title: how to redefine environments like \begin{xxx} ... \end{xxx}

text: I'm translating some text that use the `comment` package, it's usage seems like that:               \begin{en}      ... some English text     \end{en}          \begin{zh}     ... corresponding Chinese text     \end{zh}      By using `\excludecommand{en}` or `\includecommand{en}` before `\begin{document}`, we can control the text out or in the final PDF document. But this too trouble to add `\begin{}/\end{}` for every paragraph, what I want is following:               \en{      ... some English text     }          \zh{     ... corresponding Chinese text     }      this is much more simple to type. and I create the commands like this:               \newcommand{\zh}[1]{\begin{zh}#1\end{zh}}     \newcommand{\en}[1]{\begin{en}#1\end{en}}      But this cause compile error like `runaway argument`, how to make it work under this situation by using `newcommand`?


title: Undefined control sequence in TikZ braces

text: \documentclass[12pt]{article}          \usepackage{tikz}          \begin{document}          \begin{figure}     \begin{center}     \begin{tikzpicture}[scale=1]       \foreach \i[count=\t from 0] in {16,...,23}       {         \path (\t+0.25,1) coordinate (P\i);         \fill (P\i) circle (2pt);       }          \end{tikzpicture}     \end{center}     \end{figure}          \end{document}      Compiling this results in               ! Undefined control sequence.     \UseTextAccent ...up \@firstofone \let \@curr@enc                                                    \cf@encoding \@use@text@en...     l.14   }      Why does TeX have a problem with the closing brace in Line 14? It is just used to close the `foreach`.


title: Make a Vigenère rectangular in LaTeX

text: I want to make a rectangular 26x26 table where in the first row contains the letters A, B, ..., Z, the second row B, C, ..., Z, A, the third row C, D, ..., Z, A, B, etc. One (not efficient) way is the following:               \begin{tikzpicture}       \draw[step=.5cm,gray,thick]       (-6,-6) grid (6,6);            \draw (-5.75,5.75) node{A} (-5.25,5.75) node{B} (-4.75,5.75) node{C}  (-4.25,5.75) node{D}  (-3.75,5.75) node{E}  etc; % this is the first row            \draw (-5.75,5.25) node{B} (-5.25,5.25) node{C} (-4.75,5.25) node{D}  (-4.25,5.25) node{E}  (-3.75,5.25) node{F}  etc; % this is the second row            % and so on for the rest rows       \end{tikzpicture}      Any ideas how to to make this happen more efficiently? Also what if I want to use the Greek alphabet A, B, Γ, ..., Ω instead of the English alphabet.


title: titlesec image after

text: Can someone explain to me why the second of these two doesn't work? The first produces an image before the section name, where the second produces an error claiming there is no `\begin{document}`               \titleformat{\section}[hang]{\color{black}\Large\bf\filcenter}{}{0in}{\includegraphics[width=\linewidth]{blue.png}}[]               \titleformat{\section}[hang]{\color{black}\Large\bf\filcenter}{}{0in}{}[\includegraphics[width=\linewidth]{blue.png}]


title: Passing (just) other options, when using pgfopts

