title: mdframed creates empty frame edge on new page

text: I have a document where I use shaded `mdframed` frames for annotations. One annotation is on the very bottom of the page and somehow the frame extends to the next page even though all its content is on the previous page. This was really hard to reproduce in a simpler document. I managed to simplify it to the MWE below which is also here, and the output is: ![enter image description here](http://i.stack.imgur.com/paWcu.png) This example is very fragile, i.e. small changes will cause the frame to either end on the first page or push a line to the second one. In my document however it is a lot more robust. Even adding or removing a line from the frame doesn't solve the issue (the content of the page is just adjusted to fit the page and the frame shows the same behaviour). This may be explained by the use of other packages (e.g. `microtype`), but cannot be the cause of the problem. It does however make the approach of just editing the text to be a line shorter or longer unfeasible. What might be causing this behaviour and how can I avoid it? ## Code:               \documentclass[parskip=half, a4paper]{scrartcl}     \usepackage[margin=2cm, lmargin=3cm, footskip=1cm]{geometry}          \usepackage{amsmath}          \usepackage[compact, explicit]{titlesec}     \titleformat{\section}[hang]{\Large\bfseries}{\hspace{-1cm}section \thesection:}{1ex}{#1}     \titleformat{\subsection}[leftmargin]{\filleft\bfseries}{\hspace{-1cm}\alph{subsection})}{0ex}{}     \titleformat{\subsubsection}[runin]{\bfseries}{\hspace{-1em}\thesubsubsection\quad}{0ex}{\hspace{-1em}#1\mbox{\quad}}          \usepackage{titling}     \pretitle{\begin{center}\Huge\bfseries\sffamily}     \posttitle{\end{center}}     \preauthor{\begin{center}\rm\Large}     \postauthor{\end{center}}     \predate{\begin{center}\rm\large- }     \postdate{ -\end{center}}     \setlength{\droptitle}{-2cm}          \title{title}     \author{author\\author}     \date{date}          \usepackage[xcolor]{mdframed}     \newmdenv[hidealllines=true, backgroundcolor=gray!30, font=\small]{revision}          \begin{document}          \maketitle          \section{first}     \subsection{}     text          \subsection{}     text          \subsection{}     text          \subsection{}     text          text     \[         x     \]     text          text     \[         x     \]     text     \[         x     \]     text          \section{second}     text     \begin{align*}         x\\x\\x\\x     \end{align*}     text          text          text          text          text     \linebreak     text          \begin{revision}         text              text              text              text     \end{revision}          \section{third}     \subsection{}     text          \end{document}


title: Have subfiles declare sections to be included in different places of the document

text: I'd like to have several Latex files, imported or included in a master `document.tex` file, which declare different sections to be included in the master file, like:               % in file a.tex     \begin{notes}     My notes from file A     \end{notes}          \begin{examples}     An example from file A     \end{examples}          %%%%%%%%%%%%%%%%%%%%%%%%%%%          % in file b.tex     \begin{notes}     My notes from file B     \end{notes}          \begin{examples}     An example from file B     \end{examples}          %%%%%%%%%%%%%%%%%%%%%%%%%%%          % in file document.tex          \section{Notes}     % input notes from a.tex and b.tex          \section{Examples}     % input examples from a.tex and b.tex      And have the following output:               Notes     My notes from file A     My notes from file B          Examples     An example from file A     An example from file B      I could have 4 separate files instead of 2 (`a.notes.tex`, `a.examples.tex`, etc), but I'd like to keep everything related to `a` in a single file, if possible. Do you know if there is a way to achieve this behaviour?


title: l3regex usage throws __scan_new:N error

text: Using TeXLive, with this MWE               \documentclass{article}     \usepackage{expl3}     \usepackage{l3regex}     \begin{document}       a     \end{document}      I get an error for an undefined control sequence               (/usr/share/texlive/texmf-dist/tex/latex/l3experimental/l3str/l3tl-analysis.sty     Package: l3tl-analysis 2011/12/08 v3039 L3 Experimental token lists analysis     (/usr/share/texlive/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty     Package: l3str 2013/04/24 v4482 L3 Experimental strings     )     ! Undefined control sequence.     <recently read> \__scan_new:N           l.54 \__scan_new:N                        \s__tl      I assume some incompatible (too old) L3 packages. However, the Debian packages word quite well in resolving dependencies in the past. Could you please assist me?


title: How do I define a new punctuation mark?

text: Here's is some code for a variant exclamation point despite its various short comings (such as non-scalability)               \documentclass[12pt]{article}     \usepackage{tikz}     \usetikzlibrary{calc}          \newcommand\bigexclaim{%%       \tikz{%%         \node[circle,fill,inner sep=0.55pt] (A) at (0,0)     {};         \coordinate                         (B) at (0,2.5ex)   ;         \draw[fill,rounded corners=1.25pt] ($(A)!1.5pt!-23:(B)$) --                                             ($(A)!1!-16:(B)$)     --                                             ($(A)!1!-30:(B)$)     --                                              cycle;       }}     \newsavebox{\myexclamationptbox}     \savebox{\myexclamationptbox}{\bigexclaim}     \newcommand{\myexclamationpt}{\usebox{\myexclamationptbox}\kern-2pt}          \begin{document}            Prove\myexclamationpt    \par       Prove!          \end{document}      ![enter image description here](http://i.stack.imgur.com/naCsd.png) For math mode we've got various formatting commands such as `\mathbin`, `\mathrel`, and `\mathpunct` to get the spacing _correct_ around new binary operators, relations, and punctuation. Is there something similar for creating custom punctuation marks? Is there glue that should be considered? Or is this all just a matter of guessing until you like what you see?


title: When i start my new page everything just goes to the top of the first page. Also, how can i keep everything in my left column aligned?

text: \documentclass[twocolumn]{article}     \pagestyle{empty}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{multicol}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \oddsidemargin=0pt     \topmargin=0pt     \textwidth=6.5in     \textheight=8.5in     \begin{document}     \textcolor{cyan}{\Large \bfseries{8.1 Complex Numbers}}     \begin{multicols}{2}     \begin{minipage}[t]{0.2\textwidth}     \begin{itemize}     \item Basic Concepts of Complex Numbers     \item Complex Sloutions of Equations     \item Operations on Complex Numbers     \end{itemize}     {\bfseries \textcolor {brown}{LOOKING AHEAD TO CALCULUS}}\\     The letters \textit {j} and \textit {k} are also used to rep-     resent $\sqrt -1$ in calculus and some     applications (electronics, for example)\\     \\     The cslculator is in complex number     mode.  The top screen supports the     definition of i.  The bottom screen shows how the calculator returns the     real and imaginary parts of the     complex number $7 + 2i$     \end{minipage}     \begin{minipage}[t]{0.8\textwidth}     {\bfseries \textcolor{cyan}{Basic Concepts of Complex Numbers}} The set of real numbers does not include      all numbers needed in algebra.  For example, there is no real number solution of     the equation     \begin{center}     {$x^2=-1,$}     \end{center}     since no real number , when squared, gives -1.  To extend the real number system     to include solutions of equations of this type, the number $i$ is defined to     have the following property.     \\     \\     {\bfseries \textcolor{brown}{The Imaginary Unit $i$}}     \\     \begin{center}     $i=\sqrt-1$ and therefore $i^2=-1$.     \end{center}     (Note that $-i$ is also a square root of -1.)     \\     \\     Square roots of negative numbers were not incorporated into an integrated     number system until the 16th century.  They were then used as solutions of equa-     tions and later (in the 18th century) in surveying.  Today, such numbers are used     extensively in science and engineering.     {\textit Complex numbers} are formed by adding real numbers and multiples of $i$.     \\     \\     {\bfseries \textcolor {brown}{Complex Numbers}}     \\     If a and b are real numbers, then any number of the form $a + bi$ is a     {\bfseries complex number.}  in the complex number a+bi,a is the {\bfseries real part} and b is the {\bfseries imaginary part.}*     \\     Two complex numbers a+bi and c+di are equal provided that their real      parts are equal and that their imaginary parts are equal; that is, they are equal if and     only if a=c and b=d.\     Some graphing calculators, such as the TI-83/84 Plus, are capable of     working with complex numbers, as seen in {\bfseries Figure1.}\     For a complex number $a+bi,$ if $b=0,$ then $a+bi=a,$ which is a real     number.  Thus, the set of real numbers is a subset of the set of complex numbers.     If $a=0$ and $b 0$, the complex number is said to be a {\bfseries pure imaginary number.}     For example, $3i$ is a pure imaginary number.  A pure imaginary number, or a     number such as $7+2i$ with $a  0$ and $b  0$, is a {\bfseries nonreal complex number.}     (The from a+ib is used to write expressions such as $i\sqrt 5$, since $\sqrt 5i$ could     be mistaken for $\sqrt 5i$.)     The relationships among the subsets of the complex numbers are shown in     {\bfseries Figure 2} of the next page.     \end{minipage}     \end{multicols}     \newpage     For a positive real number \textit {a}, the expression $\sqrt -a$ is defined as follows.     ---Britney Wiggins     \end{document}`


title: Compare the height of arguments

text: I'm trying to define a `\newcommand` with three arguments. I'd like to:   * compare the height of these arguments   * choose the largest height to create frames (with that height) around the arguments. **Question** How can I compare these three arguments to choose the _tallest_? * * * ## First Update Following the advise by _David Calister_ , I defined a command which insert all the arguments in a box and return the height of the box, and also defined a new lenght (called `MyLen`). The following code,               \documentclass{minimal}     \usepackage{calc}     \newcommand\zz[3]{\sbox0{\ensuremath{#1#2#3}}\the\ht0}     \newlength{\MyLen}          \begin{document}     \zz{1}{2}{\frac{3}{4}}     \zz{1}{2}{3}     \end{document}      results into ![enter image description here](http://i.stack.imgur.com/BftIl.png) Well Done so far! Then, I'd like to set `MyLen` to be such result, using               \documentclass{minimal}     \usepackage{calc}     \newcommand\zz[3]{\sbox0{\ensuremath{#1#2#3}}\the\ht0}     \newlength{\MyLen}          \begin{document}     \zz{1}{2}{\frac{3}{4}}          \zz{1}{2}{3}          \settoheight\MyLen{\zz{1}{2}{\frac{3}{4}}}     \the\MyLen     \end{document}      but the result is wrong (the last value should be equal to the first one) ![enter image description here](http://i.stack.imgur.com/G1pzC.png) What is happening? Where is my mistake?


title: How to customise the numbering system of subequations with IEEEtranstools?

text: I'm using `IEEEtrantools`'s `IEEEeqarray`, and in there I can print sublabeled equations like               x^2   (1a)     y^2   (1b)      with:                \begin{IEEEeqnarray}{rCl}       x & = & y \IEEEyessubnumber \\       z & = & b \IEEEyessubnumber     \end{IEEEeqnarray}      However -- I need to have first subnumber to be `m`, second `b`:               x^2   (1m)     y^2   (1b)      So I read the source of `IEEEtrantools.sty` and here's the best I come up with:               \documentclass{article}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{DejaVu Sans}     \setsansfont{DejaVu Sans}     \setmonofont{DejaVu Sans Mono}          \usepackage{IEEEtrantools}          \begin{document}          \subsection{Test!}          \begin{IEEEeqnarray}{rCl}       x & = & y \renewcommand\theIEEEsubequation{\theequation{m}} \IEEEyessubnumber \\       z & = & b \renewcommand\theIEEEsubequation{\theequation{b}} \IEEEyessubnumber     \end{IEEEeqnarray}          \end{document}      I compiles, but doesn't work. Any way to achieve that? `IEEEeqarray` is a must for me. My question is: custom list to subnumber strings means that the default subnumber strings list is `a`, `b`, `c`,... while I need to have a custom list: `m`, `b`,... (for the problem at hand I need only two).


title: Drawing anomaly -- do macros nest properly?

text: The following code draws edges with arrows to two squares. It seems to me the effect should be identical, but no. The arrow at the "node[alive]" child just touches the child, while the arrow at the "\living" child invades it. It must be that I don't understand something quite fundamental about what macros mean or how they work. Can someone kindly explain?               \documentclass{minimal}     \usepackage{tikz}     \begin{document}         \begin{tikzpicture}[         ->,thick,         alive/.style={inner sep=0pt,minimum size=5mm,rectangle,draw} ]           \newcommand{\living}{node[alive]{}}          \node  {}              child{[thick]                 child{\living}                  child{node[alive]{}}             };         \end{tikzpicture}     \end{document}


title: Automatically start the necessary pdflatex runs if .tex has changed (MacOS X)?

text: I read about `Latex Daemon`, which seems to automatically start a new latex run, when the source document (.tex) has changed. Can somebody recommend me a **similar solution for`MacOS X`** (as Latex daemon seems to be for `Windows` only)? * * * _snip:_   I've removed the 2nd part of my question about speeding things up and created a new question: How to speed up pdflatex for a very large document on MacOS X? * * * I use `TexMakerX` as editor and `Skim`as viewer. `Skim` can autoupdate the PDF file, as soon as it has changed, so that should be no problem. My current LaTeX project has several source files, combined with `\include`, so the solution should be able to "observe" the changes of at least one of those files. **edit:** I'll accept `latexmk` as the answer for automatically running `pdflatex` several times to update bibliography and references   and I'll ask the question of speeding up processing in a new question. For those who want to set up `latexmk`on `MacOS X`, this page from Damien Pollet could be helpful. Problems I had with `latexmk`:   * with the `-pvc`-option it seems to slow down my MacBook, as switching to another application got quite slow, especially when its windows were located in another Space    * so I turned that off and just now use `latexmk` via short key `F1` to automatically compile "everything", while I use a single `pdflatex`-run with `F2` to add small changes in the text. While searching with google I also found the `atchange` program http://www.ccrnp.ncifcrf.gov/~toms/atchange.html which seems to do similar things, I did not test it yet.


title: Fit around nodes and edges

text: I know that I can use the fit library of tikz to get a fitted background behind some nodes. How can I get the fit to be around edges as well? My current code:               \begin{tikzpicture}[prefix=fig/,     state/.style={circle,draw,thick},     hmm/.style={draw,rectangle}]          \node[state] (a1) at (0,0) {} edge [loop above,thick] () ;     \node[state] (a2) at (1,0) {} edge [loop above,thick] () edge[<-,thick] (a1);     \node[state] (a3) at (2,0) {} edge [loop above,thick] () edge[<-,thick] (a2);          \node[hmm,fit=(a1) (a2) (a3)] (a) {};     \end{tikzpicture}      This puts the top of the background box straight through the loops. How can I fit the box nicely around the nodes and edges (so the top of the loop must be a point somehow in the fit).


title: What is accents commands behavior ?

text: I've read LaTeX sources to define the real behavior of accent commands and I've failed. It states with this: > >     \def\DeclareTextAccent#1#2#3{%   >     \DeclareTextCommand#1{#2}{\add@accent{#3}}} >   i.e. it constructs from `\accent` TeX-primitive. Then I've went to _TeX by Topic_ book and read about `\accent` primitive. But unfortunately I can't find any useful information that will explains the accent's behavior. **I need to know how does x-position and y-position of accent symbols are calculated.** I've found such info: > The width of a character with an accent is the same as that of the > unaccented character. TeX assumes that the accent as it appears in the font > file is properly positioned for a character that is as high as the x-height > of the font; for characters with other heights it correspondingly lowers or > raises the accent. > > ... > > The horizontal positioning of an accent is controlled by `\fontdimen1`, > slant per point. Kerns are used for the horizontal movement. But even knowing that I can't find answer to my question. Maybe you can?


title: Error with pdf image and texstudio

text: I'm writing a .tex file with texstudio. In the tex there are some pdf figures. When i compile it the pdf viewer of texstudio shows me this: ![valid XHTML](http://i92.photobucket.com/albums/l5/Gianluca_Mastrantonio/Schermata2014-04-24alle145945_zpse71c0c3a.png). while if i open the compiled pdf with another program, i get the real pdf image: ![valid XHTML](http://i92.photobucket.com/albums/l5/Gianluca_Mastrantonio/Schermata2014-04-24alle145250_zps970c62b4.png). How that can be possible? P.S. if instead of a pdf image i use another format (for example eps jpeg), there are no problems


title: Plotting 1/x not correct in pgfplots?

text: When I'm drawing f(x)=1/x or similar functions, pgfplots draws asymptotes. Do I have to draw the function in two pieces with different domains, or am I missing something? ![enter image description here](http://i.stack.imgur.com/i4yoF.png)               \documentclass[a4paper]{article}     \usepackage{tkz-euclide}     \usepackage{pgfplots}     \usetkzobj{all}          \begin{document}     \begin{center}     \begin{tikzpicture}     \begin{axis}%         [             grid=major,               x=5mm,             y=5mm,             xtick={-10,-9,...,10},                xmin=-10,             xmax=10,             xlabel={\tiny $x$},             axis x line=middle,             ytick={-10,-9,...,10},             tick label style={font=\tiny},             ymin=-10,             ymax=10,             ylabel={\scriptsize $f(x)$},             axis y line=middle,             no markers,             samples=100,             domain=-10:10,         ]         \addplot[thick] (x,{1/x});         \addplot[dashed] (x,{1/(x-2)});     \end{axis}      \end{tikzpicture}     \end{center}     \end{document}


title: Latex figure, default option [h]?

text: It seems that the figures in my document are positioned at the top of the page by default. Is it possible to change that default behaviour to [h]? (without adding [h] to all the figures) Thanks in advance!


title: How to set default positioning of figure/table document wide

text: I'm writing my thesis and I find myself adding `[hb]`s and `[ht]`s to all figures and tables. Is there a way to make this global for the whole document? Preferably with the option to override it for certain figure/table instances.


title: Take 2: How do automatic overlay specifications work in Beamer (in a nested situation)

text: I had previous asked a question about this, but I feel that it wasn't focused enough and the answers got a little confused...so instead of editing that question, I've opted to start a new one....I hope people do not object. * * * I'm having trouble understanding what Beamer does when one uses **nested** automatic overlay specification. Consider the following example:               \documentclass[10pt,a4paper]{beamer}          \begin{document}     \begin{frame}     \Huge     \only<1-+(3)>{\alert<-+>{foo} \alert<-+>{bar}}     \only<+>{a}\only<+>{b}\only<+>{c}\only<+>{d}\only<+>{e}     \only<1>{1}\only<2>{2}\only<3>{3}\only<4>{4}\only<5>{5}\only<6>{6}     \end{frame}     \end{document}      Which gives: ![alt text](http://i.stack.imgur.com/i3wom.png) I would say that the foo and bar appear as expected, but outside of the \only between slide 4 and 5 something strange happens. In particular where are b and c? I would expect that there would be a nice correspondance between the letters and the numbers...wouldn't you? Sure, there would be an offset, but I would not expect that this offset would change at slide 5. > Also, is there a variable/counter that holds the slide number? * * * To give some weight to my suggestion that \beamerpauses should only be calculated once I would say the there are two completely non-intuitive lines in the following frame:               \begin{frame}     \alt<1-2>{     \begin{itemize}[<+->]     \item a     \item b     \end{itemize}}{     \addtocounter{beamerpauses}{2} %why should I need this?     \begin{itemize}[<+->]     \item A     \item B     \item C     \item D     \end{itemize}     }     \action<6>{} %this lines is really annoying because of the 6     %\action<+>{} %this gives an extra slide at the end.     %\action<.>{} %this doesn't work.          \end{frame}      I would write the whole thing without those extra lines and expect it to Just Work (TM)....


title: In exponents, parenthesis too small, \big too big

text: When something big (a fraction, a sum, an integral...) appears within a pair of parenthesis, one can typically use `\left(...\right)` to get delimiters large enough to surround the contents. The delimiters are actually often too large: then `\bigl(...\bigr)`, `\Bigl(...\Bigr)`, `\biggl(...\biggr)`, and `\Biggl(...\Biggr)` are useful. Those delimiters, unfortunately, do not scale when appearing in `\scriptsize` (in exponents and the like). In that context, a simple `(...)` may be too small, `\left(...\right)` too large, and `\bigl(...\bigr)` too large as well (first three lines below). I tried using `\displaystyle` to get delimiters of an intermediate size, but I find even that too big (fourth line). What code should I use to get delimiters of a correct size? ![Parentheses of different sizes in an exponent](http://i.stack.imgur.com/jfVLL.png) The figure is generated by the following code (plus some cropping).               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \[ x^{\sum_{i=1}^{N} (\frac{a_i + 1}{2b_i} + c_i)} \]% too small     \[ x^{\sum_{i=1}^{N} \left(\frac{a_i + 1}{2b_i} + c_i\right)} \]% too big     \[ x^{\sum_{i=1}^{N} \bigl(\frac{a_i + 1}{2b_i} + c_i\bigr)} \]% too big     \newcommand{\normall}[1]{\mathopen{\displaystyle#1}}%     \newcommand{\normalr}[1]{\mathclose{\displaystyle#1}}%     \[ x^{\sum_{i=1}^{N} \normall(\frac{a_i + 1}{2b_i} + c_i\normalr)} \]% a bit big     \end{document}


title: Make region plots from data using pgfplots & control over colors

text: What is a standard way to make 2D region plots from data, using pgfplots? I've searched the forum, but I haven't found a thread on this subject. The data would be organized, for example, in a three columns CSV, representing a 3D surface. Probably one could start filling with colors the regions between contours in a "contour plot". But I would like an automatic way that works fine even when there are multiple separated regions that should have the same color. The perfect example of what I would like is the figure, shown below for completness, from this Mathematica.SX thread. Please ignore the logscale, title and labels, because obviously the present question is not about such details; except that a similar legend would be welcome. ![here](http://i.stack.imgur.com/c3hUs.png). Additionally, is it possible to have control over colors, using maybe a piecewise function, similarly to what it is asked in the above Mathematica thread? **Edit** A very simple example, would be the paraboloid-like surface found in here, as a CSV.


title: Pagination, left indent

text: I have created my personal style `.sty`, where I inserted all the declarations of my LaTeX document. In particular, I redefined `\chapter`, `\section`, `\subsection`, ..., so they appear as in the picture below ) ![enter image description here](http://i.stack.imgur.com/MHQvd.jpg) My problem is as follows. I'd like a left indentation inside the chapter's content. Ad you can see in the picture (word processor), the title has a 0 indentation (margin set with the `geometry` package). I wish to have an indentation in all the paragraphs, section title, subsection, ..., inside the chapter, but mantaining the correct margin in the footer (see picture below). ![enter image description here](http://i.stack.imgur.com/f6igg.jpg) I have obtained these one....the problem is the absence of indentation :( ![enter image description here](http://i.stack.imgur.com/jWG77.jpg)


title: How can I make the LyX - Table of contents (TOC) page be empty after the end of the TOC and not continue with the other pages?

text: I have created a TOC in my LyX by simply using the TOC from the Insert menu. I have found that after the TOC ends the rest of the page is not blank as expected, but rather what I wrote comes directly afterwards. How can I tell LyX to leave the rest of the page blank ?


title: moderntimeline incompatibility with positioning using Beamer

text: I am preparing a slide for my PhD defense with a list of research stays with some tasks and publications. If I create the timeline by itself, there is no problem. But when integrating it with my presentation since I need \usetikzlibrary{positioning} for some parts of my code, then the labels of the timeline get missplaced. Compare the two images below. Here is a code sample.               \documentclass{beamer}          %%%%%% --- Stuff needed for the modern timeline in Beamer     \usepackage{xcolor}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage{tikz}     \usetikzlibrary{decorations}     \usepackage{textcomp}      \usetikzlibrary{snakes}     \usepackage{ifthen}     \usepackage[firstyear=2009,lastyear=2014]{moderntimeline}          \makeatletter     % change these colors according to your needs     \colorlet{color0}{blue}     \colorlet{color1}{olive}          \newcommand*{\hintfont}{}     \newcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}     \newcommand*{\listitemsymbol}{a~}     \newcommand*{\cventry}[7][.25em]{%       \cvitem[#1]{#2}{%         {\bfseries\raggedright #3}%         \ifthenelse{\equal{#4}{}}{}{, \raggedright{\slshape#4}}%         \ifthenelse{\equal{#5}{}}{}{,  \raggedright#5}%         \ifthenelse{\equal{#6}{}}{}{, \raggedright#6}%         .\strut%         \ifx&#7&%           \else{\newline{}\begin{minipage}[t]{\linewidth}\small\raggedright#7\end{minipage}}\fi}}     \newcommand*{\cvitem}[3][.25em]{%       \begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%           \raggedleft\hintstyle{#2} & {#3}%       \end{tabular}%       \par\addvspace{#1}}     \tlmaxdates{2009}{2014}     \newlength{\quotewidth}     \newlength{\hintscolumnwidth}     \setlength{\hintscolumnwidth}{0.175\textwidth}     \newlength{\separatorcolumnwidth}     \setlength{\separatorcolumnwidth}{0.025\textwidth}     \newlength{\maincolumnwidth}     \newlength{\doubleitemmaincolumnwidth}     \newlength{\listitemsymbolwidth}     \settowidth{\listitemsymbolwidth}{\listitemsymbol}     \newlength{\listitemmaincolumnwidth}     \newlength{\listdoubleitemmaincolumnwidth}     \setlength{\maincolumnwidth}{\dimexpr0.9\linewidth-\separatorcolumnwidth-\hintscolumnwidth\relax}          \tikzset{         tl@startyear/.append style={             xshift=(0.5-\tl@startfraction)*\hintscolumnwidth,             anchor=base         }     }     \makeatother          %%%%%%%% ----- Packages necessary for the rest of the slides     \usetikzlibrary{positioning}          \begin{document}          \begin{frame}          \tldatelabelcventry{2009.580}{June 2009}{MSc Thesis}{}{}     {}{}{}          \tllabelcventry{2009.583}{2009.833}{July-Sept. 2009}{Research stay}{Some Lab at SomeUniversity}     {Somewhere}{}{     \vspace{-10pt}     \begin{itemize}\setlength\itemsep{-5pt}     \item[--] task 1     \item task 2     \item More awesome tasks we developed     \end{itemize}     }          \tllabelcventry{2011.500}{2011.995}{June-Dec. 2011}{Research stay}{Some Lab at SomeUniversity}{Seomewhere}{}{}          \tldatelabelcventry{2010.500}{June 2010}{Some Conf. 2010}{}{}     {}{Some A, some title some year}          \end{frame}          \end{document}      That is the expected (this is generated by commenting `\usetikzlibrary{positioning}` ): ![enter image description here](http://i.stack.imgur.com/zyzKO.png) And that is what is obtained with the provided code: ![enter image description here](http://i.stack.imgur.com/bT8NX.png)


title: Stopping the accidental absorption of digits into literals

text: I recall that I was once writing some TeX code, and I encountered something like this               \count\foo     \foo=2\otherMacro     [\the\foo]      If `\otherMacro` was defined as something like `\def\otherMacro{9 cats is too many}` then `\foo` in the above line would actually get set to 29 instead of 2, because the 9 from the cats macro would be absorbed. A more insidious case is something like this:               \newcount\foo     \def\setfoo{\foo=2}     \def\otherMacro{9 cats is too many}     \setfoo\otherMacro     [\the\foo]      This code also goes awry and absorbs the 9, setting \foo to 29. In this case it's harder to know where the appropriate place for the fix is. And it's hard to see the error when looking at `\setfoo\otherMacro` without also going back to the macro definitions, because in real-world cases the macro definitions will probably be very far away from the invocations. I remember that at the time I ran into this issue I sat down and developed a comprehensive understanding of all of the cases where this would happen, and I adopted a set of defensive coding standards to prevent it, which involved liberal use of % and spacing. However, I didn't take any notes, and I'm not confident that I can remember all of the details and nuances. For example, I can't recall whether or not this ever happened when dealing with \dimen or other types of registers, and I can't recall exactly what my rules were for the defensive use of % and spacing. I'm about to sit down to experiment with this TeX-gotcha once again, but I figured that it couldn't hurt to also post to SO for community advice. I know that SO doesn't usually like discussion threads, so I'll put it like this instead: If anybody has a comprehensive understanding of these issues, then a single-post brain dump on the matter would make for a solid SO-appropriate response. Note also that I'm using Plain TeX, and not LaTeX. [UPDATE]: After considering suggested solutions from David Carlisle, and considering the caveats which he described, I'm amending this curiosity to this post:               \def\otherMacro{9 cats is too many}     \newcount\foo     \def\bar#1{[\the\foo][#1]}          \def\setfooSpace{\foo=2 }     \def\setfooRelax{\foo=2\relax}          \afterassignment\bar\setfooSpace\otherMacro          \afterassignment\bar\setfooRelax\otherMacro      The second-to-last line results in the text               [2][9 cats is too many]      while the last line itself results in               [2][]9 cats is too many      Both the `\relax` and the `2<space>`solutions work to prevent the absorption of the 9 into the 2, but the solution with the space appears to be superior in that it makes a macro like \setfoo feel more atomic.


title: I want to draw these figures in the link

text: http://etc.usf.edu/clipart/galleries/588-fraction-pies-quarters      I can draw most of the figures in this link. But the thing i want to know is how to shade a region as in the figures 3,4,5,6.


title: Citation in externalized pgfplots

text: I have a few `\cite` commands in my `pgfplots` which are not being displayed properly when `externalization` in on. As soon as you turn off the `externalization`, the references will be displayed correctly.               \documentclass{article}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \tikzexternalize     \begin{document}     \begin{tikzpicture}     \begin{axis}[xmin=-1,xmax=1,xlabel = \cite{Lorem}, title=\cite{Lorem2}, ylabel=\cite{Lorem3}]     \addplot      coordinates{ (0,0)(2,2)};     \end{axis}     \end{tikzpicture}          \begin{thebibliography}{99\kern\bibindent}          \bibitem{Lorem}\textsc{Lorem ipsum dolor sit}     \texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae purus mi. Fusce quam urna, elementum at ullamcorper in, tempus sed quam.}          \bibitem{Lorem2}\textsc{Lorem ipsum dolor sit}     \texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae purus mi. Fusce quam urna, elementum at ullamcorper in, tempus sed quam.}          \bibitem{Lorem3}\textsc{Lorem ipsum dolor sit}     \texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae purus mi. Fusce quam urna, elementum at ullamcorper in, tempus sed quam.}     \end{thebibliography}     \end{document}      ![enter image description here](http://i.stack.imgur.com/4sxBq.png)


title: How can I use todonotes \missingfigure in subcaptions subfigure environment?

text: The following MWE:               \documentclass[]{scrreprt}     \usepackage{xltxtra}     \usepackage{subcaption}     \usepackage{todonotes}          \begin{document}          \begin{figure}     \centering         \begin{subfigure}         \centering         \missingfigure{Bild 1}         \end{subfigure}         \begin{subfigure}         \centering         \missingfigure{Bild 2}         \end{subfigure}      \end{figure}          \end{document}      results in errors such as `Emergency stop`, `You can't use \end in internal vertical mode.` or `Missing number, treated as zero`. Seems to me, as if `\missingfigure` is not usable in the subfigure environment of `subcaption`. Is there another way to use this?


title: chapter style with lateral bar

text: Is is possible to have a different text/layout for the chapter page, and a vertical bar? What I want to achieve is something like this: ![enter image description here](http://i.stack.imgur.com/5H2R5.png)


title: Animation of PSTricks code

text: Consider the following code (taken from http://pstricks.blogspot.dk/2014/06/des-roues-pour-des-routes-au-profil.html):               \documentclass{article}          \usepackage[       a4paper,       margin = 2cm     ]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{pstricks-add}     \usepackage{animate}               \pstheader{Road-Wheels.pro}     \definecolor{DOrange}{rgb}{1,0.4,0.2}     \SpecialCoor     \pagestyle{empty}     \def\SinusoidalWheelRoad#1{       \pstVerb{/ni #1 def                /di 1 ni dup mul add sqrt neg def                /d1 di neg 1 add def                /ai ni 1 di sub div def                /ai_ 1 ai div def                /xP 2 Pi mul 18 div \i\space mul def                /theta 0 xP {Cos di add 1 exch div neg} 10 Simpson RadtoDeg def                /theta1 {0 exch {Cos di add 1 exch div neg} 10 Simpson RadtoDeg neg} def                /xP1 0 def % di neg 1 add 2 sqrt mul 0.5 mul neg def                /yP1 di neg 1 sub def % xP1 neg def                /alpha {t theta1} def       }%     }     \psset{       arrowscale = 1.3,       arrowinset = 0.05,       arrowlength = 1.9,       labelFontSize = \scriptstyle     }     \def\Wheel#1{%       \pstVerb{/Hh 0 def /Hs 1 def /Hb 1 def /color {Hh Hs Hb} def /dH 1 #1\space div def}       \definecolor[ps]{macouleur}{hsb}{color}       \multido{\i = 0+2, \n = 0.1+0.05}{#1}{%         \pscustom[           linecolor = black,           fillstyle = solid,           fillcolor = macouleur,           opacity = 0.5         ]{           \psplot[             algebraic,             plotstyle = curve,             polarplot = true           ]{\i\space Pi mul #1\space div Pi 2 div sub}%            {\i\space 2 add Pi mul #1\space div Pi 2 div sub}%            {-cos(2*atg(ai*tan((x/2+Pi/4)*ni)))-di}           \lineto(0,0)           \closepath%         }         \pstVerb{/Hh Hh dH add def}%       }%     }               \begin{document}          \begin{center}     \psset{       dimen = middle,       unit = 0.3     }     \def\nImages{120}% images     \multido{\i = 0+1}{\nImages}{%     \begin{pspicture}(-8,-9)(48,9)       \psframe(-8,-8.9)(48,8.9)       \SinusoidalWheelRoad{6}       \psaxes[         labelFontSize = \scriptscriptstyle       ]{->}(0,0)(-6,-8)(47,8)[$x$,90][$y$,0]       \rput{!theta neg}(!xP 0){%         \Wheel6         \psdot[linecolor = red](0,0)         \psdot[linecolor = DOrange](!xP1 yP1)%       }       \pscustom[         fillstyle = solid,         fillcolor = yellow!50,         linecolor = blue,         opacity = 0.5       ]{%       \psplot[         algebraic,         plotstyle = curve,         plotpoints = 720       ]{-2 Pi mul}{2.5 Pi mul ni mul}{cos(x)+di}       \psline(*{2.5 Pi mul ni mul} {cos(x)+di})%              (!2.5 Pi mul ni mul di 2 sub)%              (!-2 Pi mul di 2 sub)%              (*{-2 Pi mul} {cos(x)+di})%       }       \parametricplot[         linecolor = DOrange,         linejoin = 1,         plotpoints = 720       ]{0}{xP}{%         xP1 alpha cos mul yP1 alpha sin mul sub t add         xP1 alpha sin mul yP1 alpha cos mul add       }     \end{pspicture}     \newpage%     }          \multido{\i = \nImages+-1}{\nImages}{%     \begin{pspicture}(-8,-9)(48,9)       \psframe(-8,-8.9)(48,8.9)       \SinusoidalWheelRoad{6}       \psaxes[         labelFontSize = \scriptscriptstyle       ]{->}(0,0)(-6,-8)(47,8)[$x$,90][$y$,0]       \rput{!theta neg}(!xP 0){%         \Wheel6         \psdot[linecolor = red](0,0)         \psdot[linecolor = DOrange](! xP1 yP1)%       }       \pscustom[         fillstyle = solid,         fillcolor = yellow!50,         linecolor = blue,         opacity = 0.5       ]{%       \psplot[         algebraic,         plotstyle = curve,         plotpoints = 720       ]{-2 Pi mul}{2.5 Pi mul ni mul}{cos(x)+di}       \psline(*{2.5 Pi mul ni mul} {cos(x)+di})%              (!2.5 Pi mul ni mul di 2 sub)%              (!-2 Pi mul di 2 sub)%              (*{-2 Pi mul} {cos(x)+di})%       }       \parametricplot[         linecolor = DOrange,         linejoin = 1,         plotpoints = 720       ]{0}{xP}{%         xP1 alpha cos mul yP1 alpha sin mul sub t add         xP1 alpha sin mul yP1 alpha cos mul add       }     \end{pspicture}     \newpage%     }     \end{center}          \end{document}      (The `Road-Wheels.pro` file can be found here.) How do I use the `animate` package to create an animation of all the pictures genereated by the code instead og having a lot of single pictures? (I would really like to see the correct implementation since I have tried myself for quite some time without success.)


title: Fractions with `\dfrac` cause compile error

text: I'm new to LyX. I'm writing my next homework with it to give it a try. My example code is below:               % Preview source code          %% LyX 2.0.5.1 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{babel}     \begin{document}     This is an expression with dfrac:          \[ f(x) = \dfrac{2}{x} \]     \end{document}      Under another question, they offered me to use `\dfrac` fractions for a better view. However, using `dfrac` causes compiler error like below: ![Compiler Error](http://i.stack.imgur.com/an8Pr.png) I thought this error with `dfrac` may be due to not using the `amsmath` package. I went to `Menu > Document > Settings > Math Options`, I unchecked `Use AMS math package automatically` and I checked `Use AMS math package`. LyX added `\usepackage{amsmath}` and `\usepackage{amssymb}` lines into the source code. Now when I try to preview my article in PDF format, it gives `LaTeX Error: File 'amsmath.sty' not found.` error. I used to use online Latex editors, then copy screen shot of their output and paste it into MS Word. It was so simple doing that way. Now all these packages, uneditable source code, and all these complexity for writing a simple fraction is making me too frustrated. I have started to question if I did the right thing with switching to LyX. Because those online editors perfectly displaying that `dfrac` fraction in my example. How do I write a simple `dfrac` fraction after opening a new article from `Menu > File > New` in a fresh LyX 2.0.5.1 installation?


title: White space creeping in when I place a tikz picture inside another tikz picture

text: I'm trying to design a seating chart for my classroom. I've done this using `pstricks`. I wanted to try it in `tikz`. What I'm doing is drawing a rectangle to represent each desk. Since the desks are arranged into groups of four, I then group these four rectangles together. The problem I'm having is when I try to group them together, I'm getting unexpected whitespace. Here's a MWE:               \documentclass{article}     \usepackage[margin=1in,showframe]{geometry}     \setlength{\parindent}{0pt}     \usepackage{tikz}     \usetikzlibrary{calc}          \newcommand{\mysmallbox}{%%"       \begin{tikzpicture}         \node (A) at (0,0) {};         \node (B) at (6,4) {};         \draw (A) rectangle (B);         \draw (A.center|-B.center) -- (A.center-|B.center);       \end{tikzpicture}}          \newcommand{\boxesInboxes}{%%'       \begin{tikzpicture}         \node (A) at (3,2) {\mysmallbox};         \node (B) at (9,6) {\mysmallbox};         \draw[color=red,line width=0.1pt] (0,0) rectangle (12,8);       \end{tikzpicture}}          \pagestyle{empty}     \begin{document}          \mysmallbox          \boxesInboxes          \end{document}      ![enter image description here](http://i.stack.imgur.com/AT71f.png) Where is the whitespace coming from? **UPDATE** I found this solution about bounding boxes. That seems far more complicated than I want. Is there a simpler way of _pruning_ the extra white space? I also found this solution about setting the bounding box, but I still get a little bit of white space in front of the picture.


title: How does one change the babel language with the ClassicThesis style?

text: It's all in the title. The issue is simple, I just wish to change the language so that I can type in french using babel. The original languages are `ngerman` and `american`. I just want to replace the `ngerman` language to `french` or `francais` or `frenchb` or whatever needed to type in french. So what I did was change this line 41 (in the ClassicThesis.tex file) :               \documentclass[ twoside,openright,titlepage,numbers=noenddot,headinclude,%1headlines,% letterpaper a4paper                     footinclude=true,cleardoublepage=empty,abstractoff, % <--- obsolete, remove (todo)                     BCOR=5mm,paper=a4,fontsize=11pt,%11pt,a4paper,%                     ngerman,american%                     ]{scrreprt}      into this               \documentclass[ twoside,openright,titlepage,numbers=noenddot,headinclude,%1headlines,% letterpaper a4paper                     footinclude=true,cleardoublepage=empty,abstractoff, % <--- obsolete, remove (todo)                     BCOR=5mm,paper=a4,fontsize=11pt,%11pt,a4paper,%                     francais,american%                     ]{scrreprt}      also changed line 63 to this               \selectlanguage{francais} % american ngerman      and finally I opened the ClassicThesis-config.tex file and uncommented line 78 to this :               \PassOptionsToPackage{francais,american}{babel}   % change this to your language(s)      And that's all I did. Then, when I try to compile (using TexShop on Mac), I get this message :               Package frenchb.ldf Warning: The definition of \@makecaption has been changed,     (frenchb.ldf)                frenchb will NOT customise it;     (frenchb.ldf)                reported on input line 60.          (/usr/local/texlive/2012/texmf-dist/tex/latex/hyperref/nameref.sty     (/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))     (./ClassicThesis.out) (./ClassicThesis.out)     (/usr/local/texlive/2012/texmf-dist/tex/context/base/supp-pdf.mkii     [Loading MPS to PDF converter (version 2006.09.02).]     ) (/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty     (/usr/local/texlive/2012/texmf-dist/tex/latex/oberdiek/grfext.sty)     (/usr/local/texlive/2012/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))     (/usr/local/texlive/2012/texmf-dist/tex/latex/microtype/mt-ppl.cfg)     ABD: EveryShipout initializing macros (./FrontBackmatter/DirtyTitlepage.tex)     (/usr/local/texlive/2012/texmf-dist/tex/latex/bera/t1fvm.fd) [1{/usr/local/texl     ive/2012/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]     (./FrontBackmatter/Titlepage.tex [2]     <gfx/TFZsuperellipse_bw.pdf, id=17, 260.5755pt x 203.14595pt>     <use gfx/TFZsuperellipse_bw.pdf> [3 <./gfx/TFZsuperellipse_bw.pdf>])     (./FrontBackmatter/Titleback.tex     (/usr/local/texlive/2012/texmf-dist/tex/latex/psnfss/ts1pplj.fd)) [4]     (./FrontBackmatter/Dedication.tex) [5] [6] (./FrontBackmatter/Abstract.tex)     [7] [8] (./FrontBackmatter/Publication.tex) [9] [10]     (./FrontBackmatter/Acknowledgments.tex     ./FrontBackmatter/Acknowledgments.tex:11: Missing \endcsname inserted.     <to be read again>                         \unskip      l.11 ...\defcitealias{knuth:1974}{Donald E. Knuth}                                                       \citetalias{knuth:1974} \c...          ?      Process aborted      Is this a normal reaction? What am I doing wrong?


title: Generating gradetables with parts using the exam class

text: I've just started using the `exam` class to typeset, well, an exam, and when using the `\gradetable` command to create the final grade table, it only shows me the points at the granularity of a question, but not the parts (or subparts, etc.) of that question, as the following example illustrates:               \documentclass[addpoints]{exam}          \begin{document}          \begin{questions}     \question     What if there were no air?     \begin{parts}     \part[4]     Describe the effect on the balloon industry.     \part[6]     Describe the effect on the aircraft industry.     \end{parts}     \question     \begin{parts}     \part[12]     Define the universe.     Give three examples.     \part[8]     If the universe were to end, how would you know?     \end{parts}     \end{questions}          \gradetable          \end{document}      ![enter image description here](http://i.stack.imgur.com/vYNuV.png) Is there anyway to make the gradetable split up the points into parts, or should I do it myself?


title: TikZ - I do not know the key ... despite correct code (can't define a new style anymore)

text: I just wanted to define a new style, a very very simple one with `align left, text width=6cm` but I found out even simpler code won't work. Basically I assume my installation is broken or I run the code in some secretly incorrect way. Googled for this for about 20 minutes already and I just can't figure it out. **EDIT** My eyes still work fine, by the way. Long day. ## MWE               \documentclass[     a4paper     ]{scrartcl}          \usepackage{     newtxtext,     amsmath,     }     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage{tikz}     \tikzset{     sometest/.style{         align=left,         text width=5cm     },     asdfasdf/.style{         rectangle     },     }          \listfiles          \begin{document}     Test.     \begin{center}     \begin{tikzpicture}     \node {Something text.};     \node[sometest] {AAA};     \end{tikzpicture}     \end{center}     \end{document}     \end{document}      produces ![enter image description here](http://i.stack.imgur.com/l7y4e.png) ## File List               *File List*     scrartcl.cls    2013/12/19 v3.12 KOMA-Script document class (article)     scrkbase.sty    2013/12/19 v3.12 KOMA-Script package (KOMA-Script-dependent bas     ics and keyval usage)      scrbase.sty    2013/12/19 v3.12 KOMA-Script package (KOMA-Script-independent b     asics and keyval usage)       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)     scrlfile.sty    2013/12/19 v3.12 KOMA-Script package (loading files)     tocbasic.sty    2013/12/19 v3.12 KOMA-Script package (handling toc-files)     scrsize11pt.clo    2013/12/19 v3.12 KOMA-Script font size class option (11pt)     typearea.sty    2013/12/19 v3.12 KOMA-Script package (type area)     newtxtext.sty    2014/04/07 v1.25     fontaxes.sty    2014/03/23 v1.0d Font selection axes      xkeyval.sty    2012/10/14 v2.6b package option processing (HA)      xkeyval.tex    2012/10/14 v2.6b key=value parser (HA)     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)      fontenc.sty        t1enc.def    2005/09/27 v1.99g Standard LaTeX file     textcomp.sty    2005/09/27 v1.99g Standard LaTeX package       ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file      amsmath.sty    2013/01/14 v2.14 AMS math features      amstext.sty    2000/06/29 v2.01       amsgen.sty    1999/11/30 v2.0       amsbsy.sty    1999/11/29 v1.2d       amsopn.sty    1999/12/14 v2.01 operator names      fontenc.sty        t1enc.def    2005/09/27 v1.99g Standard LaTeX file     inputenc.sty    2008/03/30 v1.1d Input encoding file         utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc        t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       ts1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc         tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)          pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)       pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)       pgfrcs.code.tex      pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)       pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)       pgfsys.code.tex     pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)     pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive      pgfcore.code.tex     pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)     pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)       pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)      pgfkeys.sty          pgfkeys.code.tex      pgfmath.sty          pgfmath.code.tex       pgffor.code.tex         tikz.code.tex       ts1cmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions      t1ntxrx.fd    2012/12/25 v1.0     supp-pdf.mkii     pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)     epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf       grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)     kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)     kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)     etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)     epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live


title: Hyperref cross-references across split documents

text: Say I have a document of type               \documentclass{article}     \usepackeage{hyperref}          %\includeonly{Chap1}     %\includeonly{Chap2}          \begin{document}          \include{Chap1}     \include{Chap2}          \end{document}      Where `Chap1` `\ref`'s labels of `Chap2` and vice versa. Using `\includeonly`, I want to compile `Chap1` to `Chap1.pdf` and `Chap2` to `Chap2.pdf`. Is there a way to inform hyperref about this, so a reference `Chap2.pdf` will automatically be hyperlinked so that it opens the referenced location in `Chap1.pdf` ?


title: More than one option within a frame

text: I'm using `beamer` to create frames. I don't want frame numbers and I want to allow for frame breaks:               \begin{frame}[allowframebreaks]{My title}      does work, and               \begin{frame}[noframenumbering]{My title}      How do I combine both?               \begin{frame}[noframenumbering allowframebreaks]{My title}      nor               \begin{frame}[noframenumbering][allowframebreaks]{My title}      work.               \begin{frame}[noframenumbering, allowframebreaks]{My title}      only enables the first option.


title: Hyphenation of CamelCaseClassNames: Mix automatic and manual?

text: My text contains some long, CamelCaseClassNames which LaTeX doesn't like to hyphenate automatically. I found the `\camelhyph` macro on projects:latexcamel and it works perfectly for automatic hyphenation before each upper case letter. However, I also want to allow hyphenation within some longer words in the classname. As soon as I use the `\camelhyph` macro on anything containing `\\\\-` it breaks down. Can anyone fix this?               \documentclass{article}          \usepackage{xspace}     \usepackage{ifthen}          \makeatletter       \newcommand{\camelhyph}[1]{\@fterfirst\c@amelhyph#1\relax }       \def\@fterfirst #1#2{#2#1}       \def\c@amelhyph #1{%        \ifthenelse{\equal{#1}\relax}{}{%  Do nothing if the end has been reached          \ifnum`#1<91 \-#1\else#1\fi%     Check whether #1 is an uppercase letter,                                     %     if so, print \-#1, otherwise #1         \expandafter\c@amelhyph%    %     insert \c@amelhyph again.     }}     \makeatother               \newcommand{\cclass}[1]{\texttt{\camelhyph{#1}}\xspace}     \begin{document}               Lorem ipsum dolor sit amet, consectetur adipiscing elit.      Curabitur vitae lectus augue. Duis vitae quam sem.      Integer rhoncus tempor est et convallis. Ddonec orciodio,      facilisis in portaeget,       \cclass{MySpecialCamelCaseLooooooongwooooordClassName}      ornare veltortor. Pellentesque sed risus sed dolor iaculis     malesuada vitae ac purus. Praesent convallis mattis faucibus.     Nulla gravida ante id sapien tincidunt nec suscipit magna placerat.           %not working because of the additional breakmark: \-     %Lorem ipsum dolor sit amet, consectetur adipiscing elit.      %Curabitur vitae lectus augue. Duis vitae quam sem.      %Integer rhoncus tempor est et convallis. Ddonec orciodio,      %facilisis in portaeget,       %\cclass{MySpecialCamelCaseLooooooongwooo\-oordClassName}      %ornare veltortor. Pellentesque sed risus sed dolor iaculis     %malesuada vitae ac purus. Praesent convallis mattis faucibus.     %Nulla gravida ante id sapien tincidunt nec suscipit magna placerat.           \end{document}


title: How to number subequations separately from the main equation?

text: I would like to produce in report class the following style for numbering subequations:   * The main equation has its own number, and can be referenced.   * Each subequations are labelled with lower case letters. These labels are vertically aligned.   * When referring to the subequations, their full path is shown (e.g., "Equation (1b)..."). Here is an example I found in a paper (The curly bracket is not necessary): ![enter image description here](http://i.stack.imgur.com/VIZDJ.png) (From: Hans-Georg Beyer, Bernhard Sendhoff, Robust optimization – A comprehensive survey, Computer Methods in Applied Mechanics and Engineering, Volume 196, Issues 33–34, 1 July 2007, Pages 3190-3218) This code produces the standard style:               \documentclass{report}          \usepackage{amsmath}     \usepackage[colorlinks=true,linkcolor=blue]{hyperref}          \begin{document}     \ldots can be stated as:     \begin{subequations}     \label{main_eq}     \begin{align}     \label{sub_eq1}\text{optimize:}\quad &f(x),\\     \label{sub_eq2}\text{subject to:}\quad &g(x)\leq0,\\     \label{sub_eq3}&h(x)=0,     \end{align}     \end{subequations}     where~\eqref{sub_eq2} represents an inequality constraint and~\eqref{sub_eq3} an equality constraint.          \ldots the optimum of $f(x)$ in~\eqref{main_eq}, like NP-hardness in\ldots          \end{document}


title: From LaTeX to reST

text: While using reST (restructuredtext) to produce some mathematical documents I could not find documentation regarding multidimensional matrices.   1. How do you create matrices in reST?   2. Is there is a quick, syntactical transformation between LaTeX and reST?


title: shrinking a page

text: In the reference list section of my paper, there is one reference alone occupying/creating one extra page, which is something i do not want. What could be a solution for changing this without affecting the margins? my references are created as usual by the commands,               \newpage     \section*{References}     \bibliographystyle{chicago}     \bibliography{references}      and come to the very end of my paper. Many thanks


title: Create fill-in-the-blank version of a document with ability to toggle blanks on and off

text: I am preparing some lecture notes/slides and would like to efficiently create two versions of the output: a complete version for myself, and a version for my students with certain text replaced with blanks or an empty box so that they can fill it in during lectures. the `\underline{\phantom{text}}` command does the trick, but it would be time consuming to create a separate version of the document and insert this in all the relevant places. How can one use macros to give us the ability to easily toggle between the teacher version (with full text) and student version (with blanks)? I was going to post this as a question but then figured it out so thought I'd share it.


title: How do I 'stack' marginnotes that are triggered on the same line?

text: I'm trying out a new definition style for my thesis. If a new term is introduced, I repeat it in the margin (and emphasize it inline). A simplified demonstration:               \newcommand*{\idef}[1]{%       \marginnote{\fbox{#1}}%       \emph{#1}%     }      Sometimes, two new terms will be introduced on the same line. Right now the second margin-note will just overlap the first. I'd like it placed next to the first. Or below the first, in the absence of horizontal space. How could I accomplish this? **Edit:** All solutions proposed so far (including my own) can only place excess notes _below_ others. Ideally, when there's space, I'd like a same- line-origin note to be placed _next to_ the previous (to its right). This is tricky, depending on when `\marginpar`s are typeset, exactly. I believe the only way would be to postpone typesetting the note until the end of the line has been reached, and 'prepare it' until then. But I'm a bit out of my element there.


title: Creating radial trees in TikZ

text: I am fairly new TikZ user and I am looking for a way to generate a radial tree similar this: ![enter image description here](http://i.stack.imgur.com/rBR6r.jpg) or this: ![enter image description here](http://i.stack.imgur.com/OMkU0.jpg) So far, I have two methods of doing this: 1) Program it manually - This involves quite a lot of setup and could be a very time consuming project even for my (relatively) small trees of only about dozen+ nodes. 2) Use the Mindmap library - This is the closest library I've found, but after a lot of reading up on the subject, it appears that it would require extensive modification to function as radial tree instead of a mindmap. The lines would have to be changed and the placement of nodes would have to be altered slightly. Is there a good TikZ library or method for generating radial trees that A) use lines to connect nodes, and B) provide control over the distance of a node from the root i.e. all nodes of a given depth at the same distance from root vs staggering distance of nodes with too many siblings? Criteria B is not mandatory, but is something that I am strongly hoping for: it would be nice to be able to modify placement of nodes based on number of siblings, but the essential thing is still the creation of the radial tree that doesn't look as silly as a mindmap and provides some control over the placement of nodes.


title: Optional argument to \item to appear in brackets after the counter

text: Usually, when you have the following document:               \documentclass{article}     \usepackage{enumitem}     \begin{document}     \begin{enumerate}     \item Mary     \item[had] a little      \item lamb     \end{enumerate}     \end{document}      It will format as                 1. Mary     had a little       2. lamb      I would want it to format as                 1. Mary       2 (had). a little       3. lamb      In other words, I would like the optional argument that can be passed to an `\item` not to replace the usual label, but I want it to appear additionally. In particular, the counter should still be stepped. This might seem like a subtlety, but note that the argument should appear before the period and after the counter. In fact, this is just a minimal example - I would like to have greater flexibility in placing the optional argument within the label. Is there a way to do this with the `enumitem` package?


title: How to refer to current node name in "execute at begin node"

text: Hi I'm wondering how can I reference to current node name in `execute at begin node` property.               \node[execute at begin node = \command_which_uses_node_name_to_to_do_soething_draw_uml_component_symbol] (){Node-name};


title: Centered Footnotes

text: I would like my footnotes to be centered but couldn't find any literature on this. Here is a MWE.               \documentclass[lettersize,14pt,twoside,openright]{memoir}     \usepackage[symbol,perpage]{footmisc}     \makeatletter %makes the footnote mark bigger     \renewcommand{\@makefnmark}{\hbox{\textsuperscript{\large{\@thefnmark}}}}     \makeatother     \renewcommand\footnoterule{\rule{\linewidth}{0pt}}     \DefineFNsymbols*{safestar}{{$*$}{\textdagger}{\textdaggerdbl}{\textsection}     {\textparagraph}{\textbardbl}{$**$}{\textdagger\textdagger}     {\textdaggerdbl\textdaggerdbl}{\textsection\textsection}     {\textparagraph\textparagraph}{\textbardbl\textbardbl}}     \setfnsymbol{safestar}     \begin{document}     This is a line of text.\footnote{This is a footnote that should be centered.}     \end{document}       I am compiling with LuaLaTeX but I don't think it should matter.


title: Glossaries package: small caps in body and normal caps in the acronym list

text: I want a list of acornyms to be printed in normal caps. However, I want small cpas acronyms in the body text. I use `glossaries` package as the follwoing example. Would you please help?               \documentclass[a4paper]{report}     \usepackage[style=long, toc, smallcaps]{glossaries}     \makeglossaries     \newacronym{acr}{acr}{Acronym}     \begin{document}     This is an \gls{acr}. An \gls{acr} should be in small caps.     The first column in the follwoing list of acronyms should be in normal caps.     \printglossary[title={List of Acronyms}]     \end{document}


title: TikZ node with UML comment shape

text: I'm wondering how could I draw node that looks like ** UML comment **. Any suggestions? ![enter image description here](http://i.stack.imgur.com/StBTW.png)


title: Biblatex: Have only one author in citation -- multiple articles with same first author, different year

text: \documentclass{article}          \begin{filecontents}{test.bib}     @article{author99,     title = {A fine title},     year = {1899},     author = {An Author and Another Bauthor and Yeta Cauthor},     journal = {Madness}     }     @article{author05,     title = {The best title},     year = {1905},     author = {An Author and More Dauthors and Whois Thisauthor and Heis Thatauthor},     journal = {Insanity}     }     \end{filecontents}          \usepackage[%       style=authoryear,       bibstyle=authoryear,       backend=biber,       maxbibnames=99,       maxnames=2,       firstinits=true,       uniquename=init]{biblatex}     \addbibresource{test.bib}          \begin{document}     \noindent     \parencite{author99} \\ \parencite{author05}.          \printbibliography     \end{document}      ![output of above code](http://i.stack.imgur.com/YjZPi.png) As you can see from the image, when the first author is identical, two of the authors are printed in the citation, even if the year of the articles are different. I don't want this, but only the one author, e.g.               (Author et al. 1899)     (Author et al. 1905)      I've tried setting `maxcitenames=1`, but that didn't make any difference. Is it it possible to achieve this? Edit: I'm running TeXlive 2010 on Windows 7, Biblatex version 1.4b with Biber 0.9.


title: \pageref, but for columns

text: I need to point to a label on a page, but as my text is layed out in two columns, I'd also like to include the column (1 or 2). Is there a way to find out which column a label is in?               \documentclass{icgg}     \begin{document}     \section{First chapter}     \label{explanation}     Some text explaining some things.     ...     ... see page \pageref{explanation} for ...          \end{document}          I'd like to use something like:               see page \pageref{explanation}, column \columnref{explanation} for ...      Possible? ps. the document class is provided by someone else and it defines the two- column format.


title: How to get the list of predefined colors in xcolor such that the list can be used in foreach looping?

text: I need to get the list of predefined colors in xcolor. Hard-coding as follows is not a good coding practice.               \documentclass[dvipsnames,cmyk]{minimal}     \parindent=0pt     \usepackage{pstricks}           \begin{document}         \psforeach{\nA}         {             Tan,              RedOrange,              Magenta,             Yellow,             Green,             Red,             Blue,             BrickRed,             DarkOrchid,             Rhodamine,             OliveGreen,             Mahogany,             Goldenrod%               }{{\color{\nA}\nA} \endgraf}     \end{document}      ![enter image description here](http://i.stack.imgur.com/TcAwP.png) * * * My real scenario is to create an animation as follows.               \documentclass[pstricks,dvipsnames,cmyk]{standalone}          \usepackage{etoolbox}          \def\temp{}          \begingroup     \renewcommand\DefineNamedColor[4]{\listgadd{\temp}{#2}}     \input{dvipsnam.def}     \endgroup     \def\do#1{#1,}     \edef\MyNames{\dolistloop{\temp}end}          \begin{document}     \psforeach{\x}{\MyNames}     {        \expandafter\ifstrequal\expandafter{\x}{end}{}        {             \pspicture(\LL,\BB)(\RR,\TT)             \pscircle*[linecolor=\x](0,0){\RR}             \rput(0,0){\tiny\x}             \endpspicture             \newpage        }     }     \end{document}      ![enter image description here](http://i.stack.imgur.com/8VY8j.gif)


title: How to improve the looks of a fraction?

text: We may notice that the numerator and denominator in the following fraction are not aligned. And, to me it does not look good. How to align the numerator and denominator?               \documentclass{article}          \usepackage{amsmath,mathrsfs,xcolor,mathtools}          \let\xoverline\overline % supply your definition          \begin{document}          \begin{equation}     \dfrac{1-k^{m+n+d}}{1-k}     \end{equation}     \end{document}      The above yields: ![enter image description here](http://i.stack.imgur.com/SnwxQ.png)


title: Need to do some changes to pgfplots axis

text: I am still in the habit of learning TikZ, barely started using `pgfplots` to create my images Although I am still not sure what the best way to do so is, I need to create the image below. My problems is mainly the axis (and the points, but I guess I should refrain from asking too many questions at once.) ![enter image description here](http://i.stack.imgur.com/PABzd.png) Here is the image I am trying to reconstruct. And below is my attempt. ![enter image description here](http://i.stack.imgur.com/WXH3M.png) And here is my code               \documentclass[10pt,a4paper]{article}     \usepackage[hmargin=3cm,vmargin=2cm]{geometry}     \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}     \begin{figure}[h!tbp]     \centering     \begin{tikzpicture}     \begin{axis}[         scale only axis,         grid=major,         axis lines=middle,         inner axis line style={=>},         xlabel={\large $x$},         ylabel={\large $y$},         ytick={-5,-4,...,5},         xtick={-4,-3,...,4},         ymin=-5,         ymax=6,         xmin=-5,         xmax=5,     ]     \addplot[color=red,thick] {x^2-4};     \end{axis}     \end{tikzpicture}     \end{figure}     \end{document}      My question is - How do I shift the ticks, so they are not directly below, but shifted to the right?. (Same as the image I am trying to reconstruct) - Are there any easy way to add a dashed background, quite faint? I know a dashed background is not advised, but I think It works if it is quite faint, and I need my plot to be as close as possible to the original image =)


title: How to get eulervm package working with classicthesis, arsclassica and MyriadPro in LyX

text: I'm using the LyX-version of the classicthesis style package. Because I need to use a sans serif typeface, I'm also using arsclassica for its sans serif headings (including it in the LyX preamble). The problem is, when I include MyriadPro in the LyX preamble, it automatically seems to override the eulervm math font. I cannot seem to select MyriadPro from the LaTeX installed fonts, and when I switch to 'use non-TeX fonts' in LyX, I get errors compiling the document ('use of \@chapter doesn't match its definition'). The best I was able to do now is select the default sans serif font in LyX, but it's nowhere near as nice as Myriad is. Is there any way to get this combination to work together?


title: Control output grid with in pgfplots while doing everything else automatically

text: A nice feature of `pgfplots` is that it automatically chooses reasonable values for maximum/minimum x and y values and for the x and y unit vectors which especially effects the grid size and the labels of the ticks on x and y axis. On the other hand I know that I can choose the `xmin,xmax,...` values and the unit vectors manually. I do this for example when I want that the distance of the ticks is exactly 1 cm on the resulting printed paper. See for example my question here: pgfplots axis scaling However is it possible to combine both things in a reasonable way such that the following hold: Require that `pgfplots` draws the grid lines such that the distance of the ticks is say 1 cm on the printed paper, but let it do everything else automatically similar like it would normally do such that the resulting plot fits nicely on the page... Please ask if it is not completely clear what I want (I feel that my english is too bad to make it really clear...) **Edit** Here are two examples, see the comments in the code:               \documentclass{article}          \usepackage{pgfplots}          \begin{document}               %In this example everything is pretty nice, except that the grid on the printed paper is     %not exactly 1cm x 1cm          \begin{tikzpicture}        \begin{axis}[grid,no markers,samples=100]           \addplot {exp(x)};        \end{axis}     \end{tikzpicture}               %In this example the grid size on the printed paper is 1cm x 1cm, which I want, but     %the picture is really too large     \begin{tikzpicture}        \begin{axis}[grid,no markers,samples=100,x=1cm,y=1cm]           \addplot {exp(x)};        \end{axis}     \end{tikzpicture}                    %Here I adjusted it manually. But I want that it does this automatically. I don't want to think about what will be the maximum value of the function etc.          \begin{tikzpicture}        \begin{axis}[grid=both,no markers,samples=100,x=1cm,y=1cm/50,yticks={0,50,...,200}]           \addplot {exp(x)};        \end{axis}     \end{tikzpicture}          \end{document}      I don't want to include the output in this case since it is just to large in the second example.


title: Smaller font sizes in boitecoloriee environment gives bad result

text: The boites package _defines environments that allow page breaks inside framed boxes whose edges may be variously fancy. The bundle includes a few examples (shaded box, box with a wavy line on its side, etc)_. `boitecoloriee` is one of those environments. It typesets its contents in a gray background color inside a framed box. With smaller fonts the lines typeset with this environment are cut in its bottom, as can be seen with the following example:               \documentclass{standalone}     \usepackage{boites,boites_exemples}     \usepackage{lipsum}          \begin{document}          \begin{boitecoloriee}       \lipsum[131]     \end{boitecoloriee}          \footnotesize          \begin{boitecoloriee}       \lipsum[131]     \end{boitecoloriee}          \end{document}      which gives: ![demonstration of the problem with the boitecoloriee environment](http://i.stack.imgur.com/zVUgE.png) Notice how the second box has defective lines. Does anybody have any idea on how to fix this?


title: Own environment with own label

text: I want to have an environment for strategies. So far I used the package ntheorem to define such an environment. I use it like this:               \begin{strategy}[bla]         bla bla     \end{strategy}      And get:                <surrounding text>           Strategy 1 (Bla):         bla bla          <surrounding text>      Which is what I want except that I would like to group the numbering of the strategies with by me specified prefixes, like LD.1,..LD.5 and I.1,..I.3 and so on:               <surrounding text>          Strategy A.1 (bla):        bla bla        more bla bla          <surrounding text>      So, the word _Strategy_ my prefix and a short description an a non-indented line, then the strategy text indented. Also I would like a little space above and below the strategy. Is it possible to use ntheorem in such a way:               \begin{strategy}[prefix][bla]         bla bla     \end{strategy}      Or has anybody another idea. I do not need to use ntheorem. It was just the first idea I had. I use ntheorem for other environements, so they should work together.


title: Move section out of part

text: I am using the document class `article`. Once I place a part in the document, all subsequent sections belong to the part automatically. How can I reset a section such that it does not belong to a part? The following sample demonstrates what I want to achieve:               \section{Introduction}          \part{Part 1}     \section{Section 1 belonging to part 1}     \section{Section 2 belonging to part 1}          \part{Part 2}     \section{Section 1 belonging to part 2}     \section{Section 2 belonging to part 2}          % should not belong to Part 2     \section{Conclusion}


title: How do I display text at 60pt or even 600pt?

text: I am new to LaTeX. I am having a hard time creating a font past 40 points. Here is my code:               \documentclass[letterpaper]{article}     \begin{document}         \fontsize{40}{48}\selectfont hi     \end{document}      If I change the 40 and corresponding 48 to anything bigger, it does not seem to increase the size of the word "hi". I can go lower but not higher. Technically I need this for some text in a cell for a table I am working on in LaTeX, but I'm sure if I figured out what I was doing wrong I could apply it to the table. The font size I am aiming for is somewhere around 60 to 100 points in size.


title: How do I set the aspect ratio of 2D (flattened 3D) surface plot?

text: I am trying to do a 2D surface plot, and the way to do this in pgfplots seems to be making a 3D surface plot, and then adjusting the view. And this works fine, until I try to adjust the aspect ratio. The 2D options don't work, because it is a 3D plot afterall, and the `plot box ratio` ceases to work once I adjust the `view`. I adopted an example from the pgfplots manual (section 4.5.2, all y values multiplied by two):               \documentclass{article}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}[view={0}{90},plot box ratio={1}{2}{1}]     % We have `surfdata.dat' with     % ---------     % 0 0 0.8     % 1 0 0.56     % 2 0 0.5     % 3 0 0.75     %     % 0 2 0.6     % 1 2 0.3     % 2 2 0.21     % 3 2 0.3     %     % 0 4 0.68     % 1 4 0.22     % 2 4 0.25     % 3 4 0.4     %     % 0 6 0.7     % 1 6 0.5     % 2 6 0.58     % 3 6 0.9     % -> yields a 4x4 matrix:            \addplot3[surf] file {surfdata.dat};     \end{axis}     \end{tikzpicture}     \end{document}      My output is on the left, my expected output on the right (obviously I don't want all the ticks distorted). ![enter image description here](http://i.stack.imgur.com/INiti.jpg)


title: Wrong area plot

text: I'm trying to draw a plot from this table:               ip   Min             Std     0    19.86764349     97.20356138     16   19.86764349    250.079659     22   19.86764349    168.2253117     23   19.86764349    169.2514577     33   19.86764349    142.664228     ...     996  0.371543541    1.52E-07     997  0.371543312    1.85E-07     998  0.371543276    1.73E-07     999  0.371543154    1.97E-07     1000 0.371542976    1.99E-07      The code is this:               \documentclass{article}     \usepackage{pgfplots}     \begin{document}       \begin{tikzpicture}         \begin{axis}[           scale only axis,           enlargelimits=false,           stack plots=y,           area style           ]           \addplot[] table [x=ip,y=Min] {dataTablaEstadisticas.dat}; closedcycle;           \addplot[draw=none,fill=green!50] table [x=ip,y=Std] {dataTablaEstadisticas.dat}; closedcycle;         \end{axis}       \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/0nve4.png) I can't find my mistake. Any advice, please?


title: Enumerate inside a theorem environment

text: I use the `enumitem` package:               \usepackage[shortlabels]{enumitem}      And I put some numeration like this in a theorem environment with `\theoremstyle{plain}`:               \begin{prop}         We have             \begin{enumerate}[(i)]                 \item $χ(c_M)=-\Id_{σM}$,                  and if $π_0(M)=0$,                  \item $χ(f_M)=-α_M^{-1}$.             \end{enumerate}     \end{prop}      the `[(i)]` after `\begin{enumerate}` is supposed to make items indexed by `(i)(ii)(iii)`. But in this theorem environment, as texts are italic, the `(i)(ii)(iii)` become funny things like _(i)(ii)(iii)_. How do I fix it?


title: Need information to get scientific notation for the coefficient

text: Good afternoon everyone, I wanted to know if anyone knows how to put scientific notation for the coefficient of a variable. If you look at my results you will agree with me that to get a table with a coefficient of 0,0000742 is not so good. Could you help me to find the command that will allow me to get 7,42.10^(-5)?               % 27 May 2014 16:10:14     \documentclass{article}     \usepackage{dcolumn}     \usepackage{booktabs}     \usepackage{graphics}     \usepackage{siunitx}     \sisetup{     detect-mode,     group-digits = false,     input-symbols = ( ) [ ] - +,     table-align-text-post = false,     input-signs = ,          }          \begin{document}          \begin{table}[htbp]\centering     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}     \caption{Innovation regressions using several diversity dimensions. \label{tabl}}     \resizebox{\textwidth}{!}{      \begin{tabular}{l*{7}{c}{S[table-format=1.2,table-column-width=10mm]}}     \toprule                      &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}\\                 &\multicolumn{1}{c}{Full sample div\_cont}&\multicolumn{1}{c}{Full sample div\_cont}&\multicolumn{1}{c}{Full sample div25\_cont}&\multicolumn{1}{c}{Full sample div25\_nat}&\multicolumn{1}{c}{Full sample div25\_nat\_obs}\\          \hline     gdp\_pop     &   0,0000742       &   0.0000327         &    0.000142\sym{*}  &    0.000142\sym{*}  &   0.0000913         \\                 &      (1.56)         &      (0.52)         &      (2.32)         &      (2.32)         &      (1.24)         \\     [1em]     ind\_agri    &      0.0127\sym{**} &      0.0100         &      0.0174\sym{*}  &      0.0174\sym{*}  &      0.0183\sym{**} \\                 &      (2.93)         &      (1.93)         &      (2.71)         &      (2.71)         &      (3.11)         \\     [1em]     ln\_pop      &     -0.0158         &    -0.00404         &    -0.00720         &    -0.00708         &    -0.00881         \\                 &     (-1.20)         &     (-0.26)         &     (-0.34)         &     (-0.33)         &     (-0.31)         \\     [1em]     size\_area   &   0.0000254\sym{*}  &  0.00000644         &   0.0000158         &   0.0000157         &   0.0000132         \\                 &      (2.17)         &      (0.46)         &      (0.91)         &      (0.90)         &      (0.57)         \\     [1em]     human\_st    &      0.0515         &      0.0141         &     0.00257         &     0.00241         &      0.0505         \\                 &      (1.71)         &      (0.33)         &      (0.06)         &      (0.06)         &      (1.04)         \\     [1em]     sh\_for\_pop  &       2.982         &       2.629         &      -3.222         &      -3.244         &      -3.605         \\                 &      (0.77)         &      (0.63)         &     (-0.62)         &     (-0.62)         &     (-0.81)         \\     [1em]     div\_cont    &       5.790\sym{*}  &       3.758         &                     &                     &                     \\                 &      (2.28)         &      (1.33)         &                     &                     &                     \\     [1em]     y2000       &      -0.279         &                     &      -0.469         &      -0.468         &                     \\                 &     (-1.11)         &                     &     (-1.20)         &     (-1.21)         &                     \\     [1em]     educ        &                     &      0.0489\sym{*}  &                     &                     &                     \\                 &                     &      (2.28)         &                     &                     &                     \\     [1em]          div25\_cont  &                     &                     &      0.0825         &                     &                     \\                 &                     &                     &      (0.12)         &                     &                     \\     [1em]     div25\_nat   &                     &                     &                     &       0.212         &                     \\                 &                     &                     &                     &      (0.07)         &                     \\     [1em]     div25\_nat\_obs&                     &                     &                     &                     &       2.391         \\                 &                     &                     &                     &                     &      (0.96)         \\     [1em]     \_cons      &      -3.135         &      -2.583         &       0.990         &       0.858         &      -1.513         \\                 &     (-1.44)         &     (-1.62)         &      (0.62)         &      (0.30)         &     (-0.44)         \\     \hline     \(N\)       &          44         &          22         &          44         &          44         &          22         \\     \(R^{2}\)   &       0.702         &       0.776         &       0.595         &       0.594         &       0.626         \\     \addlinespace     Fixed Effect            &         YES         &         NO      &          YES         &         YES       &         YES    \\     \midrule     \hline\hline     \multicolumn{6}{l}{\footnotesize \textit{t} statistics in parentheses}\\     \multicolumn{6}{l}{\footnotesize Standard errors are cluster by id.}\\     \multicolumn{6}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\     \end{tabular}}     \end{table}          \end{document}


title: Using a fp variable in a longtabu header

text: So, I am using the tabu package (which I _need_ to use over tabular others for several reasons) to make a long table spanning several pages. This table contains currency amounts in a column, and I'd like to have a subtotal of the column at the start of each page. After a number of trials using lengths to store values (which I found out is not suitable, as the range of lengths is too limited for the size of the values I need to use), I settled on using the fp package. Also, after some iterations, I found the simplest approach seems to be using tabu's capabilities to define a different header for the first page and the following ones, putting the variable I'm using as an accumulator inside the header. However, I'm seeing that the variable is expanded at the end of the total calculation, and not at the moment when the header is used on each page. In the following MWE, the grand total is correctly calculated as 4700, however the header in the second page shows 4700 as the subtotal although the header appears when it should still be 4300 :               \documentclass[11pt,a4paper]{article}     \usepackage{fp}     \usepackage{tabu}     \usepackage{longtable}          \FPset\total{0}          \newcommand{\summa}[1]{#1%     \FPadd\0\total{#1}\global\let\total\0%     }          \newcommand{\resettotal}{%     \FPset\0{0}\global\let\total\0%     }          \begin{document}          \begin{longtabu} to \textwidth {X[l]}     Amount \endfirsthead     Amount \\     subtotal \FPeval{\result}{round(total,2)}\result \endhead     \resettotal \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00} \\      \summa{100.00}      \end{longtabu}          The global total is \FPeval{\result}{round(total,2)}\result          \end{document}      From my limited understanding of how tabu works internally, this might be because headers are only positioned after the whole table is done (when tabu knows exactly how long the table will be). But is there a way I could tell the interpreter to expand the \total variable at the point where the header is used? Thanks, cheers.


title: "Segment not found" when using \printbibliography[segment=x] and \includeonly

text: # Addendum: @PLK has commented below on the feasibility of this: > I can't see how this could work - `\includeonly` would have to be changed to > be aware of biblatex-specific internals such as the segment/section creation > macros in order to track such things in unloaded files. I am not sure how complicated that is, so I'm offering a small bounty for anyone willing to look into this. * * * There's a conflict between `biblatex`'s `\printbibliography[segment=x]` option to print per-section bibliographies, and the use of `\includeonly`. As far as I can tell, this is caused by the segment numbers being re-arranged due to the sections not being included. So, if include two sections and the second one uses `\printbibliography[segment=2]`, that will no longer work when you `\includeonly{section2}` because the segment number of that section is now `segment=1`:               ! Package biblatex Error: Segment '2' not found in Section '0'.      This of course is fixable by changing `segment` every time, but that would make the use of `\includeonly` more than cumbersome. Any thoughts on how to fix this? # MWE:               \documentclass{article}          \usepackage{filecontents}     \begin{filecontents}{bibliography.bib}     @Article{gob,       title           = {I've Made a Huge Mistake},       author          = {Bluth, Gob},       journal         = {Journal of Magicians},       year            = {2003},       volume          = {1},       number          = {1},       pages           = {1--10},     }          @Article{michael,       title           = {Her?},       author          = {Bluth, Michael},       journal         = {Sudden Valley},       year            = {2003},       volume          = {1},       number          = {1},       pages           = {1--10},     }          @Article{tobias,       title           = {Never-nudism},       author          = {F{\"u}nke, Tobias},       journal         = {Blue Man Group},       year            = {2003},       volume          = {1},       number          = {1},       pages           = {1--10},     }     \end{filecontents}          \begin{filecontents}{section1.tex}     \section{First section}     Check this out~\cite{gob}.     \printbibliography[heading=subbibliography,segment=1,]     \end{filecontents}          \begin{filecontents}{section2.tex}     \section{Second section}     Check this out~\cite{michael}.     \printbibliography[heading=subbibliography,segment=2,]     \end{filecontents}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[british]{babel}     \usepackage{csquotes}     \usepackage[%       backend=biber,       refsegment=section,     ]{biblatex}     \addbibresource{bibliography.bib}          \includeonly{%       % section1,% % This always works because its segment number is constant at 1.       section2,%     }          \begin{document}     \include{section1}     \include{section2}     \nocite{tobias}     \printbibliography     \end{document}


title: Adding more \graphicspath causes images to not be found

text: The structure of the document I'm writing is the following.               Top level -> Plots -> some images                        -> 1 -> some images                        -> 2 -> some images                        -> 3 -> some images                        -> 4 -> some images      Using the command:               \graphicspath{{./Plots/}{./Plots/1/}      Seems to work fine and allow me to add images from these two folders, however, when I try to add folders 2, 3 and 4 to the \graphicspath, I get an error for all figures saying that it cannot find the images. Is there a way to fix this, or for the graphics package to look within all subfolders?               \documentclass[12pt, a4paper, notitlepage]{article}     \usepackage[margin=2.5cm]{geometry}     \usepackage{parskip}     \usepackage{setspace}     \renewcommand{\arraystretch}{1.15}     \onehalfspacing     \usepackage[pdftex]{graphicx}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}     \graphicspath{ {/Plots/}{/Plots/1/}{/Plots/2/}{/Plots/3/}{/Plots/4/} }          \title{Report}     \author{Me}     \date{April 2013}          \begin{document}          \maketitle     \thispagestyle{empty}          \newpage     \section{1}     Text.          \begin{figure}     \includegraphics[width=1\textwidth]{ImageFromPlots1}     \end{figure}              \end{document}


title: How can I center a tikzpicture horizontally by a certain point/coordinate?

text: this is a rather nit-picky question but I wanted to ask anyway. Is is possible to center the tikz figure horizontally with using the coordinate indicated by the red circle? The catch is, I have found an answer already. Martin Scharrer provided a "good" compact snippet here. But considering my level of expertise and that I just copy and pasted some code I would like to make sure: is this a good practice still? Maybe some things inside TikZ changed in the last ~2 years and it now can be done easier? **MWE**               \documentclass[     11pt     ]{scrartcl}     \usepackage{     tikz,     relsize,     tgheros     }          \usetikzlibrary{         calc,trees,shadows,positioning,arrows,chains,shapes.geometric,         decorations.pathreplacing,decorations.pathmorphing,shapes,         matrix,shapes.symbols,patterns,intersections,fit         }          \tikzset{         >=latex     }     \tikzset{xcenter around/.style 2 args={execute at end picture={%       \useasboundingbox let \p0 = (current bounding box.south west), \p1 = (current bounding box.north east),                             \p2 = (#1), \p3 = (#2)                         in             ({min(\x2 + \x3 - \x1,\x0)},\y0) rectangle ({max(\x3 + \x2 - \x0,\x1)},\y1);     }}}          \begin{document}     \begin{center}     \begin{tikzpicture}[font=\sffamily\small,xcenter around = {0,0}{9,6}]         %         \draw[style=help lines,step=0.5cm] (0,0) grid (9.1,6.1);         %         \draw[->,thick] (-0.1,0) -- (9.5,0) node[anchor=west]{Employees}; %X-Achse         \draw[->,thick] (0,-0.1) -- (0,6.5) node[anchor=south]{Sales}; %Y-Achse         %         \foreach \x in {0,1,...,9} \draw [thick](\x cm,-2pt) -- (\x cm,2pt);         \foreach \y in {0,1,...,6} \draw [thick](-2pt,\y) -- (2pt,\y);         %         \foreach \x in {0,1,...,9} \draw (\x cm, 0 cm) node[anchor=north]{\x} coordinate (x axis);         \foreach \y in {0,1,...,6}  \draw (0 cm, \y cm) node[anchor=east]{\y} coordinate (y axis);         %         \node (orig) at (0,0) {};         \draw         (2,1) coordinate (A)         (3,3) coordinate (B)         (6.5,4.5) coordinate (C)             (5,2) coordinate (D)             (9,5) coordinate (E)         ;         %         \foreach \pt/\labpos in {B/above left,C/below,D/below left}{           \filldraw (\pt) circle (2pt) node[\labpos=3pt,fill=white]{\pt};         };         \foreach \pt/\labpos in {A/below,E/below}{           \filldraw[gray] (\pt) circle (2pt) node[\labpos=3pt,fill=white]{\pt};         };         %         \draw[draw=red,fill=red] (4.5,3) circle (4pt);     \end{tikzpicture}     \end{center}     \end{document}


title: How to remove space in math mode inside a tabular environment

text: I'm using some semantics formula that contains both math symbols and text inside a p{} column in a tabular environment. The formula is too long to fit in the column, then LaTeX has to create new lines inside the formula. The problem is that it adds much space between some symbols of the formula, and I'd like to know if there is a way to prevent that (other than telling LaTeX manually where to add new lines). Here is a MWE:               \documentclass{article}          \begin{document}     \begin{tabular}[t]{rlp{5cm}}       {NP1} &$=$ &$\lambda{x_e}.~\textsc{gen}_{\textsc{e}}: \textrm{relevant}_c(\textsc{e})[\textrm{dance}(\textsc{e}) \wedge \textrm{beautiful}(\textsc{e}) \wedge \textrm{agent}(\textsc{e}) = x]$     \end{tabular}     \end{document}      In this example, the output looks like this: ![image](http://i.imgur.com/wCeT1vU.png) Thanks for the help!


title: Problem with mdframed, lstlisting and subfig

text: I'm trying to understand why the following code does not compile.               \documentclass[12pt]{article}     \usepackage[svgnames]{xcolor}     \usepackage{filecontents}     \usepackage{tikz}     \usepackage[framemethod=TikZ]{mdframed}     \usepackage{listings}     \lstnewenvironment{lstframed}     {         \mdframed[backgroundcolor=LightSlateGray!10] }     {         \endmdframed     }          \usepackage{subfig}     \begin{document}          \begin{figure}[H]         \centering         \subfloat[A]{             B         } \\         \subfloat[C]{             \begin{lstframed}                 D             \end{lstframed}         }         \caption{E}     \end{figure}     \end{document}      If I do not use `mdframed`, then everything is fine, but I'm using a fancy frame in my real document, so I really need it.


title: Feynman Diagrams with feynMF and feynMP

text: Im triying to learn how to draw Feynman diagrams by using feynMF which I installed from this link and compiled. however even in this simple example which I took from manual it gave me `! I detected a fmfgraph environment outside of fmffile. ! I detected a fmfgraph environment outside of fmffile.` these errors. how can I fix this problem? thanks               \documentclass[11pt]{article}         \usepackage{feynmf}     \begin{document}     \begin{fmfgraph}(40,25)     \fmfpen{thick}     \fmfleft{i1,i2}     \fmfright{o1,o2}     \fmf{fermion}{i1,v1,v3,o1}     \fmf{fermion}{o2,v4,v2,i2}     \fmf{photon}{v1,v2}     \fmf{photon}{v3,v4}     \fmfdotn{v}{4}     \end{fmfgraph}     \end{document}


title: Beamer: error while making handouts

text: I'm trying to make a handout version of my presentation: i.e., a version with only the last slide on every sequence of slides. After reading around I installed `pgfpages` and changed:               \documentclass{beamer}      to               \documentclass[handout]{beamer}     \usepackage{pgfpages}       However, I get the error:               ! Class beamer Error: Overprints may not overlap.      (I'll note that the original version of the presentation compiles, no problem.) Ideas? Am I don't something wrong, is there a different way to make handouts?