title: \expandafter and counters not playing nicely

text: My google-fu has finally failed me... I'm trying to write a package that will allow you say `\addauthor{name, email}` several times and have the title page properly formatted. Here is a minimal example of my troubles:               % FILE: sd.sty     \ProvidesPackage{sd}     \newcounter{authors}     \newcommand{\@authors}{\@empty}     \newcommand{\@authorsnoemail}{\@empty}     \def\addauthor#1{\@addauthor#1\@nil}     \def\@addauthor#1,#2\@nil{%       \expandafter\def\expandafter\@authorsnoemail\expandafter{%         \@authorsnoemail%         \ifnum\value{authors}>0, \fi%         #1}       \expandafter\def\expandafter\@authors\expandafter{\@authors%         \ifnum\value{authors}=0 \else ; \fi%         #1 - #2}       \stepcounter{authors}}     \newcommand{\ane}{\@authorsnoemail}     \newcommand{\auth}{\@authors}      and then I try               % FILE: main.tex     \documentclass{article}     \usepackage{sd}          \addauthor{1, 1@1}     \addauthor{2, 2@2}     \addauthor{3, 3@3}          \begin{document}     \begin{tabular}{ll}     Expected: & 1, 2, 3 \\     Got: &  \ane\\     Expected: & 1 - 1@1; 2 - 2@2; 3 - 3@3 \\     Got: & \auth \\     \end{tabular}     \end{document}      And the output is               Expected: 1, 2, 3     Got:      , 1, 2, 3     Expected: 1 - 1@1; 2 - 2@2; 3 - 3@3     Got:      ; 1 - 1@1; 2 - 2@2; 3 - 3@3      My question is "How can I do the counter comparison properly, so that the divider will only be inserted at the second author and above?" (I included both lists since for some reason removing one makes it work... I suspect I'm doing something wrong with the `\expandafter`s)


title: Brace from {cases} environment disappears after rowcolors*{1}{...}{...}

text: I use `rowcolors*{1}{...}{...}` to color a table, then I use it again (with white as arguments) to reset the color. After that, braces look weird (they disappear slightly). If I use `scrbook`, `book`, `article` (e.g.) the above error occurs.   If I use `minimal`, the brace looks normal. Why is that, and what can I do to fix the error?               \documentclass{scrbook}     \usepackage[table]{xcolor}     \usepackage{amsmath}          \begin{document}     % rowcolors*{1}{...}{...} ommitted.     % TABLE ommited.     \rowcolors*{1}{white}{white}          \[     x =     \begin{cases}     y & z     \end{cases}     \]          \end{document}


title: Stack datastructure using LaTeX

