title: Label of figure in a for loop

text: I am adding figures to my TeX file using the following code:               \foreach \paramA in {a,b,c}     {     \foreach \paramB in {1,2,3}     {     \begin{figure}     \addOneImage{pathToImage/imageName_\paramA_batch\paramB.png}     \end{figure}\label{fig:imageName_\paramA_batch\paramB}     }     }      The figures are added with an increasing index next to the `Figure` caption (e.g. `Figure 1.1`,`Figure 1.2`, etc). I use `\ref` to reference the images in the following manner:               \ref{fig:imageName_a_batch1}     ...     \ref{fig:imageName_c_batch3}      The problem is that when compiling the PDF file, all the figure numbers in the reference appears the same (e.g., `1.1`)! although when pressing the reference link it refers to the correct figure. Have someone encountered this problem before? How do I fix this problem? (I have many images added to the document in many places and for loops makes the code bearable. I do not want to copy-paste it).


title: Include custom file into header with org-mode

text: I have a LaTeX file with some directives for my TeX documents (`\usepackage` and such things). Now I want to reuse this file in different org-mode files. I know I can include files with `#+include: 'path/to/some/file.tex'`, but this puts the content of the file after `\begin{document}`. Can I somehow include a file into the header? As suggested, here an example: A **template.tex** file that holds the header:               \documentclass[a4paper]{customClass}     \usepackage{etex}     \title{Some Title}     \supervisor{Someone}      As also shown here, this uses a custom document class, which is one of the reasons why I just want to be able to include it. Then I have a file which contains all the content ( **content.org** ):               #+INCLUDE: template.tex          * Chapter 1     ** Subchapter 1        Some content     ** Subchapter 2        More content      Which currently outputs ( **content.tex** ):               \documentclass[11pt]{article}     \usepackage[latin1]{inputenc}     % a lot more org-mode standard header stuff     % ...          \begin{document}          \maketitle          \setcounter{tocdepth}{3}     \tableofcontents     \vspace*{1cm}          % my template.tex file     % not where I wanted it     \documentclass[a4paper]{customClass}     \usepackage{etex}     \title{Some Title}     \supervisor{Someone}               \section{Chapter 1}     % rest of the document     % ...          \end{document}      So in short: I want to reuse my `template.tex` file in a few org documents to have consistent formatting. Is this possible?


title: PGFPLOT Externalization not working

text: I am trying to externalize PGF Plot to be saved as EPS file using latex and enabled shell-escape.                   \documentclass[a4paper]{article}         \usepackage{lipsum}         \usepackage{tikz}         \usepackage{pgfplots}         \usepgfplotslibrary{external}         \tikzexternalize%[prefix=fig/]         \tikzset{external/system call={latex -shell-escape -interaction=nonstopmode -jobname="\image" "\texsource" ; dvips -o "\image".ps "\image".dvi ; ps2eps -f "\image".ps && mv "\image".eps "\image"}}               \pgfplotsset{ compat=1.8,  tick label style={font=\small},  label style={font=\small}, legend style={font=\footnotesize}}         \tikzexternalize[prefix=fig/]          \title{\LaTeX\ plots with \texttt{tikz} and \texttt{pgfplots}}         \author{Roel Van Beeumen}         \date{April 17, 2012}              \begin{document}         %\tikzsetnextfilename{filename}         \tikzset{external/force remake}         \maketitle                   % == A first plot ======================================== %         \section{A first plot}              \lipsum[1]         \begin{figure}[h]         \centering         % -------------------------------------------------------- %         \begin{tikzpicture}         \begin{axis}[xlabel=$x$,ylabel=$\sqrt{|x|}$, axis x line=bottom,axis y line=left, ymax=2.1,xmax=4.4]         \addplot[blue,mark=none,domain=-4:4,samples=201] {sqrt(abs(x))};         \end{axis}         \end{tikzpicture}         % -------------------------------------------------------- %         \end{figure}         \lipsum[2]                        % == A second plot ======================================= %         \section{A second plot}              \lipsum[3]         \begin{figure}[h]         \centering         % -------------------------------------------------------- %         \begin{tikzpicture}         \begin{loglogaxis}[xlabel=Dof,ylabel=Error,width=\textwidth]         \addplot file{datafile1a.dat};         \addplot file{datafile1b.dat};         \legend{Case 1,Case 2}         \end{loglogaxis}         \end{tikzpicture}         % -------------------------------------------------------- %         \end{figure}         \lipsum[4-5]                        % == A third plot ======================================== %         \section{A third plot}              \lipsum[6]         \begin{figure}[hbtp]         \centering         % -------------------------------------------------------- %         \begin{tikzpicture}         \begin{loglogaxis}[xlabel=Dof,ylabel=Error,width=\textwidth]         \addplot table[x=dof1,y=error1] {datafile2.dat};         \addplot table[x=dof2,y=error2] {datafile2.dat};         \legend{Case 1,Case 2}         \end{loglogaxis}         \end{tikzpicture}         % -------------------------------------------------------- %         \end{figure}         \lipsum[7]                   \end{document}        However, on executing this with latex -shell-escape in Linux Mint 16 with TeX Live 2013, I get the following error for each plot. **! Package tikz Error: Sorry, the system call 'latex -shell-escape -interaction= nonstopmode -jobname="untitled-1-figure2" "\def\tikzexternalrealjob{untitled-1} \input{untitled-1}" ; dvips -o "untitled-1-figure2".ps "untitled-1-figure2".dvi ; ps2eps -f "untitled-1-figure2".ps && mv "untitled-1-figure2".eps "untitled-1 -figure2"' did NOT result in a usable output file 'untitled-1-figure2' (expecte d one of epsi:eps:ps). Please verify that you have enabled system calls. For pd flatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'untitled-1-figure2.log'. If you continue now, I'll try to typeset the picture.** However, if I just press **Return** key, it generates EPS files successfully. I tried a lot of trials, but no luck. Please help me.


title: microtype package (v.2.5 beta 06) and footnote protrusion

text: According to section 6 of `microtype` manual (v.2.5 from 2011/02/07, p. 23) the code below should set custom protrusion for footnote numbers. However, when `\microtypecontext` command is set, it cancels footnote mark completely. I run lualatex (beta-0.70.1-2011061410), but it isn't important if you're using pdflatex or xelatex, the result is same. Ideas? Here's a MWE:               \documentclass{article}          \usepackage{geometry}     \geometry{a5paper,showframe}          \usepackage[protrusion=true,factor=2000]{microtype}          \makeatletter          \SetProtrusion[context=footnote]%         {font=*/*/*/*/scriptsize}% adapt if necessary; "footnotesize" corrected to "scriptsize" after Werner's note         {1={,650},%         2={,400},%         3={,400},%         4={,400},%         5={,400},%         6={,400},%         7={,500},%         8={,400},%         9={,400},%         0={,400}}          \newcommand*\new@makefnmark{\hbox{\@textsuperscript{\normalfont         \microtypecontext{protrusion=footnote}\@thefnmark}}}     \renewcommand*\@footnotemark{%         \leavevmode \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi         \new@makefnmark \ifhmode\spacefactor\@x@sf\fi \relax}          \makeatother          %\setcounter{footnote}{123}          \begin{document}          Here's some text to show the behaviour of footnote marker at%     %     \footnote{A footnote}     %     the end of a line, which disappears when the code for setting microtypecontext is used in fnmark redefinition.          \end{document}      Note that the version of microtype package is 2.5 beta 06 which supports xelatex and tracking feature for lualatex. The same question asked at comp.text.tex. I'll sync them if necessary. * * * **UPDATE** : Robert made couple of replies at comp.text.tex and solved most of problems regarding this issue by updating the package (microtype beta is now 2.5 beta 08). The only one that still remains is that numbers throughout a document (not only footnotes) are always lining nums, meaning `Lowercase` and `Proportional` options to `fontspec` get ignored, so text figures cannot be used in normal fashion. With `Renderer=Basic` option to `fontspec`, `Numbers=Lowercase` option gets applied, but `Numbers=Proportional` still does not.


title: Chapter number and chapter title in one line

text: This is what I want: > Chapter 1 : Introduction but I always get: > Chapter 1 > > Introduction How do I do this?


title: Adding empty pages to fill up a book page quota

text: I am writing a book and have already made contract for _x_ pages with the printing company, so I want to create a PDF containing _x_ pages. However, say that I only have material enough to fill _x − y_ pages. Is there some package or simple hack available for adding _y_ empty pages at the end of the document? I.e. I want to add empty pages until the latest added page is page number _x_.


title: Glossary backlink points to wrong page

text: The gloassary I am displaying keeps a backlink to the page, where the entry was used. It correctly says page 3, but the link jumpgs to the 3rd page from the beginning, instead to the 3rd page with arabic pagenumbering. What am I missing here? To reproduce: 1. Build this thing 2. Go to glossary and click the pagenumber 3. Find yourself looking at the 3rd page.                   \documentclass[10pt,a4paper,headsepline,footsepline,DIV13,BCOR12mm]{scrbook}         \usepackage[english,ngerman]{babel}         \usepackage[T1]{fontenc}         \usepackage[latin1]{inputenc}         \usepackage{scrpage2}         \pagestyle{scrheadings}         \usepackage{graphicx}         \usepackage{hyperref}         \usepackage[toc,numberedsection]{glossaries}         \makeglossaries         \newacronym{fap}{FAP}{Fundamental Architectural Principles}              \begin{document}              \selectlanguage{ngerman}         \thispagestyle{empty}              \begin{table}[h]         \centering         \begin{tabular}{ccc}         \hspace{0.7cm} &         \end{tabular}         \end{table}              \vspace{8mm}         \begin{center}         {\Large         {\bfseries \scshape Institut Software \&  Engineering}\\          6a \hspace{0.25cm} D- \\         }         \end{center}              \vspace{1cm}         %title         \begin{center}         {\Huge \bfseries asd  \\[2mm] in   \\[5mm] asdasd }         \end{center}              \vspace{1.5cm}         %author         \begin{center}         {\Large Christian Vaas}         \end{center}              \vspace{1cm}         \begin{center}         {\Large \bfseries Masterarbeit  Software Engineering}         \end{center}              \vspace{1cm}         \begin{center}         \includegraphics[width=.4\linewidth]{img/logos/LogoSEengl}         \end{center}              \newpage         \thispagestyle{empty}         \mbox{}         \newpage         \thispagestyle{empty}              \begin{table}[h]         \centering         \begin{tabular}{ccc}         \hspace{0.7cm} &         \end{tabular}         \end{table}              \vspace{1cm}         \begin{center}         {\Large         {\bfseries \scshape Institut Software \& Systems Engineering}\\          6a \hspace{0.25cm} D- \\         }         \end{center}              \vspace{2.5cm}         %title         \begin{center}         {\Huge \bfseries  Patterns \\[2mm] in   \\[5mm]  Architectures}         \end{center}              \vspace{1cm}         %author         \begin{center}         \begin{table}[h]         \centering         \begin{tabular}{ll}         Matrikelnummer: &  \\         Beginn der Arbeit: & XX.\ XXXX 20XX \\          Abgabe der Arbeit: & XX.\ XXXX 20XX \\         Erstgutachter: & Prof.\ Dr.\   \\         Zweitgutachter: & Prof.\ Dr.\ YYY YYYYYY \\         Betreuer: &  S.  \\         \end{tabular}         \end{table}         \end{center}              \vspace{1.25cm}              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%         %%% Statement-Page         \newpage         \thispagestyle{empty}         \mbox{}         \newpage         \thispagestyle{empty}              \centerline{\bfseries ERKLAERUNG}              \vspace{5cm}         Hiermit versichere ich, dass ich diese Masterarbeit selbstaendig verfasst habe.         Ich habe dazu keine anderen als die angegebenen Quellen und Hilfsmittel         verwendet.              \vspace{1cm}         \begin{flushleft}         %select german for formatting the date         \selectlanguage{ngerman}         Augsburg, den \today \hfill ZZZ ZZZZZZ         \end{flushleft}              \newpage         \thispagestyle{empty}         \mbox{}                   \newpage              %select english as language!         \selectlanguage{english}              \vspace*{1cm}         \section*{\centering Abstract}         \vspace{1cm}              \paragraph*{CONTEXT}              \pagenumbering{roman}              \tableofcontents         \newpage         \listoffigures         \newpage         \listoftables              \pagenumbering{arabic}              \chapter{Introduction}         \section{Motivation/Challenges}         \section{Approach}         Blubber \gls{fap}              \printglossaries              \end{document}


