title: Sankey Diagram not rendering proper

text: I've found this website very useful for the past few months without ever needing to post a question but alas the time has come where I actually need to make a post, hopefully someone might be able to help me out here. So here goes... I've been using LaTeX to write my thesis and all has gone well so far. I have 64-bit version of MikTex 2.9.5105 installed on my computer. I've been trying to figure out how to draw Sankey Diagrams and came across the answer by Paul Gaborit on How to draw a Sankey Diagram using TikZ The source code from TeXample is given below.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{etoolbox}          \pgfdeclarelayer{background}     \pgfdeclarelayer{foreground}     \pgfdeclarelayer{sankeydebug}     \pgfsetlayers{background,main,foreground,sankeydebug}          \newif\ifsankeydebug          \newenvironment{sankeydiagram}[1][]{            \def\sankeyflow##1##2{% sn, en         \path[sankey fill]         let         \p1=(##1.north east),\p2=(##1.south east),         \n1={atan2(\x1-\x2,\y1-\y2)-90},         \p3=(##2.north west),\p4=(##2.south west),         \n2={atan2(\x3-\x4,\y3-\y4)+90}         in         (\p1) to[out=\n1,in=\n2] (\p3) --         (\p4) to[in=\n1,out=\n2] (\p2) -- cycle;         \draw[sankey draw]         let         \p1=(##1.north east),\p2=(##1.south east),         \n1={atan2(\x1-\x2,\y1-\y2)-90},         \p3=(##2.north west),\p4=(##2.south west),         \n2={atan2(\x3-\x4,\y3-\y4)+90}         in         (\p1) to[out=\n1,in=\n2] (\p3)         (\p4) to[in=\n1,out=\n2] (\p2);       }                 \tikzset{         sankey tot length/.store in=\sankeytotallen,         sankey tot quantity/.store in=\sankeytotalqty,         sankey min radius/.store in=\sankeyminradius,         sankey arrow length/.store in=\sankeyarrowlen,         sankey debug/.is if=sankeydebug,         sankey debug=false,         sankey flow/.style={           to path={             \pgfextra{               \pgfinterruptpath               \edef\sankeystart{\tikztostart}               \edef\sankeytarget{\tikztotarget}               \sankeyflow{\sankeystart}{\sankeytarget}               \endpgfinterruptpath             }           },         },         sankey node/.style={           inner sep=0,minimum height={sankeyqtytolen(##1)},           minimum width=0,draw=none,line width=0pt,         },         % sankey angle         sankey angle/.store in=\sankeyangle,         % sankey default styles         sankey fill/.style={line width=0pt,fill,white},         sankey draw/.style={draw=black,line width=.4pt},       }            \newcommand\sankeynode[4]{%prop,orientation,name,pos         \node[sankey node=##1,rotate=##2] (##3) at (##4) {};         \ifsankeydebug         \begin{pgfonlayer}{sankeydebug}           \draw[red,|-|] (##3.north west) -- (##3.south west);           \pgfmathsetmacro{\len}{sankeyqtytolen(##1)/3}           \draw[red] (##3.west)           -- ($(##3.west)!\len pt!90:(##3.south west)$)           node[font=\tiny,text=black] {##3};         \end{pgfonlayer}         \fi       }            \newcommand\sankeynodestart[4]{%prop,orientation,name,pos         \sankeynode{##1}{##2}{##3}{##4}         \begin{scope}[shift={(##3)},rotate=##2]           \path[sankey fill]           (##3.north west) -- ++(-\sankeyarrowlen,0)           -- ([xshift=-\sankeyarrowlen/6]##3.west)           -- ([xshift=-\sankeyarrowlen]##3.south west)           -- (##3.south west) -- cycle;           \path[sankey draw]           (##3.north west) -- ++(-\sankeyarrowlen,0)           -- ([xshift=-\sankeyarrowlen/6]##3.west)           -- ([xshift=-\sankeyarrowlen]##3.south west)           -- (##3.south west);         \end{scope}       }            \newcommand\sankeynodeend[4]{%prop,orientation,name,pos         \sankeynode{##1}{##2}{##3}{##4}         \begin{scope}[shift={(##3)},rotate=##2]           \path[sankey fill]           (##3.north east)           -- ([xshift=\sankeyarrowlen]##3.east)           -- (##3.south west) -- cycle;           \path[sankey draw]           (##3.north east)           -- ([xshift=\sankeyarrowlen]##3.east)           -- (##3.south west);         \end{scope}       }            \newcommand\sankeyadvance[3][]{%newname,name,distance         \edef\name{##2}         \ifstrempty{##1}{           \def\newname{##2}           \edef\name{##2-old}           \path [late options={name=##2,alias=\name}];         }{           \def\newname{##1}         }         \path         let         % sankey node angle         \p1=(##2.north east),         \p2=(##2.south east),         \n1={atan2(\x1-\x2,\y1-\y2)-90},         % sankey prop         \p3=($(\p1)-(\p2)$),         \n2={sankeylentoqty(veclen(\x3,\y3))},         % next position         \p4=($(##2.east)!##3!-90:(##2.north east)$)         in         \pgfextra{           \pgfmathsetmacro{\prop}{\n2}           \pgfinterruptpath           \sankeynode{\prop}{\n1}{\newname}{\p4}           \path (\name) to[sankey flow] (\newname);           \endpgfinterruptpath         };       }            \newcommand\sankeyturn[3][]{%newname,name,angle         \edef\name{##2}         \ifstrempty{##1}{           \def\newname{##2}           \edef\name{##2-old}           \path [late options={name=##2,alias=\name}];         }{           \def\newname{##1}         }         \ifnumgreater{##3}{0}{           \typeout{turn acw: ##3}           \path           let           % sankey node angle           \p1=(##2.north east),           \p2=(##2.south east),           \p3=($(\p1)!-\sankeyminradius!(\p2)$),           \n1={atan2(\x1-\x2,\y1-\y2)-90},           % sankey prop           \p4=($(\p1)-(\p2)$),           \n2={sankeylentoqty(veclen(\x4,\y4))},           \p5=(##2.east),           \p6=($(\p3)!1!##3:(\p5)$)           in           \pgfextra{             \pgfmathsetmacro{\prop}{\n2}             \pgfinterruptpath             % \fill[red] (\p3) circle (2pt);             % \fill[blue](\p6) circle (2pt);             \sankeynode{\prop}{\n1+##3}{\newname}{\p6}             \path (\name) to[sankey flow] (\newname);             \endpgfinterruptpath           };         }{           \typeout{turn acw: ##3}           \path           let           % sankey node angle           \p1=(##2.south east),           \p2=(##2.north east),           \p3=($(\p1)!-\sankeyminradius!(\p2)$),           \n1={atan2(\x1-\x2,\y1-\y2)+90},           % sankey prop           \p4=($(\p1)-(\p2)$),           \n2={sankeylentoqty(veclen(\x4,\y4))},           \p5=(##2.east),           \p6=($(\p3)!1!##3:(\p5)$)           in           \pgfextra{             \pgfmathsetmacro{\prop}{\n2}             \pgfinterruptpath             % \fill[red] (\p3) circle (2pt);             % \fill[blue](\p6) circle (2pt);             \sankeynode{\prop}{\n1+##3}{\newname}{\p6}             \path (\name) to[sankey flow] (\newname);             \endpgfinterruptpath           };         }       }            \newcommand\sankeyfork[2]{%name,list of forks         \def\name{##1}         \def\listofforks{##2}         \xdef\sankeytot{0}         \path          let         % sankey node angle         \p1=(\name.north east),         \p2=(\name.south east),         \n1={atan2(\x1-\x2,\y1-\y2)-90},         % sankey prop         \p4=($(\p1)-(\p2)$),         \n2={sankeylentoqty(veclen(\x4,\y4))}         in         \pgfextra{           \pgfmathsetmacro{\iprop}{\n2}         }         \foreach \prop/\name[count=\c] in \listofforks {           let           \p{start \name}=($(\p1)!\sankeytot/\iprop!(\p2)$),           \n{nexttot}={\sankeytot+\prop},           \p{end \name}=($(\p1)!\n{nexttot}/\iprop!(\p2)$),           \p{mid \name}=($(\p{start \name})!.5!(\p{end \name})$)           in           \pgfextra{             \xdef\sankeytot{\n{nexttot}}             \pgfinterruptpath             \sankeynode{\prop}{\n1}{\name}{\p{mid \name}}             \endpgfinterruptpath           }         }         \pgfextra{           \pgfmathsetmacro{\diff}{abs(\iprop-\sankeytot)}           \pgfmathtruncatemacro{\finish}{\diff<0.01?1:0}           \ifnumequal{\finish}{1}{}{             \message{*** Warning: bad sankey fork (maybe)...}             \message{\iprop-\sankeytot}           }         };       }            \tikzset{         % default values,         declare function={           sankeyqtytolen(\qty)=\qty/\sankeytotalqty*\sankeytotallen;           sankeylentoqty(\len)=\len/\sankeytotallen*\sankeytotalqty;         },         sankey tot length=100pt,         sankey tot quantity=100,         sankey min radius=30pt,%         sankey arrow length=10pt,%         % user values         #1}     }{     }                    \begin{document}     \begin{tikzpicture}[x=1pt,y=1pt]            \begin{sankeydiagram}[         sankey tot length=90pt,%         sankey tot quantity=6,%         sankey min radius=15pt,%         sankey fill/.style={           draw,line width=0pt,           fill,           lime!50,         },         sankey draw/.style={           draw=black,           line width=1pt,           line cap=round,           line join=round,         },         %sankey debug,         ]         \sankeynodestart{6}{-90}{p0}{0,100};         \sankeyadvance{p0}{50pt}              \sankeyfork{p0}{3/p1,3/p2}              \sankeyturn{p1}{90}         \sankeyadvance{p1}{20pt}              \sankeyadvance{p2}{60pt}              \sankeyfork{p2}{2/p3,1/p4}              \sankeyturn{p3}{90}         \sankeyadvance{p3}{50pt}              \sankeyfork{p3}{1/p5,1/p6}              \sankeyadvance{p5}{70pt}              \sankeyfork{p1}{1/p7,1/p8,1/p9}         \sankeyadvance{p7}{50pt}         \sankeyadvance{p9}{50pt}              \sankeyadvance{p4}{40pt}         \sankeyturn{p4}{90}         \sankeyadvance{p4}{65pt}              \sankeyadvance{p7}{40pt}              \sankeynode{3}{0}{p11}{[shift={(50pt,-15pt)}]p7}         \sankeyfork{p11}{1/p7a,1/p9a,1/p5a}         \path (p7) to[sankey flow] (p7a);         \path (p9) to[sankey flow] (p9a);         \path (p5) to[sankey flow] (p5a);         \sankeyadvance{p11}{30pt}         \sankeynodeend{3}{0}{p11}{p11}              {           \tikzset{             sankey fill/.append style={               line width=0pt,               lime!50!green!50,             }           }           \sankeyturn{p8}{-90}           \sankeyadvance{p8}{40pt}                \sankeyturn{p6}{-90}           \sankeyturn{p4}{-90}                \sankeynode{3}{-90}{p10}{[shift={(-15pt,-60pt)}]p8}           \sankeyfork{p10}{1/p8a,1/p6a,1/p4a}           \path (p4) to[sankey flow] (p4a);           \path (p6) to[sankey flow] (p6a);           \path (p8) to[sankey flow] (p8a);           \sankeyadvance{p10}{30pt}           \sankeynodeend{3}{-90}{p10}{p10}         }                      \end{sankeydiagram}     \end{tikzpicture}     \end{document}      I could run this on another 32 bit computer flawlessly but it does not parse well on the 64 bit computer. The diagram is all a jumbled mess like; ![enter image description here](http://i.stack.imgur.com/k1Ape.jpg) Is there something simple I'm missing here. I'm a novice here and barely understand LaTeX and learning it as I go and this seems to be a simple issue but a bit out of my grasp in troubleshooting. Any help is appreciated. Thanks in advance !


