title: How to get non-italic acute accent in math mode?

text: `$\acute{e}$` makes an italic `e` with accent in math mode, how can I get the acute accent with a regular letter? I should mention that this is for annotating a plot with matplotlib, so common tricks in LaTeX may not work, I tried `\text` and `\mbox`, both failed.


title: The right way to get sans-serif math?

text: I notice that `beamer` has everything in sans-serif by default, including math. In a regular `article`, simply using `\sffamily` doesn't cause math to be set in sans-serif. Using `\renewcommand{\familydefault}{\sfdefault}` doesn't work and the `sansmath` package sort of works, but seems to produce varying results with respect to whether letters are italic or not (e.g., in `beamer` `\Gamma` is not italicized, but with `sansmath` it is.) Is there one "right" way to do this? Edit: another problem is that `\sansmath` seems to turn `\beta` into "ﬁ".


title: Change color of plots in pgfplots globally

text: In pgfplots I can change the color of plots locally as in the example below. However is there a way to change the color for all plots in a document globally?               \documentclass{article}          \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}        \begin{axis}           \addplot[color=red] coordinates{(0,0) (1,2)};        \end{axis}     \end{tikzpicture}     \end{document}


title: Creating Donut chart

text: I have seen a donut chart, but it does not look like a ring, rather the portions of the ring are disjoint. **2D version** ![](http://i.stack.imgur.com/YrghB.png) **3D version** ![](http://i.stack.imgur.com/JoTKp.png) How to create them? **Related Questions:** 1. How to design a 3D donut pie chart with pgf-plot? 2. How can I produce a 'ring (or wheel) chart' like that on page 88 of the PGF manual? 3. How to draw a coffee cup (thanks to @PrzemysławScherwentke) 4. Create a ring diagram in TeX For the 2D part, I tried to do some tweak on the following code, which is shamelessly copied from the answer of the 4th question, but found no such _obvious_ way:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{arrows}     \begin{document}          % Adjusts the size of the wheel:     \def\innerradius{1.8cm}     \def\outerradius{2.2cm}          % The main macro     \newcommand{\wheelchart}[1]{         % Calculate total         \pgfmathsetmacro{\totalnum}{0}         \foreach \value/\colour/\name in {#1} {             \pgfmathparse{\value+\totalnum}             \global\let\totalnum=\pgfmathresult         }              \begin{tikzpicture}                % Calculate the thickness and the middle line of the wheel           \pgfmathsetmacro{\wheelwidth}{\outerradius-\innerradius}           \pgfmathsetmacro{\midradius}{(\outerradius+\innerradius)/2}                % Rotate so we start from the top           \begin{scope}[rotate=90]                % Loop through each value set. \cumnum keeps track of where we are in the wheel           \pgfmathsetmacro{\cumnum}{0}           \foreach \value/\colour in {#1} {                 \pgfmathsetmacro{\newcumnum}{\cumnum + \value/\totalnum*360}                      % Calculate the percent value                 \pgfmathsetmacro{\percentage}{\value/\totalnum*100}                 % Calculate the mid angle of the colour segments to place the labels                 \pgfmathsetmacro{\midangle}{-(\cumnum+\newcumnum)/2}                      % This is necessary for the labels to align nicely                 \pgfmathparse{                    (-\midangle<180?"west":"east")                 } \edef\textanchor{\pgfmathresult}                 \pgfmathsetmacro\labelshiftdir{1-1*(-\midangle>180)}                      % Draw the color segments. Somehow, the \midrow units got lost, so we add 'pt' at the end. Not nice...                 \fill[\colour] (-\cumnum:\outerradius) arc (-\cumnum:-(\newcumnum):\outerradius) --                 (-\newcumnum:\innerradius) arc (-\newcumnum:-(\cumnum):\innerradius) -- cycle;                      % Set the old cumulated angle to the new value                 \global\let\cumnum=\newcumnum             }                \end{scope}         \end{tikzpicture}     }     \wheelchart{26/cyan,  28/orange, 33.5/yellow, 12/blue!50!red}          \end{document}


title: What is a good strategy to internationalize a document class?

text: I am busy with a new document class and I have been trying my hand in internationalizing some of the contents. I have tried using `translator` from Beamer. Is this a good strategy? Can the code shown below be improved? Are there any other options to carry out such a task?               %% The article class     \documentclass[oneside]{book}     \usepackage[paperwidth=4.75in,paperheight=7.25in,                 textwidth=4.5in,textheight=6.5in,                 headsep=0.1in, footskip=0.15in,                 marginratio=1:1]{geometry}     \usepackage[dutch,greek,english]{babel}     \usepackage{filecontents,xspace}     \usepackage{translator}          %% just to allow filenames to be changed easily     \def\fname{mothererror}          %% The Greek dictionary file     \begin{filecontents*}{\fname-Greek.dict}     \ProvidesDictionary{\fname}{Greek}     \providetranslation{mother}{mht`era `olwn t`wn laj`wn}     \providetranslation{Error}{L`ajos}     \providetranslation{Errors}{L`ajh}     \end{filecontents*}          %% The Dutch dictionary file     \begin{filecontents*}{\fname-Dutch.dict}     \ProvidesDictionary{\fname}{Dutch}     \providetranslation{mother}{moeder van alle fouten}     \providetranslation{error}{fout}     \providetranslation{Error}{Fout}     \providetranslation{Errors}{Fouten}     \end{filecontents*}          %% The English dictionary file     \begin{filecontents*}{\fname-English.dict}     \ProvidesDictionary{\fname}{English}     \providetranslation{mother}{mother of all errors}     \providetranslation{error}{error}     \providetranslation{Error}{Error}     \providetranslation{Errors}{Errors}     \end{filecontents*}          %% The package file mothererror.sty     %% internationlizes mother of all errors!     \begin{filecontents*}{\fname.sty}     %% Now declare what environment we need:     \NeedsTeXFormat{LaTeX2e}[1994/12/01]     %% Load the translator package     \RequirePackage{translator}     \usedictionary{\fname}     %% create a test error for package     \def\geterror#1{\translate{Error} #1 :      \ifcase #1\or          1 A general error\or         \ldots\translate{mother}\xspace\or      \fi}     \end{filecontents*}          %% Load the package we just saved     \usepackage{\fname}     \uselanguage{dutch,greek,english}     \begin{document}     %% Dutch     \selectlanguage{dutch}     \chapter{\translate{Errors}}     Dutch: \geterror{2}, \today     %% English     \selectlanguage{english}     \chapter{Errors}     English: \geterror{2},  \today     %% Greek     \selectlanguage{greek}     \chapter{\translate{Errors}}     Ellhnik'a: \geterror{2} \today     \end{document}


title: What paper dimensions to use for printing with the octavo class?

text: I am working on a fiction novel. I want to print this in a comfortable size for carrying and reading. I will have the pages printed, cut to size, glued together, with heavy paper added to the outside to form a cover. I found the `octavo` class, which gives a nice look, however, the documentation is a bit confusing. I will print at a local print store. They usually just print on A4 or A5 paper. If I give the store any strange sizes, they'll likely add extra space around the pages, or distort the size to fit their printing machines. Can I use any of the paper-size options (e.g. `folio`, `quarto`, or `octavo`) to create a PDF that I is ready for printing at my local print store? Can I trust octavo to give me enough white-space in the middle of the book, where the seam is? Are there any other classes or packages I should consider for creating a novel? I had difficulty finding anything related to this in CTAN.


title: Graphic file .eps not found though in proper directory:

text: I am using `graphicx` to typeset the figures for my PhD thesis. I have large files in `.eps` format. However, whenever I try to typeset the file (using pdfTeX), the console says > "LaTeX error: File 'Figure' not found" It is in the same directory as my `.tex` file, and the file will typeset if I create it as a `.dvi` and then convert it to `.pdf`. I would rather not do this though, because I want to use `hyperref`.


title: Can't use .eps instead of .jpg or .png

text: > **Possible Duplicate:**   >  Insert eps graphics with graphicx (file not found) I'm trying to follow the tutorial on this website (link). I can typeset the cover letter example with a `.jpg`, but not a `.eps`. I get the error               ! LaTeX Error: File `figures/UILogoLG3L' not found.     See the LaTeX manual or LaTeX Companion for explanation.     Type H for immediate help.     ...     l.14 } % ?


title: How to use forward slash (/) as a path separator in texniccenter

text: I am working on a collaborative Latex project which is hosted on a svn server. The project uses forward slash as the path separator in the tex source. e.g, `\includegraphics[width=0.15\textwidth]{img/EC}` This creates a problem for me as I get a 'File not found' Latex error on TeXnicCenter for this. I think this is because I am on Windows and TexnicCenter does not understand `/` as a path separator. Is there some way to fix this? I am using Latex --> PDF profile, which uses this compiler `C:\Program Files\MiKTeX 2.9\miktex\bin\pdflatex.exe`. Just to clarify, I don't have write permission on most of the core tex files, so I cannot do a replace all `/` with `\`. Plus most of the other people are using Linux, so it will be impossible for me to convince them to shift to `\`. The contents of MWE .log file:-                   This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2011.9.20)  8 APR 2014 16:50     entering extended mode     **MWE.tex     (E:\escudo\proposal\MWE.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, arabic, armenian, assamese, basque, bengali     , bokmal, bulgarian, catalan, coptic, croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, galic     ian, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, icelandic, indonesian, interlingua, irish, italian,      kannada, kurmanji, lao, latin, latvian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, ng     erman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese, romanian, russian, sanskrit, serbian, slovak, s     lovenian, spanish, swedish, swissgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usenglishm     ax, welsh, loaded.     ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"     File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count79     \c@section=\count80     \c@subsection=\count81     \c@subsubsection=\count82     \c@paragraph=\count83     \c@subparagraph=\count84     \c@figure=\count85     \c@table=\count86     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     ) ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf.sty"     Package: epstopdf 2010/02/09 v2.5 Conversion with epstopdf on the fly (HO)      ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\epstopdf-base.sty"     Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf          ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"     Package: infwarerr 2010/04/08 v1.3 Providing info/warning/message (HO)     )     ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\grfext.sty"     Package: grfext 2010/08/19 v1.1 Managing graphics extensions (HO)          ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvdefinekeys.sty"     Package: kvdefinekeys 2011/04/07 v1.3 Defining keys (HO)          ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"     Package: ltxcmds 2011/04/18 v1.20 LaTeX kernel commands for general use (HO)     )))     ("C:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty"     Package: kvoptions 2010/12/23 v3.10 Keyval support for LaTeX options (HO)          ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty"     Package: keyval 1999/03/16 v1.13 key=value parser (DPC)     \KV@toks@=\toks14     )     ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\kvsetkeys.sty"     Package: kvsetkeys 2011/04/07 v1.13 Key value parser (HO)          ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"     Package: etexcmds 2011/02/16 v1.5 Prefix for e-TeX command names (HO)          ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"     Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)     Package ifluatex Info: LuaTeX not detected.     )     Package etexcmds Info: Could not find \expanded.     (etexcmds)             That can mean that you are not using pdfTeX 1.50 or     (etexcmds)             that some package has redefined \expanded.     (etexcmds)             In the latter case, load this package earlier.     )))     ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"     Package: pdftexcmds 2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)          ("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"     Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)     Package ifpdf Info: pdfTeX in PDF mode is detected.     )     Package pdftexcmds Info: LuaTeX not detected.     Package pdftexcmds Info: \pdf@primitive is available.     Package pdftexcmds Info: \pdf@ifprimitive is available.     Package pdftexcmds Info: \pdfdraftmode found.     )          Package epstopdf Warning: No graphics package `graphic{s,x}' loaded.          )) ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"     Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)          ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty"     Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)      ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty"     Package: trig 1999/03/16 v1.09 sin cos tan (DPC)     ) ("C:\Program Files\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg"     File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive     )     Package graphics Info: Driver file: pdftex.def on input line 91.          ("C:\Program Files\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"     File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX     \Gread@gobject=\count87     ))     \Gin@req@height=\dimen103     \Gin@req@width=\dimen104     )     No file MWE.aux.     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.     LaTeX Font Info:    ... okay on input line 7.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.     LaTeX Font Info:    ... okay on input line 7.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.     LaTeX Font Info:    ... okay on input line 7.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.     LaTeX Font Info:    ... okay on input line 7.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.     LaTeX Font Info:    ... okay on input line 7.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.     LaTeX Font Info:    ... okay on input line 7.     ("C:\Program Files\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"     [Loading MPS to PDF converter (version 2006.09.02).]     \scratchcounter=\count88     \scratchdimen=\dimen105     \scratchbox=\box26     \nofMPsegments=\count89     \nofMParguments=\count90     \everyMPshowfont=\toks15     \MPscratchCnt=\count91     \MPscratchDim=\dimen106     \MPnumerator=\count92     \makeMPintoPDFobject=\count93     \everyMPtoPDFconversion=\toks16     )          ! LaTeX Error: File `img/EC' not found.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.8 \includegraphics{img/EC}          I could not locate the file with any of these extensions:     .png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2     Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.          (E:\escudo\proposal\MWE.aux) )      Here is how much of TeX's memory you used:      1366 strings out of 494045      19168 string characters out of 3148393      69513 words of memory out of 3000000      4671 multiletter control sequences out of 15000+200000      3640 words of font info for 14 fonts, out of 3000000 for 9000      715 hyphenation exceptions out of 8191      42i,1n,23p,318b,37s stack positions out of 5000i,500n,10000p,200000b,50000s          No pages of output.     PDF statistics:      0 PDF objects out of 1000 (max. 8388607)      0 named destinations out of 1000 (max. 500000)      1 words of extra memory for PDF output out of 10000 (max. 10000000)


