title: Cannot use a different directory for lstinputlisting

text: I'm having a bit of a problem. I'm trying to include source code in an appendix in latex. I use the following line in order to add the source code:               \lstinputlisting[language=C]{"C:\work\EA10080\trunk\Programming\Secondary_side\full_function\Submodules\ePWM.c"}      but I get the following error: > 398 Undefined control sequence. \lst@inputpath "C:\work \EA 10080\trunk > \Programming \Secondary _... l.398 > ...ry_side\full_function\Submodules\ePWM.c"} What am I doing wrong? I'm using the package listing, color and the document class is report. Minimal working example:               \documentclass[12pt,a4paper]{report}          \usepackage{listings}     \usepackage{color}          \definecolor{mygreen}{rgb}{0,0.6,0}     \definecolor{mygray}{rgb}{0.5,0.5,0.5}     \definecolor{mymauve}{rgb}{0.58,0,0.82}          \lstset{numbers=left,commentstyle=\color{mygreen},keywordstyle=\color{blue}}          \begin{document}          \begin{appendices}     \chapter{Source Code for PWM}     \label{sec:A}          \lstinputlisting[language=C]{"C:\work\EA10080\trunk\Programming\Secondary_side\full_function\Submodules\ePWM.c"}          \end{appendices}          \end{document}      Also, maybe I should mention that adding the source code "manually" (using \begin{listing} and then writing the code) works fine. It's much less practical though.


title: How to tweak 3-5 authors citation with the biblatex-apa style?

text: One thing about the `biblatex-apa` style I could not get used to, is the 3-5 authors citation: if the authors number is between 3-5, all of them will be printed in citation. e.g. Biblatex-apa style: >   * [Citation] Goossens, Mittelbach, Samarin and Peter (2020) >   * [Bibliography] Goossens, M., Mittelbach, F., Samarin, A. & Peter, T. > (2020). _How to DIY a nuclear bomb at home_ (1st ed.). Reading, Mass.: > Addison-Wesley. > Sometimes the authors list is really long in text, and I thought it is indeed not necessary. So how to make the `maxcitenames` number to `2`, just like the built in biblatex styles do. MWE is provided:               \documentclass{article}          \usepackage[colorlinks]{hyperref}     \usepackage{libertine}     \usepackage[UKenglish]{babel}     \usepackage{csquotes}     \usepackage[         style=apa,         backend=biber,         maxcitenames=2,  % no effect!               natbib=true] {biblatex}      \DeclareLanguageMapping{british}{british-apa}     \LetLtxMacro{\cite}{\citet} %          \addbibresource{biblatex-examples.bib}     \begin{document}          \section*{Apa citation}          Article - 2 authors: \cite{sarfraz}\\     Article - 3 authors: \cite{companion}\\     In proceeding: \cite{salam}\\     Ph.D thesis:  \cite[see e.g.][]{geer} \\     Master thesis: \cite{loh}\\     Report: \cite{padhye}\\     Repeat citation:  \cite{companion}, \citet{companion}, \citep{companion} \\     Multi-citation:  \cite{bertram,knuth:ct:a,knuth:ct:b,knuth:ct:c} \\     \printbibliography          \end{document}


title: Using a math font matching San Serif Font