title: Layout of multiple lines footnotes

text: I have a question about footnotes with LaTeX: I would like the multi-lines footnotes to look like:               1 This is the first line of the very, very long footnote          and this is the second line of the very long footnote          and this is the third line of the very long footnote.      How can I accomplish this? I already checked out package footmisc but could not find working options.


title: \addbibresource[location=remote] does not resolve cross-references

text: # Edit: As per moewe's suggestion, the MWE is now truly minimal (I think). I removed the need for multiple `.bib` files by removing abbreviations, and made the main `.bib` file smaller (exactly as shown below). Here's the log (`file.blg`):               [0] Config.pm:318> INFO - This is Biber 1.8     [0] Config.pm:321> INFO - Logfile is 'file.blg'     [60] biber-darwin:275> INFO - === Sat May 10, 2014, 14:45:31     [61] Biber.pm:333> INFO - Reading 'file.bcf'     [128] Biber.pm:630> INFO - Found 2 citekeys in bib section 0     [156] Biber.pm:3053> INFO - Processing section 0     [181] Biber.pm:3190> INFO - Looking for bibtex format file 'https://dl.dropboxusercontent.com/u/47261882/bibliography.bib' for section 0     [182] bibtex.pm:134> INFO - Data source 'https://dl.dropboxusercontent.com/u/47261882/bibliography.bib' is a remote BibTeX data source - fetching ...     [925] bibtex.pm:812> INFO - Found BibTeX data source '/var/folders/lw/xmh_g5vx4j9ctfxysb189qyr0000gn/T/ZegiE_xxWe/biber_remote_data_source_vqdu_.bib'     [930] bibtex.pm:134> INFO - Data source 'https://dl.dropboxusercontent.com/u/47261882/bibliography.bib' is a remote BibTeX data source - fetching ...     [1508] bibtex.pm:812> INFO - Found BibTeX data source '/var/folders/lw/xmh_g5vx4j9ctfxysb189qyr0000gn/T/ZegiE_xxWe/biber_remote_data_source_17lZd.bib'     [1509] Utils.pm:169> WARN - Duplicate entry key: 'a:watson:2014:01' in file '/var/folders/lw/xmh_g5vx4j9ctfxysb189qyr0000gn/T/ZegiE_xxWe/biber_remote_data_source_17lZd.bib', skipping ...     [1509] Utils.pm:169> WARN - Duplicate entry key: 'ic:bedau:2009:01' in file '/var/folders/lw/xmh_g5vx4j9ctfxysb189qyr0000gn/T/ZegiE_xxWe/biber_remote_data_source_17lZd.bib', skipping ...     [1509] Utils.pm:169> WARN - Duplicate entry key: 'c:barberousse:2009:01' in file '/var/folders/lw/xmh_g5vx4j9ctfxysb189qyr0000gn/T/ZegiE_xxWe/biber_remote_data_source_17lZd.bib', skipping ...     [1510] Utils.pm:169> WARN - I didn't find a database entry for crossref 'c:barberousse:2009:01' in entry 'ic:bedau:2009:01' - ignoring (section 0)     [1535] Biber.pm:2939> INFO - Overriding locale 'en_GB.UTF-8' default tailoring 'variable = shifted' with 'variable = non-ignorable'     [1535] Biber.pm:2945> INFO - Sorting 'entry' list 'nty' keys     [1535] Biber.pm:2949> INFO - No sort tailoring available for locale 'en_GB.UTF-8'     [1539] bbl.pm:482> INFO - Writing 'file.bbl' with encoding 'ascii'     [1540] bbl.pm:555> INFO - Output to file.bbl     [1540] Biber.pm:105> INFO - WARNINGS: 4      It seems like the file is fetched twice (hence the warnings for duplicate keys). But I do not know how this is related to the issue. * * * When using `biblatex`'s (and `biber`'s) feature for fetching `.bib` files from remote locations, cross-refs are not resolved. Consider the following bibliography file (`bibliography.bib`):               @Article{a:watson:2014:01,       title           = {The Evolution of Phenotypic Correlations and ``Developmental Memory''},       author          = {Watson, Richard A. and Wagner, G{\"u}nter P. and Pavlicev, Mihaela and Weinreich, Daniel M. and Mills, Rob},       journal         = {Evolution},       year            = {2014},       month           = apr,       volume          = {68},       number          = {4},       pages           = {1124--1138},       doi             = {10.1111/evo.12337},       url             = {http://dx.doi.org/10.1111/evo.12337},     }          @InCollection{ic:bedau:2009:01,       title           = {The Evolution of Complexity},       author          = {Bedau, Mark A.},       pages           = {111--130},       doi             = {10.1007/978-1-4020-9636-5_8},       url             = {http://dx.doi.org/10.1007/978-1-4020-9636-5_8},       crossref        = {c:barberousse:2009:01},     }          @Collection{c:barberousse:2009:01,       editor          = {Barberousse, Anouk and Morange, Michel and Pradeu, Thomas},       title           = {Mapping the Future of Biology},       booktitle       = {Mapping the Future of Biology},       subtitle        = {Evolving Concepts and Theories},       publisher       = {Springer Netherlands},       year            = {2009},       doi             = {10.1007/978-1-4020-9636-5},       url             = {http://dx.doi.org/10.1007/978-1-4020-9636-5},       series          = {Boston Studies in the Philosophy of Science},       volume          = {266},     }      If I cite `ic:bedau:2009:01` when using `\addbibresource{bibliography.bib}`, the cross-reference to `c:barberousse:2009:01` is resolved successfully. If I cite it when using `\addbibresource[location=remote]{<url>.bib}`, however, the cross-reference is not resolved, unless I happen to also cite `c:barberousse:2009:01` somewhere else in the text. I am using an up-to-date version of `MacTeX` and compiling with `pdflatex -> biber -> pdflatex`. Any ideas? Can someone at least confirm that they face the same issue? MWE below. ![Output](http://i.stack.imgur.com/j3BSG.png) # MWE:               \documentclass{article}          \usepackage[backend=biber]{biblatex}          % If I fetch the file from a remote location, cross-refs are not resolved.     \addbibresource[location=remote]{https://dl.dropboxusercontent.com/u/47261882/bibliography.bib}     % If the file is stored locally, everything works okay.     % \addbibresource{bibliography.bib}          \begin{document}     % Does not resolve cross-reference.     \cite{a:watson:2014:01,ic:bedau:2009:01}.     % Resolves cross-reference because it is also cited explicitly.     % \cite{a:watson:2014:01,ic:bedau:2009:01,c:barberousse:2009:01}.          \printbibliography     \end{document}


title: Tikz, how to make underline brace

text: How can I make underline brace for part of formula y+z in a tikzpicture below? I am aware of `underbrace` in math mode, but I want the brace be outside of a `revblock`.               \begin{tikzpicture}     [revblock/.style={shape=rectangle,draw=blue!50,fill=blue!30,                       minimum height=3mm, minimum width=100mm,                       text width=99mm}]     \matrix [column sep=2mm,row sep=2mm,ampersand replacement=\&]     {     \node(rev3name){$\rho_3$:}; \& \node(rev3)[revblock]{$x = y + z$};\\     };     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/uOtVH.png)


title: Table exceeds page width (tabularx and tabulary)

