title: Description definitions and ntheorem

text: I want to have inline listings in description items, so I used this very nice answer. Unfortunately this hackery destroys my theorem environments with error `something's wrong--perhaps a missing \item` Here is the MWE that shows the problem:               \documentclass{article}     \makeatletter     %%inline listings in description items     \let\orig@item\item          \def\item{%         \@ifnextchar{[}%             {\lstinline@item}%             {\orig@item}%     }          \begingroup     \catcode`\]=\active     \gdef\lstinline@item[{%         \setbox0\hbox\bgroup             \catcode`\]=\active             \let]\lstinline@item@end     }     \endgroup          \def\lstinline@item@end{%         \egroup         \orig@item[\usebox0]%     }     \makeatother          \usepackage{listings}     \lstloadlanguages{C++}         \lstset{             basicstyle=\ttfamily,         }     \usepackage{ntheorem}     \newtheorem{theorem}{Theorem}          \begin{document}     \section{Descriptions}     \begin{description}     \item[\lstinline{some verb text}] here is text     \item[\lstinline{some more}] more text     \end{description}     \section{Theorems}     \begin{theorem}[A Named theorem]     \begin{equation}         e^x = \sum_{k=1}^\infty \frac{x^k}{k!}     \end{equation}              \end{theorem}     \end{document}      Is there a way to use both things without interfering?


title: Cannot build file on Editorial Manager

text: I am submitting a manuscript through Editorial Manager. I am getting this error. The manuscript successfully compiles on my local computer and also on WriteLatex which I used for editing. As I am new to Latex, I don't know how to fix this. This is compiled on the server side, so I cannot modify the installation folder. The problem is that I don't even know which line is causing the error in my manuscript file. Could someone please help me? The deadline for submission is today. It says `I can't find file 'tikzlibrarypositioning.code.tex'... l.32 \usetikzlibrary{positioning}` but I don't even declare that as a package. Is it one of the packages I use that imports that? How do I know which one? These are my imports:               \usepackage[round]{natbib}     \usepackage[colorinlistoftodos]{todonotes}     \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{array,tabularx}     \usepackage{multicol}     \usepackage{hyperref}     \usepackage{multirow}     \usepackage{verbatim}     \usepackage{a4wide}     \usepackage[caption=false]{subfig}     \usepackage{amssymb}     \usepackage{setspace}     \usepackage[section]{placeins}      The log file               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX) (format=pdflatex 2013.9.11)      31 DEC 2013 08:24      entering extended mode       restricted \write18 enabled.       %&-line parsing enabled.      **main.tex      (./main.tex      LaTeX2e       Babel  and hyphenation patterns for 78 languages loaded.           LaTeX Warning: File `example.eps' already exists on the system.       Not generating it from this source.           (c:/TeXLive/2013/texmf-dist/tex/latex/base/fix-cm.sty      Package: fix-cm 2006/09/13 v1.1m fixes to LaTeX      (c:/TeXLive/2013/texmf-dist/tex/latex/base/ts1enc.def      File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file      )) (c:/TeXLive/2013/../texmf-local/tex/latex/aries/svjour3.cls      Document Class: svjour3 2010/11/25 v3.3      LaTeX document class for Springer journals      Class Springer-SVJour3 Info: extra/valid Springer sub-package (-> *.clo)      (Springer-SVJour3) not found in option list of \documentclass      (Springer-SVJour3) - autoactivating "global" style.      (c:/TeXLive/2013/../texmf-local/tex/latex/aries/svglov3.clo      File: svglov3.clo 2009/12/18 v3.2 style option for standardised journals      SVJour Class option: svglov3.clo for standardised journals      )      LaTeX Font Info: Redeclaring math symbol \Gamma on input line 147.      LaTeX Font Info: Redeclaring math symbol \Delta on input line 148.      LaTeX Font Info: Redeclaring math symbol \Theta on input line 149.      LaTeX Font Info: Redeclaring math symbol \Lambda on input line 150.      LaTeX Font Info: Redeclaring math symbol \Xi on input line 151.      LaTeX Font Info: Redeclaring math symbol \Pi on input line 152.      LaTeX Font Info: Redeclaring math symbol \Sigma on input line 153.      LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 154.      LaTeX Font Info: Redeclaring math symbol \Phi on input line 155.      LaTeX Font Info: Redeclaring math symbol \Psi on input line 156.      LaTeX Font Info: Redeclaring math symbol \Omega on input line 157.      \logodepth=\dimen102      \headerboxheight=\dimen103      \betweenumberspace=\dimen104      \aftertext=\dimen105      \headlineindent=\dimen106      \c@inst=\count79      \c@auth=\count80      \instindent=\dimen107      \authrun=\box26      \authorrunning=\toks14      \titrun=\box27      \titlerunning=\toks15      \combirun=\box28      \c@lastpage=\count81      Manuscript     Click here to download Manuscript: main.tex      Click here to view linked References     \rubricwidth=\dimen108      \c@section=\count82      \c@subsection=\count83      \c@subsubsection=\count84      \c@paragraph=\count85      \c@subparagraph=\count86      \spthmsep=\dimen109      \c@theorem=\count87      \c@case=\count88      \c@conjecture=\count89      \c@corollary=\count90      \c@definition=\count91      \c@example=\count92      \c@exercise=\count93      \c@lemma=\count94      \c@note=\count95      \c@problem=\count96      \c@property=\count97      \c@proposition=\count98      \c@question=\count99      \c@solution=\count100      \c@remark=\count101      \c@figure=\count102      \c@table=\count103      \abovecaptionskip=\skip41      \belowcaptionskip=\skip42      \figcapgap=\dimen110      \tabcapgap=\dimen111      \figgap=\dimen112      \bibindent=\dimen113      \@tempcntc=\count104      ) (c:/TeXLive/2013/texmf-dist/tex/latex/natbib/natbib.sty      Package: natbib 2010/09/13 8.31b (PWD, AO)      \bibhang=\skip43      \bibsep=\skip44      LaTeX Info: Redefining \cite on input line 694.      \c@NAT@ctr=\count105      ) (c:/TeXLive/2013/texmf-dist/tex/latex/todonotes/todonotes.sty      Package: todonotes 2012/07/25 .dtx Todonotes source and documentation.      Package: todonotes 2012/07/25      (c:/TeXLive/2013/texmf-dist/tex/latex/base/ifthen.sty      Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)      ) (c:/TeXLive/2013/texmf-dist/tex/latex/xkeyval/xkeyval.sty      Package: xkeyval 2012/10/14 v2.6b package option processing (HA)      (c:/TeXLive/2013/texmf-dist/tex/generic/xkeyval/xkeyval.tex      \XKV@toks=\toks16      \XKV@tempa@toks=\toks17      \XKV@depth=\count106      File: xkeyval.tex 2012/10/14 v2.6b key=value parser (HA)      (c:/TeXLive/2013/texmf-dist/tex/generic/xkeyval/keyval.tex))) (c:/TeXLive/2013/      texmf-dist/tex/latex/xcolor/xcolor.sty      Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)     (c:/TeXLive/2013/texmf-dist/tex/latex/latexconfig/color.cfg      File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive      )      Package xcolor Info: Driver file: pdftex.def on input line 225.      (c:/TeXLive/2013/texmf-dist/tex/latex/pdftex-def/pdftex.def      File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX      (c:/TeXLive/2013/texmf-dist/tex/generic/oberdiek/infwarerr.sty      Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)      ) (c:/TeXLive/2013/texmf-dist/tex/generic/oberdiek/ltxcmds.sty      Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)      )      \Gread@gobject=\count107      )      Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.      Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1341.      Package xcolor Info: Model `RGB' extended on input line 1353.      Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.      Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.      Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.      Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.      Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.      Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.      ) (c:/TeXLive/2013/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (c:/TeXLive/      2013/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (c:/TeXLive/2013/texmf-dist/te      x/latex/pgf/utilities/pgfrcs.sty (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/ut      ilities/pgfutil-common.tex      \pgfutil@everybye=\toks18      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def      \pgfutil@abb=\box29      (c:/TeXLive/2013/texmf-dist/tex/latex/ms/everyshi.sty      Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)      )) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex      Package: pgfrcs 2010/10/25 v2.10 (rcs-revision 1.24)      ))      Package: pgf 2008/01/15 v2.10 (rcs-revision 1.12)      (c:/TeXLive/2013/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (c:/TeXLive/20      13/texmf-dist/tex/latex/graphics/graphicx.sty      Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)      (c:/TeXLive/2013/texmf-dist/tex/latex/graphics/graphics.sty      Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)      (c:/TeXLive/2013/texmf-dist/tex/latex/graphics/trig.sty      Package: trig 1999/03/16 v1.09 sin cos tan (DPC)      ) (c:/TeXLive/2013/texmf-dist/tex/latex/latexconfig/graphics.cfg      File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live      )      Package graphics Info: Driver file: pdftex.def on input line 91.      )      \Gin@req@height=\dimen114      \Gin@req@width=\dimen115      ) (c:/TeXLive/2013/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (c:/TeXLive/      2013/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex      Package: pgfsys 2010/06/30 v2.10 (rcs-revision 1.37)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex      \pgfkeys@pathtoks=\toks19      \pgfkeys@temptoks=\toks20      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex      \pgfkeys@tmptoks=\toks21      ))      \pgf@x=\dimen116      \pgf@y=\dimen117      \pgf@xa=\dimen118      \pgf@ya=\dimen119      \pgf@xb=\dimen120      \pgf@yb=\dimen121      \pgf@xc=\dimen122      \pgf@yc=\dimen123      \w@pgf@writea=\write3      \r@pgf@reada=\read1      \c@pgf@counta=\count108      \c@pgf@countb=\count109      \c@pgf@countc=\count110      \c@pgf@countd=\count111      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg      File: pgf.cfg 2008/05/14 (rcs-revision 1.7)      )      Package pgfsys Info: Driver file for pgf: pgfsys-pdftex.def on input line 900.      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def      File: pgfsys-pdftex.def 2009/05/22 (rcs-revision 1.26)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def      File: pgfsys-common-pdf.def 2008/05/19 (rcs-revision 1.10)      )))      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex      File: pgfsyssoftpath.code.tex 2008/07/18 (rcs-revision 1.7)      \pgfsyssoftpath@smallbuffer@items=\count112      \pgfsyssoftpath@bigbuffer@items=\count113      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex      File: pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)      )) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex      Package: pgfcore 2010/04/11 v2.10 (rcs-revision 1.7)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (c:/TeXLive/2      013/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (c:/TeXLive/2013/texmf      -dist/tex/generic/pgf/math/pgfmathutil.code.tex) (c:/TeXLive/2013/texmf-dist/te      x/generic/pgf/math/pgfmathparser.code.tex      \pgfmath@dimen=\dimen124      \pgfmath@count=\count114      \pgfmath@box=\box30      \pgfmath@toks=\toks22      \pgfmath@stack@operand=\toks23      \pgfmath@stack@operation=\toks24      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.te      x)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric      .code.tex)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.t      ex)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.co      de.tex)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.te      x)      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex      ))) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex      \c@pgfmathroundto@lastzeros=\count115      )) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.te      x      File: pgfcorepoints.code.tex 2010/04/09 (rcs-revision 1.20)      \pgf@picminx=\dimen125      \pgf@picmaxx=\dimen126      \pgf@picminy=\dimen127      \pgf@picmaxy=\dimen128      \pgf@pathminx=\dimen129      \pgf@pathmaxx=\dimen130      \pgf@pathminy=\dimen131      \pgf@pathmaxy=\dimen132      \pgf@xx=\dimen133      \pgf@xy=\dimen134      \pgf@yx=\dimen135      \pgf@yy=\dimen136      \pgf@zx=\dimen137      \pgf@zy=\dimen138      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.cod      e.tex      File: pgfcorepathconstruct.code.tex 2010/08/03 (rcs-revision 1.24)      \pgf@path@lastx=\dimen139      \pgf@path@lasty=\dimen140      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.te      x      File: pgfcorepathusage.code.tex 2008/04/22 (rcs-revision 1.12)      \pgf@shorten@end@additional=\dimen141      \pgf@shorten@start@additional=\dimen142      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex      File: pgfcorescopes.code.tex 2010/09/08 (rcs-revision 1.34)      \pgfpic=\box31      \pgf@hbox=\box32      \pgf@layerbox@main=\box33      \pgf@picture@serial@count=\count116      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code      .tex      File: pgfcoregraphicstate.code.tex 2008/04/22 (rcs-revision 1.9)      \pgflinewidth=\dimen143      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.c      ode.tex      File: pgfcoretransformations.code.tex 2009/06/10 (rcs-revision 1.11)      \pgf@pt@x=\dimen144      \pgf@pt@y=\dimen145      \pgf@pt@temp=\dimen146      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex      File: pgfcorequick.code.tex 2008/10/09 (rcs-revision 1.3)      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.te      x      File: pgfcoreobjects.code.tex 2006/10/11 (rcs-revision 1.2)      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.co      de.tex      File: pgfcorepathprocessing.code.tex 2008/10/09 (rcs-revision 1.8)      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex      File: pgfcorearrows.code.tex 2008/04/23 (rcs-revision 1.11)      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex      File: pgfcoreshade.code.tex 2008/11/23 (rcs-revision 1.13)      \pgf@max=\dimen147      \pgf@sys@shading@range@num=\count117      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex      File: pgfcoreimage.code.tex 2010/03/25 (rcs-revision 1.16)           (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex      File: pgfcoreexternal.code.tex 2010/09/01 (rcs-revision 1.17)      \pgfexternal@startupbox=\box34      )) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.te      x      File: pgfcorelayers.code.tex 2010/08/27 (rcs-revision 1.2)      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code      .tex      File: pgfcoretransparency.code.tex 2008/01/17 (rcs-revision 1.2)      )      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex      File: pgfcorepatterns.code.tex 2009/07/02 (rcs-revision 1.3)      ))) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.te      x      File: pgfmoduleshapes.code.tex 2010/09/09 (rcs-revision 1.13)      \pgfnodeparttextbox=\box35      ) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex      File: pgfmoduleplot.code.tex 2010/10/22 (rcs-revision 1.8)      )      (c:/TeXLive/2013/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.st      y      Package: pgfcomp-version-0-65 2007/07/03 v2.10 (rcs-revision 1.7)      \pgf@nodesepstart=\dimen148      \pgf@nodesepend=\dimen149      )      (c:/TeXLive/2013/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.st      y      Package: pgfcomp-version-1-18 2007/07/23 v2.10 (rcs-revision 1.1)      )) (c:/TeXLive/2013/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (c:/TeXLive/2      013/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (c:/TeXLive/2013/texmf-dist/      tex/generic/pgf/utilities/pgfkeys.code.tex)) (c:/TeXLive/2013/texmf-dist/tex/ge      neric/pgf/utilities/pgffor.code.tex      Package: pgffor 2010/03/23 v2.10 (rcs-revision 1.18)      \pgffor@iter=\dimen150      \pgffor@skip=\dimen151      \pgffor@stack=\toks25      \pgffor@toks=\toks26      )) (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex      Package: tikz 2010/10/13 v2.10 (rcs-revision 1.76)           (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.co      de.tex      File: pgflibraryplothandlers.code.tex 2010/05/31 v2.10 (rcs-revision 1.15)      \pgf@plot@mark@count=\count118      \pgfplotmarksize=\dimen152      )      \tikz@lastx=\dimen153      \tikz@lasty=\dimen154      \tikz@lastxsaved=\dimen155      \tikz@lastysaved=\dimen156      \tikzleveldistance=\dimen157      \tikzsiblingdistance=\dimen158      \tikz@figbox=\box36      \tikz@tempbox=\box37      \tikztreelevel=\count119      \tikznumberofchildren=\count120      \tikznumberofcurrentchild=\count121      \tikz@fig@count=\count122      (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex      File: pgfmodulematrix.code.tex 2010/08/24 (rcs-revision 1.4)      \pgfmatrixcurrentrow=\count123      \pgfmatrixcurrentcolumn=\count124      \pgf@matrix@numberofcolumns=\count125      )      \tikz@expandcount=\count126           (c:/TeXLive/2013/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzli      brarytopaths.code.tex      File: tikzlibrarytopaths.code.tex 2008/06/17 v2.10 (rcs-revision 1.2)      )))      ! I can't find file `tikzlibrarypositioning.code.tex'.       ...nput tikzlibrary\pgf@temp .code.tex       \catcode `\@ =\csname tikz...      l.32 \usetikzlibrary{positioning}           (Press Enter to retry, or Control-Z to exit)      Please type another input file name      ! Emergency stop.


