title: mailto: Email link in PDF renders incorrect link in mail application

text: Package:               \ProvidesFile{jobapp}     \special{papersize=8.5in,11in}          %----------------------------------------------     %   Dependencies      %----------------------------------------------     \usepackage{array}     \usepackage{xcolor}     \usepackage[margin=1.5cm,top=50pt]{geometry}     \usepackage{parskip}     \usepackage{setspace}     \usepackage{tgpagella} % TG Pagella font     \usepackage{textcomp} % Needed for pagella font bullet points     \usepackage[T1]{fontenc}     %\usepackage[sc]{mathpazo}     %\usepackage{lmodern}     %\usepackage[urw-garamond]{mathdesign}     \usepackage{titlesec}     \usepackage{enumitem}     \usepackage{ifthen}     \usepackage[hidelinks]{hyperref}     \usepackage{fancyhdr}     \usepackage{xparse}     %----------------------------------------------     %   Debugging utilities (uncomment to enable)     %----------------------------------------------     %\overfullrule=1mm % Show overfull hboxes     %\usepackage{layout} % Insert graphic of page layout using \layout in body          %----------------------------------------------     %   Custom things     %----------------------------------------------     \definecolor{lightgray}{gray}{0.8}     \newcommand\VRule{\color{lightgray}\vrule width 1pt}     \newcommand\HRule{\color{lightgray}\hrule height 0.4pt}      \newcolumntype{L}{>{\raggedleft}p{0.11\textwidth}}     \newcolumntype{R}{p{0.83\textwidth}}          \makeatletter     \newcommand{\DoIfNoText}[1]{% Thanks to http://tex.stackexchange.com/a/44938       \begingroup       \sbox0{#1}%       \ifdim\wd0=\z@         \endgroup         \expandafter\@gobble       \else         \endgroup         \expandafter\@firstofone       \fi}     \makeatother          %----------------------------------------------     %   Document Variables     %----------------------------------------------     \newcommand\Name{}     \newcommand\Address{}     \newcommand\Phone{}     \newcommand\Email{}     \newcommand\Company{}     \newcommand\CompanyAddress{}     \newcommand\Encl{}     \newcommand\Skype{}     %----------------------------------------------     %   Setters     %----------------------------------------------     \newcommand{\SetName}[1]{\renewcommand{\Name}{#1}}     \newcommand{\SetAddress}[1]{\renewcommand{\Address}{#1}}     \newcommand{\SetPhone}[1]{\renewcommand{\Phone}{#1}}     \newcommand{\SetEmail}[1]{\renewcommand{\Email}{#1}}     \newcommand{\SetSkype}[1]{\renewcommand{\Skype}{#1}}          \newcommand{\OptionalCompany}[1]{%       \DoIfNoText{#1}         {\renewcommand{\Company}{\ignorespaces#1}}%       }          \newcommand{\OptionalCompanyAddress}[1]{%       \DoIfNoText{#1}         {\renewcommand{\CompanyAddress}{\ignorespaces#1}}%       }          \newcommand{\OptionalEncl}[1]{%       \DoIfNoText{#1}         {\renewcommand{\Encl}{\ignorespaces#1}}%       }          %----------------------------------------------     %   Helpers \href{mailto:e.xmaple@example.com}{\nolinkurl{e.xmaple@example.com}}     %----------------------------------------------     \newcommand{\emailhref}{\href{mailto:\Email}{\Email}}     \newcommand{\contactblock}{\Address \\ \Phone \\ \emailhref \\ \Skype}     \newcommand{\first}{1\textsuperscript{st}}     \newcommand{\second}{2\textsuperscript{nd}}     \newcommand{\third}{3\textsuperscript{rd}}     \newcommand{\nth}[1]{#1\textsuperscript{th}}          %----------------------------------------------     %   Page customizations     %----------------------------------------------     \pagestyle{fancy}     \setlength{\headheight}{56pt}     \setlength{\headsep}{32pt}     \setlength{\textheight}{668pt}     \setlength{\footskip}{10pt}     \setlength{\parskip}{10pt}     \renewcommand{\arraystretch}{1.2}     \renewcommand{\headrule}{\vspace{5pt}\HRule}     \renewcommand{\footrule}{}     \titleformat*{\section}{\bfseries\Large\uppercase}     \titlespacing{\section}       {0pt} % left       {5pt} % before       {-2pt} % after       [0pt] % right          %----------------------------------------------     %   Header & footer definitions     %----------------------------------------------          %% Header Left - Show large name on first page     \fancyhead[LH]{%        \ifthenelse{\value{page}=1}{%         \raisebox{0.5\height}{\Huge\scshape{\Name}}%       }{}     }          %% Header Right - Show contact info on first page; name otherwise.     \fancyhead[RH]{%        \ifthenelse{\value{page}=1}{%         \contactblock%       }{%         \Large\scshape{\Name}%       }     }          %% Footer - Empty Footer     \fancyfoot[CF]{}          %----------------------------------------------     %   Macros & other     %----------------------------------------------          %% Table style used by resume including vertical divider     \newenvironment{CvTable}       {\begin{tabular}{L!{\VRule}R}}       {\end{tabular}}          %% Formats resume item blocks     \NewDocumentEnvironment       {CvBlockEnv}       {m >{\SplitArgument{1}{\\}} m}       {%         \begin{CvTable} %           #1 & \CvBlockSplitTitle#2 % Set year/title/subtitle       }{%         \end{CvTable} % End block detail       }          %% Splits the second argument to CvBlockEnv into Title & Subtitle     \def\CvBlockSplitTitle#1#2{%       \parbox[t]{0.8\textwidth}{\textbf{#1}%         \IfValueTF {#2} { \\ \textit{#2} } { }%       }     }          %% Create compact itemize     \newenvironment{citemize}       { \vspace{0.2em}\begin{itemize}[leftmargin=12pt, itemsep=0.2em] }       { \vspace{-1em}\end{itemize} }          %----------------------------------------------     %   Cover Letter     %----------------------------------------------     \newenvironment{CoverLetter}       {%         \today \par \vspace{20pt}%         \DoIfNoText{\CompanyAddress} {%           \DoIfNoText{\Company}%             {\Company \\}           \CompanyAddress \par \vspace{30pt}         }       }       {         \par          %\vspace{0pt}%         \Name{} \par \vspace{10pt}%         \DoIfNoText{\Encl} {\par\noindent\textbf{Encl:}~\Encl{}}%       }      **MWE** :               \documentclass[10pt]{article}         \usepackage{jobapp}         \usepackage{amsmath}%symbols         \usepackage{fontawesome} % add skype, FB and Gtalk symbol :)         \providecommand\faSkype{{\FA\symbol{"F17E}}} % add skype symbol.         \usepackage[export]{adjustbox} % left align the figure         \usepackage{graphicx}%graphicx package         \usepackage{lipsum} % Used only for this example.          %----------------------------------------------     %   Document information     %----------------------------------------------     \usepackage{color,hyperref}     \definecolor{darkblue}{rgb}{0.0,0.0,0.3}%0.0,0.0,0.3     \hypersetup{colorlinks,breaklinks,                 linkcolor=darkblue,urlcolor=darkblue,                 anchorcolor=darkblue,citecolor=darkblue}     %------------------------------------------------------------     \usepackage{fontspec} % use package for cambria font     \setmainfont{Cambria} %set font          %------------------------------------------------------------     \SetName{First Last}     \SetEmail{\faEnvelope{}~example@email.com} % email address          %----------------------------------------------     %   Document     %----------------------------------------------     \begin{document}          \end{document}      **MWE OUTPUT:** This is the email Link I get when I get on it from the compiled PDF. Why does it show like this. It was working fine. ![MWE Output](http://i.stack.imgur.com/0CmX2.png)


title: Bracing fraction numerator or denominator to the left or right

text: I have a fraction with further fractions in both the numerator and denominator. I wish to label the fractions in the numerator and denominator with braces to the right. I would like these braces to span the full height of the fractions but I would not like them to extend the fraction line any further. I have tried `\frac{a}{\left.\frac{b}{c}\right}}` which achieves the former but not the latter and I have tried `\frac{a}{\frac{b}{c}\mathrlap{\\}}}` which achieves the latter but not the former, since I can't put one half of the `\left` `\right` pair inside `\mathrlap` and the other half outside.


title: create table with only header bold and center

text: How to create a table using latex - only it's 1st row bold and center and others are left side and normal.               \begin{table}               \renewcommand{\arraystretch}{1.5}               \caption[m1]{ m2}               \label{Hardware}\centering          \begin{tabular}{|c|c|c|c|}          \hline          a & b & c & d  \\ \hline          a  & b  & c & d\\ \hline          a & b & c & d \\ \hline          \end{tabular}          \end{table}


title: Simple Beamer Template for Total Beginners

text: Is there a template that allows me to create slides with only some simple formulas at most?


title: How to tile pages in LaTeX

text: When a `pdf` is generated through `LaTeX`, the pages will be displayed one on top of the other. These pages may be normally oriented or rotated (through e.g. `pdfpageattr`). What I want to know is how we could compile the `pdf` such that pages `1` and `2` are side by side; then underneath these two pages we have pages `3` and `4` side by size. So instead of the progression down the document being `1 -> 2 -> 3 -> 4`, we have `1 , 2` next to each other followed by `3, 4` next to each other and so on.


title: Custom ToC — Put vspace only below chapters that have sections in them

text: I’m using the `titletoc` package in the `book` class. Currently, my chapter entries are configured like this (I left out the unimportant parameters for simplicity):               \titlecontents{chapter}[0pc]     {\addvspace{1pc}}     {}     {}     {}     [\addvspace{4pt}]      Look at that `4pt` space below the chapter entry. I want to change this such that this `4pt` space does _not_ appear when there are no sections in the chapter. It should only appear for chapters with sections. How do I accomplish this?


title: For stacked bar chart, how to render zero height bars as invisible?

text: I am creating a stacked bar chart using the nifty `pgfplots` package. It turns out that many of my data values are zero -- only a few columns have nonzero entries in a given layer. Using the `ybar stacked` plot style, data values that are zero are rendered as a visible line (particularly noticeable for `thick` lines). For example here is an MWE and its output:               % arara: pdflatex     \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}       \begin{axis}[ybar stacked, thick]         \addplot+ coordinates {(1,3) (2,0) (3,0)};         \addplot+ coordinates {(1,0) (2,5) (3,0)};         \addplot+ coordinates {(1,0) (2,0) (3,3)};         \addplot+ coordinates {(1,0) (2,0) (3,1)};       \end{axis}     \end{tikzpicture}     \end{document}      Notice the blue lines at the bottoms of columns 2 and 3: ![enter image description here](http://i.stack.imgur.com/Z0bKz.png) Is there any way to have `pgfplots` render these zero values as invisible (i.e., not at all)? For the example, this would mean that the blue lines at the bottoms of columns 2 and 3 would disappear.


title: Set layout for the first page of Chapters in ConTeXt

text: When designing some documents, I hope I can set a global layout and another layout for the first page of all chapters. I have defined two layouts as follows:               \setuppagenumbering     [alternative=doublesided,      location=]          % global layout for the whole document     \setuplayout     [backspace=2.5cm,      width=16.5cm,      topspace=2cm,      height=25.2cm,      header=\lineheight,      headerdistance=\lineheight,      footer=0cm]          % layout for the first page of Chapters     \definelayout     [firstpage]     [height=26.2cm,      footerdistance=\lineheight,      footer=\lineheight]          \starttext     \chapter{First Chapter}     I am in the first page.     \page     I am in the second page.     \stoptext      Now the question is that how I can apply this `firstpage` layout to the first page of the chapter `First Chapter` and switch back to the `global layout` after the first page of this chapter?


title: How do I skip a level with tikz-qtree?

text: I'm trying to draw a tree, but I can't get it to skip one level. This is my code.               \documentclass[border=1cm]{standalone}     \usepackage{tikz-qtree}     \begin{document}     \begin{tikzpicture}         [every tree node/.style={draw,circle},        level distance=1.25cm,sibling distance=1cm,         edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}]     \Tree [.\node {};          \edge node[auto=right] {1};         [.\node{};           \edge node[auto=right] {1};             [.\node{};           \edge node[auto=right] {1};           [.\node{apple};]           \edge node[auto=left] {0};           [.\node {pear}; ]           ]           \edge node[auto=left] {0};             [.\node{};           \edge node[auto=right] {1};           [.\node{bike};]           \edge node[auto=left] {0};           [.\node {car}; ]           ]         ]         \edge node[auto=left] {I WANT THIS EDGE TO GO STRAIGHT TO};             [            \edge node[auto=right] {};             [.\node{HERE};           \edge node[auto=right] {1};           [.\node{walk};]           \edge node[auto=left] {0};           [.\node {run}; ]  ]   ]         ]     \end{tikzpicture}     \end{document}      Here is the image the code produces. ![enter image description here](http://i.stack.imgur.com/mZiQx.png)


title: using standalone with algorithmicx or algorithm2e

text: I am trying to compile a `standalone` file containing pseudocode created with the `algorithmicx` package. According to algorithmicx crashes standalone it should work with the `preview` option set for standalone, however it does not. Also the mentioned `vbox` hack does not work. What am I doing wrong? The first compiler error:               ! Extra }, or forgotten \endgroup.     \@endfloatbox ...pagefalse \outer@nobreak \egroup                                                        \color@endbox     l.13 \end{algorithm}      The (generic) pseudocode file:               \documentclass[preview]{standalone}     \usepackage{algorithm}     \usepackage{algpseudocode}          \begin{document}     \vbox{     \begin{algorithm}       \caption{Euclid’s algorithm}\label{euclid}       \begin{algorithmic}[1]         \State $r\gets a\bmod b$       \end{algorithmic}     \end{algorithm}     }     \end{document}      Thank you for your help. Sven * * * UPDATE: Using the `algorithm2e` package (as suggested by David Carlisle) and not using the `vbox` lets the pseudocode file compile without errors. When I use `\KwIn{foo}` it breaks again. This in turn is fixed by using `\usepackage[varwidth]{standalone}`. The pseudocode file compiles without errors. However now when I try to include the pseudocode file in my main file, I get the following compilation error in the `algorithm2e.sty` when compiling the main file:               ! Undefined control sequence.     <argument> \SetAlgoLined           l.1177 ...etcount,titlenotnumbered,lined,shortend}                                                       %      The new pseudocode file (without `~\\\` there is no line break after `\KwIn{foo}`):               \documentclass[varwidth]{standalone}     \usepackage[utf8]{inputenc}     \usepackage{algorithm2e}          \begin{document}     \begin{algorithm}       ~\\       \KwIn{foo}       $r\gets a\bmod b$\;       \end{algorithm}     \end{document}      The main file where pseudocode is included:               \documentclass[a4paper,10pt]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[subpreambles]{standalone}          \begin{document}     \include{pseudocode}     \end{document}


title: Avoid stanza indentation in eledpar

text: I'm typesetting epic verse in parallel text format, i.e. with the original langugage on one page and the translation on the facing page. Having played around with a number of parallel packages, it transpires that the `eledpar` and `eledmac` packages are good for doing this. However, the implementation isn't entirely perfect for my purposes. Firstly, the `eledpar` package needs you to pre-determine the indentation _every line in the verse_ with the `\setstanzaindents` macro. Whilst you can pass more arguments to this macro than there are lines in your verse, this ends up looking ridiculous, especially since I want no indentation on my verse at all. I have experimented with the `\setcounter{stanzaindentrepetition}{9999}` macro and so forth, to no avail. Really my question is: Is there a simple way in which I can suppress all the indentation in the `astanza` environment, whilst retaining the main useful feature of the `eledpar` package (i.e. facing page parallel texts)? **MWE:** * * *               \documentclass[10pt,a4paper]{memoir}          \usepackage{eledmac,eledpar}          \begin{document}          \setstanzaindents{0,0,0,0,0,0,0,0,0,0,0}          \begin{pages}          \begin{Leftside}          \firstlinenum{2}     \linenumincrement{1}     \beginnumbering          \begin{astanza}     First in first stanza &     Second in first stanza &     Second in first stanza &     Third in first stanza &     Fourth in first stanza &          First in second stanza &     Second in second stanza &     Second in second stanza &     Third in second stanza &     Fourth in second stanza \&     \end{astanza}          \endnumbering     \end{Leftside}          \begin{Rightside}          \firstlinenum{2}     \linenumincrement{1}     \beginnumbering          \begin{astanza}     First in first stanza &     Second in first stanza &     Second in first stanza &     Third in first stanza &     Fourth in first stanza &          First in second stanza &     Second in second stanza &     Second in second stanza &     Third in second stanza &     Fourth in second stanza \&     \end{astanza}          \endnumbering     \end{Rightside}          \Pages     \end{pages}     \end{document}      * * * **EDIT:** I have played around with `\setstanzaindents{0}` and `\setcounter{stanzaindentrepetition}{1}` _ad infinitum_ and repeatedly obtain the infuriating response:               ! Missing number, treated as zero.     <to be read again>                        \sza@1@     1.18 \begin{astanza}      From the `eledpar` and `eledmac` documentation, this error occurs when stanza indentation is set incorrectly - it's trying to get the indentation length, but no such length has been set (or at least that's my interpretation).


title: No caption label using minted with caption and hyperref

text: I'm trying to use the `caption` and `hyperref` with the `listing` environment and the `minted` package. If you compile the MWE, the listing will only show a number but no name. hyperref inserts a link, however the target is not the listing. This warning is thrown:               name{listing.1} has been referenced but does not exist, replaced by a fixed one      Both problems are solved by not using the `caption` package. Setting `labelformat=default` fixes the disappearing listing label but no the issue with hyerref. MWE:               \documentclass{book}          \usepackage{hyperref}          \usepackage{caption}     \captionsetup{labelformat=simple}          \usepackage{minted}          \begin{document}     A reference to \ref{lst:sample}     \begin{listing}     \begin{minted}{c}     //code here     \end{minted}     \caption{A caption}     \label{lst:sample}     \end{listing}     \end{document}      end of .log:               *File List*         book.cls    2007/10/19 v1.4h Standard LaTeX document class         bk10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)     caption.sty    2009/10/09 v3.1k Customizing captions (AR)     caption3.sty    2009/10/09 v3.1k caption3 kernel (AR)     keyval.sty    1999/03/16 v1.13 key=value parser (DPC)     hyperref.sty    2009/10/09 v6.79a Hypertext links for LaTeX     ifpdf.sty    2009/04/10 v2.0 Provides the ifpdf switch (HO)     ifvtex.sty    2008/11/04 v1.4 Switches for detecting VTeX and its modes (HO)     ifxetex.sty    2009/01/23 v0.5 Provides ifxetex conditional     hycolor.sty    2009/10/02 v1.5 Code for color options of hyperref/bookmark (HO     )     xcolor-patch.sty    2009/10/02 xcolor patch     pd1enc.def    2009/10/09 v6.79a Hyperref: PDFDocEncoding definition (HO)     etexcmds.sty    2007/12/12 v1.2 Prefix for e-TeX command names (HO)     infwarerr.sty    2007/09/09 v1.2 Providing info/warning/message (HO)     hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive     kvoptions.sty    2009/08/13 v3.4 Keyval support for LaTeX options (HO)     kvsetkeys.sty    2009/07/30 v1.5 Key value parser with default handler support      (HO)         url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.     bitset.sty    2007/09/28 v1.0 Data type bit set (HO)     intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)     bigintcalc.sty    2007/11/11 v1.1 Expandable big integer calculations (HO)     pdftexcmds.sty    2009/09/23 v0.6 LuaTeX support for pdfTeX utility functions (     HO)     ifluatex.sty    2009/04/17 v1.2 Provides the ifluatex switch (HO)     ltxcmds.sty    2009/08/05 v1.0 Some LaTeX kernel commands for general use (HO)          atbegshi.sty    2008/07/31 v1.9 At begin shipout hook (HO)     hpdftex.def    2009/10/09 v6.79a Hyperref driver for pdfTeX     minted.sty    2013/08/21 v2.0-alpha2      fancyvrb.sty    2008/02/07     float.sty    2001/11/08 v1.3d Float enhancements (AL)     ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)         calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)     ifplatform.sty    2009/09/10 v0.3a Testing for the operating system     catchfile.sty    2007/11/11 v1.2 Catches the contents of a file (HO)         test.w18     etoolbox.sty    2009/08/06 v1.8 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)     xstring.sty    2009/06/05 v1.5c String manipulations (C Tellechea)         test.pyg     nameref.sty    2007/05/29 v2.31 Cross-referencing by name of section     refcount.sty    2008/08/11 v3.1 Data extraction from references (HO)         test.out         test.out     xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)     color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive     pdftex.def    2010/03/12 v0.04p Graphics/color for pdfTeX     supp-pdf.mkii         test.out.pyg     ***********          )      Here is how much of TeX's memory you used:     6849 strings out of 493848     104237 string characters out of 1152824     183207 words of memory out of 3000000     10051 multiletter control sequences out of 15000+50000     4329 words of font info for 17 fonts, out of 3000000 for 9000     714 hyphenation exceptions out of 8191     38i,7n,38p,790b,431s stack positions out of 5000i,500n,10000p,200000b,50000s     pdfTeX warning (dest): name{listing.1} has been referenced but does not exist     , replaced by a fixed one          </usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmitt10.pfb></usr/shar     e/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr10.pfb>     Output written on test.pdf (1 page, 18041 bytes).     PDF statistics:     21 PDF objects out of 1000 (max. 8388607)     3 named destinations out of 1000 (max. 500000)     1 words of extra memory for PDF output out of 10000 (max. 10000000)


title: conditional loop printing text and icon

text: I'm new in the Latex world. I'm writing a little guide and I've choose Latex, in particular Texmaker for writing it. I'm trying to do a loop for printing some instruction as File -> Save as -> Ok. this is my code preamble:               \usepackage{graphicx}     \usepackage{tikz}     \usepackage{ifthen}          \newcommand*{\Iconmenu}[1]{\includegraphics[scale=0.4]{#1}}%     \newcommand*{\UnrollMenu}[2]{%         \foreach \x in {#2} {%             \ifthenelse{\x\equal{#1}{true}}{%                 $\x\Iconmenu{#1}\boldsymbol{\rightarrow}$}%                  {%             $\x$}%     }}%      and this is the call in the document:               \UnrollMenu{appearance}{Appearance,Themes}      appearance is an icon in jpg format I'd like to print it in this way: Appearance ![appearance.jpg](http://i.stack.imgur.com/avvWy.jpg) -> Themes but I can't figure out, someone could give a hint?


title: Test if two things typeset identical results

text: I want to test if two somewhat arbitrary things typeset as exactly the same thing. For example I would like the test to tell me that `abc` is different from `xyz`, but is the same as `\def\bar{abc}\bar`. A poorly designed test and MWE is               \documentclass{article}     \makeatletter     \newsavebox{\@tempboxb}     \newcommand{\iftypesetsame}[4]{\begingroup%         \savebox{\@tempboxa}{#1}%         \savebox{\@tempboxb}{#2}%         \ifdim\ht\@tempboxa=\ht\@tempboxb%             \ifdim\dp\@tempboxa=\dp\@tempboxb%                 \ifdim\wd\@tempboxa=\wd\@tempboxb%                     #3%                 \else%                     #4%                 \fi%             \else%                 #4%             \fi%         \else%             #4%         \fi%     \endgroup}     \makeatother     \begin{document}     \iftypesetsame{abc}{abc}{same}{different}          \iftypesetsame{abc}{bcd}{same}{different}          \newcommand{\foo}{\begingroup\def\bar{abc}\bar\endgroup}     \iftypesetsame{abc}{\foo}{same}{different}          \iftypesetsame{xyz}{zyx}{same}{different} % Test gets it wrong          \iftypesetsame{a\vspace{1in}\par b}{ab}{same}{different} % Test gets it wrong     \end{document}      which tests based on the height, width and depth of the box. This is obviously not very robust because two very different things (e.g., `xyz` and `zyx`) can have the same width, height, and depth. It also doesn't handle arbitrary inputs (e.g., `\par` and `\vspace`}. While I would like a perfect LaTeX solution, I would be interested in tests that fail less frequently of even LuaTeX based solutions


title: Circuit Node with Text near Input and Output

text: I'd like to draw a user defined a simple node shape in combination with the circuit library. The node has one input and one output. I'd like to put text _inside_ the node shape near the input and output. I couldn't find an example in the TikZ manual that describes how to put text inside the node shapes (except for the info label). There are two problems.   * The circuit library fills the node and this overwrites the text. I managed to turn that off with a style. I'm not sure if this is the best thing to do.   * I can't figure out how to position the text. It always ends up in the centre of the node shape. The following is what I've got:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{circuits.logic.CDH}     \tikzset{circuit logic CDH}     \usetikzlibrary{shapes.misc}     \makeatletter     \pgfdeclareshape{myshapeshape} {       \inheritsavedanchors[from=rectangle]        \inheritanchorborder[from=rectangle]       \inheritanchor[from=rectangle]{north}       \inheritanchor[from=rectangle]{north west}       \inheritanchor[from=rectangle]{north east}       \inheritanchor[from=rectangle]{center}       \inheritanchor[from=rectangle]{west}       \inheritanchor[from=rectangle]{east}       \inheritanchor[from=rectangle]{mid}       \inheritanchor[from=rectangle]{mid west}       \inheritanchor[from=rectangle]{mid east}       \inheritanchor[from=rectangle]{base}       \inheritanchor[from=rectangle]{base west}       \inheritanchor[from=rectangle]{base east}       \inheritanchor[from=rectangle]{south}       \inheritanchor[from=rectangle]{south west}       \inheritanchor[from=rectangle]{south east}       \inheritbackgroundpath[from=rectangle]       \anchor{1}{         \pgf@process{\northeast}%         \pgf@xa=\pgf@x%         \pgf@process{\southwest}%         \advance\pgf@x by \pgf@xa%         \pgf@x=0.5\pgf@x%       }       \anchor{2}{         \pgf@process{\southwest}%         \pgf@xa=\pgf@x%         \pgf@process{\northeast}%         \advance\pgf@x by \pgf@xa%         \pgf@x=0.5\pgf@x%       }       % attempt to put in text.       \beforebackgroundpath{%           \pgf@process{\northeast}%           \pgf@xa=\pgf@x%           \pgf@process{\southwest}%           \advance\pgf@x by \pgf@xa%           \pgf@x=0.5\pgf@x%           \pgftext{\textsc{1}}       }%     }     \tikzset{circuit declare symbol=myshapeg,              set myshapeg graphic={draw,                                   fill=none,                                   shape=myshapeshape,%                                   minimum width=10mm,                                   minimum height=20mm}}     \tikzset{myshape/.style={myshapeg,info=center:{#1}},              myshape/.default={null}}     \makeatother          \begin{document}          \begin{tikzpicture}     \draw (0,0) node(inout)[myshape=text] {}           (inout.1) -- + (0,-1)           (inout.2) -- + (0,1)     ;     \end{tikzpicture}          \end{document}      ![example of node shape](http://i.stack.imgur.com/9pgHU.png) Any help much appreciated.


title: Testing if inside \halign

text: I am trying to write a macro that has a different behavior when called from text mode, math mode, display math, and math tables. The first three are easy enough with `\ifmmode` and `\mathchoice`. But the last one is a bit more complicated as I have to test for various LaTeX- and AMS-environments: `array`, `array*`, `gather`, `align` etc. However, as all those environments are implemented as variants of `\halign`, the cleanest way would be to check if the macro is called from within a `\halign`. Hence my question: is there a way to test if a macro is called from `\halign` ? (this is a user-level macro that will very probably never be called from inside `\noalign`, so no need to put an extra test for this case). **Edit** : I found a quasi-answer to this, by which I mean that it works in all the above AMS environments but not in a plain `\halign`. Namely, in plain math, `\math@cr@@@` is a macro expanding to `\cr`, but it is changed in the aligned environments. So I only have to do something like               \def\plain@cr{\cr}     \ifx\math@cr@@@\plain@cr ... \else ... \fi


title: xelatex and asian writing

text: I just managed to change font (thanks!) but now I have a problem... The text, once written in traditional asian form (top to bottom, right to left on pdflatex) is now normal. So my question now is - can I have both? Changed font and traditional asian writing layout?


title: Font of equations globally

text: I have the problem, that I write in sans serif and I don't want any serif fonts in my equations. I used the font tgadventor. So, now I had to set every character in"\text{}" environment in my equations. Not good. So I changed to a mathfont, "arev". Problem: I don't get the sans serif output in equations like demonstrated on the webpage http://www.tug.dk/FontCatalogue/arev/. Following code:                \documentclass[10pt,a4paper]{scrbook}      \usepackage[latin1]{inputenc}     \renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif     \usepackage{arev}                                                   %%sans serif with math support     \usepackage[T1]{fontenc}      \usepackage[english]{babel}     \usepackage{amsmath}      \usepackage{subfigure}      \usepackage[onehalfspacing]{setspace}      \usepackage{placeins}      \usepackage{caption}      \usepackage{floatflt}      \usepackage{wrapfig}      \usepackage{fancyhdr}      \usepackage{booktabs}      \usepackage{color}      \usepackage{multirow}      \usepackage{geometry}      \usepackage[nottoc]{tocbibind}      \usepackage{appendix}      \usepackage{color}      \usepackage{paralist}      %\usepackage{flafter}      \usepackage{ifthen}      \usepackage{mathptmx}      \usepackage{upgreek}     \usepackage{enumitem}      \usepackage{rotating}     \usepackage{floatrow}     \usepackage[table]{xcolor}     \usepackage{CJK}     \usepackage[margin=10pt,format=plain,textfont=small,labelfont=bf,labelformat=simple,labelsep=endash]{caption}                     \begin{document}          test \\     $tees$ \\     \begin{equation}     test     \label{eq:test}     \end{equation}          % ------------------------------------------------------------------------     \end{document}     % ------------------------------------------------------------------------      How can I get my global sans serif font?


title: pgfGantt open box and axis change

text: I have a question about the pgfGantt package. I would like to create a chart with an x-axis for the timeline at the bottom and a y-axis on the left side for the resources both with arrows at the ends. So I would like to avoid the box style which is used by the package and to move the timeline from the top to the bottom of the chart. Do I overlooked some package options or can the above be achieved with some slight changes to the implementation? I would like to avoid to switch to another package or to create the charts on my own with tikz, because the other functionality is really nice.


title: mtpro2 curly braces as default

text: is it possible to set mtpro2 curly braces as default as given below? when i write `\left\\{...\right\\}` it should give the first result. ![enter image description here](http://i.stack.imgur.com/OEDkn.png) ![enter image description here](http://i.stack.imgur.com/pdpqt.png) Code:               \documentclass[10pt,a4paper]{article}     \usepackage[utf8x]{inputenc}     \usepackage{ucs}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage[lite]{mtpro2}          \begin{document}          \begin{equation*}         \def\arraystretch{1.2}\LEFTRIGHT\lbrace.{\,              \begin{array}{rrr}                 1 & , & 1  \\                  2 & , & 2  \\                  3 & , &  3 \\                  5 & , &  4             \end{array}}%     \end{equation*}          \begin{equation*}             \LEFTRIGHT\lcbrace\rcbrace{\begin{array}{rrr}                     1 & , & 1  \\                      2 & , & 2  \\                      3 & , & 3  \\                      5 & , & 4                  \end{array}}     \end{equation*}     as default.          \begin{eqnarray*}     &&\left\{      \begin{array}{rrr}     1 & , & 1  \\      2 & , & 2  \\      3 & , & 3  \\      5 & , & 4      \end{array}%     \right.  \\     &&     \left\{      \begin{array}{rrr}     1 & , & 1  \\      2 & , & 2  \\      3 & , & 3  \\      5 & , & 4      \end{array}%     \right\}      \end{eqnarray*}     change this.          \end{document}


title: Unordered layers in tikz-3dplot (3d effect)

text: ## Short formulation of the question Is there a way to order layers in tikz-3dplot according to their distance to the observer's position? The picture should look realistic in order to give some intuition to the reader. But I prefer a solution without rearranging all items of the graphic. ## Example The following working example does not show the correct 3D view, i.e. the balls are wrong ordered in the second picture:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{tikz}     \usepackage{tikz-3dplot}          \begin{document}          \begin{tikzpicture}      \node[fill=red,circle] (c1) at (0,0,0) {};      \node[fill=gray,circle] (c2) at (1,0,0) {};      \node[fill=blue,circle] (c3) at (1,0,1) {};      \node[fill=green,circle] (c4) at (0,0,1) {};      \node[fill=black,circle] (c5) at (0,1,0) {};      \node[fill=orange,circle] (c6) at (1,1,0) {};      \node[fill=yellow,circle] (c7) at (1,1,1) {};      \node[fill=magenta,circle] (c8) at (0,1,1) {};      \draw[line width=2pt] (c1) -- (c2) -- (c3) -- (c4) -- (c1);      \draw[line width=2pt] (c5) -- (c6) -- (c7) -- (c8) -- (c5);      \draw[line width=2pt] (c1) -- (c5);      \draw[line width=2pt] (c2) -- (c6);      \draw[line width=2pt] (c3) -- (c7);      \draw[line width=2pt] (c4) -- (c8);     \end{tikzpicture}          \tdplotsetmaincoords{45}{0}     \begin{tikzpicture}[tdplot_main_coords]      \node[fill=red,circle] (c1) at (0,0,0) {};      \node[fill=gray,circle] (c2) at (1,0,0) {};      \node[fill=blue,circle] (c3) at (1,0,1) {};      \node[fill=green,circle] (c4) at (0,0,1) {};      \node[fill=black,circle] (c5) at (0,1,0) {};      \node[fill=orange,circle] (c6) at (1,1,0) {};      \node[fill=yellow,circle] (c7) at (1,1,1) {};      \node[fill=magenta,circle] (c8) at (0,1,1)      \draw[line width=2pt] (c1) -- (c2) -- (c3) -- (c4) -- (c1);      \draw[line width=2pt] (c5) -- (c6) -- (c7) -- (c8) -- (c5);      \draw[line width=2pt] (c1) -- (c5);      \draw[line width=2pt] (c2) -- (c6);      \draw[line width=2pt] (c3) -- (c7);      \draw[line width=2pt] (c4) -- (c8);     \end{tikzpicture}          \tdplotsetmaincoords{54.7}{45}     \begin{tikzpicture}[tdplot_main_coords]      \node[fill=red,circle] (c1) at (0,0,0) {};      \node[fill=gray,circle] (c2) at (1,0,0) {};      \node[fill=blue,circle] (c3) at (1,0,1) {};      \node[fill=green,circle] (c4) at (0,0,1) {};      \node[fill=black,circle] (c5) at (0,1,0) {};      \node[fill=orange,circle] (c6) at (1,1,0) {};      \node[fill=yellow,circle] (c7) at (1,1,1) {};      \node[fill=magenta,circle] (c8) at (0,1,1) {};      \draw[line width=2pt] (c1) -- (c2) -- (c3) -- (c4) -- (c1);      \draw[line width=2pt] (c5) -- (c6) -- (c7) -- (c8) -- (c5);      \draw[line width=2pt] (c1) -- (c5);      \draw[line width=2pt] (c2) -- (c6);      \draw[line width=2pt] (c3) -- (c7);      \draw[line width=2pt] (c4) -- (c8);     \end{tikzpicture}          \end{document}      ## Further outlook Maybe it is crucial to note that I want to use different view angles (feature of `[tikz-3dplot][1]`) without ordering the entire crystal with respect to the appearing layers.


title: Is it possible to customize the \textcite command in biblatex?

text: Today i am constructing a project template in latex. So far i have succeeded in building up the biblatex environment (with some help from some guys of this forum as well ^^). Now i have moved on to the citations. Now, when i use the `\textcite{key}` command, in the document it displays as `Author1 et al. [refNumber]`. The unfortunate thing is, that i have some guidelines for my project, and the display convention will be:               It has been previously shown that biblatex is superior to bibtex (cf. Author1 et al. [refNumber]).      As for now, what i am typing is the following `(cf. \textcite{key})`. Now, my question is: Is there a way to customize the \textcite command in such a way that, when typing `textcite{key}`, that it directly generates my desired format? Best regards


title: Once citation in combination with bibtex

text: I use Bibtex for my bibliography, but I am concerned about the file growing to large to be maintainable. In particular, a considerable amount of my citations occur only once in a project, and I do not want to place in the Bib-tex file just because of just a few lines that put sugar to my thesis. Can I combine Bibtex with "once-citation", such that the following might be possible:               A few more funny jokes can be found in     \citeonce{EHG50}{type="article", author="Einstein, Grothendieck, Hilbert", title="Really good jokes!" },     which we higly recommend for further references to the topic.      such that the citation is placed in the bibliography. If something similar is achievable, I'll appreciate it as well.


title: How to make size tailored label with envlab?

text: According to the package guide I should be able to declare label sizes in the preamble of the document like in this example:               \documentclass[12]{letter}          \usepackage{envlab}          \SetLabel{63mm, 46mm, 10mm, 8mm, 3mm, 3, 6}     \begin{document}     \startlabels     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }     \mlabel{}{%         givenname surname \\         Address line \\         postalcode \\         Country     }        \end{document}      However when I do that I get:               ! LaTeX Error: Missing \begin{document}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.12 }      and if I move the `\SetLabel` to after `\begin{document}` I get:               ! Missing number, treated as zero.     <to be read again>                         \par      l.13 \mlabel{}                   {%      What have I missed? What am I doing wrong?


title: Using natbib package, in the References section, the header is now written in capitals

text: I have a thesis written in LaTeX. I've just switched over to `natbib` as it offered some nice commands but I'm starting to run into some trouble. This one is minor I guess, but I have headers, with the chapter name and page number on. They are implemented in the `.cls` file like so:               \def \@oddhead{\normalfont \rmfamily \slshape \hfill \leftmark \hfill \thepage}% writes chapter (not sec) at top.      for a normal page, and               \def \ps@chapHeadings{\def \@oddhead{\hfill \textit{\thepage}}}      for a new chapter page. Now the reference pages have the headings written all capitals. I don't like this as it's inconsistent with the way the rest of the thesis is done. Does any one know how to sort it?


title: How can I put page numbers or headers inside my handouts (handoutWithNotes)?

text: I've been trying to obtain some stylized handouts using `beamer` with `handoutWithNotes` by Guido. What I have now is the 4 framed handouts purely but I'd like to put the page number on the bottom of the handout page and kind of a header on the top. Here's some minimal example:               \documentclass[12pt,xcolor=pdftex,dvipsnames,handout]{beamer}     \usetheme{Darmstadt}            \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage[portuges,brazil]{babel}     \newcommand{\Autor}{Arthur Alvim}     \newcounter{countpag}     \setcounter{countpag}{0}     \title{Title}     \author{Author}     \date{\today}     %%%% Handouts     \usepackage{pgfpages}     % \usepackage{handoutWithNotes}     \include{style4x}     \pgfpagesuselayout{4 on 1 with notes}[a4paper,border shrink=5mm]          \begin{document}     \begin{frame}[plain]       \titlepage     \end{frame}          \section{First section}     \subsection{First subsection}     \begin{frame}{First frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \begin{frame}{Second frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \subsection{Second subsection}     \begin{frame}{Third frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \begin{frame}{Fourth frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \section{Second section}     \subsection{First subsection}     \begin{frame}{First frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \begin{frame}{Second frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \subsection{Second subsection}     \begin{frame}{Third frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \begin{frame}{Fourth frame}         \begin{block}{First Block}             First Block         \end{block}         \begin{block}{Second Block}             Second Block         \end{block}         \begin{block}{Third Block}             Third Block         \end{block}     \end{frame}     \end{document}      This `\include{style4x}` is part of the code inside the package `handoutWithNotes` that I've extracted. Here it goes:                  \pgfpagesdeclarelayout{4 on 1 with notes}{            \edef\pgfpageoptionheight{\the\paperheight}            \edef\pgfpageoptionwidth{\the\paperwidth}            \edef\pgfpageoptionborder{0pt}        }        {        \pgfpagesphysicalpageoptions{%            logical pages=8,%            physical height=\pgfpageoptionheight,%            physical width=\pgfpageoptionwidth,%            %last logical shipout=3%            last logical shipout=4%        }        \pgfpageslogicalpageoptions{1}{%            scale=.70,            center=\pgfpoint{.25\pgfphysicalwidth}{.875\pgfphysicalheight}%        }%        \pgfpageslogicalpageoptions{2}{%            scale=.70,            center=\pgfpoint{.25\pgfphysicalwidth}{.625\pgfphysicalheight}%        }%        \pgfpageslogicalpageoptions{3}{%            scale=.70,            center=\pgfpoint{.25\pgfphysicalwidth}{.375\pgfphysicalheight}%        }%        \pgfpageslogicalpageoptions{4}{%            scale=.70,            center=\pgfpoint{.25\pgfphysicalwidth}{.125\pgfphysicalheight}%        }%        \pgfpageslogicalpageoptions{5}{%            border shrink=\pgfpageoptionborder,%            resized width=.5\pgfphysicalwidth,%            resized height=.3333\pgfphysicalheight,%            center=\pgfpoint{.75\pgfphysicalwidth}{.875\pgfphysicalheight},%            copy from=5        }%        \pgfpageslogicalpageoptions{6}{%            border shrink=\pgfpageoptionborder,%            resized width=.5\pgfphysicalwidth,%            resized height=.3333\pgfphysicalheight,%            center=\pgfpoint{.75\pgfphysicalwidth}{.625\pgfphysicalheight},%            copy from=6        }%        \pgfpageslogicalpageoptions{7}{%            border shrink=\pgfpageoptionborder,%            resized width=.5\pgfphysicalwidth,%            resized height=.3333\pgfphysicalheight,%            center=\pgfpoint{.75\pgfphysicalwidth}{.375\pgfphysicalheight},%            copy from=7        }%        \pgfpageslogicalpageoptions{8}{%            border shrink=\pgfpageoptionborder,%            resized width=.5\pgfphysicalwidth,%            resized height=.3333\pgfphysicalheight,%            center=\pgfpoint{.75\pgfphysicalwidth}{.125\pgfphysicalheight},%            copy from=8        }%        \AtBeginDocument{            \newbox\notesbox            \setbox\notesbox=\vbox{                \hsize=\paperwidth                \vskip-1in\hskip-1in\vbox{                    \color{black}{                        \vskip1cm                        Notes:\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth                    }                }            }            \newbox\notesboxInitial            \setbox\notesboxInitial=\vbox{                \hsize=\paperwidth                \vskip-1in\hskip-1in\vbox{                    \color{black}{                        \vskip1cm                        \centering{\Large{\textbf{\Autor => the rest do not appear \title - \author}}}                        \vskip1cm                        Notes:\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                    }                }            }            \newbox\notesboxFinal            \setbox\notesboxFinal=\vbox{                \hsize=\paperwidth                \vskip-1in\hskip-1in\vbox{                    \color{black}{                        \vskip1cm                        Notes:\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \hrule width\paperwidth\vskip1cm                        \thepage \hfill -> do not increment \stepcounter{countpag} Page\arabic{countpag}                     }                }            }          \pgfpagesshipoutlogicalpage{5}\copy\notesboxInitial          \pgfpagesshipoutlogicalpage{6}\copy\notesbox          \pgfpagesshipoutlogicalpage{7}\copy\notesbox          \pgfpagesshipoutlogicalpage{8}\copy\notesboxFinal        }     }      I've tried all these variables -> (`\thepage`, `\insertpagenumber`, `\insertframenumber`, `\insertpresentationendpage`, and created `countpag`) but in some way they don't change. I think its a problem with the scope of the variables I'm using. So guys, what can we do to make these variables increment?


title: Package keyval Error: pdfa undefined

text: I try to compile a friends project and get the following error message:               ! Package keyval Error: pdfa undefined.          See the keyval package documentation for explanation.     Type  H <return>  for immediate help.      ...          l.2238 \ProcessKeyvalOptions{Hyp}      In this project there is no line 2238 and the package `keyval` is not used either. Same project can be compiled on other machines. This happens when I use the package `jheppub`, so a minimal working example would be:               \documentclass{article}     \usepackage{jheppub}


title: Disable underlining in display math and resume afterwards

text: In my documents I have conditional text, which is underlined (in non-display math mode) to make it more obvious to the reader as to exactly which portions of text is conditional text. In display math mode, I don't attempt to underline things, but have separate markers to indicate the conditional text. This is the purpose of the `\ConditionalText` macro below, which is a greatly simplified version of my actual use case. So, I would like to be able to pass in text which _starts_ in text mode but may have display math mode in it, and   * have the underlining _skip_ the display math portion, and then    * resume after the display math.  The MWE below runs fine, but that is because the last `\ConditionalText` is commented, and that is the specific problem case. ## Note:   * The reason why I can _not_ simply apply `\ConditionalText` three times: once before the display math, then in the display math, and then outside the display math is illustrated in the full test case below with the setting              \def\ShowProblemSpacingIssue{}      I feel as if the _Full Text Case_ below may not be all that clear as I had intended, so that can be ignored for now -- only relevant if one is interested in why I can't just apply the `\ConditionalText` macro several times.   * One solution would be to manually adjust the spacing for the case when the text is being suppressed, but not only is that very error prone but also difficult to know how much space to adjust as there many be multiple display math environments, or `align` blocks composed of several lines of equations.   * Even though the MWE uses the `soul` package, I am not stuck on that, so a `\tikzmark` type of solution would be fine.   * Now that I have composed this question I feel as if this might be a classic x-y problem as I am really looking for a way to show conditional text which could be a few words, a few lines in the middle of a paragraph, be entire paragraphs possibly containing display math, or be portions of a display math equations, or even an entire display math environment. But the solution to this problem would require the least amount of change to my code, and hence am looking into this first. ## References:   * I am using the solution from Mark portions of text without affecting spacing to mark the indicators fo the conditional text.   * Changbars to indicate location of conditional text * * * ## Code: MWE               \documentclass{article}     \usepackage{xparse}% Not essential for this problem.     \usepackage{xcolor}     \usepackage{amsmath}% just for \text{}     \usepackage{soul}               \NewDocumentCommand{\UnderlineText}{O{red} m}{%         \setulcolor{#1}\ul{#2}%     }%          \NewDocumentCommand{\ConditionalText}{O{red} m}{%         \ifmmode%             #2% Don't underline if in math mode         \else%             \UnderlineText[#1]{#2}%         \fi%     }%               \begin{document}     \noindent\ConditionalText{Underlining in text mode works great.}          \noindent\ConditionalText{Underlining works with inline math: $e = mc^2.$}     %     \[         \ConditionalText{F = ma \quad\text{Properly skips underling in math mode}}     \]          \noindent     %\ConditionalText{%     The problem is here when there is display math mode     \[ e^{\pi i} = -1\]     in the same paragraph where I need the underlining to \emph{skip}     the display math portion.     %}%          \end{document}      ## Code: Full Test Case               % With the following commented, I should not need the     % \renewcommand that gets executed below.     \def\ShowProblemSpacingIssue{}%          \documentclass{article}     \usepackage{xparse}% Not essential for this problem.     \usepackage{xcolor}     \usepackage{etoolbox}     \usepackage{amsmath}% just for \text{}     \usepackage{soul}     \usepackage{parskip}     \usepackage{showframe}          \newtoggle{SupressConditionalText}     \ifdefined\ShowProblemSpacingIssue         \toggletrue{SupressConditionalText}     \else         \togglefalse{SupressConditionalText}% This requires last use of \ConditionalText to be commented     \fi          \NewDocumentCommand{\UnderlineText}{O{red} +m}{%         \setulcolor{#1}\ul{#2}%     }%          \NewDocumentCommand{\ConditionalText}{O{red} +m}{%         \ignorespaces%         \iftoggle{SupressConditionalText}{}{%             \ifmmode%                 #2% Don't underline if in math mode             \else%                 \UnderlineText[#1]{#2}%             \fi%         }%         \ignorespacesafterend%     }%               \begin{document}     \ConditionalText{Underlining in text mode works great.}          \ConditionalText{Underlining works with inline math: $e = mc^2.$}     %               Text before a conditional display math formula.     \[         \ConditionalText{F = ma \quad\text{Properly skips underling in math mode}}     \]     Text after a conditional display math formula.               The following works in terms of toggling the conditional text, but has a spacing issue due to the conditional text in the display math environment:     %     \ConditionalText{%     The problem is here when there is display math mode}%     \[ \ConditionalText{e^{\pi i} = -1} \]     \ConditionalText{%     in the same paragraph where I need the underling to \emph{skip}     the display math portion.     }%          \ifdefined\ShowProblemSpacingIssue     \else         % Want to be able to eliminate this \renewcommand,         % and use \ConditionalText as below.         \renewcommand{\ConditionalText}[2][red]{%{O{red} +m}{%             \iftoggle{SupressConditionalText}{}{%                 #2% Don't underline if in math mode             }%         }%     \fi          \ConditionalText{%     The problem is here when there is display math mode     \[ e^{\pi i} = -1\]     in the same paragraph where I need the underling to \emph{skip}     the display math portion.     }%          Some text at end of document to see placement.     Note the additional space above this with      \verb|\def\ShowProblemSpacingIssue{}|.     \end{document}


title: Help with multiple bibliographies in article class

text: I am writing a short thesis and there is a synopsis section as the first section. I wish the synopsis and thesis bibliographies to be separate and have two .bbl files. The first bibliography is at the end of the synopsis section and should take input from file1.bbl while the second bibliography should be at the end of the document and should use input from file2.bbl . Is there a quick way to do this ? There is a multibbl package but I am not sure if it works in the article class and I have already typed the entire thesis text with citations separately forgetting that I have to insert the synopsis section at the beginning. Thanks


title: Is it possible to pass options to mpost.exe using luamplib?

text: I would like to use the development version of metapost with luamplib. I've switched over the executable mpost.exe which is presumable called by luamplib somewhere along the line. Now, I would like to pass the option `\--math=double` to `mpost.exe` so that I can perform calculations on numbers larger than 4096. Is this possible and, if so, then how can it be done? I run Windows 7 and miktex 2.9 if it's relevant. Edit, the question above is based on a misunderstanding of how this worked, Khaled cleared that up in the first comment below: What I have done so far (thanks Khaled):   1. Downloaded the latest luatex from here   2. Replaced the binary in my miktex folder with the downloaded version (and updated formats and FNDB just in case).   3. Downloaded the mplib source from here and searched through the file `mplibapi.pdf`.   4. Found reference to `mp_math_double_mode` on page 7.   5. Looked through `luamplib.lua`, and inferred that options could be passed in the function * * *               function load()         local mpx = mplib.new {             find_file   = finder,             ini_version = true,             math_mode = mp_math_double_mode,<--edit here         }         mpx:execute(format("input %s ;", currentformat))         return mpx     end      * * * to which I added the indicated line. Still no luck.


title: How to create nomenclature using TeXnicCenter?

text: I have trouble executing the nomenclature. I saw many posts in the internet like Using package nomencl and List of symbols or abbreviations (nomenclature) but I am unable to do it. I would like to create a list of symbols to my report that I am writing. I am using Windows 7 and TeXnicCenter. I do not know what these sequences mean?               latex filename.tex     makeindex filename.nlo -s nomencl.ist -o filename.nls     latex filename.tex      Any help please? What should I do?


title: Repeat headings in list of tables for multiple pages

text: I am trying to add header for the list of tables in multiple pages, which is something like this. I want to repeat that "Table" and "Page" on every page of my list of tables as shown in the figure. I am using `tocloft` package for this. To generate header in the first page I'm using               \renewcommand{\cftafterlottitle}{%     \\[4em]\mbox{}\hspace{4pt}TABLE\hfill{\normalfont Page}\vskip\baselineskip}      Can anyone help me with this? Thank you               \documentclass[12pt]{report}     \usepackage[letterpaper]{geometry}     \geometry{verbose,tmargin=1.25in,bmargin=1.25in,lmargin=1.4in,rmargin=1.15in}     \usepackage[doublespacing]{setspace}     \usepackage{tocloft}     \usepackage[rm, tiny,center, compact]{titlesec}     \usepackage{tocvsec2}     \usepackage{caption}     \usepackage{graphicx}     \usepackage{layouts}     \usepackage{booktabs}     \setlength{\abovetopsep}{4pt}          \begin{document}          \renewcommand{\cftsecafterpnum}{\vskip0.5\baselineskip}     \renewcommand{\cftsubsecafterpnum}{\vskip0.5\baselineskip}     \renewcommand{\cftsubsubsecafterpnum}{\vskip0.5\baselineskip}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \addcontentsline{toc}{chapter}{TABLE OF CONTENTS}            \begin{singlespace}     \renewcommand\contentsname{\normalfont} {\centerline{TABLE OF CONTENTS}}          \setlength{\cftaftertoctitleskip}{1em}     \renewcommand{\cftaftertoctitle}{%     \hfill{\normalfont {Page}\par}}          \tableofcontents          \end{singlespace}     \pagebreak{}          \begingroup     \begin{center}     %LOT          \addcontentsline{toc}{chapter}{LIST OF TABLES}       \renewcommand{\cftlottitlefont}{\center\normalfont\MakeUppercase}     \setlength{\cftbeforelottitleskip}{-12pt}     \renewcommand{\cftafterlottitleskip}{12pt}          \renewcommand{\cftafterlottitle}{%     \\[4em]\mbox{}\hspace{4pt}TABLE\hfill{\normalfont Page}\vskip\baselineskip}          \begin{center}     \begin{singlespace}          \begin{spacing}{.2}     \setlength{\cftbeforechapskip}{0.4cm}     \setlength{\cftbeforesecskip}{0.30cm}     \setlength{\cftbeforesubsecskip}{0.30cm}     \setlength{\cftbeforefigskip}{0.4cm}     \setlength{\cftbeforetabskip}{0.5cm}          \listoftables           \end{spacing}     \end{singlespace}     \end{center}     \endgroup     \pagebreak{}          \chapter{\uppercase {Introduction}}           Sample text at the first page of the chapter. Sample tables follow below.          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}          \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}               \begin{table}     \caption{This is a long caption so that I will have to make make a fewer number of tables in this example}     \begin{tabular}{l c}      \toprule     Sample & Description \\     \midrule     Sample & Example \\     Sample & Example \\     \bottomrule     \end{tabular}     \end{table}           \end{document}      ![enter image description here](http://i.stack.imgur.com/gXdZ4.png)


title: Multiple choice questions type setting

text: ![enter image description here](http://i.stack.imgur.com/uaiQ7.jpg) See the fourth question: the choices are showing twice one is along horizontal and another is along vertical, but I need only one like the above three. The commands I have used is given below.               \documentclass{exam}     \usepackage{ifthen}     \usepackage{calc}     \renewcommand{\baselinestretch}{1.2}     \oddsidemargin 0in \evensidemargin 0in \topmargin 0in \textheight     9.2in \textwidth 6.5in     %\hoffset -1in     %\voffset -1in     %\evensidemargin 14pt     \usepackage{amsmath,amsthm,amsfonts,amssymb,dsfont}     \pagestyle{headandfoot} \extraheadheight{.5in} \lhead[]{}     \chead[ \vskip .1in  MATHEMATICS\\     STANDARD X(CBSE)\\           %\hrule         \textbf{PAIR OF LINEAR EQUATIONS IN TWO VARIABLES} \linebreak            \textbf{Time: 1 Hour}   \hskip 1.3in  \textsf{ }            \hfill{\textbf{Max. Marks:30}}\vskip.05in \vskip -.5in]{}     \rhead[]{} \lfoot{David 7502878908} \cfoot{HOME TUITIONS}     \rfoot{\iflastpage{$\maltese\maltese\maltese \maltese     \maltese$}{Continued...\ldots}} \pointsinrightmargin     \newcommand{\ntt}{\normalfont\ttfamily}     %    command name     \newcommand{\cn}[1]{{\protect\ntt\bslash#1}}     \hfuzz1pc % Don't bother to report overfull boxes if overage is < 1pc          \newcommand{\thmref}[1]{Theorem~\ref{#1}}     \newcommand{\secref}[1]{\S\ref{#1}}     \newcommand{\lemref}[1]{Lemma~\ref{#1}}     %\newcommand{\bysame}{\mbox{\rule{3em}{.4pt}}\,}     \newcommand{\sqt}[1]{\sqrt{\smash[b] {#1}}}          %    \interval is used to provide better spacing after a [ that     %    is used as a closing delimiter.     \newcommand{\interval}[1]{\mathinner{#1}}          %    Notation for an expression evaluated at a particular condition. The     %    optional argument can be used to override automatic sizing of the     %    right vert bar, e.g. \eval[\biggr]{...}_{...}     \newcommand{\eval}[2][\right]{\relax       \ifx#1\right\relax \left.\fi#2#1\rvert}          %    Enclose the argument in vert-bar delimiters:     \newcommand{\envert}[1]{\left\lvert#1\right\rvert}     \let\abs=\envert          %    Enclose the argument in double-vert-bar delimiters:     \newcommand{\enVert}[1]{\left\lVert#1\right\rVert}     \let\norm=\enVert     \newcommand{\pad}[2]{\frac{\der #1}{\der #2}}     \newcommand{\IC}{{\mathbb C}}     \newcommand{\IN}{{\mathbb N}}     \newcommand{\IR}{{\mathbb R}}     \newcommand{\gol}{\mbox{$\,${\rm Log}$\,$}}     \newcommand{\Log}{\ln}     \newcommand{\ov}[1]{\overline{\smash[b] {#1}}}     \newcommand{\Ndash}{\nobreakdash--}     \newcommand{\IE}{{\mathds{R}^n}}     \newcommand{\IF}{{\mathds{R}^m}}     \setlength\parindent{0pt}              %usage \choice{ }{ }{ }{ }         %(A)(B)(C)(D)         \newcommand{\fourch}[4]{         \par                 \begin{tabular}{*{4}{@{}p{0.23\textwidth}}}                 (a)~#1 & (b)~#2 & (c)~#3 & (d)~#4                 \end{tabular}         }              %(A)(B)         %(C)(D)         \newcommand{\twoch}[4]{                      \begin{tabular}{*{2}{@{}p{0.46\textwidth}}}                 (A)~#1 & (B)~#2                 \end{tabular}         \par                 \begin{tabular}{*{2}{@{}p{0.46\textwidth}}}                 (C)~#3 & (D)~#4                 \end{tabular}         }              %(A)         %(B)         %(C)         %(D)         \newcommand{\onech}[4]{         \par               (A)~#1 \par (B)~#2 \par (C)~#3 \par (D)~#4         }              \newlength\widthcha         \newlength\widthchb         \newlength\widthchc         \newlength\widthchd         \newlength\widthch         \newlength\tabmaxwidth              \setlength\tabmaxwidth{0.96\textwidth}         \newlength\fourthtabwidth         \setlength\fourthtabwidth{0.25\textwidth}         \newlength\halftabwidth         \setlength\halftabwidth{0.5\textwidth}              \newcommand{\choice}[4]{                 \settowidth\widthcha{AM.#1}\setlength{\widthch}{\widthcha}                 \settowidth\widthchb{BM.#2}                     \ifthenelse{\widthch<\widthchb}{\setlength{\widthch}{\widthchb}}{}                 \settowidth\widthchb{CM.#3}                     \ifthenelse{\widthch<\widthchb}{\setlength{\widthch}{\widthchb}}{}                 \settowidth\widthchb{DM.#4}                     \ifthenelse{\widthch<\widthchb}{\setlength{\widthch}{\widthchb}}{}                      \ifthenelse{\widthch<\fourthtabwidth}{\fourch{#1}{#2}{#3}{#4}}          {\ifthenelse{\widthch<\halftabwidth\and\widthch>\fourthtabwidth}{\twoch{#1}{#2}{#3}{#4}}                                    {\onech{#1}{#2}{#3}{#4}}}         }               \begin{document}     \hrule     \begin{questions}             \question What is your favourite color?         \onech{cjfije}{nkwjfl}{vvkji}{ n ejok}         \question nci jifj         \twoch{nknfi}{nvsjijp}{msj8j}{n vuhjkd}         \question kkkkkkkkkkkkkkkkkkkkkkkkkkkkkk         \fourch{qqqqqqqqq}{qqqqqqqqqq}{qqqqqqqqq}{rrrrrrrrrrrr}         \question what is your favourite fruit?         \choice{apple}{banana}{orang}{pear}     \end{questions}          \end{document}      I think there is a wrong in the following redefinition..               \newcommand{\choice}[4]{                     \settowidth\widthcha{AM.#1}\setlength{\widthch}{\widthcha}                     \settowidth\widthchb{BM.#2}                         \ifthenelse{\widthch<\widthchb}{\setlength{\widthch}{\widthchb}}{}                     \settowidth\widthchb{CM.#3}                         \ifthenelse{\widthch<\widthchb}{\setlength{\widthch}{\widthchb}}{}                     \settowidth\widthchb{DM.#4}                         \ifthenelse{\widthch<\widthchb}{\setlength{\widthch}{\widthchb}}{}                          \ifthenelse{\widthch<\fourthtabwidth}{\fourch{#1}{#2}{#3}{#4}}              {\ifthenelse{\widthch<\halftabwidth\and\widthch>\fourthtabwidth}{\twoch{#1}{#2}{#3}{#4}}                                        {\onech{#1}{#2}{#3}{#4}}}             }      Kindly correct it and tell me how to identify the correct choice and to print in a separate sheet.


title: JASA Tex archive

text: Im a beginner using latex and I was very happy writting my paper for JASA (Journal of the acoustical society of America and found out that ASA end their support to JASAtex. Wonder if somebody wants to share a tex template with me. Please.


title: Formatting this table

text: I am terrible at creating tables, the following is the code from Excel2Latex               % Table generated by Excel2LaTeX from sheet 'Sheet1'     \begin{table}[htbp]       \centering       \caption{Add caption}         \begin{tabular}{rr}         \toprule         \multicolumn{1}{c}{Timeline} & \multicolumn{1}{c}{Outcomes} \\         \midrule         Oct. 2014 - Dec. 2014 & 1. blah blah blah blah blah blah blah blah blah. \\               & 2. blah blah blah blah blah blah blah blah blah. \\         Jan. 2015 - Mar. 2015 & 1. blah blah blah blah blah blah blah blah blah. \\               & 2. blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. \\         Apr. 2015 - Jun. 2015 & 1. blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. \\               & 2. blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. \\         Jul. 2015 - Oct. 2015 & 1. blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. \\               & 2. blah blah blah blah blah blah blah blah blah. \\         \bottomrule         \end{tabular}%       \label{tab:addlabel}%     \end{table}%      which produces: ![enter image description here](http://i.stack.imgur.com/JSUXS.png) How can I make this look better? BTW, the length of the "blah"s is how long my actual sentence is.


title: How do I create a combined figure with two imported curves and draw around it with Tikz?

text: This is a two part question that I'd really appreciate any help with, I couldn't find previous posts about this so I apologize if this is a repeat question. It all stems from attempting to create this figure that I drew: ![enter image description here](http://i.stack.imgur.com/8WzcU.jpg) where the two blue lines are imported from a data file created with C++, and the grey pencil marks are what I'd like to draw with Tikz. My first question deals with alignment, I'm having issues placing the lines I'd like to draw next to my imported lines. Whenever I try to draw them, the blue imported lines shift. If anyone has suggestions as to how I could draw on an imported curve that'd be great. My second question is how do I create the arrows behind the blue lines? I know how to create them one-by-one, but I'm sure there is a better way where they stop at the next line they see. Here's my code, it is able to compile, but definitely doesn't come close to creating my hand drawn image:               \documentclass{report}          \usepackage[top=1in,left=1in,bottom=1in,right=1in]{geometry}     \usepackage{pgfplots}     \usepackage{subfigure}          \pgfplotsset{compat=1.7}     \usetikzlibrary{backgrounds}     \usetikzlibrary{patterns}          \pgfdeclarepatternformonly{north east lines med}{\pgfqpoint{-1pt}{-1pt}}{\pgfqpoint{7pt}   {7pt}}{\pgfqpoint{6pt}{6pt}}%     {       \pgfsetlinewidth{0.4pt}       \pgfpathmoveto{\pgfqpoint{0pt}{0pt}}       \pgfpathlineto{\pgfqpoint{6.1pt}{6.1pt}}       \pgfusepath{stroke}     }               \begin{document}          \begin{figure}[!htb]     \centering         \subfigure{             \begin{tikzpicture}                 \begin{axis}[                 xtick=\empty,                 ytick=\empty,                 axis lines=none,                 no markers,                 ]                 \addplot + table[x index=50, y index=5000]{velocityprofile1.dat};                 \end{axis}             \end{tikzpicture}         }         \subfigure{             \begin{tikzpicture}                 \begin{axis}[                 xtick=\empty,                 ytick=\empty,                 axis lines=none,                 no markers,                 ]                 \addplot + table[x index=3644, y index=5000]{velocityprofile1.dat};                 \end{axis}             \end{tikzpicture}         }     \begin{tikzpicture}         \begin{scope}[on background layer]         \draw[-](-3,0)--(5,0);         \end{scope}[on background layer]     \end{tikzpicture}     \caption{FTCS I}     \label{fig:please work}     \end{figure}               \end{document}      The `velocityprofile.dat` file is somewhat large and the question isn't really about importing that data specifically so I haven't attached it, let me know if you need it. Thanks for your help in advance! EDIT: This is my code. The first column is `x index=50` in the code, the second column is `x index=3644`, and the third is `y index=5000`.


title: How can I increase baselineskip in a document using memoir class?

text: I am trying to increase the baselineskip for every chapter except the titlepage. I am using setlength to change its value but it has no effect. Any help would be great. Following is my main file.               \documentclass[11pt, a4paper, twoside, openright]{memoir}          % \includeonly{./chapters/conclusion/conclusion}          \usepackage{graphicx} % For inserting graphics in the page     \usepackage{epstopdf} % For automatically converting eps images to pdf while using pdflatex     \usepackage{dblfloatfix} % For using a "b" as placement specifier for a page wide image     \usepackage{fixltx2e} % For ensuring correct image numbering when we use \figure*     \usepackage{mathtools} % For using mathematics environments     \usepackage{amsfonts} % For using text formatting in equations eg \mathbf     \usepackage{algorithm} % For wrapping algorithmic environment to produce a floating    environment.     \usepackage{algorithmic} % For using algorithmic environment     \usepackage{threeparttable} % For adding footnotes to the table     \usepackage{subcaption} % For putting multiple figures within a single figure environment     \usepackage{tikz} % For drawing          \graphicspath{{chapters/SASNN/img/}{chapters/GSNN/img/}{chapters/literature/img/}{chapters/intro/img/}{chapters/conclusion/img/}{garnish/cover/}}          \setsecnumdepth{subsubsection}          % To ensure equal margin for odd and even pages     \setlength{\oddsidemargin}{15.5pt}     \setlength{\evensidemargin}{15.5pt}          % Increase line spacing     \setlength{\baselineskip}{24pt plus 1pt minus 1pt}          \begin{document}     % title page     \input{./garnish/cover/cover}          % abstract     \begin{abstract}     \input{./garnish/abstract/abstract} % We use input because usage of include causes an extra bank page to be added.     \end{abstract}          \mainmatter         \include{./chapters/intro/intro}     \include{./chapters/literature/literature}     \include{./chapters/GSNN/gsnn}     \include{./chapters/SASNN/sasnn}     \include{./chapters/conclusion/conclusion}          \backmatter     \include{./garnish/pub/pub}          \bibliographystyle{plain}     \bibliography{../../../Bibliography/Bibtex/SNN}     \end{document}      UPDATE: I tried \linespread also but that doesn't work either.


title: alltt and hyperref package not playing nice together

text: I'm am trying to create some cross references between two documents. I'm using alltt in both docs to control the layout of some of the content. For the cross reference links, I am defining the anchor with \hyperdef. For references in the same document, I use \hyperlink to create the link. For external references, I use \hyperref. I found that depending on whether I place the various \hyper* commands on then inside or outside of an alltt block, the links will either work or fail. Being curious I opened the generated PDF file in a text editor and I found that when the \hyper* commands are placed inside an alltt block, it's being mangled.               Outside of alltt:  /Subtype/Link/A<</F(external\040doc.pdf)/S/GoToR/D(EXTERNAL\040TARGET\0401.EXTERNAM\040TARGET\0401)>>          Inside of alltt:  /Subtype/Link/A<</F(external\\unhbox\040\\voidb@x\040\\penalty\040\\@M\040\\\040doc.pdf)/S/GoToR/D(EXTERNAL\\unhbox\040\\voidb@x\040\\penalty\040\\@M\040\\\040TARGET\\unhbox\040\\voidb@x\040\\penalty\040\\@M\040\\\0401.EXTERNAM\\unhbox\040\\voidb@x\040\\penalty\040\\@M\040\\\040TARGET\\unhbox\040\\voidb@x\040\\penalty\040\\@M\040\\\0401)>>      For links in the same manual, that's not a big deal. I just create the link and anchor in alltt blocks. I don't have a solution or workaround for external links. Any ideas on how to prevent that mangling from happening? The external links must work inside an alltt block. Below is a sample I create to demonstrate the problem. * * * * * * **test1.text**               \documentclass{article}     \usepackage{lipsum}     \usepackage{alltt}     \usepackage{hyperref}               \begin{document}     \section{Source a}          Outisde alltt          \hyperref{external doc.pdf}{EXTERNAL TARGET 1}{EXTERNAM TARGET 1}{\textbf{ To external  target }}  \newline          \hyperlink{INSIDE ALLTT}{LINK \#1}               \begin{alltt}     Inside alltt          \hyperref{external doc.pdf}{EXTERNAL TARGET 1}{EXTERNAM TARGET 1}{\textbf{ To external  target }}  \newline     \hyperlink{INSIDE ALLTT}{lINK \#2}          \end{alltt}          \lipsum          \section{Source b}          \begin{alltt}     \hypertarget{INSIDE ALLTT}{}     \end{alltt}     Fu baz          \end{document}      * * * * * * **external doc.text**               \documentclass{article}     \usepackage{lipsum}     \usepackage{hyperref}          \begin{document}     \section{Source a}     \lipsum          \hyperdef{EXTERNAL TARGET 1}{EXTERNAM TARGET 1}{External Target \#1} \newline          \end{document}


title: Aligning two minipages - one with lstlisting, one without - on top?

text: I'm already aware that two minipages with [t] align at the baseline of the top line, not at the top of their respective boxes/containers; however, this is somewhat different: when I use a small minipage with one letter, and a minipage with lstlisting, and try to align them on top as on the below MWE, I get this (using `lua-visual-debug`): ![test02b.png](http://i.stack.imgur.com/flfxt.png) I really don't understand - what is that pushing the listing minipage down, a linebreak? Where did that come from? How could I get these two items aligned on top (such that the `A` remains where it is - and the listing+minipage move vertically up to match it)? By the way, notice that in the MWE below - the second example, with two minipages with lstlisting each, works without a problem:               \documentclass{article}          %\usepackage{lua-visual-debug}     \usepackage{listings}          \begin{document}          Test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test ...          \begin{minipage}[t]{1em}     A     \end{minipage}     \hfill     \begin{minipage}[t]{\dimexpr\textwidth-2\parindent-2.2em}%     \begin{lstlisting}     sslg kaha kshd kajshd     asl q7ey q[peo [pdv     sdfk a9su qpowie e     asj asy dqoi poai     \end{lstlisting}     \end{minipage}          Test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test sentence test ...          % http://tex.stackexchange.com/questions/36712/how-to-place-two-code-/36737     \begin{minipage}[t]{0.45\linewidth}     \begin{lstlisting}[caption={Some XML Caption}]       .. xml code ...       .. xml code ...       .. xml code ...       .. xml code ...       .. xml code ...       .. xml code ...     \end{lstlisting}     \end{minipage}     %     \begin{minipage}[t]{0.45\linewidth}     \begin{lstlisting}[caption={Some Javascript Caption}]       ... javascript code ...       ... javascript code ...       ... javascript code ...     \end{lstlisting}     \end{minipage}          \end{document}


title: Inserting TeX code into beamer - Problem with otherkeywords

text: I am preparing a `beamer` presentation and using the `lstlisting` environment in order to put in TeX code. I am using the following code which is largely copied from here:               \definecolor{lightgrey}{rgb}{0.9,0.9,0.9} % defining color for listing     \definecolor{darkgreen}{rgb}{0,0.6,0} % defining color for listing          \lstset{language=[LaTeX]TeX, texcsstyle=*\bf\color{blue},     numbers=left, breaklines=true, keywordstyle=\color{darkgreen},     commentstyle=\color{red}, otherkeywords={$}, frame=leftline,     tabsize=2, backgroundcolor=\color{lightgrey}}      I would like to also copy the `otherkeywords={$, \\{, \\}, \\[, \\]},` line from tom (here again). However, it is always giving me error messages with that line. Is there something wrong with that code? Thanks, Max In response to the comment: The error occurs I do this:               \documentclass{beamer}          \usepackage{remreset}     \usepackage{comment} % end and begin comment     \usepackage{dtklogos} % for \BibTeX          \usepackage{listings} % display code on slides; don't forget [fragile] option after \begin{frame}     \usepackage{bera} % pause in listing     \usepackage{color}     \definecolor{lightgrey}{rgb}{0.9,0.9,0.9} % defining color for listing     \definecolor{darkgreen}{rgb}{0,0.6,0} % defining color for listing          \makeatletter     \@removefromreset{subsection}{section} % creates navigation circles for every slide not section     \makeatother     \setcounter{subsection}{1} % creates navigation circles for every slide not section          \usetheme{Frankfurt}     \setbeamercovered{transparent}          \lstset{language=[LaTeX]TeX,     texcsstyle=*\bf\color{blue},     numbers=left,     breaklines=true,     keywordstyle=\color{darkgreen},     commentstyle=\color{red},     otherkeywords={$, \{, \}, \[, \]},     frame=leftline,     tabsize=2,     backgroundcolor=\color{lightgrey},     escapeinside=||     }               \begin{document}               \begin{lstlisting}         \title[Title]{An Introduction to \LaTeX}         \subtitle[Event]{ABC}         \author[Author]{XXX}          \institute[University]{XYZ University}         \maketitle     \end{lstlisting}          \end{document}      I does not occur if I substitute `otherkeywords={$, \\{, \\}, \\[, \\]},` with `otherkeywords={$},`


title: Yet another leader dot question and related for TOC

text: I asked a question yesterday. Thanks for the help. It turns out I only need to remove the leader dots AND the page number associated with "CHAPTER". This is using the `memoir` class and also uses a `.sty` file. I know this is not a minimal working example, but I don't know which line(s) of code are the problem. I have messed with them all... Here is the main file               \documentclass[oneside,12pt]{memoir}     \usepackage{pw1}      \begin{document}     \tableofcontents*     \addcontentsline{toc}{chapter}{CHAPTER}     \chapter{blah}     \end{document}       Here is relevant stuff in the `pw1.sty` file               \let\oldtoc\tableofcontents     \renewcommand{\tableofcontents}{\clearpage\pagestyle{toc}}\oldtoc}     \renewcommand{\contentsname}{TABLE OF CONTENTS}     \renewcommand*{\tocheadstart}{\vspace*{-\topfiddle}}     \renewcommand*{\aftertoctitle}{\thispagestyle{plain}%         \par\nobreak \mbox{}\hfill{\normalfont Page}\par\nobreak}     \renewcommand*{\cftchapterfont}{\normalfont}     \renewcommand*{\cftchapterpagefont}{\normalfont}     \renewcommand*{\cftchapterleader}{%      \cftchapterfont\cftdotfill{\cftchapterdotsep}}         {\cftdotsep}      \setlength{\cftbeforechapterskip}{0pt plus 0pt}      This is what I get: > CHAPTER...............................................1 One other problem I am having is that the Chapter on page2 of the TOC is not all caps and needs to be. This one should be simple, but... > Chapter


title: Is reStructuredText compatible with the memoir class?

text: While I'm fine with writing "real" documents in full-blown LaTeX, I often switch to reStructuredText as a lightweight markup language for simplish documents (like meeting notes and stuff). I was quite happy with my workflow (`file.txt -> rst2latex-2.6.py -> pdflatex -> file.pdf`) until I recently decided that I wanted to use the `memoir` class, just as I do for my real documents. The documentation for reStructuredText states that this class is supported via the `\--documentclass=memoir` option. However, my document now fails to compile because of some command fragility issue I don't really understand : Titles and section titles are converted to something in the lines of :               \title{\phantomsection%       This it the title%       \label{this-it-the-title}}      which `article` seems fine with, but which `memoir` chokes on (about 15 errors in the log file). **Is this an obvious but undocumented bug, or did I do something obviously wrong in the first place ?** Minimal (not)working example :               #!/bin/sh          rm -f test.*          cat >> test.txt <<EOF     This it the title     =================          this is dummy text     EOF          rst2latex-2.6.py -V     rst2latex-2.6.py --verbose --documentclass=memoir test.txt test.tex     pdflatex -interaction=nonstopmode test.tex       As for the output, I get out of it :               rst2latex-2.6.py (Docutils 0.9 [release], Python 2.6.8, on darwin)     This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts 2011_5)     ...     (...then the usual latex yada yada, including about 15 "errors"...)     ...     !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on test.log.      In case it is useful, here is the complete (and incorrect) LateX document produced by docutils :               \documentclass[a4paper]{memoir}     % generated by Docutils <http://docutils.sourceforge.net/>     \usepackage{fixltx2e} % LaTeX patches, \textsubscript     \usepackage{cmap} % fix search and cut-and-paste in Acrobat     \usepackage{ifthen}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          %%% Custom LaTeX preamble     % PDF Standard Fonts     \usepackage{mathptmx} % Times     \usepackage[scaled=.90]{helvet}     \usepackage{courier}          %%% User specified packages and stylesheets          %%% Fallback definitions for Docutils-specific commands          % hyperlinks:     \ifthenelse{\isundefined{\hypersetup}}{       \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}       \urlstyle{same} % normal text font (alternatives: tt, rm, sf)     }{}     \hypersetup{       pdftitle={This it the title},     }          %%% Title Data     \title{\phantomsection%       This it the title%       \label{this-it-the-title}}     \author{}     \date{}          %%% Body     \begin{document}     \maketitle          this is dummy text          \end{document}


title: Tikz : column header in groupplot legend with a loop

text: I'm trying to plot some data using loops, but i've some issues when I try to extract the column header and have it as a sub legend. Does anyone have any idea to fix it up ?               \documentclass{minimal}          \usepackage{tikz}     \usepackage{pgfplots}     \usepgfplotslibrary{groupplots}     \usepackage{pgfplotstable}     \definecolor{skyblue1}{rgb}{0.447,0.624,0.812}               \pgfplotstableread{     time    y   c   q   r   pi  r_F efp z_E z_F     1   0.105597    0.000553    0.007493    0.002008    0.001352    41.251213   0.015177    0.015177    41.251213     2   0.003563    0.003143    -0.001881   0.000742    -0.000582   0.541130    -0.011564   -0.001644   0.545364     3   0.003204    0.004251    -0.000223   0.000048    -0.000367   -0.016199   0.000767    0.001246    -0.016337     4   0.003582    0.004518    0.000531    -0.000285   -0.000218   -0.115549   0.000642    0.000411    -0.115694     5   0.003762    0.004358    0.000743    -0.000414   -0.000126   -0.158629   0.000492    -0.000035   -0.158753     }\modelresponses     \pgfplotstablegetcolsof{\modelresponses}          \begin{document}       \begin{tikzpicture}              \begin{groupplot}[group style={group size=3 by 2,vertical sep= 1.5cm},width=0.45\textwidth,ybar]          \pgfplotsinvokeforeach{1,2,3,4,5,6,7,8,9}{%                     \pgfplotstablegetcolumnnamebyindex{#1}\of{\modelresponses}\to{\mycolname};                     \nextgroupplot[title=\mycolname,grid=major];                  \addplot[very thick,smooth,skyblue1] table [ x index=0,  y index=#1] {\modelresponses};         }         \end{groupplot}       \end{tikzpicture}     \end{document}


title: Remove section header from a beamer theme (Singapore)?

text: I like everything about the beamer theme Singapore except:   1. The centering of the frame title   2. The navigation symbols that remain at the bottom   3. The sections in the header The first two are easily solved by               \setbeamertemplate{frametitle}[default][left]     \setbeamertemplate{navigation symbols}{}      I still can't find a solution for the third though. `\setbeamertemplate{headline}{}` gets rid of the sections in the header but dumps the nice shading. So my question: how do I get rid of those pesky sections (e.g., the "foo bar baz" below) in the header without dumping the shading? ![exampleframe](http://i.stack.imgur.com/orOWt.jpg)


title: Getting the color from a beamer theme?

text: How do I find out what color a beamer theme uses? In particular, what is the color that the Singapore theme uses? I'd like to grab this color so that I can color my tables with it and remain consistent with the general theme. I've copied and pasted the `.sty` file for Singapore below. I really wasn't able to glean much from looking at it.               % Copyright 2007 by Till Tantau     %     % This file may be distributed and/or modified     %     % 1. under the LaTeX Project Public License and/or     % 2. under the GNU Public License.     %     % See the file doc/licenses/LICENSE for more details.          \ProvidesPackageRCS $Header: /cvsroot/latex-beamer/latex-beamer/themes/theme/beamerthemeSingapore.sty,v 1.10 2007/01/28 20:48:30 tantau Exp $               \DeclareOptionBeamer{compress}{\beamer@compresstrue}     \ProcessOptionsBeamer               \mode<presentation>          \setbeamercolor{section in head/foot}{use=structure,bg=structure.fg!25!bg}          \useoutertheme[subsection=false]{miniframes}               \setbeamertemplate{frametitle}[default][center]          \AtBeginDocument{%       {         \usebeamercolor{section in head/foot}       }            \pgfdeclareverticalshading{beamer@headfade}{\paperwidth}       {%         color(0cm)=(bg);         color(1.25cm)=(section in head/foot.bg)%       }            \setbeamercolor{section in head/foot}{bg=}     }          \addtoheadtemplate{\pgfuseshading{beamer@headfade}\vskip-1.25cm}{}          \beamertemplatedotitem          \mode     <all>


title: Adding a transition only for an image

text: Suppose I have a slide defined as follows:               \begin{frame}[t,fragile]{Some Slide}     \begin{itemize}     \item An item     \item Another item     \end{itemize}          \pause          \begin{center}     \begin{tikzpicture}[overlay]          \transdissolve     \transduration{2}          \node[yshift=78] (img2)   {\includegraphics[scale=0.25]{someimage.png}};          \end{tikzpicture}     \end{center}         \end{frame}      Now I want _only_ the image to be show with a transition. In the above code, with the transition command added inside the `tikzpicture` environment, the complete slide as well as image are drawn with a transition. How do I restrict the transition to the image only?