text: How can I match the font of an equation to a Sans Serif font? I am using the following code.               \documentclass{article}     \usepackage[margin=1in,headheight=5\baselineskip,headsep=1\baselineskip,includehead]{geometry}               \usepackage[scaled, mono=false]{libertine}      \renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif     \usepackage[T1]{fontenc}          \begin{document}     \section*{Sans Serif Font along with equation and formula}          \noindent How can I put my equation between dollar signs, e.g., \verb|$E=mc^2$|, and get an output which matches a Sans Serif font?           \noindent Here is the result of \verb|$E=mc^2$|: $E=mc^2$          \end{document}      Here is the output. ![enter image description here](http://i.stack.imgur.com/6TI85.png)


title: Why is \baselineskip not inserted before an \unvbox?

text: It seems that `\setbox0=\vbox{\hbox{abc}}\unvbox0` is not equivalent to `\hbox{abc}`: the former does not insert a `\baselineskip` in the following situation.               \vbox{%        \hbox{XY}%        \hbox{abc}%        \hbox{def}     }          \vbox{% missing baselineskip before \unvbox0       \hbox{XY}%       \setbox0=\vbox{\hbox{abc}}%       \unvbox0       \hbox{def}     }      A solution might be               \vbox{% the baselineskip is inserted when we write \box0, then remove it.       \hbox{XY}%       \setbox0=\vbox{\hbox{abc}}%       \box0       \setbox2=\lastbox       \unvbox2       \hbox{def}     }      but is it really the right way to do it? For information, I am trying to emulate the behaviour of `\halign` with hand- made boxes, and I don't think that I will be able to put the `\hbox{abc}` (corresponding to rows) directly on the current vertical list since the rows need to all be read and the glue left unset, until the end of the tabular is reached and we can know the width of each column. Resetting the glue requires me to go through the list of row boxes, `\unhbox` them, `\unhbox` and re-`\hbox` each cell, etc.               \bye


title: Painless Memoir Class Book Template

text: I would like to find a memoir class book template that has the basic features of a book already configured (with dummy type, dummy figures, etc.) that compiles properly, so I can just start writing without having to read any long and tedious manuals. Where can I find such a thing?


title: How to disable \renewcommand

text: I've got a custom class derived from `report`. I defined some standard commands inside of it to reflect its specific, so they look like:               \newcommand\contentsname{Custom Content}     \newcommand\bibname{Custom Bibname}     \newcommand\appendixname{Custom Appendix}      The problem is, when I add `inputenc` and `babel` packages which I also need, these commands become overridden with their localized versions from these packages. Of course, I can redefine the commands _again_ in the document preamble, but I'm just curious: is there a general way to define commands which cannot be redefined later with `\renewcommand` in other classes?


title: How to include multiple images inside a TikZ loop

text: I have a case, where my files are named `images_001.png` .... `images_011.png`. I tried to put them like this:               \def\filelists{1/{"t0_01"},2/{"038"}, 3/{"050"},4/{"060"}}          \foreach \i\element in \filelists {          \node[inner sep=0cm, outer sep=0cm] at (0, 1.5+\i*-3.1){\includegraphics[width=12cm, height=3cm,bb=390bp 70bp 3810bp 930bp,clip]{/Users/xxxxx/paper_animations/fig4_conc_set3_\element.png}};          }      but I could not manage finally. Any advice?


title: Centered-justified style

text: Is there a text style that is centered and places words on lines in such a way that it looks justified on the left and right sides? I'm not looking for a fixed justified text, but kind of boxing whose width will adapt depending on the words to place. The idea to to prevent single words to be put on a new line, but rather to take more words from the previous line to make it look more justified. Here is an example to make it clearer. I have a macro that does this:               % opening quote     \newcommand{\dvquote}[2]{       \begin{center}\parbox{110mm}{         \begin{center}         \begin{itshape}#1\end{itshape}\\         ---~\textsc{#2}         \end{center}       }\end{center}\vspace{-5mm}}      On some occasions it produces a line with a single word, such as the following: ![centered text with single word on last line](http://i.stack.imgur.com/7v2qA.png) This is not very balanced, so I would like something like: ![centered text with carriage return](http://i.stack.imgur.com/VoeZg.png) Same amount of lines, but more balanced. It's easy enough to achieve when needed, by adding a manual carriage return, but I'm wondering if there's some kind of automatic style that would achieve this. Reducing the width of the paragraph to be under 110mm is not an option because I need most quotes to be quite large, and even then, the same problem might happen with just about any fixed width anyway. In a kind of similar issue (which may have the same solution), I have a box defined by:               % central quote     \usepackage{fancybox}     \newcommand{\dvbox}[1]{       \begin{center}\doublebox{         \parbox{10cm}{           \vspace{3mm}             \begin{center}               \parbox{9cm}{\textsc{#1}}             \end{center}           \vspace{3mm}         }       }\end{center}}      which produces justified output such as: ![justified box with two lines](http://i.stack.imgur.com/opUuc.png) Occasionally though, there is not enough to fill a whole line, so I get: ![justified box with one line](http://i.stack.imgur.com/eAmmK.png) which would probably look better centered. Is there a standard approach to fix this?


title: Use macro as coordinate in pgfplots plot

text: I'm trying to come up with a solution to the question How to maintain consistency with TikZ and Pgfplots?. Essentially, what is needed is a way to save a coordinate as a macro (or a global key, maybe?) that can then be used instead of the usual `<x>,<y>` pair, both in normal nodes/paths and in pgfplots plots. For clarification: I would like to be able to define a macro `\PointA` that I can call whenever the syntax `(<x>,<y>)` is expected. This might be in the definition of a node using `\node at (<x>,<y>) {};`, or in a pgfplots plot using `\addplot coordinates { (0,0) (<x>,<y>) (1,1) };` Just using `\def\<name>{<x>,<y>}` works fine for normal nodes and paths, but when I try to use it as a coordinate in a pgfplots plot, it fails with the error message:               File ended while scanning use of \pgfplots@foreach@plot@coord@NEXT.      An expansion issue, yet again? Or should I use a totally different approach?               \documentclass{article}     \usepackage{pgfplots}          \def\PointA{1,2}          \begin{document}     \begin{tikzpicture}            \draw [gray] (0,0) grid (3,3);       \fill (\PointA) circle (2pt); % Works            \begin{axis}[xshift=3.5cm,width=6cm,xmin=0,xmax=3,ymin=0,ymax=3,grid=both]              \fill [orange] (axis cs:\PointA) circle (4pt); % Works         \addplot coordinates { (0,0) (1,2) (2,2) }; % Works     %    \addplot coordinates { (0,0) (\PointA) (2,2) }; % Fails            \end{axis}     \end{tikzpicture}     \end{document}


title: Handwritten R-like-kay

text: I need a handwritten "k" with a circle, the one which looks a bit like R. I found few fancy fonts with such R-like-kay, say this one, but non of them can stay next to "\ell" in math formulas. Maybe I have to make one my-self with METAFONT, but it seems to be stupid to learn it just for one letter, and I am sure this way I will produce something ugly. I hope someone can help.


title: PS-Tricks + Beamer Problem

text: I have a strange problem with PS-Tricks. I can only create one picture when using beamer. Take this as an example:               \documentclass{beamer}          \usepackage[pdf]{pstricks}               \begin{document}     \begin{frame}          \begin{pspicture}(0,0)(2,2)       \psline(0,0)(1,1)      \end{pspicture}          \end{frame}          \begin{frame}          \begin{pspicture}(0,0)(2,2)       \psline(0,0)(1,1)      \end{pspicture}          \end{frame}               \end{document}      Only the first frame contains a pstricks graphic, the second one is empty. Pstricks only creates the first graphic and ignores the rest. Any ideas to this? I use TexLive 2013.


title: Horizontal line through table cell

text: I have a very long, thin table that I'm folding onto itself to make a wider, shorter version. The table has a couple horizontal rules to separate data categories. For example, the original table is like:               -----------------------     | Column A | Column B |     -----------------------     | Data A1  | Data B1  |     | Data A2  | Data B2  |     | ------------------- |     | Data A3  | Data B3  |     ...      and I'm wanting it like:               ---------------------------------------------------     | Column A | Column B |     | Column A | Column B |     ---------------------------------------------------     | Data A1  | Data B1  |     | Data A51 | Data B51 |     | Data A2  | Data B2  |     | Data A52 | Data B52 |     | ------------------- |     | Data A53 | Data B53 |     | Data A3  | Data B3  |     | Data A54 | Data B54 |     ...      The problem is I cannot get the desired behavior with the horizontal rules. If I use something like `\cmidrule{1-2}`, there is a blank row in the right two columns:               ---------------------------------------------------     | Column A | Column B |     | Column A | Column B |     ---------------------------------------------------     | Data A1  | Data B1  |     | Data A51 | Data B51 |     | Data A2  | Data B2  |     | Data A52 | Data B52 |     | -------------------                             |     | Data A3  | Data B3  |     | Data A53 | Data B53 |     ...      I've tried playing with `\vspace{-3mm}` but I can't find values and a placement that gets the right results. I've also considered not using `\cmidrule` and fill the left two cells with a horizontal line. Something like               \multicolumn{2}{c}{--------} & Data A53 & Data B53 \\      However, I can't figure out how to make this horizontal line.


title: Endfloat: Extra blank page when using efloatseparator

text: The following MWE adds a blank page between landscape tables in Chapter 2 when I use `\renewcommand{\efloatseparator}{\mbox{}}` to suppress putting each table on a page of its own. If I remove the command and leave every table on its own page it works fine. How can I remove this blank page which seems to be caused by the `\mbox` command?               \documentclass[a4paper,12pt,oneside]{book}     \usepackage{pdflscape}          \usepackage[tablesfirst,notablist]{endfloat}     \usepackage{titletoc}          \renewcommand{\theposttable}{\Roman{posttbl}}     \renewcommand{\thepostfigure}{\Roman{postfig}}     \renewcommand{\thefigure}{\Roman{figure}}     \renewcommand{\thetable}{\Roman{table}}          \renewcommand{\efloatseparator}{\mbox{}}           % new environment for landscape tables         \newenvironment{ltable}         {\begin{landscape}\begin{table}}         {\end{table}\end{landscape}}          % make it known to endfloat     \DeclareDelayedFloatFlavor{ltable}{table}          \begin{document}          \chapter{This is Chapter 1}     \startlist{lot}     Some text in chapter 1.  See my figure \ref{tab:table1}.          \begin{table}     \caption{First Table} \label{tab:table1}     \end{table}          \printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}     \processdelayedfloats          \chapter{This is Chapter 2}     \startlist{lot}     Some text in chapter 2.  See my figure \ref{tab:table2}.          \begin{ltable}     \caption{First Table} \label{tab:table2}     \end{ltable}          \begin{ltable}     \caption{First Table} \label{tab:table2}     \end{ltable}          \begin{table}     \caption{First Table} \label{tab:table2}     \end{table}          \printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}     \processdelayedfloats     \end{document}


title: How to add an invisible watermark to pdf documents?

text: I'd like to add an invisible watermark to each PDF document that I produce so that in case it leaks, I know where it leaked from. Anyone knows what would a good way for an invisible watermark be in a PDF document and how to add one?


title: How to color diacritical marks?

text: I would like to have the diacritical marks stand out visually by being colored differently. For example, can I have â in which the circumflex is in red, and the 'a' is in black? When I use `\textcolor{...}` for the diacritical mark, it is not placed correctly over (or under) the letter.


title: How to define new functions for plotting in tkz-fct?

text: Is it possible to define new functions in tkz-fct and use them to plot using `\tkzFct`?


title: Letterspacing, Minion Pro, and Tufte-LaTeX (problem with running header)

text: I'm trying to use Minion Pro with the Tufte-LaTeX class. Basically, I've got it working, but I have a problem with letterspacing the small caps for the running header. Rather than appearing in small caps (as it does if I use the Tufte-LaTeX default Palatino), it appears in regular lower case. Here's a minimal example:               \documentclass[nols,nofonts]{tufte-book}     \usepackage[MnSymbol]{mathspec}     \setprimaryfont{Minion Pro}     \setmainfont[Mapping=tex-text]{Minion Pro}     \usepackage{lipsum}          \title{Lorem ipsum}          \begin{document}     \mainmatter     \chapter{The origins of Lorem Ipsum}     \lipsum          \end{document}      This warning appears in the console: "Class tufte-book Warning: Proper spacing of small-caps letters has not been set up on input line 16" which is clear enough, but I don't know how to fix it. The Tufte-LaTeX sample book states "The Tufte-LATEX classes try to load the appropriate letterspacing package (either pdfTEX’s letterspace package or the soul package). If you’re using XeLaTeX with fontenc, however, you should configure your own letterspacing." but (reasonably enough) doesn't provide any more detail. I've found examples of how to use fontspec (which is loaded by mathspec in my example) to change the letterspacing of specific blocks of text, but I haven't been able to figure out how to set the letterspacing for small caps text globally. Any help would be appreciated.


title: How can I migrate my MiKTeX distro to another computer and keep my packages?

text: I want to migrate my home distro of MiKTeX to my work desktop and keep all of my installed packages. I want to do this because my workplace blocks my attempts at downloading packages I've included in my documents.. I've been using WriteLaTeX to create my documents because of this, but that becomes an issue when I want to embed images into my document. Thanks in advance.


title: algorithm2e split over several pages

text: Is there an option in `algorithm2e` to split the algorithm over several pages? Please no answer with "use `algorithmic` or `listings` packages". `algorithm2e` is the best package for algorithms in latex, so I want to get it running with this package.


title: Difference between \begin{theorem}...\end{theorem} and {\theorem ...}

text: I see that both attempts to display a theorem in the following code generates similar output.               \documentclass{article}     \usepackage{amsthm}     \newtheorem{theorem}{Theorem}     \begin{document}          \begin{theorem}     \( (a + b)^2 = a^2 + 2ab + b^2 \)     \end{theorem}          {     \theorem     \( (a + b)^2 = a^2 + 2ab + b^2 \)     }     \end{document}      I want to know what the difference between `\begin{theorem}...\end{theorem}` and `{\theorem ...}` is.


title: How to draw smooth curves with PSTricks?

text: Consider the following example: ![enter image description here](http://i.stack.imgur.com/rvI6X.png)               \documentclass{article}          \usepackage{pstricks-add}          \begin{document}          \begin{pspicture}(0,-0.25)(4,6.25)      \pnode(2,0){A}      \pnode(0,4){B}      \pnode(2,6){C}      \pnode(4,4){D}      \rput(1.5,3.5){\small{$A$}}      \rput(1.5,4.5){\small{$B$}}      \rput(2.5,4.5){\small{$C$}}      \rput(2.5,3.5){\small{$D$}}      \multido{\iA=0+1}{7}{\psline[linestyle=dashed,linecolor=blue](0,\iA)(4,\iA)}      \multido{\iB=0+1}{5}{\psline[linestyle=dashed,linecolor=blue](\iB,0)(\iB,6)}      \psline[linewidth=1.25pt](A)(C)      \psline[linewidth=1.25pt](B)(D)      \pspolygon[linewidth=2pt,linecolor=red](A)(B)(C)(D)      \pscurve[linewidth=1pt]{->}(2.75,4.75)(2.8,5.25)(2.65,5.75)(2,6.25)(1.25,6)(0.75,5.25)      \pscurve[linewidth=1pt]{->}(2.5,2.5)(2.95,1)(2.65,0.2)(2,-0.25)(1,0)(0.5,1.5)     \end{pspicture}          \end{document}      How do I make the curved arrows smooth? I guess the `\psbezier` function is the way to do it but I cannot make it look nice, so help will be much appreciated. **Update** In case someone finds the figure useful, here is a generalization of the code:               \documentclass[a4paper]{article}          \usepackage[hmargin=2.4cm,vmargin=3cm]{geometry}     \usepackage{subcaption}     \usepackage{auto-pst-pdf,pstricks-add}     \usepackage{expl3}          \ExplSyntaxOn      \cs_new_eq:NN       \calculate      \fp_eval:n     \ExplSyntaxOff          \newcommand*{\betegn}[3]{%       \rput(!#1 4 div \figur\space mul #2 4 div \figur\space mul){\small{$#3$}}     }          \begin{document}          \begin{figure}[htbp]     % Figure number.     \def\figur{2}     % Constants.     \def\hoejde{\calculate{3*\figur}}     \def\bredde{\calculate{2*\figur}}     \def\faktorA{\calculate{\hoejde+1}}     \def\faktorB{\calculate{\bredde+1}}     \def\faktorC{\calculate{\hoejde-1}}     \def\faktorD{\calculate{\figur-1}}     \def\skalering{\calculate{2.5/\figur}}     \centering     \psset{      unit=\skalering     }     \begin{subfigure}{0.58\textwidth}      \centering       \begin{pspicture}(\bredde,\hoejde)        \pnode(!\figur\space 0){A}        \pnode(!0 \bredde\space){B}        \pnode(!\figur\space \hoejde\space){C}        \pnode(!\bredde\space \bredde\space){D}        \betegn{3}{7}{A}        \betegn{3}{9}{B}        \betegn{5}{9}{C}        \betegn{5}{7}{D}       \psset{        linestyle=dashed,        linecolor=blue       }        \multido{\iA=0+1}{\faktorA}{\psline(0,\iA)(\bredde\space,\iA)}        \multido{\iB=0+1}{\faktorB}{\psline(\iB,0)(\iB,\hoejde\space)}       \psset{        linewidth=1.25pt,        linestyle=solid,        linecolor=black       }        \psline(A)(C)        \psline(B)(D)        \pspolygon[linewidth=2pt,linecolor=red](A)(B)(C)(D)       \end{pspicture}      \subcaption{Before the rearrangement.}     \end{subfigure}     \begin{subfigure}{0.38\textwidth}      \centering       \begin{pspicture}(\figur,\hoejde)        \pnode(0,0){A}        \pnode(!0 \bredde\space){B}        \pnode(!0 \hoejde\space){C}        \pnode(!\figur\space \hoejde\space){D}        \pnode(!\figur\space \bredde\space){E}        \pnode(!\figur\space 0){F}        \betegn{3}{7}{A}        \betegn{3}{9}{B}        \betegn{1}{11}{C}        \betegn{1}{1}{D}       \psset{        linestyle=dashed,        linecolor=blue       }        \multido{\iC=1+1}{\faktorC}{\psline(0,\iC)(\figur\space,\iC)}        \multido{\iD=1+1}{\faktorD}{\psline(\iD,0)(\iD,\hoejde\space)}       \psset{        linewidth=1.25pt,        linestyle=solid,        linecolor=black       }        \pspolygon(A)(C)(D)(F)        \psline(B)(E)        \psline[linewidth=2pt,linecolor=red](F)(B)(D)       \end{pspicture}      \subcaption{After the rearrangement.}     \end{subfigure}     \caption{Figure~$\figur$.}     \end{figure}          \end{document}      All you have to do is change the value of `\figur`. The document can be compiled with `pdflatex -shell-escape filename.tex`.


title: complex nodes with tikz-qtree

text: I am trying to convert my `tree-dvips` trees into something that is compatible with xelatex. I had a look at the `tikz-qtree` package, but it seems to be impossible to set complex nodes. In the old `qtree` package there was a low level syntax that I could use (leaf, branch, ...), but this seems to be gone. In `tree-dvips` I just put the complex stuff inside of `\node{...}`, but how do I do this with `tikz-qtree`?               \documentclass{scrbook}          \usepackage{tikz-qtree}          \begin{document}          This is some text and the figure should be the size of the text not larger and not smaller.     \begin{figure}[h]     \begin{tikzpicture}     \Tree[.{V[\begin{tabular}[t]{@{}l@{}}                  spr eliste,\\                  comps eliste ]                  \end{tabular}} [.NP dogs ] [.V sleep] ]     \end{tikzpicture}          \end{figure}          This is some text and the figure should be the size of the text not larger and not smaller.          \end{document}      Edit: Tried to do without the tabular environment, but adding the left/north option gives me a funny result. Look at the "man" in the following figure. It is too much north.               \documentclass{scrbook}          \usepackage{tikz-qtree}     \tikzset{every tree node/.style={align=left, anchor=north}}          \begin{document}          \begin{tikzpicture}     \tikzset{level 1+/.style={level distance=3\baselineskip}}     \tikzset{frontier/.style={distance from root=12\baselineskip}}     \Tree[.{V[{\sc comps} { }]}               [.{{1} NP} man ]               [.{V[{\sc comps} { {1} }]}                     [.{{2} NP} ketābāro ]                    [.{V[{\sc comps} { {1}, {2} }]}                         [.{{3} PP} \edge[roof]; {be Sepide} ]                         [.{V[{\sc comps} { {1}, {2}, {3} }]} dādam ]                    ]               ]     ]     \end{tikzpicture}          \end{document}


title: Using libertine Sans Serif font along with LaTeX typewriter default font

text: How can I use the default `LaTeX` typewriter font along with a Sans Serif `libertine` font?               \documentclass{article}     \usepackage[margin=1in,headheight=5\baselineskip,headsep=1\baselineskip,includehead]{geometry}               \usepackage[scaled]{libertine}      \renewcommand*\familydefault{\sfdefault}     \usepackage[T1]{fontenc}          \usepackage{sectsty}      \sectionfont{\sc\sectionrule{0pt}{0pt}{-5pt}{0.5pt}}          \usepackage{lipsum}          \usepackage{fancyhdr}     \pagestyle{fancy}     \lhead{test1}     \chead{test2}     \rhead{\texttt{xy@z.com}}          \begin{document}     \section*{My Section Heading}     \lipsum          \end{document}      The typewriter font in the output PDF does not match with the rest of the document and actually looks weird, as shown in the following picture (a magnified version of the picture is also illustrated). ![enter image description here](http://i.stack.imgur.com/yI2UD.png)


title: set default font size for \caption*{}

text: I currently use `\caption*{}` elements from the `caption` package to add small notes and explanations underneath figures and tables. Since I want those notes to be small I write them as               \caption*{\footnotesize This is a note}      I have a **lot** of these so setting the `\footnotesize` every time seems a tad redundant. Is there any way to set a default font size for the `\caption*{}` element and for that element alone (in particular: to leave `\caption{}` unaffected)?


title: Double dot at the end of sentence

text: I try to make a class. I wrote               \renewcommand\thetable{\thechapter\arabic{table}.}      and under the table or in sentence I have e.g. "Table 2.1." but problem is when reference is at the end of sentence, e.g.:               Example sentences with reference \ref{tab.some}.      gives > Example sentences with reference Table 2.1.. Similar problem for figures.


title: Indexing: placing the letter sigma in the letter s section

text: I'm working on the index of my thesis and have the word σ-algebra. I would like this to appear with words starting with s. How can I do this please? Right now it appears at the top. I tried using the babel in this way               \documentclass{amsbook}     \usepackage{amssymb,amscd,latexsym,amsxtra}     \usepackage[mathscr]{eucal}     \usepackage[greek, english]{babel}          \newtheorem{thm}{Theorem}[chapter]     \newtheorem{cor}[thm]{Corollary}     \newtheorem{lem}[thm]{Lemma}     \newtheorem{prop}[thm]{Proposition}     \newtheorem{ax}{Axiom}               \theoremstyle{definition}     \newtheorem{defn}[thm]{Definition}     \newtheorem{exmp}[thm]{Example}     \newtheorem{xca}[thm]{Exercise}     \newtheorem{prob}[thm]{Problem}          \theoremstyle{remark}     \newtheorem{rem}[thm]{Remark}     \newtheorem{claim}{Claim}     \newtheorem{case}{Case}     \newtheorem*{notation}{Notation}          \numberwithin{section}{chapter}     \numberwithin{equation}{chapter}     \numberwithin{figure}{chapter}     \numberwithin{table}{chapter}               \makeindex          \begin{document}          \frontmatter          \begin{abstract}     \end{abstract}          \maketitle               \tableofcontents               \mainmatter          \index{sand|see{grains}}     \index{\greektext s \latintext algebra|see{sigma algebra}}     \index{road|see{street}}     %    Include main chapters here.     \include{}                    \backmatter          \printindex          \end{document}


title: Parallel numbering

text: In my script I want to have a structure as illustrated in the following example: 1 Section 1.1 Subsection 1.2 Subsection 1.A Exercise 1.B Exercise 1.3 Subsection 2 Section 2.1 Subsection etc. How can I realize this?


title: Test if a skip has an infinite stretch/shrink component

text: I want to implement an if-then-else depending on whether a skip contains a special character or not. So far, I tried the idea: convert the skip to a token list, and check if the letter `f` is in the list. Something like this:               \leftskip=10pt plus1fil\relax     \edef\mystring{\the\leftskip\the\rightskip}     \if\instring{f}{\mystring}\message{YES}\else\message{NO}\fi     \def\mystring{10.0pt plus 1.0fil}     \if\instring{f}{\mystring}\message{YES}\else\message{NO}\fi     \message{\the\leftskip}      I use `\mystring` as defined here: Check if a string contains a given character Unfortunately, the code does not work. The log file contains contains `NO` instead of `YES`:               NO     YES     10.0pt plus 1.0fil      Probably I know what is wrong, but it is time to ask for a better idea: how to detect infinity?


title: Possibility of extending LaTeX capabilities given technology advancements?

text: As countless questions/answers have noted in the past, LaTeX requires you to compile at least twice when there are references, TOC/LOF, etc. Many of these situations have been documented in the answer to What are the situations where you have to compile a document more than once? Efforts at avoiding this extra step have been successful in select, very specific cases, such as How can I avoid compiling twice? Yet, it is a practice that we take as a given today, simply developing scripts and macros to automate this process enough to ease the pain. The answer to [this question about moving to the previous page] alludes to memory constraints of early computers being central to the reasons why TeX was originally built the way it was. Information that might be needed later is simply stowed away in any number of auxiliary files, and referred to as the next pass was made. Once a page is "complete", it is forgotten by the compiler. I have often thought: **Given the advancements in computer processing and memory capabilities, is it possible/realistic/planned for LaTeX to maintain more of the document in memory to avoid having to compile multiple times?** Keeping the entire document in memory would take a lot of memory, and perhaps some very large documents could not go this route (maybe it would have to be an optional behavior). But it seems that many aspects of typesetting would benefit from this sort of enhanced compilation. I realize this gets to the heart of what (La)TeX is and how it was built. It is not a simple patch; it likely requires a rewrite of the whole core (or does it?). There are certainly other issues that surround this as well (Would this actually reduce compilation time?); I'd be delighted for a reference to another place that discusses this or related issues. (Has this been thought about for LaTeX3?)


title: What's the difference between object, template interface, and template code arguments in xtemplate?

text: From @cgnieder's very helpful xtemplate article: > Basically there are four commands that are important for the definition of > the structures: >   >   >     \DeclareObjectType >         {⟨object⟩} >         {⟨number of args⟩} >   >     \DeclareTemplateInterface >         {⟨object⟩} >         {⟨template⟩} >         {⟨number of args⟩} >         {⟨interface⟩} >   >     \DeclareTemplateCode >         {⟨object⟩} >         {⟨template⟩} >         {⟨number of args⟩} >         {⟨parameter⟩} >         {⟨code⟩} >   >     \DeclareInstance >         {⟨object⟩} >         {⟨instance⟩} >         {⟨template⟩} >         {⟨parameter⟩} >   Why is there a distinction between the number of arguments for each of `\DeclareObjectType`, `\DeclareTemplateInterface`, and `\DeclareTemplateCode`


title: Separating and merging layers in pdf files

text: Does anyone know of a way to use the command line in Linux to separate and merge layers (optional content, section 8.11 of ISO 32000:2008) from a PDF file? I am mostly interested in files created with Adobe Illustrator - apologies if this is too far off-topic, I am quite desperate. I've posted this also to serverfault a while back, but no answers. I have come across a reference to cslayer.dev in here but I cannot find any further documentation.


title: \phantom with always correct spacing (taking into account its surroundings)

text: I regularly use `\phantom` to visually align things in my documents, and often have to manually fill in the spaces that are cut off by removing the atoms (which I don't fully understand) between the objects before and after the `\phantom`---normally this works by adding `{}`'s inside the `\phantom` argument, but not always. With the help of http://tex.stackexchange.com/a/95923/42225, I've cobbled together the following, but I feel that there should be a more elegant solution that doesn't require the preceding and following objects as arguments (which I've made optional).               \documentclass{article}     \usepackage[english]{babel}     \usepackage{amsmath}     \usepackage{xparse}          \makeatletter     \NewDocumentCommand{\archphantom}{O{{}} m O{{}}}{%         \setbox0\hbox{$#1#2#3$}%         \setbox1\hbox{$#1{#2}#3$}%         \dimen@\dimexpr\wd0-\wd1%         #1\phantom{#2}\kern\dimen@#3%     }     \makeatother          \begin{document}          \begin{align*}         x & = \fbox{\hspace{5cm}\vphantom{b}}+\ldots\\         &\archphantom{=}[\ldots] + \fbox{\hspace{5cm}\vphantom{b}} && \text{works}\\         &\phantom{=}\,\:\ldots + \fbox{\hspace{5cm}\vphantom{b}} && \text{trial $\&$ error}\\         &\phantom{{}={}}\ldots + \fbox{\hspace{5cm}\vphantom{b}} && \text{doesn't work}     \end{align*}          \end{document}      For this case in particular (`=`+`\ldots`), I wasn't able to simulate the correct spacing by e.g. `\phantom{{}={}}\ldots`, which motivated me to finally ask this question. ;-) As a side remark, I'm concurrently looking for good name suggestions for the resulting command (or feedback to my choice). I've first thought about `\phantombridge`, since I need to take into account the objects before and after---metaphorically the two visible abutments of an invisible bridge. Now, however, since an arch is basically the same concept, I prefer `\archphantom`, which also has the added connotation of "a `\phantom` of higher rank" (compare angel vs. archangel).


title: Make a minipage float

text: I am using the `minipage` environment to put a table and figure next to each other. Now I would like this to 'float' like a normal figure or table, such that LaTeX decides where to put it (using the [htb] options). After some googling, I found that the `minipage` environment is not a floating one, so it will always be inserted in the same location as the code. This is not always the nicest solution. Is there a way to prevent/circumvent this, such that also a minipage is treated like a float?


title: Processing input files

text: What is the easiest technique to get the n-th line from a input file called `input` and pass it on to a macro called `\process`. Please note that I'm not asking about outputing the n-th line verbatim but about catching the line and passing it on to the macro. The macro `\process` is defined as follows:               \def\process#1\endprocess{%         % process #1     }      The n-th line of the input file should be passed as the argument `#1` to the macro `\process`.


title: How to remove the blank page when omitting comments and messages in knitr

text: I am using the following code to create a plot, I want to omit message, comments and warnings and everything else but the plot.               \documentclass{article}     \usepackage{pdflscape}     \pagestyle{empty}     \begin{document}          \begin{landscape}          <<echo=FALSE, message=FALSE, comment=NA, warning=FALSE>>=     x1 <- runif(10)     y1 <- runif(10)     x2 <- runif(10)     y2 <- runif(10)     x <- cbind(x1,x2)     y <- cbind(y1,y2)     plot(y ~ x)     @          \end{landscape}     \end{document}      A blank page is created before the plot. I think there is something related to the landscape that create the blank page. Is there any way to get rid of it? Thanks a lot!


title: ** ERROR ** DVI stack exceeded limit. with tikz-qtrees in xelatex

text: I've got a snippet of `tikz-qtree` which causes               ** ERROR ** DVI stack exceeded limit.      when compiling with xelatex, but works fine with pdflatex. But I need xelatex because I've got a lot of unicode in the document. There's the code:               \documentclass[11pt]{article}     \usepackage{savetrees}     \usepackage{tikz-qtree, tikz-qtree-compat}     \tikzset{every tree node/.style={align=center, anchor=north}}     \usetikzlibrary{positioning}          \begin{document}     \begin{tikzpicture}     \tikzset{every tree node/.style={align=center, anchor=north}}     \Tree [.CP [.C' [.C\\ø ] [.TP [.T' [.T\\ed ] [.VP [.DP \edge[roof ];\\I ] [.V' [.V\\ask ] [.CP [.C' [.C ø ] [.TP [.T' [.T\\ed ] [.VP [.DP \edge[roof ];\\John ] [.V' [.V\\believe ] [.CP [.C' [.C ø ] [.TP [.T' [.T\\ed ] [.VP [.DP \edge[roof ];\\Mary ] [.V' [.V' [.V\\lie ] ] [.PP \edge[roof ];\\why ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]     \end{tikzpicture}     \end{document}      And to download: http://sprunge.us/OaIO


title: Disable ISSN but keep ISBN with biblatex

text: I'm writing a document where I want `ISBN`s to be shown for books so I have turned on the `isbn` option. This causes the `ISSN` for journals to be shown when I reference an article. Is there a way to enable `ISBN`s but dissable `ISSN`s? They seem to be controlled by the same option in when referring to the `biblatex` manual. I'm also using the `biblatex-chem` styles as well if that helps.


title: Macro shifts to the right

text: Every time I'm using this macro it shifts to the right. Why?               \newcommand*{\addLine}[1]{         \begin{tikzpicture}[overlay, remember picture]             \coordinate (x) at (#1,0);             \draw [open triangle 45-] (0,0) -- (x);         \end{tikzpicture}     }      **Edit** Well, I adapted my real macro (I just provided a smaller example for the sake of demonstration), but I still have a little gap:                   \newcommand*{\AddNote}[4]{%         \begin{tikzpicture}[overlay, remember picture]%                     \coordinate (x) at (#2,0);                     \coordinate (a) at ($(x)!(#1.north)!($(x)+(0,1)$)$);                     \coordinate (b) at ($(a)+(0.5,0)$);                     \coordinate (c) at ($(b)+(0,#3)$);                     \draw [open triangle 45-] (a) -- (b) -- (c);                     \node[right] at (c) {\bf\sffamily\smaller#4};         \end{tikzpicture}%         }


title: Symbol or dingbat of a calculator?

text: I looked all over but could not find anything. Is there a package out there that has a symbol/dingbat of a calculator? I know there probably isn't, but I've seen much stranger stuff out there before...


title: How to emphasize the character '&' within a listing?

text: How do I emphasize with the `listings` package the column separators in a tabular environment? This is my MWE:               \documentclass{article}     \usepackage{lmodern}     \usepackage{graphicx}     \usepackage{array,longtable,tabularx,ctable}     \usepackage{siunitx}     \usepackage{listings}     \lstset{        language={[LaTeX]tex},        basicstyle=\ttfamily,        keywordstyle=\color{blue}\bfseries,        stringstyle=\color{red},        commentstyle=\color{green},        columns=fullflexible,        %        morekeywords={tabular,toprule,midrule,bottomrule},        otherkeywords={},        emph={},        emphstyle={\color{red}\bfseries}     }     \begin{document}     This is my tabular material:          \medskip          \begin{tabular}{lcl}     \toprule     2.3456   & 2.3456    & 0.1 \\     12,3456 & 12,3456  & 12,3456   \\     -9,8765  & -9,8765  & -9,8765   \\     \bottomrule     \end{tabular}          \medskip          And this is the code:          \medskip          \begin{lstlisting}     \begin{tabular}{lcl}     \toprule     2.3456   & 2.3456    & 0.1 \\     12,3456 & 12,3456  & 12,3456   \\     -9,8765  & -9,8765  & -9,8765   \\     \bottomrule     \end{tabular}     \end{lstlisting}          \end{document}      How can the character `&` have a separated emphasizing style? TYIA.


title: How to cite authors in small cap with \citet?

text: I followed Natbib reference sheet and `\citet` works as expected. I would like the author's name to appear in small caps, how can I do that? I guess I should do: > Define `\citenumfont` to be a font declaration or command like `\itshape` or > [...] `\textit`. but I have no idea what it means. **Before you upvote lockstep's answer** : it does not work, the authors name are not in small cap, the renewcommand has no effect. His example code does not compile as it is now. **UPDATE:** Here is a minimum working example. smallcap.tex               \documentclass[fleqn]{article}     \usepackage[numbers]{natbib}     \makeatletter     %\renewcommand*{\NAT@nmfmt}[1]{\textsc{#1}}     \def\NAT@nmfmt#1{\textsc{#1}}     \makeatother     \begin{document}     As mentioned in \citet{Biegler97}~\dots     \bibliographystyle{plainnat}     \bibliography{dummy}     \end{document}      dummy.bib               @BOOK{biegler97,       AUTHOR = {Lorenz T. Biegler and Ignacio E. Grossmann and Arthur W. Westerberg},       TITLE = {Systematic Methods of Chemical Process Design},       YEAR = {1997},       PUBLISHER = {Prentice Hall PTR, Upper Saddle River, NJ}     }


title: Is there a value for \textfraction (and totalnumber, floatpagefraction) that I should avoid getting close to?

text: Initially I wanted to open a question: > How to get (more) text on a page with large floats? But of course the topic at hand has been covered way more many times than google can list on one page. (some links: /1, /2, and /3). After searching around, I started adding the following lines in my MWE which essentially solved the problem in the MWE:               \renewcommand\textfraction{.1}     \setcounter{totalnumber}{5}     \renewcommand{\floatpagefraction}{.8}      ## Picture for MWE ![enter image description here](http://i.stack.imgur.com/0Z6WQ.png) So I am in the situation where my MWE works perfectly while my real document does not. The relevant page in my real document looks like this: ![enter image description here](http://i.stack.imgur.com/IEHKd.png) => I am wondering, if I play around with the values mentioned earlier, could I break something? **Are there values which I should not use for textfraction, totalnumber or floatpagefraction?** ## MWE               \documentclass[     a4paper     ]{scrreprt}          \usepackage{     lmodern,     }               \usepackage[%     paper=a4paper,     left=3cm,%     right=2cm,%     top=3cm,%     bottom=2cm,%     headheight=1.5cm,%     headsep=1.5cm,%     ]{geometry}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \renewcommand\textfraction{.1}     \setcounter{totalnumber}{5}          \begin{document}          \begin{figure}[htbp]     \centering     \fbox{\parbox[c][8cm]{0.4\linewidth}{Height8cm}}     \caption{Test}     \label{fig:Test1}     \end{figure}          Short text. Blahblah. Short text. Blahblah. Short text. Blahblah.           \begin{figure}[htbp]     \centering     \fbox{\parbox[c][10cm]{0.4\linewidth}{Height10cm}}     \label{fig:Test2}     \caption{Another test}     \end{figure}          Third short text. Blahblah. Short text. Blahblah. Short text. Blahblah.          \begin{figure}[htbp]     \centering     \caption{Test}     \fbox{\parbox[c][6cm]{0.4\linewidth}{Height6cm}}     \label{fig:Test3}     \end{figure}          \end{document}


title: How to align these two tikz figures better?

text: I'm quite new to latex and I'm trying to get two tikz figures side by side. I've honestly just looked up "tikz figures side by side" and taken code and re-adjusted it to give the figures I want, so parts of the below code might seen unnecessary.               \begin{figure}[h]     \centering     \begin{subfigure}[b]{0.3\textwidth}     \centering     \tdplotsetmaincoords{60}{30}     \begin{tikzpicture}[scale=1.55,tdplot_main_coords]     \filldraw[         draw=gray,         fill=gray!40,     ]          (1,1,0)             -- (0,1,0)             -- (0,-1,0)             -- (1,-1,0)             -- cycle;     \draw[thin,->] (-1,0,0) -- (1,0,0) node[anchor=north east]{$x$};     \draw[ultra thick] (0,0,0) -- (0,1,0);     \draw[ultra thick] (0,0,0) -- (1,0,0);     \draw[ultra thick] (0,0,0) -- (0,-1,0);     \draw[thin,->] (0,-1,0) -- (0,1,0) node[anchor=north west]{$y$};     \draw[thin,->] (0,0,-1) -- (0,0,1) node[anchor=south]{$z$};     \end{tikzpicture}     \caption{The cone $\sigma$}     \end{subfigure}     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\begin{subfigure}[b]{0.3\textwidth}     \centering     \tdplotsetmaincoords{60}{30}     \begin{tikzpicture}[scale=1.55,tdplot_main_coords]     \filldraw[         draw=gray,         fill=gray!40,     ]          (1,0,1)             -- (1,0,-1)             -- (0,0,-1)             -- (0,0,1)             -- cycle;     \draw[thin,->] (-1,0,0) -- (1,0,0) node[anchor=north east]{$x$};     \draw[ultra thick] (0,0,-1) -- (0,0,1);     \draw[ultra thick] (0,0,0) -- (1,0,0);     \draw[thin,->] (0,-1,0) -- (0,1,0) node[anchor=north west]{$y$};     \draw[thin,->] (0,0,-1) -- (0,0,1) node[anchor=south]{$z$};     \end{tikzpicture}     \caption{The dual cone $\sigma^*$}     \end{subfigure}     \caption{$Cone((1,0,0),(0,1,0),(0,-1,0))$ and its dual cone.}     \end{figure}      This creates the figure like so; ![enter image description here](http://i.stack.imgur.com/5XtTE.png) I have a small gripe though. The bottom of the z-axis on the left picture isn't in line with the bottom of the z-axis on the right. It would just be neater to me if they were aligned, but I can't figure out how to. Any help?


title: Why do citations break my page's layout?

text: I am having troubles with citations. As seen on the attached screenshot, they sometimes don't do linebreaking properly, but produce an error `overfull hbox` and break my layout. Here are the relevant packages I include.               \documentclass[12pt,a4paper]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[german]{babel}     \usepackage[hyphens]{url}     \usepackage{jurabib}     \usepackage{pdfpages}      And here is the screenshot: ![enter image description here](http://i.stack.imgur.com/ojQlu.png) **EDIT** : I just found this answer. Neither `\usepackage{breakcites}` nor `\usepackage{cite}` helped, but `\usepackage{microtype}` certainly did. Let's see whether it will solve all linebreaking problems.


title: Unexpected list spacing when trying to implement vertical lists in paragraph style (with enumitem)

text: I'm trying to create a styling for certain numbered lists where they are formatted as normal paragraphs; i.e., a paragraph indent before the label, with all subsequent lines of each item unindented. This matches the Chicago Manual of Style's recommendations for vertical lists in paragraph style (section 6.128): > When items in a numbered list consist of very long sentences, or of several > sentences, and the list does not required typographic prominence, the items > may be set in regular text style as numbered paragraphs, with only the first > line indented, punctuated as normal prose. I'm using the `enumitem` package for (1) style numerals and other things. After checking out the excellent breakdown of list-related widths in the `memoir` manual (esp. figure 8.2), I've got it working, but only by changing what I think is actually correct. (It's amazing how good the memoir manual is as a reference for normal LaTeX!) What I think should work is:               \begin{enumerate}[label=(\arabic*),leftmargin=0pt,itemindent=\dimexpr\parindent+\labelwidth+\labelsep,listparindent=\parindent]      (See this other question for use of `\dimexpr`.) That is, have a zero left margin, and then set `\itemindent` (first line of item indent) so that it represents a paragraph indent plus room for the label and its separator. However, this actually adds slightly too much space for the first lines. If I get rid of the `\labelsep` in the `itemindent` sum, it works (or at least looks aligned properly visually).               \begin{enumerate}[label=(\arabic*),leftmargin=0pt,itemindent=\dimexpr\parindent+\labelwidth,listparindent=\parindent]      Can anyone explain what's going on here? I suspect it's something to do with how `enumitem` is using `labelwidth` internally... Also, let me know if you think this isn't the correct interpretation of the Chicago wording! **EDIT** : If you want a full LaTeX document to see the issue, here's one I prepared earlier (Blue Peter style):               \documentclass[11pt,a4paper,twoside,notitlepage]{article}          \usepackage{enumitem}          \begin{document}          \section{Enumerate Layout Tests}          First \emph{with} use of {\textbackslash}labelsep in the itemindent sum:          \begin{enumerate}[label=(\arabic*),leftmargin=0pt,itemindent=\dimexpr\parindent+\labelwidth+\labelsep,listparindent=\parindent]          \item My first long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long item.          With a second paragraph!          \item My second long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long item.          \end{enumerate}          And a second paragraph to show the standard paragraph indent position. But with lots of text     text text text text text     text text text text text     text text text text text     text text text text text     text text text text text     to check multi-line paragraphs.          OK, now \emph{without} use of {\textbackslash}labelsep in the itemindent sum:          \begin{enumerate}[label=(\arabic*),leftmargin=0pt,itemindent=\dimexpr\parindent+\labelwidth,listparindent=\parindent]          \item My first long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long item.          With a second paragraph!          \item My second long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long     long long long long long item.          \end{enumerate}          \end{document}


title: Tikz multiple graphics in one environment

text: I try to place multiple graphics in my Document. I tried to create a scope and shift the graphics, is there a better way?               \documentclass{article}     \usepackage{scrtime, dsfont}     \usepackage{listings}     \usepackage{amsmath, amssymb}          \usepackage{tikz}     \usetikzlibrary{backgrounds,calc, decorations.pathreplacing,snakes}     \begin{document}       \begin{tikzpicture}[scale=.5]     \pgfmathsetmacro{\A}{27}     \pgfmathsetmacro{\xn}{10}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \pgfmathsetmacro{\A}{27}     \pgfmathparse{((\cubex+\cubey) + (\A / (\cubex*\cubey)))/3}     \pgfmathsetmacro{\xn}{\pgfmathresult}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}[yshift=-5cm]     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \pgfmathsetmacro{\A}{27}     \pgfmathparse{((\cubex+\cubey) + (\A / (\cubex*\cubey)))/3}     \pgfmathsetmacro{\xn}{\pgfmathresult}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}[yshift=-10cm]     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \pgfmathsetmacro{\A}{27}     \pgfmathparse{((\cubex+\cubey) + (\A / (\cubex*\cubey)))/3}     \pgfmathsetmacro{\xn}{\pgfmathresult}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}[yshift=-15cm]     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \pgfmathsetmacro{\A}{27}     \pgfmathparse{((\cubex+\cubey) + (\A / (\cubex*\cubey)))/3}     \pgfmathsetmacro{\xn}{\pgfmathresult}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}[yshift=-20cm]     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \pgfmathsetmacro{\A}{27}     \pgfmathparse{((\cubex+\cubey) + (\A / (\cubex*\cubey)))/3}     \pgfmathsetmacro{\xn}{\pgfmathresult}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}[yshift=-25cm]     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \pgfmathsetmacro{\A}{27}     \pgfmathparse{((\cubex+\cubey) + (\A / (\cubex*\cubey)))/3}     \pgfmathsetmacro{\xn}{\pgfmathresult}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}[yshift=-30cm]     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \pgfmathsetmacro{\A}{27}     \pgfmathparse{((\cubex+\cubey) + (\A / (\cubex*\cubey)))/3}     \pgfmathsetmacro{\xn}{\pgfmathresult}     \pgfmathsetmacro{\cubex}{\xn}     \pgfmathsetmacro{\cubey}{\xn}     \pgfmathparse{\A / (\cubex * \cubey)}     \pgfmathsetmacro{\cubez}{\pgfmathresult}     \begin{scope}[yshift=-35cm]     \draw[red,fill=green] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,0) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,\cubez) -- cycle;     \draw[red,fill=yellow] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,0) -- cycle;     \end{scope}     \end{tikzpicture}     \end{document}


title: Multiple accents on Greek letter in XeLaTeX

text: I'm new to XeLaTeX and having trouble combining a macron and breve over Greek letters. I input `\textgreek{ᾱ̆}`, but the breve is sitting right on top of the macron. How do I raise it up? Or, alternatively, is there way to make this into a pre-defined glyph?


title: Recursively defined macros in TeX

text: After receiving a nice answer to a previous question, I got enthousiastic and tried to create a macro `\sum` such that `\sum<1+2+3>` would be expanded into 6. My idea was to work recursively, using the parsing functionality of `\def`. For instance, the following code outputs "7+6+5"               \documentclass{article}     \def\sumtestX<#1+#2>{\ifx\empty#2{#1}\else{\sumtestX<#2>+#1 }\fi}     \def\sumtest<#1>{\sumtestX<#1+\empty>}          \begin{document}     \sumtest<5+6+7>     \end{document}      So one would expect that turning the "+" into a real "sum" would calculate the actual sum. Nevertheless, the following code doe _not_ work.               \documentclass{article}     \def\sum#1+#2{\the\numexpr#1+#2\relax}     \def\sumtestX<#1+#2>{\ifx\empty#2{#1}\else{\sum\sumtestX<#2>+#1 }\fi}     \def\sumtest<#1>{\sumtestX<#1+\empty>}          \begin{document}     \sumtest<5+6+7>     \end{document}      "Missing number, treated as zero" !? What's wrong?


title: Why not use vertical lines ('|') in a tabular?

text: My question is a follow-up to the answer to a follow-up question, to be found here. `;)` I'd like to know why one would advise against using vertical lines (via `|`) in a tabular (i.e. in `\begin{tabular}{|c|c|}`)? Or is it simply a matter of finding 'nicer' formats, which don't require vertical lines?


title: What is the latest edition of Knuth's "Computers & Typesetting" Series?

text: I would like to buy Knuth's "millenium boxed set" of Computers & Typesetting, but I can't figure out if there is more than one edition. The "Computers & Typesetting" books were originally published in 1986. Were they published as a boxed set then, or are any box sets available now the "Millenium Edition"?


title: angular spring macro

text: Does anyone have a macro for an "angular spring" ? I'm looking for something similar to that in `pst-coil` (PS-Tricks package) but the geometry of the "spring" is not straight but an arch (with eventually, variable opening).


title: Adding program listings using QR/Data Matrix

text: I apologize that this is not strictly a LaTeX question, but I thought this StackExchange would be most suitable; all of what I describe below is done in LaTeX, BTW. In my thesis I want to make sure that certain examples are illustrated with attached code; while I could put the code as files on my personal webpage, I would prefer if the thesis could be self-contained because you never know what might happen in 10 years: the webpage might be gone, while someone actually wants the code and has a paper/PDF version of the thesis. However, putting too much code is pointless, because it is difficult to see someone typing 5-20 pages of code. I thought of doing something new: encoding my code using QR/Data Matrix and putting the resulting images as figures. I was wondering how would you go about it, if at all? The style I am using for typesetting is Classic Thesis. BTW: My initial approach would be to use square QR codes (they are most popular) of the largest possible size and stack them if necessary (vertically, two blocks per page). The QR codes would be generated automatically from live program listings using a Makefile (file.cpp -> file.pdf) and attached to the thesis project. **Comments regarding data capacity:** While comments about capacity are clearly relevant here, a 144x144 square encoded as Data Matrix would contain about 2300 ASCII characters. However, using special encoding modes can bring this up to about 64,000 characters (most code is made of letters and whitespaces). Also, using 80 characters per line is a flawed methodology because multiple lines have very little to no characters. Finally, nothing stops one from using multiple squares to do the encoding.


title: No figures or tables on this page

text: Occasionally there are "special pages" on which I do not want to have any figures or tables (e.g., cover pages). Usually I solve this by simply putting all floats sufficiently late in the source code so that they never appear on the special page. Is there any cleaner solution? Can I easily implement a `\nofloatsonthispage` macro?


title: What is the right way to cite @inproceedings with biblatex?

text: What is the right way to cite `@inproceedings` with biblatex? More specifically, many computer science proceedings paper citations seem to use book titles like "Proceedings of the 28th Annual ACM/IEEE Symposium on Logic in Computer Science". How should this book title be broken down for the biblatex fields? Here are several combinations of `booktitle`, `booksubtitle`, and `booktitleaddon`. Which is the best practice based on the biblatex model?               @inproceedings{key,       ...,       booktitle = {Proceedings of the 28th Annual ACM/IEEE Symposium on Logic in Computer Science},       ...     }          @inproceedings{key,       ...,       booktitle = {Logic in Computer Science},       booksubtitle = {Proceedings of the 28th Annual ACM/IEEE Symposium},        ...     }          @inproceedings{key,       ...,       booktitle = {Logic in Computer Science},       booktitleaddon = {Proceedings of the 28th Annual ACM/IEEE Symposium},        ...     }


title: Place section later in document than defined

text: Is is possible to have a section appear later in the document than where it is defined?               \documentclass{article}          \begin{document}     \section{Intro}     This section appears first.          \section{Arcane details}     This section should not appear here, but later.          \section{Interesting bits}     That people want to see.          \appendix     % The Arcane details section should appear here.          \end{document}      In this simple example, I don't want the second section I defined (Arcane details) to appear as the second section, but rather to be an appendix at the end of the document. I know I could just move that section to the location I want it, but the case I want to do this for is for an automatically generated document (specifically Sweave from R) and the section I want to appear later involves calculations that need to be done before the rest of the document can be generated.


title: How to modify Memoir class' headers/footers without redefining everything

text: I am using the `memoir` class for a multi-part (and multi-book) document. The class' headers and footers suit me fine for a `twoside`, `openright` document, but I'd like to add to them the following:   * In the header, the book and part numbers before the chapter.   * In the footer, a copyright notice. I've tried to redefine the style, based on How to add an author name or copyright symbol on each page in memoir class?, but have been unsuccessful. Is there a way to merely add the above elements to headers/footers without breaking anything else?


title: Defining a `\subtitle` macro - `\reserved@e` undefined

text: I want to define a general-ish `\subtitle` macro that simply adds to the `\@title` macro set by the user-level `\title`. Here is what I've got:               \documentclass{article}     \RequirePackage{xparse,expl3}     \makeatletter\ExplSyntaxOn     \NewDocumentCommand \subtitle { m }       {         \cs_set:Npx \@title           {\@title\\[.5ex]\large#1}       }     \ExplSyntaxOff\makeatother          \title{A New Chapter}     \subtitle{In This Short Book}          \begin{document}     \maketitle     Blah     \end{document}      This is supposed to define a document command `\subtitle` that takes one mandatory argument. It then fully expands the current value of `\@title` and `\\\\[.5ex]\large#1`, setting this expanded value to `\@title`, effectively appending the subtitle to it. Unfortunately, this raises the error               ERROR: Undefined control sequence.          --- TeX said ---     \\  ->\let \reserved@e                             \relax \let \reserved@f \relax \@ifstar {\let \reserv...     l.12 \subtitle{In This Short Book}          --- HELP ---     TeX encountered an unknown command name. You probably misspelled ...      Why am I getting this error and, more importantly, how might I fix it?


title: Trying to make a horizontal table puts the table off the page, how should it be used?

text: I tried landscape, sideways, sidewaystable but they place my table (without turning) outside of the page (see bottom for picture). I'm using sharelatex to make my pdfs, could be a problem with that. Otherwise, how do I get my table to go horizontal? ## Sample table               \documentclass[dvips,12pt]{article}     \usepackage{booktabs}     \usepackage{rotating}          \begin{document}          \begin{sidewaystable}[h]     \footnotesize{}     \caption{Caption. }     \tabcolsep=0.12cm     \begin{tabular}{lllllllllllll}     \hline     &\multicolumn{4}{c}{A} & \multicolumn{4}{c}{B} & \multicolumn{4}{c}{C} \\     \cmidrule(r{10pt}){2-5} \cmidrule(l{6pt}r{10pt}){6-9} \cmidrule(l{6pt}){10-13}     Z & Y & X & Q. & W & E & S & T & L & M & S & V & R \\     \hline     1       &       35165   &       48.7\%  &       35165   &       3.5\%   &       6756    &       35.3\%  &         6756    &       9.0\%   &       0       &       0.0\%   &       0       &       0.0     \\     2       &       11780   &       16.3\%  &       23560   &       2.3\%   &       5086    &       26.6\%  &         10172   &       13.6\%  &       779     &       5.8\%   &       1558    &       0.2     \\     3-5     &       9669    &       13.4\%  &       36003   &       3.6\%   &       4143    &       21.7\%  &         15331   &       20.5\%  &       1961    &       14.7\%  &       7619    &       0.9     \\     6-10    &       5078    &       7.0\%   &       38405   &       3.8\%   &       1784    &       9.3\%   &         13190   &       17.6\%  &       2127    &       15.9\%  &       16553   &       1.9     \\     11-15   &       2285    &       3.2\%   &       29192   &       2.9\%   &       603     &       3.2\%   &         7634    &       10.2\%  &       1329    &       9.9\%   &       17109   &       2.0     \\     16-25   &       2543    &       3.5\%   &       51499   &       5.1\%   &       459     &       2.4\%   &         8957    &       12.0\%  &       1834    &       13.7\%  &       37559   &       4.4     \\     26-50   &       2287    &       3.2\%   &       83445   &       8.3\%   &       218     &       1.1\%   &         7499    &       10.0\%  &       1983    &       14.8\%  &       72967   &       8.5     \\     51-100  &       1795    &       2.5\%   &       126972  &       12.6\%  &       62      &       0.3\%   &         4229    &       5.6\%   &       1704    &       12.8\%  &       120788  &       14.1    \\     101-500 &       1460    &       2.0\%   &       277190  &       27.6\%  &       8       &       0.0\%   &         1184    &       1.6\%   &       1449    &       10.8\%  &       275645  &       32.3    \\     500+    &       195     &       0.3\%   &       304695  &       30.3\%  &       0       &       0.0\%   &         0       &       0.0\%   &       195     &       1.5\%   &       304695  &       35.7    \\     Total   &       72257   &       ~       &       1006126 &       ~       &       19119   &       ~    &  7     4952    &       ~       &       13361   &       ~       &       854493  \\     \end{tabular}     \end{sidewaystable}          \end{document}      ![table](http://i.stack.imgur.com/frRAc.png)


title: Using structural commands in \newcommand - structure messed up?

text: Is it right that usage of structural commands like `\chapter`, `\section`, `\subsection` and the like inside of `\newcommand` screws up the document's structure? I've got a `\section*{...}` inside a `\newcommand` block and using that new command does not work properly. In Texmaker when I use the structure view to navigate through the document, clicking on the corresponding node in the tree moves the focus to the one `\section` command inside the `\newcommand` block instead of the ones that should actually be generated by usage of the custom command in different spots of the document. Complicating, I know. I hope you'll get the point. What do I have to do to get custom commands to produce a correct document structure? //edit: Here's an example of my problem:               \documentclass[a4paper,10pt]{report}          \newcommand{\sectionexample}[2]{         \section*{#1}         This is an Example of what I think is not working...         #2     }          \begin{document}         \tableofcontents         \sectionexample{Test}{Hello World!}     \end{document}      This generates correct output aside from the fact that the section headline is missing in the \tableofcontents.


title: How should one maintain and update a MiKTeX installation?

text: Every once in a while after updating MiKTeX, the installation gets into an inconsistent state. This might be a problem with the packages (an example is described in this question), but sometimes packages are split or renamed. The cases I remember are when `amslatex` was split into `amsmath` and `amscls` and when `miktex-etex-base-2,9` was renamed to `miktex-etex-base-2.9` ( _if I recall correctly_ ; I am sure it was either that or something very similar). In each case the MiKTeX Update process suggested to remove the "old" packages but it didn't give the user any hints about him having to manually add the respective replacement packages back in the package manager to get one's MiKTeX installation back into a usable state. **What are best practices for keeping MiKTeX up to date?** Note that I'm not asking about installing new packages or fonts in general; there are other questions covering this area.   * In which order should one execute the Update process and the Synchronization of the repository?   * According to user Kurt, it is recommended to check the MiKTeX homepage before updating. What else should one do?   * When and in which order (and why) should one execute the "Refresh FNDB" and "Update Formats" processes within the MiKTeX Options menu?   * What else can happen? Other advice?


title: Automatic labeling of enumeration items

text: I would like to redefine the `enumerate` environment so that each `\item` automatically sets `\label{en:\arabic{page}\alph{enumi}}`. I already tried               \usepackage{etoolbox}     \gappto{\item}{\label{en:\arabic{page}\alph{enumi}}}      but this also triggers in the `center` environement, where I don't want it. How can I do this, avoiding conflict with `enumitem.sty` if possible. (Don't worry about non-uniqueness of labels - the document layout assures that.)


title: Insert A3 page with figure into A4 document with active references

text: Based on the first answer from a previous post "Insert foldable A3 pages in an A4 document with active references", I tried to get a figure on an A3 page in my thesis. However, it does not turn out as it should: the picture does not get centered on the page. Otherwise it works. (see below for example output). What I would like: The picture centered on the page and the caption on the inner half of the A3 page, just as if it were an A4 page. Any ideas? I also do need hyperref working ...               \usepackage[demo]{graphicx}     \usepackage{lipsum}          \usepackage{afterpage}     \usepackage{changepage}     \newenvironment{hugepage}%      {\clearpage       \pagestyle{empty}  % turn off display of page numbers, headers, ...             \changepage{247mm}{370mm}{25mm}{15mm}{}{}{}{}{}} % switch to A3      {\clearpage       \changepage{160mm}{247mm}{25mm}{25mm}{}{}{}{}{}} % back to A4          \begin{document}          \afterpage{%      \pdfpagewidth=2\pdfpagewidth      \pagestyle{empty}      \begin{hugepage}        $\,$       \begin{figure}[!t]              \includegraphics[width=308mm,height=229mm,page=1]{figures/aaa.pdf}         \caption{Left side image A3.}       \end{figure}      \end{hugepage}     }          \newpage          \afterpage{%      \pdfpagewidth=2\pdfpagewidth      \pagestyle{empty}      \begin{hugepage}        $\,$       \begin{figure}[!t]              \includegraphics[width=308mm,height=229mm,page=2]{figures/aaa.pdf}         \caption{Right side image A3.}       \end{figure}      \end{hugepage}     }          \lipsum{3}     \end{document}      Page 2 (the A3 page) looks like this: ![enter image description here](http://i.stack.imgur.com/eF8St.jpg) The problem is, that the picture is not center aligned. The caption is on the right side of the odd and the even page, but it should be on the right side of the even and on the left side of the odd page. Other suggested solutions are:   change of `textwidth` (Not an option since it requires `memoir` class).   using a KOMA script (Which results in non-centered image as well. And the caption got centered as well, but it should not be). Code of which looks like this:               \afterpage{% Insert after the current page     \clearpage     \KOMAoptions{paper=A3,paper=landscape,pagesize}     \recalctypearea     \begin{figure}[p]     \centering        \includegraphics[width=308mm,height=229mm,keepaspectratio]{largeimage}%        \caption{A large image which required A3}     \end{figure}     \clearpage     \KOMAoptions{paper=A4,pagesize}     \recalctypearea     }      However, it messes up with the page numbers. (see page 3).


title: Diagrams package that allows to draw computer buffers (memory diagrams)

text: I'm writing a document that explains internals of memory buffers and computers and I'm looking for a LaTeX package that would allow me to create diagrams similar to the following: **Circular buffer** : ![enter image description here](http://i.stack.imgur.com/qmPQ6.png) **Linear buffer** : ![enter image description here](http://i.stack.imgur.com/nUFfU.png) Any suggestions?


title: Closing file problem when opening FoxitReader with TexnicCenter

text: I use the FoxitReader instead of Acrobat Reader to see the pdf files. I defined it when I installed TeXnicCenter. When a new file is compiled, it does not automatically closes off the old one. So in order to see the new file, I have to manually close the old file in Foxit Reader (click the X). What can I do? Should I change "Close document before running Latex: Do not close"? If so, with what? Related: http://consult.wikidot.com/latex#foxit The project's options are:               Profile Latex:       C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe       -interaction=nonstopmode "%pm"       Bibtex:       C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\bibtex.exe       "%bm"       Makeindex:       C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\makeindex.exe       "%bm"            Under Viewer:       Path C:\PROGRAM FILES (X86)\FOXIT SOFTWARE\FOXIT READER\FOXIT READER.EX       View Project's Output  Command line: "%bm.pdf"       Close document before running Latex: Do not close


title: Matrix is too small, how to make it bigger?

text: I am trying to make the following matrix bigger since the elements do not fit quite well inside of it. I don't know why..               \documentclass[11pt,a4paper,oneside]{report} % KOMA-Script book     \usepackage[pdftex]{graphicx} % to work with PDFLaTex     \usepackage[T1]{fontenc}      \usepackage{fouriernc}     \usepackage{amsfonts,amsmath,amssymb,amsthm}     \usepackage[a4paper, hmargin={3.5cm,3cm}, vmargin={2.5cm,2.5cm}]{geometry} % margin     \usepackage{multicol}     \usepackage{chngcntr} % added to reset footnote for each chapter     \counterwithout{footnote}{chapter}%added to reste footnote for each chapter      \usepackage{fancyhdr}      \usepackage{enumerate}     %\counterwithout{equation}{chapter} % undo numbering system provided by phstyle.cls     \usepackage{wasysym} % symbols     \usepackage[hang]{footmisc} %to align text of footnotes           \begin{document}      Unscalled matrix     \begin{equation*}     \begin{bmatrix}     a_{1}&u_{2}&\frac{a_{1}}{d}u_{3}\\[6pt]     a_{2}&u_{1}&\frac{a_{2}}{d}u_{3}\\[6pt]     a_{3}&0&u_{4}\\[6pt]     \end{bmatrix}     \end{equation*}           and rescalled..a bit ugly..     \begin{equation*}     \scalebox{2.4}{\Bigg[}\begin{matrix}     a_{1}&u_{2}&\frac{a_{1}}{d}u_{3}\\[6pt]     a_{2}&u_{1}&\frac{a_{2}}{d}u_{3}\\[6pt]     a_{3}&0&u_{4}\\[6pt]     \end{matrix}     \scalebox{2.4}{\Bigg]}     \end{equation*}          also this one     \begin{equation*}     \begin{vmatrix}     1&z&x^2r+y^2t+z^2+2xys\\0&x&x^2b+y^2d+2zx\\0&y&x^2a+y^2c+2zy     \end{vmatrix}     \end{equation*}     \end{document}      and the output... ![enter image description here](http://i.stack.imgur.com/AsPuC.jpg) Thank you


title: About \def\b*{\begin{align*}}

text: I want to make the code shorter. I defined the following pair of macros:               \def\b*{\begin{align*}}     \def\e*{\end{align*}}      My point is that I saw this is a document, with               \def\b*{\begin{eqnarray*}}     \def\e*{\end{eqnarray*}}      instead. The first pair of macros do not compile (on sharelatex.com), and the second one does. Why?


title: Arsclassica: failure in Bibilography and minitoc

text: I tried to use `arsclassia`. I downloaded all the files, except the product, i.e. `ArsClassica.pdf`. I tried to compile `ArsClassica.tex` by TexShop, first LaTeX, then BiBTeX and 2 times LaTeX. When I did the BiBTeX, the error messages were:               "This is BibTeX, Version 0.99d (TeX Live 2012);     I found no \citation commands---while reading file ArsClassica.aux;     I found no \bibdata commmand--- while reading file ArsClassica.aux;     I found no \bibstyle commmand--- while reading file ArsClassica.aux".      The resulting PDF file is identical to the `ArsClassica.pdf` file given in the above URL, except, there is no Bibliography and `minitoc`. I am using this `arsclassia` package for my thesis and is now stuck. Please advise what to do.


title: Replacing Unicode non-breakable spaces by normal spaces

text: I am using the Neo keyboard layout, which uses all kinds of modifier keys to input all kinds of characters (e.g. Greek letters and mathematical symbols). It also has shift+Mod3+space mapped to Unicode 0A, no-break space. From time to time it happens that I mistakenly press these buttons (while entering a space between other symbols with the same modifier keys). Unfortunately [Lua|Xe]TeX obeys these spaces as unbreakable spaces both in normal text and in mathmode (using `fontspec` and `unicode-math`). However my editor (vim) shows the symbol like a normal space, so it is impossible to see where I made a mistake. Is there an easy way to tell [Lua|Xe]TeX to treat no-break spaces like normal spaces?


title: Referencing all uses of a multiply defined label

text: I want to be able to apply the same label multiple times and have a referencing command, that lists all uses of that label. Minimal example:               \documentclass{article}          \newcounter{example}          \begin{document}          Warning: Examples     \myref{pessimistic} % 1, 4     are passimistic. Apart from that, only examples     \myref{beginner} % 1, 2     are suitable for beginners.          \refstepcounter{example} \mylabel{beginner} \mylabel{pessimistic}          \refstepcounter{example} \mylabel{beginner} \mylabel{optimistic}          \refstepcounter{example} \mylabel{intermediate}           \refstepcounter{example} \mylabel{expert} \mylabel{pessimistic}          \end{document}      I'm looking for an implementation for `pdflatex` - avoiding `makeindex` if possible. Is there already a package that does something similar - or how could I go about implementing that?


title: BibTeX writes "pages" where it should be "page"

text: In a book I'm citing, the pages are numbered as following: `X-Y`, where `X` is the chapter number and `Y` is the number of the page in that chapter. For example, the fifth page of the third chapter would be numbered `3-5`. To get the page number `3-5` in a reference, I have to write `3\\-5`, since BibTeX seems to automatically replace hyphens in the page numbers with en dashes. So that's a problem I had which is solved now. However, even after writing `pages = {3\\-5}` in the BibTeX code, BibTeX writes "pages 3-5" in the bibliography, not "page 3-5". How can I make BibTeX understand that "3-5" is just one page and not a range of pages?


title: Hyphenation not working as expected

text: I have the following text:               The example shown in figure \ref{fg:package_normal} shows the scope of the class \textit{org.\-argouml.\-kernel.\-ProfileConfiguration} (\textit{Having}).      Unfortunately the name ProfileConfiguration is so long that it is longer than the textwidth. That's why I added those `\\-` to indicate that it should be hyphenated earlier. But this does not work. So how can I correct it? ## EDIT Here is a complete example:               \documentclass[formal]{seal_thesis}     \begin{document}     The example shown in figure \ref{fg:package_normal} shows the scope of the class \textit{org.\-argouml.\-kernel.\-ProfileConfiguration} (\textit{Having}).          Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.     \end{document}      And here is the template:               %%     %% This is file `seal_thesis.cls'.     %%     %% This file is the seal thesis class files. All thesis at seal should     %% be written using this style file.     %%     %% \CharacterTable     %%  {Upper-case    \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     %%   Lower-case    \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     %%   Digits        \0\1\2\3\4\5\6\7\8\9     %%   Exclamation   \!     Double quote  \"     Hash (number) \#     %%   Dollar        \$     Percent       \%     Ampersand     \&     %%   Acute accent  \'     Left paren    \(     Right paren   \)     %%   Asterisk      \*     Plus          \+     Comma         \,     %%   Minus         \-     Point         \.     Solidus       \/     %%   Colon         \:     Semicolon     \;     Less than     \<     %%   Equals        \=     Greater than  \>     Question mark \?     %%   Commercial at \@     Left bracket  \[     Backslash     \\     %%   Right bracket \]     Circumflex    \^     Underscore    \_     %%   Grave accent  \`     Left brace    \{     Vertical bar  \|     %%   Right brace   \}     Tilde         \~}     \NeedsTeXFormat{LaTeX2e}[1995/12/01]     \ProvidesClass{seal_thesis}                   [2005/02/10 v1.0e      seal LaTeX thesis class]          \LoadClass[10pt,twoside,a4paper]{book}     \RequirePackage{graphicx}     \RequirePackage{listings}     \RequirePackage{fancyhdr}          \newif\ifformal     \formalfalse          \DeclareOption{formal}{%     \formaltrue     }     \ProcessOptions     % Using Palatino font     \renewcommand{\rmdefault}{ppl}     \renewcommand{\sfdefault}{phv}     \renewcommand{\ttdefault}{pcr}          \setlength{\textwidth}{15cm}     \setlength{\textheight}{21.3cm}     \setlength{\evensidemargin}{-6mm}     \addtolength{\oddsidemargin}{4mm}          \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ \ #1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection \ \ #1}}     \fancyhf{}     \fancyhead[LE,RO]{\fontfamily{pfr}\selectfont\small\bfseries\thepage}     \fancyhead[LO]{\fontfamily{pfr}\selectfont\rightmark}     \fancyhead[RE]{\fontfamily{pfr}\selectfont\leftmark}          \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0pt}     \fancypagestyle{plain}{       \fancyhead{}       \renewcommand{\headrulewidth}{0pt}     }               \def\thesisType#1{\gdef\@thesisType{#1}}     \def\subtitle#1{\gdef\@subtitle{#1}}     \def\home#1{\gdef\@home{#1}}     \def\country#1{\gdef\@country{#1}}     \def\legi#1{\gdef\@legi{#1}}     \def\prof#1{\gdef\@prof{#1}}     \def\assistent#1{\gdef\@assistent{#1}}     \def\email#1{\gdef\@email{#1}}     \def\url#1{\gdef\@url{#1}}     \def\begindate#1{\gdef\@begindate{#1}}     \def\enddate#1{\gdef\@enddate{#1}}          \gdef\@thesisType{No Thesis Type given}     \gdef\@title{No Title given}     \gdef\@subtitle{missing}     \gdef\@date{No Date given}     \gdef\@home{No Home given}     \gdef\@country{No Country given}     \gdef\@legi{No Legi given}     \gdef\@prof{No Professor given}     \gdef\@assistent{No Assisten(s) given}     \gdef\@email{missing}     \gdef\@url{missing}     \gdef\@begindate{No Begin Date given}     \gdef\@enddate{No End Date given}     \def\missing{missing}          \newif\ifsubtitle     \subtitletrue     \newif\ifemail     \emailtrue     \newif\ifurl     \urltrue          \newlength{\normaltopmargin}     \setlength\normaltopmargin{\topmargin}          \renewcommand\maketitle{%       \ifformal       \ifx\@subtitle\missing         \subtitlefalse       \fi       \ifx\@email\missing         \emailfalse       \fi       \ifx\@url\missing         \urlfalse       \fi       \newpage       \thispagestyle{empty}       \begingroup       \fontfamily{pfr}\selectfont       \begin{flushright}%         \vspace*{50\p@}         {\fontsize{24}{0}\selectfont \@thesisType}         \vskip -9\p@         \vbox{\hrule height0.25pt width\textwidth}         \vskip -2\p@         {\fontsize{9}{0}\selectfont \@date}         \vskip 20\p@         {\fontfamily{pfr}\fontsize{48}{0}\selectfont\bfseries \@title}         \ifsubtitle           \vskip 5\p@           {\fontsize{24}{0}\selectfont \@subtitle}         \fi         \vfill         {\fontsize{24}{0}\selectfont\bfseries \@author}         \vskip -2\p@         {\fontsize{9}{0}\selectfont of \@home,\ \@country \ (\@legi)}         \vskip 35\p@         {\fontsize{10}{0}\selectfont\bfseries supervised by}         \vskip 4\p@         {\fontsize{12}{0}\selectfont \@prof\\[2\p@] \@assistent}      \end{flushright}%      \vskip 87\p@      \parindent \z@      \includegraphics[width=7cm]{logo_inf}\hfill\includegraphics[width=3.5cm]{seal_bw}      \endgroup      \clearpage\thispagestyle{empty}\cleardoublepage       \fi       \thispagestyle{empty}       \begingroup       \fontfamily{pfr}\selectfont       \begin{flushright}%         \vspace*{50\p@}         {\fontsize{24}{0}\selectfont \@thesisType}         \vskip -9\p@         \vbox{\hrule height0.25pt width\textwidth}         \vskip 31\p@         {\fontsize{48}{0}\selectfont\bfseries \@title}         \ifsubtitle           \vskip 5\p@           {\fontsize{24}{0}\selectfont \@subtitle}         \fi         \vfill         {\fontsize{24}{0}\selectfont\bfseries \@author}      \end{flushright}%      \vskip 174\p@      \parindent \z@      \includegraphics[width=7cm]{logo_inf}\hfill\includegraphics[width=3.5cm]{seal_bw}      \endgroup      \clearpage\thispagestyle{empty}      \normalfont      \vspace*{\fill}      \noindent      \hspace{-0.9em}      \begin{tabular}{ll}        {\bf \@thesisType} & \\[4\p@]        {\bf Author:} & \@author \ifemail , \@email\fi\\[4\p@]        \ifurl        {\bf URL:} & \@url \\[4\p@]        \fi        {\bf Project period:} & \@begindate \ - \@enddate \\[4\p@]      \end{tabular}           \vskip 4\p@      \noindent Software Evolution \& Architecture Lab\\[2\p@]      \noindent Department of Informatics, University of Zurich%     }     \def\@maketitle{%       \newpage       \thispagestyle{empty}       \begingroup       \fontfamily{pfr}\selectfont       \begin{flushright}%         \vspace*{50\p@}         {\fontsize{24}{0}\selectfont \@thesisType}         \vskip -9\p@         \vbox{\hrule height0.25pt width\textwidth}         \vskip -2\p@         {\fontsize{9}{0}\selectfont \@date}         \vskip 20\p@         {\fontsize{48}{0}\selectfont\bfseries \@title}         \ifsubtitle           \vskip 5\p@           {\fontsize{24}{0}\selectfont \@subtitle}         \fi         \vfill         {\fontsize{24}{0}\selectfont\bfseries \@author}         \vskip -2\p@         {\fontsize{9}{0}\selectfont of \@home,\ \@country \ (\@legi)}         \vskip 35\p@         {\fontsize{10}{0}\selectfont\bfseries supervised by}         \vskip 4\p@         {\fontsize{12}{0}\selectfont \@prof\\[2\p@] \@assistent}      \end{flushright}%      \vskip 87\p@      \parindent \z@      \includegraphics[width=7cm]{logo_inf}\hfill\includegraphics[width=3.5cm]{seal_bw}      \endgroup      \clearpage\thispagestyle{empty}\cleardoublepage       \thispagestyle{empty}       \begingroup       \fontfamily{pfr}\selectfont       \begin{flushright}%         \vspace*{50\p@}         {\fontsize{24}{0}\selectfont \@thesisType}         \vskip -9\p@         \vbox{\hrule height0.25pt width\textwidth}         \vskip 31\p@         {\fontsize{48}{0}\selectfont\bfseries \@title}         \ifsubtitle           \vskip 5\p@           {\fontsize{24}{0}\selectfont \@subtitle}         \fi         \vfill         {\fontsize{24}{0}\selectfont\bfseries \@author}      \end{flushright}%      \vskip 174\p@      \parindent \z@      \includegraphics[width=7cm]{logo_inf}\hfill\includegraphics[width=3.5cm]{seal_bw}      \endgroup      \clearpage\thispagestyle{empty}      \normalfont      \vspace*{\fill}      \noindent      \hspace{-0.9em}      \begin{tabular}{ll}        {\bf \@thesisType} & \\[4\p@]        {\bf Author:} & \@author \ifemail , \@email\fi\\[4\p@]        \ifurl        {\bf URL:} & \@url \\[4\p@]        \fi        {\bf Project period:} & \@begindate \ - \@enddate \\[4\p@]      \end{tabular}           \vskip 4\p@      \noindent Software Evolution \& Architecture Lab\\[2\p@]      \noindent Department of Informatics, University of Zurich     }          %\def\ps@sealheadings{\let\@mkboth\@gobbletwo     %       \let\@oddfoot\@empty\let\@evenfoot\@empty     %       \let\@mkboth\markboth     %   \def\@evenhead{\vbox{\hbox     %       {\llap{\parbox[b]{\textwidth}{\fontfamily{pfr}\selectfont\bfseries\thepage}}\hfil     %       {\rlap{\parbox[b]{50pt}{\fontfamily{pfr}\selectfont\leftmark}}}}     %         \hrule height0.4pt width\textwidth}}     %   \def\@oddhead{\vbox{\hbox to \textwidth{%     %         \fontfamily{pfr}\selectfont{\rightmark}\hfil\bfseries\thepage}\vskip 1.5pt plus 0pt minus 1.5pt%     %         \hrule height0.4pt width\textwidth}}     %   \def\chaptermark##1{\markboth{\@chapapp \ \thechapter.\ \ ##1}{}}%     %   \def\sectionmark##1{\markright{\thesection \ \ ##1}}}          %\ps@fancyheadings          \renewcommand\chapter{\if@openright                             \clearpage\thispagestyle{empty}\cleardoublepage                         \else                             \clearpage                         \fi                         \thispagestyle{empty}%                         \global\@topnum\z@                         \@afterindentfalse                         \secdef\@chapter\@schapter}     \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne                            \if@mainmatter                              \refstepcounter{chapter}%                              \typeout{\@chapapp\space\thechapter.}%                              \addcontentsline{toc}{chapter}%                                        {\protect\numberline{\thechapter}#1}%                            \else                              \addcontentsline{toc}{chapter}{#1}%                            \fi                         \else                           \addcontentsline{toc}{chapter}{#1}%                         \fi                         \chaptermark{#1}%                         \addtocontents{lof}{\protect\addvspace{10\p@}}%                         \addtocontents{lot}{\protect\addvspace{10\p@}}%                         \if@twocolumn                           \@topnewpage[\@makechapterhead{#2}]%                         \else                           \@makechapterhead{#2}%                           \@afterheading                         \fi}          \def\@makechapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright         \ifnum \c@secnumdepth >\m@ne           \if@mainmatter             \hfill{\fontfamily{pfr}\fontsize{22}{0}\selectfont\bfseries \@chapapp\space \thechapter}%             \par\nobreak             \vbox{\hrule height0.25pt width\textwidth}             \par\nobreak             \vskip 15\p@           \fi         \fi         \interlinepenalty\@M         \flushright{\fontfamily{pfr}\fontsize{32}{0}\selectfont\bfseries #1}\par\nobreak         \vskip 40\p@       }}     \def\@schapter#1{\if@twocolumn                        \@topnewpage[\@makeschapterhead{#1}]%                      \else                        \@makeschapterhead{#1}%                        \@afterheading                      \fi}     \def\@makeschapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright         \interlinepenalty\@M         \vbox{\hrule height0.4pt width\textwidth}         \flushright{\fontfamily{pfr}\fontsize{32}{0}\selectfont\bfseries #1}\par\nobreak         \vskip 40\p@       }}          \renewcommand\section{\@startsection {section}{1}{\z@}%                                        {-3.8ex \@plus -1ex \@minus -.2ex}%                                        {2.3ex \@plus.2ex}%                                        {\fontfamily{pfr}\selectfont\LARGE\bfseries}}     \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%                                          {-3.3ex\@plus -1ex \@minus -.2ex}%                                          {1.5ex \@plus .2ex}%                                          {\fontfamily{pfr}\selectfont\Large\bfseries}}     \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%                                          {-3.3ex\@plus -1ex \@minus -.2ex}%                                          {1.5ex \@plus .2ex}%                                          {\fontfamily{pfr}\selectfont\large\bfseries}}     \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%                                         {3.25ex \@plus1ex \@minus.2ex}%                                         {-1em}%                                         {\normalfont\normalsize\bfseries}}     \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%                                            {3.25ex \@plus1ex \@minus .2ex}%                                            {-1em}%                                           {\normalfont\normalsize\bfseries}}          \renewcommand\labelitemi{\tiny\raisebox{1.5pt}{$\m@th\bullet$}}          %%\def\fnum@figure{{\bfseries\fontfamily{pfr}\selectfont %%\figurename\nobreakspace\thefigure}}     %%\def\fnum@table{{\bfseries\fontfamily{pfr}\selectfont %%\tablename\nobreakspace\thetable}}     \long\def\@makecaption#1#2{%       \vskip\abovecaptionskip       \sbox\@tempboxa{{\bfseries\fontfamily{pfr}\selectfont{#1}}: \fontfamily{pfr}\selectfont{#2}}%       \ifdim \wd\@tempboxa >\hsize         {\bfseries\fontfamily{pfr}\selectfont{#1}}: \fontfamily{pfr}\selectfont{#2}\par       \else         \global \@minipagefalse         \hb@xt@\hsize{\box\@tempboxa}%       \fi       \vskip\belowcaptionskip}          % new contenttable for lists and tables     \renewcommand\listoffigures{%         \newpage         \section*{\listfigurename}             \@starttoc{lof}%     }     \renewcommand\listoftables{%         \section*{\listtablename}             \@starttoc{lot}%     }     \renewcommand\lstlistoflistings{%         \section*{List of \lstlistlistingname}             \@starttoc{lol}%     }          \renewcommand\bibname{References}          \newenvironment{abstract}{%       \chapter*{Abstract}}       {}          \newenvironment{zusammenfassung}{%       \chapter*{Zusammenfassung}}{}          \newenvironment{acknowledgements}{%       \chapter*{Acknowledgements}}{}               \endinput