I don't want to use the following               \begingroup     \edef\next{\endgroup         \noexpand\const{Xp}{\X(tp)}         \noexpand\const{Yp}{\Y(tp)}         \noexpand\const{Xf}{\X(tf)}         \noexpand\const{Yf}{\Y(tf)}     }\next      and               \begingroup     \edef\next{\endgroup     \noexpand\psparametricplot[algebraic,plotpoints=100]{0}{\tf}{\X(t)|\Y(t)}}\next      because they seem to be cryptic. Instead I want to create a new environment as follows,               \newenvironment{DelayExpansion}     {\begingroup     \edef\next\bgroup\endgroup\ignorespaces}     {\egroup\next\ignorespacesafterend}      but unfortunately it produces compilation errors that you can see by yourself. If the errors can be fixed, the environment will be used as follows,               \DelayExpansion       \noexpand\const{Xp}{\X(tp)}       \noexpand\const{Yp}{\Y(tp)}       \noexpand\const{Xf}{\X(tf)}       \noexpand\const{Yf}{\Y(tf)}     \endDelayExpansion      and               \DelayExpansion         \noexpand\psparametricplot[algebraic,plotpoints=100]{0}{\tf}{\X(t)|\Y(t)}}     \endDelayExpansion      Or without specifying the `\noexpand` as follows.               \DelayExpansion       \const{Xp}{\X(tp)}       \const{Yp}{\Y(tp)}       \const{Xf}{\X(tf)}       \const{Yf}{\Y(tf)}     \endDelayExpansion      and               \DelayExpansion         \psparametricplot[algebraic,plotpoints=100]{0}{\tf}{\X(t)|\Y(t)}}     \endDelayExpansion      The MWE for the real scenario is given as follows.               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-plot}          \addtopsstyle{gridstyle}{gridlabels=0,griddots=0,subgriddiv=5,gridwidth=0.4pt,subgridwidth=0.2pt}          \usepackage[nomessages]{fp}     \newcommand\const[3][3]{%         \expandafter\FPeval\csname#2\endcsname{round(#3:#1)}%         \pstVerb{/#2 \csname#2\endcsname\space def}%     }          \const{Vox}{2}     \const{Xo}{1}          \const{Voy}{4}     \const{Yo}{10}          \const{g}{10}          \def\X(#1){Xo+Vox*#1}     \def\Y(#1){Yo+Voy*#1-0.5*g*#1^2}          \const{tp}{Voy/g}     \const{toffset}{0.5}     \const{tf}{2*tp+toffset}          %\newenvironment{DelayExpansion}     %{\begingroup     %\edef\next\bgroup\endgroup\ignorespaces}     %{\egroup\next\ignorespacesafterend}     %     %\DelayExpansion       %\noexpand\const{Xp}{\X(tp)}         %\noexpand\const{Yp}{\Y(tp)}         %\noexpand\const{Xf}{\X(tf)}         %\noexpand\const{Yf}{\Y(tf)}     %\endDelayExpansion          \begingroup     \edef\next{\endgroup         \noexpand\const{Xp}{\X(tp)}         \noexpand\const{Yp}{\Y(tp)}         \noexpand\const{Xf}{\X(tf)}         \noexpand\const{Yf}{\Y(tf)}     }\next          \begin{document}     \begin{pspicture}[showgrid](0,\Yp)(\Xf,\Yf)         \psframe[fillstyle=vlines,fillcolor=gray](0,\Yf)(\Xo,\Yo)         \psparametricplot[algebraic,plotpoints=100]{0}{\tf}{\X(t)|\Y(t)}     \end{pspicture}     \end{document}      How to create a "delay expansion" environment? ## The latest update: I have tried the solution given by Ryan, but it still produces some errors (please try it by yourself to see the error messages).               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-plot}          \usepackage[nomessages]{fp}          % cannot be simplified unless I must break my real scenario          \newcommand\const[3][3]{%         \expandafter\FPeval\csname#2\endcsname{round(#3:#1)}%         \pstVerb{/#2 \csname#2\endcsname\space def}%     }          \const{Xo}{1}     \const{Yo}{10}     \const{tp}{0.4}     \const{tf}{2*tp+1.5}          \def\X(#1){Xo+2*#1}     \def\Y(#1){Yo+4*#1-0.5*5*#1^2}               % try this for comparison first     %\begingroup     %\edef\next{\endgroup         %\noexpand\const{Yp}{\Y(tp)}     %}\next          % Ryan's suggestin     \usepackage{environ}     \NewEnviron{DelayExpansion}{%       \begingroup       \edef\next{\endgroup\BODY}%       \next%     }          % Ryan's suggestion     \begin{DelayExpansion}         \noexpand\const{Yp}{\Y(tp)}     \end{DelayExpansion}               \begin{document}     \begin{pspicture}(0,6)(6,\Yp)         \psparametricplot[algebraic,plotpoints=100]{0}{\tf}{\X(t)|\Y(t)}     \end{pspicture}     \end{document}      > I will offer 4 bounties of 500 each to a single accepted answer. Does it > sound excited?


title: Order of subscript and superscript

text: If a mathematical symbol has both subscript and superscript, is there a best practice which should come first? I have seen both, for example `$\sum_{t=0}^3$` and `$\sum^3_{t=0}$`. AFAIK they give identical output. Personally, I find the first version much easier to read. It confuses me a lot if both versions are used in the same document. Is one of the two forms considered best practice?


title: Include pdf documents from a list written in a text file

text: In a text file `titles.txt`, I have the title, category and filenames of all the documents I wish to insert in TeX file. I can properly insert the title and the category (used with `\index`) but unfortunately I can not use the filename since **`\includepdf` added extra space** that I can't remove. The structure of the text file is the following:               title1     category1     filename1     tilte2     category2     filename2     etc..      Here is the code:               \newcounter{numexos}     \setcounter{numexos}{1}          \newread\myfile     \newcommand*\readfile{%     \immediate\openin\myfile=titles.txt\relax     \loop\unless\ifeof\myfile         \read\myfile to\mybtitle         \read\myfile to\mycategory         \read\myfile to\myfname              \ifeof\myfile\else            \index{\mycategory}            \includepdf[addtotoc={1, section, 1 , \mybtitle, \numexos },fitpaper=true,pagecommand={}]{\myfname.pdf}            \addtocounter{numexos}{1}         \fi     \repeat     \immediate\closein\myfile     }      Instead of using the filename stored in the TXT file I can use the counter if possible: I've tried but I failed for the same reasons : additionnal space in the filename: `01 .pdf`


title: Kerning for arabic digits?

