title: mathtime mt11p mtpro2 into texlive

text: Dear TeXperts: someone sent me some latex files that require mtgub fonts. (Previous Fixing Attempts: I had hoped that by switching to the ubuntu 13.10 texlive distribution with texlive-extra-fonts (in contrast to my earlier use of a direct install), the fonts would magically appear. alas, they did not.) mtgub seems to be a mathtime font in ctan package mt11p, http://www.ctan.org/tex-archive/fonts/mt11p . mt11p on ctan maximizes confusion by referring to being a package that uses mathtime fonts as distributed by Y&Y, but that have no connection with the mathtime package commissioned by Y&Y. not kidding. eventually, the mt11p package also refers to PCTeX's MathTime Pro fonts. PCTeX has a "lite" free version (great!) as well as a pro version, but the installation instructions only for tetex, which has been out of date since 2006. nowadays, we have texlive. PCTeX has no font installation instructions for texlive. so, I need to find out (a) exactly what files I need (mtplite.zip from pctex?) and (b) how to install them. help?


title: Floating parameter [H] streches table vertically

text: I am currently using `[H]` as a floating parameter for a list of tables in the appendix. The idea is to make the tables in the appendix start at the same vertical distance from the top on every page (Vertical alignment of multiple consecutive tables). Now the problem is that `[H]` streches the table in that the **distance between the rows becomes larger**. Where does this come from? Instead I wanted to use `[H]` only to eliminate the floating behaviour but at the same time keep the formatting consistent. See the following example to illustrate the problem. You can swap `[H]` for `!h` and both tables will look exactly the same, as desired, but the vertical distance from the top is ruined.               \documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}     \usepackage[onehalfspacing]{setspace}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{booktabs}     \usepackage{float}               \begin{document}          \chapter{Tables}               \begin{table}[!h]     \centering     \caption{Table caption}      \label{magic numbers}     {\scriptsize     \begin{tabular}{l*{7}{c}}     \toprule      & \multicolumn{1}{c}{A} & \multicolumn{1}{c}{B} &      \multicolumn{1}{c}{C} & \multicolumn{1}{c}{D} & \multicolumn{1}{c}{E} & \multicolumn{1}{c}{F} & \multicolumn{1}{c}{G}  \\     A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\         \end{tabular}     }     \end{table}          \vspace*{18pt}     \begin{table}[H]     \centering     \caption{Table caption}      \label{magic numbers}     {\scriptsize     \begin{tabular}{l*{7}{c}}     \toprule      & \multicolumn{1}{c}{A} & \multicolumn{1}{c}{B} &      \multicolumn{1}{c}{C} & \multicolumn{1}{c}{D} & \multicolumn{1}{c}{E} & \multicolumn{1}{c}{F} & \multicolumn{1}{c}{G}  \\     A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      A & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      B & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      C & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\      D & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\     E & 54.42 & 54.42 & 54.42 & 54.42 & 54.42& 54.42& 54.42\\       \end{tabular}     }     \end{table}               \end{document}      So in the end the aim is to align multiple tables (in the appendix) consistently, ie starting at the same point from the top. Maybe there is a way to achieve this manually? I could do this by hand for the respective tables, the solution really does not have to be automized. Also I only want to achieve this behaviour in the appendix, but not in the main document, as the floating is working fine there. Thanks.


title: Copy Czech characters from PDF with charter font

text: I wanna be able to copy czech characters from PDF, but for some reason it doesn´t work. here is my code:               \usepackage{cmap}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{charter}      and if I write for example **říjen** (october :), the text is fine in PDF, but when I try to copy it somewhere, I get **ˇríjen**. (It´s the same for all characters with ˇ). if I change `\usepackage{charter}` to `\usepackage{tgtermes}`, the character ř is fine. But I would like to use charter font because it simply looks better, but I need to be able to copy czech characters. How can I achieve copying czech characters with charter?


title: \emptyset doesn't work with LuaTex + glossaries + unicode-math (bug?)

text: The following code doesn't work with LuaTex (I get an "undefined control sequence" error). It works if I either comment out \usepackage{unicode-math} or if I change the glossary name from $\emptyset$ to something else. Is this a bug? How can I fix this because I need all packages.               % !TEX TS-program = lualatex     \documentclass{article}     \usepackage{unicode-math}          \usepackage{glossaries}     \newglossaryentry{symb}{name={$\emptyset$}, description={description}}          \begin{document}     $\emptyset$, \gls{symb}     \end{document}


title: \ifnumcomp + \ref

text: I have a definition with 20 cases or so, and a proof about that definition has one case for each case of the definition. I'd like the proof cases to reorder themselves automatically when I reorder cases in the definition. I'm trying to use this answer about sorting to sort the proof cases by the label they reference, but running into some trouble. A minimal example of what goes wrong is:               \documentclass{article}     \usepackage{etoolbox}     \begin{document}     \newcounter{foo}     \refstepcounter{foo}\label{a}     \refstepcounter{foo}\label{b}     \ifnumcomp\ref{a}<\ref{b}{A}{B}     \end{document}      which produces rather a lot of errors:               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)      restricted \write18 enabled.     entering extended mode     (./test.tex     LaTeX2e <2011/06/27>     Babel <3.9f> and hyphenation patterns for 2 languages loaded.     (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))     (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty     (/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)) (./test.aux)     ! Missing \endcsname inserted.     <to be read again>                         \relax      l.7 \ifnumcomp\ref{a}<                           \ref{b}{A}{B}     ! Missing number, treated as zero.     <to be read again>                         \protect      l.7 \ifnumcomp\ref{a}<                           \ref{b}{A}{B}     ! Missing = inserted for \ifnum.     <to be read again>                         \gdef      l.7 \ifnumcomp\ref{a}<                           \ref{b}{A}{B}     ! Missing number, treated as zero.     <to be read again>                         \gdef      l.7 \ifnumcomp\ref{a}<                           \ref{b}{A}{B}          LaTeX Warning: Reference `\endcsname ' on page 1 undefined on input line 7.          ! You can't use `\numexpr' in horizontal mode.     \ifnumcomp ...\ifnum \numexpr #1\relax #2\numexpr                                                        #3\relax \expandafter \@fi...     l.7 \ifnumcomp\ref{a}<                           \ref{b}{A}{B}          LaTeX Warning: Reference `A' on page 1 undefined on input line 7.          [1{/usr/share/texlive/texmf-dist/fonts/map/pdftex/updmap/pdftex.map}]     (./test.aux)          LaTeX Warning: There were undefined references.           )     (see the transcript file for additional information)</usr/share/texlive/texmf-d     ist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/share/texlive/texmf-dist/fo     nts/type1/public/amsfonts/cm/cmr10.pfb>     Output written on test.pdf (1 page, 19390 bytes).     Transcript written on test.log.      In an attempt to wave a dead chicken over it, I also tried these incantations for the comparison:               \ifnumcomp{\ref{a}}<{\ref{b}}{A}{B}     \ifnumcomp\protect\ref{a}<\protect\ref{b}{A}{B}     \ifnumcomp{\protect\ref{a}}<{\protect\ref{b}}{A}{B}      Each of these produce their own long errors. Is there a way to compare references suitable for use in the sorting mechanism suggested above?


title: Abbreviate only middle names in biblatex