text: I want to use pgfopts (and therefore pgfkeys) when customizing a class with new options, keeping the old ones, and using some of them. Here is a simplified example with a class "exa" which extends "article" with a new option, and also sets option "a5paper".               \begin{filecontents}{exa.cls}     \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{exa}[2014/03/19 exa]     % As "article" with "a5paper" set, and an extra option "lastword".     \RequirePackage{pgfopts}     \pgfkeys{       /exa/.cd,       lastword/.code=\AtEndDocument{\par The last word is #1.}     }     \ProcessPgfOptions{/exa}     \PassOptionsToClass{a5paper}{article}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}     \ProcessOptions     \LoadClass{article}     \end{filecontents}          \documentclass[lastword=bar,twocolumn]{exa}          \usepackage{blindtext}     \begin{document}     \blindtext     \end{document}      The three options work as intended here; "a5paper" set by the class, "twocolumn" sent to "article", and the new option "lastword". But it gives a warning about unused global option ["lastword=bar]". How can take away all options ProcessPgfOptions took care of, so that only the rest is sent on to "article"?


title: Right alignment of description items (similar to default enumerate)

text: Let us consider the following example :               \documentclass[12pt,twoside,a4paper]{book}     \usepackage[left=.45in,right=.45in,top=.6in,bottom=.6in,headheight=14.5pt]  {geometry}     \usepackage{enumerate}     \begin{document}     Under 'enumerate' environment :     \begin{enumerate}[(i)]     \item Text     \item Text     \item Text     \item Text     \item Text     \item Text     \item Text     \item Text     \end{enumerate}               Under 'description' environment :     \begin{description}     \item[(i)] Text     \item[(ii)] Text     \item[(iii)] Text     \item[(iv)] Text     \item[(v)] Text     \item[(vi)] Text     \item[(vii)] Text     \item[(viii)] Text     \end{description}          \end{document}         **Output** : ![enter image description here](http://i.stack.imgur.com/SIASu.png) I want to get the second list environment using `\begin{enumerate}` and   `\end{enumerate}`. Is it possible?


title: Bad interaction between mdwtools' syntax package and graphicx

text: I'm writing a document where I want to both include some image via `graphicx`'s `\includegraphics` and display some BNF grammars using the `syntax` package of `mdwtools`, however I receive an error of `undefined control sequence` when I try to use them together _with some filenames_. A minimal example that fails:               \documentclass{article}          \usepackage{syntax}     \usepackage{graphicx}          \begin{document}          \includegraphics{logo_uniud_black}          \end{document}      Compiling this I get the following error:               (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))     ! Undefined control sequence.     \filename@simple ...#2\\}\fi \edef \filename@base                                                        {#1}     l.8 \includegraphics{logo_uniud_black}             [omissis]          ! Undefined control sequence.     \filename@simple ...#2\\}\fi \edef \filename@base                                                        {#1}     l.8 \includegraphics{logo_uniud_black}          (That makes 100 errors; please try again.)      Commenting out `\usepackage{syntax}` fixes the problem. Also using a filename that doesn't contain underscore works, so that this code doesn't fail:               \documentclass{article}          \usepackage{syntax}     \usepackage{graphicx}          \begin{document}          \includegraphics{logouniudblack}          \end{document}      Why do I get this error and how is it related to the underscore in the filename? Is there a way to fix it without renaming all the files I have to include? * * * Edit: Actually it seems like even section names with underscore create problems, so that `\include`s raise similar errors, for example with the source:               \documentclass{article}          \usepackage{syntax}          \begin{document}          \include{sintassi_astratta}          \end{document}      I get these errors:               (/usr/share/texlive/texmf-dist/tex/latex/mdwtools/syntax.sty) (./bad_doc.aux)     ! Undefined control sequence.     \GenericError  ...                                                                                #4  \errhelp \@err@     ...     l.7 \include{sintassi_astratta}          ! Undefined control sequence.     \GenericError  ...                                                                                \let \@err@               ...     l.7 \include{sintassi_astratta}          ! Undefined control sequence.     \GenericError  ...                                                                                \@empty \def \MessageBreak...     l.7 \include{sintassi_astratta}          ! Undefined control sequence.     \GenericError  ...                                                                                \endgroup      l.7 \include{sintassi_astratta}          ! Argument of \reserved@b has an extra }.     <inserted text>                      \par      l.7 \include{sintassi_astratta}          Runaway argument?     {\usc@builtindischyphen }\futurelet \@let@token \@ifnch astratta.aux     ! Paragraph ended before \reserved@b was complete.     <to be read again>                         \par      l.7 \include{sintassi_astratta}          (./sintassi.tex)     ! Missing control sequence inserted.     <inserted text>                      \inaccessible      l.7 \include{sintassi_astratta}          ! Too many }'s.     \@filef@und ...\@let@token \let \discretionary {-}                                                       {}{}\discretionary {-}{}{}...     l.7 \include{sintassi_astratta}          [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./sintassi.tex)     Runaway text?     \@setckpt{sintassi\protect \unhbox \voidb@x \kern .06em\vbox {\hrule \ETC.     ! File ended while scanning text of \write.     <inserted text>                      }     l.7 \include{sintassi_astratta}          ! Unbalanced write command.     <write> ... \@setckpt {sintassi_astratta}\@charlb           l.7 \include{sintassi_astratta}          (./bad_doc.aux     Runaway argument?     {sintassi\protect \global \let \OT 1\textunderscore \unhbox \voidb@x \ETC.     ! Paragraph ended before \@input was complete.     <to be read again>                         \par      l.5           ! Missing { inserted.     l.7 ...or immediate help   \endgroup {}\def \par }          )          LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.          ! Missing } inserted.     <inserted text>                      }     l.9 \end{document}          ! Missing } inserted.     <inserted text>                      }     l.9 \end{document}          ! Extra \endgroup.     <recently read> \endgroup           l.9 \end{document}           )      If I'm not mistaken instead of looking for `sintassi_astratta.tex` it is looking for `sintassi.tex`. It seems like `syntax` is redefining the underscore in some way that breaks everything.


title: LaTeX Beamer, TikZ and overlays — page numbering issue

text: I'm using `\onslide<…->` for overlays in TikZ:               \documentclass{beamer}     \usepackage{tikz}     \setbeamertemplate{footline}{\insertpagenumber{}}          \begin{document}         \begin{frame}             \begin{tikzpicture}                 \draw node[] at (0, 0) {$s_0$};                      \onslide<2->{                     \draw node[] at (1, 1) {$s_1$};                 }                      \onslide<3->{                     \draw node[] at (2, 2) {$s_2$};                 }             \end{tikzpicture}         \end{frame}     \end{document}      …and there are no more annoying additional bullets in the headline for every single overlay, but the page number is still increasing (so I'm getting only one bullet but 1, 2, 3 as page numbers). Is there any solution this problem?


title: How to fix symbol index entry?

text: All my entries in the symbol index involving `$\|\cdot\|$` get rejected. For instance `{\index{symbol}{normx@{$\|\cdot\|_X$}}}`. How can I fix this?


title: How to avoid frame break in beamer?

text: I am using the command `\begin{frame}[allowframebreaks]` to split a large slide into multiple slides. However, the last slide only contains two lines and I would like to force them into the previous slide. How can I do so?


title: lstinputlisting does not include file within lstnewenvironment?

text: I want to use `lstinputlisting` to include a file with code within an `lstlisting` block, which is defined through a new environment. However, the `lstinputlisting` command itself, not the code, is reproduced verbatim in the code block. MWE:               \documentclass{minimal}     \usepackage{color}     \usepackage{listings}     \usepackage{verbatim}          \definecolor{customblue}{RGB}{235,241,245}          \lstnewenvironment{terminalblock}{%       \lstset{backgroundcolor=\color{customblue},       frame=single,       framerule=0pt,       basicstyle=\ttfamily,       breaklines=true,       columns=fullflexible}}{}          \begin{document}      \begin{terminalblock}       \lstinputlisting{code.cpp}      \end{terminalblock}          \begin{verbatim}      \verbatiminput{code.cpp}     \end{verbatim}          \begin{lstlisting}      \lstinputlisting{code.cpp}     \end{lstlisting}          \end{document}      The same problem occurs in the standard `lstlisting` and `verbatim` environments as well. The PDF document just contains `\lstinputlisting{code.cpp}` three times, as shown. ![mwe.png](http://i.stack.imgur.com/nKRIy.png) Since the background of the block generated by the custom environment is the correct colour, so I think the configuration settings are working in the custom environment, but not `lstinputlistings`. I don't know if it's relevant, but these are the contents of `code.cpp`:               #include <iostream>     #define abusing using          abusing namespace std;          int main()     {        cout<<"Hello, world!"<<endl;        return 0;     }


title: How to punctuate multiline equations?

text: This might be off topic, yet I wouldn't know where else to ask. I want to keep up with the good habit of punctuating displayed equations. For example I know the comma (`,`) is compulsory in               Here, we can reduce \(f\) to a more simple form     \[         f(t) = \exp{-t_c/t},     \]     where \(t_c\) is called the damping constant.       Yet how should I treat multiline equations? Take a look at this               The function \(g\) is simply the derivative of \(f\), so     \begin{align*}         g(t) &= \deriv{f(t)}{t}\\              &= \frac{t_c}{t^2}\exp{-t_c/t},     \end{align*}     so \(g(t)\) will be smaller than \(f(t)\) for large \(t\).      is this correctly punctuated?


title: Changing font size of code in lhs2tex

text: I am a LaTeX / Haskell newbie and this question involves `lhs2tex`. Please let me know if I am posting on the wrong forum. I am writing a report in which I have fragments like:               \begin{figure}       \begin{spec}       fib n = case n of           0 -> 1           1 -> 1           _ -> fib (n-1) + fib (n-2)       \end{spec}       \caption{Simple recursive function to calculate the $n^{th}$ Fibonacci number}       \label{fib01}       \end{figure}        The report is preprocessed `with lhs2tex`. Since some of the other examples are a lot longer than this one, I want to reduce the font size only for the `code` and `spec` blocks. Is there an easy way to do this? Thanks for your time.


title: How to use every plot with TikZ

text: In the paragraph about gnuplot in the pgfmanual, I read this : > The following styles influence the plot: `/tikz/every plot` (style, > initially empty) This style is installed in each plot, that is, as if you > always said `plot[every plot,...]` This is most useful for globally setting > a prefix for all plots by saying: >   >   >      \tikzset{every plot/.style={prefix=plots/}} >   I try this with no succes.               \documentclass{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}[domain=0:4,every plot/.style={green,ultra thick}]       \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);       \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};       \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};       \draw plot[id=x]   function{x}    node[right] {$f(x) =x$};       \draw plot[id=sin] function{sin(x)}      node[right] {$f(x) = \sin x$};       \draw plot[id=exp] function{0.05*exp(x)} node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};     \end{tikzpicture}          \end{document}


title: How to put a list and an equation side by side

text: I'd like to get a list and an equation side by side so that I fill the page width better for aesthetic reasons, I've tried the following but doesn't compile:               \begin{tabular}{cc}     Known values:     \begin{enumerate}[i.]     \item $I_0 = 1nA = 1\cdot 10^{-9} A $     \item $T_1=20$     \item $T_2=0$     \item $T_2=100$\\     \end{enumerate}     &$I=I_0\cdot (e^{\frac{q\cdot v}{k_{bT}}}-1)$\\     \end{tabular}      I'm not very familiar with the tabular environment so I may have missed something or not done something necessary properly. Any help or alternatives would be greatly appreciated.


title: How to write under an underline?