title: Including pdf figures in Latex document using TexnicCenter

text: I am sorry if I missed anywhere the obvious answer to my problem, but after searching several hours for a solution I am a bit lost... I am using Texniccenter and MikTex under Windows Vista to create a pdf document with Latex. Most of my images are in PS format and hence I use the LaTex=>PS=>PDF profile to create my document. If I however try to include a pdf image instead of a ps the document creation is interupted and no final pdf output is created. My code looks like this:               \usepackage{graphicx}     \usepackage{pdfpages}          \begin{figure}[h!]     \centering     \includegraphics[scale=0.5]{image.pdf}     \caption[]{}     \label{}     \end{figure}      Is there anything obvious that I am missing here ?


title: Longtable & siunitx

text: So this is the first time I am attempting to use the `longtable` package and for some reason, I can't even get MWE to run - Pdflatex gets stuck after loading the `booktabs` package. I honestly can't see why it won't even run, as it is not giving errors. The image below is the Excel file of my "table" (ignore the "Exluded" - minor typo) ![enter image description here](http://i.stack.imgur.com/Wc35Q.png) I'd like the Latex table to have the following features:   * Must fit the page width (personal preference)   * Decimal alignment   * Want the Headers on first page to be headers on the second page (I think I did that correctly in the code). Not sure though. Despite my Latex compiler not working, I have attempted in my "MWE" to be as comprehensive as possible:               \documentclass{article}     \usepackage{longtable, booktabs, siuntix}     \begin{document}     \begin{longtable}{|c|c|c|c|c|c|}     \caption{Descriptive Statistics: Whole Sample ($N = \num{13 298}$)\label{table:DSWS}}     \toprule     {\bfseries Variable} & {\bfseries Proportion of Individuals in Sample} & {\bfseries Graduated (\%)} & {\bfseries Academically Excluded (\%)} & {\bfseries Transferred (\%)} & {\bfseries Censored} \\     \midrule     \endfirsthead     \midrule     {\bfseries Variable} & {\bfseries Proportion of Individuals in Sample} & {\bfseries Graduated (\%)} & {\bfseries Academically Excluded (\%)} & {\bfseries Transferred (\%)} & {\bfseries Censored} \\     \midrule     \endhead     Total & 100.00 & 40.98 & 13.39 & 6.02 & 39.61 \\     \addlinespace     \bfseries Gender (\%) \\     Male                 & 57.78 & 39.98 & 15.68 & 5.38 & 38.96 \\     Female               & 42.22 & 42.33 & 10.24 & 6.91 & 40.52 \\     \addlinespace     \bfseries Race (\%) \\     White & 39.34 & 52.48 & 4.15 & 5.91 & 37.46 \\                             Black & 35.46 & 28.97 & 23.77 & 6.57 & 40.69 \\                             Coloured & 13.21 & 39.56 & 14.34 & 6.72 & 39.39 \\                          Indian/Asian & 11.98 & 40.30 & 11.93 & 4.02 & 43.75 \\                     \addlinespace     \bfseries Financial Aid (\%) \\     Ineligible for Financial Aid & 77.86 & 43.83 & 9.59 & 5.18 & 41.4 \\     Eligible for Financial Aid & 22.14 & 30.94 & 26.73 & 9 & 33.32 \\     \addlinespace     \bfseries Programme (\%) \\     Mainstream & 77.68 & 45.7 & 9.71 & 6.16 & 38.43 \\     Academic Development & 22.32 & 24.53 & 26.18 & 5.56 & 43.73 \\       \addlinespace     \bfseries English Home Language (\%) \\     Yes & 65.21 & 47.22 & 7.74 & 5.75 & 39.29 \\     No & 34.79 & 29.27 & 23.97 & 6.53 & 40.23 \\     \addlinespace     \bfseries School Quintile (\%) \\     1 & 1.45 & 23.83 & 38.86 & 7.77 & 29.53 \\     2 & 2.8 & 25.74 & 32.44 & 5.36 & 36.46 \\     3 & 8.44 & 24.58 & 31.7 & 7.48 & 36.24 \\     4 & 5.29 & 26.28 & 28.98 & 6.11 & 38.64 \\     5 & 44.62 & 44.03 & 10.8 & 5.65 & 39.52 \\     Independent  & 37.38 & 44.92 & 7.7 & 6.12 & 41.26 \\     \addlinespace     \bfseries Province (\%) \\     Western Cape & 41.45 & 45.95 & 10.49 & 6.17 & 37.39 \\     Non- Western Cape & 58.55 & 37.45 & 15.44 & 5.92 & 41.19 \\     \addlinespace     \bfseries Year of First Registration     {2006} & 11.54 & 69.32 & 16.48 & 8.21 & 5.99 \\     {2007} & 11.91 & 70.39 & 17.05 & 6.5 & 6.06 \\     {2008} & 13.29 & 66.67 & 17.77 & 7.41 & 8.15 \\     {2009} & 15.32 & 54.05 & 20.86 & 10.7 & 14.38 \\     {2010} & 11.42 & 51.78 & 11.46 & 5.8 & 30.96 & \\     {2011} & 10.87 & 14.18 & 11.96 & 4.22 & 69.64 \\     {2012} & 13.11 & 0 & 6.94 & 3.56 & 89.51 \\     {2013} & 12.54 & 0 & 3 & 0.72 & 96.28 \\     \bottomrule     \end{longtable}     \end{document}


title: in=down modifier breaks \draw command when coordinate is returned by macro

text: Another Minimal Non-Working Example...               \documentclass{article}     \usepackage{tikz}     \begin{document}     \newlength\mylength     \setlength\mylength{20pt}     \newcommand*\mypoint{\mylength,20pt}     \begin{tikzpicture}         \draw (0pt,0pt) to [in=down] (\mypoint);     \end{tikzpicture}     \end{document}      Everything is fine without the `[in=down]` modifier. Assistance welcome! I need a fix that retains the general structure; this is a simplification of a real situation in which I have hundreds of these `to [in=down] (\mypoint)` line segments in my draw command, where `\mypoint` is a different macro in each case, and it's not feasible to create a new node for every call of the macro.


title: Passing the current column width to a macro (for table headers)