text: I know of the option `firstinits=true` to abbreviate the first and all middle names in biblatex. What I would like to achieve is to only abbreviate the middle names. So e.g. `author = {Smith, John Ethan Jacob}` should be printed as `Smith, John E. J.` Please see the MWE based on the answer of Jonathan from this post at the end of this question. I get the following output: > [SD95] Smith, John E. J./Doe, Jain L. Some book title. A Publisher, 1995. But what I would like to see as output is: > [SD95] Smith, John E. J. ; Doe, Jain L: Some book title. A Publisher, 1995. The `;` between the author names and the `:` between the author names and the book title are specific to the bib style (custom made) I use. But the solution below doesn't respect this custom style. Any idea how to achieve the desired abbreviation, but don't loose the bib style? MWE:               \documentclass{article}     \usepackage[backend=biber,style=din, autocite=footnote]{biblatex}          \begin{filecontents*}{bibliography.bib}     @BOOK{SD1995,       author = {Smith, John Ethan Jacob and Doe, Jain Lauren},       title = {Some book title},       year = {1995},       publisher = {A Publisher}     }     \end{filecontents*}          \addbibresource{bibliography.bib}          \usepackage[T1]{fontenc}          \def\bibnamedelima{ }%     \def\bibnamedelimb{ }%     \DeclareNameFormat{author}{%       \ifblank{#5}{}{#5\addspace}% prefix if applicable       #1% last name       \edef\firstname{#3}%       \ifblank{#3}{}{\addcomma\addspace\expandafter\first{\firstname}}%       \ifthenelse{\value{listcount}<\value{liststop}}%        {\addslash}{}%     }          \DeclareNameFormat{labelname}{%       \ifblank{#5}{}{#5\addspace}% prefix if applicable       #1% last name       \edef\firstname{#3}%       \ifblank{#3}{}{\addcomma\addspace\expandafter\first{\firstname}}%       \ifthenelse{\value{listcount}<\value{liststop}}%        {\addslash}{}%     }          \makeatletter     \def\@empty{}     \def\first#1{\expandafter\@first#1 \@nil}     \def\@first#1 #2\@nil{#1\addspace%       \if\relax\detokenize{#2}\relax\else\@initials#2\@nil\fi}     \def\initials#1{\expandafter\@initials#1 \@nil}     \def\@initials#1 #2\@nil{%       \initial{#1}%       \def\NextName{#2}%       \ifx\@empty\NextName\relax%       \else\@initials#2\@nil\fi}     \def\initial#1{\expandafter\@initial#1\@nil}     \def\@initial#1#2\@nil{#1.\addspace}     \makeatother                    \begin{document}     \null     \vfill          How the citation look like: \cite{SD1995}          \clearpage     \printbibliography     \end{document}      **Edit** Please look here for the din style I'm using in the MWE. With this style I get two white spaces between the first author and the separating `;`, when I use the modification by Andrew Swann. Without the modification there is only one white space. I'm now looking for a solution to this problem.


title: LaTeX Centering newline in subfloat caption

text: I have these images with their title beneath: ![enter image description here](http://i.stack.imgur.com/1KUi8.png) I want to add some information below, like this: ![desc](http://i.stack.imgur.com/tbIQ0.png) The good news is, I'm able to do it. The last screenshot is from my pdf previewer.               \subfloat[Highway\\1700 frames\\800x600]{\includegraphics{highway.jpg}}     or     \subfloat[\shortstack{Office\\2050 frames\\800x600}]{\includegraphics{office.jpg}}      The simple slash `\\\` solution stop working (shift to the left) when there's too much text. The `\shortstack` solution always work, but there's not a lot of space between the lines. The problem is, even when they work, both give me the following errors :               There were errors in your LaTeX source     test.tex:22: Argument of \sf@@@subfloat has an extra }. [...e=0.9]{highway.jpg}}]     test.tex:22: Paragraph ended before \sf@@@subfloat was complete. [...e=0.9]{highway.jpg}}]      Is there any way to do what I want? Here's a working minimal exemple :               \documentclass[letterpaper, 12pt]{book}     \usepackage{color,graphicx}     \usepackage{subfig}     \captionsetup[subfigure]{labelformat=empty}          \begin{document}     \begin{figure}[!ht] \centering         \subfloat[Highway]{\includegraphics[scale=0.9]{highway.jpg}} ~         \subfloat[Office]{\includegraphics[scale=0.9]{office.jpg}} ~         \subfloat[Pedestrians]{\includegraphics[scale=0.9]{pedestrians.jpg}} ~              \caption{Some caption}     \end{figure}     \end{document}


title: Error using \limits

text: My minimal TeX file                   \documentclass{article}         \usepackage{amsmath}         \begin{document}               \begin{align}\label{eq:time_marginal_condition}             x \left\| x \right\|\limits_{L^{2}(\mathbb{R})}^{2}          \end{align}          \end{document}      I get the warnings               ./test.tex:8: Limit controls must follow a math operator.     <argument> ...tion} x \left \| x \right \|\limits                                                        _{L^{2}(\mathbb {R})}^{2}      l.8          \end{align}          ./test.tex:8: Undefined control sequence.     <argument> ... x \right \|\limits _{L^{2}(\mathbb                                                        {R})}^{2}      l.8          \end{align}          ./test.tex:8: Limit controls must follow a math operator.     <argument> ...tion} x \left \| x \right \|\limits                                                        _{L^{2}(\mathbb {R})}^{2}      l.8          \end{align}          ./test.tex:8: Undefined control sequence.     <argument> ... x \right \|\limits _{L^{2}(\mathbb                                                        {R})}^{2}      l.8          \end{align}      **How can you get rid of such warnings in the _align_ environment?** My unsuccessful attempt               \begin{align}\label{eq:time_marginal_condition}                 x \left\| x \right\|                 \limits_{L^{2}( \texorpdfstring{\mathbb{R}}{} )}^{2}     \end{align}


title: Problem using a tikzpicture in \titleformat

text: I'm trying to customize the style of my chapter headings with `tikz`. Unfortunately, I can't figure out how to properly use `tikz` in the (optional) `⟨after⟩` argument of the the `\titleformat` command. With the minimal example below, my compiler seems to get lost in an endless loop; the `⟨after⟩` argument has to be the culprit because, if I remove it, I don't run into any trouble. Any idea of what's going wrong?               \documentclass[12pt]{scrbook}          \usepackage{tikz}     \usepackage{titlesec}     \usepackage{titletoc}          \titleformat{\chapter}     [hang]     {\huge}     {}     {0em}     {}     [\large \begin{tikzpicture} \draw [ultra thick] (0,0) -- (0,1);\end{tikzpicture}]     % the previous line does not work when [ultra thick] is included          \begin{document}          \chapter{Introduction}          Some text          \end{document}


title: classicthesis and scrheadings

text: When using `classicthesis` I feel that the `spacedlowsmallcaps` (provided by `classicthesis`) take too much control over my typography. I've been able to tweak the section titles to have a capital letter in the beginning. However, I don't seem to be able to get the text in the header to be anything but small caps. Is it possible to customize this? Any help on this would be highly appreciated! Here is what I am working on - and I use LuaLaTeX:               \documentclass[twoside,openright,titlepage,numbers=noenddot,headinclude,                 % headlines,% letterpaper,% a4paper                 footinclude=true,cleardoublepage=empty,                 BCOR=5mm,paper=a4,fontsize=10pt]{scrbook}     \usepackage{lipsum}     \usepackage{amsmath,amssymb}     \usepackage[math]{fontspec}     \newfontlanguage{Norwegian}{NOR}     \defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle}          \usepackage{subfig}     \usepackage{titlesec}     \usepackage[parts,beramono,eulerchapternumbers,%             listings,subfig,manychapters,%             floatperchapter]{classicthesis}           \begin{document}     \titleformat{\section}{\relax}{\textsc{\thesection}}{1em}{}     \pagestyle{scrheadings}     \chapter{First chapter}     \section{First section}     \lipsum[1-6]     \newpage     \lipsum[1]     \end{document}


title: changing chapter name in fncychap

text: I am using the package `fncychap` (here) with scrbook and Sonny. Now I want to change the name of the word 'chapter' to a date which I can type by hand when I am creating a new chapter. I've experimented around with `\ChNameVar{}` but didn't get it. So how can you create this?


title: GraphViz and LaTeX; gives blank PDF

text: I've tried 4 different `.sty` files (most of which didn't work, some of which gave me errors on rendered page). Now trying with the dot2texi package, which is giving me a blank PDF. I have tried running `initexmf --edit-config-file=pdftex.ini` then adding: `EnableWrite18=t` to opened file, and I've tried adding `-shell-escape` to the run command: ![TeXWorks config](http://i.stack.imgur.com/qQ2F3.png) Yet nothing has worked. **How can I write and successfully compile inline GraphViz diagrams in LaTeX?**


title: Inserting day of the week into custom datetime format

text: I'm using a custom datetime format and a custom environment to generate a list of dates (for a course syllabus), and would like to modify it a bit more to add the abbreviated day name after the numerical date. Here's what I have:               \documentclass{article}     \usepackage{advdate}     \usepackage[dayofweek]{datetime}% http://ctan.org/pkg/{advdate,datetime}     \newdateformat{syldate}{\THEMONTH/\THEDAY ()}     \newenvironment{schedule}       {\par\syldate\renewcommand{\item}{\par%         \stepcounter{mycntr}\ifnum\value{mycntr}>2\relax%           \setcounter{mycntr}{0}\AdvanceDate[3]%         \else           \AdvanceDate[2]%         \fi\today\quad}       }{\par}     \SetDate[02/09/2013]     \newcounter{mycntr}     \begin{document}     \begin{schedule}       \item Something       \item Something else       \item Relax       \item Go to the sea       \item Something       \item Something else       \item Relax       \item Go to the sea          \end{schedule}     \end{document}      Which yields the following: ![enter image description here](http://i.stack.imgur.com/iXNmq.jpg) I would like to add the abbreviated day name of the corresponding date in those empty parentheses. So the final would look something like this: > 9/4 (W) Something > > 9/6 (F) Something > > 9/9 (M) Something Any pointers? Can't figure out how to do it just from the `datetime` package documentation, I found the `dayofweek` package option but that seems to only modify `\today`.


title: The gap between two double-spaced footnotes is too large. How can I fix