text: I would like to be able to write under the underline. Is it possible? ![enter image description here](http://i.stack.imgur.com/Poz7p.png) This is the simple code I have:               \documentclass{article}     \begin{document}     $\frac{ \textrm{Text}}{1} \frac{\textrm{Text}}{2} \frac{\textrm{Text}}{3}$     \end{document}      It does the job but I want to be able to make the texts under underlines smaller. One way to do so is to adjust the font each time. Is it an easier way? Or is there any built-in function for this. To assign the size which would be the same as the size for subscript.


title: LaTeX3: \file_if_exist:nTF & complete path to the file found

text: `\file_if_exist:nTF` searches the TeX/LaTeX input path for the filename given as an argument. Now I am looking for a way to get hands on the complete path to the file, in case it was found. From the LaTeX2e command `\IfFileExists` I know that it stores the path to the file in the macro `\@filef@und`. I wonder if there is a LaTeX3 counterpart to `\@filef@und`. If not, I kindly ask the LaTeX3 developers to provide a such, because it may come in handy in certain programming tasks.


title: setup of 5 figures as 2x3 table with 6th cell having the caption

text: I want the figure to look like the following. Cant figure out how to do that using graphicx or subfloat. :s ![The way it should look like](http://i.stack.imgur.com/vbZEt.jpg) please help :) After the discussions:               \begin{figure}[htb]     \begin{minipage}{0.5\textwidth}       \includegraphics[width=.9\textwidth]{Fig3a}     \end{minipage}%     \hfill     \begin{minipage}{.5\textwidth}       \includegraphics[width=.9\textwidth]{Fig3b}     \end{minipage}     \begin{minipage}{.5\textwidth}       \includegraphics[width=.9\textwidth]{Fig3c}     \end{minipage}%     \hfill     \begin{minipage}{.5\textwidth}       \includegraphics[width=.9\textwidth]{Fig3d}     \end{minipage}     \begin{minipage}{.5\textwidth}       \includegraphics[width=.9\textwidth]{Fig3e}     \end{minipage}%     \hfill     \begin{minipage}{.5\textwidth}       \caption{caption stuff}     \end{minipage}%     \label{fig3}     \end{figure}      but this still gives the caption at the end and not in the 6th box FYI: I am using the svjour3 document Also now I think if the fig 3 a comes alone and bcde come in a 2x2 pattern would be the best. OK I finally did the above using the tabular Thanks ppl :)


title: change achemso style in chapterbib

text: I have a root file and a separate `chapter.tex` and chapter.bib for each chapter (per the `chapterbib` setup: I am not using the `achemso` package). Root file:               \documentclass[12pt,oneside,final]{thesis}     \usepackage{chapterbib}     \usepackage[superscript]{cite}     \usepackage{chemstyle}     \usepackage{cite}     \begin{document}     \title{Title}     \include{chapter1}     \end{document}      Chapter 1 (as a separate tex file)               \chapter{Chapter 1}     Text goes here\cite{person2013malaria}     \bibliographystyle{achemso}     \bibliography{./Bibliographies/chapter1}        Bib file (as a separate `.bib` file saved to the appropriate directory above)               @article{person2013malaria,     title={Malaria},     author={Person, One and Person, Two and Person, Three and Person, Four and Person, Five and Person, Six and Person, Seven and Person, Eight and Person, Nine and Person, Ten and Person, Eleven},     journal={J. Amer. Med. Assoc.},     volume={25},     number={2},     pages={160},     year={2013},     publisher={LWW}     }      I am trying to control my `achemso` style bibliography with the following command:               @Control{achemso-control,     ctrl-article-title = "yes",     ctrl-chapter-title = "no",     ctrl-etal-number = "99",     ctrl-etal-firstonly = "no",     }      ...with no success. Not sure if I'm putting it in the wrong location (have tried adding it directly to the `.bib` file, saved as a separate `.bib` file (`chapter1-control.bib`) and calling it in with the `\bibliography` command.


title: How to create a tikzstyle for special edges, like transfer and rest arcs?

text: I need for petri nets some special edges for arcs:   1. Reset arc      * which has an cross at Place   2. Transfer arc      * which has an dashed edge from place to place and an snaked edge from transition to dashed edge. ![reset and transfer arc](http://i.stack.imgur.com/eOGS5.png) This is what I have so far:               \documentclass{article}     \def\xcolorversion{2.00}     \def\xkeyvalversion{1.8}          % allows drawing of petri nets     \usepackage[version=0.96]{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows,decorations.pathmorphing, decorations.markings,shapes,snakes,automata,backgrounds,petri}     % Petri net definition for tikz     \tikzstyle{place}=[circle,thick,draw=blue!75,fill=blue!20,minimum size=6mm]     \tikzstyle{transition}=[rectangle,thick,draw=black!75,                   fill=black!20,minimum size=4mm]     \tikzstyle{every label}=[red]          \pgfarrowsdeclare{x}{x}     {     \arrowsize=0.2pt     \advance\arrowsize by .5\pgflinewidth     \pgfarrowsleftextend{-4\arrowsize-.5\pgflinewidth}     \pgfarrowsrightextend{.5\pgflinewidth}     }     {     \arrowsize=0.2pt     \advance\arrowsize by .5\pgflinewidth     \pgfsetdash{}{0pt} % do not dash     \pgfsetroundjoin     % fix join     \pgfsetroundcap     % fix cap     \pgfpathmoveto{\pgfpoint{-6\arrowsize}{6\arrowsize}}     \pgfpatharc{180}{270}{6\arrowsize}     \pgfusepathqstroke     \pgfpathmoveto{\pgfpointorigin}     \pgfpatharc{90}{180}{6\arrowsize}     \pgfusepathqstroke     \pgfpathmoveto{\pgfpoint{6\arrowsize}{-6\arrowsize}}     \pgfpatharc{180}{270}{-6\arrowsize}     \pgfusepathqstroke     \pgfpathmoveto{\pgfpointorigin}     \pgfpatharc{90}{180}{-6\arrowsize}     \pgfusepathqstroke     }          \tikzstyle{normal}=[->]     \tikzstyle{read}=[-]     \tikzstyle{reset}=[-*]     \tikzstyle{inhibitor}=[-o]     \tikzstyle{transfer}=[-x]          \usepackage[latin1]{inputenc}     \begin{document}               \begin{tikzpicture}[node distance=1.3cm,>=stealth',bend angle=45,auto]       \begin{scope}[xshift=10cm]         \node [place,tokens=1]                           (p1') [label=right:$p_1$]                 {};         \node [place,tokens=1]                           (p2') [below of=p1', label=left:$p_2$]    {};              \node [transition] (t1') [right of=p1'] {}           edge [pre, inhibitor, bend left]                  (p1')           edge [post, bend left]                            (p2')           edge [post, reset, bend right] node[swap]     {3} (p1');              \node [transition] (t2') [left of=p2'] {}           edge [pre, normal, bend left]     node [auto] {2} (p2')           edge [post, read, bend right]         (p2')           edge [post, transfer, bend left, snake=snake]     node [auto] {2} (p1');       \end{scope}     \end{tikzpicture}          \end{document}      I'm very new to Latex and tikz. Hope someone can help me. Regards.


title: Verbatim inside a minipage inside a tikz node -- beamer class

text: I am trying to get a boxed text as part of a tikz node. I found an example here that I am trying to follow, but it is giving me an error: Argument of \@xverbatim has an extra }. I can't figure it out. Any help would be greatly appreciated. My code is below. One interesting thing is that if I change the documentclass to article, it works. However, I need this in a beamer environment.               \documentclass[table,xcolor=pdftex,dvipsnames]{beamer}          \usepackage{tikz}          \usetikzlibrary{shapes,snakes}          \begin{document}          \begin{frame}        \frametitle{Testing verbatim}        \tikzstyle{mybox} = [draw=red, fill=blue!20, very thick,         rectangle, rounded corners, inner sep=2pt, inner ysep=2pt]     \begin{tikzpicture}     \node [mybox] (box){%         \begin{minipage}{0.4\textwidth}         \tiny         \begin{verbatim}     <list title="MOVIES">        <film>           <title>The Shining</title>           <release_date>1980-05-23</release_date>           <director>Stanley Kubrick</director>           <actor>Jack Nicholson</actor>        </film>        <film>           <title>Spartacus</title>           <director>Stanley Kubrick</director>        </film>        <film>           <title>The Passenger</title>           <actor>Jack Nicholson</actor>        </film>        ...     </list>         \end{verbatim}         \end{minipage}     };     \end{tikzpicture}       \end{frame}     \end{document}


title: Help with the titlepage

text: I need to write the title page for my work and I need that the author and director names be in the right side of the page, anyone can help me or give an idea? This is what i tried               \documentclass[a4paper,english,spanish,12pt,titlepage]{report}      \begin{document}      \begin{titlepage}      \begin{center}      \textsc{\LARGE Departament of My University}\\[0.4cm]      \textsc{\large Name of University}\\[0.6cm]                \textsc{\Large Final Work}\\[0.5cm]                { \Huge \bfseries Name of my work}\\[0.4cm]                      \vspace{2\baselineskip}                      \vspace{2\baselineskip}       \begin{minipage}{0.4\textwidth}      \begin{flushright} \large      \emph{Autor:} \\       My Name\\      \emph{Director:} \\      My Director´s name      \end{flushright}      \end{minipage}                {\large March, $2013$}      \end{center}      \end{titlepage}      \end{document}


title: Automating LaTeX tables with specifications from R

text: I have some latex tables generated from R-code, the sample latex table code is below               \begin{table}[ht]     \begin{center}     \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c}     \hline     & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\      \hline     1 & 186.30 & 101.52 & 128.33 & 148.02 & 132.08 & 138.63 & 107.98 & 133.09 & 134.12 &   119.23 & 133.21 & 165.73 \\      2 & 104.03 & 184.67 & 184.07 & 169.27 & 117.85 & 107.67 & 169.89 & 111.93 & 185.41 &  134.30 & 198.12 & 120.83 \\      3 & 170.20 & 189.47 & 142.98 & 106.06 & 116.85 & 120.74 & 100.51 & 195.18 & 196.31 & 189.16 & 180.00 & 191.78 \\      4 & 176.23 & 187.77 & 127.99 & 194.66 & 135.87 & 152.42 & 137.35 & 109.88 & 162.07 & 171.81 & 136.07 & 122.29 \\      \hline     \end{tabular}     \end{center}     \end{table}      I will have about 50 or 60 tables generated like this. **I want to input '\hdashline' after every row in a table and want to separate the tables by '\vspace{2em}'** How Can I do this automatically from R code fro every table as I have hell lot of tables, I could not find a function to write these in x-table..Any help is appreciated..


title: stack.sty and \end{environment}

text: I'm writing a multilevel `itemize` list environment to simplify the process of putting nested lists in Beamer slides, and I want it to support `enumerate` lists as well. The `mitemize` environment is supposed to work as follows:               \begin{mitemize}       \enumeratelist       \mitem{1} Candidate Generation       \mitem{2} From annotated data       \mitem{2} Using heuristics from unannotated data       \mitem{1} Connect the slots to create trees       \mitem{1} Pruning and Sorting       \mitem{2} Covering algorithm on annotated corpus       \mitem{2} Sorting linkage specifications by structure     \end{mitemize}      Which is supposed to look as follows: ![enter image description here](http://i.stack.imgur.com/Tjkm4.png) I've gotten the package working with one problem: whenever `mitemize.sty` tries to close an `enumerate` or `itemize` list, the result is an error message:               \begin{itemize} on input line 104 ended by \end{itemize}.      or               \begin{enumerate} on input line 504 ended by \end{enumerate}.      Apparently `\Push{stackname}{itemize}\end{\Stack{stackname}}` isn't the same as `\end{itemize}`. Any ideas how to fix this:               \ProvidesPackage{mitemize}     \RequirePackage{stack}     \RequirePackage{ifthen}          \NewStack{mitemizeStack}{\empty}     \newcounter{mitemize@depth}          \newenvironment{mitemize}{        \newcommand{\mitem}[1]{%           \whiledo{\value{mitemize@depth}>##1}{%          \end{\Stack{mitemizeStack}}%          \Pop{mitemizeStack}%          \addtocounter{mitemize@depth}{-1}%           }%           \whiledo{\value{mitemize@depth}<##1}{%          \addtocounter{mitemize@depth}{1}%          \Push{mitemizeStack}{itemize}          \begin{itemize}%           }%           \item%        }%        \newcommand{\enumeratelist}{%          \addtocounter{mitemize@depth}{1}%          \Push{mitemizeStack}{enumerate}          \begin{enumerate}%        }%     }{        \whiledo{\value{mitemize@depth}>0}{%           \end{\Stack{mitemizeStack}}%           \Pop{mitemizeStack}%           \addtocounter{mitemize@depth}{-1}%        }%     }      * * * Here's a more minimal example to play with. The output is correct, but I get the error `\begin{itemize} on input line 7 ended by \end{itemize}.`               \documentclass{article}     \usepackage{stack}     \NewStack{endenvstack}{\empty}     \begin{document}          \Push{endenvstack}{itemize}     \begin{itemize}     \item Foo     \item Bar     \item Baz     \end{\Stack{endenvstack}}          Text that comes after the list          \end{document}


title: How to create a lined page with line numbers?

text: I'd like to create a page in my LaTeX document that just consists of lines. It should look like this: ![enter image description here](http://i.stack.imgur.com/QXGX5.jpg) Additionally, I want the lines numbered. I have no idea where to start. Are there any hints?


title: Problems combining tikz and storebox: Missing number, treated as zero. With animate, page shipped out with text `graphicx`,

text: When I load both `tikz` and `storebox` and compile the following MWE, I get an error message `! Missing number, treated as zero.`. When I additionally load `animate`, I get no error message, but a spurious page with the text `graphicx`.               \documentclass[12pt]{standalone}     \usepackage{tikz}     \usepackage{storebox}     %\usepackage{animate}     \listfiles     \begin{document}     Test     \end{document}        * When I compile the document above (`tikz` then `storebox`, no `animate`), I get the error message shown below, along with a two-page PDF document.   * When I include `animate`, I get no error message, but still a two-page PDF document.   * If I load `storebox`, then `tikz`, and no `animate`, result is normal. If I leave out `tikz` of any combination, result is normal. If I leave _any_ of the three packages out of the sequence `storebox`-`animate`-`tikz`, result is normal. There must be some strange 3-package issue going on; but they're all relatively new and not obscure... The log:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) (format=pdflatex 2013.9.26)  30 OCT 2013 21:50     entering extended mode      restricted \write18 enabled.      %&-line parsing enabled.     **test     (./test.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge     rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi     c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis     h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis     h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h     ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma     rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,      kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,      piedmontese, polish, portuguese, romanian, romansh, russian, sanskrit, serbian     , serbianc, slovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, u     ppersorbian, welsh, loaded.     (/local/opt/texlive/2012/texmf-dist/tex/latex/standalone/standalone.cls     Document Class: standalone 2012/09/15 v1.1b Class to compile TeX sub-files stan     dalone     (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/ifluatex.sty     Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)     Package ifluatex Info: LuaTeX not detected.     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/ifpdf.sty     Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)     Package ifpdf Info: pdfTeX in PDF mode is detected.     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/ifxetex/ifxetex.sty     Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/xkeyval/xkeyval.sty     Package: xkeyval 2012/10/14 v2.6b package option processing (HA)          (/local/opt/texlive/2012/texmf-dist/tex/generic/xkeyval/xkeyval.tex     \XKV@toks=\toks14     \XKV@tempa@toks=\toks15     \XKV@depth=\count79     File: xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)          (/local/opt/texlive/2012/texmf-dist/tex/generic/xkeyval/keyval.tex)))     \sa@internal=\count80          (/local/opt/texlive/2012/texmf-dist/tex/latex/standalone/standalone.cfg     File: standalone.cfg 2012/09/15 v1.1b Default configuration file for 'standalon     e' class     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/local/opt/texlive/2012/texmf-dist/tex/latex/base/size12.clo     File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count81     \c@section=\count82     \c@subsection=\count83     \c@subsubsection=\count84     \c@paragraph=\count85     \c@subparagraph=\count86     \c@figure=\count87     \c@table=\count88     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     \sa@box=\box26     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te     x     \pgfutil@everybye=\toks16     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def     \pgfutil@abb=\box27     (/local/opt/texlive/2012/texmf-dist/tex/latex/ms/everyshi.sty     Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)     ))     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex     Package: pgfrcs 2010/10/25 v2.10 (rcs-revision 1.24)     ))     Package: pgf 2008/01/15 v2.10 (rcs-revision 1.12)     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty     (/local/opt/texlive/2012/texmf-dist/tex/latex/graphics/graphicx.sty     Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)          (/local/opt/texlive/2012/texmf-dist/tex/latex/graphics/graphics.sty     Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)          (/local/opt/texlive/2012/texmf-dist/tex/latex/graphics/trig.sty     Package: trig 1999/03/16 v1.09 sin cos tan (DPC)     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/latexconfig/graphics.cfg     File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live     )     Package graphics Info: Driver file: pdftex.def on input line 91.          (/local/opt/texlive/2012/texmf-dist/tex/latex/pdftex-def/pdftex.def     File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX          (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/infwarerr.sty     Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/ltxcmds.sty     Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)     )     \Gread@gobject=\count89     ))     \Gin@req@height=\dimen103     \Gin@req@width=\dimen104     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex     Package: pgfsys 2010/06/30 v2.10 (rcs-revision 1.37)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex     \pgfkeys@pathtoks=\toks17     \pgfkeys@temptoks=\toks18          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.c     ode.tex     \pgfkeys@tmptoks=\toks19     ))     \pgf@x=\dimen105     \pgf@y=\dimen106     \pgf@xa=\dimen107     \pgf@ya=\dimen108     \pgf@xb=\dimen109     \pgf@yb=\dimen110     \pgf@xc=\dimen111     \pgf@yc=\dimen112     \w@pgf@writea=\write3     \r@pgf@reada=\read1     \c@pgf@counta=\count90     \c@pgf@countb=\count91     \c@pgf@countc=\count92     \c@pgf@countd=\count93          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg     File: pgf.cfg 2008/05/14  (rcs-revision 1.7)     )     Package pgfsys Info: Driver file for pgf: pgfsys-pdftex.def on input line 900.          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.d     ef     File: pgfsys-pdftex.def 2009/05/22  (rcs-revision 1.26)          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-p     df.def     File: pgfsys-common-pdf.def 2008/05/19  (rcs-revision 1.10)     )))     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.     code.tex     File: pgfsyssoftpath.code.tex 2008/07/18  (rcs-revision 1.7)     \pgfsyssoftpath@smallbuffer@items=\count94     \pgfsyssoftpath@bigbuffer@items=\count95     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.     code.tex     File: pgfsysprotocol.code.tex 2006/10/16  (rcs-revision 1.4)     )) (/local/opt/texlive/2012/texmf-dist/tex/latex/xcolor/xcolor.sty     Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)          (/local/opt/texlive/2012/texmf-dist/tex/latex/latexconfig/color.cfg     File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive     )     Package xcolor Info: Driver file: pdftex.def on input line 225.     Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.     Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.     Package xcolor Info: Model `RGB' extended on input line 1353.     Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.     Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.     Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.     Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.     Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.     Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex     Package: pgfcore 2010/04/11 v2.10 (rcs-revision 1.7)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex     \pgfmath@dimen=\dimen113     \pgfmath@count=\count96     \pgfmath@box=\box28     \pgfmath@toks=\toks20     \pgfmath@stack@operand=\toks21     \pgfmath@stack@operation=\toks22     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.     tex     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic     .code.tex)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigo     nometric.code.tex)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.rando     m.code.tex)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.compa     rison.code.tex)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.     code.tex)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round     .code.tex)     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.     code.tex)))     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex     \c@pgfmathroundto@lastzeros=\count97     ))     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.co     de.tex     File: pgfcorepoints.code.tex 2010/04/09  (rcs-revision 1.20)     \pgf@picminx=\dimen114     \pgf@picmaxx=\dimen115     \pgf@picminy=\dimen116     \pgf@picmaxy=\dimen117     \pgf@pathminx=\dimen118     \pgf@pathmaxx=\dimen119     \pgf@pathminy=\dimen120     \pgf@pathmaxy=\dimen121     \pgf@xx=\dimen122     \pgf@xy=\dimen123     \pgf@yx=\dimen124     \pgf@yy=\dimen125     \pgf@zx=\dimen126     \pgf@zy=\dimen127     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconst     ruct.code.tex     File: pgfcorepathconstruct.code.tex 2010/08/03  (rcs-revision 1.24)     \pgf@path@lastx=\dimen128     \pgf@path@lasty=\dimen129     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage     .code.tex     File: pgfcorepathusage.code.tex 2008/04/22  (rcs-revision 1.12)     \pgf@shorten@end@additional=\dimen130     \pgf@shorten@start@additional=\dimen131     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.co     de.tex     File: pgfcorescopes.code.tex 2010/09/08  (rcs-revision 1.34)     \pgfpic=\box29     \pgf@hbox=\box30     \pgf@layerbox@main=\box31     \pgf@picture@serial@count=\count98     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicst     ate.code.tex     File: pgfcoregraphicstate.code.tex 2008/04/22  (rcs-revision 1.9)     \pgflinewidth=\dimen132     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransform     ations.code.tex     File: pgfcoretransformations.code.tex 2009/06/10  (rcs-revision 1.11)     \pgf@pt@x=\dimen133     \pgf@pt@y=\dimen134     \pgf@pt@temp=\dimen135     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.cod     e.tex     File: pgfcorequick.code.tex 2008/10/09  (rcs-revision 1.3)     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.c     ode.tex     File: pgfcoreobjects.code.tex 2006/10/11  (rcs-revision 1.2)     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathproce     ssing.code.tex     File: pgfcorepathprocessing.code.tex 2008/10/09  (rcs-revision 1.8)     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.co     de.tex     File: pgfcorearrows.code.tex 2008/04/23  (rcs-revision 1.11)     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.cod     e.tex     File: pgfcoreshade.code.tex 2008/11/23  (rcs-revision 1.13)     \pgf@max=\dimen136     \pgf@sys@shading@range@num=\count99     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.cod     e.tex     File: pgfcoreimage.code.tex 2010/03/25  (rcs-revision 1.16)          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.     code.tex     File: pgfcoreexternal.code.tex 2010/09/01  (rcs-revision 1.17)     \pgfexternal@startupbox=\box32     ))     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.co     de.tex     File: pgfcorelayers.code.tex 2010/08/27  (rcs-revision 1.2)     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretranspare     ncy.code.tex     File: pgfcoretransparency.code.tex 2008/01/17  (rcs-revision 1.2)     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.     code.tex     File: pgfcorepatterns.code.tex 2009/07/02  (rcs-revision 1.3)     )))     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.cod     e.tex     File: pgfmoduleshapes.code.tex 2010/09/09  (rcs-revision 1.13)     \pgfnodeparttextbox=\box33     )     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.     tex     File: pgfmoduleplot.code.tex 2010/10/22  (rcs-revision 1.8)     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version     -0-65.sty     Package: pgfcomp-version-0-65 2007/07/03 v2.10 (rcs-revision 1.7)     \pgf@nodesepstart=\dimen137     \pgf@nodesepend=\dimen138     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version     -1-18.sty     Package: pgfcomp-version-1-18 2007/07/23 v2.10 (rcs-revision 1.1)     ))     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/utilities/pgffor.sty     (/local/opt/texlive/2012/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)     ) (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex     Package: pgffor 2010/03/23 v2.10 (rcs-revision 1.18)     \pgffor@iter=\dimen139     \pgffor@skip=\dimen140     \pgffor@stack=\toks23     \pgffor@toks=\toks24     ))     (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.cod     e.tex     Package: tikz 2010/10/13 v2.10 (rcs-revision 1.76)          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothan     dlers.code.tex     File: pgflibraryplothandlers.code.tex 2010/05/31 v2.10 (rcs-revision 1.15)     \pgf@plot@mark@count=\count100     \pgfplotmarksize=\dimen141     )     \tikz@lastx=\dimen142     \tikz@lasty=\dimen143     \tikz@lastxsaved=\dimen144     \tikz@lastysaved=\dimen145     \tikzleveldistance=\dimen146     \tikzsiblingdistance=\dimen147     \tikz@figbox=\box34     \tikz@tempbox=\box35     \tikztreelevel=\count101     \tikznumberofchildren=\count102     \tikznumberofcurrentchild=\count103     \tikz@fig@count=\count104          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.cod     e.tex     File: pgfmodulematrix.code.tex 2010/08/24  (rcs-revision 1.4)     \pgfmatrixcurrentrow=\count105     \pgfmatrixcurrentcolumn=\count106     \pgf@matrix@numberofcolumns=\count107     )     \tikz@expandcount=\count108          (/local/opt/texlive/2012/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie     s/tikzlibrarytopaths.code.tex     File: tikzlibrarytopaths.code.tex 2008/06/17 v2.10 (rcs-revision 1.2)     )))     (/local/opt/texlive/2012/texmf-dist/tex/latex/storebox/storebox.sty     Package: storebox 2011/12/21 v1.3a Store and reuse boxes in a file size efficie     nt way          (/local/opt/texlive/2012/texmf-dist/tex/latex/collectbox/collectbox.sty     Package: collectbox 2012/05/17 v0.4b Collect macro arguments as boxes     \collectedbox=\box36     ))     (./test.aux)     \openout1 = `test.aux'.          LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 6.     LaTeX Font Info:    ... okay on input line 6.      ABD: EveryShipout initializing macros     (/local/opt/texlive/2012/texmf-dist/tex/context/base/supp-pdf.mkii     [Loading MPS to PDF converter (version 2006.09.02).]     \scratchcounter=\count109     \scratchdimen=\dimen148     \scratchbox=\box37     \nofMPsegments=\count110     \nofMParguments=\count111     \everyMPshowfont=\toks25     \MPscratchCnt=\count112     \MPscratchDim=\dimen149     \MPnumerator=\count113     \makeMPintoPDFobject=\count114     \everyMPtoPDFconversion=\toks26     ) (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty     Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO     )     Package pdftexcmds Info: LuaTeX not detected.     Package pdftexcmds Info: \pdf@primitive is available.     Package pdftexcmds Info: \pdf@ifprimitive is available.     Package pdftexcmds Info: \pdfdraftmode found.     )     (/local/opt/texlive/2012/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty     Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf          (/local/opt/texlive/2012/texmf-dist/tex/latex/oberdiek/grfext.sty     Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO)          (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty     Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)     ))     (/local/opt/texlive/2012/texmf-dist/tex/latex/oberdiek/kvoptions.sty     Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)          (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty     Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)          (/local/opt/texlive/2012/texmf-dist/tex/generic/oberdiek/etexcmds.sty     Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)     Package etexcmds Info: Could not find \expanded.     (etexcmds)             That can mean that you are not using pdfTeX 1.50 or     (etexcmds)             that some package has redefined \expanded.     (etexcmds)             In the latter case, load this package earlier.     )))     Package grfext Info: Graphics extension search list:     (grfext)             [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE     G,.JBIG2,.JB2,.eps]     (grfext)             \AppendGraphicsExtensions on input line 452.          (/local/opt/texlive/2012/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg     File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv     e     ))     (/local/opt/texlive/2012/texmf-dist/tex/latex/storebox/storebox-pgf.sty     Package: storebox-pgf 2011/12/21 v1.3a Patches for PGF to support transparency      and shadings inside storeboxes     Package storebox-pgf Info: Patching macro \pgfsys@horishading.     Package storebox-pgf Info: Patching macro \pgfsys@vertshading.     Package storebox-pgf Info: Patching macro \pgfsys@radialshading.     Package storebox-pgf Info: Patching macro \pgfsys@functionalshading.     Package storebox-pgf Info: Patching macro \pgfsys@fadingfrombox.     Package storebox-pgf Info: Patching macro \pgfsys@transparencygroupfrombox.     )     ! Missing number, treated as zero.     <to be read again>                         <     l.6 \begin{document}          ?      ! Illegal unit of measure (pt inserted).     <to be read again>                         <     l.6 \begin{document}          ?      ! Extra \fi.     \document ...p <1sp\global \topskip 1sp\relax \fi                                                        \global \@maxdepth \maxdep...     l.6 \begin{document}          ?      [1          {/local/opt/texlive/2012/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]     [2] (./test.aux)           *File List*     standalone.cls    2012/09/15 v1.1b Class to compile TeX sub-files standalone     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)      ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional      xkeyval.sty    2012/10/14 v2.6b package option processing (HA)      xkeyval.tex    2012/10/14 v2.6b key=value parser (HA)     standalone.cfg    2012/09/15 v1.1b Default configuration file for 'standalone'      class      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)         tikz.sty    2010/10/13 v2.10 (rcs-revision 1.76)          pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)       pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)       pgfrcs.code.tex      pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)       pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)       pgfsys.code.tex     pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)     pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive      pgfcore.code.tex     pgfcomp-version-0-65.sty    2007/07/03 v2.10 (rcs-revision 1.7)     pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)       pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)      pgfkeys.sty          pgfkeys.code.tex       pgffor.code.tex         tikz.code.tex     storebox.sty    2011/12/21 v1.3a Store and reuse boxes in a file size efficient      way     collectbox.sty    2012/05/17 v0.4b Collect macro arguments as boxes     supp-pdf.mkii     pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)     epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf       grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)     kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)     kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)     etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)     epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live     storebox-pgf.sty    2011/12/21 v1.3a Patches for PGF to support transparency an     d shadings inside storeboxes      ***********           )      Here is how much of TeX's memory you used:      10228 strings out of 493481      196958 string characters out of 3140986      10231912 words of memory out of 10432467      13337 multiletter control sequences out of 15000+200000      3938 words of font info for 15 fonts, out of 3000000 for 9000      957 hyphenation exceptions out of 8191      56i,5n,56p,411b,111s stack positions out of 30000i,500n,10000p,200000b,80000s     </local/opt/texlive/2012/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb>     Output written on test.pdf (2 pages, 9563 bytes).     PDF statistics:      18 PDF objects out of 1000 (max. 8388607)      12 compressed objects within 1 object stream      0 named destinations out of 1000 (max. 500000)      13 words of extra memory for PDF output out of 10000 (max. 10000000)      I've used this combination of packages before. What's going on, and how can I amend this problem or use a workaround?


title: Are the \[ and \begin{equation} used interchangeably?

text: When I use double dollar signs `$$` or `\\[` and `\\]` to begin and end math mode I have no problem compiling the file. When I substitute them with `\begin{equation}` and `\end{equation}` correspondingly I get an error. For example:               \[     \label{eq:stress_strain_eq}     \left\{\begin{array}{c}     \sigma_x \\     \sigma_y \\     \tau_{xy}     \end{array}\right\}     =     \begin{bmatrix}     \overline{Q}_{11}   & \overline{Q}_{12}  & \overline{Q}_{16}    \\[0.3em]     \overline{Q}_{12}   & \overline{Q}_{22}  & \overline{Q}_{26}    \\[0.3em]     \overline{Q}_{16}   & \overline{Q}_{26}  & \overline{Q}_{66}     \end{bmatrix}     \cdot     \left\{\begin{array}{c}     \epsilon_x \\     \epsilon_y \\     \gamma_{xy}     \end{array}\right\}     \]      produces the right result but I cannot reference it. I thought that the three options were interchangeable.


title: Simulating a figure-environment

text: In this question of mine, I asked how to distribute two pictures with some text between evenly (across the horizontal) and got a really good answer. Here's the code of it, for those who don't want to follow the link (there's picture there too!):               \documentclass{article}     \usepackage[demo]{graphicx}     \begin{document}     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           \begin{center}     \raisebox{\dimexpr-.5\height+.5\ht\strutbox}%       {\includegraphics[width=1in,height=1in]{black_square}}%     \hspace{.5in}%     and%     \hspace{.5in}%     \raisebox{\dimexpr-.5\height+.5\ht\strutbox}%       {\includegraphics[width=1in,height=1in]{black_square}}     \par\end{center}          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{document}      My question is: What do I have to do, to add some text below the pictures, so it is exactly spaced like in `figure` environment ? Or - even better - could one modify this code, so that instead of using `\includegraphics` I can directly use the `figure` environment so that two such environments are on the same height with some text between them ? Thank you very much!


title: How to draw a symbol on top of another symbol?

text: I have two circles: empty circle               \circle{5}      and solid circle               \circle*{3}      How can I draw solid one on top of empty one? Can we make a command? I want to put it within the text to show as a symbol. Thanks. Different things I have copied from internet:               \documentclass{article}     \newcommand\bulletarrow{{\ooalign{\raise0.8ex\hbox{$\bullet$}\cr$\downarrow$}}}     \begin{document}          \raisebox{.5pt}{\textcircled{\raisebox{-.9pt} {8}}}          \circle*{8}          \circle{15}               \setlength{\unitlength}{1mm}     \begin{picture}(60, 40)     \put(20,30){\circle{1}}     \put(20,30){\circle*{5}}     \put(20,30){\circle{8}}     \put(40,30){\circle{1}}     \put(40,30){\circle{2}}     \put(40,30){\circle{3}}     \put(40,30){\circle{4}}     \put(40,30){\circle{5}}     \put(40,30){\circle{6}}     \put(40,30){\circle{7}}     \put(40,30){\circle{8}}     \put(40,30){\circle{9}}     \put(40,30){\circle{10}}     \put(40,30){\circle{11}}     \put(40,30){\circle{12}}     \put(40,30){\circle{13}}     \put(40,30){\circle{14}}     \put(15,10){\circle*{1}}     \put(20,10){\circle*{2}}     \put(25,10){\circle*{3}}     \put(30,10){\circle*{4}}     \put(35,10){\circle*{5}}     \end{picture}               \end{document}


title: Alternative to \text inside an align environment

text: Is there a way to write texts without resorting to using the `\text` macro every time I write something in the `align` enviroment? I am trying to write a proof and pretty much 90% requires me to write inside the `align` environment. Here is an example               \documentclass[11pt]{article}     \usepackage{amsmath}     \begin{document}     \begin{align*}      E is {\bf open} & \iff \textit{every} point  is an {\bf interior point}                      & \iff \forall x \in E, there exists a neighbourhood of x such that each N is disjoint                      & \iff \forall x \in E, x is not a limit point of E^c                      & E^c contains all its limit points     \end{align*}     \end{document}      Basically if I were to include the text, I have to wrap each sentence with \text{...}


title: TikZ - diagram of the sun

text: I am attempting to generate the following diagram: ![enter image description here](http://i.stack.imgur.com/Kt85r.png) I am finding it difficult to place all of the triangles surrounding the center circle in the manner shown. Currently I can place four of the 8 triangles by specifying left, right and so on but I don't know how to place the triangles that are slanted. How would I go about completing this diagram?


title: Problem in setting the section heading in small caps font while changing the font

text: I am trying to change the font in the document to `Arial`. I am using the following code.               \documentclass{article}          \usepackage[margin=1in,headheight=5\baselineskip,headsep=1\baselineskip,includehead]{geometry}               \usepackage[scaled]{uarial}      \renewcommand*\familydefault{\sfdefault}      \usepackage[T1]{fontenc}          \usepackage{sectsty}      \sectionfont{\sc\sectionrule{0pt}{0pt}{-5pt}{0.5pt}}          \usepackage{lipsum}          \begin{document}               \section*{My Section Heading}     \lipsum               \end{document}      Unfortunately, the sections heading are not in small caps. When I comment out the following line it works but the font is the LaTeX normal font. Could someone help me on this?               \renewcommand*\familydefault{\sfdefault}      Here is the results with and without `\renewcommand*\familydefault{\sfdefault}`. ![enter image description here](http://i.stack.imgur.com/knPHE.png)


title: Automatically number a word in description if used at least twice

text: I defined an environment with `description` which automatically numbers the bold words if they appear twice or more often in an `\item[]`. So far it works fine, but I cannot add a `1` to the first word, if the word appears more often in a "incorrect" order (see ME). Here is my as-minimal-as-possible example and what I have done so far (needs two runs):               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage{selinput}     \SelectInputMappings{     adieresis={ä}, germandbls={ß},     }     \usepackage{xstring}     \usepackage{blindtext}          %%%%     \makeatletter          \newcounter{dcounter}     \newcounter{ecounter}            \def\Tipps@item[#1]{\g@addto@macro{\ListeII}{[#1]}%       \if@noparitem         \@donoparitem       \else         \if@inlabel           \indent \par         \fi         \ifhmode           \unskip\unskip \par         \fi         \if@newlist           \if@nobreak             \@nbitem           \else             \addpenalty\@beginparpenalty             \addvspace\@topsep             \addvspace{-\parskip}%           \fi         \else           \addpenalty\@itempenalty           \addvspace\itemsep         \fi         \global\@inlabeltrue       \fi       \everypar{%         \@minipagefalse         \global\@newlistfalse         \if@inlabel           \global\@inlabelfalse           {\setbox\z@\lastbox            \ifvoid\z@              \kern-\itemindent            \fi}%           \box\@labels           \penalty\z@         \fi         \if@nobreak           \@nobreakfalse           \clubpenalty \@M         \else           \clubpenalty \@clubpenalty           \everypar{}%         \fi}%       \if@noitemarg         \@noitemargfalse         \if@nmbrlist           \refstepcounter\@listctr         \fi       \fi       \sbox\@tempboxa{\makelabel{#1%         % Is #1 on the list?     \IfSubStr{\Liste}{#1}{%         % If it is     \def\inhalt{#1}%     % How often is #1 in \ListeII     \StrCount{\ListeII}{[#1]}[\Number]%     % If \Number is 1 do nothing, else print \Number     \ifnum\Number=1\relax\else~\Number%       % If Number is 2 make a label       \ifnum\Number=2 \label{\thedcounter\theecounter}\fi%     \fi%     }{%     % If not: Add to list     \g@addto@macro{\Liste}{ #1 }%     \stepcounter{dcounter}%     % is label r@\thedcounter\theecounter defined or not?     \@ifundefined{r@\thedcounter\theecounter}{}{~1}%     }%     :}}%       \global\setbox\@labels\hbox{%         \unhbox\@labels         \hskip \itemindent         \hskip -\labelwidth         \hskip -\labelsep         \ifdim \wd\@tempboxa >\labelwidth           \box\@tempboxa         \else           \hbox to\labelwidth {\unhbox\@tempboxa}%         \fi         \hskip \labelsep}%       \ignorespaces}          \def\Tippsitem{%        \@inmatherr\Tippsitem        \@ifnextchar [\Tipps@item{\@noitemargtrue \Tipps@item[\@itemlabel]}}           % - - - - - - - - - - - - - - - - - - - - - -           \newenvironment{Hinweis}{\def\Liste{}\def\ListeII{}% make lists empty     \setcounter{dcounter}{1}% setcounter back to one     \stepcounter{ecounter}%     \let\item\Tippsitem%      \begin{description}}      {\end{description}}           \makeatother     %%%%%          \begin{document}          % In "correct" order -> works fine :)     \begin{Hinweis}     \item[Fuß] In "correct" order -> works fine :)     \item[Fuß] For the problem look at the next list     \item[Fuß]correct     \item[was]correct     \item[Ärger]correct     \item[Würfel]correct     \item[Würfel]correct     \item[Würfel]correct     \item[Hmmm\dots]correct     \item[Würfel]correct     \item[Würfel]correct     \item[Würfel]correct     \item[Würfel]correct     \end{Hinweis}                    And here is the problem:      % In "incorrect" order -> doesn't work fine :(     \begin{Hinweis}     \item[Fuß] Here should be a \textbf{1}     \item[Ärger] No 1     \item[Fuß] correct     \item[Fuß] correct     \item[Hmmm\dots] correct     \item[Würfel] Should be a \textbf{1}     \item[was] No \textbf{1}     \item[Würfel]correct     \item[Würfel]correct     \item[Würfel]correct     \item[Würfel]correct     \item[Würfel]correct     \item[Würfel]correct     \end{Hinweis}          \end{document}      As you can see the numeration of the second list is wrong. You can find my first try here (second post), but I do not like the solution because it did not allow me to use `\dots` and I had to build a macro to be able to use `ß`, etc... and so I made a new one (this one). I hope someone has an idea how to solve this numeration problem.


title: pgfplots grouped bar chart from file

text: I am trying to create a grouped bar chart with pgfplots from a file that contains a data table. However in the resulting picture the bars are not grouped but on top of each other. Every working example of grouped bar charts with pgfplots I found in the documentation, at stackoverflow or with google includes the coordinates in the tex file itself (those example work for me too). The bars should be in pairs with one pair for each value of `rounds`. The first bar of each pair should be the corresponding value of `RRS`. The second bar of each pair should be the corresponding value of `QRC`. My tex file               \documentclass[a4paper,10pt]{article}          \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usepackage{pgfplots}          \pgfplotsset{compat=1.8}          \begin{document}     \begin{tikzpicture}       \begin{axis}[ybar]         \pgfplotstableread{frequency_comparison_23.dat}\loadedtable;              \addplot table[x=rounds, y=RRS] {\loadedtable};         \addplot table[x=rounds, y=QRC] {\loadedtable};           \end{axis}     \end{tikzpicture}     \end{document}      And the table "frequency_comparison_23.dat"               vertices rounds RRS QRC     8388608 37 47 727     8388608 38 5731 15709     8388608 39 29072 35103     8388608 40 33027 26904     8388608 41 18914 13062     8388608 42 8141 5291     8388608 43 3177 1999     8388608 44 1179 766     8388608 45 435 273     8388608 46 175 104     8388608 47 59 43     8388608 48 26 11     8388608 49 9 5     8388608 50 6 3     8388608 51 1 0     8388608 52 1 0


title: Tables as Header and footer

text: I've been struggling with my `.tex` for quite some time now, and decided its time to look for help. This is the situation: all docs here (my office) need to bring, as header, a table (3 columns) which contains logo & title & page count. Also, as footer, it must have a table (2 columns) which contains text & text. I'm using the `book` documentstyle because I need the summary and chapter structure. I've already tried the `\background` package, but it seens to not accept tables as content. So, here is the question: could you point me the direction I must follow? I wanted to include a picture, but my rep doesn't allow me.... * * * Update: 05-09-2013 Trying new code now, thanks for your help! the code:                   \documentclass[a4paper,12pt]{book}     \usepackage[utf8]{inputenc}     \usepackage[demo]{graphicx}     \usepackage{hyperref}     \usepackage{array}     \usepackage{lastpage}     \usepackage{lipsum}          \usepackage{fancyhdr}     \usepackage[hmargin=2cm,top=4cm,headheight=65pt,footskip=65pt]{geometry}          \setlength{\parindent}{0.95cm}          \pagestyle{fancy}     \renewcommand{\headrulewidth}{0pt}     \fancyhead[C]{%               \begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.5cm}|}               \hline               \includegraphics[height=1.5cm,width=2.5cm]{logo.png} &               \centering               \Huge{TITLE} &               \centering               \tiny{P\'ag. \thepage\ de \pageref{LastPage}\\               Data: 17/05/2013\\               Rev. 0}\tabularnewline               \hline               \end{tabular}%     }     \fancyfoot[C]{%               \begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.5cm}|}               \hline               \includegraphics[height=1.5cm,width=2.5cm]{logo.png} &               \centering               \Huge{TITLE} &               \centering               \tiny{P\'ag. \thepage\ de \pageref{LastPage}\\               Data: 17/05/2013\\               Rev. 0}\tabularnewline               \hline               \end{tabular}%     }          \begin{document}     \lipsum[1-10]     \end{document}      produces the table header, but its overlapping the default header. Also, the pages in which a chapter starts, there is no header. I need headers in all pages. Some pics: ![Overlapping Headers](http://i.stack.imgur.com/PRDsk.png) Overlapping Headers ![Blank header](http://i.stack.imgur.com/mCxoR.png) ## Blank header ## ----------------------------------------------------- Initial code: Could you take a look at my code? its not working the way its supposed to do: its produces only a table, but not as header or footer.               \documentclass[a4paper,12pt]{book}     \usepackage{graphicx}     \usepackage{hyperref}     \usepackage{epsfig}     \usepackage{float}}     \usepackage{multicol}     \usepackage{array}     \usepackage{multirow}     \usepackage{lastpage}          \usepackage[margin={2cm}]{geometry}          \usepackage[brazilian]{babel}     \usepackage[utf8]{inputenc}                    \setlength{\paperheight}{29.7cm} \setlength{\paperwidth}{21cm}          \usepackage{indentfirst}     \setlength{\parindent}{0,95cm}                    \usepackage{fancyhdr}     \pagestyle{fancy}          \setlength{\headheight}{16pt}     \fancyhead{               \begin{table}[t]                    \begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.0cm}|}                    \hline               \includegraphics[height=1.5cm]{logo.png} &               \centering               \HUGE{TITLE} &               \centering               \tiny{Pág. \thepage\ de \pageref{LastPage}                     Data: 17/05/2013                    Rev. 0}         &               \hline                    \end{tabular}               \end{table}     }          %I need a similar table on footer     \fancyfoot[C]{           \begin{table}[t]                    \begin{tabular}{|m{3.0cm}|m{10.0cm}|m{2.0cm}|}                    \hline               \includegraphics[height=1.5cm]{logo.png} &               \centering               \HUGE{TITLE} &               \centering               \tiny{Pág. \thepage\ de \pageref{LastPage}                     Data: 17/05/2013                    Rev. 0}         &               \hline                    \end{tabular}               \end{table}          }               \begin{document}          CONTENTS          \end{document}


title: Clean-Looking Piecewise-Defined Functions

text: I want to write a clean-looking piecewise defined function. There's a similar post here: How to write a function (piecewise) with bracket outside?, but I have follow-up questions. The two options I have now are:               \[ f(n) = \begin{cases}            \frac{n}{2} & \textrm{ if $n$ is even} \\           -\frac{n-1}{2} & \textrm{ if $n$ is odd} \\        \end{cases} \]      (using the `amsmath` package), and               For every $n \in \mathbb{N}$, let     \[ f(n) = \left\{      \begin{array}{l l}     \frac{n}{2} & \quad \mbox{if $n$ is even}\\     -\frac{n-1}{2} & \quad \mbox{if $n$ is odd}\\     \end{array} \right. \]      Both seem pretty complicated for something so simple... Also, is there a way to "center" the `$\frac{n}{2}$`, so it looks aligned with `$-\frac{n-1}{2}$` (instead of off to the left)?