text: I'm trying to fit this table to the page width but I can't. I tried the tabularx environment and the contents got mixed. I tried also the tabulary environment: it's better, the contents are not mixed but the table exceed the page width. The code I'm using for the table, using tabularx is this:               `\documentclass[10pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{graphicx}     \usepackage{multirow}     \usepackage{caption}     \usepackage{tabularx}     \usepackage{tabulary}     \usepackage{booktabs}     \usepackage{footmisc}     \begin{document}     \begin{table}     \scalebox{1}{     \begin{minipage}{1\textwidth}     \centering     \caption{aaaaa aaaaa aaaa aaaa}     \begin{tabularx}{1\textwidth} {X X X X X X X X}     \toprule     Aaaaa aaa & Bbbbbbbbb & \multicolumn{2}{l}{CCCCCC CCCcccccc} & \multicolumn{2}{l}{Dddddddd} & \multicolumn{2}{l}{Eeeeeeeeee\footnote{ccccc ccccc cc} eeeeeee  eeeeeee} \\         \midrule         \multirow{5}[9]{*}{Kitchen} & Refrigerator & 40    &       & \multicolumn{1}{l}{14} & \multicolumn{1}{l}{\multirow{5}[9]{*}{40}} & \multirow{2}[4]{*}{28} & \multirow{5}[9]{*}{55} \\               & Separate freezer & 40    &       & \multicolumn{1}{l}{10} & \multicolumn{1}{l}{} &       &  \\               & Dishwasher & 40    &       & \multicolumn{1}{l}{7} & \multicolumn{1}{l}{} & \multirow{2}[4]{*}{16} &  \\               & Washing machine & 40    &       & \multicolumn{1}{l}{9} & \multicolumn{1}{l}{} &       &  \\               & Others & 40    &       & \multicolumn{1}{l}{-} & \multicolumn{1}{l}{} & 11    &  \\         \multirow{2}[3]{*}{Electric equipment} & Informatics & \multicolumn{2}{l}{\multirow{2}[3]{*}{33}} & \multicolumn{1}{l}{7} & \multicolumn{1}{l}{\multirow{2}[3]{*}{13}} & 12    & \multirow{2}[3]{*}{21} \\               & Entertainment & \multicolumn{2}{l}{} & \multicolumn{1}{l}{6} & \multicolumn{1}{l}{} & 9     &  \\         \multicolumn{2}{l}{Lighting systems} & \multicolumn{2}{l}{13} & \multicolumn{2}{l}{8} & \multicolumn{2}{l}{18} \\         \multirow{3}[6]{*}{HVAC} & Air heating & \multicolumn{1}{l}{9} & \multicolumn{1}{l}{\multirow{3}[6]{*}{11}} & 9     &       & \multicolumn{2}{l}{\multirow{2}[4]{*}{n. a.}} \\               & Air cooling & \multicolumn{1}{l}{2} & \multicolumn{1}{l}{} & 9     &       & \multicolumn{2}{l}{} \\               & Air conditioner & \multicolumn{1}{l}{-} & \multicolumn{1}{l}{} & 9     &       & \multicolumn{2}{l}{2} \\         \multicolumn{2}{l}{Water heating} & \multicolumn{2}{l}{2} & \multicolumn{2}{l}{-} & \multicolumn{2}{l}{n. a.} \\         \multicolumn{2}{l}{Others} & \multicolumn{2}{l}{-} & \multicolumn{2}{l}{30} & \multicolumn{2}{l}{4} \\         \bottomrule     \end{tabularx}     \label{tab:comp_dist_cons_dif_sourc}     \end{minipage}}     \end{table}     \end{document}`      ![enter image description here](http://i.stack.imgur.com/UW4nh.jpg) For tabulary I replace: \begin{tabularx}{1\textwidth} {X X X X X X X X} ... \end{tabularx} by this: \begin{tabulary}{1\textwidth} {J J J J J J J J} \end{tabulary} And I got this: ![enter image description here](http://i.stack.imgur.com/JYya8.jpg) Is there any way to adjust both the table contents and the table width? Thank you in advance.


title: Color name appears before \section name in .pdf hierarchical "tree" links

text: I'm using the package `xcolor` to provide colorful `\section` titles. It looks great but when I make a .pdf, the color name appears before the section name in the .pdf's hyperlinked organizational "tree". For example, in the left pane of my .pdf reader I see the following: > ForestGreenIntroduction I'd like it to read: > Introduction Can I suppress the color name somehow?


title: How to use parameter numbers and \foreach

text: Is there a way to use the TikZ `\foreach` command to do operations with parameters? E.g. I would like to be able to write (just a silly example):               \newcommand{\foo}[9]{              \foreach \x in{1,2,...,9}{             \draw(0,#\x)--++(1,1);              }     }      where `#\x` would mean the _x_ th parameter of the command I'm defining with `\newcommand`. This should come in handy since I'm writing macros that depend on global values that can be set arbitrarily. E.g. `\def\N{9}` would go in preamble and I'd write `newcommand{\bar}[\N]{...}`, but since I don't know beforehand how much parameters there will be, I can't define anything unless I write `\foreach \x in{1,2,...,\N}` and the above draw command. * * * What I actually like to do: I'd like to have a command that plots some coordinates which are given. So I'd like `\foo{#1}{#2}{#3}` to expand to something like;               \draw plot coordinates {(360/\N*1:#1) (360/\N*2:#2) (360/\N*3:#3) ... (360/\N*\N:#N};      but I don't know if this is possible.


title: Latex tabbing: Undefined tab position

text: I am getting error"! LaTeX Error: Undefined tab position." for the following snippet of latex code.               \begin{tabbing}     \> \>$n$ = Some data\\     \> \>$B$ = Another Statement\\     \> \>$N$ = Yet another statement\\     \end{tabbing}      I looked at the related post: Tabbing environment: How to line break?, but I cannot figure out the reason for error. Can someone suggest how to fix this error?


title: How do I position pairs of arrows in TikZ to make 'harpoons'?

text: I wish to use left-right 'harpoons' to show a reversible reaction in a kinetic scheme. I can get part of the way, but how can I vertically shift the horizontal arrows so that I have them separated (to give harpoons) rather than overlying each another? Or is there an altogether better way of doing this? Using TikZ               \usepackage{tikz}     \usetikzlibrary{matrix,arrows}      Then               \begin{tikzpicture}     \matrix (m) [matrix of nodes, column sep=3em]     {A + R & AR & AR* \\};     \path[-left to, font=\scriptsize]     (m-1-1) edge node[above]{$k_{+1}$} (m-1-2);     \path[-left to,font=\scriptsize]     (m-1-2) edge node[below] {$k_{-1}$} (m-1-1);     \path[-left to,font=\scriptsize]     (m-1-2) edge node[above] {$\alpha$} (m-1-3);     \path[-left to,font=\scriptsize]     (m-1-3) edge node[below] {$\beta$} (m-1-2);     \end{tikzpicture}      **Updated:** Thanks to all those that responded with advice - all suggesting routes other than TikZ. These are certainly appropriate in many cases, but the reason I went with TikZ was the desire to generate more complex schemes than simple linear equations (see below). Also, a couple of points, ideally I wanted the harpoons to be a fixed length and the reactants not to be in mathmode (ie roman not italic). I still have no response directly addressing the generation of harpoons in TikZ. ![enter image description here](http://i.stack.imgur.com/jazva.png) The picture above was produced with the following code:               \begin{tikzpicture}               % define matrix     \matrix (m) [matrix of nodes, column sep=3em, row sep=2em]     { & & & AR*\\     A + R & ARb & ARc \\      & & & AD\\};           % agonist binding     \path[-left to, font=\scriptsize]     (m-2-1) edge node[above]{$k_{+1}$} (m-2-2);     \path[-left to,font=\scriptsize]     (m-2-2) edge node[below] {$k_{-1}$} (m-2-1);          % cleft closure     \path[-left to,font=\scriptsize]     (m-2-2) edge node[above] {$\beta$} (m-2-3);     \path[-left to,font=\scriptsize]     (m-2-3) edge node[below] {$\alpha$} (m-2-2);          % channel opening     \path[-left to, font=\scriptsize]     (m-2-3) edge node[above, xshift=-6] {$\delta$} (m-1-4);     \path[-left to, font=\scriptsize]     (m-1-4) edge node[below, xshift=6] {$\gamma$} (m-2-3);          % desensitization     \path[-left to, font=\scriptsize]     (m-2-3) edge node[above, xshift=16] {1000 s$^{-1}$} (m-3-4);     \path[-left to, font=\scriptsize]     (m-3-4) edge node[below, xshift=-10] {10 s$^{-1}$} (m-2-3);          \end{tikzpicture}


title: Undefined control sequence math operators

text: I have an algorithm defined under figure container. For some reason I am getting a strange error in the conditional expression of the second If block statement.               \begin{figure}     \begin{flushleft}     \textbf{Function}: Function\\     \textbf{Output}: Some function\\     \end{flushleft}     \begin{algorithmic}[1]         \For{ $u \in V$}            \If { $MyFu(u,v) \wedge MyFu(v,u)$ }             %something           \Else             %something else           \EndIf           \\           \If{$v \textless w \vee ( w \textless v \wedge u \textless w \wedge \invneg Func(u,w) )$}            %something           \EndIf         \EndFor         \end{algorithmic}         \caption{My algorithm}         \label{fig:function}     \end{figure}      The errors that I get are the following.               LaTeX Warning: Command \textless invalid in math mode on input line 117.     LaTeX Warning: Command \textless invalid in math mode on input line 117.     LaTeX Warning: Command \textless invalid in math mode on input line 117.          ! Undefined control sequence.     <argument> ...\wedge u \textless w \wedge \invneg                                                    Func(u,w) )$     l.117 ...ess w \wedge \invneg Func(u,w) )$}          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      Can anyone suggest what maybe wrong in the conditional expression of second if statement ? Also, how to remove the warning ? Thanks


title: How to scale all fonts (in the whole document) by certain factor or percentage?

text: Is there a way to scale the font size of all text in a LaTeX document by a certain factor, something like `\scalealltext{factor=0.95}`? Edit: Text should reflow, so as to fit (a bit) more text on a page and ultimately trim down the number of pages. Edit2: Apart from wanting to apply it to a specific problem, my question is more general. So giving specific fonts for the specific document I had when this question was raised is IMO not of much use.


title: Problem with enumitem and \raggedright

text: I want my items in lists (`enumerate`, `itemize` and `description`) to be raggedright. So I use `enumitem` package to make things easier               \usepackage{enumitem}     \setlist[enumerate]{before = \raggedright}% In fact I use \RaggedRight from ragged2e package, but it doesn't matter (I think)      But then I found a problem: if the enumerate is in another paragraph it works great; but if it is in the same, the `\raggedright` applies to the paragraph too.               \documentclass{scrartcl}     \usepackage{enumitem}     \setlist[enumerate]{before=\raggedright}          \begin{document}     %   THIS WORKS     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \begin{enumerate}         \item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.         \item Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     \end{enumerate}          %   THIS DOESN'T     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     \begin{enumerate}         \item Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.         \item Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.     \end{enumerate}     \end{document}      ## How can I solve this? Is this a bug? ![enter image description here](http://i.stack.imgur.com/OLgT4.png) **EDIT:** After reading @egreg 's answer. I'm still not completely pleased because I get two different spacing if I compile this               \documentclass{scrartcl}     \usepackage{enumitem}     %\setlist[enumerate]{before=\csname par\endcsname\raggedright}     \begin{document}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.     \begin{enumerate}\raggedright         \item Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.     \end{enumerate}     \end{document}      and this               \documentclass{scrartcl}     \usepackage{enumitem}     \setlist[enumerate]{before=\csname par\endcsname\raggedright}     \begin{document}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.     \begin{enumerate}%\raggedright         \item Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.     \end{enumerate}     \end{document}      And I'm not totally convinced that the second one (egreg's one) is right (the space is larger).


title: Package providing fully expandable conditionals

text: Is there a package providing a collection of fully expandable conditionals like this one:               \newcommand\myif@num[1]     {\ifnum#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}      Background: Let's say I want to program an expandable recursive macro `\foo` which contains a nested use of `\ifnum`. Then this could look like this:               \def\foo#1#2%     {%       ... some stuff ...       \ifnum\bar=\z@% exit condition         \expandafter\expandafter\expandafter\@gobbletwo        \else         \ifnum\baz>\quux% another exit condition           \expandafter\expandafter\expandafter\@gobbletwo          \else            \expandafter\expandafter\expandafter\foo         \fi       \fi       \expandafter{\the\numexpr...}{stuff}%     }      But even this won't work because the last `\fi` is not always destroyed. So off to `\romannumeral` trickery... With the above macro this conditional looks like this:               \def\foo#1#2%     {%       ... some stuff ...       \myif@num{\bar=\z@}       {}       {%         \myif@num{\baz>\quux}         {}         {\expandafter\foo\expandafter{\the\numexpr...}{stuff}}%       }%     }      Much cleaner, isn't it?


title: Annotate grouped bar plot

text: I'm trying to draw a grouped bar plot, but with added dots "on top" to signify outliers in the results. Currently I have:                   \begin{figure}[]           \begin{tikzpicture}             \begin{axis}[                 width  = 1*\textwidth,                 height = 4.5cm,                 major x tick style = transparent,                 ybar=1*\pgflinewidth,                 bar width=13pt,                 symbolic x coords={A,B,C,D},                 xtick = data,                 enlarge x limits=0.25,                 ymax=15,                 ymin=0,                 legend cell align=left,                 legend style={                         at={(1,1.05)},                         anchor=south east,                         column sep=1ex                 }             ]                 \addplot[style={fill=red,mark=none}]                     coordinates {(A, 4.44) (B,0.1) (C,4.37) (D,4.07)};                      \addplot[style={fill=green,mark=none}]                     coordinates {(A, 0.4) (B,0.8) (C,0.3) (D,0.5)};                      \addplot[style={fill=blue,mark=none}]                     coordinates {(A, 0.2) (B,0) (C,0.9) (D,0.8)};                      \addplot[style={fill=yellow,mark=none}]                     coordinates {(A, 9.59) (B,0.2) (C,8.86) (D,8.62)};                  \draw node[fill,circle,scale=0.5]{} (axis cs:A,7);             \draw node[fill,circle,scale=0.5]{} (axis cs:B,11);             \draw node[fill,circle,scale=0.5]{} (axis cs:C,3);             \draw node[fill,circle,scale=0.5]{} (axis cs:D,12);                  \legend{C1,C2,C3,C4}           \end{axis}         \end{tikzpicture}     \end{figure}      This draws the grouped plots etc, but the "dots" always appear at the (0,0) position, ignoring the relative coordinates. See the picture below, where it is close to the "A". Ideally, I'd like to position such a dot above every bar in the graph. How can I properly specify the coordinates? ![Above example](http://i.stack.imgur.com/QdpOw.png)


title: Using \addplot+ and \foreach in pgfplot

text: I have four text files with each 21 columns, and I want to plot, for each file, the first column as x, and then the 20 next columns as y. For each file, then put it all together on the same graph. It's basically 20 replicates under 4 different conditions. I have the following code, using `\foreach`, but I'd like to make it cleaner by using `\addplot+` rather than `\addplot` with the fill argument. If I use `\addplot+` within the `\foreach` loop, then each replicate has it's own color, and it's not really what I want. To be clear, the following code does what I want, but I'd like to hear about solutions to make it nicer.               \documentclass[professionalfonts,11pt]{beamer}     \begin{document}     \begin{frame}{Conséquences des variations du taux de croissance}          \begin{center}         \begin{tikzpicture}             \begin{semilogyaxis}[                 xlabel=Temps,                 ylabel={Taille de population},                 cycle list name = monokai,                 legend pos = north west                 ]                 \foreach \yindex in {2,...,20}                     \addplot[mark = none, draw = RYB1] table [y index = \yindex] {data/vardem_30.dat};                 \foreach \yindex in {2,...,20}                     \addplot[mark = none, draw = RYB2] table [y index = \yindex] {data/vardem_10.dat};                 \foreach \yindex in {2,...,20}                     \addplot[mark = none, draw = RYB3] table [y index = \yindex] {data/vardem_3.dat};                 \foreach \yindex in {2,...,20}                     \addplot[mark = none, draw = RYB4] table [y index = \yindex] {data/vardem_1.dat};             \end{semilogyaxis}         \end{tikzpicture}     \end{center}          \end{frame}     \end{document}


title: Two equations in a block of table

text: ![enter image description here](http://i.stack.imgur.com/ratNZ.png)I make a table, 2*2，               \begin{center}     \begin{table}[H]     \centering     \begin{tabular}{|c|c|} \hline          $F=ax$ &  \nabla F =a $         \\ \hline     $G=a+b\\ K=a+c$ &  $ H=c+d$          \end{tabular}     \end{table}     \end{center}      The above code generates mistakes. In 2*1 block I want a 2 line equation. So I try `\align`,`\equation` and so on. For example,               \begin{center}     \begin{table}[H]     \centering     \begin{tabular}{|c|c|} \hline          $F=ax$ &  \nabla F =a $         \\ \hline     \begin{align*}G&=a+b\\ K&=a+c\end{align*} &  $ H=c+d$          \end{tabular}     \end{table}     \end{center}      But this makes mistake too. So I have to use `$$`, but I do not know how to write two equation in `$$`. Thank you. I am looking forward to your answer. By the way, even this makes mistakes.               \begin{center}     \begin{table}[H]     \centering     \begin{tabular}{|c|c|} \hline          $F=ax$ &  \nabla F =a $         \\ \hline     \begin{equation*}G=a+b \end{equation*} &  $ H=c+d$          \end{tabular}     \end{table}     \end{center}


title: make math symbol italic

text: I must admit that I don't really know my way around LaTeX, pretty much at all. Anyway, here's my problem: I want to include the symbols `\flat` and `\sharp` in my text. Unfortunately I only receive errors when I put them in like that. So I declared this somewhere               \newcommand{\vb}{\ensuremath{\flat}}      and it works quite well. Unfortunately I need my text with this symbol always in italics. So when I write `B\vb` (in italics) the `B` and the flat sign will intersect. Is there any way I can force the flat sign to be italicised?


title: Are itemize and EBGaramond compatible?

text: This MWE works:               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{luainputenc}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{ebgaramond}          \makeatother          \usepackage{babel}     \begin{document}     Here is some plain text in Garamond     \end{document}      But it I put the text in itemize like this:               \documentclass[english]{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{luainputenc}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{ebgaramond}          \makeatother          \usepackage{babel}     \begin{document}     \begin{itemize}     \item Here is some plain text in Garamond     \end{itemize}          \end{document}      I get an error:               ! LaTeX Error: Font family `TS1+EBGaramond-LF' unknown.      This is using pdflatex and texlive 2013 on fedora. It _does_ compile with luatex or xetex Any idea what is going on?


title: How to report *amsart* bugs? (Looks like a bug to me.)

text: I have noticed the following strange behavior when using a custom counter in certain situations in _amsart_ document class. Here is an example:               \documentclass{amsart}     \newcounter{exercise}     \newcommand{\exercise}{\stepcounter{exercise}                            \subsection*{Exercise \theexercise}}     \begin{document}     \exercise     % Text.     \exercise     \end{document}      This prints 2 times "Exercise 2". The behavior goes back to "normal" if i either:   1. replace `amsart` with `article`, or   2. replace `\subsection` with `\section`, or   3. uncomment the text "`Text.`". This will not cause a problem in a useful document because when there is some text between `\exercise`'s, the problem goes away, but i think this can indicate some bug in _amsart_ , so i wanted to report it, but i didn't find where. What should i do?


title: Adding points when plotting a graph: how to do with tikz?

text: ## My question How can I add plots to the graph I am drawing, in order to have a more precise drawing? * * * ## My code I am learning how to plot graphs. Here is the code I use. You can see on the picture that the curve is not smooth: one should use more plots to draw this graph.               \begin{tikzpicture}[domain=-5:8]     \draw[very thin,color=gray] (-5.1,-1.6) grid (8.1,1.6);     \draw[->] (-5.2,0) -- (8.2,0) node[right] {$x$};     \draw[->] (0,-1.7) -- (0,1.7) node[right] {$\sin(x)$};     \draw[color=orange] plot function{sin(x)} ;     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/qnpL3.png)


title: An extensive list of LaTeX symbols and Unicode equivalents?

text: The first two columns of the table here (partly reproduced below) is exactly what I'm looking for, but I'd like a more extensive list. I want the unicode symbols to be in unicode symbols, and not as images or anything else. Symbol TeX ¬ \neg ± \pm · \cdot → \to ⇒ \Rightarrow ⇔ \Leftrightarrow ∀ \forall ∂ \partial etc. But I want as many as possible.


title: New command or environment for numbered examples

text: > **Possible Duplicate:**   >  Good environment for writing math examples   >  How to create a new counter for an a new environment that is in sync with > subsections So I looked at the `\newcommand` command and I'm not quite sure how I can use that to my advantage. So I'm asking for your help :) I am making a paper which has problems and examples in it. And I would like to have a command which will automatically make a mini text, let's say: `Example 1`, or `Example 1.1` (according to the sections and subsections), that is bolded and in a specific color. Currently I have the following syntax:               {\bf \color{Green}Example 3.}\bigskip          Show this and that...          {\bf \color{Emerald}Solution:}\bigskip      And this looks fine in PDF, but it get's kinda tedious. I have to watch what is the example number, and have I accidentally repeated it and so on. The same would be for exercises. How can I do something like that, so that I only have to write (in code) `\example` or just `\begin{example}`.


title: How to create a new counter for an a new environment that is in sync with subsections

text: I want to create an example environment with a counter which will be in sync with my subsections. So I'll have: > subsection 3.2   >  lemma 3.2   >  example 3.2   >  example 3.3   >  lemma 3.3 > > subsection 3.3   >  example 3.3   >  example 3.4 I find it hard to understand the `\newcounter` command and how it works. Plus, is there a command for `\onsectionchange` \- so I can do (in pseudo code):               \onsubsectionchange{     %example counter := subsection counter     }


title: Vertically connected boxes with text and math inside them

text: I want to have lots of boxes (see http://www.texample.net/tikz/examples/boxes- with-text-and-math/) with text and math inside them. These boxes are arranged vertically and connected by a line. How may I do it with LaTeX?


title: Custom numbering of listings

text: I have a number of listings in my document, numbered 1, 2, 3 and so on. I need a table with three listings (say, three different variants of the same algorithm), that will be numbered as 2a, 2b, 2c. The very next listing would be numbered as 3.


title: Is there a possibility to sort a bibliography by language/author/title?

text: For getting the list of bibliography with `biblatex` I use this code:               ...     \printbibheading     \printbibliography[keyword=primary,heading=subbibliography,title={Les sources principaux}]     \printbibliography[notkeyword={primary,ncite},heading=subbibliography,title={Les sources secondaires}]     ....      I use different types of bib-entries like `@Book`, `@Article`, `@Misc`, `@Incollection`, `@Inproceedings`, etc. I would like to sort the bibliography   1. by language in this order: French, German, English, Polish, Greek, Russian   2. by the author’s surname   3. by title (because a lot of entries do not have an author’s name) Is there a possibility to get this type of sorting for every subbibliography title?


title: Plot TikZ items with respect to 3D position, not the order of appearance in the code

text: I have a big bunch of polygons plot in 3D with TikZ. The code is generated by a program, so it's hard for me to print the "foreground" polygons last, so that they are well printed in space. In other words, if the last line of my TikZ code is a polygon "behind" the others with respect to the projection I use in TikZ, I want this last polygon to be "hidden" by the foreground ones, even though the `\fill` command was used before. Is there an option to do this?


title: How to calculate with metadata in footer

text: I have footer that draws on a svn version data field (package: svn-multi). I would like to perform a simple calculation that subtracts a number from the reported version. The footer code is `\lfoot{Ver: \textcolor{red}{1:}\textcolor{red}{\svnkw{LastChangedRevision}}}` Currently `\svnkw{LastCHangedRevision}` is set at 286 so for this and future reports I need it to present 'LastCHangedRevision-285' In response to MWE request:               \documentclass[a4paper]{article}          % Versioning     \usepackage{svn-multi}     \svnidlong {$HeadURL:  $}{$LastChangedDate: 2012-02-21 10:20:32 +0000 (Tue, 21 Feb 2012) $}{$LastChangedRevision: 287 $}{$LastChangedBy: $}     \svnid{$Id: BESA-2012.tex 287 2012-02-21 10:20:32Z $}          \usepackage{fancyhdr}     \pagestyle{fancy}     \usepackage{color, lastpage}     \renewcommand\headrulewidth{0.0pt} \renewcommand\footrulewidth{0.2pt}     \lhead{} \chead{} \rhead{}     \cfoot{\svnkw{LastChangedDate}} \lfoot{Ver:     \textcolor{red}{1:}\textcolor{red}{\svnkw{LastChangedRevision}}}     \rfoot{\thepage/\pageref{LastPage}}          \begin{document}


title: Getting a "missing } inserted" error

text: I'm a LaTeX newbie so pardon my ignorance. I'm getting a "missing } inserted" one the last line of this code. Any help greatly appreciated!               \documentclass[a4paper]{article}          \usepackage{tabularx}          %\usepackage{doublespace}     %\setstretch{1.2}          \usepackage{ae}     \usepackage[T1]{fontenc}     \usepackage{CV}     \usepackage[normalem]{ulem}     \usepackage{parskip}          \addtolength{\textwidth}{1in}     \addtolength{\hoffset}{-.5in}     \addtolength{\textheight}{.75in}     \addtolength{\voffset}{-.75in}           \setlength\parindent{0pt}               \begin{document}                    \pagestyle{empty}          %Ueberschrift     \begin{center}     \huge{\textsc{Robert Elder}}\\     \small{\textsc{Assistant Professor of History}     \vspace{\baselineskip}                    \small{\textsc{Tabor College \\ 400 S. Jefferson St. \\ Hillsboro, KS 67063 \\ Phone   (office): 620-947-3121 ext. 1064 \\ Phone (cell): 864-506-6830 \\ roberte@tabor.edu}}     \end{center}


title: Draw a factor graph with tikzpicture

text: Ordinarily I draw graphs in tikz with:               \begin{tikzpicture}         \Vertex[x=1,y=1]{x1}         \Vertex[x=2,y=1]{x2}         \Vertex[x=3,y=1]{x3}         \Vertex[x=4,y=1]{x4}         \Vertex[x=5,y=1]{x5}         \Edge(x1)(x2)         \Edge(x2)(x3)         \Edge(x3)(x4)         \Edge(x4)(x5)     \end{tikzpicture}      Now I want to draw a factor graph, where the vertices are squares instead of circles. This is the only difference. I can't, however, find out how. How do I?


title: show metadata into the pdf

text: Super noob question: is it possible to show the **metadata** inserted with hyperref into the generated pdf itself? I don't mean to set them during generation, that would be easy. I know that is not possible or somewhat hard to search and replace strings of text into a pdf after creation. I've some nice LaTeX invoice template, where normally, only some data changes. I would like to use C or Objective-C to change those data after the PDF is generated. It seems to me that the metadata are, maybe, more accessible programmatically and I would not like to loose the excellent LaTeX typeset text of the PDF. I would like to use metadata as some sort of baked in database. Am I crazy? For example, the "author" field could be set to a placeholder value like XXX, then I would later set/change it by only accessing PDFs metadata, programmatically (in other words in post-production without LaTeX). It's like a fillable pdf but with metadata as a mean to update the text. **EDIT** I know it could be an automation distorted idea but the problem arise from the usage scenario. I would like to produce a simple invoicing app for iOS (iPhone and iPad) and I would like to use the nice typeset pdf I created with LaTeX. I know i can't embed TEX into the app because of various licensing problems. At the same time I don't like to depend on an external, network reachable, TEX engine like scribtex.


title: Can a CMYK PDF be hacked or converted to duotone?

text: > **Possible Duplicate:**   >  duotone PDF files with lualatex I have CMYK PDF files compiled with `lualatex`, but the publisher requires duotone. I've seen some cool tricks about manipulating the colour channels and separating them. Perhaps something like this can be used to hack a CMYK file and create a duotone file? Or colour separated files that the publisher might be able to use? Or perhaps this is technically not feasible.


title: Can't write Greek RecipeName in xcookybooky

text: I am using `xcookybooky` to create my own cookbook in greek. Until now I was using `iso-8859-7` encoding in all my documents and it was working fine. With `xcookybooky` there is an issue with this particular encoding. All the letters appear like "Chinese" and the weird thing is that there are no errors. I tried to change the encoding to `utf8` and something rather strange happened. All greek letters appeared as they should be, exept from the RecipeName. There are also some errors that have to do with greek letters and T1. My code is               \documentclass{article}          \usepackage[english,greek]{babel}     \usepackage[utf8]{inputenc}     %\usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}          \usepackage{tikz} % for creating the lines for the hint     \usepackage{xcolor}     \usepackage{wrapfig} % To wrap the tabular with the ingredients     \usepackage{ifthen}     \usepackage{xkeyval}     \usepackage{lettrine} % numbering the preparation steps     \usepackage{fancyhdr}     \usepackage{units}     \usepackage{tabularx} % line breaks in tabular     \usepackage{xcookybooky}          \begin{document}     \begin{recipe}{Μπανάνα}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \ingredients{     2 αυγά\\     3 & μπανάνες\\     \unit[200]{ml} & βούτυρο\\     \unit[40]{g} & ζάχαρη\\     \unit[50]{g} & κακάο     }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \preparation{     \step Πρώτο βήμα     \step Δεύτερο Βήμα     \step Τρίτο Βήμα     \step Τέταρτο Βήμα     }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\setRecipenameFont{cmr}{T1}{m}{n}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \setHeadlines{     inghead = Υλικά,     prephead = Προετοιμασία,     hinthead = Μυστικό,     }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \end{recipe}     \end{document}      My outputs are **utf8 encoding** ![enter image description here](http://i.stack.imgur.com/bKqRZ.png) **iso-8859-7 encoding** ![enter image description here](http://i.stack.imgur.com/9tMkl.png) Any ideas on that? Note that I'm using `pdflatex`.


title: Accessing author name without natbib

text: I am finalizing a paper that I wrote using natbib. The publisher rejected my initial submission as it used abbrvnat.bst and asked me to use their specific .bst file (which rules out natbib). I have searched - looks like that there is no way to get author names out and not use natbib with bibtex. What I have:   1. A LaTeX file with all the citations added in (and some \citeauthor{} commands).   2. A .bib file containing all the references.   3. Publisher supplied bst file. In case you are curious, this is RSC. I am open to using biblatex if that will solve the problem. The publisher is silent about biblatex (they give me the option of supplying all the special .sty files I used). The biblatex manual is quite useless from a quick read standpoint. Can someone give me a barebones example of how to use biblatex in my situation? I have not provided a MWE because it quite obviously does not make sense. What I have does not work.


title: How can I get rid of the numbering of one section in the header?

text: My last chapter is called "Anhang" and I wrote in LaTeX `\section*{Anhang}`. Then it doesn't have a numbering but for the heading I get `5.Anhang`. How can I get rid of the `5.` (the number is from the section before)?                 \documentclass[a4paper,12pt]{article}       \pagestyle{headings}       \def\eop{\hfill$\square$}       \begin{document}            \section*{Anhang}       \sectionmark{Anhang}       \addcontentsline{toc}{section}{Anhang}       \end{document}      Thank you so much.


title: Modify abbrvnat bibliography style so that last name comes first in typeset entries

text: I use `\bibliographystyle{abbrvnat}` as bibliography style in LaTeX `\documentclass{book}`. All is fine except that I would like the bibliography to sort alphabetically the last name of the author, instead of his/her initials. Has anybody come across that? Any help is much appreciated.


title: Minted Listings don't behave the way they should

text: I'm quite new to `La/TeX` and I have a question about the package `minted` and it's listing feature. I'm using a `LaTeX` template from someone else who gave it to me. He used the listing feature as well but the output in his case isn't the way I want it to be. This is what it looks like ![what it look like](http://i.stack.imgur.com/DsTks.png) This is the what I want it to look like (except for the red rectangle) ![what it should look like](http://i.stack.imgur.com/Yzbxo.png) I want the listing caption to look the default `LaTeX` way plus I don't want all the frames and stuff. Here's the code I used:                   \begin{listing}[H]           \begin{minted}{cpp}         #include <string>         int main(){         // Example comment         ExampleNamespace::object* stuff;         int e, x, a, m, p, l, e=0;         double d = 3.0;         string i = "donno";          stuff->setSomeMoreStuff("stuff");         // bring it to an end         return EXIT_SUCCESS;         }         \end{minted}         \caption{Stuff doing stuff (C++)}         \label{lst:Stuff}         \end{listing}      to produce the first listing I included it in my main.tex. The problem is I don't know what causes this listing appearance. So I deleted everything that was `minted`-related and differed from the this template. BUT WHATEVER I DO after compiling main.tex THE OUTPUT STAYS THE SAME. The second listing is made by using this (same this-link as above) template. in order to find stuff in the main.tex I can delete, I searched for 'minted' 'mint' 'listing' and so on ... this is what I deleted in my main.tex (I don't know what it did/what it was for):               \makeatletter     \newcommand{\minted@write@detok}[1]{%      \immediate\write\FV@OutFile{\detokenize{#1}}}%          \newcommand{\minted@FVB@VerbatimOut}[1]{%       \@bsphack       \begingroup         \FV@UseKeyValues         \FV@DefineWhiteSpace         \def\FV@Space{\space}%         \FV@DefineTabOut         %\def\FV@ProcessLine{\immediate\write\FV@OutFile}% %Old, non-Unicode version         \let\FV@ProcessLine\minted@write@detok %Patch for Unicode         \immediate\openout\FV@OutFile #1\relax         \let\FV@FontScanPrep\relax     % DG/SR modification begin - May. 18, 1998 (to avoid problems with ligatures)         \let\@noligs\relax     % DG/SR modification end         \FV@Scan}         \let\FVB@VerbatimOut\minted@FVB@VerbatimOut          \renewcommand\minted@savecode[1]{       \immediate\openout\minted@code\jobname.pyg       \immediate\write\minted@code{\expandafter\detokenize\expandafter{#1}}%       \immediate\closeout\minted@code}     \makeatother      Like L said THE OUTPUT STAYED THE SAME! I use the Texmaker editor and I compile with:               pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex|biber %.bcf|makeindex %.nlo -s nomencl.ist -o %.nls|pdflatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex|evince %.pdf      I wonder whether there is any package included in the main.tex (there are a lot included) that causes this behaviour. Maybe my `LaTeX` setup saved this style after first compiling and if I change something afterwards and recompile it the compiler doesn't care... Btw, sorry my bad english... If there's anything you don't understand let me know.


title: How to put lots of brackets

text: I want to show all valid bracketed strings made from {} [] (). This is the intended output:               {[()]}     {[]()}     {[]}()     {([])}     {()[]}     {()}[]     {}[()]     {}[]()     {}([])     {}()[]     [{()}]     [{}()]     [{}]()     [({})]     [(){}]     [()]{}     []{()}     []{}()     []({})     [](){}     ({[]})     ({}[])     ({})[]     ([{}])     ([]{})     ([]){}     (){[]}     (){}[]     ()[{}]     ()[]{}      This is what I did:               \{[()]\}\\     \{[]()\}\\     \{[]\}()\\     \{([])\}\\     \{()[]\}\\     \{()\}[]\\     \{\}[()]\\     \{\}[]()\\     \{\}([])\\     \{\}()[]\\     [\{()\}]\\     [\{\}()]\\     [\{\}]()\\     [(\{\})]\\     [()\{\}]\\     [()]\{\}\\     []\{()\}\\     []\{\}()\\     [](\{\})\\     []()\{\}\\     (\{[]\})\\     (\{\}[])\\     (\{\})[]\\     ([\{\}])\\     ([]\{\})\\     ([])\{\}\\     ()\{[]\}\\     ()\{\}[]\\     ()[\{\}]\\     ()[]\{\}\\      However, some of these cause an error. Any idea why this is happening? What is the best way to go about this? Edit: Sorry for not putting up an MWE and the full example. This is my old `.tex` file. The ones that are commented are the ones causing an error(!Missing number, treated as zero. \protect):               \documentclass{article}     \begin{document}        Lots of Brackets:\\        \texttt{           \{[()]\}\\           \{[]()\}\\           \{[]\}()\\           \{([])\}\\           \{()[]\}\\           \{()\}[]\\           \{\}[()]\\           \{\}[]()\\           \{\}([])\\           \{\}()[]\\           %[\{()\}]\\           %[\{\}()]\\           %[\{\}]()\\           %[(\{\})]\\           %[()\{\}]\\           %[()]\{\}\\           %[]\{()\}\\           %[]\{\}()\\           %[](\{\})\\           %[]()\{\}\\           (\{[]\})\\           (\{\}[])\\           (\{\})[]\\           ([\{\}])\\           ([]\{\})\\           ([])\{\}\\           ()\{[]\}\\           ()\{\}[]\\           ()[\{\}]\\           ()[]\{\}\\        }     \end{document}      Thanks to David Carlisle's answer, I now know the exact problem. This `.tex` file works perfectly:               \documentclass{article}     \begin{document}        Lots of Brackets:\\        \texttt{           \{[()]\}\\\relax           \{[]()\}\\\relax           \{[]\}()\\\relax           \{([])\}\\\relax           \{()[]\}\\\relax           \{()\}[]\\\relax           \{\}[()]\\\relax           \{\}[]()\\\relax           \{\}([])\\\relax           \{\}()[]\\\relax           [\{()\}]\\\relax           [\{\}()]\\\relax           [\{\}]()\\\relax           [(\{\})]\\\relax           [()\{\}]\\\relax           [()]\{\}\\\relax           []\{()\}\\\relax           []\{\}()\\\relax           [](\{\})\\\relax           []()\{\}\\\relax           (\{[]\})\\\relax           (\{\}[])\\\relax           (\{\})[]\\\relax           ([\{\}])\\\relax           ([]\{\})\\\relax           ([])\{\}\\\relax           ()\{[]\}\\\relax           ()\{\}[]\\\relax           ()[\{\}]\\\relax           ()[]\{\}\\\relax        }     \end{document}      However, I ended up putting all these in another file and using the `listings` package and the `\lstinputlisting` command to insert text directly from a file.


title: How to dynamically give key names with expl3?

text: I have a property list which associate names with values name 1 -> value 1   name 2 -> value 2   ... I want to use names from the property list to dynamically create keys. The following code               \documentclass{article}     \usepackage{expl3}     \begin{document}     \ExplSyntaxOn     \prop_new:N   \l_my_prop      \prop_put:Nnn \l_my_prop { name1 } { val1 }     \prop_put:Nnn \l_my_prop { name2 } { val2 }          \prop_map_inline:Nn \l_my_prop       {         \keys_define:nn { phylogenetictree }            {             #1 .tl_gset:c = \l_#1_tl           }       }     \ExplSyntaxOff     \end{document}      gives an error               ! Undefined control sequence.     <argument> \l_          name1_tl     l.15   }          The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      Why this code isn't working ? Is there a better way to achieve this ?


title: gb4e leaves extra space before translation

text: gb4e leaves extra (unwanted) blank line space between gloss and translation. Same problem as here: Why is the gap between the translation and the last line of the gloss so wide in my interlinear gloss? but the answer there (`cgloss.sty`) doesn't always fix the problem. In the following code - the third `\glt` line has a wide space before it:               \documentclass{article}     \usepackage[safe]{tipa}          \usepackage{gb4e,cgloss}          \begin{document}          \begin{exe}         \ex \gll kma t'-\textschwa{l}\v{c}qu-(\textgamma)in \\         {\sc 1sg}  {\sc 1sg.sub-}see-{\sc 2sg.obj} \\         \glt `I saw you.' (S1:71)              \ex \gll q-\textschwa{l}\v{c}qu-{\textbeta}um kma\\         {\sc 2.irr-}see-{\sc 1sg.obj} {\sc 1sg}\\         \glt `Look (at) me.' (S1:75)              \ex kma t-k'o{\textbeltl}-ki\v{c}en \\         {\sc 1sg} {\sc 1sg.subj-}come-{\sc 1sg.subj} \\         \glt `I came/arrived.' (S3:13)          \end{exe}     \end{document}


title: help with my kludges -- manipulating whitespace in minipages

text: I'm using `captionof` to kludge some sidecap-like figures. `sidecap` wouldn't let me use my other kludge to get the horizontal rules. I like the first example figure but I don't like how the whitespace surrounds the caption in the second figure. There are lots of locations in the minipage environment to manipulate the vspace. Any tips where would be a consistent (ideally global) way to get the captions positioned correctly?               \documentclass[11pt]{article}     \usepackage[demo]{graphicx}     \usepackage{lipsum}     \usepackage{sidecap}     \usepackage{wrapfig}     \usepackage{capt-of}     \usepackage{geometry}           \begin{document}     \lipsum[1]     \begin{figure}[htb]     \begin{minipage}{\textwidth}     \noindent\rule{\textwidth}{0.5pt}     \begin{minipage}{.45\linewidth}     \includegraphics[width=\linewidth]{test.pdf}     \end{minipage}\hfill     \begin{minipage}{.5\linewidth}     \captionof{figure}{ test }     \label{fig:test}     \end{minipage}\hfill     \noindent\rule{\textwidth}{0.5pt}     \end{minipage}     \hfill     \end{figure}          \lipsum[1]     \begin{figure}[htb]     \begin{minipage}{\textwidth}     \noindent\rule{\textwidth}{0.5pt}     \begin{minipage}{.45\linewidth}     \includegraphics[width=\linewidth]{test.pdf}     \end{minipage}\hfill     \begin{minipage}{.5\linewidth}     \captionof{figure}{ Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pel- lentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum. }     \label{fig:test}     \end{minipage}\hfill     \noindent\rule{\textwidth}{0.5pt}     \end{minipage}     \hfill     \end{figure}          \end{document}


title: using a Postscript Type 1 font with fontspec and LuaLaTex on MacOSX

text: I am having trouble using SabonLT which is a Postscript Type 1 Outline font. I have the font installed as a system font (as described here) rather than a local font. I'm running LuaLaTex on Mac OSX. I have checked in `/Users/<username>/Library/texlive/2012/texmf -var/luatex- cache/generic/names/otfl-names.lua` but indeed no Sabon font is listed there. I have tried both with and without the path specification in the fontspec call: `\setmainfont[Path=/Library/Fonts/]{Sabon LT}`. (Though there is no way to specify the extension because Postscript Type 1 fonts don't have one.) But no matter what I do I get the following error: `fontspec error: "font-not- found"`.


title: Break line only if it's too long, but breaking won't create a new page

text: I'm the author of the `contracard` package/class for typesetting calling cards for traditional dances. Currently, if you typeset a particularly long figure on a calling card it wraps like this (look at the 'Ladies left hand star all the way' in B1): > ![Contra dance typeset normally](http://i.stack.imgur.com/KI0TA.png) However, the way dance cards work if you're reading down the list your eye needs to jump straight to the beginning of each move. When a line wraps like that, I'd like it to break at the separator (the semi-colon in this case) like so: > ![Contra dance typeset correctly](http://i.stack.imgur.com/8x7yg.png) This makes it much easier for your eye to jump to the ladies chain. Unfortunately, there's even more to it than that. Since we're dealing with index cards here and space is rather tight, I would like to return only if doing so would _not_ create a page break anywhere inside the containing environment (the `contra` environment in my package, or `mweenv` in the MWE below). For instance, if you have a really, really, long line that takes up a full line and part of the previous line:               | A1. This is a figure; This is a really, really, long     |     |     figure that takes up an entire line and the next one |      and you break it at the semi-colon:               | A1. This is a figure;     |     This is a really, really, long figure that takes up  |     |     an entire line and the next one |      There's a chance that the new (third) line that's created will cause a new page break. If so, this line should be left alone. At first I thought this would be as simple as getting the remaining space left on the line, checking if the width of the new moves text was smaller than that, and breaking if not. According to several threads online, however, this information isn't available from TeX's programming layer, so that's a no go. I then thought I could store the previous moves text in a temporary macro somewhere, compare the whole line to the `\columnwidth` (this should always be one column, but you never know I guess), and break only if it's longer. This is actually difficult to do because there may be more than two moves on a line, things like semi-colons and commas get inserted at certain counts, etc. This is not unsurmountable, however, it would just require a lot of fiddling and would end up being rather hackish in the end. As for checking if a page break is created, I couldn't think of a way to do that without saving the number of pages to a temp file and recompiling once for every long line to see if they change. If you have more than a handful of dances this turns into a _lot_ of compiles (if you have 10 dances with 4 long figures that require two recomipiles each that's 80 recompiles). So my question is simply: _Am I making this overly complicated? Is there some better way to do this, or make the line easier to read in a different way?_ A MWE (sort of; the description is probably what's really needed here as a lot of the package-specific stuff that makes this complicated can't be present in a MWE) is presented below:               \documentclass{article}     %     \usepackage[margin=0.5in,top=0.75in,paperwidth=6in,paperheight=4in]{geometry}     \usepackage{ifthen}     %     \newenvironment*{mweenv}{}{}%     \newcounter{textcounter}     \setcounter{textcounter}{1}     \newcommand{\inserttext}[1]{%      \ifthenelse{\value{textcounter}=1}{\par}{}#1%      \ifthenelse{\value{textcounter}=1}{;\ \setcounter{textcounter}{0}}{\setcounter{textcounter}{1}}%     }     %     \begin{document}     %     \begin{mweenv}     \inserttext{This is a long line that wraps around the document}%     \inserttext{A line break should happen at the semi-colon if it would not cause     the page to break as well.}     \inserttext{This is more text}\inserttext{It should not break}%     \end{mweenv}     %     \end{document}      Sorry for the long, rather vague, question. Please let me know if any clarification is needed. (Worth noting, this question is in regards to this specific issue on GitHub)


title: individual path distance between nodes

text: I have been using the Tikz package to draw NFA's and DFA's, and it's a good package to do so with, but sometimes I have to be extra creative in my setup of it. It would be much easier if there was a possibility to make change one distance between two nodes. Does anybody know if such a possibility exists with the Tikz package?               \documentclass[a4paper,12pt]{article}     \usepackage{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows,automata}          \begin{document}          \begin{figure}     \begin{tikzpicture}[node distance = 2cm]          \node[initial,state]        (1)                     {$1$};     \node[state]                (2) [right of=1]        {$2$};     \node[accepting,state]      (3) [right of=2]        {$3$};          \path (1) edge    node  {}  (2)           (2) edge    node  {}  (3);     %ex make the distance between node 2 and 3 more than 2 cm          \end{tikzpicture}     \end{figure}          \end{document}


title: Is the Standard LaTeX Book class capable of a Novel's dimensions, and the front back matter?

text: Can the standard LaTeX “Book” class adjust to the paper size and structure of a Novel sized book? It would be smaller than the standard dimensions that LaTeX seem to be setup for. The LyX dialog box for adding a custom paper size keeps the [ok] button grayed out after I’ve made my adjustments. Would that requires another package to support customization, or does it require an adjustment in the settings of MikeTeX first? I’d like to customize the standard paper sizes used in Novels, for instance those that fit nicely on a bookshelf with other novels, something small but not tiny. (http://en.wikipedia.org/wiki/Book_size) The “12mo” paper size would be perfect; it’s an American Library Association standard size, also known as "Duodecimo" 17.5-20 cm (5” x 7-3/8”). Is the standard LaTeX using Book Class capable enough for typesetting a novel in final form typesetting a page that would fit on those dimensions, even if I have to use 8.5 X 11 and trim it, with all the proper pieces (front matter, main matter, back matter) of a commonly published novel? I’m not thinking of a submittal to an editor, and not a submittal to a publishing house that converts submittals using their own system, but rather something that could be used for direct printing from pdf? LyX or another LaTeX front end seems like the perfect solution for a Fiction project if the default packages are all that’s necessary. I suppose if it can handle a scientific textbook with tables, formula and diagrams, then it’s more than capable enough. That’s why I’m thinking that I could just use the Standard LaTeX Book class and create a template to fill in on LyX, and all the text would be typeset with precision, all in its proper spot, with the excellent word spacing and justification controls that LaTeX excels at, since a Novel is the simplest type of book, page after page of the same font and formatting. But I'd use the KOMA Book (scrbook) class or Memoir if necessary. Also, I’ll probably just use InkScape, Scribus or Gimp for the front and back cover graphics and skip text altogether there. The scenes would not be numbered like "2.4.2.1". A Novel usually has the following layout:   * Front Cover (use a graphics program: Scribus, InkScape or GIMP)   * Front Matter   * Table of Contents   * Dedication   * Prologue   * Main Matter (Parts, Chapters, Scenes, and insets for monologues or poem)   * Epilogue   * Back Matter   * Back Cover (use a graphics program: Scribus, InkScape or GIMP)


title: Adding a dictionary definition

text: Does anyone know of a package that supports dictionary definitions? I was thinking of something like this: ![enter image description here](http://i.stack.imgur.com/5Trgz.png) Source: Luscombe et al (2001), Yearbook of Medical Informatics. A) the easiest would probably be to type it in yourself and stick it in a parbox B) nicer would be to be able to link it in from a dictionary file C) even better would be to link it in and to just call it with the correct formatting


title: Editing a signature block

text: I am trying to get a signature block that look exactly like what is shown below, but I am unable to achieve it in LaTeX. Can anybody be of help to me. Please note that the Jun 13 is left aligned, while the Offshore Ops is directly below the Deputy General.                                                                           AA ABCDEF                                                                 Deputy General     Jun 13                                                      Offshore Ops


title: How can I make dateplot x-ticks steps to 4 years?

text: I'm currently trying to create a nice election diagram for Bavaria. This is what I got by now: ![enter image description here](http://i.stack.imgur.com/Bsk6m.png) ## LaTeX source Complete source with Makefile and data is on Github. Here is the LaTeX-part without csv-file:               \documentclass[varwidth=false, border=2pt]{standalone}     \usepackage[utf8]{inputenc} % this is needed for umlauts     \usepackage[ngerman]{babel} % this is needed for umlauts     \usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf     \usepackage[margin=2.5cm]{geometry} %layout          \usepackage{pgfplots}     \usepgfplotslibrary{dateplot}     \usetikzlibrary{pgfplots.dateplot}          \begin{document}     \begin{tikzpicture}         \begin{axis}[                 date coordinates in=x,                 xticklabel={\year},                 x tick label style={align=center, rotate=45},                 yticklabel=$\pgfmathprintnumber{\tick}$\,\%,                 date ZERO=1946-06-30,                 xmin={1946-01-01},                 xmax={2010-01-01},                 extra y ticks={5},                 /pgfplots/ytick={0,10,...,100},                 ymin=0, ymax=100,                 width=15cm, height=8cm,     % size of the image                 grid = major,                 grid style={dashed, gray!30},                 legend style={at={(1.15,1)}, anchor=north}              ]               \addplot[blue, dashed, mark=triangle*] table [x=Wahltag, y=Wahlbeteiligung, col sep=comma] {landtagswahlen-in-bayern.csv};               \addplot[black,mark=square*] table [x=Wahltag, y=CSU, col sep=comma] {landtagswahlen-in-bayern.csv};               \addplot[red,mark=square*] table [x=Wahltag, y=SPD, col sep=comma] {landtagswahlen-in-bayern.csv};               \addplot[green,mark=square*] table [x=Wahltag, y=GRÜNE, col sep=comma] {landtagswahlen-in-bayern.csv};               \addplot[yellow,mark=square*] table [x=Wahltag, y=FDP, col sep=comma] {landtagswahlen-in-bayern.csv};               \legend{Wahlbeteiligung,CSU,SPD,Grüne,FDP}         \end{axis}     \end{tikzpicture}     \end{document}      ## Questions How can I make 4-year steps for x ticks? Can I make one label for every year in the csv-file?


title: Lyx hierarchical lists

text: there. I am trying to build a list like this in LyX, but I CANNOT. I need to write something after 1. ![enter image description here](http://i.stack.imgur.com/S9e2A.png) Any idea to do this in LyX? I can do it in LaTeX using code. Thanks!


title: Does standalone LaTeX exist?

text: Is there a standalone version of LaTeX that might run of, say, a USB stick? So a version that doesn't need installing. I am looking for something to run under Windows.


title: Excess vertical space in mdframed ending with display math environment

text: When the `mdframed` environment ends with an `align` there is excess vertical spacing at the bottom. I would like to adjust the `MyBoxedEnvironment` environment such that the vertical space at the bottom is uniform independent of the contents of the box ending with text or an `align` environment. ![enter image description here](http://i.stack.imgur.com/N1Byh.png) All the cases ( **#1** and **#3** in the MWE) where I don't like the excess spacing are in red. The others (not shown in included image) in yellow seem ok to me (See Page 2 of output). ## Notes:   * To not have multiple nested boxes, the `MyBoxedEnvironment` applies the solution from Adjust environments's behaviour when nested.   * To ensure that box is always the full `\linwidth` the contents are wrapped within a `minipage`. This is really only needed to fix this for the very first test case.  Note that in the first part of the included image (where the environments are not nested) the vertical spacing at the bottom is ok. Before settling on the `minipage` solution, I attempted to use `\hfill` but that resulted in excess vertical space in the first box.   * This does not seem related to Spurious space above align environment at top of page/minipage ## Questions:   1. How do I adjust this within the `mdframed` environment without manually adding a vertical adjustment to the contents of the box which are being `\input` from an external file?   2. Also why does the vertical spacing on _Case 5_ change slightly if the text "Case 5" is removed? This does not bother me, but just curious as to the cause. * * * ## Update: 2012-03-12: The MWE code has been updated to simplify comparison with the original and the current proposed solution by @DavidCarlisle. This solution works great for Case 1 and Case 3 (where we end with a display math environment). But has problems with Cases 2, 4 thru 7 where the environment does not end with a display math and eats the last line. However, after incorporating the suggestion mentioned in the comments the last line is no longer gobbled. So, now the only remaining problem is the additional vertical space at the top Here is am image of Case 3 to show the problem. The original output (via `MyBoxedEnvironmentOld`) is shown on the left and the new output (via `MyBoxedEnvironmentNew`) is shown on the right. Note that there seems to be extra vertical space at the top of the display math environment. ![enter image description here](http://i.stack.imgur.com/gCuft.png) So, I attempted to apply the solution from Spurious space above align environment at top of page/minipage by un-commenting the included code, then we get: ![enter image description here](http://i.stack.imgur.com/eTloo.png) ## Code: (Updated 2012-02-13)               \documentclass{article}     \usepackage[paperheight=25.0in]{geometry}     \usepackage{amsmath}     \usepackage{xcolor}     \usepackage{mdframed}          %%%% This adjustment from the URL below has no effect here.     %%%% http://tex.stackexchange.com/questions/36954/spurious-space-above-align-environment-at-top-of-page-minipage     %%     %\usepackage{etoolbox}     %\makeatletter     %\pretocmd\start@align{%     %  \if@minipage\kern-\topskip\kern-\abovedisplayskip\fi     %}{}{}     %\makeatother               \colorlet{MyBackgroundColor}{yellow!10}          \newmdenv[         backgroundcolor=MyBackgroundColor,         linewidth=1.5pt,         skipabove=0pt,         skipbelow=0pt,         innerleftmargin=1pt,         nobreak=true,         ]{MyBoxedEnvironmentMdframed}          % Should be no harm with trailing % here.     \newenvironment{MyBoxedEnvironmentOld}{%         \def\MyBoxedEnvironmentOld{%             \let\endMyBoxedEnvironmentOld\empty%             \par\noindent\ignorespaces%         }%         \begin{MyBoxedEnvironmentMdframed}%         \begin{minipage}{\linewidth}%               to fix very first test case         \par\noindent\ignorespaces%     }{%         %\hfill% ensure full line width of first test case {minipage version is better}.         \end{minipage}%         \end{MyBoxedEnvironmentMdframed}%         \ignorespacesafterend%     }%          \makeatletter%     \newenvironment{MyBoxedEnvironmentNew}{%         \def\MyBoxedEnvironmentNew{%             \let\endMyBoxedEnvironmentNew\par%             \par%\noindent\ignorespaces%         }%         \begin{MyBoxedEnvironmentMdframed}%         \begin{minipage}{\linewidth}%               to fix very first test case         \par%\noindent\ignorespaces%     }{%         \par%         \setbox0=\lastbox%         \ifnum\ht\z@=\z@%             \ifnum\dp\z@=\z@%                 \unskip\unskip\unpenalty%         %   \else%         %       \box\z@%         %   \else%         %       \box\z@%         %   \fi%         %\fi%         \fi\fi\box\z@% Apply fix mentioned in comments         \end{minipage}%         \end{MyBoxedEnvironmentMdframed}%         \ignorespacesafterend%     }%     \makeatother%               % Simplify repeated testing and comparrison: Run MyBoxedEnvironmentOld and MyBoxedEnvironmentNew side by side     \newcommand{\TestNestedEnvironments}[2][yellow!10]{%         \colorlet{MyBackgroundColor}{#1}%         \noindent%         \begin{minipage}[t]{0.49\linewidth}             \begin{MyBoxedEnvironmentOld}%      non-nested test                 #2%             \end{MyBoxedEnvironmentOld}%             %             \begin{MyBoxedEnvironmentOld}%      nested test                 #2%                 \begin{MyBoxedEnvironmentOld}%                     \textcolor{red}{#2}%                 \end{MyBoxedEnvironmentOld}%             \end{MyBoxedEnvironmentOld}%         \end{minipage}%         \hfill%         \begin{minipage}[t]{0.49\linewidth}             \begin{MyBoxedEnvironmentNew}%      non-nested test                 #2%             \end{MyBoxedEnvironmentNew}%             %             \begin{MyBoxedEnvironmentNew}%      nested test                 #2%             \begin{MyBoxedEnvironmentNew}%                 \textcolor{red}{#2}%             \end{MyBoxedEnvironmentNew}%             \end{MyBoxedEnvironmentNew}%         \end{minipage}%         \bigskip%     }%          \begin{document}     \noindent%     Problem only with \textbf{MyBoxedEnvironment} with display math and no text afterwards:          \TestNestedEnvironments[red!20]{         \begin{align*}             e = m c^2 \quad (Case~1)         \end{align*}     }          %----------------------------------------------------------     \TestNestedEnvironments{         \begin{align*}             e = m c^2  \quad (Case~2)         \end{align*}     Ok with text below (short or long).     }          %----------------------------------------------------------     \TestNestedEnvironments[red!20]{     Text only above:         \begin{align*}             e = m c^2  \quad (Case~3)         \end{align*}     }          %----------------------------------------------------------     %\newpage% Don't need since paper height is now extended.     \noindent     Ok with display math and text above and below:          \TestNestedEnvironments{     Text above (and below):         \begin{align*}             e = m c^2  \quad (Case~4)         \end{align*}     Text below (and above).     }          %----------------------------------------------------------     \bigskip\noindent     Ok with inline math (but slight change in spacing if the "(Case~5)" label is removed):          \TestNestedEnvironments{$e = m c^2  \quad (Case~5)$}          %----------------------------------------------------------     \bigskip\noindent     Ok with short text:          \TestNestedEnvironments{Lorem ipsum dolor sit amet.\quad (Case~6)}          %----------------------------------------------------------     \bigskip\noindent     Ok with long text:          \TestNestedEnvironments{         Lorem ipsum dolor sit amet, consectetur adipiscing elit.          Sed accumsan nulla ac ipsum elementum interdum.          Praesent ultricies faucibus turpis, non scelerisque nisi bibendum et.          \quad (Case~7)     }     \end{document}


title: Avoiding page numbers in allowframebreaks option - beamer

text: In my presentation, I am citing many papers and thus want to have a bibliography in the end so that people can refer to full citations as well. But I don't want to include them in page numbers in presentation(not to scare the audience). Any clean solution for this?               \begin{frame}[allowframebreaks]     \frametitle{References}     \scriptsize{\bibliographystyle{acm}}     \bibliography{references}     \end{frame}


title: matrix alignment with preceeding unary minus

text: I've never quite been pleased with the options for aligning matrices in TeX when there is a preceding unary minus in some of the rows (but not all). I'd like to implement an environment that automatically detects a preceding unary minus and adds a `\phantom{-}` to each row not containing one. I'm not sure how to go about this but also willing to accept other solution ideas. My main parameter is that it needs to be just as simple of an environment to use as the `ams bmatrix` environment. Here is the output demonstrating why I believe `\phantom{-}` is the way to go ![\\phantom{-} is better](http://i.stack.imgur.com/MPGXj.png) Here is the code to demonstration:               \documentclass{article}               \usepackage{mathtools} %for minus signes in matrices          \usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, sy          \begin{document}          \begin{tabular}{cc}     Usual & \\ \hline      & \\     $     \begin{bmatrix}     1 & 2 & 12345\\     -5 & 2 & -5 \\     0 & -1 & 1     \end{bmatrix}     $     &     $     \begin{bmatrix}     1-\lambda & 2         & 12345\\     -5        & 2-\lambda & -5 \\     0         & -1        & 1-\lambda     \end{bmatrix}     $\\[1cm]          Right Aligned &\\  \hline      & \\     $     \begin{bmatrix*}[r]     1 & 2 & 12345\\     -5 & 2 & -5 \\     0 & -1 & 1     \end{bmatrix*}     $     &     $     \begin{bmatrix*}[r]     1-\lambda & 2         & 12345\\     -5        & 2-\lambda & -5 \\     0         & -1        & 1-\lambda     \end{bmatrix*}     $\\[1cm]          Phantom Minues & \\  \hline      & \\          $     \begin{bmatrix}     \phantom{-}1 & \phantom{-}2 & \phantom{-}12345\\     -5           & \phantom{-}2 & -5 \\     \phantom{-}0 & -1 & \phantom{-}1     \end{bmatrix}     $     &     $     \begin{bmatrix}     \phantom{-}1-\lambda & \phantom{-}2         & \phantom{-}12345\\     -5                   & \phantom{-}2-\lambda & -5 \\     \phantom{-}0         & -1                   & \phantom{-}1-\lambda     \end{bmatrix}     $     \end{tabular}     \end{document}


title: A bold plus symbol in math mode

text: I'd like to use a different `+` symbol in addition to `+` in math mode, preferably one which is just bolder than the standard one. I'm currently using `\pmb{+}` from the `amsbsy` package, but it's a bit too lean for my taste, and it looks a bit pointy to the ends. I am aware of `\ding{58}` from the `pifont` package, as well as `\Plus` from `bbding`, both of which seem to be non-math mode symbols, and look really bad next to math symbols. Am I missing some other option to produce a bold +, apart from drawing the symbol myself?


title: What is the purpose of \crcr in an \halign preamble?

text: I know that the point of `\crcr` is to be a kind of "backup `\cr`" in `\halign`/`\valign`, in that it only adds a `\cr` if it wouldn't result in two in a row. Nonetheless it seems to find its way into the `\halign` preamble, where it seems merely like a slightly-longer version of `\cr`. For example, the plain Tex definition of `\matrix`:               *\show\matrix     > \matrix=macro:     #1->\null \,\vcenter {%       \normalbaselines \m@th \ialign {%         \hfil $##$\hfil &&\quad \hfil $##$\hfil \crcr         \mathstrut \crcr         \noalign {\kern -\baselineskip }%         #1\crcr          \mathstrut \crcr         \noalign {\kern -\baselineskip }%       }%     }\,.      (I have added some formatting). I don't get why the preamble would end in `\crcr` when `\cr` works just as well, is the _only_ option mentioned by the TeXbook, and when `\crcr` doesn't seem to function as a backup `\cr` in this case. Now, the _third_ `\crcr` does have that particular function here, but in the very simple alignment               \halign{#\crcr x}      you will get a "Missing `\cr` inserted" error nonetheless. I have seen this idiom elsewhere so I assume it has _some_ reason but I can't figure out what it is.


title: Redefined maketitle gives error

text: I'm currently using a template I found online, it included a `.cls` file that modified the usual `\maketitle`. Every time I compile with this class I get an error after the `\maketitle`saying `There's no line to end`, here is the whole `.cls` I'm using:               % ---------------------------------------------------------------------     % Conference proceedings and article templates for     % personal open-archiving activities     % September 2012     % ---------------------------------------------------------------------          \ProvidesClass{SelfArx}[25/01/2012, v1.0]     \RequirePackage{ifthen}     \RequirePackage{calc}     \AtEndOfClass{\RequirePackage{microtype}}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}     \ProcessOptions*     \LoadClass{article}     \RequirePackage{ifpdf}      % Needed to pick between latex and pdflatex          %----------------------------------------------------------------------     %   FONTS     %----------------------------------------------------------------------          \RequirePackage{times}      % Loads the Times-Roman Fonts     \RequirePackage{mathptmx}   % Loads the Times-Roman Math Fonts          %----------------------------------------------------------------------     %   VARIOUS USEFUL PACKAGES     %----------------------------------------------------------------------          \RequirePackage[utf8]{inputenc}     \RequirePackage{amsmath,amsfonts,amssymb}     \RequirePackage{graphicx,xcolor}     \RequirePackage{booktabs}          %----------------------------------------------------------------------     %   MARGINS      %----------------------------------------------------------------------          \RequirePackage[left=2cm,%                     right=2cm,%                                     top=2.25cm,%                                     bottom=2.25cm,%                                     headheight=11pt,%                                     letterpaper]{geometry}%          %----------------------------------------------------------------------     %   FIGURES AND TABLES CAPTIONS     %----------------------------------------------------------------------          \RequirePackage[labelfont={bf,sf,small},%                     labelsep=period,%                     justification=raggedright]{caption}     \setlength{\abovecaptionskip}{0pt}     \setlength{\belowcaptionskip}{0pt}          %----------------------------------------------------------------------     %   PAGE HEADER     %----------------------------------------------------------------------          \RequirePackage{fancyhdr}  % Needed to define custom headers/footers     \RequirePackage{lastpage}  % Number of pages in the document     \pagestyle{fancy}          % Enables the custom headers/footers     % Headers     \lhead{}%     \chead{}%     \rhead{\small\sffamily\bfseries\@PaperTitle\  --- \thepage/\pageref{LastPage}}     % Footers     \lfoot{}%     \cfoot{}%     \rfoot{}%     \renewcommand{\headrulewidth}{0pt}% % No header rule     \renewcommand{\footrulewidth}{0pt}% % No footer rule          %----------------------------------------------------------------------     %   SECTION/SUBSECTION/PARAGRAPH SET-UP     %----------------------------------------------------------------------          \RequirePackage[explicit]{titlesec}     \titleformat{\section}       {\color{color1}\large\sffamily\bfseries}       {}       {0em}       {\colorbox{color2!10}{\parbox{\dimexpr\linewidth-2\fboxsep\relax}{\centering\arabic{section}. #1}}}       []     \titleformat{name=\section,numberless}       {\color{color1}\large\sffamily\bfseries}       {}       {0em}       {\colorbox{color2!10}{\parbox{\dimexpr\linewidth-2\fboxsep\relax}{\centering#1}}}       []       \titleformat{\subsection}       {\color{color1}\sffamily\bfseries}       {\thesubsection}       {0.5em}       {#1}       []     \titleformat{\subsubsection}       {\sffamily\small\bfseries}       {\thesubsubsection}       {0.5em}       {#1}       []         \titleformat{\paragraph}[runin]       {\sffamily\small\bfseries}      and here is a minimal example that produces the error:               \documentclass[fleqn,10pt]{SelfArx}           \usepackage{graphicx}     \usepackage[utf8]{inputenc}     \usepackage[spanish]{babel}     \setlength{\columnsep}{0.55cm}      \setlength{\fboxrule}{0.75pt}                \definecolor{color1}{RGB}{0,0,90}      \definecolor{color2}{RGB}{0,20,20}                \PaperTitle{Title} % Article title          \Authors{Julio Cáceres\textsuperscript{1}*}      \affiliation{\textsuperscript{1}\textit{stuff}}      \affiliation{*\textbf{Email}: e@mail.com}                \Keywords{key1 -- key2 -- key3}      \newcommand{\keywordname}{Keywords}           \begin{document}     \flushbottom              \maketitle          Hi there          \end{document}      Any help would be appreciated.


title: Mimic fonts and spacing of tufte-book class

text: I am writing a book using memoir class and I want to mimic fonts and spacing of tufte-book class.


title: LaTeX3: If next in input stream is command X or environment X, do Y else Z

text: Because I write my own document class (okay, I try to ...), this question bothers me for weeks as there are many situation, in which I need something like this. Is there a way to test, if the next token list in the input stream is command `\foo`? I didn't found anything like this (or I didn't recognize it), neither in the web nor in the `expl3` documentation. For example, I want to realize something like this:               \DeclareDocumentCommand \test {  } {%       \if_next_tl:NTF \emph {   % This function doesn't exist!         % Do something if true       }{         % Do something if false       }     }      So when I write               Bla \test Bla Bla      the false code is executed, and when I write               Bla \test \emph{Bla} Bla      the true code is executed. I know there are LaTeX3 functions like `\peek_after:Nw`, `\peek_charcode:NTF` and TeX macros like `\@ifnextchar`, but I don't understand how to use them in this case. I think it would be the best to use LaTeX3 functionality for this. And maybe, I am completely wrong and this is not the correct attempt to solve things in LaTeX. _In addition_ : Is there a similar way to test, if there follows an environment `foo` in the input stream? # Background This is an simplified example where I could use this: I have a command `\exercise`, which typesets something like an headline with a following vertical space. If "normal" text follows after `\exercise`, this looks like it should. But if I add an enumeration after `\exercise`, the vertical space looks too small---although it is the same. I don't know why, but maybe because of the space between the items (it's all about perception and a optical correction). That's why I want to add a very small additional space after the heading in `\exercise`, if it's followed by an enumeration. So what I want to realize is something like "conditional spacing". Here's an example: ## Code               \documentclass{scrartcl}          \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{lipsum}     \usepackage{xparse}     \usepackage{noindentafter}          \DeclareDocumentCommand \exercise {  } {%       \vspace{\baselineskip}       \noindent\textsf{\bfseries\Large Exercise}       \vspace{0.5\baselineskip}       \NoIndentAfterThis     }          \begin{document}          \exercise          \lipsum[1]          \begin{enumerate}       \item One       \item Two       \item Three     \end{enumerate}     \lipsum[1]          \exercise          \begin{enumerate}       \item One       \item Two       \item Three     \end{enumerate}          \end{document}      ## Document Here's the result. In my opinion, the space after the second "Exercise" is a little bit too small. So I want to add some space after `\exercise`, if it is followed by an enumeration. ![Example document](http://i.stack.imgur.com/wyA7q.png)


title: Mavericks upgrade screwed up my pdflatex (command not found)

text: so everything was working fine ... until i upgraded to os x mavericks (version 10.9.2) a couple days ago. using   * emacs version 24.3 (9.0)   * auctex version 11.87.3 after upgrade, tried to compile and got:               Running `LaTeX' on `test' with ``pdflatex  -interaction=nonstopmode "\input" test.tex''     /bin/sh: pdflatex: command not found          LaTeX exited abnormally with code 127 at Wed Mar  5 09:45:28      where did my pdflatex go? what is the fix?