title: Tips for choosing hardware for best LaTeX compile performance

text: Which things should one have in mind when one wants to buy new hardware optimized for best (pdf)latex performance? For example one might think the more cores on your cpu the better. But since latex is a linear thing there is no much space for parallelizing. So the number of cores seems not to be so important. What features of your new system especially the cpu are crucial for best latex performance? Which features that are usually important for good performance for general use are not crucial for latex performance? **Edit:** Clearly you could simply choose the most expensive high end system you can get. However usually one has a budget and the question is really about which parts of the system and features in detail are crucial for latex compile performance and which are not so important because latex cannot use it for example...


title: fontspec-color not working correctly with microtype package

text: If I use the fontspec package together with the microtype package, the color- feature of fontspec does only colarize the last line of the paragraph instead of the whole paragraph, as the grouped `\addfontfeature`-command should work.               \documentclass{article}          \usepackage{fontspec}     \usepackage{xcolor}     \usepackage{microtype}          \setmainfont{DejaVu Serif}          \begin{document}     \twocolumn%     Test. Test. Test. Test. Test. Test.      Test. Test. Test. Test. Test. Test.      Test. Test. Test. Test. Test. Test.      Test. Test. Test. Test. Test. Test.      Test. Test.          \begingroup%         \addfontfeature{Color=blue}%         Test. Test. Test. Test. Test. Test.          Test. Test. Test. Test. Test. Test.          Test. Test. Test. Test. Test. Test.          Test. Test. Test. Test. Test. Test.          Test. Test.     \endgroup%          Test. Test. Test. Test. Test. Test.      Test. Test. Test. Test. Test. Test.      Test. Test. Test. Test. Test. Test.      Test. Test. Test. Test. Test. Test.      Test. Test.     \end{document}      The result looks like this: ![Badly colored paragraph](http://i.imgur.com/jYAnqwC.jpg). I use LuaLaTeX with `fontspec.sty` (2013/03/16 v2.3a) and `microtype.sty` (2013/03/13 v2.5).


title: Tikz how to draw a line to rectangle split

text: I am drawing an ER-diagram and would like to show the relationships between tables. ![enter image description here](http://i.stack.imgur.com/zTS6Q.png) I managed to create the tables:               \documentclass{article}     \usepackage[cm]{fullpage}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{shapes,positioning}          \tikzset{       outernode/.style={draw,ultra thick,inner sep=0},       innernode/.style={inner sep=.3333em,draw,rectangle split}     }     \newcommand\innernode[2]{\tikz\node[innernode,rectangle split parts=#1]{#2};}          \begin{document}     \begin{tikzpicture}       \node (1) [outernode]            { \innernode 2 {sco\_groups \nodepart{second} id} } ;       \node (2) [below= 1cm of 1.south east, anchor=north west, outernode]            { \innernode 3 {sco\_index \nodepart{second} tid \nodepart{third} sco\_id} } ;     \end{tikzpicture}     \end{document}      But don't know, how to create the line, uniting them (I marked it with red).


title: Automatically increasing date in table cell

text: I'd like to have an automatic date in a table. Automatic date means I'd like to specify a start date which is shown in the first row of the table and every additional row shows appropriate next day. I've already implemented a newcommand for the appropriate row. What I need now is a way to increase a specified date by a counter value. Here are my commands:               \newcommand{\pweek}[3]{         \setcounter{weekCounter}{1}         \section*{Tagesberichte Woche #1}         \begin{table}[h]             \begin{tabular}{|p{1cm}|p{14cm}|}                 #2             \end{tabular}         \end{table}         \newpage         \section*{Wochenbericht #1}     #3     \newpage     }          \newcommand{\pday}[1]{         \hline         \arabic{weekCounter}\stepcounter{weekCounter} & #1 \\ \hline     }      I'd like to replace `\arabic{weekCounter}` with the corresponding date which has to be specified somehow in the parameter list of the command. Do you know how to achieve this?


title: Can PGF plot the integral of any specified function?

text: How can I use the `pgf` maths engine to plot the integral of any function? For example `\addplot {int(cos(x))}` does not work.


title: \renewcommand and \newcommand for accented letters

text: I'm using OT1 font encoding, but I would like to use T1 font encoding for glyphs that don't exist in OT1. To do that, I'm redefining the typical T1 commands so that they automatically choose a T1 encoding. With the commands for accented letters, however, like `\'e` for `é`, using `\newcommand{\'e}` won't work because `\'` is already defined, but I can't use `\renewcommand{\'e}` either, since the full sequence `\'e` is not already defined. Suggestions?               \documentclass{article}     \usepackage[T1, OT1]{fontenc}     %\newcommand{\'e}{\fontencoding{T1}\selectfont{\symbol{233}}} <- gives 'Command \' already defined' error     %\renewcommand{\'e}{\fontencoding{T1}\selectfont{\symbol{233}}} <- gives '\'eundefined' error     \begin{document}     \'e     \end{document}      * * * **EDIT:** Given all the comments about the OT1 vs. T1 encoding, here's the contents of the OT1 and T1 fonts for `libertine`. One can see here that the OT1 font has some ligatures the T1 font doesn't have:               \documentclass{article}     \usepackage{fonttable}     \begin{document}     \fonttable{LinLibertineT-lf-ot1} % OT1 encoding     \fonttable{LinLibertineT-lf-t1} % T1 encoding     \end{document}      ![enter image description here](http://i.stack.imgur.com/ERD8n.png) ![enter image description here](http://i.stack.imgur.com/oTuqm.png)


title: How to create a citation graph using Bibtex and XML

text: I would like to include a citation graph for all the citations in my bibliography. My question is how to parse the graph file (in XML format), replacing the `\cite{...}` keys with the correct number from the bibliography for my document. I'll illustrate what I'm trying to do with a minimal example. Let's suppose my document has just 2 citations, DocA and DocB. DocA is itself included in the bibliography of DocB, so the citation graph has one directed edge. I define this graph in XML format using GEXF (http://gexf.net/format/) as follows:               <graph defaultedgetype="directed">     <nodes>        <node id="0" label="\cite{DocA}" />        <node id="1" label="\cite{DocB}" />     </nodes>     <edges>        <edge id="0" source="1" target="0" />     </edges>     </graph>      I can load this file into Gephi (https://gephi.org/) to produce a visualisation which I output as PDF and import as an image in my LaTeX source file. In the LaTeX file, I also have `\cite{DocA}` and `\cite{DocB}` somewhere, which will be replaced by numbers `[1]` and `[2]` in the document's bibliography. What I want to do is replace `\cite{DocA}` and `\cite{DocB}` in the XML file with `[1]` and `[2]` so that they correspond to the numbers in the document bibliography. Can I use BibTeX to do this? If I can get this to work, it should provide a pretty visualisation of how the documents in my bibliography relate to each other.


title: Using multicolumn in latex

text: I want to create a table like this using Latex                     ---------------------------------           |               sets            |           ---------------------------------           | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |     ---------------------------------------     | I1  | * |   | * | * |   | * |   | * |     ---------------------------------------      Here is what I wrote               \begin{table}     \caption{Multiprogram sets}     \label{multiprogram}      \begin{tabular}{| c | c | c | c | c | c | c | c | c |}       \cline{3-9}       \multicolumn{8}{}{}    &   Sets  \\       \hline       \multicolumn{1}{}{}   & 1 & 2 &  3 & 4 & 5 &  6 & 7  & 8 \\       \hline        astar         &  & * &  & * &  &  & * &   \\       \hline      \end{tabular}     \end{table}      But it doesn't work! The output look like                         -----------------------------                                      sets |     ---------------------------------------             1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |     ---------------------------------------     | I1  | * |   | * | * |   | * |   | * |     ---------------------------------------      Any way to fix that?


title: Is it possible to add new alphabets to unicode-math?

text: In ordinary LaTeX, one can easily add new math alphabets by using `\DeclareMathAlphabet`. One is then able to use, say, `cmsy`, `eus`, and `rsfs` letters side-by-side. Unfortunately, there does not seem to be a similar mechanism in `unicode-math`, or at the very least `\DeclareMathAlphabet` doesn't do what it's supposed to do. **Question.** How can I set up my own math alphabets in `unicode-math`? ## Attempted workarounds Since `unicode-math` has lots of math alphabets, one workaround might be to replace an unused alphabet with the desired one using `\setmathfont[range=...->...]`. This doesn't quite work right in my example:               \documentclass[12pt]{article}     \usepackage{fontspec,xltxtra,xunicode}     \defaultfontfeatures{Mapping=tex-text}          \usepackage{unicode-math}          \scrollmode          \setmathfont{xits-math.otf}     \setmathfont[range={\mathscr,\mathbfscr},StylisticSet=0]{xits-math.otf}     \setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{xits-math.otf}     \setmathfont[range={\mathtt->\mathcal}]{latinmodern-math.otf}          \begin{document}     \[     \begin{array}{c}     \mathcal{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} \\     \mathscr{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} \\     \mathtt{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}     \end{array}     \]      I suspect the problem is that the codepoints of the calligraphic letters in Unicode are not contiguous. Using `\mathversion` seems to work better:               \documentclass[12pt]{article}     \usepackage{fontspec,xltxtra,xunicode}     \defaultfontfeatures{Mapping=tex-text}          \usepackage{unicode-math}          \setmathfont{xits-math.otf}          \setmathfont[version=eucal]{latinmodern-math.otf}     \newcommand{\eucal}[1]{\mathchoice %       {\mbox{\mathversion{eucal}$\displaystyle\mathscr{#1}$}} %       {\mbox{\mathversion{eucal}$\mathscr{#1}$}} %       {\mbox{\mathversion{eucal}$\scriptstyle\mathscr{#1}$}} %       {\mbox{\mathversion{eucal}$\scriptscriptstyle\mathscr{#1}$}}}          \setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{xits-math.otf}          \begin{document}     \[     \begin{array}{c}     \mathcal{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} \\     \mathscr{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} \\     \eucal{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z}     \end{array}     \]     \end{document}      But this feels very inefficient.


title: biblatex: How to abbreviate names in citations (only get, say, first letters of last names)?

text: In presentation slides, one's own work is typically abbreviated, by, say, first letters of last names (like "This has been solved by FB (2013)" instead of "This has been solved by Foobarfoo and Barfoobar (2013)"). How can this be achieved with `BibLaTeX`, while keeping the full references in the bibliography? (like "Foobarfoo, B. and Barfoobar, F. (2013), On strange BibLaTeX questions, Journal of BibLaTeX 12(3)". [The latter bibliography style I already have, I am just wondering whether there is an option so that `\cite{}` changes from the standard, full-last-name author-year style to this new, abbreviated style. I saw the option `abbreviate=true`, but of course that didn't do it.]


title: Stack overflow / endless recursion when using menukeys

text: since I've upgraded from TeX Live 2012 to TeX Live 2013, I have some trouble with a custom package. The package provides some commands that are intended to be used either as standalone commands or embedded within the `\keys{}` command provided by the `menukeys` package. The commands use a mechanism I've picked up somewhere to allow for an optional argument - don't know whether it's a good idea to do it that way, but it has worked so far. Now, for some reasons I don't fully understand, the system enters an endless loop until it hits the maximum stack size. Can someone please tell me what went wrong here and what I can do to prevent this? Thanks Volker MWE:               \documentclass{scrartcl}     \usepackage{menukeys}          % This would usually be part of my custom package...     \makeatletter     \def\foobar{\@ifnextchar[\@foobar{\@foobar[]}}     \def\@foobar[#1]#2{foo=#1, bar=#2}     \makeatother          \begin{document}     without optional argument: \foobar{FOO}          with optional argument: \foobar[BAR]{FOO}           \keys{some key}          % the next line triggers the error: TeX capacity exceeded, sorry [input stack size=5000].     \keys{without optional argument: \foobar{FOO}}          \keys{with optional argument: \foobar[BAR]{FOO}}     \end{document}


title: How to direct Aquamacs to all .aux files such that they can be trashed?

text: is there a way to pass a command in the .emacs so the Aquamacs to trash all the auxiliary files keeping only pdf and tex in the folder?


title: upside down question/exclamation mark

text: I'm trying to use the urw-garamond font to write some text in spanish, but the upside down question and exclamation marks aren't recognised properly.. I've saved the source document as utf8, so shouldn't it 'just work'? my source is as follows:               \usepackage{fullpage}     \usepackage{setspace}     \doublespacing          \usepackage[T1]{fontenc}     \usepackage[urw-garamond]{mathdesign}     \usepackage{garamondx}          \begin{document}          á, é, í, ó, ú, ü, ñ, ¿, ¡          \end{document}      and the output is:               á, é, í, ó, ú, ü, ñ, £, a


title: Is it possible to change the edges for some tree level using forest package?

text: Is it possible to change this MWE which is using forest package to produce a tree, similar to that produced by the next MWE that is not using forest? The very last level of child nodes would have to be stacked on top of each other with edge drawn from the `south` of the parent to the `west` of the child. After reading the Forest manual, I got an impression that the key `where n children=0` should be able to help, and added the line with the comment, but no matter what `grow` parameter I supplied, such as north/south, or 0-45-90-120 etc, the direction of growth did not change. The solution probably lies in the pp. 10-12 of the Forest manual, but it is evading me :(               \documentclass{article}     \usepackage{forest}          \begin{document}          \begin{forest}      for tree={       where n children=0{draw=red,grow=120}{}, %<============       edge path={         \noexpand\path[\forestoption{edge}]           (!u.parent anchor) -- +(0,-15pt) -|              (.child anchor)\forestoption{edge label};       },       l sep=10pt,     }      [P       [N1         [N1C1]         [N1C2]       ]       [N2         [N2C1]         [N2C2]       ]     ]     \end{forest}     \end{document}      Without forest (the lowest level edge is different and the nodes are stacked):               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{trees}          \begin{document}          \begin{tikzpicture}[         children/.style={grow=down,xshift=-0.2cm,             edge from parent path={(\tikzparentnode.201) |- (\tikzchildnode.west)}         },         level1/.style ={level distance=4em,anchor=west},         level2/.style ={level distance=8em,anchor=west},         level 1/.style={edge from parent fork down,sibling distance=5em,level distance=4em         }     ]         \node[anchor=south](super){P}[]         child{node {N1}             child[children,level1] {node {N1C1}}             child[children,level2] {node {N1C2}}         }         child{node {N2}             child[children,level1] {node {N2C1}}                  child[children,level2] {node {N2C2}}};     \end{tikzpicture}     \end{document}


title: reading and processing data in pgfplots

text: I have a standard text file, two columns, space separated, containing x and y data to be plotted. I want to plot x vs -y, i.e. plot(x,-y). In general, how do you read your data and plot a function of them in pgfplots, e.g. (x,-y), (log x, y), (x, y^2), etc? The following code returns error               \pgfplotstableread{inputdata.txt}\mydata;     \addplot table [ color=red, only marks, mark=*, mark size=0.5pt, x expr=\thisrowno{1}, y expr=\thisrowno{2}*-1 ] {\mydata};


title: Style Parcolumns vertical bar

text: How can I style the vertical bar in parcolumns that appears when using `rulebetween=true`? I am trying to do something similar to what you can do with `\vrule` like the below:               \newcommand\VRule{\color{gray}\vrule width 0.5pt}      Here is what I have currently:               \documentclass{article}     \usepackage[margin=1in]{geometry}% http://ctan.org/pkg/geometry     \usepackage{lipsum}% http://ctan.org/pkg/lipsum     \usepackage{parcolumns}% http://ctan.org/pkg/parcolumns     \begin{document}         \begin{parcolumns}[nofirstindent,colwidths={1=2cm},rulebetween=true]{2}             \colchunk[1]{\noindent 1770 }             \colchunk[2]{\noindent \lipsum [1-3]}         \end{parcolumns}     \end{document}


title: Environment aligned undefined when trying to write a system of equations

text: I'm trying to write a system of equations in LaTeX. From the Wiki page _Advanced Mathematics_ I took this example:               \begin{equation}      \left.\begin{aligned}             B'&=-\partial \times E,\\             E'&=\partial \times B - 4\pi j,            \end{aligned}      \right\}      \qquad \text{Maxwell's equations}     \end{equation}      but as a result I got:               ! LaTeX Error: Environment aligned undefined.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.49  \left.\begin{aligned}      Does anybody know what goes wrong here?


title: How do you jump to an error from the Error List in LaTeX-suite?

text: I just discovered LaTeX-suite and was overjoyed with the breadth of the compiling and debugging options, but for some reason the primary debugging mechanism is not working for me. When I compile with `\ll` I get the expected log output, and then the "Quickfix List" window appears and gains focus. The reference manual appears to indicate that simply pressing enter should move focus to the source window at the location of the error, but for me it does nothing but minimize the accompanying log output preview. The reference at http://folk.uio.no/haaksk/config-files/.vim/doc/latex- suite.html indicates               You can then scroll through the errors and press <enter> to be taken to the location     of the corresponding error´unless you set the g:Tex_GotoError variable to 0.      Even with `Tex_GotoError` set to `1` I do not get the expected behaviour, and I'm not sure what else to try.


title: Switching math fonts with unicode-math

text: I want to use a different math font in figures (namely tikzpictures). I already asked a question about this topic where I tried to mix `mathspec` and `unicode-math`. Now after some reseach I realized that `mathspec` does not allow to switch the font at all and I should use only `unicode-math`. But there I also get build errors in my MWE (or should I say MnWE, because it does not work):               % !TEX TS-program = xelatex     \documentclass{article}          \usepackage{etoolbox}     \usepackage{tikz}     \usepackage{unicode-math}     \setmainfont{TeX Gyre Pagella}     \newcommand{\rmmath}{\setmathfont{TeX Gyre Pagella Math}}     \rmmath     \setsansfont[Scale=MatchUppercase]{Candara}          \newcommand{\sfmath}{ %         \setmathfont{TeX Gyre Pagella Math} %         \setmathfont[range=\mathup, Numbers=Lining, Scale=MatchUppercase]{Candara} %         \setmathfont[range=\mathit, Scale=MatchUppercase]{Candara Italic} %         \setmathfont[range=\mathbf, Scale=MatchUppercase]{Candara Bold} %     }          \BeforeBeginEnvironment{tikzpicture}{\sfmath}     \AfterEndEnvironment{tikzpicture}{\rmmath}          \begin{document}     % This would work, but I actually do not need sans math in running text     %   \sfmath $I$     %   \rmmath $I$     %   \sfmath $I$     %   \rmmath $I$     %   \sfmath $I$     %   \rmmath $I$     %   \sfmath $I$     %   \rmmath $I$              Text $I$         \begin{figure}         \begin{tikzpicture}             \node {Node: $I$};         \end{tikzpicture}         \caption{Caption text with math $I$}         \end{figure}         Text     % If you remove the following lines it will compile         \begin{figure}         \begin{tikzpicture}             \node {Node: $I$};         \end{tikzpicture}         \caption{with math $I$}         \end{figure}     \end{document}      Some interesting notes: if I remove the `figure` environment, i.e. only use `tikzpicture` it will build. If I use `center` instead of `figure` it also does not work. Funnily enough, if I have only **one** figure it will build. The first error I get:               .................................................     . fontspec info: "defining-font"     .      . Font family 'Candara(1)' created for font 'Candara' with options     . [BoldItalicFont={},ItalicFont={},Script=Math,SizeFeatures={{Size=10-},{Size=7     .40005-10,Font=Candara,Style=MathScript},{Size=-7.40005,Font=Candara,Style=Math     ScriptScript}},Numbers={Lining},Scale={MatchUppercase}].     .      . This font family consists of the following shapes:     .................................................          ! LaTeX Error: Symbol font `um_fam1' not defined.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.43 ^^I\begin{tikzpicture}          Your command was ignored.


title: Table inside a fcolorbox

text: Here is what I am trying to do: I am trying to create an environment similar to a colored `textbox`in MS Word and enter text, table, and formulas inside the box. Right now, this is what I do:                 \fcolorbox{black}{black!20}{\parbox{\textwidth}{%             \color{red!70!black}%     text text math math         }}      However, when I try to include a table inside this environment, I get error. Is it possible to modify this environment such that it can also accommodate the tables as well? Here is a `MWE`:               \documentclass[12pt, xcolor=pdftex,x11names,table]{article}     \usepackage{tabularx}     \usepackage{graphicx}     \usepackage{mathtools}          \usepackage{pdfpages}     \usepackage{setspace}     \usepackage{verbatim}     \usepackage{subfig}     \begin{document}     text $i=j$                      \fcolorbox{black}{black!20}{\parbox{\textwidth}{%                 \color{red!50!black}%     again text and $math$     \begin{table}         \begin{tabular}{ccc}                \textbf{Q} & \textbf{test}&\textbf{test2}\\           \hline           5 &&\\           \hline           \end{tabular}%          \end{table}             }}     \end{document}


title: How to modify the position of path nodes in tikz

text: I've created the following diagram with tikz. ![diagram](http://i.stack.imgur.com/w3JCh.png) As you can see, it's difficult to read the each numbers on the paths. I'd like to modify the position of the numbers on the paths. How can I do this? Here's my code so far:                \documentclass[titlepage,10pt, a4paper]{article}      \usepackage{tikz}      \usetikzlibrary{arrows,shapes,automata,positioning,calc}           \begin{document}      \begin{center}      \tikzset{      adim/.style={rectangle,minimum width=50,minimum height= 20,draw,thick},      nn/.style={rectangle,minimum width=210, minimum height=20,draw,thick},}      \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=7cm,      thick,main node/.style={draw,font=\sffamily\Large\bfseries}]      \node (Z1) [adim] at (-4,4)  {Z$_1$};      \node (Z2) [adim] at (-1,4) {Z$_2$};      \node (Z3) [adim] at (2,4)  {Z$_3$};      \node (Z4) [adim] at (5,4)  {Z$_4$};       \node (G1) [adim] at (-4,0.5)  {G$_1$};       \node (G2) [adim] at (-1,0.5) {G$_2$};       \node (G3) [adim] at (2,0.5)  {G$_3$};       \node (G4) [adim] at (5,0.5)  {G$_4$};       \path[every node/.style={font=\sffamily\small}]           (Z1) edge node[midway, right] {8} (G1)           (Z2) edge node[midway, right] {3} (G2)           (Z2) edge node[midway, right] {2} (G3)           (Z2) edge node[midway, right] {6} (G4)           (Z3) edge node[above] {4} (G1)           (Z3) edge node[midway, right] {12} (G2)           (Z3) edge node[midway, right] {15} (G3)           (Z4) edge node[midway, right] {3} (G3)           (Z4) edge node[midway, right] {9} (G4)      \end{tikzpicture}      \end{center}      \end{document}


title: Rationale to use \input{filename} on the pdflatex command line?

text: In a tex.SX user profile, I read the best practice recommendation > Execute `pdflatex \input{filename}` instead of `pdflatex filename`. I have always used the latter one, directly, in scripts, and in Makefiles. What would be a reason to _always_ use `pdflatex \input{filename}` instead?


title: Can I change documentclass in the middle of a document?

text: A school I'm applying to requires me to combine my research statement and my CV into a single document. However, my research statement is in the `amsart` document class while my CV is in the `article` document class and I'm having trouble getting it to look at all nice in a single class. Is there a way to change document class part of the way through a document? Alternately is there an easy way to get LaTeX to just concatenate the output of two different files?


title: how to split the table heading in booktabs?

text: how to split the column headings? How do I get newline after some word? When I put `\\\`, it changes the alignment badly. This is my code:               \documentclass{article}     \usepackage{pgfplots}     \usetikzlibrary{patterns}     \usepackage{booktabs,tabularx}               \begin{document}          \begin{table}[t]     %\setlength{\tabcolsep}{6.2 pt}     \caption{Case studies}     \centering      \begin{tabularx}{\textwidth}{p{3cm}ccccc}         \toprule     \centering Nature of unreliability &  Sender SST & Receiver SST & Implementation SST & Retransmission Bound & Decidability\\               \midrule          Noisy (Single fixed error message) & DSST & DSST & DSST & Unbounded & Yes\\     \bottomrule     \end{tabularx}     \label{case-studies}     \end{table}               \end{document}       This what I got: I just want to split the column title in two rows. How do I do that? ![enter image description here](http://i.stack.imgur.com/PpYHq.png)


title: Redefining \listoffigures and \listoftables to flow like regular two-column text

text: I found this redefinition of a table of contents very useful for my very long table of contents within my two-column book. With a slightly modified version of the command in the link, I got what I wanted:               \makeatletter     \renewcommand\tableofcontents{%         \section*{\huge\contentsname             \@mkboth{%                \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}         \@starttoc{toc}%     }     \makeatother      The problem is that I can't figure out how to do the same for `listoffigures` and `listoftables`. Does anyone know how? I took a guess at what might do the job (below), but that definitely didn't work. If anyone can point me to documentation, that would also be appreciated. I know how to get rid of any undesired page breaks; that's not an issue.               \makeatletter     \renewcommand\listoffigures{%         \section*{\huge\contentsname             \@mkboth{%                \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}         \@startlof{lof}%     }     \makeatother      * * * A minimal working example:               \documentclass[9pt,openany,twocolumn]{book}          \makeatletter     \renewcommand\tableofcontents{%         \section*{\huge\contentsname             \@mkboth{%                \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}         \@starttoc{toc}%     }     \makeatother          \begin{document}          \let\cleardoublepage\relax     \frontmatter     \begingroup     \let\clearpage\relax     \tableofcontents     \listoffigures     \endgroup          \mainmatter     \chapter{Armadillo}     \section{Grubs}     \begin{figure}       \caption{Pink Fairy armadillo}       \label{fig1}     \end{figure}          \chapter{Beetle}     \section{Leaves}     \begin{figure}       \caption{Dung beetle}       \label{fig2}     \end{figure}          \chapter{Cat}     \section{Birds}     \begin{figure}       \caption{Siamese cat}       \label{fig3}     \end{figure}          I think I'm hungry??          \end{document}      ![enter image description here](http://i.stack.imgur.com/Q52fn.png)


title: Generating code examples

text: I would like to make a table showing some custom commands that I have defined. It would be nice if I could do something like the following.               \documentclass{article}          \newcommand{\reals}{\ensuremath{\mathbf{R}}}     \newcommand{\CodeExample}[1]{\verb~#1~ & #1 \\}          \begin{document}          $$     \begin{array}{r@{\qquad}r}         \CodeExample{\reals}     \end{array}     $$          \end{document}      I want the left column of my table to be the LaTeX code, and the right column to be the typeset output. However, my code places the typeset output in both columns. Is there anyway to make this work, or do I need to manually enter both columns of my table? Thanks everyone for your help! I would like to do one more thing: define an environment to generate the table of code examples. Here is my attempt.               \documentclass{article}         \usepackage{array,xparse}         \NewDocumentCommand{\CodeExample}{v}{#1 & \scantokens{#1} \\}         \newenvironment{CodeExamples}[1]         {             \begin{center}                 \begin{tabular}{|>{\ttfamily}l|>{$}l<{$}|}                     \hline         }         {                     \hline                 \end{tabular}             \end{center}         }              \newcommand{\reals}{\ensuremath{\mathbf{R}}}          \begin{document}          \begin{CodeExamples}         \CodeExample{\reals}         \CodeExample{\reals^{n}}     \end{CodeExamples}          \begin{CodeExamples}         \ \CodeExample{\reals}         \CodeExample{\reals^{n}}     \end{CodeExamples}          \end{document}      There are two problems with my environment. First, I need the ensuremath in my definition of the reals macro; otherwise, I get a "mathbf only allowed in math mode" error. Second, the environment seems to be eating the first character of the input: that is why I added the extra space in the second example of the CodeExamples environment.


title: Unequal bin widths in pgfplots density histogram

text: In the pgfplots manual, it talks about density histograms with equal bin widths/ranges. Is it possible to make a density histogram with specified unequal bin widths/ranges? For example, if I set xmin=1, xmax=3 and bins=2, it will automatically make 2 bins, [1,2) and [2,3]. Can I make the bins [1, 1.2] and (1.2, 3]?


title: LyX reference problem

text: I'm having a minor reference problem. Im using LyX 2.1.0 on Mac and Jabref 2.9. My problem is that when I'm making a reference to an article/book, etc. that have exactly two authors it says "and" between the authors, for example (Petersen, C. and Plenborg, T.). Right now, I'm writing a seminar that has to be in my native language (danish) and therefore, I need to replace the "and" with "og". How can I do that? I have tried to change the language-settings in both LyX and Jabref to danish, but it doesn't work. Jabref is set to the ISO8859_1 encoding - I don't now if it has something to do with that? Any help is appreciated.


title: Adding a caption or title to a listing in an mdframed environment

text: I have several pieces of Matlab script I have put into boxes using the below method. I want to be able to call them listings 1 2 3 4 etc. Preferably a command that will do it automatically for me. New to LaTeX so no idea I have searched and found very little.               \documentclass[a4paper,12pt]{article}         \usepackage{mdframed}         \begin{document}         \begin{mdframed}[skipabove=\topsep,skipbelow=\topsep]         \begin{verbatim}         S = 55; % Value of the underlying        ...         V =             2.2147   %This is the value of our put option         \end{verbatim}         \end{mdframed}         \end{document}


title: Label name in circuitikz

text: Is it possible to get a labelname in circuitikz to be equal to the output from               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{circuits.ee.IEC}     \usepackage{siunitx}     \begin{document}     \begin{tikzpicture}[circuit ee IEC,every info/.style={font=\footnotesize},set resistor graphic=var resistor IEC graphic]         \draw (0,0) to[resistor={info={$R_\text{L}=\SI{220}{\ohm}$}}] (2,0);     \end{tikzpicture}     \end{document}      As far I've understood there's no "info" property in circuitikz, so I can't figure out how to do the same with that package. E.g., using something like               \draw (0,0) to[R=$R_1=\SI{2}{\ohm}$] (2,0)      results in an error in circuitikz. If possible, I'd prefer to use circuitikz over the circuits.ee.IEC library as I like the symbols in circuitikz more. Best regards, dm Edit: circuitikz example that's not working:               \documentclass{article}     \usepackage{tikz}     \usepackage[siunitx,european,americanresistors]{circuitikz}     \begin{document}     \begin{tikzpicture}[american currents]         \draw (0,0) to[R=$R_1=\SI{2}{\ohm}$] (2,0);     \end{tikzpicture}     \end{document}


title: subtle issue when changing font style of the toc in connection with the header of the page

text: I am using the `amsbook` class and changed the font style of the title of the table of contents (toc) with the command               \renewcommand{\contentsname}{\textbf{\textsf{Contents}}}      So I want it in `\sf` style and bold face letters. The toc has two pages, and on the second page there appears a header line with CONTENTS written in smallcaps, also in `\sf` and bold face letters. I however do not want it to be bold face here. Is there a simple solution to change that? If it is complicated I guess I just live with the default `amsbook style`. Thanks anyway for any suggestions!


title: Lyx nested environments

text: I would like to put an enumerated list into the body of a Lemma environment, in Lyx. This is what I would have:               Lemma 1. First line of the statement         i)  condition 1         ii) condition 2       last line of the statement.     Proof. .......      But when I set "enumerated list" for the two central lines, then the last line (before proof) is shown as a separated Lemma:               Lemma 1. First line of the statement         i)  condition 1         ii) condition 2     Lemma 2. last line of the statement.     Proof. .......


title: How to increase the distance between nodes and node orientation with TikZ graph drawing library

text: I am creating a graph using TikZ (it is in ConTeXt, but the idea should be the same in LaTeX):               \usemodule[tikz]     \usetikzlibrary[graphs, graphdrawing]     \usegdlibrary[layered]          \defineframed[fixed][width=5mm,height=5mm, frame=off]               \starttext     \tikz \graph [layered layout, nodes={draw, circle}]     {     start__\fixed{$x_0$},     x1U__\fixed{$x_{1U}$},     x1M__\fixed{$x_{1M}$},     x1L__\fixed{$x_{1L}$},     x2U__\fixed{$x_{2U}$},     x2M__\fixed{$x_{2M}$},     x2L__\fixed{$x_{2L}$},     x3U__\fixed{$x_{3U}$},     x3M__\fixed{$x_{3M}$},     x3L__\fixed{$x_{3L}$},     start -> { x1U, x1M, x1L},     x1U ->   { x2U, x2M, x2L},     x1M ->   { x2U, x2M, x2L},     x1L ->   { x2U, x2M, x2L},     x2U ->   { x3U, x3M, x3L},     x2M ->   { x3U, x3M, x3L},     x2L ->   { x3U, x3M, x3L}     };               \stoptext      which gives: ![enter image description here](http://i.stack.imgur.com/ldlBv.png)   1. How do I increase the distance between nodes?   2. How do I make the graph grow from left to right rather than top to bottom? I am afraid that I am lost in the TikZ documentation.


title: Column spacing problem

text: I'd like to know how to position two columns in the following table closer together. The table looks like this: ![table](http://i.stack.imgur.com/it8yF.png) I have found I had a problem with spacing of tabular columns combined with \multicolumn. I found an inelegant solution. Perhaps someone knows of a better one? and Column padding in tables. Unfortunately, I still cannot get it to work. Consider the following code:               \begin{table}     \begin{mdframed}[style=schwarzelinie]     \begin{center}     \begin{threeparttable}     \caption{\textbf{Charakteristika 123}     \begin{tabular*}{1\columnwidth}{@{\extracolsep{\fill}}lS[table-alignment=center,table-column-width=0.02\columnwidth]S[table-alignment=center,input-symbols=(),table-column-width=0.02\columnwidth]}     \toprule       & \multicolumn{2}{c}{\textbf{Patienten: n(\%)}}\tabularnewline     \midrule     \midrule      \textbf{Anzahl} & \multicolumn{2}{c}{59}\tabularnewline     \midrule      \textbf{Dauer:} &  & \tabularnewline     - weniger als 1 Stunde & 8 & (13,6)\tabularnewline     - zwischen 1-3 Stunden & 23 & (39,0)\tabularnewline     - zwischen 4-72 Stunden & 26 & (44,1)\tabularnewline     - länger als 72 Stunden & 2 & (3,4)\tabularnewline     \midrule      \textbf{Charakter:} &  & \tabularnewline     - ausschließlich anfallsartig & 45 & (76,3)\tabularnewline     - ausschließlich stetig & 12 & (22,0)\tabularnewline     - stetig und anfallsartig alternierend & 1 & (1,7)\tabularnewline     \end{tabular*}\begin{tablenotes}[para,flushleft]     \textbf{Erläuterungen:} Einige Erklaerungen.      \end{tablenotes}     \end{threeparttable}     \end{center}     \end{mdframed}     \end{table}


title: Python "as" keyword ignored in Listings

text: Following code cant highlight **as** keyword. What am I doing wrong? Shouldn't **as** be bold like **import**?               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{listings}          \lstset{morekeywords={as}}          \title{Python listings}     \author{me}          \begin{document}          \maketitle          \section{Introduction}     Python example          \begin{lstlisting}[language=Python]     #!/usr/bin/env python     """     An animated image     """     import numpy as np     import matplotlib.pyplot as plt     import matplotlib.animation as animation     \end{lstlisting}          done with the example.     \end{document}


title: Check for special character in verbatim environment

text: I would like to substitute a `>` in the beginning of each line of a `Verbatim` environment with another character. Consider:               \documentclass{article}     \usepackage{fancyvrb,xstring}     \renewcommand{\FancyVerbFormatLine}[1]{%      \IfBeginWith{#1}{>}{t#1}{#1}     }     \begin{document}     \begin{Verbatim}     >est       \end{Verbatim}     \end{document}      This does not work. That is: it compiles with `pdflatex`, but nothing happens with the `>`: ![enter image description here](http://i.stack.imgur.com/Fxbgu.png)


title: No italics in algorithm2e if-clause

text: Why does `algorithm2e` typeset the variables `anychange` and `done` in italics, and how can I turn this off? How can I remove the semicolon after `done` in the `until`-clause? ![enter image description here](http://i.stack.imgur.com/n9O9d.png)               $\textsf{anychange} \gets \textsf{false}$ \\     \Repeat{$\textsf{done}$}{              $\textsf{done} \gets \textsf{true}$ \\         \ParallelFor{$u \in V$} {             $\delta \gets \max_{v \in N(u)} \left \{ \Delta mod(v, \zeta(u) \rightarrow \zeta(v)) \right \} $\\             $C \gets \zeta(\arg\max_{v \in N(u)} \left \{ \Delta mod(v, \zeta(u) \rightarrow \zeta(v)) \right \} ) $\\             \If{$\delta > 0$}{                 $\zeta(u) \leftarrow C$ \\                 $\textsf{done} \gets \textsf{false}$ \\                 $\textsf{anychange} \gets \textsf{true}$ \\             }         }     }     \If{$\textsf{anychange}$}{         $G' \leftarrow$ \textsf{contract}$(G, \zeta)$ \\         $\zeta \gets$ \textsf{prolong(PLM$(G')$)} \\     }


title: How include a feynmp file in beamer title page?

text: How does one include a diagram done with feynmp in a beamer title page? feynmp produdes .1 files but when I include them as graphics, the labels of the different lines/vertices do not appear on title page. **Can one directly generate feynmp diagrams on the title page of a beamer presentation?**


title: How do I access float's name (e.g. for use with caption*)?

text: I would like to access the current name of the float. In the float package manual, I've read that command `\floatname{<float name>}{<new name>}` works by redefining `\fname@<float name>`. However, I wasn't able to get it working Here is an example of what I would like to achieve:               \documentclass{article}          \usepackage{float}     \usepackage{algorithm}          \floatname{algorithm}{New name for algorithm}          \begin{document}          \begin{algorithm}          Some algorithm here.          \caption{This is a caption where I would like to reference the float name (i.e. ``New name for algorithm'').}     \end{algorithm}          \end{document}      Any ideas?


I feel "uncomfortable" with the existing constants below (which are already defined in PSTricks)               Euler = 2.718281828     Pi = 3.141592654      because I think using `e` and `π` is much more natural. My question is : How can I use unicode characters as identifiers in PostScript? Is it impossible?               \documentclass[pstricks,border=12pt]{standalone}          \usepackage{pst-plot}     \pstVerb     {         /e {2.718281828} def          /π {3.141592654} def      }          \def\f{ln(e^x)+π}          \begin{document}     \begin{pspicture}[algebraic](0,-2)(5,5)         \psplot{0}{4}{\f}     \end{pspicture}     \end{document}


title: polytopes as inequalities sistem solutions in R3 (x-y-z) cartesian space

text: i'm here to ask if there's a TikZ/pgf support to draw areas resulting from a system of linear inequalities, into a xyz cartesian space. i found examples of my needs for xy plan at How to plot polygon using TikZ, but i also need to draw some 3d polytopes. the problem is coordinate system as i found in pgfmanual.pdf seems not suited for R3: only (,) support but i need something like (,,). As an example, i need to do drawings like this: ![http://dl.dropbox.com/u/9439473/share/polytope.png](http://i.stack.imgur.com/8iqKJ.png) but i also need to get a colored surface with a 50% transparent color. The system which generated that polytope is quite simple and is a linear programming problem: x_1 + x_2 + x_3 <= 4   x_1 <= 2   x_3 <= 3   3*x_2 + x_3 <= 6   x_1 >= 0   x_2 >= 0   x_3 >= 0 Can you advise me some url/article/doc which can help me, or make me some example to lead me to learn how to reach my target? Thank you for your attention


title: pdflatex (TeXLive) unreadable output on linux

text: I'm compiling my TeX files using pdflatex from XFCE terminal (same on XTerm). The compile log is very hard to read. It's like pdflatex doesn't break the lines, so the window is randomly filled with sentenses. Is there a way to fix it? I'm using Debian Wheezy, edit: here is an example                                           ! Package inputenc Error: Unicode char \u8:���      not set up for use with LaTeX.                                   See the inputenc package documentation for      explanation.     Type  H <return>  for immediate help.          ...                                                                                l.73 \additional                   ?                 ! Emergency stop.          ...                                                                                l.73 \additional          !  ==> Fatal error occurred, no output PDF file produced!                                                              Transcript written      on scs1_memo.log.


title: IEEEtran and the automatic generation of mailto: links

text: I wonder what IEEEtran does with parentheses around email links. I noticed that email addresses are automatically converted to links (which is what I want), but parentheses around an email and some more text make the text part of the mailto: link. Is that not clear enough? Here's a MWE:               \documentclass{IEEEtran}     \usepackage{hyperref}     \begin{document}     (e-mail: test@example.com) % result: mailto:e-mail:test@example.com          e-mail: test@example.com   % result: mailto:test@example.com          (e-mail: test@example.com  % result: no link          e-mail: test@example.com   % result: no link     \end{document}      I want, of course, in HTML notation               (e-mail: test@example.com)      I could not find anything about this in the IEEEtran or hyperref package documentations, and neither could I find any mailto: handling in the IEEEtran code. What is happening here, and how can I prevent it? _Update_ : The same issue arises without hyperref, and it only happens with words such as "e-mail" or "x-y", not with "email" or "x-" or "-y" for example. Here's an updated and extended MWE:               \documentclass{IEEEtran}     \listfiles     \begin{document}     test@example.com           % correct: mailto:test@example.com          email: test@example.com    % correct: mailto:test@example.com          e-mail: test@example.com   % correct: mailto:test@example.com          (email: test@example.com)  % correct: mailto:test@example.com          (email: test@example.com   % correct: mailto:test@example.com          (e-mail: test@example.com) % wrong:   mailto:e-mail:test@example.com          (x-y: test@example.com)    % wrong:   mailto:x-y:test@example.com          (x-: test@example.com)     % correct: mailto:e-mail:test@example.com          (-y: test@example.com)     % correct: mailto:e-mail:test@example.com          (e-mail: test@example.com  % wrong:   no link          e-mail: test@example.com   % wrong:   no link     \end{document}      With that MWE, these are the file versions listed:               *File List*     IEEEtran.cls 2012/12/27 V1.8 by Michael Shell     ot1ptm.fd 2001/06/04 font definitions for OT1/ptm.     ***********


title: What's the difference between \RequirePackage and \usepackage?

text: I understand that "the convention is to use `\RequirePackage` in a package or class and `\usepackage` in a document", but apart from that, is there any practical difference between the two commands? (I am thinking for example that it could be the case that `\RequirePackage` is a "stronger" command and you wouldn't run into problems with hyperref not being at the end)


title: glossaries: different appearences for long and full displayed acronyms

text: Consider the following minimal example:               \documentclass{article}          \usepackage[acronym, shortcuts]{glossaries}     \makeglossaries          \newcommand{\abbr}[1]{\underline{#1}}     \newacronym{snr}{SNR}{\abbr{s}ignal-to-\abbr{n}oise \abbr{r}atio}          \begin{document}         This: \gls{snr} looks as desired, but \acl{snr} doesn't.     \end{document}      I want the underlining to appear on the first use of an acronym (i.e. for the "full" version) and when I print the glossary (i.e. in the "description") but no underlining for the "long" version when I use `\acl`. My main problem is that I don't know how to toggle the `\abbr` command such that it does essentially nothing. I tried using something like               \newcommand{\myacl}[1]{         \renewcommand{\abbr}[1]{##1}                     \acl{#1}     }       but that doesn't work. Any suggestions?


title: Defining a new environment without spreading over two pages

text: I've definied an environment with               \newenvironment{definiere}{\begin{leftbar} \textbf{Definition:}\newline }{\end{leftbar}}      Unfortunately sometimes this environment is spread over two pages, where the left-bar is about 2cm long and "Definition" written as header, but the actual definition itself is on the next page. I'm using this environment mostly like this:               \begin{definiere}        \begin{equation}          WMC=\sum_{i=1}^n {c_i} \label{eq:WMC}        \end{equation}     \end{definiere}      I can avoid this behaviour by moving paragraphs below or above the definition, but sometimes it doesn't make sense anymore. My question is, does someone see a more elegant solution to my needs?


title: How do I make links in my pdf to run other programs?

text: I remember when I installed MiKTeX on my PC, I did it by clicking a series of links in a pdf document, which would run the various installer programs.   What (La)TeX commands were used to make that happen? How would I create a pdf with a link that, when clicked, will run `C:\path\program.exe` with command line arguments `-args`? Any differences for OSX/Linux?


title: Bad rendering of OrnementsADF

text: With the code (typeset with XeTeX)               \font\orn="Ornements ADF" at 12pt     \centerline{\orn\char70\quad\char57\quad\char102}     \centerline{\orn\char102\quad\char57\quad\char70}     \centerline{\orn\char70\quad\char116\quad\char102}     \centerline{\orn\char102\quad\char116\quad\char70}     \centerline{\orn Q\quad\char57\quad q}     \bye      I have this result ![enter image description here](http://i.stack.imgur.com/lp1Ni.jpg) As you can see some glyphs are cut on the right edge. Where is the error? How can I improve the rendering? `[edit]` The only strange thing I can see is in the terminal:               This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012)      restricted \write18 enabled.     entering extended mode     (./test031.texFontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.      [1]Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.      )     Output written on test031.pdf (1 page).     Transcript written on test031.log.      Maybe the "fontconfig warning" has something to do with this error. /etc/fonts/conf.d/50-user.conf has this content               <?xml version="1.0"?>     <!DOCTYPE fontconfig SYSTEM "fonts.dtd">     <fontconfig>         <!-- Load per-user customization file -->         <include ignore_missing="yes" prefix="xdg">fontconfig/conf.d</include>         <include ignore_missing="yes" prefix="xdg">fontconfig/fonts.conf</include>         <!-- the following elements will be removed in the future -->         <include ignore_missing="yes" deprecated="yes">~/.fonts.conf.d</include>         <include ignore_missing="yes" deprecated="yes">~/.fonts.conf</include>     </fontconfig>      `[edit 2]` I've tried the code on another computer and the result is the same.


title: pgfplots: colorbar: align y ticklables to the right

text: I have a colorbar in pgfplots and would like to have the y tick labels aligned to the right. Using               colorbar style={yticklabel style={align=right}}      did not work for me. The left colorbar shows the default behaviour and the right the wanted bahaviour but with clumsy code (see MWE below). ![colorbar ticklabel aligned and not aligned](http://i.stack.imgur.com/XLhlN.png) MWE:               \documentclass{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \begin{document}     \begin{tikzpicture}     \begin{axis}[     hide axis,     scale only axis,     height=0pt,     width=0pt,     colorbar,     point meta min=-20,     point meta max=20,     colorbar style={         height=10cm,     }]     \addplot [draw=none] coordinates {(0,0)};     \end{axis}     \end{tikzpicture}     \begin{tikzpicture}%[xshift=2cm]     \begin{axis}[     hide axis,     scale only axis,     height=0pt,     width=0pt,     colorbar,     point meta min=-20,     point meta max=20,     colorbar style={      yticklabel={$$},         height=10cm,     }]     \addplot [draw=none] coordinates {(0,0)};     \end{axis}          \foreach \x [evaluate=\x as \xeval using 20-\x*4] in {0,1.25,...,10}     \node[anchor=east] at (1.75,-\x) {\pgfmathprintnumber{\xeval}};          \end{tikzpicture}     \end{document}![enter image description here][3]


title: Help understanding/debugging spacing around headings (and other places)

text: I am trying to get my headings set up to meet my university's thesis formatting requirement. I'm using the titlesec package because it has the ability to suppress the spacing before the second heading when two headings appear in a row. That's a requisite given the school's guidelines. Things are mostly working out, but I'm running into two problems:   1. The spacing before and after the first line of a `display` chapter heading is a bit larger than what I think I'm telling it to be.   2. The spacing after the chapter heading is different for single and multiline chapter titles. (I don't need the text to start in the same place on every page, I just need the space between the bottom of the chapter title and the first line of text to be consistent.) I've tried digging through the guts of `titlesec.sty` to try and figure out exactly what's going on, but that is a very steep uphill battle. It's quite the convoluted pile of code (with a lot of capability, of course). So, I was wondering if anyone could lend some insight into what is triggering the extra space around the label and what is causing the inconsistent spacing following the title. Recommendations on how to trace the processing and see exactly where the spaces are coming from would also be appreciated. I know that TeX has some debugging functions available, but I've never worked with them and the references I have describing them are a bit scary given my lack of TeXpertise. If there are some approachable tools I could be using, I'd love to be able to apply them in some other places, too. In particular, places where I have to switch back and forth between single and double spacing. That often results in me needing to insert some `\vspace` hacks to fix things up since I don't really know what's going on under the hood very well. Here is a minimum working example that illustrates the problems I'm running into with the headings:               \documentclass[openany,oneside]{book}          \setlength{\headsep}{12pt}     \setlength{\headheight}{12pt}     \setlength{\topmargin}{-24pt}     \setlength{\textheight}{9in}     \setlength{\footskip}{24pt}          % Command to create a rule of the specified width and height, but pretending both are zero so it     % doesn't actually shift anything around. Optionally shift it vertically by a specified amount.     % \zeroSizeRule[verticalShift]{width}{height}     \newcommand{\zeroSizeRule}[3][0pt]%     {%         \raisebox{#1}[0pt][0pt]{\makebox[0pt][l]{\rule{#2}{#3}}}%     }          \newcommand{\testFirstLineSpace}{\settoheight{\tempheight}{CHAPTER}\zeroSizeRule[\tempheight]{0.125in}{2in}\zeroSizeRule[-12pt]{0.25in}{12pt}}     \newcommand{\testHeadingToTextSpace}{\zeroSizeRule[-1in]{0.375in}{1in}}               \usepackage[explicit]{titlesec}          \newlength{\tempheight}     \titleformat{name=\chapter}%         [display]% shape type         {\normalfont\rmfamily\bfseries\LARGE\centering}% format for title text         {\testFirstLineSpace CHAPTER \thechapter}% format for label          {12pt}% spacing between label and title text         {\parbox[t]{4.5in}{#1}}% before code          \titlespacing{name=\chapter}%         {0pt}% left margin increase - let the parbox take care of it         {1in}% vertical space before title         {1in}% vertical space after title          \newcommand{\filler}{\MakeUppercase{A quick brown dog with memory problems jumped over the lazy fox over and over and over and over and over and over again.}}          \begin{document}          \mainmatter          \chapter{TEST THAT IS LONG ENOUGH TO WRAP ONTO A SECOND LINE\testHeadingToTextSpace}     \filler          \chapter{SHORTER TEST\testHeadingToTextSpace}     \filler          \end{document}


title: bibtex author field: multiple spellings

text: I have an author who has a cryllic spelling and a romanized spelling. Thus, I'd like him to be listed in the bibliography as: Alexander Pushkin (Алекса́ндр Пу́шкин). However, hacking around with the bibtex author field I haven't found a native way to do it yet. Is there one?


title: Problem with adjusting the width of even pages in a two sided document wifh changepage package

text: I am using changepage package to locally control the text margins of a twosided document. An example of what I am actually doing is the following:               \documentclass[twoside]{article}     \usepackage[strict]{changepage}     \usepackage{lipsum}     \usepackage{showframe}          \begin{document}     \begin{adjustwidth*}{}{-1cm}     \lipsum     \lipsum     \lipsum     \lipsum     \lipsum     \end{adjustwidth*}     \end{document}      Based on the changepage documentation, the `adustwidth*` checks weather the page is odd or even and by passing a value only to the second argument the text contained within `adustwidth*`is extending into the outside margin. However it doesn't seem to work with even pages as shown below: ![problem with adjustwidth in the even pages of a two sided document](http://i.stack.imgur.com/o2fsm.png). Can you please propose any solution? Thank you.


title: How can I prevent URLs from being clickable?

text: I want to stop every URL in my document from being clickable in the resulting PDF. I am using the `url` package, and the documentation claims that it " _does not make hyper-links_." So, I don't know why links are becoming clickable! I also have some specific requirements that are met by the `url` package and not by the `hyperref` package, so simply using the `hyperref` package is probably not an option for me. I'm using TeXShop 3.11 with Pdftex. The minimal example below generates a document with a clickable link to `www.google.com` when viewed in Preview.app in OS X 10.9.4.               \documentclass[10pt,letterpaper]{article}          \usepackage[hyphens]{url}     \urlstyle{same}          \begin{document}          foo \url{www.google.com} bar          \end{document}


title: Define global hyphenation for words containing numbers

text: In my thesis a have a lot of occurences of the word like ABC2011abc and I want them to be hyphenated as `ABC2011\\-abc`. Is it possible to define a global hyphenation rule, like say with `\hyphenation`? Search and replace would be a last measure and feels very un-LaTeX.


title: Alignment at the center of two multicolumn

text: I would center 10e-1 and 10e-3 at the center of the 4 multicolumn. How can I do?               \usepackage{siunitx}     \usepackage{multirow}     \usepackage{booktabs}               \begin{table}[htp]         \centering         \begin{tabular}{lS[table-format=1.4]                          S[table-format=1.4]                          S[table-format=1.4]                          S[table-format=1.4]}             \toprule                 {\emph{Nodi}} & \multicolumn{4}{c}{PEP} \\                 \cmidrule(lr){2-5}                             & \num{10e-1} &     &       & \num{10e-3} \\                 \cmidrule(lr){2-5}                             & {BC}   & {PNC}    & {BC} & {PNC} \\             \midrule             1               & 1.1107 & 1.1112  & 1.001  & 1.001 \\             3               & 1.3046 & 1.1488  & 1.003  & 1.0029 \\             7               & 1.597  & 1.1734  & 1.007  & 1.006 \\             12              & 1.8435 & 1.188   & 1.0117 & 1.0089 \\             20              & 2.0836 & 1.2009  & 1.0201 & 1.0122 \\             25              & 2.1777 & 1.2064  & 1.0246 & 1.0134 \\             35              & 2.3101 & 1.2141  & 1.0347 & 1.0153 \\             50              & 2.4443 & 1.2223  & 1.0488 & 1.0167 \\             65              & 2.5501 & 1.228   & 1.0636 & 1.0175 \\             75              & 2.6109 & 1.2308  & 1.0723 & 1.0178 \\             90              & 2.6915 & 1.235   & 1.0864 & 1.0184 \\             100             & 2.7417 & 1.237   & 1.0954 & 1.0186 \\             \bottomrule         \end{tabular}     \end{table}


title: (La)TeX equivalent of MS Word's "Don't add space between paragraphs of the same style"

text: I'm using a `quote` environment to add some references at the beginning of sections with two custom commands. If I have more than one reference, the `\list` nature of the environment automatically adds margin space around each reference, which is not so pleasant looking. _MS Word_ offers the paragraph option " _Don't add space between paragraphs of the same style_ " which would be able to suppress the space between these two environments. **How can I do the same in this situation?** ### MWE:               \documentclass{article}          \usepackage{url}     \usepackage{blindtext}          % Commands for adding references to sections     \newcommand{\referenceurl}[2][See:]{\begin{quote}\emph{#1} \url{#2}\end{quote}}     \newcommand{\reference}[2][See:]{\begin{quote}\emph{#1} #2\end{quote}}          \begin{document}     \section{Important Material}     \referenceurl{http://www.example.com/important_material}     \reference[See also:]{\emph{Important Material for Dummies}, Wikipedians Anonymous Press, 2005.}     \blindtext          \section{Other Material: Ideal Style}     \referenceurl{http://www.example.com/important_material}     \reference[\vskip -6ex\relax See also:]{\emph{Important Material for Dummies}, Wikipedians Anonymous Press, 2005.}     \blindtext          \section{Single Reference: Default style should not change}     \reference{Example page}     \blindtext          \section{Single URL Reference: Default style should not change}     \referenceurl[Excellent Resource:]{http://www.example.com/important_material}     \blindtext          \section{Multiple References: Spacing should be suppressed}     \reference{Textbook}     \reference[Alternate Resource:]{Textbook}     \blindtext     \end{document}


title: Use of spanish babel in beamer

text: I downloaded a `beamer` template from http://cameron.bracken.bz/beamer- template/comment-page-1#comment-734 and I want to use it for a presentation in Spanish but when I try to use accents it doesn't compile.               \documentclass[xcolor=x11names,compress,utf8]{beamer}          \usepackage{graphicx}     \usepackage[spanish]{babel}          %% Beamer Layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \useoutertheme[subsection=false,shadow]{miniframes}     \useinnertheme{default}     \usefonttheme{serif}     \usepackage{palatino}          \setbeamerfont{title like}{shape=\scshape}     \setbeamerfont{frametitle}{shape=\scshape}          \setbeamercolor*{lower separation line head}{bg=DeepSkyBlue4}      \setbeamercolor*{normal text}{fg=black,bg=white}      \setbeamercolor*{alerted text}{fg=red}      \setbeamercolor*{example text}{fg=black}      \setbeamercolor*{structure}{fg=black}           \setbeamercolor*{palette tertiary}{fg=black,bg=black!10}      \setbeamercolor*{palette quaternary}{fg=black,bg=black!10}           \renewcommand{\(}{\begin{columns}}     \renewcommand{\)}{\end{columns}}     \newcommand{\<}[1]{\begin{column}{#1}}     \renewcommand{\>}{\end{column}}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}               \section{\scshape Introduction}     \begin{frame}     \title{Identificacion}     %\subtitle{SUBTITLE}     \author{     Cameron Bracken\\     {\it Humboldt State University}\\     }     \date{     \today     }     \titlepage     \end{frame}          \begin{frame}{Introduction}     \tableofcontents     \end{frame}          \section{\scshape Background}      \subsection{frame 1}     \begin{frame}{frame 1}     \begin{itemize}     \item Item atención     \item Item B     \begin{itemize}     \item Subitem 1     \item Subtem 2     \end{itemize}     \item Item C     \end{itemize}     \end{frame}          \end{document}      This example compiles perfectly but when I change `\title{Identificacion}` for `\title{Identificación}` it crashes. Thanks for all the help!


title: how to use fancyvrb Verbatim in tabularx?

text: When using `tabular` and `p` it is possible to insert `Verbatim` block in a table using minipage               \documentclass[]{article}%     \usepackage{fancyvrb}     \begin{document}         \begin{tabular}{|p{2in}|p{3in}|}     \hline     col 1 & \begin{minipage}{3in}              \begin{Verbatim}                  test              \end{Verbatim}             \end{minipage}     \\\hline     \end{tabular}         \end{document}      However, I use `tabularx` and use `X` instead of `p` for that column. But this does not work               \documentclass[]{article}%     \usepackage{tabularx}     \usepackage{fancyvrb}     \begin{document}          \begin{tabularx}{\paperwidth}{|p{2in}|X|}     \hline     col 1 & \begin{minipage}{4in}              \begin{Verbatim}                  test              \end{Verbatim}             \end{minipage}     \\\hline     \end{tabularx}          \end{document}       Error is               >pdflatex foo.tex      This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian)      restricted \write18 enabled.     .....     Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix      <2008/02/07> (tvz) (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty     )) (./foo.aux)     ! Argument of \FV@BeginScanning has an extra }.     <inserted text>                      \par      l.14 \end{tabularx}      At first I thought may be I need extra `{}` around the minipage, but that did not help               \documentclass[]{article}%     \usepackage{tabularx}     \usepackage{fancyvrb}     \begin{document}          \begin{tabularx}{\paperwidth}{|p{2in}|X|}     \hline     col 1 & {\begin{minipage}{4in}              \begin{Verbatim}                  test              \end{Verbatim}             \end{minipage}             }     \\\hline     \end{tabularx}          \end{document}       Next, I removed the `{}` and replaced `X` by `p` so now it is the same as `tabular`, but this also did not work:               \documentclass[]{article}%     \usepackage{tabularx}     \usepackage{fancyvrb}     \begin{document}          \begin{tabularx}{\paperwidth}{|p{2in}|p{3in}|}     \hline     col 1 & \begin{minipage}{3in}              \begin{Verbatim}                  test              \end{Verbatim}             \end{minipage}            \\\hline     \end{tabularx}          \end{document}       Next, I put back the `{}` and kept `p` in there, but this did not work either               \documentclass[]{article}%     \usepackage{tabularx}     \usepackage{fancyvrb}     \begin{document}          \begin{tabularx}{\paperwidth}{|p{2in}|p{3in}|}     \hline     col 1 & {\begin{minipage}{3in}              \begin{Verbatim}                  test              \end{Verbatim}             \end{minipage}                    }     \\\hline     \end{tabularx}          \end{document}       **question is: How to use`Verbatim` in `tabularx` ?** Assuming it is possible with a magic trick, I'd like to use `X` actually instead of `p` since I want to tell it to use all the remaining space left. But with `minipage` it needs a width, but when it is in an `X` column, I do not know the width of that column. How to handle that minipage wants width value, but it is sitting in an `X` column ? But first, I'd to know even if `Verbatim` is possible inside `tabularx`


title: Arcs on a plane in 3-D drawing

text: I'd like to do the following figure using TikZ: ![](http://wstaw.org/m/2012/12/23/zeichnung.png) I would know how to to this using `\clip`, `\draw`, `arc` and `\draw[->]` in 2D. But how can I draw this on a plane that lies in the x-z plane?


title: How can we draw Christmas animations with TikZ?

text: In the spirit of How can we draw a Christmas tree with decorations, using TikZ?, how can we realize Christmas animations with TikZ? For example: ![enter image description here](http://i.stack.imgur.com/mCqnC.gif) or also: ![enter image description here](http://i.stack.imgur.com/lkmTt.gif)


title: Align siunitx columns in numbers table

text: Here is a table but it has a problem: the column of 1, 20, 50, and 100 aren't perfectly aligned to others. How can I do that? ## MWE               \documentclass{article}     \usepackage{siunitx,booktabs,multirow}     \begin{document}     \begin{table}[htp]         \centering         \begin{tabular}{lS[table-format=4.5]                          S[table-format=4.5]                          S[table-format=4.5]                          S[table-format=4.5]}             \toprule             \multirow{2}*{\textsc{PEP}} &     \multicolumn{4}{c}{Nodi}     \\ \cmidrule(lr){2-5}                                         & 1      & 20     & 50     & 100    \\ \midrule             1e-06                       & 1      & 1      & 1      & 1.0001 \\             1e-05                       & 1      & 1.0002 & 1.0005 & 1.001  \\             0.0001                      & 1.0001 & 1.002  & 1.005  & 1.0099 \\             0.001                       & 1.001  & 1.0198 & 1.0486 & 1.0952 \\             0.01                        & 1.01   & 1.1846 & 1.4    & 1.6447 \\             0.1                         & 1.1111 & 2.084  & 2.4454 & 2.7404 \\ \bottomrule         \end{tabular}     \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/wWNl7.png)


title: Table cell overflow

text: Consider this document example:               \documentclass[a4paper,draft]{article}          \usepackage{calc}     \usepackage[demo]{graphicx}     \usepackage{tabularx,multirow}          \usepackage{geometry}     \geometry{hmargin=0cm}          \newlength\framewidth     \setlength{\framewidth}{\paperwidth}     \addtolength{\framewidth}{-3cm}          \begin{document}     \centering          \fbox{     \begin{tabularx}{\framewidth}{XXX}     \multirow{3}{0.30\framewidth}{\centering     \includegraphics[width=0.2\textwidth, height=1cm]{test}\vspace{0.1cm}\linebreak\sffamily\tiny     subtext\linebreak     more text} &%     \multirow{3}{0.30\framewidth}{\centering\large\textsc{Project name}\linebreak\textbf{Current document, more text, and even more text, still more text}} &%     a \\     & & b \\     & & c \\     \end{tabularx}     }     \end{document}      I've marked with yellow color the text that was overflown out of the cell. Also, if I put everything in a box, and measure that box, it is shorter than actual text contained in the box. Why is that? ![Overflown table cell](http://i.stack.imgur.com/AGi4u.png)


title: Calculate maximum of lengths

text: How can I calculate a maximum of lengths? I am aware of `pgfmath's` function `max(x_1,x_2,...)`               \documentclass[a4paper,draft]{article}     \usepackage{tikz}     \pgfmathparse{max(3,4)}          \begin{document}     \end{document}      But what if I have lengths instead of numbers?               \documentclass[a4paper,draft]{article}          \usepackage{tikz}     \newlength{\foo}     \setlength{\foo}{1cm}          \newlength{\baz}     \setlength{\baz}{1cm}          \pgfmathparse{max(\foo,\baz)}          \newlength{\qux}     \setlength{\qux}{\pgfmathresult}      `\pgfmathresult` doesn't have a unit of measurement.


title: LaTeX verbatim environment inside lists

text: I am using LaTeX and I have a verbatim environment inside an enumerate one. However, there is much whitespace between the verbatim text and the following list item. What I have now is something like this: ![Incorrect](http://i.stack.imgur.com/kTMW8.png) **I would like to get something like this:** ![Correct](http://i.stack.imgur.com/PUIyO.png) Does anyone know how to achieve it in an elegant way (i.e. without manually using `\vspace{-4ex}`)? **[EDIT]** The code I am using is like this:               \begin{enumerate}         \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum             dictum quam at sapien pellentesque porta. Morbi arcu nibh, consequat             non consequat a, congue sed libero.             \begin{verbatim}                 Lorem ipsum dolor sit amet, consectetur adipiscing elit.                 Vestibulum dictum quam at sapien pellentesque porta.             \end{verbatim}              \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum             dictum quam at sapien pellentesque porta. Morbi arcu nibh, consequat             non consequat a, congue sed libero.     \end{enumerate}


title: KOMA-Script scrbook: width of chapter and section number

text: I'm using KOMA-Script’s `scrbook` class and have problems with the Table of Contents. When the chapter number is too large, the chapter number is glued to the chapter heading. The chapter-section number field is also glued to the section heading. The page numbers of the sections are pushed slightly to the right so that the page numbers for sections do not line up with the page numbers for the chapters. I have similar issues if the section numbers are too large. ![enter image description here](http://i.stack.imgur.com/hG5Ue.png) What should I do?


title: How to make longtable respect \nopagebreak in the beginning?

text: For the book I am typesetting now I need a table environment with the following abilities:   1. Span over multiple pages;   2. Allow `\nopagebreak` between two lines   3. Do not ignore `\nopagebreak` before the beginning of the environment Points 1 and 2 can be achieved with `longtable` environment; but recently I bumped into the situation when the code:               \section{Some section}          \begin{longtable}{...}     ...      leaves the section header on one page and starts to typeset `longtable` on the next page. `\nopagebreak` between `\section` and `\begin` does not help. I found the bug filed on longtable about 9 years ago, but it seems that no-one is interested, and I do not know TeX well enough to fix it myself. I tried `supertabular` package — it has the same problem, and `stabular` which has points 1 and 3, but does not have point 2. Is there some way to make `longtable` listen to `\nopagebreak`? Or maybe there is some other package that supports all three points? Or will it be easier to just stack `\hbox`s and `\vbox`s in a desired way?


title: \pagebreak[number] only breaks with number = 4

text: I wanted to try out _encouraging_ of pagebreak using `\pagebreak[number]`. As far for now it only breaks the page when I define `\pagebreak[4]` and only then (it won't work on any other circumstances). Can someone explain to me how should it work ? If I have a new section just in the bottom of the page and if I use `\pagebreak[3]` over `\section{xxxxx}` it will not break it then. The manual says : > The \pagebreak command tells LaTeX to break the current page at the point of > the command. With the optional argument, number, you can convert the > \pagebreak command from a demand to a request. The number must be a number > from 0 to 4. The higher the number, the more insistent the request is.


title: \makecvtitle doesn't work with  moderncv in MiKTeX 2.9

text: I have a problem with the following tex excerpt in relation to `moderncv` on MiKTeX 2.9 on Windows 7. I do not get the title of my CV.               "! Undefined control sequence.     l.44 \makecvtitle     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined."      The line `\makecvtitle` is part of my template, that compiles fine on Linux with TeX Live. I use pdflatex, also tried tex. No change. Can somebody help me to target this issue?               \documentclass[12pt,a4paper,roman]{moderncv}   % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')     \usepackage[english,ngerman]{babel}     % moderncv themes     \moderncvstyle{classic}                        % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'     \moderncvcolor{orange}                          % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'     \renewcommand{\familydefault}{\rmdefault}    % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name     %\nopagenumbers{}                             % uncomment to suppress automatic page numbering for CVs longer than one page          % character encoding     \usepackage[utf8]{inputenc}                  % if you are not using xelatex ou lualatex, replace by the encoding you are using     %\usepackage{CJKutf8}                         % if you need to use CJK to typeset your resume in Chinese, Japanese or Korean          % adjust the page margins     \usepackage[scale=0.75]{geometry}     %\setlength{\hintscolumnwidth}{3cm}           % if you want to change the width of the column with the dates     %\setlength{\maketitlenamewidth}{10cm}        % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...          % personal data     \firstname{Mari}     \familyname{Wayne}     % \title{Resumé title (optional)}               % optional, remove the line if not wanted     \address{Nowwhere}{23556 Lübeck}    % optional, remove the line if not wanted     \mobile{+49 1704XXXXXX}                     % optional, remove the line if not wanted     %\phone{+2~(345)~678~901}                      % optional, remove the line if not wanted     %\fax{+3~(456)~789~012}                        % optional, remove the line if not wanted     \email{mwayne@wayne.de}                          % optional, remove the line if not wanted     %\homepage{ww}                    % optional, remove the line if not wanted     %\extrainfo{additional information}            % optional, remove the line if not wanted     % \photo[64pt][0.4pt]{picture}                  % '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file; optional, remove the line if not wanted     %\quote{Some quote (optional)}                 % optional, remove the line if not wanted          % to show numerical labels in the bibliography (default is to show no labels); only useful if you make citations in your resume     %\makeatletter     %\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}     %\makeatother          % bibliography with mutiple entries     %\usepackage{multibib}     %\newcites{book,misc}{{Books},{Others}}     %----------------------------------------------------------------------------------     %            content     %----------------------------------------------------------------------------------     \begin{document}     \makecvtitle


title: Subfigure Labeling Latex

text: I have a quick question about labeling subfigures: I am putting in figures side-by-side using the `subfigure` package, but I don't want the labelling to be included in the caption (i.e (a), (b), (c), etc). How do I go about doing this?               \begin{figure}[h!]          \hfill          \subfigure[caption 1]          {\includegraphics[width = 0.45\textwidth]{fig1.png}}          \hfill          \subfigure[caption 2]{\includegraphics[width = 0.45\textwidth]{fig2.png}}          \hfill          \caption{Title for both}          \end{figure}


title: Old style numerals using times and mtpro2

text: I am trying to use old style numerals with the `times` package for fonts in text mode and `mtpro2` package for fonts in maths mode. I would like to be able to use old style numerals in just a few places in the main body of the text using a command something like `\oldstylenums{}` for example. If I load the `txfonts` package and use `\oldstylenums{}` I get old style numerals in Times font in the main body of the text but the `mtpro2` fonts in maths mode are replaced by those of `txfonts` which I do not want. If I load the `oldstyle` package and use `\textos{}` I get old style numerals in the main body of the text but they are in Computer Modern font. Is what I am asking for possible? Here is a MWE:               \documentclass[11pt,openright]{memoir}     \usepackage[utf8]{inputenc} % If utf8 encoding     \usepackage[T1]{fontenc}    %     \usepackage[english]{babel} % English please     \usepackage{textcomp}     \usepackage{times} % Use Times font in text mode     \usepackage[zswash]{mtpro2} % Use MathTime Professional 2 fonts in maths mode          %\usepackage{txfonts} % Use \oldstylenums{} for old style numerals     %\usepackage{oldstyle} % Use \textos{} for old style numerals          \begin{document}          \mainmatter          Old style numerals using Times font here     \oldstylenums{01234567890}.           Normal lining numerals used otherwise 01234567890.          Normal lining numerals used in math mode     \begin{equation}     \zeta(x) = \int^{56789}_{01234} \frac{dx}{e^x - 1}        \end{equation}          \end{document}


title: Resizing image and losing quality

text: I want to create a pdf document from images of different size and I fit each image to the text dimensions to include them in the document, with               \includegraphics[width=\textwidth, height=\textheight, keepaspectratio]{file.jpg}      The problem is that these images are very enormous: 160MB in total; and this size is kept in the pdf output (160.9MB), but I don't need so much pixel information since I resize each image. How can I exploit the resizing of each image to earn space?


title: Forcing macro expansion with keyval

text: While trying to provide an answer to this question, I've run into a stumbling block that I can't seem to get over. The `listings` package (like many others) uses `keyval` to handle configuration. What should be done if part of that configuration is a macro that must be expanded prior? All (admittedly semirandom) configurations of `\expandafter` produce some sort of error or another. The closest I got was getting an error that complained about the fact that TeX was encountering text (keys) before `\begin{document}`. Is there any way to get around this? **MWE**               \documentclass[a4paper, 12pt,english]{article}     \usepackage{color,forloop}     \definecolor{gray}{rgb}{0.4,0.4,0.4}     \definecolor{darkgreen}{rgb}{0.0,0.4,0.0}     \definecolor{darkred}{rgb}{0.6,0.0,0.0}          \newcounter{ct}     \newcommand{\lstkeygenr}{%       \forloop{ct}{0}{\value{ct} < 50}{%         r\arabic{ct},       }     }          \usepackage{listings}     \lstdefinelanguage{mylanguage}                       {keywords=[1]{add,sub,test},                        keywords=[2]{r0,r1,r2,\lstkeygenr},                        keywords=[3]{p00,p01,p10,p11},                        moredelim=[s][\footnotesize\textit]{<}{>},                        keywordstyle=[1]\normalsize\color{gray}\bfseries\ttfamily,                        keywordstyle=[2]\color{red},                        keywordstyle=[3]\color{darkred}}          \begin{document}          \lstset{numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt,language=mylanguage}     \begin{lstlisting}       p00 add r0 , r1 , r2 , r3 , r4     \end{lstlisting}          \end{document}


title: How to force tables to be in the middle of the page

text: I am trying to include a set of tables into my document. Since the tables are quite large, I want them to be on landscape pages, and centered right in the middle of the page (that is, centered in terms of pagewidth and pageheight as well). This works fine for the second to last table, however, the first table always ends up right on top of the page, which looks rather unpleasant. The Tex code looks like following:               \documentclass[10pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{graphicx}     \usepackage{booktabs}     \usepackage{fullpage}     \author{~~~}     \pagestyle{empty}     \usepackage[margin=.01in, landscape]{geometry}     \begin{document}          \input{../stata_outputs/regressions_page_length.tex}     \clearpage          \input{../stata_outputs/regressions_clicks.tex}     \clearpage          [...]          \end{document}      The input files are automatically generate by Stata, and en excerpt looks like this:               \begin{table}[htbp]\centering     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}     \caption{page\_length after 0 weeks}     \begin{tabular*}{25cm}{@{\hskip\tabcolsep\extracolsep\fill}l*{5}{c}}     \toprule     &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}\\     &\multicolumn{1}{c}{control"}&\multicolumn{1}{c}{+local}&\multicolumn{1}{c}{+global}&\multicolumn{1}{c}{plus}&\multicolumn{1}{c}{all}\\          [...]               \bottomrule     \multicolumn{6}{l}{\footnotesize \textit{t} statistics in parentheses}\\     \multicolumn{6}{l}{\footnotesize * p<0.10, ** p<0.05, *** p<0.010}\\     \end{tabular*}     \end{table}      Is there any way that I could force Latex to put these tables exactly where I want them, preferrably by setting an option in the main file? Editing each individual input file is not really an option, since the are generated multiple times a day...


title: How to remove a blank page after maketitle, scrbook

text: There appears a blank page between the title page and the table of content. Many had this problem, but no solution works for me, because no one used the `scrbook` class.               \documentclass[DIV=10,openany]{scrbook}          \title{Documentation}          \begin{document}          \maketitle          \tableofcontent          \end{document}


title: Emphasize labels in a graph

text: I've got a graph with nodes and arcs between them. Then I added labels to the nodes. My problem now: The labels are partially unreadable because the arcs disturb. Do I have an opportunity to highlight the labels, that they are better readable. Like a background color or something like that? What is the common solution for this problem? I tried to change the text color but this isn't enough to solve the problem. Edit: example code!               \documentclass{article}     \usepackage{tikz}     \begin{document}      \begin{tikzpicture}         \tikzstyle{every node}=[draw,circle,fill=white,minimum size=18pt, inner sep=0pt]         \def \x{2}         \def \y{1.5}         \draw (1 * \x, 0 * \y) node (leer) [draw=green, label=90:5] {$\emptyset$};         \draw (1 * \x,-1 * \y) node (b) [draw=green, label=90:{1,2,3}] {b};         \draw [->]  (leer) -- (b);     \end{tikzpicture}          \end{document}      In this example, you can barely read the "2". How can I emphasize the "1,2,3"-String to improve die readability! Now dynamically:               \documentclass{article}     \usepackage{tikz}     \newcount\incount     \def\tin#1#2{\incount=0\relax\edef\marshal{\noexpand\TIn#1@@;#2@@;}\marshal}     \def\TIn#1#2;#3#4;{%       \ifx#1@%            \ifx#3@%           \incount=\ifnum0>\incount-\fi\incount%           \let\next=\relax%         \else%           \advance\incount by-1%           \def\next{\TIn#1#2;#4;}%         \fi%       \else%         \def\test##1#1##2##3?{\ifx##2*\else\advance\incount by1\fi}%         \test#3#4;#1**?%         \def\next{\TIn#2;#3#4;}%       \fi%       \next%           }          \begin{document}          \begin{tikzpicture}     [declare function={nchoosek(\n,\k)=\n!/(\k!*(\n-\k)!);}, x=1.5cm,y=2.5cm,     NULL/.style={fill=green!30, label=90:{1,2,3,4,5}},     A/.style={fill=green!30, label=90:{1,3,4,5}},     B/.style={fill=green!30, label=90:{1,3,5}},     C/.style={fill=green!30, label=90:{1,2,4,5}},     D/.style={fill=red!30, label=90:{2,5}},     E/.style={fill=green!30, label=90:{1,3,5}},     ]          \foreach \R [count=\y from 0, evaluate={\s=nchoosek(5,\y);}, remember=\R as \r] in {        {NULL},        {A,B,C,D,E}}        \foreach \C [count=\x from 0] in \R {             \node [circle, draw, anchor=base, minimum width=1cm, minimum height=0.75cm, \C/.try]            (\C) at (-\s/2+\x,-\y+1) {\C};                  \foreach \c in \r {             \tin{\c}{\C}             \ifnum\incount=1               \draw (\c.south) -- (\C.north);             \fi          }       }     \end{tikzpicture}     \end{document}


title: New command like \textcite but with only one author

text: I am using `biblatex` and a custom numeric-comp style for my references. I really like it the way it works but now I just want to have a new command which does the same as `\textcite` but truncates the number of authors to one. That is               @BOOK{Steger2008,     author = {Carsten Steger and Markus Ulrich and Christian Wiedemann},     title = {Machine Vision Algorithms and Applications},     year = {2008}     }      gives with `\textcite{Steger2008}: "Steger, Ulrich, and Wiedemann"` It'd be great to have sth like `\shorttextcite{Steger2008}` that gives: `"Steger et al."` Is that possible - and how? Thanks for your help.


title: The bbl.and function in my bst file is ignored

text: I have created a custom bautzen.bst file for a paper which has to be written in German with kind-of Harvard style but some changes. To create the bst I have used the custom-bib script and added a function (to format urldate). The bst file contains this function:               FUNCTION {bbl.and}     { "und"}      Other functions like               FUNCTION {bbl.volume}     { "Band" }      are correctly applied to the reference list. However, when using \cite in the text I'm getting e.g. 'Pott and Pott' instead of 'Pott und Pott' if there are only two authors.   I have also loaded babel               \usepackage[ngerman]{babel}      Bibliography is defined as follows in the document:               \bibliographystyle{bautzen}      As the header and the bst file are quite large I don't paste them here, please refer to header and the bst.   I really need this fixed but have no idea what's wrong, so any help is much appreciated! * * * The following can be used as mwe, but you need the custom bst file from the link above of course.               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[german]{babel}     \usepackage{lmodern}     \usepackage{natbib}     \begin{document}     Test with \cite{Pott2012} and an end.     \bibliography{bib}     \bibliographystyle{bautzen}     \end{document}          @book{Pott2012,     address = {Berlin, Heidelberg},     author = {Pott, Oliver and Pott, Andre},     doi = {10.1007/978-3-642-29685-7},     isbn = {978-3-642-29684-0},     publisher = {Springer Berlin Heidelberg},     series = {Springer-Lehrbuch},     title = {{Entrepreneurship}},     url = {http://www.springerlink.com/index/10.1007/978-3-642-29685-7},     year = {2012}     }


title: Varying number of columns in multi-equation environment

text: Consider the following document:               \documentclass{article}     \usepackage{amsmath}     \newcommand{\expr}[1]{\begin{pmatrix}x_#1\\y_#1\end{pmatrix}}     \begin{document}     \begin{equation}       c = a \cdot b     \end{equation}     \begin{align*}       a&=\expr{a} & b&=\expr{b}     \end{align*}     \end{document}      which displays like this: ![equation + align* environments](http://i.stack.imgur.com/OliZq.png) I.e. the first (part of the) equation is centered, the second part is set in two columns with a third of the free space located before, in between and after. I would like to have the same setup, but with the equation(s) in one environment. I have tried several combinations of multi-equation environments in amsmath, but without luck. For instance:               \begin{align}       \begin{aligned}         c = a \cdot b       \end{aligned} \\       \nonumber       \begin{aligned}a&=\expr{a}\end{aligned} & & \begin{aligned}b&=\expr{b}\end{aligned}     \end{align}      displays like this: ![align environment](http://i.stack.imgur.com/Smgba.png) with the two "sub-equations" being fine, but the main equation at the top is not centered. The following:               \begin{gather}       c = a \cdot b \\       \begin{aligned}         \nonumber         a&=\expr{a} & b&=\expr{b}       \end{aligned}     \end{gather}      results in the two "sub-equations" being set too tight: ![gather environment](http://i.stack.imgur.com/LHWP9.png)


title: Number alignment in tables with some values in partial boldface (all but the decimal point)

text: I want to align decimal values in a table with some values printed in bold. Just by itself, this is no problem. We can use the `siunitx` package and `\robustify\bfseries` to do the trick as described, e.g., in siunitx: Bold single numeric cells. However, I would like to keep the decimal point of the bold values in normal weight. This gives an overall more visually pleasing impression. So far I use a crude workaround (`r@{.}l`) in which integer and decimal parts are their own column. Is there a possibility to arrive at my desired formatting with `siunitx` or some other package, or do I have to continue using my crude workaround?


title: Adapt labelling facilities of listings package

text: I compiled a catalogue from past exercises for a lecture (running to several hundred pages), which makes consistent labelling a bit of an issue. My solution is to use labels of the form `prb:problemname:locallabel`, where `locallabel` is something of the form `eq:ODE` or `fig:convergence`. To be able to use this in practice (and not have to type huge labels every time), I came up with a function that generates local functions to deal with this (this was almost a year ago, and I certainly had help from StackExchange, but don't remember all the questions that I should reference now - apologies):               \AtBeginDocument{% hyperref changes the commands \AtBeginDocument, so this must come afterwards     \let\prblabel\label % define commands so that \prb... can be continually overwritten     \let\prbref\ref     \let\prbeqref\eqref     \let\prbautoref\autoref     \newcommand\locallabels[1]{%       \renewcommand\prblabel[1]{\label{#1:##1}}%       \renewcommand\prbref[1]{\ref{#1:##1}}%       \renewcommand\prbeqref[1]{\eqref{#1:##1}}%       \renewcommand\prbautoref[1]{\autoref{#1:##1}}%     }}      which is called at the beginning of a problem as `\locallabels{prb:problemname}`. All labels within the problem can then be used as if the file were stand-alone, as long as all labelling/referencing commands are used in their `prb`-version. What I couldn't get to work is that this behaviour extends into the `listings`-environment (`\usepackage{listings}`), which provides its own labelling facilities. Therefore, these have to be called like               \lstinputlisting[label={prb:problemname:code:sample}]{matlab/sample.m}      which adds a further source of potential errors if the people writing new examples in this framework forget to use this correctly, or even just have a typo in the first part of the label (referencing with `\prbref{code:sample}` works of course, once the label is created correctly). My question is thus how I can extend my `\locallabels`-command such that this also takes care of the `listings`-package, i.e. that I can call               \lstinputlisting[label={code:sample}]{matlab/sample.m}      instead of the above. I've experimented with changing the `\label`-command directly, but with strange results. If a possible solution is in this vein, I have to add the further restriction (in the interest of cross-referencing between examples), that it still has to be possible to call e.g. `\eqref{prb:otherproblemname:eq:PDE}`.