title: Passing shape argument to titleformat as a command

text: I aim at using to types of chapter headings in my document: for preambule and appendix, simple underlined upper case, while for the main chapters, I want to have a full page with "chapter n / Title" on two different lines… I (almost) managed to do it by defining a new environment "chapterpage" and by passing arguments to `\titleformat` (from titlesec package) as macros (that are not defined in the same way in global and chapterpage environments. However, I do not manage to pass the first optional argument to `\titleformat` following this way :( I need this as I want to use a hang shape in the former layout and a display one in the latter. I suspect it may be solved using the appropriate \protect commands, but I did not manage to fix it! Here is a minimal example. If it worked, "Chapter 2" and "Bar" should be printed on different lines. Thank you for your help.               \documentclass[11pt]{scrreprt}          \usepackage{lipsum}     \usepackage{titlesec}     \usepackage{setspace}          \newcommand{\mychapterShape}{hang} % hang is for aligning the number with the title     \newcommand{\mychapterFormat}{\relax}     \newcommand{\mychapterBefore}{\raggedright}      \newcommand{\mychapterAfter}{\normalsize\vspace*{.8\baselineskip}\titlerule}     \newcommand{\mychapterLabel}{\thechapter} %{\relax}          \newenvironment{chapterpage}      {         \renewcommand{\mychapterShape}{display}         \renewcommand{\mychapterFormat}{             \vspace{\stretch{7}}\normalfont\onehalfspacing\centering\large         }         \renewcommand{\mychapterBefore}{             \thispagestyle{empty}%             %\begin{addmargin}[1cm]{0cm}%             \vspace{0.5em}%         }         \renewcommand{\mychapterAfter}{             \vspace{\stretch{10}}\cleardoublepage\thispagestyle{empty}\singlespacing         }         \renewcommand{\mychapterLabel}{\chaptertitlename~\thechapter}     }     {} % end chapterpage envt           \titleformat{\chapter}[\mychapterShape]%         {\mychapterFormat}{\mychapterLabel}{1em}%         {\mychapterBefore}[\mychapterAfter]%               \begin{document}          \chapter{Foo}         \lipsum[1-3]          \begin{chapterpage}     \chapter{Bar}     \end{chapterpage}     \lipsum[1-3]          \end{document}


title: How to stack two subfigures next to a third subfigure?

text: I'm using the subfigure environment to show 3 graphics in one figure environment. However, I'd like to arrange them in the following order (subfig1 is larger than the other two):               | SUBFIG1 | SUBFIG2 |     | SUBFIG1 | SUBFIG3 |      How can this be achieved? I've tried to add a linebreak, but that moved the third subfigure below the other two.


title: How do I fix Memoir's header "Contents" in the Sniplets section?

text: In memoir I really like the way how custom entities are being referred to, such as the sniplets in its manual. It lets you define a set of items just like Figures and Tables. I'm reusing this code for other purposes, but I noticed a small glitch that's also present in the memoir manual itself. All pages in the Sniplets section have a header "Contents" as shown below. ![enter image description here](http://i.stack.imgur.com/b4tXy.png) I suspect that something in the `\sniplettoc` macro is causing this. The relevant lines from the `memsty.sty` file:               %%%% SNIPLETS %%%%     \newcounter{sniplet}     \counterwithin{sniplet}{chapter}     \newcommand*\snipletname{Sniplet}     \newcommand*\snipletref[1]{\snipletname~\ref{#1} on~\pref{#1}}     \newenvironment{sniplet}[1][]{       \refstepcounter{sniplet}       \edef\mem@e{\@ifnotmtarg{#1}{~(#1)}}       \section*{\snipletname~\thesniplet\mem@e}       \phantomsection       \addcontentsline{toc}{section}{\snipletname\ \thesniplet\mem@e}       \renewenvironment{lcode}{%\@zeroseps         \renewcommand{\verbatim@startline}{\verbatim@line{\hskip\gparindent}}         \small\setlength{\baselineskip}{\onelineskip}\verbatim}%       {\endverbatim         \vspace{-0.75\baselineskip}%         \noindent}     }{}          \let\normalchangetocdepth\changetocdepth     \newcommand\sniplettoc{%       \setcounter{@memmarkcntra}{\value{tocdepth}}%       \begingroup%       \let\changetocdepth\@gobble%       \normalchangetocdepth{-10}%       \cftinsertcode{start-sniplets}{\normalchangetocdepth{3}}%       \cftinsertcode{end-sniplets}{\normalchangetocdepth{-10}}%       \let\tocheadstart\relax%\@gobble       % \printtoctitle\@gobble       \renewcommand\printtoctitle[1]{\section*{Sniplet overview}}%       \let\aftertoctitle\relax%       \let\printtocnonum\relax%       \let\precistoctext\@gobble%       \setlength\cftsectionindent{0pt}%       \tableofcontents*       \endgroup       \setcounter{tocdepth}{\value{@memmarkcntra}}     }      How do I fix this?


title: MacOSX: Cannot use garamond font

text: I'm now using TeXstudio with my Macbook pro, **MacOSX Lion system**. I want to set the font of content to garamond but the command I got from the Internet is not working.               \usepackage[urw-garamond]{mathdesign}     \usepackage[T1]{fontenc}      The preview area is grey with such commands. I have downloaded the four pfb files for garamond, what should I do next?


title: Slashed characters in ConTeXt?

text: In LaTeX there is a `slashed` package which will put a nicely centered slash through an arbitrary symbol - the `\not` command provides an off-center slash on most symbols. How can I do this in ConTeXt? I need this in math mode, so that, for example:               \definecharacter notx {\buildtextaccent\textslash x}      gives me a nice text slashed x, but not a math one. Thanks!


title: Is there a ConTeXt version of the LaTeX lefteqn?

text: What I want is to be able to set up equations like this:               a very long first expression             = the second line             = and a third line             = and maybe even a fourth      In LaTeX, this would be done with the `array` environment and `lefteqn`. A look through the excellent documents on math in ConTeXt doesn't seem to answer my question. So - how do I do this in ConTeXt? Thanks very much!


title: biblatex: the last-name first-name separator authortitle

text: In the answer to the post Modify the last-name first-name separator in biblatex's authortitle it was shown how to customize formattting author's name. I need a somewhat different formatting, namely "Fox P., R. Rabbit" instead of "Fox P, R. Rabbit" (with the dot before comma as required by national standards of my country). How to modifiy the following script borrowed from the above cited post in order to add a dot after "Fox P" before "," and to keep it working with any number of authors? I meean that "Fox P." sould not transform to "Fox P.." in case of single author.               \RequirePackage{filecontents}     \begin{filecontents}{sample.bib}     @ARTICLE{liu:11,       author = {Peter Fox and Richard Rabbit and Franc Bird},       title = {Animals are the better humans},       journal = {Horse and Hound},       year = {2011},       volume = {10},       pages = {11--15}     }     \end{filecontents}          \documentclass[a4paper,ngerman]{scrartcl}     \usepackage{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{csquotes}     \usepackage[style=authortitle,firstinits=true]{biblatex}     % =================================     % biblatex modification     \makeatletter     \def\MKbibnamefirst#1{\expandafter\mkbibnamefirst@i#1..\@nil}     \def\mkbibnamefirst@i#1.#2.#3\@nil{#1}     \renewbibmacro*{name:last-first}[4]{%       \ifuseprefix         {\usebibmacro{name:delim}{#3#1}%          \usebibmacro{name:hook}{#3#1}%          \ifblank{#3}{}{%            \ifcapital              {\mkbibnameprefix{\MakeCapital{#3}}\isdot}          {\mkbibnameprefix{#3}}%            \ifpunctmark{'}{}{\addhighpenspace}}%          \mkbibnamelast{#1}\isdot          \ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}%          \ifblank{#2}{}{\addlowpenspace\mkbibnamefirst{#2}}}         {\usebibmacro{name:delim}{#1}%          \usebibmacro{name:hook}{#1}%          \mkbibnamelast{#1}\isdot          \ifblank{#4}{}{\addlowpenspace\mkbibnameaffix{#4}\isdot}%     %     \ifblank{#2#3}{}{\addcomma}%          \ifblank{#2}{}{\addlowpenspace\MKbibnamefirst{#2}}%     %     \ifblank{#3}{}{\addlowpenspace\mkbibnameprefix{#3}\isdot}     }}     \makeatother     % =================================          \bibliography{sample}     \begin{document}        Samplecite~\cite{liu:11}.        \printbibliography     \end{document}


title: Create Two PDF versions of Classroom slides from Single LaTeX file: Teacher and Student

text: Is there a way to create a single document that will process a LaTeX file in two different ways (different preambles) and produce two different outputs. Specifically, I want to produce a set of classroom slides, one for my use and one to be made available to the students. The student version would have the overlays flattened and place 4 slides to the page. I hope this makes sense.


title: Subfigures with number inside figure

text: I like to have 3 (or whatever number) images and I like them to be as subfigures with numbering a), b), c) and so on: ![enter image description here](http://i.stack.imgur.com/vJbRp.png)   Here, the numbering is done manually and I wonder if there is a way to let LaTeX do the job. Of course the referencing should still work and the position of the label may be chosen freely.


title: Strange persisting error, even after removing the code.

text: After doing some changes to my document, I get a “Runaway Argument” error on compilation. After undoing these changes the error persists. However, when I copy the code to a new file or rename the .tex file, the error goes away. What is wrong? _[Note: question heavily edited by Caramdir.]_


title: Constant errors for missing symbols in equation environment

text: I realise this sounds like a daft question, but I have a lot of missing symbols coming up in my work, but they are there! One such example is               \begin{equation} \label{eq:rgbtohsb}     \begin{center}     $Hue = \left\{\begin{array}{ccc}     \frac{g - b}{max(r,g,b)- min(r,g,b)} & \quad \text{if } & max(r,g,b) =  r\\     \frac{b-r}{max(r,g,b)- min(r,g,b)} & \quad \text{if } & max(r,g,b) = g \\     \frac{r-g}{max(r,g,b)- min(r,g,b)} & \quad \text{if } & max(r,g,b) = b \\     \end{array}          Saturation = \left \{ \begin{array}{ccc}     0 & \text{if } & r = g = b\\     \frac{max(r,g,b)}{V} & \quad \text{ otherwise} \\     \end{array} $          $Value = max(r,g,b)$          $Lightness = \frac{1}{2}(max(r,g,b) + min(r,g,b)) $     \end{center}     \end{equation}      As you can see I do indeed have all of the `$`. Also I have the `\begin{center}` and `\end{center}` Another error, is that it says `\begin{document}` ended by `\end{equation}` Here is the header I am using               \documentclass[a4paper,11pt,twoside]{article}     \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage{fancyhdr}     \usepackage{mathtools}     \usepackage[parfill]{parskip}     \usepackage{program}     \pagestyle{fancyplain}     \fancyhf{}     \rhead{\fancyplain{}{\today}}     \cfoot{\fancyplain{}{\thepage}}     \usepackage{graphicx}     {\tiny }      I do have an `\end{document}` Thanks for your help!


title: Using pgfplots, why do I get "undefined control sequence" when trying to use a foreach variable as a parameter to addplot?

text: Since I have multiple plots with error bars, I would like to shift the error bars slightly to make the overall plot more readable. However, when I try to do this using the variable of a `\foreach` as the amount to shift, I get an "undefined control sequence" error.               \documentclass{article}          \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}     \begin{axis}     \foreach \x/\y in {a/-1cm, b/0cm, c/1cm} {         \addplot+ [             %every error bar/.append style={xshift=\y},             %every node/.style={xshift=\y},             error bars/y dir=both,             error bars/y explicit,         ] coordinates {             (0, 0) +- (0, 1)             (1, 0) +- (0, 1)             (2, 0) +- (0, 1)         };     }     \end{axis}     \end{tikzpicture}          \end{document}      (The document does not compile when I uncomment either one of the two comments.) What's wrong here? **EDIT** : Added another variable to the `\foreach`. In my actual use-case it would contain the filename to plot data from or the label to use for the curve.


title: Quickly Leaving Math Text to Continue Typing in Texmaker

text: In Texmaker, I like using the shortcut to enter math mode. This shortcut creates two dollar signs, and allows you to immediately type text in between the two. My problem is that I would like to be able to continue typing outside of this block immediately upon finishing with my math text. I would like to, say, hit "tab" and be able to start typing outside the math block, one space after the latter dollar sign. How do I do this? Is there a shortcut for this? If not, can I create one? Alternatiely: Can I edit the Math shortcuts that come with Texmaker? I don't mean that I want to edit the keys I press to obtain the code -- rather, I would like to change the code that is available from the Math menu.


title: Force all floats to the end of the document without using endfloat, compatible with htlatex

text: What is the easiest way to have all floats forcibly appear at the end of the document? **The solution should work with`htlatex`**, the floats should appear at the end of the HTML document in this case. (The original question, Force all floats to the end of the document without using endfloat, didn't have the htlatex requirement, and the solution doesn't work for htlatex. Other than that it's a copy, sorry for that. I didn't want to edit the original question, but I could.) The `endfloat` package is not an option, see below. The following questions are related but not helpful: How to place all floats (tables in particular) at a certain point in the document Place all floats last without changing numbering ## Details In our environment we have wrappers for creating figures, tables etc.. The wrappers are implemented as environments to allow "everything" inside and furthermore accept, among others, the long and short caption name, the label and the contens of the figure. The implementation of the wrappers can be altered for different document layouts (caption above/below, figure separated by rule yes/no, ...). One particular layout requires each figure to be placed after the main document. ## Own attempts The `endfloat` package comes to mind. However, I was unable to get it to work, as the figures are created by a wrapper. I have tried implementing this using `\gappto`: The figure-creating command would be just appended to a global hook which is executed just before `\end{document}`. This worked when the figure-creating wrapper was just a command, but now it's an environment to allow "everything" inside. I have added my attempt to the MnWE below, but this results in the following error message:               ! Extra }, or forgotten \endgroup.     \environment_richfigure_end_aux:w ...gure}\egroup           l.39       \end{richfigure}      How would you implement this? ## MnWE               \documentclass{scrartcl}     \pagestyle{empty}     \usepackage{caption}     \usepackage{xparse}     \usepackage{etoolbox}          \newcommand{\delayedfigures}{}          % Comment the following line to get working code     \newcommand{\dofigure}[1]{\gappto{\delayedfigures}{\clearpage#1}}          % The example works with the default implementation of \dofigure     \providecommand{\dofigure}[1]{#1}          %%   \begin{richfigure}     %%     [<placement>, e.g. htp (h=here, t=top, p=page)]     %%     {<short caption>}     %%     {<long caption>}     %%     {<\label{label}>}     %%       <\includegraphics[...]{figure}>     %%   \end{richfigure}     \NewDocumentEnvironment{richfigure}{O{tbp} m m m}{%       \dofigure\bgroup%{%         \begin{figure}[#1]%           \caption[#2]{#3}#4%             }{% Here, the contents of the environment are placed         \end{figure}%       \egroup%{     }          \gpreto{\enddocument}{\delayedfigures}          % Usage example     \begin{document}       Main document contents.            \begin{richfigure}{Short caption}{Long caption}{\label{fig:1}}         Figure contents.       \end{richfigure}            All figures are to appear on separate pages, one per page.     \end{document}


title: is there a way to format the following equations?

text: I have the following structure to a set of equations:               \begin{align}     \MoveEqLeft eq1 = \\     & eq2term1 eq2term2 \\     & eq3term1 eq3term2     \end{align}      Right now eq2term1 and eq2term2 are way too long to appear together in the same line. I want to break it into:               \begin{align}     \MoveEqLeft eq1 = & \\     & eq2term1 \\     & eq2term2 \\     & eq3term1 eq3term2     \end{align}      However, there is one thing I don't like about this, which is eq2term1 and eq2term2 are aligned to the left the same way. I want to push eq2term2 much further in, so that it is apparent it is a continuation of eq2term1. Is there a way to do that? I think I could do that by adding spaces before eq2term2, but that doesn't sound the "right" way to do it...


title: Specific section format

text: I'd like to use `titlesec` to typeset a section header that would look like this: > --------- Name of Section ------------ (the ---- would be a rule, and the entire section header would be centered) I've looked at the `titlesec` documentation, but I'm a little confused as to how to do this. Any help would be greatly appreciated.


title: LaTeX template for a report

text: I am fairly new to LaTeX. I am writing a report in LaTeX and I would like to know if anybody can give me the right hint. The Report is a mix of text, tables and graphs. It should have also headers and page numbers. At the best I should make the best use of the space (i.e. many information should be packed in few pages). Can anybody suggesting me the right template for the Report I am trying to write? In general, it would be cool if you know a good site where I can download various templates? Thanks for your help


title: page layout problem

text: I have a knotty (at least for me) problem to solve. I do apologize, I'm a beginner. I'm trying to find a solution to misalignment. My document is as follows:               page 1       xxxxxxxxxxxx       xxxxxxxxxxxx       xxxxxxxxxxxx           page 2     xxxxxxxxxxxx     xxxxxxxxxxxx     xxxxxxxxxxxx      But what I'd like is:               page 1      xxxxxxxxxxxx      xxxxxxxxxxxx      xxxxxxxxxxxx       page 2      xxxxxxxxxxxx      xxxxxxxxxxxx      xxxxxxxxxxxx       The preamble is:               \documentclass[a4paper,twoside,11pt]{report}     %\documentclass[a4paper,singleside,11pt]{report}     \usepackage{ia_urb_thesis}     \usepackage[italian]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{amsmath}% http://ctan.org/pkg/amsmath               \begin{document}          \titolo{Title ...     \\[5mm]             }     \candidato{io}     \relatore{Chiar.mo Prof.~}     \annoaccademico{000}                         \copertinatesi          \dedica{Ai miei genitori}     \indice     \indicefigure     \indicetabelle     \iniziatesto          \include{cap_1}     \include{cap_2}               \appendix     \include{app_a}     \include{biblio}          \ringraziamenti     bla bla  ...          \end{document}      What's wrong with that?


title: cfr-lm & sans serif small caps

text: How can I have the _sans serif small caps_ with this fonts?               \documentclass{book}          % Latin Modern with oldstyle digits         \usepackage[%        rm={oldstyle,proportional},%        sf={oldstyle,proportional},%        tt={oldstyle=false,proportional=false,monowidth}%      ]{cfr-lm}           \begin{document}     \sffamily\scshape test     \end{document}


title: Avoid putting statements on the same line with algorithmicx

text: I'm writing a simple pseudocode, but I have a problem with a repeat..until block. Basically what happens is that the return statement that follows the end of this loop gets rendered on the same line as the until clause, which is ugly, but I can't find a way to put it on a line of its own _with the correct indentation_. Here you can have an example:               \documentclass[a4paper,10pt]{article}     \usepackage{algorithm}     \usepackage[noend]{algpseudocode}     \begin{document}     \begin{algorithm}     \caption{test di Fermat}\label{alg:test-fermat}     \begin{algorithmic}[1]     \Procedure{testFermat}{$n, prove$}         \Repeat             \State{$a \gets$ numero casuale tra 2 e $n-1$}             \If{$a^n \not\equiv a \bmod n$}                 \Return composto             \EndIf             \State{$prove \gets prove - 1$}         \Until{$prove > 0$}         \Return forse primo     \EndProcedure     \end{algorithmic}     \end{algorithm}     \end{document}      I've tried to add a linebreak using `\\\`, but this breaks the indentation. I've tried using `\algorithmicindent` to add indentation manually, but this displays "1.5em" instead of a whitespace. I've tried to add a `\State` or `\Statex` after the `\Until`, but this also breaks the indentation. Is there a simple way to put the last `\Return` on a line on its own, without breaking the indentation? By the way, this happens also with the return inside the If block, but I'm more worried about the one with the until, since it doesn't look so bad with the if. edit: I've read this question, but it does not solve the problem. I don't want to use `varwidth` because, since I have to fix the until loop, I'd have to manage by hand all indentations[starting a `varwidth` environment in the middle of the loop breaks other indentations].


title: List with arrows instead of bullets

text: I want a bullet list with arrows instead of bullets, like:               => Line 1     => Line 2      I tried this, but it returned some error:               \begin{itemize}{labelitemi}{$\Rightarrow$}[leftmargin=1em]      \item Line 1      \item Line 2     \end{itemize}      (I took the code from here) It should be simple, but I couldn't figure it out from enumitem's manual. How do I go about this?


title: tcolorbox empty title but with frame?

text: I want a box with the header frame for empty title. How can I do that? If I remove the title, the header frame will be removed automatically. I've tried to put an empty title so that I can keep the header frame but with no luck.               \begin{frame}[t]         \frametitle{KKKKKKKK}     \begin{tcolorbox}[colback=green!5, colframe=green!30!black, title = {}]          \end{tcolorbox}     \end{frame}


title: make ``quote'' output as “quote„

text: I have a document in which everything is quoted in the form:               ``quote''      How do I make them appear in the output document as > “quote„ thanks


title: Writing conditional equations with braces in sphinx

text: I want to write conditional statement with one-sided curly brackets in Sphinx as shown below: ![enter image description here](http://i.stack.imgur.com/KqJiQ.jpg) In Latex, the best I could do is given below:               \[     x = \begin{cases}             \begin{split}                 d&,               &     I_x &\leq I_p - t \\                 s&, \; \; I_p - t &\leq I_x &\leq I_p + t \\                 b&, \; \; I_p + t &\leq I_x             \end{split}         \end{cases}     \]       But it provides some blank spaces in middle of condition (marked in red) as shown below: ![enter image description here](http://i.stack.imgur.com/y27OA.jpg) But even that also, doesn't work in Sphinx. It ends up in big error. **So how can I achieve it in both Latex and Sphinx?**


title: Vertical spacing problems with a custom math symbol in LaTeX

text: I need to have a few custom math symbols by adding different number of dots on top of the standard `\preceq` math symbol. So, I have done this as follows:               \newcommand{\orderC}{\stackrel{\therefore}{\preceq}}     \newcommand{\orderB}{\stackrel{..}{\preceq}}     \newcommand{\orderA}{\stackrel{.}{\preceq}}      Now, the problem is that `\orderC` occupies too much vertical space. In particular if I used it in an inline equation, that line will look way too much separated from the main paragraph. I was wondering if I am creating the symbols correctly and if there is a way to avoid this? Thanks in advance,


title: How can I draw an arrow linking two items in a list?

text: I know you can use the package **tikz** to have braces like               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{tikzmark,decorations.pathreplacing,calc}     \begin{document}     \MyText[2em]{start1}{end1}{Technological cascade}     \newcommand\MyText[4][0pt]{%     \begin{tikzpicture}[overlay, remember picture]     \draw [decoration={brace},decorate,thick]     ( $ ({pic cs:#3}|-{pic cs:#2}) + (#1,1.3ex) $ ) --       node[anchor=west,xshift=5pt,text width=5cm] {#4}      ( $ (pic cs:#3) + (#1,0) $ );     \end{tikzpicture}%     }     \begin{itemize}     \item Processing \tikzmark{start1}     \item Embedding in paraffin blocks     \item Microtomy     \item Staining     \item Microscopy \tikzmark{end1}     \end{itemize}     \end{document}      However, I have an arrow back, like negative connection: **How can you make such arrows in a list?** ![enter image description here](http://i.stack.imgur.com/H92Fa.png) You can also propose other ways to say and visualise the effect what is in the list.


title: What is the correct way to create slanted text in ConTeXt?

text: I need to write some romanized foreign words within a passage of English text. Generally, such words should appear as slanted text. I created this simple document and noticed that while both `\it` and `\empth` both slant the text, the appearance of the letters is quite different:               \starttext         {\it Test}         \emph{Test}     \stoptext      With the default fonts, the first example has a more rounded "e" and the start and end points of "s" end in with a small rounded shape, however, both texts appear slanted. Which is the correct way to slant foreign-language text in ConTeXt?


title: ornaments in pgfornament to be at the corners at every page

text: Now, I have the following code producing the output as shown:               \documentclass[12pt]{article}     \usepackage{tikz}     \usepackage{pgfornament}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}[every node/.style={inner sep=0pt}]     \node[text width=8cm,align=center](Text){%     In visions of the dark night     I have dreamed of joy departed-     But a waking dream of life and     light Hath left me broken-hearted.     Ah! what is not a dream by day     To him whose eyes are cast     On things around him with a ray     Turned back upon the past?     That holy dream- that holy dream,     While all the world were chiding,     Hath cheered me as a lovely beam     A lonely spirit guiding.     What though that light, thro’ storm and night,     So trembled from afar-     What could there be more purely bright     In Truth’s day-star?     A Dream (1827) by Edgar Allan Poe} ;     \node[shift={(-1cm,1cm)},anchor=north west](CNW)     at (Text.north west) {\pgfornament[width=1.75cm]{61}};     \node[shift={(1cm,1cm)},anchor=north east](CNE)     at (Text.north east) {\pgfornament[width=1.75cm,symmetry=v]{61}};     \node[shift={(-1cm,-1cm)},anchor=south west](CSW)     at (Text.south west) {\pgfornament[width=1.75cm,symmetry=h]{61}};     \node[shift={(1cm,-1cm)},anchor=south east](CSE)     at (Text.south east) {\pgfornament[width=1.75cm,symmetry=c]{61}};     \pgfornamenthline{CNW}{CNE}{north}{87}     \pgfornamenthline{CSW}{CSE}{south}{87}     \pgfornamentvline{CNW}{CSW}{west}{87}     \pgfornamentvline{CNE}{CSE}{east}{87}     \end{tikzpicture}     \end{document}      I want to make the ornaments come at the corners for every page and the leaves to be removed. How do I do that? ![enter image description here](http://i.stack.imgur.com/3kjT5.png)


title: Unnecessary first line shift in XeTeX

text: Using XeTeX I noticed how first line is shifted with `\usepackage{indentfirst}` in a document which I don't want to happen. In LaTeX everything works Ok. Examples: **XeTeX:**               \documentclass[a4paper,oneside,14pt]{book}     \usepackage{xltxtra}     \usepackage{polyglossia}     \usepackage{fontspec}     \usepackage{extsizes}     \usepackage{indentfirst}     \usepackage{fancyhdr}     \pagestyle{plain}     \linespread{1.5}     \setdefaultlanguage{ukrainian}     \setmainfont{Times New Roman}      ![enter image description here](http://i.stack.imgur.com/YcPQL.png) **LaTeX:**               \documentclass[a4paper,oneside,14pt]{book}     \usepackage{ucs}     \usepackage[utf8x]{inputenc}     \usepackage[T2A]{fontenc}     \usepackage[ukrainian]{babel}     \usepackage{extsizes}     \usepackage{indentfirst}     \usepackage{fancyhdr}     \pagestyle{plain}     \linespread{1.5}      ![enter image description here](http://i.stack.imgur.com/ZiIrN.png) The question is how to fix this indentation? Should I use some manual indentation instead of `indentfirst`? Will it be then a "wheel"?


title: Text containing math above and below equilibrium sign won't compile (using mhchem)

text: Why won't this compile? I suspect the math inside the `[]`s are preventing compilation. If so how do I make this work? Thanks.               \documentclass[12pt]{article}     \usepackage[version=3]{mhchem}     \begin{document}     \ce{E + S <=> [$k_1$][$k_{-1}$] ES <=>[$k_2$] E + P}     \end{document}      Error: > ! Missing $ inserted. $ l.34 ...k_1$}][\ce{$k_{-1}$}] ES <=>[$k_2$] E + P} ?


title: Online manual in "Book" format, like DocBook, but providing collarborative editing like mediawiki?

text: I have a reference document for some software that I would like to publish online, and to provide a pdf and multi-page html version. DocBook looks idea for this, similar to how subversion publish their manual; http://svnbook.red- bean.com/ However I would like to be able to collaboratively edit the document on the similar to google docs, or mediawiki. I am using lots of equations so LaTax support is highly sought after. Any suggestions on what I can use? I have looked at the Heirarchy and DocBook plugins for wikipedia, but they seem old and unmaintained and I couldn't get them to work as I want.


title: Left-aligning authors section in an article

text: I want to align the authors section of my article to the left. If there are more than one authors, each author should be aligned left in its own cell. I am using memoir's article class. This is what I came up with:               \documentclass[twoside,twocolumn,english,article]{memoir}          \pretitle{\begin{flushleft}\LARGE}     \posttitle{\par\end{flushleft}\vskip 0.5em}     \preauthor{\begin{flushleft}                \large \lineskip 0.5em%                \begin{tabular}[t]{l}}     \postauthor{\end{tabular}\par\end{flushleft}}          \title{My Title}     \author{         First Author\\         first@email.com     \and         Second Author\\         second@email.com     }          \begin{document}     \maketitle     Hello world.     \end{document}      The code above does align the first author to the left, but the second author is still centered in its own cell. I tried using `parbox`es for each author. However, using a `parbox` inside the `author` command resulted in the following error:               ! Argument of \reserved@a has an extra }.     <inserted text>                      \par      l.54 }      What should I do to have a nice, left-aligned authors section?


title: Why must I invoke ghostscript directly to convert PS to PDF?

text: My computer runs on Windows 7 with MikTeX 2.9 and GhostScript 9.02 installed. I am still confused why do I have to invoke `gswin64c.exe` rather than `ps2pdf.exe` to convert ps to pdf? The switches I want to use are                -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=filename.pdf -c save pop -f filename.ps      When I use `ps2pdf.exe` with the switch above, it got error message as follows. ![enter image description here](http://i.stack.imgur.com/jTAVY.png) Experiment results based on Philippe's comment as follows. ## Not working syntax:   * `ps2pdf -sPAPERSIZE=a4 in.ps out.pdf`   * `ps2pdf -sPAPERSIZE#a4 in.ps` ## Working syntax:   * `ps2pdf -sPAPERSIZE#a4 in.ps out.pdf`   * `ps2pdf in.ps out.pdf` with top margin gets cropped.   * `ps2pdf in.ps` with top margin gets cropped.


title: How to list supplementary figures in the list of figures?

text: I created several supplementary figures in my thesis using the `newfloat` package as below:               \usepackage{newfloat}     \DeclareFloatingEnvironment[name={Supplementary Figure}]{suppfigure}      When I create the main list of figures (`\listoffigures`) the supplementary figures do not appear in the list, only the main figures. Do you know how I could fix that?


title: WinEdt cannot locate the specified .tex and .bib files

text: My laptop OS crushed and I did a fresh re-installation. I have installed WinEdit 8.1, 64-bit, and MiKTeX 2.9, 64-bit. However, I am trying to compile a TeX file but it returns the following error: > system cannot find the specified file


title: Where to save lco templates for scrlttr2 letters?

text: In the german Koma Script Book I read about the elegant way to predefine the personal address in a .lco file like this ### ~/texmf/tex/latex/jd_private_v001.lco # <- added answer here for other readers               \ProvidesFile{JohnDoePrivate.lco}[2012/04/11]     \setkomavar{fromname}{John Doe}     \setkomavar{signature}{John Doe}     \setkomavar{fromaddress}{Iceroad 4\\ Northpole}     ...      And include it in the header of a letter like ### ~/my/work/letters/letter.tex               \documentclass[foldmarks=true,foldmarks=blmtP,%     JohnDoePrivate,version=last]{scrlttr2}     \usepackage[utf8]{inputenc}          \begin{document}     \opening{Dear Peter,}          i just want to say "hi".          \closing{Best wishes}     \end{letter}     \end{document}      My first idea was to create one `.lco` per sender address like `JohnDoePrivate.lco`, `JohnDoeWork.lco` and store them global on my Linux system. But where? If John moves i could create a `jd_private_v002.lco` and LaTeX will hopefully take the latest address. I could also use the old `.tex` files too, if i force LaTeX to use a special version.


title: How to tell people why packages become deprecated and shouldn't be used anymore?

text: I'm working with LaTeX for a while now. Writing more and more documents I've learned that there are packages that should not be used or got replaced by others. Looking into files my friends or students wrote I read those deprecated ever and ever again. I always tell them not to use them because there are better ones. Then they're asking me, why not update the old ones instead of writing new ones. I wonder if there is any simply explanation, convincing them to write better code and use packages that are up to date.


title: Oversized \underbrace's label causes unwanted spacing

text: Consider this:               \left( x-1 \right) \underbrace{ \left( ? \right) }_{ \text{what is this?} }      The label is longer than the braced portion, which causes unwanted space between the parentheses. Is there a way around that, so that the parentheses "touch" as they would normally? Please note that I just started on LaTeX, and I'm using TexMaths inside LibreOffice Writer.


title: Subscript and underbraces

text: I'm trying to draw an under brace below some subscripts. The thing is that, if I do it the normal way, displays just fine, but with the subscripts letter a little big for a subscript. However, if I force the size, it becomes horribly spaced from the preceding text. Here's the code I'm using for each case Preamble:               \ProvidesPackage{mystyle}     \usepackage[spanish]{babel} %Idioma     \usepackage[utf8]{inputenc} %Codificacion     \usepackage[T1]{fontenc}    %Para que use las formas vectoriales de las fuentes     %\usepackage{lmodern}       %Cambia Computer Modern por Latin Modern     \usepackage{mathtools}      %Paquete matemático general     \usepackage{commath}        %Funcionalidad matemática adicional, como por ejemplo, derivadas     \usepackage{hyperref}       %Links dinámicos en los capítulos y demás     \hypersetup{hidelinks}      %Configura hyperref     \usepackage{siunitx}        %Notación científica y unidades     \usepackage{cancel}         %Para tachar expresiones matemáticas     \usepackage{graphicx}       %Importar imágenes      First case               \begin{align}      \varepsilon_{\underbrace{ijl\hdots}_{n \text{ índices}}} =      \end{align}       Second case               \begin{align}       \varepsilon_{\underbrace{\scriptstyle ijl\hdots}_{n \text{ índices}}} =      \end{align}       Here the outputs, respectively: ![enter image description here](http://i.stack.imgur.com/To4OU.png) ![enter image description here](http://i.stack.imgur.com/cTOSo.png) (Do not worry about the overfull to the right... I'm into that)


title: TexnicCenter User Interface

text: I use TexnicCenter at home and work as well. because I have different sceen sizes, the **Bookmarks** in **Graphical User Interface** has always to be adjusted manually (see picture)![enter image description here](http://i.stack.imgur.com/1tqad.jpg) Which I (each time) have to manually arrange to look like ![enter image description here](http://i.stack.imgur.com/46ZzM.jpg) Is there a way to save such configurations?


title: How to create something like a function (procedure, macros, etc.) in TikZ?

text: I want to draw this thing many a time:               \node[circle,draw,thick,inner sep=0pt,minimum size=2ex] (sum) [left = of myobject] {};     \draw[semithick] (sum.north west) -- (sum.south east);     \draw[semithick] (sum.south west) -- (sum.north east);     \fill (sum.center) -- (sum.south west) arc (-135:-45:1ex) -- cycle;      Is it possible to make a one command that will execute all this code? And `[left = of myobject]` should be a variable.


title: Passing files to SAGE on Mac OS X

text: * System: Mac OS X 10.9.2   * Sage Version 6.1.1, Release Date: 2014-02-04   * TexLive 2013 installation I'm trying to pass a file generated by LaTex (sagetex.sty) that is in SAGE format to my local installation of SAGE.               $ sage test_sagetex_installation.sagetex.sage     dyld: Symbol not found: _rl_executing_keyseq     Referenced from: /usr/local/bin/bash     Expected in: /Applications/sage/local/lib/libreadline.6.dylib     in /usr/local/bin/bash      I have confirmed that I can pass commands directly to SAGE through the command line:               $ sage -c 'print factor(35)’     5 * 7      It seems like this error has to do specifically with passing a file to sage. I'm a little lost about how to debug this error.


title: How to use special characters like the question mark as a variable in a formula?

text: If i write `$t=a$` in LaTex, I get "t = a". If I write `$t=?$` I get "t =?" but I want to get "t = ?". The ? shall have the same distance from the equals sign as any other variable or letter. **Is there a way to to treat the "?" the same way as any other letter in a formula?** To make clear how `$t=a$` and `t=?` look like, I have added a screenshot.![To make clear how $t=a$ and t=? look like, I have added a screenshot.](http://i.stack.imgur.com/u0WIu.jpg)


title: Equation numbers messed up

text: I'm writing a thesis as a collection of different articles. I'm treating each article as a chapter. The first article has Equations numbering A.1, A.2 etc and the second article has equation numbering B.1, B.2 etc. For some unknown reason, now when I compile the thesis, the equations in Article B has numbers as B.2.1, B.2.2 where the middle 2 is the section number. I want to have B.1 and B.2 as before. Why is LaTeX now including the section number in the equation numbering? Any help would be highly appreciated. Thanks a lot... Update: I still have problems after "mpg" answer. The problem is that in my Article 2, the equation numbers are reset at each main section so that I have in Section B.1 equations B.1, B.2 etc and in Section B.2 I get equation numbers B.1 , B.2 again instead of B.3 and B.4. The equation numbers from Article 1 is fine though. I'm attaching a minimal example. Here is the main document (save as main.tex):               \documentclass[fleqn,a4paper,openany,twoside,11pt]{book}     \usepackage[latin1]{inputenx}     \usepackage[OT1]{fontenc}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{cite}     \usepackage{fancyhdr}     \usepackage{chapterbib}     \parfillskip 0pt plus 0.75\textwidth          \renewcommand\chaptername{Paper}     \renewcommand{\thechapter}{\Alph{chapter}}     \setcounter{secnumdepth}{4}          \pagestyle{empty}     \pagestyle{fancy}     \fancyhead{}     \fancyfoot{}     \fancyhead[LE,RO]{\bfseries{\thepage}}     \renewcommand{\headrulewidth}{0.6pt}     \newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}}          \begin{document}          %\clearemptydoublepage     \newpage{\pagestyle{empty}\cleardoublepage\pagenumbering{roman}}     \setcounter{page}{3}          \clearemptydoublepage     \begingroup           \renewcommand{\appendix}{%      \par      \setcounter{section}{0}%      \renewcommand{\thesection}{\thechapter.\Alph{section}}%      }          \include{paper1}          \endgroup               \begingroup            \renewcommand{\appendix}{%       \par       \setcounter{section}{0}%       \renewcommand{\thesection}{\thechapter.\Alph{section}}%       }           \include{paper2}      \endgroup          \end{document}      Here is paper 1 (article 1)...save as paper1.tex :               \chapter{\huge \bfseries My paper A}          \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}     \fancyhead[LO]{\scriptsize \bfseries\rightmark}     \fancyhead[CE]{\scriptsize \bfseries{Paper A}}               \section{Modelling}     \subsection{Simulating}     bla bla bla bla bla blabla blabla blabla blabla blabla blabla blabla blabla bla     bla blabla blabla blabla blabla blabla blabla bla     \begin{equation}\label{eq:eqmotion}     \begin{bmatrix}     m & 0 \\     0 & m     \end{bmatrix}     =     \begin{pmatrix}     F \thinspace \cos \omega_{f} \thinspace t \\     F \thinspace \sin \omega_{f} \thinspace t     \end{pmatrix}     \end{equation}          \section{experiment}     bla bla bla bla bla blabla blabla blabla blabla blabla blabla blabla blabla bla     bla blabla blabla blabla blabla blabla blabla bla     \begin{equation}\label{eq:eqmotion2}     \begin{bmatrix}     m & 0 \\     0 & m     \end{bmatrix}     =     \begin{pmatrix}     F \thinspace \cos \omega_{f} \thinspace t \\     F \thinspace \sin \omega_{f} \thinspace t     \end{pmatrix}     \end{equation}          \appendix     \numberwithin{equation}{section}     \section{force coefficients}     \subsection{second force}     The coefficients of bla bla     \begin{align}     A_{0} & = 15 \nonumber  \\     B_{1} & = 1     \end{align}          \subsection{first force}     \begin{align}     A_{0} & = 14 \nonumber  \\     B_{1} & = 2     \end{align}      And paper2 (article 2).......save as paper2.tex :               \chapter{\huge \bfseries My paper B}          \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}     \fancyhead[LO]{\scriptsize \bfseries\rightmark}     \fancyhead[CE]{\scriptsize \bfseries{Paper B}}          \numberwithin{equation}{chapter}          \section{Modelling}     \subsection{Simulating}     bla bla bla bla bla blabla blabla blabla blabla blabla blabla blabla blabla bla     bla blabla blabla blabla blabla blabla blabla bla     \begin{equation}\label{eq:beqmotion}     \begin{bmatrix}     m & 0 \\     0 & m     \end{bmatrix}     =     \begin{pmatrix}     F \thinspace \cos \omega_{f} \thinspace t \\     F \thinspace \sin \omega_{f} \thinspace t     \end{pmatrix}     \end{equation}          \section{experiment}     bla bla bla bla bla blabla blabla blabla blabla blabla blabla blabla blabla bla     bla blabla blabla blabla blabla blabla blabla bla     \begin{equation}\label{eq:beqmotion2}     \begin{bmatrix}     m & 0 \\     0 & m     \end{bmatrix}     =     \begin{pmatrix}     F \thinspace \cos \omega_{f} \thinspace t \\     F \thinspace \sin \omega_{f} \thinspace t     \end{pmatrix}     \end{equation}          \appendix     \numberwithin{equation}{section}     \section{force coefficients}     \subsection{second force}     The coefficients of bla bla     \begin{align}     A_{0} & = 15 \nonumber  \\     B_{1} & = 1     \end{align}          \subsection{first force}     \begin{align}     A_{0} & = 14 \nonumber  \\     B_{1} & = 2     \end{align}       On compiling the main document (with paper1.tex and paper2.tex in the same folder as main.tex), you will note that in paper B (article 2) in section B.2, the equation numbering starts as B.1 again..which is wrong. It should be B.2. What am I doing wrong? Thanks a lot...


title: Spanish.ldf error

text: I just installed MiKTeX 2.9 x64 on my windows 8.1 laptop. I use Texmaker as a TeX editor. I'm trying to compile a document with these packages:               \usepackage[utf8]{inputenc}          \usepackage[spanish]{babel}          \usepackage[spanish]{layout}      when the compiler is running, it appears the MiKTeX Package Manager's message saying that the file `spanish.ldf` is missing and it will install the `babel- spanish` package. So, I click yes, then the package is installed, but I get the following error: (and hundred more)               ! Undefined control sequence.     l.117 \StartBabelCommands      on line 117 but my file only has 67 lines!. On the other hand, if I compile the file clicking on "no" to the package manager, the file compile normally. How can I install the `babel-spanish` in order to compile normally my files? I tried to install this package from differents repositories and I still get the error.


title: One alphabet in a different font

text: I wanted a sans serif font in Latex, where the capital I looks different than the small l. I came across droid font, which is nice but too wide and takes up too much space. Currently, I am using               \usepackage[T1]{fontenc}     \renewcommand{\familydefault}{\sfdefault}      The "solution" I am thinking of is to only use capital I of the droid font, with everything else remaining the same. Is it possible? If so, how?


title: Having trouble understanding error message

text: I am trying to use the answer supplied in question Change \headheight for a \pagestyle in my own document, but am having trouble understanding the error messages that come up. Here is the document: (UPDATED)               \documentclass{scrartcl}     \usepackage{lecturenotes}          \begin{lecture}{01}{Sample Lecture Notes}{Tom Jack}{01/01/2000}{Chris Karl}{PHYSICS 130: Physics of Energy}          \end{lecture}     \end{document}      And the style file lecturenotes.sty: (UPDATED)               \def\fileversion{1.0}     \def\filedate{2014/02/05}     \NeedsTeXFormat{LaTeX2e}          \usepackage{amsmath,amssymb,amsthm,amsfonts}     \usepackage[top=2cm, bottom=2cm, outer=5.5cm, inner=2cm, heightrounded, marginparwidth=3.5cm, marginparsep=0.4cm, includeheadfoot]{geometry}               \newcommand{\firstpagehead}{         \framebox{             \vbox{                  \hbox to 12.5cm { {\bfseries {\course}} \hfill {Lecture \lecturenum\ -- \lecturedate} }                 \vspace{4mm}                 \hbox to 12.5cm { {\Large \hfill {\lecturetitle}  \hfill} }                 \vspace{2mm}                 \hbox to 12.5cm { {\itshape {Lecturer: \lecturer} \hfill {Notes by: \lecturescribe}} }             }         }          }               \usepackage{scrpage2}          \newpagestyle{normalpage}{     {{\rlap{\lecturedate}\hfill \lecturetitle\hfill\llap{Lecture \lecturenum}}}     {{\rlap{\lecturedate}\hfill \lecturetitle\hfill\llap{Lecture \lecturenum}}}     {{\rlap{\lecturedate}\hfill \lecturetitle\hfill\llap{Lecture \lecturenum}}}     }{     {{\rlap{}\hfill \thepage\hfill\llap{}}}     {{\rlap{}\hfill \thepage\hfill\llap{}}}     {{\rlap{}\hfill \thepage\hfill\llap{}}}     }               \newpagestyle{firstpage}{     {\firstpagehead}     {\firstpagehead}     {\firstpagehead}     }{     {{\rlap{}\hfill \thepage\hfill\llap{}}}     {{\rlap{}\hfill \thepage\hfill\llap{}}}     {{\rlap{}\hfill \thepage\hfill\llap{}}}     }               \usepackage{afterpage}     \pagestyle{normalpage}     \addtolength{\textheight}{-3cm}     \addtolength{\headheight}{3cm}          \AtBeginDocument{         \thispagestyle{firstpage}         \addtolength{\textheight}{3cm}         \afterpage{             \global\advance\headheight by -3cm         }     }          \newenvironment{lecture}[6]{         \global \def \lecturenum {#1}         \global \def \lecturetitle {#2}         \global \def \lecturescribe {#3}         \global \def \lecturedate {#4}         \global \def \lecturer {#5}         \global \def \course {#6}         \begin{document}     }{}


title: Alternative for tikz's scope environment outside tikzpicture

text: I have a lot of small tikz graphics that I all want to scale down, so I'd like to put them in a scope, like this:               \documentclass{article}     \usepackage{tikz}     \begin{document}         \begin{scope}[scale=0.3]             \begin{tikzpicture}     %               Draw stuff in a small scale             \end{tikzpicture}             \begin{tikzpicture}     %               Draw more stuff in a small scale             \end{tikzpicture}         \end{scope}         \begin{tikzpicture}     %           Draw stuff in normal scale again         \end{tikzpicture}     \end{document}      But this doesn't work because the scope environment is only defined inside a tikzpicture. How can I achieve this effect? Do I have to use `\tikzset` and save the current scale before scaling down and restoring it again at the end or is there a "proper" way of doing this?


title: How to fix this MWE to show the chapterthumbs in KOMA-Script?

text: the compilation failure of the whole dissertation was narrowed down to this MWE below. For some reason the MWE fails to compile with the log file below: **MWE**   This MWE is related to this post and this post which was _successfully compiled_ by other users or machines but not on mine anymore after updating TexLive to 2014.               \documentclass[paper=a4, twoside=semi]{scrbook} % A4 is 210mm x 297mm     \usepackage{blindtext}     \usepackage{calc}%     \usepackage{chapterthumb}% package should be installed in the same active folder     \usepackage{etoolbox}%     \usepackage{nameref}%     \usepackage{totcount}     \regtotcounter{chapter}%     %=====================Bibliography=============================     \usepackage[backend=biber]{biblatex}     \usepackage{filecontents}     \begin{filecontents}{jobname.bib}     @article{rand_objective_1971,         title = {Objective criteria for the evaluation of clustering methods},         volume = {66},         pages = {846},         number = {336},         journaltitle = {Journal of the American Statistical Association},         author = {Rand, William M.},         date = {1971}     }          \end{filecontents}     \addbibresource{jobname.bib}     %=========================Chapter thumbs========================     \AtBeginDocument{%     \ifnumequal{\number\totvalue{chapter}}{0}{%     \renewcommand{\chapterthumbwidth}{\paperheight}%     \renewcommand{\chapterthumbskip}{\paperheight}%     }{%     \typeout{There are \number\totvalue{chapter} chapter in this document}%     \renewcommand{\chapterthumbskip}{\paperheight/\number\totvalue{chapter}}%     \renewcommand{\chapterthumbwidth}{\paperheight/\number\totvalue{chapter}}%     }%     }%          \lohead[\putchapterthumb]{\putchapterthumb}     \addtokomafont{chapterthumb}{\bfseries}          \newrobustcmd{\SetChapterThumbHeader}{%     \lohead[\putchapterthumb]{\putchapterthumb}%     }%          \newrobustcmd{\ClearChapterThumbHeader}{%     \lohead[]{}%     }%          \newrobustcmd{\refcommand}[1]{%     \nameref*{#1}%     }%          \newtoggle{UseChapterThumb}%     \toggletrue{UseChapterThumb}%          \renewcommand*{\chapterthumbformat}{\refcommand{chapter::title::\number\value{chapter}}}%          \makeatletter          \newcounter{totalchaptercounter}%          \newrobustcmd{\CreateUniqueChapterLabel}[1]{%      \refstepcounter{totalchaptercounter}%     \label{chapter::title::\number\value{totalchaptercounter}}%     }%               \let\LaTeXStandardChapter\chapter%          \newcommand{\chapter@noopt}[1]{%     \iftoggle{UseChapterThumb}{\SetChapterThumbHeader}{\ClearChapterThumbHeader}     \LaTeXStandardChapter{#1}%     \CreateUniqueChapterLabel{#1}%     }%          \newcommand{\chapter@opt}[2][]{%     \iftoggle{UseChapterThumb}{\SetChapterThumbHeader}{\ClearChapterThumbHeader}     \LaTeXStandardChapter[#1]{#2}%     \CreateUniqueChapterLabel{#2}% Must appear after chapter title is done     }%               \newcommand{\unstarredchapter}{%     \@ifnextchar[{\chapter@opt}{\chapter@noopt}%     }%          \newcommand{\starredchapter}[1]{%     \ClearChapterThumbHeader% Clear the headers -> no chapterthumb here      \LaTeXStandardChapter*{#1}%        }%          \renewcommand{\chapter}{%     \@ifstar{\starredchapter}{\unstarredchapter}%     }%               \let\LaTeXStandardTOC\tableofcontents%     \renewcommand{\tableofcontents}{%     \begingroup%     \renewcommand{\chapter}{\LaTeXStandardChapter}%     \LaTeXStandardTOC%     \endgroup%     }%               \let\LaTeXStandardLOF\listoffigures%     \renewcommand{\listoffigures}{%     \begingroup%     \renewcommand{\chapter}{\LaTeXStandardChapter}     \LaTeXStandardLOF%     \endgroup     }%          \let\LaTeXStandardLOT\listoftables%     \renewcommand{\listoftables}{%     \begingroup%     \renewcommand{\chapter}{\LaTeXStandardChapter}     \LaTeXStandardLOT%     \endgroup     }%               \let\LaTeXStandardPrintBibliography\printbibliography%               \newrobustcmd{\commonprintbibliographysetup}[1][]{%     \iftoggle{UseChapterThumb}{\SetChapterThumbHeader\refstepcounter{chapter}}{\ClearChapterThumbHeader}     \LaTeXStandardPrintBibliography[#1]     \iftoggle{UseChapterThumb}{%     \immediate\write\@auxout{%     \string\newlabel{chapter::title::\number\value{chapter}}{{\thepage}{\thepage}{Bibliography}{}}%     }%     }{}%     }%                    \newrobustcmd{\printbibliography@@noopt}{%     \commonprintbibliographysetup[]%     }%          \newrobustcmd{\printbibliography@@opt}[1][]{%     \commonprintbibliographysetup[#1]%     }          \renewcommand{\printbibliography}{%     \@ifnextchar[{\printbibliography@@opt}{\printbibliography@@noopt}%     }%          \makeatother     %==================================================     \title{Title of the Dissertation}     \author{Author Name}      \publishers{Faculty Name}          \begin{document}     \maketitle     \pagestyle{plain}     \pagenumbering{roman}     \tableofcontents     \listoffigures     \listoftables     \cleardoublepage          \chapter*{Acknowledgments}     \addcontentsline{toc}{chapter}{Acknowledgments}          \chapter*{Abstract}     \addcontentsline{toc}{chapter}{Abstract}     \cleardoublepage     \lohead[\putchapterthumb]{\putchapterthumb}     \mainmatter     \pagestyle{scrheadings}          \chapter{Introduction}     \begin{figure}     \caption{dummy figure}     \end{figure}          \chapter{Materials \& Methods}           \chapter{Results}      \begin{table}     \caption{dummy table}     \end{table}          \chapter{Discussion}     In his reference \parencite{rand_objective_1971}, the author did a nice job.     \backmatter     \cleardoublepage     \printbibliography[heading=bibintoc]     \end{document}      **Log file snippet**               This is XeTeX, Version 3.14159265-2.6-0.99991 (TeX Live 2014/W32TeX) (preloaded format=xelatex 2014.9.2)  2 SEP 2014 20:07     entering extended mode      \write18 enabled.      %&-line parsing enabled.     **MWE_bleed_interaction.tex     (./MWE_bleed_interaction.tex     .     .     .     \c@section@level=\count114     LaTeX Info: Redefining \ref on input line 353.     LaTeX Info: Redefining \pageref on input line 353.     )     (c:/texlive/2014/texmf-dist/tex/latex/totcount/totcount.sty     Package: totcount 2011/01/25 v1.2 package for gettingthe total value of LaTeX c     ounters     )     \c@chapter@totc=\count115     .     .     .     (c:/texlive/2014/texmf-dist/tex/latex/filecontents/filecontents.sty     Package: filecontents 2011/10/08 v1.3 Create an external file from within a LaT     eX document     )          LaTeX Warning: Overwriting file `./jobname.bib'.          \openout15 = `jobname.bib'.               ! Undefined control sequence.     l.38 \lohead                 [\putchapterthumb]{\putchapterthumb}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.               ! LaTeX Error: Missing \begin{document}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.38 \lohead[                  \putchapterthumb]{\putchapterthumb}     You're in trouble here.  Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.          ! Undefined control sequence.     l.38 \lohead[\putchapterthumb                                  ]{\putchapterthumb}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     l.38 \lohead[\putchapterthumb]{\putchapterthumb                                                    }     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          \c@totalchaptercounter=\count233     Package biblatex Info: Trying to load language 'english'...     Package biblatex Info: ... file 'english.lbx' found.     (c:/texlive/2014/texmf-dist/tex/latex/biblatex/lbx/english.lbx     File: english.lbx 2014/06/25 v2.9a biblatex localization (PK/JW/AB)     )     Normal \count register pool exhausted, switching to extended pool.     \@quotelevel=\count277     \@quotereset=\count278          (./MWE_bleed_interaction.aux)     \openout1 = `MWE_bleed_interaction.aux'.          LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 156.     LaTeX Font Info:    ... okay on input line 156.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 156.     LaTeX Font Info:    ... okay on input line 156.     .     .     .         [5] [6               ]     ! Undefined control sequence.     \ClearChapterThumbHeader ->\lohead                                         []{}     l.165 \chapter*{Acknowledgments}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          [7] [8               ]     ! Undefined control sequence.     \ClearChapterThumbHeader ->\lohead                                         []{}     l.168 \chapter*{Abstract}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          [9] [10               ] [11] [12               ]     ! Undefined control sequence.     l.171 \lohead                  [\putchapterthumb]{\putchapterthumb}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     l.171 \lohead[\putchapterthumb                                   ]{\putchapterthumb}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     l.171 \lohead[\putchapterthumb]{\putchapterthumb                                                     }     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          [13] [14               ]     ! Undefined control sequence.     <argument> \undefinedpagestyle           l.173 \pagestyle{scrheadings}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ->\lohead                                       [\putchapterthumb ]{\putchapterthumb }     l.175 \chapter{Introduction}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...ohead [\putchapterthumb                                                        ]{\putchapterthumb }     l.175 \chapter{Introduction}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...humb ]{\putchapterthumb                                                        }     l.175 \chapter{Introduction}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          [1] [2               ]     Chapter 1.     ! Undefined control sequence.     \SetChapterThumbHeader ->\lohead                                       [\putchapterthumb ]{\putchapterthumb }     l.180 \chapter{Materials \& Methods}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...ohead [\putchapterthumb                                                        ]{\putchapterthumb }     l.180 \chapter{Materials \& Methods}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...humb ]{\putchapterthumb                                                        }     l.180 \chapter{Materials \& Methods}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          [3] [4               ]     Chapter 2.     ! Undefined control sequence.     \SetChapterThumbHeader ->\lohead                                       [\putchapterthumb ]{\putchapterthumb }     l.182 \chapter{Results}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...ohead [\putchapterthumb                                                        ]{\putchapterthumb }     l.182 \chapter{Results}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...humb ]{\putchapterthumb                                                        }     l.182 \chapter{Results}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          [5] [6               ]     Chapter 3.     ! Undefined control sequence.     \SetChapterThumbHeader ->\lohead                                       [\putchapterthumb ]{\putchapterthumb }     l.187 \chapter{Discussion}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...ohead [\putchapterthumb                                                        ]{\putchapterthumb }     l.187 \chapter{Discussion}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...humb ]{\putchapterthumb                                                        }     l.187 \chapter{Discussion}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          [7] [8               ]     Chapter 4.          LaTeX Warning: Citation 'rand_objective_1971' on page 9 undefined on input line      188.          [9] [10               ]     ! Undefined control sequence.     \SetChapterThumbHeader ->\lohead                                       [\putchapterthumb ]{\putchapterthumb }     l.191 \printbibliography[heading=bibintoc]          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...ohead [\putchapterthumb                                                        ]{\putchapterthumb }     l.191 \printbibliography[heading=bibintoc]          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Undefined control sequence.     \SetChapterThumbHeader ...humb ]{\putchapterthumb                                                        }     l.191 \printbibliography[heading=bibintoc]          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.               LaTeX Warning: Empty bibliography on input line 191.          [11               ] (./MWE_bleed_interaction.aux)          LaTeX Warning: There were undefined references.               Package biblatex Warning: Please (re)run Biber on the file:     (biblatex)                MWE_bleed_interaction     (biblatex)                and rerun LaTeX afterwards.          Package logreq Info: Writing requests to 'MWE_bleed_interaction.run.xml'.     \openout1 = `MWE_bleed_interaction.run.xml'.           )      Here is how much of TeX's memory you used:      8513 strings out of 493725      148335 string characters out of 6149065      597217 words of memory out of 5000000      11750 multiletter control sequences out of 15000+600000      8846 words of font info for 31 fonts, out of 8000000 for 9000      1328 hyphenation exceptions out of 8191      54i,8n,43p,807b,717s stack positions out of 5000i,500n,10000p,200000b,80000s          Output written on MWE_bleed_interaction.pdf (28 pages).        **Notes**   * To use the `chapterthumb` in the MWE one should install KOMA examples from the latex distribution package manager. the `chapterthumb.sty` resides in the `Angang B` part of the KOMA examples. Additionally, one should copy the `chapterthumb.sty` and paste it in the active `.tex` folder.   * Windows 7 32bit but the same problem was encountered on Ubuntu 14.04 LTS OS.   * TexLive 2014 distribution   * compilation with XeLaTeX   * TexSTudio editor 2.8.2   * Solving this MWE is very critical to me because this will fix the same error my dissertation throws during compilation. **Update 1**   Adding `\listfiles` to the MWE as suggested by Kurt thankfully issued these pkgs:                *File List*      scrbook.cls    2013/12/19 v3.12 KOMA-Script document class (book)     scrkbase.sty    2013/12/19 v3.12 KOMA-Script package (KOMA-Script-dependent bas     ics and keyval usage)      scrbase.sty    2013/12/19 v3.12 KOMA-Script package (KOMA-Script-independent b     asics and keyval usage)       keyval.sty    2014/05/08 v1.15 key=value parser (DPC)     scrlfile.sty    2013/12/19 v3.12 KOMA-Script package (loading files)     tocbasic.sty    2013/12/19 v3.12 KOMA-Script package (handling toc-files)     scrsize11pt.clo    2013/12/19 v3.12 KOMA-Script font size class option (11pt)     typearea.sty    2013/12/19 v3.12 KOMA-Script package (type area)     blindtext.sty    2012/01/06 V2.0 blindtext-Package       xspace.sty    2009/10/20 v1.13 Space after command names (DPC,MH)         calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)     chapterthumb.sty    2014/01/15 v0.3 unsupported LaTeX package     graphicx.sty    2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live        xetex.def    2014/07/25 v4.03 LaTeX color/graphics driver for XeTeX (RRM/JK)             color.sty    2014/04/23 v1.1a Standard LaTeX Color (DPC)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive     scrlayer.sty    31/10/2013 v0.9.1480 package (defining layers and page styles)     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)      nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section     refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)     gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)     kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)     kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)     etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)     totcount.sty    2011/01/25 v1.2 package for gettingthe total value of LaTeX cou     nters     biblatex.sty    2014/06/25 v2.9a programmable bibliographies (PK/JW/AB)     biblatex2.sty    2014/06/25 v2.9a programmable bibliographies (biber) (PK/JW/AB     )       logreq.sty    2010/08/04 v1.0 xml request logger       logreq.def    2010/08/04 v1.0 logreq spec v1.0       ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)          url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.       blx-dm.def     biblatex-dm.cfg     blx-compat.def    2014/06/25 v2.9a biblatex compatibility (PK/JW/AB)     biblatex.def         standard.bbx    2014/06/25 v2.9a biblatex bibliography style (PK/JW/AB)      numeric.bbx    2014/06/25 v2.9a biblatex bibliography style (PK/JW/AB)      numeric.cbx    2014/06/25 v2.9a biblatex citation style (PK/JW/AB)     biblatex.cfg         filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX      document      english.lbx    2014/06/25 v2.9a biblatex localization (PK/JW/AB)      ***********      **Update 2**   ![enter image description here](http://i.stack.imgur.com/3e5tF.png) So the KOMA-script is updated. **Updated Question**   So the code in the MWE worked before because it was based on the `scrpage2` package which is no more supported in the new version of KOMA-Script and that was the source of the errors in the log file. The new `chapterthumb` is based on `scrlayer` instead of the older `scrpage2` package. So how to update the current code to make it comply with the new KOMA version?


title: No *.bbl file generated by bibtex under emacs

text: I can't seem to figure out why my emacs/latex setup fails to produce a *.bbl file for generating references and in text citations. What makes this problem strange is that my setup works for a while i.e. my final output includes a nicely texed file with correct in text citations and a reference page, but then, as of lately, seems to quit on me. I can't recall doing anything strange to my configuration such as editing the '.emacs' file etc.. Symptoms 'LaTeX: there were unresolved citations, {5} pages' 'BibTeX finished successfully. Run LaTeX again to get citations right.' 'LaTeX: there were unresolved citations, {5} pages' No *.bbl file is generated in my working directory. Setup OSX 10.6.8, Emacs-23.3-modified-3 by Vincent Goulet and MacTeX-2011. I'm using Mendeley to manage my *.bib files and all files are stored in a dropbox share folder. Code               \documentclass[12pt,letterpaper]{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[american]{babel}     \usepackage{natbib}               \begin{document}                \citep[pg. 2]{copes2009criminological}.                \bibliographystyle{abbrvnat}     \bibliography{/Users/userName/Desktop/dropbox/bibTex/SOCIO862}     \end{document}      Actions latex bibtex latex view open output-file-name.pdf Note: I'm pretty sure the command 'latex' in the Actions list actually means pdflatex. I don't get *.dvi files when I run the above sequence of commands and *.eps image files don't compile into the final document though *.png or *.pdf work fine. Current solution 1 Apparently deleting and reinstalling the Emacs applications sets thing back to working order, but this really isn't a good solution. Current solution 2 I don't have this problem under texmaker or texworks. Everything works OK. I could give up emacs and use an alternative tex editors, but I've gotten comfortable with the short keys. Log file notes 'Package natbib Warning: Citation `citation-key' on page 2 undefined on input line 64.'


title: Asymmetrical tolerancing

text: I am new to LaTeX, tentatively using it to prepare a complicated industrial document (laboratory test report). Thanks to help recently obtained here, I have discovered the magnificent capabilities of `siunitx` such as the `S` column option for tables. I have just begun to use this option in the table attached. I have seen that tolerancing was another option of `siunitx`, but apparently only for symmetrical values, i.e., `+-X`. I wonder how to improve the visual appearance of the toleranced temperatures, as I do not think my current solution is optimal. Any help appreciated, as I have a large number of such tables in my document.               \documentclass[a4paper, oneside,11pt, english]{report} % Mode production     \usepackage[top=25mm, bottom=25mm, left=20mm, right=20mm]{geometry} %Layout of page     %Source encoding--------------------------------------------------------------------     \usepackage[utf8]{inputenc} % UTF-8 encoding for code editing     %end source encoding---------------------------------------------------------------     %fonts--------------------------------     \usepackage[T1]{fontenc} % Usual fonts     \usepackage{tgheros,textcomp}% Fonts     \usepackage[helvet]{sfmath} % Using helvetica font for maths, instead of default.          %SI Units--------------------------------------------------     \usepackage{siunitx}% Handling Si units     %end SI units----------------------------------------------------     %document layout-----------------------     \usepackage{float} % Floating figures and tables     \usepackage[margin=10pt, font=bf]{caption} % Setting options for captions     %end document layout------------------------     %------------------------------------------------------------------------     % [DEFINITION OF GLOBAL CONFIGURATION AND VARIABLES  ]-------------------     %------------------------------------------------------------------------     % Special options for SI units and tolerancing---------------------------     \sisetup{output-decimal-marker={,}}% Selection of coma for separator     \sisetup{detect-all}% Complement to Si units, aligning format of numbers with text     \sisetup{exponent-product=\cdot}     \newcommand{\tol}[3]{\ensuremath{\si{#1}^{\thinspace+\num{#2}}_{-\num{#3}}}} %Formula for tolerancing     % End special options for SI units and tolerancing---------------------------------     % Font option selection-------------------------     \renewcommand{\familydefault}{\sfdefault}%selecting default font (clone of helvetica)     %\renewcommand{\familydefault}{phv}\selectfont %selecting default font (helvetica)     % End font option selection--------------     % [END DEFINITION OF GLOBAL CONFIGURATION AND VARIABLES  ]----------------------------     %------------------------------------------------------------------------------------     \begin{document}     \begin{table}[H]     \noindent \begin{center}     \caption{\label{Fluids}Fluids}     \begin{tabular}{|l|c|c|S|S|c|}     \hline     Fluid&Fluid \#&Immersion&{Fluid}&{Stowing}& Number\\     Category&per&Duration&{temperature} &{temperature}&of\\ &MIL-XXX&(minutes)&{(\si{\degreeCelsius})}&{(\si{\degreeCelsius})}&cycles\\     \hline\hline     Fluid type 1 &2&\phantom{1} \tol{5}{2}{0}&25&85&4\\      Mineral hydraulic fluid&5&\tol{15}{5}{0}&80&100&6\\     Synthetic hydraulic fluid&3&\tol{15}{5}{0}&85&100&5\\      Mineral lubricant&7&\tol{15}{5}{0}&120&125&6\\     Cooling fluid&19&\tol{15}{5}{0}&50&25&5\\      \hline     \end {tabular}      \end{center}      \end{table}          \end{document}


title: add vdots to a listing without breaking the box

text: I have a problem when I try to add `\vdots` in an escaped string inside of a `listing` environment. The box is cut. How can I avoid the break of the box? The code is this:               \lstset{language=[Sharp]C,,basicstyle=\footnotesize, showspaces=false,showtabs=false,,breaklines=true,showstringspaces=false,breakatwhitespace=true,frame=trBL, escapeinside={(*@}{@*)}}     \begin{lstlisting}             private void Form1_Load(object sender, EventArgs e)             {                 XDocument doc = XDocument.Load("XMLFile1.xml");                 textBox1.Text = doc.Descendants("dos").Single().Value.Replace("\n","\r\n");                 int val = textBox1.Lines.Count();                 (*@{\center\vdots}@*)                 XmlDocument doc2 = new XmlDocument();                 doc2.Load("XMLFile1.xml");                 textBox2.Text = doc2.GetElementsByTagName("dos")[0].InnerText;             }     \end{lstlisting}


title: Adding a caption to graphics in parshape

text: This question is the continuation of the one posted here. How can I add a caption to the figures as shown below? ![enter image description here](http://i.stack.imgur.com/XT3ii.png)


title: How can one pass the contents of a LaTeX environment to a macro?

text: I'm working on an exam document class where the user enters in questions something like this:               \multiplechoice{Question}     {Answer #1}     {Answer #2}     {Answer #3}     {Answer #4}     {Correct answer}     {Explanation}      I'd like to process this information in various ways in one LaTeX run (to create an answer sheet, key, and the test itself), so the questions need to be stored in a macro. The awkwardness comes when one defines:               \newcommand{\sectionA}[1]{\newcommand{\putsectionA}{#1}}      and then asks the user to put 15 questions as an argument to \sectionA. I'd much rather have those questions be the contents of an environment, like so:               \begin{sectionA}     lots of questions     \end{sectionA}      Mostly because I find it much easier to keep track of environment declarations than curly brackets. Is it possible to have the contents of an environment get packaged up into a macro? Edit: The solution would seem to be to us the `environ` package, but it doesn't seem to be working. Here's what I'm trying:               \documentclass{article}     \usepackage{environ}     \NewEnviron{foo}{\edef\foot{\BODY}}     \begin{document}     \begin{foo}       Store This     \end{foo}     \foot     \end{document}      However when running this code `\foot` remains undefined. It actually seems impossible to define any macro using `environ`. Even when not using `\BODY`. For example, replacing the definition above with               \NewEnviron{foo}{\newcommand{\foot}{Print me}}      still fails. I've also tried `\Collect@Body` from the `environ` package with similar results. Does `\NewEnvrion` somehow prohibit defining new commands?


title: macro for custom indexing with conditionals and text recognition

text: I was unable to solve this by myself and by searching this wonderful site. The problem is with indexing. I still consider myself as a LaTeX newbie :) **The situation:** - I'm working on an english book about programming (300+ pages). For this I'm using _makeidx_ and _varindex_ packages; they are awesome and work well. - In this book there are number of macros, like `\type{std:integer}`, `\var{variable}`, `\const{SIZE}`, `\kword{for}`, etc. They just provide correct text formatting, nothing magic. **What I want** - These macros I would like to use to index all those words for one- or two-level indexing. Some questions are at the end of this post. **What I did:** - I changed all macros (`\type{}`, `\const{}`, etc.) to the versions, which include also `\index{#1}`, which was quite simple. Here is the example:               \newcommand{\type}[1]{       \mbox{\texttt{#1}\index{#1}}     }      This gives me a simple index, and it is working well. However, in the Index I have very long lists of many variables, constants and types, all beginning with the same prefix, i.e. `cl::Source`, `cl::Program`, or `CL_xxx`, `CL_yyy`, etc. **My attempts:** I would like to make an index with main single word - cl:: and all words beginning with cl:: put as subitems under it. This can be done by hand, and much of editing, but I figured out the _xstring_ package, and `\StrBehind` function. So, I defined the macro in the following way:                \newcommand{\typei}[1]{%        \IfBeginWith{#1}{cl}{%          \IfBeginWith{#1}{cl::}            {\mbox{\texttt{#1}}\index{cl::!\StrBehind{#1}{cl::}}}            {\mbox{\texttt{#1}}\index{cl!#1}}        }{%        \IfBeginWith{#1}{CL}{%          \IfBeginWith{#1}{CL\_}           {\mbox{\texttt{#1}}\index{CL\_!\StrBehind{#1}{CL\_}}}           {\mbox{\texttt{#1}}\index{CL!#1}}        }%        {%        \mbox{\texttt{#1}}\I{#1}%        }%      }%     }      This (probably) is causing LaTeX error:               ! TeX capacity exceeded, sorry [input stack size=5000].     \reserved@a ->\def \reserved@a                                     *{\let \@xs@assign \@xs@expand@and@detokenize...     l.1127 ...nstructor of the type \typei{cl::Source}                                                        and then the source is pa...          !  ==> Fatal error occurred, no output PDF file produced!      So, I have a rather general **questions** :   1. How to define a macro which can index any word with given starting characters, which separates this start from the rest for two-level index? I mean the following: `\type{cl::Type}` will generate the effect like `\texttt{cl::Type}\index{cl::!Type}`. And preferably the macro will by default separate `cl::` from the rest, and should be working for any other word just like normal.   2. How to make such macros for different types of usage? I'd like rather to avoid typing all very similar macros for `\kword`, `\var`, `\const`, `\type`, `\func`, etc. - they are all quite similar, and differ only in typography. Maybe it is a way to write something like a macro for generating another macros?   3. The ideal solution will allow to index words with some predefined prefixes, like `std::`, `cl::`, or `CL_`... this would be very helpful. Indexing such a book is huge task and I'm a bit overhelmed. Using only `\index{}` command is messing the normal text also. The usage of _varindex_ package greatly improves the indexing by defining circular references and cross-references, which are very customizable. The whole package is a bit difficult to understand but has a great number of possibilities. Maybe there is some hacky way to made this simple? Sorry for such long post, I tried to make things as clear as possible. I count on your help, `*TeX` hackers! :) You are my only HOPE! :)


title: How to put some commands written by a software's codes into Latex beamer?

text: I prepared a program written in GAP's envirounment. I'd like to put them all in one of my beamer pages exactly as follows:               gap> z:=CyclicGroup(IsPermGroup,10);; n:=CyclicGroup(IsPermGroup,15);;          s:=DirectProduct( z, n );;          e:=Elements(s);;          r:=Filtered(e,t->Order(t)=10);;          Size(r);;      What can I do? I used `\text{}` to get the result as it is shown above but it's useless. Thanks for any help.


title: \includegraphics: a command in the optional argument

text: I want to pass some arguments to `\includegraphics` via a command, but I can't get it working as I would expect. My M(n)WE:               \documentclass{article}     \usepackage{graphicx}     \begin{document}          \newcommand{\widthText}{,width=3cm}     \includegraphics[scale=0.5 \widthText]{picture}          \end{document}      I guess that the point would be to expand `\widthText` before... In my actual code, the command `\widthText` is actually either the one given above, or empty, depending on some boolean, and I have also a `\heightText` to set the height.


title: error when using tcolorbox + listings for multipage source

text: I'm try to highlight source code with colored background, but I face a bit error. ![using listings](http://i.stack.imgur.com/rHdIr.png) ![enter image description here](http://i.stack.imgur.com/CVKf7.png) first image is created with listings only and that is what I need. You can see on the last image that `basicstyle` is not applied (still has black text color). this is the tcolorbox + listings code (to generate the last image).               \documentclass{article}          \usepackage{xcolor}     \usepackage{tcolorbox}     \tcbuselibrary         {             breakable,             listings         }          \lstset{%       language=[LaTeX]{TeX}     }          \begin{document}              \begin{tcblisting}             {                 listing only,                 left                        = 3em,                 boxrule                     = 0.1mm,                 breakable,                 parbox                      = true,                 colback                     = gray,                 colframe                    = black,                 listing options             =                      {                         basicstyle          = \normalsize\ttfamily\color{white},                         keywordstyle        = \color{white},                         stringstyle         = \color{green},                         identifierstyle     = \color{yellow},                         commentstyle        = \color{black},                         numbers             = left,                         numbersep           = 1em,                         columns             = fullflexible,                         breaklines          = true,                         breakindent         = 0pt,                         tabsize             = 3,                         showstringspaces    = false,                         numberstyle         = \small\color{white},                     },             }     \documentclass{article}          \usepackage{xcolor}          \lstset{%         language=[LaTeX]{TeX},         basicstyle          = \normalsize\ttfamily\color{white},         keywordstyle        = \color{white},         stringstyle         = \color{green},         identifierstyle     = \color{yellow},         commentstyle        = \color{black},         numbers             = left,         numbersep           = 1em,         columns             = fullflexible,         breaklines          = true,         breakindent         = 0pt,         tabsize             = 3,         showstringspaces    = false,         numberstyle         = \small\color{gray},         backgroundcolor     = \color{gray},     }          \begin{document}               Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida     mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.     Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus     et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra     metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus     eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium     quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean     faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-     abitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue     eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim     rutrum.          Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi     auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et,     tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna,     vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis. Suspendisse     ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et     magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna.     Nulla ullamcorper vestibulum turpis. Pellentesque cursus luctus mauris.                    \end{document}              \end{tcblisting}               \end{document}


title: \underset italicizes whatever in it

text: I'm trying to write a simple argmin equation. However `\underset` command italicizes whatever in it. Here is my code:               \begin{align}          \label{Eq:argmin}          &{x}={\arg\underset{p}{\rm min}}\{N_{clip}(\bar{\pmb{\rm x}})\}\\          &{\rm subject~to}~ {p}~ \epsilon~\Theta \nonumber          \end{align}      and here is the output ![enter image description here](http://i.stack.imgur.com/en1Zv.png) It is strange because I used the same code many times before and it was working properly. Only in this file I have that problem... Do you have a guess about the source of that error or any solution to get rid of it? Thank you in advance


title: How to avoid page break after \part entry in ToC with memoir

text: I am using the `memoir` class for a document with many chapters and parts. In the ToC sometimes there is a page break between the name of `\part` and the name of the next chapter.               Table of Contents          Part I     1. Chapter ........... 5     2. Chapter ........... 10     3. Chapter ........... 15          Part II      1. Chapter ........... 20     2. Chapter ........... 25     3. Chapter ........... 30          Part III     ‹page breaks here›      I tried to find out in the memoir documentation, but as a beginner I did not understand how to avoid the page breaking after a new part. As Steven explained to me here (look there for an example), I certainly have to use `needspace`, but I don't now how.


title: Path file appearing in an image when using includegraphics

text: I have the following code:               \begin{figure}[htp]     \centering     \includegraphics[]{home/me/Music/MSc/Thesis/genbank.png}     \caption{The growth of genbank}\label{fig:name}     \end{figure}      But a blank box appears with the path to the file. Why is this? Other questions on this site have had paths with special characters, and removing them has solved the problem. However, I don't have any special characters in mine. My packages list is:               \usepackage{booktabs}     \usepackage[english]{babel}     \usepackage{grffile}     \pagenumbering{roman}     \newcounter{qcounter}     \let\centering\relax     \usepackage{color, colortbl}     \definecolor{name}{system}{definition}     \definecolor{Gray}{gray}{0.9}     \definecolor{LightCyan}{rgb}{0.88,1,1}     \usepackage{caption}     \usepackage{tikz}     \usepackage{babel}     \usepackage{graphicx}     \usepackage{csquotes}     \usepackage{fancybox}     \MakeOuterQuote{"}     \usepackage[utf8]{inputenc}     \usepackage{amsmath, amsthm, amssymb}      What is the problem?


title: Placing equation numbers on the right

text: I am new to TeX and am using scribtex to write a maths paper. When I put the followng code, the equation number is automatically displayed on the left, instead of in the right as is usually done. What is the problem and how do I fix it? Thanks for your time.                \documentclass[12pt,oneside]{amsart}      \usepackage{amssymb}      \usepackage[T1]{fontenc}      \usepackage[utf8]{inputenc}      \begin{document}      Let us consider a spherical symmetric metric in curvature coordinates:      \begin{equation}       \label{metric}      ds^2=-e^\lambda dr^2-r^2(d\theta^2+\sin^2\theta d\phi^2)+e^\nu dt^2      \end{equation}      \end{document}      The output I get is: ![enter image description here](http://i.stack.imgur.com/sYef5.jpg)


title: LuaLatex and the "Oriental TeX Project" -- Scientific Arabic Typesetting

text: Does anybody know something about the future of Arabic typesetting with LaTeX or LuaLaTeX? Do they develop tools and mechanisms for scientific typesetting of Arabic text? In other words: is it still worth the effort to work with packages like ledmac, ledpar or ledarab (or whatever) to typeset Arabic texts? Or - because theses packages are still maintained - will they be adjusted to the new developments. (AFAIK the basic file structures of ledmac are from 2005...) What about the general implementation of Arabic into LaTeX and LuaLaTeX? If Khaled Hosny hadn't helped me, I'd still be unable to typeset Arabic text. I've been wondering about questions like these, since I've found this document (cf. chapter XIII) months ago but never any documentation nor news about progress or status or usability.


title: Is there a conflict between memoir and sidenotes?

text: I am attempting to use the `memoir` package in conjuction with the `sidenotes` package, but when I attempt to compile, I get the following error: `Option clash for package changepage` and compilation terminates. It seems that compilation terminates at `\newcounter{sidenote}` Is there something simple I'm missing that is causing this apparent conflict? When I switch to `article` or `book`, I have no issues.


title: Errors with \bibentry with bibliography style that puts macro in bbl file

text: The following example works fine. However, if `\bibliographystle{plainnat}` is replaced by `\bibliographystle{te}`, where `te.bst` is the style available at http://econtheory.org/technical/te.bst, then two errors are generated: "Undefined control sequence. Hotelling, Harold (1929), \enquote ..." and "Undefined control sequence. ...ding, Massachusetts. \bibAnnoteFile ...". The problem seems to be that `\enquote` and `\bibAnnoteFile` are needed to format the reference, but are not supplied in time. (The bibliographystyle puts their definitions in the bbl file.) Is there a simple solution?               \begin{filecontents}{mytestbib.bib}     @article{HotellingEJ1929,       author = {Hotelling, Harold},       title = {Stability in competiton},       journal = {Economic Journal},       year = {1929},       volume = {39},       pages = {41-57}     }          \end{filecontents}     \documentclass{article}     \usepackage{filecontents}     \usepackage{natbib}     \usepackage{bibentry}          \begin{document}          \nobibliography{mytestbib}          A full in-text cite of \bibentry{HotellingEJ1929}.          A regular citation of \cite{HotellingEJ1929}.          \bibliographystyle{plainnat}          \end{document}