text: I have to have footnotes double-spaced, but if I use `\begin{doublespace}` and `\end{doublespace}` within footnotes, then the gap between two footnotes becomes too wide. Could anybody fix it?               \documentclass[12pt,letterpaper,leqno]{article}     \usepackage{setspace}     \newcommand{\note}[1]{\footnote{\begin{doublespace}#1\end{doublespace}}}     \begin{document}     abcde\note{This is the first footnote.}     ABEDE\note{This is the second footnote.}     \end{document}


title: Equation numbers in loop

text: I am using the loop command to make an exam file with unique numbers, i.e., the whole exam text is repated and only the first page of the exam looks different. I am using equation numbers in the text and the labels are multiple defined because of the loop, so they are all linking to the last one and the numbers is very big in the last exams. Do you have any idea how to overcome this problem? Thanks a lot! edit: Here is an example: http://blubb-bla.de/pk_test_tex.pdf edit2: Here is the code: `\documentclass[a4paper,oneside,11pt,DIV=14]{scrartcl}   \setcounter{numsoll}{25}   \begin{document}   \loop   You are number \arabic{numakt}.   \begin{align} a = b \label{eq} \end{align}   Reference \eqref{eq}.   \pagebreak      \ifnum\value{numakt}<\value{numsoll}   \stepcounter{numakt}   \repeat   \end{document}`


title: pgfkeys overeager in stripping away my braces

text: This is an extremely minimal example of what I'm trying to do.               \documentclass{article}     \usepackage{pgfkeys}     \pgfkeys       {         /ae/example/set/parameters/.cd,         keya/.code = { \def\mykeya{#1} },         keyb/.code = { \def\mykeyb{#1} },         /ae/example/use/parameters/.cd,         keya/.code = { \mykeya },         keyb/.code = { \mykeyb },       }     \newcommand{\setkeys}[1]{\pgfkeys{ /ae/example/set/parameters/.cd, #1}}     \newcommand{\usekeys}[1]{\pgfkeys{ /ae/example/use/parameters/.cd, #1}}     \pagestyle{empty}     \begin{document}          \setkeys{keya={{\bfseries hello}},keyb={world!}}          \usekeys{keya,keyb}      This following text should not be \textbf{bold.}          \end{document}      The general idea is that I have _setter_ and _getter_ keys defined. Generally, the _macro_ call is more complicated than just assigning a value to a command name. But the above example illustrates the problem I've run into. My inner braces are getting completely stripped out. I don't want to assume that key values are to define subgroups. That is, I don't necessarily want to define the key as               /ae/example/set/parameters/.cd,     keya/.code = { \def\mykeya{{#1}} },      I would like the user to be able to specify the grouping by using inner braces like I have in the MWE:               \setkeys{keya={{\bfseries hello}}      I know for the above example I could write               \setkeys{keya={\textbf{hello}}      and everything would be fine. But such an approach won't work for other commands like `\footnotesize` and other kindred commands. Also, I know I could wrap things up in boxes               \setkeys{keya=\mbox{\bfseries hello}}}      But this prevents the innards of the box from seeing mark-up that's being called from the outside. Any ideas on how to get `pgfkeys` to be a bit less greedy in how it strips away braces? **UPDATE** I've considered doing something like:                \setkeys{keya="\bfseries hello"}      and use some preprocessor to convert the `"` to the appropriate braces. I also considered defining a _variant_ key like                 /ae/example/set/parameters/.cd,       keya*/.code = { \def\mykeya{{#1}} },      But I'm wondering whether someone else has a better approach.


title: Multiple alignments in align environment

text: My MWE:               \documentclass{report}     \usepackage{amsmath}          \begin{document}          \begin{align}     &u = \frac{1}{\theta_{2,3}} \left [ -z_1 - \left ( c_2 + \frac{\epsilon}{2} \right )z_2 - \theta_{2,1}\sin(x_1) - \hat{\theta}_{2,2}x_2 + \dot{\alpha}_1 \right ] \\      &\dot{\xi}_{2,2} = - \frac{\partial \beta_2}{\partial x_2}\left [ \theta_{2,1}\sin(x_1)+\left ( \xi_{2,2}  + \beta_2(x_2) \right ) x_2 + \theta_{2,3}u \right ]  \\     &\hat{\theta}_{2,2} = \xi_{2,2} + \beta_2(x_2) \\     &\beta_2 =  \frac{\gamma}{2}x_2^2      \end{align}          \end{document}      The result: ![enter image description here](http://i.stack.imgur.com/uHLXL.png) What I want: ![enter image description here](http://i.stack.imgur.com/yuFCH.png) That is, next to the left alignment, I want to align the equal signs of equations (2) to (4).


title: Decimal separator in \psaxes of pstricks-add

text: When I use the comma option of the command \psaxes, only the y-coordinates are displayed with a comma while the x-coordinates are still displayed with a dot. My figure is included in a somewhat big file. When I extract it and put it alone in a blank tex file, the problem disappears. Do you have any idea where the problem could come from? Here is my code:               \begin{figure}[h]     \begin{center}         \psset{yunit=12cm,xunit=7.8cm}         \begin{pspicture}(0,-0.042)(1.1,0.45)             \readdata{\TauxRATHRRelatif}{Donnees/Chapitre1/Taux_RAT_HR_Relatif_1990_2007.txt}             \psaxes[comma,Dx=0.1,Dy=0.05,tickstyle=bottom]{->}(0,0)(1.1,0.45)[Âge relatif,0][Taux d'évènements en \%,0]             \psframe(0.7,0.35)(1.0,0.42)             \psline[linecolor=blue](0.72,0.40)(0.8,0.40)             \psline[linecolor=red](0.72,0.37)(0.8,0.37)             \rput[l](0.82,0.4){\footnotesize Taux brut}             \rput[l](0.82,0.37){\footnotesize Taux lissé}             \listplot[linecolor=blue,plotNo=1,plotNoMax=2]{\TauxRATHRRelatif}             \listplot[linecolor=red,plotNo=2,plotNoMax=2]{\TauxRATHRRelatif}         \end{pspicture}     \caption{Taux de RAT en âge relatif (générations 1990-2007)}     \end{center}     \end{figure}      The first lines of the Taux_RAT_HR_Relatif_1990_2007.txt file are:               0.01    0.08950938  0.051705574     0.02    0.072002824 0.069167033      Thank you very much for your help. Regards, Olivier [EDIT]: My mistake: I forgot to delete these lines at the beginning of every figure of my document:               \makeatletter     \def\pst@@@hlabel#1{#1}     \makeatother      I'm truly sorry for the waste of your time and for the double answer. But I'm still interested in knowing how to make the comma option work after having customized the x-coordinates labels like this:               \newarray\ListeMois     \readarray{ListeMois}{Janvier&Février&Mars&Avril&Mai&Juin&Juillet&Août&Septembre&Octobre&Novembre&Décembre}     \makeatletter     \def\pst@@@hlabel#1{\rput[rb]{30}{\scriptsize\ListeMois(#1)}}     \makeatother


title: Fill a grid with TikZ

text: How do I fill a grid in TikZ? I want to do something like:               \draw[draw,fill=red!20] (0,0) grid (2,2);      instead of manually drawing 4 rectangles.


title: How to define variants in build system for Latex in Sublime Text 3

text: After the new LatexTools plugin was released, I am unable to get the follwoing functionality which I had in the previous LatexTools plugin. I tend to use the sequence latex-dvipdfm the most(Build: `Ctrl`+`B`), but I also needed pdflatex (Run: `Ctrl`+`Shift`+`B` and xelatex (Xelatex in build menu). The following bit of code in the Latex.sublime-build file used to accomplish that.               "cmd": ["latexmk",             "-e","\\$dvipdf = 'dvipdfmx %O -o %D %S'", "-e", "\\$latex = 'latex %O -interaction=nonstopmode -synctex=1 %S'",             "-f", "-pdfdvi"],                       "variants":             [                      { "cmd": ["latexmk",                 "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",                 "-f", "-pdf"],                 "name": "Run"                 },                           { "cmd": ["latexmk",                 "-e", "\\$pdflatex = 'xelatex %O -interaction=nonstopmode -synctex=1 %S'",                 "-f", "-pdf"],                 "name": "xelatex"                 },                  ]      I am unable tweak the Latextools.sublime-settings file and get this to work under the new LatexTools plugin. Could anyone suggest a way to tweak the build system to achieve this ? Thanks. **EDIT** : I had posed the question to the creator of the LatexTools plugin and he was kind enough to reply. I am posting his reply as an answer.


title: Mathematical description of TeX's infinite numbers?

text: TeX has things like infinitely stretchable spaces and infinitely bad penalties. Since Knuth is Knuth, I assume these are a carefully thought-out implementation of some well defined non-Archimedean number system, and that that he had good reasons for picking that particular number system over some other system (e.g. some richer or weaker system). What number system is it? Does it have a hierarchy of infinities? Does it have invertible infinities, like in the Levi-Civita field?


title: Creating a "Last Name, First Name" entry in the index for OPmac

text: I'm trying to create an index entry that looks like: `Knuth, Donald E. 4` Where `Donald` is the first name of a person and `Knuth` is his last and `E.` his middle initial. From what I can tell, the comma character is used as part of the syntax of index entries and thus is not directly available for the text of an index entry. There is a special support macro, `\iis` whose intent is to assist in sorting when unusual characters are part of the text. Using that macro I came up with the following: `The computer scientist \iis DonEKnuth {Knuth, Donald E.} \ii DonEKnuth Donald E. Knuth is well known for ...` That is an obviously cumbersome way to deal with the issue and I thought that perhaps there is a better way (within OPmac)? p.s. `eplain` (which uses `makeindex`) has the macros `\sidxname{Donald E.}{Knuth}[subterm] and \idxname{Donald E.}{Knuth}[subterm]` for this purpose. Although it isn't strictly required since one could simply use `\sidx{Knuth, Donald E.}`, etc.` directly.


title: Two column Algorithmicx with variable-width columns

text: In another post, @Jubobs suggested to use the `multicol` package around an `algorithmic` environment, to typeset the algorithm in two columns. Recently, I faced a rather aesthetic issue: It might be the case that one column has a long line, while all lines in the other column are short. Example: ![An algorithm with a long line](http://i.stack.imgur.com/yYCg1.png) Here's the code for the above picture:               \documentclass[twocolumn]{article}     \usepackage[width=11cm]{geometry}   % page width is reduced to show the effect     \usepackage{multicol}     \usepackage{algorithm}     \usepackage{algpseudocode}          \begin{document}     \begin{algorithm*}[t]         \caption{An algorithm with a long line.}         \label{alg1}         \begin{multicols}{2}             \begin{algorithmic}[1]                 \If{$(x = y^2+1$ and $z=x^3+4y -12)$ }                     \State $a \gets b + c$                 \EndIf                      \columnbreak                      \State $x \gets 0$             \end{algorithmic}         \end{multicols}     \end{algorithm*}          \end{document}       Is it possible to typeset an `Algorithmicx` environment in two columns, but with unequal widths? I tried the `vwcol` package as suggested in this post, but I wasn't able to make it work for my case.


title: Defining a function in pseudocode

text: I am trying to define a function in LaTeX pseudocode, as shown below.               \begin{algorithm}     \begin{algorithmic}[1]     \Function{Increment}{$a$}     .....     \EndFunction     \end{algorithmic}     \end{algorithm}      However, when I compile, I get the error, `undefined control sequence \Function{Increment}{$a$}.` What mistake am I doing here and how can I solve it?


title: Styling my section/chapter

text: I'm trying to reproduce this chapter/section style on LaTeX and I would like some insight on how to achieve this. I have been using the `secsty` package but I haven't come up with any real results. The idea is for this to represent a chapter in my document but I suppose there's no problem in calling this a section and my original sections subsections.![enter image description here](http://i.stack.imgur.com/J8qTB.jpg) Thanks,


title: Uppercase pagenumbering (roman) using \frontmatter

text: I am using `\frontmatter`, `\mainmatter` and `\backmatter` so my pagenumbering is correct. However, i would like my roman pagenumbering in `\frontmatter` to be uppercase. Is there any easy way to do so? ps: i am using a adapted `memoir` as class.


title: Nesting of case-selecting functions

text: Can case-selecting functions like `\prg_case_int` or `\prg_case_str` be nested? If so I will provide some examples of very weird results I observe with nesting. REVISION: I messed up the syntax suggested in the `interface3` document by omitting some of the `<code case>` strings. The revised code of my experiment now works and looks like this:               %document name: LaTeX3_interface3.tex     %RN 15/3/2012     %   OBJECTIVE: Nesting case-selecting functions prg_case_str or prg_case_int.     %   REFERENCE: The LaTeX3 Intefaces, 8 Feb 2012 (interface3.pdf), page 38ff.     %   COMMENTS:      %   (1) on the first attempt failed to define all of the <code case> strings and the whole      %   thing turned pear shaped     %   (2) the printed messages in the result are not properly formatted but that's due      %   to my inexperience in LaTeX2 and needs to be addressed seperately.     %=====================================================================================          \documentclass{article}     %\usepackage{expl3}     \usepackage{amsmath,xparse}      \ExplSyntaxOn      \NewDocumentCommand{\myCommand}{ m m m }      {         \prg_case_str:nnn { #1 }     {         {1a}          {             \prg_case_str:nnn { #2 }             {                 {2A} %{case 1a:2A\\}                 {                     \prg_case_str:nnn { #3 }                     {                         {3\alpha}   {case 1a:2A:3\alpha\\}                         {3\beta}    {case 1a:2A:3\beta\\}                         {3\gamma}   {case 1a:2A:3\gamma\\}                                       }                         {None of 1a:2A: 3\alpha, 3\beta, 3\gamma \\}                 }                 {2B} %{case 1a:2B\\}                 {                     \prg_case_str:nnn { #3 }                     {                         {3\alpha}   {case 1a:2B:3\alpha\\}                         {3\beta}    {case 1a:2B:3\beta\\}                         {3\gamma}   {case 1a:2B:3\gamma\\}                                       }                         {None of 1a:2B: 3\alpha, 3\beta, or 3\gamma\\}                 }                 {2C} %{case 1a:2C\\}                 {                     \prg_case_str:nnn { #3 }                     {                         {3\alpha}   {case 1a:2C:3\alpha\\}                         {3\beta}    {case 1a:2C:3\beta\\}                         {3\gamma}   {case 1a:2C:3\gamma\\}                                       }                         {None of 1a:2C: 3\alpha, 3\beta, 3\gamma\\}                 }             }                  {None of 1a: 2A, 2B, 2C\\}         }         {1b}          {             \prg_case_str:nnn { #2 }             {                 {2A}    {case 1b:2A\\}                 {2B}    {case 1b:2B\\}                 {2C}    {case 1b:2C\\}             }                  {None of 1b: 2A, 2B, 2C\\}         }         {1c}          {             \prg_case_str:nnn { #2 }             {                 {2A}    {case 1c:2A\\}                 {2B}    {case 1c:2B\\}                 {2C}    {case 1c:2C\\}             }                  {None of 1c: 2A, 2B, 2C\\}         }     }         {None of 1a, 1b, 1c\\}     }     %etc. etc.     \ExplSyntaxOff           \begin{document}          $\myCommand{1a}{2A}{3\alpha}$     $\myCommand{1a}{2B}{3\beta}$     $\myCommand{1a}{2C}{3\gamma}$     $\myCommand{1b}{2A}{3gamma}$     $\myCommand{1b}{2B}{3gamma}$     $\myCommand{1b}{2C}{3gamma}$     $\myCommand{x}{2A}{3gamma}$     $\myCommand{1a}{y}{3gamma}$     $\myCommand{1a}{2C}{3gamma}$     $\myCommand{1b}{2A}{3gamma}$     $\myCommand{z}{2B}{3gamma}$     $\myCommand{1b}{2C}{3gamma}$          \end{document}      If I knew how to import the resulting .pdf document I would. My apologies for starting a wild goose chase. My only excuse is that the LaTeX syntax is quite tricky to get right in the absence of automated editing facilities that would as a minimum generate correct indentations. Perhaps such LaTeX3 editing facilities are already available, if they are I would love to hear about them.


title: Conflict between luatex-ja and fontspec

text: I am using LuaLaTeX to write my thesis, because LuaLaTeX has better compatibility. However, now I found that there seems to be conflict between the package `luatex-ja` (which provides neccessary CJK support) and the package `fontspec`. I think maybe it could be worked around, but I don't know how. Here is a mini example.               \documentclass{article}     \usepackage{luatexja-fontspec}     \setmainjfont{HanaMinA}     \newfontfamily\diacritics{FreeIdgSerif}     \newcommand\dc[1]{{\diacritics #1}}     \begin{document}     The diacritic symbol \dc{ḱe^^^^e548^^^^e535}  included in FreeIdgSerif has not been printed.     \end{document}      Compiling it, the following result will be printed out:![two symbols are not printed out](http://i.stack.imgur.com/Na9Cd.png) However, if I change to xelatex and use the package `xeCJK`:               \documentclass{article}     \usepackage{xeCJK}     %\usepackage{luatexja-fontspec}     %\setmainjfont{HanaMinA}     \newfontfamily\diacritics{FreeIdgSerif}     \newcommand\dc[1]{{\diacritics #1}}     \begin{document}     The diacritic symbol \dc{ḱe^^^^e548^^^^e535}  included in FreeIdgSerif has not been printed.     \end{document}      The correct result will be printed out like this:![The desired result](http://i.stack.imgur.com/3rv9P.png) So, there seems to be conflict between `luatex-ja` and `fontspec`. My question: how can I get the same result like with XeLaTeX? Any idea?


title: Setting a wavy sidebar

text: Is there a way to have `framed.sty`'s `sidebar` environment to use a long wavy line, constructed, for example, using the `mathabx.sty`'s `\lfilet` variable- sized delimiter?


title: How do you get a lower or higher tilde/~?

text: I want to presents hours and say from hour x to hour y by using sample '~'. Please guide me how I can present the symbol "~"? * * * In contrast to How does one insert a backslash or a tilde (~) into LaTeX?, I'm particularly interested in controlling the vertical placement of the `~`.


title: Paper size with geometry in memoir: LaTeX vs PDFLaTeX

text: I have been searching for an answer to my problem, but my search did not yield any topics with the same problem, so hereby my question: I have created a document with the `memoir` package. The stocksize should be 25 x 18 cm, with trims at 0.5 cm from the borders. The paper will be cutted at 24 x 17 cm, the bleed is to avoid white borders around my full page pictures after cutting the paper. The code below works perfectly when I build with LaTeX to PS. And then convert the ps to pdf with Acrobat Distiller. However, when using this sequence, pictures are required to be in eps-format. However, I want to include jpegs or png's (photographs), so therefore I want to build it with `pdflatex`. However, when building the code below with `pdflatex` the page size is not correct: it is smaller (i.e., 6.69x9.45inch with `pdflatex` compared to 7.09x9.84inch with LaTeX). I have tried to exclude the packages I use to find out which is incompatible, but I did not manage to find out what is causing the problem. Does anyone have an idea? By the way: at first I just converted my jpg's to eps and builded the pdf with LaTeX. However, the image quality was terrible so therefore, I would like to use `pdflatex`.                   \documentclass[10pt,showtrims,openright]{memoir}         \usepackage{eso-pic}% For prechapterpics that have to bleed over the trims         \usepackage{graphicx}          \usepackage{geometry}          \usepackage[dutch,british]{babel}          \usepackage{booktabs}          \usepackage{eurosym}          \usepackage{lscape}          \usepackage[authoryear]{natbib}           \usepackage{threeparttable}            \usepackage{multirow}                \setstocksize{25cm}{18cm}          \settrims{0.5cm}{0.5cm}         \geometry{paperwidth=17cm, paperheight=24cm}         \setlrmarginsandblock{3cm}{2cm}{*}%%%%          \setulmarginsandblock{2.5cm}{3cm}{*}         \checkandfixthelayout              %%%%%%%%%%%%%%%% Newcommand to put the chapterimage in before each chapter         \newcommand\chapimage[1]{%         \cleartoverso          \noindent%         \AddToShipoutPictureBG*{% Add picture to current page           \AtStockLowerLeft{% Add picture to lower-left corner of paper stock         \includegraphics[keepaspectratio=true, width=\stockwidth]{art/#1}}}%         \clearpage}%%end Newcommand               \title{Title thesis}         \author{Authorname}         \date{}              \begin{document}         \maketitle         \chapimage{testimage}           \chapter{Title of first chapter}         \end{document}


title: How can I write a matrix using the whole page width in a two-colum document?

text: How can I write a big matrix (or array) in the width of the page while using two columns for all paper? I know that for figures (`figure*`) can be used, is there any way to do it for arrays?


title: Classic thesis + Minionpro

text: How can i use `classicthesis` with `minion pro`? I have tried to put `minion pro` in the options of `classicthesis` but I get an error. I use Windows and TeXLive 2012. Is `minion pro` not in TeXLive as default?


title: Question about changing the position of the footnote rule

text: My question is after I redefine the length of footrule, the footrule doesn't change the position on even or odd page, it's always at the left side. Did I lost something or there's the other way to redefine it? sorry for updating late. ![footrule](http://i.stack.imgur.com/tzxKk.png)


title: Add rows to a pgftable

text: I need to add a custom row of data to a `\pgfplotstable` for drawing purposes. The commented line is the needed data. I can read and manipulate any element from table but I can't add any row. Any advice ?               \documentclass{article}          \usepackage{pgfplots}          \begin{document}          \pgfplotstableread{         s       f         0.0     75.9638         0.380665    206.565         0.58711     243.435         0.793555    333.435     %    1.0     Element(1,2) + 360.0 = 75.9638 + 360.0     }\data          \end{document}


title: newcommand to count words?

text: Environment that counts words inside does like the title says, but prints the words that it counts, too. Is there a way to count the words without printing them?               \countCommand{Four and twenty blackbirds} % should print: 4


title: Georgian in sharelatex

text: I need to create a book for a friend of mine and I thought that Latex would best fit for this job. Plus this will be a very good opportunity to learn this powerful tool. The problem is that the book is written in Georgians and I don't know the way to support them. I have created a small sample with a Georgian poem but after compilation its not showing the letters.               \documentclass{article}     \usepackage[utf8]{inputenc}          \title{Poem}         \date{February 2014}         \begin{document}          \maketitle          ვახტანგ მეფე  ტახტზე  იჯდა,     რომ  დაიპყრეს  ოსმალთ  ქართლი.     წელში  გაწყდა  გლეხ-კაცობა,     დაუწესეს  დიდი  ხარკი.               \end{document}      Can you provide me with some resources to start writing in Georgian?


title: How can I format the header without italics in reports without using fancyhdr?

text: I am writing a report. I set `\pagestyle{headings}` which looks well, but formats the chapter in italics instead of normalfont. How can I change this to normalfont or boldfont, without using `fancyhdr`? * * * Here is an example how it looks: _KAPITEL 5. INSTALLATION UND BENUTZUNG_ 26 And here is an example how it should look: **KAPITEL 5.** INSTALLATION UND BENUTZUNG 26


title: Redefine \newcommand to insert code at start and end of custom macros

text: I would like to be able to insert code into the definitions of my custom macros, without having to modify _each_ macro definition. This seemed like a simple case of redefining `\newcommand`, but this turns out not to be so easy (well for me anyway). I end up with: > Illegal parameter number in definition of \MacroB.   >  to be read again   >  1 l.45 \newcommand*{\MacroB}[1]{b#1b} My guess is that somewhere I need to double up the `#` but I don't understand why, and guessing which ones need to be doubled up did not work. So perhaps that is not the problem. ## Notes:   * The MWE below compiles fine -- one needs to uncomment the `\def\EnableTrace{}` to see the problem.   * The goal of this is to build up a stack trace of macros as they are being called. ## Code:               %\def\EnableTrace{}     \documentclass{article}          %% All packages included here...     \usepackage{xparse}     \usepackage{letltxmacro}               %% Start of custom macros...     \ifdefined\EnableTrace         \newcounter{NestingDepth}         \newcommand*{\StartMacro}[1]{%             \typeout{**** DEBUG: (Depth=\arabic{NestingDepth}) Started macro "\string#1".}%             \stepcounter{NestingDepth}%         }%         \newcommand*{\EndMacro}[1]{%             \addtocounter{NestingDepth}{-1}%             \typeout{**** DEBUG: (Depth=\arabic{NestingDepth}) Completed macro "\string#1".}%         }%         % --------------         \LetLtxMacro{\OldNewcommand}{\newcommand}%         \RenewDocumentCommand{\newcommand}{%             s%    #1 = * (ignored for now to keep the code below simple)             m%    #2 = macro name             O{1}% #3 = number of paramaters             o%    #4 = default value for first optional parameter (if there is one)             m%    #5 = code to execute         }{%             %             \ifnum#3=1\relax                 \OldNewcommand{#2}{\StartMacro{#2}#5\EndMacro{#2}}%             \else                 \IfBooleanTF{#4}{%                     % first parameter of macro being defined is optional, as default value is provided                     \OldNewcommand{#2}[#3][#4]{\StartMacro{#2}#5\EndMacro{#2}}%                 }{%                     % first parameter of macro being defined is mandatory                     \OldNewcommand{#2}[#3]{\StartMacro{#2}#5\EndMacro{#2}}%                 }%             \fi         }%     \fi          \newcommand*{\MacroB}[1]{b#1b}%     \newcommand*{\MacroA}[1]{a\MacroB{#1}a}%          \begin{document}     \MacroA{XXX}          \MacroB{YYY}     \end{document}


title: How to draw ligands with different hapticities

text: In organometallic chemistry it's common to draw ligands that are not bound atom to atom. Common examples are ferrocene: ![](http://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Ferrocene-2D.png/100px- Ferrocene-2D.png) or Zeisse's salt: ![](http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Zeise%27sSalt.png/200px- Zeise%27sSalt.png) Does anyone have a strategy for approaching structures such as these? For the alkene bond, one approach would be `\chemfig{M-([2,0.5]=)([6,0.5]=}` but this has the bond from the metal extending to the center of the double bond, rather than stop just before it. I'm looking more for a general approach than a solution to these particular compounds.


title: How to remove white space above and below Tikz figure

text: I used GMS package to write a maths book, and used Tikz code genrated by Geogebra to draw the image. The problem is there are too much white space above and below Tikz figure, as in the following picture: ![enter image description here](http://i.stack.imgur.com/RVx2N.png) Here is the minimal working example:               \documentclass{gsm-l}     \usepackage[papersize={160mm,240mm},inner=20mm, outer=15mm, vmargin=15mm]{geometry}     \geometry{includeheadfoot}     \usepackage{enumitem}     \setlist[itemize]{leftmargin=*}     \usepackage{graphicx}     \DeclareGraphicsExtensions{.pdf,.png,.jpg, .tif}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}     \usepackage[utf8]{vietnam}     \begin{document}     This is the document.               \begin{definition}      Đây là môi trường định nghĩa, và hình vẽ đi ngay sau nó.      This is the definition environment, and the Tikz figure follows it.      \end{definition}           \definecolor{cqcqcq}{rgb}{0.75,0.75,0.75}     \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm,scale=0.7]     \clip(-4.3,-10.66) rectangle (17.58,6.3);     \draw (-2.3,4.08)-- (-3.74,0.04);     \draw (-3.74,0.04)-- (0.9,0.02);     \draw (0.9,0.02)-- (-2.3,4.08);     \draw (4.88,4.04)-- (3.44,0);     \draw (3.44,0)-- (8.08,-0.02);     \draw (8.08,-0.02)-- (4.88,4.04);     \begin{scriptsize}     \fill [color=black] (-2.3,4.08) circle (0.5pt);     \draw[color=black] (-2.28,4.4) node {$A$};     \fill [color=black] (-3.74,0.04) circle (0.5pt);     \draw[color=black] (-3.78,-0.18) node {$B$};     \fill [color=black] (0.9,0.02) circle (0.5pt);     \draw[color=black] (1,-0.18) node {$C$};     \draw[color=black] (-1.44,1.52) node {h.1a};     \fill [color=black] (4.88,4.04) circle (0.5pt);     \draw[color=black] (4.9,4.36) node {$A$};     \fill [color=black] (3.44,0) circle (0.5pt);     \draw[color=black] (3.4,-0.22) node {$B$};     \fill [color=black] (8.08,-0.02) circle (0.5pt);     \draw[color=black] (8.14,-0.26) node {$C=D$};     \draw[color=black] (5.74,1.48) node {h.1b};     \end{scriptsize}     \end{tikzpicture}          The above picture is left align also.      The other question is : How can I center it?      Please help me.      \end{document}      So, how can I remove that white space? Please help me. Thanks.


title: Create a book cover with spine, rear page and flaps

text: I have just finished my thesis, and I want to ask if there is a way to create a front-title page with spine (I don't know if this is the right term for the area between front page and rear page)? I would also like to include a back page. Some preliminary ideas are shown bellow ![](http://i.imgur.com/Z1bJB.jpg) I found a package called `zwpagelayout` which allows somehow to create a spine and flaps as well. I tried to use it by               \documentclass[11pt]{book}     \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage[pdftex]{graphicx}     \usepackage{colortbl}     \usepackage{xcolor}     \usepackage[papersize={,293mm}, topmargin=2mm, botmargin, strictheight, leftmargin=0mm, flap=50mm, textwidth=209mm, spine=13mm, cropmarks, cropframe, croptitle=Πρότυπο Εξωφύλλου]{zwpagelayout}     \linespread{1}          \begin{document}      Εξώφυλλο     \end{document}      Using this code produces an error that `spine is not defined`... Any ideas? I edited the previous code and the result is ![](http://i.imgur.com/9GgEE.jpg) Now I have to find a way to "move" around pages... Any ideas will over- welcomed!!! I also used this               \documentclass[12pt,a4paper]{article}     \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage{pstricks}     \pagestyle{empty}          \makeatletter      \def\La{%       L\kern-.36em{%       \setbox0\hbox{T}%       \vbox to\ht0{%         \hbox{$\m@th$%           \csname S@\f@size\endcsname           \fontsize\sf@size\z@           \math@fontsfalse\selectfont A}%           \vss%         }%       }%     }     \def\AllTeX{(\La\kern-.075em)\kern-.075em\TeX}     \makeatother          \begin{document}     \begin{titlepage}     \psset{unit=1in,linewidth=2pt}%     \psline(-0.75,2)(-0.75,-\paperheight)%     \psline(-0.25,2)(-0.25,-\paperheight)%     \rput[lb]{90}(-0.3,-0.75\paperheight){\red\Huge\textbf{Study}}%     \rput[lb]{90}(-0.4,-0.1\paperheight){\red\Huge\textbf{MicroMEGAS}}%          \vspace*{3cm}     \centerline{\Huge \textbf{P}ost\textbf{S}cript \textbf{T}ricks}          \vspace{2cm}     \centerline{\Large Athanasios Stamatopoulos}     \end{titlepage}          \end{document}      but my compiler cannot recognise commands like the following               \psline(-0.75,2)(-0.75,-\paperheight)%      The output from this code is ![](http://i.imgur.com/gqRsn.jpg) As you see no spine is produced. Instead spine is inserted in frontpage... I have found a way to move around pads... The complete and correct code is               \documentclass[11pt]{book}     \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage[pdftex]{graphicx}     \usepackage{colortbl}     \usepackage{xcolor}     \usepackage[papersize={,293mm}, topmargin=2mm, botmargin, strictheight, leftmargin=0mm, flap=50mm, textwidth=209mm, spine=13mm, cropmarks, cropframe, croptitle=Πρότυπο Εξωφύλλου]{zwpagelayout}     \linespread{1}          \begin{document}      \hbox to \textwidth{%     \vbox to \textheight{\hsize \CropFlap \centering     Back flap\vfill}\hss     \vbox to \textheight{\hsize \UserWidth \centering     \begin{tikzpicture}\draw (0,0) --(5,5);\end{tikzpicture}\vfill \leavevmode     ISBN+EAN}\hss     \vbox to \textheight{\hsize \CropSpine \centering     \vfill     \begin{sideways}Name Title\end{sideways}\vfill}\hss     \vbox to \textheight{\hsize \UserWidth \centering     Front cover\vfill \LaTeX}\hss     \vbox to \textheight{\hsize \CropFlap \centering     Front flap\vfill}}     \end{document}


title: Passing environment to \luatexluaescapestring fails

text: Can anyone explain why the macro `\makequesone` below fails and/or suggest a fix? The verbatim option works (as in the MWE) but I would like the content of the argument to be able to contain relatively arbitrary text and mathematical content so I don't think the verbatim option is ideal. The basic point is to store a list of questions in a lua table, and then to generate exams by randomly selecting questions from the bank. Right now, I'm just getting the storage retrieval part working. The fourth argument will contain an exam question and I have the understanding that `\luatexluaescapestring` should be used to prevent bad things from happening. In the working code below, I used a `v` type argument, but using an `m` type argument and just storing the args in token lists and doing nothing with them generates no errors, so I have the feeling that the issue is with `\luatexluaescapestring` which doesn't seem to like a `\par` somewhere. A "fix" would allow me to pass the content of that 4th argument to lua relatively freely and to retrieve it with `\getquestion`. In either case, an explanation of what's going on would be nice :)               \documentclass{article}     \usepackage{xparse}     \usepackage{luacode}     \begin{luacode*}          cats = {}     function makequestion(c,id,pt,q)         -- if question category doesn't exist, then create a table for it         if not cats[c] then            cats[c] = {}         end         -- add new question with tag "id" to category "c" table.         -- question worth "pt" points, and has content "q"         -- some questions may have entries for the parts subtable         cats[c][id]={points = pt, ques = q, parts = {}}     end          function getquestion (c,id)         tex.sprint(cats[c][id].ques)     end          \end{luacode*}          % Adds a question of category #1 and question id #2 to the table.     % the question point value is #3 and the actual question is #4.     % in use, there will be a 5th field for question parts.     %      % #1 = category     % #2 = id     % #3 = points     % #4 = question          \NewDocumentCommand{\makequesone}{ m m m +m }         {             \directlua{makequestion("\luatexluaescapestring{#1}","\luatexluaescapestring{#2}","\luatexluaescapestring{#3}","\luatexluaescapestring{#4}")}         }          \NewDocumentCommand{\makequestwo}{ m m m v }         {             \directlua{makequestion("\luatexluaescapestring{#1}","\luatexluaescapestring{#2}","\luatexluaescapestring{#3}","\luatexluaescapestring{#4}")}         }          \NewDocumentCommand{\getquestion} { m m }         {             \directlua{getquestion("\luatexluaescapestring{#1}","\luatexluaescapestring{#2}")}         }          \begin{document}     hi     % fails     %\makequesone{factor}{id1}{1}{\begin{itemize}\item fish\end{itemize}}               % works     \makequestwo{factor}{id1}{1}!Here is my question \begin{itemize}\item fish\end{itemize}!          \getquestion{factor}{id1}          \end{document}


title: Why is tikz cycle behavior different as compared to restating starting point?

text: In a recent tutorial style answer for How to draw this diagram with TikZ?, I encountered some strange behavior with `tikz`. The code below is a slightly reduced version of the code from that answer. I attempted to reduce it even further, but that made the issue harder to see. Here is what I get if I end the line below in black with `\-- cycle`:               \draw (A1) -- (intersection-1) -- (A4) -- cycle;      ![enter image description here](http://i.stack.imgur.com/LfJmW.png) Notice how the black lines go past the points at A1 and A4. But, by not using `\-- cycle` and instead re-specifying the starting point as the ending point, I get better results for the A1:               \draw (A1) -- (intersection-1) -- (A4) -- (A1);      ![enter image description here](http://i.stack.imgur.com/aMcc6.png) A way to fix this is below, but why is the behavior different if using `\--cycle` or re-specifying the starting point as the end point? ## References:   * Based on How to fix TikZ corners in 3D, applying `line join=round` does fix this and yields the desired results: ![enter image description here](http://i.stack.imgur.com/p8mmc.png) ## Code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{intersections}          \begin{document}          \begin{tikzpicture}          % Define all the points:         \coordinate (A1) at (0,4);         \coordinate (A2) at (3,6);         \coordinate (A3) at (5,5);         \coordinate (A4) at (6,3);         \coordinate (A5) at (4.5,1.5);         \coordinate (An) at (0,0);          % Draw the lines         \draw [ultra thick, blue, solid ] (An) -- (A1) -- (A2) -- (A3) -- (A4) -- (A5);          % Label the nodes:         \foreach \Index/\Position in {1/left, 2/above, 3/above right, 4/right, 5/below right, n/left} {             \node [\Position] at (A\Index) {$A_{\Index}$};         }%              \draw [gray, ultra thick]                  [name path=A1A3] (A1) -- (A3)                 [name path=A2A4] (A2) -- (A4)                 [name path=A1A4] (A1) -- (A4);                   \fill [fill=red!20, draw=black, ultra thick, name intersections={of=A1A3 and A2A4}]             (A1) -- (intersection-1) -- (A4) -- cycle;% produces wacky vertices             %(A1) -- (intersection-1) -- (A4) -- (A1);% this fixes problem at (A)          %    % Following fix works     %    \fill [fill=red!20, draw=black, line join=round, ultra thick, name intersections={of=A1A3 and A2A4}]     %       (A1) -- (intersection-1) -- (A4) -- cycle;          \end{tikzpicture}     \end{document}


title: How to use \textwidth (or any variable) in a picture environment

text: I don't understand why this doesn't work. I am getting a compile error. Am I missing something?               \documentclass[12pt,a4paper]{article}     \begin{document}     \begin{picture}(0,0)             \linethickness{1.5pt}             \put(0,0){\line(1,0){\textwidth}}     \end{picture}     \end{document}      The error is in `\textwidth`. When I put a decimal value (like 137) in, the example compiles correctly. The reason that I want to use `\textwidth` is obvious, I want a line aligned with the text. Strangely enough, variable expansion does work in a TikZ environment.


title: Tikz Ellipse Formatting

text: I am having difficulty formatting an ellipse within a Tikz box. I am a little bit of a loss on how to describe the issue, so I will let the code speak for itself. I want it to look like this:               \documentclass[11pt, oneside]{article}       \usepackage{pgf,tikz}     \usetikzlibrary{shapes,snakes,backgrounds,arrows}        \begin{tikzpicture}[line width=1pt,line cap=round,line join=round,x=1.0cm,y=1.0cm]%     \tikzstyle{number}=[text=black,font=\Large]%     \tikzstyle{largedigit}=[draw=blue,ellipse,minimum height=20pt,minimum width=50pt]%     \clip (0,-1) rectangle  (5,1);%     % Expression%     \node      [number]      at     (1.85,0.5)      {$5$};%     \node                    at     (2.35,0.5)      {$+$};%     \draw node [largedigit]  at     (2.5,0.5)       {};%     \node      [number]      at     (3,0.5)         {$81$};%     \end{tikzpicture}     \end{document}      But I would like to have it within this tikz minipage that I scalped from somebody somewhere. But I fear there is a conflict:               \documentclass[11pt, oneside]{article}      \usepackage{pgf,tikz}     \usetikzlibrary{shapes,snakes,backgrounds,arrows}             \tikzstyle{fancytitle} =[right=8pt,fill=black, text=white, ellipse]%     \tikzstyle{mybox} = [draw=black,fill=white,thick,rectangle, inner sep=10pt, inner     ysep=14pt,minimum height=2.5in]%     \begin{tikzpicture}[transform shape]%     \node [mybox] (box) {%     \begin{minipage}{.48\linewidth}%     {%      \begin{tikzpicture}[line width=1pt,line cap=round,line join=round,x=1.0cm,y=1.0cm]%     \tikzstyle{number}=[text=black,font=\Large]%     \tikzstyle{largedigit}=[draw=blue,ellipse,minimum height=20pt,minimum width=50pt]     \clip       (0,-1) rectangle    (5,1.5);     % Expression     \node   [number]       at   (1.85,0.5)          {$5$};     \node                  at   (2.35,0.5)          {$+$};     \draw node  [largedigit]   at   (2.5,0.5)           {};     \node   [number]       at       (3,0.5)         {$81$};     \end{tikzpicture}     }%     \end{minipage}%     };%     \node[fancytitle] at (box.north west) {Step 4: ``A'' \& ``S''};%     \end{tikzpicture}%      The first code works just great, but as soon as I inbed it within the tikz minipage, the ellipse acts very differently. Is there some incompatibility with my code? I have messed with `minimum width=?` and `minimum height=?` but from within the tikz minipage the parameters don't work the same.


title: Convert MS word margins into geometry package margins

text: I would like to convert the following margins that I have found in my MS word document to geometry package. > Top: 2.38cm Bottom: 2.38cm Inside: 2.29cm Outside: 1.52cm > > Gutter: 0cm Here is MWE:               \documentclass[11pt,twoside,openright]{memoir}     \usepackage{geometry}     \usepackage{lipsum}     \geometry{         paperheight=8.00in,         top=2.38cm,         bottom=2.38cm,          paperwidth=5.25in,         inner=2.29cm,         outer=1.52cm,         %bindingoffset=.75in,     }          \begin{document}     \lipsum[1-10]     \end{document}      The main issue here is that createspace is complaining that the gutter is insufficient and should be atleast `.75"`. The margins that I have provided are from their word template but when I submit it for review I get an insufficient gutter margin error that states I need gutter margin of atleast `.75in` and inside, top, bottom, outer, margins of atleast `.25in`. Does my code follow those specifications? EDIT: Here is an image from createspace's interior file reviewer. You can see that the page is coming out the dotted lines. On the left you can see the errors that have shown up. This image includes the answer that was suggested by @DL6ER ![enter image description here](http://i.stack.imgur.com/UYcln.png). EDIT 2: I already have had my book approved for a book proof and have already recevied the proof. The only reason, I want to change the margins is because the margins I used to get the book approved were odd. The text was _too_ close to the gutter. Here is the code that I used, maybe, someone can manipulate it so the text isn't so close to the gutter and the outside margin isn't so large.               \geometry{ paperheight=8.00in, top=.75in, bottom=.75in, paperwidth=5.25in, inner=.38in, outer=.75in, bindingoffset=.75in, }      Here is image of it on createspace. Aside from the showframe, the dimensions are fine (according to createspace). The main issue that I am having is that outside margin (the one indicated by the arrow) is too _in_ so if that could be stretched then that would be perfect or even if the entire text could be centred then that would be fine also. ![enter image description here](http://i.stack.imgur.com/RDqWF.png) EDIT 3: I have contacted Createspace and they have informed that only the first 18 pages of my document are a little bit outside of the required amount, the rest of the book is perfect. I have reviewed the other pages as well and that seems to be exactly the case. My `Introduction` is the only portion of the book that is outside the margins, otherwise, the rest of the book is fine. What could be the issue?


title: Why are the equal signs not equal and how do I make them equal?

text: This question is related to a question I asked here: How to reproduce typesetting of coupling constant in chemmacros There I was using `libertine` with `newtxmath` and `beramono` together with the `chammacros` package to typeset data for a report. When doing so, I noticed that different equal (=) signs appear. I found that this comes from an equal sign being either used in math mode or in normal mode. But how do I get rid of this, in general and in the particular context of chemmacros. Here is a MWE:               \documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{libertine}     \usepackage[scaled=.83]{beramono}     \usepackage[libertine]{newtxmath}          \usepackage{chemmacros}[2014/01/29] % use version 4     \chemsetup[nmr]{       delta = (ppm) ,       pos-number = side ,       use-equal,       format = \bfseries,       list=true ,       coupling-pos-cs = \ensuremath ,       atom-number-cs = \ensuremath         }     \usepackage{siunitx}     \sisetup{       separate-uncertainty ,       per-mode = symbol ,       range-phrase = -- ,       detect-mode = false ,       detect-weight = true ,       mode = text ,       text-rm = \libertineLF % use libertine with lining figures     }          \begin{document}          First with `chemmacros`          \begin{experimental}     \NMR(400)[C6D6] \val{2.01} (d, \J(1;CH)[Hz]{25.0}, \#{24}, \pos{5})     \end{experimental}          Then without:          This is an equal = and this too $ = $.          \end{document}      As one can see, the signs are equal in size and shape. ![Example](http://i.stack.imgur.com/xeuT8.png)


title: Using a variable as a package setting within a class

text: I have defined a new class. Within this class, I am calling on the hyperref package, and I set the following options:               \RequirePackage{hyperref}     \hypersetup      {       pdfauthor={...},       pdfsubject={...},       pdftitle={...},     }      Now, I have defined certain variables within this class (which I can call with `\variablename{}`). However, if I use these within this package, as part of the option settings, then this fails (undefined control sequence). Am I not using the right syntax?               \RequirePackage{hyperref}     \hypersetup      {       pdfauthor={\variablename{}},       pdfsubject={\variablename{}},       pdftitle={\variablename{}},     }      I've read these questions (variable-name \newcommand with parameters within another \newcommand and Defining a newcommand, with variable name, inside another newcommand), but they are about newcommands... this is rather a regular package (hyperref) that I'm including, so I'm hoping it does not need to be this complicated)...


title: Part numbering with suffixes: I, II, IIIa, IIIb, IV,

text: I would like to have my parts numbered like this: `I, II, IIIa, IIIb, ... , IV, ...` I have written some code which works fine. But when using `hyperref`, I get this warning: `destination with the same identifier (name{part.1}) has been already used, duplicate ignored`, because I reset the counter to zero for the sub-numbering. ## Question Is there any way to achieve the same result, but without reseting the part counter (and without producing `hyperref`-warnings)? ## Code               \documentclass{article}     \usepackage{hyperref}          \begin{document}     \tableofcontents     \pagebreak          \part{First}     \part{Second}          % change part numbering to ROMAN alph     \newcommand{\thelastpart}{\arabic{part}}%store old number     \edef\thelastpartexp{\thelastpart}     \addtocounter{part}{1}     \edef\themainpart{\thepart}      \setcounter{part}{0}%set subcounter     \renewcommand{\thepart}{\themainpart\alph{part}}          \part{Third a}     \part{Third b}          % reset part numbering     \setcounter{part}{\thelastpartexp}%restore counter     \addtocounter{part}{1}     \renewcommand{\thepart}{\Roman{part}}               \part{Fourth}          \end{document}


title: TeX capacity exceeded, sorry [hash size=20000]

text: I'm using a lot of packages right now:               \usepackage{mathtools}     \usepackage{amssymb}     \usepackage{array}     \usepackage{float}     \usepackage[colorlinks=true]{hyperref}     \usepackage[usenames,dvipsnames]{color}     \usepackage{verbatim}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{chngcntr}     \usepackage{enumitem}     \usepackage{ctable}     %\usepackage{showframe}          \usetikzlibrary{plotmarks}     \usetikzlibrary{arrows}          %subfigures     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}          %inline lists     \usepackage{paralist}      So, this error started to appear when I started to \usepackage{pgfplots}. Changing the order changes the details of the error message (it chokes on loading a different library), Without removing any of the packages, how can I get this to work? > If you really absolutely need more capacity, you can ask a wizard to enlarge > me. Where can I find a wizard?


title: Listings package with caption legend in spanish

text: I'm using the `listings` package and would like to translate the caption text displayed to Spanish, so instead of `Listing 1: Dummy label` it will display `Listado 1: Dummy label`. This is my code:               \documentclass[11pt]{article}   % list options between brackets     \usepackage[spanish]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{hyperref} %Links     \usepackage{verbatim}     \usepackage{listings}     \lstset{ %     %  language=Octave,                % the language of the code       basicstyle=\scriptsize,           % the size of the fonts that are used for the code       frame=single,                   % adds a frame around the code       breaklines=true,                % sets automatic line breaking       breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace       escapeinside={\%*}{*)},            % if you want to add LaTeX within your code       extendedchars=true,     }                    \begin{document}          \begin{lstlisting}[caption=Evento celebrado en días no consecutivos]     {     "identificador" : "22587"     "nombre" : "Visita guiada para conocer las aves del Botanico"     "descripcion" : "... Los domingos 8 de julio, 12 de agosto y 9 de septiembre (a las 10.30 horas) ..."     "dia-de-inicio" : "2012-07-08 10:30:00 +0200"     "dia-de-fin" : "2012-09-09 10:30:00 +0200"     }     \end{lstlisting}               \end{document}


title: data arrays in latex(or how to efficiently use data to drive layout)

text: In my book I need to use certain colors for certain chapters. One way to understand this is how to efficiently color a thumb index. I would like to make it easy to setup the colors in a data array(not a latex typographical array) and easily access the values from the array. In a normal programming language you would do something like               var ThumbColors = {Red, Blue, Green, ...}     ....     SetThumbColor(ThumbColors[k]) (where k maybe the current chapter or whatever)      Code like this allows one to separate the code from the data and hence makes it extremely easy to change the colors without having to find every instance of SetThumbColor. e.g., it is very bad to do this               SetThumbColor("red")      as it requires one to change every instance, who knows where, to change the colors. So, I need some way to implement the first case.               \NewCommand{\ThumbColors}{{red, green, blue, ...}}     \SetThumbColor{...}      OR, even better, some way to use a dictionary(key-value pairs) in an easy way:               \NewCommand{\ThumbColors}{{chapter1 = red, chapter2 = green, chapter3 = blue, ...}}     \SetThumbColor{\GetThumbColors{chapter1}}      The main thing is it should be quick to type. It's very easy to do in a programming language and i don't want to have to do 15 lines of code just to do something similar to 1 or 2 lines(else why not just hard code it in the first place?)


title: Kile and texlive 2012

text: Since I was not happy about the choice of texlive 2009 from Ubuntu repositories, I installed texlive 2012 manually from the website. Secondly, I like Kile to write, but when I try to install it, it forces me to install all the packages that i want to avoid (2009 version). So I used equivs and made a dummy Ubuntu package that tricks the OS (Ubuntu 12.04 64-bit) into installing kile without those packages. The problem is that Kile refuses compile. When I try to do it, from the output I can see that he does:   * cd into the right directory   * executes the pdflatex command And that's it. The funny thing is that repeating the same exact command via the terminal, the file is compiled correctly (I updated correctly the PATH, after all). Any ideas on how can I get it to work again?


title: Dummies Guide to Biber

text: I've spent a good deal of time searching the forum and couldn't find a user- friendly guide to citations with `biber` using TeXShop or TeXworks on a Mac. I'd like to successfully reproduce a slightly modified version lockstep's MWE found on another thread:               \listfiles          \documentclass{article}          \usepackage[authordate,backend=biber]{biblatex-chicago}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          Some text \autocite{A01}.          \printbibliography          \end{document}      Unfortunately, TeXShop and TeXworks only return the following: > Some text [A01]. I believe the problem resides with typesetting. Specifically, I understand that I must compile by calling `pdflatex`, `biber`, `pdflatex`. Unfortunately, `biber` is not listed as an engine under either TeXShop or TeXworks. First, I've verified that the appropriate packages are all installed using Tex Live Utility. I then tried to follow the `biber` manual to add the engine to TeXworks but didn't know how to browse my file directory to locate `biber` (assuming its somewhere under the /usr folder tree) nor could I add any 'arguments' as shown in the manual. With respect to TeXShop (my preferred program) there seems to be some complication with adding biber. I did note Mark S. Everitt's script (In TeXShop, is there a directive to select biber or BibTeX on a per-document basis?) but didn't know where to place his script. I tried placing it in '/usr/texbin' but to no avail (assuming that I still need to compile by calling `pdflatex`, `biber`, `pdflatex`). Any guidance would be greatly appreciated! [Please bear with me. As a polisci doc candidate I have little understanding of computers, esp scripts/programming. :( ]


title: \multicolumn issues

text: I try to achieve a table that resembles the one given in this link. Here is my code, and the result of running the code:               \begin{tabular}{l|l|l|}     \cline{2-3}     & \multicolumn{2}{l|}{Inner Rings} &  \multicolumn{4}{l|}{Outer Rings} \\     \cline{2-3}      & 2.2668  & 1.2866 \\     & 2.5329  & 1.3195 \\     & 2.7484  & 1.3742 \\     & 2.6992  & 1.3403 \\      & 2.6338  & 1.3657 \\          \multicolumn{1}{|l|}{Average and uncertainty}     \end{tabular}      ![enter image description here](http://i.stack.imgur.com/gWGjP.png) What I desire to have is three columns, the first column being blank until you reach the row containing "Average and uncertainty";   for the second column, I would like "Outer Rings" to be above 2.2668, 2.5329, etc.;   and for the third column, I would like "Inner Rings" to be above 1.2866, 1.3195, etc. How might I achieve this? I have tried many things.


title: Table of contents with roman, arabic, and no page numbers

text: I am trying to create a customized table of contents with the following form. I have been looking at a number of sources but still having a hard time getting it to work adequately. Right before the abstract there is a title page that should not be considered in the table of contents. There is an appendix at the end, that should not have a page number. The table of contents should look like this:                                                  Table of Contents                      Abstract............................................ ii                 Acknowledgement. ................................... iii                 Table of Contents................................... iv                 Tables.............................................. v                 Figures............................................. vi                 1.0 Introduction ................................... 1                         1.1 Background.............................. 2                         1.1 Objectives.............................. 3                 2.0 Review.......................................... 4                         2.1 xxxxxxxxxx.............................. 5                         2.2 yyyyyyyyyy.............................. 6                 3.0 Conclusion...................................... 7                 4.0 References...................................... 8                 CODE................................................ 9                 APPENDIX


title: income distribution champagne glass in tikz

text: I was trying to draw this or this. However, it is really hard for me to create the concave part of these images and seperate the picture into 5 equal parts.


title: More Math Fonts in ConTeXt

text: Yesterday Aditya very helpfully updated the Wiki: http://wiki.contextgarden.net/Math_fonts#Using_Math_fonts_in_MkIV. Modern, times, palatino, bonus, iwona (not iowna), antykwa-torunska, lucidanova, xits, xitsbidi and cambria appear to work properly under MKIV current, and 2013.11.10 12:23 MKIV beta. Lucida and asana work under current but not under beta. However, lucida does not create all symbols. For example, the \nabla symbol is not created. (This problem does not occur with lucidanova). Hvmath, informal and mathtimes would not build under either beta or current. Charter, garamond and utopia would not build under beta and defaulted to modern under current. Euler defaulted to modern under both current and beta. Do others find the same issues with math fonts? When, for example, lucida builds under current it uses fonts in /usr/local/texlive/texmf-local/fonts. I have copied the contents of the /texlive/texmf-local into the /texmf-local folder of my standalone beta version. I have used sudo texhash and the ls-R file has built and appears to list the contents properly. However, there is no sign that beta recognises the contents of the texmf-local folder. Why should current recognise/use its texmf-local folder but beta not recognise/use its texmf-local? I have been looking at some of the typescript files. The basic structure is recognisable from the documentation. However, most of the entries are preceded by ‘\s!’. What does this mean? I am sure I am not the only person to find math fonts in ConTeXt difficult. Any assistance would be much appreciated.


title: Why doesn't LaTeX vertically center contents of table cells by default?

text: Or perhaps provides an easier way to do so? Most tables rendered (that I have witnessed) seem to require vertical centering of content in table cells, purely for aesthetics. So what is the reason that LaTeX would make this particular job a 'bit hard' (relatively speaking) than horizontal centering? Is there something under the hood that makes this tricky? What was the design assumption that led to this? I'm relatively new to LaTeX and this particular question has been itching my mind for a few days now, since every table that I have to include in my published work requires vertical centering of cell contents. I'm guessing this is a common use case that could/should have been factored into TeX by default but isn't. Am I missing something here?


title: How do I put a label to left of a horizontal ncline in psmatrix?

text: The MWE example below does everything I want it to do, except the line               \tlput{$\delta$}      does nothing. I want the $\delta$ to the left of the dashed line. Here is the MWE:               \documentclass{article}          \usepackage{pst-node}          \begin{document}              \begin{figure}             \centering             \psmatrix[colsep=0.3cm,rowsep=.4cm,mnode=circle]             [mnode=dot,dotscale=.00001] \\             [mnode=dot,dotscale=.00001] & [mnode=dot,dotscale=.00001] & [mnode=dot,dotscale=.00001] \\             [mnode=r] && [mnode=r]             \ncline{1,1}{2,2}             \taput{$\Pi$}             \tlput{$M_{3}$}             \ncline{2,2}{3,1}             \tlput{$M_{1}$}             \ncline{2,2}{3,3}             \trput{$M_{2}$}             \psset{linestyle=dashed}\ncline{2,1}{2,3}             \tlput{$\delta$}             \endpsmatrix         \end{figure}          \end{document}      Thanks.


title: LyX does not recognise texlive directory on Mac

text: I installed my TeX Live through Macports. There is no problem if I compile my `.tex` with `xelatex` in a terminal. But LyX only "knows" the texlive basic packages with are located at `/usr/local/texlive/2013basic/`. But the extra features of TeX Live are put separately by Macports into `/opt/local/share/`. I added the latter into the "PATH" of LyX and reconfigured it again and again but still LyX never sees the extra packages. I have no idea what's wrong with LyX on Mac!


title: Spacing using minipage in theorem environment (ntheorem)

text: Consider the following example and notice the different vertical spacings between the theorem caption and the text. Is there a way to get the same spacing when using minipage as in the case of normal text?               \documentclass[english]{article}     \usepackage{babel}     \usepackage{blindtext}     \usepackage{lipsum}          \usepackage{amsmath}     \usepackage[amsmath]{ntheorem}%          \makeatletter     \newtheoremstyle{mystyle}%       {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont%               ##1\ ##2\theorem@separator}\hbox{\strut}}}]}%}       {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]%         \hfill{\normalfont(##3)}\newline}       \theorembodyfont{\normalfont}       \theoremindent0cm     \makeatother     \theoremstyle{mystyle}          \usepackage[demo]{graphicx}          \newtheorem{test}{test}     \begin{document}        \begin{test}           \begin{minipage}[t]{0.6\linewidth}              \vspace{0cm}              %\lipsum[40]              test           \begin{itemize}           \item test           \item test           \end{itemize}        \end{minipage}        \begin{minipage}[t]{0.4\linewidth}           \vspace{0cm}           \includegraphics[draft,height=4cm, width=5cm]{imageName}        \end{minipage}         \end{test}         \begin{test}            test         \end{test}     \end{document}      ![spacing](http://i.stack.imgur.com/2rNOO.jpg)


title: Trouble with latex and dvips with an FSTTCS documentclass

text: Following from my other question Which DVI viewer on linux?, now that I can easily view DVI files I came to the conclusion that the unusual document class I used for my document defines some non-standard margins and/or page size. This clashes with my compilation chain `latex --> dvips --> ps2pdf` (I'm using PSTricks): the dvi file looks formatted fine, but `dvips` isn't able to get the page size right and the margins look shifted. The class file I'm using is located here (in the _submission format_ section of the FSTTCS conference page there is also a zip file with a readme and examples). You can see my problem by compiling this minimal example:               \documentclass{fsttcs}     \begin{document}     \title{My document}     \runningtitle{My document}     \runningauthors{A, B, C}     \author{A, B, C}     \affiliation{XYZ}     \section{Sect. 1}     This is the section 1 of the test file.     This is the section 1 of the test file.     This is the section 1 of the test file.     \newpage     \section{Sect. 2}     This is the section 2 of the test file.     This is the section 2 of the test file.     This is the section 2 of the test file.     \newpage     \section{Sect. 3}     This is the section 3 of the test file.     This is the section 3 of the test file.     This is the section 3 of the test file.     \end{document}      With a simple `pdflatex test.tex` everything looks ok, but when I run `latex test.tex && dvips test.dvi && ps2pdf test.ps`, the page slightly changes its proportions and the page contents are shifted. I tried passing specifying all formats supported by `dvips` (letter, legal, ledger, a4, a3) with the `dvips -t <size>`, but none of them works correctly. I'm sure `pdflatex` gives the correct output because it is the same as the precompiled pdf included in the example zip file, but I can't use it because of PSTricks and I'm unable to specify the correct format to `dvips`. What should I do, please?


title: LaTeX (TikZ) image centering

text: I have a problem with the horizontal alignment of an image. I have compiled the image from the `matlab` extension and added it to my LaTeX file with the following code:               \begin{figure}[H]     \centering     \newlength\figureheight      \newlength\figurewidth      \setlength\figureheight{6cm}      \setlength\figurewidth{9cm}     \input{img/ConvPlot.tikz}     \caption{Convergentieplot bij $\nu=-0.7$ en $M_{ref}=M(Q=30)$.}     \label{ConvPlot}     \end{figure}      LaTeX automatically centers the image width **and** the vertical axis width. But I want only the figure box centered, not the image and axis. Is there any way to achieve this? Image: ![http://i49.tinypic.com/35iwxs4.jpg](http://i.stack.imgur.com/MJKEJ.png)


title: Should you put citations before or after interpunction?

text: This probably also could go to English.SE, but I'm not sure. When I want to cite a source for a complete sentence, you put the citation before or after the period? And if you cite for a word, or figure, do you put it before or after the comma? Please bear in mind my citations are not superscripted, here's an example: > appropriate awards and punishments[4, p.415]. or > appropriate awards and punishments.[4, p.415] Equivalent: > when, on January 28[3, p.4], or > when, on January 28,[3, p.4] I have a feeling that for facts I should put it right behind the fact and before the comma, while for sentences it should be after the period, but I do not know for sure.


title: Modifying a bst file to allow for an arxiv field

text: I am trying to add an `arxiv` reference to my bibentries and I would like to control how it shows up in the citation. I would like to have the field only contain the informative part:               arxiv = 0809.0726      but for the result to be more informative and perhaps contain a link:               \href{arXiv:0809.0726}{www.arxiv.org/abs/0809.0726}      which, of course can be done with a macro:               \newcommand{arxiv}[1]{{ \href{arXiv:#1}{www.arxiv.org/abs/#1}}}     \arxiv{0809.0726}      S far so good. I've taken `unsrt.bst` and started modifying it.   1. I've added `arxiv` to the ENTRY list   2. I've added a `format.arxiv` function that is a model for what I want:              FUNCTION {format.arxiv}     { arxiv empty$          { "" }          {" {\url{arXiv:" * arxiv * "}}" * }       if$     }        3. I modify the relevant output functions to call arxiv.output (for example, `unpublished`):               FUNCTION {unpublished}      { output.bibitem       format.authors "author" output.check       new.block       format.title "title" output.check       new.block       note "note" output.check       new.block       format.arxiv output       format.date output       fin.entry      }      However, when I try to compile a file I get the error:               Running `BibTeX' on `ResearchStatement' with ``bibtex ResearchStatement''     This is BibTeX, Version 0.99c (Web2C 7.5.6)     The top-level auxiliary file: ResearchStatement.aux     The style file: myunsrt.bst     Database file #1: general.bib     You can't pop an empty literal stack for entry FarjounSchaeffer2010     while executing---line 963 of file myunsrt.bst     (There was 1 error message)          BibTeX exited abnormally with code 2 at Thu Nov 10 16:39:09      I tried playing with the `*`'s in the `format.arxiv` function, but I kept getting the wrong results I'm sure this is easy for those who can access the force...but I am still a grasshopper here...


title: auto-pst-pdf problem - no cropped <file>-autopp.pdf

text: I'm trying to get some PSTricks pictures to PDF. I'm using the information provided on http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput#autopstpdf Well, never change a running system ... yesterday it worked, but due to HDD problems I had to reinstall my system (Win XP sp3, Miktex 2.9, Texniccenter 2.02). The thing is, the final .pdf is created, Latex->PDF, XeLatex->PFD, ... it doesn't matter. But what I would need is the cropped .pdf from the picture itself, the <'file'-autopp.pdf>. Perl (5v18) ist installed (although before the reinstallation I didn't have it). I got the "typical" two warnings, which I found quite often in forums, but those guys just needed the final .pdf, I would need the cropped pictures. Using:                \documentclass[12pt]{article}           \usepackage[pdf]{pstricks}      \usepackage[crop=off]{auto-pst-pdf}      \usepackage{pst-pdf}           \begin{document}      \input{a.pstricks}      \end{document}      Getting (umformen.log): (... .tex-file is called "umformen")               [...]         runsystem(echo "-------------------------------------------------")...executed.         runsystem(echo "auto-pst-pdf: Auxiliary LaTeX compilation")...executed.         runsystem(echo "-------------------------------------------------")...executed.         runsystem(del "umformen-autopp.log")...executed.              runsystem(latex -disable-write18 -jobname="umformen-autopp" -interaction=batchmode  "\let \APPmakepictures \empty \input           umformen.tex")...executed.              Package auto-pst-pdf Warning:              Creation of umformen-autopp.dvi failed.         This warning occured on input line 124.              Package auto-pst-pdf Warning:              Could not create umformen-pics.pdf. Auxiliary files not deleted.         This warning occured on input line 124.         runsystem(echo "-------------------------------------------------")...executed.         runsystem(echo "auto-pst-pdf: End auxiliary LaTeX compilation")...executed.         runsystem(echo "-------------------------------------------------")...executed.     [...]      Because the whole system is reinstalled, I think the error is maybe somewhere else? Anyone any clues? Greetings, Florian


title: How to draw this piecewise graph using PGF/TikZ?

text: Given   ![enter image description here](http://i.stack.imgur.com/TUOyN.png) Is there an easy way to define the condition as "rational" and "irrational" using PGF/TikZ? A minimal example would be greatly appreciated. This is one of the rational/irrational graphs in Calculus by Michael Spivak book, page 97. ![enter image description here](http://i.stack.imgur.com/SK7iP.jpg)


title: Printing single bib entry in a section other than references

text: Traditionally we use \cite{} to print a list of cited references from a .bib file at the end of document. Apart from this i need to print one entry in a section (say above reference section). e.g. I need something like this Paper published   1. A.dan, i am best, in: journal of.........  References (list of cited references) 1. 2. 3 A.dan, i am best, in: journal of.........


title: Error while including inkscape image in tex file

text: I am using the Tex Live 2013/Debian on my Ubuntu 14.04 I exported an image as PDF in Inkscape (and checked the PDF+Latex option). To include the image in my latex file, I used the following command               \begin{figure}     \centering     \input{2.pdf_tex}     \caption{Flowchart describing our approach.}     \end{figure}      However, on building the .tex in TexMaker, I get the following error               (Inkscape) Color is used for the text in Inkscape, but the package 'color.sty' is not loaded      How can I resolve this issue?


title: How to set a global setting for hyphenation of already hyphenated words using XeLaTeX?

text: Please consider the MWE below, I want to _globally_ invoke hyphenation of already hyphenated words using `Babel` package, `Hyphenat` package in English, to get the same effect when using `<word1>-\hspace{0pt}<word2>` as shown in the output below. This is hopefully to avoid tracking down every hyphenated word in a thesis last-minute scenario, especially after doing some text edit in a 200-page thesis. I am quite satisfied with the effect of `\hspace{0pt}`, and I don't see any reason against using it blindly, or am I missing something? **MWE Code**               \documentclass{scrartcl} % complied with XeLaTeX     \usepackage[english]{babel}     %\defineshorthand{"-}{\babelhyphen{hard}} % didn't work     \usepackage{fontspec}     \usepackage{libertine}          \begin{document}     In summary, IL-17 can be produced by innate and adaptive cells, but more profoundly from innate sentinel cells of the immune system.      The nTh17 is a novel subset that is thymic-\hspace{0pt}dependent and shows a distinct developmental pathway from iTh17 cells that are derived from naive T cells.          In summary, IL-17 can be produced by innate and adaptive cells, but more profoundly from innate sentinel cells of the immune system.      The nTh17 is a novel subset that is thymic"-dependent and shows a distinct developmental pathway from iTh17 cells that are derived from naive T cells.     \end{document}      **Output**   ![enter image description here](http://i.stack.imgur.com/ytlVd.png)


title: Comparison of available TeX distribution tools

text: By any chance, is there any place or page for the comparison of the available distribution tools? For me, at this point of time, I only 3 TeX tools. They are 1) LaTeX 2) MiKTeX 3) TeX Live Are there any other?


title: In output PDF, first letter after \iftoggle condition is removed

text: When iftoggle condition is used, first letter after the condition is removed in the output. Consider below code               \documentclass{article}     \usepackage{etoolbox}     \begin{document}     \newtoggle{test}     \toggletrue{test}     First sentence.\iftoggle{test}{ Second sentence.} Last sentence.     \end{document}      If one executes above code, it renders `"First sentence. Second sentence.ast sentence."` removing "L"!. Can any one tell me how to correct it?