title: How to use \noexpand in an \edef?

text: Continuing with my struggle to deal with expansion issues, I am stuck on how to use an `\edef` properly. The code below with the switches set as:               %\def\ApplyColorToTitle{}     %\def\UseMathrmInTitle{}     \def\UseEdefInsteasOfDef{}      produces: ![enter image description here](http://i.stack.imgur.com/nZtSI.png) but as soon as I attempt to apply color formatting of the title, or even use `\mathrm{}` (surprisingly using `\text{}` does not exhibit this problem) in the title I get compile errors if I attempt to use the `\edef`. That is, the following settings work:               \def\ApplyColorToTitle{}     \def\UseMathrmInTitle{}     %\def\UseEdefInsteasOfDef{}      and produce the desired result: ![enter image description here](http://i.stack.imgur.com/KlQT6.png) However, I would like to be able to use this code with all the switches enabled:               \def\ApplyColorToTitle{}     \def\UseMathrmInTitle{}     \def\UseEdefInsteasOfDef{}      In this case I _thought_ I needed to use a `\noexpand` on the formatting macro in the `\edef`:               \edef\FormattedTitle{\noexpand\FormatTitle{\Title}}      This `\noexpand` does work for the case of:               \def\ApplyColorToTitle{}     %\def\UseMathrmInTitle{}     \def\UseEdefInsteasOfDef{}      and hence I thought I was on the right track, but still fails with the use `\mathrm{}`. ## Question: How do I use the `\edef` instead of a `\def` **and** allow for use of `\mathrm{}` along with the color formatting? ## Note:   * I have to admit I am not sure why I have the `\edef` here in the first place, but there must have been a case that was not working that got fixed when I switched to using an `\edef`. I realize that it is not a very good reason, but that is why I would prefer to continue to use the `\edef`. If the expansion gurus here see no reason to be using an `\edef` here and recommend that I just use the `\def` I will do that until I am able to provide a MWE that actually requires a `\edef`.   * I do need to use `\mathrm{}` instead of `\text{}` to ensure that the `th` is in roman font even if the title is wrapped in another formatting macro.. ## Code:               %\def\ApplyColorToTitle{}     %\def\UseMathrmInTitle{}     \def\UseEdefInsteasOfDef{}          \documentclass{article}     \usepackage{xcolor}     \usepackage{amsmath}          \newcommand*{\Title}{}%     \newcommand*{\SetTitle}[1]{%         \renewcommand*{\Title}{#1}%     }%          \ifdefined\ApplyColorToTitle         \newcommand{\FormatTitle}[1]{\textbf{\textcolor{blue}{\boldmath#1}}}%     \else         \newcommand{\FormatTitle}[1]{#1}%     \fi               \begin{document}     \ifdefined\UseMathrmInTitle         \SetTitle{$n^{\mathrm{th}}$ Root}%     \else         \SetTitle{$n^{\text{th}}$ Root}%     \fi          \ifdefined\UseEdefInsteasOfDef% Would prefer to use an edef         \edef\FormattedTitle{\FormatTitle{\Title}}%         % Thought that adding this \noexpand would do the trick as         % it seems to alow for \ApplyColorToTitle being defined.         %\edef\FormattedTitle{\noexpand\FormatTitle{\Title}}%     \else         \def\FormattedTitle{\FormatTitle{\Title}}%     \fi          Title is: \FormattedTitle     \end{document}


title: Typesetting ornamental cards?

text: I'm currently trying to print out some small poems onto card, and I stumbled onto the article "Typesetting modern & contemporary poetry with LaTeX". Some of the examples in there are truly beautiful. Does anybody know if the source for this, or anything else is available in the public domain? Or how else would you create LaTeX cards with ornamental borders and ligatures like that?


title: frame size beamer

text: I am using beamer to create a simple presentation. I want to be able to set the width and height of all frames with respect to the slide size? Then I also would like to change the margin between columns, so that I make use of space more efficiently. working example:               \documentclass{beamer}     \usepackage{times}     \usepackage{amssymb,amstext,amsmath,latexsym,mathtools}     \usepackage[italian,british]{babel}     \usepackage[T1]{fontenc}     \usepackage{csquotes}     \usepackage[style=authoryear-comp,firstinits=true,maxcitenames=2,maxbibnames=99]{biblatex}     \usepackage{cmbright}     \usepackage{setspace}     \usepackage{hyperref}     \usepackage{xcolor}          \usepackage{geometry}     \geometry{verbose}     \usepackage{movie15}               \begin{document}               \begin{frame}     \frametitle{abc}     abc     \begin{columns}[c]     \column{1.2in}     \framebox{\includegraphics[width=\linewidth]{fig.pdf}}\\     abc\\     \column{1.2in}     \framebox{\includegraphics[width=\linewidth]{fig.pdf}}\\     abc\\     \column{1.2in}     abc\\     \end{columns}     \end{frame}          \end{document}


title: pgf macro that returns a node

text: How can I write a macro that returns a coordinate (or a node). The node must be usable within a tikzpicture environment and preferably inside a path declaration. I need something like the following (it doesn't compile). I am not sure if `pgfcoordinate` is the correct way to go...               \documentclass{article}     \usepackage{tikz}     \usepackage{pgf}          \begin{document}          \newcommand{\mycoord}[2]{         \pgfmathsetmacro{\x}{\pgfmathparse{#1} \pgfmathresult} % actually do some calculations         \pgfmathsetmacro{\y}{\pgfmathparse{#2} \pgfmathresult} % actually do some calculations         \pgfcoordinate{\x}{\y}} % I want this node to be returned.          \begin{tikzpicture}          \node at \mycoord{1}{2} {some text}; % I want to use the calculated node          \end{tikzpicture}     \end{document}      the error message is > Package tikz Error: Cannot parse this coordinate.


title: Incompatibility between \nobreakdash and babel

text: I use the `\nobreakdash` command to disallow a linebreak after the dash in short expressions like -s, -ar etc. I use (`{\nobreakdash}-s`, `{\nobreakdash}-ar`) but it seems not work as can be seen on the picture below. ![enter image description here](http://i.stack.imgur.com/4t5KX.png) Here comes minimul example:               \documentclass[10pt,a4paper,twocolumn]{extbook}     \usepackage{etoolbox}% http://ctan.org/pkg/etoolbox     \usepackage[top=2cm, headsep=0.4cm, bottom=1.5cm, left=1.5cm, right=1.5cm]{geometry}     \usepackage{fancyhdr}     \usepackage[icelandic, latin, czech]{babel}     \usepackage[utf8]{inputenc}     \DeclareUnicodeCharacter{00A0}{~} % finds hidden non-breakable space     \usepackage[T1]{fontenc}     \usepackage{tgpagella}     \usepackage[scaled=0.90]{helvet} % ss     \usepackage{hanging}     \usepackage{makeidx}     \usepackage{tipa}     \usepackage{fix2col}     \usepackage{color}     \usepackage{titlesec}     \usepackage{amsmath} %used for non-breakabledash     \usepackage{hyphenat} % no hyphen in abbreviations           % COLORS     \definecolor{darkgreen}{rgb}{0.4, 0.01, 0.24}          %COMMANDS     \newcommand\entry[3][]{\hangpara{2em}{1}{\fontfamily{phv}\selectfont{\textbf{{#2}}}}\      #3\ifx\relax#1\relax\markboth{#2}{#2}\else\markboth{#1}{#1}\fi     \par}\nopagebreak[4]            \newcommand\n{$n$\nobreakdash-\hspace{0pt}} %nonbreakable dash in grammar endings       \def \nobreakseq {\nobreak \hskip 0pt \hbox} %nolinebreak in case like (-s, -)           % DICTIONARY PAGE STYLE      \fancypagestyle{dictstyle}{%      \renewcommand{\headrulewidth}{0.4pt}      \fancyhf{}      \fancyhead[LE,LO]{{\fontfamily{phv}\selectfont{\textbf{\rightmark}}}}      \fancyhead[CO,CE]{\thepage}%the page numbers will be printed when the dictionary is ready      \fancyhead[RE,RO]{{\fontfamily{phv}\selectfont{\textbf{\leftmark}}}}}           \setlength{\columnsep}{20pt}      \setlength{\columnseprule}{0.1pt}            \newcommand{\HRule}{\rule{\linewidth}{0.1mm}} % rule line           \begin{document}      \twocolumn      \pagestyle{dictstyle}            \entry[stjórnmálafræðingur]{{stjórn$\cdot$mála$\cdot$$\cdot$fræðing|ur}}{{\textipa{[{s}{\textsubring{d}}{j}{ou}{r}{\textsubring{d}}{\textsubring{n}}{m}{au}{l}{a}{f}{r}{a}{i}{ð}{i}{\ng}{\r{g}}{\textscy}{\textsubring{r}}]}}{\color{darkgreen}{\small{\textbf{  m}}}}{\color{darkgreen}{\footnotesize{ (\nobreakdash-s, \nobreakdash-ar)}}}\foreignlanguage{czech}{{ politolog, politoložka}}.}           \end{document}


title: Problem with setting correct custom page size with 'geometry' in xelatex

text: I'm trying to set the page size using the `geometry` package as shown in the following MWE, compiled with `xelatex test.tex`:               \documentclass[12pt]{article}          \usepackage[b5paper,pass]{geometry}     \geometry{b5paper}     \usepackage{tikz,enumitem}          \usepackage{fix-cm}          \usepackage{fontspec}     \defaultfontfeatures{Ligatures=TeX}     \setmainfont{Junicode}          \usepackage{layouts}          \usepackage{etoolbox}     \patchcmd{\drawpage}{\ifdrawparameters}{\iftrue}%       {\typeout{^^J*******\string\drawpage fixed*******^^J}}%       {\typeout{^^J*******\string\drawpage not fixed*******^^J}}          \usepackage{lipsum}                    \begin{document}          \lipsum[1]          \end{document}      If I then try to check the page size using `pdfinfo` (on Ubuntu), I get size of US letter (?!):               $ pdfinfo -box -f 1 -l 1 test.pdf | grep Page     Pages:          1     Page    1 size: 612 x 792 pts (letter)     Page    1 MediaBox:     0.00     0.00   612.00   792.00     Page    1 CropBox:      0.00     0.00   612.00   792.00     Page    1 BleedBox:     0.00     0.00   612.00   792.00     Page    1 TrimBox:      0.00     0.00   612.00   792.00     Page    1 ArtBox:       0.00     0.00   612.00   792.00      However, if I enter `b5paper` in `\documentclass[b5paper,12pt]{article}` - then I can just as well delete all the other references to `geometry` using `b5paper` - because when I compile with that change, I get:               $ pdfinfo -box -f 1 -l 1 test.pdf | grep Page     Pages:          1     Page    1 size: 498.9 x 708.66 pts     Page    1 MediaBox:     0.00     0.00   498.90   708.66     Page    1 CropBox:      0.00     0.00   498.90   708.66     Page    1 BleedBox:     0.00     0.00   498.90   708.66     Page    1 TrimBox:      0.00     0.00   498.90   708.66     Page    1 ArtBox:       0.00     0.00   498.90   708.66      ... which (I guess) corresponds to correct B5 measures. Now, as far as I had believed until now - one should be able to change the paper size with `geometry` - as long as those changes are issued before `\begin{document}`, is that correct? If so, why doesn't it work here? I'm wandering, because I wanted to set some custom page sizes with `geometry` in this way (and which thus I couldn't propagate to the `\documentclass` command). Many thanks in advance for any suggestions on how to set a custom page size in this example,   Cheers!


title: Hyphen point list WriteLatex

text: I'm should have a hyphen point list in write latex is looking like below Inn: - person                   - User              - Adresse      How can I making this in WriteLatex?


title: LuaTeX and polyglossia -> Warnings

text: I am using an up-to-date version of MikTeX. As soon as I compile a document with LuaLaTeX and including the package polyglossia I get two warnings: >   1. Module luaotfload-main warning: LuaTeX v0.76 is old, v0.79 or later is > recommended. >   2. LaTeX warning: "xparse/redefine-command" - Redefining document command > \oldstylenums with arg. spec. 'm' on line 144. (-> _fontspec-patches.sty_ ) > I would like to get rid of those.


title: Single/Double side environment with different backgrounds

text: I'm having trouble aligning some of the elements.   1. I would like align `Check Box` and `Cross Box` to be same size so that they look nicer below is what i got so far.    2. Also it would be great if they can change in size with respect to environment with (some ratio 60% of text or so)   3. Have background so that it would be easer to read.(as shown in the second part of the question) Thank you for your help in advance! ![enter image description here](http://i.stack.imgur.com/IPETR.png)               \documentclass{article}     \usepackage[a4paper,margin=2cm,showframe=false]{geometry}     \usepackage{graphicx}     \usepackage{pst-node}     \usepackage{wasysym}     \usepackage{marvosym}     \usepackage{xcolor}     \newsavebox\IBox     \newenvironment{good}[2][1]     {\def\scale{#1}\begin{lrbox}{\IBox}\begin{minipage}{\dimexpr#2\linewidth-2\fboxsep-2\fboxrule\relax}\ignorespaces}     {%         \end{minipage}\end{lrbox}%                       \rput( \dimexpr-10\wd\IBox+\fboxsep+\fboxrule\relax,0){%                      \scalebox{\scale}[1]{   \makebox(0,0){\put(20,0){%      \resizebox{0.4\textwidth}{!}{\color{green!25}\Checkedbox}}}}%             }%         {\usebox\IBox}%       }         \newenvironment{bad}[2][1]     {\def\scale{#1}\begin{lrbox}{\IBox}\begin{minipage}{\dimexpr#2\linewidth-2\fboxsep-2\fboxrule\relax}\ignorespaces}     {%         \end{minipage}\end{lrbox}%                       \rput( \dimexpr-10\wd\IBox+\fboxsep+\fboxrule\relax,0){%                      \scalebox{\scale}[1]{   \makebox(0,0){\put(20,0){%      \resizebox{0.37\textwidth}{!}{\color{red!25}\Crossedbox}}}}%             }%         {\usebox\IBox}%       }          \usepackage{lipsum}          \begin{document}     \lipsum[1]          \vspace{3mm}          \begin{good}{0.49}     \lipsum[1]     \end{good}\hfill     \begin{bad}{0.49}     \lipsum[1]     \end{bad}          \vspace{3mm}          \lipsum[1]     \end{document}      [UPDATE] This is a more or less second part of the answer I would be happy if some one can put Checked-box as the background for this one. And again there is some aligning problems with `minipage` but i will ignore this one for now. ![enter image description here](http://i.stack.imgur.com/iugPe.png)               \documentclass{article}     \usepackage[framemethod=TikZ]{mdframed}     \usepackage{lipsum}     \usepackage[a4paper,margin=2cm,showframe=false]{geometry}     \usepackage{graphicx}     \usepackage{pst-node}     \usepackage{wasysym}     \usepackage{marvosym}     \usepackage{xcolor}          \definecolor{Dkgreen}{RGB}{0,135,0}          \newmdenv[     roundcorner=10pt,     middlelinecolor=red!25,     frametitlerulecolor=red!30,     frametitlerule=true,     frametitle={Example\hfill\resizebox{12pt}{!}{\color{red}\Crossedbox}},      frametitlebackgroundcolor=red!25,     backgroundcolor=red!8,]{test}               \newmdenv[     roundcorner=10pt,     middlelinecolor=Dkgreen!25,     frametitlerulecolor=Dkgreen!30,     frametitlerule=true,     frametitle={Example\hfill\resizebox{12pt}{!}{\color{Dkgreen}\Checkedbox}},      frametitlebackgroundcolor=Dkgreen!25,     backgroundcolor=Dkgreen!8,]{test2}               \begin{document}     \begin{test}            \lipsum[1]     \end{test}          \begin{test2}            \lipsum[1]     \end{test2}                    \begin{minipage}{.48\linewidth}       \begin{test}            \lipsum[1]     \end{test}     \end{minipage}     \hspace{0.3cm}     \begin{minipage}{.48\linewidth}     \begin{test2}            \lipsum[1]     \end{test2}     \end{minipage}%                    \end{document}


title: What style/font is this?

text: Does anyone know how to create numbering for Theorem/lemma/… like this one in the image below, also any idea about the font name? ![enter image description here](http://i.stack.imgur.com/skYOS.png)


title: Changing look for table of contents

text: Consider the normal table of contents: ![enter image description here](http://i.stack.imgur.com/yif0m.png) Coming from something like this:               \documentclass{memoir}          \begin{document}         \tableofcontents*         \newpage         \chapter{A chapter}         \section{A section}         \section{A longer named section}         \newpage         \chapter{Another chapter}         \section{A section}         \section{Yet another section}         \section{And a really long section named which probably is so very long that                 some people might think is too long}     \end{document}      Can I have something that looks more like what is below here?                                       Contents                     1  A chapter                 3                              1.1            A section 3                    1.2       A longer named 3                                     section                       2  Another chapter           5                    2.1            A section 5                    2.2  Yet another section 5                    2.3    And a really long 5                         section named which                          probably is so very                               long that some                           people might think                               it is too long        So, instead of filling out with dots the names are flushed right, next to the page numbers.


title: New line in an animate environment

text: I would like to generate a chess animation in a beamer presentation. As a **MWE** :               \documentclass{beamer}     \usepackage{chessfss}     \usepackage[controls]{animate}     \begin{document}     \begin{frame}[fragile]     \begin{animateinline}{1}     {{     \boardfont     \noindent     Z0L0\\     QZ0Z\\     Z0ZQ\\     0L0Z\\     \par     }}     \end{animateinline}     \end{frame}     \end{document}      The chess pieces are however displayed in one row. How can I resolve this problem?


title: List of Tables - Table name configuration inside ToC

text: When I use \listoftables, it shows me:               TABELA 1 title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8      I'm trying to make it shows:               TABELA 1 - title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8      How could I change it using tocloft package?


title: Add keywords to an existing language in listings

text: I've already read extending a language with additional keywords and I have found kind of a solution, but I'm not quite sure if it's the right way and if I won't have problems in the future. The scenario is like this: I have different pieces of code in ruby, Java and a custom one, in a random order (not all ruby code first, then all Java, etc). Here is a MWE to illustrate:               \documentclass[11pt]{report}          \usepackage{listings}     \usepackage{framed}     \usepackage{xcolor}          \lstset{ %       basicstyle=\footnotesize\ttfamily,       numbers=left,       numberstyle=\tiny\color{gray}\ttfamily,       numbersep=5pt,       backgroundcolor=\color{white},       showspaces=false,       showstringspaces=false,       showtabs=false,       frame=single,       rulecolor=\color{black},       captionpos=b,       keywordstyle=\color{blue}\bf,       commentstyle=\color{gray},       stringstyle=\color{green},       keywordstyle={[2]\color{red}\bf},     }                    \lstdefinelanguage{story}     {morekeywords={Given,When,Then},         sensitive=false,         morekeywords={[2]Scenario},     }          \begin{document}     First some ruby code     \lstinputlisting[language=Ruby,caption={Ruby}]{ruby_code.rb}          Now some java code     %\lstset{language=Java}     %\lstset{ morekeywords={[2]@Given,@When,@Then}}     \lstinputlisting[language=Java,caption={Java}]{JavaCode.java}          Now some story code     \lstinputlisting[language=story,caption={Story}]{story_code.story}     \end{document}      I'll put only the java code which is the one troubling and the one I really care:               // JavaCode.java     public class ComportamientoSteps {         Croupier croupier;              @Given("una nueva mano")         public void nuevaMano() {             croupier = new Croupier();         }              @When("el croupier tiene $carta1 y $carta2")         public void elCroupierTiene(int carta1, int carta2) {             croupier.agregarCarta(new Carta(carta1));             croupier.agregarCarta(new Carta(carta2));         }              @Then("$valor deberia plantar")         public void croupierDeberiaPlantar(String valor) {             boolean debe_pedir = valor.equals("no");              assertThat(croupier.debePedirOtraCarta(), equalTo(debe_pedir));         }     }      What I'm trying to do is:   1. First, define a common style for al pieces of code: size, colors of `keywords` and `[2]keywords`, etc. I want this style for every language.   2. Then define the very simple story language.   3. Lastly, I input the code via `\lstinputlisting[language=whatever]{file}` I want to extend the Java language to interpret `@Given`, `@When` and `@Then` as `[2]keywords`. In the MWE there is a piece of code commented out, with that piece of code it works (you have to remove the `language=Java` in the options), but I don't want to do that every time I have to put Java code, I just want to use the `lstinputlisting` with the `language` option. Besides, I don't know if setting the language to Java like that won't bring me trouble in future listings.


title: Biblatex Custom Cite Command with \citefield

text: I need to make a custom cite command for my PhD. I made this so far:               \newcommand{\sfootcite}[1]{\footnote{\emph{\citename[2]{#1}{shortauthor}}, \citefield{#1}{shorttitle}}}      which works great if my cite looks like this:               \sfootcite{iustinus1997}      The problem is I have two optional arguments before the entry name. My cites look like this: \sfootcite[Cf.][P. 8]{iustinus1997} How do I get new command to make the cite looking like this: > Cf. Autor, Title, P. 8 Basically my question is: How do you get things, which are in [][] before {iustinus1997} to be included in the new cite command? Here is my MWE:               \documentclass[a4paper,11pt]{scrartcl}     \usepackage[latin1]{inputenc}     \usepackage{csquotes}     \usepackage{blindtext}     \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}      @book{iustinus1997,         Address = {Berlin/New York},         Author = {{Iustinus Martyr}},         Call-Number = {EgI180},         Date-Added = {2010-10-13 09:19:34 +0200},         Date-Modified = {2010-10-13 09:21:42 +0200},         Editor = {Miroslav Marcovich},         Publisher = {Walter de Gruyter},         Series = {Patristischen Texte und Studien},         Shortauthor = {Iust.},         Shorttitle = {De Tryph.},         Title = {Iustini Martyris dialogus cum Tryphone},         Volume = {47},         Year = {1997}}     \end{filecontents}      \newcommand{\sfootcite}[1]{\footnote{\emph{\citename[2]{#1}{shortauthor}}, \citefield{#1}{shorttitle}}}     \usepackage[ngerman]{babel}     \usepackage[style=authoryear, hyperref=true]{biblatex}      \bibliography{\jobname}      \begin{document}     \blindtext \sfootcite{iustinus1997}     \blindtext     \printbibliography          \end{document}


title: How do I write $\sim$ approximately with the correct spacing?

text: I would like to use the symbol `$\sim$` as "approximately". e.g:               \documentclass{minimal}     \begin{document}     There are $\sim 10^{80}$ atoms in the universe.     \end{document}      I think that I need to declare `$\sim$` as some sort of unary math operator, to make the spacing correct! How? **Edit:** Here: http://en.wikipedia.org/wiki/Tilde it can be read, that `$\sim$` can be used both as a binary relation operator, and an unary operator meaning "approximately". > Common use > > This symbol (in English) sometimes means "approximately", such as: "~30 > minutes ago" meaning "approximately 30 minutes ago".[2] It can mean "similar > to",[3] including "of the same order of magnitude as",[4] such as: x ~ y" > meaning that x and y are of the same order of magnitude. Another > approximation symbol is ≈, meaning "approximately equal to."


title: In LyX: Skipping numbers in enumerate and changing symbol of enumeration

text: I would like to skip numbers in a list. Consider the following example:               \begin{enumerate}     \item text1     \item[3.] text2     \item[22.] text3     \end{enumerate}      However, I cannot figure out how to do this **in LyX** (although it is obvious how to code it in the source code). I tried exporting, then changing and reimporting the document, however LyX doesn't properly read these changes. A related questions is how to get the symbols in numbering to change in LyX, e.g. from 1., 2., 3., .... to i., ii., iii., ... , as shown below.               \begin{enumerate}[i]     \item text1     \item text2     \end{enumerate}      Thanks!


title: How can I use math inside a label in Description in a beamer doc?

text: I'm describing regular expressions, and I would like to have items like this:               \documentclass[10pt,hyperref={pdfpagelabels=false}]{beamer}     \usepackage[utf8x]{inputenc}     \usepackage{default}          \mode<presentation>     {      \usetheme{Warsaw}      \setbeamertemplate{background canvas}[vertical shading][bottom=white!10,top=blue!10]      \setbeamercovered{transparent}     }          \usepackage[brazil]{babel}     \usepackage[T1]{fontenc}     \usepackage[scaled=.80]{helvet}     \usepackage{graphicx}     \setbeamertemplate{caption}[numbered]             \begin{document}     \section{Search}     \subsection{Regular Exp}      \begin{frame}[allowframebreaks]{\texttt{Regular Expressions} Operators}{Powerfull}       \texttt{Regular Expressions} (\texttt{RE}) are good:       \begin{description}        \item[\textasciicircum]  Matches the beginning of the line        \item[\textbackslash] Escape character        \item[[]] Group characters        \item[\textbackslash( \textbackslash)] Hell        \item[$\textbackslash< \textbackslash> $] Hey.     %   \item[{$[:\mathtt{upper}:]$}] Same as $[A-Z]$.       \end{description}      \end{frame}     \end{document}      But some of them seem not to work. Some variants I've tried (with `]` outside math) gave me half of the item in the correct font/color, and the last char `]` in black as if it was normal text. Please, how can I get this done? -- Edited: minimal working example added.


title: Is it possible to change the color of a single bar when the bar plot is based on symbolic values?

text: I am beginner in LaTeX, trying to use it for industrial documents. I wonder if there is a way to change the color of only one bar of the plot below, ie "TestDetails", to illustrate it is a local macro and not a LaTeX keyword. I have been trying to experiment with point meta, but could not find a way.               \documentclass{article}     \usepackage{filecontents}      \usepackage{pgfplots}      \usepackage{pgfplotstable}     \pgfplotsset{width=.95\textwidth, compat=newest}           \begin{document}          \begin{filecontents}{data.csv}     {Occurences}, {keyword}     215, item     159, SI     134, subsubsection     106, TestDetails     58, caption     \end{filecontents}          \pgfplotstableread[col sep=comma]{data.csv}{\datatable}          \begin{tikzpicture}     \begin{axis}[     /pgf/number format/.cd,1000 sep={},     width=0.8\linewidth,height=6cm,     xbar,     xmin=30, xmax=250,     xtick=\empty,     enlarge x limits={value=0.1, upper},     enlarge y limits=0.1,     ytick=data,      y dir=reverse,     xlabel= {},     y tick label style={major tick length=0pt},     yticklabels from table={\datatable}{[index]1},     nodes near coords, nodes near coords align=horizontal,     ]     \addplot [draw,fill=blue!50]table[     y expr=\coordindex,     x index=0]{\datatable};     \end{axis}     \end{tikzpicture}          \end{document}


title: How can I determine the TeX distribution or OS a tex file is being built in?

text: I have this problem where a bibliography .sty file is possibly named differently between Windows (Miktex) and MacOS (Mactex). ( **Edit** : I mean .bst file) I can't verify this is the root of the issue since I don't have Windows available currently to inspect the .sty file name, but on Windows, the following builds correctly               \bibliographystyle{IEEETran}      While on MacOS, the the same line must be changed to the following for the file to build (note the capitalization)               \bibliographystyle{IEEEtran}      I'd like something like a C/C++ #ifdef directive that let's me detect the system or distribution that is building the file and conditionally use the appropriate line, so that the same file builds on both setups. Of course, I haven't tried the MacOS compatible line on Windows; it may be that the lower- case "t" works on Windows as well. However, my question remains: **is it possible to detect what system or distribution the file is being built in and condition some markup on the result?**


title: Listings with keywords that contain both letters and numbers

text: I have a listing which needs to highlight keywords with both letters and numbers. Following the advice in this question I've used the `otherkeywords` to define the keywords which contain numbers. This works for keywords which contain only letters (e.g. `FOO`) and keywords which contain only numbers (e.g. `1234`) but not those that contain both (e.g. `1234FOO`). Here is an example document:               \documentclass[12pt]{article}          \usepackage{xcolor}     \usepackage{listings}          \renewcommand{\ttdefault}{pcr}          \definecolor{Black}{gray}{0.0}     \definecolor{Blue}{rgb}{0.12,0.29,0.53}          \lstset{       basicstyle=\color{Black}\ttfamily, %       keywordstyle=[1]\color{Blue}\ttfamily\bfseries, %     }          \lstdefinelanguage{mylang}{ %       keywords={FOO,BAR,BAZ,ARG}, %       otherkeywords={1234,XYZ1234,XYZ1234HelloWorld}, %     }          \begin{document}     \begin{lstlisting}[numbers=none,breaklines=true,caption={},language=mylang]     FOO     BAR     BAZ     ARG     1234     XYZ1234     XYZ1234HelloWorld     \end{lstlisting}     \end{document}      The resulting PDF looks like this: ![PDF generated from the LaTeX above](http://i.stack.imgur.com/MsGUg.png) In this example the keywords `XYZ1234` and `XYZ1234HelloWorld` should be highlighted, but the first three letters (`XYZ`) are not styled consistently with the rest of the keyword. How can I change the language definition to make the highlighting consistent?


title: import package does not work with 'latex' but works with 'pdflatex' command, any solution?

text: I am using the add-on `import` package of Donald Arseneau to typeset my thesis while allowing each thesis chapter files to be placed in a subfolder. Using this package lets me do it when I typeset my document with `pdflatex` but not with `latex`. It does not look for the files in the nested folders and complains that they are not found. Is there a solution to this problem? I prefer `latex` command for typesetting as it handles the `.eps` files better. I work in a linux environment. Below is a minimal compilable code that used. `puthesis` is a style file for Purdue University thesis.               \documentclass[me,dissertation]{puthesis}     \usepackage{graphicx}     \usepackage{import}     \begin{document}     \subimport{introduction/}{c.tex}     \subimport{summary/}{c.tex}     \end{document}


title: Cover whole page with squares arranged in a “spiral”

text: I'm trying to cover a whole landscape A4 paper with small squares - drawn in TikZ - starting from the bottom left corner of the page and moving towards to the center of the page in a spiral, but I have a flaw in my method, because the page is not filled at the end. ![](http://i.stack.imgur.com/1Dss9.png) Each small square has a side length of 1.5 mm. And there are a few prerequisites that have to be met, so the page can be fully covered with squares.   1. The width and height of the page (297 mm × 210 mm) has to divisible with the side length of the square. 210 mod 1.5 = 0 297 mod 1.5 = 0   2. The area of the page has to be disivble with the area of the square. 297 mm × 210 mm = 62370 mm2 1.5 mm × 1.5 mm = 2.25 mm2 62370 mod 2.25 = 0 And I have to iterate 62370 / 2.25 = 27720 times to cover the page. All conditions are met, so my algorithm is not correct. (Note that the following code needs to be compiled twice with `lualatex` and this takes about 2 minutes on an older i7 CPU.)               \documentclass{article}          \usepackage[nohead,%         nofoot,%         nomarginpar,%         paperwidth=297mm,%         paperheight=210mm,%         tmargin=5mm,%         rmargin=5mm,%         bmargin=5mm,%         lmargin=5mm,%         vscale=1,%         hscale=1]{geometry}          \usepackage{tikz}          \usepackage{luacode}          \pagestyle{empty}          \begin{luacode*}         function square_spiral()             local direction = 0             local x = 0             local y = 0             local shift = 1.5             local x_min = 0             local y_min = shift             local x_max = 297 - 1.5 * shift             local y_max = 210 - 1.5 * shift             local square_count = (297 * 210) / (1.5 * 1.5)                  tex.sprint("\\begin{tikzpicture}[remember picture, overlay]")                  for i = 1, square_count, 1 do                      tex.sprint("\\filldraw[black!" .. (i - 1) / (square_count - 1) * 100 ..                     ", line width=0pt] (current page.south west) ++(" ..                     string.format("%.1f", x) .. "mm, " .. string.format("%.1f", y) ..                     "mm) rectangle +(" .. shift .. "mm, " .. shift .. "mm);")                      if direction == 0 then -- right                     if x < x_max then                         x = x + shift                     else                         direction = 1                         x_max = x_max - shift                     end                 elseif direction == 1 then -- up                     if y < y_max then                         y = y + shift                     else                         direction = 2                         y_max = y_max - shift                     end                 elseif direction == 2 then -- left                     if x > x_min then                         x = x - shift                     else                         direction = 3                         x_min = x_min + shift                     end                 elseif direction == 3 then -- down                     if y > y_min then                         y = y - shift                     else                         direction = 0                         y_min = y_min + shift                     end                 end                      --[[                 print(string.format("%.1f", x) .. ", " ..                     string.format("%.1f", y) .. ", " .. i)                 ]]                  end                  tex.sprint("\\end{tikzpicture}")         end     \end{luacode*}          \begin{document}          \luadirect{square_spiral()}          \end{document}


title: Problem with latex math expression

text: I've been trying to write `p = sqrt2^(sqrt2)` like this `$p= \sqrt 2^ (\sqrt2)$`. And, the output I am getting is not what I am looking for. How can I write this properly?


title: How to draw a box around a certain part of the page?

text: I'm using a0poster package to create a poster of dimensions 90x100 cm^2. To place text on the page I use `\textblock` command. Now, there are several blocks I want to frame together. The obvious choice is to use `tikz`. This, however, fail miserably. For example, Consider the following               \begin{tikzpicture}       \node (a) at (0,0) {a};       \node (b) [left=50cm of a] {b};       \node (c) [right=10cm of a] {c};     \end{tikzpicture}      `a` and `c` doesn't appear on the page when I apply this inside a textblock. When I use it outside a textblock, the nodes positions change in an unpredictable way. If I try to use               \begin{tikzpicture}       \node (a) at (current page) {a};       \node (b) [left=50cm of a] {b};       \node (c) [right=10cm of a] {c};     \end{tikzpicture}      The results are pretty much the same with the main feature that the position is not constant. Event using `current page.center` isn't constant, which is buffering to me. How can I, then, draw a line between two fixed points on the poster?


title: \input in figure environment not centering

text: I'm making a presentation with beamer, and I've drawn some figures in TikZ that I'm inserting into the presentation using `\input{footikz.tex}` For some reason the tikz picture is appearing off to the right of where they should be. Below is some of my code, I was wondering if anyone could spot a silly mistake I'm making?               \begin{frame}     \frametitle{\insertsubsection}     \begin{alertblock}{\insertsubsubsection}          \begin{figure}     \centering     \begin{subfigure}[c]{0.2\textwidth}     {\scalebox{0.4}{\input{Figures/Tikz/Arrows0.tex}}}     \end{subfigure}     ~     \begin{subfigure}[c]{0.2\textwidth}     {\scalebox{0.4}{\input{Figures/Tikz/Arrows180.tex}}}     \end{subfigure}     ~     \begin{subfigure}[c]{0.2\textwidth}     {\scalebox{0.4}{\input{Figures/Tikz/Arrows360.tex}}}     \end{subfigure}     \caption{caption}     \end{figure}          \end{alertblock}     \end{frame}      In this instance, the first subfigure appears in the center of the page and the next two are placed to the right of it. I'd like them to be left, center, right. Later in the presentation I have an extremely similar layout and it works fine. Thanks.


title: Drawing Cantor Set

text: I am trying to draw a cantor set in LaTeX and I am having issues doing this. I am trying multiple `\put` commands, but they just go to the right of one another. Does anyone know how to do this? Any help would be much appreciated.


title: How to set font size for \caption* (but not \caption)

text: I need to change the font size from `\caption*` to `10pt`.However, using `\captionsetup` the `\caption` font size changes as well. How can I solve that?


title: TeXMaker: Autocompletion of brackets

text: I have just switched to texmaker from texstudio since I am working on mac now. I am wondering if there is a possibility of setting texmaker to autocomplete `(),[],{},` since I extensively use these symbols in math text.


title: controlling the angle of line/curve endings

text: Is there a way to control the line endings of a line/curve to be vertical. It is easier to explain with a picture. Here I have drawn a curve, but as you can see the lines end at the angle equal to the gradient of the curve at that point. I want it to end vertically so that it looks like the line is truncated where the axes end: ![enter image description here](http://i.stack.imgur.com/Rw18Q.png)               \begin{tikzpicture}[scale=1]     \draw[line width=20pt, red] plot [smooth,tension=1] coordinates{(-1,0.5) (0,1.5) (1,1.5) (2,2.4) (3,2) (4,2.2)};     \draw[thick] plot [smooth,tension=1] coordinates{(-1,0.5) (0,1.5) (1,1.5) (2,2.4) (3,2) (4,2.2)};     \draw [->, black, ultra thick] (-1,0) -- (4,0);     \draw [->, black, ultra thick] (0,-1) -- (0,4);     \end{tikzpicture}      Here's the code


title: New command and the corresponding star counterpart with xparse

text: The following works as expected:               \newcommand{\engl}[2]{#1 (en. \textsl{#2})\index{en-ro}{#2}}      However, what I want to achieve would be a `*` version of it which only adds to the indices, without the visible text, something like:               \newcommand{\engl*}[2]{#1 (en. \textsl{#2})\index{en-ro}{#2}\term{#1!#2}\term{#2!#1}}      Of course, this does not work (the pdf is compiled, but with lots of warnings which were not there with the original definition), so I've tried something equivalent with xparse:               \usepackage{xparse}     \NewDocumentCommand\engl{sm}{%       \IfBooleanTF#1         {\index{en-ro}{#1}\term{#1}}         {#1 (en. \textsl{#2})\index{en-ro}{#2}\term{#1!#2}\term{#2!#1}}%     }      which doesn't work either. How to properly create such a command and its `*` counterpart?


title: What primitives can expandably tell us about the current horizontal list?

text: I've been writing some code that expands macros and catches characters and non-expandable primitives as they reach TeX's stomach, and I encountered an issue: since I gather letters one by one, with non-expandable code (at least `\futurelet`), kerning between letters is destroyed, as well as ligatures. It would thus be better to grab letters until encountering a non-letter typesetting command. However, my code must cope with things like               a b\ifdim\lastskip>0pt hi!\fi c      If I typeset `b` before continuing expansion, then the kerning between `b` and `c` is destroyed. But if I first continue expansion, then `\lastskip` will see the previous space, and not be `0pt` as it should. My solution is to insert an `\hskip 0pt\relax` when starting the word, then collect letters, performing expansion, then remove the given skip and typeset the letters. This also ensures that `\lastpenalty` and others are zero, as they should. To make sure that my solution is correct, I need to know what primitives can access information about what is being typeset. In TeX, there is at least `\lastkern`, `\lastpenalty` and `\lastskip` (not `\lastbox` since it is not expandable). What about pdfTeX primitives? XeTeX primitives (in particular, can information about the last character be obtained)? LuaTeX is probably another can of worms altogether because everything can be done expandably through `\directlua`: I cannot have any control.


title: Using specific fonts in XeTeX

text: I'm trying to use specific fonts in my LaTeX file. But `fontspec` can't find my desired fonts. I use               family file | grep -i helvetica      to know the names to use in XeTeX using `fontspec`               /usr/local/share/fonts/HelveticaNeueLTPro-UltLtIt.otf: Helvetica Neue LT Pro,HelveticaNeueLT Pro 25 UltLt     /usr/local/share/fonts/HelveticaNeueLTPro-BdCn.otf: Helvetica Neue LT Pro,HelveticaNeueLT Pro 57 Cn     /usr/local/share/fonts/HelveticaNeueLTPro-Lt.otf: Helvetica Neue LT Pro,HelveticaNeueLT Pro 45 Lt      My `.cls` part that needs specific fonts is               \RequirePackage[quiet]{fontspec}     \RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math}          \setmathfont{Latin Modern Math}          \newfontfamily\bodyfont[]{HelveticaNeueLT Pro 45 Lt}     \newfontfamily\thinfont[]{HelveticaNeueLT Pro 25 UltLt}     \newfontfamily\headingfont[]{HelveticaNeueLT Pro 57 Cn}          \defaultfontfeatures{Mapping=tex-text}     \setmainfont[Mapping=tex-text, Color=textcolor]{HelveticaNeueLT Pro 45 Lt}      But `fontspec` gives errors all the time!


title: Can one (more or less) automatically suppress ligatures for certain words?

text: One of the major attractions -- for me at least -- of typesetting my papers in (La)TeX is its automated and fully transparent use of typographic ligatures. However, as Knuth pointed out in the TeXbook, it is sometimes necessary to disable or suppress ligatures in order to either improve a word's legibility (Knuth uses the word `shelfful` as an example) or so as not to inadvertently change its meaning, which is especially important in some non-English European languages, such as German, which have lots of compound words (viz., `Sauf{}laden` vs. `Sau{}fladen`, and `Chef{}innenleben` vs. `Chefinnen{}leben`). Here's my question, which is related to a question I posed in comp.text.tex about half a year ago but which didn't generate any good answers: If one were to compile a list of words for which ligatures should be suppressed, is there a way to program TeX (possibly/likely LuaTeX) not to use ligatures for these words? Please note that I am **not** looking to suppress ligatures globally for the entire document, but only those that occur in certain words. Suppose one had a list of words such as               shelf{}ful, self{}ish, self{}less, half{}life, shelf{}life, dwarf{}like,      waif{}like, wolf{}like, half{}line, roof{}line, Pfaff{}ian, cuff{}link,      off{}load, off{}line, wolf{}fish, chaf{}finch, saf{}flower      Is there a way to pass this list to TeX and to instruct it to either not insert a ligature at all (as in `shelfful` and `shelflife`) or to use only a two-character rather than a three-character ligature (for `Pfaffian` and `offline`, say)? Possibly, this _no-ligation_ list would also indicate to TeX the method by which the ligation should be suppressed. To suppress a ligature, one can insert a pair of braces, `{}`, an italics correction, `\/`, or a zero- width kern, `\kern0pt`. However, these methods do not in general produce the same outcome, especially in the case of the `fl` character pair, and it may therefore be desirable to instruct TeX exactly which non-ligation method it should employ when it encounters a word on the no-ligation list. By the way, observe that the no-ligation instances for all words in the above list correspond to potential hyphenation points. A pure guess on my part: a solution to the challenge I'm posing may involve creating two types of hyphenation points: the first type would consist of "ordinary" hyphenation points, and instances of the second type would inform TeX that it's dealing with both a hyphenation point and a no-ligation point. Addendum 16 September -- I've added a "bounty" of 200 points. :-) # And the winning answer is... I've declared Aditya's entry below the winner. Here's a modified version of his MWE, which contains a (very!!) contrived sentence that contains words with seven different types of ligatures that should be suppressed (f-f, f-i, f-l; ff-i, ff-l; f-fi, and f-fl). Observe that the MWE needs to be compiled with `ConTeXt`.               \usemodule[translate]          \translateinput[shelffuls][shelf|*|fuls]     \translateinput[selfish][self|*|ish]     \translateinput[halflife][half|*|life]      \translateinput[standoffish][stand|*|off|*|ish]     \translateinput[cufflinks][cuff|*|links]      \translateinput[offloads][off|*|loads]         \translateinput[chaffinches][chaf|*|finches]     \translateinput[safflower][saf|*|flower]          \definetextmodediscretionary * {\prewordbreak\discretionary{-}{}{\kern0pt}\prewordbreak}     \hyphenation{chaf-finches}     \starttext          No ligatures disabled:\\     A standoffish and selfish person who offloads shelffuls         of cufflinks and doesn't watch chaffinches in the        safflower field has a short halflife.          \medskip     \enableinputtranslation      Some, but not all, ligatures disabled:\\     A standoffish and selfish person who offloads shelffuls         of cufflinks and doesn't watch chaffinches in the        safflower field has a short halflife.          \stoptext      ![enter image description here](http://i.stack.imgur.com/bbxYJ.png)


title: Peculiar pagebreak problem with nested environments

text: I have been trying to make custom theorem environments because the classical newtheorem command does not suit my needs. I have been stuck with a pagebreak problem which I explain below. Here is the code :               \documentclass[12 pt]{article}          \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{fullpage}     \usepackage[framemethod=tikz]{mdframed}          \renewenvironment{proof}         {\par         \textit{\underline{Proof.}} \par         \nopagebreak         \vspace{12 pt}%                  \begin{mdframed}[bottomline=false,topline=false,rightline=false]%     }     {%         \end{mdframed}\par         \vspace{-15 pt}%         \begin{flushright} $\square$ \end{flushright}%     }          \begin{document}     Text          \vspace{550 pt}          Text         \begin{proof}             This text goes on the next page without the title "\textit{\underline{Proof.}}", and I would want my environment title to stick with its body.          \end{proof}     \end{document}      Any idea how to tackle this problem? I spent hours on it googling and I ran out of ideas. EDIT : I managed to get rid of that stupid in-between environment by simply using the mdframed package the way it should be used. Still got the page break with this exact code though.


title: Using \phantom in subscript with the bayesnet TikZ library

text: I'm using the `bayesnet` TikZ library to draw a graphical model. Node variables might have different size, say `$v_0$` and `$v_{N-1}$` and the result is that some bubbles are bigger than others. I am trying to use `\phantom` to create bubbles of the same size like this:               \node[obs] (v0) {$v_{0\phantom{N-}}$};      The problem with this solution is that the label is pushed all the way to the left inside the bubble. Referring to the above fragment, is there a way to compute the space taken by `{N-}` (note that it's a subscript) and distribute it evenly to the left and right of `$v_0$`?


title: Cabinet projection in PSTricks (2)

text: I'd like to draw 3D-objects in cabinet projection with angle α=26.565° (i.e. atan(α) = 0.5) and scaling factor k=0.5590 = sqrt(5)/4, because the objects should be drawn on a grid, as in the left picture (2-1-coordinate system, from a math book on analytical geometry). ![coord systems](http://i.stack.imgur.com/SRht4.jpg) A related question is here (Cabinet projection in PSTricks). There Herbert proposes to use pst-3dplot.pro with coordType=5, but doing this I get five unwanted effects: (1) the scaling factor k is too small, (2) the axes are changed, I need y and z axes parallel to drawing plane, (3) to get the right angle for the z axis, I have to set Alpha=-153.435, and this results in a corresponding labeling of the axes, (4) the coordinate system is turned around clockwise 90 degrees, (5) the label „x“ of the horizontal axe is ON the axe, not above or below or besides it: Minimal example:               \documentclass{article}     \usepackage{pst-3dplot}     \usepackage{auto-pst-pdf}     \begin{document}     \psset{coorType=5,Alpha=-153.435,IIIDxTicksPlane=xz}     \begin{pspicture} %(-2,-2)(3,3)     \psset{subgriddiv=2, gridlabels=0pt,    % grid        gridwidth=0.4pt, subgridwidth=0.4pt,        gridcolor=black!50, subgridcolor=black!50}     \psgrid(-4,-3)(6,6) %(x2,y2)     \pstThreeDCoor[xMin=0,xMax=5, yMin=0,yMax=5, zMin=0,zMax=5,%       IIIDticks,       IIIDlabels,drawing=true, %Alpha=90, %Beta=30,       linewidth=1.5pt,linecolor=red]     \end{pspicture}     \end{document}      Wolfgang Büchel


title: hyphenation rule not acted upon

text: In this example, why is the hyphenation rule not used?               \documentclass{article}     \usepackage{tabu}     \hyphenation{abc-def-hij-klm-nop-qrs-tuv-wxyz}     \begin{document}          \begin{center}     \begin{tabu} {|X|X|}     abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz &      abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz      \\     5 & 6 \\     \end{tabu}     \end{center}          \end{document}      Output: ![screenshot](http://i.stack.imgur.com/UZhOQ.png)


title: How can I consecutively number only some pages of a document?

text: The following code typesets a 12 page document; text only appears on every other page and there's an empty page between two text pages:               \documentclass{article}     \usepackage{atbegshi}     \usepackage{lipsum}          \makeatletter     \AtBeginShipout{%       \ifodd\c@page         \begingroup           \AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox           \global\AtBegShi@Discardedtrue           \mbox{}\thispagestyle{empty}\clearpage         \endgroup       \else       \fi%     }     \makeatother          \begin{document}          \lipsum[1-30]          \end{document}      Now I am trying to number sequentially the pages with text in them; with the code above pages with text are numbered 1,3,5,... but I would like them to be 1,2,3,... I did some attempts but none of them produced the desired result. How can I achieve the consecutive numbering? The idea is to wrap this into a command that will allow to change the behaviour of the text flow inside a group: when invoked, the command will cause the text to be typeset in every other page but maintaining the consecutive numbering for the pages with text; once the group ends the text and numbering must return to their normal behaviour.


title: How to add a line to the Table of Contents without a page number

text: In my LaTeX document, I want to add some extra lines in the Table of Contents to show the general topic of the next section of chapters. The syntax I'm using right now, outlined in a quick example:               \tableofcontents     \chapter{Chapter A}     some text     \chapter{Chapter B}     some text     \renewcommand{\thepart}{} %Removes the counting in roman numerals before the part name     \addcontentsline{toc}{part}{And now for something completely different} %Adds it to the table of contents without it showing up in the document.     \chapter{Chapter C}     some text     \chapter{Chapter D}     some text      However, I want to remove the page number that appears besides the title of 'And now for something completely different' in the Table of Contents. Is there an (easy, preferably without creating your own packages) way to do so?


title: Inserting wrapfig causes margin notes to disappear

text: I have this short example derived from this XeTeX CV template, which uses margin notes to show years. You can use the Mandrill picture for `pic.jpg`, and you could also use the original template to reproduce the issue instead of this SSCE.               %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode          \documentclass[10pt, a4paper]{article}     \usepackage{fontspec}           % DOCUMENT LAYOUT     \usepackage{geometry}      \geometry{a4paper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}     \setlength\parindent{0in}          % FONTS     \usepackage{xunicode}     \usepackage{xltxtra}     \defaultfontfeatures{Mapping=tex-text} % converts LaTeX specials (``quotes'' --- dashes etc.) to unicode     \setromanfont [Ligatures={Common},Numbers={OldStyle}]{Adobe Caslon Pro}     \setmonofont[Scale=0.8]{Monaco}      \setsansfont[Scale=0.9]{Optima Regular}           % ---- MARGIN YEARS     \usepackage{marginnote}     \newcommand{\years}[1]{\marginnote{\scriptsize #1}}     \renewcommand*{\raggedleftmarginnote}{}     \setlength{\marginparsep}{7pt}     \reversemarginpar          \usepackage{wrapfig}          % DOCUMENT     \begin{document}          \begin{wrapfigure}[1]{r}{.2\linewidth}       \centering       \includegraphics[width=1\linewidth]{pic.jpg}     \end{wrapfigure}          \section*{Education}     \noindent     \years{2011} Mandrill College\\          \end{document}      Ideally, it should show the following: ![](http://i.stack.imgur.com/0A3CL.png) But as soon as I include the `wrapfigure`, this becomes: ![](http://i.stack.imgur.com/zEH0p.png) The margin note simply disappears. There are no warnings displayed. Now, I've already observed that the placement of the figure relative to where the margin notes should be displayed doesn't matter. In my real CV I'd place the figure top right and the sections with Education etc. would be much further down the page. So my questions   * Why does this fail?   * What do I have to change to have the years displayed again?    * If I can't use `wrapfig` to insert a floating figure at the top right no matter what the text, what should I use instead?


title: How to avoid getting cropped marginpar?

text: I'm using the `fixme` package to add notes to various parts of my thesis draft. However, if I set the margins using the `geometry` package, I notice that the fixme notes are not formatted correctly (with margin overflow). Is there a simple fix? MWE below:               \documentclass[letterpaper]{amsbook}     \usepackage[draft]{fixme}     \usepackage[lmargin=1.3in,rmargin=1.3in,bottom=1.3in,top=1.3in,twoside=False]{geometry}          \begin{document}     \listoffixmes               stuff \fixme{Here is where I would put a really long fixme note, so long in fact that it might seem silly....}          \end{document}


title: FOSS for real-time PGFPlots

text: Any FOSS for real-time PGFPlots? Is it worth opening a feature request for KtikZ (QtikZ)?


title: TikZ - Node fit over multiple matrix cells does not want to align vertically

text: I'd like to align the top line of the node named `ImportantStuff` along the upper line of `AlsoImportantStuff`'s upper line. How can I do that? ## Picture ![enter image description here](http://i.stack.imgur.com/xIvoK.png) ## MWE (new)               \documentclass[     11pt,     a4paper     ]     {scrreprt}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}          \usepackage{         tikz,     }          \usetikzlibrary{         external,         plotmarks,         calc,         matrix,         intersections,         fit     }          \tikzset{     hauptgruppe/.style={         rectangle,         minimum width=1cm,         minimum height=1cm,         font=\sffamily\bfseries,         draw=black,         very thick,         fill=white,     },     infotext/.style={         draw=black,         rectangle,         font=\sffamily\footnotesize,         align=left,     },     }          \begin{document}     \begin{center}     \begin{tikzpicture}[font=\small]     \matrix [     matrix of nodes,     nodes in empty cells,     row sep=5pt,     column sep=5pt,     inner sep=5pt,     row 1/.style={nodes={hauptgruppe}},     %row 2/.style={nodes={infotext, text width=0.25\linewidth, align=center}},     name=m,     ]     {         | (asdf)| {\parbox[t]{1.8cm}{AAAA}\hfill\parbox[t]{1.8cm}{BBBB}} &         | (dfgdsfgadgf)| {BBBB} &         | (regf3refg)| {BBBB} \\         | [infotext, text width=0.25\linewidth, font=\sffamily\footnotesize, anchor=north] (ImportantStuff) | {%             \begin{itemize}             \item{AAA}             \item{BBB}             \item{CCC}             \item{Arbitrary words. Who knows how much text exactly\ldots}             \item{\ldots gets puts here\ldots}     %       \item{See?}             \end{itemize}} & |[minimum width=0.25\linewidth, minimum height=2cm, anchor=north]| ~ & |[minimum width=0.25\linewidth, minimum height=1cm, anchor=north]| ~ \\     };     \node[infotext, font=\sffamily\footnotesize, text width=0.5\linewidth, fit=(m-2-2) (m-2-3), anchor=north] (AlsoImportantStuff){%         \begin{itemize}         \item{Longer text to make it worth it.}         \item{And some words}         \item{Even more}         \end{itemize}};     \end{tikzpicture}     \end{center}     \end{document}      ## MWE (old), necessary if you like to understand the solution               \documentclass[     11pt,     a4paper     ]     {scrreprt}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}          \usepackage{         tikz,     }          \usetikzlibrary{         external,         plotmarks,         calc,         matrix,         intersections,         fit     }          \tikzset{     hauptgruppe/.style={         rectangle,         minimum width=1cm,         minimum height=1cm,         font=\sffamily\bfseries,         draw=black,         very thick,         fill=white,     },     gruppe/.style={         rectangle,         minimum width=2cm,         minimum height=0.8cm,         draw=gray,         very thick,         font=\sffamily\bfseries,     },     untergruppe/.style={         rectangle,         minimum width=2cm,         minimum height=1cm,          text width=3.5cm,         draw=gray,         very thick,         font=\sffamily,     },     infotext/.style={         draw=black,         rectangle,         font=\sffamily\footnotesize,         align=left,     },     }          \begin{document}     \begin{center}     \begin{tikzpicture}[font=\small]     \matrix [     matrix of nodes,     nodes in empty cells,     row sep=5pt,     column sep=5pt,     inner sep=5pt,     row 1/.style={nodes={hauptgruppe}},     row 2/.style={nodes={infotext, text width=0.25\linewidth, align=center}},     %row 3/.style={nodes={infotext, text width=0.25\linewidth, font=\sffamily\footnotesize}},     row 4/.style={nodes={infotext, text width=0.25\linewidth, font=\sffamily\footnotesize}},     name=m,     %below=2cm of      ]     {         | (ergergt3gdfg) | {Word} &         | (efgsdfhdahf) | {Yo} &         | (3fefgdsf) | {Lo} \\         | (erg4zdhfsz)| {\parbox[t]{1.8cm}{AAAA}\hfill\parbox[t]{1.8cm}{BBBB}} &         | (ElastomereBedhfwjeoifjwgispiel)| {BBBB} &         | (woiefs9djfo)| {BBBB} \\         | [infotext, text width=0.25\linewidth, font=\sffamily\footnotesize, anchor=north] (ImportantStuff) | {%             \begin{itemize}             \item{AAA}             \item{BBB}             \item{CCC}             \item{Arbitrary words. Who knows how much text exactly\ldots}             \item{\ldots gets puts here\ldots}     %       \item{See?}             \end{itemize}} & |[minimum width=0.25\linewidth, minimum height=2cm, anchor=north]| ~ & |[minimum width=0.25\linewidth, minimum height=1cm, anchor=north]| ~ \\         | (XXXXenschaften) | {%             \begin{itemize}             \item{A}             \item{B}             \item{C}             \end{itemize}} &         | (YYYYYY) | {%             \begin{itemize}             \item{A}             \item{B}             \item{C}             \end{itemize}} &         | (ZZZZZ) | {%             \begin{itemize}             \item{A}             \item{B}             \item{C}             \end{itemize}}\\     };     \node[infotext, font=\sffamily\footnotesize, text width=0.5\linewidth, fit=(m-3-2) (m-3-3), anchor=north] (AlsoImportantStuff){%         \begin{itemize}         \item{Longer text to make it worth it.}         \item{And some words}         \item{Even more}         \end{itemize}};     \end{tikzpicture}     \end{center}     \end{document}


title: Table row content, duplicate or quote in a different table

text: Following on from Arbitrary named counter, referenced, which was answered very comprehensively, I have a follow up question. This one's difficult to describe so my searching around the internet and StackExchange may not have found any existing answers, apologies if so, most happy to be directed towards previous answers if so. Basically, if I now have my beautifully arbitrarily labelled table (see Arbitrary named counter, referenced) thus:               [table begin preamble]     \project{ProjectAlpha} & [Description of alpha.] \\     \project{ProjectBeta}  & [Description of beta.] \\     \project{ProjectGamma} & [Description of gamma.] \\     [end table code]      Then what I need to do in other parts of the document is quote the entire table row. I.e., in other parts of the documents, I might need to show a table with just:               [table begin preamble]     ProjectBeta & [Description of beta.] \\     [end table code]      And there's no way I should reproduce that by hand since the underlying description will be changing regularly, so I'd want to write once, propagate everywhere (external documents too, using xr). Is there any way to do this? Maybe similar to how \pageref{} works by displaying the page number on which an object occurs, whether it's possible to show the entire row on which a label exists?


title: Command for paragraph indentation after equations

text: I want to write two new commands `\eqend` and `\eqcntd` so that when I put the command at the end of an equations,   1. The `\eqend` command puts a "." after the equation and forces the next paragraph to indent, regardless of the number of blank lines after the equation.   2. The `\eqcntd` command puts a "," after the equation and forces the next paragraph not to indent, regardless of the number of blank lines after the equation. This is a sample usage,               \begin{equation}     f(x) = x^2 + 1 \eqend     \end{equation}     Some text here, but it's gonna get indented.      and another one,               \begin{equation}     f(x) = x^2 + 1 \eqcntd     \end{equation}               Some text here, but it's not gonna get indented.      Here is my NOT-WORKING solution,               \newcommand{\eqend}{\,. \mbox{\par}}     \newcommand{\eqcntd}{, \mbox{\noindent}}


title: Word-by-word sorting of authors in bibliography using biblatex/biber

text: I am using Biber/`biblatex` for the bibliography of my forthcoming book. I just received the last round of corrections from the copyeditor, and discovered that the sort order used in my bibliography is letter-by-letter, not word-by-word (as defined in _The Chicago Manual of Style_ , 15th ed., 18.60). For example, the following two entries are sorted with Shapin appearing before Sha, because the following letter in Sha's name is "X", which comes after "p" in Shapin: > Shapin, Steven, and Simon Schaffer. Leviathan and the Air-Pump: Hobbes, > Boyle, and the Experimental Life. Princeton, NJ: Princeton University Press, > 1985. > > Sha, Xin Wei. “Whitehead’s Poetical Mathematics.” Configurations 13, no. 1 > (2007): 77–94. In a bibliography, "Sha" should come before "Shapin." The problem seems to be Biber: I tried two different styles for `biblatex` (`style=mla`, and the `biblatex-chicago` package) and in both "Shapin" came before "Sha"; when I used BibTeX instead of Biber, the order was correct, that is, "Sha" came before "Shapin." I realize I can of course go in by hand and add sortkeys, which would not be too much trouble. But is there an option I have overlooked, or a way to change this, in either `biblatex-chicago`, `biblatex`, or Biber?


title: When using longtable, my table counter starts from 2 rather than 1. Why?

text: When using `longtable`, my table counter starts from 2 rather than 1. Why? ![enter image description here](http://i.stack.imgur.com/BQb0C.png)               \documentclass[12pt]{article}          \usepackage{xcolor}     \usepackage{array,booktabs,longtable}     %\extrarowheight5pt          \begin{document}          \begin{table}     \begin{longtable}{@{}p{0.2\linewidth}p{0.4\linewidth}p{0.4\linewidth}@{}}     \toprule     Options         & Values             & Descriptions\\     \midrule     %     \verb|PtNameMath|         & {\color{blue}\verb|true|}, \verb|false|             &   whether the node label is in math mode.\\     %     \bottomrule      \end{longtable}     \caption{\texttt{\textbackslash pstGeonode} options.}     \label{tab:GeoNodeOptions}     \end{table}               \end{document}


title: \textbf{text} without increasing the length of the text

text: When using `\textbf{text}`, the length of `text` will be increased. Is there a way to make the `text` bold face without increasing its length? edit: Thanks to @Herbert and @Martin, here is a perfect solution for me:                  \newsavebox\CBox         \newcommand<>*\textBF[1]{\sbox\CBox{#1}\resizebox{\wd\CBox}{\ht\CBox}{\textbf#2{#1}}}


title: How do I put a table following the other table in a two-colmuns layout?

text: my page is of two columns layout and I want to put two tables in consequence on the right column like below:               text here    Table 1 goes here     text here     text here    Table 2 goes here     text here      while I have used `wraptable` then Table 1 is placed accurate but Table 2 is jumped to the left column below the last text line. In case if I remove `wraptable` for the table 2, the two tables are covering each other (overlapping). How can I have the two tables aligned in the right column?


title: revtex4 left and right margins are not the same

text: I seem to have a problem with margins. I'm using revtex4 (4-1 messes up my references, but that's not the point). The preambule is this:               \documentclass[twocolumn,prc,floats,amsmath,amssymb]{revtex4}      And when I compile it I get this: ![enter image description here](http://i.stack.imgur.com/W4cD8.jpg) How to get the same amount of white space on the same sides? Thanks for help :)


title: How to dim block environments in beamer

text: One of my beamer slides looks like the following:               \documentclass{beamer}     \begin{document}     \begin{frame}{}          \begin{block}{Theorem}     Theorem 1.     \end{block}     \pause          \begin{block}{Theorem}     Theorem 2.     \end{block}     \pause          \begin{block}{Theorem}     Theorem 3.     \end{block}          \end{frame}     \end{document}      So as written, it shows Theorem 1 on the top of the page, then the theorem disappears, then it shows Theorem 2 in the middle of the page, then the theorem disappears, then it shows Theorem 3 on the bottom of the page. What I would like it to do is show all three theorems on the page, but with the last two blocks dimmed out. When I change slides, I would like it to now dim the first theorem and brighten/emphasize the second block. Finally, I would like it to dim the second theorem and brighten the last theorem. How do I do this? If the question is unclear, I can clarify it. Help is appreciated! Thanks!


title: Running htlatex in a shell script (bash, mac)

text: I am trying to simply run a command:               htlatex texfilename "xhtml,charset=utf-8"      In a terminal command line, it runs well. If I create a shell script file that looks like:               #!/bin/bash     htlatex texfilename "xhtml,charset=utf-8"      It produces the following:               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)      restricted \write18 enabled.     entering extended mode     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge     rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi     c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis     h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis     h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h     ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma     rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,      kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,      polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s     lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,      welsh, loaded.          *      and stops. How can I make this work? Should I give some options to `htlatex`? I am using a Mac.


title: Autoindent in Texmaker?

text: I've been using Texmaker for ~5 years now and prefer it over other editors because of its flexibility. Is there a way to auto-indent LaTeX code in TeXmaker so that the code becomes more manageable ?


title: Strange result in plotting data using pgfplots

text: I'm trying to plot this:               \begin{tikzpicture}     \begin{axis}[         height=5cm,         width=\linewidth]         \addplot[smooth,blue] plot coordinates {         (27,177)         (28,223)         (29,240)         (30,227)         (31,201)         (32,186)         (33,183)         (34,187)         (35,192)         (36,191)         (37,188)         (38,174)         (39,168)         (40,169)         (41,195)         (42,249)         (210,413)         (211,473)         };     \end{axis}     \end{tikzpicture}      and this is the result: ![plot result \(strange\)](http://i.stack.imgur.com/5IMqq.jpg) > As you can see, my data contains increasing non repeating value on x axis. However, there's a curve that bend back at around `x=30` to `40` and `x=210` to `220`. However when I remove the last 2 data `(210,413),(211,473)` the resulting plot seems normal: ![plot result \(normal\)](http://i.stack.imgur.com/XaHMW.jpg) > Any idea for this?


title: Lua syntax for the listings package

text: I'm preparing some slides with `Beamer` and I've just discovered that the `listings` package, which otherwise does exactly what I want, is missing the syntax for the `Lua` language. How can I configure `listings` to highlight Lua?


title: In the siunitx package, how do i get it to produce uncertainties with the \pm symbol instead of parenthesis

text: Using the `siunitx` package, if I specify an error with the `\pm` symbol then it automatically converts it to a form using parenthesis. I would like it to not do this and keep the `\pm` symbol, but still space the elements of the quantity and symbol in a good way. e.g. `\SI{10 \pm 2}{\kelvin} would produce 10(1) k` I would like it to produce: `10\pm1 k` or something similar with spacing taken care of.


title: How can I use the lstsample environment (lstdoc package) in article?

text: I would like to try the `lstsample` environment from the `lstdoc` package, distributed with the `listings` package. For that I have written the following document:               \documentclass{article}     \usepackage{lstdoc}     \usepackage{lipsum}          \begin{document}          \begin{lstsample}{}{}       \color{blue}       \lipsum[68]     \end{lstsample}          \end{document}      But it fails compilation with the message:               ! Undefined control sequence.     \lst@sampleInput ->\MakePercentComment                                             \catcode `\^^M=10\relax \small \lst@s...     l.10     \end{lstsample}      What am I missing?


title: How to make a wide longtable fit on page?

text: I'm new to LaTeX, and copied over a table from Excel into TeXShop (mac) using the macro. I set it as a longtable because it spans two pages, but with regard to width, the table isn't fitting. Also, where can I insert the `\label` and `\caption` commands? Here's the code I've used:                 \documentclass[12pt,a4paper]{report}              \title{}             \author{}             \date{}              %This introduces packages that will be used in the text          \usepackage{longtable}         \usepackage{graphicx}         \usepackage{url}         \usepackage{float}         \usepackage{siunitx}         % lscape.sty Produce landscape pages in a (mainly) portrait document.         \usepackage{lscape}              %This sets new commands/shortcuts that can be used         \newcommand{\ecoli}{\emph{Escherichia coli }}         \newcommand{\PCMX}{Chloroxylenol }         \newcommand{\potperm}{Potassium Permanganate}         \newcommand{\mhagar}{Mueller-Hinton Agar}         \newcommand{\sulfuricacid}{H$_2$SO$_4$}          \begin{landscape}     \subsection{Blank Data Tables}     %Table generated by macro in TeXShop by copy-pasting table from Excel          \begin{longtable}{lllllllll}     No. & Juice & Loc. & Samp.No. & Dettol /mm$\pm$0.05 & Ethanol /mm$\pm$0.05 & 2M \sulfuricacid /mm$\pm$0.05 & H$^+$/KMnO$_4$ /mm$\pm$0.05 & Control/mm$\pm$0.05 \\     \endfirsthead     No. & Juice & Loc. & Samp.No. & Dettol /mm$\pm$0.05 & Ethanol /mm$\pm$0.05 & 2M \sulfuricacid /mm$\pm$0.05 & H$^+$/KMnO$_4$ /mm$\pm$0.05 & Control/mm$\pm$0.05 \\     \endhead     \multicolumn{9}{r}{{Continued\ldots}} \     \endfoot     \hline     \endlastfoot          1 & Sugarcane & 1 & 1 \\     2 & Sugarcane & 1 & 2 \\     3 & Sugarcane & 1 & 3 \\     4 & Sugarcane & 1 & 4 \\     5 & Sugarcane & 1 & 5 \\     6 & Orange & 1 & 1 \\     7 & Orange & 1 & 2 \\     8 & Orange & 1 & 3 \\     9 & Orange & 1 & 4 \\     10 & Orange & 1 & 5 \\     11 & Carrot & 1 & 1 \\     12 & Carrot & 1 & 2 \\     13 & Carrot & 1 & 3 \\     14 & Carrot & 1 & 4 \\     15 & Carrot & 1 & 5 \\     16 & Sugarcane & 2 & 1 \\     17 & Sugarcane & 2 & 2 \\     18 & Sugarcane & 2 & 3 \\     19 & Sugarcane & 2 & 4 \\     20 & Sugarcane & 2 & 5 \\     21 & Orange & 2 & 1 \\     22 & Orange & 2 & 2 \\     23 & Orange & 2 & 3 \\     24 & Orange & 2 & 4 \\     25 & Orange & 2 & 5 \\     26 & Carrot & 2 & 1 \\     27 & Carrot & 2 & 2 \\     28 & Carrot & 2 & 3 \\     29 & Carrot & 2 & 4 \\     30 & Carrot & 2 & 5 \\     31 & Sugarcane & 3 & 1 \\     32 & Sugarcane & 3 & 2 \\     33 & Sugarcane & 3 & 3 \\     34 & Sugarcane & 3 & 4 \\     35 & Sugarcane & 3 & 5 \\     36 & Orange & 3 & 1 \\     37 & Orange & 3 & 2 \\     38 & Orange & 3 & 3 \\     39 & Orange & 3 & 4 \\     40 & Orange & 3 & 5 \\     41 & Carrot & 3 & 1 \\     42 & Carrot & 3 & 2 \\     43 & Carrot & 3 & 3 \\     44 & Carrot & 3 & 4 \\     45 & Carrot & 3 & 5 \\          \end{longtable}     \end{landscape}     \end{document}


title: Pass a list through pgfkey

text: I'm declaring a new shape [which looks like an Integrated Circuit]. One of the options I want to provide for this shape should be a list of positive integers with arbitrary length [which configures something about the IC ports]. For example, the call to create a node of this shape should look like:               \node (X) [TheShape,LeftPorts={2,4,3}] {};      ... or at least that's what I hope to have. The above won't work because the commas will be interpreted as beginning of a new `<key>=<value>` pair. I will later want to iterate though this `LeftPorts` list with `\foreach` multiple times to perform maths (such as sum) and drawing. Hence, the next obvious alternative:               \node (X) [TheShape,LeftPorts/.list={2,4,3}] {};      does not seem to work(?). Since it will be processing through the list with `.code` in just a single run; and without any place for me to setup initial condition for the loop. (like resetting sum counter to 0) **The question is:** How to pass such list of integer through pgfkeys so it can be later processed by `\foreach` freely multiple times. * * * To give some code to work on and show another attempt by using `\noexpand`:               \documentclass{article}     \usepackage{tikz}          \tikzset{         Total/.initial=2,         List/.initial=2,         LeftPorts/.initial=2,         LeftPorts/.code={             \tikzset{List=#1}             % calculate total             \foreach \x in #1 { % <- not working.                 \tikzset{Total=\x}             }         },     }          \newcommand{\listVals}{         \begin{itemize}             \item LeftPorts: \pgfkeysvalueof{/tikz/LeftPorts}             \item List: \pgfkeysvalueof{/tikz/List}             \item Total: \pgfkeysvalueof{/tikz/Total}         \end{itemize}     }          \begin{document}         \tikzset{LeftPorts=\noexpand{4,5,6}}         \listVals     \end{document}      expected result:   * LeftPorts: 2   * List: 4,5,6   * Total: 6 Actual result:   * LeftPorts: 2   * List: 4,5,6   * Total: 2 Note: If you can show how to use that `\foreach` to do total sum or product as well, it would be appreciated.


title: Drawing lines between 2 intersections of a function given the y-value (Morse potential)

text: I have to draw lines (vibrational energy lines) in a Morse potential curve. Let me explain it with a more general example : If I have a parabola x², I want to draw lines in it given a set of y values, for instance (1; 0.5; 0.7; 0.8; 0.85; 0.875). How can I draw these lines up to the intersection? For example, how can I find the x values to draw the first line from (-1,1) up to (1,1)? My intention is to draw a figure like this ![Morse potentials](http://i.stack.imgur.com/6TleC.gif)


title: Strange beamer problem

text: Could anybody tell me why the following `beamer` document does not compile?               \documentclass{beamer}          \DeclareMathAlphabet{\mathbb}{U}{msb}{m}{n}     \let\mathbb\undefined     \DeclareMathAlphabet{\mathbb}{U}{msb}{m}{n}          \begin{document}     \begin{frame}     $\mathbb{Q}$     \pause     \begin{itemize}      \item Test     \end{itemize}     \end{frame}     \end{document}      The strange thing is that the code compiles when I remove _either one_ of the following:   1. the first `\DeclareMathAlphabet`,   2. `\let\mathbb\undefined`,   3. `$\mathbb{Q}$`   4. `\pause`,   5. the `itemize` environment. Of course, the first two lines in this document are superfluous, but I would like to know what is going wrong. I am using `beamer` in version 3.10 with TeXLive 2011.


title: Remove parentheses from number with uncertainty and the separate-uncertainty=true option with siunitx

text: This is a follow-up to my previous question. Using the `separate- uncertainty=true` option with **siunitx** , a number like `\SI{100 \pm 12}{\kelvin}` would be output as (100 \pm 12) K I want to get rid of the parentheses. Now there is a `bracket-numbers = false` option, which doesn't seem to work in this instance. I can do `open- bracket={}, close-bracket={}` in the options and this will work, but it seems rather brute force, as I intend to apply this to the whole document. Does any one know a better way to sort this?


title: Reduce spacing in table of contents (beamer)

text: How can I reduce the spacing between the items of my table of contents in my beamer presentation? Here is my currient LaTeX code:               \documentclass{beamer}     \usepackage[T1]{fontenc}     \usepackage{lmodern}der pdf     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}          \title[Short title]{My very long title that doesn't fit into the footer}     \author{Me}     \date{\today}     \beamertemplatenavigationsymbolsempty     \setbeamertemplate{footline}[frame number]     \usetheme{CambridgeUS}          \AtBeginSection[]     {     \begin{frame}     \frametitle{Outline}     \tableofcontents[currentsection, hideothersubsections]     \end{frame}     }          \begin{document}          \maketitle     \clearpage          \begin{frame}     \frametitle{Outline}     \tableofcontents[hideothersubsections]     \end{frame}               \section{Intro}     \begin{frame}     \frametitle{Welcome}     ...     \end{frame}          \section{Topic 1}     \begin{frame}     \frametitle{Topic 1}     ...     \end{frame}          \section{Topic 2}     \begin{frame}     \frametitle{Topic 2}     ...     \end{frame}          \subsection{Red}     \begin{frame}     \frametitle{Red}     ...     \end{frame}          \subsection{Green}     \begin{frame}     \frametitle{Green}     ...     \end{frame}          \subsection{Blue}     \begin{frame}     \frametitle{Blue}     ...     \end{frame}          \section{Topic 3}     \begin{frame}     \frametitle{Topic 3}     ...     \end{frame}          \section{Topic 4}     \begin{frame}     \frametitle{Topic 4}     ...     \end{frame}          \section{Topic 5}     \begin{frame}     \frametitle{Topic 5}     ...     \end{frame}          \section{The end}     \begin{frame}     \frametitle{The end}     End of file :-)     \end{frame}          \end{document}      See page 7 the point "The end" is missing. I need that one.


title: Footnotes tabularx-environment LaTeX

text: I've been trying to find a satisfying solution to the footnotes-in-tables- problem for hours now. Nothing I come across seems to work the way it should. Still, in the `tabularx` package documentation it is stated that `tabularx` supports `\footnote`. I've tried using the               \footnote{footnote text}      command in the `tabularx` environment, and it for sure shows the footnote in the table (hallelujah!), but not the footnote text (not so much hallelujah). I've also tried               \footnotemark[footnote#]      with               \footnotetext[footnote#]{footnote text}      somewhere underneath the table, which works perfectly fine, except that you have to keep track of the counters yourself, which results in tragedy when you insert a normal `\footnote` elsewhere in the text on the page. The best solution would be if one could have lettered footnotes in the table and numbered for the text, but `\footnotemark` does not support using letters as numbers. So... does anyone understand how `tabularx` works with footnotes? A MWE:               \begin{table}[!h]     \centering     \caption{Characteristics of the most common reactor types}     \label{tab:reactor-properties}     \begin{tabularx}{0.8\textwidth}{*{4}{L}}     \toprule     Type    & Fuel \footnotemark[1] & Moderator  & Coolant  \\     \midrule     LGR \footnotemark[2] & \ce{UO2}, enr. & Graphite, \ce{H2O}  & \ce{H2O}(\emph{l}) \\     \bottomrule     \end{tabularx}     \end{table}          \footnotetext[1]{enr. = enriched in \ce{^{235}U}, nat. = natural}     \footnotetext[2]{There were four such reactors at the Chernobyl plant at the time of the accident \cite{nuclear-energy}}      EDIT: The solution offered by David Carisle worked perfectly for a day or so. I have no idea why it stopped working, but both the footnote-text and references have stopped working in a minipage-tabularx-environment. A MWE:               \documentclass[a4paper,11pt]{article}          \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{geometry,parskip,setspace,amsmath,amssymb,amsfonts,gensymb}     \usepackage[english]{babel}     \usepackage[per-mode=symbol]{siunitx}     \usepackage{graphicx,tabularx,booktabs,multirow,url,hyperref}     \usepackage[hang,small,bf]{caption}     \usepackage[version=3]{mhchem}     \usepackage[page,toc]{appendix}     \usepackage[ref]{cite}     \usepackage{fancyhdr}          %Footnotes in table     \makeatletter     \newtoks\FTN@ftn     \def\pushftn{%      \let\@footnotetext\FTN@ftntext\let\@xfootnotenext\FTN@xftntext       \let\@xfootnote\FTN@xfootnote}     \def\popftn{%      \global\FTN@ftn\expandafter{\expandafter}\the\FTN@ftn}     \long\def\FTN@ftntext#1{%       \edef\@tempa{\the\FTN@ftn\noexpand\footnotetext                         [\the\csname c@\@mpfn\endcsname]}%       \global\FTN@ftn\expandafter{\@tempa{#1}}}%     \long\def\FTN@xftntext[#1]#2{%       \global\FTN@ftn\expandafter{\the\FTN@ftn\footnotetext[#1]{#2}}}     \def\FTN@xfootnote[#1]{%        \begingroup          \csname c@\@mpfn\endcsname #1\relax          \unrestored@protected@xdef\@thefnmark{\thempfn}%        \endgroup        \@footnotemark\FTN@xftntext[#1]}          \makeatother     %End footnotes in table          % ---------- New Commands ----------     \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}     \newcolumntype{C}{>{\centering\arraybackslash}X}      \newcolumntype{L}{>{\raggedright\arraybackslash}X}          \begin{document}          \begin{table}[!h]     \begin{minipage}{1\textwidth}     \centering     \caption{Characteristics of the most common desalination processes \cite{ref1} \label{tab:desalination-properties}}     \begin{tabularx}{1\textwidth}{l l L L}     \toprule     Property                &   Reverse Osmosis         &   MSF\footnote{For large MSF plants}      &    MED        \\     \midrule     El.\footnote{El. = electrical} energy consumption    [\si{\kilo\watt\per\cubic\metre}]  &   $6.5-12$    & $4-6$ \ref{ref1}      &   $4.5-12.5$  \\     Th.\footnote{Th. = thermal} energy consumption [\si{\kilo\watt\per\cubic\meter}] &              & $55-120$ \ref{ref1}   &               \\     Plant cost              &   High                        &   Medium      &   Low         \\     Product quality         &   Medium\footnote{Energy dependent}   &   High            &   High            \\     Feed pretreatment       &   High                        &   Medium      &   Low         \\     Maintenance             &   High                        &   Low         &   Low         \\     \bottomrule      \end{tabularx}     \end{minipage}     \end{table}               \begin{thebibliography}{9}     \bibitem{ref1} Some reference     \end{thebibliography}          \end{document}      As seen in the screen dump below, footnotetext and references (note, I'm importing a bib-file in my document) are not working inside the tabularx- environment: ![Table with non-working footnotes and references](http://i.stack.imgur.com/ymSSo.png) Providing the file list given from \listfiles:               *File List*     article.cls    2007/10/19 v1.4h Standard LaTeX document class       size11.clo    2007/10/19 v1.4h Standard LaTeX file (size option)     inputenc.sty    2008/03/30 v1.1d Input encoding file       latin1.def    2008/03/30 v1.1d Input encoding file      fontenc.sty        t1enc.def    2005/09/27 v1.99g Standard LaTeX file     geometry.sty    2010/09/12 v5.6 Page Geometry       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)       ifvtex.sty    2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO)      ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional      parskip.sty    2001/04/09 non-zero parskip adjustments     setspace.sty    2011/12/19 v6.7a set line spacing      amsmath.sty    2000/07/18 v2.13 AMS math features      amstext.sty    2000/06/29 v2.01       amsgen.sty    1999/11/30 v2.0       amsbsy.sty    1999/11/29 v1.2d       amsopn.sty    1999/12/14 v2.01 operator names      amssymb.sty    2009/06/22 v3.00     amsfonts.sty    2009/06/22 v3.00 Basic AMSFonts support      gensymb.sty    2003/07/02 v1.0 (WaS)        babel.sty    2008/07/08 v3.8m The Babel package      english.ldf    2005/03/30 v3.3o English support from the babel system      siunitx.sty    2012/01/19 v2.4i A comprehensive (SI) units package        expl3.sty    2012/01/19 v3209 L3 Experimental code bundle wrapper      l3names.sty    2011/12/30 v3113 L3 Experimental namespace for primitives     l3bootstrap.sty    2011/12/29 v3110 L3 Experimental bootstrap code         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)         calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)        color.sty    2005/11/14 v1.0j Standard LaTeX Color (DPC)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)      ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live     l3basics.sty    2012/01/15 v3196 L3 Experimental basic definitions      l3expan.sty    2012/01/15 v3196 L3 Experimental argument expansion         l3tl.sty    2012/01/09 v3158 L3 Experimental token lists        l3seq.sty    2012/01/09 v3158 L3 Experimental sequences and stacks        l3int.sty    2012/01/07 v3139 L3 Experimental integers      l3quark.sty    2012/01/08 v3148 L3 Experimental quarks        l3prg.sty    2011/12/31 v3122 L3 Experimental control structures      l3clist.sty    2012/01/09 v3157 L3 Experimental comma separated lists      l3token.sty    2011/12/31 v3123 L3 Experimental token manipulation       l3prop.sty    2012/01/09 v3158 L3 Experimental property lists        l3msg.sty    2012/01/08 v3153 L3 Experimental messages         l3io.sty    2012/01/09 v3160 L3 Experimental input-output operations       l3file.sty    2012/01/09 v3158 L3 Experimental file operations       l3skip.sty    2012/01/07 v3139 L3 Experimental dimensions and skips       l3keys.sty    2011/12/22 v3086 L3 Experimental key-value interfaces         l3fp.sty    2012/01/08 v3154 L3 Experimental floating-point operations        l3box.sty    2012/01/09 v3158 L3 Experimental boxes     l3coffins.sty    2012/01/08 v3155 L3 Experimental coffin code layer      l3color.sty    2011/09/07 v2776 L3 Experimental colour support     l3luatex.sty    2012/01/09 v3158 L3 Experimental LuaTeX-specific functions        array.sty    2008/09/09 v2.4c Tabular extension package (FMi)     l3keys2e.sty    2012/01/19 v3207 LaTeX2e option processing using LaTeX3 keys       xparse.sty    2012/01/19 v3209 L3 Experimental document command parser     translator.sty    2010/06/12 ver 1.10     translator-language-mappings.tex     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)     tabularx.sty    1999/01/07 v2.07 `tabularx' package (DPC)     booktabs.sty    2005/04/14 v1.61803 publication quality tables     multirow.sty              url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.     hyperref.sty    2011/12/04 v6.82m Hypertext links for LaTeX     hobsub-hyperref.sty    2011/04/23 v1.4 Bundle oberdiek, subset hyperref (HO)     hobsub-generic.sty    2011/04/23 v1.4 Bundle oberdiek, subset generic (HO)       hobsub.sty    2011/04/23 v1.4 Subsetting bundle oberdiek (HO)     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)      intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)     etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)     kvsetkeys.sty    2011/04/07 v1.13 Key value parser (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Defining keys (HO)     pdftexcmds.sty    2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)     pdfescape.sty    2011/04/04 v1.12 Provides string conversions (HO)     bigintcalc.sty    2011/01/30 v1.2 Expandable big integer calculations (HO)       bitset.sty    2011/01/30 v1.1 Data type bit set (HO)     uniquecounter.sty    2011/01/30 v1.2 Provides unlimited unique counter (HO)     letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)      hopatch.sty    2011/01/30 v1.0 Wrapper for package hooks (HO)     xcolor-patch.sty    2011/01/30 xcolor patch     atveryend.sty    2011/04/23 v1.7 Hooks at very end of document (HO)     atbegshi.sty    2011/01/30 v1.15 At begin shipout hook (HO)     refcount.sty    2010/12/01 v3.2 Data extraction from references (HO)      hycolor.sty    2011/01/30 v1.7 Color options of hyperref/bookmark (HO)     kvoptions.sty    2010/12/23 v3.10 Keyval support for LaTeX options (HO)       pd1enc.def    2011/12/04 v6.82m Hyperref: PDFDocEncoding definition (HO)     hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive      hpdftex.def    2011/12/04 v6.82m Hyperref driver for pdfTeX     rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)      caption.sty    2011/11/10 v3.2e Customizing captions (AR)     caption3.sty    2011/11/01 v1.4a caption3 kernel (AR)       mhchem.sty    2011/06/03 v3.11 for typesetting chemical formulae       ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)       twoopt.sty    2008/08/11 v1.5 Definitions with two optional arguments (HO)     appendix.sty    2009/09/02 v1.2b extra appendix facilities         cite.sty    2010/09/10  v 5.3     fancyhdr.sty         supp-pdf.mkii     epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf       grfext.sty    2010/08/19 v1.1 Managing graphics extensions (HO)     epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live     translator-basic-dictionary-English.dict         siunitx-abbreviations.cfg    2012/01/19 v2.4i siunitx: Abbreviated units     siunitx-binary.cfg    2012/01/19 v2.4i siunitx: Binary units      nameref.sty    2010/04/30 v2.40 Cross-referencing by name of section     gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)     "Test document".out     "Test document".out         umsa.fd    2009/06/22 v3.00 AMS symbols A         umsb.fd    2009/06/22 v3.00 AMS symbols B      ***********


title: How to make table floats work with preview/standalone environment?

text: Couldn't make a table float work inside the preview environment:               \documentclass[fontsize=16pt]{scrartcl}          \usepackage[active,tightpage]{preview}     \setlength{\PreviewBorder}{25pt}          \begin{document}     \begin{preview}          \begin{table}     \centering     \begin{tabular}{c|c}     a & b\\     \hline     c & d\\     \end{tabular}     \caption{testing}     \label{tab:testing}     \end{table}          \end{preview}     \end{document}      gives error "Not in outer par mode". The manual of preview mentions a "floats" option, but adding it makes no difference. I know that making a table "float" don't make much sense in a single preview page, I just want them to become non-float and stay in the place where it's defined and show up in the preview. And then I found this question. It says that standalone package would work. But I couldn't get it to work either:               \documentclass{standalone}          \begin{document}          \begin{table}     \centering     \begin{tabular}{c|c}     a & b\\     \hline     c & d\\     \end{tabular}     \caption{testing}     \label{tab:testing}     \end{table}          \end{document}      gives error "Something's wrong--perhaps a missing \item". And even if it works, it raises a serious problem, that is, it occupies the documentclass but I must use KOMA-Script. By the way, I use xelatex, don't know if it matters. Any ideas? **Edit** : I think I have mentioned in the post that I know what a "float" means and that it does not make "much" sense. But it does make some sense: I use preview for, literally, preview. So every element in the document should show up in the preview so I can "preview" it. And for a table float the proper way of show up is to become a non-float and stay at where it's defined. This is exactly what this post says standalone is supposed to do. Then after the preview, if I comment out the preview package or make it inactive, every thing should work in the normal way again (table floats float normally, etc). So I'm not asking for a method of making a table float sticky, but how to make it show up in preview/standalone environment. **Solution** :The solution turns out to be               \documentclass[preview,class=scrartcl,fontsize=20pt]{standalone}      This will automatically turn table floats into non-float while retaining the original document class. Also see Jesse's answer for a clever but a little more sophisticated solution.


title: LaTeX template for Oxford Journal about IT science [The Computer Journal]

text: I'm looking for LaTeX templates to typeset a working paper in a Oxford journal's preprint style, I'm also looking for BibTeX style files (templates) for Oxford Journal about IT science. I found this link: http://www.oxfordjournals.org/for_authors/latex.html but it doesn't help much, I cant see anywhere any template (or *.sty file) I can download and work with. Any ideas, links, help? I'm asking about The Computer Journal from Mathematics & Physical Sciences, here: http://www.oxfordjournals.org/our_journals/computer_journal/about.html. Unfortunately I cant see any *.tex or *.sty file there which I could use.