title: Making switch/case with etoolbox's \ifdefequal

text: I've got a define such as `\def\doctype{SomeString}`. `\doctype` can take on one of five values. I want to do something like a switch statement in a programming language, i.e. (pseudocode):               switch (\doctype) {         case 'SomeString1': some text here         case 'SomeString2': some different text here         ...     }      (I don't need a default/else/otherwise case.) I tried doing this in LaTeX with:               \documentclass{article}          \usepackage{etoolbox}          \def\doctype{SomeString1}          \newenvironment{switchdoctype}[0]{%       \newcommand{\case}[2]{\ifdefequal{\doctype}{##1}{##2}{}}%     }{}          \begin{document}          \begin{switchdoctype}       \case{SomeString1}{some text here}       \case{SomeString2}{some different text here}     \end{switchdoctype}          \end{document}      This gives an error: `ERROR: Argument of \@secondoftwo has an extra }.` I gather this is some sort of problem with using `\ifdefequal`. How can I make this work? I suspect it's some trick of expansion but I can't make this work with my limited knowledge of [La]TeX; I'm interested in learning something from making this work. MacTeX 2010 here, which is based on TeX Live 2010 AFAIK. Thanks! P.S.: boolexpr has a `\switch` but I can't use it because it conflicts badly with etoolbox (and BibLaTeX depends on etoolbox as far as I can tell). I have reported this incompatibility to the author listed in boolexpr's documentation.


title: how to colorize syntax using R + Sweave?

text: I'm writing a LaTeX document using Sweave (a Beamer presentation, really), which weaves R code and LaTeX. Is there a way to make my chunks of code and its output highlighted? I could use listings package but that would mean I would have to rummage through the .tex file and wrap all `Schunks` so I'm looking for perhaps more elegant solutions if currently available.


title: Correctly setting chapter hierarchy

text: I'm not sure if I've phrased the title correctly, but let me try to explain: I have my tex file basically organized as follows:               \frontmatter         ...         ...     \mainmatter         \input chap1         \input chap2         ...      Each chapter input begins with `\chapter{name}`. Everything is nice in the Table of Contents as far as chapter numbers; yet, the "sidebar navigation" in the pdf displays incorrectly. The first two chapters after the first are shown nested in the first. I've noticed I can resolve this by setting `\setnumber{chapter}{1}` before `\input chap1`, but this messes up the TOC to start chapter numbering at 2. This of course then leads me to try `\setnumber{chapter}{0}`, which then resolves the TOC, but messes up the navigation hierarchy. This bubble pops up somewhere else every time I push it down. Images of the two cases: ![Imgur](http://i.imgur.com/VA6FlRz.png) ![Imgur](http://i.imgur.com/hkvIn1z.png) Min. working example:               \documentclass[11pt]{report}     \usepackage{         bookmark,         titlesec,         tabularx,         graphicx,         hyperref,         nameref,         amssymb,         amstext     }     \hypersetup{bookmarknumbered}     \setcounter{tocdepth}{4}     \setcounter{secnumdepth}{1}          \begin{document}              \maketitle         \tableofcontents         \listoftables         \listoffigures                   \input 1-...         \input 2-...         \input 3-...         \input 4-...         \input 5-...         \input 6-...          \end{document}      I should note lastly, that the only difference between the first chapter and others is that it does not contain any sections. Noting this, I tried adding some sections. This did not change the problem. Any help is appreciated! # Updates I've updated the above to a new minimal working example. I've tossed the thesis template class as that was too hairy to try to debug. I noticed a duplicate equation label in the input 4, and removed it. I also added the `bookmark` package as suggested. One, some, or all of these changes fixed the issue.


title: Did anybody manage to use the PhD package?

text: I've seen these very nice dicussion about fancy chapters: Fancy chapter headings It seems that the packages are now called PhD https://github.com/yannisl/phd I can't find any documentation about it. Did somebody managed to use it (I hope so for the creator :) of the package)? If it's the case could show me a simple working example?


title: Add a table of contents into a moderncv document

text: It seems that the class moderncv doesn't implement the `\tableofcontents` command. Is there any easy way to add a table of contents into the first page of the CV. Within a `minipage` for example ?


title: Is it possible to have an enhanced version of the singletitle option?

text: I have the following problem with biblatex: I use a cite style that has a full citation in footnotes for the first citation, subsequent citations refer back to the first footnote (similar to verbose-note/verbose-inote). These subsequent citations should only comprise the author’s last name and the reference to the footnote in which it was cited first, _unless_ there is more than one work of this author in this footnote. Thus, I am looking for a functionality similar to the “singletitle” option, only not with regard to all cited works, but only limited to one footnote. To illustrate the problem, I include a minimal example. “Nachname” should have no shorttitle, since the reference to the respective footnote is already unambiguous. It should look like the one for “Dritter”. But “Buchautor” should have a shorttitle, since there are two works of this author in the footnote with the first citations. By the way, the option “singletitle” is set by verbose-note and verbose-inote, so there is no need to give it here explicitly.               \documentclass[ngerman]{scrartcl}     \listfiles     \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @ARTICLE{Nachname1,       author = {Nachname, Vorname},       title = {Titel des Zeitschriftenartikels},      shorttitle = {Titel},       journal = {Zeitschrift},       date = {2006},       volume = {6},       pages = {19--75}     }     @BOOK{Buchautor1,       author = {Buchautor, Hans-Wilhelm},       title = {Irgendein Buch},      shorttitle = {Irgendein},       location = {Buch am Wald},       date = {2000}     }     @BOOK{Nachname2,       author = {Nachname, Vorname},       title = {Ein Buch},      shorttitle = {Buch},       date = {2004},      location = {Berlin}     }     @BOOK{Buchautor2,       author = {Buchautor, Hans-Wilhelm},       title = {Ein weiteres Buch},      shorttitle = {Weiteres},       location = {München},       date = {2002}      }     @ARTICLE{Dritter,      author = {Dritter, Dieter},      title = {Der Dreisprung in Geschichte und Gegenwart},      shorttitle = {Dreisprung},      date = {2010},      journal = {Dynamik}     }     \end{filecontents}     \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage{babel,csquotes}          \usepackage[       style=verbose-inote     ]{biblatex}     \bibliography{\jobname}          \begin{document}     \footcite{Nachname1,Dritter}     \footcite{Nachname2}     \footcite{Buchautor1,Buchautor2}     \footcite{Dritter}     \footcite{Nachname2}     \footcite{Buchautor2}     \footcite{Buchautor1}     \footcite{Nachname1}     \end{document}      Has anyone a clue where I could start off?


title: Simple (execution) stack with pointers and comments using TikZ

text: I'm looking for a simple way to draw a stack. I know about drawstack.sty. I actually love the stacks produced by this package but the size is way too big as I'm using IEEEtran for my paper. The stack should use as less space as possible (i.e. fit the text size). This answer produces the desired result but I'm looking for a way to additionally draw pointers and comments (see the mockup below). I'm absolutely new to TikZ and therefore have no idea how to achieve this. ![enter image description here](http://i.stack.imgur.com/PyiaH.png)


title: Automating Error Detection of pfdlatex

text: ## Background: I have numerous individual files that need to be compiled, so am using a script to do that with the following options:               set PDFLATEX_OPTIONS = "\         --file-line-error \         --shell-escape \         --synctex=1 \         --interaction=nonstopmode \         --recorder "      as I don't want compilation to terminate just because there is an error in one file. ## Intro: I would like my script to detect which files totally failed to produce useful results. At this time, I am not too concerned with slight overfull/underfull box reports, but trying to focus on the ones that _must_ be fixed (as opposed those that _should_ be fixed). For conditions that are specific to my own use case, I have put as much error detection as possible and write to the log file very specific error messages which my script can detect and report any problems. This process has worked great until I recently came across an issue where _some_ PDF files were not produced at all due to a change in my common `.sty` files. Well, that was an easy fix, I just use:               grep "no output PDF file produced"      and test the return code to detect this failure. But this got me thinking, which is always a bad sign :-), that perhaps there might be some case where that message is not generated, but the PDF file does not contain any content, or there are other catastrophic failures that can occur. ## Question: What I am looking for are recommendations on _specific_ error messages to look for in the log files, or automate-able tests that should be performed to minimize the chance of a some extremely important failure being overlooked. And even tough I am mainly concerned with what _must_ be fixed, at some point I will need to look at the _should_ be fixed category also. For example, at some point an overfull box warning is really a _must_ be fixed. Any suggestions on these would also be useful. ## Notes:   * Perhaps I should just be looking at the return code from `pdflatex` instead of specific error messages, but I think it would be more useful to be able to categorize the failures so that I can prioritize.   * This question isn't about things that can be detected via the `nag` package for instance as discussed in     * How to use nag?     * Is there a nag package for TikZ? I am using as much of that kind of detection that I am aware of, and I review the PDF file at the time of creation to make sure it looks reasonable, but can't be looking at _every_ PDF every time I change the `.sty` files. ## References:   * Trapping LaTeX error/warning


title: How can I define a custom class of keywords in listings?

text: How can I define a custom class of keywords in `listings`? In the C# listing below, keywords, such as `using`, `namespace`, etc., get highlighted as desired. However, I would like to define a custom class of keywords called "attributes", that would allow me to declare `Test`, `Assert`, etc. as attributes and highlight them in a custom style (e.g. cyan color). How can I do that? ![enter image description here](http://i.stack.imgur.com/2teH7.png)               \documentclass[12pt]{article}     \usepackage{graphicx}     \usepackage{pdflscape}     \usepackage{color}     \usepackage{xcolor}     \usepackage{listings}     \usepackage[T1]{fontenc}     \usepackage[scaled]{beramono}     \usepackage[driver=pdftex, margin=2.54cm]{geometry}               \definecolor{bluekeywords}{rgb}{0,0,1}     \definecolor{greencomments}{rgb}{0,0.5,0}     \definecolor{redstrings}{rgb}{0.64,0.08,0.08}     \definecolor{xmlcomments}{rgb}{0.5,0.5,0.5}     \definecolor{types}{rgb}{0.17,0.57,0.68}          \lstset{language=[Sharp]C,     showspaces=false,     showtabs=false,     breaklines=true,     showstringspaces=false,     breakatwhitespace=true,     escapeinside={(*@}{@*)},     commentstyle=\color{greencomments},     keywordstyle=\color{bluekeywords}\bfseries,     stringstyle=\color{redstrings},     basicstyle=\ttfamily,     morekeywords={  abstract, event, new, struct,                     as, explicit, null, switch,                     base, extern, object, this,                     bool, false, operator, throw,                     break, finally, out, true,                     byte, fixed, override, try,                     case, float, params, typeof,                     catch, for, private, uint,                     char, foreach, protected, ulong,                     checked, goto, public, unchecked,                     class, if, readonly, unsafe,                     const, implicit, ref, ushort,                     continue, in, return, using,                     decimal, int, sbyte, virtual,                     default, interface, sealed, volatile,                     delegate, internal, short, void,                     do, is, sizeof, while,                     double, lock, stackalloc,                     else, long, static,                     enum, namespace, string, GeneticAlgorithmHarmonizer, var},                     %list your attributes here     }          \begin{document}     \begin{lstlisting}[breaklines=true]     using System;     using Harmonizer;     using NUnit.Framework;     using ScoreManagement;          namespace TestingLibrary     {         [TestFixture]         public class ScoreManagementUnitTests         {             private const KeySignature KeySignature = ScoreManagement.KeySignature.CMajor;             private const TimeSignature TimeSignature =     ScoreManagement.TimeSignature.FourFour;                  [Test]             public void AddConstructorParameters_AddingKeySignature_ReturnsTrue()             {                 var score = new Score(KeySignature);                       Assert.IsTrue(score.KeySignature == KeySignature);             }         }     }          \end{lstlisting}     \end{document}


title: Editing LaTeX tables in MS Excel

text: I have a big LaTeX table that I want modify it in Excel, is there any solution? There is some good solutions for converting Excel table to Latex tables.


title: Example from the pstricks-add manual not compiliing

text: Consider the following example (taken from p. 29 in the `pstricks-add` manual):               \documentclass{article}          \usepackage{pstricks-add}          \begin{document}          \begin{pspicture}(-1,-1)(8,8)     \multido{\iA=1+1}{6}{%       \rput(\iA,7.5){\Huge\psdice[unit=0.75,linecolor=red!80]{\iA}}       \rput(! -0.5 7 \iA\space sub){\Huge\psdice[unit=0.75,linecolor=blue!70]{\iA         }}%       \multido{\iB=1+1}{6}{%         \rput(! \iA\space 7 \iB\space sub){%           \rnode[c]{p\iA\iB}{\makebox[1em][l]{\strut\psPrintValue[fontscale=12]{\iA             \space \iB\space add}}}%     }}}     \ncbox[linearc=0.35,nodesep=0.2,linestyle=dotted]{p11}{p66}     \ncbox[linearc=0.35,nodesep=0.2,linestyle=dashed]{p15}{p51}     \rput{90}(-1.5,3.5){1. dice}     \rput{0}(3.5,8.5){2. dice}     \psline[linewidth=1.5pt](0.25,0.5)(0.25,8)     \psline[linewidth=1.5pt](-1,6.75)(6.5,6.75)     \end{pspicture}          \end{document}      I get the error               ! Undefined control sequence.     <argument> \strut \psPrintValue                                      [fontscale=12]{\iA \space \iB \space add}     l.16 }      when I compile using `latex`. How do I make the code compile?


title: Parallelogram symbol

text: I'd tried _Detexify_ but no success. Since we have `\square` for quadrilateral and `\triangle` for triangles, I'd like to use a symbol for parallelogram. A kind of slanted square. Of course, I can do this using `tikz` but I guess that it is too much. I'd need to load a huge package only to draw a single symbol. Any ideas?


title: Setting background color of minipage without overflow

text: I would like to set a color to the leftmost minipage in the following code:               \usepackage{xcolor}     \fcolorbox{red}{gray}{       \begin{minipage}{0.33\textwidth}       some text       \end{minipage}     }          \begin{minipage}{0.67\textwidth}     some other text     \end{minipage}      but the leftmost minipage is displayed over the whole page and the rightmost appears on the second page (given there is enough text in both). I read that one should set innerleftmargin, innerrightmargin and paragraph parameters to 0, but that didn't work either. What is the right way to do it?


title: 4 side by side pictures in poster latex

text: I look for an example to put 4 pictures side by side in the case of a poster with `baposter` package. thanks


title: Problems with beyond the margin of a article?

text: I'm writing a paper, but in the process, I encounter a problems : when I drawing a map with the following codes               \documentclass{article}         \usepackage{amsmath,amssymb,booktabs}         \begin{document}          \begin{figure}         \[         \begin{array}{@{}l@{}c@{}l@{}}         \toprule          \hat{A}  &&  \hat{B}  \\          (a,A=g^a)  &&  (b,B=g^b)  \\           x\in_R[1,q-1] ,\quad  X=g^{H_1(x,a)}   \\         & \xrightarrow{\textstyle  ID_A, Cert_A,  X } \\         &&  y\in_R [1,q-1] ,\quad  Y=g^{H_1(y,b)}  \\          & \xleftarrow {\textstyle  ID_B,Cert_B, Y  } \\           K=H_2(Y^a,B^{H_1(x,a)},Y^{H_1(x,a)},\hat{A},\hat{B})  \\         &&  K=H_2(A^{H_1(y,b)},X^b,X^{H_1(y,b)},\hat{A},\hat{B})   \\         \bottomrule         \end{array}         \]          \caption{title}          \end{figure}         \end{document}      I find that this it beyond the margin. Just like this ![enter image description here](http://i.stack.imgur.com/oC1IL.jpg) You can see very obviously that it beyond the margin. Both changing the font size and rotating the map won't get it to adapt to my article(I tried these two ways). who can help me?


title: Integer operator in tikzpicture environment

text: And I have got this figure:               \begin{figure}[H]         \centering                                                      \begin{tikzpicture}             \begin{axis}[width=200pt,axis x line=middle, axis y line=center, ylabel={$\frac{{\delta x}_j}{{\Delta x}_j}$},xlabel={$n$},xmin=0,xmax=6,ymin=0,ymax=1.5]                 \addplot+[mark=none,smooth] (\x,{1/(2^(\x))});             \end{axis}         \end{tikzpicture}         \caption{Effect of the parameter $n$ on the particle nodes scaling}         \label{n_influence}     \end{figure}      The problem is that I don't want this function to be plotted for the real numbers, but I would like to plot the integer part of it. Does someone have a solution?


How to use this command to display an arabic text in an utf8 tex file?               \newenvironment{abstractAr}       {\clearpage           % we want a new page          \vspace*{100\p@}%        \thispagestyle{empty}% no header and footer          \begin{center}                  {\usefont{T1}{LobsterTwo-LF}{bx}{it}\LARGE{خلاصة}}          \end{center}          \par        \vspace*{60\p@}          \normalsize       }       {\par % end the paragraph        \vspace{\stretch{3}} % space at bottom is three times that at the top        \clearpage           % finish off the page       }       I'm loading the `arabic` option, but, I couldn't display it. Any brilliant idea, please?


title: Inline math spacing and varying interword spacing

text: Say I want to reduce the space between two letters in math mode by 2/18 quad. Going all Die Hard 3, I put together 2 -3/18 quad `\!` and add 4/18 quad with `\:`. The problem is, though, that apparently the positive space gets squashed according to the current line's interword spacing while the negative space does not. So in extreme cases I get -6/18 quad which looks less than satisfying in my MWE and in the real world: ![screenshot](http://i.stack.imgur.com/huRVf.png)               \documentclass[a5paper]{article}     \newcommand{\md}{\ensuremath{M\!\!\:D}}     \begin{document}     a a a a a a a a a a a a a a a a a a a a a a $\md$ a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a          aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaa $\md$ aaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaaaaaaa aaaaaaaa     \end{document}      So why is inline math subjected to normal interword spacing adjustments and how can I switch it off? (I can imagine this leading to problematic results in many formulae, even when not doing such strange spacing arithmetic as I did.)


title: Edgeworth Box of Pareto efficiency

text: I would like to have a figure like the following image, but I can't find a way to make the red convex curves. ![enter image description here](http://i.stack.imgur.com/Ntfrn.png) My code so far contains:               \begin{tikzpicture}     \draw (1, 3.5) to[out=0,in=90] (3.5, 1);     \draw (.5, 3) to[out=0,in=90] (3, .5);     \draw (.25, 2.5) to[out=0,in=90] (2.5, 0.25);         \draw[-, very thick] (0,0) node[below]{O} -- (4.2,0) node[below] {y};         \draw[-, very thick] (0,0) -- (0,4) node[left]{x};     \draw[-,very thick] (0,4)--(4.2, 4) node[above]{A};     \draw[-, very thick] (4.2, 4)--(4.2,0);          \end{tikzpicture}


title: Non-linear plot looks linear

text: I am plotting a non-linear function -2/3 x^ 3 + x^2-3x+4/3 in the interval [0,1/2], I tried to change the scales to make it look less linear but still looks like a straight line. Any suggestions?               \usepackage{tikz}     \begin{figure}     \begin{tikzpicture}[xscale=5,yscale=3,domain=0:1,step=.01];     \draw[<->] (0,1.5)--(0,-.3);     \draw[<->] (-.3,0)--(1,0);     \draw[] (1,0) node[right]{\small $x$};     \draw[color=blue]   plot[samples=200] (\x,{ifthenelse(\x <.5,-(2/3)*\x^3+\x^2-3*\x+4/3,(2/3)*\x^3-\x^2+3*\x-4/3))}) node[right] {\small{$b(x)$}};     \draw[color=red] (-.2,0.635) node[right]{$\beta$};     \draw[color=red] (0,0.635)--(1,0.635);     \draw[color=red,dotted,thick](.25,-.3)--(.25,0.635);     \draw[color=red,dotted,thick](.75,-.3)--(.75,0.635);     \draw[color=red](.25,-.3)node[below]{\footnotesize{$\phi_1(\beta)$}};     \draw[color=red](.75,-.3)node[below]{\footnotesize{$\phi_2(\beta)$}};     \end{tikzpicture}      \end{figure}


title: Question on interpretation of a pgfplotsset

text: I am trying to understand the following code:               \pgfplotsset{         discard if not/.style 2 args={             x filter/.code={                 \edef\tempa{\thisrow{#1}}                 \edef\tempb{#2}                 \ifx\tempa\tempb                 \else                     \def\pgfmathresult{inf}                 \fi             }         }     }      Here is my understanding after reading the manual:   1. `\pgfplotsset` is used to set document-wise style.   2. `discard if not/.style 2 args` defines a style named `discard if not` in the namespace `/pgfplots` and takes two arguments: `#1` and `#2`.    3. `x filter/.code` is used to change the behavior of the PGFPLOTS regarding coordinate filtering. Here, we are saying to use `x filter` for coordinate filtering based on a single coordinate. `.code` is similar to TeX command: `\newcommand`. `x filter` gets an input coordinate as `#1` and applies filtering and finally writes the results into the macro `\pgfmathresult`. If we set `\pgfmathresult` to `inf` by `\pgfmathresults{inf}` this means the coordinate can be discarded (if `unbounded coords=discard` is set).   4. `\thisrow{#1}` returns the active row in `#1` column. In other words, `\thisrow{#1}` = table(active row,column=`#1`).    5. `\tempa{\thisrow{#1}}` defines a macro named `tempa` which has a value of the currently active table row in the designated column, `\tempa` = table(active row,column=`#1`).   6. `\edef` refers to expanded definition. It expands the macro to evaluate its value.    7. `\edef\tempa{\thisrow{#1}}` evaluate the macro and assigns the value of the active row in the designated column to `tempa`.   8. `\edef\tempb{#2}` assigns the value of the second argument to macro `tempb`.   9. `\ifx`: I couldn't find this in the manual but I am assuming that `\ifx\tempa\tempb` is equivalent to logical condition: `\tempa == \tempb`. Maybe we have `\ify`?   10. `\pgfmathresult{inf}`: up to this moment `\pgfmathresult` has the value of the x coordinate and setting it to `inf` discards the coordinate if `unbounded coords=discard` has been set.   11. `\def\pgfmathresult{inf}` I couldn't find what exactly `\def` does but I assume it sets the value of `\pgfmathresult` to `inf` which can refer to discarding. So, `discard if not` is a name of a style that when is called applies a coordinate discarding based on two input arguments. I would be thankful if someone could correct me if I have not understood it correctly or give me a better interpretation.


title: another specific section format

text: Is there a way to implement the following style in LaTeX? "Sections should be numbered using upper-case roman numerals (I, II, III, etc.). Section titles should appear on the first line of text, italicized, as part of the first paragraph in each section." It's not stated in the quote, but the section numbers are to appear centred on their own line, as section headings (using a medium weight, normal sized font). I couldn't see a way to implement both a separate heading and a run-in element by playing around with titlesec. Many thanks in advance!


title: sidenotes package: horizontal spacing after the sidenote mark

text: If I use the package sidenotes and try the following:               Test\sidenote{Side note.}, continue.      there is a big space before the comma. Is it possible to avoid this?


title: Are there specialized libraries or packages to draw blocked/partitioned/splitting matrices in Tikz?

text: I need to write matrix splitting and factorization operations (for my linear algebra course). It is hard to do these is direct Latex. I can use Visio to draw these easily, but I'd prefer to use Tikz now since I use Latex for my report. I'd like to show a small example of what I typically need, and a crude implementation in tikz to illustrate what I need and **ask if there exist a library or general approach to do this Tikz**. Here is a typical example of what I'd like to typeset: ![enter image description here](http://i.stack.imgur.com/M5OM9.jpg) Here is the result of the tikz drawing ![enter image description here](http://i.stack.imgur.com/OCj1l.png) Here is the code               \documentclass{article}     \usepackage{tikz}     \begin{document}     \[     A=L+D+U     \]     where          \begin{tikzpicture}         \def\x{0}        \def\y{0}        \def\L{2}        \def\s{.25}        \def\z{.35}                \draw [very thin,fill=lightgray] (\x,\y) rectangle (\x+\L,\y+\L);         \node at (\x+\L+\s,\y+\L/2) {$=$};         \node[font=\Large] at (\x+0.5*\L,\y-\z) {$A$};              \pgfmathsetmacro\x{\x+\L+2*\s}              \draw [very thin] (\x,\y) rectangle (\x+\L,\y+\L);         \draw [fill=lightgray] (\x,\y)--(\x+.9*\L,\y)--(\x,\y+.9*\L);         \node[font=\Large] at (\x+0.65*\L,\y+0.65*\L) {$0$};         \node[font=\Large] at (\x+0.5*\L,\y-\z) {$L$};              \node at (\x+\L+\s,\y+\L/2) {$+$};              \pgfmathsetmacro\x{\x+\L+2*\s}              \draw [very thin] (\x,\y) rectangle (\x+\L,\y+\L);          \draw [fill=lightgray]  (\x+0.9*\L,\y)--(\x+\L,\y)--(\x+\L,\y+0.1*\L)--(\x+0.1*\L,\y+\L)--(\x,\y+\L)--(\x,\y+0.9*\L)--(\x+0.9*\L,\y);          \node[font=\Large] at (\x+0.25*\L,\y+0.25*\L) {$0$};          \node[font=\Large] at (\x+0.75*\L,\y+0.75*\L) {$0$};          \node[font=\Large] at (\x+0.5*\L,\y-\z) {$D$};               \node at (\x+\L+\s,\y+\L/2) {$+$};              \pgfmathsetmacro\x{\x+\L+2*\s}              \draw [very thin] (\x,\y) rectangle (\x+\L,\y+\L);         \draw [fill=lightgray] (\x+\L,\y+0.1)--(\x+\L,\y+\L)--(\x+0.1,\y+\L);         \node[font=\Large] at (\x+0.35*\L,\y+0.35*\L) {$0$};         \node[font=\Large] at (\x+0.5*\L,\y-\z) {$U$};          \end{tikzpicture}     \end{document}      The matrix itself can be a rectangle as shown, no fancy parenthesis needed and such. The idea is just to highlight the structure of the matrices (diagonal, upper, lower, banded, etc...) **update 7/23/13 9:40 pm** Is there a way to make the sizes remain the same in the `align` env? **update 10:40 pm** Thanks for Qrrbrbirlbel reply. The correct way to keep the size the same is               {\tikzset{set ALDU=small}     \begin{align*}       A        &= L + D + U  \\       \ALDU{A} &= \ALDU{L} + \ALDU{D} + \ALDU{U}     \end{align*}     }      ![enter image description here](http://i.stack.imgur.com/8ME1n.png) isn't Latex nice? try to do this in Microsoft word :)


title: Geogebra import into latex doesn't work

text: I created this file :               \documentclass[10pt]{article}          \usepackage{pstricks-add}          \pagestyle{empty}          \begin{document}          \newrgbcolor{zzttqq}{0.6 0.2 0}          \psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=o,dotsize=3pt      0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}          \begin{pspicture*}(-4.3,-2.6)(7.06,6.3)          \psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1,Dy=1,ticksize=-2pt 0,subticks=2]{->}(0,0)(-4.3,-2.6)(7.06,6.3)          \pspolygon[linecolor=zzttqq,fillcolor=zzttqq,fillstyle=solid,opacity=0.1](1,2)(3,2)(3,4)(1,4)          \psline[linecolor=zzttqq](1,2)(3,2)          \psline[linecolor=zzttqq](3,2)(3,4)          \psline[linecolor=zzttqq](3,4)(1,4)          \psline[linecolor=zzttqq](1,4)(1,2)          \begin{scriptsize}          \psdots[dotstyle=*,linecolor=blue](1,2)          \rput[bl](1.08,2.12){\blue{$A$}}          \psdots[dotstyle=*,linecolor=blue](3,2)          \rput[bl](3.08,2.12){\blue{$B$}}          \psdots[dotstyle=*,linecolor=blue](3,4)          \rput[bl](3.08,4.12){\blue{$C$}}          \psdots[dotstyle=*,linecolor=blue](1,4)          \rput[bl](1.08,4.12){\blue{$D$}}          \end{scriptsize}          \end{pspicture*}     \end{document}      He gives me 58 errors. I have not realla clue why these errors apperar. Perhaps it has problems with the colors. Do i need to include the tikz package or sth else?


title: How to typeset converge in probability in lyx or latex?

text: I'm a new user for lyx, and I am wondering how you can put the `p` above that right arrow?


title: Redefine graphicx draft mode

text: How to redefine draft mode for graphicx package not to draw figure borders but only image path? I would like to print the document without pictures and then stick photos.


title: Parse dotted string, extracting last part

text: I want a macro that will separate a string like "1.2.3" into two parts: the part until the last dot (call that the _context_ ) and the last number. This seems a pretty basic application of a helper macro and `\expandafter`, but I can't get it to terminate. Here is my MWE, with some debugging macros thrown in:               \documentclass{article}          \makeatletter     \newcommand{\parse}[1]{%         Parsing #1:\par%         \let\my@context\@empty%         \let\my@number\@empty%         \expandafter\@parse#1.\@nil         Context: \my@context\par         Number: \my@number     }     \def\@parse#1.#2\@nil{%         \if#2\@empty%             \edef\my@number{#1}%             \show\my@number%         \else%             \edef\my@context{\if\my@context\@empty\else\my@context.\fi#1}%             \show\my@context%             \expandafter\@parse#2\@nil%         \fi     }     \makeatother          \begin{document}     \tracingmacros=1     \parse{1.2.3}          \parse{4.5.6.7}          \parse{1.2}     \tracingmacros=0          \end{document}      As I compile this I get to what ought to be the terminating case but it doesn't succeed. Here is the log file:               \parse #1->Parsing #1:\par \let \my@context \@empty \let \my@number \@empty \ex     pandafter \@parse #1.\@nil Context: \my@context \par Number: \my@number      #1<-1.2.3          \@parse #1.#2\@nil ->\if #2\@empty \edef \my@number {#1}\show \my@number \else      \edef \my@context {\if \my@context \@empty \else \my@context .\fi #1}\show \my@     context \expandafter \@parse #2\@nil \fi      #1<-1     #2<-2.3.          \my@context ->          \@empty ->          > \my@context=macro:     ->1.     \@parse ... \my@context .\fi #1}\show \my@context                                                        \expandafter \@parse #2\@n...     l.30 \parse{1.2.3}          ?           \@parse #1.#2\@nil ->\if #2\@empty \edef \my@number {#1}\show \my@number \else      \edef \my@context {\if \my@context \@empty \else \my@context .\fi #1}\show \my@     context \expandafter \@parse #2\@nil \fi      #1<-2     #2<-3.          \my@context ->1          \@empty ->          \my@context ->1     > \my@context=macro:     ->1.2.     \@parse ... \my@context .\fi #1}\show \my@context                                                        \expandafter \@parse #2\@n...     l.30 \parse{1.2.3}          ?           \@parse #1.#2\@nil ->\if #2\@empty \edef \my@number {#1}\show \my@number \else      \edef \my@context {\if \my@context \@empty \else \my@context .\fi #1}\show \my@     context \expandafter \@parse #2\@nil \fi      #1<-3     #2<-          \@empty ->          \my@number ->          \my@context ->1.2          \my@context ->1.2     > \my@context=macro:     ->1.2.3.     \@parse ... \my@context .\fi #1}\show \my@context                                                        \expandafter \@parse #2\@n...     l.30 \parse{1.2.3}          ?      ! Undefined control sequence.     \@parse ...y@context \expandafter \@parse #2\@nil                                                        \fi      l.30 \parse{1.2.3}          ?       In the last successful expansion of `\@parse`, `#1` is "3" and `#2` is "". It seems that `\@empty` expands to "" as well. So why does `\if#2\empty` not succeed? I welcome fancy `xparse` and `l3regex` solutions but would love a basic one as well. There's something simple I'm not getting.


title: How to add rule under content

text: I would add a rule under `CONTENTS` like this: ![enter image description here](http://i.stack.imgur.com/SvUvN.png) How can I do? I have to use some particular package?


title: AutomaticLaTeXPlugin + MacVim on OSX Lion

text: I am desparatly trying to get the AutomaticLaTeXPlugin to work with MacVim. I previously worked with Latex-Suite but i really like the autocompilation, progressbar .. that AutomaticLaTeXPlugin seems to offer. I fullfill all the Requirements. I am using MacVim+Janus and have installed the plugin in my `~/.janus`directory. Some things work (like `:TOC`, `:help atp`) but the compilation is not fully working. Doing `:TEX` and nothing changes (no statusbar, nor any compilation). Doing `:PID`says `[ATP:] lualatex is not running`. The only compilation aspects that do work is running `:Latexmk`or pressing `F5`(which results in the whole window showing me the compilation log file). How can i get the automatic compilation, progressbar, `:TEX`commands to work? My current `~\.atprc.vim`: PasteBin


title: esvect with transparency makes part of the arrow darker

text: When using the `esvect` package in a transparency context, one can see that the arrow is built by superposing two "blocks": a line and an arrowhead. But as the line overrides the arrow head, the center of the arrow looks less transparent. Is there a way to change this modifying `esvect` code? ![Transparency issue](http://i.stack.imgur.com/0QwLE.png)               \documentclass{standalone}          \usepackage{tikz}     \usepackage{esvect}          \begin{document}          \begin{tikzpicture}       \node[semitransparent] {$\vv{v}$};     \end{tikzpicture}          \end{document}


title: How to mark different bibliographies with different letters in amsrefs?

text: It seems that amsrefs strikes again! I'd like to have more than one bibliography, and in the first one, the entries should be marked, say, as [A1], [A2] etc., in the second, say, [B1], [B2] etc. and so on. I could use `\BibLabel` to modify the look of the entries in the bibliography, and modify `\cite@somethings` to modify the references, but this seems to be an ugly hack. Any better ideas?


title: Make one author's name bold every time it shows up in the bibliography

text: I'm working on a CV. I'd like to highlight my name in every entry in the bibliography. I've tried simply replacing `{myname}` with `{\bf myname}` or `{{\bf myname}}`, but they fail with various errors, particularly when sorting. This post gives a solution that's nearly what I'm looking for. The solution in the linked post is to use:               \newcommand{\myname}[1]{\textbf{#1}}      to wrap all instances of the name in question. EDIT: Removed error example because it was caused by an unassociated error in a .bst file. The answer selected below now directly answers the only question posed above.


title: Scaling fonts document-wide

text: I'm looking to use `lcmtt` mentioned here as my default typewriter font, but the scaling is way out of proportion with the rest of the text. I've used the following commands to enable the font:               \usepackage[T1]{fontenc}     \renewcommand*\ttdefault{lcmtt}      How can I scale down this `\tt` font document wide? ...sorry if this is trivial, but I can't seem to crack it.


title: Extra space after new command using xparse

text: I was trying to write a macro that could take either one of two arguments and produce different outputs for both cases. For that, I used to package xparse. Here is the macro I wrote:               \documentclass[a4paper,english, makeindex, final]{memoir}          \usepackage[demo]{graphicx}          \usepackage{xspace}     \usepackage{xparse}                  \DeclareDocumentCommand\fig{om}{       \IfNoValueTF{#1}         {(fig. \ref{#2})\xspace}         {(fig. \ref{#2}.#1)\xspace}     }     %------------------------------------------------------------     \begin{document}          This it text I want to type \fig[A]{fig1}. And it is the same with the only one argument as well \fig{fig1}.          \begin{figure}[!htbp]     \begin{center}     \includegraphics[width=0.8\linewidth]{}     \caption[test figure]{Test figure. A big black box}     \label{fig1}     \end{center}     \end{figure}              \end{document}      The problem is that the new command generate automatically a space after the text and I can figure out how to remove it. I tried the xspace package but it does not seem to work... ![enter image description here](http://i.stack.imgur.com/rOgv8.jpg)


title: Description list with right alignment of labels

text: I want a description list that looks like the following:                         Name | Joel Spolsky            Address | Some address                      Some zipcode          Telephone | +31 123 456             E-Mail | email@domain.org     Something more | Bashing latex in-           elaborate | to submission           How would I accomplish this? I've tried using the enumitem package but it doesn't want to align the labels (not the items) to the right as in the above example. When using the multiline style option items either overlap or bump into eachother. I'm trying to recreate something like this in LaTeX: http://europass.cedefop.europa.eu/img/dynamic/c1477/type.FileContent.file/CVExamples2_nl_NL.pdf               \usepackage{enumitem}     \setdescription{style=multiline,topsep=10pt,leftmargin=5cm,font=\normalfont}          \section{Experience}     \begin{description}       \item[Data] 2011 - heden (20 weken)        \item[Beroep of functie] Software Developer       \item[Voornaamste werkzaamheden en verantwoordelijkheden] Software ontwikkeling        \item[Naam en adres van de werkgever] Multicast Automatisering B.V.        \item[Soort onderneming of sector] Informatie Communicatie Technologie (ICT)     \end{description}


title: Modifying the latex code from tabular() in r so that output is not cut off and is displayed properly?

text: I am using the r function `tabular()` to produce tables that I can turn into pdfs. The output looks fine, except for some of the tables I am producing. When I compile the pdfs, the table is cutoff on the page, in the sense that it should continue onto another page but there is no other page of output but the latex code is there for the rest of the table. The tables are sometimes not quite centered either. Is there a simple option I am missing in tabular that will remedy this? Below is the stuff I have added to the `latex()` output from r. Thanks.               \documentclass{article}     \usepackage{rotating}     \begin{document}     \pagenumbering{gobble}     \begin{sidewaysfigure}     \begin{tabular}          .....          \end{tabular}     \end{sidewaysfigure}     \end{document}


title: How to reproduce typesetting of coupling constant in chemmacros

text: I am using the fonts `libertine` with newtxmath and `beramono` together with the `chammacros` package to typeset experimental data. This works very well and I get the desired results. This package manages to typeset the coupling constant in a way that its prescript is very close to the letter J. When I try to achieve the same result text, I fail, even though I am using packages like `mathtools` of `leftidx`but they don't meet my needs it their standard version. Here is a MWE               \documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{libertine}     \usepackage[scaled=.83]{beramono}     \usepackage[libertine]{newtxmath}          \usepackage{chemmacros}     \chemsetup[nmr]{       delta = (ppm) ,       pos-number = side ,       use-equal,       format = \bfseries,       list=true     }     \usepackage{siunitx}     \sisetup{       separate-uncertainty ,       per-mode = symbol ,       range-phrase = -- ,       detect-mode = false ,       detect-weight = true ,       mode = text ,       text-rm = \libertineLF % use libertine with lining figures     }          \ExplSyntaxOn     \cs_set_protected:Npn \__chemmacros_nmr_coupling:w (#1;#2)       {         \tl_set:Nn \l__chemmacros_nmr_coupling_bonds_tl { #1 \! }         \tl_set:Nn \l__chemmacros_nmr_coupling_nuclei_tl           {             \c_math_subscript_token               { \chemmacros_chemformula:n { #2 } }           }         \__chemmacros_nmr_coupling_aux_i:w       }     \cs_set_protected:Npn \chemmacros_nmr_number:n #1       {         $ #1 $ \, % put the number in math-mode for lining figures         \chemmacros_atom:V \g__chemmacros_nmr_element_tl       }     \ExplSyntaxOff          \begin{document}     Good way:     \begin{experimental}       \NMR(400)[C6D6] \val{2.01} (d, \J(1;CH)[Hz]{25.0}, \#{24}, \pos{5})     \end{experimental}     Not so good way:     $\prescript{1}{}{J}$ coupling          \end{document}      I believe `chemmacros` is using `mathtools` internally from what I remember from the documentation, but appparently in a smarter way than I do.


title: catoptions causes option clash with xcolor

text: Look at the following example:               \documentclass{scrartcl}          \usepackage{filecontents}     \begin{filecontents}{my1.sty}        \RequirePackage{xcolor}        \RequirePackage{catoptions}     \end{filecontents}     \begin{filecontents}{my2.sty}        \RequirePackage{xcolor}     \end{filecontents}               \usepackage[cmyk]{xcolor}     \usepackage{my1}     \usepackage{my2}          \begin{document}        \rule{2cm}{2cm}     \end{document}      `catoptions` seems to cause an option clash if there is a `\RequirePackage{xcolor}` somewhere after it. Everything works fine if I load `my2` before `my1` but I can’t ensure that this won’t happen. `my1` is a place holder for my `menukeys` package, `my2` is a place holder for any other package requiring `xcolor`.


title: Using pgfplots, is there a way to get the same data range for two plots in different figures without entering the bounds manually?

text: Example:               \documentclass{article}     \usepackage{pgfplots}     \begin{document}          \begin{figure}     \begin{tikzpicture}     \begin{axis}     \addplot table {         0 0         1 0     };     \end{axis}     \end{tikzpicture}     \caption{Figure 1}     \end{figure}          \begin{figure}     \begin{tikzpicture}     \begin{axis}     \addplot table {         0 1         1 1     };     \end{axis}     \end{tikzpicture}     \caption{Figure 2}     \end{figure}          \end{document}      Here, the first plot ends up with the y range [-1, 1] while the second plot ends up with the y range [-0.8, 1.2]. I want both plots to have the same range that automatically covers both lines. How can I do this without entering ymin/ymax manually?


title: Theorem/Definition/Lemma problem --- Numbering

text: I am trying to work on the numbering of the theorems/definitions/lemmas etc., and I have some problems with the numbering. I would like the theorems, propositions, corollarys, definitions, conjectures, examples to follow the same numbering, and to reduce the numbering. For example, in my code below, the stuff goes as follows: > Chapter 1 > > Addition > > 1.1 Basics (SECTION) > > Definition 1.1.1. > > Theorem 1.1.1. > > Theorem 1.1.2. > > Example 1.1.1. > > 1.1.1. Some tips (SUBSECTION) > > Definition 1.1.2. > > 1.2 Advanced stuff (SECTION) > > Definition 1.2.1. But how would I get it to be like this below?: > Chapter 1 > > Addition > > 1.1 Basics (SECTION) > > Definition 1.1 > > Theorem 1.2 > > Theorem 1.3 > > Example 1.4 > > 1.1.1. Some tips (SUBSECTION) > > Definition 1.5 > > 1.2 Advanced stuff (SECTION) > > Definition 1.6 And for each new **chapter** , how would I get the numbering to be resetted? Like it would be Definition 2.1, Theorem 2.2, Theorem 2.3 for chapter 2. I like the layout of my table of contents, i.e. Part I is addition and subtraction, Part II is Multiplication and division, and I am happy with the way the sections and subsections are working, but I just want to definitions, theorems etc. to be corrected.               \documentclass[11pt,a4paper]{report}     \usepackage{amsmath,amsfonts,amssymb,amsthm,epsfig,epstopdf,titling,url,array}               \theoremstyle{plain}     \newtheorem{thm}{Theorem}[section]     \newtheorem{lem}[thm]{Lemma}     \newtheorem{prop}[thm]{Proposition}     \newtheorem*{cor}{Corollary}          \theoremstyle{definition}     \newtheorem{defn}{Definition}[section]     \newtheorem{conj}{Conjecture}[section]     \newtheorem{exmp}{Example}[section]          \theoremstyle{remark}     \newtheorem*{rem}{Remark}     \newtheorem*{note}{Note}                              \begin{document}     \tableofcontents          \part{Addition and Subtraction}          \chapter{Addition}     \section{Basics}     \begin{defn}     Here is a new definition     \end{defn}     \begin{thm}     Here is a new theorem     \end{thm}     \begin{thm}     Here is a new theorem     \end{thm}     \begin{exmp}     Here is a good example.     \end{exmp}     \subsection{Some tips}     \begin{defn}     Here is a new definition     \end{defn}     \section{Advanced stuff}     \begin{defn}     Here is a new definition     \end{defn}     \subsection{Warnings}     \begin{defn}     Here is a new definition     \end{defn}          \chapter{Subtraction}     \section{Basics}     \subsection{Some tips}     \section{Advanced stuff}     \subsection{Warnings}          \part{Multiplication and Division}          \chapter{Multiplication}     \section{Basics}     \subsection{Some tips}     \section{Advanced stuff}     \subsection{Warnings}          \chapter{Division}     \section{Basics}     \subsection{Some tips}     \section{Advanced stuff}     \subsection{Warnings}                    \end{document}


title: Scale font only vertically (poor man’s condensed of Libertine)

text: I’m using Linux Libertine to typeset the translation of a poem with `eledmac`/`eledpar`. The original text appears on the left pages and the translation on the right ones. Since the translated verses are longer then the original once it happens often that a single word of the translated verse breaks in a new line. This is ok, but I thought about scaling the font of the translated font slightly in the vertical direction to create a _poor man’s condensed_ version of Libertine. I know that this is not the best way but I want at least see if it looks that bad.               \documentclass[parskip=full]{scrartcl}          \usepackage{libertine}          \usepackage{geometry}     \geometry{showframe,textwidth=70mm}          \begin{document}     This is a text that is a little to long for this line.          \addfontfeatures{Scale=0.965}     This is a text that is a little to long for this line.     \end{document}      ![scaled fonts](http://i.stack.imgur.com/JXbIh.png) I’m aware of `fontspec`’s `Width` option, but it won’t work for Libertine and `Scale` affects width and height. All solutions taking an argument (e.g. `\scalebox`) wont work here, because I can’t wrap all verses in such a macro. So I need a switch like `\addfontfeature` or something else.


title: Vertical numbering with multienumerate environment

text: I'm trying to get the numbering in the `multienumerate` environment to go vertically instead of horizontally. So,               \documentclass{article}          \usepackage{multienum}          \begin{document}          \begin{multienumerate}         \mitemxx{item 1}{item 4}         \mitemxx{item 2}{item 5}         \mitemxx{item 3}{item 6}     \end{multienumerate}          \end{document}      Is there an obvious way to do this? I've tried a number of different ways of getting an enumerated list into a `tabular` environment with the item numbers aligned, to no avail so far. Thanks for any help.


title: Remove page break before glossary

text: I have a problem with `glossaries` package. When I insert my glossary with `\printglossary[title=Glossaire]` it is inserted in page IV. But my glossary start on page V ; the `printglossary` make a page break before adding my glossary and I don't want that. I try to use `\let\cleardoublepage\clearpage` before `\printglossary` and that doesn't work, I had again a page break. I also try to give `onepage` or `oneside` options to my `\documentclass` and that doesn't work too. How can I do to remove the page break before my glossary ? \-- Here is pages IV and V. And my Table of Contents. ![pages IV and V](https://lut.im/WjVT7NoA/IKXwpC3j) ![Table of Content](https://lut.im/oURGD4wu/3iEZgc76)


title: Why \leaders and \mkern works strangely in different font size?

text: I can hardly determine a good title for this question, I'm sorry. Minimal test code:               \documentclass{minimal}     \usepackage{lipsum}     \begin{document}     foo     {\fontsize{18}{18}\leaders\hbox{$\mkern 10000mu.\mkern 10000mu$}\hfill}     bar          \lipsum     \end{document}      If I compile this, `bar` and the result of `\lipsum` is gone. It's amazing. And,   * If I replace the arguments of `\fontsize` with 15 or 20, everything is correct!    * If I replace `\hbox{$\mkern 10000mu.\mkern 10000mu$}` to something else, e.g. delete one `\mkern 10000mu`, the result may be correct too. I know that `\fontsize` changes the length of a mu unit. But I totally cannot understand what happens. Here is an example of Plain TeX:               % fine     % Width of hbox less than \maxdimen     a\leaders\hbox{\kern8000pt.\kern8000pt}\hfill b          text text     \vfill\eject          % BAD: text after the leaders is gone     % Width of hbox more than \maxdimen     a\leaders\hbox{\kern10000pt.\kern10000pt}\hfill b          text text     \vfill\eject          % fine?     % Width of hbox more than \maxdimen     a\leaders\hbox{\kern12000pt.\kern12000pt}\hfill b          text text     \vfill\eject          \bye      I wonder why a box of 20000pt width makes wrong output, but a box of 24000pt width seems correct. I know it is an overflow thus it cannot be a bug of TeX, but what happens? * * * **Background** The code comes from `tocloft` package. Now I believe it is a bug of `tocloft`. In `tocloft`, it defines               \providecommand{\cftdotfill}[1]{%       \leaders\hbox{$\m@th\mkern #1 mu\hbox{\cftdot}\mkern #1 mu$}\hfill}      And `\cftnodots` is `10000`. Then this test file fails:               \documentclass{article}     \usepackage{tocloft}     \renewcommand{\cftsecleader}{\fontsize{16}{19}\cftdotfill{\cftnodots}}     \usepackage{lipsum}          \begin{document}          \contentsline{section}{TEST}{1}          \lipsum     \end{document}      I can fix the bug by redefining `\cftdotfill` to               \renewcommand{\cftdotfill}[1]{%       \leaders\hbox to #1\p@{\hss\cftdot\hss}\hfill}      But the bug still shocked me.


title: Why does TeX remove braces around delimited arguments?

text: On pp. 203-204 of the TeXbook, Knuth describes how TeX absorbs macros' arguments: delimited go until the first appearance of the delimiter, and undelimited go until the next token, in both cases respecting brace groups. But then he says: > In both cases ,if the argument found in this way has the form `'{<nested > tokens>}'`, where `<nested tokens>` stands for any sequence of tokens that > is properly nested with respect to braces, the outermost braces enclosing > the argument are removed and the `<nested tokens>` will remain. This is a very annoying feature for delimited arguments! For example, in this question, there is no good way to deal with a macro `\macro#1\pgfeov` where `#1` may either be a single braced argument or a pair of arguments, because the braces are removed by the argument scanner and then the result (if not double-braced) looks like multiple tokens and so is caught (by an inner macro) as more than one argument even though I put braces around it. I consulted the TeXbook in the hopes that some kind of explanation would be given, but there is not even an exercise on the subject. Can anyone suggest why this is a useful feature? **Edit:** I want to clarify that I am not talking about "arguments" in the imperative-language sense where one tries to treat macros as functions, passing its inputs as, say, `\macro[#1]<#2>(#3,#4)`. I mean them in the sense described above: token lists absorbed by TeX by parsing text. I also want to add that I am less interested in workarounds than in the answer to the question in the title: why (philosophically) does TeX work like this? For example, I know that the reason that spaces are ignored after control words is that if they were not, there would be no way to _omit_ a space after one, since the scanner will keep piling on letters to the macro name until it no longer can. So there is a benefit to this rule; it makes the language more powerful.


title: TikZ: How to get a few smooth grid lines for surface plots

text: I want to produce smooth surface plots with smooth grid lines using TikZ/pgfplots. Usually, this can be achieved using e.g. `[samples=100]`, but this also draws 100 grid lines. I basically want that   1. the surface and the grid lines are computed using many help points (samples) to make it smooth    2. but only a fraction of the grid lines shall be drawn. I've browsed the documentation, but couldn't find anything helpful in that direction. All the surface plot examples which I found showed edgy grid lines giving the surface a faceted look instead of the smooth pictures I want to achieve. Here's a minimal working example for two different sample values:               \documentclass{article}     \usepackage{tikz, pgfplots}          \begin{document}          \begin{tikzpicture}        \begin{axis}[samples=10]           \addplot3[surf, domain=-2:2] {x^2-y^2};        \end{axis}     \end{tikzpicture}          \begin{tikzpicture}        \begin{axis}[samples=100]           \addplot3[surf, domain=-2:2] {x^2-y^2};        \end{axis}     \end{tikzpicture}          \end{document}      ![Output from MWE](http://i.stack.imgur.com/1vYV6.png) In the first picture, the lines are too edgy, in the second picture all the many lines are drawn. How can I achieve a smooth looking surface with **only a few** , but **smooth** , grid lines?


title: Text Meta-label

text: ![Labels](http://i.stack.imgur.com/OpS2n.jpg) I'm trying to reproduce the effect pictured here in LaTex. I would like to be able to label parts of a sentence to help my students with grammar. Is something like this possible? I'm not aware of any packages that do this. {I wasn't sure what tag to give this; if tikz is wrong, please feel free to correct.} Thanks for your help.


title: Section header for references shows wrong number

text: So I downloaded a nice looking article template which has a custom look for section titles. But now the number next to the References header is the same as that of the last section. How do I fix this? Showing no number at all has my preference, but showing the correct section number is fine too.               \documentclass[twoside]{article}     \usepackage{titlesec}% Allows customization of titles     \titleformat{\section}[block]{\large\scshape\centering{\Roman{section}.}}{}{1em}{} % Change the look of the section titles           \begin{document}          \section{Introduction}     \subsection{Problem description}          Blah blah blah.     \subsection{Another section}          Another section.     \begin{thebibliography}{9}          \bibitem{ref}       some reference.     \end{thebibliography}          \end{document}


title: Getting a section to not appear in beamer tables of contents

text: How do I do that? How would I get this one section frame to not appear?               \section{Section}     \subsection{}     \frame{     }


title: Best way to cite interviews or conversations with BibTeX?

text: I'm writing a master thesis where part of the source material is from conversations with employees and is not necessarily written anywhere. What would be the best way to cite this? I am considering using `@misc` and just have `title="Information from <3-4 people in the company>"` and then cite to this whenever I feel it is needed in the paper. Another solution could be to use the preface to thank for the help and explain that some of the information is taken directly from them. However, I feel this is not accurate enough. Of course I could try and ask them for written information about it, but I fear this would take too much time, since the deadline is not that far away.


title: Increase spacing in closing of cover letter in moderncv

text: Using the `moderncv` package, how do I increase the spacing between the closing and the name after the closing i.e. increasing the space between "Yours faithfully" and "John Doe" in this picture ![picture](http://i.stack.imgur.com/FMigV.png) This is the default `template.tex` available at http://www.ctan.org/tex- archive/macros/latex/contrib/moderncv/examples.


title: How can I change the counters of tables in the appendices?

text: I have multiple appendices and in some appendices I have tables. What I want is that each appendix itself has a letter as a number (e.g. Appendix A: title). A second thing that I want to achieve is that the table in each appendix are numbered by a letter and a number, the letter corresponding by the appendix the table is in, and number should start from 1 in each appendix. The second table in the second appendix should be numbered B2, no matter how many tables I have in the first appendix. I am able to use letters as numbers for my appendices, but not in the correct form. I can refer to the tables in the text (but not in the correct way, I use "see Table B\ref{results}" for instance). I cannot seem to change the numbering of the tables itself. The numbering starts with 1 and adds up. I don't know how to put a letter in front of it.


title: Using \usepackage[active,tightpage]{preview} does not generate any page

text: What is wrong with this code?               \documentclass{article}     \usepackage[active,tightpage]{preview}     \begin{document}     \(1 + 1 = 2\)     \end{document}      I get this error.               $ pdflatex bar.tex     This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)      restricted \write18 enabled.     entering extended mode     (./bar.tex     LaTeX2e <2011/06/27>     Babel <3.9f> and hyphenation patterns for 2 languages loaded.     (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))     (/usr/share/texmf/tex/latex/preview/preview.sty     (/usr/share/texmf/tex/latex/preview/prtightpage.def)) (./bar.aux)     Preview: Fontsize 10pt     Preview: PDFoutput 1     (./bar.aux) )     No pages of output.     Transcript written on bar.log.      Can you please help me to fix this? I want the behavior of `\documentclass[preview]{standalone}`. Both text and math should be rendered, however the page size should be cropped so that is large enough to fit all content, but no larger than that.


title: Updating an autocompletion in TeXnicCenter

text:
I am trying to update the `figure` autocomplete in TeXnicCenter (TXC) to suit how I use `figure`s. I believe I need to alter the Tex.xml file in `C:\Program Files\TeXnicCenter\Packages` and then restart TXC. I have changed the `figure` entry to               <lxEnvironment name="figure"      parameters="1"      desc="Provides a figure environment for pstool"     icon="format.bmp"     index="9"     expafter="}%
\centering%
\psfragfig[width=0.8\textwidth]{test_chapter/test1_matlabfrag_20130917T1147_W3H1b}%
\caption{qwe2}%%
\label{fig:f1}%%
%
\end{figure}"     expbefore="\begin{f"/>      Strangely, in the application the autocomplete for figure still behaves as it did before I made this alteration. I don't know where TXC is getting the data now. Any suggestions on what I need to do to change autocomplete? My current work around is to add a text module in the insert menu. The only problem is this is a menu click rather than an autocomplete.


title: Minus sign in Table

text: What is the correct way of doing a minus sign in a LaTeX Table? The minus sign I'm doing seems much longer than the minus sign in math mode.


title: How to change thanks symbol in beamer

text: My code is               \documentclass[14pt]{beamer}% http://ctan.org/pkg/beamer     \let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764     \usetheme{Berkeley}     \usepackage[timeinterval=1]{tdclock}     \makeatletter     \beamer@headheight=1.5\baselineskip     \makeatother     \setbeamercolor{normal text}{bg=black!10}                    \begin{document}     \title[Title]{My title%     \thanks{\scriptsize Project supported by foundation: }} %<<----this place     \subtitle{Subtitle}     \author{Author}     \institute[Institute]{My institute}     \date[\initclock\tdtime]{\today}     \logo{\color{blue!50}\scalebox{2}{\TeX}} % you can % it     \begin{frame}       \titlepage     \end{frame}          \section{A section}     \subsection{A subsection}     \begin{frame}       \frametitle{Frame title}       \framesubtitle{frame subtitle}       Some text     \end{frame}          \begin{frame}       Some more text     \end{frame}          \section{Another section}     \subsection{Another subsection}     \begin{frame}       Some final text     \end{frame}     \end{document}      I want to change the 1 to, for example, \aleph like below. How can I do this? thanks for advance. ![enter image description here](http://i.stack.imgur.com/gumr4.jpg)


title: Linking Latex Tables to Beamer

text: Is there a way to link Latex table titles to Beamer? If I change the table titles in Latex and I want to include these titles in my Beamer tables, is there a way to have these titles automatically sent into Latex?


title: Placing a table next to figure (align table vertically centre)

text: I would like to place a table and figure side by side in my document. I have achieved this with the following code               \documentclass[a4paper,10pt]{article}          \usepackage{floatrow}     \usepackage{color}     \newfloatcommand{capbtabbox}{table}[][\FBwidth]          \begin{document}     \begin{figure}       \begin{floatrow}          \ffigbox[\FBwidth]%         {\includegraphics*[width=0.45\textwidth]{LiverPhantom.png}}         {\caption{Liver Phantom}%         \label{fig:Zoom}%       }       \capbtabbox{%          \begin{tabular}{|c|cc|cc|cc|} \hline          \textbf{Head} & \multicolumn{6}{c|}{\textbf{Pixel Width}} \\ \hline               & \multicolumn{2}{c|}{\textbf{Picker}} & \multicolumn{2}{c|}{\textbf{Blue}} & \multicolumn{2}{c|}{\textbf{Red}} \\                & X & Y & X & Y & X & Y \\ \hline          \textbf{H1}   & 79.9 & 80.0 & 87.3 & 87.5 & 87.7 & 87.1 \\          \textbf{H2}   & 79.4 & 79.3 & 87.5 & 87.1 & 87.3 & 87.2 \\          \textbf{H3}   & 80.2 & 80.4 & - & - & - & -\\ \hline          \textbf{Mean} & \multicolumn{2}{c|}{\textbf{\color{red}79.9}} & \multicolumn{4}{c|}{\textbf{\color{red}87.3}} \\ \hline         \end{tabular}          }{           \caption{Phantom pixel width}           \label{fig:ZoomTBl}       }       \end{floatrow}     \end{figure}     \end{document}      However, the bottom boundaries of the figure and table have the same y-coordinate. Is it possible to align the table vertically centre with respect to the figure?


title: how to add section number and name to the page header

text: I'm trying to modify the page layout of my thesis. I'd like to have at the top-right corner the section number **and section title** and at the top left corner the page number. Using the following:               \usepackage{fancyhdr}          \begin{document}          \pagestyle{fancy}     \lhead{\thesection}     \chead{}     \rhead{\thepage}     \lfoot{}     \cfoot{}     \rfoot{}      I get what expected. However I'd like to add the section name. I've tried:               \pagestyle{fancy}     \lhead{\thesection}{thesectiontitle}     \chead{}     \rhead{\thepage}     \lfoot{}     \cfoot{}     \rfoot{}      but of course it didn't work. I think it requires a bit more of programming but I only have a basic Latex tutorial so far where I can't find useful information. Thank you in advance for any advice


title: Removing part of a symbol or image

text: Tidying up and posing a secondary question which was answered I'm trying to put together a visual aid of people numbers in a particular area, so I imagine using something like. Answered elsewhere using the `marvosym` package with `\Gentsroom` as the symbol. ![Man image](http://i.stack.imgur.com/nOH5u.png) Is there an easy way to shade out half the image e.g. If I'm using each figure to represent four people and I want to indicate 2 by using half a figure? Link to earlier question below Question on human shape in tikz Note: The title is terrible but all I can think of. Please feel free to edit it.


title: fancyhdr equivalent in ConTeXt

text: In LaTeX the `fancyhdr` package provides the `lhead`, `chead` and `rhead` macros that allow me to create the left, center and right parts of the header. These macros also enable me to treat each part of the header as a column. For example the following MWE:               \documentclass{article}          \usepackage{fancyhdr}     \pagestyle{fancy}          \lhead{\textbf{A\\ B}}     \chead{\textbf{C\\ D}}     \rhead{\textbf{E}}          \begin{document}          Some Text          \end{document}      Produces the following document: ![MWE](http://i.stack.imgur.com/xaGfI.png) Notice how A and B are stacked on top of each other. How can I achieve this in ConTeXt?


title: Include one TeX file into another

text: I have `main.tex` file with:               \documentclass[]{report}     \begin{document}     \input{filename.tex}     \end{document}      Let say `filename.tex` have the following content:               \begin{abstract}     text         \end{abstract}      Everything works, by TeXstudio IDE don't recognize any commands in `filename.tex`, because it doesn't have declaration of the document class. And so, it becomes inconvenient to work with this file. Is there any better way to include files one into another?


title: Write18: capturing shell (script) output as command/variable?

text: Let's say I compile the following file with `pdflatex -shell-escape test.tex`:               \documentclass{minimal}          \begin{document}          File listing is:          \immediate\write18{ls /usr}          \end{document}      This will send the output of the command `ls /usr` to report/log of `pdflatex` (primarily to `stdout`). There are then two cases I'd like to utilize:   * The output of `ls /usr` being included directly in the document (LaTeX stream).   * The output of `ls /usr` becoming the contents of a `\newcommand` (by this I mean, that I'd like the script to be executed when the `\newcommand` is executed first - and upon subsequent calls to the new command, the shell code should not be executed anew).  I have read through How to execute shell script from LaTeX?, but I'm not sure if this "pipe input" can be applied to `\newcommand`. I have also read through tex - How can I save shell output to a variable in LaTeX? \- and it seems that Tex' file I/O should be used; but I'm quite disliking the fact that I'd still have to redirect the script output (actually, in this case, the `ls /usr` output) to a file, and then read it in, to have it as contents of a command. So, is there an easier way to achieve what I'd want (hopefully, illustrated through an example based on the above code)?    EDIT: Ehm, I should have asked one more question earlier :) I'll try with an edit here, although it will probably get missed .. :) I originally asked for a `\newcommand` that will execute shell code only upon its definition (i.e., in a sense it is "cached"); and the answer from @egreg does exactly that. But then - would it be possible to have a different `\newcommand` definition, such that each time this newcommand is called, the shell command is executed anew? I.e. executing something like `\@@input|"cat tempfile"` (which cannot be executed as such), where `tempfile` changes between calls?


title: References in margins `biblatex`

text: How can I use `biblatex` and not have the references run into the margins? I've seen some posts and solutions to this problem pertaining to URLs but I'm not using web links so it's a different problem. `biblatex` appears to not want to break the titles of books. My `\usepackage` statement, if it helps, is as follows:               \usepackage[citestyle=authoryear,bibstyle=authoryear,sorting=nyt,        eprint=false,isbn=false,url=false,doi=false]{biblatex}


title: beamer note spacing issue

text: I’m having a problem with beamer, where the first paragraph in a note has different spacing from subsequent ones. MWE:               \AtBeginDocument{\setbeameroption{show notes on second screen=left}}          \documentclass[17pt]{beamer}     \usepackage{pgfpages}     \setbeamertemplate{note page}{\insertnote}          \begin{document}          \begin{frame}{Title}     Content     \end{frame}          \note{Hello everyone, and welcome to my talk. Today I'll be presenting     about Title.}          \begin{frame}{Introduction}     Content     \end{frame}          \note{Title first came to prominence in 1883 when Author first described     the phenomenon.          There has since been a great deal of subsequent research on it.}          \end{document}      comes out as ![enter image description here](http://i.stack.imgur.com/f1XLi.png) The first paragraph is single-spaced, but the next one is double-spaced. Any idea how I can fix this?


title: Index Exponent with LaTeX

text: Please, how can i write               C i,j       in LaTeX (`i` as an index and `j` an an exponent)? I know just that:               C^j     C_i


title: siunitx number too big when trying to round

text: Using the `siunitx` package               \usepackage{siunitx}      I am trying to put numbers with plenty of decimal digits in a table while rounding them to 3 digits after the decimal point. There is a compilation error saying `! Number too big.`. I tried to change the expected digit amounts to a thousand, but this does not work:               \begin{table}       \sisetup{         table-number-alignment = center,         table-figures-exponent = 1000,         table-figures-integer = 1000,         table-figures-uncertainty = 1000,         table-figures-decimal = 1000,         table-sign-mantissa,         table-sign-exponent,         table-auto-round       }       \begin{tabular}{         S         S         S         S       }       0.2 & 0.6903200460356393 & 0.625 & -6.532004603563935e-2 \\        \end{tabular}     \end{table}      Is there a fix?


title: Generate only the index, no main body text

text: I would like to discard the entire document and have _only_ the index remaining. Note:   * This is a follow up to an earlier question of mine Remove page number from index entries.   * This document is an index of hyper linked files, so the content is not useful. My naive attempt below does not produce any output. I want Page 2 of the document that gets generated if the `\usebox{\DiscardBox}` line is un- commented, but not Page 1. ## Code:               \documentclass{article}     \usepackage{imakeidx}     \usepackage{hyperref}          \makeindex[columns=1]          \newsavebox{\DiscardBox}          \begin{document}       \savebox{\DiscardBox}{%         Test\index{foo}         Testing\index{bar}       }%       %\usebox{\DiscardBox}            \printindex     \end{document}


title: Gnuplot and PDFLatex question

text: I'm trying to use Gnuplot and package `gnuplottex` to create plots directly in LaTeX. Started with the following simple example               \documentclass[a4paper]{article}     \usepackage[shell]{gnuplottex}          \begin{document}     \begin{gnuplot}[terminal=pdf,terminaloptions={font ",10" linewidth 3}]     plot sin(x), cos(x)     \end{gnuplot}     \end{document}      When I run               pdflatex  -synctex=1 -interaction=nonstopmode --enable-shell %.tex      I get the following warning messages:               Package gnuplottex Warning:Shell escape not enabled          Package gnuplottex Warning:Please convert example1-gnuplottex-fig1.gnuplot manually          ...      No pages of output. I'm using MikTeX, TeXmaker and Gnuplot 4.5. Any help will be much appreciated!


title: I cannot run any cmd in WinEdt

text: I am using WinEdt(Build: 20110315 (v. 6.0)) with MiKTeX(2.9.4282). I have used it for years, it was all OK one hour ago. But now I cannot click the button to run the cmd. I do not know what I did any thing wrong. When I **click** the pdflatex icon(or any others cmd, next the recycle bin icon), it simply says in the windows > Startup folder: E:\Poster_Li > > Error launching Console Application PDFLaTeX Command Line: pdflatex.exe > "filename.tex" Startup Folder: E:\Poster_Li > > Invalid folder name (above in English, this line is given in local > language). It seems that the Startup folder is fixed to E:\Poster_Li. I have deleted E:\Poster_Li. On the other hand, I can still use cmd line such as pdflatex filename.tex to compile files (I do not like this way.).


title: Can't I put a list inside an \lrbox?

text: I want to have a list in my saved box. Why doesn't the following work?               \documentclass{article}     \usepackage{setspace}          \newsavebox{\mybox}          \newenvironment{myenv}{%       \begin{lrbox}{\mybox}%       \begin{list}{}{}%     }{%       \end{list}%       \end{lrbox}%       \usebox{\mybox}%     }%          \begin{document}     \begin{myenv}     \item First item.     \item Second item.     \end{myenv}     \end{document}       Must I use a `\minipage`?


title: \ref{} does not work under certain circumstances

text: So I know that the problem is at               \setcounter{secnumdepth}{0}      But I don't know if there is a fix to this (without deleting this line, since I don't want numbered sections), since the link in ToC is fine. Basically the effect I want is to have a clickable link on one arbitrary word I write (just like the URL where the link is behind the text).               \documentclass[12pt]{article}     \usepackage{hyperref}     \title{Test}     \setcounter{secnumdepth}{0}     \begin{document}     \maketitle     \tableofcontents     \section{Test}\label{sec:test}     There should be a clickable link: \ref{sec:test}\\     But this works:     \autoref{sec:test}\\     And this also works:     \pageref{sec:test}\\     \end{document}


title: Aligning matrices by headlines, TikZ

text: 1) How to align the two matrices (B) and (C) by their first row? 2) I took fancy in this "random steps" decoration. The manual, however, says nothing about it. Any tips/links on this fascinating decoration?               \documentclass{standalone}     \usepackage{comment}          \usepackage{tikz,pgf}          \usetikzlibrary{fit,scopes,arrows,calc,shapes.misc,shapes.arrows,chains,matrix,positioning,decorations.pathmorphing,shapes,backgrounds}          \begin{document}          \tikzset{         fuzzy/.style = {decorate, decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}},         ns/.style = {             % The shape             rectangle,             % The size             minimum size = 6mm,              rounded corners = 3mm,             % The border             very thick,             draw,             % The font             font = \ttfamily,             fuzzy         }     }          \newcommand{\bbrect}[3]{\node[rectangle,fuzzy,draw,fit=(B-#1-2.north west) (B-#2-2.south east), inner sep = 0pt] (block#3) {}}     \newcommand{\cbl}[2]{\node[rectangle,fuzzy,draw,fit=(C-#1-1.north west) (C-#1-1.south east), inner sep = 0pt] (cblock#2) {}}          \begin{tikzpicture} [             >=latex, thick,              /pgf/every decoration/.style = {/tikz/sharp corners},             fuzzy/.style = {decorate, decoration = {random steps, segment length = 0.5mm, amplitude = 0.15pt}},             minimum size = 6mm, line join = round, line cap = round,             ns/.style = {rectangle, draw, fill = white, fuzzy, rounded corners = 3mm},             node distance = 6mm,             tip/.style = {->,shorten >= 1pt,fuzzy},             every join/.style = {fuzzy, rounded corners = 2mm},             hv path/.style = {to path = {-| (\tikztotarget)}},             vh path/.style = {to path = {|- (\tikztotarget)}},             skip loop/.style = {to path = {-- +(0,#1) -| (\tikztotarget)}},             BarreStyle/.style={opacity = 0.2, line width = 3 mm, rectangle},         ]         \ttfamily         \begin{scope}                 \matrix (B) [matrix of nodes, ampersand replacement = \&] {                     \hline                     {Col 1} \& {Col 2}\\                     \hline                     {fsdf} \& {12}\\                     {xxfd} \& {7}\\                     {fsdf} \& {2}\\                     {} \& {2}\\                     {} \& {2}\\                     {} \& {2}\\                     {} \& {2}\\                     {} \& {2}\\                     {} \& {7}\\                     {} \& {7}\\                     {} \& {2}\\                     {} \& {2}\\                     {} \& {2}\\                     {} \& {8}\\                     {} \& {4}\\                     {} \& {4}\\                     {} \& {4}\\                     {} \& {4}\\                     {} \& {4}\\                     {} \& {4}\\                     {} \& {9}\\                     {} \& {11}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {1}\\                     {} \& {5}\\                     {} \& {5}\\                     {} \& {5}\\                     {} \& {6}\\                     {} \& {6}\\                     {} \& {6}\\                     {} \& {10}\\                     {} \& {3}\\                     {} \& {3}\\                     {} \& {3}\\                     {} \& {0}\\                     {} \& {0}\\                     {} \& {0}\\                     {} \& {0}\\                     {} \& {0}\\                     {} \& {0}\\                     {} \& {0}\\                     {} \& {0}\\                     {} \& {0}\\                 };                 \bbrect{2}{2}{1};                 \bbrect{3}{3}{2};                 \bbrect{4}{9}{3};                 \bbrect{10}{11}{4};                 \bbrect{12}{14}{5};                 \bbrect{15}{15}{6};                 \bbrect{16}{21}{7};                 \bbrect{22}{22}{8};                 \bbrect{23}{23}{9};                 \bbrect{24}{32}{10};                 \bbrect{33}{35}{11};                 \bbrect{36}{38}{12};                 \bbrect{39}{39}{13};                 \bbrect{40}{42}{14};                 \bbrect{43}{51}{15};             \end{scope}                  \begin{scope}[xshift = 5cm]                 \matrix (C) [matrix of nodes, ampersand replacement = \&] {                     {12}\\                     {7}\\                     {2}\\                     {7}\\                     {2}\\                     {8}\\                     {4}\\                     {9}\\                     {11}\\                     {1}\\                     {5}\\                     {6}\\                     {10}\\                     {3}\\                            {0}\\                 };                   \cbl{1}{1};                 \cbl{2}{2};                 \cbl{3}{3};                 \cbl{4}{4};                 \cbl{5}{5};                 \cbl{6}{6};                 \cbl{7}{7};                 \cbl{8}{8};                 \cbl{9}{9};                 \cbl{10}{10};                 \cbl{11}{11};                 \cbl{12}{12};                 \cbl{13}{13};                 \cbl{14}{14};                 \cbl{15}{15};         \end{scope}              \begin{pgfonlayer}{background}             \foreach \i in {1,...,15} {                 \path[draw,fuzzy] (block\i.north east) -- (cblock\i.north west);                 \path[draw,fuzzy] (block\i.south east) -- (cblock\i.south west);             }         \end{pgfonlayer}          \end{tikzpicture}          \end{document}


title: Manually setting the size of a node and forcing contents to 'fill' node

text: I have an expression "a = function(b)" inside a node. But "a =" and "function(b)" appear on separate lines. I can force the node to be wider, but this doesn't change how the writing inside is laid out. How can I fix this? Thanks EDIT: Please see below:               \documentclass[12pt article]{article}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage[latin1]{inputenc}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \begin{document}          \begin{tikzpicture}[node distance = 2cm, auto]          \tikzstyle{block} = [rectangle, draw, fill=blue!20,          text width=5em, text centered, rounded corners, minimum height=4em]          \node [block] (A) {Some writing, a = function(b)};          \end{tikzpicture}          \end{document}


title: Problem with hyperref and umlauts in the path of a link

text: I use hyperref to put links to external files into a TeX-document. That works fine until thera are german umlauts in the name of the external file. Is there any workaround? P.S. It is a problem of the preview function in the editor texstudio. When I open the pdf-file in acrobat raeder, the link works even with umlauts in the path.


title: How newif command works

text: As I haven't got answers to my questions here : How to draw vertical lines using pgfgantt package. So I decided to implement my own command that I added to `pgfgantt.sty` file (I have made a copy). I looked to `pgfgantt.sty` and I cam with this code that works with only one problem :               \newcommand\drawverticalline[1]{%     \begingroup%     \begin{pgfinterruptboundingbox}%     \begin{scope}      \newif\ifgtt@includetitle        \ganttset{%           include title in canvas/.is if=gtt@includetitle,%           include title in canvas           }        \gtt@tsstojulian{#1}{\gtt@today@slot}        \gtt@juliantotimeslot{\gtt@today@slot}{\gtt@today@slot}%        \ifgtt@includetitle%         \def\y@upper{0}%        \else%          \pgfmathsetmacro\y@upper{%           \gtt@lasttitleline * \ganttvalueof{y unit title}%          }%        \fi%       \pgfmathsetmacro\y@lower{%       \gtt@lasttitleline * \ganttvalueof{y unit title}%       + (\gtt@currentline - \gtt@lasttitleline - 1)%       * \ganttvalueof{y unit chart}%       }%       \pgfmathsetmacro\x@mid{%          (\gtt@today@slot - 1 + \ganttvalueof{today offset})%                         * \ganttvalueof{x unit}%        }%       \draw [/pgfgantt/today rule]                     (\x@mid pt, \y@upper pt) -- (\x@mid pt, \y@lower pt)                     node [/pgfgantt/today label node] {\ganttvalueof{today   label}};%      \end{scope}      \end{pgfinterruptboundingbox}%       \endgroup%     }      This is just an example to show that it works. Here's what I get with this code :               \documentclass{article}     \usepackage[frenchb]{babel}       \usepackage{pgfgantt}     \usetikzlibrary{shadows}          \begin{document}     \begin{tikzpicture} % optional        \begin{ganttchart}[x unit=1.8mm,                        y unit chart=0.87cm,                        time slot format=isodate,                        vgrid=*{5}{dotted},                      ]                       {2014-04-14}{2014-07-11}            \gantttitlecalendar{month=name} \\                  \ganttbar[progress=100]{title1}{2014-04-14}{2014-04-15} \\                 \ganttbar[progress=100]{title2}{2014-04-15}{2014-04-17} \\                 \drawverticalline{2014-05-07}        \end{ganttchart}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Sc7wP.jpg) Normally the line should be draw below the title bar. It's this code that define where we start drawing :               \ifgtt@includetitle%       \def\y@upper{0}%     \else%       \pgfmathsetmacro\y@upper{%         \gtt@lasttitleline * \ganttvalueof{y unit title}%       }%     \fi%      How `\ifgtt@includetitle` works? It's defined like this :               \newif\ifgtt@includetitle     \ganttset{%         include title in canvas/.is if=gtt@includetitle,%         include title in canvas         }


title: Bibliography preamble \bibpreamble natbib

text: I am trying to produce some text after the "References" heading, but before the numbered references themselves. I had read that using the natbib package and the command `\bibpreamble{...insert preamble here...}` should do just that, however, I cannot get this to work. My (abridged) code is as follows:               \bibliographystyle{plainnat}     \bibliography{library}     \bibpreamble{\ \\     For an in-depth discussion on... see     \cite{Baikie1988}, and for ... see     \cite{Cardona1978, Ley1979}.}      This produces the References heading, the numbered references then this block of text at the end. Placing it before the `\bibliographystyle{}` command makes this block of text appear before the References heading. It is as if the command `\bibpreamble{}` is not being recognised by LaTeX. I have also tried using `\newcommand{\bibpreamble}{...text...}` and `\renewcommand{\bibpreamble}{...text...}` but neither of these change the output. Does anybody have any experience with this kind of problem? I am trying not to introduce too many changes to the structure of my document in order to make this work, so the least "invasive" solution would be preferred.


Let us consider the simpler one which is a triangle. According to the `pst- eucl`, ![enter image description here](http://i.stack.imgur.com/0KGc5.png) the point names will be placed on the bisector lines. The below example is contradictory to the above statement. ![enter image description here](http://i.stack.imgur.com/72IKm.png) ![enter image description here](http://i.stack.imgur.com/plGeE.png) ![enter image description here](http://i.stack.imgur.com/F5n0j.png)               \documentclass[pstricks,border=15pt]{standalone}     \usepackage{pst-eucl}          \pstVerb     {         /rv {rand 36000 mod 100 div} def % random number from 0.00 to 359.99     }          \begin{document}          \psLoop{30}{%     \begin{pspicture}[showgrid=false](-2,-2)(2,2)         \pscircle[linestyle=dashed,linecolor=lightgray]{2}         \pstTriangle[linejoin=2](!2 rv PtoC){A}(!2 rv PtoC){B}(!2 rv PtoC){C}%     \end{pspicture}}          \end{document}      Now let us consider any polygon. How to automatically place points names of a polygon on the bisector lines?


title: text above arrow in question "drawing-mechanical-systems-in-latex"?

text: With reference to the first answer in this: Drawing Mechanical Systems in LaTeX I want the text `x` above the arrow, simple as that, also how can I control how high above the arrow it is? So I tried adding an `{$x$}` to the "-latex" arrow, like this:               \draw [-latex,ultra thick] (M.east) ++ (0.2cm,0) -- +(1cm,0) node [midway,above] {$x$};      but the `x` gets boxed, I want it without the box. Maybe one could show me how to cancel for node style that was set in the beginning, but that would remove the box around `m` which is important.


title: how to bold equation in lyx

text: I have equations inside text. I tried to bold equation from lyx text style->series bold but only text is bolded but equations are not. I can make font larger for equation and other options but bold and italic is not working for equations


title: Get \printindex or \lstlistoflisting to TOC with correct numbering

text: So when you create an index or a listoflistings, they are not listed in \tableofcontents.               \appendix     \newpage     \printindex     \newpage     \lstlistoflistings      To make them appear, I entered custom content lines               \appendix     \newpage     \addcontentsline{toc}{section}{Listings}     \lstlistoflistings          \addcontentsline{toc}{section}{Index}     \printindex      They now appear, but without numbering;               A. Bibliography     Listings     Index      How can I make them get the correct numbering? I don't want it to be static, because the order may change or some more appendices are added...


title: How to install unicode-math on Ubuntu 12.04 (Precise Pangolin)?

text: I want to install `unicode-math` to use with XeLaTeX. I use ubuntu 12.04 LTS (because of some incompatibilities of later kernel versions with my HW). Is there a way to install `unicode-math` package? I tried to install it through `apt-get install texlive-math-extra`, but it doesn't seem to be in that package.


title: koma book chapter number with trailing .0?

text: By default, KOMA-Script scrbook produces chapters numbered like "1. Introduction". How can I get a chapter numbered like "1.0 Introduction"?


title: Scaleable 'double border'-rectangle

text: How can I draw a rectangle with a 'double-border', which allows to specify a color for each of its 8 (4 inner, 4 outer) borders separately and does not widen the separating space between the outer and inner rectangle when scaled in a `resizebox`? (Sorry, I'm very new to TikZ.) I tried the following, its shortcomings are: its 3 'rectangles' (inner border equals outer border) and its edges look 'not connected':               \begin{tikzpicture}       \draw[red, double = black] (0,0) -- (1,0);       \draw[green, double = purple] (1,0) -- (1,1);       \draw[blue, double = brown] (1,1) -- (0,1);       \draw[yellow, double = white] (0,1) -- (0,0);     \end{tikzpicture}      ![Here is a picture to illustrate the problem](http://i.stack.imgur.com/7oeUl.png)


title: Plots from externalized TikZ are rotated

text: I just found out about `tikzexternalize` and I love it - well, almost. This is my situation: I have done simulations in Matlab and used matlab2tikz to get the plots from Matlab into my `.tex` document. This worked fine until I reached the point where I got an error because I ran out of memory. Then I found the externalization stuff. When I finally got it to work, my plots were all rotated 90 degrees clockwise. Why? When I just do a simple plot inside my main file, it works fine, so why does it not work for those input files? This is an MWE:               \documentclass[a4paper,fontsize=10pt]{scrartcl}     \usepackage{tikz}     \usetikzlibrary{external}     \tikzexternalize[mode = list and make,optimize=false,     prefix=Bilder/]      \usepackage{pgfplots}     \pgfplotsset{     xlabel=\hspace*{-1.0 ex}\raisebox{-1.5 ex}{$x$},      ylabel=\hspace*{-2.5 ex}\raisebox{-2.5 ex}{$y$}     }          \begin{document}          \begin{figure}     \centering     \input{Bilder/mymatlabfig.tikz}     \end{figure}          \end{document}      where `mymatlabfig.tikz` comes from the `matlab2tikz` script:               % This file was created by matlab2tikz v0.2.3.     % Copyright (c) 2008--2012, Nico Schlömer <nico.schloemer@gmail.com>     % All rights reserved.     %      % The latest updates can be retrieved from     %   http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz     % where you can also make suggestions and rate matlab2tikz.     %      %      %      \begin{tikzpicture}          \begin{axis}[%     view={0}{90},     width=0.5\textwidth,     height=0.394354838709677\textwidth,     scale only axis,     xmin=-4, xmax=4,     ymin=-1, ymax=1,     legend style={align=left}]     \addplot [     color=blue,     solid     ]     coordinates{     (-3.14159265358979,-1.22464679914735e-16)(-3.0133643820147,-0.127877161684506)(-2.88513611043961,-0.253654583909507)(-2.75690783886451,-0.375267004879374)(-2.62867956728942,-0.490717552003938)(-2.50045129571433,-0.598110530491216)(-2.37222302413923,-0.695682550603486)(-2.24399475256414,-0.78183148246803)(-2.11576648098904,-0.855142763005346)(-1.98753820941395,-0.914412623015812)(-1.85930993783886,-0.958667853036661)(-1.73108166626376,-0.98718178341445)(-1.60285339468867,-0.999486216200688)(-1.47462512311358,-0.995379112949198)(-1.34639685153848,-0.974927912181824)(-1.21816857996339,-0.93846842204976)(-1.0899403083883,-0.886599306373)(-0.961712036813202,-0.820172254596956)(-0.833483765238108,-0.740277997075315)(-0.705255493663015,-0.648228395307789)(-0.577027222087921,-0.545534901210549)(-0.448798950512828,-0.433883739117558)(-0.320570678937734,-0.315108218023621)(-0.192342407362641,-0.191158628701372)(-0.064114135787547,-0.0640702199807131)(0.064114135787547,0.0640702199807131)(0.192342407362641,0.     191158628701372)(0.320570678937734,0.315108218023621)(0.448798950512828,0.433883739117558)(0.577027222087921,0.545534901210549)(0.705255493663015,0.648228395307788)(0.833483765238108,0.740277997075315)(0.961712036813202,0.820172254596956)(1.0899403083883,0.886599306373)(1.21816857996339,0.938468422049761)(1.34639685153848,0.974927912181824)(1.47462512311358,0.995379112949198)(1.60285339468867,0.999486216200688)(1.73108166626376,0.98718178341445)(1.85930993783886,0.958667853036661)(1.98753820941395,0.914412623015812)(2.11576648098904,0.855142763005346)(2.24399475256414,0.78183148246803)(2.37222302413923,0.695682550603487)(2.50045129571432,0.598110530491217)(2.62867956728942,0.490717552003938)(2.75690783886451,0.375267004879374)(2.88513611043961,0.253654583909507)(3.0133643820147,0.127877161684506)(3.14159265358979,1.22464679914735e-16)      };     \addlegendentry{sin x};          \addplot [     color=green!50!black,     solid     ]     coordinates{     (-3.14159265358979,-1)(-3.0133643820147,-0.991790013823246)(-2.88513611043961,-0.967294863039029)(-2.75690783886451,-0.926916757346022)(-2.62867956728942,-0.871318704123389)(-2.50045129571433,-0.801413621867957)(-2.37222302413923,-0.718349350097727)(-2.24399475256414,-0.623489801858733)(-2.11576648098904,-0.518392568310525)(-1.98753820941395,-0.404783343122394)(-1.85930993783886,-0.284527586631032)(-1.73108166626376,-0.159599895033379)(-1.60285339468867,-0.0320515775716552)(-1.47462512311358,0.0960230259076819)(-1.34639685153848,0.222520933956314)(-1.21816857996339,0.345365054421308)(-1.0899403083883,0.462538290240835)(-0.961712036813202,0.57211666012217)(-0.833483765238108,0.672300890261317)(-0.705255493663015,0.761445958369134)(-0.577027222087921,0.838088104891841)(-0.448798950512828,0.900968867902419)(-0.320570678937734,0.949055747010669)(-0.192342407362641,0.981559156991065)(-0.064114135787547,0.997945392750336)(0.064114135787547,0.997945392750336)(0.192342407362641,0.981559156991065)(0.320570678937734,     0.949055747010669)(0.448798950512828,0.900968867902419)(0.577027222087921,0.838088104891841)(0.705255493663015,0.761445958369135)(0.833483765238108,0.672300890261317)(0.961712036813202,0.57211666012217)(1.0899403083883,0.462538290240835)(1.21816857996339,0.345365054421307)(1.34639685153848,0.222520933956314)(1.47462512311358,0.0960230259076814)(1.60285339468867,-0.032051577571655)(1.73108166626376,-0.159599895033379)(1.85930993783886,-0.284527586631032)(1.98753820941395,-0.404783343122394)(2.11576648098904,-0.518392568310525)(2.24399475256414,-0.623489801858733)(2.37222302413923,-0.718349350097727)(2.50045129571432,-0.801413621867956)(2.62867956728942,-0.871318704123389)(2.75690783886451,-0.926916757346022)(2.88513611043961,-0.967294863039029)(3.0133643820147,-0.991790013823246)(3.14159265358979,-1)      };     \addlegendentry{cos x};          \end{axis}     \end{tikzpicture}%      The result is a rotated plot. How can I fix this?


title: Negative or zero chapter number not appearing in list of figures (lof)

text: Usually figures 1,2,3 of chapter n appears as "n.1, n.2, n.3" in main text and in List of Figures (lof) but this format is not respected if n <= 0, in this case figures appear simply as "1, 2, 3" and the correct format "n.x" show up again only when n > 0.


title: Alternate Greek symbols

text: I remember there being a way to display some Greek letters in a slightly different style (like how people often write Greek letters a bit differently than they're printed). Can anybody remind me of the command for this?


title: Indexing footnotes as a toc

text: I am using two kinds of footnotes:   1. To show english equivalent of a term.   2. To explain something in more detail or to refer to the required section. I want to have an index of the first-type footnotes at the end of my document like a toc (or like a four column table with 2 pairs of english/equivalent headers). Do we have a package or command for that?


title: Periods show up as hieroglyphs in TexMaker OS X

text: I am getting the following strange and somewhat annoying behavior in TexMaker for OS X 10.9: ![enter image description here](http://i.stack.imgur.com/72VpJ.png) It happens any time a period immediately follows a curly brace. Why? Is there any way to fix this...? Thanks for any tips!


title: Strange symbol in place of full-stop in TexMaker

text: Writing in texmaker these lines               (the mount heigh is $1200m$).     we saw it in \ref{chapter1}.     width=6.02099737532808in           (inside tikzpicture environment)      all the dots (fullstop) get replaced by this symbol ![strange symbol](http://i.stack.imgur.com/uLB69.png) When I compile the document then it behaves like a dot, and get rendered as a dot/fullstop. Even if it's not a problem thou, I would like to understand what this symbol means and if it has some reason to exist... Anyone has a clue? EDIT: Compilable version:               \documentclass{book}     \begin{document}     (the mount heigh is $1200m$).     we saw it in \ref{chapter1}.     \end{document}