title: How to convert the latex file into postscript file

text: I have faced one problem. Actually, I'm working on `IEEE` paper, and they said that I have to convert my `.tex` files into postscript file How can I get postscript file? I'm working with WinEdt 8.0 version Should I convert first my `.jpg` figures into `.eps` format by using Photoshop, or it is not necessary step? For figures, I use the following code:               \begin{figure}         \centering         \includegraphics[scale=0.3, angle=0]{Files/xxx.jpg}         \caption[xxx xxxxxx xxxxx.]{xxx xxxxxx xxxxx.}         \label{fig1}     \end{figure}      Everything work perfect with me .. I can get `.pdf` file .. But `.ps` file still I don't how to find it


title: How can I make my tex file (created in WinEdt) compatible with Scientific WorkPlace?

text: I have always used WinEdt as a LaTeX Editor and I love it. However, a colleague of mine uses Scientific WorkPlace, and apparently the `.tex` file created by WinEdt is not compatible with Scientific WorkPlace (it does not compile the file which in WinEdt is compiled with no errors). I had similar issues with another colleague who uses TeXnicCenter. Does anyone know who can be done in order to fix these problems? How can I modify my `.tex` file (in WinEdt) in order to make sure that Scientific WorkPlace (or another LaTeX editor, such as TeXnicCenter) can effectively compile it with no errors?


title: Distinguish even/odd pages in header with oneside option

text: See the MWE below. How can I achieve (in the standard `book` class) that despite the `oneside` option odd and even pages are distinguished in the header? I would like to have that, also with oneside printing, the header of odd pages displays the chapter while the header of even pages displays the section, just as it would be the case without the oneside option.               \documentclass[oneside]{book}          \usepackage{lipsum}     \usepackage{fancyhdr}          \usepackage[       a4paper,                                           textwidth=16cm,                                    outer=2cm,       textheight=45\baselineskip,       headheight=\baselineskip,       includehead=true,% Default       heightrounded,     ]{geometry}          \pagestyle{fancy}     \fancyhead{}     \fancyhead[LO]{\leftmark}     \fancyhead[RE]{\rightmark}     \fancyhead[LE,RO]{\thepage}     \renewcommand{\headrulewidth}{0pt}     \fancyfoot{}          \begin{document}          \chapter{Chapter One}     \section{Section One of Chapter One}     \lipsum     \lipsum     \section{Section Two of Chapter One}     \lipsum     \lipsum          \end{document}


title: Transforming a list with xparse

text: I would like to be able to turn a list `A,B,C` into `A \\\ B \\\ C`, where A, B, C are LaTeX expressions. It would be quite simple to do with a package like `xstring`, but for the possibility that A, B or C contain a comma. So I thought of using `xparse`,writing some code like `{>{\SplitList{,}}m}`. Unfortunately not only it didn't work, but even trying such a simple thing as:               \DeclareDocumentCommand\foo%     {>{\SplitList{,}}m}%     {\ProcessList{#1}{#1 X}     .......................     \foo{a,b,c}      just produces: ![enter image description here](http://i.stack.imgur.com/cs4zB.png) I expected `aXbXcX`. I really don't understand what's happening, nor what `ProcessList` does. Another problem is that up to now, I've no idea how to indicate the replacement of the separating commas with newline commands.


title: List of glossaries not displaying

text: I am using the following code for the list of glossaries, but the list of glossaries do not generate (the code compiles well). Can anybody suggest what may be the problem?               \documentclass{article}     \usepackage[colorlinks]{hyperref}     \usepackage[acronym]{glossaries}     \makeglossaries     \begin{document}     \newglossaryentry{utc}{Coordinated Universal Time}     \newglossaryentry{adt}{Atlantic Daylight Time}     \newglossaryentry{est}{Eastern Standard Time}          The code is for testing the glossaries list.          \printglossaries     \end{document}


title: Kile creates special character in empty cells for tables

text: I am using Kile as a Latex editor, and I particularly like the Tabular Wizard. However, when a cell has an empty value, Kile adds a special character, a pink `×`. When I try to compile the document into pdf format, I then have errors because this special character that supposedly represents empty cells is not known in UTF-8. Currently I am replacing the special characters with white spaces, but I believe this solution is flimsy at best. How can I fix this?


title: Changing parameters of specific bar in a bar chart using tikz

text: at the moment, i draw the following bar chart:               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \definecolor{ref}{rgb}{0.65,0.65,0.65} %{0.4,0.8,0.85}     \definecolor{lhmm}{rgb}{0.9,0.6,0.5}     \definecolor{ghmm}{rgb}{0.7,0.9,0.35}     \definecolor{lsvm}{rgb}{0.9,0.8,0.25}     \definecolor{gsvm}{rgb}{0.4,0.8,0.9}          \pgfplotsset{compat=1.9}          \begin{document}          \begin{tikzpicture}[font=\sffamily\scriptsize]     \pgfkeys{         /pgf/number format/precision=1,          /pgf/number format/fixed zerofill=true         }     \begin{axis}[         ybar,         bar width=.2cm,         enlargelimits=0.09,         legend style={at={(0.5,1.15)},         anchor=north,legend columns=-1},         xlabel={Demonstration},         ylabel={Recall [\%]},         width=0.9\linewidth,         height=0.9\linewidth,         symbolic x coords={1,2,3,1+2,1+3,2+3,1+2+3},         xtick=data,         nodes near coords,         nodes near coords align={vertical},         every node near coord/.append style={color=black, rotate=67.5, anchor=center, font=\tiny, xshift=7, yshift=3}     ]          \addplot [fill=lhmm] coordinates {(1,37.5) (2, 43.8) (3, 62.5) (1+2, 62.5) (1+3, 62.5) (2+3, 62.5) (1+2+3, 62.5)}; % ,postaction={pattern=north east lines}     \addplot [fill=ghmm] coordinates {(1,43.8) (2, 50.0) (3, 68.8) (1+2, 75.0) (1+3, 75.0) (2+3, 75.0) (1+2+3, 75.0)};     \addplot [fill=lsvm]coordinates {(1,81.3) (2, 93.8) (3, 93.8) (1+2, 93.8) (1+3, 93.8) (2+3, 93.8) (1+2+3, 93.8)};     \addplot [fill=gsvm]coordinates {(1,87.5) (2, 100.0) (3, 100.0) (1+2, 100.0) (1+3, 100.0) (2+3, 100.0) (1+2+3, 100.0)};          \legend{L-HMM,G-HMM,L-SVM,G-SVM}     \end{axis}     \end{tikzpicture}          \end{document}      The resulting chart is what I want with one exception: There are several bars where I would like to draw an additional pattern instead of only filling the bars. For example I would like to have north east lines for the `(2, 100.0)` entry. Is that possible? Greetings, Simon.


title: How to set the same slide number for all slides in the `allowframebreaks` group?

text: I have `[framebreaks]` frames in a Beamer presentation. I want to have all generated slides there to have the same slide nubmber, e.g., if I have a `listing` or some text that spans across two or more slides, but within the same frame I want to prevent slide number increase until I start a new frame. In the MWE below "Slide 1" should be numbered 1/2 for the first 3 PDF slides, whereas "Slide 2" should be 2/2. Using `\addtocounter{framenumber}{-1}` or `\setcounter{framenumber}{x}` simply starts counting at current-1 or x. I am aware of this post, but unless I am missing something, I don't see how I can adapt the material there to my problem at this hour. ## MWE               \documentclass{beamer}       \mode<presentation>          \usetheme{Boadilla}     \usepackage{lipsum}          \begin{document}          % "Slide 1"     \begin{frame}[allowframebreaks]     \begin{itemize}      \item Foo       \item Bar      \item Baz     \end{itemize}     \lipsum[1-5]     \end{frame}          % "Slide 2"     \begin{frame}     test     \end{frame}          \end{document}


title: Sorting list with etoolbox

text: I would like make a listing of shortseries fields in my .bib file. I see `etoolbox` can help make to made a list of themes and to loop on them. My idea is :   * for each entry, add the shortseries and series fiels to a list when the entry is cited.   * loop to this list at end But I would like sort this list by alphabetic order. For example, my list could be : `CCSA, BHG`, and I would like this be `BHG, CCSA`


title: What's the difference between \usepackage{ngerman} and \usepackage[ngerman]{babel}

text: Is there something additional that `\usepackage[ngerman]{babel}` does that a simple `\usepackage{ngerman}` won't be able to do?


title: Retrieve em-width from another font

text: I’m trying to align verbatim segments with their outputs. Consider this MWE:               \documentclass{article}     \usepackage{lmodern}     \usepackage{fancyvrb}     \DefineVerbatimEnvironment{IVerbatim}{Verbatim}{xleftmargin=2em, gobble=2}          \begin{document}     Here is some verbatim text, indented by 2em:          \begin{IVerbatim}       Do \textit{something}!     \end{IVerbatim}          Now here is its result, indented by 2em:          \begin{quote}       Do \textit{something}!     \end{quote}          How can I get them to align?         \end{document}      Both the `quote` & the `IVerbatim` environments are indented by 2em; the trouble is that the em of the LMRoman font is wider than the em of the LMMono font. (Correction: As mentioned in the accepted answer, the `quote` environment is actually indented by 2.5 em.) How can I set the indent of my `IVerbatim` segments to be 2em of the roman font? This needs to be something I can plug into the line `xleftmargin=〈` _`something`_`〉`.


title: Make a two column with one column image and other text

text: How do I make a two column minisection in my latex document where the left hand column would be an image and the right hand column would be some accompanying text?


title: tikz-qtree mangles edge anchors in trees