text: A very common programming data structure is a stack. A stack is simply a one dimensional array. Stack elements are pushed in or popped out of the stack one at a time as LIFO (Last In First Out). ![enter image description here](http://i.stack.imgur.com/UnGf8.png) I am trying to build a general routine to represent such stacks using LaTeX2e. The stack has two operations a pop and a push. The popped elements are stored in a macro `\popped@element`, so that they can be pushed into another stack if necessary or typeset material. At this point I provided a`\before@pop@hook` and an `\after@pop@hook`, to enable surrounding material to be added. Not sure if this correct from a design point. To get material in an `fbox` the construction became very weird (see lines 71-72):               \def\before@pop@hook{\bgroup\color{blue}\fbox}     \def\after@pop@hook{\egroup}      **I am looking for improvements/corrections to the code to make it more robust and accept any type of input such as verbatim text, ability to be inserted into tables, i.e, which sections of the code would need to become`outer` etc.** So far I have come up with this MWE:               \documentclass{book}     \usepackage[latin]{babel}     \usepackage{xcolor,lipsum}     \parindent0pt     \makeatletter     \newcommand\lorem{Fusce adipiscing justo nec ante. Nullam in enim.      Pellentesque felis orci, sagittis ac, malesuada et, facilisis in,      ligula. Nunc non magna sit amet mi aliquam dictum. In mi. Curabitur      sollicitudin justo sed quam et quadd.}     % Define a new stack by letting it to \@empty     \newcommand\newstack[1]{%        \let#1\@empty     }     % #1 stack name     %  #2 element contents     \newcommand{\add@element}[2]{%       \def\element{#2}%       \push@element{#1}     }     % #1 stack name     \newcommand{\push@element}[1]{%        \xdef#1{\element+#1}     }          %% Add hooks here for typesetting          \def\before@pop@hook{\bgroup\color{red}}     \def\after@pop@hook{\egroup}          \def\before@pop@hook{}     \def\after@pop@hook{}          \long\def\pop@#1+#2\@nil#3{%       \def\popped@element@{\before@pop@hook{#1}\after@pop@hook}       \def\popped@element{#1}       % \xdef\element{#1} if required?       % remaining list       \def#3{#2}%       }          % stack name #1     \newcommand\pop@element[1]{%     \ifx #1\@empty  Error\else        \expandafter\pop@#1\@nil#1     \fi     }          \begin{document}     % Create two stacks     \newstack{\stack}     \newstack{\tempstack}     % add some elements to stack     \def\elt@start{Start }\def\elt@stop{Stop}     \add@element{\stack}{english}     \add@element{\stack}{polish}     \add@element{\stack}{australian}     \add@element{\stack}{german}     \add@element{\stack}{\elt@start greek \elt@stop}          % pop some elements from \stack     % and put them in boxes     Popped from stack          \pop@element{\stack}     \popped@element@     \pop@element{\stack}     \popped@element@          % add last popped element from \stack to \temp     % pop it into blue box     \def\before@pop@hook{\bgroup\color{blue}\fbox}     \def\after@pop@hook{\egroup}     \add@element{\tempstack}{\popped@element}     \parbox{3cm}{\popped@element@}               \def\X{german}     \def\Y{\popped@element}     \ifx\X\Y \add@element{\stack}{\popped@element}\fi          In temp stack \tempstack          \def\before@pop@hook{}     \def\after@pop@hook{}     \add@element\stack{\lorem}          \pop@element{\stack}     \parbox{3.9cm}{\popped@element@}          \end{document}       **LaTeX3 and Lua solutions are also welcome, provided they come with long explanations.** _**Update_** It is a pity that I cannot accept all the answers as they are all great and examined the issues from all aspects. I was especially impressed with Frank's and Joseph's answers and their explanations. cjorssen's Lua solution is very promising and can be very useful, if one wanted to parse the contents further. I have accepted Bruno's answer as it was the one with a MWE and clearly demonstrating the use of verbatim text in lists.


title: How can I use overlays in beamer when producing graphs with dot?

text: I usually describe graphs with graphiz and I enjoy _dot2tex_ which produces the corresponding TikZ code. To explain an algorithm in a presentation, I need to uncover the nodes and edges of a graph step by step (without changing the layout, of course). I can find some documentation on how to do that when one is writing directly tikz code, for instance Beamer vs. TikZ: uncover nodes step-by-step , but in my case the code is generated automatically from the dot specification. Is it possible to include overlay specification in the dot file?


title: Add label to right-angled connector -

text: I'm try to add a label to a right-angled connector in a TikZ figure. Below is the code I'm using:               \begin{tikzpicture}[every node/.style={minimum height={1.5cm},thick,align=center},node distance=2.5cm, auto]     \node[draw] (CC) {CC};     \node[draw, right= of CC] (PC) {PC};     \node[draw, dashed, below= of CC] (AP) {DP};     \node[draw, dashed, below= of AP] (SP) {SP};     \node[draw, below = of SP] (BD) {BD};     \draw[->] (CC) to node {DM} (AP);     \draw[->] (AP.west) |- ($(AP.west) - (2.0,0)$) |- (BD.west);     \draw[->] (PC) |- (SP);     \draw[->] (AP) to node {SPa} (SP);     \draw[->] (SP) to node {Al} (BD);     \end{tikzpicture}      This is what is being output plus the label I would like to put is marked in red. ![enter image description here](http://i.stack.imgur.com/2iRP6.png) How could this be done? I've tried putting in the usual `{text}` in `\draw[->] (AP.west) |- ($(AP.west) - (2.0,0)$) |- (BD.west);` but I'm either getting an error or the label is being misplaced. Thanks in advance!


title: Float table with subfloat extend to multiple pages LyX

text: I have a float (table) which contains several subfloats. The last of these subfloats does not fit on the page and is cut off. I would like it to extend to the next page. I know of `longtable` but that does not work with floats in LyX. What is the right solution here?


title: What is the difference between `\hspace*{\fill}` and `\hfill`?

text: In the `memoir` manual on page 183 ,this example is given:               \begin{figure}     \centering     \hspace*{\fill}     {ILLUSTRATION 1} \hfill {ILLUSTRATION 2}     \hspace*{\fill}     \caption{Example float with two illustrations}     \label{fig:mult1}     \end{figure}      I have tried to figure out, what the difference between `\hspace*{\fill}` and `\hfill` is!? The `\hfill` definition and `\hspace` definition did not help me much.


title: Ternary plot: points outside of the triangle

text: although my test data points are all inside the (0,0,1),(0,1,0),(1,0,0) triangle, my ternary plot unexpectedly plots some of them outside of the triangle.               \documentclass{beamer}          \usepackage{pgfplots}          \pgfplotsset{compat=1.5}          \usepgfplotslibrary{ternary}               \def\ternaryPlot#1{           \begin{frame}         \begin{tikzpicture}             \begin{ternaryaxis}                  \addplot3 table[x index = 1, y index = 2, z index= 3]{#1};                  \end{ternaryaxis}         \end{tikzpicture}      \end{frame}          }          \begin{document}          \ternaryPlot{ternaryPlotTest.tsv}               \end{document}      ternaryPlotTest.tsv:               foo ololo   alala   elele     foo1    0.5 0.3 0.7     foo2    0.2 0.5 0.2     foo3    1   1   1


title: overfull hbox when I insert hline

text: I've got an issue related to table of contents. I want a horizontal line before each section, so I put                   \renewcommand{\cftsecfont}{     \hline     %other stuff that I need     }      This is perfect in terms of what I see, but I get a warning because (I guess) the compiler expects to find `\hline` within a table. So I replaced it with               line(1,0){length}      The problem now is that if length is long enough (I need the line to arrive on top of the page number), I get an overfull hbox. Any idea? I already searched related problems with no luck.


title: vertical alignment using tabularx / arraystretch

text: I am using the tabularx package to customize my tables. I changed the definition of `tabularxcolumn` to vertically center the text. As I am using `arraystretch`, the bold 'titles' of my table are aligned quite ugly. How can I fix this?                 \documentclass[fleqn,10pt,twocolumn]{article} % Document font size and equations        \usepackage{tabularx}       \usepackage[table]{xcolor}       \usepackage{colortbl}       \usepackage{enumitem}       \renewcommand\tabularxcolumn[1]{m{#1}}       \renewcommand\arraystretch{1.5} \setlength\minrowclearance{2.4pt}             \arrayrulecolor{blue}            \newcolumntype{=}{>{\global\let\currentrowstyle\relax}}       \newcolumntype{^}{>{\currentrowstyle}}       \newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%         #1\ignorespaces       }                 \begin{document}       \begin{tabularx}{\linewidth}{|=l^X|@{}}       \multicolumn{2}{>{\columncolor{blue}}c}{\color{white}\textbf{Table: Interfaces}} \\       \hline       \rowcolor{blue}       \rowstyle{\color{white}\bfseries}       \textbf{Interface} &\rowstyle{\color{white}}\textbf{Programming Languages}\\       \texttt{.NET}        & The blablab this is only some text to illustrate my problem:        \begin{itemize}[topsep=-5pt,leftmargin=0.7cm,itemsep=0.8pt,labelsep=.5cm]        \item C\#        \item VB .NET        \end{itemize}\\       \texttt{JNI}       & Some other text \\        \hline       \end{tabularx}       \end{document}      And can someone explain when I need to insert this @{}? I still dont get that..


title: How do I set up sections to be padded with leading 0s?

text: I am formatting a document for someone, and he wants each section number to be three digits long, starting with 000, and with padding zeros when needed. I found a similar question, and tried to adapt the example, but it gives me a               ! TeX capacity exceeded, sorry [input stack size=5000].     \thesection ->\thesection                                .\three@digits {\value {section}}     l.11 \section{Synopsis}          If you really absolutely need more capacity,     you can ask a wizard to enlarge me.      My MNWE is:                \documentclass[letterpaper]{article}           %Padding the leading zeros \makeatletter      \renewcommand\thesection{\thesection.\three@digits{\value{section}}}      \makeatother           \begin{document} \setcounter{section}{-1} \tableofcontents      \section{Synopsis} foo           \section{Language} bar           \section{Legal} baz           \end{document}


title: How to move a phrase in a resume template?

text: Here is some template CV in LaTeX: http://www.rpi.edu/dept/arc/training/latex/resumes/ Consider template number 9a (source). I want to move the name to the left, write "Resume" in the middle, and put a date on the right. How can I do this?


title: Blurry output in LaTeX using LyX

text: I am using LyX to type a paper. My problem is that the quality of the pdf output from LyX is very low. I am using Adobe Acrobat Reader to view the pdf output that I generate using pdflatex. I have tried putting               \usepackage[OT1]{fontenc}     \usepackage{lmodern}      in the preamble but it did not help. Please see the image of the output for further reference (especially consider the edges of the letters) ![enter image description here](http://i.stack.imgur.com/F50Ib.png)


title: How to create and include .tikz files in your manuscript?

text: Recently, I learnt about the matlab code `matlab2tikz`. The output of this code is a `.tikz` file that can be used, I guess, alongside standard figure packages with a simple line `\input{mysphere.tikz}` in the figure environment. This got me wondering if `.tikz` is a common way to include the TikZ code in your manuscript. It would be convenient for me to save TikZ scripts in separate files instead of having them all in my final manuscript. This will make my manuscript(s) more readable. Can anyone advise me in this regard? I searched the `pgfmanual` for the string `.tikz` but found no results. I am still searching the web for examples of `.tikz` files. (I asked this question `TeX.SeX` chat a few minutes ago and ported it here on the advise of `@WillHunting`.)


title: White spaces in report

text: My editor produces a new paragraph every time I omit a line with pressing 2 times enter. I would like to turn this function off and begin new paragraphs only with explicit `\par` command. Does anybody knows how to do so? I am using TeXmaker (on Ubuntu).


title: Referring an equation inside a theorem

text: I have theorems which `LaTeX` numbers and then some equations inside and outside theorems that LateX has numbered. When I refer to an equation inside a theorem statement then `LaTeX` is referring to it by the theorem's number and not the equation's number.               \usepackage{amsmath}     \newtheorem{prop}[thm]{Proposition}     \begin{prop}     Blah is      \begin{equation}\label{eq:Blah}     B=L+a-H     \end{equation}     \end{prop}          From equation ~\ref{eq:Blah} we know blah blah blah.      Suppose the proposition number is `4.1` and the equation number is `12` then my text catches `4.1` and not `12`. I don't particularly care which number is catches, so long as it is consistent. So that someone reading the text can find what I am referring to. How can I fix this?


title: How can I insert a table within a figure's caption?

text: I have a small table that I would like included in the caption below a tikzpicture enclosed within a figure. Is this possible?


title: Mixing math character classes (e.g. \mathord to the left and \mathrel to the right)

text: **It is possible to have a symbol or group behave to the left as if it had one particular math character class and to the right as if it had another?** One typical case where this comes up is when one parenthesizes part of a longer expression. For example, enclosing the first part of `\\(U \rightarrow U \rightarrow U\\)` in square brackets (`\\([U \rightarrow] U \rightarrow U\\)`) will lead to the closing square bracket `]` being too close to the following `U`. In this case, creating a new `\mathrel` out of the arrow and the closing square bracket (`\\([U \mathrel{\rightarrow ]} U \rightarrow U\\)`) solves the problem: ![parenthesizing part of an expression while retaining the original spacing](http://i.stack.imgur.com/1Rf4h.png) but a fully general solution would be nice. Another example: Perhaps I would like to define an asymmetric relation symbol `` (a leaf, whatever this might stand for) for which I would like to make it visually clear that it conceptually binds closer to its right-hand argument than to the left. The result should look like this: `M v`. Unlike the title of this question, this one would actually be "\mathord to the _right_ and \mathrel to the _left_ ". (Perhaps this is a two-argument function that accepts a matrix and a vector. The assumption is that there is a good reason for using infix notation and for writing it closer to the vector. Maybe it transforms the vector before multiplying the vector to the matrix, in a way that the vector transformation makes only sense if combined with matrix multiplication. Note that I've picked such an example for visual clarity, but pairing `\mathord` up with `\mathbin` instead of `\mathrel` might be more realistic.) Perhaps a better example: I might define a typecast operator for some formal language. I'd like to denote the typecast expression as `expr ∽τ` (using `\backsim`), with type `τ` set closer to the symbol `∽`: it's as if `∽` first merged with the target type to then form a left-unary typecast operator; we can even enumerate all such operators `∽τ` under the assumption that the number of possible target types `τ` is small. The hacky solution to do a lot of hierarchical math character class assignment (i.e. `\\(M \mathrel{\mathord{\someleafsymbol} v}\\)` for my first leaf example) is dispreferred. I was thinking of a macro `\DeclareTwofaceMathchar{lclass}{rclass}{symbol}` where `lclass` and `rclass` are among `\mathord`, `\mathop`, `\mathbin`, ... If there is no such fully general solution, an explanation for why there is none will also be a good answer. Somewhat related is my Addendum about a "genuine unary plus" at the bottom of this question: What is a good method for producing a unary plus/minus sign that always works?


title: Add cross-page text referenced to text

text: I have `\appendix` in my document and I want to have referenced text throud pages for current section. For example: ![example of document](http://i.stack.imgur.com/ocmf6.png)


title: Strategies to deal with \ being in an awkward place on the keyboard?

text: So, I'm typing on a standard EN-US Qwerty keyboard, where the `\` key is in the top right below the backspace key. I find that LaTeX requires me to repeatedly type this key for macros and such, and that my wrists tend to get quite sore from constantly reaching for it. I'm wondering, what strategies have been used to make this easier, both from an efficiency and an ergonomics standpoint? I realize that this question is fairly open ended, so there probably won't be one "right" answer, but I'm curious what different things people have done to overcome this over the years.


title: PDF viewer with dual page option?

text: I wonder if there is a viewer, or a whole TeX package allowing me to display two pages side by side. I have two big monitors and I cannot use them effectively now. PCTEX comes close but not quite - it has a DVI viewer, which creates a lot of problems with embedded figures. I have Texworks and Texstudio installed, and they cannot do that. I am running Win 7.


title: Why is the picture not inserted?

text: When I `pdflatex` the text below it doesn't insert the picture, but writes the name of the file instead (pic). And the geometry line gives the error               ! LaTeX Error: Missing \begin{document}.      The picture I am using is at http://bayfiles.com/file/jIHB/oeWKYv/pic.pdf and the floatrow package from. **Question** Can anyone see what is wrong? **Text**               \documentclass[a4paper]{article}     \pdfpagewidth=\paperwidth     \pdfpageheight=\paperheight     \usepackage{aeguill}     \pdfcompresslevel=9     \usepackage[pdftex,colorlinks]{hyperref}          \usepackage{a4}     \usepackage{fixltx2e}     \usepackage[danish]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}          \usepackage[draft]{graphicx}     \usepackage{floatrow}          \usepackage{geometry}          \geometry{margin=10pt,paperwidth=\textwidth+20pt,paperheight=\textheight+20pt}          \begin{document}          The first paragraph.          \begin{figure}       \includegraphics{pic}     \end{figure}          And the second.          \end{document}


title: Correct sorting of composite page numbers with makeindex

text: Running an index file like               \indexentry{foo}{1}     \indexentry{foo}{i}     \indexentry{foo}{a}      through `makeindex` results in an includable output file like               \begin{theindex}            \item foo, i, 1, a          \end{theindex}      Apparently, `i` is considered a roman number, which is usually correct. However, when the page numbers are composite as in               \indexentry{foo}{1.7}     \indexentry{foo}{i.8}     \indexentry{foo}{a.9}      with style file               page_compositor "."      I get an output of               \begin{theindex}            \item foo, 1.7, a.9, i.8          \end{theindex}      Now, `i` is considered a letter, which is wrong in my use case. Is there a way to tell `makeindex` when a letter is a roman number, particularly in the composite case above?


title: error on image image insert

text: I have a two collumn layout. I work with the ACM TOG template. I want insert two images as subfigures aligned next to each other, spanning two columns. The images are inserted ![under each other](http://i.stack.imgur.com/p3taH.png) How can i fix this? I use this code:               %%%%%%%%%%%%%% Image: sensor suit     \begin{figure*}[t]     \begin{center}         \label{image:suit}             \begin{subfigure}[t]{\textwidth}                     \label{im:device_front}             \includegraphics[width=0.39\textwidth]{images/device_front}             \caption{Frontal view of the sensor system}         \end{subfigure}                     \quad                     \quad         \begin{subfigure}[t]{\textwidth}                     \label{im:device_side}             \includegraphics[width=0.39\textwidth]{images/device_side}             \caption{Side view of the sensor system}         \end{subfigure}      \caption{Overview of the body sensor network as worn by the subjects}     \label{default}     \end{center}     \end{figure*}     %%%%%%%%%%%%%%      This is my preamble:               \documentclass{acmtog}     \usepackage{paralist}     \usepackage{graphicx}     \usepackage[width=0.48\textwidth]{caption}     %\usepackage{subcaption}     \usepackage{subfigure}     ...      The error i get is (from the log):               Underfull \vbox (badness 5862) has occurred while \output is active []               ./thesis_ACM_format_final.tex:182: Missing number, treated as zero.     <to be read again>                         }     l.182         \begin{subfigure}[t]{\textwidth}          ?      ./thesis_ACM_format_final.tex:182: Illegal unit of measure (pt inserted).     <to be read again>                         }     l.182         \begin{subfigure}[t]{\textwidth}          ?           Overfull \hbox (8.8799pt too wide) in paragraph at lines 182--182     []\OT1/ptm/m/n/8 (a)      []               Overfull \hbox (2.22392pt too wide) in paragraph at lines 182--182     \OT1/ptm/m/n/8 t       []          <images/device_front.jpg, id=10, 4336.2pt x 3252.15pt>     File: images/device_front.jpg Graphic file (type jpg)          <use images/device_front.jpg>     Package pdftex.def Info: images/device_front.jpg used on input line 184.     (pdftex.def)             Requested size: 196.5597pt x 147.38254pt.          ./thesis_ACM_format_final.tex:189: Missing number, treated as zero.     <to be read again>                         }     l.189   \begin{subfigure}[t]{\textwidth}          ?      ./thesis_ACM_format_final.tex:189: Illegal unit of measure (pt inserted).     <to be read again>                         }     l.189   \begin{subfigure}[t]{\textwidth}          ?           Overfull \hbox (8.8799pt too wide) in paragraph at lines 189--189     []\OT1/ptm/m/n/8 (a)      []               Overfull \hbox (2.22392pt too wide) in paragraph at lines 189--189     \OT1/ptm/m/n/8 t       []          <images/device_side.jpg, id=11, 4336.2pt x 3252.15pt>     File: images/device_side.jpg Graphic file (type jpg)          <use images/device_side.jpg>     Package pdftex.def Info: images/device_side.jpg used on input line 191.     (pdftex.def)             Requested size: 196.5597pt x 147.38254pt.      EDIT: This worked for me (had to use subfig and subfloat):               %%%%%%%%%%%%%% Image: sensor suit     \begin{figure*}[t]     \begin{center}         \label{image:suit}             \subfloat[Frontal view of the sensor suit as worn by the subject]{\includegraphics[width=0.45\textwidth]{images/device_front}}         \quad         \quad         \quad             \subfloat[Side view of the sensor suit as worn by the subject]{\includegraphics[width=0.45\textwidth]{images/device_front}}         \caption{Overview of the body sensor network as worn by the subjects}     \label{default}     \end{center}     \end{figure*}     %%%%%%%%%%%%%%


title: How can I find a footnote by its number (Hfootnote.xx)?

text: I want to find out, which footnote is causing a warning message in my pdfoutput. I am using Miktex 2.9, my document is from the type "scrreprt" and I make usage of the package parnotes. I get the message: `{HFootnote.9} has been referenced but does not exist, replaced by a fixed one.` I know that there are many questions and answers to this topic, but the solutions do not work out for me. I tried the following:   * hyperref is loaded as the last package   * yes, I use footnotes in tables, but that's what the package "parnotes" is good for, isn't it? I can't provide a minimal example, because then I would know which footnote does cause the error. My document has a size of 250 pages and I do not have the time to check each of the footnotes if it is displayed and linked correctly (I have to finish my Masterthesis in three days). **Can someone please tell me how I can find out which footnote does cause the trouble?** Just in case that I somehow misused the parnotes-package in my tables, here is an example of one of my tables (the table and the footnote is displayed correctly):               \begin{table}[htbp]                          \begin{tabularx}{\textwidth}{|L{2.5cm}|X|p{11cm}|}         \toprule         \parnoteclear         \textbf{Anforderung} & \textbf{P(5)} & \textbf{Bewertung}\\                              \midrule                             Preis & / & Some text\parnote{My footnote text.} which has a value of 80~\texteuro\ per month.\\                 \bottomrule     \end{tabularx}       \parnotes                                \caption{My caption for this table.}     \label{tab:ModelingToolSignavio}                     \end{table}      This is the definition of the parnoteclear-command:               \usepackage{parskip}     \usepackage{tabularx}     \usepackage[roman]{parnotes}    % enables footnotes in tables          \def\parnoteclear{%         \gdef\PN@text{}%         \parnotereset     }      Thanks in advance for every hint, idea or advise.   Timo


title: Using TikZ coordinates in expressions?

text: I would like to be able to calculate two new `\coordinate`s by starting from two existing coordinates. I have defined two coordinates `c1` and `c2`. A minimal example would be               \documentclass{report}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}         \begin{tikzpicture}[x={(.05\textwidth,0)},y={(0,.05\textwidth)}]         \def\arrowlength{0.5}         \coordinate (c1) at (1,0);         \coordinate (c2) at (4,1);              \draw (c1) -- (c2);         \end{tikzpicture}     \end{document}      Continuing from here, I would like to calculate a third coordinate, `c3`, that lies in the middle of `c1` and `c2`. I have tried               \coordinate (c3) at (0.5*c1+0.5*c2);      but that gives me the error               Package pgf Error: No shape named 0 is known      Second, I would like to draw an arrow from `c3`, orthogonal to the line between `c1` and `c2`. So I would like to take the difference `c2-c1`, rotate that vector by `90` degrees, normalize it, multiply it with the length the arrow is supposed to have, then add it to `c3` and store it as a new coordinate called `c4`. Is this possible? (I want to avoid calculating the coordinates manually since I have to do this a lot of times and I want to be able to make changes to it easily) **Edit 1:** Thanks to Jake and percusse, I reallized that I have to enclose the expression in $-signs and enclose the coordinates in parentheses. I have now updated the minimal example to               \documentclass{report}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}         \begin{tikzpicture}[x={(.05\textwidth,0)},y={(0,.05\textwidth)}]         \def\arrowlength{0.5}         \coordinate (c1) at (1,0);         \coordinate (c2) at (4,1);         \coordinate (c3) at (5,0);              \coordinate (c4) at ($(c1)!0.5!(c2)$);         \coordinate (c5) at ($(c4)!\arrowlength!90:(c2)$);              \coordinate (c6) at ($(c2)!0.5!(c3)$);         \coordinate (c7) at ($(c6)!\arrowlength!90:(c3)$);              \draw (c1) -- (c2) -- (c3);         \draw[->] (c4) -- (c5);         \draw[->] (c6) -- (c7);         \end{tikzpicture}     \end{document}      which produces the image ![Arrows are not equally long](http://i.stack.imgur.com/gVIuT.png) As can be seen, the arrows are not equally long, so replacing `2cm` (which Jake used) with `0.5` (which I assumed would automatically, like all other coordinates specified without a unit, use the `x` and `y` vectors) did apparently not work. Any ideas for how to specify the length of the arrow in terms of "unit lengths"? (The coordinate `(4,1)` for example is 4 unit lengths in the `x`-direction and 1 unit length in the `y`-direction) **Edit 2:** I updated my example according to Jakes suggestion to               \documentclass{report}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}         \def\unitlength{0.05\textwidth}         \begin{tikzpicture}[x={(\unitlength,0)},y={(0,\unitlength)}]         \def\arrowlength{0.5*\unitlength}         \coordinate (c1) at (1,0);         \coordinate (c2) at (4,1);         \coordinate (c3) at (5,0);              \coordinate (c4) at ($(c1)!0.5!(c2)$);         \coordinate (c5) at ($(c4)!\arrowlength!90:(c2)$);              \coordinate (c6) at ($(c2)!0.5!(c3)$);         \coordinate (c7) at ($(c6)!\arrowlength!90:(c3)$);              \draw (c1) -- (c2) -- (c3);         \draw[->] (c4) -- (c5);         \draw[->] (c6) -- (c7);         \end{tikzpicture}     \end{document}      and now the arrows are equally long.


title: Document class for writing class note

text: I would like to know the document class to write my lecture notes and assignments questions which I will be using for a course I am teaching. I want your valuable suggestions in this regard.


title: Spacing of key entries in gnuplot using epslatex

text: When using the `epslatex` terminal, I always have to use the width command as well as `\hspace` to get the LaTeX generated key labels properly aligned. Is there any way of getting this to work automatically? For example, I just wanted to use a key with two columns, but it was impossible to get it lined up properly (the first column would always overlap with the second). Here is an example:                   set terminal epslatex colortext color standalone "phv" 12  header "\\bfseries"           set output "figtmp1.tex"              set notitle         set nokey         set size 1,1                    set origin 0,0              set xlabel "{\\Large $x$}"          set ylabel "{\\Large $y$}"              ti2 = "{\\large $S^{zz}_\\sigma(L/2)$}"         ti4 = "{\\large $S^{xx}_\\sigma$}"              set key Left top right vertical maxrows 1              f1(x) = x**1         f2(x) = x**2              plot \         f1(x) w lp lc rgb "red" t ti2,\         f2(x) w l lt 2 lc rgb "dark-grey" t ti4      This produces a two-column, one-line key where the line sample of f1(x) extends into the second column belonging to f2(x). Also, the spacing between the label and the corresponding line sample is much too large (this can be adjusted using `width`). A related formatting problem occurs for a regular (single-column) key:                   set key Left top right      The labels appear to be centred. How do I align the labels, for example, to the left without using the LaTeX command `\hspace` and determining the spacing needed by trial and error?


title: Creating Trie trees in TikZ

text: I'm writing a Java app to generate tries for Latex using TikZ. I'm struggling to typeset a Trie to follow example below: ![example](http://i.stack.imgur.com/f9Q3u.jpg) Could someone provide me with an example how to properly nest children nodes and corresponding labels. What I got now is:               \begin{tikzpicture}     \node [circle] {}         child{ node [circle] {} edge from parent node[above left] {$B$} }         child{ node [circle] {} edge from parent node[above left] {$F$}                 child [circle] {}             };      \end{tikzpicture}      But edge labels won't match to the right edges.


title: `\center` and size of `\frac` in my code

text: \documentclass[a4paper,12pt]{article}     \usepackage{amsmath}     \usepackage{fullpage}     \usepackage{secdot}     \usepackage{setspace}          \setlength\parindent{0pt}          \title{\vspace{-3em} Quantum Mechanics}     \author{David Ge}          \begin{document}     \maketitle          \section{Operators In Schroedinger Equation}     \onehalfspacing     In quantum mechanics, a question that concerns us all is whether light is particles or waves. Let's first assume light is wave, so it must satisfy the wave equation:          \vspace{-1em}     \begin{align}         \left (\frac{\partial^2 \psi}{\partial x^2}+\frac{\partial^2 \psi}{\partial y^2}+\frac{\partial^2 \psi}{\partial z^2} \right)-             \frac{1}{c^2}  \frac{\partial^2 \psi}{\partial t^2} & = 0 \\         \nabla^2 \psi - \frac{1}{c^2}  \frac{\partial^2 \psi}{\partial t^2} & = 0     \end{align}          Naturally, we construct the solution of this wave equation:          \begin{center}         $ \psi(x,y,z;t) = \psi_{0} \, e^{i \, [\, k (x+y+z)- \omega t + \phi_{0}\, ]}$     \end{center}          Here, we can set the initial condition $\phi_{0} = 0$, and we would like to explore the 1D case:     \begin{center}         $ \psi(x,t) = \psi_{x,0} \, e^{i \, (kx- \omega t)}    $     \end{center}          Now, we lay down all the foundation, and we want to express the momentum and energy operators, by using the solution of the wave function. By observing the equation:          \begin{center}     $ E = \frac{p^2}{2m} + V  $     \end{center}     \end{document}      The above is my code, and I have two questions to ask:   1. I feel really annoying to type `\begin{center} \end{center}` each time when I need to type down the equation. I'm wondering is there an easier way to accomplish this?   2. See `$ E = \frac{p^2}{2m} + V $`. Here, the size of the fraction looks ugly, can anyone help me because I don't know how to ask this question.


title: How to do subsections for a homework problem?

text: I have a homework question and I have `\section*{Problem 1}` which has parts `(a), (b)...` how do I properly section each part?


title: Indentation of a code block in lhs2TeX

text: What's the (quick and) easy way to set the indentation of a `\begin{code}`/`\end{code}` or `\begin{spec}`/`\end{spec}`? That is, I want to set only the indentation of the whole block, not the indentation of the columns in the code (which can be configured by `\hsindent` as described in the documentation). One solution would be to use `\texths` (as mentioned here) and a `minipage`, but I suspect there are better/nicer options.


title: I am new to TeX. Should I use LaTeX, XeLaTeX, ...?

text: I am starting to learn LaTeX and I really like what I am seeing. However, I get the feeling I should actually start with another 'TeX' version. I've been reading about different options. Some references:   * What is XeTeX exactly and why should I use it?   * Differences between LuaTeX, ConTeXt and XeTeX   * Which "TeX" should one use? These questions and answers are very helpful, but I'd like to check to see if my findings are correct. I get the feeling that XeLaTeX is more of the 'improved' version that provides easier/more font options and makes it easier when using weird characters. Most people talk about 'converting' from one TeX to another, but given the fact that I am a beginner I am looking for the proper TeX flavor right now, so that I do not need to change preambles and such when I am learning about new things that are only available when using other TeX engines. Some details about my usage:   * I visualize using TeX mostly for business reports, memos, and investigations.    * I also might use it for presentations and publishing in book-format.    * I will not be using advanced math nor Chinese or other very non-Latin symbols.   * Being a beginner, I do not need to convert any old documents. I have been reading about LaTeX3, however, and this _seems_ like a version that will be superior to the existing TeX options. So when this becomes available, I envision switching to this. So if that is of any validity, I'd say that easy conversion to / compatibility with LaTex3 would be important.  Also, I read about an issue with 'microtype' in XeTeX, but I do not really get what that is and if this would affect me. To quote from this question related to another beginner's question: > XeLaTeX would be (especially) suitable to you, for better (Unicode) > multilingual support and easy font switching. And it supports more image > format and PSTricks code. I feel this also applies to my situation, so I am about to use XeLaTeX instead of LaTeX, and learn using this instead. Is this a good idea given my situation, or am I overlooking something important?


title: What's the difference between XeLaTeX and XeTeX?

text: > **Possible Duplicate:**   >  I am new to TeX. Should I use LaTeX, XeLaTeX, …? Can't find any information or i don't know where to search. Anyone can explain, please?


title: Spurious [?] vertical space introduced by multicols

text: In the example below, you'll notice, in the first box, a slight spurious vertical space before the text actually starts, and probably introduced by `multicols`. Do you know how to get rid of it?               \documentclass[10pt]{article}     \usepackage{xcolor}     \usepackage{multicol}     \usepackage{lipsum}     \usepackage{calc}     \setlength{\fboxsep}{3mm}\setlength{\fboxrule}{1pt}%     \begin{document}     \noindent\fcolorbox{red}{red!20}{%     \begin{minipage}[t]{\textwidth-2\fboxrule-2\fboxsep}%     \begin{multicols}{3}%     text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text     \end{multicols}%     \end{minipage}}%          \noindent\fcolorbox{red}{red!20}{%     \begin{minipage}[t]{\textwidth-2\fboxrule-2\fboxsep}%     text text text text text text text text text text text text text text text text text text text     \end{minipage}}%     \end{document}      ![illustration](http://i.stack.imgur.com/qp8en.png)


title: Strange issue after removing bug

text: I removed a bug in my LaTeX code. Now the section is bug free because it uses code from a Lamport book. But it still is included in the pdf after using `pdflatex` more than once. What is the problem? Can somebody give me a hint for debugging?


title: PSTricks animation not scaling correctly

text: Consider the following animation:               \documentclass{article}          \usepackage[margin=2cm]{geometry}     \usepackage{pst-eucl}     \usepackage{animate}     \usepackage{siunitx}          % LaTeX 3 syntax     \ExplSyntaxOn       \cs_new_eq:NN \calc \fp_eval:n     \ExplSyntaxOff          \def\sundial#1{%     % constants     \def\length{16 }     \def\north{#1 }     % helping constants     \def\northB{\calc{90-\north}}     \def\lengthB{\calc{\length*sin(\northB*pi/180)}}     \def\lengthC{\calc{\length*sin(\north* pi/180)}}     \def\coorx{\calc{\lengthB*sin(\northB*pi/180)}}     \def\coory{\calc{\lengthC*cos(\north* pi/180)}}     \def\maxxA{\calc{\length+0.45}}     \def\maxxB{\calc{1/4*\length*(sin(2*\north*pi/180)+cos(2*\north*pi/180)+3)}}     \def\maxx{\calc{max(\maxxA,\maxxB)}}     \def\maxyA{\calc{1/2*\lengthC*(sin(\north*pi/180)+cos(\north*pi/180))}}     \def\maxyB{\calc{\coory+0.6}}     \def\maxy{\calc{max(\maxyA,\maxyB)}}     % settings     \psset{unit=0.8}     \sisetup{round-mode=places,round-precision=1}     % picture     \fbox{%     \begin{pspicture}(-0.6,-0.15)(\maxx,\maxy)       \pnodes{P}(0,0)(\coorx,\coory)(\length,0)       \pspolygon(P0)(P1)(P2)       \pstMarkAngle{P2}{P0}{P1}{\SI{\north}{\degree}}       \pstRightAngle{P0}{P1}{P2}       \pstMarkAngle{P1}{P2}{P0}{\SI{\northB}{\degree}}       \uput[180](P0){$A$}       \uput[90](P1){$C$}       \uput[0](P2){$B$}       \pstMediatorAB[         PointSymbol=none,         PointNameA=none,         PointNameB=none,         CodeFig=true,         CodeFigColor=black       ]{P1}{P2}{M}{MN}       \psset{offset=-9pt,linestyle=none,nrot=:U}       \pcline(P0)(P1)       \ncput*{\SI{\lengthB}{\cm}}       \pcline(P1)(P2)       \ncput*{\SI{\lengthC}{\cm}}       \pcline[offset=9pt](P0)(P2)       \ncput*{\SI{\length}{\cm}}     \end{pspicture}%     }     }          \begin{document}          \begin{animateinline}[poster=first,controls,palindrome]{5}       \multiframe{51}{iA=20+1}{\sundial{\iA}}     \end{animateinline}          \end{document}      ![output](http://i.stack.imgur.com/zM9Ej.jpg) (Note: The `\fbox` is only there to illustrate the size of the `pspicture` frame.) When I run the animation (from Adobe Reader), the width and the height of the frame doesn't change; instead, the figure gets stretched. How do I fix this? P.S. When I don't have an animation and choose single (different) values of `\north`, the frame gets ajusted as I would expect. **Update** I ended up using the following but AlexG's method is better (since the calculations are done automatically):               \documentclass{article}          \usepackage[margin=2cm]{geometry}     \usepackage{pst-eucl}     \usepackage{animate}     \usepackage{siunitx}          % LaTeX 3 syntax     \ExplSyntaxOn       \cs_new_eq:NN \calc \fp_eval:n     \ExplSyntaxOff          % helping constants     \def\northB{\calc{90-\north}}     \def\lengthB{\calc{\length*sin(\northB*pi/180)}}     \def\lengthC{\calc{\length*sin(\north* pi/180)}}     \def\coorx{\calc{\lengthB*sin(\northB*pi/180)}}     \def\coory{\calc{\lengthC*cos(\north* pi/180)}}     \def\maxx{\calc{(3+2^(1/2))/4*\length-0.2}}% <-- global maximum for the width (minus adjustment)     \def\maxy{\calc{(1+2^(1/2))/4*\length}}%     <-- global maximum for the height          % settings     \psset{unit=0.8}     \sisetup{round-mode=places,round-precision=1}          % sundial     \def\sundial#1{%     % constants     \def\length{16}     \def\north{#1}     % picture     \begin{pspicture}(-0.5,-0.15)(\maxx,\maxy)       \pnodes{P}(0,0)(\coorx,\coory)(\length,0)       \pspolygon(P0)(P1)(P2)       \pstMarkAngle{P2}{P0}{P1}{\small\SI{\north}{\degree}}       \pstRightAngle{P0}{P1}{P2}       \pstMarkAngle{P1}{P2}{P0}{\small\SI{\northB}{\degree}}       \uput[180](P0){$A$}       \uput[90](P1){$C$}       \uput[0](P2){$B$}       \pstMediatorAB[         PointSymbol=none,         PointNameA=none,         PointNameB=none,         CodeFig=true,         CodeFigColor=black       ]{P1}{P2}{M}{MN}       \psset{offset=-9pt,linestyle=none,nrot=:U}       \pcline(P0)(P1)       \ncput*{\SI{\lengthB}{\cm}}       \pcline(P1)(P2)       \ncput*{\SI{\lengthC}{\cm}}       \pcline[offset=9pt](P0)(P2)       \ncput*{\SI{\length}{\cm}}     \end{pspicture}     }          \begin{document}          \begin{animateinline}[poster=first,controls,palindrome]{5}       \multiframe{61}{iA=15+1}{\sundial{\iA}}     \end{animateinline}          \end{document}


title: Stacked bar plot with explicit axis domain

text: I have a data table which contains positive and negative values for different categories (columns) as input. I want to visualize these values by a stacked bar plot, which shows a stacked bar plot for all negative values to the left and all positive values as a stacked bar to the right. I already found out that I cannot do this with a single axis environment, as `xbar stacked` does not render correctly (at least not as I want it) if positive and negative values are added to the same stack. Therefore, I am trying to apply a strategy that I found here: stacking negative value for ybar, which uses two axis environments with the same range for the x-axes. I started with the positive bars by filtering out negative values read from the data table. This works as expected, as long as I do not specify `xmin` and `xmax` for that axis. If I do so, the output is looking weird and not explainable for me. Here is a simple example of my current tries:               \documentclass[border=5mm]{standalone}          \usepackage{pgfplots}     \usepackage{pgfplotstable}          \pgfplotstableread{     Year    Cat1  Cat2    Cat3   Cat4     2005    10     50      -10     30       2006    -40     60      -15     90     2007    -20     60      -15     60     }\mytable          \begin{document}%            % First try: use negative and positive values in the same axis environment - FAIL       \begin{tikzpicture}         \begin{axis}[           xbar stacked,           ]           \addplot table [x index=1,y expr=\coordindex] {\mytable};           \addplot table [x index=2,y expr=\coordindex] {\mytable};           \addplot table [x index=3,y expr=\coordindex] {\mytable};           \addplot table [x index=4,y expr=\coordindex] {\mytable};           \legend{Cat1,Cat2,Cat3,Cat4}         \end{axis}       \end{tikzpicture}            % Second try: only draw positive values into single axis environment - SUCCESS, but drawing of negative values is missing       \begin{tikzpicture}         \begin{axis}[           xbar stacked,           restrict x to domain*=0:,           ]           \addplot table [x index=1,y expr=\coordindex] {\mytable};           \addplot table [x index=2,y expr=\coordindex] {\mytable};           \addplot table [x index=3,y expr=\coordindex] {\mytable};           \addplot table [x index=4,y expr=\coordindex] {\mytable};           \legend{Cat1,Cat2,Cat3,Cat4}         \end{axis}       \end{tikzpicture}            % Third try: explicitly defining the x-axis range to center the zero point - FAILS       \begin{tikzpicture}         \begin{axis}[           xbar stacked,           restrict x to domain*=0:,           xmin=-200, xmax=200,  % <-- only difference to second try (above)           ]           \addplot table [x index=1,y expr=\coordindex] {\mytable};           \addplot table [x index=2,y expr=\coordindex] {\mytable};           \addplot table [x index=3,y expr=\coordindex] {\mytable};           \addplot table [x index=4,y expr=\coordindex] {\mytable};           \legend{Cat1,Cat2,Cat3,Cat4}         \end{axis}       \end{tikzpicture}          \end{document}      This piece of code results in the following output: ![Result of the above LaTeX code](http://i.stack.imgur.com/rW1Xh.png) Does anybody have a working solution for this problem or at least an explanation why the definition of `xmin` and `xmax` changes the produced output and does not only define the axis range (as the command implies)?


title: Old Cyrillic letters in LaTeX

text: Can one type Old Cyrillic letters using LaTeX? http://en.wikipedia.org/wiki/Early_Cyrillic_alphabet Perhaps there is a package.


title: How can I get a stacked bar with single values and sum on top.

text: I have a stacked pgfplot like this: ![enter image description here](http://i.stack.imgur.com/xX57m.png) But I want the single values inside the bars and the total sum on top of the bar (this graphic is 'handmade'): ![enter image description here](http://i.stack.imgur.com/xWvho.png) How can I get this result? My attempt up to now:               \documentclass[border=5mm] {standalone}     \usepackage{pgfplots, pgfplotstable}          \begin{document}       \begin{tikzpicture}       \begin{axis}[         title={Test stacked},         ybar stacked, ymin=0,           bar width=10mm,         symbolic x coords={a,b,c,d},         xtick=data,         nodes near coords,          nodes near coords align={anchor=north},%Move values in bar         every node near coord/.style={         },       ]       %Active       \addplot [fill=blue] coordinates {     ({a},15)     ({b},25)     ({c},35)     ({d},15)};       %Inactive       \addplot [fill=red] coordinates {     ({a},60)     ({b},50)     ({c},40)     ({d},30)};       \legend{Active,Inactive}       \end{axis}       \end{tikzpicture}     \end{document}      This writes the added values inside the bar (not the single values) and the total sum is missing. The TeX-code is generated, it would be no problem for me to write the total in my TeX-code, there is no need to calculate it with tikz.


title: Pgffor and the alignment character (&)

text: I need to construct a table that looks like:               \begin{tabular}{ccc}     a(1,1) & a(1,2) & a(1,3)\\   % <---     a(2,1) & a(2,2) & a(2,3)\\   % <---  I need this     a(3,1) & a(3,2) & a(3,3)\\   % <---     \end{tabular}      for any given number of colums or rows. In fact I only need the part that has arrow next to it, because I would like to be able to put it in different kinds of environments. I need it to come like some sort of macro, so I can do               \begin{tabular}{ccc}     \generate{a}{3}{3}     \end{tabular}      to get the above table. I've tried:               \newcommand\makerow[3]{         \foreach \n [count=\ni] in {1,...,#3}{%             \ifnum\ni=1                 #1(#2,\n)             \else                 & #1(#2,\n)             \fi         }%     }%               \newcommand\makematrix[3]{         \foreach \m [count=\mi] in {1,...,#2}{%             \ifnum\mi=#2                 \makerow{#1}{\m}{#3}             \else                 \makerow{#1}{\m}{#3}\\             \fi         }%     }%               \begin{tabular}{ccc}     \makematrix{a}{3}{3}     \end{tabular}      Yet I get this error:               Incomplete \ifnum; All text was ignored after line 81.     Missing \endgoup inserted.     ....      * * * ## What I need I need a macro to quickly build tabular environments that have a variable number of colums and rows, yet I want to be able to use the tabular as I would do every day:               \begin{tabular}{cc|cc}     \hline     header 1 & header 2 & header 3\\     \hline     foo & bar & baz \\     \makematrix{a}{4}{3}    % <-- makes the rest of the table as described below     \hline         bar & baz &baz\\     \end{tabular}      etc. So The macro must be just inputted into the tabular environment, and behave as if               a(1,1) & a(1,2) & a(1,3)\\     a(2,1) & a(2,2) & a(2,3)\\     ...      were inputted at that spot. Similarly, I would like to be able to define the colums of the `tabular` environment myself because I'd like to be able tu use `> {...}` on the columns.


title: Where can I put biblatex style modifications?

text: Guidelines for customizing biblatex styles says: > Finally, assuming that I'll want to use my style adjustments in a multitude > of documents: Where do I put the relevant macro stuff? The recommended answer is a copy of biblatex.cfg in one's local texmf tree. However, _going away_ from above precondition: **What are all the places** , i.e. file types and respective locations, **where I can put`biblatex` style modifications?** I know you can write your own bbx and cbx styles, and there's probably a way to put modifications directly in a tex file? What are the limitations, advantages and disadvantages of each of these, which kind of modification typically goes where, which overrule others ...?


title: \phantom causes a spacing issue between paragraghs

text: Could anybody tell me why does `phantom` command create paragraph spacing issues as described in this thread: > This sort of code >   >   >     Vin.\ i zvat.\ mn.\ imaju akcente kao i im.\ mn.: \emph{zȗbe : zȗbi}, >     \emph{knȅzove : knȅzovi}, \emph{púževe} i t.\ d. >   >     \phantom{a}\symbol{"0311} na ˊ u svima padežima osim onih koji će se >     na po se spomenuti, n.\ p.\ \emph{strȋc} ima u rod.\ jed.\ > \emph{stríca}, dat.: >     \emph{strícu}, vin.: \emph{stríca}, tvor.: \emph{strícem}, skaz.: > \emph{strícu}; >     tako \emph{dvȏr} ima u im.\ mn.\ \emph{dvóri} i \emph{dvórovi}, i t.\ d. >   > > produces > > ![enter image description here](http://i.stack.imgur.com/X05do.png) > > Why the such a big space between the paragraphs? Does anybody know?


title: Comma in legend in pgfplots

text: The following code with the comma in the legend entry fails to compile.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}       \begin{axis}[        legend entries =  {$a, b$} , %<- error!       title = {$a, b$},       xlabel = {$a, b$}       ]            \addplot {x};            \end{axis}     \end{tikzpicture}          \end{document}      I have added additional curly brackets around the expression as needed by tikz (e.g. here Comma in the formula in tikz). Weird enough, the error only seems to appear, when using a comma in the legend, as labels and titles work fine. Is this a bug in the parser or am I missing something?


title: Align columns, last vertical line bug and add row height

text: This is my table: ![https://dl.dropboxusercontent.com/u/52838329/tabular.png](http://i.stack.imgur.com/oGvkv.png) I have a few problems:   1. I want both columns to take each 50% of the page width (excl margin), but the second column's text needs to be aligned right.   2. The last vertical line is not correctly placed   3. The first and last row need to be a bit higher so the text fits better.              \begin{tabularx}{\textwidth}{|p{0.5\textwidth}|p{0.5\textwidth}|}     \hline     \textbf{{\Large Activa}} & \textbf{{\Large Passiva}}\\ \hline     \hline      \textbf{Aanwendingsvormen} van het vermogen & \textbf{Vermogensbronnen}\\          \begin{itemize}     \item Bezittingen     \item Vorderingen     \end{itemize}     &     \begin{itemize}     \item Eigen vermogen     \item Vreemd vermogen     \end{itemize}\\          \textbf{Ondernemingsmiddelen} & \textbf{Ondernemingsbronnen}\\     Welke middelen heeft de onderneming om haar activiteit te ontwikkelen? & Hoe financiert de onderneming de ondernemingsmiddelen.\\     \hline \hline     \textbf{{\Large Vermogen} van de onderneming} & \textbf{{\Large Vermogen} van de onderneming}\\\hline     \end{tabularx}      I didn't find anything on this, so any help is appreciated!


title: How can I get rid of an Underfull \hbox message in my macro?

text: I can't find the reason for getting this message:               Underfull \hbox (badness 10000) in paragraph      This is my test case:               \newcommand{\ruler}{\noindent\rule[1ex]{\textwidth}{1pt}\\}     \newcommand{\rulercap}[1]{\ruler{\Large #1\hfill\\}\ruler}          \rulercap{test caption}


title: lstlisting with c++: spaces around scope resolution operator

text: I am having a hard time to make the output of _lstlisting_ for c++ source look good. Currently, I am stuck with a problem to reduce the amount of space around the scope resolution operator `::`. See the following example:               \documentclass{article}     \usepackage{listings}          \lstset{ %     language=C++,     basicstyle=\footnotesize,     captionpos=b,     }          \begin{document}          \begin{lstlisting}       hello::world     \end{lstlisting}          The amount of space \lstinline{is::too} damn high.          \end{document}      The output of this is shown in the picture below, where I marked the spaces that upset me. ![spaces around the scope-resolution operator](http://i.stack.imgur.com/iKMD3.png). Do you guys know a way to configure this behaviour? I couldn't find something in lstlistings documentation.


title: TeX to image over command line

text: I'd like to generate an image with math formulas with TeX from command line. Something like:               $ tex-executable "E=\frac{m_1v^2}{2}" e2.png      I have MacTex 2009 installed and I'm pretty sure that something like that already exists in this distribution. If not please suggest me a tool.


title: Draw a line through one column of a matrix

text: I'd like to "cancel" (draw a line through) a column of a matrix (using `\begin{pmatrix}..\end{pmatrix}`). How can I do this?


title: Horizontal bar-charts in PGFPlots: "point meta" messes with alignment

text: I'm drawing a rather unusual bar-chart to display the results of a small survey. The axis of the chart extends in both the negative and the positive domain. However, there is no zero and all values are positive. That sounds rather complicated, so here's a picture: ![TextA](http://i.stack.imgur.com/alNgm.png) It would be nice to see the actual values. Section 4.4.4 of the PGFPlots- manual advises to use `nodes near coords, nodes near coords align = {horizontal}` in those cases. Here's the result: ![TextB](http://i.stack.imgur.com/XjbfB.png) This looks nice, but the values are obviously wrong. To trick the bar-chart into forgetting that there's actually no zero-value present, I change the x-ticks in the plot-style and subtract 1. The displayed value next to the bars is therefore the coordinate for PGFPlots and the only one I input. Now, there are two options: calculating it during compilation as `|x|+1` (first picture) or adding the correct value explicitly (second picture): ![TextC](http://i.stack.imgur.com/dqkBE.png) ![TextD](http://i.stack.imgur.com/TxSYq.png) Both options mess up the layout in different ways and I could not figure out how to position the nodes correctly. Here's the code of the MWE, which generates the shown graphs:               \documentclass[11pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{pgfplots}     \usepackage{floatrow}     \usepackage{subfigure}          \pgfplotsset{TestBar/.style={% Overall settings         width = 0.75\textwidth,         line width=1pt,         tick style={line width=0.8pt},         xmin = -8, xmax = 8,         xtick       = {-8,-6,-4,-2, 0, 2, 4, 6, 8},         xticklabels = { 9, 7, 5, 3, 1, 3, 5, 7, 9},         xmajorgrids = true,         minor x tick num = 1,         tick align = outside,         xtick pos = left, ytick pos = left,         xbar,         height = 3cm,         enlarge y limits = 0.5, ytick = {1,2},         yticklabels = {C2, C1}}     }          \pgfplotsset{TestBarY/.style={% Draw y-Axis without anything         width = 0.75\textwidth,         height = 3cm,         line width = 1pt,         xmin = -8, xmax = 8,         xmajorgrids = false,         xtick = \empty, ytick = \empty,         no markers,         minor x tick num = 1,         axis y line* = center}     }          \pgfplotsset{TextA/.style={}}% Show no values          \pgfplotsset{TextB/.style={% Show value as given in the coordinates.         nodes near coords,         nodes near coords align = {horizontal}}     }          \pgfplotsset{TextC/.style={% Calculate value in point-meta.         nodes near coords,         nodes near coords align={horizontal},         point meta = {abs(x)+1}}     }          \pgfplotsset{TextD/.style={% Caption explicitly added in point-meta.         nodes near coords,         nodes near coords align={horizontal},         point meta = explicit symbolic}     }          \begin{document}          \begin{figure}[htb]     \subfigure[TextA: no text.]{     \begin{tikzpicture}         \begin{axis}[TestBar]             \addplot[TextA] coordinates { (2.555,1) (-1.279,2) };         \end{axis}              \begin{axis}[TestBarY]\addplot coordinates {(0,0)};\end{axis}     \end{tikzpicture}}\\          \subfigure[TextB: node-text from coordinates.]{     \begin{tikzpicture}         \begin{axis}[TestBar]             \addplot[TextB] coordinates { (2.555,1) (-1.279,2) };         \end{axis}              \begin{axis}[TestBarY]\addplot coordinates {(0,0)};\end{axis}     \end{tikzpicture}}\\          \subfigure[TextC: node-text calculated in \emph{point meta} as abs(x)+1.]{     \begin{tikzpicture}         \begin{axis}[TestBar]             \addplot[TextC] coordinates { (2.555,1) (-1.279,2) };         \end{axis}              \begin{axis}[TestBarY]\addplot coordinates {(0,0)};\end{axis}     \end{tikzpicture}}\\          \subfigure[TextD: node-text explicitly added to \emph{point meta}.]{     \begin{tikzpicture}         \begin{axis}[TestBar]             \addplot[TextD] coordinates { (2.555,1) [3.56] (-1.279,2) [2.28] };         \end{axis}              \begin{axis}[TestBarY]\addplot coordinates {(0,0)};\end{axis}     \end{tikzpicture}}     \end{figure}          \end{document}


title: Micro-graphics inline in text

text: Can I insert a graphic in-line in a sentence? * * * Use case: I'm writing a manual that involves navigating the Windows Start Menu. I would like to insert a little graphic of the start menu in-line in the text. I am aware of a `sparklines` package that does something similar, but have not been able to distill that to a simple example. Is there a macro or command that can help with this? In addition (and I hope this is a valid part of the question, but am happy to post it as a new question) I would like a shortcut or command to display the Windows Start Menu plus `n` steps of navigation, so I could write the following:               Some paragraph and then \WinMenu{Start}{Programs}{Foo}{Bar}{Baz.exe} and then more text.      or               Lorem ipsum \WinMenu{Programs,Foo,Bar,Baz.exe} and then more text.      or something similar, and the result in the PDF will be stylized somehow, with the little Start Menu box icon (shown as "GRAPHIC" below), and then, for example, in bold or `\tttext` fonts, `GRAPHIC > Foo > Bar > Baz.exe` as part of and embedded in the existing sentence.


title: Drawing Feynman Diagrams with feynMP

text: I'm trying to draw the higgs decay to two gluon diagram ![higgs to two gluon](http://i.stack.imgur.com/zn4aN.jpg) but I want gluons to go straight right and take top quark label in the middle of the loop on the line. my script is as follows:               \usepackage{feynmp-auto}     \begin{fmffile}{h_gg}     \begin{fmfgraph*}(150,150)     \fmfleft{i1}     \fmfright{o1,o2}          \fmflabel{$h$}{i1}     \fmflabel{$g$}{o1}     \fmflabel{$g$}{o2}          \fmf{dashes_arrow}{i1,v1}     \fmf{quark,label=$t$}{v1,v2}     \fmf{quark,label=$t$}{v2,v3}     \fmf{quark,label=$t$}{v3,v1}     \fmf{gluon}{v2,o1}     \fmf{gluon}{v3,o2}     \fmf{phantom}{o1,o2}     \fmfdot{v1,v2,v3}     \end{fmfgraph*}     \end{fmffile}      Please note that the big dot is just because of me its nothing to do with latex. Also is there a possibility that I can change the angle between outputs in a LO decay diagram, for instance, higgs to bbbar which can be;               \begin{fmffile}{two_body}     \begin{fmfgraph*}(70,70)     \fmfleft{i1}     \fmfright{o1,o2}     \fmflabel{$h$}{i1}     \fmflabel{$b,c,\tau$}{o1}     \fmflabel{$\bar{b} ,\bar{b} ,\bar{\tau}$}{o2}     \fmf{dashes_arrow}{i1,v1}     \fmf{quark}{v1,o1}     \fmf{quark}{v1,o2}     \end{fmfgraph*}     \end{fmffile}      Thanks.


title: Adding horizontal space between plots in pgfplot

text: I couldn't find any solution for adding horizontal space between two plots in pgfplots. The xshift thing didn't help. Here's the code:               \documentclass{sigplanconf}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usetikzlibrary{patterns}     \newcommand{\benchmark}{\textsf}     \usepgfplotslibrary{groupplots}     \usepackage{tikz}          \begin{document}          \pgfplotstableread{     1   identityOnly    both    otherOnly   average     a   0.00035173  0.00000422  0.00924541  0.12608777     b   0.00414079  0.00004965  0.10757113  0.00710518     c   0.00151162  0.00001813  0.04330784  0.13753664     d   0.00217766  0.00002526  0.06139371  0.00758067     e   0.00020642  0.00000249  0.00522527  0.00284578     f   0.00031703  0.00000380  0.02087894  0.00136650     g   0.00027212  0.00000324  0.00792774  0.00048840     h   0.10207314  0.00117326  2.63160651  0.22854330     i   0.05835732  0.00069973  1.47180476  0.34421183     j   0.00037218  0.00000434  0.01114818  0.00066935     y   0.03092297  0.00076165  1.36742588  0.09255707     }\america          \pgfplotstableread{     2   identityOnly    both    otherOnly   average     a   0.00177559  0.00003829  0.01138671  0.59759797     b   0.00234154  0.00004846  0.01488595  0.03278631     c   0.18083768  0.00392767  1.16344514  0.48364955     d   0.01192064  0.00026252  23.04508701 0.34154430     e   0.00642905  0.00013141  0.04140265  0.61546999     f   0.00331963  0.00008098  0.02224024  0.18646432     g   0.00325105  0.00006975  0.02156987  0.00076972     h   0.00220147  0.00004353  0.01544681  0.00065892     i   0.48762922  0.01007653  3.16949441  0.11817139     j   0.00368832  0.00007947  0.02380314  0.00196147     z   0.00385464  0.00212952  0.666095    0.494621     }\europe               \begin{figure}       \centering     \begin{minipage}{0.45\columnwidth}     \centering     \begin{tikzpicture}[scale = .5, transform shape]     \begin{axis}[      ybar stacked,      axis x line*=bottom,       symbolic x coords={a,b,c,d,e,f,g,h,i,j,y},      ymin=0,       xticklabel = {\benchmark{\tick}},      yticklabel={ $\pgfmathprintnumber{\tick}\,\%$ },      xtick=data,      x tick label style={rotate=45,anchor=east,font=\Large},      y tick label style={font=\Large},      title style={font=\Large},      xtick align=outside,      ytick align=inside,      every node near coord/.append style = {        anchor = west, yshift = -2pt,        rotate = 90,        font = {\Large},        /pgf/number format/fixed,      }, title={1},      cycle list = {        { fill = gray },        { fill = darkgray },        { fill = lightgray },      }]      \addplot table [x index=0, y index =1] {\america};      \addplot table [x index=0, y index =2] {\america};      \addplot+[nodes near coords, point meta=explicit] table [x index=0, y index =3, meta index=4] {\america};     \end{axis}     \end{tikzpicture}     \end{minipage}     \begin{minipage}{0.45\columnwidth}     \centering     \begin{tikzpicture}[scale = .5, transform shape]     \begin{axis}[      xshift=3mm, ybar stacked,      axis x line*=bottom,       symbolic x coords={a,b,c,d,e,f,g,h,i,j,z},      ymin=0,       xticklabel = {\benchmark{\tick}},      yticklabel={ $\pgfmathprintnumber{\tick}\,\%$ },      xtick=data,      x tick label style={rotate=45,anchor=east,font=\Large},      y tick label style={font=\Large},      title style={font=\Large},      xtick align=outside,      every node near coord/.append style = {        anchor = west,    rotate = 90,        font = {\Large},        /pgf/number format/fixed,      }, title={2},      cycle list = {        { fill = gray },        { fill = darkgray },        { fill = lightgray },      }]      \addplot table [x index=0, y index =1] {\europe};      \addplot table [x index=0, y index =2] {\europe};      \addplot+[nodes near coords, point meta=explicit] table [x index=0, y index =3, meta index=4] {\europe};          \end{axis}     \end{tikzpicture}     \end{minipage}     \label{fig:hashed-objects2}     \end{figure}     \end{document}      It produces the following plot: ![enter image description here](http://i.stack.imgur.com/fTKos.png) I want to add more horizontal space between the two. I've already read this Using pgfplots, add vertical/horizontal spacing between plots?, but in my case I have different scales on y axis and I've read this How can I add space between two separate plots, using pgfplots? it also didn't help. I'm fighting the problem already for hours.. Would appreciate your help.


title: Scale one dimension of EPS and preserve label font and size

text: I'm importing .eps in LaTeX. I want to resize image to fit my purposes. I want to do that only by one scale, _X_ or _Y_ (disproportional). The problem is that labels (font and size) become distorted. Is there some way to change _one_ scale (e.g. width) and to keep labels as they in original?


title: Equations with text and math interpersed

text: This is related to the question I asked here: Equations with only text in them Basically I want to have an equation with a lot of text and some math in them. I don't want to use `\mbox` because there is a lot of text and it may start going out of the line. In the linked question a solution is provided using `\parbox` but I want to use math also in the middle. For example:               \begin{equation}\label{key}       The product of two complex numbers z_1,z_2\in\mathbb{C} is given by the vector whose       angle is the sum of the angles of the two complex numbers,        i.e. arz(z_1z_2)=arg(z_1)+arg(z_2) and whose magnitude is the product of the                 magnitudes of the two complex numbers, i.e. |z_1z_2|=|z_1||z_2|     \end{equation}      How do I accomplish this?


title: Index does not print

text: I'm currently trying to add an index to my `.tex` file but it never appears in my pdf document.               \documentclass[11pt]{book}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{graphicx}     \usepackage{dsfont}     \usepackage[dutch]{babel}          \usepackage{cases}     \usepackage{color}               \newtheorem{stell}{Stelling}[section]     \newtheorem{gev}{Gevolg}[section]     \newtheorem{lemm}{Lemma}[section]     \theoremstyle{definition}     \newtheorem{defn}{Definitie}[section]     \newtheorem{vb}{Voorbeeld}[section]          \usepackage{hyperref}     \hypersetup{         colorlinks,         citecolor=black,         filecolor=black,         linkcolor=black,         urlcolor=black     }          \usepackage{makeidx}     \makeindex          \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhf{}     \fancyhead[L]{\nouppercase{\leftmark}}     \fancyfoot[C]{\thepage}               \title{Book}          \begin{document}     \maketitle     \tableofcontents     \chapter{First chapter}     \section{First section}\index{first section}          \printindex     \end{document}      **Edit** I had forgotten to add the `\printindex' in my message. But it was allready in my tex-file.


title: Order of appendices

text: I'm not sure whether it fits on TeX.SE or some other SE site, but anyways: I wonder whether there's a good standard on the order of the common appendices when writing the thesis. I have in mind the following:   * Table of Contents   * Index   * Bibliography   * List of Figures and Tables   * List of mathematical notation


title: Subscripts and superscripts

text: In LaTeX2 `a_1`, `a_{123}` and `a^1`, `a^{123}` used to produce subscripts and superscripts respectively. In LaTeX3 superscripts still work the same way, but what happened to subscripts? I suspect the prominent role underscores play in LaTeX3 names has made a change necessary. I tried `\\_` without success.


title: How to create a blanks diagram for counting problems?

text: How can I create a blanks diagram for simple counting problems? What I have in mind is something like this:               \documentclass{article}     \begin{document}     \begin{tabular}{ccccccc}         \underline{\phantom{abc}} & &         \underline{\phantom{abc}} & &         \underline{\phantom{abc}} & &         \\         3 & $\cdot$ & 2 & $\cdot$ & 1 & $=$ & 6 ways         \\     \end{tabular}     \end{document}      However, the spacing of that is kind of terrible. Unfortunately I don't know what this kind of diagram is called (if it has a name), and I haven't had any luck searching for packages or advice for making "blanks diagrams."


title: Make hyperlinks clickable in a DVI converted to PDF

text: I have a legacy system that "generates" documentation for one of our systems. The resulting DVI file is then converted to PDF using dvipdfm. The DVI contains URLs, but those aren't clickable in the PDF. I'm not sure if the hyperlinks are marked in the DVI. When the system generates HTML the links are clickable, but that markup might already be lost in the DVI and a tool might have to make everything starting with http:// clickable. Is there such a tool ?


title: Skip one subfigure

text: I want to create subfigs like this. The first image in the second row is skipped (also the numbering) and images are vertically aligned. Could someone help for this? ![](http://i.stack.imgur.com/yYdEN.png)


title: Footer/Header for first page of two column article

text: How can I add a footer and header just on the first page of a two column scientific article of type `\documentclass[conference]{IEEEtran}` and/or `\documentclass{article}`?


title: Set/Add subfigure counter

text: I need to change the counter for the second figure and both subfigures. For figure it works but not with subfigures. tnx a lot               \documentclass[]{article}     \usepackage{subcaption}               \begin{document}         \begin{figure}[h]             \caption{new}         \end{figure}              \begin{figure}[ht]             \begin{subfigure}[t]{.45\linewidth}                 \caption{subfigure A}             \end{subfigure}                  \begin{subfigure}[t]{.45\linewidth}                 \caption{subfigure B}             \end{subfigure}     \caption{new}         \end{figure}              \addtocounter{figure}{-1}    %works         \addtocounter{subfigure}{+2}         %doesnt work              \begin{figure}[htb]             \begin{subfigure}[t]{.45\linewidth}                 \caption{subfigure should be c instead of a, addtocounter for subfigure doesnt work}             \end{subfigure}                  \begin{subfigure}[t]{.45\linewidth}                 \caption{subfigure should be d instead of b, addtocounter for subfigure doesnt work}             \end{subfigure}             \caption{number should like the figure before, addtocounter for figure works}         \end{figure}     \end{document}      ![enter image description here](http://i.stack.imgur.com/NBQgt.jpg)


title: LYX- Change title of “Acknowledgments” in LYX

text: In Lyx, section Acknowledgments, I need to change the title displayed as "Acknowledgements" in the pdf. How can I do that ?


title: Page number in the margin note

text: I've seen some books that have the page number in the middle of the page, in the margin note; i think it make it easier to look for a particular (IMHO). Is there any chance to do this in LaTeX?


title: drawing path in foreach loop with pgfsetmacro

text: I have N points on a circle, I want to draw the intersection of the convex hulls of all sets of N-k consecutive points. The points are not evenly spaced. The values of N and k (and the actual angles of each point) will change, so I'd rather not have a hard-coded solution. Here is the best I've come up with. The silly way does exactly what I want, but it involves a lot of cut-and-paste every time. I don't understand why the second way fails; I've read that variables in \foreach loops don't quite behave as variables (I think), but I can't figure out a way around this.               \documentclass{article}     \usepackage{tikz}               \begin{document}          \begin{tikzpicture}[every node/.style={draw,inner sep=0mm}]            \def\rad{5cm}       \def\k{2}       \def\N{6}                 \node (x1) at (15:\rad) {} ;       \node (x2) at (45:\rad) {} ;       \node (x3) at (90:\rad) {} ;       \node (x4) at (120:\rad) {} ;       \node (x5) at (210:\rad) {} ;       \node (x6) at (270:\rad) {} ;                 %%% draw all the lines from xi to x(i+k)       \foreach \i in {1,2,3,4,5,6} {         \pgfmathtruncatemacro{\j}{1+mod(\i-1+\k,6)}         \draw (x\i) -- (x\j) ;       }                 %%% draw the intersection of all convex hulls of 5 consecutive points among the six       %%% this is a silly way       \clip (x1.center) -- (x2.center) -- (x3.center) -- (x4.center) -- (x5.center) -- cycle ;       \clip (x2.center) -- (x3.center) -- (x4.center) -- (x5.center) -- (x6.center) -- cycle ;       \clip (x3.center) -- (x4.center) -- (x5.center) -- (x6.center) -- (x1.center) -- cycle ;       \clip (x4.center) -- (x5.center) -- (x6.center) -- (x1.center) -- (x2.center) -- cycle ;       \clip (x5.center) -- (x6.center) -- (x1.center) -- (x2.center) -- (x3.center) -- cycle ;       \fill (x6.center) -- (x1.center) -- (x2.center) -- (x3.center) -- (x4.center) -- cycle ;                      %%% draw the intersection of all convex hulls of N-k+1 consecutive points among the N       %%% this is the code I think should work but doesn't       %%% error message: ! Package tikz Error: Giving up on this path. Did you forget a semicolon?.       \foreach \a in {1,...,\N}{         \pgfmathsetmacro{\b}{1+mod(\a+\k,\N)}         \draw (x\a) -- (x\b)         \foreach \x in {\k,...,\N} {           \pgfmathtruncatemacro{\xp}{1+mod(\a+\x-1,\N)}           \pgfmathtruncatemacro{\xq}{1+mod(\a+\x,\N)}           (x-\xp) -- (x-\xq)         } ;       }          \end{tikzpicture}               \end{document}


title: Why does a figure capture a whole page?

text: I have a figure in a whole page, even though I do not intend it to capture a whole page. There is a lot of white space around it, and I definitely think there could be some text surrounding it. Is there a way to force a figure not to use a whole page if there is still some white space around? (this is a two column document, if that helps. I am using figure* to stretch the figure across the two columns.)


title: Error when including \usepackage{hyperref}

text: I'm new to LaTeX and trying to use `hyperref`, and having trouble with `\usepackage{hyperref}`. As recommended in posts, I included `\usepackage{hyperref}` as the last `\usepackage{}` instruction. No other problem when I comment out `\usepackage{hyperref}`. I've successfully compiled the testams.tex document that came with the `hyperref` download from TUG and uses               \usepackage[%       verbose,       colorlinks=true,       naturalnames=true,       linkcolor=blue,     ]{hyperref}      I am receiving this error:               !Latex Error: \RequirePackage or \LoadClass in Options Section      This is my preamble and document structure:               \documentclass[11pt,reqno]{report}     \usepackage{geometry}                      \geometry{letterpaper}                   % ... or a4paper or a5paper or ...      %\geometry{landscape}                 % Activate for for rotated page geometry          \usepackage[parfill]{parskip}         \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{amsmath, amsthm}     \usepackage{epstopdf}     \usepackage[onehalfspacing]{setspace}     \usepackage[comma,authoryear]{natbib}     \usepackage{titling}     \usepackage{url}     \usepackage{caption}    % Activate to format captions     \captionsetup[table]{font=bf}   % Make table captions bold     %\usepackage[format=hang,font={small,bf}]{caption}  %Makes all captions bold          \usepackage{hyperref}          \title{Title}     \subtitle{Subtitle}     \author{New Author}     \date{\today}                        \begin{document}          \maketitle          \tableofcontents          \chapter{Begin}          \section{Continue}          \begin{table}[htbp]       \begin{center}       \caption{Caption}         \begin{tabular}{ccc}         %table         \end{tabular}       \label{tab:first}       \end{center}     \end{table}          \newpage     \appendix     \chapter{App 1}     \section{App 1.1}     Lots of tables.          \pagebreak          \begin{singlespace}          \bibliographystyle{plainnat}          \bibliography{bibliography}          \end{singlespace}     \end{document}


title: Math Formation/Graphical Visualization of a function with many included functions

text: I hope I can put this the right way: What I want from LaTeX is for example: ## Example               a+b*c=       | a=1+2       | b=g*2+3       ||g=2b       |||g=3       |c= 4+d       ||d=3        and the | should be connected. Like a normal list with tabulator spaces. Or if there is another way to show an equation as some kind of graphic that is connected. What I found was `xypic` but this is not really what I'm looking for. I could do it with a table, with the first column being connected and in there's a big vertical line, …. Do you know something? Do you have any tip? This is not just for pure maths.


title: Using text figures in technical and scientific documents

text: Many sources, such as Bringhurst and other style guides, recommend using text figures everywhere except all-caps text. This would seem reasonable for documents containing a lot of regular text, such as books and novels. But how much does this recommendation hold for documents that contain a lot of math formulae intertwined with text, such as textbooks and scientific reports? Of course, using text figures in math proper is wrong, but what about text figures in text and lining figures in math? Is it better/worse than using lining figures everywhere?


title: How do I remove spurious parentheses from a macro argument?

text: I want to store the argument of a macro in a temporary variable, but I know in advance that some people will incorrectly enclose the argument in parentheses as well as braces (long story). Specifically, some users will say something like                \bernard{abc}      while others will say               \bernard{(abc)}      I want the macro `\bernard`to store the string `abc` in the temporary variable in both cases. How do I achieve this?


title: TikZ matrix positioning voodoo with column sep

text: I have tried many different things and I just can't wrap my head around how to work around the fact that the column sep option to TikZ's `\matrix` command changes the positioning of the matrix on the page. The code for my (rather large) picture is below with some added comments. I would like to have a larger column sep than here (such as the 4em that's commented out below) while having the picture positioned such that the arrows down the middle are centered on the page. I can't see how this is possible without some _ugly_ `\hspace` trial and error.               \documentclass[a4paper,11pt]{article}          \usepackage{tikz,relsize,mathtools}     \usetikzlibrary{matrix,arrows,shapes}     \usepackage{units}     \newcommand\onehalf{\nicefrac{1}{2}}          \begin{document}     \thispagestyle{empty}     \begin{center}{\huge\textbf{Separation Properties}}\end{center}     %     \vspace{1ex}     \begin{tikzpicture}     \tikzstyle{every node}=[font=\small]     \matrix (m) [nodes={draw,rectangle,thin,fill=blue!10},%                  row sep=1.7em,%column sep=4em,% Uncomment this to see m move around                  text depth=0.25ex,%                  draw=red] % Comment this out to not see the outline of the matrix     {%     \node (Met) {Metrizable};              & \node (T6) {P.\@ Normal Hausdorff (T$_{\smash[b]{6}}$)}; & \node (PN) {P.\@ Normal}; \\     \node (Ord) {Total order};             & \node (T5) {C./H.\@ T$_4$ (T$_{\smash[b]{5}}$)};         & \node (HN) {C./H.\@ Normal}; \\     \node (CH) {Cpt.\@ Hausdorff};         & \node (T4) {Normal Hausdorff (T$_{\smash[b]{4}}$)};      & \node (Norm) {Normal}; \\     \node (LCH) {Loc.\@ Cpt.\@ Hausdorff}; & \node (T3h) {Tychonoff (T$_{\smash[b]{3\onehalf}}$)};    & \node (CReg) {C.\@ Regular}; \\     \node (FH) {F./C.\@ Hausdorff};        & \node (T3) {Regular Hausdorff (T$_{\smash[b]{3}}$)};     & \node (Reg) {Regular}; \\                                            & \node (T2h) {Urysohn (T$_{\smash[b]{2\onehalf}}$)}; \\                                            & \node (T2) {Hausdorff (T$_{\smash[b]{2}}$)};             & \node (PReg) {Preregular (R$_1$)};\\                                            & \node (T1) {T$_{\smash[b]{1}}$}; \\                                            & \node (T0) {T$_{\smash[b]{0}}$}; \\     };     \path[->,thin]     (T3h)  edge [bend left=90]  node[fill=white,inner sep=2pt,pos=0.25]{$\scriptstyle\beta$} (T5)     (T0)   edge [bend right=60] node[fill=white,inner sep=2pt]{\scriptsize+R$\scriptstyle_1$} (T2)     (PReg) edge [bend right=60] node[fill=white,inner sep=2pt]{\scriptsize+Loc.~Cpt.} (CReg)     (Reg)  edge [bend right=80] node[fill=white,inner sep=2pt,pos=0.70]{\scriptsize+Lindel\"{o}f} (Norm)     (Reg)  edge [bend right=80] node[fill=white,inner sep=2pt,pos=0.75]{\scriptsize+2nd count.} (HN);     \path[->,thick]      (T6)   edge node[]{} (T5)  (T6)  edge node[]{} (PN)     (T5)   edge node[]{} (T4)  (T5)  edge node[]{} (HN)     (T4)   edge node[auto]{\smaller UL} (T3h)          (T4)  edge node[]{} (Norm)     (T3h)  edge node[]{} (T3)  (T3h) edge node[]{} (FH)   (T3h) edge node[above,midway]{\smaller KEQ} (CReg)     (FH)   edge node[]{} (T2h)     (T3)   edge node[]{} (T2h) (T3)  edge node[above,midway]{\smaller KEQ} (Reg)     (T2h)  edge node[]{} (T2)     (T2)   edge node[]{} (T1)  (T2)  edge node[above,midway]{\smaller KEQ} (PReg)     (T1)   edge node[]{} (T0)     (PN)   edge node[]{} (HN)     (HN)   edge node[]{} (Norm)     (CReg) edge node[]{} (Reg)     (Reg)  edge node[]{} (PReg);     \path[->,thick]     (Met) edge node[]{} (T6)     (Ord) edge node[]{} (T5)     (CH)  edge [preaction={draw=white,-,line width=6pt}] node[]{} (T4)  (CH)  edge node[]{} (LCH)     (LCH) edge node[]{} (T3h);     \end{tikzpicture}     \end{document}


title: LyX table border colour

text: I have a multi-row table in LyX, with black horizontal borders at the top and bottom of the table. I would like to insert other horizontal borders inside the table that are grey rather than black. Does anyone know how to accomplish this? I have tried looking in the manuals and online forums to no avail so far.


title: Only input file if it exists

text: > **Possible Duplicate:**   >  Expandable version of \InputIfFileExists or \IfFileExists I am writing a LaTeX file where I input other LaTeX files (if and only if its exits, otherwise it should not include that file). _**_* TFout_1.tex exist* _*_ ** _*_** _**_* TFout_2.tex doesn't exist* _*_ ** _*_**               \documentclass{article}     %% Deutsche Anpassungen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage[ngerman]{babel}               \begin{document}     \centering     \begin{table}     \caption{ }     \begin{tabular}{l l}           TAL& \input{./TFout_1.tex}            \end{tabular}     \end{table}     \centering          \InputIfFileExists{TFout_1.tex}     {     \begin{table}     \caption{ }     \begin{tabular}{l l}          \InputIfFileExists{TFout_1.tex}     \end{tabular}     \end{table}          }          \centering     \InputIfFileExists{TFout_1.tex}     {     \begin{table}     \caption{ }     \begin{tabular}{l l}          \InputIfFileExists{TFout_2.tex}     \end{tabular}     \end{table}                    \end{document}      Contents of file TFout_1.tex:               \begin{small}\begin{tabular}{|C{2cm}|C{2cm}|C{2cm}|}     \hline     \textbf{Datum}&\textbf{Grenzwert}&\textbf{Trend}\\\hline     06.12.2012 04:04&-20&Unterschritten\\\hline     06.12.2012 04:19&-20&Unterschritten\\\hline     \end{tabular}     \end{small}


title: Use cleanthesis theme: french accent problem on MacOS X

text: I use the "cleanthesis" (http://cleanthesis.der-ric.de/) theme to write a French traineeship report but I have a problem with the accents. My é are convert to Ó (with double quote) I use these packages because I am on MacOS X:               \usepackage[applemac]{inputenc}     \usepackage[francais]{babel}     \usepackage[T1]{fontenc}      Please can you give me few leads?


title: Plotting an arbitrary function in latex

text: I would like to know how I can replicate the diagram below in latex. thanks. ![](http://i.stack.imgur.com/lBhuW.gif) Edit: I can plot a function using tikz/pgfplots if I know how the function is defined. Unfortunately, I don't know how the function is defined in this case.


title: Setup Synctex with Emacs in Windows with Sumatra PDF

text: > **Possible Duplicate:**   >  A simpleton's guide to (…)TeX workflow with emacs I want to setup SyncTeX in GNU Emacs 23.3.1 with Auctex 11.86 to work with Sumatra PDF 2.0.1. I use Windows XP and MiKTeX 2.8. I've tried a lot of things but i can not make it work. There must be some wizard here that can help me :)


title: Iterate over all defined PGF keys

text: Is there a way to iterate over all PGF keys that have been defined previously? My idea is to capture the value of all keys in order to do Proper nesting of tikzpicture environments: Reset all PGF values to their defaults. **EDIT** : I imagine something along these lines:               \documentclass{article}     \beginrecordallpgfkeys     \usepackage{tikz}     \endrecordallpgfkeys          \begin{document}       \restoreallrecordedpgfkeys     \end{document}      I wouldn't mind if recording and restoring would use a temporary file.


title: Old-style figures: Use in references/brackets (e.g. to equations, bibliography) or not?

text: In my documents I usually use old-style figures for "non-mathematical" numbers. By this I mean for example dates, page numbers, telephone numbers and the like. For tables, results of equations etc. I generally use lining figures, to distinguish them from the other numbers and to make it easier to recognize the magnitude. I usually do this with the `\num{}` command provided by `siunitx`. Using OSF by default sometimes looks a bit odd, though. Consider for instance the case of putting an OSF between brackets for referencing. Here are two examples: ![Properly filled brackets and odd OSF.](http://i.stack.imgur.com/wN2Fn.png) ![Properly filled brackets and odd OSF.](http://i.stack.imgur.com/zdKy7.png) As you can see, lining figures nicely fill up the brackets, they seem to fit into them. The OSF (2) and (3) look odd though, for example there is a dissymmetry in the (3) because it stretches below the bracket and there is a space above it. This is even more so the case with the [189] in the second example. The 9 even extents until below the bracket! My specific question is now how to handle this case. Is what I have shown here fine? Should I use OSFs for my main text, but then lining figures in such brackets? If yes, would this not look inconsistent? Should I not use OSFs at all? Or is there another fix?


title: Is it possible to load 2 or more languages at the same time in one document using listings.sty?

text: Assume in my book I am discussing two (or more) languages, e.g. PSTricks and LaTeX. Can I load these languages at the same time in my book document such that their keywords get proper markup?


title: I don't use \centering, but why must I use \arraybackslash in my table?

text: I don't use `\centering` or `\Centering` in my table below. ![alt text](http://i.stack.imgur.com/sXG1M.png) But I will get errors if I don't insert `\arraybackslash`. Question:   1. What is `\arraybackslash` for? It seems so mysterious for me.   2. Why must I insert `\arraybackslash` in place labeled (3) that is shown in my code snippet below? Why must it be put in place (3) rather than (1), (2), or (4)? * * *               \documentclass{minimal}     \usepackage[a4paper,margin=10mm,showframe]{geometry}     \usepackage{lipsum,calc,xcolor}     \usepackage{array,longtable}     \setlength{\tabcolsep}{5mm}     \setlength{\arrayrulewidth}{5mm}          \newcolumntype{A}[1]     {%             >{%                                       \begin{minipage}{#1\textwidth-1.5\arrayrulewidth-2\tabcolsep}%                     \vspace{\tabcolsep}%              }%             c%             <{%                 \vspace{\tabcolsep}%                  \end{minipage}%              }%     }%     \begin{document}     \color{red}%     \begin{longtable}{%         |%             %>{\arraybackslash}%(1) => Not Needed              A{0.5}%             %<{\arraybackslash}%(2) => Not Needed           |%             >{\arraybackslash}% (3) => Mandatory!             A{0.5}%             %<{\arraybackslash}%(4) => Not Needed         |%     }%     \hline     \lipsum[1] & \lipsum[2]\\\hline     \lipsum[1] & \lipsum[2]\\\hline     \lipsum[1] & \lipsum[2]\\\hline     \end{longtable}     \end{document}


title: Lookbehind (Regex) in TeXworks

text: I'm using TeXworks (Version 0.4.5) and came in touch with its regular expression (regex) feature, recently. I made some adjustments of the syntax- highlighting, for instance, to practice. Now I'm asking: **Is it possible that TeXworks doesn't support the lookbehind`(?<= )` expression?** At least in the Find&Replace dialogue? Because my regex-input gets marked "invalid" as soon as I try to use it there. Also, the TeXworks-manual doesn't list the lookbehind-, but it does list the lookahead-expression. _The actual problem I want to solve:_ I want to replace `\verb+BLABLA+` by `\emph{BLABLA}`. I tried to search for `\\+(?<=verb\\+.*)` and replace the match (which should be the closing `+`) by `}`. Then I'd search for `verb\\+` and replace that by `emph{`. I stumbled over the fact, that most regex-flavors don't support the `.*` or '.+' in a loobehind, though, which still leaves the question above unanswered. **Secondly, how would you solve the actual problem if not via lookbehind?**


title: Custom BibLaTeX style

text: I need to produce the following BibLaTeX style: ![enter image description here](http://i.stack.imgur.com/lUOoT.png) Currently I get this output: ![enter image description here](http://i.stack.imgur.com/wFLof.png) with the `.bib` file named `Libtest.bib`               @unpublished {mi:2009,     author = {T. Miller and X. Meyer and K. Nahel},     title = {Arbitrary title: extensive latex work pays of at university most likely},     type = {Unpublished working paper},     institution = {Random University}     location = {Random location}     date = {2009}     }      Testing:               \documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}     \overfullrule=1mm     \usepackage[onehalfspacing]{setspace}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage[backend=bibtex8,         style=authoryear-icomp,         dashed=false,         autocite=footnote,         maxcitenames=3,         mincitenames=1,         maxbibnames=100,         sorting=nty         ]{biblatex}     \bibliography{Libtest}     \renewbibmacro*{cite:labelyear+extrayear}{%     \iffieldundef{labelyear}       {}       {\printtext[bibhyperref]{%        \printtext[parens]{%         \printfield{labelyear}%        \printfield{extrayear}}}}}     \bibliography{Libtest}     \begin{document}     \cite{mi:2009}  argue...     \printbibliography     \end{document}      Maybe someone can help me to change the 'ands' to commas and to achieve the rest of the above output? Regards, Tom.


title: Alternative to Morewrites

text: Is there an alternative to `morewrites`? Using the `glossaries` package for different types of lists, as well as `lstlisting` package has put me over the maximum writes number, however, I cannot seem to load `morewrites` as it is throwing many "invalid utf-8 sequence" errors, and I have no idea where to begin tracing the culprit. Sorry this question is "vague". EDIT: I have been able to pinpoint a (there may be more) potential conflict, here is a NMWE:               \documentclass{article}     \usepackage{lipsum}          %Seems to be originating from font selection, ie, helvet package.     \usepackage{morewrites}     \usepackage{helvet}     \renewcommand{\familydefault}{\sfdefault}          \begin{document}         \lipsum[1]     \end{document}      **The above throws the following errors:**   1. `String contains an invalid utf-8 sequence \begin{document}`   2. `String contains an invalid utf-8 sequence \begin{document}`   3. `String contains an invalid utf-8 sequence .../04 scalable font definitions   for OT1/phv.]`   4. String contains an invalid utf-8 sequence .../04 scalable font definitions for OT1/phv.] Comment out the `helvet` package, and the document compiles.


title: Best way to draw a flowchart in tikz

text: After going through some flowchart examples in `tikz` and some examples in TexSX, I understand that people generally adopt two techniques to draw flowchart diagrams in `tikz`   * Define all types of blocks you need using `\tikzset`. Place the nodes according to their relative position, starting from the first node, and then draw the lines connecting them.   * Define all types of blocks you need using `\tikzset`. Draw all the nodes in a `matrix`. Leave empty spaces if you don't have a node in a particular entry in the `matrix`. Then connect all the nodes. I was curious to know, which approach is better in general. Could someone point out to the advantages and disadvantages of this methods.


title: Page numbering for chapters and special chapters

text: I am writing my thesis and I would like to have the page numbers on the top right corner of each page. And I would like to not have any page numbers on the first page of each chapter. But, I would like to have page numbers on the first page of the special chapters (e.g., acknowledgements, ToC, LoT, LoF etc)... I am using the following code (mixed and matched from several postings) that gives me indeed page numbers on the top right corner, except from the first page of each chapter (so far so good). But also except from the first page of the special chapters... Could I somehow define an environment for some of my chapters to have page numbers on their first page (so for ackn, ToC, etc) and then a different environment for the rest of the chapters?               \RequirePackage{fancyhdr}      \fancypagestyle{phdthesis}{%     \fancyhf{}      \fancyhead[R]{\thepage}      }     \makeatletter     \renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi                     \thispagestyle{empty}%                     \global                     \@topnum\z@                     \@afterindentfalse                     \secdef\@chapter\@schapter}     \makeatother