text: In most fonts, arabic digits have nonproportional width, meaning that 1 and 8 have exactly the same width even if the former has a smaller natural width. This is good for typesetting tables, but in running text this distracts:               \documentclass{article}     \pagestyle{empty}               \begin{document}       Look at this figure:       1,123,456 cars.       How to remove the extra space between the first two 1?     \end{document}      ![Result](http://i.stack.imgur.com/fVwEY.png) I feel that there's slightly too much space between the first two "ones". What do the typographers think about this issue? How do I enable kerning of digits (or just usage of their natural width) in running text?


title: No content in zoom Tikz spy

text: I'm trying to use the spy glass in Tikz, but for some reason my zoom area is always empty and (some) graphs tend to disappear when I use spy. I've updated all my packages etc. through the updater by MikTeX but this didn't solve anything. The code I use:               \documentclass{article}      \usepackage{pgfplots}      \usetikzlibrary{spy}           \begin{document}       \begin{tikzpicture}     [spy using outlines={rectangle, magnification=3,connect spies}]           \begin{axis}[grid=major,no markers,domain=-5:5,enlargelimits=false]          \addplot[solid,mark=asterisk,mark options={solid},color=blue] {x^2};         \addplot[solid,mark=asterisk,mark options={solid},color=red] {x^3};           \addplot[only marks,mark=star,mark size=2pt,color=black] coordinates{(0,0)};         \coordinate (spypoint) at (axis cs:0,0);          \coordinate (spyviewer) at (axis cs:0.5,-90);      \end{axis}           \spy[width=6cm,height=1cm] on (spypoint) in node [fill=white] at (spyviewer);           \end{tikzpicture}            \begin{tikzpicture}     %[spy using outlines={rectangle, magnification=3,connect spies}]           \begin{axis}[grid=major,no markers,domain=-5:5,enlargelimits=false]          \addplot[solid,mark=asterisk,mark options={solid},color=blue] {x^2};         \addplot[solid,mark=asterisk,mark options={solid},color=red] {x^3};           \addplot[only marks,mark=star,mark size=2pt,color=black] coordinates{(0,0)};         %\coordinate (spypoint) at (axis cs:0,0);          %\coordinate (spyviewer) at (axis cs:0.5,-90);      \end{axis}           %\spy[width=6cm,height=1cm] on (spypoint) in node [fill=white] at (spyviewer);           \end{tikzpicture}       \end{document}      I'm not allowed to upload an image here since I'm new, but the red and blue graphs disappear with the spy glass, where the black dot remains. The areas of the spy glass are correct, but also the black dot doesn't appear in the zoom area, it's completely empty. When not using spy, the graphs appear perfectly fine...


title: Multicol alternative

text: This post is a follow up to this post: multiple pairs of columns which was about generating columns of name/value pairs. There are sample outputs there. I now have several solutions and am at the point of figuring out what is best and whether there are any implementation alternatives. This is more about finding packages to implement solutions than generating solutions since I already have several working solutions prototyped but at any rate here are several criteria:   * have decided to generate this from a program so it should be amenable to that   * need lines between rows and columns so the solution must be sufficiently customizable   * happy tradeoff between leveraging latex functionality and keeping both the latex code and the program code which generates it simple   * readable generated latex code   * can handle varying widths of names and values   * runs fast   * can handle a single column of name/value pairs in addition to multiple columns Thanks to a number of respondents plus a few of my own tests I now have quite a few possible solutions some of which can be seen at the above link. There are undoubtedly other solutions too. They seem to fall in these categories:   * tikz based solution    * make each name/value pair a one row table and put these tables in a multicol or nested table    * make each column of name/value pairs a table and but them in a multicol or nested table I was favoring one table per column in a multicol since it was reasonably simple and automatically can handle varying widths of names and values per column but I came across a snag that multicol does not allow one column (I tried it and it gave me a message that it was going to use 2 columns despite the fact that I specified 1) so I would have to write the program twice: once with multicol and once for one column tables. Although nested tables seems a bit more work than multicol I am now thinking of moving to that since it allows all cases to fit in the same framework and so would be overall simpler. _Question_ : What I was wondering was whether there are any alternatives to multicol that can handle a single column and the other criteria. I have done quite a bit of searching but did not find anything suitable so far but thought I would post this in case someone else knows of something before I give up on that approach and move to the slightly more complex nested tables. EDIT: Here is the code for a tabu table for each column within a multicol. It works for two or more columns but not one.               \documentclass{article}     \usepackage{multicol}     \usepackage{tabu}     \usepackage[table]{xcolor}          \begin{document}               \providecommand{\Column}[1]{}     \renewcommand{\Column}[1]{%         \begin{tabu} to \columnwidth{>{\bfseries}lX}%         \everyrow{\tabucline[blue]-}%         #1%         \end{tabu}%     }          \begin{center}\small     \setlength{\columnseprule}{.4pt}     \renewcommand\columnseprulecolor{\color{blue}}     \begin{multicols}{2}          \Column{         Name1 & Value1. \\         Name2 & Value2. \\         Name3 & Value3. \\     }     \Column{         Name4 & Value4. \\         Name5 & Value5. \\     }          \end{multicols}     \end{center}          \end{document}      which looks like this: ![screenshot](http://i.stack.imgur.com/6iQWY.png)


title: Bibtex failing to cite one entry?

text: I've been reading a very interesting PhD thesis, and I would thus like to reference it in my work. Unfortunately this bibtex segment didn't work with `\cite{}`, instead giving `[?]`:               @phdthesis{michael_power_1991,         title = {The Power of Two Choices in Randomized Load Balancing},         url = {http://www.eecs.harvard.edu/~michaelm/postscripts/mythesis.pdf},         school = {Harvard},         author = {Michael David Mitzenmacher},         year = {1991}     }      What am I doing wrong?


title: IEEEeqnarray hyperlinks to a group of subnumbered equations

text: When I use IEEEeqnarray subnumbering and the hyperref package, hyperrefs to the subnumbered equations work fine; but if I try to reference the group of equations, the label is not found. Example document:               \documentclass[12pt]{report}     \usepackage{IEEEtrantools}     \usepackage{hyperref}          \begin{document}     When I create an IEEEeqnarray with subequation numbering and try to point back to the group of equations, the hyperrefs are broken.          \newpage          \begin{IEEEeqnarray}{rCl}\label{eqn:FirstParentLabel}     f(x) &=& 5x \IEEEyesnumber\IEEEyessubnumber\label{eqn:FirstSubeqnLabel}     \end{IEEEeqnarray}          \begin{IEEEeqnarray}{rCl}\IEEEyesnumber\label{eqn:SecondParentLabel}     g(x) &=& \pi \IEEEyesnumber\IEEEyessubnumber\label{eqn:SecondSubeqnLabel}     \end{IEEEeqnarray}          \begin{IEEEeqnarray}{rCl}     h(x) &=& 42 \IEEEyesnumber\label{eqn:ThirdParentLabel}\IEEEyessubnumber\label{eqn:ThirdSubeqnLabel}     \end{IEEEeqnarray}          \begin{IEEEeqnarray}{rCl}     k(x) &=& C \label{eqn:FourthLabel}     \end{IEEEeqnarray}          \newpage          References to subequations work: \ref{eqn:FirstSubeqnLabel},\ref{eqn:SecondSubeqnLabel}, and \ref{eqn:ThirdSubeqnLabel}.  But references to groups of equations do not work: \ref{eqn:FirstParentLabel}, \ref{eqn:SecondParentLabel}, and \ref{eqn:ThirdParentLabel}.  If I don't use subnumbering everything works fine: \ref{eqn:FourthLabel}.          \end{document}      I'm using TexLive 2012 and the most recent version of IEEEtrantools.sty. Compiler error messages are emitted: pdfTeX warning (dest): name{equation.0.0.3} ha s been referenced but does not exist, replaced by a fixed one pdfTeX warning (dest): name{equation.0.0.2} has been referenced but does not ex ist, replaced by a fixed one pdfTeX warning (dest): name{equation.0.0.1} has been referenced but does not ex ist, replaced by a fixed one Any ideas why this would be? I can't think of any more permutations on the attempts shown above. Thanks!


title: Spacing in the table of contents - change row

text: I need to change the spacing between the changes in a row. 6pt Spacing must be between \- 2.2 and 2.2.1 \- 2.3 and 2.2.2. ![enter image description here](http://i.stack.imgur.com/v8QLX.png) Use the comment               \renewcommand\cftsubsubsecafterpnum{\vskip6pt}      Unfortunately it does not work as I want.


title: 8 column table with lstinputlisting in LaTeX

text: I'd like to create a multicolumn table (up to 8 columns) to insert my code via `\lstinputlisting{source.c}`. But it seems to me that more then 6 columns aren't possibile even tough space is available. How can I get my 8 columns table? My minimal example is:               \documentclass{report}     \usepackage[portrait,a0paper,margin=1in]{geometry}     \usepackage{listings}          \usepackage{multicol}     \setlength{\columnwidth}{-25in}     \setlength{\columnsep}{-15in}     \setlength{\columnseprule}{0mm}          \begin{document}          \begin{multicols*}{8}     \lstinputlisting{source.c}     \end{multicols*}          \end{document}      But I get this error message: `! Dimension too large. \set@mult@vsize ...dima \vsize \col@number \vsize \advance \vsize -\@tempdim... l.47 \lstinputlisting`


title: Vertical Text Alignment in Title

text: I'm trying to make a title format with a large chapter number, and then smaller text with the name of the title. The following code mostly does what I want:               \documentclass[12pt]{book}     \usepackage{fontspec}     \setromanfont[Mapping=tex-text]{Garamond}     \usepackage{titlesec}     \titleformat{\chapter}{\raggedright}         {\fontsize{72pt}{72pt}\selectfont\thechapter}{1em}{\huge}          \begin{document}     \chapter{A Short Title}     Lorem ipsum...     \chapter{A Very Long Title With Extra Words}     Lorem ipsum...     \end{document}      However, if the chapter title is longer than 1 line, the vertical alignment of the numeral is unpleasant. I'd love to tell the numeral to be vertically aligned so that the top of the numeral matches the top of the rest of the text on the line, as opposed to the current alignment, where the baseline of the numeral is aligned with the baseline of the remainder of the text. I don't know what command would make this possible - and it's probable that there are lots better ways of solving this problem.


title: German Umlauts in BibTeX

text: I have the following BibTeX source               @INPROCEEDINGS{Lincke2008,       author = {Rüdiger Lincke and Jonas Lundberg and Welf Löwe},       title = {Comparing software metrics tools.},       booktitle = {ISSTA},       year = {2008},       editor = {Barbara G. Ryder and Andreas Zeller},       pages = {131-142},       publisher = {ACM},       added-at = {2008-08-04T00:00:00.000+0200},       biburl = {http://www.bibsonomy.org/bibtex/2c28c4fff6d811b643940228935a20e28/dblp},       crossref = {conf/issta/2008},       date = {2008-08-04},       description = {dblp},       ee = {http://doi.acm.org/10.1145/1390630.1390648},       interhash = {69e9d6ded70716bc2bb9319abfbb015f},       intrahash = {c28c4fff6d811b643940228935a20e28},       isbn = {978-1-60558-050-0},       keywords = {dblp},       url = {http://dblp.uni-trier.de/db/conf/issta/issta2008.html#LinckeLL08}     }      I'm managing my BibTeX items with JabRef. Now if I want to cite this item and while generating the PDF i get the following error:               ! Package inputenc Error: Keyboard character used is undefined     (inputenc)                in inputencoding `utf8x'.          See the inputenc package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.29 R�            diger Lincke, Jonas Lundberg, and Welf L�we.      I think the problem is the character `ö`. How can I avoid that? I also had similar problem with the character `é`.


title: $\cos \tau$ need to write in a different way

text: $$\frac{S \epsilon  \text{Cos}[\tau ]}{\sqrt{\lambda }}+\frac{\text{g2} S^2 \epsilon ^2 (-3+\text{Cos}[2 \tau ])}{6 \lambda }+\epsilon ^3 \left(\frac{\left(-\frac{1}{54} \text{g2}^2 S \left(32+19 S^2\right) \lambda +Z \left(\frac{35 \text{g2}^4}{27}-\frac{7 \text{g2} \text{g4}}{4}+\frac{5 \text{g5}}{8}-\frac{\text{g2}^2 \lambda }{6}+\frac{\lambda ^2}{24}\right)\right) \text{Cos}[\tau ]}{\lambda ^{5/2}}+\frac{S^3 \left(4 \text{g2}^2-3 \lambda \right) \text{Cos}[3 \tau ]}{72 \lambda ^{3/2}}\right)$$      I have copied this from Mathematica as tex file. But the problem is I need to write the $\cos[x]$ as $\cos x$. How can I do it?![enter image description here](http://i.stack.imgur.com/I7l9t.jpg)


title: Suppress introductory page numbers

text: I have a `memoir` document with introductory material (title page, table of contents, etc.) in the `\frontmatter` section. How do I prevent page numbers from automatically being put on these pages (currently they are roman numerals)? I still want normal arabic page numbers on every page in the `\mainmatter` section.               \documentclass{memoir}     \begin{document}          \frontmatter     \title{My Book}     \author{Me}     \maketitle          \mainmatter     Some text.          \end{document}      I am aware that I can switch page numbers on and off with `\pagenumbering{gobble}` and `\pagenumbergin{arabic}`. But I'm looking for a `memoir` setting which will automatically turn off page numbering for the `\frontmatter` section. (I'm asking because main document has lots of settings which seem to conflict with `\pagenumbering{gobble}` and generate warnings.) EDIT: As egreg pointed out, these warnings in my main document are generated by a conflict with the `hyperref` package. EDIT 2: If possible, I would like to remove the numbers from all pages in `\frontmatter`, but keep the page numbers in `\mainmatter` using my custom header and fooder settings:               % Headers and Footers          \nouppercaseheads          \makepagestyle{mystyle}      \setlength{\headwidth}{\dimexpr\textwidth+\marginparsep+\marginparwidth\relax}     \makerunningwidth{mystyle}{\headwidth}          \makeevenhead{mystyle}{\itshape\leftmark}{}{}     \makeoddhead{mystyle}{}{}{\itshape\leftmark}     \makeevenfoot{mystyle}{\thepage}{}{}     \makeoddfoot{mystyle}{}{}{\thepage}     \makepsmarks{mystyle}{\createmark{chapter}{left}{}{}{}}          \makeatletter     \makepsmarks{mystyle}{\createmark{chapter}{left}{shownumber}{\@chapapp\ }{:\ }}     \makeatother          \makepagestyle{plain}     \makerunningwidth{plain}{\headwidth}     \makeevenfoot{plain}{\thepage}{}{}     \makeoddfoot{plain}{}{}{\thepage}          \pagestyle{mystyle}


title: background [v2.1] package extraneous output using backgroundsetup

text: While using the new `background` package (v2.1, 4 Mar 2014) with minimal LaTeX commands in `\backgroundsetup`, I receive a centered text as `-1000pt` in a classic "Draft" watermark style. I have tried combinations of, `[pages=all]` option in package declaration, `\backgroundsetup`, yet this output persists. **Edit:** Sorry about the previous code, I removed the newlines in the code and it has compiled correctly with the same output. I am using `textblock` to position particular text at a specific location, say over a logo image. MWE is as follows. **Code**               \listfiles     \documentclass{article}     \usepackage{geometry}     \usepackage{xcolor}     \usepackage{tikz}     \usepackage[absolute,overlay,showboxes]{textpos}     \usepackage[pages=all]{background}     \geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}     \setlength{\TPHorizModule}{1mm}     \setlength{\TPVertModule}{1mm}     \setlength{\parindent}{0mm}     \backgroundsetup{contents={%     \begin{textblock}{50}(100,20) {\large {\textcolor{black}{Sometext}}} \end{textblock}%     }}     \begin{document}     HelloWorld!     \end{document}      **Output:** ![output](http://i.stack.imgur.com/MIjYy.jpg) Any pointers on rectifying this extraneous output would greatly help.


title: \addtocontents at end of document not getting written to .toc file?

text: I'm trying to find a more elegant solution for ToC, LoT, and LoF formatting for my university's thesis/dissertation style. The short form of their requirements means I need one page style for the first page of the ToC, a second page style for following pages up to where the appendix listings start, and yet a third style from the appendix listing through the end. It looks like I've run into a bug, or else I'm just missing a better solution. ### Minimal example 1               \documentclass{report}     \usepackage{lipsum}          \begin{document}     \addtocontents{toc}{\protect\thispagestyle{empty}\protect\pagestyle{plain}}     \tableofcontents          \input{twenty-chapters}     \appendix     \addtocontents{toc}{\protect\pagestyle{headings}\protect\thispagestyle{plain}}     \input{twenty-chapters}     \chapter{Foo} \include{a-chapter}     \addtocontents{toc}{\protect\thispagestyle{headings}}     \end{document}      Though I don't think it's relevant, the contents of `twenty-chapters.tex` is 20 lines of               \chapter{Foo} \include{a-chapter}      and `a-chapter.tex` is just:               \lipsum[1]     \section{Bar}     \lipsum[2-7]     \begin{figure}[tbp] \caption{Figure N} \end{figure}     \begin{figure}[tbp] \caption{Figure N} \end{figure}     \begin{figure}[tbp] \caption{Figure N} \end{figure}     \section{Baz}     \lipsum[8-9]     \begin{figure}[tbp] \caption{Figure N} \end{figure}     \begin{figure}[tbp] \caption{Figure N} \end{figure}     \begin{figure}[tbp] \caption{Figure N} \end{figure}      Here, I'm using the empty page style as a stand-in for the first page format, plain for the second page format, and headings for the third. This works fine on all but the last page of the ToC, which ends up with a plain page style instead of headings. ### Minimal example 2:               \documentclass{report}     \usepackage{lipsum}          \begin{document}     \addtocontents{toc}{\protect\thispagestyle{empty}\protect\pagestyle{plain}}     \tableofcontents          \input{twenty-chapters}     \appendix     \addtocontents{toc}{\protect\pagestyle{headings}\protect\thispagestyle{plain}}     \input{twenty-chapters}     \addtocontents{toc}{\protect\thispagestyle{headings}}     \chapter{Foo} \include{a-chapter}     \end{document}      Exactly the same as the first document, but now my final `\addtocontents` is before the last chapter. On this one, everything works perfectly. Empty page style on ToC page 1, plain on ToC page 2, and headings on ToC pages 3-4. Why would this make a difference? From looking at the `.toc` files for each example, my final `\thispagestyle` command is missing on the example that fails. Why would my `\addcontents` command not take effect in some situations?


title: Graphics in LaTeX for bits representation within boxes

text: I use `\fbox{}` in LaTeX to draw a box around a text. How can one achieve a computer bit representation as shown below, ![Here the number of boxes must be the input and the data to be entered can be as text](http://i.stack.imgur.com/UAArd.png)


title: LaTeX template for use cases

text: Currently I am trying to create a template in LaTeX for my team members in order to create a set of use cases. I thought of using tabular to create something like the picture below 2 (without colors). No problem so far. However, I hoped there is a nice way to structure the document a way, only commands have to be used, for instance `\actor{1}{System user}`, where 1 is use case #1. I don't know how to approach this for sure, especially when more then one line of text is included, for instance Main path (M) (at the picture). Has anyone an idea what would be a good way to structure such a template or could point me out the right documentation to look up this topic?


title: How can I insert the symbols into the caption of a figure?

text: I am having plots in my text. In the plots, the data sets are represented by different symbols. I'd like to explain data sets by using the symbols in the caption of the figure too. How can I insert that symbols into te caption ? for example: ![Caption of a Figure](http://i.stack.imgur.com/u9Y5O.png)


title: Style to make axis tick label opaque

text: I would like to make a specific tick label have a white opaque fill around it, so that the a line does not cross over it. Ideally I would like to be able to specify exactly which tick, but do not have an elegant method to do that, so below I attempted to use:               \pgfkeys{/pgfplots/My Y Tick Label/.append style={         yticklabel style={draw=none, inner sep=0pt, fill=white, text opacity=1}         }     }      to apply to _all_ the `yticklabel`s. This achieves the effect I want (note the `y=-2` label): ![enter image description here](http://i.stack.imgur.com/MM0yz.png) But it also has the unwanted side effect of shifting the `yticklabel` to the right. Well that to me seemed like I just need to use `.append style` instead of `.style` so that the prior settings don't get thrown away:               \pgfkeys{/pgfplots/My Y Tick Label Append/.append style={         yticklabel/.append style={draw=none, inner sep=0pt, fill=white, text opacity=1}         }     }      but using this seems to have absolutely no effect. ## Note:   * All the tick labels are manually specified, and I know exactly which particular tick labels to apply it on -- in case that simplifies the solution to Question 2 below.   * Follow up question posted at Style to make axis tick label opaque using "extra y tick" feature ## Questions:   1. How do I get an opaque tick label without adjusting its location?   2. Is there a way where I can apply this only on a specific tick label?   3. Is there perhaps a better way of doing this? I thought about changing the drawing of the asymptote but that is a bit more complicated. ## Code:               \documentclass{article}     \usepackage{pgfplots}          \newcommand{\XMin}{-2}%     \newcommand{\XMax}{2}%          \pgfkeys{/pgfplots/My Axis Style/.append style={         width=6cm, height=8cm,         xmin=\XMin, xmax=\XMax, ymin=-3.2, ymax=5,         axis y line=center,         axis x line=middle,          axis on top=true,         ytick={       -4,  -3,   -2, -1,  1,  2,   3,  4},         yticklabels={$-4$, $$, $-2$, $$, $$, $2$, $$, $4$},         }     }          \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$}}%          %---------- Above is to improve readability of MWE          \pgfkeys{/pgfplots/My Y Tick Label/.append style={         yticklabel style={draw=none, inner sep=0pt, fill=white, text opacity=1}         }     }          \pgfkeys{/pgfplots/My Y Tick Label Append/.append style={         yticklabel/.append style={draw=none, inner sep=0pt, fill=white, text opacity=1}         }     }               \begin{document}     \begin{tikzpicture}     \begin{axis}[My Axis Style,         %My Y Tick Label,%        This shifts the labels to right         %My Y Tick Label Append,% This has no effect         ]              \AddPlotFunction;         \AddPlotAsymptote;     \end{axis}     \end{tikzpicture}     %     \begin{tikzpicture}     \begin{axis}[My Axis Style,         My Y Tick Label,%        This shifts the labels to right         %My Y Tick Label Append,% This has no effect         ]              \AddPlotFunction;         \AddPlotAsymptote;     \end{axis}     \end{tikzpicture}     \end{document}


title: Undefined control sequence \State \COMMENT

text: Undefined control sequence `\State \COMMENT`. The manual clearly state that I can use the `\comment`. I use `\usepackage{algpseudocode} \usepackage{algorithm}`. Here is my code:               \documentclass[10pt, a4paper]{article}     \usepackage[utf8x]{inputenc}     \usepackage{amsmath,graphicx,subfigure}          \title{{Bachelor Thesis\\[0.5em]}            {\bf \huge Road Inventory\\Detection and Recognition\\[0.5em]}            {\bf Weekly Report 3}}     \author{Poul Sørensen. s093294}          %\setlength{\parindent}{0mm}     \setlength{\parskip}{1.5mm}               \usepackage{lettrine}     \usepackage[draft,english]{fixme}                   %Pakke til at skrive marginnoter under arbejdet. Skift draft til final når der skal printes. Brug 'fxnote{}','fxwarning', 'fxerror' eller 'fxfatal' alt efter behov.     %\fxsetup{layout=margin}                            %Footnote anbefales som option - men er ikke specielt praktisk?          \newcommand{\openCV}{\texttt{OpenCV}~}     \newcommand{\cpp}{\texttt{C++}~}     \usepackage{url}          % Different font in captions     \usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up,margin=7mm]{caption}          \usepackage{multirow}     \usepackage{array}          \usepackage{rotating}          \renewcommand{\topfraction}{0.85}     \renewcommand{\textfraction}{0.1}     \renewcommand{\floatpagefraction}{0.75}          \usepackage{color}          \definecolor{quotationcolour}{rgb}{0.95,0.95,0.95}     \definecolor{quotationmarkcolour}{rgb}{0,0.4,0.9}     % Double-line for start and end of epigraph.     \newcommand{\epiline}{\hrule \vskip -.2em \hrule}     % Massively humongous opening quotation mark.     \newcommand{\hugequote}{%       \fontsize{42}{48}\selectfont \color{quotationmarkcolour} \textbf{``}       \vskip -.5em     }          \newcounter{quotecounter}          % Beautify quotations.     \newcommand{\epigraph}[2]{%     \refstepcounter{quotecounter}       \begin{flushright}       \colorbox{quotationcolour}{%         \parbox{.95\textwidth}{%         \epiline \vskip 1em {\hugequote} \vskip -.5em         \parindent 2.2em         #1\begin{flushright}\textbf{Quote \thesection.\thequotecounter}~~ \textsc{#2}\end{flushright}         \epiline         }       }       \end{flushright}          }          \usepackage{algpseudocode}     \usepackage{algorithm}     \usepackage{eqparbox}     %\usepackage{program}     %\renewcommand{\algorithmiccomment}[1]{\hfill\eqparbox{COMMENT}{\backslash\backslash #1}}          \begin{document}          \maketitle          \newpage     \section{Performance Measurement }     There exist a few methods for measure performance~\cite{Book:OpenCV}. First one of interest is \textit{cross-validation} and its close related technique of \textit{bootstrapping}. A great outline on the topic can be found online\footnote{www.faqs.org/fags/ai-fag/neural-nets/part3/section-12.html}.          Cross-validation involves splitting the data $\Phi $ into $k$ distinct subsets ${\Phi_1,\cdots,\Phi_{k-1},\Phi_k}$, training $k$ times on $k-1$ of the subsets and testing with left out set. The $k$ test results can then be averaged to a final score.               %\begin{algorithm}     \begin{algorithmic}          \Procedure{CrossValidate}{$\Phi$}     \ForAll{$\phi \in {\Phi_1,\cdots,\Phi_{k-1},\Phi_k}$}          \State $model =$ Train($\Phi \setminus \phi$ )         \ForAll{$s \in \phi$ }             \State  \COMMENT{hej}         \EndFor          \EndFor     \EndProcedure          \end{algorithmic}      %\end{algorithm}               \section{Related Work}\fxnote{(intended for report.)}          \subsection{Machine Learning}     \input{../../"Report Parts"/MachineLearning/ML.tex}     \subsubsection{Prediction Trees}     \input{../../"Report Parts"/MachineLearning/PredictionTrees.tex}               \subsection{Colour Analysis}          \subsection{Decision Tree}          \subsection{Forest of Decision Trees}          \subsection{Hough Forest}          \newpage          \section*{Project status according to the study plan}          All under control. Report work is doing well.          \bibliographystyle{plain}      \bibliography{../../../../references}          \appendix     \end{document}


title: Different sorting schemes in different sections of bibliography

text: **Update 5-Sep-2012:** Sorry for highjacking this question, but as the status of the accepted selected answer has changed (now multiple sorting is implemented with biber/biblatex), and I think it is a good idea to update the answer of this question rather than me posting a new but nearly identical question. The question is how have different portions or fragments of the bibliography (separated e.g. by type) appear under different headings and each with a different sort order. I've tried using the `sorting` option of `\printbibliography` as suggested by PLK's answer bellow, but the numbers come out in the wrong order. Minimal example follows:               \documentclass{article}     \usepackage{filecontents}     \begin{filecontents}{biblatextest.bib}     @BOOK{BookA03,       author    = {Author Aaa},       title     = {Some Title},       publisher = {Some Publisher},       year      = 2003     }     @BOOK{BookB02,       author    = {Author Bbb},       title     = {Some Title},       publisher = {Some Publisher},       year      = 2002     }     @ARTICLE{PaperC04,       author  = {Author Ccc},       title   = {Some Title},       journal = {Some Journal},       year    = 2004,     }     @ARTICLE{PaperD01,       author  = {Author Ddd},       title   = {Some Title},       journal = {Some Journal},       year    = 2001,     }     \end{filecontents}     \usepackage[defernumbers=true]{biblatex}     \addbibresource{biblatextest.bib}     \begin{document}          \textcite{PaperD01}     \textcite{PaperC04}     \textcite{BookB02}     \textcite{BookA03}          \printbibliography[title={Books},type=book,sorting=nty]     \printbibliography[title={Articles},type=article,sorting=ynt]     \end{document}      The order of the bibliography entries in the output is correct, but the numbers are not. I get: "Books [3] [2]" and "Articles [1] [4]", rather than "Books [1] [2]" and "Articles [3] [4]" as I would expect. * * * Using `biblatex` how would one sort different sections in the bibliography by different criteria e.g.   * **Section A of biblio** : `Sort by name, title, year`, and   * **Section B of biblio** : `Sort by year, name, title`. For instance _Section A_ would be a list of books and _Section B_ a list of Proceedings where the Proceedings should be sorted by year. **Comment:** Different sections of a bibliography can be separately sorted by using sorttitle={}, see the example here:               @PROCEEDINGS{Feldman2000,       title = {Feldman v Mexico, ICSID Case No. Arb(AF)/99/1 (NAFTA)},       year = {6 December 2000},       shorttitle = {Feldman v Mexico},       sorttitle = {2000}       }            @PROCEEDINGS{JoyMining2004,         title = {Joy Mining Machinery Limited v. Arab Republic of Egypt, ICSID Case         No. Arb/03/11},         year = {6 August 2004},         shorttitle = {Joy Mining v Egypt},         sorttitle = {2004}       }      Is there another way to accomplish the same thing?


title: Vertical alignment of the top line in \sqrt

text: When using \sqrt, the top line of the square root symbol seems to be closer to the enclosed text for some text than for others. It even seems to line up differently with the left "check mark" portion of the symbol. It seems to have something to do with the dip down of the y below the baseline of the text. You can see the difference in the following, which I'm compiling with xelatex.               \documentclass{article}     %\usepackage{amsmath} same problem without amsmath     \begin{document}          $\sqrt[3]{918y}$     $\sqrt{34}$     $\sqrt{34y}$     \end{document}      ![rendered image](http://i.stack.imgur.com/b6NOT.png) Is there any way to fix it so that this doesn't happen, and \sqrt compensates for the different baselines?


title: Highlighting arbitrary chunks of text connected to quotes in margins - Can this be done in TeX/LaTeX?

text: I've got an idea and I'm wondering if it is possible to implement in TeX/LaTeX. The idea is I want to be able to associate arbitrary chunks of text on the page with a quote in the margin, and denote the association with a border around the chunk of text and a line connecting the chunk of text to the quote. Here is a picture of what I'm talking about: ![page](http://i.stack.imgur.com/2zJqo.png) Can this be done using TeX/LaTeX? if so, how?


title: Change body font in moderncv without affecting the other fonts

text: Is there a way to change the body font in `moderncv` (v0.7) without affecting the other fonts (for example `\firstnamefont`)? If I change the font via setting `\sfdefault` it influences not only the body font but all fonts of sections and title in the document.


title: Table of contents for thesis

text: I am writing my thesis and will prefer my table of contents to appear like Table Of Contents centered and not Contents aligned to the left. If U use `\tableofcontents` it appears to the left. The other question is how do I take away chapters from my table of content so that it appears like this                                       Table of Contents     Chapter     1 General information       1.1 data       1.2 good     2 Background       2.1 yes       2.2 hello      in that other can any body come to aid? thanks


title: Enlarged Characters

text: for a presentation about Chinese characters I need to enlarge a single character so that it takes about the size of 1/4 of the page (I plan to show 4 different characters in some kind of grid, which I am currently producing by using columns... probably not the best way, so I would be glad for tips in that perspective too) I would really appreciate your help here.


title: Page Layout of Songs Package problems

text: I'm creating a Songbook from the `songs` package. Currently I am having an issue with the format of the page. If the song is too long it doesn't break on the page end and goes to the second column. Here is an example of what's happening: ![](http://i.stack.imgur.com/bK3dK.png) I'm trying to debug this but I can't find out where is the error. Here is the code of my `.tex` file:               \documentclass[a4paper,12pt,onecolumn]{article}     \usepackage[utf8]{inputenc}     \usepackage[chorded]{songs}     \usepackage{a4wide}     \usepackage{pslatex}     \usepackage{verbatim}     \usepackage{graphicx}     \usepackage{float}     \usepackage{amssymb}     \usepackage{ebgaramond}          \ifchorded       \newcommand{\stopchords}{\chordsoff}       \newcommand{\resumechords}{\chordson}     \else       \newcommand{\stopchords}{}       \newcommand{\resumechords}{}     \fi          \renewcommand\printchord[1]{\sffamily\slshape\small#1}     \noversenumbers          \begin{document}     \songsection{Andrés Calamaro}     \begin{songs}{}     \beginsong{Flaca}[by={Andrés Calamaro}]     \beginverse     \[G]Flaca, no me cl\[B7]aves     tus puñ\[Em]ales, por la esp\[C]alda     tan prof\[G]undo, no me du\[D]elen     no me hacen m\[G]al.    \[D7]     \endverse     \beginverse \stopchords     Lejos, en el centro     de la tierra, las raíces     del amor, donde estaban     quedarán.      \endverse     \beginverse \stopchords     Entre no me olvides me dejé nuestros abriles     olvidados, en el fondo del placard     en el cuarto de invitados, eran tiempos dorados     un pasado mejor.      \endverse     \beginverse  \stopchords     Aunque casi me equivoco y te digo poco a poco     no me mientas, no me digas la verdad     no te quedes callada, no levantes la voz     ni me pidas perdón.      \endverse     \beginverse \stopchords     Aunque casi te confieso yo también he sido un     perro compañero, un perro ideal     que aprendió a ladrar y a volver al hogar     para poder comer.     \endverse \resumechords     \endsong     \nextcol     \beginsong{Cuando te conocí}[by={Andrés Calamaro}]     \beginverse     \[C]Cuando te conocí ya no \[E7]salías      con el \[Am]primero que te había \[Em]abandonado      no \[F]vale la pena \[C]hablar      de aquellos \[F]años pasados \[Dm] \[G]      \endverse     \beginverse  \stopchords     Cuando te conocí ya no salías      con aquel chico casado      que te prometía que la dejaría      y todavía no se había divorciado      \endverse     \beginverse  \stopchords     Cuando te conocí, salías      con un amigo de los pocos que tenías      eras lo mejor de su vida      pero fuiste lo mejor de la mía      \endverse     \beginverse  \stopchords     Cuando te conocí miré por un agujero      en tus pantalones      y dos años después      ya tomabas todas las decisiones      \endverse     \beginverse  \stopchords     Cuando te conocí      te reconocí por tus botas      y mientras tomabas tequila      dejamos atrás dos almas rotas      \endverse     \beginverse  \stopchords     Cuando te conocí me dijiste      que por mí no ibas a cambiar      ibas a seguir siendo igual,      ibas a seguir siendo igual      \endverse     \beginverse  \stopchords     Y en el fondo es tan hondo mi dolor      porque me voy, y no se puede cambiar      de corazón como de sombrero      sin haber sufrido primero     \endverse     \beginverse \stopchords     Y en el fondo es tan hondo mi dolor      porque me voy, y no se puede cambiar      de corazón como de camisa       \resumechords \[F] sin \[G]perder la \[C]sonrisa.     \endverse      \endsong     \scleardpage     \beginsong{Paloma}[by={Andrés Calamaro}]     \beginverse \resumechords     \[C]Mi vida fuimos \[G]a volar      \[Am]con un solo \[Em]paracaídas      \[F]uno sólo va a \[C]quedar      \[F]volando a la \[G]deriva      \endverse     \beginverse \stopchords     Vivir así no es vivír      esperando y esperando      porque vivir es jugar      y yo quiero seguir jugando      \endverse     \beginverse \stopchords     Le dije a mi corazón      sin gloria pero sin pena      no cometas el crimen, varón      si no vas a cumplir la condena      \endverse     \beginverse \stopchords     Quiero vivir dos veces      para poder olvidarte      quiero llevarte conmigo      y no voy a ninguna parte      \endverse     \beginverse \stopchords     No te preocupes, Paloma      hoy no estoy adentro mío      tu amor es mi enfermedad      soy un envase vacío      \endverse     \beginverse \stopchords     No te preocupes Paloma      no hay pájaros en el nido      dos ilusiones se irán a volar      pero otras dos han venido      \endverse     \beginverse \stopchords     Si me olvido de vivir      colgado de sentimiento      voy a vivir para repetir otra vez      este momento      \endverse     \beginverse \stopchords     Te bajaría del cielo, mujer      la luna hasta tu cama      porque es muy poco de amor      sólo una vez por semana     \endverse     \beginverse \stopchords     Puse precio a mi libertad      y nadie quiso pagarlo      te cambio tu corazón por el mio      para mirarlo y mirarlo      \endverse     \beginverse \stopchords     Ampas de gloria, mujer      quiero un pedazo de cielo      para invitarte a dormir      en la cama o en el suelo      \endverse     \beginverse \stopchords     Un sacrificio ritual bien o mal      yo quiero hacerle a mi estrella      sin principio ni final      no puedo vivir sin ella.     \endverse      \endsong     \beginsong{Estadio Azteca}[by={Andrés Calamaro}]     \beginverse  \resumechords     \[Em]Prendido, a tu botella \[C]vacía     esa que antes\[G], \[B7]siempre tuvo gusto a nada     \[Em]apretando los dedos, \[C]agarrandome     dándole mi vida\[G],\[B7] a ese paraa\[Em]valanchas.      \[G] \[Em] \[C] \[G] \[B7] \[Em]     \endverse     \beginverse \stopchords     Cuando era niño, y conocí el Estadio Azteca     me quedé duro, me aplastó ver al gigante     de grande me volvió a pasar lo mismo     pero ya estaba duro mucho antes.     \endverse     \beginverse \resumechords     Dicen que \[C]hay, dicen que \[G]hay     un mu\[B7]ndo de tenta\[Em]ciones     tambi\[C]én hay cara\[G]melos     con for\[B7]ma de cora\[Em]zones.     dicen que \[C]hay bueno ma\[G]lo,     \[B7]dicen que hay más o \[Em]menos     dicen que \[C]hay algo que te\[G]ner     \[B7]y no muchos te\[Em]nemos,  \[G] \[Em] \[C] \[G]     \[B7]y no muchos te\[Em]nemos. \[G] \[Em] \[C] \[G] \[B7] \[Em]     \endverse     \beginverse     Prendido a tu botella vací\[C]a     esa que an\[G]tes siempre tuvo gusto a nada.     \endverse     \endsong     \end{songs}     \end{document}


title: Bold small-caps header of theorems in amsbook

text: I'm using amsbook with amsthm. It seems that amsbook customized the theorem environment so that the theorem name (eg Theorem 1) is written in big caps and small caps, which is fine for me. But I want to make it bold. How to do it?


title: Grey box around the text

text: I have to write a `newenvironment`, which plots a grey box around the text. I can't decide which package I should be use. I am writing a dissertation and I want that some text sections have a grey box around the text. Which package should I use for my `newenvironment{greyBox}`? So you see down newenvironment it produces grey box around my text, but I want use this one               \vspace{5mm}     \begingroup     \leftskip4em     \rightskip\leftskip\textit{``text here.''}     \vspace{5mm}     \endgroup      in my newenvironment, but i can't integrate into it. The text in newenvironment should to intend right and left.               \documentclass{book}     \usepackage[ngerman]{babel}      \usepackage{xcolor}     \usepackage{mdframed}          \newenvironment{bla}%       {\begin{mdframed}[backgroundcolor=lightgray]}%       {\end{mdframed}}            %%%%%%%%%%%%%%%%%%%          \begin{document}          \begin{bla}          \begin{itemize}           \item Beccari       \item Gregorio       \item Blue            \end{itemize}     \end{bla}          \end{document}      I want exactly, that text + box are centered. I want like this picture ![enter image description here](http://i.stack.imgur.com/GuIms.jpg) Only the red part should be have a grey box, but I don't find still yet a solution.


title: Turing Machine Figure

text: Just curious if anyone had a good recommendation for generating a Turing machine style image using perhaps TikZ or something else that would create an image similar to the one shown here. ![Turing Machine](http://i.stack.imgur.com/zBpE7.png) Any sample/example code or links to similar content would be very much appreciated.


title: Use italic ampersand in different sizes depending on environment

text: This is going to be a little complicated: in the spirit of Bringhurst I am trying to incorporate italic ampersands into headings. I am using a LuaLaTeX modified version of classicthesis, hence the layout is relatively complex. I hope the following illustrates the problem. I tried to generate an MWE, but the table of content generation of classicthesis is a little to complex for me. classicthesis uses spaced capitals for chapter headings and small caps for section headings. The normalsized ampersand is fine for chapters, but to large for for sections. I created two versions `\amper` and `\ampersmall`:               \newcommand{\amper}{\protect\textit{\&}\xspace}     \newcommand{\ampersmall}{\protect\footnotesize\textit{\&}\xspace\normalsize}      The result is fine in the text: _Chapter with large ampersand_ ![Chapter heading](http://i.stack.imgur.com/5lBMP.png) _Section with small ampersand_ ![Section heading](http://i.stack.imgur.com/iNaYG.png) The problem is the table of contents, because here they layout is the opposite: chapter headings are in small caps and section headings are in normal text: ![TOC](http://i.stack.imgur.com/4S4Ly.png) Hence, I would like the exact opposite in the TOC: small ampersand for chapters, normal ampersand for sections. Does anyone has a suggestion how to accomplish switching the ampersand-macros in the TOC?


title: Prose Statement of Formulas

text: How can I write a prose statement for a particular formula. In other words, I would like to write CV = the standard deviation/mean x 100 so that "standard deviation/mean" would appear like a fraction, with a horizontal division line and mean appearing under the standard deviation.


title: Two Page Numbers in One Page

text: I am using LyX to layout a collection of essays. There is one page-number-position per spread in the design. Please find the example below. Instead of showing `59`, is it possible to show `58—59`? I am using `fancyhead` to define the current example. my code as follow:               \renewcommand*{\chapterpagestyle}{fancy}     \fancyhead{}%     \fancyfoot{}%     \fancyhead[CE]{\rmfamily \small \leftmark}     \fancyhead[CO]{\rmfamily \small\thepage }     \fancyhead[RO, LE]{\rmfamily \small }     \renewcommand{\headrulewidth}{0pt}      ![Example of the task](http://i.stack.imgur.com/DxZK6.png)


title: marginfix package interferes with title element vertical placement in memoir

text: Possibly in other classes as well. Typeset the below and everything is bunched up at the top of the page:               \documentclass{memoir}          \usepackage{marginfix}          \pretitle{\noindent\raggedright\begin{adjustwidth*}{0sp}{39bp}\fontsize{24bp}{24bp}\selectfont\MakeUppercase}     \posttitle{\end{adjustwidth*}}          \preauthor{\unskip\noindent\raggedright\normalfont\fontsize{16bp}{24bp}\selectfont\bfseries\MakeUppercase}     \postauthor{\par}          \date{}     \newcommand{\setpublisher}{\relax}     \newcommand{\publishers}[1]{\renewcommand{\setpublisher}{#1}}          \predate{\vspace*{\stretch{1}}\par\noindent\raggedright\noindent\normalfont\fontsize{12bp}{24bp}\MakeUppercase\setpublisher}     \postdate{\thispagestyle{empty}\clearpage}          \begin{document}     \title{Title goes here}     \publishers{Publishing information here}     \author{Author Name}          \maketitle          \end{document}      comment out the `marginfix` package and the publishers data properly goes to the bottom. Suggestions?


title: Which commands/packages add listoffigures to ToC?

text: How can I remove list of figures and list of tables from ToC? I read much questions about how to add them to the ToC. But indeed I have the problem that they are added and I don't want them to appear them. I use the documentclass `report`.               \documentclass[             paper=a4,           twoside=false,          10pt,               titlepage,               plainheadsepline,               plainfootsepline,               headsepline,               footsepline,         titlepage=false,                  abstracton,                  ngerman     ]{report}     \usepackage[nottoc,numbib]{tocbibind}      These are my first commands in the file. I don't know what does add them to the ToC. I produce the ToC and list of figures here:               \begin{document}     \input{titlepage}\clearpage     \pagenumbering{roman}     \include{abstract}     \startprintinglogo     \tableofcontents\clearpage     \printglossary\clearpage     \printglossary[type=\acronymtype,title={Abkürzungsverzeichnis}]\clearpage     \listoffigures\clearpage     \listoftables\clearpage     \lstlistoflistings\clearpage      The list of listings and the glossaries aren't added to the ToC - just the list of figures and the list of tables. But why?


title: Typesetting a Row Vector - Vol 2

text: If one would just **read** the question, one could easily understand that this is not a duplicate. Previously in this question, it was asked how to typeset a column vector. Two answers were present,   * First one used such syntax: `\colvec{1}{2}{3}`   * and the second one was like this: `\colvec{1;2;3}` Now I like the second one, because it seems shorter are more concise. Regarding this, another user had asked how to typeset a row vector. The answer given to that question had a syntax similar to the first bullet. I would like some help converting the one **which uses semicolons** into a row vector function, (original is given below):               \documentclass{article}          \makeatletter     \newcommand{\Spvek}[2][r]{%       \gdef\@VORNE{1}       \left(\hskip-\arraycolsep%         \begin{array}{#1}\vekSp@lten{#2}\end{array}%       \hskip-\arraycolsep\right)}          \def\vekSp@lten#1{\xvekSp@lten#1;vekL@stLine;}     \def\vekL@stLine{vekL@stLine}     \def\xvekSp@lten#1;{\def\temp{#1}%       \ifx\temp\vekL@stLine       \else         \ifnum\@VORNE=1\gdef\@VORNE{0}         \else\@arraycr\fi%         #1%         \expandafter\xvekSp@lten       \fi}     \makeatother               \begin{document}     \[     \Spvek{1;-2} \quad \Spvek[l]{1;-2;3}\quad \Spvek[c]{1;-2;-3}\quad\Spvek{1;2;-3;4}     \]     \end{document}


title: Anyone have some cool/artistic problem set templates?

text: I have been losing sleep lately as to how to make the most professional looking problem set (math and physics oriented) that is both easy to read and concise (i.e. no title pages), and yet is beautiful/elegant and has a good sense of style and professionalism (i.e. it looks like it could be from one of those great books Springer Graduate Texts). Here is my latest shot at this. ![Template for a Waves Class](http://i.stack.imgur.com/dxVlB.png) Source:               % ***********************************************************     % ******************* PHYSICS HEADER ************************     % ***********************************************************     % Version 2     \documentclass[12pt]{article}     \usepackage{amsmath} % AMS Math Package     \usepackage{amsthm} % Theorem Formatting     \usepackage{amssymb}    % Math symbols such as \mathbb     \usepackage{graphicx} % Allows for eps images     \usepackage[dvips,letterpaper,margin=1in,bottom=0.7in]{geometry}     \usepackage{tensor}      % Sets margins and page size     \usepackage{amsmath}          \renewcommand{\labelenumi}{(\alph{enumi})} % Use letters for enumerate     % \DeclareMathOperator{\Sample}{Sample}     \let\vaccent=\v % rename builtin command \v{} to \vaccent{}     \usepackage{enumerate}     \renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors     \newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}}      % for vectors of Greek letters     \newcommand{\uv}[1]{\ensuremath{\mathbf{\hat{#1}}}} % for unit vector     \newcommand{\abs}[1]{\left| #1 \right|} % for absolute value     \newcommand{\avg}[1]{\left< #1 \right>} % for average     \let\underdot=\d % rename builtin command \d{} to \underdot{}     \renewcommand{\d}[2]{\frac{d #1}{d #2}} % for derivatives     \newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} % for double derivatives     \newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}      % for partial derivatives     \newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}}      % for double partial derivatives     \newcommand{\pdc}[3]{\left( \frac{\partial #1}{\partial #2}      \right)_{#3}} % for thermodynamic partial derivatives     \newcommand{\ket}[1]{\left| #1 \right>} % for Dirac bras     \newcommand{\bra}[1]{\left< #1 \right|} % for Dirac kets     \newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right|      \left. #2 \vphantom{#1} \right>} % for Dirac brackets     \newcommand{\matrixel}[3]{\left< #1 \vphantom{#2#3} \right|      #2 \left| #3 \vphantom{#1#2} \right>} % for Dirac matrix elements     \newcommand{\grad}[1]{\gv{\nabla} #1} % for gradient     \let\divsymb=\div % rename builtin command \div to \divsymb     \renewcommand{\div}[1]{\gv{\nabla} \cdot \v{#1}} % for divergence     \newcommand{\curl}[1]{\gv{\nabla} \times \v{#1}} % for curl     \let\baraccent=\= % rename builtin command \= to \baraccent     \renewcommand{\=}[1]{\stackrel{#1}{=}} % for putting numbers above =     \providecommand{\wave}[1]{\v{\tilde{#1}}}     \providecommand{\fr}{\frac}     \providecommand{\RR}{\mathbb{R}}     \providecommand{\NN}{\mathbb{N}}     \providecommand{\seq}{\subseteq}     \providecommand{\e}{\epsilon}          \newtheorem{prop}{Proposition}     \newtheorem{thm}{Theorem}[section]     \newtheorem{axiom}{Axiom}[section]     \newtheorem{p}{Problem}[section]     \usepackage{cancel}     \newtheorem*{lem}{Lemma}     \theoremstyle{definition}     \newtheorem*{dfn}{Definition}      \newenvironment{s}{%\small%             \begin{trivlist} \item \textbf{Solution}. }{%                 \hspace*{\fill} $\blacksquare$\end{trivlist}}%     % ***********************************************************     % ********************** END HEADER *************************     % ***********************************************************          \begin{document}          {\noindent\Huge\bf  \\[0.5\baselineskip] {\fontfamily{cmr}\selectfont  Problem Set VIII}         }\\[2\baselineskip] % Title     { {\bf \fontfamily{cmr}\selectfont Physics 15c}\\ {\textit{\fontfamily{cmr}\selectfont     November 7, 2013}}}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\     {\large \textsc{david roberts}\footnote{With Elizabeth Petrik}} % Author name     \\[1.4\baselineskip]                     \section{Optical Activity and LCDs}     \emph{Some materials have a property called "optical activity,” that is, for circularly     polarized light, their index of refraction (and therefore their wavelength in the medium) depends on whether the light is right- or left-circularly polarized. The EM waves propagating in the $+\uv{z}$ direction inside such a medium can therefore be described by}     \[\v{E}(z,t)=E_L(\uv{x}+i\uv{y})e^{i(k_Lz-\omega t)} +E_R(\uv{x}-i\uv{y})e^{i(k_Rz-\omega t)}\tag{1}\]     \emph{where $E_L$, $E_R$, $k_L$, and $k_R$ are the amplitudes and wavenumbers of the left- and right-handed electric field components, and $\uv{x}$ and $\uv{y}$ are the unit vectors pointing in the $+\uv{x}$- and $+\uv{y}$-direction, respectively.}          \begin{p} Suppose that the incoming wave at $z = 0$ is linearly polarized in the x-direction, i.e.,     \[\v{E}(0,t) = E_0e^{-i\omega t}\uv{x} \tag{2}\]     Calculate $E_L$ and $E_R$.     \end{p}     \begin{s} We evaluate (1) at $z=0$ and set the resulting expression equal to (2), hereby     solving for  $E_L$ and $E_R$:     \begin{align*}     \v{E}(0,t)&=E_L(\uv{x}+i\uv{y})e^{-i\omega t)} +E_R(\uv{x}-i\uv{y})e^{-i\omega t}\tag{(1) with $z=0$}\\     &=[(E_L+E_R)\uv{x}+(E_L-E_R)i\uv{y})]e^{-i\omega t}=E_0e^{-i\omega t}\uv{x}     \end{align*}     \end{s}     \end{document}      A previous iteration: ![Template for a Waves Class](http://i.stack.imgur.com/y9GWf.png) Source:               % ***********************************************************     % ******************* PHYSICS HEADER ************************     % ***********************************************************     % Version 2     \documentclass[11pt]{article}     \usepackage{amsmath} % AMS Math Package     \usepackage{amsthm} % Theorem Formatting     \usepackage{amssymb}    % Math symbols such as \mathbb     \usepackage{graphicx} % Allows for eps images     \usepackage[dvips,letterpaper,margin=1in,bottom=0.7in]{geometry}     \usepackage{tensor}      % Sets margins and page size     \usepackage{amsmath}     \makeatletter % Need for anything that contains an @ command      \renewcommand{\maketitle} % Redefine maketitle to conserve space     { \begingroup \vskip 10pt \begin{center} \Huge {\bf \@title}         \vskip 10pt \large \@author \hskip 20pt \@date \end{center}       \vskip 10pt \endgroup \setcounter{footnote}{0} }     \makeatother % End of region containing @ commands     \renewcommand{\labelenumi}{(\alph{enumi})} % Use letters for enumerate     % \DeclareMathOperator{\Sample}{Sample}     \let\vaccent=\v % rename builtin command \v{} to \vaccent{}     \usepackage{enumerate}     \renewcommand{\v}[1]{\ensuremath{\mathbf{#1}}} % for vectors     \newcommand{\gv}[1]{\ensuremath{\mbox{\boldmath$ #1 $}}}      % for vectors of Greek letters     \newcommand{\uv}[1]{\ensuremath{\mathbf{\hat{#1}}}} % for unit vector     \newcommand{\abs}[1]{\left| #1 \right|} % for absolute value     \newcommand{\avg}[1]{\left< #1 \right>} % for average     \let\underdot=\d % rename builtin command \d{} to \underdot{}     \renewcommand{\d}[2]{\frac{d #1}{d #2}} % for derivatives     \newcommand{\dd}[2]{\frac{d^2 #1}{d #2^2}} % for double derivatives     \newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}}      % for partial derivatives     \newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}}      % for double partial derivatives     \newcommand{\pdc}[3]{\left( \frac{\partial #1}{\partial #2}      \right)_{#3}} % for thermodynamic partial derivatives     \newcommand{\ket}[1]{\left| #1 \right>} % for Dirac bras     \newcommand{\bra}[1]{\left< #1 \right|} % for Dirac kets     \newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right|      \left. #2 \vphantom{#1} \right>} % for Dirac brackets     \newcommand{\matrixel}[3]{\left< #1 \vphantom{#2#3} \right|      #2 \left| #3 \vphantom{#1#2} \right>} % for Dirac matrix elements     \newcommand{\grad}[1]{\gv{\nabla} #1} % for gradient     \let\divsymb=\div % rename builtin command \div to \divsymb     \renewcommand{\div}[1]{\gv{\nabla} \cdot \v{#1}} % for divergence     \newcommand{\curl}[1]{\gv{\nabla} \times \v{#1}} % for curl     \let\baraccent=\= % rename builtin command \= to \baraccent     \renewcommand{\=}[1]{\stackrel{#1}{=}} % for putting numbers above =     \providecommand{\wave}[1]{\v{\tilde{#1}}}     \providecommand{\fr}{\frac}     \providecommand{\RR}{\mathbb{R}}     \providecommand{\NN}{\mathbb{N}}     \providecommand{\seq}{\subseteq}     \providecommand{\e}{\epsilon}          \newtheorem{prop}{Proposition}     \newtheorem{thm}{Theorem}[section]     \newtheorem{axiom}{Axiom}[section]     \newtheorem{p}{Problem}[section]     \usepackage{cancel}     \newtheorem*{lem}{Lemma}     \theoremstyle{definition}     \newtheorem*{dfn}{Definition}      \newenvironment{s}{%\small%             \begin{trivlist} \item \textbf{Solution}. }{%                 \hspace*{\fill} $\blacksquare$\end{trivlist}}%     % ***********************************************************     % ********************** END HEADER *************************     % ***********************************************************          \begin{document}          \title{Physics 15c HW 4}     \author{David Roberts, with Nicki Charles}     \date{10/3/13}     \maketitle                    \section{Optical Activity and LCDs}     Some materials have a property called "optical activity,” that is, for circularly     polarized light, their index of refraction (and therefore their wavelength in the medium) depends on whether the light is right- or left-circularly polarized. The EM waves propagating in the $+\uv{z}$ direction inside such a medium can therefore be described by     \[\v{E}(z,t)=E_L(\uv{x}+i\uv{y})e^{i(k_Lz-\omega t)} +E_R(\uv{x}-i\uv{y})e^{i(k_Rz-\omega t)}\tag{1}\]     where $E_L$, $E_R$, $k_L$, and $k_R$ are the amplitudes and wavenumbers of the left- and right-handed electric field components, and $\uv{x}$ and $\uv{y}$ are the unit vectors pointing in the $+\uv{x}$- and $+\uv{y}$-direction, respectively.          \begin{p} Suppose that the incoming wave at $z = 0$ is linearly polarized in the x-direction, i.e.,     \[\v{E}(0,t) = E_0e^{-i\omega t}\uv{x} \tag{2}\]     Calculate $E_L$ and $E_R$.     \end{p}     \begin{s} We evaluate (1) at $z=0$ and set the resulting expression equal to (2), hereby     solving for  $E_L$ and $E_R$:     \begin{align*}     \v{E}(0,t)&=E_L(\uv{x}+i\uv{y})e^{-i\omega t)} +E_R(\uv{x}-i\uv{y})e^{-i\omega t}\tag{(1) with $z=0$}\\     &=[(E_L+E_R)\uv{x}+(E_L-E_R)i\uv{y})]e^{-i\omega t}=E_0e^{-i\omega t}\uv{x}     \end{align*}     \end{s}     \end{document}      Please, guys, I'm more interested in what you all have settled on over the years. I need an influx of artistic ideas and therefore I call on the community to summon forth its best work. I hope many will find this relevant.


title: Insert figure in a table, how to align figures with text in a table

text: I am inserting multiple figures into a table, and would like to make the following change:   1. center the text (1st column) in the cell (all the text currently are at the bottom)   2. center the figures (2nd and 3rd column) so that it doesn't cut the horizontal lines. The figures all have slightly different size. Is there a way to auto-adjust the height of each row so that all figures will fit it?   3. If possible, I would like to show some of the long text in two rows. For example, instead of :              Inverting op-amp (linear amplifier)      I want it to be in two lines, both horizontally centered in the cell:              Inverting op-amp     (linear amplifier)      Any suggestions would be highly appreciated! Thanks! Here is my latex code:               \begin{table}[ht]      \centering      \begin{tabular}{  p{4.5cm}  p{5cm}  p{5cm}  }      % centered columns (3 columns)      \hline\hline                                      %inserts double horizontal lines      Building Block  & Circuits & Frequency Response \\ [0.5ex] % inserts table heading      \hline             Inverting op-amp             (linear amplifier)             & \includegraphics[height=1in]{figures/servoblockAB.png}& \includegraphics[height=1in]{figures/servoblockAC.png} \\ [1ex]     \hline               Integrator              & \includegraphics[height=1in]{figures/servoblockBB.png}& \includegraphics[height=1in]{figures/servoblockBC.png} \\     \hline               AC integrator with DC gain             & \includegraphics[height=1in]{figures/servoblockCB.png}& \includegraphics[height=1in]{figures/servoblockCC.png} \\     \hline               Differentiator             & \includegraphics[height=1in]{figures/servoblockDB.png}& \includegraphics[height=1in]{figures/servoblockDC.png} \\     \hline               AC differentiator with DC gain             & \includegraphics[height=1in]{figures/servoblockEB.png}& \includegraphics[height=1in]{figures/servoblockEC.png} \\     \hline           \end{tabular}         \caption{A few basic circuit blocks and their frequency response for servo design.}         \label{table4.2}     \end{table}      ![enter image description here](http://i.stack.imgur.com/P9xc7.png)


title: Electronic mail-merge

text: This is not strictly a TeX/LaTeX/ConTeXt question, nevertheless this is probably the best place to ask. For the people who don't know: mail merge is a standard functionality in a word processor that allows to send personalized documents to a list of people (usually from some kind of a database). One can send such documents via snail mail or via e-mail. I've seen many packages/tools to generate the documents with LaTeX for printing and then sending them via snail mail. What I want to do, is to send the documents via email, as PDF attachments. LibreOffice has such an option. Unfortunately, as is the case for word processors, the generated documents are of rather poor typographic quality. Now comes the question. Has anyone seen/used a tool that might help with this task but with PDF documents compiled with TeX and friends? I have something in mind:   * Generate *tex files using Python and Jinja   * Compile *tex files using TeX and make (or rather: latexmk)   * Send the resulting *pdf files with python and its email library Still, as a lazy human being I would rather not write this from scratch. Can someone point me to an existing solution?


title: Subfigure and caption placement

text: I have 5 images to place (using the subfigure environment), I would like to place them either in two columns (one with 3 images, the other with 2), or in two lines (idem) and use the empty place that a 6th image would have taken to put the caption. How can I do that? Thanks!


title: Newtheoremstyle, newline and enumerate

text: Consider the following code :               \documentclass[12pt]{report}     \usepackage{amsthm}          \newtheoremstyle{multiple_remarks}       {1.0em}       {1.0em}       {\normalfont}       {0pt}       {\bfseries}       { : \\}       {5pt plus 1pt minus 1pt}       {}          \theoremstyle{multiple_remarks}     \newtheorem*{remarks}{Remarks}          \begin{document}         \begin{remarks}             Test.             \begin{enumerate}               \item First item.               \item Second item.               \item Fourth item.             \end{enumerate}         \end{remarks}              \begin{remarks}             \begin{enumerate}               \item First item.               \item Second item.               \item Fourth item.             \end{enumerate}         \end{remarks}     \end{document}      **Question:** Why the list doesn't begin on the line after the remarks header like it does for normal text, and how to fix this?


title: Drawing graphs in LaTeX

text: Is it possible to draw graphs like in image below in LaTeX? It doesn't have to look exactly the same. I need arrows with numbers and circles (or dots or other symbol) with text in it (or next to it). ![](http://i.stack.imgur.com/7smms.png)


title: How can I fill the area where the boundary is given by functions?

text: I defined an area bounded by four functions. I found related answers like: "filling area between 2 functions, with shading", but I am not able to adapt this. solution. Here the example:               % !TEX program  = pdflatex     % !TEX encoding = UTF-8 Unicode     \documentclass{standalone}     \usepackage{pgfplots}     \usepackage{amsmath}     \begin{document}     \begin{tikzpicture}     \begin{axis}[axis equal image,     width=10cm,     axis lines=middle,     axis line style={-latex},     clip =false,     xmin=0,xmax=2.45,     ymin=0,     no markers,     xlabel={$x$},ylabel={$y$},     every axis x label/.append style={anchor=north},     every axis y label/.append style={anchor=east},     ]     \addplot[domain=0.4:1.2,thick] { 1/x } node[anchor=135] {$f(x)=\dfrac{1}{x}$};     \addplot[domain=.6:2,thick] { 2/x } node[right] {$f(x)=\dfrac{2}{x}$};     \addplot[domain=0.7:1.5,thick] { x } node[right] {$f(x)=x$};     \addplot[domain=0.4:.8,thick] { 4*x } node[right] {$f(x)=4x$};               %\addplot+[domain=0.5:1] { 1/x };     %\addplot+[domain=1:sqrt(2)] { x };     %\addplot+[domain=1/sqrt(2):sqrt(2)] { 2/x };     %\addplot+[domain=0.5:1/sqrt(2)] { 4*x };     \end{axis}     \end{tikzpicture}     \end{document}      With the result: ![enter image description here](http://i.stack.imgur.com/oP4oI.png) I want to fill the area with vertical lines or maybe simple gray.


title: How to draw a ellipse figure in beamer at desired location? How to put a .eps logo figure at the right bottom corner?

text: Here is the code:                   \documentclass{beamer}         \usepackage{xeCJK}         \usepackage{tikz}         \usepackage{pstricks}         \setCJKmainfont{SimSun}              \usetheme{CambridgeUS}         \setbeamertemplate{navigation symbols}{}         \begin{document}              \title{moumou专题}         \author{author}         \institute{moumou@gmail.com}         \date{2013-08-03}              \begin{frame}         \titlepage         \end{frame}              \begin{frame}[t]         \scriptsize         在平面直角坐标系$xoy$中,点B与点$\text{A}(-1,1)$关于原点O对称,P是动点,且直线AP与   BP      的斜率之积等于$-\dfrac{1}{3}$.\\         (I)求动点P的轨迹方程;\\         (II)设直线AP和BP分别与直线$x=3$交于点M,N,问:是否存在点P使得$\bigtriangleup       \text{PAB}$与$\bigtriangleup\text{PMN}$的面积相等?若存在,求出点P的坐标;若不存在,说明理由.          \begin{pspicture}%[showgrid=true](8,6)          \psellipse[linecolor=red](4,3)(4,3)          \pscircle[linecolor=blue](4,3){2}          \end{pspicture}          \end{frame}              \begin{frame}[t]         \scriptsize     在平面直角坐标系$xoy$中,点B与点$\text{A}(-1,1)$关于原点O对称,P是动点,且直线AP与BP的斜率之积等于$-\dfrac{1}{3}$.\\        (I)求动点P的轨迹方程;\\        (II)设直线AP和BP分别与直线$x=3$交于点M,N,问:是否存在点P使得$\bigtriangleup     \text{PAB}$与$\bigtriangleup\text{PMN}$的面积相等?若存在,求出点P的坐标;若不存在,说明理由.       \begin{tikzpicture}       \draw (0,0) ellipse (2cm and 1cm);       \end{tikzpicture}       \end{frame}       \begin{frame}       \end{frame}       \end{document}      I can only draw simple figure, but I wonder how to put the figure at some place within a beamer slide. Here is a picture to describe my question. ![enter image description here](http://i.stack.imgur.com/rsnRs.png)


title: problem with scrpage2 and coloured borders

text: I'm trying to do this               \usepackage{scrpage2}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \usetikzlibrary{calc}     %\usetikzlibrary{intersections}     %\tikzset{variable/.default=}       \newcommand{\pageframe}{%         \begin{tikzpicture}[remember picture, overlay]            % page frame             \fill[red](current page.north west) rectangle (current page.south east);             \fill[white,rounded corners=1cm]($(current page.north west)+%(1cm,-1cm)$) rectangle ($(current page.south east)+(-1cm,4cm)$);     %       \node[fill=green,text width=1.5cm,text centered]      %           at ($(current page.south)+(0,4cm)$){\strut\pagemark};     %%       \strut gives all page mark nodes the same hight.          \end{tikzpicture}     }     % set page style     \cehead[\pageframe]{\pageframe}     \cohead[\pageframe]{\pageframe}     \pagestyle{scrheadings}      but it fails to compile:               ! Argument of \tikz@cc@parse@factor has an extra }.      I don't get it; if I comment the last line, `\pagestyle{scrheadings}`, it compiles, though output remains unmodified...


title: Keywords not showing up using journal template

text: So I am submitting a journal article to Elsevier, and using their template. However, I am unable to get keywords to work. I am replacing the dummy words with mine, but none of it is showing up. Can you suggest any solution? Its not even throwing errors, the keyword1 etc is just not showing up! Thanks.               \end{abstract}          \begin{keyword}     \MSC 41A05\sep 41A10\sep 65D05\sep 65D17     \KWD Keyword1\sep Keyword2\sep Keyword3          %% MSC codes here, in the form: \MSC code \sep code     %% or \MSC[2008] code \sep code (2000 is the default)     \end{keyword}          \end{frontmatter}          %\linenumbers          %% main text     \section{Introduction}


title: How to make the appendix appear at the end

text: I have the appendix page given by `\appendix` syntax. However, I have some figures that are appearing after the appendix. How to make sure that everything before the appendix appears before the appendix section?


title: pgfSweave() results in texi2dvi error "Missing \endcsname inserted"

text: When running pgfSweave using a file with the following sample code:               \documentclass[letter]{article}     \begin{document}      In this example we embed parts of the examples from the     \texttt{kruskal.test} help page into a \LaTeX{} document :     <<>>=     data(airquality)     kruskal.test(Ozone ~ Month, data = airquality)     @     \end{document}      and this command:               pgfSweave("sweave.Snw")      the following error occurs:               ...(latex header)....     ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")     ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty")))     ! Missing \endcsname inserted.     <to be read again>      ...(latex crashing out)...      This file works fine with this command:               Sweave("sweave.Snw")      and then "latex sweave.tex" at the command line.


title: always upright parenthesises and brackets

text: I was suggested by my thesis referee that parenthesizes `()` and citation brackets `[]` (I only use square brackets generated by `biblatex`)should always be in upright. This is indeed the same question as Upright parentheses in italic text and How to get upright parentheses in the whole document?. But the solution (embrac) there is not fully satisfactory. First, it produces errors for `\emph{\(math\) not work!}`; second, it does not work for italic texts in `theorem` environment. Since this is a style problem, I hope that there is no need to modify the code of the main file manually.


title: Problem to include EPS file with file name containing "#"

text: I have problem including EPS in LaTeX document. I am using `latex`->`dvips`->`ps2pdf` workflow to compile LaTeX document file. Error is thrown as > Illegal parameter number in definition The EPS file is generated by OriginPro7.5 by default ouput setting. It can be viewed in evince in Ubuntu. So is there any requirement for an eps file to be successfully included in LaTeX? EDIT: To be more specific, below is the LaTeX snippet,               \begin{figure}     \centering     \includegraphics[width=4.5cm]{figures/A.eps}     \end{figure}      Following error is thrown,               ! Illegal parameter number in definition of \@tempb.     <to be read again>     1.6 ...idth=4.5cm]{figures/A.eps}      But when I replace `A.eps` with `B.eps`, the system works fine, which makes me believe it's a problem of the EPS file. EDIT2: The real file name contains special character `#`, which is the cause of this problem. After removing `#` from the file name, problem solved.


title: IfFileExists and filecontents causes an error

text: I would like to use the `filecontents` environment in my document. I get a warning               LaTeX Warning: File `test.txt' already exists on the system.      Not generating it from this source.      If I run multiple passes of `pdfLaTeX` on the following               \documentclass{article}     \begin{filecontents}{\jobname.txt}       Hello World     \end{filecontents}     \begin{document}       \input{\jobname.txt}     \end{document}      The warning is obvious, the first pass creates the file, so the subsequent passes cause the warning. I thought I would be able to get rid of the warning with `IfFileExists`. The problem is that               \documentclass{article}     \IfFileExists{\jobname.bib}{}{       \begin{filecontents}{\jobname.txt}         Hello World       \end{filecontents}     }     \begin{document}       \input{\jobname.txt}     \end{document}      Gives me an error               ! LaTeX Error: Missing \begin{document}.      on the first pass and subsequent passes. What am I doing wrong?


title: Text alignment in tabular-environment

text: I would like to align the text within following table to the top and left. I'm pretty new to LaTeX so I have no clue. Sorry, if this questions has been asked already:               \documentclass{article}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[german]{babel}     %\usepackage{array}     \usepackage{lscape}     \usepackage{booktabs}     \begin{document}     \newcolumntype{C}[1]{>{\arraybackslash}m{#1}}% I found this somewhere but don't remember where          \begin{landscape}          \begin{tabular}{C{4cm}C{4cm}C{4cm}C{4cm}}     %<--- damit geht es jetzt auch ;)     \toprule     Cluster 1 & Cluster 2 & Cluster 3 & Cluster 4 \\      \midrule     \begin{itemize}      \item Canada, France, Germany      \item Austria, Belgium, Netherlands, Switzerland      \item Finland, Iceland, Norway, Sweden      \item Greece, Portugal, Spain      \item New Zealand     \end{itemize}      &      \begin{itemize}     \item Italy, Japan, United Kingdom, United States     \item Denmark, Ireland     \item Estonia, Hungary     \end{itemize}      &      \begin{itemize}      \item Luxembourg      \item Czech Republic, Slovenia      \item Australia, Korea, Turkey     \end{itemize}      &      \begin{itemize}      \item Poland, Slovak Republic      \item Israel     \end{itemize}     \\     \bottomrule     \end{tabular}          \end{landscape}          \end{document}


title: Resize paper to mbox

text: Is it possible to define a function where the page is resized to exactly the dimension of an mbox? For example, I want to do something like the following:               \documentclass{report}     \thispagestyle{empty}     \begin{document}     \mbox{\Huge buffer}     \end{document}      And have the output be a PDF whose dimension are exactly the size of the bounding box around the word "buffer". Currently, I am using the program `pdfcrop` to trim the resulting image, but this is a hack. I was wondering if there was a way to do this in TeX natively.


title: \nocite and pagebackref option

text: I'm interested in using `\nocite` and `pagebackref` together which sounds a bit strange. I'd like to get bibliographic references at the end of a document with mention of the page where they appear (hence the use of `pagebackref`) but with no specific reference in the text (like the usual [1] number, hence the use of `\nocite`). Maybe, I could use `\cite` instead but using an option with no reference? References in the page will be achieved through footnotes. `endnote` and `footbib` packages do not seem to offer solutions of this type but I may be wrong.


title: Using \textwidth via strip@pt with beamer and the picture environment

text: OK, I admit I haven't tried my MWE without Beamer. My goal is to use e.g `\textwidth` with the picture environment, and my overall goal is to include several rectangular portions of an .eps file within a picture environment. I was trying to follow @Qrrbrbirlbel's example here: How to use \textwidth (or any variable) in a picture environment But I can't use his geometry package options with Beamer (not sure if that is the problem, but I guess not). Here's the MWE:               \documentclass[compress,red,notes]{beamer}          \begin{document}          \frame{\frametitle{An overview to constraint-based modeling}          \makeatletter     \def\strippt{\strip@pt}     \makeatother          \newsavebox{\toynet}     \savebox{\toynet}{       \includegraphics*[width=\textwidth, viewport=0 418 708 718, clip=true]     {SmatExample}  }          \newsavebox{\toySmat}     \savebox{\toySmat}{     \includegraphics*[width=\textwidth, viewport=0 0 708 418, clip=true]     {SmatExample} }          \newsavebox{\FBAgeom}          \begin{picture}(\strippt\textwidth, \strippt\textheight)     \put(0,\strippt\textheight){\usebox{\toynet}}          \end{picture}     } % end of \frame          \end{document}      When I try to compile this, I get the following error:               No file test.nav.     <SmatExample.eps> <SmatExample.eps>     ! Undefined control sequence.     \strippt ->\strip                       @pt     l.27 }            % end of \frame      And here is another question I had using the same image (if you want to download the image to work with the MWE): How to correctly clip with viewports with includegraphics and beamer columns? Note that in my current example I haven't attempted to use the correct coefficients for `\textwidth` or `\textheight`.


title: Error when compiling with Tex4ht

text: I'm trying to compile a part of my thesis with tex4ht (to use LibreOffice grammar checker). It was working well few weeks ago but now it fails with the error:               ! Undefined control sequence.     \H@refstepcounter #1->\sf@Hrefstepcounter                                            {#1}\@ifundefined {c@sub#1}{}{\if@...     l.42  \centering      It seems related to the subfig package. I use TeXLive 2010 on Ubuntu 11.04. Here is MWE with the way I load hyperref (the photo is the one from this wikipedia article):               \documentclass[12pt,a4paper,twoside,openright,titlepage,fleqn,headsepline,headinclude,footinclude]{scrbook}          \usepackage{graphicx}     \usepackage{subfig}     \usepackage[unicode=true,bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,breaklinks=false,colorlinks=true]{hyperref}     \usepackage[all]{hypcap}          \begin{document}          \begin{figure}      \centering      \subfloat[Who's that?]{\includegraphics[width=0.45\textwidth]{Einstein_1921_portrait2.jpg}}%      \qquad      \subfloat[Who's that?]{\includegraphics[width=0.45\textwidth]{Einstein_1921_portrait2.jpg}}      \caption{A famous scientist and his twin brother.}     \end{figure}          \end{document}


title: Using 'semilogyaxis' with 'groupplot' in PGFPlots

text: Using groupplot library of PGFPlots, the command \nextgroupplot can take the parameters that \begin{axis} used to take. So giving it the option "ymode=log" should effectively make the plot a semilogyaxis plot. However I do get an error when I do that: > Missing number, treated as zero. This is strange because it works find if I gave it xmode=log it runs without errors (although giving an empty plot instead). The minimum running example follows:               \documentclass[11pt]{article}     \usepackage[utf8x]{inputenc}     \usepackage{tikz}     \usepackage{pgfplots}          \usepgfplotslibrary{groupplots}          \begin{document}       \begin{tikzpicture}[scale=0.6]         \begin{groupplot}[ group style={group name=my plots, group size=2 by 1}, ymax=1, restrict y to domain=0:1]           \nextgroupplot[ymode=log]%           \addplot+[domain=0:6,mark=o,smooth,samples=20] {2^(-1)*exp(x)};%           \addplot+[domain=0:6,mark=square,smooth,samples=20] {1-((1-2^(-1))/exp(x))};%                \nextgroupplot%           \addplot+[domain=0:6,mark=o,smooth,samples=20] {2^(-3)*exp(x)};%           \addplot+[domain=0:6,mark=square,smooth,samples=20] {1-((1-2^(-3))/exp(x))};%         \end{groupplot}       \end{tikzpicture}      \end{document}      The equations used to plot normally in a semilogyaxis, but I wanted them in a groupplot. So the function domain and so should not be the problem.


title: article with notitlepage still has the title page separately. why?

text: It seems strange from what I've read because the documentclass article should not generate a separate page for the title. For me, it does, though. Even if I add the option `notitlepage`. The code:               \documentclass[notitlepage]{article}     %%!TEX encoding = UTF-8 Unicode     \usepackage[utf8]{inputenc}     %\usepackage{ngerman}     %\usepackage[ps2pdf,a4paper,colorlinks]{hyperref}     \usepackage[a4paper,colorlinks]{hyperref}     \usepackage[a4paper,%         inner=3.5cm,%         outer=3.5cm,%         top=4cm,%         bottom=4cm,%         marginparwidth=2.5cm,%         marginparsep=0.3cm,%         includehead]{geometry}     \usepackage{makeidx}     \usepackage[fleqn]{amsmath}     \usepackage{amsthm}     \usepackage{amstext}     \usepackage{amssymb}     \usepackage{mathtools}     \usepackage{xparse}     \usepackage{tikz}     \usetikzlibrary{automata,positioning}          \hypersetup{%         pdftitle = {Semi-smooth Newton},%         pdfsubject = {},%         pdfauthor = {Albert Zeyer}%     }          \include{texdefs}          \begin{document}     \title{Semi-smooth Newton}     \author{Albert Zeyer}     \date{\today}          \maketitle          \include{main}          \bibliographystyle{alpha}     \bibliography{bibliography}          \end{document}      Where main.tex contains the main content (starts with a `\section`) and texdefs.tex contains some `\newcommand` and other stuff.


title: Semi-transparent background for image

text: I would like to add a semi-transparent background to an eps figure in `beamer`. The picture itself has transparent background. I want to add the semi-transparant background as I use the `tikz` package to overlap it with a first figure whose overlaped parts should still be visible. Here is the code I have so far:               \begin{frame}{}         \begin{itemize}             \item item             \begin{tikzpicture}                 \node (img1) {\includegraphics[height=0.4\textwidth]{figure1}};                 \visible<2>{\node (img2) at (img1.south east){\includegraphics[height=0.4\textwidth]{figure2}};}             \end{tikzpicture}         \end{itemize}     \end{frame}


title: tikz loops, creating triangle with jagged hypotenuse

text: I am in dire need of constructing the image below. In short I am trying to create an exact replica of the image, and an alternative image, with a much more jagged hypotenuse. ![Jagged hyptenuse](http://i.stack.imgur.com/LmvcQ.png) I thought about using a for loop in latex, but being as inexperienced as me, this proved difficult. My intital progress has been shown below               \documentclass[10pt,a4paper]{minimal}     \usepackage{tikz,tkz-euclide}     \usepackage{mathtools,amssymb,amsmath}     \begin{document}          \begin{tikzpicture}[scale=4]     \def \a{5}     \tkzDefPoint(0,0){O} \tkzDefPoint(1,0){A} \tkzDefPoint(1,1){B}     \tkzDrawSegments(O,A A,B)      \tkzLabelSegment[below](O,A){1} \tkzLabelSegment[right](A,B){1}     \tkzLabelPoints[below left](O) \tkzLabelPoints[below right](A) \tkzLabelPoints[above right](B)     \foreach \i in {0,...,\a}{     \tkzDrawSegment( ( \i:\a, \i:\a ),( \i:\a,(\i+1):\a ) )}     \end{tikzpicture}     %\tkzDrawSegment( ( \i:\a,(\i+1):\a ),((\i+1):\a,(\i+1):\a))          \end{document}      Any help would be greatly appreciated. My problem is creating the for loop. I just can not get it right, I think the problem is latex evaluating 0/4 and 1/3 as symbols not numbers


title: Creating gears in TikZ

text: I am trying to create a gear in TikZ in which the number of spikes can be determined and the size as well. I was looking through the pgfmanual and stumbled upon the decorations section and I tried a piece of code there. Here is what I have so far:               \documentclass[letterpaper]{article}     \usepackage{tikz}     \usetikzlibrary{decorations}     \begin{document}     \pgfdeclaredecoration{example}{initial}     {     \state{initial}[width=20pt]     {     \pgfpathlineto{\pgfpoint{0pt}{5pt}}     \pgfpathlineto{\pgfpoint{5pt}{5pt}}     \pgfpathlineto{\pgfpoint{5pt}{-5pt}}     \pgfpathlineto{\pgfpoint{10pt}{-5pt}}     \pgfpathlineto{\pgfpoint{10pt}{5pt}}     }     \state{final}     {     \pgfpathlineto{\pgfpointdecoratedpathlast}     }     }     \tikz[decoration=example]     {     \draw [red,decorate] (0,0) circle (1cm);     }     \end{document}      which yields: ![enter image description here](http://i.stack.imgur.com/CcMN8.png) Of course the above is not satisfactory. Is there a way a gear can be drawn in TikZ or any other graphics package? > Update: For those interested in ready made svg images, the NounProject > provides some sample files. Follow this link: Engrenages.


title: Showing bibliography w/out citing - \nocite(*) not working

text: I have separate .tex and .bib files, and I'm trying to print just my bibliography. Having followed the instructions here, I've ended up with               \documentstyle{amsart}     \begin{document}     \nocite{*}     \bibliographystyle{amsplain}     \bibliography{Bibliography}     \end{document}      and               @book{ulrich,     Author = {Karl Ulrich, Steven Eppinger},     Publisher = {Just testing},     Title = {Product Design and Development},     Edition = {5},     Year = {2011}}      I get - nothing. TeXShop (Version 3.18) does compile, but too quickly for me to read anything, and results in nothing. I've got in the same folder the files Bibliography.bib, PrintJustBib.aux, PrintJustBib.log, PrintJustBib.tex. Any tips?


title: How to import bibliography (from .bib file) to svg or other Inkscape friendly format

text: I want to make a poster in Inkscape and include the bibliography I have in .bib file. When I had only one item in the list, I just copied the text from generated pdf and manually formatted it (adding the italics etc.). But I can imagine that when there is a long list of references, copying and formatting gets tedious and error-prone. For maths equations I convert the LaTeX code to SVG and I was wondering if the same can be done with bibliography? The downside of this solution is that the resulting SVG file won't let me format text anymore so I can't control the line breaking. My question is - is there an easy way to generate the bibliography from .bib file and convert it to SVG or another format that will allow further text formatting?


title: Captions: Write directly below "Figure"

text: a typical caption below an image looks like: > Fig 1.1: Whatever the content might be   >  **___ __ ___ __** it is described here. My problem is that I'd like to write below "Fig 1.1" at the position of **___ __ ___ __**. I've managed to replace "Figure" by Fig, thus the lost space isn't that huge, but it's still annoying... Is there any way avaid this indent? Maybe something with \noindent? But this would require inserting manual line breaks everywhere... I can't provide a minimum working example since it would require an image however everyone should see the issue when writing a little caption of at least two lines below an image. Can anybody help me with this?


title: Some problems drawing linked lists with TikZ's matrix library

text: Some time ago I found the question Draw an adjacency-list representation of a graph with tikz and wanted to solve it. I could but with some problems which still remain and How should I draw a singly/double linked list? remind me them. My solution was:               \documentclass{standalone}      \usepackage{tikz}      \usetikzlibrary{matrix,arrows}           \begin{document}      \begin{tikzpicture}[>=stealth]      \matrix (M) [matrix of nodes,%         column sep=0pt,%         row sep=1mm,%         nodes={draw, fill=gray!20,%          minimum width=.5cm, outer sep=0pt,%           minimum height=.7cm, anchor=center},         column 1/.style={minimum height=.8cm}]%     {        \mbox{} &[2mm] 2 & \mbox{} &[2mm] 5 & / &[2mm] &   &[2mm] & \\        \mbox{} & 1 & \mbox{} & 5 & \mbox{} & 3 & \mbox{} & 4 & / \\        \mbox{} & 2 & \mbox{} & 5 & \mbox{} & 3 & / & & \\      };           \foreach \i in {1,2,3}{       \path (M-\i-1) [late options={label=left:\i}];       \draw[->] (M-\i-1)--(M-\i-2.west);       \draw[->] (M-\i-3.center)--(M-\i-4.west);      }           \draw[->] (M-2-5.center)--(M-2-6.west);      \draw[->] (M-2-7.center)--(M-2-8.west);      \draw[->] (M-3-5.center)--(M-3-6.west);           \begin{scope}[yshift=-3cm]     \matrix (M) [matrix of nodes,%         column sep=0pt,%         row sep=1mm,%         nodes={draw, fill=gray!20,%         minimum width=.5cm, outer sep=0pt,%          minimum height=.7cm, anchor=center},         column 1/.style={minimum height=.8cm}]%     {       |[label=left:1]| \mbox{} &[2mm] 2 &\mbox{}&[2mm] 5 & / &[2mm] &   &[2mm] & \\       |[label=left:2]|\mbox{} & 1 & \mbox{} & 5 & \mbox{} & 3 & \mbox{} & 4 & / \\       |[label=left:3]| \mbox{} & 2 & \mbox{} & 5 & \mbox{} & 3 & / & & \\      };           \foreach \i in {1,2,3}{      % \path (M-\i-1) [late options={label=left:\i}];       \draw[->] (M-\i-1)--(M-\i-2.west);       \draw[->] (M-\i-3.center)--(M-\i-4.west);      }           \draw[*->] (M-2-5.center)--(M-2-6.west);      \draw[*->] (M-2-7.center)--(M-2-8.west);      \draw[*->] (M-3-5.center)--(M-3-6.west);      \end{scope}     \end{tikzpicture}      \end{document}      with this results ![enter image description here](http://i.stack.imgur.com/Uw2Pi.png) Now some questions: 1- I used \mbox{} to distinguish 'empty nodes' from 'empty cells'. Do you know a better solution? 2- Although `column 1/.style` is declared boxes from 1st column show same heigth than other ones. Why? 3- Using `labels` within nodes (bottom example) changes `node` (or `cell`?) center. This problem can be avoided with `late options` (upper example). Do you know a better option? 4- Looking at first and secon column from upper example it seems that node's name is not equivalent to node.center. Do you know why? 5- I don't know if it's a rendering problem but it looks like adjacent cells have a thicker separation line. What must be column separation to draw border lines one over the other? 6- Solution for How should I draw a singly/double linked list? show starting point of `*->` arrows aligned with node center, but here its beahviour is like in Modifying `*` and `o` style tikz arrows so that they are centered at the end of line. Coul you explain me why?


title: Nested endnotes

text: How can one include an endnote within another endnote? The desired output would be one endnote structure with all endnotes appearing in the order in which they are invoked (i.e., a nested [child] endnote would have a number preceding that of a non-nested endnote occurring subsequent to the parent endnote). The following syntax is not valid but may give an idea of the desired output. I imagine the solution may be similar to the use of the `\footnotemark` and `\footnotetext` commands for achieving nested footnotes.               \documentclass{article}     \usepackage{endnotes}     \begin{document}     Attempt to nest endnotes%     \endnote{First note\endnote{Second note.}\endnote{Third note.}.}.%     \theendnotes     \end{document}      The content of this question is similar to Converting footnotemarks to endnotes, the difference being that it seeks to directly nest endnotes rather than achieve the same effect via conversion from a document containing nested footnotes. Ideally, a solution would be compatible with nesting of an arbitrary number of notes and to arbitrary depth of endnote "generation."