text: > **Possible Duplicate:**   >  tikz-qtree spoils tikz trees When I draw a tree using TikZ, for example               \documentclass{article}      \usepackage{tikz}     \begin{document}       \tikzset{every node/.style={draw,circle}}       \begin{tikzpicture}         \node {}           child { node {} }           child { node {} };       \end{tikzpicture}     \end{document}      I get this: ![enter image description here](http://i.stack.imgur.com/yhbMb.png) However, if I also load the package `tikz-qtree` the edges are anchored differently and, arguably, worse: ![enter image description here](http://i.stack.imgur.com/mPVGB.png) How can I get around this? I'd like to use `qtree` but I also want the trees to look nice.


title: Center some lines within an alignat environment nested in subequations environment

text: For typesetting a mathematical program I use the subequations environment to number the equations. The restrictions are aligned using the alignat environment (see MWE1). What I would like to achieve is that the objective equation should be centred just the way it is centred in the equation environment, but without effecting the alignment of the restriction equations (desired alignment see MWE2). The problem with MWE2 is the wrong vertical spacing between the objective equation and the `s.t.`line and the wrong numbering of the objective equation which should be the same as in MWE1. Nonsense math. program as MWE1:               \documentclass{article}          \usepackage{mathtools}               \begin{document}     \begin{subequations}     \begin{alignat}{3}         \shortintertext{Objective Function:}                                                         \min x                                              \\         \shortintertext{s.t.:}                                                         &   \sum_{p \in P} (x_p + x_p) x_{a, m, l}                                      && \leq M       & \qquad &  , \forall p \in P           \\                                                                                &   \sum_{q \in Q} x_q x_{a, m, l}                                      && \leq M       & \qquad &  , \forall q \in Q     \end{alignat}     \end{subequations}          \end{document}      Nonsense math. program as MWE2:               \documentclass{article}          \usepackage{mathtools}               \begin{document}     \noindent Objective Function:     \begin{equation}     \min x           \end{equation}     \begin{subequations}     \begin{alignat}{3}         \shortintertext{s.t.:}                                                         &   \sum_{p \in P} (x_p + x_p) x_{a, m, l}                                      && \leq M       & \qquad &  , \forall p \in P           \\                                                                                &   \sum_{q \in Q} x_q x_{a, m, l}                                      && \leq M       & \qquad &  , \forall q \in Q     \end{alignat}     \end{subequations}          \end{document}


title: Creating new commands inside the bibfile

text: Is it possible to create a new command by `\newcommand` or `\def` " **inside** " the .bib-file? I am using LuaLaTeX and biblatex and organize my bibliography with BibDesk on a mac. I also store information about reprints of paper x in collection y. I add this information in the `Addendum`-field of biblatex by something like               \bibstring{reprintin}\intitlepunct\addspace\citeauthor{author:1986}\labelnamepunct\addspace\citetitle{author:1986}\addcomma\space\citeyear{author:1986}      etc. For that I had to define some bibstrings in the preamble fo the .tex-files:               \NewBibliographyString{reprintin}     \DefineBibliographyStrings{american}{         reprintin = {Reprint in},         }     \DefineBibliographyStrings{british}{         reprintin = {Reprint in},         }     \DefineBibliographyStrings{german}{         reprintin = {Nachdruck in},         }     \DefineBibliographyStrings{ngerman}{         reprintin = {Nachdruck in},         }      I now would like to create a newcommand `\bibreprintin` that allows me to just prompt in the addendum-field `\bibreprintin{author:1986}` instead of entering the above code `bibstring{reprintin} ...`. Thereby I'd enable myself to change the look of the reprint-information later with "one click" should it become necessary later, and also make it safe that all reprint information for all publications in my bibliorgaphy look the same. My question now is, if there is any possibility to use commands like `\def`, `\newcommand`, and `\NewBibliographyString` _inside_ the .bib-file (for this is only one file) and not just inside every single .tex-file (for these are many different files I am working on).


title: Adding an underline to the word "Abstract" in \abstract?

text: To meet the requirements of the university, I need to be able to underline the word Abstract in my dissertation? Can anyone provide me with some guidance on how best to do this using the `apa6` class? Thanks in advance for your help.


title: What to do with derived font name longer than 29 characters?

text: When installing the MinionPro package from ctan I receive the following error after running the convert.sh script:               Creating PostScript fonts ...     warning: derived font name ‘MinionPro-SemiboldCnItCaptLCDFJ’ longer than 29   characters     (Use the ‘--name’ option to supply your own name.)     warning: derived font name ‘MinionPro-SemiboldCnItDispLCDFJ’ longer than 29 characters     (Use the ‘--name’ option to supply your own name.)     warning: derived font name ‘MinionPro-SemiboldCnItSubhLCDFJ’ longer than 29 characters     (Use the ‘--name’ option to supply your own name.)      What is the appropriate way do handle this error? I have also tried the FontPro package from https://github.com/sebschub/FontPro and it results in the same message.


title: Undefined Control Sequence : \caption@ifamsclass {%

text: Using pdfTeX Version 3.1415926-1.40.10 (TeX Live 2009/Debian). Something in the `subfig` package is causing this error. E.g. compiling               \documentclass{article}     \usepackage{subfig}          \begin{document}     Hi.     \end{document}      results in the error               ! Undefined control sequence.     l.202 \caption@ifamsclass                              {%      Here's the relevant part of the `log` file from this attempted compilation:               (/usr/share/texmf-texlive/tex/latex/subfig/subfig.sty     Package: subfig 2005/06/28 ver: 1.3 subfig package          (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty     Package: keyval 1999/03/16 v1.13 key=value parser (DPC)     \KV@toks@=\toks14     )     (/usr/share/texmf/tex/latex/caption.sty     Package: caption 2013/05/02 v3.3-89 Customizing captions (AR)          (/usr/share/texmf-texlive/tex/latex/caption/caption3.sty     Package: caption3 2009/10/09 v3.1k caption3 kernel (AR)     \captionmargin=\dimen103     \captionmargin@=\dimen104     \captionwidth=\dimen105     \caption@indent=\dimen106     \caption@parindent=\dimen107     \caption@hangindent=\dimen108     )          LaTeX Warning: You have requested, on input line 45, version                    `2013/05/01' of package caption3,                    but only version                    `2009/10/09 v3.1k caption3 kernel (AR)'                    is available.          ! Undefined control sequence.     l.202 \caption@ifamsclass                              {%      Some have pointed out that there is something wrong with the install of TeX Live. Any thoughts on what I can do to resolve this?


title: how to set the canvas and font size in TikZ?

text: I am using TikZ to draw standalone pictures using the `PreviewEnvironment` (which cuts the PDF size around the picture). I then import the PDF figure inside LaTeX using `\includegraphics`. Let say my font size in LaTeX is 12pt. I want to bring in a PDF figure with a good looking size and such that the size of the text in the figure and LaTeX text are same. For this I need to determine and set   1. the Canvas size (width and highs of the figure in mm),   2. the font size,  in the TikZ. How can I do that? * * * Thank you all who responded. I tried to play around with your suggestions. * ** _The idea is to create a standalone TikZ code for some drawing, such that you can create proper PDF files of any given size from that and import them in any LaTeX document. The pictures should have 1) an adjustable test (font) size ( to set based on your main document), 2) independent of the text size, an adjustable line thickness (to change for an optimum visual presentation) and, of course, 3) adjustable bounding box (i.e. scaling coordinates, distance between objects, or anything except 1 and 2) *_** Now as you start drawing a picture, you do not know what values you should choose for your objects and what would be the dimensions of the output PDF as a result. I start choosing most of the values (radius of circles etc) to be 1cm and at the end I look at File>Properties, and the dimension of the PDF is 234mm*142mm! Now I cannot go back to change all those values, so I will have to scale this. If you use \usetikzpiture[scale=0.2], it will not scale line thickness, and you will have to change this manually. If you use \pgftransformscale or \resizebox that scales everything, making the text too small too. If you use \path [use as bounding box], that just crops the pdf and you have to change everything to make sure it fits inside (specially later on when re-drawing the picture at a different dimension). **So in short, you want to set font size, line thicknesses, and bounding box dimensions independent of each other. Then I can adjust the same picture in various sizes all look ok with proper text size.** The easiest way I can think of is to set a variable, linethickness, at the beginning to adjust line widths and then use scale=... to scale the picture. I set the font size in the documentclass. Since I am new to TikZ, I do not know if I am doing things correctly. Maybe standalone PDFs are not a good idea and better to use Tikz code inside latex directly. Thank you


title: Table with subfloatrows shifted to the right?

text: I'm trying to have multiple small tables, each of a different vertical size, over two rows. The major problem that I've been trying to solve is to align the tables at the top and the captions below them. From documentation and Google results I've cobbled together a mostly working version using subfig and floatrow, but I run into an odd problem when the tables are too wide: they suddenly shift to the right on the page. Here's as close to a MWE (largely from the floatrow docs, mistakes mine) as I can get, showing it working properly and then shifted:               \documentclass[11pt]{article}     \usepackage{subfig}     \usepackage[heightadjust=all,valign=t]{floatrow}     \usepackage{fr-subfig}     \usepackage{lscape}     \begin{document}          \begin{table}     \floatbox{table}[\FBwidth]{\caption{Here's a caption}\label{tbl:table}}     {\begin{subfloatrow}     \subfloat[t1]{         \begin{tabular}{cc}                 a & b \\                  c & d \\                 e & f         \end{tabular}}     \subfloat[t2]{         \begin{tabular}{cc}                 a & b \\                  c & d         \end{tabular}}     \subfloat[t3]{         \begin{tabular}{cc}                 abasdfsaabasdfsaabasdfsa & babasdfsa \\                  cabasdfsa & dabasdfsa         \end{tabular}}          \end{subfloatrow}          \begin{subfloatrow}     \subfloat[t4]{         \begin{tabular}{cc}                 a & b \\                  c & d          \end{tabular}}     \subfloat[t5]{         \begin{tabular}{cc}                 a & b \\                  c & d \\                 e & f \\                 g & h         \end{tabular}}     \end{subfloatrow}}     \end{table}               \begin{table}     \floatbox{table}[\FBwidth]{\caption{Here's a caption}\label{tbl:table2}}     {\begin{subfloatrow}     \subfloat[t1]{         \begin{tabular}{cc}                 aabasdfsa & babasdfsa \\                  cabasdfsa & dabasdfsa \\                 eabasdfsa & fabasdfsa         \end{tabular}}     \subfloat[t2]{         \begin{tabular}{cc}                 aabasdfsa & babasdfsa \\                  cabasdfsa & dabasdfsa         \end{tabular}}     \subfloat[t3]{         \begin{tabular}{cc}                 abasdfsaabasdfsaabasdfsa & babasdfsa \\                  cabasdfsa & dabasdfsa         \end{tabular}}          \end{subfloatrow}          \begin{subfloatrow}     \subfloat[t4]{         \begin{tabular}{cc}                 a & b \\                  c & d          \end{tabular}}     \subfloat[t5]{         \begin{tabular}{cc}                 a & b \\                  c & d \\                 e & f \\                 g & h         \end{tabular}}     \end{subfloatrow}}     \end{table}     \end{document}      The results look like: ![enter image description here](http://i.stack.imgur.com/dEhJF.png) Also, you've probably noticed that the table numbering is completely wrong. I'm sure I'm just making a bunch of n00b mistakes here; any thoughts on how to fix this?


title: Is it possible to typeset text inside math without amsmath?

text: Is it possible to typeset text properly inside math without `amsmath`? Typically I typeset short text using `mathrm`, or `text` (amsmath) within equation:               $M_\mathrm{effective mass}$     $M_\text{effective mass}$      `\mathrm` works most of the time but is not a real text environment (for example the spaces are ignored as in math mode). On the other hand `\text` depends on `amsmath`. The question is, is possible to create the same result as with `text` but without using `amsmath`?


title: vspace has no effect in parcolumns

text: I have following template for my resume wherein I am trying to get rid of the space between two education fields (space between two university entries, this causes my resume to go to second page). The code that I use is as belows:               \documentclass[a4paper,20pt]{article}          \usepackage[total={6.5in,8.75in}, top=1.2in, left=0.9in]{geometry}     \usepackage{fancyhdr}     \usepackage{hyperref}     \usepackage{parcolumns}          \pagestyle{fancy}     % Remove page numbers     \fancyfoot{}          \setlength{\headheight}{28pt}     \chead{%       \fontsize{20.74pt}{24pt}\selectfont{}%       Name\\%       \fontsize{8pt}{9.6pt}\selectfont{}%       Address, Phone Number, etc.; %       \href{mailto:mail@gmail.com}{\nolinkurl{mail@gmail.com}}; %       \href{http://www.google.com}{WWW}%     }     \renewcommand{\headrulewidth}{0.4pt}          \begin{document}     \begin{parcolumns}[nofirstindent, colwidths={1=.15\linewidth}]{2}       \colchunk[1]{%       EDUCATION\\*       \\*       \\*       \\*       }       \colchunk[2]{%       \textbf{University of XXX, XXX}\hfill 2011 - 2013 (Expected)\\*       Master of Science, Computer Science, 4.0/4.0\\*       \\*       \textbf{University of YYY, YYY}\hfill 2005 - 2009\\*       Bachelor of Technology, Computer Science, 10.0/10.0       }     \end{parcolumns}     \end{document}      which produces following pdf: ![pdf](http://i.stack.imgur.com/aCJ8V.jpg) I tried putting in `\vspace{<some-num>mm}` between two university entries so as to reduce the gap, but `\vspace` has no effect. Can somebody help me with this? Thanks!


title: Avoiding "\Url Error ->\url used in a moving argument." in a custom environment

text: I have a document I'm trying to render using two classes -- my university's dissertation `.cls`, and `tufte-latex` (my uni's styleguide is ugly, and I want to make a pretty-print version for my own gratification). I've written a shim for `tufte-latex`'s `\sidefig` command, which reads like so:               \newenvironment{sidefig}%     {\begin{figure}}%     {\end{figure}}%      This works, except in the case where I need to use `\url` inside `\caption`, to cite an image source, ie:               \begin{sidefig}       \centering       \includegraphics[width=1.5in]{graphics/foobar}       \caption{This is the foobar graphic. Source: \url{http://foo.bar/baz} \label{fig:foobar}}     \end{sidefig}      This renders fine through `tufte-latex`'s own `sidefig` environment, but errors with the following error text using my shim.               [1] <graphics/foobar.png, id=34, 233.07076pt x 310.761pt>     <use graphics/foobar.png>     ! Undefined control sequence.     \Url Error ->\url used in a moving argument.           l.36 ...p://foo.bar/baz} \label{fig:foobar}}      Any idea how I can modify my shim environment to avoid this error?


title: How to specify documentclass option for a 5 inch * 7 inch book?

text: I wanted to use Latex to make a book. But not in A4 size. I want it in 5 inch * 7 inch. The standard size for a novel. In `\documentclass[a4paper]{book}`, is there anything that can replace 'a4paper' which will help me to achieve this? Or will I have to manually set all the margins and spaces?


title: Anyone recognize the difference between these two pdf's?

text: The following are the ends of two pdfs. The first comes from using lua to copy the the pdf file at the end of `stop_run`. For some reason the pdf is not complete and I'm curious as to what is missing.               /Author()/Title()/Subject()/Creator(LaTeX with hyperref package)/Producer(LuaTeX-0.70.1)/Keywords()     /CreationDate (D:20120513193853-05'00')     /ModDate (D:20120513193853-05'00')     /Trapped /False     /PTEX.Fullbanner (This is LuaTeX, Version beta-0.70.1 (MiKTeX 2.9 64-bit) (MiKTeX 2.9 64-bit) MiKTeX 2.9 64-bit)     >>     endobj     xref     0 127     0000000004 65535 f      0000036280 00000 n      0000036300 00000 n      0000036320 00000 n      0000000005 00000 f      0000000006 00000 f      0000000007 00000 f      0000000008 00000 f      0000000009 00000 f      0000000010 00000 f      0000000011 00000 f      0000000012 00000 f      0000000013 00000 f      0000000014 00000 f      0000000015 00000 f      0000000016 00000 f      0000000017 00000 f      0000000018 00000 f      0000000019 00000 f      0000000000 00000 f      0000000015 00000 n      0000011764 00000 n      0000099912 00000 n      0000000061 00000 n      0000000093 00000 n      0000011818 00000 n      0000099838 00000 n      0000000141 00000 n      0000000172 00000 n      0000011873 00000 n       The second pdf: (This one works)               /Author()/Title()/Subject()/Creator(LaTeX with hyperref package)/Producer(LuaTeX-0.70.1)/Keywords()     /CreationDate (D:20120513193853-05'00')     /ModDate (D:20120513193853-05'00')     /Trapped /False     /PTEX.Fullbanner (This is LuaTeX, Version beta-0.70.1 (MiKTeX 2.9 64-bit) (MiKTeX 2.9 64-bit) MiKTeX 2.9 64-bit)     >>     endobj     xref     0 127     0000000004 65535 f      0000036280 00000 n      0000036300 00000 n      0000036320 00000 n      0000000005 00000 f      0000000006 00000 f      0000000007 00000 f      0000000008 00000 f      0000000009 00000 f      0000000010 00000 f      0000000011 00000 f      0000000012 00000 f      0000000013 00000 f      0000000014 00000 f      0000000015 00000 f      0000000016 00000 f      0000000017 00000 f      0000000018 00000 f      0000000019 00000 f      0000000000 00000 f      0000000015 00000 n      0000011764 00000 n      0000099912 00000 n      0000000061 00000 n      0000000093 00000 n      0000011818 00000 n      0000099838 00000 n      0000000141 00000 n      0000000172 00000 n      0000011873 00000 n      0000099727 00000 n      0000000220 00000 n      0000000248 00000 n      0000011928 00000 n      0000099653 00000 n      0000000301 00000 n      0000000334 00000 n      0000022956 00000 n      0000099566 00000 n      0000000387 00000 n      0000000420 00000 n      0000023010 00000 n      0000099492 00000 n      0000000473 00000 n      0000000502 00000 n      0000029023 00000 n      0000099380 00000 n      0000000548 00000 n      0000000582 00000 n      0000029078 00000 n      0000099306 00000 n      0000000630 00000 n      0000000661 00000 n      0000029134 00000 n      0000099219 00000 n      0000000709 00000 n      0000000751 00000 n      0000029189 00000 n      0000099132 00000 n      0000000799 00000 n      0000000841 00000 n      0000029245 00000 n      0000099045 00000 n      0000000889 00000 n      0000000931 00000 n      0000035898 00000 n      0000098958 00000 n      0000000979 00000 n      0000001021 00000 n      0000035953 00000 n      0000098871 00000 n      0000001069 00000 n      0000001111 00000 n      0000036009 00000 n      0000098784 00000 n      0000001159 00000 n      0000001201 00000 n      0000036065 00000 n      0000098710 00000 n      0000001249 00000 n      0000001291 00000 n      0000011540 00000 n      0000011983 00000 n      0000001339 00000 n      0000011655 00000 n      0000011710 00000 n      0000097844 00000 n      0000098129 00000 n      0000097987 00000 n      0000098553 00000 n      0000023229 00000 n      0000022786 00000 n      0000012129 00000 n      0000022901 00000 n      0000098411 00000 n      0000023064 00000 n      0000023119 00000 n      0000098271 00000 n      0000023174 00000 n      0000029301 00000 n      0000028849 00000 n      0000023399 00000 n      0000028966 00000 n      0000036121 00000 n      0000035723 00000 n      0000029447 00000 n      0000035841 00000 n      0000036373 00000 n      0000036418 00000 n      0000036575 00000 n      0000036600 00000 n      0000037058 00000 n      0000037342 00000 n      0000050232 00000 n      0000050548 00000 n      0000057585 00000 n      0000057810 00000 n      0000078817 00000 n      0000079244 00000 n      0000086440 00000 n      0000086665 00000 n      0000097580 00000 n      0000098635 00000 n      0000100024 00000 n      0000100556 00000 n      0000100594 00000 n      0000100720 00000 n      trailer     << /Size 127     /Root 125 0 R     /Info 126 0 R     /ID [<A6C811DA4863FFFD68DAFA1EFD261EB1> <A6C811DA4863FFFD68DAFA1EFD261EB1>] >>     startxref     101047     %%EOF      I'm trying to understand what is not being finalized in the copy'ed pdf to try and fix it. My guess it is something going on with the hyperref package?


title: Is there a good way to generate FDA Form 1572?

text: I'm looking for an alternative to the web form: http://www.fda.gov/downloads/AboutFDA/ReportsManualsForms/Forms/UCM074728.pdf I've never made my own template so might be nice to learn it now. Though will have to figure out how to implement their 'Continuation Page' functionality: it's just a button you click for more pages.


title: Equation summary

text: I am writing a book for my students and I wish, at the end of each chapter, do a summary of all important equations from that chapter (with its equation number, actual formula, and a little explanation about it -- somewhat like "Clapeyron Ideal Gas Equation"). Is there some easy manner of do that. Or I will need to be crazy with labels, copy-pasting, and so on?


title: Appendix and alphabetic appendix number problem

text: In the following MWE `\appendix` doesn't change the section numbering to `Alph`:               \documentclass{book}          \newcommand*{\appheading}[1][Mathematical Appendix]{\setcounter{secnumdepth}{-1}%       \chapter{#1}\setcounter{secnumdepth}{2}}          \begin{document}          \frontmatter     \tableofcontents          \mainmatter     \chapter{Foo}          \appheading     \appendix     \section{Bar}           \end{document}


title: Wrapper around xdef to check for conflicts

text: How can I write transparent wrapper around `xdef` that, depending on package options, report error, override or obey previous definition without sacrificing all flexibility? I have no idea how to pass all this `#` in. EDIT: Example what I can do and what I want to do:               %% This is not valid. xdef have different syntax.     %% \ifpackage@force\xdef\package@define\xdef\fi     \ifpackage@obey\xdef\package@define\providecommand\fi     \ifpackage@err\xdef\package@define\newcommand\fi      So I can have generic interface for `providecommand` and `newcommand`. I want add checking in `xdef`.


title: Solid sphere with a cylindrical hole through center (bead shaped solid)

text: I am trying to draw a _solid_ sphere with a cylindrical drilled through its center. The best I have been able to do is: ![enter image description here](http://i.stack.imgur.com/fADDx.png) which does not show it is solid. How do I make it more _solid_ in appearance? ## Notes:   * The code is adapted from Strange problems in 3D-Plots TikZ: Missing parts and axes   * Besides a nice color version, I also need to be able to copy this in black and white so if you have suggestions on that, that would be helpful as well.   * Eventually need to be able to label the two radii: the sphere's and the cylinder's. ## Code:               \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[width=\textwidth,       samples=25,domain=0:360,y domain=-60:60,       xmin=-1.2,xmax=1.2,ymin=-1.2,ymax=1.2,zmin=-1.2,zmax=1.2,       xlabel={$x$},ylabel={$y$},zlabel={$z$},       axis lines=none]     \addplot3[surf,opacity=0.5]       ({cos(x)*cos(y)}, {sin(x)*cos(y)}, {1.5*sin(y)});     \end{axis}     \end{tikzpicture}     \end{document}


title: How can I resize the page that a wide table can fit?

text: I am trying to make this table to fit on my page with those sizes: non- standard paper size: width 28 cm, height 20 cm.Margins be set exactly in order to have the area available for text 27.5 cm wide and 18 cm high. My code looks like this:               \documentclass[a4paper,10pt]{article}     \usepackage[papersize=29cm,total=28.5cm]{geometry}     \usepackage{csvtools}     \usepackage{ifthen}     \usepackage{datatool}          \setlength{\parindent}{0cm}               \begin{document}     \begin{center}       {\Large \normalfont Services from Willesden Junction Underground Station towards Elephant \& Castle Underground Station}                   \CSVtolongtable{data.csv}{c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c}{       \hline\hline       \multicolumn{20}{|l|}{Monday--Friday}\\       \hline \hline       \bfseries \begin{tabular}{c}5 to\\6am\end{tabular} &       \bfseries \begin{tabular}{c}6 to\\7am\end{tabular} &       \bfseries \begin{tabular}{c}7 to\\8am\end{tabular} &       \bfseries \begin{tabular}{c}8 to\\9am\end{tabular} &       \bfseries \begin{tabular}{c}9 to\\10am\end{tabular} &       \bfseries \begin{tabular}{c}10 to\\11am\end{tabular} &       \bfseries \begin{tabular}{c}11 to\\Midday\end{tabular} &       \bfseries \begin{tabular}{c}Midday\\to 1pm\end{tabular} &       \bfseries \begin{tabular}{c}1 to\\2pm\end{tabular} &       \bfseries \begin{tabular}{c}2 to\\3pm\end{tabular} &       \bfseries \begin{tabular}{c}3 to\\4pm\end{tabular} &       \bfseries \begin{tabular}{c}4 to\\5pm\end{tabular} &       \bfseries \begin{tabular}{c}5 to\\6pm\end{tabular} &       \bfseries \begin{tabular}{c}6 to\\7pm\end{tabular} &       \bfseries \begin{tabular}{c}7 to\\8pm\end{tabular} &       \bfseries \begin{tabular}{c}8 to\\9pm\end{tabular} &       \bfseries \begin{tabular}{c}9 to\\10pm\end{tabular} &       \bfseries \begin{tabular}{c}11 to\\Midnight\end{tabular} &       \bfseries \begin{tabular}{c}Midnight\\to 1am\end{tabular}            \\ \hline}     {%                \ifthenelse{\equal{\insertbyname{w5}}{}}{\insertbyname{w5}&}{{\bf 05} \insertbyname{w5} &}           \ifthenelse{\equal{\insertbyname{w6}}{}}{\insertbyname{w6}&}{{\bf 06} \insertbyname{w6} &}           \ifthenelse{\equal{\insertbyname{w7}}{}}{\insertbyname{w7}&}{{\bf 07} \insertbyname{w7} &}           \ifthenelse{\equal{\insertbyname{w8}}{}}{\insertbyname{w8}&}{{\bf 08} \insertbyname{w8} &}           \ifthenelse{\equal{\insertbyname{w9}}{}}{\insertbyname{w9}&}{{\bf 09} \insertbyname{w9} &}           \ifthenelse{\equal{\insertbyname{w10}}{}}{\insertbyname{w10}&}{{\bf 10} \insertbyname{w10} &}           \ifthenelse{\equal{\insertbyname{w11}}{}}{\insertbyname{w11}&}{{\bf 11} \insertbyname{w11} &}           \ifthenelse{\equal{\insertbyname{w12}}{}}{\insertbyname{w12}&}{{\bf 12} \insertbyname{w12} &}           \ifthenelse{\equal{\insertbyname{w13}}{}}{\insertbyname{w13}&}{{\bf 13} \insertbyname{w13} &}           \ifthenelse{\equal{\insertbyname{w14}}{}}{\insertbyname{w14}&}{{\bf 14} \insertbyname{w14} &}           \ifthenelse{\equal{\insertbyname{w15}}{}}{\insertbyname{w15}&}{{\bf 15} \insertbyname{w15} &}           \ifthenelse{\equal{\insertbyname{w16}}{}}{\insertbyname{w16}&}{{\bf 16} \insertbyname{w16} &}           \ifthenelse{\equal{\insertbyname{w17}}{}}{\insertbyname{w17}&}{{\bf 17} \insertbyname{w17} &}           \ifthenelse{\equal{\insertbyname{w18}}{}}{\insertbyname{w18}&}{{\bf 18} \insertbyname{w18} &}           \ifthenelse{\equal{\insertbyname{w19}}{}}{\insertbyname{w19}&}{{\bf 19} \insertbyname{w19} &}           \ifthenelse{\equal{\insertbyname{w20}}{}}{\insertbyname{w20}&}{{\bf 20} \insertbyname{w20} &}           \ifthenelse{\equal{\insertbyname{w21}}{}}{\insertbyname{w21}&}{{\bf 21} \insertbyname{w21} &}           \ifthenelse{\equal{\insertbyname{w22}}{}}{\insertbyname{w22}&}{{\bf 22} \insertbyname{w22} &}           \ifthenelse{\equal{\insertbyname{w23}}{}}{\insertbyname{w23}&}{{\bf 23} \insertbyname{w23} &}           \ifthenelse{\equal{\insertbyname{w24}}{}}{\insertbyname{w24}}{{\bf 24} \insertbyname{w24} }          \\     }     {           \ifthenelse{\equal{\insertbyname{w5}}{}}{\insertbyname{w5}&}{{\bf 05} \insertbyname{w5} &}           \ifthenelse{\equal{\insertbyname{w6}}{}}{\insertbyname{w6}&}{{\bf 06} \insertbyname{w6} &}           \ifthenelse{\equal{\insertbyname{w7}}{}}{\insertbyname{w7}&}{{\bf 07} \insertbyname{w7} &}           \ifthenelse{\equal{\insertbyname{w8}}{}}{\insertbyname{w8}&}{{\bf 08} \insertbyname{w8} &}           \ifthenelse{\equal{\insertbyname{w9}}{}}{\insertbyname{w9}&}{{\bf 09} \insertbyname{w9} &}           \ifthenelse{\equal{\insertbyname{w10}}{}}{\insertbyname{w10}&}{{\bf 10} \insertbyname{w10} &}           \ifthenelse{\equal{\insertbyname{w11}}{}}{\insertbyname{w11}&}{{\bf 11} \insertbyname{w11} &}           \ifthenelse{\equal{\insertbyname{w12}}{}}{\insertbyname{w12}&}{{\bf 12} \insertbyname{w12} &}           \ifthenelse{\equal{\insertbyname{w13}}{}}{\insertbyname{w13}&}{{\bf 13} \insertbyname{w13} &}           \ifthenelse{\equal{\insertbyname{w14}}{}}{\insertbyname{w14}&}{{\bf 14} \insertbyname{w14} &}           \ifthenelse{\equal{\insertbyname{w15}}{}}{\insertbyname{w15}&}{{\bf 15} \insertbyname{w15} &}           \ifthenelse{\equal{\insertbyname{w16}}{}}{\insertbyname{w16}&}{{\bf 16} \insertbyname{w16} &}           \ifthenelse{\equal{\insertbyname{w17}}{}}{\insertbyname{w17}&}{{\bf 17} \insertbyname{w17} &}           \ifthenelse{\equal{\insertbyname{w18}}{}}{\insertbyname{w18}&}{{\bf 18} \insertbyname{w18} &}           \ifthenelse{\equal{\insertbyname{w19}}{}}{\insertbyname{w19}&}{{\bf 19} \insertbyname{w19} &}           \ifthenelse{\equal{\insertbyname{w20}}{}}{\insertbyname{w20}&}{{\bf 20} \insertbyname{w20} &}           \ifthenelse{\equal{\insertbyname{w21}}{}}{\insertbyname{w21}&}{{\bf 21} \insertbyname{w21} &}           \ifthenelse{\equal{\insertbyname{w22}}{}}{\insertbyname{w22}&}{{\bf 22} \insertbyname{w22} &}           \ifthenelse{\equal{\insertbyname{w23}}{}}{\insertbyname{w23}&}{{\bf 23} \insertbyname{w23} &}           \ifthenelse{\equal{\insertbyname{w24}}{}}{\insertbyname{w24}}{{\bf 24} \insertbyname{w24} }     \\     }     \end{center}     \end{document}      The output is like this: ![enter image description here](http://i.stack.imgur.com/CnofC.png) And it suppose to be like this: ![enter image description here](http://i.stack.imgur.com/2c1gB.png) How can I resize the page that the table will fit? And also is this the right way to add the heading?(`Services from Willesden Junction Underground Station towards Elephant \& Castle Underground Station`) I have to say that I am using csvtool package to read a .csv file to create based on it a timetable for a bus station.


title: Can filecontents write an external file in a parent directory?

text: Reading Are there any disadvantages of TeX being Turing complete? got me thinking about the potential of .tex files for harbouring malicious code. The `filecontents` package is used to write external files from within a LaTeX document. According to my tests, it can be used to write external files in an existing path _down_ the directory tree. In other words, it can create a file in the directory in which the input .tex file is located, or in any of its subdirectories. For instance, the following code works as expected,               \documentclass{article}          \usepackage{filecontents}          \begin{filecontents*}{./myfolder/myfile.txt}     Hello World     \end{filecontents*}          \begin{document}     test     \end{document}      as long as > ./myfolder is a valid path (i.e. the "myfolder" subdirectory already exists): **Is writing an external file _up_ the directory tree possible?** All of my attempts so far have been unfruitful. I'm guessing that it's not possible; otherwise, that would represent a potentially very malicious exploit, without even requiring `\--shell-escape`; malevolent people would have used that exploit long before I asked myself this question, and LaTeX would have become infamous for it. So, is writing an external file _up_ the directory tree possible or not? If the answer is yes, how do you do it? If the answer is no, what exactly forbids it?


title: Adjust font size in imported pgf

text: I generate plots with Matlab and would like to export them to a Latex based report. I found the matfig2pgf script pretty cool, since it adjusts to the document font. One problem I have though, is that the standard font size is way too large for the legend entries and exceeds the box. I found that the entries are generated through a \pgftext class, but could not find an option to change the applied font size. Is there a way to do that? Axis label etc are fine in my 12pt, just need the legend to be set to 10pt. Thanks for your help!


title: problem to automatically generate a glossary by XeLaTeX

text: I want to generate a glossary at the end of a document automatically, but the following code did not work. In fact no glossary was created. I am using XeLaTeX to compile a tex file in Mac TexLive environment. Here is the code:               \documentclass[oneside, a4paper,12pt]{book}          \usepackage[xindy]{glossaries}     \makeglossaries          \begin{document}     \include{glossary}          He has a \gls{computer}.          \appendix     \bibliographystyle{plainnat}     \bibliography{bibtex}     \printglossaries     \end{document}      The glossary.tex file contains:               \newglossaryentry{computer}     {       name=computer,       description={is a programmable machine that receives input, and provides output in a useful format}     }      Thanks in advance for your help.


title: Add an exit sign / running person?

text: What is the simplest way to add a running person, similar to the one to the right in this image in my body text? ![exit sign, running man](http://i.stack.imgur.com/VaGMT.png) I cannot find any appropriate unicode glyph or LaTeX symbol. Do I need to include a picture or draw something with tikz?


title: Lowering two expressions in an equation

text: \documentclass[11pt]{article}     \usepackage{xfrac, array, tabu, multirow, graphicx, setspace, dcolumn, tikz}     \usepackage[fleqn]{mathtools}     %the argument for d specifies the maximum number of decimal places     \usepackage[ngerman]{babel}     \usepackage[applemac]{inputenc}     \begin{document}     \begin{align}     \text{Z}&= \sum\frac{{(\text{y}_\text{i}_\text{z}-\bar{\text{y}}})}{\text{s}_\text{y}\_text{i}}\\     \end{align}     \end{document}      I want to lower two expressions, in this case y (lower i) and even lower z. Thanks in advance for some help


title: repstopdf issue on Cygwin

text: Environment: Cygwin with Cygwin Ports packages enabled for `doxygen`/`graphviz`/`mscgen`/`texlive-latex`/`texlive-latex-extras`. Configuration: `doxygen` is configured to generate LaTeX output and I have PDF output via `pdflatex`. The refman.pdf is generated but is lacking some When building this documentation, `repstopdf` is called from the build process, even though `repstopdf` has been removed from the packages. `sh: repstopdf: command not found` The epstopdf-sys.cfg contains something that looks like a redirection from `epstopdf` to `repstopdf`.               % Public domain.     % History:     % 2010/06/06 v1.2     % 2010/07/13 v1.3     % * Use `epstopdf' instead of `repstopdf' if \pdfshellescape == 1     %     \ProvidesFile{epstopdf-sys.cfg}%       [2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live]%     \def\epstopdf@sys@cmd{repstopdf}% default is restricted epstopdf     % epstopdf-sys loads pdftexcmds, \pdf@shellescape is provided     % for LuaTeX as well     \begingroup\expandafter\expandafter\expandafter\endgroup     \expandafter\ifx\csname pdf@shellescape\endcsname\relax     \else       \ifcase\pdf@shellescape       \or         \def\epstopdf@sys@cmd{epstopdf}% unrestricted if \pdfshellescape == 1       \fi     \fi     \epstopdfsetup{%       program@epstopdf=\epstopdf@sys@cmd     }%     \endinput      Apparently somewhere else the command line arguments are changed to use `repstopdf` args so simply changing repstopdf to epstopdf doesn't work. Does anyone else build LaTeX docs in Cywgin with this toolchain?


title: Why does not \centering work on a table, while \begin{center} does?

text: I cannot get my grips around the different effects of \begin{center} and \centering when used on tables (not inside tables). The MWE should explain the issue clearly:               \documentclass{article}     \begin{document}          \begin{center}     \begin{tabular}{ll}     \\     \emph{Definite benefit} & \emph{Definite cost} \\     Self-respect & Expense \\     \\     \emph{Possible benefit} & \emph{Probable cost} \\     Compensation & Trauma \\     \\     \end{tabular}     \end{center}          works to center, but not          {\centering     \begin{tabular}{ll}     \\     \emph{Definite benefit} & \emph{Definite cost} \\     Self-respect & Expense \\     \\     \emph{Possible benefit} & \emph{Probable cost} \\     Compensation & Trauma \\     \\     \end{tabular}     }          Why?          \end{document}      ![First table centered, the other one not.](http://i.stack.imgur.com/vaDNf.png)


title: Error adding smartdiagram

text: I have encountered the following error when trying to use `smartdiagram` > "! Package smartdiagram Error: I did not find the smartdiagram library > 'core.definitions'.." Here is MWE:               \documentclass{article}     \usepackage{smartdiagram}          \begin{document}     \smartdiagram[flow diagram]{Awesome, awesome, awesome}     \end{document}      I am using TeXstudio and have MiKTeX. I believe another user (@percusse) has also encountered the same error.


title: Parallel lines on a grid and circle best practices?

text: I am a TeX/LaTeX noob, but I am learning rapidly. I am about to attempt to draw the following figure using LaTeX/TeX/TikZ I already have a, (I think) good working knowledge of how to draw circles, braces, lines, segments, and nodes, etc. The last time I drew one though, I noticed that I spent a lot of time fine tuning parameters, making sure that lines intersected circles at the proper points, making sure lines were parallel, etc. I need to draw the following figure, so I wanted first inquire if there is a fast/easy way, or anything I should keep in mind, when creating parallel lines (the red ones), as per the following figure: ![enter image description here](http://i.stack.imgur.com/wStHy.jpg) The main time sinks I foresee are going to be the following:   1. Making sure the length of the purple lines are exactly correct, so as not to overshoot the red ones.    2. Making sure the red lines are all parallel to each other.    3. Making sure than I can draw nodes/dots where lines intersect each other and/or the circle.  Is there any particular way(s) that is recommended to make sure that the above points do not waste too much time? I would appreciate any advice/examples. Thanks! P.S. I am making good use of TikZ as well. **EDIT:** I am including a minimal example of my 'skill' set. As you can see, I painstakingly usually just have to fine tune co-ordinates, for where things intersect, etc. I also do not know how to not-waste-time if I wanted to make parallel lines, as shown in the red lines above. Here is my example code:               \documentclass[journal]{IEEEtran}     \usepackage{graphicx}     \usepackage{float}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{tikz}     \usetikzlibrary{matrix}     \usetikzlibrary{decorations.pathreplacing}     \usepackage{xspace}      \usepackage{float}     \usepackage{capt-of}     \usepackage{cases}                    \begin{document}          \newcommand{\var}{1.5}          \begin{tikzpicture}     %\begin{tikzpicture}              \draw [help lines] (-4,-4) grid (4,4);              % Draw the axes         \draw [->,black, ] (-4,0) -- (4,0) ;         \draw [->,black] (0,-4) -- (0,4) ;              % Draw the circle         \path [draw, ultra thick,  black] (0,0) circle (3);              %Radial Lines             \draw[black](0:0)--(45:3);         \draw[black](0:0)--(135:3);         \draw[black](0:0)--(225:3);         \draw[black](0:0)--(315:3);                      %Wavefront normal         \draw[blue](0:0)--(60:3);         \draw[blue](0:0)--(240:3);              \draw[blue](0,1) arc (90:60:1);         \draw[blue] (0,0.95)arc(90:60:0.95);         \node[] at (75:1.2)  {$\alpha$};              \draw[blue] (0.7,1.2)arc(90:30:0.37);         %\node[] at (50:2) {$\frac{pi}{4}-\alpha$};         \draw[-latex](1.5,3)node[right]{$\frac{\pi}{4}-\alpha$}             to[out=180,in=90] (50:1.5);              %Points         \path[fill, black](45:3) circle(0.1);         \node[] at (45:3.3){1};         \path[fill, black](135:3) circle(0.1);         \node[] at (133:3.3){4};         \path[fill,black](225:3) circle(0.1);         \node[] at (225:3.3){3};         \path[fill, black](315:3) circle(0.1);         \node[] at (313:3.3){2};              %Wavefronts         \draw[blue, ultra thick](-.5,3.6347)--(3.5,1.3252);         \draw[blue, ultra thick](-2.5,2.34)--(3.5,-1.1242);         \draw[blue, ultra thick](-3.2,0.9509)--(2.8,-2.5132);         \draw[blue, ultra thick](-3.2,-1.4985)--(0.2,-3.4615);              %Right angle signs         \draw[red](60:2.8)--(62:2.8)--(62:2.9);         \draw[red](60:.68)--(68:.69)--(67:.79);                             % Done     \end{tikzpicture}               \end{document}      The above code is now giving me this: ![enter image description here](http://i.stack.imgur.com/Ia78J.png)


title: How do I put list of figures and list of tables on separate pages?

text: When I put `\usepackage{tocloft}` in the preamble the pages that had list of figures and list of tables have been shifted forward. List of figures now starts on the contents page and list of tables starts on the list of figures page.


title: How to share a one column figure with two column text on same page

text: I am writing an article that is composed of a two column body. But on one page, I want a figure that takes up both columns at the top and below I want to continue writing in two column text. So far I have,               \newpage     \onecolumn     \subsection{Pumped Hydro}          \begin{figure}[h!]     \includegraphics[scale=0.75]{operatingprincipal.jpg}     \caption{Pumped Hydro}     \end{figure}     \twocolumn      {text goes here}      what happens here is the text continues on the next page, leaving about 3/4 of a page of blank space below the figure. Any help would be appreciated.


title: Improve PSTricks code for drawing of a general, regular polygon

text: Consider the following example. **Code**               % pdflatex -shell-escape test.tex          \documentclass{article}          \usepackage{auto-pst-pdf,pst-eucl,pst-poly,pstricks-add}     \usepackage[locale=DE]{siunitx}          \ExplSyntaxOn       \cs_new_eq:NN         \calc       \fp_eval:n     \ExplSyntaxOff          \def\OuterRadius{\calc{\SideLength/(2*sin(pi/\NoSides))}}     \def\RelativeAngle{\calc{360/\NoSides}}     \def\Rotation{\calc{\RelativeAngle/2}}     \def\Area{\calc{1/4*\NoSides*\SideLength^2*cot(pi/\NoSides)}}          \begin{document}          \begin{figure}     % Parameters     \def\NoSides{8}     \def\SideLength{60}     \psset{unit=0.05cm}     \begin{pspicture}(-\OuterRadius,-\OuterRadius)(\OuterRadius,\OuterRadius)       \pscircle(0,0){\OuterRadius}       \rput(0,0){%         \PstPolygon[           PolyNbSides=\NoSides,           PolyRotation=\Rotation,           unit=\OuterRadius,           linewidth=2\pslinewidth         ]       }       \multido{\rA=0+\RelativeAngle,\iA=1+1}{\NoSides}{%         \psRelNode[angle=\rA](0,0)%           (!180 \NoSides\space div cos \OuterRadius\space mul             180 \NoSides\space div sin \OuterRadius\space mul){1}{P\iA}       }      \psset{linewidth=0.5\pslinewidth,RightAngleSize=5}       \rput(0,0){$A \approx \SI[round-mode=places,round-precision=0]{\Area}{\square\m}$}       % The (really) bad code starts here.       \pcline[linestyle=dashed,offset=-8pt]{|-|}(P2)(P1)       \ncput*[nrot=:U]{\SI{\SideLength}{\m}}       \psRelLine[linestyle=none](P8)(P1){2}{S'}       \psRelLine[linestyle=none](P3)(P2){2}{S''}       \psIntersectionPoint(P1)(S')(P2)(S''){S}       \pstRightAngle[linestyle=dotted]{P1}{S}{P2}       \pcline[linestyle=dotted](P1)(S)       \pcline[linestyle=dashed,offset=-8pt]{|-|}(P1)(S)       \ncput*{$x$}       \pcline[linestyle=dotted](P2)(S)       \pcline[linestyle=dashed,offset=8pt]{|-|}(P2)(S)       \ncput*{$x$}       \psRelLine[linestyle=none](P2)(P3){2}{T'}       \psRelLine[linestyle=none](P5)(P4){2}{T''}       \psIntersectionPoint(P3)(T')(P4)(T''){T}       \pstRightAngle[linestyle=dotted]{P3}{T}{P4}       \psline[linestyle=dotted](P3)(T)(P4)       \psRelLine[linestyle=none](P4)(P5){2}{U'}       \psRelLine[linestyle=none](P7)(P6){2}{U''}       \psIntersectionPoint(P5)(U')(P6)(U''){U}       \pstRightAngle[linestyle=dotted]{P5}{U}{P6}       \psline[linestyle=dotted](P5)(U)(P6)       \psRelLine[linestyle=none](P6)(P7){2}{V'}       \psRelLine[linestyle=none](P1)(P8){2}{V''}       \psIntersectionPoint(P7)(V')(P8)(V''){V}       \pstRightAngle[linestyle=dotted]{P7}{V}{P8}       \psline[linestyle=dotted](P7)(V)(P8)     \end{pspicture}     \end{figure}          \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/3O6qS.jpg) **Question** I have the desired output but the code is not very elegant. The problem is (especially) to simplify the code giving the dotted lines and the right angle marks around the octagon. **Update** Code:               % pdflatex -shell-escape test.tex          \documentclass{article}          \usepackage{auto-pst-pdf,pst-node,multido}     \usepackage[locale=DE]{siunitx}          \ExplSyntaxOn       \cs_new_eq:NN \calc \fp_eval:n     \ExplSyntaxOff          \begin{document}          \begin{figure}[htbp]     \centering     % Parameters.     \def\NoSides{5 }     \def\SideLength{60 }     % Help.     \def\OR{\calc{\SideLength/(2*sin(pi/\NoSides))}}     \def\Area{\calc{1/4*\NoSides*\SideLength^2*cot(pi/\NoSides)}}     \edef\dAngle{\the\numexpr360/\NoSides}     \def\IR{\calc{1/2*\SideLength*cot(pi/\NoSides)}}     \def\LabelLine(#1)(#2)#3#4#5{%       \pcline[linestyle=dashed,offset=#3]{|-|}(#1)(#2)       \ncput*[nrot=#4]{#5}     }     \psset{unit=0.5mm}     \begin{pspicture}(-\OR,-\OR)(\OR,\OR)      \pstVerb{/R \SideLength 180 \NoSides div sin 2 mul div def}       \pscircle(0,0){!R }       \multido{\iA=\numexpr\dAngle/2+\dAngle,\iB=0+1}{\NoSides}{%         \pcline[linewidth=2pt](!R \iA\space PtoC)(!R \iA\space \dAngle\space add PtoC)         \ifnum\iB=0            \LabelLine(!R \iA\space \dAngle\space add PtoC)%                     (!R \iA\space PtoC)%                     {-8pt}{:U}{\SI{\SideLength}{\m}}           \LabelLine(!R \iA\space \dAngle\space add PtoC)%                     (!R \iA\space \dAngle\space add PtoC exch pop \OR\space exch)%                     {8pt}{0}{$x$}           \LabelLine(!R \iA\space PtoC)%                     (!R \iA\space PtoC pop \OR)%                     {-8pt}{0}{$y$}         \fi       }      \psset{linestyle=dotted}       \psframe(-\IR,-\IR)(\IR,\IR)       \rput(-\IR,-\IR){\psframe(5,5)}       \rput(!-\IR\space \IR\space 5 sub){\psframe(5,5)}       \rput(!\IR\space 5 sub -\IR){\psframe(5,5)}       \rput(!\IR\space 5 sub \IR \space 5 sub){\psframe(5,5)}       \rput(0,0){$A \approx \SI[round-mode=places,round-precision=0]{\Area}{\square\m}$}     \end{pspicture}     \end{figure}          \end{document}      Output: ![enter image description here](http://i.stack.imgur.com/jFDAE.jpg) Problems: I would like   * the polygon (here, pentagon) to be completely inside the dotted square,   * the dashed lines with the `x` and `y` labels to be placed as on Jubobs' TikZ solution. **Update 2** After Herbert's changes: ![enter image description here](http://i.stack.imgur.com/0glxq.jpg)   * I would like the "upper" dashed line to be horizontal,   * The polygon is still not completey inside the square. If the problem in the second bullet is fixed, the problem in the first one will be fixed automatically (I think). **Update 3** Here is how I would like the square to be ![enter image description here](http://i.stack.imgur.com/6k83Y.jpg) (In the picture above, the square is drawn manually.)


title: Semantic table markup with environments inside {tabular}

text: I run into issues trying to markup tables semantically in LaTeX. # Background Either standard `\hline` together with `\firsthline` and `\lasthline` from `array.sty` (I think) or `\midrule`, `\toprule` and `\bottomrule` from recommended `booktabs.sty` visually structure tables (or rather tabulars). They’re not truly semantic markup, though. For that, one would identify header, footer and (possibly multiple) bodies as is done in HTML with `<thead>`, `<tfoot>` and `<tbody>` respectively. Neither header nor footer should be confused with the caption, but in LaTeX that’s unlikely anyhow, because there’s an intuitively named macro `\caption` for that and it is only available for floating tables by default as it should be. The footer also is not the place for local footnotes (cf. the second mandatory parameter of `\ctable` or the `tablenotes` environment in `threeparttable.sty`). Instead, the footer usually contains rows with column sums and the like. The header most often contains column labels in its cells, which may be arranged hierarchically over several rows. The left-most and right-most columns may have roles similar to the top-most and bottom-most rows, but since tabulars in LaTeX (like HTML) are arranged vertically first that’s hard to encode. Nevertheless, due to the mandatory way columns are defined with `tabular` it’s actually easier to apply some styling to all cells in a column than to a cells in a row. It’s the other way around in HTML+CSS. You sometimes want the same tables to look quite different in two setups, e.g. a beamer presentation (`\mode<presentation>`) and its handout (`\mode<article>`). Therefore it makes sense to mark it up semantically and specify the styling per mode. I asked about that in `tabular` styled like blocks in `beamer` based upon `booktabs` markup, but did not get an answer. # Questions   1. What kind of markup should I use (out of the ones described below)?   2. How can I do it with environments instead of commands? I’m afraid the answer to 1. is “environments” (i.e. the final variant), but at the same time the answer to 2. is ”you cannot”. ## Patched tabular environment               \documentclass{scrartcl}     \usepackage{booktabs}          \let\oldtabular\tabular     \let\oldendtabular\endtabular     \renewcommand\tabular[1]{\oldtabular{#1}\toprule}     \renewcommand\endtabular{\bottomrule\oldendtabular}     \newcommand\tpart{\midrule}          \begin{document}     \begin{tabular}{ll}     Header & Header \\     \tpart     Body & Body \\      Body & Body \\     \tpart     Body & Body \\     \tpart     Footer & Footer \\     \end{tabular}     \end{document}      This simple approach works, but doesn’t show much explicit semantics. ## Semantic table parts as switches               \documentclass{scrartcl}     \usepackage{booktabs}          \newcommand{\tHead}{\toprule}     \newcommand{\tFoot}{\midrule}     \newcommand{\tBody}{\midrule}         \newcommand{\tEnd}{\bottomrule}          \begin{document}     \begin{tabular}{ll}     \tHead     Header & Header \\     \tBody     Body & Body \\ Body & Body \\     \tBody     Body & Body \\     \tFoot     Footer & Footer \\     \tEnd     \end{tabular}     \end{document}      This kind of aliasing does “work”, but requires an additional command `\tEnd`. This seems just wrong. ## Patched `tabular` with semantic table parts as switches               \documentclass{scrartcl}     \usepackage{booktabs}          \let\oldtabular\tabular     \let\oldendtabular\endtabular     \renewcommand\tabular[1]{\oldtabular{#1}\toprule}     \renewcommand\endtabular{\bottomrule\oldendtabular}     \newcommand{\tHead}{}     \newcommand{\tFoot}{\midrule}     \newcommand{\tBody}{\midrule}              \begin{document}     \begin{tabular}{ll}     \tHead     Header & Header \\     \tBody     Body & Body \\ Body & Body \\     \tBody     Body & Body \\     \tFoot     Footer & Footer \\     \end{tabular}     \end{document}      This method combines the two described above and thus disposes of `\tEnd`. ## Semantic table parts as macros with single parameters               \documentclass{scrartcl}     \usepackage{booktabs}          \newcommand{\Thead}[1]{\toprule #1 \midrule}     \newcommand{\Tfoot}[1]{#1 \bottomrule}     \newcommand{\Tbody}[1]{#1 \midrule}              \begin{document}     \begin{tabular}{ll}     \Thead{ Header & Header \\}     \Tbody{ Body & Body \\ Body & Body \\}     \Tbody{ Body & Body \\}     \Tfoot{ Footer & Footer \\}     \end{tabular}     \end{document}      This does work, but the commands can receive very long arguments so it’s easy to lose track of the closing curly brace or what it belongs to. ## Single table macros with multiple parameters               \documentclass{scrartcl}     \usepackage{booktabs}          %% \Tabular{header}{body}{footer}     \newcommand{\Tabular}[3]{%       \toprule #1 \midrule #2 \midrule #3 \bottomrule}               \begin{document}     \begin{tabular}{ll}     \Tabular%     { Header & Header \\}%     { Body & Body \\ Body & Body \\}%     { Footer & Footer \\}     \end{tabular}     \end{document}      This allows only a single table body. ## Semantic table parts as environments               \documentclass{scrartcl}     \usepackage{booktabs}          \newenvironment{thead}{\toprule}{\midrule}     \newenvironment{tfoot}{}{\bottomrule}     \newenvironment{tbody}{}{\midrule}          \begin{document}     \begin{tabular}{ll}     \begin{thead} Header & Header \\ \end{thead}     \begin{tbody} Body & Body \\ Body & Body \\ \end{tbody}     \begin{tbody} Body & Body \\ \end{tbody}     \begin{tfoot} Footer & Footer \\ \end{tfoot}     \end{tabular}     \end{document}      This is my preferred approach but it does not work and I don’t know why exactly. Environments inside `tabular`, especially when they shall contain multiple cells or – as in this case – even rows seem problematic in general. This is why I ask question 2.


title: Two-column text-figure layout with memoir

text: I am new to the memoir documentclass, and I'm attempting to learn it to typeset some lecture notes. I would like for the lecture notes to have a single column of text on the left of each page, and a single column for accompanying figures on the right of each page. Is there a nice, simple way to accomplish this in memoir?


title: Vertical orientation landscape page in a PDF output file

text: I'm using the `lscape` environment to produce landscape pages in my LaTeX document for pages that have large figures or tables, so that my page numbering is in the right place when it comes to printing etc. However, the `\begin{landscape} ... \end{landscape}` code has the consequence of putting the landscape pages as landscape in the PDF document, when all the other pages are in the portrait orientation. Is there a way to have the landscape pages put in the same orientation as the rest of the pages in the document for the PDF output?               \documentclass[12pt,a4paper]{report}     \usepackage{lscape}     \begin{document}     \pagenumbering{arabic}     \chapter{Title 1}     \begin{landscape}     \centering     Text here.     \end{landscape}     \chapter{Title 2}     \end{document}      The above code outputs to a pdf as shown on the left of the image below, I would like to achieve the output shown on the right. Many thanks ![enter image description here](http://i.stack.imgur.com/xcLlz.png)


title: Margin notes on the wrong page when using landscape in memoir

text: I have tried several similar to the following code, but the best that I can get is the `marginpar` on one side and the `figure` in the following. The first `\marginpar{\lipsum[11]}\lipsum[1]` is positioned as expected while the second `\marginpar{\lipsum[11]}`, inside afterpage, does not.               \documentclass[a4paper,11pt]{memoir}     \usepackage{afterpage}     \usepackage{amsfonts,amsmath,amssymb,amsthm}     %\usepackage[utf8]{inputenc}%\usepackage[T1]{fontenc}     \usepackage[italian]{babel}     \usepackage{emptypage}     \usepackage{eucal}\usepackage[showframe]{geometry}     \usepackage{latexsym}\usepackage{lmodern}     \usepackage{mathrsfs}\usepackage{newlfont}     \usepackage{lscape}%\usepackage{pdflscape}     \usepackage{lipsum}\usepackage{tikz}     \usepackage{hyperref}          \setstocksize{297mm}{210mm}     \settrimmedsize{297mm}{210mm}{*}     \settypeblocksize{252mm}{150mm}{*}     \setlrmarginsandblock{20mm}{40mm}{*}     \setulmarginsandblock{20mm}{25mm}{*}     \setheadfoot{10mm}{10mm}     \setmarginnotes{5mm}{30mm}{2\onelineskip}     \checkandfixthelayout          \begin{document}          \frontmatter          \tableofcontents          \listoffigures          \mainmatter          \chapter{Chapter}          \marginpar{\lipsum[11]}\lipsum[1]%% works correctly          \afterpage{%%     \marginpar{Again: \lipsum[11]}%% goes one page before the figure     \begin{landscape}     \begin{figure}     \centering\includegraphics[width=1.55\textwidth]{image.pdf}     \caption{Caption}\label{img01}     \end{figure}     \end{landscape}     }%%          \end{document}      What I would like to achieve is just a "simple" landscape page with one picture and a brief text comment in the fore margin. And then to write more such pages. I have tried to manage the `marginpar` (or `marginnote`) in relation to afterpage/landscape in several ways now, is there a way to fix this syntax? Or a completely different approach would be better? PS: sorry, since you need any image.pdf to make mine a MWE. * * * ## Addendum: Is this problem related to afterpage or landscape? Substituting `\afterpage{...}` with the following, I get always the same: note on the recto page and figure on the corresponding verso page.               \newpage%%\clearpage          %\afterpage{%%     %\begin{landscape}     \marginpar{Ancora: \lipsum[11]}     \begin{figure}     \centering\includegraphics[angle=90,width=\textwidth]{image.pdf}     \caption{Caption}\label{img01}     \end{figure}     %\end{landscape}     %}%%          \newpage%%\clearpage      What I obtain is always very similar to page 2 and 3 in the following image, while I would like contents of pages 2 and 3 to be on the same page. This misbehaviour happens also with - e.g. - `width=.15\textwidth`: so I'm thinking it's not even a matter of "top of the marginnote aligned to the top of the figure". Thank you. ![enter image description here](http://i.stack.imgur.com/pDKJh.png)


title: Problem with subcaptions in subtables

text: I am trying to implement a table with several `subtable`s, but working with `subcaption` does not work neither when I try `tabularx`. This `subtables` have different number of columns. with the following code the tables are not _equal_ in width.               \begin{table}[ht]     \caption{Earnings Surprise and Cumulated Returns}     \resizebox{\textwidth}{!}{\begin{threeparttable}     \begin{tabular}{@{\extracolsep{4pt}}lcccccccccc@{}}     \hline\hline      & \multicolumn{3}{c}{N}  & \multicolumn{3}{c}{mean} & \multicolumn{2}{c}{N} & \multicolumn{2}{c}{mean}  \\     \cline{2-4}  \cline{5-7}  \cline{8-9}  \cline{10-11}      & SUE1 & SUE2 & SUE3 & SUE1 & SUE2 & SUE3 & CASC & BHAR & CASC & BHAR \\ [1ex]     \hline     AAA & 731 & 731 & 613 & 0.0004 & 0.0004 & 0.0104 & 688 & 726 & 0.0002 & -0.0084 \\     A & 3865 & 3865 & 3455 & -0.0013 & -0.0007 & 0.0002 & 3424 & 3827 & 0.0003 & 0.0027 \\     BBB & 6308 & 6313 & 5711 & -0.0017 & -0.0009 & 0.0000 & 5512 & 6252 & 0.0003 & 0.0060 \\     NIG & 3166 & 3172 & 2825 & 0.0006 & 0.0019 & -0.0054 & 2685 & 3080 & 0.0000 & 0.0148 \\ [1ex]     All & 14070 & 14081 & 12604 & -0.0010 & -0.0001 & -0.0007 & 12309 & 13885 & 0.0002 & 0.0063 \\ [1ex]     Investment-Grade & 10904 & 10909 & 9779 & -0.0014 & -0.0007 & 0.0007 & 9624 & 10805 & 0.0003 & 0.0039 \\     Speculative-Grade & 3166 & 3172 & 2825 & 0.0006 & 0.0019 & -0.0054 & 2685 & 3080 & 0.0000 & 0.0148 \\ [1ex]     \hline     \end{tabular}     \bigskip     \begin{tabular}{@{\extracolsep{4pt}}lcccccccccc@{}}     \hline\hline      & \multicolumn{3}{c}{N}  & \multicolumn{3}{c}{mean} & \multicolumn{2}{c}{N} & \multicolumn{2}{c}{mean}  \\     \cline{2-4}  \cline{5-7}  \cline{8-9}  \cline{10-11}      & SUE1 & SUE2 & SUE3 & SUE1 & SUE2 & SUE3 & CASC & BHAR & CASC & BHAR \\ [1ex]     \hline     2004 & 1747 & 1748 & 1487 & 0.0023 & 0.0031 & 0.0006 & 1342 & 1741 & -0.0003 & 0.0214 \\     2005 & 1727 & 1728 & 1513 & 0.0022 & 0.0009 & 0.0006 & 1420 & 1707 & -0.0002 & 0.0066 \\     2006 & 1646 & 1648 & 1473 & 0.0002 & 0.0015 & 0.0011 & 1431 & 1624 & 0.0002 & 0.0045 \\     2007 & 1594 & 1595 & 1427 & -0.0085 & -0.0075 & -0.0039 & 1329 & 1573 & 0.0014 & -0.0136 \\     2008 & 1545 & 1545 & 1414 & -0.0303 & -0.0163 & -0.0172 & 1429 & 1527 & 0.0042 & 0.0132 \\     2009 & 1492 & 1494 & 1384 & 0.0163 & 0.0064 & 0.0011 & 1400 & 1482 & -0.0049 & 0.0297 \\     2010 & 1471 & 1473 & 1357 & 0.0115 & 0.0112 & 0.0037 & 1332 & 1458 & 0.0005 & -0.0042 \\     2011 & 1445 & 1445 & 1303 & 0.0056 & 0.0059 & 0.0048 & 1326 & 1417 & 0.0024 & -0.0108 \\     2012 & 1403 & 1405 & 1246 & -0.0076 & -0.0062 & 0.0040 & 1300 & 1356 & -0.0010 & 0.0079 \\ [1ex]     All & 14070 & 14081 & 12604 & -0.0010 & -0.0001 & -0.0007 & 12309 & 13885 & 0.0002 & 0.0063 \\[1ex]     pre-crisis & 5120 & 5124 & 4473 & 0.0016 & 0.0019 & 0.0008 & 4193 & 5072 & -0.0001 & 0.0110 \\     crisis & 3139 & 3140 & 2841 & -0.0193 & -0.0118 & -0.0105 & 2758 & 3100 & 0.0028 & -0.0004 \\     post-crisis & 5811 & 5817 & 5290 & 0.0066 & 0.0044 & 0.0034 & 5358 & 5713 & -0.0008 & 0.0058 \\ [1ex]     \hline     \end{tabular}          \begin{tablenotes}     \footnotesize     \item This is where authors provide additional information about the data, including whatever notes are needed.     asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa     asdfasdfsfffffffffffffffffffffffffffffffffffffffffffff     asdffffffffffffffffffffffffffffffffffffffffffffffffff     asdfffffffffffffffffffffffffffffffffffffffffffffffffffff     asdffffffffffffffffffffffffffffffffffffffffffffffffffffff     asdfffffffffffffffffffffffffffffffffffffffffffffffffffffff     asdfffffffffffffffffffffffffffffffffffffffffffffffd     asdfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa     asdfasdfsfffffffffffffffffffffffffffffffffffffffffffff     asdffffffffffffffffffffffffffffffffffffffffffffffffff     asdfffffffffffffffffffffffffffffffffffffffffffffffffffff     asdffffffffffffffffffffffffffffffffffffffffffffffffffffff     asdfffffffffffffffffffffffffffffffffffffffffffffffffffffff     asdffffffffffffffffffffffffffffffffffffffffffffff     \end{tablenotes}     \end{threeparttable}}     \end{table}      Moreover, is generally possible to set the table such that the use _the maximum allowed_ size? In other words, they take the whole space no matter whether necessary or not. **Another question is** : With the present caption I get "Table 1: xyz". Would it be possible to turn it into: > TABLE 1 \ \ > > xyz


title: Biblatex Sorting Bibliography by author and afterwards numbering it by appearence in bibliography

text: I'm using `biblatex` to create a bibliography with two parts, one part for literature and one part for internet sources. Now I want to sort each bibliography by NTY. Afterwards the entries in the bibliography should be numbered from top to bottom. This should happen in both bibliographies and I want the first number of the second bibliography to be the following of the last of the first bibliography. I don't think a MWE would make sense because I don't even have a beginning of the problem.


title: how can I correct the margin space in a journal manuscript?

text: I have a problem with preparing the manuscript in the latex macro pachakge. I put the `svjour2.cls`. (Springer latex class) and `svglov2.clo` in the TEX file’s location. However, after execution, the final pdf file seems incorrect. I compared the final file to a sample paper in archive of applied mechanics journal and found some differences. For instance, the margins in top and bottom of the manuscript are too narrow and wide, respectively. Furthermore, the font size of figure’s captions and also references are equal to text body’ font size. I can’t change such parameters manually, and it should be done by the `svglov2.clo` file. I execute the template file in the macro package, which is available in the journal’s home page and it has the same problems.


title: Datatool split page vertically

text: There is a CSV file, which has 1-6 records, I need to load it and display on the letter page into two columns (each row in a column is block with all text from CSV row), right column appears only for 4-6 records, it means that at first I need to fill first column then go two the second, so using simple table is not an option (may be I'm wrong here). CSV:               field_name1, field_name2,field_name3     smth1, smth2,smth3     smthelse1,smthelse2,smthelse3     rec1,rec2,rec3     abc1,abc2,abc3     ...,...,...     ...,...,...      will be displayed as               smth1         abc1     smth2         abc2     smth3         abc3          smthelse1     ...     smthelse2     ...     smthelse3     ...          rec1          ...     rec2          ...     rec3          ...      I've tried to use `\fbox`es and `minipage`s but I get some mess as I didn't know how to count rows (to use `\DTLifeq(current_row<=3)` to filling left part for example). What is the proper way to make `\DTLforeach` properly produce such a structure?


title: 3D data plot with PSTricks

text: Consider the following example:               \documentclass{article}          \usepackage{pst-3dplot}          \begin{filecontents*}{plotting-of-3d-surface.data}     2.17    0.001   0.82044815     2.17    0.002   0.82345825     2.17    0.004   0.82679255     2.17    0.008   0.83334715     2.17    0.016   0.84395915     2.17    0.032   0.8584953     2.21    0.001   0.77582165     2.21    0.003   0.78520505     2.21    0.009   0.80205985     2.21    0.027   0.83085105     2.24    0.001   0.7227885     2.24    0.002   0.73391615     2.24    0.005   0.7543979     2.24    0.015   0.78798745     2.24    0.003   0.74176635     2.24    0.009   0.77064805     2.24    0.027   0.81042375     2.26    0.001   0.66545585     2.26    0.003   0.7012046     2.26    0.005   0.721067     2.26    0.009   0.7447984     2.26    0.015   0.76715245     2.26    0.027   0.794177     2.27    0.001   0.62916195     2.27    0.003   0.6774642     2.27    0.009   0.72961785     2.27    0.027   0.7861086     2.28    0.001   0.5750828     2.28    0.003   0.65059675     2.28    0.005   0.6802631     2.28    0.009   0.7145367     2.28    0.015   0.74447695     2.28    0.027   0.7774403     2.29    0.001   0.51357255     2.29    0.002   0.581053     2.29    0.003   0.6173075     2.29    0.009   0.6972096     2.29    0.027   0.76793225     2.31    0.001   0.36997965     2.31    0.002   0.474415     2.31    0.003   0.53649295     2.31    0.009   0.6587164     2.31    0.016   0.70870255     2.31    0.027   0.7482423     2.31    0.05    0.7912395     2.34    0.001   0.2204104     2.34    0.002   0.316308     2.34    0.003   0.39256745     2.34    0.004   0.45240835     2.34    0.009   0.5883453     2.34    0.016   0.6590771     2.34    0.027   0.71444205     2.34    0.05    0.7690014     2.38    0.001   0.13286995     2.38    0.002   0.1828288     2.38    0.004   0.2980268     2.38    0.008   0.4507145     2.38    0.016   0.58417075     2.38    0.032   0.6833616     \end{filecontents*}          \begin{document}          \begin{figure}     \centering     \readdata{\data}{plotting-of-3d-surface.data}      \begin{pspicture}       \pstThreeDCoor[xMin=2.1,xMax=2.4,yMin=0,yMax=0.1,zMin=0,zMax=1]       \fileplotThreeD{\data}      \end{pspicture}     \end{figure}          \end{document}      When I try to compile the file above from a terminal with `latex`, I get the following output:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)      restricted \write18 enabled.     entering extended mode     (./test.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge     rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi     c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis     h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis     h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h     ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma     rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,      kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,      piedmontese, polish, portuguese, romanian, romansh, russian, sanskrit, serbian     , serbianc, slovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, u     ppersorbian, welsh, loaded.     (/usr/local/texlive/2012/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/local/texlive/2012/texmf-dist/tex/latex/base/size10.clo))     (/usr/local/texlive/2012/texmf-dist/tex/latex/pst-3dplot/pst-3dplot.sty     (/usr/local/texlive/2012/texmf-dist/tex/latex/pstricks/pstricks.sty     (/usr/local/texlive/2012/texmf-dist/tex/generic/pstricks/pstricks.tex     (/usr/local/texlive/2012/texmf-dist/tex/generic/xkeyval/pst-xkey.tex     (/usr/local/texlive/2012/texmf-dist/tex/latex/xkeyval/xkeyval.sty     (/usr/local/texlive/2012/texmf-dist/tex/generic/xkeyval/xkeyval.tex     (/usr/local/texlive/2012/texmf-dist/tex/generic/xkeyval/keyval.tex))))     (/usr/local/texlive/2012/texmf-dist/tex/generic/pstricks/pst-fp.tex     `pst-fp' v0.05, 2010/01/17 (hv))     (/usr/local/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te     x)     (/usr/local/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex     (/usr/local/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.c     ode.tex))     (/usr/local/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex)     `PSTricks' v2.40  <2013/04/05> (tvz)     (/usr/local/texlive/2012/texmf-dist/tex/generic/pstricks/pstricks.con))     (/usr/local/texlive/2012/texmf-dist/tex/generic/pstricks/pst-fp.tex)     (/usr/local/texlive/2012/texmf-dist/tex/latex/xcolor/xcolor.sty     (/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/color.cfg)     (/usr/local/texlive/2012/texmf-dist/tex/latex/graphics/dvips.def)))     (/usr/local/texlive/2012/texmf-dist/tex/latex/pst-3d/pst-3d.sty     (/usr/local/texlive/2012/texmf-dist/tex/generic/pst-3d/pst-3d.tex     `PST-3d' v1.11, 2010/02/14 (tvz)))     (/usr/local/texlive/2012/texmf-dist/tex/latex/pst-plot/pst-plot.sty     (/usr/local/texlive/2012/texmf-dist/tex/latex/xkeyval/pst-xkey.sty)     (/usr/local/texlive/2012/texmf-dist/tex/latex/multido/multido.sty     (/usr/local/texlive/2012/texmf-dist/tex/generic/multido/multido.tex      v1.42, 2010/05/14 <tvz>))     (/usr/local/texlive/2012/texmf-dist/tex/generic/pst-plot/pst-plot.tex      v1.44, 2013/01/03 (tvz,hv)))     (/usr/local/texlive/2012/texmf-dist/tex/latex/pst-node/pst-node.sty     (/usr/local/texlive/2012/texmf-dist/tex/generic/pst-node/pst-node.tex      v1.25, 2012/09/21))     (/usr/local/texlive/2012/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex     (/usr/local/texlive/2012/texmf-dist/tex/generic/pst-node/pst-node.tex)     (/usr/local/texlive/2012/texmf-dist/tex/generic/multido/multido.tex      v1.42, 2010/05/14 <tvz>) `PST-3dplot' v1.97, 2012/06/07 (HV,DL)))          LaTeX Warning: File `plotting-of-3d-surface.data' already exists on the system.                    Not generating it from this source.          No file test.aux.     PSTricks error.  See User's Guide for further information.                      Type  H <return>  for immediate help.     ! Data file ` D 2.17 D 0.001 D 0.82044815 D 2.17 D 0.002 D 0.82345825 D 2.17 D      0.004 D 0.82679255 D 2.17 D 0.008 D 0.83334715 D 2.17 D 0.016 D 0.84395915 D 2.     17 D 0.032 D 0.8584953 D 2.21 D 0.001 D 0.77582165 D 2.21 D 0.003 D 0.78520505      D 2.21 D 0.009 D 0.80205985 D 2.21 D 0.027 D 0.83085105 D 2.24 D 0.001 D 0.7227     885 D 2.24 D 0.002 D 0.73391615 D 2.24 D 0.005 D 0.7543979 D 2.24 D 0.015 D 0.7     8798745 D 2.24 D 0.003 D 0.74176635 D 2.24 D 0.009 D 0.77064805 D 2.24 D 0.027      D 0.81042375 D 2.26 D 0.001 D 0.66545585 D 2.26 D 0.003 D 0.7012046 D 2.26 D 0.     005 D 0.721067 D 2.26 D 0.009 D 0.7447984 D 2.26 D 0.015 D 0.76715245 D 2.26 D      0.027 D 0.794177 D 2.27 D 0.001 D 0.62916195 D 2.27 D 0.003 D 0.6774642 D 2.27      D 0.009 D 0.72961785 D 2.27 D 0.027 D 0.7861086 D 2.28 D 0.001 D 0.5750828 D 2.     28 D 0.003 D 0.65059675 D 2.28 D 0.005 D 0.6802631 D 2.28 D 0.009 D 0.7145367 D      2.28 D 0.015 D 0.74447695 D 2.28 D 0.027 D 0.7774403 D 2.29 D 0.001 D 0.513572     55 D 2.29 D 0.002 D 0.581053 D 2.29 D 0.003 D 0.6173075 D 2.29 D 0.009 D 0.6972     096 D 2.29 D 0.027 D 0.76793225 D 2.31 D 0.001 D 0.36997965 D 2.31 D 0.002 D 0.     474415 D 2.31 D 0.003 D 0.53649295 D 2.31 D 0.009 D 0.6587164 D 2.31 D 0.016 D      0.70870255 D 2.31 D 0.027 D 0.7482423 D 2.31 D 0.05 D 0.7912395 D 2.34 D 0.001      D 0.2204104 D 2.34 D 0.002 D 0.316308 D 2.34 D 0.003 D 0.39256745 D 2.34 D 0.00     4 D 0.45240835 D 2.34 D 0.009 D 0.5883453 D 2.34 D 0.016 D 0.6590771 D 2.34 D 0     .027 D 0.71444205 D 2.34 D 0.05 D 0.7690014 D 2.38 D 0.001 D 0.13286995 D 2.38      D 0.002 D 0.1828288 D 2.38 D 0.004 D 0.2980268 D 2.38 D 0.008 D 0.4507145 D 2.3     8 D 0.016 D 0.58417075 D 2.38 D 0.032 D 0.6833616' not found..     \@pstrickserr ... immediate help.}\errmessage {#1}                                                       \endgroup      l.74   \fileplotThreeD{\data}      What do I have to do in order the get a 3D plot if the data above with PSTricks? **Update** Using Herbert's answer, I get the following plot (where the axes are ajusted and the coordinates for the `pspicture` environment are added):               \documentclass{article}          \usepackage{pst-3dplot}          \begin{filecontents*}{plotting-of-3d-surface.data}     2.17    0.001   0.82044815     2.17    0.002   0.82345825     2.17    0.004   0.82679255     2.17    0.008   0.83334715     2.17    0.016   0.84395915     2.17    0.032   0.8584953     2.21    0.001   0.77582165     2.21    0.003   0.78520505     2.21    0.009   0.80205985     2.21    0.027   0.83085105     2.24    0.001   0.7227885     2.24    0.002   0.73391615     2.24    0.005   0.7543979     2.24    0.015   0.78798745     2.24    0.003   0.74176635     2.24    0.009   0.77064805     2.24    0.027   0.81042375     2.26    0.001   0.66545585     2.26    0.003   0.7012046     2.26    0.005   0.721067     2.26    0.009   0.7447984     2.26    0.015   0.76715245     2.26    0.027   0.794177     2.27    0.001   0.62916195     2.27    0.003   0.6774642     2.27    0.009   0.72961785     2.27    0.027   0.7861086     2.28    0.001   0.5750828     2.28    0.003   0.65059675     2.28    0.005   0.6802631     2.28    0.009   0.7145367     2.28    0.015   0.74447695     2.28    0.027   0.7774403     2.29    0.001   0.51357255     2.29    0.002   0.581053     2.29    0.003   0.6173075     2.29    0.009   0.6972096     2.29    0.027   0.76793225     2.31    0.001   0.36997965     2.31    0.002   0.474415     2.31    0.003   0.53649295     2.31    0.009   0.6587164     2.31    0.016   0.70870255     2.31    0.027   0.7482423     2.31    0.05    0.7912395     2.34    0.001   0.2204104     2.34    0.002   0.316308     2.34    0.003   0.39256745     2.34    0.004   0.45240835     2.34    0.009   0.5883453     2.34    0.016   0.6590771     2.34    0.027   0.71444205     2.34    0.05    0.7690014     2.38    0.001   0.13286995     2.38    0.002   0.1828288     2.38    0.004   0.2980268     2.38    0.008   0.4507145     2.38    0.016   0.58417075     2.38    0.032   0.6833616     \end{filecontents*}          \makeatletter     \pst@def{ScalePointsThreeD}<%       counttomark dup dup cvi eq not { exch pop } if       /m exch def /n m 3 div cvi def       n {               % now we have x y z         5 mul 3 1 roll    % z          100 mul 3 1 roll  % y         3 1 roll          % x         tx@3DPlotDict begin         saveCoor         ConvertTo2D         x2D \pst@number\psxunit mul y2D \pst@number\psyunit mul          end         m 1 sub 1 roll m 1 sub 1 roll /m m 3 sub def       } repeat>     \makeatother          \pagestyle{empty}          \begin{document}          \begin{figure}[htbp]     \centering     \readdata{\data}{plotting-of-3d-surface.data}      \begin{pspicture}(-2.5,-1.3)(2.5,4)       \pstThreeDCoor[xMin=0,xMax=3,yMin=0,yMax=3,zMin=0,zMax=4]       \listplotThreeD[plotstyle=curve]{\data}      \end{pspicture}     \end{figure}          \end{document}      ![output](http://i.stack.imgur.com/fWdRI.jpg)


title: Defining \lastname from \author

text: Is it possible to read the white space in a very simple `\author` declaration? I understand that it's dangerous to expect such a thing to work very stably, but for a limited use case, I would like to be able to print the author's last name in the document header, and I'd like to keep the mechanism as simple and standard as possible. I'd like the user to define the following:               \author{First Last}      The package would then read the text after white space in `First Last` to define the following automatically:               \lastname{Last}      I understand any solution would likely break if there is a middle name or initial, for example, or if there are multiple authors. My question is now as much about my original use case as it is about what is to me an interesting problem.


title: The origin of filecontents

text: Does anyone know why the `filecontents` environment was introduced? What is the purpose of packing it all in one file, but without using a tarball?


title: Japanese and Russian Characters in the same Document

text: I'm writing a document in English. However, I need to use a few words of both Japanese and Russian. In principle, it seems to work, but as soon as I used Japanese characters, I cannot use Russian characters afterwards. Please note that it is crucial for me that the document compiles using pdflatex. Here are two minimal examples to illustrate my problem. This one works:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T2A,T1]{fontenc}     \usepackage{CJK}          \begin{document}     {\fontencoding{T2A}\selectfont ф}     \begin{CJK}{UTF8}{min}     ル     \end{CJK}     \end{document}      But this doesn't:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T2A,T1]{fontenc}     \usepackage{CJK}          \begin{document}       {\fontencoding{T2A}\selectfont ф}       \begin{CJK}{UTF8}{min}       ル       \end{CJK}       {\fontencoding{T2A}\selectfont ф}     \end{document}      I cannot figure out why. In the second case, I get this error message:               ! Undefined control sequence.     \CJK@XX ...r `#1\endcsname {`#2}\CJK@ignorespaces                                                        \fi      l.12   {\fontencoding{T2A}\selectfont ф                                             }      I cannot find any explanation and I would really appreciate any help.


title: Problems with mfplain

text: When I read the file mfplain into Metapost, I get about a dozen error messages complaining about redundant and inconsistent equations. It's hard to believe that there is really anything wrong with mfplain. Any idea what might be going wrong ? The details of the interaction are as follows:               C:\Program Files (x86)\MikTex\miktex\bin>mpost     This is MetaPost, version 1.504 (MiKTeX 2.9)     **\relax     (mpost.mp (C:/Program Files (x86)/MikTex/metapost/base/plain.mp     Preloading the plain mem file, version 1.004))     *\input mfplain     (C:/Program Files (x86)/MikTex/metapost/base/mfplain.mp     Preloading the plain base, version 0.99: preliminaries,     basic constants and mathematical macros,     macros for converting units,     ! Inconsistent equation (off by 2.77794).     <to be read again>                        ;     l.230 mm*bpppix_=2.83464;                                    pt*bpppix_=0.99626;     ?     [[ followed by a dozen or so similar messages ]]


title: subfloatrow and tabularx, wrong numbering of figure

text: I wanted to "group" a figure and a table to get one figure. It has been proposed to use `floatrow` for this, with the possibility to remove the `subcaptions` later on (subfloatrow of package floatrow does not work without subcaptions). But it seems, that the figure inside the environment will be counted (global figure number), even though it's in a `subfloatrow`! The attached example shows the same source code with `tabularx` in the beginning and `tabular` in the end. One can see that the numbering starts with 2 instead of 1!               \documentclass{article}     \usepackage{caption,subcaption,tabularx,floatrow}          % Table float box with bottom caption, box width adjusted to content     \newfloatcommand{capbtabbox}{table}[][\FBwidth]          \begin{document}     \setcounter{figure}{0}     \begin{figure}[t!]     \ffigbox{         \begin{subfloatrow}             \ffigbox{%               \rule{3cm}{3cm}%             }{%               \caption{A figure}%             }             \capbtabbox{%               \begin{tabularx}{4cm}{cc} \hline               Author & Title \\ \hline               Knuth & The \TeX book \\               Lamport & \LaTeX \\ \hline               \end{tabularx}             }{%               \caption{A table}%             }         \end{subfloatrow}         }{%           \caption{A figure and a table}%         }     \end{figure}     \end{document}      Has anybody an idea on how to prevent this? Is it a bug?


title: Writing to a file - robust commands mess the text file written

text: I'm writing some lines to a file but I've found that robust commands damages the written file. In this context `\plural` can be a fragile command but in the real application it must be robust. MWE:               \documentclass{article}     \usepackage{xifthen}     \immediate\newwrite\txtfile     \immediate\openout\txtfile=\jobname.txt     \DeclareRobustCommand{\plural}[3]{\ifthenelse{\equal{#1}{1}}{#2}{#3}}     \newcommand{\woman}[1]{#1 \plural{#1}{woman}{women}}     \begin{document}     \immediate\write\txtfile{\woman{1}}     \immediate\write\txtfile{\woman{2}}     \end{document}      I want a way in which the text file shows '1 woman' and in the next line '2 women', defining `\plural` as robust.


title: Pictures from Inkscapes pdf+LaTeX export positioned wrong in nodes

text: Sometimes I use Inkscape to add some graphical elements and text to my pictures. Inkscape allows to export this as pdf+LaTeX, where the pdf contains the picture and all graphical elements and the LaTeX file contains the text. One can then `\input{latex-file-from-inkscape}` and the picture appears with superimposed text in the document font. Internally this uses a `picture`-environment. I now tried to put the picture in a tikz node and added a drop shadow. The result is wrong as the picture appears to get indented somehow. I found out that this also happens if a simple `\fbox` is added.               \documentclass{scrartcl}     \usepackage{tikz}     \usetikzlibrary{shadows}          \begin{document}          \def\svgwidth{.5\textwidth}     \input{drawing.pdf_tex}          \def\svgwidth{.5\textwidth}     \setlength{\fboxsep}{0pt}     \fbox{\input{drawing.pdf_tex}}          \begin{tikzpicture}     \def\svgwidth{.5\textwidth}       \node[drop shadow={shadow xshift=.8ex,shadow yshift=-.8ex,opacity=0.5},     inner sep=0,     ] at (0,0) {\input{drawing.pdf_tex}};     \end{tikzpicture}          \end{document}      the picture below shows the result 1) just input the file 2) with `\fbox` 3) with tikz drop shadow ![enter image description here](http://i.stack.imgur.com/nniPV.png) The files are available here: Picture tex file


title: XeLaTeX longtable full justification with Devnagari Text

text: I am a digital publisher of Sanskrit works. I earlier used pdfLaTeX, but recently I moved to XeLaTeX. I am on Windows using MikTeX 2.9 with TeXWorks 0.4.3. As I am typesetting epic poems with long chapters (cantos) where the fullstops and verse numbers need to align to the right, and the text fully justified, I use the `longtable` environment. The `{p}` alignment I use gives the fully justified results as expected in pdfLaTeX, but not in XeLaTeX. I tried searching for a solution but did not find one. Here is a minimum working example:               \documentclass[14pt]{article}     \usepackage{fontspec}     \usepackage{array}     % \setmainfont[Script=Devanagari]{Sanskrit 2003}     % \setmainfont[Script=Devanagari]{Mangal}     \setmainfont[Script=Devanagari]{Arial Unicode MS}     \usepackage[margin=2.5cm]{geometry}     \usepackage{longtable}     \usepackage{setspace}     \begin{document}     \setcounter{secnumdepth}{-1}     \begin{singlespace}     \begin{center}     \section{{\huge ॥ प्रथमः\ सर्गः\ -\ श्रीभार्गवावतारोपक्रमः ॥}}     \parbox{90mm}{Let's see if this is aligned properly.} \\     \parbox{90mm}{And this line as well.} \\     \parbox{90mm}{सीतारामयशोमञ्जुमुक्तामोदमुदं मुदे} \\     \parbox{90mm}{वन्दे वाग्देवतानाम्नीं मरालीं मानसाश्रयाम्} \\     \fontsize{14}{16}\selectfont     \begin{longtable}{p{90mm}l}     सीतारामयशोमञ्जुमुक्तामोदमुदं मुदे & । \\[0mm]     वन्दे वाग्देवतानाम्नीं मरालीं मानसाश्रयाम् & ॥ १ ॥ \\[0mm]     प्रत्यूहव्यूहशैवोहाहारहारस्रगच्युत- & । \\[0mm]     ध्वजं वार्षध्वजं वन्दे हेरम्बं बुद्धिवल्लभम् & ॥ २ ॥ \\[0mm]     वन्दे वन्दारुवृन्दानां पारिजातपदाम्बुजौ & । \\[0mm]     प्रभाभानू इवाभिन्नौ भवानीभूतभावनौ & ॥ ३ ॥ \\[0mm]     \end{longtable}     \end{center}     \end{singlespace}     \end{document}      In the output PDF, I expect all the lines in the first column of the table (except the third one which has only one word) to align both left and right. But the lines are only aligned to the left with varying space to the right.


title: Escape moredelim in lstlisting

text: I am wondering if it is still possible to print characters chosen to be `moredelim` in `\lstdefinestyle`. It turns out that since I've defined a character as `moredelim`, it can only be used inside quotes or comments with no obvious way to escape it. Here is some code to help understanding what I mean:               % !TEX encoding = UTF-8 Unicode     \documentclass{article}     \usepackage{listings,xcolor}     \usepackage[T1]{fontenc}     \usepackage{verbatim}          \newcommand{\listingsfont}{\fontfamily{courier}}          \lstdefinestyle{test}{         language={sh},         moredelim=**[is][\color{red}]{~}{~},         basicstyle=\ttfamily,      }          \begin{document}          I want to highlight first two command arguments in the following code:     \begin{verbatim}     $ ./my-command some-dir some-dir2 some-other-argument     $ ./my-command ~/Desktop ~/Documents some-other-argument     \end{verbatim}               What I get:     \begin{lstlisting}[style=test]     $ ./my-command ~some-dir~ ~some-dir2~ some-other-argument     $ ./my-command ~"~/Desktop"~ ~~./Documents~ some-other-argument     # ~ is not shown before ./Documents because of being used in moredelim,     # but it can be still printed in comments / inside strings.     \end{lstlisting}     \end{document}      ![Escape moredelim in lstlisting](http://i.stack.imgur.com/7IUYM.png) Of course, in my simple example I can overcome the problem by using some other characters instead of ~, but when it comes to a document with several hundred pages and lots of listings, it's good to know that whatever moredelims you choose, you won't put yourself into a trap. How can I keep ~ (or any other character) as `moredelim`, but still be able to print it when needed?