title: "Dimension too large" when using newcommand

text: When trying to use a newcommand with `tikz` I get multiple errors (all related to the same issue though) that show the message _"Dimension too large"_. I don't understand why is that, the code seems fine to me. I'll post it and explain a couple of points:               \documentclass[]{article}     \usepackage[a4paper, margin=1cm]{geometry}     \usepackage[utf8]{inputenc}     \usepackage{rotating}     \usepackage{amsmath}     \usepackage{pgfplots}     \usepackage{tikz}     \usepackage{xparse,expl3}          \usetikzlibrary{fit, arrows,backgrounds,patterns,shapes,shapes.multipart,positioning,calc,decorations.markings}     \pgfplotsset{compat=1.7}     \pagestyle{empty}          \tikzset{         opera/.style={rectangle, align=center, text width=4cm, fill=white},         datum/.style={font=\scriptsize, rotate=-90},     }          \newcommand*{\evento}[4][]{             \coordinate (A) at (0,{(#1-1600)/10});             \coordinate (B) at ({#2},{#3});%             \node[right=of B, datum] (C) {#1};             \node[right= of C] (D) {#4};     }               \begin{document}              \footnotesize              \begin{tikzpicture}[x=1cm,y=-7mm]                 \centering            %draw horizontal line               \draw[|->, -latex, draw] (0,0) -- (0,39);            \draw[-, dashed] (0,-0.5) -- (0,0);            \draw[|->, -latex, draw] (34,0) -- (34,39);            \draw[-, dashed] (34,-0.5) -- (34,39);                 %draw years         \foreach \y [evaluate=\y as \year using int(1600+\y*10)] in {0,1,...,38}{              \draw (0,\y) node[left=2pt,anchor=east,xshift=0,font=\scriptsize] {$\year$};              \draw (-0.1,\y) -- (0.1,\y);                             }              \foreach \y [evaluate=\y as \year using int(1600+\y*10)] in {0,1,...,37}{              \draw (0,\y) node[left=2pt,anchor=east,xshift=0,font=\scriptsize] {};              \draw (0,\y+.5) -- (0.1,\y+.5);                  }                  % 1                  \evento{1653}{5}{2}{The Protectorate began under the Lord Protector Oliver Cromwell};                  % 2                  % \draw (0, 5.3) edge[out=0,in=180,-*] (5,2) node[datum] {1653} node[opera]{The Protectorate began under the Lord Protector Oliver Cromwell};              \end{tikzpicture}     \end{document}      The actual code I was trying to make is marked with **1** , the number **2** is the "manual" version that is however too long, tedious to fix for each event and I like minimal code. Shouldn't the code in the New command work and provide the right coordinates for the two points to be used? If I wrote 1653, the code `(0, {(#1-1600)/10}))` should bring `(0,5.3)`, which is exactly what I want.


title: Table of contents using article and report classes

text: When I make a table of contents with the `article` and `report` classes the results are different. I have two questions.   1. Why does this happen?   2. How can I make the `report` ToC look like the `article` one? Here are a pair of examples:               \documentclass[]{report}     \usepackage{lipsum}     \begin{document}     \tableofcontents     \section{Section}     \lipsum     \end{document}      * * *               \documentclass[]{article}     \usepackage{lipsum}     \begin{document}     \tableofcontents     \section{Section}     \lipsum     \end{document}


title: Fontspec + Cabin + LuaLaTeX

text: I want to use the `Cabin` fonts (which are available on CTAN). It seems possible to use these fonts with `LuaLaTeX`, since there are `type1` fonts available, and on CTAN it says: > LuaLaTeX and xeLaTeX users who might prefer type1 fonts or who wish to avoid > fontspec may use the type1 option. However, I'm using `fontspec`, so now I'm confused. How can I get these fonts to work with `LuaLaTex` + `fontespec` ?


title: Is it possible to construct spectral lines with TeX?

text: I would like to demonstrate shifts in spectral line diagrams. I was wondering whether TeX was able to produce spectral line plots. I am aware of its functionality regarding energy level diagrams for which it is very useful. Thanks in advance.


title: Eating space before a command

text: If I have a `\newcommand*{\foo}{foo}` it will 'eat' space after it. Is there a way to tell it to eat space before, so that the result of e.g. `bar \foo bar` would be 'barfoobar'?


title: Active characters inside commands

text: I'm trying to ease my typesetting of phonetics with `tipa` by creating a custom command `myipa` which is supposed to substitute some common characters for the corresponding `tipa`codes. A much simplified example follows below, which replaces all `a`s with `@`s (which is the `tipa` code for a schwa):               \documentclass{article}     \usepackage{tipa}          \newcommand*\mytransform[1]{       \begingroup%           \catcode`\a=\active%           \def a{@}%           #1%       \endgroup%     }          \newcommand*\myipa[1]{\textipa{\mytransform{#1}}}          \begin{document}          \myipa{blabla}          \end{document}      However, all I get is `Missing control sequence inserted \myipa{blabla}`. This is my first time experimenting with active characters, so there is a high probability that I have completely misunderstood some important central idea, so feel free to fill me in.


title: Defining a counter

text: I'm trying to define a new counter which does the following:               \documentclass[10pt]{article}      \usepackage{amsmath}      \usepackage{amssymb}      \usepackage{array}     \usepackage{tikz}     \usepackage{longtable}     \newcommand*\circled[1]{\tikz[baseline=(char.base)]{             \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}          \begin{document}      \begin{longtable}{lll}      \circled{x} \quad  $3x^4-x^4-x^3(x+2)$ &      \circled{x} \quad  $-12a^2+3a(a+1)$ &     \circled{x} \quad  $ax^n+4x^n$      \end{longtable}      \end{document}      In the circles there should be 1., 2. and so on. Is it possible to define a counter which counts automaticly?


title: Dashed left arrow over symbol

text: I want to put dashed left arrow over symbol. Dashed left arrow looks like this:               $x \dashedleftarrow y$      I want arrow to be over symbol $x$, like in               $\overleftarrow{x}$      , only dashed. I tried to search, but come up only with this: “Broken” arrow symbol I did not find it in “The Comprehensive LaTeX Symbol List”, and DeTexify does not work here for obvious reasons (it can only give me dashed left arrow, but not dashed left arrow over symbol). EDIT: Read from http://ctan.vgtu.lt/info/symbols/comprehensive/symbols-a4.pdf, that there is package esvect for defining vectors, but it does not help, as it only allows to choose some styles of vector. EDIT2: Package "extpfeil" could be helpful: http://ctan.vgtu.lt/macros/latex/contrib/extpfeil/README should be a list of three symbols (single tokens or {} groups), giving (in this order): - left end of the arrow - middle part of the arrow (will be multiplicated, mostly \relbar or \Relbar) - right end of the arrow. But what should be the middle part, then? I have not used macros before much and this is bit confusing for me.. EDIT3: I ended up using mapf's answer, because I had rendering problems with Gonzalo's answer. Now I discovered that I need to have a dashed right arrow as well. I messed around with parameters in mapf's answer to find out how it works. I tried to just reverse the parameters in the definition of left dashed arrow, but I got wierd results :) Mapf, maybe You can explain what do the parameters mean? Here is the minimal example and the problems I am having right now:               \documentclass[12pt,a4paper,draft]{article}     \pagestyle{plain}     \usepackage[estonian]{babel}     \usepackage[a4paper]{geometry}     \usepackage{hyphenat}     \usepackage{enumerate}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amsfonts}     \usepackage{indentfirst}     \usepackage{amsthm}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{verbatim}     \usepackage{color}     \usepackage{tikz}           % =============================================     %Import symbol "\dashedleftarrow" from font MnSymbol without importing the whole package     % =============================================          \DeclareFontFamily{U} {MnSymbolA}{}          \DeclareFontShape{U}{MnSymbolA}{m}{n}{       <-6> MnSymbolA5       <6-7> MnSymbolA6       <7-8> MnSymbolA7       <8-9> MnSymbolA8       <9-10> MnSymbolA9       <10-12> MnSymbolA10       <12-> MnSymbolA12}{}     \DeclareFontShape{U}{MnSymbolA}{b}{n}{       <-6> MnSymbolA-Bold5       <6-7> MnSymbolA-Bold6       <7-8> MnSymbolA-Bold7       <8-9> MnSymbolA-Bold8       <9-10> MnSymbolA-Bold9       <10-12> MnSymbolA-Bold10       <12-> MnSymbolA-Bold12}{}          \DeclareSymbolFont{MnSyA} {U} {MnSymbolA}{m}{n}          \DeclareMathSymbol{\dashedleftarrow}{\mathrel}{MnSyA}{98}     \DeclareMathSymbol{\dashedrightarrow}{\mathrel}{MnSyA}{96}          \def\Gg{{\mathbf{G}}}     \def\gc{{\mathbf{g}}}          \newcommand{\toright}[1]{\overrightarrow{#1}}     \newcommand{\toleft}[1]{\overleftarrow{#1}}          \newcommand{\torightleft}[1]{\toleft{\toright{#1}}}     \newcommand{\toprerightleft}[1]{\toleft{\topreright{#1}}}         \newcommand{\torightpreleft}[1]{\topreleft{\toright{#1}}}         \newcommand{\toprerightpreleft}[1]{\topreleft{\topreright{#1}}}          \newcommand{\toleftright}[1]{\toright{\toleft{#1}}}     \newcommand{\topreleftright}[1]{\toright{\topreleft{#1}}}     \newcommand{\toleftpreright}[1]{\topreright{\toleft{#1}}}     \newcommand{\topreleftpreright}[1]{\topreright{\topreleft{#1}}}          % =============================================     % How to make dashed left arrow over symbol:     % http://tex.stackexchange.com/questions/114501/dashed-left-arrow-over-symbol     % =============================================     \makeatletter     \newcommand{\topreleft}[1]{%       \vbox {\m@th\ialign{##\crcr       \odlafill \crcr       \noalign{\kern-\p@\nointerlineskip}       $\hfil\displaystyle{#1}\hfil$\crcr}}}          \newcommand{\topreright}[1]{%       \vbox {\m@th\ialign{##\crcr       \odrafill \crcr       \noalign{\kern-\p@\nointerlineskip}       $\hfil\displaystyle{#1}\hfil$\crcr}}}          %% fill with (short) minus signs     \def\odlafill{%     $\m@th\dashedleftarrowtip\mkern-5mu\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill\mkern-0.5mu$}     %  $\m@th\mkern0mu\dashedleftarrowtip\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill$}          %% fill with find (short) minus signs     \def\odrafill{%     $\m@th\mkern-5mu\cleaders\hbox{$\mkern-3mu\shortbar\mkern4mu$}\hfill\mkern-0.5mu\dashedrightarrowtip$}     %$\m@th\mkern-0.5mu\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill\mkern-5mu\dashedrightarrowtip$}     %$\m@th\dashedrightarrowtip\mkern-5mu\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill\mkern-0.5mu$}     %$\m@th\mkern0mu\dashedrightarrowtip\cleaders\hbox{$\mkern4mu\shortbar\mkern-3mu$}\hfill$}          %% put 2pt space above and below the tip     \def\dashedleftarrowtip{%       \raisebox{\z@}[5pt][1pt]{$\mathord{\dashedleftarrow}$}}          %% put 2pt space above and below the tip     \def\dashedrightarrowtip{%       \raisebox{\z@}[5pt][1pt]{$\mathord{\dashedrightarrow}$}}          %% make the minus shorter to fit \dashedleftarrow     \def\shortbar{%     %  \smash{\scalebox{1}[1.0]{$-$}}}     \smash{\scalebox{0.4}[1.0]{$-$}}}     \makeatother          % =============================================               \begin{document}     Arrow over G should fit nicely into the brackets:          $\left[\toleft{\Gg}\right] = \left[ \topreleft{\Gg} \right].$          Dashed right arrow and left arrow should be of the same length:          $\toprerightleft{\gc}$          Left and right arrow are misaligned:          $\toprerightpreleft{\gc}$          Just for comparison:          $\torightleft{[\gc]}$          Both dashed arrows should be of the same length and align:          $\topreright{\topreleft{\Gg}}$          \end{document}      ![Current situation](http://i.stack.imgur.com/ce8l2.jpg)


title: Multiple alignments within align environment

text: My minimum working example:               \documentclass{report}          \usepackage{amsmath}          \begin{document}          \begin{align}     \dot{x}_2 =  \dot{x}_{2,0}&+\frac{\partial f_2(x_1)}{\partial x_1} \bigg|_{x_1=x_{1,0}}       (x_1-x_{1,0})+\\     &+ \frac{1}{2}\frac{\partial {f_2}^2(x_1)}{\partial {x_1}^2} \bigg|_{x_1=x_{1,0}}       (x_1-x_{1,0})^2+ \\     &+ \frac{1}{6}\frac{\partial {f_2}^3(x_1)}{\partial {x_1}^3} \bigg|_{x_1=x_{1,0}}       (x_1-x_{1,0})^3+ \\     &+   g_2  (u-u_0)      \end{align}          \end{document}      The result: ![enter image description here](http://i.stack.imgur.com/zZHZv.png) Now I would like to obtain the following result instead: ![enter image description here](http://i.stack.imgur.com/ix0VV.png) Any ideas?


title: Custom theorem numbering ... and extend to lemma etc

text: In Custom theorem numbering @egreg provided a way to custome theorem numbering:               \documentclass{article}     %\usepackage{amsthm} %% uncomment to see the difference     \newtheorem{innercustomthm}{Theorem}     \newenvironment{customthm}[1]       {\renewcommand\theinnercustomthm{#1}\innercustomthm}       {\endinnercustomthm}          \begin{document}          \begin{customthm}{8}[Somebody]\label{eight}     Every theorem must be numbered by hand.     \end{customthm}          Here is a reference to theorem~\ref{eight}.     \end{document}      Now I tend to extend such approach to Lemma, Definition, Corollary etc. However I got an error extending to Lemma. I put in               \newtheorem{innercustomlemma}{Lemma}     \newenvironment{customlemma}[1]        {\renewcommand\theinnercustomlemma{#1}\innercustomlemma}        {\endinnercustomlemma}      at the beginning then               \begin{customlemma}{abc}[abcd]\label{abcde}        abcdef      \end{customthm}      at the body. The error says:               ! Undefined control sequence. \customlemma ...heinnercustomlemma {#1}\innercust                                                                                omlemma      l.126 \begin{customlemma}{abc}                                       [abcd]\label{abcde} ?       I wonder what shall I do? Also, the font inside theorem is italic by default, I wonder if this could be tuned off?


title: How to transpose a table in expl3

text: I've been very impressed with `xparse` and `expl3`, and have written a wonderful document command using `\ProcessList` that takes a comma separated list and turns it into a (basically) 1 column table.               \stacky{A,B,C,D}     -> \begin{tabular}{rr}        \tiny 1st & A \\        \tiny 2nd & B \\        \tiny 3rd & C \\        \tiny 4th & D        \end{tabular}      Now I've become mad with the power and want to specify more than one column at a time. Something like:               \stacksy{ 5: A,B,C,D ; 6: A,C,D,B ; 3: C,A,B,D }     -> \begin{tabular}{rrrr}                  & 5 & 6 & 3 \\ \hline        \tiny 1st & A & A & C \\        \tiny 2nd & B & C & A \\        \tiny 3rd & C & D & B \\        \tiny 4th & D & B & D \\        \end{tabular}      Everything is fine, except that the input is in column-major order, but TeX (or the tabular environment) expects row-major order. **How do I transpose the input list of lists?**


title: Align along dot in tables

text: Does anyone know how to align the figure along dot within the tabular environment? I would like the figures to be under each other sharing the decimal dot as a common point of alignment.                 \begin{table}[H]         \caption{My table}         \centering          \begin{tabular}{lccc}         \toprule                 &  A            & B         & C         \\ \midrule         D       & 0.00      & +171.00   &  +135.00   \\          E               & +233.00   & +123.00   &  0.00   \\             F       & $-240.00$     & $-20.00$      & $-1590.00$ \\         G               & $-56.00$      & +68.00        & $-95.00$   \\ \bottomrule         \end{tabular}         \end{table}       Thank you very much for your help!


title: What's wrong with that code?

text: \def\totalobjects@putlabel{%      \addtocounter{totalpage}{\c@page}      \immediate\write\@auxout{\string        \newlabel{reftotaltables}{{}{\refstepcounter{totalpage}}{\relax }{}{}}}     }     \AtEndDocument{\totalobjects@putlabel}      Or how I can make next work:               \def\totalobjects@putlabel{%      \addtocounter{totalpage}{\c@page}      \refstepcounter{totalpage}\label{reftotalpages}     }     \AtEndDocument{\totalobjects@putlabel}      I am using XeLaTeX. After using the second snippet, label doesn't work (I see «??», when refer to it). After using the first snippet, I receive compile errors.


title: Adding a reverse arrow on a chain

text: For the MWE below:               \documentclass[a4paper,11pt,twoside]{report}     \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage[T1]{fontenc}          \usepackage{pgfplots,tikz}               \usetikzlibrary{calc,trees,positioning,fit,arrows,chains,shapes.geometric,%         decorations.pathreplacing,decorations.pathmorphing,shapes,%         matrix,shapes.symbols,automata}               \tikzset{     >=stealth',       punktchain/.style={         rectangle,          rounded corners,          % fill=black!10,         draw=black, very thick,         text width=10em,          minimum height=3em,          text centered,          on chain},       line/.style={draw, thick, <-},       element/.style={         tape,         top color=white,         bottom color=blue!50!black!60!,         minimum width=8em,         draw=blue!40!black!90, very thick,         text width=10em,          minimum height=3.5em,          text centered,          on chain},       every join/.style={->, thick,shorten >=1pt},       tuborg/.style={decorate},       tubnode/.style={midway, right=2pt},       every rectangle node/.style={thick}     }               \begin{document}          \begin{center}     \begin{tikzpicture}       [node distance=.5cm,       start chain=going below,]          \node[punktchain, join] (timing) {Timing Solver};          \node[punktchain, join] (solver)      {Solver};          \node[punktchain, join] (impl)      {SolverImpl};          \node[punktchain, join] (stp) {STPSolver};          \node[punktchain, join, ] (stpimpl) {STPSolverImpl};              \draw[tuborg, decoration={brace}] let \p1=(solver.north), \p2=(impl.south) in          ($(2.5, \y1)$) -- ($(2.5, \y2)$) node[tubnode] {*};              %\draw[red,thick,dashed] ($(solver.north west)+(-0.2,0.2)$)  rectangle ($(impl.south east)+(0.2,-0.2)$);              \draw[red,thick,dashed] ($(timing.north west)+(-1,0.3)$)  rectangle ($(stpimpl.south east)+(1,-0.2)$);          \node[anchor=south] at (current bounding box.north) {The Solver Instance};                \end{tikzpicture}     \end{center}               \end{document}      How can I add an arrow from STPSolverImpl to STPSolver ? I know it's a chain but is there any way to do it ? EDIT: I actually want two arrows. One up one down. So don't want to just replace that arrow


title: Is there a printable version of a reference manual for all TeX primitives?

text: Everywhere in the TeX community, I see suggestions like `\parskip`, `\obeylines`, `\parindent`, etc. I'd be surprised not to find them even in the most basic LaTeX packages. So I figured they must be deeper down in the TeX core as primitives. Knowing how they work would be very useful. Googling for `tex primitives` takes me to TeX Primitive Control Sequences. Is there a printable PDF version of such a reference?


title: How do I keep cross-references across several documents accurate?

text: This is a follow-up to my question about quality system documentation management. That question evolved to a different question and Charles suggested to ask a new one, so I'll just quote it here. > I am looking into something more like a document management system > integrated with LaTeX. > > _What aspect of document management am I looking at, for example?_   >  Quality systems have a lot of documents that cross-reference each other. > For example, **Q01 - Quality Manual** and a five dozen other documents > mention **T01 - Test Procedure A** somewhere in the body text and also in > its **References** section. If, sometime in the future, **T01 - Test > Procedure A** changes its title to **T01 - Steps In Performing Procedure A** > , obviously it will be tedious work to look through the other documents that > reference **T01**. Of course, this might require re-compiling the other > documents, but that's surely better than wading through them one by one.


title: href{} in longtable{} simply printed verbatim

text: When using href{} inside a longtable, its simply printed out in a verbatim way. How can I make it behave like expected (produce a working link in the pdf file that shows the href label? Here is a MWE:               \documentclass[graybox,envcountchap,sectrefs]{svmono}          \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{courier}     %     \usepackage{type1cm}                   \usepackage{makeidx}         % allows index generation     \usepackage{graphicx}        % standard LaTeX graphics tool                                  % when including figure files     \usepackage{multicol}        % used for the two-column index     \usepackage[bottom]{footmisc}% places footnotes at page bottom     \usepackage{parskip}     \usepackage[breaklinks]{hyperref}          \usepackage{ctable}     \usepackage{fixltx2e}     \usepackage{here}     \usepackage{caption}          \usepackage{fancybox}     \usepackage{longtable}          % define detailled toc     \usepackage[explicit]{titlesec}     \usepackage{titletoc}          % longtable     \usepackage{longtable,lscape}     \usepackage{rotating}     % \usepackage{multirow,multicol}               \begin{document}               \chapter{Links}     \label{cha:tasks} % Always give a unique label     % use \chaptermark{}     % to alter or adjust the chapter heading in the running head          \section*{Tabular Depiction }     \label{sec:tabular-depiction}          \begin{landscape}          \begin{longtable}{ll}     \caption{Caption} \\     \hline     Task & URI \\     \hline\hline\endfirsthead     \caption{Caption (cont.)}  \\     Task & URI \\     \hline\endhead     \hline      & www.uri.org \\     \hline\endfoot     \hline     Web Site  & www.uri.org \\     \hline\endlastfoot          doors & href{http://code.org/wiki/doors}{http://code.org/wiki/doors} \\     game & href{http://code.org/wiki/game}{http://code.org/game} \\     Solve & href{http://code.org/wiki/Solve}{http://code.org/wiki/Solve} \\               \end{longtable}     \end{landscape}          \end{document}


title: User-specific numbering of statements

text: How to get the user specific numbering like it is shown below?               *NSET,NSET=FixedBoundary                                                               (i4)     1,4,8                                                                                (i4.1)     Statement (i4) assigns nodes to a node set. FixedBoundary is the name of the node set      to which nodes 1,4,8 in statement (i4.1) will be assigned. In the present analysis,      nodes 1,4,8 correspond to the nodes at the fixed boundary of bimorph beam.     *NSET,NSET=POTENTIAL                                                                   (i5)     9     Statement (i5) assigns node 9 to the node set POTENTIAL.


title: pgfplots: How can I remove the markers when using addplot3?

text: I would like to remove the circles that are the markers in an `addplot3` parametrized helix. How can this be done? I have tried `markers = none` and `markers = false`.               \documentclass[tikz]{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat = 1.8}          \begin{document}     \begin{tikzpicture}       \begin{axis}[         samples = 100,         domain = 0:5 * pi,         samples y = 0,         view = {60}{30},         ]         \addplot3 ({cos(deg(x))}, {sin(deg(x))}, {5 * x});       \end{axis}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/tOC8M.png)


title: Use lining figures in TOC, old style figures in text with mathpazo

text: I use the `mathpazo` package with the `osf` option to get the Palatino font with old style figures. However, i want lining figures on the title page and in the table of contents. I have already found a way to use lining figures on the title page by using this command:               \fontfamily{pplx}\selectfont      I have tried to use this on my TOC page as well, but with little success:               {         \fontfamily{pplx}\selectfont         \thispagestyle{empty}         \tableofcontents     }      This will fix the section numbering, however not the page numbers to the right. How can i achieve that? Here's a minimal failing example:               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage[scaled]{helvet}     \usepackage[sc,osf]{mathpazo}     \usepackage[onehalfspacing]{setspace}          \usepackage{blindtext}               \begin{document}          \begin{titlepage}         \fontfamily{pplx}\selectfont         \begin{center}             Lining figures on the title page: 1234567890         \end{center}     \end{titlepage}          \pagebreak     {         \fontfamily{pplx}\selectfont         \thispagestyle{empty}         \tableofcontents     }          \pagebreak     \setcounter{page}{1}     \blinddocument          \end{document}      And this is how the TOC looks like: ![enter image description here](http://i.stack.imgur.com/z1E9J.png)


title: Having trouble with pgfSweave and tikzDevice

text: On Ben Bolker's advice I started using `pgfSweave` and `tikzDevice`. I'm struggling with getting `R` graphs into LaTeX. This is my code for `pgfSweave Rnw` file:               \documentclass{article}     \usepackage{tikz}     \usepackage{Sweave}     \usepackage[margin=1in]{geometry}          \title{Minimal pgfSweave Example}     \author{Cameron Bracken}          \begin{document}          <<setup,echo=F>>=     setCacheDir("cache")     options(keep.space=TRUE)     @               \maketitle     This example is identical to that in the Sweave manual and is intended to     introduce pgfSweave and highlight the basic differences. Please refer to     the pgfSweave vignette for more usage instructions.     We embed parts of the examples from the \texttt{kruskal.test} help page     into a \LaTeX{} document:          <<data,cache=T,tidy=T>>=     # hey, a comment     data(airquality)     print(kruskal.test(Ozone ~ Month, data = airquality )) # and another     @          \noindent which shows that the location parameter of the Ozone distribution varies     significantly from month to month. Finally we include a boxplot of the data:          \begin{figure}[!ht]       \centering       %notice the new options       {\pgfkeys{/pgf/images/include external/.code=         {\includegraphics[width=3in]{#1}}}              <<boxplot, echo=T, fig=T, width=3, height=3, tikz=T, external=T, highlight=T>>=           boxplot(Ozone ~ Month, data = airquality,             main='Ozone distribution',xlab='Month',ylab='Concentration')          @        }% this brace ends the effect of `include external'       \caption{This is from pgfSweave. Text is typset by \LaTeX\ and so matches the                font of the document.}     \end{figure}          \end{document}      which produces ![pgfSweave output](http://i.stack.imgur.com/9X1US.png) and the `tikzDevice Rnw` code is               \documentclass{article}     \usepackage{tikz}     \usepackage[nogin]{Sweave}          \begin{document}          <<echo=FALSE>>=     library(tikzDevice)     @          \begin{figure}[ht]       \centering            <<inline, echo=FALSE, results=tex>>=       tikz(console=TRUE, width=5, height=5)       x <- rnorm (100)       plot(x)       dummy <- dev.off()       @            \caption{caption}       \label{fig:inline}     \end{figure}          \end{document}      which produces ![tikzDevice output](http://i.stack.imgur.com/FmbcD.png) My question is: What am I missing? Both `Rnw` codes do not produce `R` graphs in `pdf` to include in a LaTeX document. Any help will be highly appreciated.


title: TikZ: constructing a piece of a hyperbola with a given asymptote

text: \documentclass[convert = false, border = 1cm, tikz]{standalone}     \begin{document}     \begin{tikzpicture}       \draw (0, 0) circle[radius = .35cm];       \draw (-60:1.5cm) -- +(0, 4);       \draw (0, 0) -- (-60:1.5cm);       \filldraw[black] (-60:.35cm) circle[radius = .04cm] node[below, font =       \scriptsize] {P};       \draw (-60:1.5cm) -- ++(150:4cm);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/HhwVb.png) How can I construct a hyperbola that has the given asymptotes and goes through point `P`? What we know is that the turn angle is `120` degrees, the distance from `P` to the intersection of the lines is `1.5cm` which is the semi-major axis, and the radius at periapsis is `.35cm`.


title: Add lines above and below title

text: Currently working on a document of type article. I'd like to add two horizontal lines above and below the title. I tried the following:                   \documentclass{article}         \begin{document}               \line(1,0){250}          \title{A Title}          \line(1,0){250}               \author{FirstName LastName}          \maketitle              \clearpage         \end{document}       This does not give the desired effect, and splits the title page into multiple pages. Could you advise?


title: Freely movable container

text: Is it possible to get an environment/container that is able to change the position of its content relative to the position where it would be normally. The content should be able to be anything like text or figures or (custom) environments. Someting would be great like:               \begin{container}[-5mm][-5mm][0mm]%expand 5mm to the top and to the left and 0mm to the right     \end{container}      The adjustwidth environment from the changepage package is close to that but it works only horizontally.


title: How to get headings to be an integral number of lines high (using the memoir class)?

text: I use the `memoir` class and the `\checkandfixthelayout` command to calculate the `\textheight` so that an integral number of lines will fit. This works very well: ![Image showing the result of \\checkandfixthelayout. ](http://i.stack.imgur.com/BymSy.png) But now I want to add a few section headings. Unfortunately, the height of my section headings destroys the nice relationship between `\textheight` and the height of normal lines, causing stretching between paragraphs (I use `\flushbottom`): ![Image showing the result of adding a section heading.](http://i.stack.imgur.com/pp8Y8.png) The solution seems obvious; I only need to ensure that the height of my section headings + any preceding and following space is _also_ an integral number of normal lines high. This seems simple in theory, but in practice I’m not able to figure out how to calculate the various parameters to achieve this. I want the section headings to be about twice the size of normal text (i.e., about 22 points). Then adding, for example, 1.5 lines of preceding space and .5 lines of following space should do the trick (or perhaps 2 + 1 lines, since the preceding space may disappear when a section heading appears at the top of a page). But I’ve tried both redefining `\huge` and setting `\setbeforesecskip` and `\setaftersecskip` to ‘sensible’ values, i.e., based on `\onelineskip` or `\baselineskip`, and it still doesn’t work. I have to manually select precise point sizes by trial and error, which isn’t a very reliable method, and causes much work if I decide to change some values later. So, is it possible to get the headings to automatically be an integral number of lines high (based on some input values, such as the required font size)? Note that I’m using `\setSingleSpace` to increase the leading, which may also complicate things (the values of `\baselineskip` and `\onelineskip` are not identical). Here’s an example document, used to create the above images (and yes, I do realise that widows and orphans, or section headings at the bottom of pages, may cause stretching even if the headings _are_ an integral number of lines high – ignore this for now):               \documentclass[a4paper,11pt,twoside]{memoir}          \RequirePackage[utf8]{inputenc}     \RequirePackage[T1]{fontenc}          \usepackage[osf,sc]{mathpazo}          \setSingleSpace{1.05}     \SingleSpacing          \setulmarginsandblock{1.8cm}{2.8cm}{*}     \checkandfixthelayout[nearest]          \setsecheadstyle{\mdseries\huge\itshape}          \usepackage{lipsum}          \begin{document}          \section*{Hello}          \noindent\lipsum[1]\par\lipsum*[2-7]          \end{document}


title: Shade background in pgfplots

text: I am using pgfplots package. I tried to use shade axis background. It is working in the .dvi output... But I don't see the shade when I convert it into pdf. Can anybody tell me the reason? I use TeXnicCenter editor...               \documentclass{article}     \usepackage{pgfplots}     \usepackage{tikz}     \begin{document}     \pgfplotsset{compat=1.5}     \tikzset{every mark/.append style={scale=1.1}}     \begin{tikzpicture}     \begin{semilogyaxis}[axis background/.style={     shade,top color=blue!10,bottom color=white},     legend style={fill=white},     legend style={at={(0.03,0.03)},     anchor=south west},     title=Convergence Plot,     xlabel={SNR (dB)},     ylabel={Symbol error probability},     grid=major,     legend entries={A  ,B ,C },     ]     \addplot+[mark =square*]  coordinates{      (0,0.0463972) (2.5,0.0182014) (5,0.00574787) (7.5,0.000925764) (10,0.000129722) (12.5,1e-006)     };;     \addplot+[mark=triangle*]  coordinates{      (0,0.0915691) (2.5,0.0562446) (5,0.0313533) (7.5,0.0177173) (10,0.011644) (12.5,0.00576422)     };     \addplot  coordinates{     (0,0.056353) (2.5,0.0283069) (5,0.0132647) (7.5,0.00345943) (10,0.000725631) (12.5,6.96066e-006)     };     \end{semilogyaxis}grid=major,               \end{tikzpicture}     \end{document}


title: Use Listing in newenvironment

text: I am trying to do a new environment or command (i tried both) where i can put in the name, description and code of a Method in c++ and it gives me a new section with the MethodName, the code listed and the description below. But i am not able to use the listings environment in a new command or new environment.. Consider my MWE                \documentclass[a4paper,11pt]{article}     \usepackage{listings}          \newcommand{\method}[3]     {     \section{#1}\label{#1}     \begin{lstlisting}     #2     \end{lstlisting}     #3     }           \begin{document}      \method{MethodName}{Method Void MethodName()}{Description of the Method blablabla}      \end{document}      How can I fix this? I would prefer to do it using a macro since I don't need an ending.


I'm trying to resize an equation on a `beamer` slide to make it larger. However, the usual approach of using `\scalebox` doesn't seem to work:               \begin{frame}     \scalebox{2}{     \begin{align}       x &= y\\       y &= z     \end{align}     }     \end{frame}      Producing the following error:               ! Missing \endgroup inserted.     <inserted text>                      \endgroup      How do I rescale an align environment on a beamer slide?


title: Split tikz tree level in two parts

text: I would like to rebuild this graphic for my bachelorthesis. ![predefined datatypes in XML Schema](http://i.stack.imgur.com/xCi9p.gif) ~~The problem that i ran into was, that i don't know how to split the graph in the second level, like shown in the picture above. I was able torebuild the graphic, except the "splitted tree level" and the legend below the graphic.~~ **Solution:**               %     % rebuild of graphic from     % http://www.w3.org/TR/xmlschema-2/#built-in-datatypes     %     \documentclass[12pt]{article}          \usepackage[utf8x]{inputenc}     \usepackage{tikz}     \usetikzlibrary{trees}          \begin{document}          \begin{figure}[htb]         \centering         \resizebox{\textwidth}{!}{             \begin{tikzpicture}[level distance=1.1cm,               level 1/.style={sibling distance=4cm},               level 2/.style={sibling distance=2cm},               level 3/.style={sibling distance=2.5cm},               box/.style={rectangle, fill={blue!15}, draw, font=\sffamily},               grayBox/.style={rectangle, fill=lightgray, text=black, font=\sffamily, draw},               violetBox/.style={rectangle, fill=violet, text=white, font=\sffamily, draw},               greenBox/.style={rectangle, fill=green!50, text=black, font=\sffamily, draw}]               \node[violetBox] {anyType}                 [edge from parent fork down]                 child {node[grayBox] {all complex types}                     edge from parent[dotted]                 }                 child {node[violetBox] {anySimpleType}                         child {node[box] {duration}}                         child {node[box] {dateTime}}                         child {node[box] {time}}                         child {node[box] {date}}                         child {node[box] {gYearMonth}}                         child {node[box] {gYear}}                         child {node[box] {gMonthDay}}                         child {node[box] {gDay}}                         child {node[box] {gMonth}}                         child {                             child [sibling distance = 3cm]{                                 child {node[box] {string}                                     child {node[greenBox] {normalizedString}}                                     child {node[greenBox] {token}                                         child {node[greenBox] {language}}                                         child {node[greenBox] {Name}                                             child {node[greenBox] {NCName}                                                 child {node[greenBox] {ID}}                                                 child {node[greenBox] {IDREF}                                                     child {node[greenBox] {IDREFS}                                                         edge from parent[dashed]                                                     }                                                 }                                                 child {node[greenBox] {ENTITY}                                                     child {node[greenBox] {ENTITIES}                                                         edge from parent[dashed]                                                     }                                                 }                                             }                                         }                                         child {node[greenBox] {NMTOKEN}                                             child  {node [greenBox] {NMTOKENS}                                                 edge from parent[dashed]                                             }                                         }                                     }                                 }                             }                             child {node[box] {boolean}}                             child {node[box] {base64Binary}}                             child {node[box] {hexBinary}}                             child {node[box] {float}}                             child [sibling distance = 3cm] {                                 child {node[box] {decimal}                                     child [sibling distance = 4cm] {node[greenBox] {integer}                                         child {node[greenBox] {nonPositiveInteger}                                             child {node[greenBox] {negativeInteger}}                                         }                                         child {node[greenBox] {long}                                             child {node[greenBox] {int}                                                 child {node[greenBox] {short}                                                     child {node[greenBox] {byte}}                                                 }                                             }                                         }                                         child {node[greenBox] {nonNegativeInteger}                                             child {node[greenBox] {unsignedLong}                                                 child {node[greenBox] {unsignedInt}                                                     child {node[greenBox] {unsignedShort}                                                         child {node[greenBox] {unsignedByte}}                                                     }                                                 }                                             }                                             child {node[greenBox] {positiveInteger}}                                         }                                     }                                 }                             }                             child {node[box] {double}}                             child {node[box] {anyURI}}                             child {node[box] {QName}}                             child {node[box] {NOTATION}}                         }                 };             \end{tikzpicture}         }         \caption{vordefinierte XSD Datentypen nach \cite{XMLSchema11Specification} Kapitel 3}         \label{fig:xsddatatypes}     \end{figure}          \end{document}      Here is how it looks now: ![finished_version](http://i.stack.imgur.com/TGNVF.png) PS: Is it reasonable to create a second graphic inside the figure for a legend? Is there a better way to do a legend?


title: Align column content along \div symbol

text: I would like to know if there is a way to align the content of a column along the position of a `\div` symbol. I know how to do it if there is a comma, but I don't know how to align along a different symbol.               \small     \begin{tabular}{lccccc}     \toprule     \textsc{Schema impiantistico} & $P_e$ [MW] & $\eta_I$ [\%] & $\eta_e$ [\%] & $\eta_t$ [\%] & $I_e$ \\      \midrule     Turbina a vapore a contropressione & $1\div 25$ & 88 & 15 & 73 & 0.17 \\      Turbina a vapore a condensazione e spillamento & $10\div 500$ & 65 & 30 & 35 & 0.46 \\      \midrule     Motore alternativo a recupero integrale & $0.1\div 10$ & 86 & 40 & 46 & 0.47 \\      Motore alternativo a recupero ad alta T & $0.1\div 10$ & 65 & 40 & 25 & 0.62 \\      Turbina a gas a recupero semplice & $1\div 100$ & 80 & 30 & 50 & 0.38 \\      Turbina a gas con post-combustione & $1\div 100$ & 83 & 25 & 58 & 0.30 \\      Turbina a gas con iniezione vapore & $5\div 60$ & 50 & 45 & 5 & 0.90 \\      Ciclo combinato (contropressione) & $20\div 50$ & 80 & 45 & 35 & 0.56 \\      Ciclo combinato (condensazione e spillamento) & $50\div 400$ & 70 & 50 & 20 & 0.71 \\      \bottomrule     \end{tabular}      \end{table}


title: Chapter headings too wide for page, but won't break

text: I'm preparing a document (`scrreprt`) which has pretty long chapter titles. Apparently, those are too long: they exceed the right margin by quite a bit, and of course I'm getting `Overfull \hbox` messages. It looks like this: ![Chapter heading #1](http://i.stack.imgur.com/SdJoC.png) ![Chapter heading #2](http://i.stack.imgur.com/G1a4b.png) Any ideas on how I could prevent this? I initially thought LaTeX would insert line breaks between _Marketing-_ and _Forschung_ (and _und_ and _Organisationen_ ), but it won't do that. A minimal example:               \documentclass[10pt]{scrreprt}          \usepackage[utf8]{inputenc}     \usepackage[ngerman]{babel}     \usepackage{titlesec}     \titleformat{\chapter}{\fontseries{eb}\huge}{\thechapter}{1em}{}     \usepackage[default,osfigures]{opensans}     \usepackage[T1]{fontenc}     \usepackage{geometry}     \geometry{a4paper, top=2.5cm, left=2.5cm, right=2.5cm, bottom=2.5cm, headsep=.35in, footskip=0.4in, headheight=2.5cm, footnotesep=1in}          \begin{document}          \chapter{Käuferverhalten und Marketing-Forschung als Gegenstandsbereiche des Marketing}          Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.     \end{document}


title: Lyx and Mendeley bibliography

text: I am absolutely new to Latex, Tex and whatever more there is, so I decided to try Lyx to make my life easier (haven't had much success, though). I am also using Mendeley to manage my bibliography and export a .bib file to be read in Lyx. The problem is, no matter what style I choose in either Lyx or Mendeley, I get a weird citation/bibliography layout. The bibliography in the outcome PDF looks like this:               |Bokpin(2013)| Bokpin, G. a., 2013. Ownership structure, corporate governance     and bank eciency: an empirical analysis of panel data from the banking     industry in Ghana. Corporate Governance 13 (3), 274287.     URL http://www.emeraldinsight.com/10.1108/CG-05-2010-0041      What I don't want is the key to appear in the beggining, ie `[Bokpin(2013)]`. The second problem is that the same key appears where the citation should be in the text, for example:               According to |Bokpin(2013|, the same behaviour [...]      Where it should be something like this               According to Bokpin (2013), the same behaviour [...]      or, depending on the chosen style, like this               The same behaviour [...] (BOKPIN, 2013)      Is there a configuration I should be doing in either Lyx or Mendeley that I not doing correctly (or at all)? I don't know what other information should be useful so you could help me, so feel free to comment below and I'll provide what is needed. Thanks, Bernardo


title: display \Sexpr{} in Latex without evaluation

text: I am working on a tutorial for the knitr package using the beamer class. I was able to display latex code and knitr chunks inside my presentation without evaluation but I additionally want to add inline code, namely \Sexpr{} without evaluation. So the three dots (...) should be replaced by \Sexpr{pi}. Any suggestions?               \documentclass{beamer}     \usepackage[english]{babel}     \usepackage{listings}     \lstset     {     language=[LaTeX]TeX,     breaklines=true,     basicstyle=\tt\scriptsize,     keywordstyle=\color{blue},     identifierstyle=\color{black},     }     \usepackage[utf8]{inputenc}     \usetheme{Madrid}          \title{}          \begin{document}          <<setup,echo=FALSE,include=FALSE>>=     render_listings()     @               \begin{frame}[fragile]{}{}          \begin{lstlisting}     \documentclass{article}     \begin{document}     The value of $\pi$ is ...               \Sexpr{''}<<label>>=     print("knitr!")     @          \end{document}     \end{lstlisting}                    \end{frame}          \end{document}


title: Manchu and Mongolian script

text: I am trying to write a document including Manchu script on a Mac. Manchu is written with the Mongolian alphabet with the addition of some diacritics, but the extra diacritics are included in standard Mongolian fonts included in Mac OS. Manchu/Mongolian script functions similar to Arabic script, in that the letters are connected and their shape varies depending on their position within a word. However, Mac OS is unable to input or even display Manchu/Mongolian properly, because it cannot handle the different forms that letters should take depending on their position within the word (isolated, initial, medial, or final). PCs can now both input and display Manchu/Mongolian. Now I'm wondering if it's possible to enter Manchu/Mongolian in LaTeX (say, by typing the UNICODE numbers of the letters), and have the typesetter produce proper script?


title: pgfgantt - Two labels for one bar in Gantt chart

text: In my Gantt chart (I'm using package `pgfgantt`), I have just one task in each line, one bar per task. Each bar has its corresponding label identifying the task aligned left of the chart; e.g.,               \documentclass[10pt,a4paper]{report}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{pgfgantt}          \begin{document}     \begin{ganttchart}[y unit title=0.4cm,                         y unit chart=0.5cm,                         vgrid={draw=none, dotted},                         hgrid,                          title label anchor/.style={below=-1.6ex},                         title left shift=.05,                         title right shift=-.05,                         title height=1,                         bar/.style={fill=gray!50},                         incomplete/.style={fill=white},                         progress label text={},                         bar height=0.7,                         group right shift=0,                         group top shift=.6,                         group height=.3,                         group peaks={}{}{.2}]{12}              \gantttitle{2012}{12} \\         \gantttitle{October}{4}         \gantttitle{November}{4}          \gantttitle{December}{4}                \ganttgroup{Group 1}{1}{8}\\         \ganttbar{Task 1}{1}{2} \\          \ganttbar{Task 2}{3}{4} \\          \ganttbar{Task 3}{5}{6}\\          \ganttbar{Task 4}{1}{8} \\      \end{ganttchart}     \end{document}      Now, I would like to be able to add the resources assigned to each task by inserting an inline label right of each bar. I have had a look at `/pgfgantt/bar label`, which offers a number of configurations for adjusting labels associated with a bar, but I cannot find a way to use it for having two labels (offline and inline) in one label. Is there any way to do this using `pgfgantt`? This picture shows the compiled code from above plus red labels indicating what is it that I want to achieve. ![enter image description here](http://i.stack.imgur.com/lKxzu.png)


title: Is it useful to use Latex to write medical articles?

text: I am a medical student approaching to the research world. Next month I am going to start a collaboration with a researcher that want me to learn how to create an article, to choose a specific journal, to look for materials, … It's been a while since I am (superficially) looking at tex world. In the last few days I downloaded an Elsevier template and tried to compile it, finding it relatively easy. I now try to be more specific about my question. Do you guys know if medical researchers use tex to write articles? My concerns are related to the fact that there are a lot of different journals (science group, elsevier, nature, cell, …) and at the moment I don't know if you can for example compile the Elsevier template and at the end, when you choose a specified journal, easily switch to the journal's preferred style.


title: Glossaries in Align Environment

text: Using glossaries commands in align environment seems to screw up the tag alignment. How can I use `gls{...}` commands in align environments without the tag position being altered? Consider the following code:               \documentclass[a4paper,10pt]{article}          \usepackage{amsmath,amsfonts,glossaries}     \usepackage[parfill]{parskip}          \newacronym{E}{\ensuremath{E}}{Energy}     \makeglossaries          \begin{document}         Standard gather environment         \begin{gather}             E = mc^2         \end{gather}         Glossaries Command in Align:          \begin{align}             \gls{E} &= mc^2         \end{align}         Same align environment, with the `gls` command missing:         \begin{align}             E &= mc^2         \end{align}     \end{document}      Which yields the following result, alignment differences should be clear: ![Output](http://i.stack.imgur.com/3Bfmy.png)


title: How to create this figure?

text: I have now spend hours by creating this figure - without luck. I have tried different types of tikz, tikzpicture, pstricks and multido usepackage. Can you maybe help me? I would really appreciate it. ![enter image description here](http://i.stack.imgur.com/ziatW.png)


title: Unicode in the equations: pros and cons

text: Is there any pros and cons for using of Unicode (and vice versa) in LaTeX equations? Consider two examples:               \lim_{h→0}∫_{x_0}^{x_0 + h}\frac{f(t)}{h} = f(x_0)          x_0 ⇔ ∀  > 0, ∃  > 0,(|x-x_0| <  ⇒ |f(x)-f(x_0)| < )      And without Unicode:               \lim\limits_{h \to 0}\int\limits_{x_0}^{x_0+h}\frac{f(t)}{h}=f(x_0)          x_0 \Leftrightarrow \forall\epsilon > 0, \exists\delta>0,(|x-x_0|<\delta \Rightarrow |f(x)-f(x_0)|<\epsilon)      With latest XeLaTeX the result is the same, so!, what's better?


title: vertical spacing in array with double-spacing

text: Double-spacing seems to mess up the vertical spacing inside of arrays. For example, the braces below extend too high. Is there a way to have the array contents centered vertically within the braces?               \documentclass{article}     \usepackage[doublespacing]{setspace}     \begin{document}     $\left\{ \begin{array}{c} abcde \\ abcde \end{array} \right\}$     \end{document}      ![Tall Braces](http://i.stack.imgur.com/eEtu0.png) The problem gets more obvious as the line spacing increases. For example, compare the space above the first line with the space below the second one:               \documentclass{article}     \begin{document}     \renewcommand\arraystretch{3}     $\left\{\begin{array}{c} abcde \\ abcde \end{array} \right\}$     \end{document}      ![Taller Braces](http://i.stack.imgur.com/skzoJ.png)


title: svjour3 | smartqed symbol issue

text: I'm writing a math paper for a Springer journal, using the `svjour3` class. According to the manual, `\smartqed` should produce a right justified K symbol, but it does not. On the other hand, `\qed` works fine. What am I doing wrong?               \RequirePackage{fix-cm}     \documentclass[smallextended]{svjour3}     \usepackage{graphicx}     \usepackage{mathptmx}     \usepackage{amssymb,amsmath,amsfonts,latexsym}     \begin{document}     \begin{theorem}     If $X$, then $Y$.     \end{theorem}     \begin{proof}     Clear. \smartqed     \end{proof}     \begin{theorem}     If $X$, then $Y$.     \end{theorem}     \begin{proof}     Clear. \qed     \end{proof}     \end{document}      The directory contains `svjour3.cls`, `svglov3.clo`, `spmpsci.bst`, and the file `s.tex` containing the above code. I am using MiKTeX 2.9 and compile with PDFLaTeX. The files are available at: http://www.springer.com/cda/content/document/cda_downloaddocument/LaTeX.zip?SGWID=0-0-45-468198-0


title: Global Coordinates

text: How can I declare coordinates in a block and access them from outside of the block?               \begin{tikzpicture}       \foreach \x / \y in {         1 /  3,         2 /  8,         3 / 14,       }{         \coordinate (N\x) at (\x,\y);         \path[draw] (N\x) circle (1em);      %% ok       };       \path[draw] (N1) -- (N3);              %% not ok     \end{tikzpicture}


title: Tridiagonal matrix

text: How can I reduce the size of the symbols in every element in the tridiagmatrix? It gets to large, and the ddots don't point in a straight diagonal line, the don't connect with each other. That's because I have about 5 letters in every diagelement! How can I fix this?


title: Extracting characters from the new libertine (with pdflatex)

text: The issue: I need to access e.g. `libertine`'s delta glyph in `pdflatex`. This question notes that the `\libertineGlyph` command is no longer provided by the latest version of the `libertine` package. It also notes that the replacement `libertineotf` doesn't work with `pdftex`. This answer suggests two workarounds (short of installing an older version).   1. Copy the definition of `\libertineGlyph` from the legacy version of the file.  I cannot get this to work because `libertine.sty` uses a macro `\define`. This doesn't seem to be provided when you import the three packages required by `libertine`, and it isn't a standard command.   2. It suggests using `\char` instead.  E.g. `\char934` doesn't work, presumably for the reasons which JLDiaz explained so clearly in this answer. I'd be very grateful for a working method. Edit: I'm specifically looking for a "text" delta rather than a "maths" delta. Cf: ![enter image description here](http://i.stack.imgur.com/tFRqJ.png)


title: Determine last day of given month

text: I want to determine how many days there are in a particular month. Using the `datenumber` package, I thought I could simply set the date to the 1st of the _next_ month and then back up one day would be the end of the month and extract the date. Well that sure _seemed_ simple when I came up with it, but then got stuck at actually extracting the day of the month. So, what do I need to replace               \xdef\LastDayOfMonth{\value{dateday}}      with the get the number of days in the month. ## Notes:   * I am not opposed to additional packages, so any package solution is fine. ## Code:               \documentclass{article}     \usepackage{datenumber}     \usepackage{pgffor}          \newcounter{GivenDateCounter}     \newcommand{\LastDayOfMonth}{XX}%     \newcommand{\NumberOfDaysInMonth}[2]{%         % #1 = YYYY         % #2 = MM         \ifnum#2<12\relax             % Since this is NOT Dec we can just go to the 1st of the next             % month and back up one day.             \setmydatenumber{GivenDateCounter}%                     {#1}%                     {\numexpr#2+1\relax}% Next month                     {01}% First of the month         \else             % Since this IS Dec we can just go to Jan 1st of the next             % year and back up one day.             \setmydatenumber{GivenDateCounter}%                     {\numexpr#1+1\relax}% Next Year                     {01}% Next day is Jan next year since current month is 12                     {01}% First of the month         \fi         \addtocounter{GivenDateCounter}{-1}% Now we are the end of the required month         \xdef\LastDayOfMonth{\value{dateday}}%  <---- Stuck here.         \typeout{**** \string\LastDayOfMonth for #1-#2=\LastDayOfMonth}%     }%          \begin{document}          \foreach \YearNumber in {2013, 2014} {%         \foreach \MonthNumber in {01, 02, ..., 12} {%             \par             Number of Days in \YearNumber-\MonthNumber{} is              \NumberOfDaysInMonth{\YearNumber}{\MonthNumber}.%         }%     }%               \end{document}


title: Rotate Figure using sidewaysfigure according to page number

text: I have a lot of tables and figures to include in my thesis. I am using sidewaysfigure to include them in a full-page landscape view. I need to put 90 degrees-oriented figures if the page is on the left side (even page number) and -90 degrees-oriented figures if the page is on the right side (odd page number). With the code below I obtain random orientation with no respect to the page number. In the code below you'll find 3 important examples for my theis corresponding to 1 figure and 2 tables all of them put in sidewaysfigure environment. Is there any solution obtain what I want ? Note that I haven't know how to separate the LaTex code with the text in this forum.               \documentclass[12pt,a4paper,english,french]{book}     .....     \usepackage{rotating}     \usepackage{tabularx}     \usepackage{graphicx}     \usepackage{epstopdf}     .....     \begin{document}     .....     ..... % Figure 1:     \begin{sidewaysfigure}[!htbp]      \captionsetup{justification=centering,margin=2cm,font={small}}     \centering     \fbox{\includegraphics[scale=.7]{imagesP/test.eps}}     \caption{Localisation géographique}     \captionsetup{font={scriptsize}}     \label{Figure:Local}     \caption*{{Conception de l'auteur,  Données S.I.G: \ac{OTEDD} [2013]}}     \end{sidewaysfigure}     ....     % Table 1 (Part 1/2 of the table divided into to pages)     \begin{sidewaystable}[!htbp]      \footnotesize     \centering     \renewcommand{\arraystretch}{1.5}     \def\tabularxcolumn#1{m{#1}}     \begin{tabularx}{\textwidth}{c >{\centering\arraybackslash}m{1.8cm} >{\centering\arraybackslash}m{4.4cm} >{\centering\arraybackslash}m{3.5cm} X}     \hline     \textbf{Année} & {\textbf{Auteur}} & {\textbf{Article}} & {\textbf{Revue}} &  \centering{\textbf{Apport théorique / empirique}} \tabularnewline     \hline     Text & Text & Text & Text \\     \hline     Text & Text & Text & Text \\     \hline     \end{tabularx}     \captionsetup{justification=centering,margin=2cm,font={small}}     \caption{Chronologie des études (1/2)}     \captionsetup{font={scriptsize}}     \label{sec3:chrono}     \caption*{Source: Conception de l'auteur}     \end{sidewaystable}     % Table 2 (Part 2/2 of the table divided into to pages)     \begin{sidewaystable}[!htbp]      \footnotesize     \centering     \renewcommand{\arraystretch}{1.5}     \def\tabularxcolumn#1{m{#1}}     \begin{tabularx}{\textwidth}{c >{\centering\arraybackslash}m{1.8cm} >{\centering\arraybackslash}m{4.4cm} >{\centering\arraybackslash}m{3.5cm} X}     \hline     \textbf{Année} & {\textbf{Auteur}} & {\textbf{Article}} & {\textbf{Revue}} &  \centering{\textbf{Apport théorique / empirique}} \tabularnewline     \hline     Text & Text & Text & Text \\     \hline     Text & Text & Text & Text \\     \hline     \end{tabularx}     \captionsetup{justification=centering,margin=2cm,font={small}}     \caption{Chronologie des études (2/2)}     \captionsetup{font={scriptsize}}     \label{sec3:chrono2}     \caption*{Source: Conception de l'auteur}     \end{sidewaystable}     ....     \end{document}


title: how to draw XOR gate symbol as a node in tikz?

text: I want to draw a diagram as follows: ![enter image description here](http://i.stack.imgur.com/84Xm5.jpg) This is my tikz code               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows,fit,calc,positioning,automata}          \begin{document}               \tikzstyle{int}=[draw, minimum size=4em]     \tikzstyle{init} = [pin edge={to-,thin,black}]          \begin{tikzpicture}[node distance=5cm,auto,>=latex', scale = 0.75, transform shape]         \tikzstyle{line} = [draw, -latex']         \node [int] (a) { $x^2$ };        \node [int] (b) [right of=a] { $x^1$ };         \node [int] (c) [right of=b] { $x^0$ };         % \coordinate[right=1.75cm of a] (a1)  {};              \path[->] (b) edge node { } (a);          \end{tikzpicture}          \end{document}      Output is: ![enter image description here](http://i.stack.imgur.com/6sWLZ.png) How do I make those XOR symbols in tikz?


title: Error While Trying to "Build & View"

text: I am using TeXstudio on my windows laptop, and whenever I try to view the progress of my document by pressing the "Build & View" button (the green arrow), it won't generate any thing in the viewing window, and I am provided with this message, "Error: Could not start the command: pdflatex.exe -synctex=1 -interaction=nonstopmode "texstudio_r10156".tex" What is the matter?


title: Please help to get the right symbol for my macros

text: I am not good at macros, so please can someone assist me. I need to have this symbol in my macro > ŉ So the comma is like a 9 not a 6 but the macro my colleague wrote for me does not work on my pc but it works on hers — this is it here:               Selection.Find.Execute Replace:=wdReplaceAll         With Selection.Find             .Text = "'n "             .Replacement.Text = "’n "             .Forward = True             .Wrap = wdFindContinue             .Format = False             .MatchCase = False             .MatchWholeWord = False             .MatchWildcards = False             .MatchSoundsLike = False             .MatchAllWordForms = False         End With


title: How to create subset with sim symbol

text: I've been trying to typeset as an operator the symbol ⫇ (`\subset` on top a `\sim`), but the following solutions have not been helpful   * ⫇ does not seem to be listed in symbols-a4.pdf, so detexify does not find it.   * `\limits` and `\underset` puts the tilde (or `\sim`) too separated from `\subset`.   * Using `\undertilde` looks ugly. Is any other option to obtain this symbol?


title: Allow source code to wrap around a figure

text: I would like to be able to wrap source code around a figure. Here's a MWE that should make it clear what I have in mind:               \documentclass{article}     \usepackage{wrapfig}     \usepackage{listings}     \lstset{language={},         breaklines=true,         basicstyle=\ttfamily,         breakatwhitespace=true}          \begin{document}     \noindent     \def \myasywidth {5cm}     \begin{wrapfigure}{l}{\myasywidth}     \vspace{0pt}     \rule{\myasywidth}{\myasywidth}     \end{wrapfigure}     %     %     \begin{lstlisting}     settings.outformat="pdf";     size(5cm,0);          real xmin = -0.1;     real xmax = 2;     real ymin = -0.1;     real ymax = 2;          path s = (0,0){up} .. (1/2,sqrt(1/2))  .. (1,1) .. (xmax,sqrt(xmax));     fill(s -- (xmax,0) -- cycle, mediumgray);     draw(s);          arrowbar axisarrow = Arrow(TeXHead);     draw((xmin,0) -- (xmax,0), arrow=axisarrow);     draw((0,ymin) -- (0,ymax), arrow = axisarrow);          real x = 1.4;     real dx = .05;     real t0 = times(s,x)[0];     real t1 = times(s,x+dx)[0];     path striptop = subpath(s,t0,t1);     draw((x,0) -- striptop -- (x+dx,0) --  cycle, blue);     \end{lstlisting}     %     \end{document}      Here's the result (produced with some warnings about conflicting environments): ![enter image description here](http://i.stack.imgur.com/fVJJF.png) How do I make this work? (In addition to wrapping, the solution should also restore the behavior of the `listings` package that continuations of automatically broken lines should be indented.)


title: Draw the LaTex beamer article symbol

text: How do I draw the little article symbol from LaTeX beamer's bibliography section somewhere else in my beamer presentation? I want to use it as a bullet symbol for a normal list.


title: Where can I find the changelog of TeX Live releases?

text: I know that TeX Live 2013 is now in beta and that there are already some new packages. I would like to know where the complete changelog will be available, when the new version will be released, and also where can I find the changelog for version 2012, released in the past year. Is there a specific page on the TUG site, here or somewhere else? I've searched everywhere but could not find a complete changelog?


title: open pdf at current page using TeXnicCenter and Adobe Reader, or should I use another setup?

text: Is it nowadays possible to open the compiled pdf at that position, where the last change happend, using the aforementioned TeXnicCenter and Adobe Reader? I used my favourite search engine ;) but didn't found anything, except some threads from 2011 where they stated, that it would not be possible. But then I found, that the `hyperref` package has a setting `\hypersetup{...}` with `pdfstartpage` but I didn't get it to work. If the anwser is still: "It's not possible!", my next question would be: which setup/programs should I use, so that it is possible? Or isn't it possible in general? Many thanks in advance.


title: Why is the PSCyr font package is not on CTAN?

text: There is old and famous cyrillic font package named PSCyr which is mentioned in nearly every russian guide about setting up LaTeX for writing documents with cyrillic letters. Actually I want to ask two questions regarding this package:   1. Why is it still not on CTAN and not available in major LaTeX distros?   2. Is there any more useful (and widely used) and modern alternatives?


title: custom float (newfloat): entry in listoflistings is not indented

text: I'd like to use a custom floating environment for `lstlisting`s so as to be able to draw frames around the listings using `mdframed`. My float uses the same counter as lstlisting, and also appears in the List of Listings. However, the corresponding line in the List of Listings is not indented like the other lines are. My Questions:   1. Why is that?   2. What can I do to make the entries for the custom float look the same? Minimal example:               \documentclass[a4paper,oneside,article,final]{memoir}     \usepackage{listings}          \newfloat[chapter]{myfloat}{lol}{Listing}     \newlistentry{myfloat}{lol}{0}          \begin{document}     \lstlistoflistings     \chapter{Content}          \begin{lstlisting}[caption={A}]       A!     \end{lstlisting}          \begin{lstlisting}[caption={B}]       B!     \end{lstlisting}          \begin{myfloat}[b]       \begin{lstlisting}         C!       \end{lstlisting}       \caption{C}     \end{myfloat}          \end{document}      I'd post what it looks like (already made the screenshot), but apparently one needs 10 reputation to post images :/


title: How to give floats/figures titles?

text: Below is an excerpt from my thesis, showing a figure with a caption. I'd like to give the figure a title too, that is, a few words written above the figure. Can I do that in latex? If so, how? ![enter image description here](http://i.stack.imgur.com/fgE4o.png)               \begin{figure}     \includegraphics[width=\linewidth]{./graphics/chapter6/mouse.pdf}     \caption{Blablabla}     \label{fig:length_eight_mouse}     \end{figure}


title: acro package: Italicize first occurrence of term

text: I am using the `acro` package for acronyms because, for a phrase that is not a proper name, I can have the first letter of each word uncapitalized except when it starts off a sentence, in which case the very first letter of the phrase is capitalized. Like other packages, it allows user-specification of plural forms for the acronym and the long phrase. Unlike other packages, it provides these capabilities without having to externally make an index. It is not a full fledge glossary package, but it meets my needs for acronyms. For the `acro` package, is there a way to italicize the first occurrence of the phrase, when the acronym is introduced, but without italicizing the acronym itself? The vanilla way of introducing a phrase and its acronym is `\ac{label}`, which expands to the phrase followed by its acronym in brackets. The command `\textit{\ac{label}}` causes both the phrase and the acronym to be italicized. I know that the `acronym` package (as opposed to the `acro` package) does the proper italicization with `\acfi{label}`, at least according to ftp://ftp.tex.ac.uk/pub//tex/macros/lat ... cronym.pdf. However, this is not recognized using the `acro` package. I'm not sure if a MWE is needed for this question, but here is a toy file:                 \documentclass{article}          \usepackage{acro}          \DeclareAcronym{abc}{             short=ABC,             long=alpha bettick crisps          }       \begin{document}               The objective of this report is to test acronyms like          \ac{abc}.  \acresetall \Ac{abc} are delicious.               \acresetall          \textit{\ac{abc}}.               \cleardoublepage          \printacronyms[%             name = {Abbreviations},             sort = false          ]            \end{document}


title: Relational Grammar arcs

text: I'm quite used to draw syntactic trees and even AVMs for different linguistic theories, but I've stumbled upon the need to draw Relational Grammar / Arc- paired grammar arcs for a paper I'm writing (search for "relational grammar" in Google Images to have a glimpse on how these arcs look like). Does anybody of a package that may be useful for this? Thanks!


title: Issue with xindy for package glossaries

text: Everything was working perfectly. Suddenly I started getting the error for `xindy` while using the `glossaries` package               Warning: File 'PhDThesis.acn' is empty. Have you used any entries defined in glossary 'acronym'?     ***Call to xindy failed*** Possible cause of problem: Sort key required for entries only containing command names Check 'PhDThesis.nlg' for details      I had just updated my Ubuntu 12.10. The content of the .nlg file               ;; This logfile was generated automatically by `xindy'     ;; at 14.08.2013  17:25:07     ;; Indexstyle: "/tmp/HCmyqynpuv", Rawindex: "/tmp/z3QRNA2BGB", Output: "PhDThesis.not"               Building indexentry-tree:     Hierdepth of index is :TREE          sort-indexentries: (FORWARD BACKWARD FORWARD FORWARD)     sort-indexentries: (FORWARD BACKWARD FORWARD FORWARD)     sort-indexentries: (FORWARD BACKWARD FORWARD FORWARD)     sort-indexentries: (FORWARD BACKWARD FORWARD FORWARD)     sort-indexentries: (FORWARD BACKWARD FORWARD FORWARD)     sort-indexentries: (FORWARD BACKWARD FORWARD FORWARD)     sort-indexentries: (FORWARD BACKWARD FORWARD FORWARD)     ERROR: CHAR: index 0 should be less than the length of the string               *** Unable to execute: 'xindy  -L english  -I xindy -M "PhDThesis" -t "PhDThesis.nlg" -o "PhDThesis.not" "PhDThesis.ntn"' ***          Status report:          Opening logfile "PhDThesis.nlg" (done)     Reading indexstyle...     Loading module "/tmp/HCmyqynpuv"...     Loading module "lang/english/latin9-lang.xdy"...     Loading module "lang/english/latin9.xdy"...     Finished loading module "lang/english/latin9.xdy".     Finished loading module "lang/english/latin9-lang.xdy".     Loading module "PhDThesis.xdy"...     Loading module "tex.xdy"...     Finished loading module "tex.xdy".     Finished loading module "PhDThesis.xdy".     Finished loading module "/tmp/HCmyqynpuv".     Finished reading indexstyle.     Finalizing indexstyle... (done)          Reading raw-index "/tmp/z3QRNA2BGB"...     Finished reading raw-index.          Processing index...     ERROR: CHAR: index 0 should be less than the length of the string      Help please.


title: Messy output in lyx

text: When I try to convert document to pdfs I get a messy output where the paragraphs don't begin in same place. e.g (decline the content in hebrew): ![enter image description here](http://i.stack.imgur.com/0OoSh.png) as you can see each of the lines begin in different place. How can I fix it?


title: Different font for small caps in Descriptionitem Label

text: For my Bachelorthesis I defined a new kind of item to use it with the `description` environment.               \newcommand{\tfactor}[5][Event]{%         \item[\textsc{Faktor -- #1 -- #2 }]\hfill\textbf{#3} \\%         \textbf{\textsc{Text: }}#4\\%         \textbf{\textsc{Anmerkung: }}#5%     }         What I expected was an Item with the same `textsc` font. What I've got looked like this: ![enter image description here](http://i.stack.imgur.com/CbkjZ.png) There is clearly a difference in the font. I figured out that using the `\libertine{}` command fixes it this way               \newcommand{\tfactor}[5][Event]{%         \item[\libertine{\textsc{Faktor -- #1 -- #2 }}]\hfill\textbf{#3} \\%         \textbf{\textsc{Text: }}#4\\%         \textsc{\textbf{Anmerkung: }}#5%     }             However I would like to fix it the other way round. »Text« and »Anmerkung« should have the same font as »Faktor - Event - ID« I am still using the `enumitem` package, but don't have any idea how to find out which font this is. **MWE**               \documentclass[12pt,%Schriftgröße     a4paper,%Papierformat     titlepage     ]%Titelseite nicht nummeriert     {scrreprt}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{libertine}     \usepackage{enumitem}     \usepackage[ngerman, english]{babel}                    \newenvironment{factorlist}     {%         \begin{description}[nosep,itemsep=5pt,leftmargin=0pt]%         }         {%         \end{description}%     }          \newcommand{\tfactor}[5][Event]{%         \item[\textsc{Faktor -- #1 -- #2 }]\hfill\textbf{#3} \\%         \textbf{\textsc{Text: }}#4\\%         \textsc{\textbf{Anmerkung: }}#5%     }                 \begin{document}         \begin{factorlist}             \tfactor{0}{16:24:24.24}{11 Personen sterben 64 werden verletzt}     {Im nahen Umkreis der Absturzstelle befinden sich die Zuschauertribünen}          \end{factorlist}     \end{document}      ![enter image description here](http://i.stack.imgur.com/wLCZI.png)


title: How to center horizontally and vertically the text area on my pages in svmono.cls?

text: I'm using svmono latex template for typesetting my book. Now my publisher wants me to center horizontally and vertically the text area on all of my pages. I wanted to do this by using `\usepackage[centering]{geometry}`, but it gives me some errors. How can I do that?


title: \@ifundefined actually defines macros?

text: Is it just me or is it a bit illogical that               \documentclass[a4paper]{article}     \begin{document}     \makeatletter     \@ifundefined{chapter}{}{}     \makeatother     \ifdefined\chapter chapter\else no chapter\fi     \end{document}      returns _chapter_. So basically `\@ifundefined` actually ends up defining the macro (making it equal to `\relax`)


title: Undefined Control Sequence Error in PDFLatex with \includegraphics

text: I receive two errors when using `\includegraphics` command in pdflatex. I've never seen these particular errors discussed/answered before. I have the following MWE (this is all I have in the document so far):               \documentclass{article}          \usepackage{graphicx}          \begin{document}          \begin{figure}     \begin{center}     \includegraphics[scale=0.92]{box.png}     \hspace{0.5in}\parbox{6in}{\caption{Box comparing two methods \label{box}}}      \end{center}      \end{figure}          \end{document}      where box is the figure to be included. There are two errors produced. Both of them say the following:               ! Undefined control sequence.          recently read \ltx@zapspace      I do not know what these errors mean. I assume they have something to do with `\ltx@zapspace`. I appreciate any help or clarification of this error or how to correct it.


title: What are the main differences between AutoLaTeX and LaTeXMk?

text: I stumbled upon AutoLaTeX today and it seems to be very similar to LaTeXMk indeed. Can you summarise the main differences, which might help me choose between the two tools?


title: Install fonts into a certain directory (as non-root)

text: I am trying to install MinionPro (using FontPro) into my home directory. What I usually do is to install packages is to put the .sty and other files into some directory, say `~/latexstyles`, and then do               export TEXINPUTS=$HOME/latexstyles//:.:      so latex will pick up all the files. The advantage is that I can copy the contents of this directory to different systems that often have wildly different latex versions, and it still works. However, this scheme doesn't work with fonts. The proper way to do this seems to do               sudo updmap --enable Map=MinionPro     # or edit updmap.cfg or /etc/texmf/updmap.d     sudo updmap      and then updmap modifies some system-wide configuration files. How do I translate this to an installation in the home directory? I'd like to have a result that I can just copy to another system, since I can't run the FontPro scripts on my target system (can't install the dependencies of FontPro there). I tried setting               TEXMF=$HOME/latexstyles      (and variations), but then updmap does nothing, and pdflatex doesn't run anymore.


title: Easy way to do several line styles on one path using TikZ?

text: I'm drawing a lot of 3D pictures for school using 3D-plot for TikZ. I like it when the lines that are _inside_ or _behind_ an object, eg. the ones that shouldn't be visible to be thinner than the lines that are. For instance: A cube should look like this: ![cube](http://i.stack.imgur.com/9qPLw.jpg) where the dashed lines could just be thinner than the rest.. To get this type of 3D I would normally draw the entire cube (all the lines) with the `very thin` option. Then I'd copy the lines that should be very thin (the ones that aren't dashed in the figure) and let TikZ redraw them using the `thin`option (it's obsolete I know) or the `thick` option. Since this isn't a clean way to work, what are your suggestions? I'd like to see something like:               \draw[tdplot_main_coords,thick] (0,0,0)--(0,1,0){ [very thin] --}(0,0,1)-- ... ;      Where I can just select part of a path and give it the right options (overriding the general options).


title: Landscape mode causes a blankpage

text: I'm using this code for showing an image in landscape mode:               \begin{landscape}          \begin{figure}[H]     \centering     \includegraphics[width=\hsize]{./images/SelectDVA.png}     \caption{DVA part of the Use Case \ref{sec:use_case_2}.}     \end{figure}          \end{landscape}      This causes the output to have a blank page immediately after the rotated page containing the image. It seems that using landscape causes a page break, is it true? How can I prevent this behaviour?


title: Numbering nodes in a for loop

text: I've just started using TikZ to make basic graphs, and I'm trying to reproduce the Petersen graph. I've managed to make it without using for loops, but this obviously isn't a great method for bigger examples. Currently, my new code stands at:               \begin{tikzpicture}     \foreach \x in {1,...,5}{     \pgfmathparse{(\x-1)*360/5+90}     \node[draw,circle,inner sep=8pt] (\x) at (\pgfmathresult:120pt) [semithick] {};     }          \foreach \x in {1,...,5}{     \pgfmathparse{(\x-1)*360/5+90}     \node[draw,circle,inner sep=8pt] (5+\x) at (\pgfmathresult:60pt) [semithick] {};     }     \end{tikzpicture}      This works, but isn't complete. However, I've realised that the second set of five nodes aren't numbered as `6, ... , 10` but as `5+1, ... , 5+5`, which isn't what I want. I tried using `\pgfmathparse{int(5+\x)}\pgfmathresult` instead of `5+\x`, but this results in an error. Strangely (at least to me), if I put `\pgfmathparse{int(5+\x)}\pgfmathresult` in the empty braces at the end of the second loop, it'll happily put the numbers 6, ... , 10 in the circles, so I can't see why my method shouldn't work. What am I doing wrong, and why doesn't it work? Edit: new code:               \begin{tikzpicture}     \foreach \i[evaluate={\angle=(\i)*360/5+90}] in {0,...,4}     {         \node[draw,circle,inner sep=8pt] (\i) at (\angle:120pt) [semithick] {};     }     \foreach \i[evaluate={\angle=(\i)*360/5+90}, evaluate={\Name=int(\i+5)}] in {0,...,4}     {          \node[draw, circle,inner sep=8pt] (\Name) at (\angle:60pt) [semithick] {};     }     \foreach \i in {0,...,4}      {         \pgfmathparse{int(mod(\i+1,5))}         \draw[-] (\i) -- (\pgfmathresult);     }     \foreach \i in {0,...,4}      {         \pgfmathparse{int(mod(\i,5)+5)}         \draw[-] (\i) -- (\pgfmathresult);     }     \foreach \i in {5,...,9}      {         \pgfmathparse{int(mod(\i+2,5)+5)}         \draw[-] (\i) -- (\pgfmathresult);     }     \end{tikzpicture}


title: matlab2tikz logo

text: As the author of the free and open-source package matlab2tikz, I was going to create a nice-looking logo for the software that is easily recognized on MATLAB's file exchange and representative of matlab2tikz' capabilities. Any ideas for combining MATLAB with the awesomeness of LaTeX in one iconic figure?


title: Spacing in beamer seems to change when \pause is added

text: `beamer` seems to sometimes add vertical space when I add `\pause` commands; an example is below. Is there some way to avoid that?               \documentclass{beamer}     \begin{document}     \begin{frame}       Without pause:       \[A\]\[B\]       Not too much space between displayed equations.     \end{frame}     \begin{frame}       With pause:       \[A\]\pause\[B\]       Too much space between the equations.     \end{frame}     \end{document}


title: Complicated logic circuit drawing with Tikz - two input buffer gate?

text: i'm trying to draw similar image with Tikz and Circuit Library, so far i'm stucked at drawing buffer gate with two labeled inputs (IBUFGDS and IBUFDS), standard library have a gate with only one input... Anyone have an idea how can i start? Complete drawing is not necessary , i just need a hand:D ![LINK TO IMAGE](https://dl.dropbox.com/u/14052972/timing.png) So far i come up with somtheing like this, but it's just a start:P               \documentclass{article}     \usepackage{circuitikz}     \begin{document}               \begin{circuitikz} \draw      (0,0) node[op amp] (opamp) {IBUFDS}         (opamp.+) node[left] {$data\ ser\ p$}         (opamp.-) node[left] {$data\ ser\ n$}         (opamp.out) node[right] {$data\ ser$}           (0,-5) node[op amp] (opamp) {IBUFGDS}         (opamp.+) node[left] {$clk\ in\ p$}         (opamp.-) node[left] {$clk\ in\ n$}         (opamp.out) node[right] {$clk\ in$}     ;\end{circuitikz}          \end{document}


title: Hard binomial lattice requests (color, arrows and more)

text: I wish to replicate the image in this post. However I can't do any of it except the basic stuff that my code does. Thanks for any help. The exact coloring doesn't matter. Also I don't actually want those black lines around the coloring. Perhaps a darker blue line around the light blue coloring and a darker green line around the light green coloring. ![enter image description here](http://i.stack.imgur.com/zRV02.png)               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{matrix,fit,backgrounds,calc}                     \begin{document}          \begin{tikzpicture}[>=stealth,sloped]         \matrix (tree) [%           matrix of nodes,           minimum size=1cm,           column sep=3.5cm,           row sep=0.6cm,         ]         {                  & |(top-left)| & |(top-right)|     & $ $  \\                   &                    &  $_0S_{2\Delta t}$   &       \\                   & $_0S_{\Delta t}$   &                      & $ $           \\           $_0S_0$ &                    &  $_1S_{2\Delta t}$   &       \\                   & $_1S_{\Delta t}$   &                      & $ $       \\                   &                    &  $_2S_{2\Delta t}$   &     \\                   & |(bottom-left)|    &  |(bottom-right)|    & $ $   \\                       };         \draw[->] (tree-4-1) -- (tree-3-2) node [midway,above] {$p$};         \draw[->] (tree-4-1) -- (tree-5-2) node [midway,below] {$1-p$};         \draw[->] (tree-3-2) -- (tree-2-3) node [midway,above](a) {};         \draw[->] (tree-3-2) -- (tree-4-3) node [midway,below] {};         \draw[->] (tree-5-2) -- (tree-4-3) node [midway,above] {};         \draw[->] (tree-5-2) -- (tree-6-3) node [midway,below] {};         \draw[->,dashed,shorten >= 17mm] (tree-2-3) -- (tree-1-4) node [midway,above] {};         \draw[->,dashed,shorten >= 17mm] (tree-2-3) -- (tree-3-4) node [midway,below] {};         \draw[->,dashed,shorten >= 17mm] (tree-4-3) -- (tree-3-4) node [midway,above] {};         \draw[->,dashed,shorten >= 17mm] (tree-4-3) -- (tree-5-4) node [midway,below] {};         \draw[->,dashed,shorten >= 17mm] (tree-6-3) -- (tree-5-4) node [midway,above] {};         \draw[->,dashed,shorten >= 17mm] (tree-6-3) -- (tree-7-4) node [midway,below] {};              % t-line         \draw[dashed] ($(top-left.north)!.5!(top-right.north)$) -- ($(bottom-left.south)!.5!(bottom-right.south)$);         \node at ($(bottom-left.south)!.5!(bottom-right.south)-(0,1em)$) {$\tau$};                 \end{tikzpicture}           \end{document}      ![enter image description here](http://i.stack.imgur.com/MZMEw.png)


title: why beamer requires multiple compilation to get slide numbers correct?

text: I don't actually have a real problem, but I'd like to understand why beamer requires multiple compilations to get the slide count right. I'm writing a presentation, so I often add a new frame, write something, and then compile the presentation to see how it looks. But every time a new frame is added the total number of slides isn't updated, so the last slide shows a `n+1/n` label instead of `n+1/n+1` as I'd expect(where `n` is the previous number of slides). I've tried to search a bit but I couldn't find anything mentioning this behaviour. Is this supposed to be the normal behaviour? edit: I can reproduce this by doing the following steps:   1. Create a random beamer presentation(using a style that shows the slide count e.g. AnnArbor) with one frame   2. Compile it   3. Add a new frame   4. Compile again and the last slide will show the described behaviour.


title: Best way to insert a horizontal cut line with a scissor symbol

text: What's the best way to insert a horizonal dashed line with a scissor symbol to indicate that the paper should be cut with a scissor along this line? If you have multiple layout alternatives without much code, please post it.


title: Using pgfplots, is there a way to overlay multiple stacked plots with different ranges?

text: I am using the accepted answer to the question “Is there an easy way of using line thickness as an error indicator in a plot?” to draw error bands around my regular line plots. However, I find myself wanting to plot two lines with slightly different x ranges, which makes pgfplots complain: > Package pgfplots Error: Sorry, pgfplots expects stacked plots to have > exactly the same number of coordinates. Unfortunately, I encountered at plot > with DIFFERENT NUMBERS OF COORDINATES. Please verify that 1. no point has > been dropped by coordinate filters (for example log(0) or so) and 2. all > plots have the same number of coordinates.. Is there a way to start the stacked plot over "from scratch" within the same axis/scale so that this error does not occur? For example, in the example below, commenting out either the code for plotting table A or B will make it work, but as it is, it will give the error above:               \documentclass[a4paper]{article}     \usepackage{fullpage}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \pgfplotstableread{     0 10 12     1 10 11     2 8  9     3 15 16     4 13 15     5 20 21     }\tableA          \pgfplotstableread{     2 20 23     3 19 21     4 20 22     }\tableB          \begin{document}     \begin{center}     \begin{tikzpicture}     \begin{axis}          % Table A     \addplot [draw=none, stack plots=y, forget plot] table [x={0}, y expr={\thisrowno{1}}] {\tableA};     \addplot [draw=none, stack plots=y, forget plot, fill=gray!25] table [x={0}, y expr={\thisrowno{2}-\thisrowno{1}}] {\tableA} \closedcycle;          % Table B     \addplot [draw=none, stack plots=y, forget plot] table [x={0}, y expr={\thisrowno{1}}] {\tableB};     \addplot [draw=none, stack plots=y, forget plot, fill=gray!25] table [x={0}, y expr={\thisrowno{2}-\thisrowno{1}}] {\tableB} \closedcycle;          \end{axis}     \end{tikzpicture}     \end{center}     \end{document}


title: Why xelatex indents only the first paragraph?

text: Example:               \documentclass[a4paper,titlepage]{article}     \usepackage{xltxtra}     \setmainfont[Mapping=tex-text]{Times New Roman}     \usepackage[margin=0.5in]{geometry}     \usepackage[colorlinks=true,urlcolor=blue]{hyperref}     \begin{document}     \parindent 3ex     Some text, indented properly.     \section{Some section}       Another text, without indent this time.     \end{document}      It works, but only on the first paragraph. All other paragraphs (they are located in sections and subsections) are not indented at all. What can I do to fix this?


title: How to change name separator in bibtex-generated bibliography to a different language

text: When I run BibTeX, it generates in entries with several authors something like this:   `Winfried Just and Martin Weese.`   If you write a text in a different language, I suppose it is more customary to translate _and_ to your language. In my case I use `cslatex` and I have to change the entries manually in the bbl-file to   `Winfried Just a Martin Weese.`   if I want _a_ instead of _and_. >   * Is there a way to do this automatically, without manual modification of > the bbl-file? >


title: Circle with more than one "marking"

text: I was experimenting with               \draw[          decoration={markings, mark=at position 0.75 with {\arrow[scale=2]{<}}},          postaction={decorate}          ]           (0,0) circle (2);      and replaced it with               \draw[          decoration={markings, mark=at position 0.75 with {\arrow[scale=2]{<}},             mark=at position 0.62 with {\fill circle (2pt);}},          postaction={decorate}          ]           (0,0) circle (2);      i.e. I am trying to put several markings along the circle. At first I thought I was doing it correctly, just to notice that this doesn't answer my concern 100% as this implementation somehow ruined the alignment of the markings, i.e. either the arrow or the point is off the circle and not really along the circle. Any suggestions? Thanks a lot!


title: What program can display PDF tooltips on a Linux system?

text: I am trying to put in some text tooltips in some `tikz` graphic. I have found an example using `pdfcomment`, but after I have used `pdflatex` and opened it with Evince, I don't see any tooltips. What am I doing wrong?


title: pgfplots: shadow for markers

text: I was wondering if it's possible to add shadows to markers within pgfplots. I tried the `circular drop shadow` option (from TikZ) which unfortunately had no effect at all. I also read that one can define custom marker styles with `\pgfdeclareplotmark` but that's way beyond my PGF knowledge.               \documentclass{scrartcl}          \usepackage{pgfplots}     \usetikzlibrary{shadows}     \pgfplotsset{%       mystyle/.style={red,mark=*,mark options={fill=white,circular drop shadow}}}          \begin{document}          \begin{tikzpicture}       \begin{axis}          \addplot[mystyle] {x^2 - x + 4};       \end{axis}     \end{tikzpicture}          \end{document}      Am I missing the easy solution (disregarding that nothing about shadows is mentioned in the pgfplots manual) or do I have to get deeper into PGF?


title: Fixed Sized Grids

text: I'm trying to create a latex document that is split up into grids that will match up with the dimensions of perforated paper. The dimension of each block is height: 38mm and width: 70mm. This should fit a 3 x 7 grid of blocks on to the page. Could anyone give me pointers on how to go about doing this. So far I've managed to remove all the margins around the page, create a table with the desired width margins. I get stuck when it comes to creating a fixed height for the column.               \documentclass[10pt]{article}     \usepackage[margin=0.0in]{geometry}     \usepackage{longtable}          \begin{document}          \begin{longtable}{|p{2.75in}| p{2.75in}| p{2.75in}|}          example & example & example \\[1.49in]\hline     example & example & example \\[1.49in]\hline     example & example & example \\[1.49in]\hline     example & example & example \\[1.49in]\hline     example & example & example \\[1.49in]\hline     example & example & example \\[1.49in]\hline     example & example & example \\[1.49in]\hline          \end{longtable}          \end{document}      I would want it so I could fit as much text into each table cell as possible and maintain a height of 1.49in (38mm). The [1.49in] seems to add an extra 1.49 inches to the row rather than make it a fixed value of 1.49 inches.


title: Is something like "or" acceptable in conditional tests defined by \newif?

text: I am using conditional tests in my `.cls` file which has two options "`final`" and "`draft`". I am rather familiar with conditional tests but I am just curious to know how to define the "`or`" in the following code.               \if@final OR \if@draft FINAL TEST  \else NO TEST \fi\fi      ## Edit: I have tried the following code and have gotten the desired result, so I just want to know whether I CAN use something like "`\or`" in `\newif` conditional or not. In other word, does such a command (I mean `\or`) exist at all?               \documentclass[draft]{article}     \makeatletter     \newif\if@final     \@finalfalse     \DeclareOption{final}{\@finaltrue}     \newif\if@draft     \@draftfalse     \DeclareOption{draft}{\@drafttrue}     \ProcessOptions     \newcommand{\mytest}{\if@final FINAL TEST \else  \if@draft FINAL TEST  \else NO TEST \fi\fi}     \makeatother     \begin{document}     \mytest     \end{document}


title: TikZ: using a bitmaps's dimensions as global bounding box

text: I'm using a tikzpicture environment to draw on a bitmap image in order to add annotations. I'm setting the width of my bitmap to `\textwidth.` I want to add annotations in the left or right margins of the page. TikZ usually first completes the `tikzpicture,` then aligns it with the left margin. So what's required here is a manual bounding box to make sure it's the bitmap rather than the whole drawing that's left-aligned.               \documentclass{scrartcl}     \usepackage{tikz,lipsum}     \begin{document}     \raggedright     \begin{tikzpicture}         \useasboundingbox (0,0) rectangle (\textwidth,12em);         % <------- !         \node[anchor=south west,inner sep=0] (image) at (0,0) {%         \rule{\textwidth}{12em}};         \begin{scope}[x={(image.south east)},y={(image.north west)}]             \draw[red,-latex] (-0.05,0.7) node[anchor=east] {abc} -- (0.5,0.9);         \end{scope}     \end{tikzpicture}\par     \lipsum     \end{document}      This is all fine as long as we know the bitmap's dimensions, particulary its height. But -- is there a way to make tikz use the bitmap's dimensions (after my scaling it to `width=\textwidth`) as a bounding box for the entire drawing without us knowing them in advance?


title: Why is my acronym in title not expanded in HTML but in PDF?

text:
I am using the acronym package and htlatex to convert to HTML. I discovered that using an acronym in the title does not get expanded in the HTML even if it does in the PDF. The expansion works in regular paragraphs. Here is my MWE to show the issue:               \documentclass{article}     \usepackage{acronym}          \title{My Awesome \acp{AC}}          \begin{document}          \maketitle % this is where the acronym should get expanded in HTML          \acresetall % reset any acronyms used to force expansion again     Expanding \acp{AC} works in regular paragraphs.          \section{Acronyms}     \begin{acronym}     \acro{AC}{Acronym}     \end{acronym}          \end{document}      I compile with               pdflatex <FILE>     pdflatex <FILE>     htlatex <FILE>      and get the following PDF output ![PDF showing title with expanded acronym](http://i.stack.imgur.com/VXA68.png) while the generated HTML shows only the acronym (not expanded) in the title tag:               ...
My Awesome ACs
     ...
   Expanding Acronyms (ACs) works in regular paragraphs.     ...      I would like to have the HTML use the same text "Acronyms (ACs)" as the PDF instead of "ACs".