title: Shading a Region Between Two Dashed Lines

text: I have drawn an axis with two dashed vertical lines:                   \begin{tikzpicture}     \begin{axis}[         axis x line=middle,          axis y line=middle,          ymin=-6, ymax=6, ytick={1,3,5,-1,-3,-5}, ylabel=$y$,          xmin=-2.3, xmax=2.3, xtick={-1,-2,1,2}, xlabel=$x$         ]         \pgfplotsinvokeforeach{-1, 1}{           \draw[dashed,color=red] ({rel axis cs: 0,0} -| {axis cs: #1, 0}) -- ({rel axis cs: 0,1} -| {axis cs: #1, 0});};          \addplot[red, mark=*] coordinates {(1,1)};          \addplot[red, mark=*] coordinates {(-1,1)};     \end{axis}     \end{tikzpicture}      I would like to shade the region between the dashed lines.


title: microtype tracking disables small caps in luaLaTeX

text: Normall `microtype` tracking loosens the tracking of small caps. However, with `fontspec`'s `\setmainfont{`ebgaramond`}`, small caps are completely disabled and I get a loose normal text, ![enter image description here](http://i.stack.imgur.com/UpX0C.png) as opposed to ![enter image description here](http://i.stack.imgur.com/2AvYp.png) with the corresponding font package and normal pdfLaTeX. I want to use LuaLaTeX for some fancy ligatures, and XeLaTeX messes everything up. Using the `ebgaramond` package in LuaLaTeX doesn't help.


title: How to write 1, 2, ... as a subscript to a letter?

text: I have two `theta` angles, one is `\theta -1`, other one is `\theta -2`. How can I write that properly? I want to give numbers to the thetas, putting the numbers at the bottom right end of the letter.


title: Why overprint-environment not fix position?

text: I use `overprint` environment in beamer with two columns, when overlay it move down and the last slide has some space. How can I solve this problem.               \documentclass{beamer}     \usepackage{tikz}     \newcommand{\code}[1]{\footnotesize\tt #1}     \newcommand{\codealert}[1]{\alert{\code{#1}}}     \begin{document}     \begin{frame}     \begin{columns}     \begin{column}{.55\textwidth}     \code{\textbackslash begin\{tikzpicture\}}\\     \code{\textbackslash node[circle,draw](a) at (0,0)\{a\};}\\     \code{\textbackslash node[circle,draw](b) at (1,1)\{b\};}\\     \begin{overprint}     \onslide<1>{\codealert{\textbackslash draw[->](a) -- (b);}}\\     \onslide<2>{\codealert{\textbackslash draw[->](a) to (b);}}\\     \onslide<3>{\codealert{\textbackslash draw[->](a) -| (b);}}\\     \onslide<4>{\codealert{\textbackslash draw[->](a) |- (b);}}     \end{overprint}     \code{\textbackslash begin\{tikzpicture\}}     \end{column}     \begin{column}{.4\textwidth}     \tikz{     \draw (-1,-1) rectangle +(3,3);     \node [circle, draw] (a) at (0,0) {a};     \node [circle, draw] (b) at (1,1) {b};     \onslide<1>{\draw [->,red] (a) -- (b);}     \onslide<2>{\draw [->,red] (a) to (b);}     \onslide<3>{\draw [->,red] (a) -| (b);}     \onslide<4>{\draw [->,red] (a) |- (b);}     }     \end{column}     \end{columns}     \end{frame}     \end{document}


title: My attempt to local redefine a command is failing and not sure why

text: I want to decorate some text and then reprint it undecorated. This is the code that I was using to do this.               \documentclass{article}     \usepackage{xcolor}     \makeatletter     \newcommand{\@aeformatcontent}[1]{\parbox[t]{5in}{\emph{#1}}}     \newcommand{\aeformatcontent}[1]{%%'       $\star$\hspace*{0.5em}\@aeformatcontent{#1}\par       \bgroup         \def\aeget#1{#1}%%'         $\phantom{\star}$\hspace*{0.5em}\@aeformatcontent{#1}%%'       \egroup     }           \newcommand{\aeget}[1]{\csname aephrase #1\endcsname}     \newcommand{\aedefine}[1]{\expandafter\def\csname aephrase #1\endcsname{{\color{red}#1}}}          \makeatother          \begin{document}            \aedefine{this is a trial}       \aeget{this is a trial}            \aeformatcontent{\aeget{this is a trial}}          \end{document}      When I try to compile this, I get the error:               ! Use of \aeget doesn't match its definition.     <argument> \aeget {                        this is a trial}     l.24 ... \aeformatcontent{\aeget{this is a trial}}          ?       If I replace `\def\aeget#1{#1}` with               \renewcommand{\aeget}[1]{#1}      I get stuck in an infinite loop until LaTeX's capacity is exceeded. I don't understand why neither of these approaches works. Neither do I understand why I'm getting different error messages.


title: Upgrading PGF without tex-package manager

text: I don't use MiKTeX or any other package managers. I usually install new styles/libraries by adding the .sty file to the same directory as the .tex file and compile using pdflatex. I figured out I have pgf version 2.0 and want to upgrade to version 2.10. I already tried doing texhash, but that didn't seem to change anything. Can someone help me out? I don't wish to install any MiKTex-like software.


title: In memoir, can I number abstracts as sections in the toc?

text: I'm writing up my thesis right now, using memoir, and I have a problem with abstracts. Each chapter - besides the intro and conclusion - is an article published in a journal, and has its own abstract (which is in addition to the abstract at the beginning of the thesis). I like the way the abstract environment \begin{abstract}... typesets the abstracts for each chapter, but they show up as unnumbered chapters in the table of contents. If I use \abstractnum to force numbering it just numbers the abstracts as chapters; what I'd really like is for them to be numbered as sections: **2 Great chapter title**   2.1 Abstract ....   2.2 Introduction ....   [...] I've been up one side of Google and down the other to no avail, and I can't find anything in the memoir manual. Is there a simple way to do this in memoir, or do I have make the abstracts \section{}s and live with it? Update: I've been playing more and I can get the behaviour I want in individual chapters if I muck with the section numbering and add to the toc manually:               \begin{abstract}     \addtocounter{section}{1}     \addcontentsline{toc}{section}{\numberline{\thesection}Abstract}     ...      But now I've got the opposite problem: I put the thesis abstract in the table of contents using \abstractintoc before the thesis abstract, but now the chapter abstracts show up twice, once as an unnumbered chapter and once as the properly numbered section: **2 Great chapter title**   **Abstract**   2.1 Abstract..   2.2 Introduction... Maybe it's easier to solve the problem when it's this way instead?


title: PDF video Embedding Problem

text: I have embed an mp4 video in the PDF file as given below:               \documentclass{beamer}     \usetheme{Singapore}     \usepackage{media9}     \usepackage{hyperref}     \begin{document}          \begin{frame}\frametitle{Title}          \includemedia[     width=\paperwidth,height=0.7\linewidth,     activate=pageopen,     flashvars={aaa.mp4 &autoPlay=true}     ]{}{C:/Users/name/Desktop/aaa.mp4}          \end{frame}          \end{document}       There is no compile time error in the code but after running it this massage comes along a blank pd f file.... "To view the Flash @R Technology content in this pd f file, please install the required version of Flash Player" I would like to add here that I already have installed the latest version of Flash Player(Adobe Flash Player 12 ActiveX). So,Can anyone tell what version is required to be installed to obtain Video in pd f file.


title: Looking for a special printhyphens macro

text: In May 2012 user9588 answered:               \documentclass[12pt,a4paper]{article}     \def\rehbox{{\unskip\unpenalty\setbox0\lastbox\ifhbox0 \rehbox         \hbox{\unhbox0} \else \leavevmode \fi}}     \newcommand\printhyphens[1]{%       \setbox0\vbox{{%           \pretolerance-1\hsize=0pt\hfuzz=\maxdimen           \noindent\hspace*{0pt}#1\par\rehbox}\par}%       \unvbox 0     }          \begin{document}     \printhyphens{If you cannot reconsider this proposal, you are       incompatible, my dearest friend.}     \end{document}      Is it possible to construct a macro `\printhyphs` which does following:               \documentclass[12pt,a4paper]{article}          <hyphenfile = my-path/sillyhyphens.txt>          \begin{document}     \printhyphs{If you cannot}     \printhyphs{reconsider this proposal, you are}     \printhyphs{incompatible, my dearest friend.}     \end{document}      Running (pdf|xe)latex will create a file: `my-path/sillyhyphens.txt`, containing:               If you can- not     re- con- sid- er this pro- pos- al, you are     in- com- pat- i- ble, my dear- est friend.      Whether or not the `-`signs are followed by a space is irrelevant.


title: How to Specify two level row and column labels of a matrix by braces?

text: I'm trying to write the following matrices. ![enter image description here](http://i.stack.imgur.com/fFDE2.jpg) I used the following code (given by Caramdir)               \documentclass{article}     % Load TikZ     \usepackage{tikz}     \usetikzlibrary{matrix,decorations.pathreplacing,calc}     % Set various styles for the matrices and braces. It might pay off to fiddle around     with the values a little bit      \pgfkeys{tikz/mymatrixenv/.style={decoration=brace,every left delimiter/.style=    {xshift=3pt},every right delimiter/.style={xshift=-3pt}}}      \pgfkeys{tikz/mymatrix/.style={matrix of math nodes,left delimiter=[,right delimiter=    {]},inner sep=2pt,column sep=1em,row sep=0.5em,nodes={inner sep=0pt}}}      \pgfkeys{tikz/mymatrixbrace/.style={decorate,thick}}      \newcommand\mymatrixbraceoffseth{0.5em}      \newcommand\mymatrixbraceoffsetv{0.2em}          % Now the commands to produce the braces. (I'll explain below how to use them.)     \newcommand*\mymatrixbraceright[4][m]{     \draw[mymatrixbrace] ($(#1.north west)!(#1-#3-1.south west)!(#1.south west)-    (\mymatrixbraceoffseth,0)$)         -- node[left=2pt] {#4}          ($(#1.north west)!(#1-#2-1.north west)!(#1.south west)-(\mymatrixbraceoffseth,0)$);     }      \newcommand*\mymatrixbraceleft[4][m]{      \draw[mymatrixbrace] ($(#1.north east)!(#1-#2-1.north east)!(#1.south east)+    (\mymatrixbraceoffseth,0)$)         -- node[right=2pt] {#4}           ($(#1.north east)!(#1-#3-1.south east)!(#1.south east)+    (\mymatrixbraceoffseth,0)$);     }     \newcommand*\mymatrixbracetop[4][m]{     \draw[mymatrixbrace] ($(#1.north west)!(#1-1-#2.north west)!(#1.north east)+(0,\mymatrixbraceoffsetv)$)         -- node[above=2pt] {#4}          ($(#1.north west)!(#1-1-#3.north east)!(#1.north east)+(0,\mymatrixbraceoffsetv)$);     }     \newcommand*\mymatrixbracebottom[4][m]{     \draw[mymatrixbrace] ($(#1.south west)!(#1-1-#3.south east)!(#1.south east)-(0,\mymatrixbraceoffsetv)$)         -- node[below=2pt] {#4}          ($(#1.south west)!(#1-1-#2.south west)!(#1.south east)-(0,\mymatrixbraceoffsetv)$);     }          \usepackage{tikz}     \usetikzlibrary{matrix,decorations.pathreplacing}          \begin{document}                \[      \begin{tikzpicture}[mymatrixenv]      \matrix[mymatrix] (m)  {         a & b & c & d & e & f \\         g & h & i & j & k & l\\         l & m & n & o & p & o \\         \hline \\         q & r & s & t & u & v \\         w & x & y & z & a & b \\         c & d & e & f & g & h \\       };       \mymatrixbraceright{1}{3}{$E_1$}       \mymatrixbraceright{5}{7}{$E_2$}       \mymatrixbracetop{1}{3}{$E_1$}       \mymatrixbracetop{4}{6}{$E_2$}     \end{tikzpicture}     \]          \end{document}      ![Output](http://i.stack.imgur.com/1o0gS.png) It's really nice but still it doesn't serve my purpose. Any help in this regard will be highly appreciated. Thanks


title: Can TeX know when it's at the top of a page?

text: I have a memoir project where the chapters run right after each other with a divider line between chapters. If the chapter falls at the top of a page there shouldn't be a line or a space. Is there any automatic way to do this or is the best way to just use 2 chapter styles and manually switch between them to remove the line and extra space?               \documentclass[12pt,a4paper,article]{memoir}      \usepackage{lipsum}          %----------depthead     \makeatletter      \makechapterstyle{mychapter}{%     \renewcommand{\printchaptername}{}% suppress "Chapter" from heading     \renewcommand*{\printchapternum}{}% suppress numbering from heading     \renewcommand*{\chaptitlefont}{\centering}% title formatting     \renewcommand\afterchapternum{%       \vskip3em\hrulefill\vskip1em}%       \setlength\beforechapskip{-10pt}%      \setlength\afterchapskip{30pt}% adjust vertical space after the title     }     \makeatother          \chapterstyle{mychapter}     \begin{document}          \chapter{Sample Chapter 1 should not have line and space}     \lipsum[1]          \chapter{Sample Chapter 2}     \lipsum[1]          \newpage          \chapter{Sample Chapter 3 should not have line and space}     \lipsum[1]               \end{document}


title: Incompatibility between the `footnote` and `xcolor` packages

text: The following code fails to build:               \documentclass{book}          \usepackage{footnote}     \usepackage{xcolor}          \begin{document}          \chapter{My first chapter}          \parbox{110mm}{     Here is a footnote\footnote{The footnote is here}.     Where is my footnote?     }          \end{document}      The error produced is:               ! Extra }, or forgotten \endgroup.     <argument> ...@finalstrut \strutbox }\fn@endnote }          l.13 }      If I remove the `footnote` package, the footnote is not exported outside of the `parbox`, and I need the `xcolor` package to produce gray lettrines somewhere else in the document. Is that a know bug? How can I circumvent it?


title: Use lining figures with Venturis ADF and hyperref

text: I've got a document set with Venturis ADF and old style numbers, as they match the body text of the document much better. However, one of the characters names is Zen0, and with an old style zero this looks like Zeno. Therefore I'm using `\textl{Zen0}` to write hir name. This works perfectly fine, except in `\section` commands when I have `hyperref` enabled. Minimum Working Example:               \documentclass[]{article}          \usepackage[T1]{fontenc}     \usepackage[]{venturis}     \usepackage{hyperref}          \newcommand{\Zeno}{\textl{Zen0}}          \begin{document}     \tableofcontents          \section{Zen0} %Works fine     \section{Zeno}     %\section{\textl{Zen0}} %Uncomment to break document     %\section{\lstyle Zen0} %Uncomment to break document          Zeno Zen0 \textl{Zen0} \Zeno          \end{document}


title: beamer doesn't work after upgrading to MiKTeX 2.9 – 20 error messages

text: After upgrading to MiKTeX 2.9 my `beamer` files stopped working. The code:               \documentclass{beamer}      \begin{document}      \begin{frame}      Hello      \end{frame}      \end{document}      Gives some 20 errors and two warnings, the first error being:               ! Undefined control sequence.     <argument> ...eamer@linkspace {6pt}\Hy@xspace@end                                   \Hy@LinkMath \Hy@SaveSpace...      and the first warning:               LaTeX Font Warning: Font shape `OT1/cmss/m/n' in size <4> not available     (Font)              size <5> substituted on input line 3.      The log file is available here. I have searched the web in vain, for example tried deleting the .aux file as suggested at Beamer - undefined control sequence, the solutions did not work.


title: Horizontal alignment (problem with minipage)

text: I'm new here. I just have a problem with the `minipage` environment. The problem is that the tables aren't horizontally aligned. I want these table aligned one by one, but I don't know what's wrong. Here is the code.               \centering         \begin{table}[h]             \begin{minipage}[c]{.2\linewidth}                        \begin{tabular}{|cc|}     \hline     $n$ & $\theta(º)$ \\ \hline     1   & 13.558      \\ \rowcolor[gray]{0.7}     2   & 27.959      \\     3   & 44.690      \\ \rowcolor[gray]{0.7}     4   & 69.668      \\ \hline                 \end{tabular}                 \subcaption{Predicción teórica.} \label{kbrteo}             \end{minipage}%                  \begin{minipage}[c]{.8\linewidth}                 \begin{tabular}{|cccccccc|}     \hline                     $n$ & $\theta(º)$ & $\delta \theta(º)$& $\theta(rad)$   & $\delta \theta(rad)$ & $sin\theta$ &$\delta sin\theta$ & $\frac{n\lambda}{2}$(\AA) \rule{0in}{10pt}\\ \hline          \cellcolor[gray]{0.2}& 12.2       & 0.01              & 0.213           & 0.002                & 0.211       & 0.002             & \cellcolor[gray]{0.2} \\     1                    & 13.6       & 0.01              & 0.237           & 0.002                & 0.235       & 0.002             & 0.771 \\ \rowcolor[gray]{0.7}     2                    & 27.9       & 0.01              & 0.487           & 0.002                & 0.468       & 0.002             & 1.542 \\     3                    & 44.5       & 0.01              & 0.777           & 0.002                & 0.701       & 0.001             & 2.314 \\ \rowcolor[gray]{0.7}     4                    & 69.1       & 0.01              & 1.206           & 0.002                & 0.934       & 0.001             & 3.085 \\\hline                           \end{tabular}                 \subcaption{Posiciones observadas.} \label{kbrexp}             \end{minipage}%         \caption{Estudio de las posiciones de los máximos de difracción para el KBr.}\label{kbr}         \end{table}


title: More than one e-mail address in the same domain

text: Suppose we have 3 people whose e-mail addresses are               aa@gmail.com          bb@gmail.com          cc@gmail.com      When I try to group these three addresses like               {aa, bb, cc}@gmail.com      one problem happens. If I move the mouse near `cc`, there is one wrong message `"mailto: ccg@gmail.com"`. I guess the letter `g` is the original }. So how can I simply forbiden these `"mailto"` message, for example, simply leave the addresses as a plain text ? Anyone know how to do it ?


title: returning maths values in a new command

text: So I'm trying to construct a command which calls another command to make typing easier, but for some reason I'm not able to get the commands to return things properly. Here is what I have               \documentclass[12pt]{article}               \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{mathtools}          \newcommand{\mfunction}[4] {         \def \lnum{#4}              \ifnum\lnum=0             {M_{{#1}_{{#2},{#3}}}}         \else             {M_{{#1}_{{#2},{#3}}^{k}}}         \fi     }          \newcommand{\man}[3][0] {\mfunction{A}{#2}{#3}{#1}}     \newcommand{\mbn}[3][0] {\mfunction{B}{#2}{#3}{#1}}     \newcommand{\mdn}[3][0] {\mfunction{D}{#2}{#3}{#1}}                    \begin{document}         \begin{align*}             \man[1]{n}{l} \coloneqq \{a\}\\             \mbn{n}{k} \coloneqq \{b\} \\             \mdn{n-1}{k} \coloneqq \{d\}         \end{align*}     \end{document}      This is coming back with the errors that I'm missing '$' and '}' signs where I have '\end{align*}'. Oddly when I place the code directly into my 'quick' command I get the proper output. So the code that works is:               \documentclass[12pt]{article}               \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{mathtools}                    \newcommand{\man}[3][0] {{M_{{A}_{{#2},{#3}}^{#1}}}}                    \begin{document}         \begin{align*}             \man[1]{n}{l} \coloneqq \{a\}         \end{align*}     \end{document}      Why would the first version not work and the second one work? Is something happening with my definition/if statement that is causing the new command to return data that is not intended? Thanks.


title: Log file not found! Texmaker error

text: I installed TexLive and Texmaker. When I want to build the tex document I receive the "Log not found!" error. Here is a screenshot of the Texmaker settings: ![enter image description here](http://i.stack.imgur.com/hN2bA.jpg) ![enter image description here](http://i.stack.imgur.com/lTYHq.jpg) I also used "PDFlatex + view PDF" in the quick build command section, but it didn't work. When I use the editor of the TexLive itself, it works. But, it does not work with Texmaker.


title: Alegreya prevents nested \emph commands to behave as expected

text: I'm using Alegreya font with PDFLaTeX, and have noticed that the `\emph` command did not work anymore when nested. To be clearer, this code :               \documentclass{book}     \usepackage{Alegreya}     \begin{document}     Normal text. \emph{Emphasized text.} \emph{Emphasized text including \emph{emphasized} text.}     \end{document}      yields : ![Alegreya prevents nested \\emph from working properly](http://i.stack.imgur.com/N9Hhi.png) instead of the regular nested behaviour (when another or no font is selected) : ![enter image description here](http://i.stack.imgur.com/OgRBz.png) Any ideas on how to circumvent this problem ?


title: How to put 2 cols in landscape oriented page?, 1col for 1figure, other for comments?

text: How can I obtain any similar to the image? ![enter image description here](http://i.stack.imgur.com/tXYvs.png) I was trying with similar things to * * *               \documentclass[12pt,a4paper,x11names,landscape]{article}     \usepackage{lipsum,mwe}     \usepackage{incgraph,graphicx}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}     \usepackage{multicol}          \begin{document}     This is the 1st page of \jobname, with ONLY 1 col.               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \clearpage     \begin{multicols}{2}     \begin{figure}       \centering       \includegraphics[width=0.40\textwidth]{example-image-a.eps}       \caption{forma02}\label{forma02}     \end{figure}          And now, in the rigth column, I want to explain the letter A.\\          A is the first letter of the alphabet.     \begin{itemize}       \item because YES       \item because B is the 2nd       \item and finally, because C is the 3rd.     \end{itemize}     \end{multicols}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \clearpage     The source document \jobname is OVER with this 1 col page.          \end{document}      \--------------------- OR ----------------------------               \documentclass[12pt,a4paper,x11names,landscape]{article}     \usepackage{lipsum,mwe}     \usepackage{incgraph,graphicx}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}          \begin{document}     The source document is\jobname.          \begin{minipage}[b]{0.45\linewidth}     \centering     \begin{figure}       %\centering       % Requires \usepackage{graphicx}       \includegraphics[width=\textwidth]{example-image-a.eps}       \caption{forma02}\label{forma02}     \end{figure}     \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.45\linewidth}     Here are comments about the figure in this page     \begin{itemize}       \item This is the first       \item 2nd       \item and the last     \end{itemize}     \end{minipage}          \end{document}


title: Letter with ' (and correct spacing)

text: I am struggling with a problem I can't even name properly: I'm writing an article about an object A as well as its slightly different variant A'. I am wondering what character/symbol and/or spacing magic I need for the '. I started by simply using ' but this gives me an pretty nasty space between the A and the '. Then I tried to correct that with `A\kern-0.1em'` Unfortunately this is not consistent as things get stretched around to fill the page (in some cases there's just as much space as without kerning). I also read through the giant symbol archive but at a glance I couldn't find anything appropriate. Well, I didn't know what I'm looking for so maybe I missed it. Surely this type of notation is quite common? Is there any better way to achieve this? Honestly I don't even know if an apostrophe is the right kind of dash for this kind of labeling. So any suggestions for coding magic or new symbols are welcome. Many thanks.


title: Add lifecon package to project

text: I would use actuarial symbols in my documents. Here we have lots of example: http://maths.dur.ac.uk/stats/courses/AMII/LifeConSymbolsGuide.pdf some of them need `lifecon` package. Could you tell me how can I add it? If I add `\usepackage{lifecon}` it doesn't work:               ! LaTeX Error: File `lifecon.sty' not found.Type X to quit or <RETURN> to proceed,or enter new name. (Default extension: sty)Enter file name:! Emergency stop.<read >      Coule you tell me how can I add it?


title: Changing the height, width of moderncv type resume

text: I am trying to change the pagewidth and pagelength of a `moderncv` type CV that can be found here (http://www.ctan.org/tex- archive/macros/latex/contrib/moderncv) by changing the values inside inside `moderncv.cls`:               \DeclareOption{a4paper}{       \setlength\paperheight{607mm}       \setlength\paperwidth{210mm}}      But, nothing really changes when I alter the values. Any ideas?


title: Using seqsplit with multicolumn

text: I want to create a longtable with headers centered, columns left or right aligned. Thanks to my previous question: Right aligning two columns next to each other in longtable and its great answer, I've crafted this example document:               \documentclass{article}     \usepackage{array}     \usepackage{seqsplit}     \usepackage{longtable}     \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}     \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}          \begin{document}     \begin{longtable}{|L{3.32cm}|R{3.97cm}|R{3.14cm}|L{3.57cm}|}     \hline     \multicolumn{1}{|c|}{ header1 } & \multicolumn{1}{c|}{header2} & \multicolumn{1}{c|}{ \seqsplit{The\_header3\_is\_longer\_than\_expected} } & \multicolumn{1}{c|}{What\_would\_happen\_if\_header4} \\     \hline     \endhead     \hline     some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment \\     some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment \\     some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment \\     some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment & some text goes here to illustrate the alignment \\     \end{longtable}     \end{document}      The problem with this, is that seqsplit is not doing its job and splitting long words when width set is reached. See: ![Latex example](http://i.stack.imgur.com/ewFqb.png)


title: LaTeX moderncv classic: Change the width of the title

text: I'm looking to change the width of the `\title` environment in the `moderncv` template. As it is now, the maximum width of the title under my name goes all the way to the "address"/information box on the right.


title: How to create Windows-8-styled menus?

text: I'm writing a technical documentation and I want to explain step-by-step how to go through various menus. For example I used to write `Open with > VLC media player`. That's how it looks in Windows 8: ![menu style in Windows 8](http://i.stack.imgur.com/al3ac.jpg) What I want in Latex should looks similar to this: light grey box, dark grey border and black windows-like font. ![Desired result](http://i.stack.imgur.com/KuQlH.png) I've seen this question, suggesting the package `popupmenu` \- but it looks very old fashioned - are there any more modern approaches?


title: Automatic linking (aka code highlight) in Till Tantau's `codeexample`

text: I am writing docs for a tikz-based package, and I am trying to reuse Till Tantau's `codeexample` environment to output source code along with its output. However, I cannot manage to get syntax highlighting (that is, automatic linking of keywords) to work. [ **EDIT** : as it turns out, the `pdflinks` / syntax highlighting layer is Christian Feuersänger's work] This is a minimal example reproducing the problem:               \documentclass[a4paper]{ltxdoc}     \usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}     \usepackage[utf8]{inputenc}     \usepackage{makeidx}     \makeindex     \usepackage{hyperref}     \hypersetup{%             colorlinks=true,             linkcolor=blue,             filecolor=blue,             urlcolor=blue,             citecolor=blue,             pdfborder=0 0 0,     }     \usepackage{tikz}          % pgfmanual.sty inputs pgfmanual.code.tex, which in turn inputs     % pgfmanual.prettyprinter.code.tex and pgfmanual.pdflinks.code.tex.     % All the files are in the same dir as this file.     \usepackage{pgfmanual}          \usepackage{calc} % NEEDED by pgfmanual-en-macros     \input{pgfmanual-en-macros}     \newcommand{\options}[1][options]{\opt{\oarg{#1}}}     \newcommand{\sillymacro}[2][]{        \node [shade, top color = black, bottom color = green, %               text = white, thick, rounded corners, font=\bfseries, #1] {#2};     }     \begin{document}        \begin{command}{\sillymacro\options\marg{contents}}           Defining a command via the command environment is supposed to automatically index it, isn't it?           In fact, an entry is correctly generated in the index.           Howeverm I would expect |\sillymacro| to be treated as a link, but it doesn't really work.           \begin{codeexample}[]              \begin{tikzpicture}                 \sillymacro{Uh-uhhhh! I am fancy}              \end{tikzpicture}           \end{codeexample}         \end{command}        No linking inside the example, no |\sillymacro| linking outside.        \printindex     \end{document}      I would expect automatic linking to happen, but it doesn't. All the files appear to be in the right place, and I get no warning whatsoever. In `pgfmanual.code.tex`, the key `/pdflinks/codeexample link` is set to true. I have also activated `/pdflinks/show labels`, but I cannot see any difference. **EDIT** Maybe I should make clearer that the example compiles all right, and gives no error, but it does not produce the expected result. The only problem is that the automatic linking of the keywords with their definitions and the consequent highlighting of the keywords in the code examples do not work. As I wrote in the code example, the `command` environment takes care of extracting the names of the command and indexing it. Things are working up to this point, in fact the entry is correctly indexed and shown in the index at the end of the document. What I am trying to understand is if there is something that I do that is preventing automatic linking from working, or if there is something that I am supposed to do and didn't. **EDIT (post-answer)** After Christian brilliantly answered my question below, I actually tried to make it work. Not without surprise, with respect to the code above I discovered that only adding `\def\pgfautoxrefs{1}` at the beginning of the document would only partially solve the problem. In-text auto-linking using `|\sillymacro|` would work as expected, while syntax highlighting in the code example would still be broken. To make it _totally_ work, one must replace the statement               \usepackage{pgfmanual}      with               \makeatletter     \input{pgfmanual.code}     \makeatother      This is quite puzzling, since all my `pgfmanual.sty` does is:               \input pgfmanual.code.tex      So, in the end, the complete working example is as follows:               \documentclass[a4paper]{ltxdoc}     \def\pgfautoxrefs{1} % !!!!!!     \usepackage[left=2.25cm,right=2.25cm,                 top=2.5cm,bottom=2.5cm,nohead]{geometry}     \usepackage[utf8]{inputenc}     \usepackage{makeidx}     \makeindex     \usepackage{hyperref}     \hypersetup{%             colorlinks=true,             linkcolor=blue,             filecolor=blue,             urlcolor=blue,             citecolor=blue,             pdfborder=0 0 0,     }     \usepackage{tikz}          % pgfmanual.code.tex in turn inputs     % pgfmanual.prettyprinter.code.tex and pgfmanual.pdflinks.code.tex.     % (I am using pgf 2.10 sources)     \makeatletter          % !!!!     \input{pgfmanual.code} % !!!!     \makeatother           % !!!!          \usepackage{calc} % NEEDED by pgfmanual-en-macros     \input{pgfmanual-en-macros}     \newcommand{\options}[1][options]{\opt{\oarg{#1}}}     \newcommand{\sillymacro}[2][]{        \node [shade, top color = black, bottom color = green,%               text = white, thick, rounded corners,%               font=\bfseries, #1] {#2};     }     \begin{document}        \begin{command}{\sillymacro\options\marg{contents}}           Defining a command via the command environment is supposed           to automatically index it, isn't it?                In fact, now it does!           |\sillymacro| is treated as a link, and I can happily            click on it.           \begin{codeexample}[]              \begin{tikzpicture}                 \sillymacro{Uh-uhhhh! I am fancy}              \end{tikzpicture}           \end{codeexample}         \end{command}        It also works outside, and |\sillymacro| is also highlighted in         the code listing. Great, thanks!        \printindex     \end{document}      And here is the result: ![Working example of auto-linked docs generated with tikz documentation macros](http://i.stack.imgur.com/cDCHa.png)


title: Conditional "if a package is available"

text: I'd like to do something like the following (in pseudo-TeX)               \ifpackageavailable{packagefoo}     \usefoo     \else     \usefooreplacement     \fi      For example, I know that a template file I wrote is used by people who don't have the `mdframed` package. So I want to write:               \ifpackageavailable{mdframed}     \usepackage{mdframed}     \newenvironment{framedbox}...     \else     \usepackage{framed}     \newenvironment{framedbox}...      \fi      Is there anything that provides that kind of functionality?


title: Only \usepackage if the package can be found

text: > **Possible Duplicate:**   >  Conditional "if a package is available" I'm using a package "mcode.sty" that enhances/colors listings output; typesetting will work perfectly without it. However, I'm often typesetting in an environment where I can't include the package file anywhere LaTeX can find it except the current directory. I'd like to include the `\usepackage` statement in my default preamble (I'm using LyX), but often the file won't be there, and LaTeX will quit with an error, even though I have no need for the functionality in my current project. In effect, I'd like to include the package only if the .sty file is in the current directory, or somewhere on the LaTeX path, and not exit if it can't be found. Something like `\begin{ignore_errors} \usepackage{mcode} \end{ignore_errors}`. Is there a way to do this?


title: How to increase counter for \subsection

text: How can I make the first subsection under a section start on "d"? I currently have the following code to get a,b,c,d...:               \renewcommand{\thesubsection}{\alph{subsection}}      and I tried this to make it start on "d":               \setcounter{\thesubsection}{4}      but that did not work. Ideas?


title: MiKTeX Package Manager freezes and crashes when I install new package

text: I am not new to TeX in general, but very new to TeX on Windows. In the past I always had a Linux system at hand to create my documents in TeX. However, I don't have that opportunity anymore and want to create TeX documents on my Windows (7, 64 bit) machine. I looked around for a bit and downloaded ProTeXt (http://www.tug.org/protext). Installation went fine (meaning there were no errors reported by the installer). So I open TeXworks, open a .tex file that I had created a while back and hit "Typeset". Shortly after I am informed that `scrreprt.cls` is missing. So I open the package manager to install `koma-script`. As soon as I hit the `install` button I see a new window that downloads something, however the status bars don't move and the `update statistics` are empty (=no numbers at all). After a few seconds the whole thing freezes and I get another window saying "MiKTeX Package Manager has stopped working". Any kind of help is highly appreciated!


title: renew section command with tabular sections

text: I want to renew the section command so each section will follow by a fully two columns tabular. it seems that it should be like:               \renewcommand{\section}[1]     {      \hfill\newline {#1}:\newline      \begin{tabular}{ll}     }      the problem is `\end{tabular}` which I don't know where should I put it without need of something like _endsection_. any idea?


title: Theorems and Definitions as quotes

text: Most standard styles highlight theorems and definitions using italics. Now this is something I really would like to avoid in my thesis (and generally). Unfortunately, if I just remove this "feature", I am left with the problem that it isn't obvious anymore where a theorem ends and the normal body text continues. I am wondering whether there is a not-too-complicated way to make theorem environments visually like quote environments, i. e. greater horizontal offset. What should I do? An additional question in case this is too easy: What if I don't just want a greater horizontal offset, but also a vertical line on the level of the normal offset going all the way down until the end of the theorem?


title: Why are there no alternatives to TeX, or, why is TeX still used?

text: I'm fairly new to TeX and LaTeX, having been drawn in by the _Big Idea_ — creating a document programmatically. However, my experience of TeX (and its libraries — LaTeX, ConTeXt, …) has been almost entirely unpleasant. My impression is that TeX ( _etc._ ) is essentially a pile of undocumented macros (where even are _functions?_ ) in an unparsable syntax (I am told it's Turing-complete), that very often collapses (most error messages have a mysterious origin), with shaky support for modern frameworks (I have to _read a paper_ on font naming schemes to find how to apply Helvetica?), and no serious opportunity for actual programming (as opposed to braindead markup), with a confusingly fragmented codebase (which binary, distribution, library should I use, and how do they interact?). Given that the Big Idea is a laudable one, and that TeX and friends are far from an ideal implementation of it, I'd like to know: **Why it is that, within the problem domain of programmatic document formatting, TeX is the only serious player? Does no-one have an idea of how do to this better? What would TeX look like if we were to design it from scratch?** (Note: I'm _not_ looking for a flame war; I'm looking for genuine answers.)


title: Applying \lowercase to index entries

text: I would like to sort the index entries independent of case. Initially I was getting (code provided in MWE) the image on the left. So, that _seemed_ like an easy fix: just apply `\lowercase` (uncomment the `\def` in the MWE) but that yields the image on the right: ![enter image description here](http://i.stack.imgur.com/WtZWr.png) ![enter image description here](http://i.stack.imgur.com/nJI1S.png) So, how do I get these sorted alphabetically, and get the two entries for `zero` to be displayed as a sub-entries under a single heading? ## Failed Attempts:   1. I thought this was an explansion issue, so I tried to use              \edef\LowerCaseWord{\lowercase{#2}}     \index{\LowerCaseWord!#1}      but this also yielded results identical to the image on the right.   2. Since a wise member here (who I think no longer wants to be associated with this comment :-)) once alluded that a few carefully placed `\expandafter`s should fix anything I tried this and it also does not change the output:              \edef\LowerCaseWord{\lowercase{#2}}     \expandafter\index{\LowerCaseWord!#1}      ## Code:               %\def\UseLowercase{}% Uncomment to use lowercase          \documentclass{article}     \usepackage{imakeidx}          \ifdefined\UseLowercase% Select whether we use lowercase or not         \newcommand{\IndexTitle}{Index (lowercase)}%     \else         \newcommand{\IndexTitle}{Index}%         \renewcommand{\lowercase}[1]{#1}%     \fi          \newcommand*{\AddIndexEntry}[2]{%         % #1 = indexed term, #2 = word to index this under         \par\noindent         Indexing: #2         \index{\lowercase{#2}!#1}     }%          \makeindex[title={\IndexTitle},columns=1]          \begin{document}         \AddIndexEntry{aardvark}{aardvark}         \AddIndexEntry{Saved by Zero}{Saved}         \AddIndexEntry{Saved by Zero}{Zero}         \AddIndexEntry{zero}{zero}         \printindex     \end{document}


title: Force Big figure of 4x8 subfigures appear in one page

text: I have a big figure of 4x8 subfigures and i want to force it in one page as now it displays around 20 subfigures and the rest don't appear. Update: I have tried writing this in the line:               \includegraphics[height=0.8\textheight]      but it's giving an error               \begin{figure*}[t!]     \includegraphics[height=0.8\textheight]     \centering      This is the current picture: ![problem](http://i.stack.imgur.com/3HY9P.png)


title: adding large curly bracket and black title background

text: I tried to add curly brackate using   1. `\left{` , `\begin{array}{@{}ll}` but no help. What is the way to add large brackate to cover as in image?   2. Is is possible to create black strip as in image behind `Users-schema`? Source code DEMO : https://www.sharelatex.com/project/5374a2ebeb2b8d651828ef64f               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{hyperref}     \usepackage[a4paper, total={6in, 8in}]{geometry}     \setlength\parindent{0pt}     \usepackage{xcolor}     \usepackage{setspace}     \begin{document}          \begin{center}     \textbf {User schema}     \end{center}          \setstretch{1.5}     \textbf {ID : }  \textcolor{red}{ObjectId }- Id do registro \\     \textbf {Name: } \textcolor{red}{ String  } - Name co usuario \\     \textbf {date: } \textcolor{red}{ Date } - Date de Cadastro \\     \textbf {ren\_date: } \textcolor{red}{ Date }  -  Data de           \textbf {email: } \textcolor{red}{ String } - Lorem ipsum dolorsitamet, consecteturadipisicingelit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minimveniam, exercitationullamcolaborisnisi ut aliquipexeacommodoconsequat. Duisautereprehenderit in voluptatevelit esse cillumdolore eu fugiatnullapariatur. Occaecatcupidatat non proident, sunt in culpa quiofficiadeseruntmollit.           \[     \text{accesslog: \textcolor{red}{ Array }}       \left(       \begin{array}{@{}ll}       \left\{\begin{tabular}{l}            \textbf{date}: \textcolor{red}{string}  Data -- da ocorrncia.\\            \textbf{ObjectId}: \textcolor{red}{Usuário} --  que executou.\\            \textbf{action}: \textcolor{red}{String} --  Aço Executada.\\        \end{tabular}\right.\\        ~\\        \left\{        \begin{tabular}{l}              \textbf{date}: \textcolor{red}{string}  Data -- da ocorrncia.\\              \textbf{ObjectId}: \textcolor{red}{Usuário} --  que executou.\\              \textbf{action}: \textcolor{red}{String} --  Aço Executada.\\        \end{tabular}\right.        \end{array}     \right.     \]          \hyperlink{page.2}{\textbf {group\_id : }} \textcolor{red}{ ObjectId } - Id do  grupo.           \pagebreak          \begin{center}     \textbf {Group schema}     \end{center}          \setstretch{1.5}          \textbf {ID : }  \textcolor{red}{ObjectId }- Id do registro \\     \textbf {Name: } \textcolor{red}{ String  } - Name co usuario \\     \textbf {date: } \textcolor{red}{ Date } - Date de Cadastro \\     \textbf {ren\_date: } \textcolor{red}{ Date }  -  Data de           \textbf {email: } \textcolor{red}{ String } - Lorem ipsum dolorsitamet, consecteturadipisicingelit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minimveniam, exercitationullamcolaborisnisi ut aliquipexeacommodoconsequat. Duisautereprehenderit in voluptatevelit esse cillumdolore eu fugiatnullapariatur. Occaecatcupidatat non proident, sunt in culpa quiofficiadeseruntmollit.           \[     \text{accesslog: \textcolor{red}{ Array }}       \left(       \begin{array}{@{}ll}       \left\{\begin{tabular}{l}            \textbf{date}: \textcolor{red}{string}  Data -- da ocorrncia.\\            \textbf{ObjectId}: \textcolor{red}{Usuário} --  que executou.\\            \textbf{action}: \textcolor{red}{String} --  Aço Executada.\\        \end{tabular}\right.\\        ~\\        \left\{        \begin{tabular}{l}              \textbf{date}: \textcolor{red}{string}  Data -- da ocorrncia.\\              \textbf{ObjectId}: \textcolor{red}{Usuário} --  que executou.\\              \textbf{action}: \textcolor{red}{String} --  Aço Executada.\\        \end{tabular}\right.        \end{array}     \right.     \]          \textcolor{blue} { \textbf {group\_id : }} \textcolor{red}{ ObjectId } - Id do  grupo.                \end{document}      result should be like : ![enter image description here](http://i.stack.imgur.com/h0i2r.png)


title: How to use \usepackage[parfill]{parskip} in memoir class?

text: I would like to have a blank line between my paragraphs. In this way, I have decided to use :               \usepackage[parfill]{parskip}      However, it does not work with the memoir class.               \documentclass[a4paper,11pt]{memoir}     \usepackage[T1]{fontenc}          \usepackage{lipsum}     \usepackage[parfill]{parskip}          \begin{document}     \section     lorem non justo. Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus.     Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae     ornare odio metus a mi.     \end{document}      Indeed, I get this error :`/test.tex:6: LaTeX Error: Option clash for package parskip. []` Does anyone can help me please ? Thanks


title: How can I use \vfill in a lstlistings environment?

text: I'd like to do something like this:               \begin{lstlisting}     public do(int whatever} {     \vfill     }     \end{lstlisting}      So basically, I want a method definition and then add spaces in the body of the method until the bottom of the page is reached. If possible I want to do that in one listing, since there are frames around my listings.


title: TeX's algorithms for "breaking paragraph into lines" and "setting the glue"

text: I want to learn more about the implementation of TeX's text-justification algorithm ( _setting the glue_ ). After scanning through ch.12 of Knuth's TeXbook, I'm guessing that _setting the glue_ must consist in a constrained linear program   * whose variables represent the interword glue, and   * whose constraints correspond to shrinks & stretches allowed for each interword glue. However, if my intuition is correct, the linear program in question must get prohibitively large pretty quickly as the length of the document increases, at least, for computers back in the day. Does _setting the glue_ use some heuristic instead? **EDIT** : Thanks to egreg for his answer. However, I realise I should have included the paragraph-making algorithm in my question. I'm still not quite clear on the interplay between   * the paragraph-making algorithm (which, I presume, determines where line breaks occur), and   * the text-justification algorithm (which determines the interword glue). It seems to me that the two problems are not independent. Does the paragraph- making algorithm, in the process of generating line break after line break, not use information about each glue item (natural width, stretch and shrink components), too?


title: Change the \crefrange title once

text: I'm using `cleveref` and want to use `\crefrange` in a German sentence but it doesn't create the correct title for this case: > In den Abschnitte 7.3.1 bis 7.3.3 wurde für den […]               In den \crefrange{subsec1}{subsec2} wurde für den […]      How can I change the title (or is it called label?) once? _edit_ : My desired output would be the following: > In den Abschnitte*n* 7.3.1 bis 7.3.3 wurde für den […] But only for this one instance. Usually the default output is correct.


title: \includepdf only shows first page

text: Using XeLaTeX I am trying to add a PDF to my file. Only the first page the PDF is included in the output file. The following MWE refers to a PDF I created using Apple's TextEdit and 'Save as PDF' from the Print dialog. The contents are simply: 'Page 1', 'Page 2' etc. on each page.               \documentclass{article}          \usepackage{pdfpages}          \title{Minimal Working Example}     \date{}     \author{Author}          \begin{document}     \maketitle          \section{Section 1}     Content          \includepdf{test-pdf}          \end{document}


title: Package for drawing RDF graphs

text: Is there some package to draw nice RDF graphs, such as the one below (taken from there)? Can such a graph (with the same style) be produced in TikZ? ![enter image description here](http://i.stack.imgur.com/RbJf2.png)


title: labeling edges in tikz

text: I have the following graph, where I want to label the edges. Is there a way I can integrate this in to the draw command?               {     \begin{figure}     \begin{center}     \begin{tikzpicture}[every node/.style={circle, draw, scale=.8, fill=gray!50}, scale=1.0, rotate = 180, xscale = -1]          \node (1) at ( 2.55, 3.0) {1};     \node (2) at ( 3.87, 0.92) {2};     \node (3) at ( 6.85, 0.92) {3};     \node (4) at ( 8.17, 3.0) {4};     \node (5) at ( 6.85, 5.0) {5};     \node (6) at ( 3.87, 5.0) {6};     \node (7) at ( 10.2, 3.0) {7};     \node (8) at ( 12.2, 3.0) {8};          \draw (2) -- (1);     \draw (3) -- (2);     \draw (4) -- (3);     \draw (7) -- (4);     \draw (8) -- (7);     \draw (6) -- (1);     \draw (5) -- (6);     \draw (4) -- (5);          \end{tikzpicture}     \caption{Weight 2}     \label{fig:wt2}     \end{center}     \end{figure}     }


title: Add leading zero to the items listed by a custom etaremune and enumerate

text: How can I add leading zeros in the items that are listed by the packages `etaremune` and `enumerate`? For example, I would like to have the labels to be:               A01, A02, A03, ..., A09, A10      Here is an example code. How can I add the leading zeros locally and globally?               \documentclass{article}          \usepackage{etaremune}     \usepackage{enumitem}     \setlist[enumerate]{nosep} % To remove the spacing               \begin{document}     First list          \renewcommand*{\labelenumi}{A\theenumi.}     \begin{etaremune}[topsep=0pt,itemsep=0pt,partopsep=0pt,parsep=0pt,]          \item item 10         \item item 09         \item item 08         \item item 07         \item item 06         \item item 05         \item item 04         \item item 03         \item item 02         \item item 01     \end{etaremune}          Second list     \begin{enumerate}[label={M\arabic*.}]         \item item 01         \item item 02     \end{enumerate}          Third list     \begin{enumerate}[label={M\arabic*.}, resume]         \item item 03         \item item 04     \end{enumerate}          \end{document}      Here is ![enter image description here](http://i.stack.imgur.com/bGfFn.png)the output:


title: Bibliography entries do not appear

text: I am using natbib in order to insert the citations in my paper. Now, I am trying to include each chapter of my thesis in a master paper using the command `include`. I have three papers, which I will place (by copy pasting them) in the main file, and three bibliographies. In the **_master file_** I put something like:               \begin{document}     \thispagestyle{empty}           \include{cover}               \include{main}          \newpage     \bibliographystyle{aer}     \bibliography{paper_1,paper_2,paper_3}      This section with the bibliography is well created, I can see the names, but in the main text, the names do not appear, they give me something like this `????`. How can this be fixed?


title: Counter of arguments and ifnum

text: Why is this `ifnum` always true? `\@tempcntb` is 5, shouldn't it instead print `\tmp` for the last argument? Also, I don't understand what `m@ne` does, because this certainly doesn't advance the counter by 1 (It's going from outside to inside the nested `\tmp`'s)               \documentclass{article}     \usepackage{color}          \makeatletter     \newcommand\metafunc[1]{{     \count@\z@     Number of arguments: \the\@tempcntb \par     \@tempcnta\z@\relax     \@tempcntb=\count@     \@for\tmp:=#1\do{\advance\count@\@ne}     \ifnum\@tempcnta=\@tempcntb         \@for\tmp:=#1\do{%         \advance\@tempcnta\@ne         \textcolor[RGB]{\the\numexpr255*\@tempcnta/(\count@)\relax,                      0,                      \the\numexpr255-(255*\@tempcnta/(\count@))\relax}%                     {\tmp(}}\relax         \@tempcnta\count@          \@for\tmp:=#1\do{%         \textcolor[RGB]{\the\numexpr255*\@tempcnta/(\count@)\relax,                      0,                      \the\numexpr255-(255*\@tempcnta/(\count@))\relax}%                     {)}\relax         \advance\@tempcnta\m@ne     }     \else     \@for\tmp:=#1\do{\tmp}     \fi     }}     \makeatother               \begin{document}          \metafunc{Banana,Stool,Another banana,chair,peanut}          \end{document}


title: endfloat, float - use with newfloat types

text: Does anyone know how I can get the the `endfloat` package to work with new float types defined using `\newfloat` (float package), for example:               \newfloat{map}{htbp}{lom}     \floatname{map}{Map}     \restylefloat*{map}          \newfloat{photo}{htbp}{lop}     \floatname{photo}{Photo}


title: Package options mtplusscr and mtpluscal don't work in MTPro2 complete

text: If I use them I don't get the MTMS and MTMSB fonts as described in the guide just the old times new roman. Anyone seen this before? **EDIT:** Minimal Example:               \documentclass[12pt]{article}       \usepackage[mtplusscr]{mtpro2}         \begin{document}             $$ \mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ} $$        \end{document}      And in the log file (which is way too long to reproduce here) it says that:               No file Umtms.fd. on input line 5. LaTeX Font Warning: Font shape `U/mtms/m/n' undefined.


title: Understanding a \@for loop

text: I'm having trouble with a `\@for` loop. I've got a macro that takes a comma delimited list and puts each element into a row of an array. When I do this using a `\@for` loop, I get an extra row that I don't understand. I can manually get rid of it with a negative space, (as in the commented line below) but that can't be the right way to do it, so I must be doing something wrong. Here's a minimal example. For comparison, if I construct what I expect the result of the loop to be manually, the extra row doesn't appear.               \documentclass{article}     \usepackage{amsmath}     \makeatletter     \newcommand{\fbun}[1]        {\ensuremath{\left[\begin{array}{c}           \@for\xx:=#1\do {\text{\xx}\\}     %     \\ [-2.75ex] % why is this required?           \end{array}\right]}}     \makeatother     \begin{document}     $\left[\begin{array}{c}           A\\           B\\           C\\           D\\           \end{array}\right]$     % same array, but generated by a macro     \fbun{A,B,C,D}     \end{document}      ![output of code](http://i.stack.imgur.com/S7kIk.png)


title: How can I convert a TeX document to Texinfo format?

text: I have a straight TeX document, and I'd like to produce from it a Texinfo document. Does there exist a tool that does this, or a set of guidelines? TeX and Texinfo seem to be closely related, so it feels like it should be possible, but I can't seem to find anything that does this conversion in particular. If there is no general tool for that, how much information am I likely to lose in going from TeX to XML to Texinfo? The document in question is the TeX source of the Mongrel2 manual, for reference - so it's a non-trivial chunk of TeX, but also guaranteed not to be a malformed or perverse chunk of TeX.


title: How to use SIrange in math mode

text: I cannot figure out which of the `siunitx` font options is the correct to typset the rangephrase when using `SIrange` in math mode the same way as in text mode. See the MWE               \documentclass{book}     \usepackage{siunitx}      \sisetup{mode=text} % does NOT have an effect here     \begin{document}     \SIrange{1}{2}{\watt}\\     $\alpha=\SIrange{1}{2}{\watt}$     \end{document}


title: Forcing a new page for first chapter only in article style under memoir class

text: I am using memoir class with article style as I want the short chapters to run continuously. I would like the first chapter alone to start on a recto page. `\newpage` does not force an extra blank left page which would solve the problem. Would be grateful if some LaTeX guru could help.


title: How to detect if \thepage is undefined?

text: The `sig-alternate` class by default disables page numbers, which breaks `mparhack` (amongst other things). How can I include tex code only if `\thepage` is properly defined? I tried `\ifcsname` and `\ifcsempty` of `etoolbox`, but neither worked. **MWE:**               \documentclass{sig-alternate}          %\pagenumbering{arabic}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{mparhack}          \begin{document}          \title{A Sample {\ttlit ACM} SIG Proceedings Paper in LaTeX}          \numberofauthors{1}      \author{     \alignauthor     Ben Trovato\titlenote{Dr.~Trovato insisted his name be first.}\\            \affaddr{Institute for Clarity in Documentation}\\            \affaddr{1932 Wallamaloo Lane}\\            \affaddr{Wallamaloo, New Zealand}\\            \email{trovato@corporation.com}     }     \date{30 July 1999}          \maketitle          \section{Introduction}          The \textit{proceedings} are the records of a conference.     \end{document}


title: Placing glossary entries inside \section titles

text: In my document, some glossary entries appear within the section titles. E.g.:               \documentclass{article}         \usepackage{glossaries}         \makeglossaries         \begin{document}             \tableofcontents             \section{\newglossaryentry{1}{name=somename,description={Description.}}\gls{111}}         \printglossaries     \end{document}      When compiling for a second time, it reports: > Package glossaries Error: Glossary entry `1' has already been defined. I think maybe it appears in the table of contents, then in the page, then in the headings within the page, so it returns this error.   * How can I place glossary entries inside `\part`'s, `\chapter`'s, and `\section`'s while displaying a table of contents and page headings with the title of the current section?   * The page number listed in the glossary should point to the first appearance of the entry within the title of the chapter as it appears within the page (i.e. not point to the location in the table of contents).


title: Changing the colour of the text with itemize

text: I'm creating my own `beamer` theme. I can change the colour of the bullets using `\setbeamercolor{}`. But how can I change the colour of the text after the bullets? I would like to use it in a `.sty` file.               \documentclass[10pt]{beamer}          \definecolor{INBObrown}{RGB}{118, 91, 52}     \definecolor{INBOreddishbrown}{RGB}{182, 101, 70}     \definecolor{INBOblue}{RGB}{86, 152, 200}     \setbeamercolor{item}{fg=INBObrown}     \setbeamercolor{subitem}{fg=INBOreddishbrown}     \setbeamercolor{subsubitem}{fg=INBOblue}          \begin{document}          \begin{frame}       \begin{itemize}         \item This text should be in colour INBObrown         \begin{itemize}           \item This text should be in colour INBOreddishbrown           \begin{itemize}             \item This text should be in colour INBOblue           \end{itemize}         \end{itemize}       \end{itemize}     \end{frame}          \end{document}


title: Option unicode=true with hyperref

text: Is there a drawback when using the option `unicode=true` with the package hyperref and the engines PDFTeX, XeTeX and LuaTeX? In other words, can a portable document always have `\usepackage[unicode=true]{hyperref}`?


title: Problems understanding definition of \newif

text: Reading http://profs.sci.univr.it/~gregorio/introtex.pdf, I have come across the definition of `\newif` on page 75:               \def\newif#1{\@ifdefinable{#1}{\@newif#1}}     \def\@newif#1{\count@\escapechar \escapechar\m@ne     \expandafter\expandafter\expandafter     \def\@if#1{true}{\let#1=\iftrue}%     \expandafter\expandafter\expandafter     \def\@if#1{false}{\let#1=\iffalse}%     \@if#1{false}\escapechar\count@} % the condition starts out false     \def\@if#1#2{\csname\expandafter\if@\string#1#2\endcsname}     {\uccode‘1=‘i \uccode‘2=‘f \uppercase{\gdef\if@12{}}} % ‘if’ required      I'm trying to understand how it works by following its expansion. So imagine I type `\newif\iffoo`.   1. The first expansion should be              \@ifdefinable{\iffoo}{\@newif\iffoo}      therefore checking if there is an already defined `\iffoo` and then, if there is none, passing `\iffoo` to `\@newif`. And that's where my problems begin.   2. `\@newif` should expand into:              \count@\escapechar \escapechar\m@ne     \expandafter\expandafter\expandafter     \def\@if\iffoo{true}{\let\iffoo=\iftrue}%     \expandafter\expandafter\expandafter     \def\@if\iffoo{false}{\let\iffoo=\iffalse}%     \@if\iffoo{false}\escapechar\count@      Now `\count@` is a counter (`\countdef\count@=255`) and so is `\m@ne` (`\countdef\m@ne=22 \m@ne=-1`), and `\escapechar` contains the code point of `\`, being defined as `\escapechar=\\` (I can't put the backtick after the `=` because the site's markup causes trouble). So `\count@\escapechar`, I guess, gives `\count@` that code, and `\escapechar\m@ne` makes `\escapechar` `-1`. That's for later, in `\if@`. Then we have the sequence of `\expandafter`s. Now the first one makes TeX skip the second one, and see the third one, which makes it skip `\def` and expand `\@if`, which we will get to later; then TeX (I guess) remembers it had skipped through an `\expandafter`, go back to it and execute it; this means `\def<expansion of \@if\iffoo{true}>{\let\iffoo=\iftrue}` is delayed, and we enter a new sequence of `\expandafter`s; the first one is skipped and stored away due to the left- over `\expandafter` which delayed the just-mentioned `\def`; so the second one is executed, the third one consequently stored away, and so we get a `\def` executed which should redefine `\if@` but that can't be! So the definition of the expansion of `\@if\iffoo{true}` as `\let\iffoo=\iftrue` takes place before the second `\expandafter` of the first sequence is executed, but why? Well in that assumption we get to expanding the second `\@if` and defining its expansion as `\let\iffoo=\iffalse`, then we have one/two `\expandafter`s; if there are two, they should elide, making me wonder why bother putting three both times if one both times is sufficient, whereas if there is one we get `\count@` and then `\escapechar`, so we have a useless instruction which is the repetition of one at the beginning, `\count@\escapechar`. So there must be two, right? And eliding, right? So why bother putting three?   3. And now the `\@if`. We have, as said above:              \@if\iffoo{true}      so the expansion should be:              \csname\expandafter\if@\string\iffootrue\endcsname      The `\expandafter` leaves `\if@` as it is, and expands the `\string`, which makes `\iffootrue` become `iffootrue`, since `\escapechar` is `-1<0`; so we get to:              \csname\if@iffootrue\endcsname      right?   4. Finally, the line `{\uccode‘1=‘i \uccode‘2=‘f \uppercase{\gdef\if@12{}}}` makes `i` the uppercase of `1` and `f` the uppercase of `2`, probably to make sure `\if@` in the `\uppercase` doesn't get taken for `\if@if`, since we're in `\makeatletter`, but split off because `1` and `2` cannot be put in a control sequence and are then turned into `i` and `f` by `\uppercase`. So here's the `\if@`: it gets expanded to `{}`, leaving just:              \csname footrue \endcsname      (or `foofalse`). So we understand the actual reason of the `\expandafter` in the `\csname…\endcsname`: to delay the expansion of the `\if@`, which is global since it's `\gdef`, so is defined in a group to leave the `\uccode`s local but is set to global to be used back up in those `\csname…\endcsname`s.   5. Finally, of course, we want `\escapechar` back to its original value, which was stored in `\count@`, and is restored at the end of everything. After all these reflections, I seem to have been left with only one question mark: why three `\expandafters` per `\if@` control sequence definition? So the question finally is: Is there anything wrong in what I have said, what is it, and why are there those three `\expandafter`s up there?


title: Make all figures and tables framed by default?

text: > **Possible Duplicate:**   >  Rounded corner colored box around figure I'm interested in having all of my `\begin{figure}` and `\begin{table}` environments automatically get framed. Is there any way to do this? I know that I can use the solution in Border or frame around figure, but that doesn't change the default behavior. Is there any way to do that?


title: Background color boxes around complete figure in LaTeX

text: > **Possible Duplicate:**   >  Rounded corner colored box around figure   >  Make all figures and tables framed by default? I'd like to make colored boxes (a light graytone) around my figures including the figure description in order to better enhance it from regular text. Unfortunately, I don't have any idea how to accomplish this. Maybe someone can help?


title: Is there a good business plan template?

text: I'm looking for a good business plan LaTeX template for a web startup. In my opinion it shouldn't have a standing out "classic" look - for example, fonts like Caslon, Garamond or Computer Modern ooze too much authority for a small company in my eyes; however, I'm open to everything. Any suggestions / pointers greatly appreciated!


title: Background transparency for PDF/SVG

text: I am using lua/xe/latex to generate a logo as a PDF and convert it to an SVG using pdf2svg for use on a web page. I would like to have a transparent background for the PDF and SVG. The transparent package seems to work only on text colours but not on the background. I have read that the TikZ/PDF suite will allow transparent backgrounds at http://www.latex-community.org/forum/viewtopic.php?f=5&t=697 and need to investigate that further. Meanwhile, I thought I should find out if there is a simple and easy solution like:               \pagecolor{transparent}      that may be invoked with some package. FWIW, I have previously gone down the road of converting the PDF to a PNG and adding transparency to the background colour(s) using the ImageMagick suite. I do not want to go down that path again: hence my attempt at generating an SVG logo.


title: Are there any good general typesetting books / references?

text: I would like to learn more about typesetting, the accepted best practices, rules and tricks used in books, letters, resumes etc. For example, what are the usual left and right margins? Line spacing? When to use what type of justification? Any good books or links?


title: Change key bindings in TeXworks

text: Some of default key bindings in TeXworks are completely unusable for me. I use a German keyboard and the comment keys are `Ctrl`+`Shift`+`]`, which on my keyboard can only be realized with `Ctrl`+`Shift`+`AltGr`+`9`. This however is not accepted by TeXworks. However I could not find any way to change the key binding. Is this configurable somehow? Further I would like to have "% " (percent plus space). I use TeXworks for editing `.dtx` files.


title: How to automatically include command line session output in documents?

text: When I write documents that contain source code examples and snippets the listings package is a great solution to include such things. Especially with the `\lstinputlisting` command and `firstline`/`lastline` options you don't have to do copy/pasting and you are able to easily test your examples. But what about the integration of command line sessions? For example a `bash` session, a session in the Haskell interpreter `hugs` or in the Python shell? Ideally I would like to be able to write something like this in LaTeX:               \begin{hugs}[nostartbanner]     take 3 [1..]     reverse "hello world"     \end{hugs}      And get following output in my document:               Hugs> take 3 [1..]     [1,2,3]     Hugs> reverse "hello world"     "dlrow olleh"      (perhaps plus some syntax highlighting) That means such an environment should automagically start an external shell (e.g. hugs) and should paste the session output in the document. And for bonus points it should do some caching of the output. Such an approach would help to reduce typos in anticipated output and copy-n- pasting orgies (which are of course error prone). Also while writing documentation for a comment line program or a shell that is still in rapid development you don't have to manually check all your existing examples when the output is automatically integrated in the LaTeX document. How can I solve this with LaTeX? I found Listing language for “screen session”, but this question is just about the syntax highlighting part.


title: How to compute xslant and yslant

text: There must be an easy way to compute the required values of `xslant` and `yslant` to obtain the text in the "correct plane". Below I have guessed at then, but that is a very tedious process. The desired results should be that the following lines should not have any magic numbers:               \tikzset{yz slant style/.style={red,    yslant=-0.5,  xslant=-0.1}}     \tikzset{xy slant style/.style={blue,   yslant=-0.25, xslant=1   }}     \tikzset{xz slant style/.style={orange, yslant=1,     xslant=0.05}}      and instead should be based on the values of `\xc`,`\xs`,`\yc`, and `\ys` (or `\elevation` and `\anglerot`). My guessed value produce something which I think are _close_ : ![enter image description here](http://i.stack.imgur.com/lOXuf.png) ## Notes:   * I realize that this is more of a math question, but without fully understanding how `tikz`/`pgf` works I don't know how to compute them.   * The preamble code is from 3D Arrow Tips for TikZ/pgfplots. ## Code:               \documentclass{scrartcl}     \usepackage{xcolor}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}          %% http://tex.stackexchange.com/a/51388/4301     \newcommand*\elevation{14}     \newcommand*\anglerot{-50}     \pgfmathsetmacro\xc{cos(\anglerot)}       \pgfmathsetmacro\xs{sin(\anglerot)}        \pgfmathsetmacro\yc{cos(\elevation)}      \pgfmathsetmacro\ys{sin(\elevation)}      \newcommand*\axexthreed{\xs*1cm,-\xc*1cm}      \newcommand*\axeythreed{\yc*1cm,-\ys*1cm}     \newcommand*\axezthreed{0cm,1cm}           \newcommand*{\CoordX}{3}%     \newcommand*{\CoordY}{4}%     \newcommand*{\CoordZ}{5}%          %% How do I compute these:     \tikzset{yz slant style/.style={red, yslant=-0.5, xslant=-0.1}}     \tikzset{xy slant style/.style={blue, yslant=-0.25, xslant=1}}     \tikzset{xz slant style/.style={orange, yslant=1, xslant=0.05}}                    \begin{tikzpicture}[x = {(\axexthreed)},                         y = {(\axeythreed)},                         z = {(\axezthreed)},                         ]              \draw[black, ultra thick,-latex] (-1,0,0) -- (\CoordX,0,0) node[black,left=6pt]  {$x$};          \draw[black, ultra thick,-latex] (0,-1,0) -- (0,\CoordY,0) node[black,right=6pt] {$y$};          \draw[black, ultra thick,-latex] (0,0,-1) -- (0,0,\CoordZ) node[black,above=6pt] {$z$};                     \foreach \x in {1,...,\CoordX} {             \draw [thin, draw=gray] (\x,\CoordY,0) -- (\x,0,0)                 node [left, yz slant style] at ($(\x,0,0)+(-0.2,0,0)$) {\x};         }         \foreach \x in {1,...,\CoordY} {             \draw [thin, draw=gray] (\CoordX,\x,0) -- (0,\x,0)                 node [right, xy slant style] at ($(0,\x,0)+(-0.4,-0.3,0)$) {\x};         }         \foreach \x in {1,...,\CoordZ} {             \draw [thin, draw=gray] (\CoordX,0,\x) -- (0,0,\x)                 node [right, xz slant style] at ($(0,0,\x)+(0,-0.0,-0.2)$) {\x};         }          \end{tikzpicture}          \end{document}


title: Bibtex Automatic replacement of 4+ authors with et al.

text: When copying bibtex entries from journal websites, they usually include a lot of information, and not all of it is necessary depending on the journal you are submitting the paper too. Currently I have two bib files, one with the full citation as taken from the journal page, and the other with the shorthand that I manually entered. Is there an automatic way to get bibtex to refactor bibliographies? The citation list is starting to get rather large, and so I would like to avoid just copying the main bib file and trimming down the fields by hand. I've heard of people holding on to 4 or 5 bib files with different citation styles, but if you have 30-40 references, keeping track of 150+ references becomes untenable. More specifically I want the bibliography to ignore title entries and automagically replace 4+ authors with the first author + et al. If it matters, I'm looking to submit to an AIP journal and want to follow their style manual.


title: Why is the quote environment defined as a list?

text: In the standard LaTeX classes the quote and quotation environments are defined as lists. Is there a particular reason for this? After all they do not look like lists!


title: Redundancy in bib file: conditionally suppress url if same as doi?

text: Mathscinet gives bibtex entries with both a `doi` and a `url` field included. Typically they look something like               @article {some-article,        […]         DOI = {10.1016/j.apal.2008.12.003},        URL = {http://dx.doi.org/10.1016/j.apal.2008.12.003},     }      I'm using `amsalpha.bst`, modified with `urlbst` to process both these fields. Of course, this means that they both appear, completely redundantly, in my bibliography! My question is: what's the principled way to deal with this? Here are the options I've thought of so far:   * Modify the bib file so it checks for this redundancy, and doesn't typeset the url in such cases. This seems ideal if it's possible; has anyone already done something like this? If not, is it likely to be doable by someone with a little programming experience but no existing understanding of .bst files?   * Use a bibstyle that typesets one of `url` and `doi` but not both. Not ideal: other bib entries might have only one but not both, or might have a url different from the doi.   * Comment out (or delete) the `url' field by hand, in the bib file, in these cases. This is what I'm currently doing. Seems a little clunky; also, somewhat violates “separation of form from content”: having the fields the same is correct as content, it’s just inappropriate for them then to both be typeset. Related question: How to get DOI links in bibliography


title: \HAR@checkdef alternative in natbib

text: In `harvard` package it is possible to customise missing citations by renewing a special command called `\HAR@checkdef`. Here is an example:               \usepackage{harvard}     \usepackage{pdfcomment}                  %% Tooltips over text with \pdftooltip     \bibliographystyle{apsr}                 %% (Smith, 2000)     \makeatletter                            %% Replacement of ? with ?? and a tooltip for broken citations (eases problem search in pdf)     \renewcommand{\HAR@checkdef}[2]{\@ifundefined{HAR@df@#1}{%         \saveexpandmode\expandarg\StrSubstitute{#1}{_}{\_}[\escapedkey]\restoreexpandmode%         \pdftooltip{??}{\escapedkey}\@warning{Citation '#1' on page \thepage \space undefined}}%         {#2}%     }     \makeatother      This code replaces a single stanard bold question mark with a double question mark and adds a tooltip into a PDF: ( **?** ) → (??). By using two question marks as a symbol for something incomplete or wrong I can quickly do `CTRL+F ??` in a large document and instantly assess its readiness. I've recently moved from `harvard` to `natbib` as it has more options for various brackets around citations, but now I can’t make this trick with a double question mark work again. What command should I renew or add to be able to customise broken citations in a `natbib`-using document?


title: tikzpicture log-log histogram

text: I am trying to create a graph with TikZ similar to this image (link: http://www.flickr.com/photos/68902462@N08/8340520199/in/photostream) ![enter image description here](http://i.stack.imgur.com/wy4wv.jpg) It is a histogram whose axes are in logarithmic scale. I would like to have the numbers in exponential format. Could someone help me how to do it? My data for histogram is as follows:               (-INFINITY)-(1e-8): count=0     (1e-8)-(1e-7):      count=27133     (1e-7)-(1e-6):      count=17     (1e-6)-(1e-5):      count=95     (1e-5)-(1e-4):      count=224     (1e-4)-(1e-3):      count=1060     (1e-3)-(1e-2):      count=6900     (1e-2)-(1e+1):      count=34402     (1e+1)-(1e+2):      count=149564     (1e+2)-(1e+3):      count=877     (1e+3)-(+INFINITY): count=0      I would be grateful for any help.


title: New to TeX; issue with compiling

text: I keep getting the compiling error >file ended while scanning use of \frac. I can't see any missing {}, so I'm not sure what to do.               \documentclass[]{scrreprt}     \usepackage{geometry}     \begin{document}          Molar Mass of Nitrogen     \begin{math}     \\ Bulb Volume: 213.7 cm^{3} = .2317 L     \\ Internal bulb pressure: 20 inHg = 508 mmHg = .508 bar     \\ Temperature: 294.2 K     \\ M = \frac{\rho}{P}RT     \\ \rho = \frac{.158 g}{.2137 L} = .739\frac{g}{L}     \\ M = \frac{.739 \frac{g}{L}}{.508 bar} * .083144 \frac{L*bar}{mol*K} * 294.2 K = 35.6 \frac{g}{mol}          \\ Calculation of Volume by van der Waals Equation with Successive Approximations     \\ V = \frac{nRT}{P + \frac{n^{2}a}{V^{2}}} + nb     \\ a = 1.408 \frac{L^{2}*bar}{mol^{2}}     b = .03913 L     \\ V \approx \frac{nRT}{P} + nb \approx \frac{nRT}{P}     \\ n = \frac{m}{M} = \frac{.158 g}{21.35 \frac{g}{mol}} = 7.4*10^{-3} mol     \\ V = \frac{7.4*10^{-3} mol * .083144 \frac{L*bar}{mol*K} * 294.2 K}{.508 bar} = .2138 L     \\ V = \frac{7.4*10^{-3} mol * .083144 \frac{L*bar}{mol*K} * 294.2 K}{.508 bar             + \frac{(7.4*10^{-3} mol)^{2}*1.408 \frac{L^{2}*bar}{mol^{2}}} {(.2138 L)^{2}}             + 7.4*10^{-3} mol * .03913 L = .2137 L     \end{math}     \end{document}                This is for a calculations addendum to an undergraduate chemistry lab. I figured it would be worth the time investment to learn laTeX. It's already significantly faster to do calculations in it than word, if only I can get around these compiling errors. Relevant log text: > Runaway argument? {.508 bar + \frac {(7.4*10^{-3} mol)^{2}*1.408 \frac > {L^{2}*bar}{mol^\ETC. ! File ended while scanning use of \frac.


title: How do I get a pfgplot figure to take up the whole page?

text: So, I'm making figures using `pgfplots` and I have a problem: They don't centre on the page well. I'd rather stick to `article` for ease of printing and so I can have multiple figure in the same document (If I have multiple spectra of the same compound, for example, it would be nice to have them all in one place). However, when I compile it, the figure doesn't go all the way our to the right margin, which is quite annoying. How do I scale the figure to automatically use the whole page, but not have the axis lables go off the page or such? I have a MWE that I used a tiny subset of my data in. I also pared it down (I normally use an external file for the data) and removed the labels and such to make it minimal):               \documentclass[letterpaper]{article}     \usepackage[margin=0.5 in,landscape]{geometry}     \pagestyle{empty}          %Graphics stuff here     \usepackage{pgfplots} %For graphing data     \pgfplotsset       {         compat                   = newest,         every tick/.append style = thin,         width= 0.95 \textwidth,         height= 0.95\textheight       }     \pgfkeys{/pgf/number format/set thousands separator = }          %Science stuff here     \usepackage[]{siunitx} %Adds si units and others by name- See the manual.     \sisetup{mode = text}          \begin{document}     \begin{tikzpicture}     \begin{axis}         [           x dir               = reverse,           xlabel              = Frequency (\si{\per\centi\metre}),           title                 = Demo,           xticklabel style      =   {rotate=270},           yticklabels           = {},         ]     \addplot[color = black, mark = none]     coordinates {     ( 3.983730e+003, 9.824165e+001 )     ( 3.984213e+003, 9.854189e+001 )     ( 3.984695e+003, 9.890483e+001 )     ( 3.985177e+003, 9.878275e+001 )     ( 3.985659e+003, 9.859460e+001 )     ( 3.986141e+003, 9.835152e+001 )     ( 3.986623e+003, 9.794798e+001 )     ( 3.987105e+003, 9.803477e+001 )     ( 3.987587e+003, 9.864641e+001 )     ( 3.988070e+003, 9.895673e+001 )     ( 3.988552e+003, 9.910266e+001 )     ( 3.989034e+003, 9.866454e+001 )     ( 3.989516e+003, 9.837458e+001 )     ( 3.989998e+003, 9.857204e+001 )     ( 3.990480e+003, 9.883611e+001 )     ( 3.990962e+003, 9.891921e+001 )     ( 3.991444e+003, 9.846350e+001 )     ( 3.991927e+003, 9.804715e+001 )     ( 3.992409e+003, 9.815513e+001 )     ( 3.992891e+003, 9.844558e+001 )     ( 3.993373e+003, 9.842175e+001 )     ( 3.993855e+003, 9.843822e+001 )     ( 3.994337e+003, 9.828293e+001 )     ( 3.994819e+003, 9.791080e+001 )     ( 3.995301e+003, 9.774442e+001 )     ( 3.995783e+003, 9.783126e+001 )     ( 3.996266e+003, 9.788599e+001 )     ( 3.996748e+003, 9.826096e+001 )     ( 3.997230e+003, 9.857933e+001 )     ( 3.997712e+003, 9.843895e+001 )     ( 3.998194e+003, 9.839955e+001 )     ( 3.998676e+003, 9.863584e+001 )     ( 3.999158e+003, 9.872655e+001 )     ( 3.999640e+003, 9.836100e+001 )     ( 4.000123e+003, 9.836080e+001 )};     \end{axis}     \end{tikzpicture}          \end{document}


title: Drawing on multiple images inside the same tikzpicture, how to get the right transformation of coordinates?

text: Following _Drawing on an image with TikZ_ , I've had many succesful instances of drawing on a picture with _TikZ_. However, now I have a `tikzpicture` environment with _several_ graphics, and I want to draw on each of them. However, it appears the solution offered by _Drawing on an image with TikZ_ only works for pictures centred at (0, 0), because if I try to draw on my second picture, the coordinates do not behave as expected:               \documentclass[final, 12pt]{standalone}     \usepackage{tikz}     \newcommand{\helplines}[0]{     \draw[help lines,semithick,xstep=.1,ystep=.1] (0,0) grid (1,1);     \foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }     \foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; }     }     \begin{document}%     \begin{tikzpicture}%     \node[anchor=south west,inner sep=0] (image1) at (0, 0)         {\rule{3cm}{3cm}};     \begin{scope}[x={(image1.south east)},y={(image1.north west)}]      % draw stuff      %\helplines     \end{scope}     \node[anchor=south west,inner sep=0] (image2) at (image1.south east)         {\rule{3cm}{3cm}};     \begin{scope}[x={(image2.south east)},y={(image2.north west)}]      \helplines      % draw more stuff, but coordinates do not map as desired     \end{scope}     \end{tikzpicture}     \end{document}      Result: ![Not the desired effect](http://i.stack.imgur.com/tj4N7.png) I'd like a transformed coordinate system with the origin at the bottom left at the picture and point (1, 1) at the upper right. This works for the picture located at (0, 0), but not for the image located immediately to the right. Why not, and how do I achieve the desired effect?


title: Disable syntax highlighting in Texmaker

text: Sorry for an obvious one, but I'm using Texmaker as my editor and the syntax highlighting has broken down after adding a `tikzpicture` and is making it very hard to actually see the content. (Everything is green as if it were mathematical notation). Does anyone know how to turn it off?


title: how to write théorème instead of theorem in beamer presentation

text: I am doing a math presentation in beamer. How can i have "théorème" written instead of "theorem" and "définition" instead of "definition" ? This is what i have as of now :               \documentclass[11pt]{beamer}     \usetheme{Warsaw}     %\setbeamertemplate{theorems}     \usepackage[utf8]{inputenc}     \usepackage[french]{babel}     \usepackage[T1]{fontenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     %\author{}     \title{ccc}     %\setbeamercovered{transparent}      \begin{document}     %\logo{}      \institute{}      \date{01/06/2014}      %\subject{}                          \def\O{\mathcal O}     \def\Q{\mathbb Q}     \def\R{\mbox{$\mathbb R$}}     \def\Z{\mathbb Z}     \def\C1{\mathbb C}


title: Spacing around table and figure environments

text: I've got `table` and `figure` environments, some placed "here" with `h` and some arranged automatically. But all together I don't like the spacing above and below the `figure` and `table` environments. I searched the internet and found tips to set `abovecaptionskip` and `belowcaptionskip`. Well since my tables and figures all have a caption below the actual `table`/`figure` `belowcaptionskip` allows me to set the `\vspace` between `table`/`figure` and the following text. But `abovecaptionskip` obviously just gives me `\vspace` between the `table`/`figure` and the caption, but not between the above text and the `table`/`figure`. How to set the `\vspace` above and below `table`/`figure` correctly then?


I've just started working with `pgfplots` and I'm getting good results, but I'm having difficulties getting this one done in LaTeX: ![Bell curve with multiple x-axes and annotations](http://i.stack.imgur.com/gWJwQ.png) The curve itself is not a problem, but the multiple x-axes (I don't need the top one, just the middle and the bottom ones) and especially the "68.2%" right in the middle of the plot just won't work. **Here's what I got so far:** ![My try](http://i.stack.imgur.com/tyYJ4.png)                   \pgfmathdeclarefunction{gauss}{2}{%         \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%             }              \begin{tikzpicture}              \begin{axis}[           hide y axis, tick align=outside,           domain=-3:3, samples=50,           axis lines*=left, xlabel=$IQ-Werte$, ylabel=$~$,           height=5cm, width=13cm,           xtick={-2,-1,0,1,2}, ytick=\empty,           xticklabels={%             $70$,             $85$,             $100$,             $115$,             $130$}                 ]                \addplot [thick,black!50!black] {gauss(0,1)};           \addplot [fill=black!10, domain=-1:1] {gauss(0,1)} \closedcycle;              \end{axis}         \end{tikzpicture}


title: auto-pst-pdf produces a confusing error message

text: Actually I don't want to use `auto-pst-pdf` forever. But Harish Kumar (in his comment) requested to use it for the sake of simplicity. I tried it several decades ago and it did not work. The MWE below is the example I tried and failed.               \documentclass[pstricks]{standalone}     \usepackage{pst-plot}     \usepackage{auto-pst-pdf}     \psset     {         unit=\psrunit,         polarplot,         algebraic=true,         plotpoints=1000,     }          \begin{document}     \multido{\i=1+1}{25}{%     \begin{pspicture}(-3,-3)(3,3)     \pscircle[linestyle=dashed](0,0){2}     \psplot[linecolor=red]{0}{TwoPi}{2+.5*cos(\i*x)}     \end{pspicture}}     \end{document}


title: Any known barriers preventing interactive use of Metafont

text: Does anyone know of any reason why it would be difficult/impossible to build an interactive user interface for Metafont ? I'm not talking about a "drawing" interface where you drag control points around the screen (like Fontographer, etc). But, rather, a system that would allow interactive adjustment of the font parameter values, with near-real-time display of some sort of preview (a single character, or some chosen group of characters). Some conceivable reasons why this might be impossible are: (1) MF rasterization is too slow to support this type of interactive work (2) The internal architecture of the system is essentially "batch job" oriented, and can not support this sort of "incremental" editing (3) The code is impossible to understand Are these reasons valid? Any other known roadblocks? **Edit:** I found a thing called metaflop modulator. http://www.metaflop.com/modulator. Its name is puzzling, but it's roughly the kind of thing I had in mind. It has a client-server architecture, rather than the rich desktop app I envisioned. Also, the fonts shown only have about 14 parameters, which is fewer than I expected. But, it seems to work OK, so this seems to indicate that there are no fundamental barriers.


title: Is \10 allowed as a control-sequence name?

text: At the beginning of Chapter 3: _Controlling TeX_ of his TeXbook, Knuth explains that control sequences come in two flavours: _control words_ and _control symbols_. ## Control words > The first kind, like `\input`, is called a _control word_ ; it consists of > an escape character followed by one or more _letters_ , followed by a space > or by something besides a letter. [...] In case you're wondering what a > "letter" is, the answer is that TeX normally regards the 52 symbols A...Z > and a...z as letters. The digits 0...9 are _not_ considered to be letters, > so they don't appear in control sequences of the first kind. ## Control symbols > A control sequence of the other kind, like `\'`, is called a _control > symbol_ ; it consists of the escape character followed by a single > _nonletter_. To test my understanding of those categories, I tried compiling the following code (with `pdftex`)... and was surprised not to get any error!               \def\10{foo}     \def\20{bar}     \10\20     \bye      In fact, a PDF output was generated without mishap: ![enter image description here](http://i.stack.imgur.com/Ee8R8.png) The reason I'm puzzled is that `\10` and `\20` don't seem to fall into either category of allowed control-sequence names (as defined above):   1. They contain nonletters; therefore, they can't be considered _control words_.   2. They consist of the escape character (`\`) followed by _more_ than just one nonletter; therefore, they can't be considered _control symbols_. What am I missing?


title: Avoid page breaks in \lstlistings

text: I'm trying to avoid page breaks in my `lstlisting` (seen in section 0.0.2) I know I can remedy this by floating my `lstlisting`, but it adds some unwanted white space (seen in section 0.0.1). ![float](http://i.stack.imgur.com/G3pbL.png) Is there an alternative to `float` so that my `lstlisting` will not break across pages? _OR_ Can I configure `float` to eliminate the white space so it looks identical to how it is when not in a `float` ![no float](http://i.stack.imgur.com/mA4jc.png) *I apologize for the cruft in my MWE. I'm just trying to use this in a much larger document, so I'd rather keep it as close to it as possible.               \documentclass{article}          % New commands     \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}     \newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}}          % Modified commands     \renewcommand*\abstractname{Revision History}          %%%%% Packages and configuration %%%%%     \usepackage[firstpage]{draftwatermark}     \SetWatermarkText{\textsc{Confidential}}     \SetWatermarkScale{4}     \SetWatermarkColor[gray]{0.9}          %\usepackage{fancyhdr}     %\pagestyle{fancy}     %\fancyhf{} % clear all fields     %\fancyfoot[LE,CO]{\thepage}           % page number in "outer" position of footer line     %\fancyfoot[RE,LO]{Message of the day} % other info in "inner" position of footer line          \usepackage{tabularx}          \usepackage[table]{xcolor}     \definecolor{dark-red}{rgb}{0.4,0.15,0.15}     \definecolor{dark-blue}{rgb}{0.15,0.15,0.4}     \definecolor{medium-blue}{rgb}{0,0,0.5}     \definecolor{light-grey}{gray}{0.8}          \usepackage[hidelinks]{hyperref}% keep at end     \hypersetup{         colorlinks,         linkcolor={black},         citecolor={dark-blue},          urlcolor={medium-blue}     }          %\usepackage[cm]{fullpage}     %\usepackage[letterpaper, top=0.7in, bottom=0.9in, left=0.7in, right=0.7in, showframe]{geometry}     \usepackage[margin=0.5in]{geometry}               %\usepackage{color}     \usepackage{listings}     \lstset{ %     language=C,                % choose the language of the code     basicstyle=\footnotesize,       % the size of the fonts that are used for the code     %numbers=left,                   % where to put the line-numbers     %numberstyle=\footnotesize,      % the size of the fonts that are used for the line-numbers     %stepnumber=1,                   % the step between two line-numbers. If it is 1 each line will be numbered     %numbersep=5pt,                  % how far the line-numbers are from the code     %backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}     showspaces=false,               % show spaces adding particular underscores     showstringspaces=false,         % underline spaces within strings     showtabs=false,                 % show tabs within strings adding particular underscores     %frame=single,           % adds a frame around the code     tabsize=4,          % sets default tabsize to 4 spaces     captionpos=b,           % sets the caption-position to bottom     breaklines=true,        % sets automatic line breaking     breakatwhitespace=false,    % sets if automatic breaks should only happen at whitespace     %escapeinside={\%*}{*)}          % if you want to add a comment within your code     }          \usepackage{mdwlist}     \usepackage{underscore}     \usepackage{tikz}     \usepackage{float}     \usepackage{lipsum}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage{etex}     \usepackage{etoolbox}     \makeatletter     \patchcmd{\@afterheading}%         {\clubpenalty \@M}{\clubpenalties 2 \@M \@M }{}{}     \patchcmd{\@afterheading}%         {\clubpenalty \@clubpenalty}{\clubpenalties 1 \@clubpenalty }{}{}     \makeatother     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}          \lipsum[1-8]          \subsubsection{Lorem Ipsum Dolomite}\leavevmode     \begin{lstlisting}     void abc_defgh_ijklmn_stuff * const ( void );     \end{lstlisting}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc id sapien eget magna tempus ornare vitae ut dolor. Donec pharetra diam vitae erat sollicitudin a blandit sapien blandit. Nam ligula metus, imperdiet ut accumsan non, tincidunt id a.          \subsubsection{abcde}     \begin{lstlisting}     static boolean abcde     (     abc_defg_hijk * const   lm     );     \end{lstlisting}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc id sapien eget magna tempus ornare vitae ut dolor. Donec pharetra diam vitae erat sollicitudin a blandit sapien blandit. Nam ligula metus, imperdiet ut accumsan non, tincidunt id a.\\          \end{document}


title: Change abstract page position to top in report format

text: My document type should be `report` and I need to start my abstract at the top of the page. But with the below code, the abstract is centered on the page. What do I need to do? (I cannot change the type of document.)               \documentclass[12pt,a4paper,oneside]{report}     \begin{document}     \begin{abstract}     .................     \end{abstract}     \end{document}


title: How to conceive a macro for drawing a pie-chart circle of fifths?

text: I would like to re-write parts of the book mentioned below on historic tuning temperaments, and therefore I need to draw a circle of fifths, represented in the book by hand-drawn schemata like this: ![figure from: Asselin, Pierre-Yves. Musique et tempérament. Jobert, 1985.](http://i.stack.imgur.com/iTBLk.jpg) This seems like a good reason to use pie charts. There are about 30 temperaments, so a macro for input of a set of 11 labels and values would be useful. As you can see, different steps for tuning are explained with arrows for each temperament, angles between the radial lines are changed according to the interval size and that size alteration is indicated in-between using fractions and other math expressions. Please note that the upper note, usually C, should retain its vertical position, and that the circumferential step- arrows should step outwards like in the image. I should be most obliged if someone presents a working example or an idea. Although I've experimented with much difficulty, I'm beginning to have some understanding of tikz/pgf. Still, I'm nowhere near the macro I would fancy, and I don't include any MWE's because they're not nearly intelligible. ps. _Today equal temperament is mostly used, meaning that the chart would consist of equal angles of 30 degrees as one would equally subtract 1/12 syntonic comma._


title: Commands argmin and argmax in algorithm

text: I am trying to use the `argmin` and the `argmax` commands that I defined in an algorithm but I keep getting the argument not in the middle but on the right. Does anyone have an idea how to put the argument in the middle. I declare the operators:               \DeclareMathOperator*{\argmin}{\arg\!\min}     \DeclareMathOperator*{\argmax}{\arg\!\max}      and I use the following packages to write algorithms:               \usepackage[chapter]{algorithm}     \usepackage{algorithmic}      Full algorithm code:               \begin{algorithm}     \begin{algorithmic}      \STATE some statement here     \WHILE{!stop}         \STATE $s_{i} = \argmin_{p} \| l_{j} - s_{p} \|$     \ENDWHILE     \end{algorithmic}     \end{algorithm}


title: Problem with completion in TexMaker on Elementary OS

text: I have a problem with Texmaker on my OS (Elementary OS - Luna, with kernel is Ubuntu 12.04). When I type a few words of the command (for example, the word `\begin{document}`), it doesn't appear in the list of possible commands as usual. Instead, it waits until I type the full of the word or whenever I make the backspace some letters. Surely, that's no the way the Texmaker autocompletion feature is supposed to work... What am I missing? Note: I have this problem with both TexMaker installed from software manager (version 3.2) and downloaded from the source (version 4.1).