text: In an attempt to separate the formatting of tables, and in particular their headers, from the content, I have produced the following code:               \documentclass{article}     \usepackage{array}     \usepackage{colortbl}     \usepackage{xcolor}               \newcolumntype{L}{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}}     \newcolumntype{C}{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}}          \newcommand{\vheader}[1]{\multicolumn{1}{>{\bfseries}c}{#1}}     \newcommand{\fheader}[2]{\multicolumn{1}{>{\bfseries}Cb{#1}}{#2}}          \begin{document}          \begin{tabular}{cLp{50mm}lr}       \rowcolor{black!20}       \vheader{Rank} &        \fheader{50mm}{Venerable Institution of Higher Education} &       \vheader{Location} &       \vheader{Score} \\            1 & California Institute of Technology (Caltech) & United States & 94.9 \\       \multicolumn{4}{c}{\ldots}\\       12 & University of California, Los Angeles (UCLA) & United States & 86.3 \\       13 & Columbia University & United States & 85.2 \\       14 & ETH Z\"urich -- Swiss Federal Institute of Technology Z\"urich & Switzerland & 84.5 \\     \end{tabular}          \end{document}      (data taken from Times Higher Education, universities chosen to have some with long names) The idea is that table headers should be   * bold face   * centered   * bottom aligned but that these choices should be easy to change globally. Therefore I have marked up the header cells using macros `\vheader` for variable-width columns, like `c`, `l`, `r`, and `\fheader` for fixed-width columns like `p`, `m`, `b`. It works: ![enter image description here](http://i.stack.imgur.com/o5rNJ.png) But there are three things I don't like:   * **The need to repeat the width of the column for fixed-width columns.** I have found that `\hsize` will be set to the column width. But all my attempts to retrieve it and use it in the multicolumn preamble failed, nagging about misplaced `\omit` and the likes.   * **The need to say explicitly whether this is a fixed or variable width column.** Again, I tried code that checks whether `\hsize` was changed from its value outside the tabular, and uses different multicolumn preambles depending on that, but it disagreed with multicolumn processing.   * **The need to say this for every cell, instead of once for the whole row.** The `tabu` package has a `\rowfont` macro for instance, that can take care of the bold face and centering at least, though not the bottom alignment. But `tabu` is not maintained, and looking at the source code, this is a really brittle business that involves code in the preamble to remove the previous glue of columns, which is different depending on whether or not `colortbl` is used.  Suggestions for each and any of these would be welcome—sorry for asking three questions at once! **Edit:** replaced `booktabs` by `colortbl` and a grey background for the header row. Coloured backgrounds are frequently asked for by designers, so it's important that this works. And `colortbl` can be difficult, with the background not filling the whole cell.


title: How to operate figures described by latex packages?

text: I am trying to write a go book using the latex package igo. here is the example given by the igo' User Manual: ![enter image description here](http://i.stack.imgur.com/jpQ3R.jpg) I don't know how to operate the figure described by the igo statements, put it anywhere I want, for example, as in the manual, the figure are put on the right side of texts.I've tried the \begin{figure} statements, but it doesn't work.               \documentclass[12pt]{article}     \usepackage[top=1in,bottom=1in,left=1.25in,right=1.25in]{geometry}     \usepackage{graphicx}     \usepackage{float}     \usepackage{igo}          \begin{document}     %  text     \begin{figure}[H]     \white{b4,c4,d4,e4,f4,g3,g2,c3}     \black{b3,b2,c2,d3,e3,f3,f2}     \shortstack{\showfullgoban\\White to kill}     \end{figure}     %  text     \end{document}      This is the result: ![enter image description here](http://i.stack.imgur.com/KhvTw.jpg) I need your help, thanks!


title: Errors thrown when using (custom) thermodynamic states in chemmacros's reactions environment

text: An argument error is thrown when I attempt to use thermodynamic states (as well as custom state variables via `\DeclareChemState`) in `chemmacros`'s `reactions` environment. The MWE provided at the end of the question will reproduce the following error upon (at the time of this question) typesetting with the most updated version of TeX Live 2012. **The error:**               [...] Argument of \chemformula_superscript:n has an extra }.     <inserted text>                     \par     l.8 \end{reactions}      **The MWE:**               \documentclass[12pt]{article}     \usepackage{chemmacros}     \DeclareChemState[delta=false]{StdElPot}{E}{\volt}     \begin{document}     \begin{reactions}     Pd\pch[2]\aq{} + 2 \el{} &<=> Pd\sld{} &&\StdElPot{0.83} \\     PdCl4\mch[2]\aq{} + 2 \el{} &<=> Pd\sld{} + 4 Cl\mch\aq{} &&\StdElPot{0.64}     \end{reactions}     \end{document}


title: Wrong bottom-alignment of rows of two independent tables, where the last row contains a nested table

text: I wanted to create a page, where I put some information in the left and some on the right side at the bottom of the page. The bottom lines of the minipages are supposed to be aligned as kind of an "optical line". While fiddling around with tables, nested tables and minipages, I finally got stuck in a strange layout behaviour of LaTeX: I noticed that the bottom lines are aligned properly if and only if the last row of the tables in the minipages are 1 line high. Otherwise they will be aligned to their bottom line. So what (in a hacky way) helps me is to introduce an empty row in both (independent!) tabular environments. Here is an example:               \documentclass{article}     \usepackage[a4paper]{geometry}     \usepackage{tabularx}     \usepackage{lipsum}          \begin{document}             \begin{minipage}[b]{0.49\textwidth}                 \begin{flushleft}                     \begin{tabular}[b]{@{}ll@{}}                         \textbf{Some Caption A} & Some value B\\                         \textbf{Some Caption B} & Another Value C\\                         ~ & ~                     \end{tabular}                 \end{flushleft}             \end{minipage}             \begin{minipage}[b]{0.49\textwidth}                 \begin{flushright}                     \begin{tabular}[b]{@{}ll@{}}                         \textbf{Some Caption C} & B\\                         \textbf{Some Caption D} & C\\                         \textbf{Some Caption E} & \begin{tabular}[t]{@{}l@{}}                                 E line number 1 \\                                 E line number 2 \\                                 E line number 3                             \end{tabular} \\                         ~ & ~                     \end{tabular}                 \end{flushright}             \end{minipage}     \end{document}      This code yields the expected result: ![Rows aligned correctly](http://i.stack.imgur.com/xxpWv.png) If I remove the ~ & ~ lines in the code, I get this: ![Misaligned bottom rows](http://i.stack.imgur.com/VQaVo.png) What am I doing wrong here and how can I avoid it? Thanks in advance for your help. **Edit** In order to avoid further confusion about the point of my questions I changed the example a bit. **Edit II** : In order to be even more precise, I changed the pictures and removed some abstraction...


title: Replace individual page numbers with mathematical expressions

text: I'd like to replace a few individual page numbers in a document with mathematical expressions, like `$a^0$` for page 1, `$2(2)^1$` for 4, etc. I don't have a ToC or index, so I'm not concerned about the actual page numbers changing; just what's printed at the bottom of the page. I'm not sure it's helpful, but here's a MWE. Instead of a 1 at the bottom of the page, I want `$a^0$`.               \documentclass{article}          \usepackage{amsmath}          \begin{document}         Body of page, which is about exponential functions     \end{document}


title: Slave duplicate counter

text: Is it possible to create a counter that is a "slave" to another (master) counter, but also an exact duplicate? The `\@addtoreset{<slave>}{<master>}` resets `<slave>` whenever `<master>` is incremented (similar functionality is offered by `chngcntr`), but I don't know about anything incrementing one counter (`<slave>`) automatically whenever another counter (`<master>`) is incremented. The idea is to have a macro (say) `\dupcntr{<slave>}{<master>}` as an analogue to `\@addtoreset`. The application for this might be where one is interested in renaming a counter used/provided by a package into something more meaningful for the user (say, `<slave>`), without having to reference `<master>`. Or, if the original counter contains `@` that needs to be escaped every time it's used, it is sometimes more convenient to have a "more user friendly" counter. I know one way around is to use a macro that returns the value of `<master>`, but is it possible to perform the same manipulation with a macro than one could with the counter? Manipulation here refers to the printing of the counter (via `\the<slave>`) and perhaps it's representation (like `\arabic`, `\alph`, ...).


title: TikZ code no longer compiling

text: Consider the following code:               \documentclass{article}          \usepackage{expl3}     \usepackage{tikz}          \usetikzlibrary{       hobby,       shapes.geometric,       decorations,       decorations.shapes,       shapes.geometric,       patterns     }          % http://www.guitex.org/home/it/forum/5-tex-e-latex/83195-la-libreria-hobby-tikz-non-funziona-piu#83203     \ExplSyntaxOn       \cs_if_exist:NF \prg_stepwise_function:nnnN { \cs_gset_eq:NN \prg_stepwise_function:nnnN \int_step_function:nnnN }       \cs_if_exist:NF \prg_stepwise_inline:nnnn { \cs_gset_eq:NN \prg_stepwise_inline:nnnn \int_step_inline:nnnn }     \ExplSyntaxOff          \makeatletter     \pgfdeclareradialshading[tikz@ball]{easter bg}{\pgfpoint{5bp}{25bp}}{%       color(0cm)=(tikz@ball!20);       color(0.15cm)=(tikz@ball!30);       color(0.4cm)=(tikz@ball!60);       color(0.9cm)=(tikz@ball)     }     \tikzoption{easter bg color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{easter bg}\tikz@addmode{\tikz@mode@shadetrue}}          \pgfkeys{/tikz/easter star/.code args={#1 and #2}{       \pgfdeclareradialshading[tikz@ball]{easter star}{\pgfpoint{#1}{#2}}{%       color(0cm)=(tikz@ball!20);       color(0.3cm)=(tikz@ball!40);       color(0.65cm)=(tikz@ball!60);       color(1cm)=(tikz@ball)       }      }      \tikzoption{easter star color}{\pgfutil@colorlet{tikz@ball}{#1}\def\tikz@shading{easter star}\tikz@addmode{\tikz@mode@shadetrue}}     }     \makeatother          % original code by Paul Gaborit:     % tex.stackexchange.com/questions/72784/arrow-with-two-colors-with-tikz/#72793     \tikzset{       double path/.style args = {#1 colored by #2 and #3}{         -, line join = round, line cap = rect,         shorten >= 0.1cm,         shorten <= 0.1cm,         line width = #1,#2, % first path         postaction = {           draw,-,           #3,           line width = (#1)/1.5,           shorten <= (#1)/3,           shorten >= (#1)/3         } % second path       }%     }          \tikzset{easter decoration 1/.style = {         decorate,         decoration = {           shape backgrounds,           shape = star,           shape size = 7pt,           shape sep = {0.5cm, between center}         },         inner color = yellow,         outer color = yellow!50!orange,         draw = red!20!orange       }%     }          \pgfdeclarepatternformonly{fivepointed stars easter 2}{\pgfpointorigin}{\pgfpoint{10mm}{10mm}}{\pgfqpoint{10mm}{8mm}}%     {       \pgftransformshift{\pgfqpoint{1mm}{1mm}}       \pgfpathmoveto{\pgfqpointpolar{18}{1mm}}       \pgfpathlineto{\pgfqpointpolar{162}{1mm}}       \pgfpathlineto{\pgfqpointpolar{306}{1mm}}       \pgfpathlineto{\pgfqpointpolar{90}{1mm}}       \pgfpathlineto{\pgfqpointpolar{234}{1mm}}       \pgfpathclose%       \pgfusepath{fill}     }          \tikzset{easter decoration 3/.style={         draw=green!17!yellow,         line width=2pt,         star       }     }          \pgfdeclarepatternformonly{fivepointed stars easter 3}{\pgfpointorigin}{\pgfpoint{12mm}{12mm}}{\pgfqpoint{12mm}{11mm}}%     {       \pgftransformshift{\pgfqpoint{1mm}{1mm}}       \pgfpathmoveto{\pgfqpointpolar{18}{1mm}}       \pgfpathlineto{\pgfqpointpolar{162}{1mm}}       \pgfpathlineto{\pgfqpointpolar{306}{1mm}}       \pgfpathlineto{\pgfqpointpolar{90}{1mm}}       \pgfpathlineto{\pgfqpointpolar{234}{1mm}}       \pgfpathclose%       \pgfusepath{fill}     }               \begin{document}          \begin{tikzpicture}[use Hobby shortcut]       \node[above,xshift=-3.5cm,yshift=-1.5cm] at (0.5,1){Påskeæg~1};       % Path clipping.       \clip[scale=-6](0.5,0.1) to[closed,curve through={ (0.775,0.35) .. (0.5,1) .. (0.225,0.35)}] (0.5,0.1);       % Shading.       \shade[easter bg color=orange,scale=-6](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);       % Colored paths.       \draw[double path=5pt colored by orange!80!yellow and yellow,scale=-6] (0.775,0.35) .. (0.735,0.35)  .. (0.65,0.3) .. (0.45,0.4) .. (0.235,0.355) .. (0.225,0.35);       \draw[double path=5pt colored by orange!80!yellow and yellow,scale=-6] (0.9,0.5) .. (0.775,0.55)  .. (0.55,0.5) .. (0.45,0.6) .. (0.235,0.55) .. (0.1,0.5);       \draw[double path=5pt colored by orange!80!yellow and yellow,scale=-6] (0.9,0.7) .. (0.775,0.75)  .. (0.55,0.7) .. (0.45,0.8) .. (0.235,0.75) .. (0.1,0.7);       % Stars.       \draw[easter decoration 1,scale=-6] (0.775,0.25) .. (0.735,0.25)  .. (0.65,0.2) .. (0.45,0.3) .. (0.235,0.255) .. (0.225,0.25);       \draw[easter decoration 1,scale=-6] (0.9,0.4) .. (0.775,0.45)  .. (0.55,0.4) .. (0.45,0.5) .. (0.235,0.45) .. (0.1,0.4);       \draw[easter decoration 1,scale=-6] (0.9,0.6) .. (0.775,0.65)  .. (0.55,0.6) .. (0.45,0.7) .. (0.235,0.65) .. (0.1,0.6);       \draw[easter decoration 1,scale=-6] (0.9,0.8) .. (0.775,0.85)  .. (0.55,0.8) .. (0.45,0.9) .. (0.235,0.85) .. (0.1,0.8);       % Draw the border again.       \draw[scale=-6](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);     \end{tikzpicture}     % Easter Egg 2.     \begin{tikzpicture}[use Hobby shortcut]       \node[above,xshift=-3.5cm,yshift=-1.5cm] at (0.5,1){Påskeæg~2};       % Path clipping.       \clip[scale=-6](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);       % Shading.       \draw[easter bg color=blue!65!cyan,scale=-6,postaction={pattern=fivepointed stars easter 2,pattern color=blue}](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);       \begin{scope}[transform canvas={shift={(-3.5,-3.5)}}]        \node[star,scale=2.25,easter star=2bp and 10bp, easter star color=cyan!65!blue] at (0.35,0.75){};        \node[star,scale=1.5,easter star=-2bp and 15bp, easter star color=cyan!85!blue,rotate=10] at (1.45,1.45){};        \node[star,scale=1.5,easter star=5bp and 10bp, easter star color=cyan!75!blue,rotate=-10] at (-0.5,1.95){};        \node[star,scale=1.65,easter star=5bp and 15bp, easter star color=cyan!45!blue,rotate=-5] at (-0.75,-0.85){};        \node[star,scale=1.7,easter star=5bp and 15bp, easter star color=cyan!37!blue,rotate=-3] at (0,-1.65){};        \node[star,scale=1.5,easter star=5bp and 10bp, easter star color=cyan!60!blue,rotate=2] at (0.85,-0.65){};        \node[star,scale=1.75,easter star=-2bp and 2bp, easter star color=cyan!60!blue,rotate=14] at (2,0){};            \end{scope}        % Draw the border again.        \draw[scale=-6](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);     \end{tikzpicture}     % Easter Egg 3.     \begin{tikzpicture}[use Hobby shortcut]       \node[above,xshift=-3.5cm,yshift=-1.5cm] at (0.5,1){Påskeæg~3};       % Path clipping.       \clip[scale=-6](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);       % Shading.       \draw[easter bg color=green!77!blue,scale=-6,postaction={pattern=fivepointed stars easter 3,pattern color=green!20!yellow}](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);       \begin{scope}[transform canvas={shift={(-3.5,-3.5)}}]        \node[easter decoration 3,scale=2.25] at (0.55,0.65){};        \node[easter decoration 3,scale=1.5,rotate=10] at (1.45,1.45){};        \node[easter decoration 3,scale=1.5,rotate=-10] at (-0.5,1.95){};        \node[easter decoration 3,scale=1.65,rotate=-5] at (-0.75,-0.70){};        \node[easter decoration 3,scale=1.7,rotate=-3] at (0,-1.65){};        \node[easter decoration 3,scale=1.5,rotate=2] at (0.85,-0.65){};        \node[easter decoration 3,scale=1.75,rotate=14] at (2,0){};            \end{scope}       % Draw the border again.       \draw[scale=-6](0.5,0.1) .. (0.775,0.35)[closed=true] .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);     \end{tikzpicture}          \end{document}      Earlier, the code above has produced a picture of three easter eggs, but now I get the following error:               ! Undefined control sequence.     <argument> \fp_if_undefined:NTF                                      \l_hobby_out_angle_fp {\array_put:Nnx \l_hob...     l.113 ... .. (0.5,1) .. (0.225,0.35) .. (0.5,0.1);      Can anyone help me modify the code to make it work again? P.S. I don't use TikZ myself at all.


title: How to reuse vertex names using the tkz-berge graph drawing package?

text: I'm trying to draw a graph using `tkz-berge`, where many of the vertices might display the same value, is there a way I can do this? Here is my code:               \begin{figure}[h]     \centering     \begin{tikzpicture}[scale=0.75,transform shape]       \tikzstyle{LabelStyle}=[fill=white,sloped]       \Vertex[x=0,y=0]{A}       \Vertex[x=-2,y=-1]{B}       \Vertex[x=2,y=-1]{C}       \tikzstyle{EdgeStyle}=[post]       \Edge[](A)(B)       \Edge[](A)(C)     \end{tikzpicture}     \caption{\label{fig:typical}Cool graph}     \end{figure}      But instead of B<-A->C (is what this graph looks like), I'd like it to be, for example, something like B<-A->B. So basically I guess what I'm asking is, can I have the name of the vertex in the code be different from what is actually displayed on the screen (like a "label")? P.S. I don't have enough reputation to create the tag 'tkz-berge', but there is a 'tkz-graph' tag. I can't tell if that package is different or an alternate name of berge, but it seems to be very similar, so tagging as that.


title: pdfoutput=1 can't replace pdflatex for auto-pst-pdf

text: It is frequently mentioned that latex and pdflatex are the same program invoked with different defaults for the variable \pdfoutput (0 in the former, 1 in the latter case); see What is the practical difference between latex and pdflatex?. A common advice to enforce pdflatex is therefore to put \pdfoutput=1 within the first 5 lines of the preamble (like http://arxiv.org/help/submit_tex#pdflatex). This fails for the first example using auto-pst-pdf on https://www.tug.org/PSTricks/main.cgi?file=pdf/pdfoutput.               \documentclass[12pt]{article}          \usepackage{pstricks}     \usepackage{auto-pst-pdf}          \pagestyle{empty}          \begin{document}          \begin{pspicture}(-5.25,-5.25)(5.25,5.25)%       \pscircle*[linecolor=cyan]{5}       \psgrid[subgriddiv=0,gridcolor=lightgray,gridlabels=0pt]       \Huge\sffamily\bfseries       \rput(-4.5,4.5){A} \rput(4.5,4.5){B}       \rput(-4.5,-4.5){C}\rput(4.5,-4.5){D}       \rput(0,0){auto-pst-pdf}       \rmfamily       \rput(0,-3.8){PSTricks}       \rput(0,3.8){\LaTeX}     \end{pspicture}          % removed by poster: \includegraphics{foo}% can be foo.jpg or foo.png          \end{document}      compiles just fine with               $ pdflatex -shell-escape minimal.tex      and yields the desired `minimal.pdf`. Adding               \pdfoutput=1      before (or after) `\begindocumentclass[12pt]{article}` followed by               $ latex -shell-escape minimal.tex      or even               $ pdflatex -shell-escape minimal.tex      fails with `No pages of output` and               -------------------------------------------------     auto-pst-pdf: Auxiliary LaTeX compilation     -------------------------------------------------     This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)     entering extended mode          Package auto-pst-pdf Warning:          Creation of minimal-autopp.dvi failed.     This warning occured on input line 124.               Package auto-pst-pdf Warning:          Could not create minimal-pics.pdf. Auxiliary files not deleted.     This warning occured on input line 124.          -------------------------------------------------     auto-pst-pdf: End auxiliary LaTeX compilation     -------------------------------------------------      In either case, the corresponding log file minimal-autopp.log says               Package ifplatform Warning:      shell escape is disabled, so I can only detect \ifwindows.          )     \c@app@runs=\count111          ! Package auto-pst-pdf Error:      "shell escape" (or "write18") is not enabled:     auto-pst-pdf will not work!     .          See the auto-pst-pdf package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.134         Or turn off auto-pst-pdf.}                                         %     You need to run LaTeX with the equivalent of "pdflatex -shell-escape"     Or turn off auto-pst-pdf.      So, it seems like the auxiliary pdflatex process which generates the minimal- pics.pdf is now missing the option `-shell-escape`. PS: Adding the option [crop=off] to auto-pst-pdf as in auto-pst-pdf Problem does not change anything (and I guess it shouldn't have worked in the first place if that would have been the problem).


title: Redefining an environment or a command with an indefinite numbers of items

text: According to LaTeX's basic commands if I want to create a list of items I have to use the following concept code:               \begin{itemize}       \item first       \item second       \item third     \end{itemize}      To keep my code as clean as possible and really customizable I use another concept:               \begin{myenv}       \item first       \item second       \item third     \end{myenv}      If it's possible, I'd like to also customize the "item command" like this (but it's not really essential):               \begin{myenv}       \myitem first       \myitem second       \myitem third     \end{myenv}      The problem is: How I can redefine an environment like this?               \newenvironment{myenv}       {?}       {?}      I'd like to ask the same question for the newly created command with               \newcommand{\mycmd}{?}


title: Creating a labeled tetrahedron with tikzpicture

text: I am wanting to draw a tetrahedron with labeled points on each corner. I attempted to edit the example of a cone that I found here: A cone with tikzpicture I have made it look partially like a tetrahedron but have not been able to get it right (let alone labeled points). This is what I’ve got so far:               \documentclass{article}          \usepackage{tikz}     \usepackage{tikz-3dplot}          \begin{document}          \begin{tikzpicture}[tdplot_main_coords]      \def\RI{2}      \def\RII{1.25}           \draw[] (\RI,0)        \foreach \x in {0,240} { --  (\x:\RI) node at (\x:\RI) (R1-\x) {} };      \draw[dashed,thick] (R1-0.center)        \foreach \x in {120} { --  (\x:\RI) node at (\x:\RI) (R1-\x) {} };                \begin{scope}[yshift=2cm]      \draw[thick,fill=gray!30,opacity=0.2] (\RII,0)        \foreach \x in {0,120,240,360}          { --  (\x:\RII) node at (\x:\RII) (R2-\x) {}};      \end{scope}           \foreach \x in {0,240} { \draw (R1-\x.center)--(R2-\x.center); };      \foreach \x in {120} { \draw[dashed] (R1-\x.center)--(R2-\x.center); };      \end{tikzpicture}          \end{document}      and this is what it compiles to give: ![enter image description here](http://i.stack.imgur.com/mTGrV.png)


title: Move a tikz node somewhat below in relative positioning

text: I have the following code (stripped down from a much larger one). _(I understand that there are numerous questions (and answers includingthis excellent one) on relative positioning of nodes, but they do not seem to solve my problem. Before you mark my question as duplicate, please make it sure that it really addresses my issue ie. use relative positioning and not absolute positioning.)_               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{automata,positioning}          \begin{document}          \begin{tikzpicture}[node distance=40.0mm, auto]       \node[state] (3) {3};        \node[state] (1) [above left=of 3]  {1};        \node[state] (2) [above right=of 3] {2};      \end{tikzpicture}          \end{document}      The output looks like this. ![enter image description here](http://i.stack.imgur.com/i3KQu.png) I would like to move node 3 somewhat below its current position. I have tried many ways of doing this using relative positioning (and without using absolute positioning), without success. How do I do this?


title: Change words in a Tikz picture every page

text: I'd like to create a template, as below. But I'd like to make it so that I can have multiple pages of the same layout and be able to easily replace "Header 1" and "Header 2" with different words each time. ![enter image description here](http://i.stack.imgur.com/H3SZO.png) I am able to make the gray boxes and place the words using the code below. Right now I have them in as a header so that it'll easily be place on each page.                   \begin{tikzpicture}[remember picture,overlay, fill]             \path [fill=lightgray]                 ([yshift=9cm]current page.west) -- ([yshift=9cm,xshift=12cm]current page.west) -- ([yshift=8.5cm,xshift=12cm]current page.west) -- ([yshift=8.5cm]current page.west) -- cycle;             \path [fill=lightgray]                 ([yshift=0cm]current page.west) -- ([yshift=0cm,xshift=12cm]current page.west) -- ([yshift=-0.5cm,xshift=12cm]current page.west) -- ([yshift=-0.5cm]current page.west) -- cycle;             \node[font=\bfseries\color{black},anchor=west,                   xshift=1cm,yshift=9.5cm] at (current page.west)                   {\fontsize{40}{60}\selectfont Header 1};             \node[font=\bfseries\color{black},anchor=west,                   xshift=1cm,yshift=0.5cm] at (current page.west)                   {\fontsize{40}{60}\selectfont Header 2};         \end{tikzpicture}%      But I'm wondering if there's a way to define a new environment with a tikz picture so that I can just define that environment and change the words as needed without having to individually place the headers/words each time.


title: Setting Counters for Theorems

text: I'm using the following code to generate the "lemma" functionality in my document:               \newtheorem{lemma}[theorem]{Lemma}      However, the first lemma I define appears as `Lemma 0.1`. I tried using the `\setcounter{lemma}` command to change the count, but it didn't work. I want to be able to set the counter so that the first lemma I define appears as `Lemma 5.1`. Note that I'm not working with sections or any other partitioning like that, so the 5 is somewhat arbitrary.


title: Graphics/logo in headers

text: I am writing a short note. I would like to include a graphics file with a logo in the header of all pages including the front page. The logo is roughly the size of the box generated in the example below. I am trying to use the `fancyhdr` package. There are (at least) two problems:   1. Too little space between the logo and the title on the front page   2. The page margin at the bottom of page 2 and subsequent pages is too small and moreover different from the bottom margin of the front page. I realize that something has to give. Any suggestions? If I can use/tweak my headings as an alternative that would be fine too.               \documentclass[11pt,a4paper]{article}          \usepackage{lipsum}     \usepackage{graphicx}          \usepackage{fancyhdr}     \pagestyle{fancy}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}     \chead{\rule{360pt}{70pt}} % instead of \chead{\includegraphics{top.jpg}}          \begin{document}     \title{Title here}      \date{November 2011}     \author{Jesper Jensen}     \maketitle          \thispagestyle{fancy}     \lipsum[1-9]     \end{document}


title: Making mdframed paragraph behave like normal paragraphs in terms of spacing

text: I'm using the `mdframed` package to highlight a paragraph with rules on both sides. However, the `mdframed`-environment creates a box for the paragraph inside of it and so the spacing around it is different form the spacing of a normal paragraph. The following code shows the problem:               \documentclass{article}     \usepackage{mdframed}          \parindent=0pt     \newenvironment{note}{%         \begin{mdframed}[leftmargin=\dimexpr-0.5em-3pt, innerleftmargin=0.5em,                          rightmargin=\dimexpr-0.5em-3pt, innerrightmargin=0.5em,                          linewidth=3pt,linecolor=red, topline=false, bottomline=false]%     }{\end{mdframed}}          \begin{document}     \Huge XYZ          XYZ          \begin{note}     XYZ     \end{note}          XYZ          xyz          \begin{note}     xyz     \end{note}          xyz     \end{document}      I guess the problem can be fixed with adjusting the inner margin/skip options for the `mdframed` environment, but it seems rather tricky to find the correct values to make it behave _exactly_ like a normal paragraph. Any ideas how to get the natural paragraph spacing for that? EDIT: To make it more clear, the prolematic part is the line-spacing before and after the framed paragraph. You can see the problem best when selecting a big font size and short paragraphs. In my example the framed block starts right at the bottom of text in the paragraph before it, but there should be some additional space/glue between both. The opposite problem occurs at the bottom of the framed paragraph, there's too much space between it and the following paragraph.


title: Image Orientation

text: When I import several images into LaTeX, the default is for the images to appear directly below the previous image. How can I display the pictures (even as many as five) side by side on the same row? Also, how can I have three rows of the images displayed one right after the other?


title: Biblatex square brackets color

text: How can I change the square brackets color of references in text using biblatex (numeric style)? I know it can be done with natbib, but not using this package anymore.               \documentclass[hidelinks,spanish]{book}     \usepackage[usenames,dvipsnames]{color}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \definecolor{CeruleanRef}{RGB}{12,127,172}     \usepackage[colorlinks=true,linkcolor=black,citecolor=CeruleanRef,urlcolor=black]{hyperref}     \usepackage[numbers,sort&compress]{natbib}     \bibpunct{\color{CeruleanRef}[}{\color{CeruleanRef}]}{,}{n}{}{;}          \bibliographystyle{unsrtnat}          \begin{document}          \frontmatter          \mainmatter          A reference: \cite{RBoehler1996}          \appendix          \backmatter          \bibliography{articles,reports,books,reviews}          \end{document}      With natbib I get this: ![enter image description here](http://i.stack.imgur.com/dtYTm.png) I want the same with biblatex and biber.


title: Piecewise defined function in tikz or tkz-fct

text: How to define and plot a piecewise defined function in tikz or tkz-fct? For example consider the function f(x) = 1 for x < 0, x for 0 <= x < 1, cos(x) for x >= 1 **Edit:** After Torbjørn T.'s comment I tried the following. I should mention that I included three different versions of plotting the function because I want that all three versions should work.               \documentclass{article}     \usepackage{amsmath}     \usepackage{pgfplots}     \usepackage{tkz-fct}          \pgfmathdeclarefunction{p}{3}{%       \pgfmathparse{(and(#1>#2, #1<#3))}%     }          \pgfmathdeclarefunction{f}{1}{%       \pgfmathparse{p(#1,-100,0)*1 + p(#1,0,1)*#1 + p(#1,1,100)*cos(#1r)}     }          \begin{document}          \begin{tikzpicture}        \tkzInit[xmin=-1,xmax=5,ymax=4] %        \tkzGrid %        \tkzAxeXY %        \tkzFct{f(x)} %        \draw plot function{f(x)};%           \begin{scope}[xshift=4cm]           \begin{axis}              \addplot[domain=-2:4,samples=100]{f(x)};           \end{axis}        \end{scope}     \end{tikzpicture}               \end{document}      Which gives the following output: ![output](http://i.stack.imgur.com/xC6lS.jpg)


title: Formatting a large matrix across multiple lines

text: I have the following latex to create a matrix:               \documentclass[12pt]{article}     \usepackage[margin=1in]{geometry}     \usepackage{amsmath,amsthm,amssymb}     \usepackage{graphicx,ctable,booktabs}          \begin{document}     $\left(\begin{array}{rrr}     -\frac{200 \, x^{2} {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, x^{2}}{x^{2} + y^{2}} + \frac{200 \, {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{\sqrt{x^{2} + y^{2}}} + \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} + \frac{5000 \, \pi^{2} y^{2}}{x^{4} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} - \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y^{3}}{x^{5} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & -\frac{200 \, x y {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, x y}{x^{2} + y^{2}} - \frac{1000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)}}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} - \frac{5000 \, \pi^{2} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} + \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y^{2}}{x^{4} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & \frac{1000 \, \pi y}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} \\     -\frac{200 \, x y {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, x y}{x^{2} + y^{2}} - \frac{1000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)}}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} - \frac{5000 \, \pi^{2} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} + \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y^{2}}{x^{4} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & -\frac{200 \, y^{2} {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, y^{2}}{x^{2} + y^{2}} + \frac{200 \, {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{\sqrt{x^{2} + y^{2}}} + \frac{5000 \, \pi^{2}}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} - \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & -\frac{1000 \, \pi}{x {\left(\frac{y^{2}}{x^{2}} + 1\right)}} \\     \frac{1000 \, \pi y}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} & -\frac{1000 \, \pi}{x {\left(\frac{y^{2}}{x^{2}} + 1\right)}} & 202     \end{array}\right)$     \end{document}      Here is the result: ![Large Matrix](http://i.stack.imgur.com/XUPn0.png) How can I properly format the above matrix so that it does not get cut off? How can I make span multiple lines instead?


title: Reproducing a font style

text: How to reproduce this font style please? ![enter image description here](http://i.stack.imgur.com/m2DsA.png) I've tried this, but it wouldn't work. > \large\normalfont{Najeh} Thanks a lot!


title: pgfplots: Clipping Everything Outside a Specific Area

text: I want to add information to each column of a histogram. `every node near coord` is probably the best approach. It works well with bar plots but not with the histogram:               \documentclass{article}          \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \usetikzlibrary{pgfplots.statistics}          \begin{document}          \begin{tikzpicture}     \begin{axis}[     ybar interval,     xticklabel=\pgfmathprintnumber\tick--\pgfmathprintnumber\nexttick,     % Code to generate labels     nodes near coords={     \pgfmathprintnumber{\pgfkeysvalueof{/data point/y}}     },     every node near coord/.style={     anchor=south,xshift=9mm,     },     %     ]     \addplot+[hist={bins=3}]     table[row sep=\\,y index=0] {     data\\     1\\ 2\\ 1\\ 5\\ 4\\ 10\\     7\\ 10\\ 9\\ 8\\ 9\\ 9\\     };     \end{axis}     \end{tikzpicture}          \end{document}      I used `every node near coord/.style` to shift the labels. The **problem** is that I have **four labels** for **three columns/bars** : ![enter image description here](http://i.stack.imgur.com/TmAFl.png) I addition I would like to **center the labels**. A workaround will be a manual adjustment (`every node near coord/.style`) just like in the shown example. **Update** Maybe **clipping** is a possibility. Is there a way to clip the labels (in this case the 7 in the right) away? Like this: ![enter image description here](http://i.stack.imgur.com/bhArc.png)


title: Font problems with pslatex

text: I am not really familiar with `pslatex`, I usually prefer `pdflatex`. I prepared a document, compiled with `pdflatex` many times and everything works perfectly. Now I have to recompile it with `pslatex`. I converted the images from pdf to ps and tried to run `pslatex myfile.tex`. Everything works, but when I try to open the `dvi` file I get uncomprensible text. For example:               Random Spanning ...      is               Q'ncnl Ro'nnlnf ...      I guess it is a problem related to font packages or something similar.


title: How can I insert a picture into a TikZ diagram?

text: I want to insert a picture into a TikZ graphic, is it possible? An example: ![diagram](http://i.stack.imgur.com/78Rah.png)


title: Left-align the date for all cvitems

text: All contents (mostly dates) of the first argument of `\cvitem` should left- align in Austria - as explained to me in the career center. I want to redefine the command `\cvitem` (like in Can I redefine a command to contain itself?).               \let\oldcvitem\cvitem     \renewcommand*{\cvitem}[3][]{\oldcvitem}      My MWE:               \documentclass[11pt,a4paper,sans]{moderncv}          \let\oldcvitem\cvitem%     \renewcommand*{\cvitem}[3][]{\oldcvitem[#1]{\flushright{#2}}{#3}}%          \moderncvstyle{casual}     \firstname{First}     \familyname{Last}          \begin{document}      \section{Some examples}      \cvitem{Year}{Entry}      \cvitem{2001--2013}{I am a dark knight}     \end{document}


title: How to draw a line parallel to diameter intersecting the circumference of a circle

text: I have drawn a circle and its horizontal and vertical line.               \begin{tikzpicture}            \draw (0,0) node [above left] {O} circle (3); % circle of radius 3       \draw (0,3) node [above] {A} -- (0,-3) node [below] {B}; % vertical diameter       \draw (-3,0) node [left] {P} -- (3,0) node [right] {Q}; % hotizontal diameter          \end{tikzpicture}      Now, I want a line parallel to AB passing through (-2,0) and ending on the circumference of the circle at both ends.


title: How to turn a figure into a symbol?

text: I have some figures, for e.g., finite graphs, lattices or knots, that I have drawn in eps (or pdf) format. I would ideally love to have maps indexed by these figures. However, these figures are not part of the usual LaTeX symbol set(s). Is there a way to incorporate this? For example, if I have drawn a trefoil knot and I want to write something like `$f_{trefoil}$` (or perhaps a more complicated code) which upon processing this should look like what I want, what do I need to do? P.S. Feel free to retag this question as you see fit.


title: A five level deep list

text: I would like to create a five level deep list using the `enumitem` package. I found this suggestion on stackoverflow and implemented it as follows               \documentclass[twoside,a4paper,12pt]{report}     \usepackage{enumitem}     \setlistdepth{9}          \begin{document}     \begin{enumerate}     \item 1st level         \begin{enumerate}         \item 2nd level             \begin{enumerate}             \item 3rd level                 \begin{enumerate}                 \item 4th level                     \begin{enumerate}                     \item 5th level                     \end{enumerate}                 \end{enumerate}             \end{enumerate}         \end{enumerate}     \end{enumerate}     \end{document}      But still get the error `too deeply nested`. Using itemize environments is unfortunately not an option. In the link provided it is mentioned that the `\setlistdepth{}` only works from a certain version on, how do I find out which version I am using?


title: Special cases when using old-style figures

text: When using old-style figures, what are the special cases of using lining figures (if any), apart from maths? For instance, are reference marks one such instance?               Some 1998 text which references~[1]      where the `1998` would be in old-style, should the `[1]` be in lining-style? i.e.,               Some 1998 text which references~$[1]$      Same with equation number marks? How about percents?               In 1989, there was 25\%      or               In 1989, there was $25$\%      (side question, should there be a `\thinspace` or something between the percent-sign and the numbers?)


title: pgfplots: How to place the legend box in the middle of an axis

text: I would like to have something like               legend pos= west, %insted of north west, south east...      because I don't wanna place it in the corner but vertically in the middle. How could I do this?


title: How can I print only Author-Date of the parent crossref in the bibliography entry of the child of the crossref?

text: I have an `@article` entry, which crossrefs a `@periodical` entry. I cite both of them. In my bibliography, I would like the article to refer to the periodical in the form of the citation, but i only get a more expanded form with the title included and without the date.               \documentclass[a4paper,12pt]{scrartcl}          \RequirePackage[english,germanb]{babel}     \RequirePackage[utf8]{inputenc}     \RequirePackage[T1]{fontenc}     \RequirePackage{url}     \usepackage{csquotes}          \usepackage[style=authoryear-comp]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{question.bib}          @Periodical{ journal,     title = "A Journal",     editor = "Elena Trug",     year = "2013",     issuetitle = "The theme of the issue",     }          @Article{ article1,     title = "About something",     author = "Walter Kerny",     crossref = "journal"     }          \end{filecontents}               \addbibresource{./question.bib}          \begin{document}          \cite{journal,article1}          \printbibliography               \end{document}      I get something like: > Kerny 2013; Trug 2013 > > References > > Kerny, Walter (2013). "About something". In: _The theme of the issue_. Ed. > by > Elena Trug. > > Trug, Elena, ed. (2013). A Journal: The theme of the issue. And I would like something like that for the article (like I had before I switched from BibTeX to biblatex): > Kerny, Walter (2013). "About something". In: Elena Trug, ed. (2013). I hope I'm clear. * * * Edit: I used to manage this with BibTeX using an `@incollection` entry and an `@book` one.


title: latexmk with xelatex xdv mode

text: I want to know how to use latexmk with xelatex **and** tell it to write to xdv file a number of times until all the references are correct, then use `xdvipdfmx` once to generate the final output. This is practical because for manuscripts with a lot of figures and references and needs several passes to get all the references right, writing to xdv files are way, way faster than writing to pdf every pass.


title: How to align text in title with \fcolorbox

text: I have defined a new command to make some titles for a newsletter. I'm using the article class for the document. The command is defined with the following code:               \definecolor{myblue}{rgb}{0.16, 0.32, 0.75}     \newcommand{\articletitle}[1]     {     \stepcounter{art}     \setcounter{section}{0}     \vspace{0.15cm}     {\raggedright\fcolorbox{myblue}{myblue}{{\huge \textcolor{white}{\arabic{art}}}}\hspace{1em}\textcolor{myblue}{\huge{#1}}}\\     \rule{\textwidth}{1pt}     \vspace{-0.25cm}     }      Which gives the expected result: ![This is correct](http://i.stack.imgur.com/aphty.jpg) The problem is when the title is larger than one line, which gives: ![This is not properly aligned](http://i.stack.imgur.com/VmwyW.jpg) I would like the second line of the title to be aligned with the first letter with the same space than between the first letter and the `\fcolorbox`. The result should look like this: ![Correct alignement](http://i.stack.imgur.com/4RfRg.jpg) I have searched how to do this without success. Of course I'm sure this is pretty easy to do with LateX! So if someone can help me with this... Thanks


title: Latex not data driven enough, Embed XML+XSLT?

text: Ok, so I've been using Lyx for about a year now. I haven't really dug too deep in to the LaTex/Tex side of things. I've a little more experience with XML + XSLT. It has a nice seperation of Data from Presentation. (you could even say of Model from View). Lets say I have some information relating to a Timeline. In XML I would write:               <timeline title="Australian History>         <timepoint year="60000BC" event="Aboriginal Migration">Aboriginal Australians are believed to have first arrived on the Australian mainland by boat from the Indonesian archipelago.</timepoint>          <timepoint year="1606" event="First European Landing"> The first uncontested landing in Australia by Europeans was by Dutch navigator Willem Janszoon </timepoint>          <timepoint year="1770" event="British Claim"> James Cook charted the East Coast of Australia[1] for Britain and returned with accounts favouring colonisation at Botany Bay (now in Sydney). </timepoint>          <timepoint year="1788" event="First Fleet Arrival"> A First Fleet of British ships arrived at Botany Bay in January, to establish a penal colony. </timepoint>          <timepoint year="1901" event="Federation"> The Commonwealth of Australia came into being when the Federal Constitution was proclaimed by the Governor General, Lord Hopetoun, on the 1st of January.</timepoint>      </timeline>      (Datasource for above example). And then I would write a XSL transformation to make this into some nice human readable form. Perhaps a petty SVG diagram, or a website with suitable formatting. Is there a similar notion of seperating content from formatting in Latex? (that i could then embeed into Lyx). I thought one of the LaTex motto's was "Sort out the content, let the system take care of the formatting." (or something to that effect). I've envisioning if nothing else then a XSLT could be written to transform the XML into Tex, and then that Tex could be Included. (and this exectution of the XSLT could be done each time the Lyx/Tex is exported). But that is ugly. The must be a nicer way of using some form of Extensiable Markup in Tex.


title: Why might \\* ("line break here, but no page break") not work, and how can one fix this?

text: One is often taught that "`\\\` causes a line break which is not a paragraph break" and "the variant `\\\\*` additionally prevents a page break". (I hereby acknowledge user `egreg`'s admonition that "`\\\\*` should not be used".) But `\\\\*` often doesn't work! **When does`\\\\*` not work? How can one fix this?** The following code produces a footnote example and then a body text example. Note that usage of `\\\\*` within body text is probably more common.               \documentclass{article}     \usepackage{lipsum}               \begin{document}          \lipsum[1-4]\footnote{       no asterisk \\ asterisk \\*       no asterisk \\ asterisk \\*       no asterisk \\ asterisk \\*       no asterisk \\ asterisk \\*       no asterisk \\ asterisk \\*       % the pagebreak happens here       last line}     \lipsum[5]               \lipsum[6-8]     \lipsum[2]          Line 1 \\*       % the pagebreak happens here     Line 2 \\*     Line 3 \\*     Line 4 \\*     Line 5 \\     Line 6          \end{document}


title: Extra Space After newcommand

text: I was trying to write a macro to bold a name. I used:               \newcommand{\authorship}[2]{\textbf{#1 #2}}      then in the text used               \authorship{Dave Bridges}      Unfortunately when run through pdflatex I get an extra space after the name. So for example the line               \authorship{Bridges, D.}, M. E. Fraser and G. B. G. Moorhead.  2005.  Cyclic Nucleotide Binding Domains in the Arabidopsis thaliana and Oryza satviva Genomes.  BMC Bioinformatics 6(1): 6.      adds an extra space between the period after D and the comma. How do I get rid of that extra space?


title: latexdiff fails on description environments

text: This example fails to generate a valid `.tex`: ### `test.tex`               \documentclass[a4paper]{report}     \begin{document}     \begin{description}         \item[thing] explanation of thing     \end{description}     \end{document}      ### `test_modified.tex`               \documentclass[a4paper]{report}     \begin{document}     \begin{description}         \item[A first thing] an explanation of first thing     \end{description}     \end{document}      Executing               latexdiff test.tex test_modified.tex > test_diff.tex       pdflatex test_diff.tex      yields               ! LaTeX Error: Something's wrong--perhaps a missing \item.                                                 l.25 ...      Here is the block of interest in the generated `.tex`:               \begin{document}     \begin{description}         \DIFdelbegin %DIFDELCMD < \item[thing] %%%     \DIFdel{explanation of }\DIFdelend \DIFaddbegin \item[A first thing] \DIFadd{an explanation of first }\DIFaddend thing     \end{description}     \end{document}      So `latexdiff` has inserted code _before_ the `\item`, and the compiler does not like it. Now the manpage says `latexdiff` has options to exclude commands. I tried to add               --exclude-safecmd="\\\item"      in the command line invoking `latexdiff`, with no success. Has anyone ever tweaked the options of `latexdiff` and could say how to circumvent the bug (e.g. tell `latexdiff` to skip this kind of environment)?


title: Why use \DeclareTextFontCommand vs. just \newcommand?

text: Why should I use `\DeclareTextFontCommand` vs. just `\newcommand`? In the answer to my previous question, @egreg said: > With `\DeclareTextFontCommand` you get a robust command that will remain > untouched when found in a moving argument such as a section title or a > caption. but I still don't understand what "moving argument" is, and how will `\newcommand` fail at this - just curious.


title: Font Error when using pslatex and gnuplot

text: I have a very persistent problem. I am creating a figure using gnuplot with pslatex terminal. Then I use Latex to create the .dvi (using the figure), then dvips to create the .ps and finally ps2pdf to create the .pdf. On the last step, I get the following error: GPL Ghostscript 9.05: Error: Font Renderer Plugin ( FreeType ) return code = -1 This causes the font in the figure to come out too large. Basically, I cannot control the font anymore from within gnuplot. I have installed a fixed version of FreeType (http://bugs.ghostscript.com/show_bug.cgi?id=692948) but it didn't help. I am using Ubuntu 12.04. Thanks in advance for your help :)


title: Latex using footnotes in a two-column page

text: I am using a two-column format for my paper. In the bottom left column I have the following:               Beginning introduction text. Next sentence with links to the terms     Skype\footnote{http://www.skype.com}, Google+Hangouts\footnote{link here}     and Facetime\footnote{link here} some text here. Proceeding introduction text..      Somehow this part of the text immediately goes to the upper right column of the paper but I just want it to stay in the down left and proceed in the upper right corner. If i delete the `\footnote` commands it looks good but I do however want the numbering and footnotes to work properly. ![enter image description here](http://i.stack.imgur.com/J9ls7.png) As shown the Introduction shifts downwards to compensate for the 3 footnotes in the upper right column. However, If I delete the footnotes the Introduction section aligns under the abstract perfect.


title: How to let text flow around irregular-shaped graphics in ConTeXt?

text: I have some illustrations which I need to scan and place within a document. The illustrations come in various shapes, with no straight edges, and are bound by lots empty white space, e.g.:                __________________     |                  |     |    *  *          |     |   ******         |     |   ******     *   |     |    ****     *    |     |     *********    |     |      ********    |     |      * *  * *    |      |     *  *  * *    |     |__________________|      I would like to be able to allow the text of the document to fit more closely to the shape, for e.g.:               |           This is the story |     |    *  *     of a cat named  |     |   ******        Cat who li- |     |   ******     *  ked to eat  |     |    ****     *  mice. One d- |     |     *********  ay while wa- |     |      ********  lking throu- |     |      * *  * *  gh the fore- |     |     *  *  * *  st, Cat fou- |     |                nd a family  |     | of mice who lived in a hol- |     | llow tree.                  |      How can I place such an irregularly shaped graphic within my document?


title: KOMA-script: enddot with appendix

text: Using the `\appendix` command somwhere in a KOMA-script document (in my case `scrreprt`) should change the behaviour of the enddot in a sectioning command: The chapters should only have an enddot if the numbering is in roman numerals (e.g. in the appendix) and otherwise should not have an enddot (according to the German scrguide).               \documentclass{scrreprt}     \usepackage[english]{babel}     \begin{document}     \chapter{Main}          \appendix{}     \chapter{Appendix}     \end{document}      The first compilation yields headings without any dot (even in the appendix). A secon compilation, however, yields dots in both headings. Removing the corresponding .aux file and doing recompilations reproduces the results. Moreover, the KOMA-option `numbers=autoenddot` does not change the results. Is this the expected behaviour? Why are all headings with an enddot as soon as there is the `\appendix`?


title: Using multicolumn and multirow together with spreadtab

text: I tried this piece down               \documentclass[a4paper,12pt]{article}     \usepackage[inner=0.75in,outer=0.65in,top=0.75in,bottom=0.65in]{geometry}     \usepackage{multirow}     \usepackage{spreadtab}     \usepackage[sc]{mathpazo}     \usepackage[onehalfspacing]{setspace}     \begin{document}     \begin{table}[!htb]     \centering     \caption{Sample} \vspace{3pt}     \begin{spreadtab}{{tabular}{|c|l|l|c|c|c|c|c|c|}}     \hline     @\multirow{2}{*}{Sl No.} &      @\multicolumn{2}{|c}{\multirow{2}{*}{\textbf{something}}} &      @\multicolumn{4}{|c}{\textbf{s}} &      @\textbf{a~/~b} &      @\multirow{2}{*}{\textbf{Total}} \\ \cline{3-6}     &  &  & @\textbf{x} & @\textbf{y} & @\textbf{z} & @\textbf{m} &      @\textbf{/~c} & \\ \hline     @\multirow{2}{*}{1} & @1 \& & @x & & & & 1 & &      \STcopy{v}{d3+e4+f4+g4+h4}\\ \cline{1-1} \cline{3-9}     & @Safety & @\textbf{Sub Total} & {\fontseries{b}\selectfont}\Stcopy{>}{d3}    &     \textbf{:={}} & \textbf{:={}} & \textbf{:={}} & \textbf{: ={}} & \textbf{:={}}      \\ \hline          \end{spreadtab}     \label{tab:tofisa}     \end{table}     \end{document}      Is there any alternate method to do the same? Can \multicolumn and \multirow be used as above with spreadtab???


title: TikZ external Library and pgfplots reading data from external txt file

text: I'm using the external library of TikZ for speeding up the compilation of my LaTeX document. In another thread, Christian Feuersänger reported that from December 2012, the external library uses MD5 checksums to find out whether a source file changed or not and whether the corresponding figure must be re- built in order to be up-to-date. This works fine for my figures that have been made using plain TikZ. However, I also use pgfplots to plot the run of variables whose data is stored in an external txt file. This is a MWE of what I do and how I do it:               %%% this is the main.tex file %%%     \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{external}     \usepackage{pgfplots}     \tikzexternalize     \tikzsetexternalprefix{./PDF/}     \begin{document}     \begin{figure}       \tikzsetfigurename{fluk-p}       \tikzpicturedependsonfile{data.txt}       \input{fluk-p.tex}     \end{figure}     \end{document}          %%% This is the fluk-p.tex file %%%     \begin{tikzpicture}       \begin{axis}[xlabel={Zeit\,[s]}]      ]     \addplot [color=red] table [x index=0,y index=1] {data.txt};     \addplot [color=blue] table [x index=0,y index=2] {data.txt};       \end{axis}     \end{tikzpicture}          %%% This is the data.txt file %%%     0  1  2     1  2  1     2  1  2      If I change something in the fluk-p.tex file -- say the xlabel -- TikZ finds out correctly and re-builds the figure. But if I change something in the corresponding data.txt file TikZ does not notice this. I thought I could fix this issue with the \tikzpicturedependsonfile{data.txt} command but I was wrong obviously. Can anybody help how I can make TikZ to notice changes not only in the fluk-p.tex but also in the data.txt? Thanks in advance! Sven


title: Modifying formatting of Table of Contents heading

text: I am finishing up my Master's thesis and need to modify the formatting of the _heading_ for the Table of Contents (TOC). My university's guidelines require "TABLE OF CONTENTS" to appear in all caps in the top-center of the page. I am working with a modified version of the ucthesis.cls template. The original template defines the TOC as: [Code A]               \def\tableofcontents{\@restonecolfalse       \if@twocolumn\@restonecoltrue\onecolumn\fi       \chapter*{\contentsname            \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}       }%       {\ssp\@starttoc{toc}}\if@restonecol\twocolumn\fi}      My workaround to make "TABLE OF CONTENTS" appear correctly has been to rewrite this part of the template as: [Code B]               \def\tableofcontents{\@restonecolfalse       \if@twocolumn\@restonecoltrue\onecolumn\fi       \clearpage       \begin{center}                \MakeUppercase{\contentsname}       \end{center}       {\ssp\@starttoc{toc}}\if@restonecol\twocolumn\fi}      This works as expected, but removing the `\chapter*{}` line has the side effect of removing indentations before section and subsection numbers in the TOC, as defined by the following lines of code included in the ucthesis.cls template               \def\l@section{\@dottedtocline{1}{1.5em}{2.3em}}     \def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}      Below are the outputs from code snippets A and B, respectively. ![Incorrect TOC header, correct indentation](http://i.stack.imgur.com/DMkB0.png) ![Correct TOC header, incorrect indentation](http://i.stack.imgur.com/tB489.png) I don't have much experience with LaTeX templates or macros and have found it difficult to dig up some documentation on what things like `\@mkboth` do. If anyone can shed some light on why the TOC needs to be included as a chapter and how I might be able to change the appearance of the header, it would be greatly appreciated--Thanks!


title: Adding labels to xypic

text: How would I add labels to the following xypic?               \xymatrix{       1 \ar@<-.5ex>[r] \ar@<.5ex>[r] & 2.     }      I would like to add a `\alpha_1` above the top arrow and a `\alpha_2` below the bottom arrow.


title: Using tikzpicture or pgfplots to draw a uniform grid

text: I want to use `pgfplots` or `tikzpicture` to draw a uniform grid as illustrated in below. The grid size in the figure is `8×8`. I want to be able to define a parameter that gives me the ability to draw grids with different sizes, for example, `16×16` or `32×32`. Could someone help me how I should do it? ![enter image description here](http://i.stack.imgur.com/HPOYT.png)


title: Formatting labels of chapters and sections

text: I'm just starting with this amazing world of LaTeX. I'm wondering how to set the format of a document (with some stuff centered and sections with no relative numbering) I'm trying with the `titlesec` package, But I'm not being lucky. This is what I need to reach:               Chapter 1 <- this should be centered     About whatever... <- this also should be centered     blablabla... <-this should be on the left side          Section 1. blablabla <- section in the left side, text begins in the same line          Section 2. bla bla bla     bla          Chapter 2     About whatever else...          Section 3. bla bla bla  <-IMPORTANT, section have a non relative numbering     .     .     .      Does anybody knows how to do this? **UPDATE:** Well, I found a partially solution that I would like to share. This is the code for making the section counter non relative:               \usepackage{chngcntr}     \counterwithout{section}{chapter}      Also I found a way for solving the Chapter centering:               \usepackage[Glenn]{fncychap}      This makes a fancy chapter title what makes me happy because is centered and looks nice.


title: Is is possible to associate part of a drawing to a pdfcomment (or similar) interactive bubble?

text: It is apparently possible to put a TikZ drawing inside a `pdfcomment` (but using `mbox`). Is is possible to associate only part of a drawing (e.g. a line) to a `pdfcomment`? Below it is the suggested code. I am open to use other interactive packages (similar to `pdfcomment`) if that can solve the problem. The final goal is to associate individual curves in a `pgfplot` to a tooltip when dragging the mouse.               \documentclass[]{article}     \usepackage{tikz}     \usepackage[]{pdfcomment}     \begin{document}          %ok     \pdfmarkupcomment[]{         text     }{         a paragraph     }          % ok but needs mbox     \pdfmarkupcomment[]{         \mbox{         \begin{tikzpicture}         \draw(0,0)--(1,1);         \draw(0,1)--(1,0);         \end{tikzpicture}}     }{         a drawing     }          %not ok (Error: Missing } inserted.)     \begin{tikzpicture}         \pdfmarkupcomment[]{             \draw(0,0)--(1,1);         }{             a line         }         \draw(0,1)--(1,0);     \end{tikzpicture}          \end{document}


title: multicol seems to sum up problems to later move lines to the next page

text: We digitize and reproduce old German bible texts as free software. From XML, we are automatically generating LaTeX output to then generate PDF. One of our current implementations is using the `multicol` package in combination with `bigfoot` and `perpage`. The observation is that in documents with multiple `multicols` environments there is a chance that lines get moved to the next page (leaving some empty space on the previous page), even if there are manual `\pagebreak{}`s inserted. I tried to apply some of the solutions mentioned in the documentation of `multicol`, but for instance `\setcounter{collectmore}{X}` seems to have no effect. Is there any problem or solution known? I can't provide a minimal example, because the issue is reproducable only as result of larger `multicol` environments following each other. The effect doesn't appear if I remove the `multicol` before it. However, I would be glad to provide the entire source file. So, any ideas? Edit: I now made a screenshot of the result: ![multicol lines to next page.](http://i.stack.imgur.com/VTOPD.png) There is a manual `\pagebreak{}` at the line `Mensch Christus\pagebreak{} Jesus,`, which just has no effect. This `multicol` environment is the 3rd, if I remove one of the two previous `multicol` environments (doesn't matter which one), the two empty lines wound disappear.


title: MiKTeX and Perl scripts (and one Python script)

text: Again and again here on TeX.SX users of MiKTeX ask a question having a problem with a package or included program, where it turns out, that a Perl script is involved, in particular `glossaries` (because of the script `makeglossaries`), `latexdiff` and `latexmk`. In most cases the error message looks like this: > `makeglossaries.exe: The Perl interpreter could not be found.` When my remembrance does not deceive me, it must have worked in earlier versions of MiKTeX out of the box. _**Though there are answers to questions serving more than the special issue, can we give here a basic solution even if it is not TeX related?**_ Let me list which Perl scripts are included in MiKTeX at time of writing (excerpt from MiKTeX configuration file `scripts.ini`), for every script line exists a executable in the binaries subfolder with the name seen before the equal sign:               OOopict=scripts/gapfill/OOopict.pl     afm2afm=scripts/fontools/perl/afm2afm.pl     arlatex=scripts/bundledoc/arlatex     authorindex=scripts/perl/authorindex/authorindex.pl     autoinst=scripts/fontools/perl/autoinst.pl     bib2xhtml=scripts/bib2xhtml/perl/bib2xhtml.pl     bibhtml=scripts/bibhtml/perl/bibhtml.pl     biokey2html1=scripts/shipunov/biokey2html1.pl     biokey2html2=scripts/shipunov/biokey2html2.pl     biokey2html3=scripts/shipunov/biokey2html3.pl     birm=scripts/burmese/perl/birm.pl     bundledoc=scripts/bundledoc/bundledoc     cmap2enc=scripts/fontools/perl/cmap2enc.pl     csvtools=scripts/csvtools/perl/csvtools.pl     ctanify=scripts/ctanify/ctanify     ctanupload=scripts/ctanupload/ctanupload.pl     dosepsbin=scripts/dosepsbin/dosepsbin.pl     etexdef=scripts/texdef/perl/texdef.pl     exceltex=scripts/exceltex/perl/exceltex     feynmf=scripts/feynmf/perl/feynmf.pl     fig4latex=scripts/fig4latex/perl/fig4latex.pl     findhyph=scripts/findhyph/perl/findhyph.pl     font2afm=scripts/fontools/perl/font2afm.pl     fullref=scripts/aomart/perl/fullref.pl     htcopy=scripts/tex4ht/htcopy.pl     htmove=scripts/tex4ht/htmove.pl     ibyhyph=scripts/perl/ibycus-babel/ibyhyph.pl     latex-git-log=scripts/latex-git-log     latexdef=scripts/texdef/perl/texdef.pl     latexdiff-fast=scripts/latexdiff/latexdiff-fast     latexdiff-so=scripts/latexdiff/latexdiff-so     latexdiff-vc=scripts/latexdiff/latexdiff-vc     latexdiff=scripts/latexdiff/latexdiff     latexindent=scripts/latexindent/latexindent.pl     latexmk=scripts/latexmk/perl/latexmk.pl     latexpand=scripts/latexpand/latexpand     latexrevise=scripts/latexdiff/latexrevise     ltximg=scripts/ltximg/ltximg.pl     lualatexdef=scripts/texdef/perl/texdef.pl     luatexdef=scripts/texdef/perl/texdef.pl     makeglossaries=scripts/glossaries/makeglossaries     makejmlrbook=scripts/jmlr/makejmlrbook     mathspic113=scripts/mathspic/mathspic113.pl     mathspic=scripts/mathspic/mathspic113.pl     mf2pt1=scripts/mf2pt1/mf2pt1.pl     mk4ht=scripts/tex4ht/mk4ht.pl     mkjobtexmf=scripts/mkjobtexmf/mkjobtexmf.pl     mkt1font=scripts/perl/accfonts/mkt1font.pl     mptopdf=scripts/context/perl/mptopdf.pl     orderrefs=scripts/perl/orderrefs/orderrefs.pl     ot2kpx=scripts/fontools/perl/ot2kpx.pl     pdfatfi=scripts/oberdiek/pdfatfi.pl     pdfcrop=scripts/pdfcrop/pdfcrop.pl     pdflatexdef=scripts/texdef/perl/texdef.pl     pdftexdef=scripts/texdef/perl/texdef.pl     pedigree=scripts/pedigree-perl/pedigree-perl/perl/pedigree.pl     perltex=scripts/perltex/perl/perltex.pl     pfm2kpx=scripts/fontools/perl/pfm2kpx.pl     pkfix-helper=scripts/pkfix-helper/pkfix-helper     pkfix=scripts/pkfix/pkfix.pl     pn2pdf=scripts/perl/petri-nets/pn2pdf.pl     pst2pdf=scripts/pst2pdf/perl/pst2pdf.pl     rcsinfo=scripts/rcsinfo/perl/rcsinfo.pl     showglyphs=scripts/fontools/perl/showglyphs.pl     splitindex=scripts/splitindex/perl/splitindex.pl     sty2dtx=scripts/sty2dtx/perl/sty2dtx.pl     svn-multi=scripts/svn-multi/svn-multi.pl     texcount=scripts/texcount/perl/texcount.pl     texdef=scripts/texdef/perl/texdef.pl     texdiff=scripts/texdiff/perl/texdiff.pl     texdirflatten=scripts/texdirflatten/perl/texdirflatten.pl     thumbpdf=scripts/thumbpdf/perl/thumbpdf.pl     urlbst=scripts/urlbst/urlbst     vpe=scripts/vpe/vpe.pl     vpl2ovp=scripts/perl/accfonts/vpl2ovp.pl     vpl2vpl=scripts/perl/accfonts/vpl2vpl.pl     xdv2pdf_mergemarks=scripts/xetex/perl/xdv2pdf_mergemarks.pl     xelatexdef=scripts/texdef/perl/texdef.pl     xetexdef=scripts/texdef/perl/texdef.pl      There is very probably a similar issue for the one listed Python script:               pgfplots=scripts/pgfplots/pgfplots.py      * * * _PS: Lua scripts are not affected!_


title: Makeglossaries - cannot compile glossary list

text: I am trying to get the `glossaries` package to work. I have created a minimal `.tex` file to test it. I am using TeXworks. My `.tex` file currently looks like this:               \documentclass{amsart}     \usepackage{amsmath, amssymb,amscd}          \usepackage{glossaries}          \newglossaryentry{test}{         name=Test,         description={is a test}     }          \makeglossaries          \begin{document}          This is a \gls{test}.          \printglossaries          \end{document}      The compiled pdf has the sentence "This is a Test", but there is no glossary list. I am currently compiling under the option "pdfLaTeX+MakeIndex+BibTeX". I have tried compiling just under MakeIndex by itself and then compiling the pdf again, but there is still no list. I have tried adding a "makeglossaries" option to the list of compiling options according to the following directions I found: > "You go to TeXWorks > Preferences > Typesetting, and add a processing tool. > Name it "makeglossaries" (or whatever you'd like, really), enter the program > "makeglossaries" (which should be already installed somewhere---don't worry > about the full pathname), and add a single argument: "$basename" so that > your main filename will be passed to the makeglossaries process." But when I compile under the new "makeglossaries" option I get the following error: > `makeglossaries.exe: The Perl interpreter could not be found.` After searching for info on this error I downloaded ActivePerl, following the link from this Stack Exchange question: Perl Interpreter could not be found. But I still get the error when compiling under the "makeglossaries" option. Can anyone help me figure out how to get the glossary list to appear in the compiled pdf?


title: Can't create glossary with glossaries package,Perl Strawberry, error: makeglossaries:Need exactly one file argument

text: New to Stack Exchange, and using TeX for a week.. Trying to make glossaries work for a larger document, but this even fails with the first example document provided by the glossaries package.. I have: TeXStudio 2.5.2 MikTeX 2.9, Perl Strawberry latest version 32-bit installed and even checked if the PATH was added correctly (after scavanging other answers to posts) (in commandpromt `perl -v` returns the version.. I checked all the packages needed for the `glossaries` package. I added a custom user command to add the `makeglossaries` command available for running. After a first pdfLaTeX compile and run, I get an error when running `makeglossaries`. The error message I am getting is:               Process started: "C:/LaTeX/scripts/glossaries/makeglossaries.bat"     makeglossaries: Need exactly one file argument. Use `makeglossaries --help' for help.     Process exited with error(s)      Please help me solve this, I've looked everywhere and long but nothing can be found on this error. The glossary is not created in the pdf, but the first run does create the 1 page document correctly. The `.tex` is `minimalgls.tex` (provided by package):               \documentclass{article}     \listfiles          \usepackage[colorlinks]{hyperref}      \usepackage{glossaries} % acronym will go in main glossary      %\usepackage[acronym]{glossaries} % make a separate list of acronyms     \makeglossaries          \newglossaryentry{sample}{name={sample},     description={a sample entry}}          \newacronym[\glsshortpluralkey=cas,\glslongpluralkey=contrived     acronyms]{aca}{aca}{a contrived acronym}          \begin{document}     A \gls{sample} entry and \gls{aca}. Second use: \gls{aca}.          Plurals: \glspl{sample}. Reset acronym\glsreset{aca}.     First use: \glspl{aca}. Second use: \glspl{aca}.          \printglossaries     \end{document}


title: error "latexdiff: The Perl Script could not be found."

text: I have `MikTeX 2.9` installation and `Strawberry Perl 5.10.1.5.` All the `latexdiff`, `latexdiff-fast`, `latexidff-so` paths seem to be present in the `scripts.ini` file and their `.exe` files in the `miktex/bin/x64`. Somehow when I try to run `latexdiff` command in the directory where the two versions of `.tex` files are present, I get this error               latexdiff: The Perl script could not be found.          latexdiff: Data: scripts/latexdiff/perl/latexdiff.pl      When I run the command, a pop-up window asks for installation of `latexdiff.pl` and I press ok, but it ends up in the error shown above. I followed some posts with similar problem, but couldn't find a solution. Any help would be appreciated.


title: Perl Interpreter could not be found

text: I downloaded MikTeX and got TeXworks. I try to follow the manual and create an example document. But I get an error message in the "Console output" window: "Latexmk.exe: The Perl intetpreter could not be found." Is this Perl interpreter something that I have to download separately? I thought everything would be included in the package. I have Windows.


title: How to obtain the space left to bottom of page

text: Since it is impossible to use `\vfill` inside a `framebox`, is there any way of getting the current height position of text? I want to fill in a `framebox` so that it uses all the space left on a page, instead of trial and error...