title: Text color with hyperref package

text: I wanted to use the hyperref package and I looked for help and I found a lot of solutions. However, I used this option that look great, as I could control the colors.               \documentclass[12pt,a4paper]{article}     \usepackage{hyperref}     \hypersetup{       colorlinks   = true, %Colours links instead of ugly boxes       urlcolor     = red, %Colour for external hyperlinks       linkcolor    = blue, %Colour of internal links       citecolor   = blue %Colour of citations, could be ``red''     }      After usuing the `\usepackage{hyperref}` I saw that the full text color changed from black to grey. I printed it to see if the problem is only in pdf format, but without `\usepackage{hyperref}` become darker than with `\usepackage{hyperref}` . How can I have the dark text and using `\usepackage{hyperref}`? here are the images (sorry for the text in portuguese): with `\usepackage{hyperref}` ![enter image description here](http://i.stack.imgur.com/rOMbC.png) ahd without `\usepackage{hyperref}` ![enter image description here](http://i.stack.imgur.com/9FPor.png) This is my MWE               \documentclass[12pt,a4paper]{article}     \usepackage[dvips]{graphicx}     \usepackage[portuges]{babel}     \usepackage[latin1]{inputenc}     \usepackage{verbatim}     \usepackage{natbib}     \usepackage{amssymb}     \usepackage{amsmath,amssymb,mathtools}     \usepackage{hyperref}     \hypersetup{       colorlinks   = true,        urlcolor     = blue,       linkcolor    = blue,        citecolor   = blue      }          \usepackage[nodisplayskipstretch]{setspace}     \setstretch{1.5}               \begin{document}               \section{Monetary and Fiscal Policy rules}\label{sec:policyrules}          \subsection{Introduction}\label{subsec:intro}          I must confess to not seeing a difference in blackness/grayness of the text across the two samples.     Mico you are right. these images do not show clearly the difference. But if you pay more attention you can see that the second one is darker than first. And in the printed version the difference is bigger      A part of the problem is that it's hard to compare the two samples on screen: on contains four lines but the other only three. Could you repost the second example, showing four lines as well?      Mico here you are. I edited the second image. i think now the difference is clearly.           hyperref does not change the main text color. Thus the effect is probably quite unrelated to this package. One reason can be the use of color. This can be tested with package color and textcolor without hyperref. Or there are transparencies (images, ...) involved. It is known, that AR uses a different rendering method then.           You should provide a fully compilable minimal working example that only contains the lines necessary to reproduce the problem. Then it is easier for others to help you.          Can be a font problem.          Yeah, there isn't much we can do until we have a full MWE that we can print ourselves and compare.               \citet{Taylor1993}            \citep{Zheng.etal2012, Froemmel.etal2011, Hayat.Mishra2010, Moura.Carvalho2010, Consolo.Favero2009}.            \citet{Svensson2000, Ball1999}           \citet{Taylor2002}           \begin{align}     \label{eq:regrapm}         i_{t}&= \mathcal{M}(\Omega_{t})+\epsilon^{\mathcal{M}}_{t} \\     \label{eq:regradesp}         G_{t}&= \mathcal{G}(\Omega_{t})+\epsilon^{\mathcal{G}}_{t} \\     \label{eq:regrarev}         R_{t}&= \mathcal{R}(\Omega_{t})+\epsilon^{\mathcal{R}}_{t}     \end{align}          \citet{Clarida.etal2000}, da seguinte forma:     \begin{equation}\label{eq:jurosequilibrio}         i^{\ast}=\mathfrak{m}_{0}+\mathfrak{m}_{1}\left(E\left[\pi_{t,k}|\Lambda_{t}\right]-\pi^{\ast}\right)+                         \mathfrak{m}_{2}E\left[y_{t,q}|\Lambda_{t}\right]+\mathfrak{m}_{3}E\left[X_{t}|\Lambda_{t}                  \right]     \end{equation}               \subsection{Conclusion} \label{subsec:conclusion}                    \bibliographystyle{mybibstylept}     \bibliography{thesisbiblio}               \end{document}


title: svjour3: h/v centering text on a4paper?

text: I am preparing a manuscript using svjour3. I would like to have the text (dimensions unchanged!) simply centred on a4paper rather than aligned to the top-right corner, given that svjour3 in all but twocolumn mode assumes some a5'ish page geometry. I am using an excerpt from ftp://ftp.springer.de/pub/tex/latex/svjour3/global/template.tex.               \RequirePackage{fix-cm}     \documentclass[smallextended]{svjour3}%ftp://ftp.springer.de/pub/tex/latex/svjour3/global/svjour3.cls     \smartqed     \usepackage{blindtext}     \begin{document}     \title{Insert your title here}     \author{First Author}     \institute{F. Author \at                   first address \\                   Tel.: +123-45-678910\\                   Fax: +123-45-678910\\                   \email{fauthor@example.com}}     \maketitle     \begin{abstract}     \blindtext     \keywords{First keyword \and Second keyword \and More}     \end{abstract}     \section{Introduction}     \blindtext     \section{Section title}     \blindtext     \end{document}      I am aware of a previous question, but I don't want the margins to be simply balanced, I want the text dimensions to remain unchanged and have the text body centred as-is on a4. I am also aware that this will be fixed for me in final editing, but I want to have it centred for my private purposes.


title: LaTeX - how do I force PDF page height/width?

text: I am attempting to finish my LaTeX project, and I can't seem to get the PDF to compile to the right size no matter what I do. In my .cls file I have this set:               \paperheight 11in     \paperwidth 8.5in      But no matter what I change it to, it compiles to about 8.25x11.7". I can post my .cls files or anything else for that matter if someone knows hat I am doing Here is my .cls file: usfmanus.cls \- I am using BakomaTex Word for my editor. When I compile my PDF, I am still getting strange dimensions. I really appreciate this, thank you.


title: Centering equation on a line

text: I am trying to center my equation on the line using this code:               \[          \ l_{12} =  \frac {m_{c} c_{c} \frac {dT_{c}}{dt} + m_{s} c_{s} \frac {dT_{s}}{dt}}{m_{s}} Delta t           \]      but I keep getting this error: `Missing $ inserted.` I tried adding $ but it's still not working.


title: \widetilde with Type 1 font

text: I am trying to use `\widetilde` with a custom font called LTL fonts http://theory.stanford.edu/~matteo/ltlfonts/ From its description: > The font is distributed in outline Type 1 format, with associated TeX (TFM), > Adobe (AFM), and Microsoft (PFM) font metrics. The thing is when I use `\widetilde{\LTLcircle}`, it appears like ![the tilde is too low](http://i.stack.imgur.com/eYekd.png) Apparently the tilde is too close to the circle, and I would like to raise it a bit. I found a related question about how to lower the tilde, unfortunately I can't find the way to "raise" it.


title: Prevent biblatex from printing a header

text: When using `biblatex` together with `myheadings`, `biblatex` adds a header `REFERENCES` on the pages where the bibliography is. How do I prevent that? ![enter image description here](http://i.stack.imgur.com/toiUS.png)               \documentclass{article}     \pagestyle{myheadings} % page numbers in top right corner     \usepackage{fontspec,xunicode,xltxtra} % XeLaTeX     \defaultfontfeatures{Mapping=tex-text} % support TeX conventions like ``--''     \setmainfont{Linux Libertine O}      \usepackage{csquotes}     \usepackage[style = authoryear, backend = biber]{biblatex}     \addbibresource[location = local]{test.bib}          \begin{document}          I want to cite \cite{brunner1965}          \printbibliography          \end{document}      My .bib file:               @PREAMBLE{         "\newcommand{\aumlaut}{\char"00E4}" #         "\newcommand{\uumlaut}{\char"00FC}"             }          @BOOK{brunner1965,         AUTHOR = "Karl Brunner",         TITLE = "Altenglische {G}rammatik",         YEAR = "1965",         ADDENDUM = "{N}ach der angels{\aumlaut}chsischen {G}rammatik von {E}duard {S}ievers",         EDITION = "Dritte, neubearbeitete {A}uflage",         LANGUAGE = "German",         LOCATION = "T{\uumlaut}bingen",         NUMBER = "3",         PAGETOTAL = "x + 436",         PUBLISHER = "Max Niemeyer",         SERIES = "{S}ammlung kurzer {G}rammatiken germanischer {D}ialekte. {A}. {H}auptreihe"}


title: Drawing timeline

text: I have a dataset which consists of repeating events over time. Each event takes an arbitrary amount of time. I could plot this using `gnuplot` but am unable to produce correct keys because of the hackish nature of script. I had to manually draw legends. The plot looks like this: ![timeline via gnuplot](http://i.stack.imgur.com/IjoFv.png) Could I do something like this via TikZ or some other graphing tool? My dataset looks as follows:               running 20     stage-out 47     running 34     stage-in 3     running 24     stage-out 39     ...      As shown above, the file is a two-column text where the first column represents event name and the second column the time interval for that event.


title: number separator formatting with ragged right positioning using siunitx, R, Hmisc::latex

text: I found Boris's suggestion to use `siunitx` to achieve number formatting in `Hmisc::latex` tables to almost be exactly what I was looking for: R, Sweave, Hmisc: pretty-print numbers However, if you look closely at the table, the number columns line up poorly with the column labels. This is worse when using multicolumn labels (e.g., cgroup). In looking at the documentation (page 15, table 9) for siunitx, I think this is because it is centering the numbers at the decimal point. Is it possible to use the number formatting functions of `siunitx` but justify the columns as `\raggedleft` (right aligned) within a call to `Hmisc::latex`?


title: How to automate vfill on last paragraph before a page break in case of underfull vbox

text: > **Possible Duplicate:**   >  \flushbottom vs \raggedbottom I have my Thesis with nearly 200 pages. I have encountered many underfull vbox problems due to the high of equation-to-text ratio. LaTeX likes to space out paragraphs in underful vbox scenarios, leading to some paragraphs being awkwardly at the bottom, see the screenshot attached. ![The need of vfill](http://i.stack.imgur.com/0zHNM.png) By affixing `/vfill` at the end of that paragraph, I can move the awkward stretch to the bottom of the page, which is much less noticeable to the eye. How does one normally deal with this, such as something like flush top? Is there a way to automate adding `/vfill` to the every last paragraph before page breaks or do I have to do it manually?


title: Is it possible to remove (or otherwise nullify) a whatsit node from a box?

text: I am aware that it is not generally possible to modify the contents of a box (as per http://tex.stackexchange.com/a/49903/17427), though I believe it is sometimes possible to "unbox" material and hack away at it (but not familiar with that). However, my interest at the moment lies in **removing (or disabling) a`\write` node from a box**, which would not affect how it appears etc. The motivation for this is primarily as per my "answer" here regarding the way `beamer` puts a shrunk copy of slides in the notes pages and the resulting multiply defined labels it causes. For the purposes of the MWE, suppose I am creating a box that contains a `\label`, but I want to show that box twice, once with the `\label` taking effect and later without, and I want to prevent the multiple labels issue without subverting other features of the labelling mechanism in general, and without collecting the raw code in the box and processing it twice. I'm sure this is possible with LuaTeX, and I'm interested in solutions both with and without LuaTeX (hence I haven't tagged this as {luatex}). MWE to play with:               \documentclass{article}     \tracingonline2     \showboxdepth\maxdimen     \showboxbreadth\maxdimen          \newbox\boxa     \newbox\boxb          \newcommand{\showtwo}[2]{\showtokens{^^J^^J#1, #2^^J^^J}}     \begin{document}     \section{Hello}          {     \setbox\boxa\hbox{abc\label{hi}def}     \showbox\boxa     \setbox\boxb=\copy\boxa     \box\boxa          \let\write\showtwo     % edit \boxb somehow     \showbox\boxb     \box\boxb          }          \end{document}      The approach I've tried to take at the moment is not to delete the node from the box (as I have no idea where to start), but rather to add an extra layer of indirection to the `\write` before it goes in the box via `\latelua`, and then I should theoretically be able to change the behaviour of the indirection layer without editing the box. This may not be a good idea in general (thoughts?), but it shows I've made some effort! However, according to the manual, "the result of using `tex.print` from inside callbacks is undefined", and I am not sure if `\latelua` is considered a callback. In any case, the only things I've managed to do from a `\latelua` without my commands being silently ignored are `tex.error` and `tex.sprint([[\noexpand\undefinedcs]])`, and certainly nothing like `tex.sprint([[\unexpanded{\immediate\write\@auxout{...}}]])`. Lua indirection attempt (but note my label isn't written to the `aux` file before I disable writing):               \documentclass{article}     \tracingonline2     \showboxdepth\maxdimen     \showboxbreadth\maxdimen          \newbox\boxa     \newbox\boxb          \directlua{tex.enableprimitives('',tex.extraprimitives())}     \setcounter{errorcontextlines}{\maxdimen}          \usepackage{etoolbox}     \makeatletter     \patchcmd{\label}{\protected@write}{\protected@labelwrite}{}{\showtokens{patching \label failed}}     \let\protected@labelwrite\protected@write     \patchcmd{\protected@labelwrite}{\write#1}{\latelabelwritehelper{#1}}{}{\showtokens{patching \protected@labelwrite failed}}          \newcommand*{\latelabelwritehelper}[2]{%         \latelua{tex.sprint([[\noexpand\latelabelwrite{#1}{#2}]])}}     \newcommand*{\latelabelwrite}[2]{\immediate\write#1{#2}}     \newcommand*{\disablelatelabelwrite}{\let\latelabelwrite\@gobbletwo}     \makeatother          \begin{document}          \section{Hello}          \setbox\boxa\hbox{abc\label{hi}def}     \showbox\boxa     \setbox\boxb=\copy\boxa     \box\boxa          \disablelatelabelwrite     \showbox\boxb     \box\boxb          \end{document}      (Note also that this is my first real attempt to do something in Lua!)


title: Is there a way to \label each page in an included pdf file?

text: I am including a PDF file as part of my reports appendices. The PDF file does not have page numbers, these are added using `pagecommand=\thispagestyle{plain}` which continues the LaTeX page numbering.               \usepackage{pdfpages}     \includepdf[pages=-, pagecommand=\thispagestyle{plain}]{file.pdf}      How would I make it possible to refer to each PDF page using `\pageref{}` in the rest of my report?


title: Comparing an argument to a string when argument is a result of a command with etoolbox

text: I've got an example like that:               \documentclass{article}          \usepackage{etoolbox}          \newcommand{\ab}{a}          \newcommand{\aORb}[1]{%             \ifstrequal{#1}{a}{"a" was given}{not a}, %             \ifstrequal{#1}{b}{"b" was given}{not b}%     }          \begin{document}      begin               \aORb{\ab{}}           end     \end{document}      And the output of that code is:               begin     not a, not b     end      However, if I put simply "a" or "b" as an argument to `\aORb` instead of `\ab{}` then it works fine. Is there another command in `etoolbox` package that will allow me to do such a comparison correctly?


title: Horizontal rule between lines that vertically takes up only its height and that doesn't close up to surrounding ascenders/descenders

text: I would like a command `\lineseprule` that appears as a horizontal line of customizable width. It should neither take up a full line's height (`\linesepruleA` below) nor close up the lines above and below (in a way that ascender and descender height affect the spacing between the surrounding lines; `\linesepruleB` below). Instead it should simply insert between the lines, as if it were its own very thin line. ![illustration with shopping list](http://i.stack.imgur.com/gfEPW.png) The vertical spacing for `\linesepB` depends on ascenders and descenders: ![dependence on ascenders and descenders](http://i.stack.imgur.com/1wcOn.png)               \documentclass{article}     \usepackage{chancery}          \parindent0pt % disablement of paragraph indentation          \newcommand*{\linesepruleA}[1]{\par \rule{#1}{.4pt}\par}     \newcommand*{\linesepruleB}[1]{\par \hrule width#1 height.4pt}               \begin{document}          {\large\underline{Shopping list}}     \bigskip          toilet paper \par     kitchen rolls \par     detergent \par     \linesepruleA{4em} % too high     toothbrush \par     toothpaste \par     \linesepruleB{4em} % see below     milk \par     cereals \par               \vspace{2\baselineskip}          \hrulefill\par     {\small\verb|The vertical spacing for \linesepruleB depends on ascenders and descenders:|}          \medskip          a \par     \linesepruleB{4em} % much too close     o \par          \medskip          g \par     \linesepruleB{4em} % still too close     b \par          \end{document}      * * * **A clarification:** I was making an assumption about lines having specific top and bottom boundaries. A meaningful interpretation of my question is: (1) Either pick a meaningful placement (e.g., place the horizontal rule in the middle of "half-x-height above the first row's baseline" and "half-x-height above the second row's baseline" or (2) let the user customize it with a parameter that lets the user pick something like the vertical distance below the first row's baseline or the vertical deviation from the default described in (1) above. **Addendum to clarification:** Martin Scharrer tells us that `\ht\strutbox` and `\dp\strutbox` are `.7\baselineskip` and `.3\baselineskip`, respectively. (Steven B. Segletes has written a solution covering all I had in mind, using the default of `.7\baselineskip` above the lower line's baseline.)


title: How to create a symbol that is alike for indices around empty {}?

text: How can I create the symbol shown below so that it be insertable as letter into text in LaTeX? ![enter image description here](http://i.stack.imgur.com/3XhWh.png) I found it in a book and I tried to reverse engineer it, but I failed:               % does not compile {}[\bf{п}]^(\bf{п}){}[\bf{м}]^(\bf{у})     % does not compile {}^{\bf{п}}_{\bf{п}}\mathbf{C}^{\bf{м}}_{\bf{у}}


title: Numbering multiple paragraphs at once

text: I am drawing up a document that has numbered paragraphs. 1-36 are numbered normally and I have no problems. However, on paragraph 37, I need something like: > 35 Normal paragraph. > > 36 Normal paragraph. > > 37-46 The following paragraphs correspond to text text text text, text text. > > 47 Normal paragraph. I'm numbering my paragraphs using:               \newcounter{xpar}     \setcounter{xpar}{1}     \newcommand{\xp}{\arabic{xpar}\stepcounter{xpar}.\hspace{.5in}}      Can anyone help me figure out how to number the paragraph with a 37-46, and then continue on with 47?


title: Customize appendix entries in ToC and pdf bookmarks

text: > **Possible Duplicate:**   >  How to make appendices behave like sections in ToC Consider the minimal example below. How can I achieve that in the appendix part (only there!) of the ToC paragraphs are aligned with sections? Paragraphs should also figure as sections in the pdf bookmarks! EDIT: Added hyperref.               \documentclass[10pt, a4paper]{report}          \usepackage[titletoc]{appendix}     \usepackage{hyperref}          \begin{document}          \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{4}        \tableofcontents          \chapter{XXX}     \section{YYY}     \subsection{WER}     \subsubsection{ABC}     \subsubsection{DEF}     \subsection{ZTR}     \subsubsection{OIU}     \subsubsection{OIZ}     \subsubsection{POI}     \paragraph{tzu}     \paragraph{rfv}     \begin{appendices}     \makeatletter     \def\chaptermark#1{\markboth{\MakeUppercase{\@chapapp. \  #1}}{}}     \def\thechapter{}     \makeatother     \chapter{AAA}     \paragraph{abc}     \paragraph{def}     \paragraph{ghi}     \end{appendices}          \end{document}


title: enumerate item within an custom environment and mdframed

text: I'm trying to define a custom environment within mdframed for handling questions in a document. The reason for the question-solution structure is to enable parsing into other formats (html etc). The following code demonstrates my problem; the enumerate does not display properly in mdframed. I realise there have been related posts but I cannot find a solution to this.               \documentclass[12pt, a4paper]{article}          \usepackage{tikz,pgf}     \usetikzlibrary{shadows}     \usepackage[framemethod=tikz]{mdframed}          \newcounter{exercises}     \def\theexercise{\thesection.\arabic{exercises}}          \newenvironment{exercises1}     { \refstepcounter{exercises}       \begin{enumerate} }     { \end{enumerate}      }          \newenvironment{exercises_mdf}     { \refstepcounter{exercises}      \begin{mdframed}[backgroundcolor=black!10, frametitle={Exercise \theexercise}]     \begin{enumerate} }     { \end{enumerate}      \end{mdframed}      }          \newenvironment{question}{ \item } { }     \newenvironment{solution}{ \\ {\bf Solution:} \\ }{ }          \begin{document}          \begin{exercises1}     \begin{question} Q1      \begin{solution} S1 \end{solution}     \end{question}     \begin{question} Q2     \begin{solution} S1 \end{solution}     \end{question}     \end{exercises1}          \begin{exercises_mdf}     \begin{question} Q1      \begin{solution} S1 \end{solution}     \end{question}     \begin{question} Q2      \begin{solution} S2 \end{solution}     \end{question}     \end{exercises_mdf}          \end{document}


title: Suppressing error messages

text: I have a style sheet that has some problems. At this point I am just writing my paper and do not really care about \viiipt warnings and errors. So I need to press enter a million times to skip errors while my latex file is compiling . Is there any way to tell the compiler (Latex2Pdf) that I want to skip all the errors?


title: pgfplots: marker size relative to interval size

text: I am trying to create a `ybar interval` pgf plot with horizontal lines as markers on top of each interval/bar. Intervals widths are specified by my external CSV data file. I defined my own plotmark (just a `\draw (0,0) -- (1,0);`), which I am trying to scale in width for each interval I'm plotting. I have found this answer, where the author makes use of `\thisrow`, but in my case I get an error: > ! Package PGF Math Error: Unknown function > `thisrow_unavailable_load_table_directly' (in > 'thisrow_unavailable_load_table_directly'). The pgfplots documentation (p.56) mentions this error: > The argument hcolumn namei has to denote either an existing column or one > for which a column alias exists (see the manual of PgfplotsTable). If it > can't be resolved, the math parser yields an \Unknown function" error > message. **How do I fix/accomplish this?** My MWE:               \documentclass{standalone}          \usepackage{filecontents}     \usepackage{pgfplots, pgfplotstable}          \begin{document}     \begin{tikzpicture}     \pgfdeclareplotmark{hr}{         \draw (0,0) -- (1,0);     }          \begin{axis}[ymode=log,]     \addplot+[         ybar interval,         fill=cyan,         draw=none,         mark=hr,         scatter,         scatter src=explicit,         visualization depends on=\thisrow{width}\as\intvWidth,         scatter/@pre marker code/.append style={             /tikz/mark width=\intvWidth         },     ] table [         col sep=comma,         create on use/xaccum/.style={             create col/expr=\pgfmathaccuma+\prevrow{width}         },         x=xaccum, y=height,     ] {data.csv};     \end{axis}     \end{tikzpicture}     \end{document}      My CSV file looks like this:               height,width     1,884     2,5768     3,835     4,2661     5,492     6,1349     7,486     8,1117     9,498     10,854     10,0      And here's a rendering without widened markers (the blue specs above the cyan area are the markers now):   ![bad markers](http://i.stack.imgur.com/w9Ul9.png)


title: Continuous error messages despite positive results when checked with minimal working example!

text: I get following error messages, I ran several checks, but just can't figure out where they're comming from! I use MikTex 2.9 and Biber 1.7. These are the error messages:               Line255: File ended while scanning use of \field. <inserted text> \par \begin{document}     Line92: Illegal parameter number in definition of \NewCount. <to be read again>1 \begin{enumerate}     Line92: Undefined control sequence.<argument> \blx@bbl@data \begin{enumeLine256: Incomplete \iffalse; all text was ignored after line 92. <inserted text>\fi \include{PSA4_Deckblaetter}     Line256: Incomplete \iffalse; all text was ignored after line 92. <inserted text>\fi \include{PSA4_Deckblaetter}     Line259: Undefined control sequence. \ps@plain -> \let save@@mkboth\@mkboth\ps@save@plain\let\@mkboth....     Line1: Incomplete \iffalse; all text was ignored after line 259 <inserted text>\fi <> PSA4_Globalisation_Meta.tex The file ended while I was skipping conditional text.      When I run Biber I get this message:               Entity: line 1961: parser error : Extra content at the end of the document <bcf:section number="0"> ^      I compile frequently so I know exactly that everything worked fine until I wrote a new paragraph and included 8 new references. I use a meta `.tex` file and then include each chapter separately as an own `.tex`. What I did so far:   * Checked my `.bib` file for wrong symbols or the like. Found some "&" and took them out and deleted everything else that was suspicous.   * I ran a mininmal example using my meta file code and then ran a check on each chapter separately including ALL the references.    * Ran another test only with the new paragraph I worte and only the new references.    * I checked all `.tex` files for any overlooked `\iffalse`. (I had used it before to check something, but deleted it then (completely!)) and checked for lonely `\begin{enumerate}`. Everything works perfectly there! But if I run my original complete document I get these errors! I know you guys want minimal examples, but all my code, references and text works perfectly within a minimal example. So I don't know what else I need to provide you apart from the full file.


title: Insert a new line without \newline command

text: I'm searching for inser a new line just push the "enter" button on the keyboard. Is there a solution? This is the "boring" way:               \section{mySection}         My really really really long text.\newline         A new text line.      This is instead a shorter and really less boring way:               \section{mySection}         My really really really long text.              A new text line.      And this last solution is that i adopted, but if in a really long text it will create a lots of white space on the latex editor, and this is not really nice for me. Is there a way to create a new line just with the following code?               \section{mySection}         My really really really long text.         A new text line.


title: Deleting the numbering behind the Appendices in the TOC

text: I have a problem about Appendices. I want to delete the numbering behind the Appendices in the TOC while I want the Appendices pages to appear by default in the first page of each Appendix. In other words, I ONLY want to delete the numbering. I hope I be clear enough.


title: Proper use of cmap and mmap

text: I am curious about the differences between   * `\usepackage{cmap}`   * `\usepackage[resetfonts]{cmap}`   * `\usepackage{mmap}` (= `\usepackage[useTeX]{mmap}`)   * `\usepackage[noTeX]{mmap}` What are their precise differences? (I am not familiar with (La)TeX internals, so a beginner's explanation would be very helpful.) If this matters: I am using `\usepackage[T3,T1]{fontenc}` (with `T3` being necessitated by the `tipa`-package), which is important in my case (but might not be important for a fully general answer to this question). ((Also, I am assuming that each of these commands would need to be loaded _after_ loading package `fixltx2e` but _before_ loading packages `times` and `fontenc`. Is that right?)) **Update:** Kurt's starter code is great. I have uncommented the tipa-lines, saved the file in UTF-8 (and modified the input encoding line to `\usepackage[utf8]{inputenc}`, and went through all different cmap/mmap- options. However, I see no difference in the text that is pasted from the output pdf-file (perhaps because the MWE uses virtual fonts (by default?)?). Ideally, perhaps someone could help (both of us have tried a lot) to find a minimal example that shows five different output pasting behaviors when the only difference is whether no cmap/mmap or one of the 4 cmap/mmap options is loaded. Ideally that example would also specify the encoding the file is saved in to make this work (remember to not use a BOM for UTF-8; more importantly I don't know whether all input encodings lead to identical behavior (assuming correct escaping of accented characters in input encodings that don't offer a particular character)).


title: Problem compiling cases environment

text: I am trying to compile a simple `cases` example, but I'm having trouble with the tabular separator `&`. Here's my code:               \begin{equation}         f(x) =          \begin{cases}             x + 1 & \mbox{blabla} \\             x & \mbox{otherwise}         \end{cases}     \end{equation}      I am getting the following errors:               Misplaced alignment tab character &. x + 1 &          Misplaced alignment tab character &. x &      What could be wrong?


title: Pros and cons of the LaTeX3 syntax?

text: The programming language introduced by `expl3` in LaTeX3 is a bit unusual compared to other TeX macro languages in that it uses both _ and : for function names. Could someone provide some technical insight on the pros and cons of the syntax?


title: SOLVED: PDFLatex doesn't include bib properly on a 2nd system

text: I have encountered a weird pdflatex problem. Maybe you know a solution to this. I have a latex project on a server. When I compile this project + bibliography with               pdflatex project     bibtex project     pdflatex project     pdflatex project      Everything works fine. The last pdflatex properly includes all the bib-files, which were created before. But if I mount this server on my local computer over the network and run my local                pdflatex project      on all the files, pdflatex fails to include all the references - although they were correctly included, when I run pdflatex on the server. The funny thing is, that this had worked on a 2nd system (which I do not have anymore). Do you know why the local pdflatex does not include the bib-files created from the server (and why this had worked out fine with an older machine)? Edit: I forget to mention the pdflatex versions on the machines: Server (where it works): pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian) Local machine: pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) /edit2: Solved the problem, after trying several things. It seems, that it really was a latex version issue... I have to add [backend=bibtex] to \usepackage[backend=bibtex]{biblatex}.... It seems, that in my older latex installation, the bibtex backend was the default backend... The new installation expects files created with a biber backend, if no backend is further specified! Thx for your replies!!


title: ExSheets includequestions

text: I have a large file `database.tex` with a lot of questions and solutions in the format of the ExSheets package. If I include multiple questions with one `\includequestions` command, the questions are included in the order of there definition in `database.tex`. So there is no difference between the following two lines               \includequestions[IDs={q1,q2}]{database.tex}     \includequestions[IDs={q2,q1}]{database.tex}      If I want a specific order or the questions I need multiple `\includequestions` commands:               \includequestions[IDs={q2}]{database.tex}     \includequestions[IDs={q1}]{database.tex}      But `database.tex` is large and I want to include 6 or more questions in a specific order. Thus, typesetting needs more than 1 minute. Is there a better and faster way? * * * **Update** : I forgot to mention that I use a custom header for questions and solutions (to keep it easy I only give the code for the header of questions):               ...     \begin{question}[ID=q1,subtitle={T1}]     ...          \def\loesung{}          \ExplSyntaxOn       \DeclareInstance{exsheets-heading}{myhead}{default}{       number-post-code = {\hspace{1em}\textbf{\tl_use:N \l__exsheets_questions_subtitle_tl}~%       \ifdef{\loesung}{\color{blue}\tiny(\texttt{\tl_use:N \l__exsheets_questions_id_tl})}{}       } ,       join = {         title[r,B]number[l,B](.333em,0pt)       } ,       attach = {         main[l,vc]title[l,vc](0pt,0pt)       }     }     \ExplSyntaxOff          \RenewQuSolPair       {question}[][headings=myhead]       {solution}[][headings=myhead]      If I use the answer from @cgnieder, I get: ![enter image description here](http://i.stack.imgur.com/Bo8N1.png)


title: utf8 input encoding with biblatex (biber and bibencoding=utf8)

text: I have a document with Cyrillic, English and German. All worked well so far. But now I need a special Character in the bibliography.bib file. Its an `\.{E}` If I just put that in there it gives me the following error: `! Package inputenc Error: Unicode char \u8:Ė not set up for use with LaTeX.` Here's a sample code that reproduces that behavior:               \documentclass[12pt,a4paper]{article}     \usepackage{amsmath,amsthm,amssymb,amsfonts}     \usepackage[T1,T2A]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage[english,russian,ngerman]{babel}          \usepackage[backend=biber,bibencoding=utf8]{biblatex}          \usepackage{filecontents}     \begin{filecontents}{onebook.bib}     @book{eichenbaum,     author={{\.{E}}jchenbaum},     title={Wie Gogol's \enquote{Mantel} gemacht ist},     }     \end{filecontents}     \addbibresource{onebook.bib}     \nocite{*}          \begin{document}          \.{E}jchenbaum          Гоголь          Münze          \printbibliography          \end{document}      If I put a regular `E` in that .bib file, I get the following (and correct encoding as I want it outside the bibliography): ![without special character in .bib](http://i.stack.imgur.com/0NflR.png) If I put that `\.{E}` in the .bib file and I comment out the line: `% \usepackage[utf8]{inputenc}` Then I get the following: ![with special char in .bib file](http://i.stack.imgur.com/ewI6m.png) So the funny thing is, I can get the bibliography interact with my document file at the cost of losing encoding of regular text in there ... As always, I appreciate any kind of help! Thanks!


title: How can I insert verbatim text to beamer notes?

text: I would like to inset **Verbatim text to beamer notes**. When using Verbatim in beamer notes, I got errors. For your information, below is what I would like to do.               \begin{frame}[containsverbatim]       \frametitle{Date and Time Setup}        \begin{itemize}            \item ABC            \item DEF        \end{itemize}             \note{         \begin{Verbatim}[fontfamily=courier, fontsize=\footnotesize,                           obeytabs=true, tabsize=4]               My Verbatim Text Here!              \end{Verbatim}            } % end of notes          \end{frame} % end of frame


title: An .eps image, whose caption is too separated from the image.

text: I am writing a thesis in a large .tex file in Vim. I have an .eps image, whose caption is too separated from the image. I have extensively read similar posts, tried almost everything, but the problem still persists, because it only occurs with this particular image:               imagefilename.eps       I would appreciate very much if you could help me. I have a very simple preamble. The rest of the captions (from the rest of the .eps images) have the exact space that I need, except for this particular image. This way, I would not prefer to write commands in the preamble, due to this will modify all captions of the rest of the images. I would only like to reduce the space image-caption of this particular image. I don’t know why the space caption-image for this particular image is bigger than the rest. Here is the code that introduces the image:               \begin{center}     \begin{figure}     \begin{center}     \includegraphics[scale=0.150,angle=0]{imagefilename.eps}     \caption{\small\sf This text is the image caption for the image showed. Note that this text is too separated from the image above.}      \label{image}     \end{center}     \end{figure}     \end{center}      Here is the link to direct download of the image, in order to check previously if a possible solution works: https://www.mediafire.com/?xtub719odxrvbsx I also show a direct link of another .eps image: https://www.mediafire.com/?225azt8wkhyblzh Just try to maintain the last code, and replace the               imagefilename.eps      with               a.eps      And you will see that the caption for a.eps is closer to the figure (!!!) My preamble is this:               \documentclass[12pt,a4paper,twoside,openany]{report}     \usepackage[left=2.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm]{geometry}     \parindent 1 true cm     \usepackage[dvips]{graphicx}     \usepackage{eufrak}     \usepackage[spanish]{babel}     \usepackage[latin1]{inputenc}       \usepackage[T1]{fontenc}     \usepackage{times}     \usepackage{amsmath}     \usepackage{graphicx,epsfig}     \usepackage{multirow}     \usepackage{float}     \usepackage{color}     \usepackage[longnamesfirst,super]{natbib}      \setcitestyle{square}      \usepackage{fancyhdr}        \pagestyle{fancy}                                          \renewcommand{\chaptermark}[1]{\markboth{\thechapter .\ #1}{}}              \renewcommand{\sectionmark}[1]{\markright{\thesection .\ #1}{}}      \lhead{\nouppercase}     \rhead{\nouppercase}     \fancyhead[LE]{{\sf \leftmark}}                                      \fancyhead[RE]{}                                                     \fancyhead[RO]{{\sf \rightmark}}                                   \fancyhead[LO]{}      \fancyfoot[LE,RO]{\thepage}     \fancyfoot[CE,CO]{}                                                              \renewcommand{\headrulewidth}{0.0pt}                                     \renewcommand{\baselinestretch}{1.25}     \usepackage{adjustbox}     \usepackage{enumerate}     \usepackage{courier}     \begin{document}      I would appreciate very much if someone could help me, making tests with the images provided above, using my preamble, and the code that introduces the image. (I am writing the thesis .tex file in Vim).


title: What bar should be used for definition of (formal) languages?

text: I wanted to know which standard symbol should be used as a delimiter when recursively defining a (formal) language, such as this fragment of arithmetic expressions : X ::= 0 | 1 | X+X | X*X | I use |, but I have to put by hand the spaces between the bar and the left and right symbols. Moreover, in other documents or papers, the bar looks like bigger than the standard one, so I wondered if there was a particular symbol or a best practice. Edit : Here a short version of the kind of code I'm using right now :               \documentclass[11pt,letterpaper]{report}          \usepackage{amssymb,amsmath,amsfonts,amsxtra,amsthm}     % etc...          \begin{document}          % ...          \[ A ::= 0 | 1 | A+A | A \times A \]          %...          \end{document}      While I'm looking for spacing more like the definition at page 4, around the end of 1.1 in http://perso.ens-lyon.fr/olivier.laurent/folgames.pdf for example. I think its called Backus-Naur Form or something like that.


title: Looking for a smarter \left ... \right

text: I'm looking for an automatic fence-resizing macro like the traditional `\left` and `\right`, but I need some more features (not to mention `\left` and `\right` are quite "buggy" and poorly spaced as the consensus seems to be). In particular, I would like the ability to   * exclude certain parts of the formulas from being counted (typically sub/superscripts) and   * to break a fenced section across a linebreak while ensuring the sizes remain the same I noticed that the `nath` package provides the features but it dramatically changes the rest of the math syntax in ways that are incompatible with "standard" LaTeX, which means they are prone to breakage when other packages are used. Does anyone have a more _lightweight_ solution to this problem?


title: pgfplotsset{compat=1.9} causes y=0 error bar to disappear

text: I am producing a stacked bar chart or two series with error bars that describe the uncertainty in their sum. I apply the error bars as properties of the second plot. If I use \pgfplotset{compat=1.9}, then points where the second plot value is zero (no rectangle) don't get error bars, even through the error amount is non-zero! Not surprisingly, the manual says that pgfplots 1.9 comes with "suppression of empty increments in stacked bar plots" that is enabled with compat=1.9 or higher. Sure seems like a bug. Am I doing something wrong?               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          % Uncomment to make second error bar disappear     \pgfplotsset{compat=1.9}          \begin{filecontents*}{dataTable.txt}     xpos firsty secondy yerrdown yerrup     1           0         1                0.1               0.1     2           1         0               1.5               0.4     3           2         1               0.3               0.4     \end{filecontents*}          \begin{document}          \pgfplotstableread{dataTable.txt}\dataTable     \begin{tikzpicture}     \pgfplotsset{set layers}     \begin{axis}[     ybar stacked         ]     % Layers needed to get error bars on top of lower blue rectangle     \addplot table[on layer=axis grid,x=xpos, y=firsty]{\dataTable};     \addplot plot[on layer=axis lines,error bars/.cd, y dir=both, y explicit] table[x=xpos, y=secondy, y error minus=yerrdown, y error plus=yerrup]{\dataTable};          \end{axis}          \end{tikzpicture}               \end{document}      With compat1.9: ![With compat=1.9](http://i.stack.imgur.com/0DeD9.png) Without compat1.9: ![Without compat=1.9](http://i.stack.imgur.com/frPpY.png)


title: Line spacing and alignment issues in tables with multiline cells

text: While trying to create tables with multiline cells, I run into some line spacing and alignment issues. The following code creates two tables:               \documentclass[10pt]{article}     \usepackage[english]{babel}     \usepackage{pbox}     \usepackage{multirow}          \begin{document}     \begin{table}[htp]     \centering     \begin{tabular}{lll}     cell11 & cell21 & cell31\\     cell12 & \begin{tabular}{l} cell221 \\ cell222 \\ \end{tabular} & cell32\\     \pbox[t]{5cm}{cell131 \\ cell132} & cell23 & cell33\\     cell14 & cell24 & \multirow{2}{*}{\pbox[t]{5cm}{cell341 \\ cell342}} \\     \\     cell15 & cell25 & cell35\\     cell16 & cell26 & cell36\\     \end{tabular}\vrule     \begin{tabular}{lll}     cell11 & cell21 & cell31\\     cell12 & cell221 & cell32\\      & cell222 & \\     cell131 & cell23 & cell33\\     cell132 & & \\     cell14 & cell24 & cell341\\      & & cell342\\     cell15 & cell25 & cell35\\     cell16 & cell26 & cell36\\     \end{tabular}     \caption{left: My attempts of a table with multiline cells. None of the attempts lead to the desired result. right: How it should look; the desired table with manually inserted empty cells, a lot of work and not really flexible.}     \end{table}     \end{document}      ![tables](http://i.stack.imgur.com/1mim7.png)   The right table shows the desired result. It was created using empty cells, lacking flexibility in case of changing content. In the left table, the attempts to make multirow/multiline cells are shown. Note the line spacing and alignment issues. Lines 5 and 6 (without any multiline cells) have the correct distance from each other. A `tabular` within the `table` (cells 221 and 222) gives the correct intra- and intercell line spacing, however the horizontal alignment is incorrect. Additionally, cells 12 and 32 have an incorrect vertical alignment. Using `pbox` (cells 131 and 132) aligns the full row correctly. Line spacing within the cell is correct, but the spacing to the next cell (from 132 to 14) is to small. This might lead to the impression, that 132 and 14 belong together. The same problem occurs when using `multirow` (cells 341 and 342). Within the cell, line spacing is correct, but spacing between 342 and 35 is to small.   Question: how to create a table with multiline cells and correct spacing/alignment? * * * > For me, the two answers provided by David and Steven both work equally well. > Since I like to keep my documents as simple as possible, I decided to use > David's solution, as no additional package is needed. Consequently, I > accepted his answer. This is just my personal preference and no judgement on > the quality of the quality of the soultions.


title: modifying pagenumbers in crossreferences

text: I need to typeset crossreferences to pages, using `\pageref`, with wherever possible no more than two digits. For example:               pp. 1-23      pp. 101-23   %(for 101-123)     pp. 101-105  %(not 101-05, because the second number starts with a zero)     pp. 101-222  %full range because 101-22 would be wrong      The crux is: `\pageref` just turns out 101-123; how can I modify this? (Sorry no MWE, because I would need one with hundreds of pages...) I looked at some packages, but none seem to offer the sort of thing I need.


title: Issue with titlesec page styles and appendix in book class

text: I'm using `titlesec` to set my page style in a book class. If I include an appendix, the header corresponding to the first chapter is "Appendix 1" instead of "Chapter 1".               \documentclass{book}          \usepackage[pagestyles]{titlesec}       \newpagestyle{main}[\scshape]{%       \sethead       [\thepage][][\chaptertitlename\space\thechapter. \chaptertitle]       {\ifthesection{\thesection\space\,\sectiontitle}       {\chaptertitlename\space\thechapter. \chaptertitle}}{}{\thepage}     }     \pagestyle{main}     \usepackage{lipsum}          \begin{document}          \chapter{Foo}     \lipsum          \appendix     \chapter{Bar}     \lipsum          \end{document}


title: different alignment on some lines of an align* envirnoment

text: I would like to typeset a set of equations, where a bunch of them a short (fit on one line) and one of them is long. I would like it to look something like the output of the following:               \begin{align*}        && a&=b & c&=d & e&=f & g&=h &&     \end{align*}     \begin{align*}       x < (a^2+b^2)\cos( (a+b)/(c+d) ) \sqrt{g^2+1} < 3     \end{align*}      I would like the equations on the first line evenly spaced out and centered, and the equation on the second line centered with them overall. Two problems with the above: 1) Vertical space between the two align's. Easily fixed with `\vspace{-1em}`. 2) Being separate align's, they may break across pages, which I do not want. I can of course do this with one align and a bunch of `\qquad` instead of a bunch of `&`, but using the `&` makes the overall spacing and centering nicer. I have tried putting the first equation inside an aligned but the two equations are not centered with each other.


title: PSfrag isn't working to add LaTeX symbols to eps figures

text: I have converted a jgraph file to eps, and am trying to replace text in the eps figure with LaTeX symbols. I have followed the instructions listed in this question but the solution suggested does not seem to work for me. Here is my short snippet:               \documentclass{article}          \usepackage{graphicx}     \usepackage{psfrag}     \usepackage{auto-pst-pdf}          \begin{document}          \title{Sample PSFrag}     \maketitle          Hi there.          {       \psfrag{rmax}{$r_{max}$}       \includegraphics[width=0.5\textwidth]{lusearch9}     }          \end{document}      The string occurs in the eps file: `\(rmax = 0%\))` but still no substitution happens in the final pdf file produced. I am using `pdflatex --shell-escape sample.tex`. Any suggestions, especially using the pdflatex mechanism, would be appreciated.


title: Selectively suppress generation of typeset output

text: Is it possible put TeX into a "mute" mode in which all typesetting is suppressed?               \documentclass{article}     \pagestyle{empty}     \begin{document}       \suppress       This text will not be seen in the generated document.       \enable       But this text will.       \suppress       And this text won't again.     \end{document}      The input should be processed "as usual" (maintaining counters, etc.), just without outputting anything. **EDIT** : The current application is the creation of a document, in PDF format, that contains only the figures contained in a given source. However, in the end I'm interested if it's possible to mute output in a generic fashion, just the way I asked. If I wanted just to solve the problem, I would simply open the PDF in Acrobat and extract the figures.


title: How to tell TikZ to first compute and then display a variable?

text: I want `TikZ` to first compute and then display the value of a variable. The question is, for sake of simplicity, based on this concrete example from TeXample.net:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \def \n {5}     \def \radius {3cm}     \def \margin {8} % margin in angles, depends on the radius          \foreach \s in {1,...,\n}     {       \node[draw, circle] at ({360/\n * (\s - 1)}:\radius) {$\s$};       \draw[->, >=latex] ({360/\n * (\s - 1)+\margin}:\radius)          arc ({360/\n * (\s - 1)+\margin}:{360/\n * (\s)-\margin}:\radius);     }     \end{tikzpicture}     \end{document}      Suppose I messed up and I wanted my labels to run from 0 to n-1, instead of from 1 to n. How can I tell TikZ to first compute the difference or whatever operation on the variable, and then display it:               \documentclass{standalone}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \def \n {5}     \def \radius {3cm}     \def \margin {12} % margin in angles, depends on the radius          \foreach \s in {1,...,\n}     {       \node[draw, circle] at ({360/\n * (\s - 1)}:\radius) {$\s-1$};       \draw[->, >=latex] ({360/\n * (\s - 1)+\margin}:\radius)          arc ({360/\n * (\s - 1)+\margin}:{360/\n * (\s)-\margin}:\radius);     }     \end{tikzpicture}     \end{document}      I even used a temporary auxiliary variable \r=\s-1 but it still prints the following instead the nodes' numbers from 0 to n-1: ![enter image description here](http://i.stack.imgur.com/mIzJ4.png) Remark: I know the problem would be solved by defining another range for `\s`, i.e. `{0,...,\n-1}` but I already wrote a _similar_ code (but long, so it wouldn't be a MWE if I post it) based on this, with dependence on the `\s` and I wouldn't like to shift lot of times the variable to `\s+1` in the somehow long formulas.


title: How to draw a simple but beautiful decorative head-rule?

text: The picture shown below is the desired simple head-rule, but the rule width should be much thinner like `1pt`. ![enter image description here](http://i.stack.imgur.com/vJPYY.png) Real one: ![enter image description here](http://i.stack.imgur.com/e0Fsr.png) So how to use `Tikz` or other packages to draw this kind of line as a `headrule`? Or alternatively, suppose I have the vector pciture in pdf form, e.g `head- rule.pdf`, how can I include it for use of head-rule?


title: keyval error on passing macro as an optional argument to includegraphics

text: I am trying to include an image in my document:               \documentclass[a4paper,10pt,twoside]{book}     \usepackage{graphicx}          \begin{document}          \def\foo{scale=0.1}     \includegraphics[\foo]{fig1.eps}          \end{document}      gives me the error               ERROR: Package xkeyval Error: `scale=0.1' undefined in families `Gin'.      It has something to do with macro expansion, but I was not able to solve it. Then I saw this question with the following answer > Defining a private `\includegraphics` allows you to call macros as optional > arguments: >   >   >     \protected\def\newincludegraphics{\@testopt\new@includegraphics{}} >     \def\new@includegraphics[#1]{% >       \begingroup >       \@protected@edef\x{\endgroup >         \noexpand\includegraphics >         \if\relax\detokenize{#1}\relax\else[#1]\fi >        }\x >     } >   >     \newincludegraphics[\scalefactor]{image} >   where the new macro `\newincludegraphics` was defined. **MWE**               \documentclass[a4paper,10pt,twoside]{book}     \usepackage{graphicx}          \begin{document}     \protected\def\newincludegraphics{\@testopt\new@includegraphics{}}     \def\new@includegraphics[#1]{%       \begingroup       \@protected@edef\x{\endgroup         \noexpand\includegraphics         \if\relax\detokenize{#1}\relax\else[#1]\fi        }\x     }          \def\foo{scale=0.1}     \newincludegraphics[\foo]{fig1.eps}          \end{document}      Nevertheless I still get this error:               ERROR: You can't use `\spacefactor' in vertical mode.          --- TeX said ---     \@->\spacefactor                       \@m      l.62 \newincludegraphics                             [scale=0.1]{fig1.eps}      What could be the cause of this error, and is there a workaround without defining another macro to include graphics?


title: Can I use letter ä in urls?

text: I have the following beginning on my tex file:               \documentclass[a4paper]{amsart}     \usepackage[utf8]{inputenc}     \usepackage[finnish]{babel}     \usepackage{url}      Now I need to put an URL to the document that contains the letter ä. I tried to do this               \url{http://www.address.fi/kälä-example}.     \url{http://www.address.fi/k\"al\"a-example}.      but this won't work in my system. Can I see those addresses properly somehow?


title: PSTricks: Perpendicular bisectors of line segments using pst-eucl

text: First: This is a crosspost from the LaTeX Community since I haven't gotten any answer there. Consider the following MWE:               \documentclass{article}          \usepackage{pst-eucl}          \begin{document}          \begin{figure}      \centering       \begin{pspicture}(10.5,9.8)        \pnode(0,2.3){A}        \pnode(3.7,7.8){B}        \pnode(10.5,9.8){C}        \psdot(A)        \psdot(B)        \psdot(C)        \psline(A)(B)(C)       \psset{        PointSymbol=none,        PointNameB=none,        CodeFig=true,        CodeFigColor=black       }        \pstMediatorAB{B}{A}{M}{M''}        \pstMediatorAB{C}{B}{M'}{M'''}       \end{pspicture}     \end{figure}          \end{document}      Is it possible to (1) remove `M` and `M'` from the figure and (2) extend the lines in order to make them intersect? Ad (1): I tried to make the third argument blank but that is not legal. Thank you in advance! P.S. I know that it can be achieved with the following but I would like to do it with pst-eucl only:               \documentclass{article}          \usepackage{pst-eucl,pstricks-add}          \begin{document}          \begin{figure}      \centering       \begin{pspicture}(10.5,9.8)        \pnode(0,2.3){A}        \pnode(3.7,7.8){B}        \pnode(10.5,9.8){C}        \psdot(A)        \psdot(B)        \psdot(C)        \psline(A)(B)(C)       \psset{        PointSymbol=none,        PointNameB=none,        CodeFig=true,        CodeFigColor=black       }        \psRelLine(A)(B){1 2 div}{I'}        \psRelLine[angle=90](I')(A){3}{I''}        \psRelLine(B)(C){1 2 div}{J'}        \psRelLine[angle=90](J')(B){2.8}{J''}        \psIntersectionPoint(I')(I'')(J')(J''){X}        \pcline(I')(X)        \pcline(J')(X)        \pstRightAngle{A}{I'}{I''}        \pstRightAngle{B}{J'}{J''}       \end{pspicture}     \end{figure}          \end{document}


title: Table with width assignment

text: I am trying to create a matrix in texmaker when using the wizard-->quick tabular i get a table, but I want to have equal spacing between the columns , so at the option i choose fixed column width when i see the code I noticed that               %\usepackage{array} is required      so i place it the pre-amble and hit compile but it doesnot allow me to compile it and goes into a never ending loop               \documentclass[authoryear,preprint,review,12pt]{elsarticle}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{mathtools}               \begin{document}          \begin{tabular}{|c|c|c|c|c|}     \hline      • & \multicolumn{4}{c|}{location} \\      \hline      • & 1 & 2 & 3 & 4 \\      \hline      Average & • & • & • & • \\      \hline      Average measure& • & • & • & • \\      \hline      A & • & • & • & • \\      \hline      B & • & • & • & • \\      \hline      C & • & • & • & • \\      \hline      D & • & • & • & • \\      \hline      E & • & • & • & • \\      \hline      \end{tabular}               \end{document}      Is there a way to set a designated width to the code used above, with out the use of packages ?


title: Creating a table in a narrow space

text: I'm working with moderncv and having difficulties when creating a table in a narrow space. How to make the table properly? **Edited:**                   \documentclass[10pt,a4paper,sans]{moderncv}         \usepackage[T1]{fontenc}         \usepackage[indonesian]{babel}         \usepackage{array, booktabs}         \usepackage{multirow}         \usepackage[raggedrightboxes]{ragged2e}              \usepackage{makecell}         \renewcommand\theadfont{\bfseries}              \newcounter{tabenum}         \newcommand\tabitem{\refstepcounter{tabenum}\thetabenum.}              \moderncvstyle{casual}          \moderncvcolor{blue}               \usepackage{lipsum}               \usepackage[scale=0.75,margin=1.5cm]{geometry}          \firstname{}          \familyname{}               \address{}         \mobile{}         \phone{}         \fax{}         \email{}         \homepage{}         \extrainfo{}              \quote{}              \setlength{\hintscolumnwidth}{3cm}              \setlength\tabcolsep{3.25pt}              \begin{document}              \makecvtitle               \section{Riwayat Pekerjaan}              \cvline{Riwayat Kepangkatan dan Golongan Ruang Penggajian}{\small\renewcommand\arraystretch{1.2}         \setcounter{tabenum}{0}         \begin{tabular}[t]{@{}r@{\hskip\labelsep}ccclllll@{}}         \multirow{2}{*}{\thead{{No.}}} & \multirow{2}{*}{\thead{Pangkat}} & \multirow{2}{*}{\thead{Gol. Ruang}} & \multirow{2}{*}{\thead{Berlaku TMT}} & \multirow{2}{*}{\thead{Gaji Pokok}} & \multicolumn{3}{c}{\thead{Surat Keputusan}}                                                                       \\\cline{6-8}                                       & \multicolumn{1}{c}{}                                  & \multicolumn{1}{c}{}                                     &                                       & \multicolumn{1}{c}{}                                     & \multicolumn{1}{c}{\thead{Pejabat}} & \multicolumn{1}{c}{\thead{Nomor}}   & \multicolumn{1}{c}{\thead{Tanggal}} \\         \midrule[1pt]\addlinespace         \tabitem & Pengatur & II/c (CPNS) & 1 Jan 1991 & 56.080 & Mendikbud & 4700/A2.IV.1/C/1991 & 21/01/1991 \\         \tabitem & Pengatur & II/c (PNS) & 1 Nov 1992 & 70.100 & Mendikbud & 356/B/CI/SP & 31/10/1992 \\         \tabitem & Pengatur Tingkat I & II/d & 1 Okt 1994 & 148.700 & BAKN & II.13-23/05021/KEP/X/1994 & 03/06/1996 \\         \end{tabular}}         \setcounter{tabenum}{0}              \end{document}


title: Pgfplotstable header in bold

text: I want to create a table using the pgfplotstable package. I've managed to get 95% of the formatting I want using the following:               \usepackage{pgfplotstable}     \usepackage{booktabs}          % global settings     \pgfplotstableset{     after row={\hline},     every head row/.style={     before row={     \rowcolor{lightgray}     \noalign{\hrule height \tableborder}     },     after row={     \hline     },     },     every last row/.style={     after row=\noalign{\hrule height \tableborder}     },     col sep = &,     row sep=\\,     % column type/.add={}{\vrule width \tableborder},     every col no 1/.style={ column type/.add={|}{} },     every col no 2/.style={ column type/.add={|}{} },     every col no 3/.style={ column type/.add={|}{} },     every col no 4/.style={ column type/.add={|}{} },     every col no 5/.style={ column type/.add={|}{} },     every first column/.style={     column type/.add={!{\vrule width \tableborder}}{}     },     every last column/.style={     column type/.add={}{!{\vrule width \tableborder}}     },     string type,     }      Even though there are many `every col no`, which I don't like, it still works almost perfectly. The only thing I'm missing is to put the header's text in bold. If I try to force it to bold in the actual table it doesn't compile, and I'm not able to change the content of the row to bold. So with this code I ask 2 questions: **1 - Hown can I get the header's text to be bold?** **2 - Does anyone know of a better way to do what the`every col no` commands do, but in a more general way?** EDIT: Here is the complete code now (It was missing a def). And bellow the initial config is the code to generate the table.               \usepackage{pgfplotstable}     \usepackage{booktabs}     \def\tableborder{1.5pt}          % global settings     \pgfplotstableset{     after row={\hline},     every head row/.style={     before row={     \rowcolor{lightgray}     \noalign{\hrule height \tableborder}     },     after row={     \hline     },     },     every last row/.style={     after row=\noalign{\hrule height \tableborder}     },     col sep = &,     row sep=\\,     % column type/.add={}{\vrule width \tableborder},     every col no 1/.style={ column type/.add={|}{} },     every col no 2/.style={ column type/.add={|}{} },     every col no 3/.style={ column type/.add={|}{} },     every col no 4/.style={ column type/.add={|}{} },     every col no 5/.style={ column type/.add={|}{} },     every first column/.style={     column type/.add={!{\vrule width \tableborder}}{}     },     every last column/.style={     column type/.add={}{!{\vrule width \tableborder}}     },     string type,     }      With this the table is generated. Note that this is only a portion of the actual document and the table is a fake.               \pgfplotstabletypeset{     person & singEnglish & singGaeilge & pluralEnglish & pluralGaeilge\\     1st & at me & agam & at us & againn\\     2st & at you & agat & at you & agaibh\\     3st & at him & aige & at them & acu\\     & at her & aici & &\\     }      Here is the result. I want the text in the header to be bold, and the column lines to go all the way on all columns ![enter image description here](http://i.stack.imgur.com/ItZjp.png) **EDIT Nº2:** Ok now here is a sample of a compilable code (stand alone), but now it is refusing to paint the header row. Please help.               \documentclass[12pt,a4paper]{book}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}          \usepackage{pgfplotstable}     \usepackage{booktabs}     \def\tableborder{1.5pt}          % global settings     \pgfplotstableset{         after row={\hline},         every head row/.style={             before row={             \noalign{\hrule height 1.5pt}             },             after row={                 \hline             },           },         every last row/.style={             after row=\noalign{\hrule height 1.5pt}         },         col sep = &,         row sep=\\,         % column type/.add={}{\vrule width \tableborder},         every col no 1/.style={ column type/.add={|}{} },         every col no 2/.style={ column type/.add={|}{} },         every col no 3/.style={ column type/.add={|}{} },         every col no 4/.style={ column type/.add={|}{} },         every col no 5/.style={ column type/.add={|}{} },         every first column/.style={             column type/.add={!{\vrule width 1.5pt}}{}         },         every last column/.style={             column type/.add={}{!{\vrule width 1.5pt}}         },         string type,     }          \begin{document}     \pgfplotstabletypeset{     1 & 2 & 4 \\     3 & 4 & 9 \\     }     \end{document}


title: underline omitting the descenders

text: I'm very well aware that it is considered best practice _not_ to use underlining other than on typewriters and in handwriting. But sometimes it is needed nonetheless. In my opinion the typographically least offending way to underline in print is to leave out the descenders. This is also how I learned to do it in handwriting. Very few fonts offer a pre-made underlined variant, but some text-processors (e.g. OS X text-engine) do -- depending on the font used -- an acceptable job at emulating this effect: ![OS X TextEdit underline](http://i.stack.imgur.com/huZv2.png) How would I tweak any of the existing ways/packages for underlining to do the same? As a bonus, I'd like to be able to tweak the behaviour (extent of the omitted part, apply to which letters) per font and text style, preferably working with XeLaTeX.


title: How to define an 'Experiments' section?

text: I am writing a short report using the standard book class. In the report we describe about 10 experiments. I would like to define a sectioning command called `experiment`. This sectioning command should be very similar to that of a standard section. The only difference I would like if possible that it issues a new page and in the contents, the experiments must be shown at the end of the Chapter.                 Chapter 1 Introduction  12         section 2  .....         section 3  .....         experiment 1.2 ....         experiment 1.3 ....         experiment 1.4 ....


title: How to I convert a pdf to a ps format so that I can insert it into a document?

text: I would like to insert an article into my thesis, and compile the thesis into postscript with normal LaTeX. (not pdfLaTeX). I have an article that is in pdf format that I'd also like to insert in there. Every method I try to use to convert the pdf to ps (or eps) and insert it into the document results in a mess. When I try pdf2ps, and then use `\includegraphics`, it includes all of the article on 1 page, and the text isn't even centered. I get the same result when I try `\epsfig`. I don't want to use `pdfpages`, as it only works with pdfLaTeX. I also have the article source, but its a complete document with its own styles and document class. I don't know if there's a way to recompile the article too inside of the thesis compilation?


title: LaTeX3: unable to convert space separated list into clist

text: I want to convert a space separated list of items, given as argument to a function, into a clist variable in order to iterate over them. However, I am not able to create a usable clist variable as the following code example demonstrates. `\clist_map_inline:Nn` always takes the whole list instead of separating the elements. What am I doing wrong?               \documentclass{minimal}     \usepackage{expl3}          \ExplSyntaxOn     \cs_new:Nn\parselist:n{       \tl_set:Nx\l_csv_tl{#1}       \tl_replace_all:Nnn\l_csv_tl{~}{,}       \clist_set:Nx\l_csv_clist\l_csv_tl       \clist_map_inline:Nn\l_csv_clist{         \noindent Name:~#1\par       }     }     \ExplSyntaxOff          \begin{document}     \def\csv{fred jane albert}     \ExplSyntaxOn       \parselist:n\csv       \parselist:n{john~peter~linda}     \ExplSyntaxOff     \end{document}


title: Why isn't \prime automatically set to be a superscript?

text: In math mode, writing `\prime` gives too big a "prime" symbol, and it isn't a superscript, like it always is in textbooks. Why is this? This isn't a question about how to get `\prime` to be a superscript, I know that. The questions is about the reasoning behind why it isn't like that _by default_.


Biber (v1.9) is reporting a version mismatch ("Found biblatex control file version 2.5, expected version 2.6") so I checked what version I have installed. It is version 2.7 according to the RELEASE file in `...\tex\latex\biblatex`. I deleted all aux-files (especially the bcf files) and tried again. But the new .bcf file still states `controlfile version="2.5"` I uninstalled the biblatex package using the MikTeX package manager and reinstalled it. To no avail. I don't get it. How can my bcf files state biblatex version 2.5 when I have version 2.7 installed? Could someone please explain how these bcf files are produced so that I can understand how this is possible (and possibly locate the source of the problem)?


title: multi-column row in align environment

text: I would like to be able to use `multicolumn` inside an align environment, much like we can do in a `tabular` environment MWE:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align}         a &= e^{a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p} \\         e^{a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p} &= a     \end{align}     \end{document}      In this case I would like to be able to put the `&` inside the exponent on the lhs of the second line, i.e. `e^{a+b+c+d+e+ & f+g+h+i+j+k+l+m+n+o+p}` but of course this is not allowed. I tried using `multicolumn` but this gave errors as well. Of course I could align both equations to the left, but where I need it the situation is much more involving. Until now, I would put the ampersand in the second equation fully to the left, and manually adjust using negative spaces… But I wonder if there exists a better solution. The most ideal situation would be something that allows me to put the `&` wherever I want, even inside brackets, but I would be happy with a multicolumn solution as well. **EDIT** What I try to achieve is something like ![enter image description here](http://i.stack.imgur.com/ADgx4.png)


title: Why do I need to use \paragraph{} after a \section{} to get correct indenting whereas a blank line suffices for subsequent paragraphs?

text: I have noticed that whenever I start a new section, subsection, etc., I need to preface my text block with **\paragraph{}** to get correct indentation for the first paragraph. In subsequent paragraphs, however, I note that I can simply leave an empty line and the paragraph is formatted correctly. Is this correct behaviour, and if so what is the reason for this? Is the first paragraph supposed to be naturally unindented, perhaps for the reason of compatibility with lettrines and such? Is there an easier (terser) way to stipulate first-paragraph indentation? I'm using the **article** documentclass under **xelatex**. Thanks for any insight you can offer.


title: amsart with table of contents with "to" and "from" hyperlinks

text: My question (I don't know about the answer) is relatively simple. I am often obligated to use amsart documentclass and so like this post, How to do this amsart Table of Contents excluding dots on bold section rows I wanted to keep amsart (unless there was an idea for a completely similar method with same aesthetics and features, e.g., \author, \email, etc. in fancy footnote; I can manage the margins with geometry...) and use some of the modifications in the above link. However, I also wanted to incorporate hyperref to do the "both ways" hyper linking that is talked about in this link, and quoted below it, Linking the section text to the TOC > "I'd like the section headings in running text to link to their "line" in > the Table of Contents so as to get "two-way" navigation, eg: a user looks in > the Table of Contents for a section title, jumps there, reads a couple of > lines, clicks on the section title again and gets taken to the section's > entry in the Table of Contents once more." When I try to combine them (both ways), I find that the section number and the first letter of the section title overlap. Also same for subsection, etc. Any ideas? So what I have so far is just the combination here: (I know order can matter so maybe this helps).               \documentclass{amsart}     %\usepackage[showframe,paper=a5paper]{geometry}% Just for this example          % FROM http://tex.stackexchange.com/questions/173834/how-to-do-this-amsart-table-of-contents-excluding-dots-on-bold-section-rows %          \usepackage{etoolbox}          % Modifications to amsart ToC-related macros...     \makeatletter     \let\old@tocline\@tocline     \let\section@tocline\@tocline     % Insert a dotted ToC-line for \subsection and \subsubsection only     \newcommand{\subsection@dotsep}{4.5}     \newcommand{\subsubsection@dotsep}{4.5}     \patchcmd{\@tocline}       {\hfil}       {\nobreak          \leaders\hbox{$\m@th             \mkern \subsection@dotsep mu\hbox{.}\mkern \subsection@dotsep mu$}\hfill          \nobreak}{}{}     \let\subsection@tocline\@tocline     \let\@tocline\old@tocline          \patchcmd{\@tocline}       {\hfil}       {\nobreak          \leaders\hbox{$\m@th             \mkern \subsubsection@dotsep mu\hbox{.}\mkern \subsubsection@dotsep mu$}\hfill          \nobreak}{}{}     \let\subsubsection@tocline\@tocline     \let\@tocline\old@tocline          \let\old@l@subsection\l@subsection     \let\old@l@subsubsection\l@subsubsection          \def\@tocwriteb#1#2#3{%       \begingroup         \@xp\def\csname #2@tocline\endcsname##1##2##3##4##5##6{%           \ifnum##1>\c@tocdepth           \else \sbox\z@{##5\let\indentlabel\@tochangmeasure##6}\fi}%         \csname l@#2\endcsname{#1{\csname#2name\endcsname}{\@secnumber}{}}%       \endgroup       \addcontentsline{toc}{#2}%         {\protect#1{\csname#2name\endcsname}{\@secnumber}{#3}}}%          % Handle section-specific indentation and number width of ToC-related entries     \newlength{\@tocsectionindent}     \newlength{\@tocsubsectionindent}     \newlength{\@tocsubsubsectionindent}     \newlength{\@tocsectionnumwidth}     \newlength{\@tocsubsectionnumwidth}     \newlength{\@tocsubsubsectionnumwidth}     \newcommand{\settocsectionnumwidth}[1]{\setlength{\@tocsectionnumwidth}{#1}}     \newcommand{\settocsubsectionnumwidth}[1]{\setlength{\@tocsubsectionnumwidth}{#1}}     \newcommand{\settocsubsubsectionnumwidth}[1]{\setlength{\@tocsubsubsectionnumwidth}{#1}}     \newcommand{\settocsectionindent}[1]{\setlength{\@tocsectionindent}{#1}}     \newcommand{\settocsubsectionindent}[1]{\setlength{\@tocsubsectionindent}{#1}}     \newcommand{\settocsubsubsectionindent}[1]{\setlength{\@tocsubsubsectionindent}{#1}}          % Handle section-specific formatting and vertical skip of ToC-related entries     % \@tocline{<level>}{<vspace>}{<indent>}{<numberwidth>}{<extra>}{<text>}{<pagenum>}     \renewcommand{\l@section}{\section@tocline{1}{\@tocsectionvskip}{\@tocsectionindent}{}{\@tocsectionformat}}%     \renewcommand{\l@subsection}{\subsection@tocline{1}{\@tocsubsectionvskip}{\@tocsubsectionindent}{}{\@tocsubsectionformat}}%     \renewcommand{\l@subsubsection}{\subsubsection@tocline{1}{\@tocsubsubsectionvskip}{\@tocsubsubsectionindent}{}{\@tocsubsubsectionformat}}%     \newcommand{\@tocsectionformat}{}     \newcommand{\@tocsubsectionformat}{}     \newcommand{\@tocsubsubsectionformat}{}     \expandafter\def\csname toc@1format\endcsname{\@tocsectionformat}     \expandafter\def\csname toc@2format\endcsname{\@tocsubsectionformat}     \expandafter\def\csname toc@3format\endcsname{\@tocsubsubsectionformat}     \newcommand{\settocsectionformat}[1]{\renewcommand{\@tocsectionformat}{#1}}     \newcommand{\settocsubsectionformat}[1]{\renewcommand{\@tocsubsectionformat}{#1}}     \newcommand{\settocsubsubsectionformat}[1]{\renewcommand{\@tocsubsubsectionformat}{#1}}     \newlength{\@tocsectionvskip}     \newcommand{\settocsectionvskip}[1]{\setlength{\@tocsectionvskip}{#1}}     \newlength{\@tocsubsectionvskip}     \newcommand{\settocsubsectionvskip}[1]{\setlength{\@tocsubsectionvskip}{#1}}     \newlength{\@tocsubsubsectionvskip}     \newcommand{\settocsubsubsectionvskip}[1]{\setlength{\@tocsubsubsectionvskip}{#1}}          % Adjust section-specific ToC-related macros to have a fixed-width numbering framework     \patchcmd{\tocsection}{\indentlabel}{\makebox[\@tocsectionnumwidth][l]}{}{}     \patchcmd{\tocsubsection}{\indentlabel}{\makebox[\@tocsubsectionnumwidth][l]}{}{}     \patchcmd{\tocsubsubsection}{\indentlabel}{\makebox[\@tocsubsubsectionnumwidth][l]}{}{}          % Allow for section-specific page numbering format of ToC-related entries     \newcommand{\@sectypepnumformat}{}     \renewcommand{\contentsline}[1]{%       \expandafter\let\expandafter\@sectypepnumformat\csname @toc#1pnumformat\endcsname%       \csname l@#1\endcsname}     \newcommand{\@tocsectionpnumformat}{}     \newcommand{\@tocsubsectionpnumformat}{}     \newcommand{\@tocsubsubsectionpnumformat}{}     \newcommand{\setsectionpnumformat}[1]{\renewcommand{\@tocsectionpnumformat}{#1}}     \newcommand{\setsubsectionpnumformat}[1]{\renewcommand{\@tocsubsectionpnumformat}{#1}}     \newcommand{\setsubsubsectionpnumformat}[1]{\renewcommand{\@tocsubsubsectionpnumformat}{#1}}     \renewcommand{\@tocpagenum}[1]{%       \hfill {\mdseries\@sectypepnumformat #1}}          % Small correction to Appendix, since it's still a \section which should be handled differently     \let\oldappendix\appendix     \renewcommand{\appendix}{%       \leavevmode\oldappendix%       \addtocontents{toc}{%         \protect\settowidth{\protect\@tocsectionnumwidth}{\protect\@tocsectionformat\sectionname\space}%         \protect\addtolength{\protect\@tocsectionnumwidth}{2em}}%     }     \makeatother          % #1 (default is as required)          % #2          % #3     \makeatletter     \settocsectionnumwidth{2em}     \settocsubsectionnumwidth{2.5em}     \settocsubsubsectionnumwidth{3em}     \settocsectionindent{1pc}%     \settocsubsectionindent{\dimexpr\@tocsectionindent+\@tocsectionnumwidth}%     \settocsubsubsectionindent{\dimexpr\@tocsubsectionindent+\@tocsubsectionnumwidth}%     \makeatother          % #4 & #5     \settocsectionvskip{10pt}     \settocsubsectionvskip{0pt}     \settocsubsubsectionvskip{0pt}          % #6 & #7     % See #3          % #8     \renewcommand{\contentsnamefont}{\bfseries\Large}          % #9     \settocsectionformat{\bfseries}     \settocsubsectionformat{\mdseries}     \settocsubsubsectionformat{\mdseries}     \setsectionpnumformat{\bfseries}     \setsubsectionpnumformat{\mdseries}     \setsubsubsectionpnumformat{\mdseries}          % #10     % Insert the following command inside your text where you want the ToC to have a page break     \newcommand{\tocpagebreak}{\leavevmode\addtocontents{toc}{\protect\clearpage}}          % #11     \let\oldtableofcontents\tableofcontents     \renewcommand{\tableofcontents}{%       \vspace*{-\linespacing}% Default gap to top of CONTENTS is \linespacing.       \oldtableofcontents}          \setcounter{tocdepth}{3}                          %AMSART STUFF          \newtheorem{theorem}{Theorem}[section]     \newtheorem{lemma}[theorem]{Lemma}          \theoremstyle{definition}     \newtheorem{definition}[theorem]{Definition}     \newtheorem{example}[theorem]{Example}     \newtheorem{xca}[theorem]{Exercise}          \theoremstyle{remark}     \newtheorem{remark}[theorem]{Remark}          \numberwithin{equation}{section}          % From http://tex.stackexchange.com/questions/32495/linking-the-section-text-to-the-toc?lq=1          %CHOICE ONE of TWO          %\usepackage[explicit]{titlesec}     %\usepackage{hyperref}     %\hypersetup{     %    colorlinks,%     %    citecolor=black,%     %    filecolor=black,%     %    linkcolor=black,%     %    urlcolor=black     %}     %\titleformat{\chapter}[display]     %  {\normalfont\huge\bfseries}{\chaptertitlename\ {\fontfamily{cmr}\selectfont\thechapter}}{20pt}{\hyperlink{chap-\thechapter}{\Huge#1}     %\addtocontents{toc}{\protect\hypertarget{chap-\thechapter}{}}}     %\titleformat{name=\chapter,numberless}     %  {\normalfont\huge\bfseries}{}{-20pt}{\Huge#1}     %\titleformat{\section}     %  {\normalfont\Large\bfseries}{\thesection}{1em}{\hyperlink{sec-\thesection}{#1}     %\addtocontents{toc}{\protect\hypertarget{sec-\thesection}{}}}     %\titleformat{name=\section,numberless}     %  {\normalfont\Large\bfseries}{}{0pt}{#1}     %\titleformat{\subsection}     %  {\normalfont\large\bfseries}{\thesubsection}{1em}{\hyperlink{subsec-\thesubsection}{#1}     %\addtocontents{toc}{\protect\hypertarget{subsec-\thesubsection}{}}}     %\titleformat{name=\subsection,numberless}     %  {\normalfont\large\bfseries}{\thesubsection}{0pt}{#1}          %CHOICE TWO of TWO          \usepackage[explicit]{titlesec}     \usepackage{hyperref}     \hypersetup{         colorlinks,%         citecolor=black,%         filecolor=black,%         linkcolor=black,%         urlcolor=black     }          % renew \contentsline for toc to include hypertarget     \let\oldcontentsline\contentsline%     \renewcommand\contentsline[4]{%     \hypertarget{toc#4}{}%     \oldcontentsline{#1}{#2}{#3}{#4}}          % renew \section to link to the toc     \titleformat{\section}     {\normalfont\Large\bf}     {{\thesection} \hyperlink{tocsection.\thesection}{#1}}     {1pc}     {}          % renew \subsection to link to the toc     \titleformat{\subsection}     {\normalfont\bf}     {{\thesection} \hyperlink{tocsubsection.\thesubsection}{#1}}     {1pc}     {}                                   \begin{document}          \title{Report fom}          %    Information for first author     \author{Brn}     %    Address of record for the research reported here     \address{6G1}     %    Current address          \email{safds@fds.ca}     %    \thanks will become a 1st page footnote.     \thanks{The author was supported bnd the Department.}          %%    Information for second author     %\author{Author Two}     %\address{Mathematical Research Section, School of Mathematical Sciences, Australian National University, Canberra ACT 2601, Australia}     %\curraddr{Department of Mathematics and Statistics, Case Western Reserve University, Cleveland, Ohio 43403}     %\email{two@maths.univ.edu.au}     %\thanks{Support information for the second author.}          %    General info     %\subjclass[2000]{Primary 54C40, 14E20; Secondary 46E25, 20C20}          \date{\today.}          %\dedicatory{This paper is dedicated to my advisor.}          \keywords{Differ??}          \begin{abstract}     This paper is      \end{abstract}          \maketitle               \tableofcontents          \section{This is a numbered first-level section head}     This is an example of a numbered first-level heading.          \subsection{This is a numbered second-level section head}     This is an example of a numbered second-level heading.               \section{This fasfdasfdsais a numbered first-level section head}     This is an example of a numbered first-level heading.          \subsection*{This is an unnumbered second-level section head}     This is an example of an unnumbered second-level heading.               \end{document}


title: TexShop Statistics (Word Count) with BasicTeX

text: I recently re-installed tex on my mac, and decided to go with the BasicTeX package rather than the full (2.4GB) MacTeX package, together with the MacTeX- additions package, which includes TexShop. (Running TeX 3.14159265 (TeX Live 2014) and TexShop 3.39). After downloading the various packages I use, everything is running smoothly, _except_ for the "statistics" functionality that provides a word count (under the menu Edit>Statistics...). After typesetting, if I call up the statistics it just displays '0' in all the fields, even if I click the "Update" button. My guess is that there is some tool (texcount, perhaps?) which is included in the full installation but not BasicTex. Is there any relatively straightforward way to get the "statistics" functionality working, or do I need to just bite the bullet and install the full MacTex package?