title: Problem with scrolling in TeXStudio

text: I am using Macbook Pro and TeXStudio. While viewing the Tex file, the page is always scrolling back to the top automatically. How to solve this ?


title: Alternative for \DeclareMathOperator

text: I'm getting a little tired of defining all my mathematical operators with `\DeclareMathOperator`. Also it is rarely useful to have them as a macro. On the contrary it sometimes leads to macro name collision (e.g. `\span`). So I came up with the following:               \documentclass{article}     \usepackage{amsmath}     \catcode`\¡=\active     \def¡#1!{\operatorname{#1}}     \begin{document}         \[e^{ix} = ¡cos! x + i¡sin! x\]     \end{document}      I'd like to get rid of the `!` at the end and maybe use `\ifmmode`, to allow `¡` in normal text. Is that possible? Are there other side effects of my definition I should be aware of?


Can the Latex pick up the size of font in table? I want to create the table with rigorous bounds and that Latex pick up the size of font by itself.


title: ExPex: Continuing labels of subparts in multipart examples

text: I rely heavily on ExPex and have a problem in automatically labeling subparts of multipart examples:               Consider the following construction:          \pex<like>     \a[label=0] I like X     \xe          Some folks might say something like:          \pex[exno=\getref{like}]     \a I like food     \a I like pens     \xe          Observe the similarity to the construction:          \pex<wantz>     \a[label=0] Me wantz X     \a Me wantz food     \a Me wantz pens     \xe          But there’s more!          \pex[exno=\getref{like}]     \a I like LaTeX     \a I like ExPex     \xe      I get the result on the left side but want the result on the right side: ![](http://i.imgur.com/aCBl3v1.png) In other words, I want the numbers of the subparts of a given multipart examples to just go on. I could do it using \a[label=] every time and keeping track by myself, but that seems tedious and unreliable. I suspect that there is some way I could use \pexcnt to do the trick, but even after reading the manual a few times, I have not clue how to.


title: Issues when including matlab code in Latex

text: I am currently trying to implement my Matlab-Code into `TeX`. Weird enough, when programming a minimum working example, everything works pretty fine. However, when I use my real document, I only get errors. Here the MWE:               \documentclass{article}     \usepackage[numbered]{mcode}     \definecolor{lightgray}{rgb}{0.9,0.9,0.9}     \renewcommand{\lstlistingname}{Quellcode}     \lstset{backgroundcolor=\color{lightgray},             linewidth=15.5cm,}     \begin{document}     \lstinputlisting[label={hans}, caption=Funktion {\ttfamily setminInt}]                     {"E:/Program Files/MATLAB/projects/master/classes/Customer.m"}     \end{document}      Here's the preamble of the original document (although heavily shortened):               \documentclass[a4paper,12pt,parskip,bibtotoc,liststotoc]{article}          \usepackage{fontenc}     \usepackage[ngerman, english]{babel}        \usepackage{setspace}      %fr Zeilenabstand     \usepackage[notindex,nottoc]{tocbibind}  %Inhaltsverzeichnisse erstellen          %zustzliche bentigte Pakete     \usepackage{graphicx}      %Graphik     \usepackage{amsmath,amssymb}  %Mathematik     \usepackage{natbib}       %Zitate     \usepackage{marvosym}      %enthlt Symbole wie das Eurozeichen     \usepackage{eurosym}     %\setcounter{secnumdepth}{3}     %\setcounter{tocdepth}{3}          \usepackage[numbered]{mcode}     \definecolor{lightgray}{rgb}{0.9,0.9,0.9}     \renewcommand{\lstlistingname}{Source Code}     \lstset{backgroundcolor=\color{lightgray},             linewidth=15.5cm,}          \setlength{\parskip}{3pt} % 1ex plus 0.5ex minus 0.2ex}               \usepackage{mdwlist}      \usepackage[labelsep=space,justification=centering]{caption}          %\usepackage{hyperref} %erlaubt Links innerhalb des pdf-Dokuments zu erzeugen          \setlength{\parindent}{0pt}   %Verhinderung des horizontalen Einrckens zu Beginn eines Absatzes          %Seitenlayout     \topmargin -0.9cm    %Vertikaler Abstand der Kopfzeile von der Bezugslinie     \textheight 25cm    %Abstand der Grundlinie der Kopfzeile zum Haupttext     \textwidth 16.5cm    %Breite des Haupttexts     \footskip 1cm      %Abstand der Grundlinien der letzten Textzeile und der Fuzeile     \voffset -0.5cm     %Vertikale Bezugspunktposition     \hoffset -1.2cm     %Horizontale Bezugspunktposition          \onehalfspacing     %anderthalbzeiliger Abstand          \newcommand{\url}{\;}  %URL im Literaturverzeichnis          \begin{document}     \lstinputlisting[caption=Funktion {\ttfamily setminInt}]                         {"E:/Program Files/MATLAB/projects/master/classes/Customer.m"}     \end{document}      I always get the error: ("E:\Program Files (x86)\MiKTeX 2.9\tex\latex\psnfss\ot1pcr.fd")) ! Incomplete \iffalse; all text was ignored after line 560. So `miktex` ignores everything that's written in the customer class (the code starts at line 560)


title: Fitting column headers on one row

text: I have the following table:               \documentclass[12pt,notitlepage]{article}     \usepackage{setspace}      \usepackage{ifthen}     \usepackage{booktabs}     \usepackage{array}     \usepackage{multirow}     \usepackage{tabularx}     \usepackage{caption}          \begin{document}     \begin{table}[!h]         \captionsetup{font=bf, labelsep=period, singlelinecheck=off}         \caption{DI detection results}              {\footnotesize \onehalfspacing         \newcolumntype{W}{>{\raggedright\arraybackslash}X}         \newcolumntype{Y}{>{\raggedleft\arraybackslash}X}         \newcolumntype{Z}{>{\centering\arraybackslash}X}         \begin{tabularx}{\textwidth}{clZZZZZ}         \toprule         \multirow{2}{*}{Criterion} & \multirow{2}{*}{Statistic} & Total Period & Period 1 & Period 2 & Period 3 & Period 4\\         & & (2000--2012) & (2000--2002) & (2003--2005) & (2006--2008) & (2009--2012) \\ \otoprule             Criterion 1 & Threshold  & 360.5 & 601.2 & 601.2 & 601.2 & 601.2 \\                   & Detected (DI) & 32    & 31    & 64    & 31    & 12 \\                   & Simultaneously detected & 18    & 15    & 34    & 6     & 5 \\                   & Prop. (\%)  & 56.3  & 48.4  & 53.1  & 19.4  & 41.7 \\                   &       &       &       &       &       &  \\             Criterion 2 & Threshold  & 307.4 & 514.0 & 514.0 & 514.0 & 514.0 \\                   & Detected (DI) & 37    & 39    & 68    & 32    & 15 \\                   & Simultaneously detected & 21    & 16    & 35    & 7     & 5 \\                   & Prop. (\%)  & 56.8  & 41.0  & 51.5  & 21.9  & 33.3 \\                   &       &       &       &       &       &  \\             Criterion 3 & Threshold  & 261.7 & 438.9 & 438.9 & 438.9 & 438.9 \\                   & Detected (DI) & 47    & 46    & 74    & 39    & 20 \\                   & Simultaneously detected & 26    & 20    & 38    & 11    & 5 \\                   & Prop. (\%)  & 55.3  & 43.5  & 51.4  & 28.2  & 25.0 \\             \bottomrule             \end{tabularx}}         \end{table}          \end{document}      which outputs: ![enter image description here](http://i.stack.imgur.com/HXXAV.jpg) However I do not like the appearance of column titles such as 'Total Period' and the year beneath it. I'd like to be able to fit "Total Period" all on one row and same with the years, e.g., (2000--2012) on one row rather than split across two. How can I do this?


title: Automatically add List of Abbreviations (totcount and acronym)

text: I would like to have a list of abbreviations automatically added if there are abbreviations. I am using acronym for the abbreviations and am currently trying to count the `\ac` commands using totcount.               \documentclass[english, a4paper, 10pt]{article}          %abbreviations     \usepackage[printonlyused]{acronym}          %count acronyms     \usepackage{totcount}     \newtotcounter{acro_num}     \def\oldac{} \let\oldac=\ac     %FIXME_1: \def\ac{\stepcounter{acro_num}\oldac}          \begin{document}          \section{Document Start}          %list of abbrev     \ifnum\totvalue{acro_num}>0%     \section*{List of Abbreviations}     \fi     \begin{acronym}[12345678]     \setlength{\parskip}{0pt}     \setlength{\partopsep}{0pt}     \setlength{\topsep}{0pt}     \setlength{\parsep}{0pt}     \setlength{\itemsep}{0pt}       %list of acronyms       \acro{ABR}{abbreviation}     \end{acronym}     \ifnum\totvalue{acro_num}>0%     \clearpage     \fi               %reset abreviations     \acresetall          %document     \section{Amazing...}          %FIXME_2: \ac{ABR} is working!          Bla bla...          \end{document}      **Problem:**   If `FIXME_1` is commented in and `FIXME_2` is commented out, there is a space in the document (looks weird, especially with sections!) (PS: `\ifnum` around the whole block does not work) Can anyone help? Thank you very much!


title: Color package interferes with sections

text: I would like to use the `color` package to define custom color for listings background but when I include it it creates nasty side effect on my numbered section headers (only section, not lower levels). This is how the section header looks like:   * color package is included ![When color package is included](http://i.stack.imgur.com/jup11.png)   * color package is commented [Color package commented] ![enter image description here](http://i.stack.imgur.com/wEhKd.png) I think the problem is with this package because this happens only when I include it. This is my preamble file:               \usepackage[margin=2.5cm]{geometry}  %postavljanje margine     \usepackage[utf8]{inputenc}     \usepackage[croatian]{babel}     \usepackage[fixlanguage]{babelbib}     \selectbiblanguage{croatian}     \usepackage{graphicx}          \usepackage[hang,small,bf,justification=centering]{caption}     \usepackage{subcaption}     \usepackage{chngcntr}          \usepackage{tocloft}  %tablica sadržaja     \renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}  %točkice na sadržaju     \usepackage{lmodern}     \usepackage{hyperref}     \usepackage{cite}     \usepackage{setspace}  %postavi prored     \onehalfspacing  %prored 1.5     \usepackage[acronym]{glossaries}     \input{glossary}     \renewcommand{\acronymname}{Oznake i kratice}     \makeglossaries     \usepackage{parskip}  %preskakanje paragrafa          %\usepackage{color}     \usepackage{listings}  %postavke za pseudokodiranje i umetanje koda     \lstset{       language=C,                % choose the language of the code       numbers=left,                   % where to put the line-numbers       stepnumber=1,                   % the step between two line-numbers.               numbersep=5pt,                  % how far the line-numbers are from the code       %backgroundcolor=\color{gray},  % choose the background color. You must add \usepackage{color}       showspaces=false,               % show spaces adding particular underscores       showstringspaces=false,         % underline spaces within strings       showtabs=false,                 % show tabs within strings adding particular underscores       tabsize=2,                      % sets default tabsize to 2 spaces       captionpos=b,                   % sets the caption-position to bottom       breaklines=true,                % sets automatic line breaking       breakatwhitespace=true,         % sets if automatic breaks should only happen at whitespace       title=\lstname,                 % show the filename of files included with \lstinputlisting;     }          %naslovi     \usepackage{titlesec}     \titleformat*{\section}{\scshape\large\bfseries\MakeUppercase}     \titleformat*{\subsection}{\normalsize\bfseries}     \titleformat*{\subsubsection}{\normalsize}     \usepackage{secdot}     \sectiondot{subsection}     \sectiondot{subsubsection}          %brojevi uz podnaslove     \usepackage{chngcntr,tocloft}     \counterwithin*{figure}{section}     \counterwithin*{figure}{subsection}     \counterwithin*{figure}{subsubsection}          \addtolength{\cftfignumwidth}{2em}               \renewcommand{\thefigure}{%       \ifnum\value{subsection}=0         \thesection.\arabic{figure}%       \else         \ifnum\value{subsubsection}=0           \thesubsection.\arabic{figure}%         \else           \thesubsubsection.\arabic{figure}%         \fi       \fi     }


title: How to nicely format a table including measurement errors

text: I have a table which contains measurement results. Currently I have one column per measurement 'type'. In each column, I have values like `$+$0.74\,\,$\pm$\,\,0.14`. The table is rather long (~30 rows), and looks very unorganized. I think it is possible to align the column on _one_ character, like the (first?) `.`, or the `$\pm$`. However, I think that then it still looks unorganized. Is there a way to align table columns on more than one item, like both `.` _and_ the `$\pm$`. Maybe this will also look weird, I don't know. Here is what I currently have:               \documentclass{article}     \usepackage{booktabs}     \begin{document}     \begin{tabular}{lccccl}      & A & B & C & D & E\\     continental US      & $-$0.81\,$\pm$\,0.14 & $-$1.7\,$\pm$\,0.30 & $-$0.81\,$\pm$\,0.15 & $-$1.6\,$\pm$\,0.30 & $-$0.78 \\     Central-Eastern US  & $-$2.9\,$\pm$\,0.38  & $-$3.0\,$\pm$\,0.38 & $-$2.9\,$\pm$\,0.39  & $-$2.9\,$\pm$\,0.39 & $-$2.7  \\     Western Europe      & $-$2.9\,$\pm$\,0.63  & $-$2.6\,$\pm$\,0.56 & $-$3.0\,$\pm$\,0.65  & $-$2.6\,$\pm$\,0.56 & $-$2.6  \\     Japan               & $-$0.49\,$\pm$\,0.13 & $-$1.2\,$\pm$\,0.33 & $-$0.49\,$\pm$\,0.14 & $-$1.2\,$\pm$\,0.33 & $-$0.49 \\     Middle East         & $+$0.78\,$\pm$\,0.08 & $+$4.0\,$\pm$\,0.42 & $+$0.79\,$\pm$\,0.08 & $+$4.0\,$\pm$\,0.42 & $+$0.72 \\     East Central China  & $+$10\,$\pm$\,1.1    & $+$21\,$\pm$\,2.2   & $+$10\,$\pm$\,1.1    & $+$20\,$\pm$\,2.2   & $+$8.7  \\     North Central India & $+$1.3\,$\pm$\,0.27  & $+$4.0\,$\pm$\,0.84 & ~~1.1\,$\pm$\,0.27   & $+$4.6\,$\pm$\,1.1  & $+$1.1  \\     \end{tabular}     \end{document}      Any suggestions to make this nicer are welcome :)


title: Unreasonable orphans in lines (classicthesis)

text: I am using classicthesis in Lyx, and I run into some weird orphans. From what I can see, there are no reasons for them to occur (see image for two examples). ![Problem](http://i.imgur.com/A9dyxwW.png) I am using this package in my preamble: \usepackage[left=3.5cm,right=3.5cm]{geometry}


title: Subfig package and tufte class

text: I am using the `subfig` package in combination with the tufte latex class. Unfortunately I did not manage to make it work error free. As discussed in other forums (see here), the subfig package alters the caption size of all floats, which can be prevented by using the option `caption=false` when loading the package. However, this somehow confuses the hyperlinks in the document, such that figure and table references are linked to section headers instead of the figures and tables. Here is an example of the problem I have               \documentclass{tufte-book}          %\usepackage[caption=false]{subfig}     \usepackage{subfig}          \begin{document}     \chapter{A}     \section{This section}     If [caption = false] is used, the hyperrefs go to the section heather above, instead of going to Figure~\ref{testfig} or to Table~\ref{testtab}. If it is not used, the hyperrefs work, but the figure captions are printed with a bigger fontsize than they usually do.          \vspace{10cm}          \begin{figure}     \caption{This is the test figure}\label{testfig}     \end{figure}          \begin{table}     \caption{This is the test table}\label{testtab}     \end{table}          \end{document}      I know this is a detail, but I am curious if there is a workaround. I have no clue on how to solve this issue on my own. Thanks in advance for any help!


title: TeX Syntax In Mathematica

text: Why cant I write Tex syntax directly in Mathematica however, I can paste it in from another editor and it is converted to pretty syntax?


title: generate schematic diagram with shapes and curved path

text: I wish to generate the following figure: ![enter image description here](http://i.stack.imgur.com/kGUq2.png) So far I have managed:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \begin{document}     \begin{tikzpicture}[transition/.style = {rectangle,draw = black!50, fill = black!20, thick}]     \draw [>=stealth, ->](0,0) -- (0cm,-10cm) node[left, midway] {Depth};     \draw [>=stealth, ->](0cm,0cm) -- (10cm,0cm) node[above, midway] {Temperature [$^{o}$C]};     \draw[dashed] (1.99,0) -- (1.99,-10);     \draw (10,0).. controls (9.5,-2) and (8,-4) .. (7,-4) .. controls (5,-5) and (3,-7) .. (2.5,-8);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/VXw8d.png) Where as you can see I am struggling with generating the curved line. It seems like there must be a better way of generating a line like this, other than the method I have chosen. In addition, I am unsure of how to generate the rectangle in the middle of the diagram (when I try to do this, the rectangle appears in the top left hand corner of the page). Furthermore, how can I specify the node 'Temperature' to be above the numbers? Note that I have scaled the diagram so that 20 on the diagram is equal to 10 cm, thus I can use this to space the values shown.


title: What to do when a package conflicts with a development version of another one?

text: I'm not sure about making this question here but I don't know where to do it. I'm using cvs version of TikZ and from time to time I found it incompatible with some other packages based on its released version. Some time ago it happened with `forest` (although I think it's solved) and today happened with `tikzposter` and tikz-mimo-shapes. If I use pgf-2.1 everything works, but with cvs version some error stops compilation. So, what to do know? With `forest` I sent a message to the author and he provided me a patch which I think was later incorporated into a newer version. Another option would be to fill a bug report in pgf's place explaining these problems. An the last one would be to use or not cvs version depending on what package I'm using, but this one is not very comfortable. What do you suggest?


title: How to solve "! LaTeX Error: File `todonotes.sty' not found" in Linux?

text: I'm running Fedora 20 and trying to compile the following simple document:               \documentclass[a4paper]{article}          \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage[colorinlistoftodos]{todonotes}          \title{Your Paper}          \author{You}          \date{\today}          \begin{document}     \maketitle          Hello, World!          \end{document}      After this I get the error `! LaTeX Error: File todonotes.sty not found` and don't know how to fix it. I use TexMaker and have everything installed, but still get this. How can I fix it? Thanks.


title: How is it possible that references are not in the correct order if I put them in a figure caption in LyX?

text: I'm using LyX and I added a reference to a figure caption. Now this reference is the number [1] in the reference list even if it appears later than many others. It looks like the float captions have a higher priority in counting references' appearance. I added many things to my preamble but even if I delete those lines in the preamble the problem stays. I'm using a customized bibtex style, but in a brand new article it works in the proper way. Where could the problem stay?


title: Arithmetic in arguments to the geometry package

text: I'd like to use the `geometry` package to auto-crop the output of my LaTeX (so that it looks bigger on-screen as I'm editing). I have found a way to remove the margins completely and brutally:               \geometry{paperwidth=\textwidth,  paperheight = \textheight, margin=0cm}      However, I'd like to be somewhat more gentle. I tried the following, but it does not work:               \geometry{paperwidth=\textwidth + 1cm,  paperheight = \textheight+1cm, margin=1cm}      The reason is that arithmetic does not work inside these arguments. (LaTeX doesn't seem smart enough to do the addition). What is the correct way to achieve this effect?


title: Center table on page

text: I would like to center a table on the page, not only the content. But I can't find the right keyparameter or command. I have follwing table               \documentclass[11pt]{scrartcl}     \usepackage{multirow}          \usepackage[a4paper]{geometry}      \geometry{a4paper,tmargin=3.5cm, bmargin=2.5cm, lmargin=2cm, rmargin=2.5cm, headheight=3em, headsep=1.5cm, footskip=1cm}                \begin{document}     Erstellen Sie folgende Tabelle in der Datei \emph{A2.tex}. Verwenden sie       dazu die Befehle \texttt{\textbackslash multirow},  \texttt{\textbackslash       multicolumn}, \texttt{\textbackslash hline} und \texttt{\textbackslash cline}.              \begin{tabular}{|c|c|c|c|}             \hline             \multirow{3}{*}{Zelle A}& Zelle B & \multicolumn{2}{|c|}{Zelle C} \\             \cline{2-4}             &\multicolumn{2}{|c|}{Zelle D}& Zelle F \\             \cline{2-4}              & Zelle H & Zelle I & Zelle J \\              \cline{1-4}             \multicolumn{4}{|c|}{Zelle K} \\             \hline         \end{tabular}          \end{document}      How can I center the whole table horizontally?


title: How do I ensure my images/graphics are embedded in the output document?

text: I am new to LaTex and I am learning the concept and terminology by using Lyx (TeX live under Linux). I created my first document using the `Book` class, added some images (combination of jpgs/pngs), and compiled to PDF. After sending the PDF to a Windows 7 PC and opening the PDF there the images where replaced by place holders and I got an error message. It was searching for the images on the target computer. How do I ensure my images/graphics are _embedded_ in the output document?


title: Why does pgffor not calculate correctly?

text: I have the following problem: I want to draw some moiree effects in tikz. This seems to be no problem. I did it without any error (two circles of trapezia). Now the two rings should be moved a bit. I added things and nothing worked anymore. I give you a reduced code below. Unfortunately the problem arises only if I calculate the movement by pgfmath. If I give them directly, all right, no error. The (reduced) code:               \documentclass[a4paper,12pt,notitlepage]{article}     \usepackage{tikz}     \usepackage{pgffor}     \usetikzlibrary{scopes}     \newcommand{\drawCircularLines}[2]     {         \foreach \i          [             evaluate=\i as \startAngle using 360/#1*(\i-1)+#2,             evaluate=\i as \endAngle using 360/(2*#1)*(2*\i-1)+#2         ]         in {1,...,#1}         {             \draw (\startAngle:2cm) -- (\startAngle:3cm) -- (\endAngle:3cm) -- (\endAngle:2cm) -- cycle;         }     }          \newcommand{\moireeTest}[3][0]     {         \begin{figure}         \centering         \begin{tikzpicture}             { [color=red]                 \drawCircularLines{#2}{0}             }             { [color=blue]                 \drawCircularLines{#3}{#1}             }         \end{tikzpicture}         \caption{Moiree Test mit #2 und #3 Strichen (Delta #1).}         \end{figure}     }          \begin{document}          \pgfmathparse{360/80/1*0}     \moireeTest[\pgfmathresult]{5}{3}          \end{document}      If you replace the `\pgfmathresult` by `0` or delete the optional argument you see the correct 3 trapezia in blue. Can you tell me, where is my fault? Thanks


title: Weird behaviour of \FuncSty in algorithm2e

text: I'm using the small capital font \textsc{MyAlgorithm} several times inside my algorithm2e environment as follows:               \documentclass[a4paper, english]{article}     \usepackage{amsmath}      \usepackage{amssymb}     \usepackage{amsthm}     \usepackage[ruled,linesnumbered,vlined]{algorithm2e}          \begin{document}          \begin{algorithm}     \DontPrintSemicolon     \FuncSty{${\textsc{FirstAlgorithm}}(a, b))$} \Begin{       $ X \leftarrow \textsc{AnotherAlgorithm}(c, d)$\;     }     \end{algorithm}          \end{document}      I don't undestand why FirstAlgorithm has a completely and unexpected (looks like \textit) font and AnotherAlgorithm later looks as it should? Any ideas?


title: Background color gradient for entire document

text: Is anyone aware if it's possible to change an entire document's background to a fading color? In other words, can you take silver and slowly fade it to white from left to right and have this same effect throughout the entire document? I understand I could probably take Inkscape, make an image and put a background image for each page. I cannot find anything native which works so far. Note that this is for a normal `report` based document and not for a `beamer` presentation.


title: Rd.sty throws ! LaTeX Error: Command \bold already defined.

text: I have to use `Rd.sty` package can be obtained from here in my `.Rnw` documents. Without using `\usepackage{Rd}` everything works fine. But the inclusion of `\usepackage{Rd}` throws the following error:               ! LaTeX Error: Command \bold already defined.                    Or name \end... illegal, see p.192 of the manual.      I goggled for the solution and found a comment about the problem but could not resolve the issue. Sorry for not providing MWE because only `\usepackage{Rd}` causes the error. Thanks in advance for your help.


title: Algorithm with Latex ( Package algorithmicx)

text: This is my algorithm:                \usepackage{graphicx}      \usepackage[linesnumbered,ruled,vlined]{algorithm2e}      \usepackage{algorithmicx}      \usepackage{algpseudocode}      %\usepackage{algorithmic}      \usepackage{float}      \begin{document}      \begin{algorithm}      \caption{Euclid's algorithm}\label{euclid}      \begin{algorithmic}[1]      \Procedure{Euclid}{$a,b$}      \State $r\gets a\bmod b$      \While{$r\not=0$}      \State $a\gets b$      \State $b\gets r$      \State $r\gets a\bmod b$      \EndWhile      \State \textbf{return} $b$\Comment{The gcd is b}     %\EndProcedure      \end{algorithmic}      \end{algorithm}      \end{document}      i have this error:               ./llncs1.dem: 102: Missing number, treated as zero /EndWhile      Have you an idea please ?


title: psfrag equivalent for pdflatex

text: I am currently updating my workflow from the old `tex2ps2dvi` workflow (needs a lot of time and `matplotlib` and other stuff etc. hasn't a EPS output (only PDF, SVG, PS, PNG, etc...). I am trying to adopt the font in my picture to the rest of my document. Normally I use:               \psfrag{old text in old font}[l][l]{new text in new font}     \psfrag{old text in old font}[90][l][l]{90 deg rot new text in new font}      But I always have to save it as pdf and then open it with Illustrator and modify it and save it as EPS then include it... Is there a native implementation of `psfrag` in LaTeX, which can handle the text-replacement with `pdflatex`?


title: Add indent to \footnoterule

text: I would like to show the footnote rule with the same indentation as the footnote. I have tried with something like               \renewcommand\footnoterule{%       \kern-3\p@       \rule{.4\columnwidth}{0.4pt}       \kern2.6\p@}      But it produces inconsistent results. In some cases the rule is indented, in other cases it appears in the same line as the last line of text in the page.


title: \makechapterstyle{} for scrreprt (change chapter title format)

text: The memoir-class offers the command \makechapterstyle{} to define the look of all chapter titles (e.g. https://www.writelatex.com/1312879nbdvry#/3224717/) Is there a way to create something similar with the scrreprt-class? ![Example form Bristol university](http://i.stack.imgur.com/mhS6A.png)


title: How to provide format in latex

text: How to give the format of ZOZZLE as follows in latex? (please disregards to blue highlight, it is due to selection of mouse) ![enter image description here](http://i.stack.imgur.com/yoqcS.png)


title: Some Chinese fonts cannot be used in xelatex

text: I'm using xelatex for I have to deal with Chinese characters. However, something weired bothers me.               \usepackage{xeCJK}     ...      The following command has no bold effect:               \textbf{\fontspec{SimSun} 中文}      If this is because SimSun have no bold shape, the following problem is much more weired:               {\fontspec{STXinwei} 中文}     \textbf{\fontspec{STXinwei} 中文}      The former command shows Chinese characters in default font but the latter shows them in STXinwei! I am using linux and this is my fc-list output               /path to my font/ SimSun 宋体:style=regular     /path to my font/ STXinwei 华文新魏:style =regular


title: How to change theorem name from english to french in LaTeX?

text: I would like to change the name of `Theorem` and `lemma` in `LaTeX` to french like this:   * `Theorem` to `Théorème`   * `Lemma` to `Lemme` I saw answers related to this question but with `beamer`, e.g., Change theorem name in Beamer. So is there a way to do it in LaTeX? Also, is there a standard method to do this modification to change name of other things like `Algorithm` to `Algorithme`, ...


title: biblatex: postnote behavior

text: With `style=authoryear`, `biblatex` has this neat feature of automatically adding "p. " or "pp. " before page numbers. My problem is that if I add a further comment after the page number such as ", emphasis added", I lose this feature (which makes my citations inconsistent to each other). Here is a MWE:               \documentclass{article}     \usepackage[style=authoryear,natbib=true]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{referencia.bib}     @misc{john-73,     author = {John, S.},     year = {1973},     title = {The best book ever},     }     \end{filecontents}               \addbibresource{referencia.bib}          \begin{document}          ``Some quotation'' \citep[43]{john-73}.          ``Some quotation'' \citep[see][43]{john-73}.          ``Some \emph{quotation}'' \citep[][43, emphasis added]{john-73}.           \end{document}      And here is my ouput: > “Some quotation” (John, 1973, p. 43). > > “Some quotation” (see John, 1973, p. 43) > > “Some _quotation_ ” (John, 1973, 43, emphasis added). The symbol "p. " disappears in the third citation. So, my question is this: how can I preserve "p. " while adding postnotes such as "emphasis added"? Is there a standard way of doing that?


title: (Autor, year) reference as well as citation style

text: The journal publisher has certain demands for citation and references which I have to fulfill. Following are the demands: > All citations in text should refer to: 1. Upto two authors: Both authors > last name without initials {comma} year of publication. 2. More than two > authors: First author's last name followed by et al. {comma} year of > publication. > > All references: References should be sorted alphabetically and then > chronologically. More than one reference from the same author(s) in the same > year must be identified by the letters 'a', 'b', 'c' etc. placed after the > year of publication. > > Examples: > > Reference to a journal publication: Van der Geer, J., Hanraads, J.A.J., > Lupton, R.A., 2010. The art of writing a scientific article. J. Sci. Commun. > 163, 51–59. > > Reference to a book: Strunk Jr., W., White, E.B., 2000. The Elements of > Style, fourth ed. Longman, New York. My efforts: I tried to use `biblatex` for the first time since I read that it has more options for customization. I keep getting errors of the form > command ---- already defined for commands `\bibhand, \c@author, \citename, \bibfont, \Citeauthor` I investigated the `.cls` file and found that it uses `natbib` package by including the line: `\RequirePackage[\@biboptions]{natbib}`. I tried with `natbib` package by including the following line: `\usepackage[square,sort,comma,numbers]{natbib}` It gave me an error, `Option clash for package natbib`. I have no clue what else to do. Could somebody guide me as to how I should generate the required reference and citation styles? Note: I would preferably not change the `.cls` file since it is provided by publishers, but I can try out such solutions. The source for above text is: http://www.elsevier.com/journals/medical-image-analysis/1361-8415/guide-for- authors#68000 * * * Update: I commented out the line in .cls file which loads natbib. Now problem with natbib is solved. I am trying to get desired results with natbib


title: Does a (Lua) approach exist, to read XML data into a .tex file?

text: I am having a lot of data in `.xml` files which look like this:               <DATA>       <NAME="name" />       <VERSION="1" />       <VARIABLES>         <TEST>           <ELEMENT atr="0" atr2="1">123456.000000001</ELEMENT>         </TEST>       </VARIABLES>     </DATA>      I have to write a lot of templates reading this data for documentation and I would like to do this with LaTeX. Does any approach exist, to write this data into a `.tex` file? I want to write a file, where each `{SOMETHING/SOMETHINGELSE}` gets replaced by the XML value. A bonus would be, to get it rounded. As I am using LuaLaTeX, I guess there could be an approach in this language. But any other possibility would be interesting for me, too. Unluckily, I am not the scripting guy, but if you say, I should do this in python (which I would be willing to learn...), I will move this to an other SX-page. The file would look something like this:               % arara: lualatex          \documentclass{article}     \usepackage{booktabs}     \usepackage{siunitx}          \begin{document}     \section{VolumeFlows}     A variable: $x=\SI{{VARIABLES/TEST/ELEMENT}}{\metre}$          \begin{table}%     \centering     \begin{tabular}{l S}     \toprule     Name & {Value}\\     \midrule     A variable & {VARIABLES/TEST/ELEMENT}\\     \bottomrule     \end{tabular}     \end{table}     \end{document}


title: Extended graphics State pgf error in Acrobat

text: I'm compiling with `pdflatex` in Ubuntu with TeX Live 2012. When I open the pdf with evince, I have no problem. But when I open the pdf with Acrobat in Windows and I reach a page where there's a tikz-picture, I get the following error: "Could not find the Extended Graphics State named 'pgf@CA0.5'." After that it can't show tikz images. Foxit reader can show the images without problem (in Windows) I did some googling and found this and this. On the second link it says that it's a pgf problem and now it's solved (2005). I wish I could provide some MWE, but I've been working with this document for a looong time and never happened before. When exactly did the problem start it's difficult to say, because I'm most of the time in Ubuntu. I'll try to give a MWE, but in the meantime, does anybody came across this problem? EDIT: After some work, I've managed to narrow it down to a MWE:               \documentclass[12pt]{report}          \usepackage[framemethod=tikz]{mdframed}          \usepackage{pstricks}          \usepackage{tikz}     \usetikzlibrary{shadows}          \begin{document}     \begin{tikzpicture}     \node [drop shadow] at (0,0) {Hello};     \end{tikzpicture}     \end{document}      Compile with pdflatex. If you remove any of the first two `\usepackage` it works fine. Evince says (on console): "Error: ExtGState 'pgf@CA.5' is unknown" Some additional info. Compiling with MikTeX 2.9 gives no problem. The problem comes with TeX Live 2012 and 2013.


title: Is there something like 'auto index'?

text: Before I index 200 pages of my thesis manually, I need to ask if there is a better way to do this? For example, can I specify a file which contains keywords whose locations are to be indexed?


title: Section titles without numbers in non-starred version

text: I am trying to format the section title in the `memoir` class, so there is no section numbers in it, and I don't want to use the `\section*`command because it makes it more cumbersome to make it show up in the table of contents and in the heading. At the moment, the relevant part of my preamble looks like this:               \usepackage{titlesec}          \setcounter{secnumdepth}{0}     \setcounter{tocdepth}{3}          % CHAPTER FORMAT          \titleformat{\chapter}[hang]         {\Huge\sffamily\bfseries}         {\thechapter}         {10pt}         {\Huge}          % SECTION FORMAT          \titleformat{\section}         {\sffamily\normalsize\bfseries}         {\thesection}         {1em}         {}     \titlespacing{\section}         {0pt}         {0\parskip}         {0\parskip}         [0pt]          % SUBSECTION FORMAT          \titleformat{\subsection}         {\itshape\normalsize}         {\thesubsection}         {}         {}     \titlespacing{\subsection}         {0pt}         {0\parskip}         {-1\parskip}         [0pt]      Even though I have set the `secnumdepth`to `0`, the numbering in the section title is still there. Here is exactly what I want:   * Chapters, Sections and Subsections in TOC   * Numbered Chapters (Both in text and in TOC)   * Unnumbered Sections and Subsections (both in text and TOC), but without using `\section*` My only problem is that I can't seem to get rid of the section numbering. EDIT: As requested, here comes a working example:               \documentclass[a4paper, twoside]{memoir}          \usepackage{lipsum}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          % LANGUAGE/HYPHENATION          \usepackage[english, danish]{babel}          % INDENTS AND MORE          \setlength{\baselineskip}{12pt plus 0pt minus 0pt}     \setlength{\parskip}{12pt plus 0pt minus 0pt} % Skip size after paragraph     \setlength{\parindent}{0mm} % Indent size     \usepackage{indentfirst} %           % HEADER / PAGE STYLE          \setlength{\headwidth}{\textwidth}         \addtolength{\headwidth}{\marginparsep}         \addtolength{\headwidth}{\marginparwidth}          \copypagestyle{thesis}{myheadings}     \makerunningwidth{thesis}{\headwidth}     \makeheadrule{thesis}{\headwidth}{0.2pt}     \makeheadposition{thesis}{flushright}{flushleft}{}{}          \makepsmarks{thesis}{%         \nouppercaseheads         \createmark{chapter}{left}{nonumber}{\@chapapp\ }{. \ }         \createmark{section}{right}{nonumber}{}{}          \createplainmark{toc}{both}{\contentsname}         \createplainmark{lof}{both}{\listfigurename}         \createplainmark{lot}{both}{\listtablename}         \createplainmark{bib}{both}{\bibname}         \createplainmark{index}{both}{\indexname}         \createplainmark{glossary}{both}{\glossaryname}     }          \makeevenhead{thesis}%         {\sffamily\bfseries\small\thepage}{}{\sffamily\bfseries\small\leftmark}     \makeoddhead{thesis}%         {\sffamily\bfseries\small\rightmark}{}{\sffamily\bfseries\small\thepage}          \pagestyle{thesis}          \aliaspagestyle{chapter}{empty} % empty page style          % FORMAT TOC + LOF + LOT          \renewcommand\printtoctitle{\Huge\sffamily\bfseries}     \renewcommand\printloftitle{\Huge\sffamily\bfseries}     \renewcommand\printlottitle{\Huge\sffamily\bfseries}          % FONTS          \renewcommand{\rmdefault}{cmr}     \renewcommand{\sfdefault}{phv}     \renewcommand{\ttdefault}{pcr}     \renewcommand\familydefault{\rmdefault}          % FORMAT CHAP, SEC, SUBSEC     \usepackage{titlesec}          \setcounter{secnumdepth}{0}     \setcounter{tocdepth}{3}          % CHAPTER FORMAT          \titleformat{\chapter}[hang]         {\Huge\sffamily\bfseries}         {\thechapter}         {1em}         {\Huge}          % SECTION FORMAT          \titleformat{\section}         {\sffamily\normalsize\bfseries}         {\thesection}         {1em}         {}     \titlespacing{\section}         {0pt}         {0\parskip}         {0\parskip}         [0pt]          % SUBSECTION FORMAT          \titleformat{\subsection}         {\itshape\normalsize}         {\thesubsection}         {}         {} % Intet linieskift efter subsection      \titlespacing{\subsection}         {0pt}         {0\parskip}         {-1\parskip}         [0pt]          \begin{document}     \selectlanguage{english}     \frontmatter     \tableofcontents     \paragraph*{Abstract}     \lipsum[1]     \mainmatter     \chapter{Test Chapter}     \lipsum[1]     \section{Test Section}     \lipsum[1]     \subsection{Test Subsection}     \lipsum     \end{document}


title: legend looks strange for joint line and bar plot in pgfplots

text: I am trying to draw both a line plot and a bar plot in the same plot. However, the legend for the line plot looks wrong. **Question:** How do I make the legend look like the legend for a regular line plot?               \documentclass[margin=2mm]{standalone}          \usepackage{pgfplots}          \pgfplotsset{compat=newest}          \begin{document}     \begin{tikzpicture}       \begin{axis}[           ybar,           ylabel=Inventory,           xmin=0,           xmax=47,           height=4cm,           width=\textwidth,           ymin=0,           xtick={0,4,8,12,16,20,24,28,32,36,40,44},           xticklabels={Jul,Aug,Sep,Oct,Nov,Dec,Jan,Feb,Mar,Apr,May,Jun},           legend style={at={(0.5,-0.33)},anchor=north},           legend columns=4]         \addplot[sharp plot,black,very thick] coordinates             {(0, 100) (1, 90) (2,80) (3,70)              (4,160) (5,150) (6,140) (7,130)              (8,120) (9,110) (10,100) (12,90)};         \addplot[bar width=4pt,draw=purple,fill=purple] coordinates             {(0, 100) (4,0) (8,0) (12,80)};         \legend{Inventory, Shipments};       \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/F4Cqz.png)


title: How to write a LaTeX class file for my thesis

text: I want to design a new LaTeX for my college thesis, so that all students could use it. I have decent understanding of how LaTeX works. I am looking for some nice article explaining how to write a LaTeX class file. Whether it would be nice to modify an existing one or start from the scratch?


title: Can I get a list of all sections as a simple enumerate-list?

text: I am currently creating a template for transcripts (I don't know if this is the right word: you write a transcript if you have a (business) meeting and you want to record all important stuff that was said). The source is here. The agenda items are currently in a simple `enumerate`-environment **and** as `\section*` in the source code. I would like to have only the `section*{agenda item}` written by the transcript writer. The list of all agenda items should get generated automatically. Ist this possible? (Just to make that clear: I don't want to insert a table of contents! I want a simple               \begin{enumerate}[leftmargin=1.3em]%         \setlength{\itemsep}{-2pt}%          \item agenda item 1         \item agenda item 2         \item agenda item 3         \item agenda item 4     \end{enumerate}      which gets generated automatically)


title: KOMA warning about ToC

text: Lately I've noticed the following warning from KOMA when I compile my documents:               Class scrreprt Warning: \float@addtolists detected!     (scrreprt)              You should use the features of package `tocbasic'     (scrreprt)              instead of \float@addtolists.     (scrreprt)              Support for \float@addtolists may be removed from     (scrreprt)              `scrreprt' soon .      The documentation for KOMA makes a brief mention of package `\tocbasic` but none of the examples there mention anything about `\float@addtolists`, unless this information is in the German documentation and hasn't been translated to English yet. What does the warning mean, and can anyone suggest what changes I can make to silence it?


title: From LaTeX with pdflatex to plain TeX

text: I've always wanted to try plain TeX instead of LaTeX. I can use plain but I'm not able to use correctly the fonts and I'm not able to use the french hyphenation. I would to know how to do this with plain. Yes a lot of questions ! I work with MacTeX, it's perhaps important if I need to create a new format.               \documentclass{article} % It's not really important I can work without a class.     \usepackage[utf8]{inputenc} % is it possible to work with utf8 with TeX ?     %\usepackage[T1]{fontenc}         \usepackage[upright]{fourier} % or another font with T1 !     \usepackage[frenchb]{babel} % I need french hyphenation only !     \begin{document}          Bonjour          J'ai toujours voulu savoir comment écrire un document en français avec TeX.          \end{document}       Perhaps it's more interesting to have a solution with ConTeX ? It would be interesting to have an answer with XeTeX, XelaTeX, LuaTeX and LuaLaTeX.


title: Left align equation description

text: I have a short description for each of my equations. I want to have them flushleft (similar to the equation numbers which are flushright). How can I do that? Here is a MWE:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{equation}     \text{this is my first equation: } z = x     \end{equation}     \begin{equation}     \text{this is my second equation: } z = x+y     \end{equation}     \end{document}      And my desired output is like this: ![enter image description here](http://i.stack.imgur.com/mebXO.png)


title: Preparing an abstracts book for a session

text: I have a list of contributions for a conference, with each one consisting of a serial number, a title, a list of authors, and an abstract. What I'd like to do is:   * typeset the list of contributions sequentially, so a reader can skim the abstracts   * have an author index, so that the reader looking for the contribution of a particular author can jump directly to that page.  I have enough contributions, and expect enough changes, that automating this is worth my while. Is there a standard package that I can adapt to do this ? I don't mind writing some external scripts to preprocess data if need be. Note: there's no scheduling information I need to worry about.


title: Style to make axis tick label opaque using "extra y tick" feature

text: This is a follow up to Style to make axis tick label opaque, where a suggestion was made to use the `extra y ticks` to specify special tick marks and use `extra y tick style` to apply a style to only those tick labels. I attempted to adapt Jake's answer to the above referenced question and apply that by making `-2` not a normal tick, but an `extra y tick`:               ytick={-1,1,2,3,4},%    Note: -2 not listed here     extra y ticks={-2},%      extra y tick style={draw=none, inner sep=0pt, outer sep=0.3333em, fill=white, text opacity=1},      but this does not seem to have **any** effect on the `y tick label` at `-2`: ![enter image description here](http://i.stack.imgur.com/L8s21.png) # Code:               \documentclass{article}     \usepackage{pgfplots}          \newcommand{\XMin}{-2.2}%     \newcommand{\XMax}{1.5}%          \pgfkeys{/pgfplots/My Axis Style/.append style={         width=7cm, height=8cm,         xmin=\XMin, xmax=\XMax, ymin=-3.2, ymax=2.5,         axis y line=center,         axis x line=middle,          axis on top=true,         ytick={-1,1,2},         extra y ticks={-2},         extra y tick style={draw=none, inner sep=0pt, outer sep=0.3333em, fill=white, text opacity=1},         }     }          \newcommand*{\AddPlotFunction}{\addplot[smooth, ultra thick, domain=\XMin:\XMax, red]  {exp(x)-2} node [left] {$y=e^x-2$}}%     \newcommand*{\AddPlotAsymptote}{\addplot[smooth, thin,        domain=\XMin:\XMax, blue] {-2} node [below left] {$y=-2$}}%          \begin{document}     \begin{tikzpicture}     \begin{axis}[My Axis Style]         \AddPlotFunction;         \AddPlotAsymptote;     \end{axis}     \end{tikzpicture}     \end{document}


title: Changing distance between chapter number and chapter title in the table of contents

text: I'm typesetting a document with more than 100 chapters in it (don't ask, I didn't write it!). The table of contents comes out ugly, because it seems the distance between the chapter number and the chapter title is intended for two- digit chapters only. Once we hit a three digit chapter number, the last digit of the number overwrites the chapter title. How can this be modified? What variables control the width of the chapter number? Any fixes?


title: Increasing vertical space after equation in paragraph with short previous line?

text: ## The problem I'm aware that LaTeX the spacing around equations in a paragraph differs depending on how long the line of the paragraph immediately preceding the equation is. When the preceding line is short, there's less vertical space before the equation, because the text of the equation will actually be below the empty part of the line. Thus, in plain text, we get something like:                 The quick brown fox jumps over the     lazy dog. The quick brown fox jumps.                                            ; blank line before equation                   F = ma                      The quick brown fox jumps over the     lazy dog.                              ; no blank line before equation                   F = ma      That makes sense to me, but it seems that in the former case, the amount of space "looks" about the same, whereas in the latter case, the amount of space below the equation "looks" smaller. A screenshot and code for a minimal example follow. Where is this behavior specified or documented, and what can I do to adjust it? In the minimal example, the difference doesn't really look bad, but it is noticeable, and in a document I'm working on it's very noticeable and doesn't look all that great. That document has a lot of non-minimal stuff (a package tree-style proofs that need to be wrapped in **\vcenter** , and double spacing), but I'm hoping that I can resolve this based on the example here. ## Minimal working example ![vertical spacing around equations](http://i.stack.imgur.com/UQ14n.png)               \documentclass{article}          \begin{document}          The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the.     \begin{equation}       \frac{a}{b}     \end{equation}     The paragraph continues here.     The paragraph continues here.     The paragraph continues here.          The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the.     \begin{equation}       \frac{a}{b}     \end{equation}     The paragraph continues here.     The paragraph continues here.     The paragraph continues here.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the.          The paragraph continues here.     The paragraph continues here.     The paragraph continues here.     The quick brown fox jumps over the lazy dog.     The quick brown fox jumps over the lazy dog.          \end{document}      ## Illustration of the real, but non-minimal, problem ![illustration of the real, non-minimal problem](http://i.stack.imgur.com/KRqCB.png)


title: How to highlight a paragraph containing a tikzpicture

text: I'm trying to highlight an entire paragraph that contains a figure drawn with tikz. I'd like to highlight the text and also the blank space around the figure, while the figure itself should have the usual white background (the rectangle in my example means only that what's inside should not be shaded).               \documentclass{article}     \usepackage{tikz}     \begin{document}          Some text of the main body of the document.          \paragraph{Paragraph}     Some text of the paragraph.     \begin{figure}[h]     \centering       \begin{tikzpicture}          \node at (0,0) [rectangle,draw] {             \begin{tikzpicture}            \draw [->] (-.5,0) -- (5,0) node [below] {$x$};            \draw [->] (0,-.5) -- (0,3) node [left] {$y$};            \end{tikzpicture}};          \end{tikzpicture}        \caption{The rectangle only delimits the area without shaded background; it needn't be rendered in actual paragraph.}       \label{fig:label}     \end{figure}          Some text of the paragraph. \\          Some text of the main body of the document.          \end{document}      I'm using this topic as a reference. Is it even possible to do?


title: Changing theorem number systems mid document

text: I have a numbering system setup for most of my document using:               \newtheorem{theorem}{Theorem}[section]     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{corollary}[theorem]{Corollary}      Which produces the obvious:               Theorem 1.1     Lemma 1.2     Theorem 1.3     Corollary 1.4     etc.      But I'm trying to halfway through the document redefine all the above to look at subsection and not just section:               Theorem 2.1.1     Corollary 2.1.2     Theorem 2.1.3     Lemma 2.1.4     Theorem 2.2.1     etc.      I can't seem to find a way to do that. Is it possible? I tried using the ntheorem package, but it seems to conflict with:               \newtheorem*{definition}{Definition}      and my other non-numbered stuff.


title: After updating to MacTeX 2013, font size and kerning of Monotype Corsiva are strange

text: I knew I probably shouldn't have upgraded, being not very experienced, I always have to wade through strange errors. However, this is really weird. Here's my example:               %!TEX TS-program = lualatex      %!TEX encoding = UTF-8 Unicode           \documentclass[20pt]{scrreprt}          \usepackage{fontspec}          \begin{document}     Test {\fontspec{Monotype Corsiva}Test}     \end{document}      Yesterday, this would have rendered the two "Test" in the same size, kerning in Monotype Corsive being, well, normal. Today, after upgrading to MacTeX 2013 (but not really fiddling with the fonts) Monotype Corsiva is much smaller and has big spaces between letters. I presume I made a mistake somewhere - but what am I doing wrong? I am using Monotype Corsive in texts to render a corporate identity title, consisting of one word. So I can work around the issue by increasing font size and defining kerning for that one word - however, fiddling with font size increases line height and that doesn't look good either.


title: PGFPlots: How does one plot a wave packet?

text: Given the equation `2\cos(kx - wt)\cos(.5\Delta k(x - \frac{\Delta w}{\Delta k}t))`. How can I plot this in `pgfplots`?   * `k` is the wave number   * `w` is the frequency   * `\Delta k` and `\Delta w` are both `\ll 1`   * We also have this relationship `w = -k^3` If I plotted this in Python, I would define `t = linspace(-10, 10, 500000)` or whatever the range of `t` I need, but I don't know how to handle the parameter `t` in `pgfplots`.                   \documentclass[tikz]{standalone}         \usepackage{pgfplots}         \pgfplotsset{compat = 1.8}         \begin{document}         \begin{tikzpicture}         \begin{axis}[           x min = -10,           x max = 10,           y min = -2,           y max = 2,           axis x line = middle,           axis y line = middle,            samples = 1000           ]          \addplot[red] {2 * cos(deg()) * cos(deg())};         \end{axis}         \end{tikzpicture}         \end{document}      It will look something like: ![enter image description here](http://i.stack.imgur.com/22tfr.png)


title: To fix alignment in text added to Table of Contents?

text: My school requires tables of contents formatted like this -- please note the little headings, in red: ![enter image description here](http://i.stack.imgur.com/fcN18.png) I have it almost ready, except for a pesky misalignment in the second page of the table of contents. "Chapter" gets thrown to the right. ![Chapter thrown to right](http://i.stack.imgur.com/LiDqX.png) As I prepare a minimal working example, it seems that a previous addtocontents line triggers the problem.               \documentclass[12pt,letterpaper,oneside]{book}     \usepackage{tocloft}          \usepackage[toc,page]{appendix}     \usepackage{titlesec}     \usepackage[nottoc]{tocbibind}     \usepackage{afterpage}     \usepackage{blindtext}     \usepackage{indentfirst}     \usepackage{fancyhdr}          \begin{document}          \tableofcontents          \addtocontents{toc}{\hfill Page \par}     %  Is this line above the culprit? if commented, Chapter below aligns!          \chapter{Blah blah1}     \section{Basics}     \subsection{Margins}     \blindtext     \section{Blah in section}     \Blindtext     \subsection{More blah for a subsection}     \blindtext      \begin{figure}     \caption{picture}     \end{figure}     \chapter{Some Blah}     \section{One section}     \blindtext     \chapter{All}     \blindtext     \chapter{the}     \blindtext     \section{Good enough}     \blindtext     \subsection{Better}     \blindtext          \addtocontents{toc}{\protect\afterpage{Chapter\hfill Page \par\medskip}}     % This is how I add those 'headings' to the toc.     % Not well aligned!          \chapter{way}     \section{Please}     \section{Go}     \subsection{Ahead}     \chapter{to}     \chapter{the}     \chapter{very}     \chapter{end}     \chapter{keep}     \section{keep uno}     \section{kep dos}     \chapter{going}     \chapter{more}          \end{document}      This minimal code will produce this: ![enter image description here](http://i.stack.imgur.com/jEIXD.png) Is there a way to fix that addtocontents line? or a more sensible way to do it? Please advise. Thank you in advance! * * * If it helps, these are some lines from the .toc file:               \contentsline {subsection}{OM as city block distance}{28}     \afterpage {Chapter\hfill Page \par \vspace \medskipamount }     \contentsline {subsection}{Euclideanity of OM and Euclidean transformations}{29}     \contentsline {subsubsection}{Raw and transformed OM as Euclidean}{29}     \contentsline {subsubsection}{Low dimensional Euclidean via MDS}{32}     \contentsline {section}{Distribution of sequences and inter-sequence distances}{34}     \contentsline {subsection}{Distribution of true inter-triple and OM distances}{34}      And this is how it looks like: ![enter image description here](http://i.stack.imgur.com/AVbId.png) * * * Aw, I just added a               \addtocontents{toc}{Chapter\hfill Page \par}     \section{Distribution of sequences and inter-sequence distances}      What a dirty thing.


title: one problem of creating table in latex

text: I want to create a table in LaTeX by this               \begin{table}          \begin{center}          \begin{tabular}{c | c | c | c | c |c {c}r}          j/i              & 1:Tumor & 2:Envir & 3:Leuk & 4:Lymph & 5:Macroph \\          \hline          Tumor &$0$&$1$&\pm 1&\pm{1} &\pm 1  \\          Envir            &$1$&$0$&$0$&$0$&$0$  \\          Leuk             &\pm 1&$0$&$0$&$0$&$0$  \\          Lymph          &\pm 1&$0$&$0$&$0$&\$1$ \\          Macroph       &\pm 1&$0$&$0$&$0$&$0$  \\          \end{tabular}          \end{center}          \end{table}      but I have this table ![enter image description here](http://i.stack.imgur.com/xn1bS.png) what can I do to solve this problem?


title: Wrong figure and caption position

text: I have a problem with my images!! ![look at my problem](http://i.stack.imgur.com/46rDt.png) As you can see, the position of images (a) and (b) is totally wrong! I don't know why! I used Latex for a lot of years, but it is the first time I see something like this. Can anybody help me? I am using Linux Mint 17 and I use Kile. The code to generate the images is               \begin{figure*} [htbp]     % \centering     \subfigure[\label{fig:adr_MG}]     {\includegraphics[scale=0.29]{ADR_UE_last_1.eps}}      \hspace{0.2cm}     \subfigure[\label{fig:adr_RB}]     {\includegraphics[scale=0.29]{ADR_RB_last_1.eps}}     \hspace{0.2cm}     \subfigure[\label{fig:adr_TIME}]     {\includegraphics[scale=0.27]{tab_2_new.eps}}     \caption{Aggregate Data Rate as function of the multicast group size (a) and     the number of RBs (b), and execution time comparison (c).}     \label{fig:adr}     \end{figure*}      Thanks in advance!


title: Drawing a polyline between two nodes in tikz

text: I am a beginner with tikz and finding the following really difficult to do. ![enter image description here](http://i.stack.imgur.com/zbydF.png) I have defined and drawn node1 and node2 in tikz. You can figure it out easily from the picture. What I intend to do is   * Draw a dashed line from (node1.south) to P1.   * Draw a dashed line from P1 to P2.   * Draw a pointed dashed line from P2 to (node2.north).   * where the point P1 is (node1.south)+(0,-y). y is a positive integer which I am free to choose depending on y-axis distance between node1 and node2.    * and I define the point P2 as the point where a horizontal left-ward line from P1 meets the vertical upward line from (node2.north).   This thing roughly accomplished in google drawing is shown.


title: automatic spacing between words in math mode

text: In math mode, something like `$if f x > 3 then 42 else y$` typesets to this: ![$if f x > 3 then 42 else y$](http://i.stack.imgur.com/XXXnQ.png) Obviously, spacing is wrong here, and I need to correct manually: `$if \: f \: x > 3 \: then \: 42 \: else \: y$` typesets to ![enter image description here](http://i.stack.imgur.com/jYxVf.png)   1. Which is the correct amount of space to insert?   2. Is there a way to automate this process, i.e. automatically insert a space between "words" separates by spaces in the source?


title: `keystroke` package doesn't work with polyglossia in TeXLive 2012

text: Example file:               \documentclass{article}     \usepackage{fontspec}     \setmainfont[Mapping=tex-text]{Ubuntu}     \usepackage{polyglossia}     \setmainlanguage{russian}     \usepackage{keystroke}     \begin{document}     \keystroke{Q}     \end{document}      Error (when running `xelatex test.tex`):               ! Package polyglossia Error:     The current roman font does not contain the Cyrillic script!     Please define \cyrillicfont with \newfontfamily.          See the polyglossia package documentation for explanation.     Type  H <return>  for immediate help.      ...          l.8 \keystroke{Q}      When I compile with TeXLive 2009, the same file works fine. What is wrong?


title: How to install fontspec on linux?

text: I tried installing the fontspec package with the help of the instructions provided here: http://www.tug.org/fonts/fontinstall.html where as the font map file as specified in the 4th step didnt seem to be in the package that I downloaded from here : http://ctan.org/pkg/fontspec I was successful in doing all other steps except this map file and lines in my test.latex file:               \usepackage{fontspec}       \newcommand{\myfont}{SegoeUI}      when compiled showed this error               ! fontspec error: "font-not-found"       ! The font "SegoeUI" cannot be found.      Can anybody help me in getting this done? Is there other alternative way to install fontspec package as i need to work with fonts like Arial, Segoe UI ?


title: \slash allows for hyphenation of only the word on its left; how to fix it for the right-hand word

text: I often use `\slash` to allow for linebreak after the slash. However I found that `\slash` doesn't allow for hyphenation of the word to its right, while it does for the word on its left. How do I use `\slash` in a way (this can be a different macro, if necessary) that hyphenation points on both sides are preserved?               \documentclass{memoir}          \begin{document}          \noindent qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq addition\slash{}subtraction          \noindent qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq addition\slash{}subtraction          \noindent qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq addition\slash{}subtraction          \noindent qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq addition\slash{}subtraction          \noindent qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq addition\slash{}subtraction          \noindent qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq addition\slash{}subtraction          \end{document}      In this example, the last line hyphenates after "ad-", the line before linebreaks after the slash, and none of the previous lines hyphenate "subtraction".


title: Let caption float into margin

text: I searched for a long time to find a solution to let a caption of a figure and/or a table expand into the outside margin. I'm able to get a figure/table where the width is `textwidth` plus `marginparwidth`. See my MWE down below using a solution on stackexchange. **EDIT:** Thanks to Steven B. Segletes, who found the right question, I was able to fix this with the command `\captionsetup{margin={0pt,-\marginparwidth}}` using the `caption`-package. I edited the code below, too.               \documentclass[%         12pt,         BCOR=15mm,         captions=tableheading,         DIV=current,         ]{scrbook}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage[demo]{graphicx}          \usepackage[         top=30mm,         bottom=40mm,         inner=30mm,         outer=55mm,         marginparsep=5mm,         marginparwidth=30mm,         ]{geometry}          \usepackage[leqno, fleqn]{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \usepackage{booktabs}     \usepackage{array, tabularx}          \usepackage{ifoddpage}     \newlength\fullwidth\fullwidth=\textwidth \advance\fullwidth by \marginparwidth          \begin{document}          \begin{figure}         \checkoddpage         \edef\side{\ifoddpage l\else r\fi}         \makebox[\textwidth][\side]{%              \includegraphics[width=\fullwidth]{figure}         }%         \captionsetup{margin={0pt,-\marginparwidth}}         \caption{Long captiontext do get two lines, so I can see, if the caption expands into the margin.\label{fig:label}}     \end{figure}          \begin{table}[h]         \captionsetup{margin={0pt,-\marginparwidth}}         \caption{Instabile Isotope können unter Aussendung von Kernteilchen zerfallen. Dabei bilden sie neue Isotope.\label{tab:radiozerfall}}         \checkoddpage         \edef\side{\ifoddpage l\else r\fi}         \makebox[\textwidth][\side]{%              \begin{tabularx}{1.01\fullwidth}{>{\kern-\tabcolsep}XXXXXX<{\kern-\tabcolsep}}             \toprule             Produkt       & \multicolumn{2}{c}{Strahlungs-} & \multicolumn{3}{c}{Eigenschaften der Strahlungsteilchen}  \\                            & teilchen           & bezeichnung          & Kernladungs\-zahl & Nukleonen\-zahl & Durchdrin\-gung \\             $^{A-4}_{Z-2}\text{E}$ & He-Kern            & $\alpha$-Strahlung   & $+2$              & 4               & gering          \\             $^{A}_{Z+1}\text{E}$   & Elektron           & $\beta$-Strahlung    & $-1$              & 0               & mittel          \\             unverändert            & Photon             & $\gamma$-Strahlung   & $\phantom{-}0$    & 0               & groß            \\ \bottomrule             \end{tabularx}}     \end{table}          \end{document}      Thanks in advance.


title: How to use 2cell in Lyx?

text: I'd like to write natural transformation arrows in LyX (2.0.5.1) using `2cell` (see this answer). The problem is, LyX seems to include the xy package by default and it's only using the `[all]` option. I can't find a way to change the options or disable the package alltogether, and if I use the `xy` package with the `[all,2cell]` options in the document preamble I get complaints about loading the package twice. Is there a (nice) way around this? **EDIT:** As pointed out in the comments, LyX adds the `xy` package automatically when I use `\xymatrix` in the document. Can this be disabled or can I change which options are used for the package?


title: Polylongdiv: Show x^n if the coefficient = 0

text: I'm trying to figure out how to display x^n with 0 as coefficient in the polynom divison. I'm using the polynom package for this but the following example doesn't show x^3 and x. Minimal example               \documentclass{article}     \usepackage{polynom}     \begin{document}     \begin{center}     \polyset{style=C,div=:,vars=x}     \polylongdiv{x^4 + 0 x^3 - 45 x^2 + 0x + 324}{x - 6}     \end{center}     \end{document}      I didn't find anything in the package's manual. So is there a solution for my problem?


title: How to write shell script for latex compliation?

text: Here's my needs. I have a latex file or template, some content of this file(say company name) needs to be changed according to different companies. I want to write a shell script satisfying this need, help me auto compilation and generating the corresponding pdf file. Is anyone having similar experiences before? Thanks!


title: How can I typeset the date/time at compile time?

text: For printed drafts of my papers, I would like to add a timestamp on every page with the date/time when the document was last compiled. Is there any LaTeX command that produces the current date/time at compile time? Even better, is there any package that already solves my problem?


title: Breaks Long title in chapter headers into 2 lines

text: I used `book` class to write my thesis as follows               \documentclass [12pt,oneside,final]{book}      The title of some chapters are long so it reaches the page number as shown in picture. how I can breaks Long titles of the chapter in the headers into 2 lines so it will look better any idea   ![enter image description here](http://i.stack.imgur.com/KGQOI.png)


title: changing spacing of caption

text: I'm creating a figure using LyX. I would like the spacing of the caption below the figure to be 1.3. Is there an easy way to accomplish this? Setting the spacing to 1.3 for the entire document using the setspace command doesn't seem to work.               \begin{sidewaysfigure}     \begin{centering}     \includegraphics{...}     \par\end{centering}     \caption{...}     \end{sidewaysfigure}


title: How to obtain perfect greyness with TeX?

text: Greyness, or typographic color is the apparent blackness of a block of text. I would be curious how you deal with improving it in TeX. How much can TeX's inherent line-breaking algorithm be fine-tuned to obtain the best solution? (Edit: Rephrased the question.)


title: Barplot: alternating colors, bars side by side

text: I'd like to have a barplot with bars side-by-side and with alternating colors. It should look like the ouput of the code below, just with alternating bar colors. (Got the idea from here)               \documentclass{article}          \usepackage{pgfplots}     \pgfplotsset{compat=1.10}          \begin{document}          \begin{tikzpicture}     \begin{axis}[ybar interval, xmin=0, xmax=0.3,]     \addplot+[bar shift=0pt] coordinates         {(0,2) (0.1,1) (0.2,0.5) (0.3,0.7)};     \end{axis}     \end{tikzpicture}          \end{document}      In the manual I only see options for plots that are added as separate plots, but I don't know how to align them properly. And my search only finds solutions with separated bars that can have different colors. How can I accomplish the task to have bars with different colors besides each other in pdflatex?


title: Beamer (with style) to Html5?

text: My organization require the use of a standardized powerpoint template for how slides should look, so I've written my own Beamer .sty (style file). Then I write .Rnw-files in RStudio that I knit (knitr) to create pdf-slides that look like they should. The slides have more advanced layout than what just Markdown allows (corporate logos, fonts, color palettes etc.). But I'm getting jelous of all the nice looking HTML5-presentations out there (reveal.js, DZslides, etc.). Is there a way to go from advanced beamer (including .sty) to HTML5? Or do I need to start from scratch and re-create the layout in the HTML5 environment and use Markdown somehow?


title: Reading datafile entry by entry

text: In order to use pstricks in a certain fashion, I would like to access a datafile line by line, inside a multido loop. For example, let's say my file is called Datafile.dat. It contains the (x,y) coordinates of say, 20 points. I would like something like               \multido{\iA=0+1}{20}{%     \psdot(Datafile.dat(\iA,1),Datafile.dat(\iA,2))     }      I know there exists functions to do this, but my emphasis is on being able to access the datafile element by element.


title: Measuring the distance from text to the top of the page

text: How can I obtain a measurement from the baseline of any line of text in a document to top of the body of text on a page?


title: Disappearing plot (All values has been filtered away)

text: I am trying to get the following plot to work               \documentclass[a4paper,10pt]{standalone}     \usepackage{pgfplots,tikz}     \pgfplotsset{compat=1.6}     \begin{document}     \begin{tikzpicture}     \begin{semilogyaxis}[%     scale only axis,     xmin=0, xmax=14,     xlabel={Iterations},     ymin=-0.747366157054232, ymax=-0.627152206833444,     yminorticks=true,     ylabel={Values $g(x)$}     ]     \addplot [     color=blue,     solid     ]     table{     1 -0.627152206833444     2 -0.727653418778865     3 -0.744147940956529     4 -0.74683810473197     5 -0.747279463520111     6 -0.747351895087422     7 -0.747363807639291     8 -0.747365769422513     9 -0.747366093009514     10 -0.747366146462357     11 -0.747366155305526     12 -0.747366156770711     13 -0.747366157013831     14 -0.747366157054232     };     \end{semilogyaxis}     \end{tikzpicture}%     \end{document}      The problem is that i obtain the error message > ! Package pgfplots Warning: the current plot has no coordinates (or all have > be en filtered away) I assume it has to do with the combination of very close values, and logarithmic scales. (The plot compiles just fine using normal axis) Is there any method to get the plot to work _with_ a logarithmic scale? ' Nw


title: Center aligning a shrunk frame in beamer

text: I have a beamer related question. I am using [shrink=50] command to shrink a frame. I want the shrunk frame to be center aligned but by default it is aligned left of the slide. How do I do this?               \documentclass{beamer}     \usetheme{Warsaw}     \begin{document}     \begin{frame}[shrink=50]     \textbf{Title of the slide}     \vskip10pt     Hi     \end{frame}     \end{document}


title: Adding labels to a formula

text: I have a diagram like this, explaining a formula:               \documentclass{article}     \usepackage{stackrel}     \begin{document}         $\stackrel[e+f+g+h^i]{a^b}{c d}$     \end{document}      For this example, I have removed the numbers.   * How can I scale this diagram up, so that each part appears exactly 300% larger?   * If I am using an OpenType font, will this scaling produce errors?   * How can I add labels to the formula describing what each part means?


title: Babel[french] adds \ier commands, why doesn't Babel[english] add \th?

text: I recently realized that when called with the option `[french]`, the `babel` package adds a number of useful commands such as `ier{}` for "1er" read "premier", `\no` or `\degres`. Yet it seems to get similar features for english (say `\st{}` or `\degree`) one either needs to load specialized packages such as `nth` or define new commands such as setting `\degree` to `\textsuperscript{\circle}`. Why the inconsistency? Am I missing something?


title: minted vs. texments vs. verbments

text: Regarding the typesetting of syntax-colored source code, I know that `listings` is inferior because it doesn't utilize a full lexer. Instead the Python-based solution is recommended. It seems there are three packages to use the Python library `pygments` instead: `minted`, `texments` and `verbments`. Most people seem to use `minted` here. The `verbments` documentation says it aims to fix issues with `minted`. So what are the important differences? Has someone tried all of them?


title: How can I reproduce the figure with each picture labeled by a lowercase letter?

text: Here is the figure I am trying to reproduce. ![Figure 2](http://i.stack.imgur.com/YIYyU.png) I was able to get the figure without the lowercase labels with the following code:               \begin{figure}         $$\begin{array}{cl}             \includegraphics[height=2cm]{image1.jpg} &             \includegraphics[height=2cm]{image3.jpg} \\             \includegraphics[height=2cm]{image2.jpg} &             \includegraphics[height=2cm]{image4.jpg}         \end{array}$$         \caption{$(a)-(d)$ are cool}     \end{figure}      I can't figure out out to get the letters to appear at the bottom left of each picture. Can anyone help?


title: Post-filtering output that I can't seem to pre-filter with silence package

text: I have a book that was producing 20,000 lines of output to stdout when I compiled it with pdflatex. I did the following to reduce the output:               \RequirePackage{silence}     \WarningFilter{Fancyhdr}{\headheight is too small}     \WarningFilter{textpos}{environment textblock}     %\pdfsuppresswarningpagegroup=1 % my pdftex isn't new enough     \hfuzz=999pt % reduce overfull hbox errors     \hbadness=10000 % reduce underfull hbox errors      This cut it to 500 lines. However, that is still too much. I would like to cut it to zero lines when there are no errors, so that I can actually look at the output every time I compile the book. The remaining not-useful output seems to consist mainly of the following categories:   1. Messages saying what packages I've loaded: `(/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)`   2. A message for every file included via `includegraphics`.   3. A message for every font used: `<</usr/share/texlive/texmf-dist/fonts/type1/p ublic/amsfonts/cm/cmsy10.pfb>>`   4. Files being included. Some of these classes of messages seem to be impossible to prevent, because they're coded into TeX itself. Therefore there seems to be no other option than to do some kind of post-filtering on the output. Do I have to code my own filter, or have other people written something to do this? Related:   * Use latexmk to filter the log file   * Silence file inclusion messages?   * Can't silence a pdftex "PDF inclusion: multiple PDFs with page group" error   * Reducing the console output of LaTeX


title: Conditional based on the version of pdflatex?

text: I would like to do this:               \pdfsuppresswarningpagegroup=1      However, this feature is only supported by pdftex 1.40.15 and higher. How can I do this conditionally, so that my document won't be broken in other tex engines or in earlier versions of pdftex? As a side issue, does this command go in the preamble? (I can't test it because I'm not yet running 1.40.15+.) Related: Can't silence a pdftex "PDF inclusion: multiple PDFs with page group" error