title: Custom acronyms via \def

text: I'd like to define acronyms via the \def command. I know that the acronym package exists, but that's too much typing (\ac{myacronym} vs. \myacronym). The problem that I have is that for \def\myacronym{acronym expanded}, it won't have an empty space after it, so I can only use it in front of punctuation. For \def\myacronym{acronym expanded }, I cannot use it before punctuation because it always causes an empty space. My question is: How can I detect whether punctuation comes after the acronym, so I can dynamically generate a space only if needed. Also, it would be nice to be able to detect whether there is the string ". " before my acronym, so I could make the acronym uppercase dynamically. I guess this is kind of hard to do since those parameters are not passed to the function, but maybe somebody has an idea. Thanks for your help:)


title: bold letter or word spacing for text animation

text: I want to make a text animation movie for my wife for Valentines. My first thought was to use the beamer package and have a different word in bold on each slide. I would then convert the pdf to jpegs and use each slide as a frame. As I am reading the slides in the audio, the words will go to bold in sequence. The problem is that the bold letters are wider than the non-bold letters, so the words slide around a little between frames depending on which word is bold. I would like this to go away, but I don't know the best way to fix it. My first thought was to try and set the letter spacing for non-bold text to match that of bold text. I don't know exactly how to do that, but I suspect it won't look that great. Trying to set the word spacing to what it would be if all the text were bold seems like it might look better, but I am not sure it is feasible. How do I do this well?


title: Is there a way to tune ball shading in TikZ ?

text: I want to create a Go stone in TikZ. "ball color" option in node style is almost OK.   Here is my result: ![alt text](http://i.stack.imgur.com/hP8rZ.png) But I don't like the stones, they are "too balish". The "reflection" should be less spot-on and more ambient. I could get such a result if I could manipulate both shading colors or shading curve. Can I do it in TikZ? Here is what I want to achieve: ![alt text](http://i.stack.imgur.com/L654J.png) PS. Any ideas to render wood-like background w/o texture?


title: Beamer navigation bar dresden theme

text: I am using the dresden theme for a presentation. However, I have too many subsection in a section part of the presentation. The slides I have in a subsection are represented by circles that will highlight when I'm on the current slide. But they're too many and it makes the navigation bar too long. Is there a way to shorten it? Like having to columns of circles or only displaying the current subsection? I have a row of circles for each slides in each subsection. But 7 subsection makes the rows of circles too long.               \documentclass{beamer}     \usetheme{Dresden}     \usecolortheme[overlystylish]{albatross}     \setbeamertemplate{caption}[numbered]               \begin{document}          \section{Section 1}     \subsection{Subsection 1}          \begin{frame}     \end{frame}          \subsection{Subsection 2}          \begin{frame}     \end{frame}          \subsection{Subsection 3}     \begin{frame}     \end{frame}          \subsection{Subsection 4}     \begin{frame}     \end{frame}          \subsection{Subsection 5}     \begin{frame}     \end{frame}          \subsection{Subsection 6}     \begin{frame}     \end{frame}          \subsection{Subsection 7}     \begin{frame}     \end{frame}          \end{document}      Thank you very much. ![enter image description here](http://i.stack.imgur.com/4dIO9.png)


title: Display inline sums

text: I am writing my thesis and I have some sums which are inline, and others which are part of equations. My questions is: is there a convention, an unwritten rule about how inline equations should be displayed? Which of the following is the "right" one for this kind of situation?   * `$T=\{\sum\nolimits_{i:e_{i} \in S_{j}} y_{i} = w_{j}\}$`   * `$T=\{\displaystyle\sum\limits_{i:e_{i} \in S_{j}} y_{i} = w_{j}\}$` In a book I have seen that all the inline sums are written with the first code, while the ones from equations with the second. Is this the correct way?


title: Center text in a table column?

text: I have the following table               \begin{tabular}{ll}     \includegraphics{tag.png} & bla bla bla.\\     \includegraphics{tag.png} & \\     \includegraphics{tag.png} & Store project\\     \includegraphics{tag.png} & Gestures\\     \includegraphics{tag.png} & Screenshot\\     \includegraphics{tag.png} & Tagging\\     \end{tabular}      Now I'd like to achieve that the second column consumes all the remaining page width and the text should be centered vertically in the cell. I achieve either one of this but no both together. Any hints?


title: How do I properly set up Latex-suite in Gvim?

text: I just installed Miktex, and downloaded Latex Suite latest snapshot. I extracted its files in both **C:\Program files (x86)\Vim\vimfiles** and **C:\Program files (x86)\Vim\vim74** _(I'm not sure why I have these two directories; it may be due to I have gVim and vim from cygwin)_. I also edited my _vimrc to add the options that Latex-Suite installation guide says. It seems to work, since commands like !latex and !yap example.tex are executed for a simple tex file. However, in gVim the menu tabs related to Tex do not appear. Also, the command "echo Tex_CompileRule_dvi" tells this is an undefined variable. I'm afraid I might be missing some things attrying to use Latex within gVim...


title: How to align terms in alignat environment (follow-up)

text: This is follow-up on the similar question. I still cannot figure out where to put ampersands on `alignat` environments. :( * * * Here is what I generated. ![enter image description here](http://i.stack.imgur.com/w8yF7.png) To enhace the readability, I want to customize the alignment.   * I'd like the second column to be aligned around `\oplus` even though it induces some spaces after the first `=` sign and before the second `=` sign.   * Similarly, I'd like the third column to be aligned around `+` sign even though it induces some space after the `=` signs.   * Yet, I'd like the three columns to be separated by the `=` signs that are vertically aligned as shown above. How can I do that?               \documentclass{minimal}          \usepackage{amsmath,amssymb,bm}     % Matrix inverse \inv[2]{\Abf} or \inv{\Abf}     \newcommand{\inv}[2][1]{\ensuremath{{#2}^{-{#1}}}}     % Matrix transpose     \newcommand{\trans}[1]{\ensuremath{{#1}^\intercal}}          \newcommand{\Abf}{\ensuremath{\bm{A}}}     \newcommand{\Ibf}{\ensuremath{\bm{I}}}     \newcommand{\Pbf}{\ensuremath{\bm{P}}}     \newcommand{\Qbf}{\ensuremath{\bm{Q}}}     \newcommand{\Ubf}{\ensuremath{\bm{U}}}          \begin{document}          \begin{subequations}     \begin{alignat}{3}     \lambda\Ibf - \Abf     &=     \Ubf     \big(     (\lambda-n)\Ibf_{k-1}     &\oplus     \lambda\Ibf_{n-k+1}     \big)     \trans\Ubf     &=     (\lambda-n)\Pbf + \lambda\Qbf     \\     \inv{(\lambda\Ibf - \Abf)}     &=     \Ubf     \Bigg(     \frac{1}{\lambda-n}\Ibf_{k-1}     &\oplus     {\frac 1 \lambda}\Ibf_{n-k+1}     \Bigg)     \trans\Ubf     &=     {\frac 1 {(\lambda-n)}}\Pbf + {\frac 1 \lambda}\Qbf     \\     \inv[2]{(\lambda\Ibf - \Abf)}     &=     \Ubf     \Bigg(     \frac{1}{(\lambda-n)^2}\Ibf_{k-1}     &\oplus     {\frac 1 {\lambda^2}}\Ibf_{n-k+1}     \Bigg)     \trans\Ubf     &=     {\frac 1 {(\lambda-n)^2}}\Pbf + {\frac 1 {\lambda^2}}\Qbf     \end{alignat}     \end{subequations}          \end{document}


title: Create PDF with images in black and white

text: I have a LaTeX document with several black and white, gray value, and color images. When creating a PDF with pdfLaTeX I get a PDF where I am not sure if the embedded black and white images are actually set as black and white (important for the printing costs). Is there a way to test which images are set as black and white, gray value, and color; and if necessary force pdfLaTeX to set them as black and white?


title: How to count the number of authors of a document?

text: I need to make a change to a Latex style (.sty) which contains the following line:               {\large {\boldCondensed\color{corporate3Color}\raggedright AUTHORS: \MakeUppercase \@author\par}}      The problem is that when there is a single author, the results prints "AUTHORS: JOHN DOE" with the "S" at the end of authors. Hence, I would like to find a way to make sure that if there is a single author, the "S" is removed from the header. How do I recover the number of authors that was provided in the document?


title: How to print A0 poster as an array of combinable A4 pages?

text: So I have an A0 paper on which I want to stick myltiple A4 pages representing original A0 poster presentation. I have no A0 printer. I can print only A4 pages. How to get A0 latex poster be printed as multiple A4 so I could glue them toogether? no pages shall overlap, no offset - I want to get `4x4==16` A4 pages (I use `pdflatex` for tex to pdf printing)


title: Using ted (or another package) instead of etoolbox for patching commands in memoir?

text: Another question related to my university's odd ToC style requirements. Regular chapters in the ToC need to have all-caps titles, and appendices need regular-case titles. I have a perfectly elegant etoolbox solution               \documentclass{memoir}     \makeatletter     \usepackage{etoolbox}     \patchcmd{\@chapter}%     {\addcontentsline{toc}{chapter}}%     {\let\f@rtocold\f@rtoc%      \def\f@rtoc{\uppercase\expandafter{\f@rtocold}}%      \addcontentsline{toc}{chapter}}%     {\typeout{Chapter Patch Succeeded}}%     {\typeout{Chapter Patch Failed}}     \makeatother     \begin{document}     \tableofcontents*     \chapter{One}     This is chapter 1.     \appendix     \chapter{Alpha}     This is appendix A.     \end{document}      but it seems PCTeX 6 doesn't have e-TeX support built in (waiting on registration at the PCTeX forums so I can ask about that directly). I don't use it myself, but some people here do, and I'd like to avoid having them change TeX systems if possible. I can't use memoir's built-in `\patchcommand`, since `\@chapter` has delimited arguments. I've tried using `\Substitute*` from `ted`, but no success yet. Replacing the commands between `\makeatletter` and `\makeatother` above with the following:               \usepackage{ted}     \Substitute*[\renewcommand{\@chapter}]{\@chapter}%     {\addcontentsline{toc}{chapter}}%     {\let\f@rtocold\f@rtoc%      \def\f@rtoc{\uppercase\expandafter{\f@rtocold}}%      \addcontentsline{toc}{chapter}}      I get `Use of \@chapter doesn't match its definition.` How can I convince `\Substitute*` to modify a command with arguments?


title: TikZ: How to use \tikzexternalize in TeXstudio or How to create Makefile for using \tikzexternalize

text: This question is based on Draft option in TikZ like graphicx. From pgf manual, > 33.4 Externalizing Graphics > > The probably most comfortable way is to use the default conguration with > **pdflatex -shell-escape main** which authorizes pdflatex to call itself > recursively to generate the images. Also manual says _"users will need to issue the required commands manually (or with make)"_ How to issue the required commands manually? or How to issue the required commands using makefile? I am using **TeXstudio** with **Miktex**


title: Two-column figures not displaying in IEEEtran document class

text: I have a two column document in which I display a lot of figures. I also have to display some figures spanning the two columns. To display "normal" figures I use this piece of code, for example:               \documentclass[conference]{IEEEtran}     \usepackage{subfig}     \usepackage{fixltx2e}     \usepackage{stfloats}          \begin{document}          \begin{figure}[!htb]     \centering     \subfloat[]{\includegraphics[width=0.49\linewidth]{figs/Case1/potential1_sd}} \hfill     \subfloat[]{\includegraphics[width=0.49\linewidth]{figs/Case1/potential2_sd}} \hfill     \subfloat[]{\includegraphics[width=\linewidth]{figs/Case1/sd_colorbar}}      \caption{}     \label{fig:case1_sd}     \end{figure}          \end{document}      To span a figure in two columns:               \begin{figure*}     \centering     \subfloat[]{\includegraphics[width=0.32\textwidth]{figs/Case1/potential1_feat}} \hfill     \subfloat[]{\includegraphics[width=0.32\textwidth]{figs/Case1/potential2_feat}} \hfill     \subfloat[]{\includegraphics[width=0.32\textwidth]{figs/Case1/sd_colorbar}}      \caption{}     \label{fig:case1_feat}     \end{figure*}      EDIT: The problem seems to be happening with this piece of code:               \begin{figure*}     \subfloat[Vector Field]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_vector_field}} \hfill     \subfloat[Curl-free Component]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_rotational_free}} \hfill     \subfloat[Divergence-free Component]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_divergence_free}} \hfill     \subfloat[Harmonic]{\includegraphics[width=.2\textwidth]{figs/Case1/quiver_harmonic}} \\     % If I comment this line, everything works. Can't I use two rows too?     \subfloat[]{\includegraphics[width=.5\textwidth]{figs/Case1/quiver_colorbar}}      \caption{Mean vector fields. The color bar represents the vectors magnitudes.}     \label{fig:case1_meanvecs}     \end{figure*}      If I commented it, the others figures, including two column figures displayed with the code above, can be seen in the document. However, when I enable the second piece of code, all figures in my .tex disappear. I lose references, everything. I don't know what I'm doing wrong. Thank you in advance.


title: Disable ligatures when using mk4ht to create html

text: How can I easily disable all ligatures, when converting my LaTex-file to html? For the html-generation I am using the command-line               mk4ht htlatex file.tex 'xhtml,charset=utf-8' ' -cunihtf -utf8 -cvalidate' '-d./html/'      My latex document begins with the following lines               \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[none]{hyphenat}     \usepackage{microtype}      As suggested in How can I completely suppress ligatures? I tried the following options for microtype: `\DisableLigatures[f]{encoding = *, family = * }` The html-output though still contains characters **ﬁ**.


title: Using catchfile and envlab packages

text: The following code works well enough: envelopea.tex               \documentclass[12pt]{letter}     \usepackage[businessenvelope,customenvelopes]{envlab}          \SetEnvelope[2.0in]{240mm}{145mm}     \setlength{\EnvelopeTopMargin}{0.75in} % 0.5     \setlength{\EnvelopeLeftMargin}{1.25in} % 2.0          \begin{document}     \startlabels     \mlabel{%     1234 Center Lane \\     Long Mile Village \\     92319%     }%     {%     239 Mill Lake Rd \\     Centreville \\     78392%     }%     \end{document}      I would, however, like to use the catchfile package in order to retrieve the addresses from an external file. An implementation might look something like this. addressa.tex               1234 Center Lane \\%     Long Mile Village \\%     92319%      addressb.tex               239 Mill Lake Rd \\%     Centreville \\%     78392%      letterb.tex               \documentclass[12pt]{letter}     \usepackage[businessenvelope,customenvelopes]{envlab}     \usepackage{catchfile}          \newcommand{\getfromaddress}[1]{\CatchFileDef{\thefromaddress}{#1}{}}     \newcommand{\gettoaddress}[1]{\CatchFileDef{\thetoaddress}{#1}{}}     \providecommand{\expandonce}{\unexpanded\expandafter}          \getfromaddress{addressa.tex}     \gettoaddress{addressb.tex}          \SetEnvelope[2.0in]{240mm}{145mm}     \setlength{\EnvelopeTopMargin}{0.75in} % 0.5     \setlength{\EnvelopeLeftMargin}{1.25in} % 2.0          \begin{document}     \startlabels     \mlabel{%     \expandonce{\thefromaddress}%     }%     {%     \expandonce{\thetoaddress}%     }%     \end{document}      When I compile this code I receive an error message which complains of unbalanced curly brackets. At first glance, things appear to be balanced. I'm not too familiar with the use of `\expandafter` and `\expandonce`. I figure that someone might be able to make this work quite easily. Any comments/suggestions are greatly appreciated. ![Output from the working example](http://i.stack.imgur.com/K2Bc0.png) I have incorporated code presented in this post together with code suggested by egreg in order to yield a .cls file for letters which can be called by specifying the following info:   1. File in which from address resides   2. File in which to address resides   3. Letter opening/salutation   4. Letter closing   5. Letter post script   6. Letter signature   7. Envelope dimensions I have included the code below: theletter.cls               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{theletterb}[]     \LoadClass[]{letter}     \RequirePackage{lipsum}     \RequirePackage{catchfile}     \RequirePackage[businessenvelope,customenvelopes]{envlab}     \RequirePackage{xparse}     \RequirePackage[textwidth=345.0pt,%     top=2in,     headheight=1.0in,     headsep=0.20in]{geometry}     \newcommand{\getfromaddress}[1]{\CatchFileDef{\thefromaddress}{#1}{}}     \newcommand{\gettoaddress}[1]{\CatchFileDef{\thetoaddress}{#1}{}}     \providecommand{\expandonce}{\unexpanded\expandafter}     \ExplSyntaxOn     \NewDocumentCommand{\MLABEL}{ }      {       \johnchris_mlabel:oo { \thefromaddress } { \thetoaddress }      }     \cs_set_eq:NN \johnchris_mlabel:nn \mlabel     \cs_generate_variant:Nn \johnchris_mlabel:nn { oo }     \ExplSyntaxOff     \AtBeginDocument{%     \pagestyle{empty}     \let\ps@firstpage\ps@plain       \begingroup\edef\x{\endgroup         \noexpand\begin{letter}{\expandonce{\thetoaddress}}           {\expandonce{\thefromaddress}}}\x       \opening{\theopening}     }%     \AtEndDocument{%     \closing{\theclosing}     \ps{\thepostscript}     \newpage     \startlabels     \MLABEL     \end{letter}     }      letter.tex               \documentclass{theletter}     \getfromaddress{addressa.tex}     \gettoaddress{addressb.tex}     \newcommand{\theopening}{Dear Recipient}     \newcommand{\theclosing}{Sincerely,}     \newcommand{\thepostscript}{}     \signature{Mae L. Mann}     \SetEnvelope[2.0in]{240mm}{145mm}     \setlength{\EnvelopeTopMargin}{0.75in}     \setlength{\EnvelopeLeftMargin}{1.25in}     \begin{document}     \input{body.tex}     \end{document}      And again, the supporting files are: addressa.tex               1234 Center Lane \\%     Long Mile Village \\%     92319%      addressb.tex               239 Mill Lake Rd \\%     Centreville \\%     78392%      body.tex               lipsum[1]


title: Should the fontenc package be loaded before or after font packages?

text: I seem to recall reading somewhere that `fontenc` should be loaded either before or after the packages loading fonts, but I cannot remember which. I don't see differences between loading it before and after. Was what I read incorrect, or is there a preferred package loading order and why?


title: Latex words within eqnarray are getting emphasized

text: I have a latex equation within an eqnarray as follows,               \begin{eqnarray*}\nonumber     f(\xi) = \min \xi\\     where, \forall n_{j} \in N, \xi = \max (\xi_{1}, \xi_{2}, .., \xi_{j})\\     s.t.\\     \forall n_{j} \in N, \sum_{C_{i} \in C} x_{ij} \leq \eta_{j}\\     \end{eqnarray*}      But the problem is that the word "where" is getting emphasized which I do not want. The word max is not getting emphasized as it is reserved word preceded by a "\". Is there any way I can deemphasize the word "where"? The same is the fate of the letters "s.t." - I also don't want them emphasized inside the eqnarray.


title: How can I introduce a non-technical person to LaTeX?

text: I have been using LaTeX for about a year now. I don't consider myself an expert at LaTeX but I know my around it enough to get things done. One of my colleagues, whose background is entirely non technical, wishes to learn LaTeX so that he can switch from using Open Office. He uses computers for browsing and preparing documents in a word processor. Please advise on how to introduce LaTeX to him (without making it sound like rocket science) and any material that is available online (like a LaTeX simple guide) for this purpose.


title: framed.sty not found after switching from OS X to Linux

text: I transitioned from OS X to Debian Linux. I have freshly installed TeX live, and I want to compile some tex files now which were running before on OS X. For example, there is a file which uses a standard Springer template, but I end up with the following error:               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)      \write18 enabled.     entering extended mode     (/home/....../foobar.tex.swp     LaTeX2e <2011/06/27>     Babel <3.9h> and hyphenation patterns for 2 languages loaded.     (./svmult.cls     Document Class: svmult 2007/06/25 v5.4      Springer Verlag global LaTeX document class for multi authored books     (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))     (/usr/share/texlive/texmf-dist/tex/latex/subfig/subfig.sty     (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)     (/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty     (/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty))))     (/usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty     (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)     (/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))          ! LaTeX Error: File `framed.sty' not found.      (I compile using Gummi). Is there a package which I am missing? I ran `sudo apt-get install texlive- latex-base`, but this was already completely installed. * * * According to this page, Debian 6 has a lot of files in `tex/latex/ltxmisc/`, including the `framed.sty`. However, on my Debian Jessie (upcoming 8), there are only few files in that directory:               $ ls -l /usr/share/texlive/texmf-dist/tex/latex/ltxmisc/     total 68     -rw-r--r-- 1 root root 9956 Jan 13  2006 abstbook.cls     -rw-r--r-- 1 root root 1683 Jan 13  2006 beletter.cls     -rw-r--r-- 1 root root 3348 Jan 13  2006 bibcheck.sty     -rw-r--r-- 1 root root 1125 Jan 13  2006 concrete.sty     -rw-r--r-- 1 root root 6489 Jan 13  2006 flashcard.cls     -rw-r--r-- 1 root root 8608 Jan 13  2006 iagproc.cls     -rw-r--r-- 1 root root  772 Jan 13  2006 linsys.sty     -rw-r--r-- 1 root root 1388 Jan 13  2006 mitpress.sty     -rw-r--r-- 1 root root 6725 Jan 13  2006 thrmappendix.sty     -rw-r--r-- 1 root root 2103 Jan 13  2006 topcapt.sty     -rw-r--r-- 1 root root 2847 Jan 13  2006 vrbexin.sty


title: How can I reference the current (sub)section number?

text: I want to create a macro that dynamically returns the current chapter, section, subsection (etc.) I'm in. I've created a macro called `\getCurrentSectionNumber` that does this, but it lacks the ability to figure out how many levels deep it is and shorten/lengthen the result accordingly. This macro should essentially return the full numbering text of the most recent subsection, section, or chapter where it was invoked. This macro should produce the following text at the given places.   * A: "1"   * B: "1.1"   * C: "1.1.1"   * D: "1.1.2"   * E: "1.2"   * F: "1.2.1"   * G: "1.2.2" Note that at A, it prints "1.??" because there is no section defined at that point. Locations C, D, F, and G all omit the subsection. ## Example:               \documentclass{report}     \usepackage{etoolbox}               \newcommand\getcurrentref[1]{%      \ifnumequal{\value{#1}}{0}       {??}       {\the\value{#1}}%     }      \newcommand{\getCurrentSectionNumber}{\getcurrentref{chapter}.\getcurrentref{section}}               \begin{document}          \chapter{My Example}     A: Current number is \getCurrentSectionNumber          \section{Section One-point-One}         B: Current number is \getCurrentSectionNumber         \subsection{subsection one-point-one-point-one}             C: Current number is \getCurrentSectionNumber         \subsection{subsection one-point-one-point-two}             D: Current number is \getCurrentSectionNumber     \section{Section Two}         E: Current number is \getCurrentSectionNumber         \subsection{subsection one-point-two-point-one}             F: Current number is \getCurrentSectionNumber         \subsection{subsection one-point-two-point-two}             G: Current number is \getCurrentSectionNumber          \end{document}      ## Example's Output: ![output of the example code given above](http://i.stack.imgur.com/QAaMo.png) Any help would be appreciated. Thanks!


title: .DTX won't load corresponding .STY

text: I'm preparing a documented source for a package file and I basically use the skeleton from the ltxdoc manual verbatim. For some reason, when I compile the .dtx to generate the documentation, it just won't load the style file though. No error that it can't find it, either.               % \iffalse meta-comment     %     %     % Copyright (C) 2014 by Richard Zach <rzach@ucalgary.ca>     % ------------------------------------------------------     %     % This work may be distributed and/or modified under the     % conditions of the LaTeX Project Public License, either version 1.3     % of this license or (at your option) any later version.     % The latest version of this license is in     %   http://www.latex-project.org/lppl.txt     % and version 1.3 or later is part of all distributions of LaTeX     % version 2005/12/01 or later.     %     % This work has the LPPL maintenance status `maintained'.     %      % The Current Maintainer of this work is Richard Zach.     %     % This work consists of the files bpextra.dtx, bpextra.ins, bpextra.sty     %     % \fi     %     % \iffalse     %<*driver>     \ProvidesFile{bpextra.sty}     %</driver>     %<package>\NeedsTeXFormat{LaTeX2e}     %<package>\ProvidesPackage{bpextra}     %<package>   [2014/04/26 0.1 Extra commands for bussproofs.sty]     %<*driver>     \documentclass{ltxdoc}          \usepackage{bpextra}     \usepackage{hyperref}          \renewcommand{\fCenter}{\ensuremath{\,{\to}\,}}          \EnableCrossrefs              \CodelineIndex     \RecordChanges     \begin{document}       \DocInput{bpextra.dtx}       \PrintChanges       \PrintIndex     \end{document}     %</driver>     % \fi     %     % \CheckSum{0}     %     % \CharacterTable     %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z     %   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z     %   Digits        \0\1\2\3\4\5\6\7\8\9     %   Exclamation   \!     Double quote  \"     Hash (number) \#     %   Dollar        \$     Percent       \%     Ampersand     \&     %   Acute accent  \'     Left paren    \(     Right paren   \)     %   Asterisk      \*     Plus          \+     Comma         \,     %   Minus         \-     Point         \.     Solidus       \/     %   Colon         \:     Semicolon     \;     Less than     \<     %   Equals        \=     Greater than  \>     Question mark \?     %   Commercial at \@     Left bracket  \[     Backslash     \\     %   Right bracket \]     Circumflex    \^     Underscore    \_     %   Grave accent  \`     Left brace    \{     Vertical bar  \|     %   Right brace   \}     Tilde         \~}     %     %     % \changes{v0.1}{2014/04/26}{Initial version with deduce, linelabel      %    functionality}     %     % \GetFileInfo{bpextra.sty}     %     % \DoNotIndex{\newcommand,\newenvironment}     %     %     % \title{The \textsf{bpextra} package\thanks{This document     %   corresponds to \textsf{bpextra}~\fileversion, dated \filedate.}}     % \author{\href{http://ucalgary.ca/rzach/}{Richard Zach}}     % \date{}     %     % \maketitle     %     % \section{Introduction}     %      The full file is here: https://github.com/OpenLogicProject/bpextra


title: Have gnuplot inherit the domain from pgfplots

text: I'm using `domain=min:max` within `pgfplots`, but unless I provide the same limits to `gnuplot` explicitly, they are ignored and `gnuplot` proceeds with plotting in the range `[-10,10]` (I assume that is the default range). Is there any way I can have `gnuplot` inherit the domain limits? If not, is there a way to pass them to `gnuplot` using`\pgfkeysvalueof{<whatever>}`? # MWE:               \documentclass{article}     \usepackage{tikz,pgfplots}     \pgfplotsset{compat=newest}          \begin{document}     \begin{tikzpicture}       \begin{axis}[         domain=-2:2,]              \addplot3[raw gnuplot,surf,samples=20,]           gnuplot[surf,] {%             splot [-2:2] [-2:2] (1-x)^2 + 100*(y-x^2)^2             % splot (1-x)^2 + 100*(y-x^2)^2 % This defaults in the range [-10,10].           };       \end{axis}     \end{tikzpicture}%     \end{document}


title: Create a link to open a script as a text file (don't run it) from a latex document in linux

text: I would like a command such as this:               \href{../src/wkfl/vlyUpstrOvrlp.sh}{vlyUpstrOvrlp}      but I want the subsequent link to open the file in gedit or the default text editor in linux. Bonus points if it also works in windows.


title: Change font family locally (using package with limited scope)

text: I want to be able to use small caps for chapter headings. According to Using \textsc{} within \section{} CM default font does not support small caps so I need to use:               \usepackage[T1]{fontenc}      in the preamble. However, this changes font for whole document. I do have quite complex set up and global setting causes few issues so I would like to get same effect as by using `\usepackage[T1]{fontenc}` in preamble (that is - to be able to use small caps for chapter headings), but only for chapter headings that defined created by using following macro:                \def \centeredchapter#1{         \chapter*{\centering{\LARGE \textsc{#1}}}         \addcontentsline{toc}{chapter}{#1}         }      Is it possible?


title: \tableofcontents and \listoffigures help

text: I'm trying to format the front matter of a thesis and am running into trouble with both the table of contents and the list of figures. The current table of contents looks like this:   * List of Figures    * List of Tables    * Chapter    * 1\. Introduction    * 2\. etc.  What I want to do is get rid of the "Chapter" heading in the above, so right after List of Tables, it starts with "1. Introduction". Any ideas? Also, for the list of figures. It automatically puts the figure caption when generating the list, but my captions are long. I want to keep them long in the text, but short in the generated list of figures. Is it possible to, say, just include the first sentence of the caption for the list of figures? Thanks for your help.


title: Utilizing oldstyle figures without resorting to \oldstylenums

text: Quite a few of the freely available LaTeX fonts include oldstyle figures (numerals that harmonize with lower case letters) in addition to lining figures. (Generally, you have to load the `textcomp` package to make the additional symbols available.) However, only a few font packages provide an easy switch to oldstyle figures - the ones I know that are freely available are   * `\usepackage[osf]{mathpazo}` (for the Palatino font),   * `\usepackage[osf]{libertine}`, and   * `\usepackage{cfr-lm}` (for the Latin Modern font). For other fonts, one may use the `\oldstylenums` macro to access oldstyle figures, typing (e.g.) `\oldstylenums{123}` in every single instance. This is impractical and tedious.               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage{textcomp}          \usepackage{tgschola}% or, e.g., tgtermes, cmbright, iwona          \begin{document}          \Large          0123456789          \oldstylenums{0123456789}          \end{document}      ![enter image description here](http://i.stack.imgur.com/7VF8p.jpg) I know that XeLaTeX allows for easy access to Open Type Font features (among them oldstyle figures). However, I'm interested in (pdf)LaTeX for the moment. Is it possible to conveniently utilize oldstyle figures for every LaTeX font that includes them?


title: What is the height of the footnote, at shipout ?

text: Suppose I want to draw an horizontal line, at shipout, the position of which is on top of the footnotes if some are in the page, and the bottom of the text otherwise. How can I retrieve the height of the footnote section to do so? For instance, the following puts a line at the end of the page (footnote included) :               \documentclass{article}     \usepackage{atbegshi}     \usepackage{picture}          \makeatletter     \AtBeginShipout{%       \AtBeginShipoutUpperLeftForeground{%         \dimen@i\topmargin\advance\dimen@i\headheight%         \advance\dimen@i\headsep\advance\dimen@i 1in%         \advance\dimen@i\textheight%         \put(0, -\dimen@i){\line(1,0){2\textwidth}}}     }          \newcount\@cp     \def\copypasta#1#2{\@cp=0\loop\ifnum\@cp<#1 #2\advance\@cp by1\repeat}     \begin{document}     \copypasta{400}{white purple }     \footnote{Oh noes}     \copypasta{200}{brown fox }     \end{document}      Thanks!


How to define a math command that displays a variable in a specific font? E.g. usage `\MyMathCommand{P}`.


title: Left-aligning URL with line breaks in bibliography

text: URLs break fine in my bibliography. My problem is that they are justified which creates a gap between "URL:" and the URL itself (see below). Is there a way to left align only the URL? I am using natbib. ![enter image description here](http://i.stack.imgur.com/Ni4dz.jpg) Here is a minimum working example:               \documentclass[11pt, oneside]{report}     \usepackage[hyphens]{url}     \usepackage[round]{natbib}     \begin{document}          \cite{Shaffer2004}          \bibliographystyle{dcu}     \bibliography{references}          \end{document}      This is the references.bib file:               @article{Shaffer2004,     author = {Shaffer, David Williamson and Squire, Kurt R and Gee, James P},     journal = {Phi Delta Kappan},     pages = {104--111},     number = {2},     title = {{Video games and the future of learning}},     url = {http://website.education.wisc.edu/kdsquire/tenure-files/23-pdk-VideoGamesAndFutureOfLearning.pdf},     volume = {87},     year = {2004}     }


title: Omitting only the page number of chapter's heading in ToC

text: How can I remove the page number of the chapter's header in ToC, without removing the page numbers of the preface pages? For example, in my Table of Contents, I have,               Acknowledgments               ii     table of contents            iii     ...     abstract                    viii          Chapter     1 Chapter one                 1       1.1 Section one             1     ...     2 Chapter two                 2      2.1 Section one               2      ... and so on...      How to remove the first page number 1 or 2 that related to the chapters' headers without touching the page numbers of the preface pages? As for the document class, I am using `\documentclass[doublelespace,tocchapterhead]`, together with file `.cls` of what I think was originally called `chicagothesis` or something like that. I have tried to to removed `#2` in:               \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par      But the result was, the page numbers of all headers have been removed. Is there any way to control that? I do not want to use `tocloft` package or `etoolbox` package.


title: Long code that needs to wrap

text: How would I enter this text on an 8.5x11 worksheet with 1.25inch margins all around so wraps around and does not extend onto the margins? Using normalsize text.               SolverAdd CellRef:=Worksheets("Worksheet_Alpha_Gamma_TestResult").Range("$H$43:$H$46")Relation:=5, FormulaText:="binary


title: Can somebody edit this so it works

text: \documentclass{article}               %--------------------------------------------------------------------     %--------------------------------------------------------------------     \newcounter{choice}     \renewcommand\thechoice{\Alph{choice}}     \newcommand\choicelabel{\thechoice.}          %--------------------------------------------------------------------------------     \newenvironment{choices}%       {\list{\choicelabel}%          {\usecounter{choice}\def\makelabel##1{\hss\llap{##1}}%            \settowidth{\leftmargin}{W.\hskip\labelsep\hskip 2.5em}%            \def\choice{%              \item            } % choice            \labelwidth\leftmargin\advance\labelwidth-\labelsep            \topsep=0pt            \partopsep=0pt          }%       }%       {\endlist}     %--------------------------------------------------------------------------------     \def\CorrectChoice{%           \choice           \addanswer{\thequestion}{\thechoice}%         }         \let\correctchoice\CorrectChoice     %    \par % Uncomment this to have choices always start a new line        % \let\par\@empty         % If we're continuing the paragraph containing the question,         % then leave a bit of space before the first choice:         \ifvmode\else\enskip\fi         \ignorespaces       %       {}     \makeatother     \newbox\allanswers     \setbox\allanswers=\hbox{}     \newcommand{\addanswer}[2]{%       \global\setbox\allanswers=\hbox{\unhbox\allanswers \quad #1.~#2}%     }     \newcommand{\showanswers}{%       \vfill       \begin{center}         Answers       \end{center}       \unhbox\allanswers     }                              %--------------------------------------------------------------------     \begin{document}          \begin{enumerate}     \item One of these things is not like the others; one of these things       is not the same.  Which one doesn't belong?       \begin{choices}         \choice George         \choice Paul         \choice John         \correctchoice Ringo         \choice Socrates       \end{choices}     \item What was the color of George Washinton's white horse?       \begin{choices}         \choice Green         \choice Yellow         \choice White       \end{choices}     \item One of these things is not like the others; one of these things       is not the same.  Which one doesn't belong?       \begin{choices}         \choice George         \choice Paul         \choice John         \choice Ringo         \choice Socrates       \end{choices}     \item What was the color of George Washinton's white horse?       \begin{choices}         \choice Green         \choice Yellow         \choice White       \end{choices}     \item One of these things is not like the others; one of these things       is not the same.  Which one doesn't belong?            \begin{choices}         \choice George         \choice Paul         \choice John         \choice Ringo         \choice Socrates       \end{choices}     \item What was the color of George Washinton's white horse?            \begin{choices}         \choice Green         \choice Yellow         \choice White       \end{choices}     \end{enumerate}          \showanswers     \end{document}


title: Setting an "attribute" for Theorem to be accessed later

text: I am writing a math paper with a large number of theorems. I'm looking to have a table summarizing my results, and I'd love it if the table could be generated automatically from my paper. I' looking to be able to do something like this               \begin{thm}      \shortTheorem{$x + y = y + x$}      Let $x,y$ be integers. Then $x+y=y+x$.      \end{thm}      Note that shortTheorem is just the name I made up for whatever tag I put my desired text into. Then, later on, I want to have a table which, for each theorem I define, prints its "shortTheorem" contents. i.e.   * x + y = y + x Are there existing packages to do this? If not, how would I go about writing my own macro to do so? (Note: I couldn't figure out if there was a way to actually render a LaTeX table in my question, feel free to edit if you know how.)


title: Center column headings in tabular: multicolumn not respected

text: I would like to center column headings (and column headings only) in the following table. Why does it work with the first column, but not the second (I thought `\multicolumn` is the correct approach to this problem).               \documentclass{article}          \usepackage[american]{babel}     \usepackage{tabularx}     \usepackage{booktabs}          \begin{document}     \begin{tabular}{rr}       \toprule       \multicolumn{1}{c}{$\alpha$} & \multicolumn{1}{c}{$\alpha=0.99999$} \\       \midrule       10     & 69.681   \\              & 901.741  \\       1000   & 893.630  \\              & 82.806   \\       \bottomrule     \end{tabular}     \end{document}


title: How to add spaces between items in TOC

text: The mini-document               \documentclass[12pt,openany,oneside]{book}     \usepackage{titletoc}     \usepackage{lipsum}     \titlecontents{part}[3pc]{\addvspace{3pc}\filcenter}     {\sffamily\bfseries PART \thecontentslabel\\*[.2pc]\large}     {\sffamily\bfseries\large}{}[\addvspace{.5pc}]               \title{Title}     \date{}     \author{pythonee}          \begin{document}     \maketitle          \frontmatter     \tableofcontents     \chapter{Front One}     \lipsum[1]          \mainmatter     \part{Introduction}     \chapter{history}     \lipsum          \backmatter     \chapter{Back One}     \lipsum[1]          \end{document}       The Toc output look like: ![output](http://i.stack.imgur.com/vQ9QN.png) Now I want to make the space between `\frontmatter` and `\mainmatter` equals to `\frontmatter and`\mainmatter` in Toc. By the way. Why the **PART** doesn't display in TOC. I have customized it with `titletoc`. ![vertical spaces between chapter should be compact](http://i.stack.imgur.com/AiFpW.png)


title: LTR sequences within  RTL text - alternative to cumbersome markup?

text: I am writing a book in Persian that is full of text in Latin scripts scattered all over book. I have to wrap every Latin script with `\lt{}` to guide xetex to align words from left to right. **It's really cumbersome.** If I do not use \lr{} output of `One Two Three` will be `Three Two One` in Persian document and output of `یک دو سه` will be `سه دو یک` in English documents. This is a very basic requirement and I wonder why xetex can not do it without extra markup. Is there any way for not using \lr{}


title: How to draw a monthly gantt chart with quarterly vgrid?

text: I recently updated my pgfgantt package, and can't figure out how to update one of my charts to draw properly under the new package. The chart has a two- tiered title, years over months. It also had a quarterly vertical grid. It's the quarterly vertical grid I'm having issues recreating. My old working code was               \begin{tikzpicture}[x=.5cm, y=1cm]       \begin{ganttchart}%           [today=5.5, vgrid, vgrid lines list={4,7,...,\value{gtt@width}}]{19}         \gantttitle{2012}{12} \gantttitle{2013}{7} \\         \gantttitlelist{1,...,12}{1}\gantttitlelist{1,...,7}{1} \\         \ganttgroup{Prospectus}{1}{7} \\         %% more gantt items omitted       \end{ganttchart}     \end{tikzpicture}      Following the examples in the package documentation I can create a dotted vertical grid for every other month, but not for every third month. every other month:               \begin{tikzpicture}[x=.5cm, y=1cm]       \begin{ganttchart}%       [today=5.5, vgrid={draw=none, dotted}]{19}         \gantttitle{2012}{12} \gantttitle{2013}{7} \\         \gantttitlelist{1,...,12}{1}\gantttitlelist{1,...,7}{1} \\         \ganttgroup{Prospectus}{1}{7} \\       \end{ganttchart}     \end{tikzpicture}      but `vgrid={draw=none, none, dotted}` gives the error > ERROR: Package pgfkeys Error: I do not know the key '/tikz/none' and I am > going to ignore it. Perhaps you misspelled it. and `vgrid={draw=*2{none}, dotted}` gives the error > ERROR: Package xcolor Error: Undefined color `*2{none}'. How can I get two skips followed by a dotted line?


title: Appendices inside a section?

text: How can create appendices "numbered" A, B, C within three different sections of a Lyx article document. In other words, I would like Appendix A to be at the the end of my first section, Appendix B to be at the end of my second Section, etc. I tried to use the Document ------> Start Appendix Here, but then I can't continue with the sections.


title: Setting default font size in \newfontfamily

text: When mixing fonts in XeTeX, some fonts have quite different aspects for the same size. Say, I'm using Linux Libertine as my main font and I want to use Latino Elongated for chapter headings. Latino Elongated is quite smaller than Linux Libertine for the same font size (11pt). Is there a way to specify the default font size when loading a font via `\newfontfamily`, such that all text written using that font is scaled up?


title: Extra space between footnote numbers and content for high count

text: I’m using the following commands to customize footnotes:               \usepackage[bottom,norule,hang]{footmisc}     \setlength{\footnotemargin}{2mm}     \setlength{\footnotesep}{4mm}     \addtolength{\footskip}{2mm}      The results were as I wanted but only until the 10th footnote (see image below). Is there a way to define the the footnote text margin as a function of the horizontal space that the footnote number takes? ![](http://i.stack.imgur.com/nUQ1v.png) The numbers are flushed to the left and have the same margin as the main text. The footnote text margin, however, seems to be the main text margin plus a fixed quantity.


title: Typesetting boardgame positions using ttf font

text: For presenting positions in the game of backgammon, there is a commercially developed, but free for personal use, without modifications, font called `eXtremeGammon`. The ttf font file is available from the eXtreme Gammon site ttf file. I was hoping to use this font for typesetting notes and references using LaTeX. I took the advice from the accepted answer to an earlier TeX Stackexchange post, Installing TTF fonts in LaTeX, on using ttf fonts in LaTeX by using XeTeX rather than LaTeX. I have two problems with this approach: 1) Some characters in the font are not found by XeLaTeX, eg. digraphs and the £ character. The font does work with these characters outside TeX and the characters do appear with a symbol when studying the ttf file using FontForge. The following simple example outputs a pdf file from XeLaTeX, but containins only the symbol for the @-character.               \documentclass{article}     \usepackage{fontspec}     \setromanfont{eXtremeGammon}     \begin{document}     ñ © @ £     \end{document}      The only thing I can understand as related in the log file is these lines:               Missing character: There is no ñ in font eXtreme Gammon/ICU!     Missing character: There is no © in font eXtreme Gammon/ICU!     Missing character: There is no £ in font eXtreme Gammon/ICU!      I tried using the tip from this earlier posting related to inputting characters to XeLaTeX Foreign characters in XeLaTeX, but it did not change anything for me. 2) The goal is to be able to typeset positions with end result as in this picture ![enter image description here](http://i.stack.imgur.com/sDpEX.png) which is an image of how browsers render the font. The font works by individual characters being eg. a black disc on the middle fifth of a downward triangle with white background, a white disc on the lowest fifth of an upward triangle with lined background or eg. a part of the playing frame. In order to have the characters "connect" and not have holes in the resulting position I add `\offinterlineskip`. However, this still leaves very thin horizontal empty lines in the diagram after some lines. Here is a simple example that draws a downward white triangle using the font. The spacing is better but not quite right at all lines, even with `\offinterlineskip`               \documentclass{article}     \usepackage{fontspec}     \setromanfont{eXtremeGammon}     \begin{document}     \offinterlineskip %% Still leaves thin vertical lines of empty space                       %% after some lines. Problem in font itself ?     \noindent      A\\     B\\     C\\     D\\     E     \end{document}      Here is image of the triangle in the pdf output with thin empty lines in two spots: ![enter image description here](http://i.stack.imgur.com/0tTbj.png) A last note is that the eg. the triangles does not look nearly as "sharp" as in a browser when it is rendered using a CSS sheet with `@font-face`, so perhaps this overall strategy on how to typeset these positions in TeX is flawed ? UPDATE: Regarding part 1) I tried running Leo Liu's answer to Generating a table of glyphs with XeLaTeX and it turns out that only for values i in the range from 32 to 160 are there any for which `\iffontchar\font\i` is true despite there being more characters with symbols in the ttf font then the number of trues here. I haven't worked much with LaTeX and fonts but I am starting to think if this could be some sort of encoding problem ? The following post could be relevant Font has glyph but XeLaTeX reports "Missing character". How would I check the following from the last comment in that post: _if this font is to old and doesn't use unicode_ ?


title: DOM to LaTeX resources/toolkits?

text:
I want to convert some webpages to nicely formatted Latex documents. The webpage is a discussion forum, with deeply nested comments. Before I begin to write my own naive implementation, are there any tools/scripts which help with such html->latex structure transformation. For example, suppose a thread hierarchy is a simple `ul` `li` nesting , I need a tool that helps me put it into `itemize` blocks. And if possible, even for more complex `div` and `span` nesting. Here is an example to make it more explicit:

I am a parent comment of the root post. This is my opinion.

 I disagree with the parent and these are my opinions.

 Your opinion is wrong because of such and such facts.

 I am a deeply nested comment

 I agree, I also disagree with parent comment.

 I am another parent comment to the root post

      To convert this to               \begin{itemize}         \item I am a parent comment of the root post. This is my opinion.         \begin{itemize}             \item I disagree with the parent and these are my opinions.             \begin{itemize}                 \item Your opinion is wrong because of such and such facts.                 \begin{itemize}                      \item I am a deeply nested comment.                 \end{itemize}                 \item  I agree, I also disagree with parent comment.                          \end{itemize}         \end{itemize}         \item I am another parent comment to the root post      \end{itemize}      ![enter image description here](http://i.stack.imgur.com/dfCrF.png)


title: KOMA Script exclude header-footer in contents

text: I am using these settings:               \documentclass[12pt,a4paper,english,openany,oneside]{scrbook}     \usepackage{etoolbox}     \usepackage{calc}     \makeatletter     \pretocmd{\@part}{\gdef\parttitle{#1}}{}{}     \pretocmd{\@spart}{\gdef\parttitle{#1}}{}{}     \makeatother     \usepackage[nouppercase,headsepline,footsepline,automark]{scrpage2}     \clearscrheadfoot     \clearscrheadings     \chead{}     \cfoot{}     \ihead{HeaderLeftText}     \ohead{\parttitle}     \ifoot{\rule{0pt}{\ht\strutbox+\dp\strutbox}\leftmark}     \ofoot{\rule{0pt}{\ht\strutbox+\dp\strutbox}\thepage}     \pagestyle{scrheadings}      and               \begin{document}     % title stuff here     \thispagestyle{empty}     \newpage     \tableofcontents     \part{PartText}      The **problem** is that since the settings above are defined before `\begin{document}`, the rendering of table of contents causes error that undefined control sequence in \parttitle and \part, because the headers and footers also appear on the contents page (which I dont want). I think the error is due to the fact that no \part is defined before the TOC and hence there is no text to put in partitle, i.e. the right header. So, how could I get rid of the header-footer in TOC, or what's another solution?


title: TikZ Drawing a changing vector field in a grid

text: So far I succeeded in drawing a simple grid along with it's centres using grid and nodes.               \draw[step=1] (0, 0) grid (4, 3);          \coordinate (a) at (0.4, 0.3);     \coordinate (b) at (3.8, 0.8);          \draw[fill=white,thick,->] (a) -- (b);          \foreach \x in {0.5, 1.5, 2.5, 3.5} {         \foreach \y in {0.5, 1.5, 2.5} {             \node at (\x, \y)[circle, fill=black, scale=0.25] {};         }     }      However the nodes representing the centroids of the cells, I would also like to add a vector field. The vectors in a column should point in the same direction, but along the x axis they should point more in the upward direction as one goes to the right side (like Pi/8, Pi/4, 3*Pi/4, etc). It's clear to me how this would be programmed in a "normal" programming language, but I don't see how this fits into TikZ's foreach loop.. Also I'm wondering weather it's possible to have a curvilinear grid instead of a simple rectangular.


title: Defining a macro for making slides from same source document?

text: It's sloppy, but sometimes I just want to make an existing source document into slides containing exactly the same material, while leaving the original article unaltered. A further ambition would be that edits to the original would also result in changes to the hacked-up slides. I figured some macros would help me here, so I tried something like this:               %\def\NowMakingSlides{1}          \ifdefined\NowMakingSlides     \documentclass[aspectratio=43]{beamer}     \else     \documentclass[oneside, letterpaper,12pt]{amsart}     \fi          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %  Controlling for whether we are hacking up some slides     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \ifdefined\NowMakingSlides       \newcommand{\beginframe}[1]{\begin{frame}\frametitle{#1}}       \newcommand{\Section}[1]{\nextframe{#1}}       \newcommand{\stopframe}{\end{frame}}       \newcommand{\nextframe}[1]{\stopframe\beginframe{#1}}     \else       \newcommand{\Section}{\section}       \newcommand{\beginframe}[1]{}       \newcommand{\stopframe}{{}}       \newcommand{\nextframe}[1]{{}}     \fi          \begin{document}          \beginframe{This Sentence No Verb}     I like writing equations.          \nextframe{The End}     But sometimes I have to stop, even though $e^{i\pi}+1=0$          \stopframe     \end{document}      Note the `\Section` macro which is supposed to start a new slide title with the given text in places where the article starts a new section. (Similar macros left out of this MWE cover `subsection` etc.) That greatly reduces the number of spots in which a `nextframe` even needs to be inserted and keeps slide titles in sync with the article. It works great for creating the normal document when I comment out the first line, but not when I leave the line in place, with a `File ended` message. Deleting the macro calls and substituting what I _think_ they are doing gives me a working document. Further investigation shows that the `stopframe` macro is not working. What's wrong with it?


title: Generating a single TeX file by merging different TeX files

text: I have a main TeX file which inputs many other TeX files i.e. for example               \documentclass{article}     \begin{document}     \input{input1.tex}     \input{input2.tex}     \input{input3.tex}     \end{document}      Let's call the above file say `main.tex` I want a single TeX file which imports contents from `input1.tex`,`input2.tex` and `input3.tex`, so that I have only one single TeX file instead of the above four TeX files.


title: Opaque-to-transparent gradient lost in embedded PDF figure

text: I have a figure created with Inkscape as SVG and exported as PDF. When I view the PDF directly (e.g. in OS X Preview), it shows correctly. When embedding it in a LaTeX document, it has problems with gradients that go from opaque white to transparent. They appear matte white on the final PDF output (after `pdflatex`). I am using the `baposter.cls' by Brian Amberg. The figures appear on colored column boxes. In the attached screenshot the figure is on the left side (showing the gradient), on the right side it is embedded into the poster (showing opaque white instead). ![enter image description here](http://i.stack.imgur.com/Y0cvJ.png) The colours don't seem to matter. I can have a red-to-transparent gradient, the same thing happens (renders matte red in the final PDF). * * * Now this comp.tex.pdf thread suggests it might be a problem of Ghostscript. I remember installing Ghostscript 9, I have these on my machine:               /opt/local/share/ghostscript/9.05     /usr/local/share/ghostscript/8.71      But TeXShop I think uses TeX Live (I'm on version 2010), and its manual says: > Because of the importance of Perl and Ghostscript, TEX Live includes > ‘hidden’ copies of these programs. Should I point TeX Live to the other Ghostscript location? Should I update TeX Live? Thanks


title: Vertically Aligning Multiple Symbols in Each Row

text: In the following MWE, I want the `\implies` symbols to be aligned, and both `\leq` symbols on each row to be aligned (adding space between everything as necessary). How can I add `&` symbols in the `align*` code to make this happen?               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align*}     |p - q| \leq M     & \implies -M \leq p - q \leq M \\     & \implies q - M \leq p \leq q + M     \end{align*}     \end{document}      To be clear, I want the output to look like this (just substitute `\leq` for each `<`):               |p - q| < M ==>  - M  < p - q <  M                 ==> q - M <   p   < q + M


title: \eqref{eq:..} doesn't work as expected

text: If I write something like this `As shown in \eqref{eq:..}` I would expect the following output after compilation: "As shown in (1)". However, I always get this:"As shown in equation (1)". How can I prevent that the word "equation" is added? I used the follwing documentclass:               %%%%%%%%%%%%%%%%%%%%%%%%%%%%Dokumentklasse UVKABook für A5%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{UVKABoA5}          \DeclareOption{twoside}{\PassOptionsToClass{\CurrentOption}{scrbook}}     \DeclareOption{12pt}{\PassOptionsToClass{\CurrentOption}{scrbook}}     \DeclareOption{liststotocnumbered}{\PassOptionsToClass{\CurrentOption}{scrbook}}     \DeclareOption{idxtotoc}{\PassOptionsToClass{\CurrentOption}{scrbook}}     \DeclareOption{bibtotocnumbered}{\PassOptionsToClass{\CurrentOption}{scrbook}}     \DeclareOption{idxtotocnumbered}{         \AtEndOfClass{                 \renewcommand*\idx@heading{                         \if@openright\cleardoublepage\else\clearpage\fi                         \twocolumn[\chapter{\indexname}]                         \@mkboth{\indexname}{\indexname}                 }         }     } \DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}}     \ExecuteOptions{twoside,13pt,liststotocnumbered,idxtotocnumbered,bibtotocnumbered}     \ProcessOptions\relax     \LoadClass{scrbook}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \let\switcht@@therlang\relax     \let\svlanginfo\relax     \def\ds@deutsch{\def\switcht@@therlang{\switcht@deutsch}     \gdef\svlanginfo{\typeout{Deutsche Sprache}\global\let\svlanginfo\relax}}          \AtBeginDocument{\@ifpackageloaded{babel}{     \@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht@deutsch}}     \@ifundefined{extrasngerman}{}{\addto\extrasngerman{\switcht@deutsch}}     }{\switcht@@therlang}     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \RequirePackage[T1]{fontenc}     \RequirePackage[latin1]{inputenc}     \RequirePackage[titles]{tocloft}     \RequirePackage{makeidx}     \RequirePackage{mathptmx}     %\RequirePackage{natbib}     \RequirePackage{cite}                 \RequirePackage{color}     \RequirePackage{scrpage2}     \RequirePackage[inner=3cm,%                                                                 outer=2cm,%                                                                 top=2.7cm,%                                                                 bottom=3.2cm]{geometry}     \clubpenalty = 10000     \widowpenalty = 10000     \displaywidowpenalty = 10000          %\bibliographystyle{abbrv}     %\bibliographystyle{straub}     \bibliographystyle{IEEEtran}                \setheadsepline{.4pt}          \addtokomafont{chapter}{\fontfamily{phv}\fontsize{15}{15}\bfseries}     \addtokomafont{section}{\fontfamily{phv}\normalsize\bfseries}     \addtokomafont{subsection}{\fontfamily{phv}\normalsize\bfseries}     \addtokomafont{subsubsection}{\fontfamily{phv}\normalsize\bfseries}     \addtokomafont{caption}{\small}     \setkomafont{captionlabel}{\small}     \setkomafont{pagehead}{\small}          \color[cmyk]{0,0,0,1}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \deffootnote[1.5em]{2em}{1.5em}{\textsuperscript{\thefootnotemark}}          \renewcommand{\cftchappagefont}{\fontfamily{phv}\bfseries}     \renewcommand{\cftchapfont}{\fontfamily{phv}\bfseries}     \renewcommand{\cftsecpagefont}{\fontfamily{phv}}     \renewcommand{\cftsubsecpagefont}{\fontfamily{phv}}     \renewcommand{\cftsecfont}{\fontfamily{phv}}     \renewcommand{\cftsubsecfont}{\fontfamily{phv}}          \newcommand{\preface}[1][\prefacename]{\chapter*{#1}}     \newcommand{\Preface}[1][\prefacename]{\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}          \newcommand{\ack}[1][\ackname]{\chapter*{#1}}     \newcommand{\Ack}[1][\ackname]{\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}          \newcommand{\abstract}[1][\abstractname]{\chapter*{#1}}     \newcommand{\Abstract}[1][\abstractname]{\chapter*{#1}\addcontentsline{toc}{chapter}{#1}}          \newcommand{\changefont}[3]{\fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}          \def\ackname{Acknowledgment}     \def\abstractname{Abstract}     \renewcommand{\figurename}{Fig.}     \renewcommand{\tablename}{Tab.}     \def\switcht@deutsch{\svlanginfo         \def\ackname{Danksagung}         \def\abstractname{Kurzfassung}         \renewcommand{\figurename}{Abb.}       \renewcommand{\tablename}{Tab.}     }          \renewcommand*{\chapterpagestyle}{empty}     \renewcommand{\baselinestretch}{1.33}      And at the beginning of my document I include the following:               \usepackage{graphicx}                                % Standartpaket zur Grafikeinbindung     \usepackage{amsmath}                                 % Erweiterung des Mathematik-Modus     \usepackage{amssymb}                                                 % Erweiterung des Mathematik-Modus     %\usepackage[ngerman]{babel}                         % Neue, deutsche Rechtschreibung und Silbentrennung.      \usepackage[english]{babel}                          % Englische Rechtschreibung und Silbentrennung.     \usepackage{supertabular}                            % Erweitere Tabellen     \usepackage{units}                                   % Einheiten in Formeln     \usepackage[thinspace,thinqspace,squaren]{SIunits}   % Vordefinierte SI-Einheiten     \usepackage{url}                                     % URLs formatieren     \usepackage{cite}                                    % Formatierung von Zitaten     \usepackage{pdfsync}                                           % PDF-Synchronisierung mit SumatraPDF     \usepackage{makeidx}                                               % Um einen Index zu erzeugen => z.B. mit GMTI\index{GMTI}     \usepackage{booktabs}                                % Für schönere Tabellenlinien     \usepackage{enumitem}                                % Anpassbare Enumerates/Itemizes         \usepackage{multirow}                                                                % Zeilen/Spalten von Tabellen zusammenfassen     %\usepackage{trfsigns}                               % Zeichen für Transformationen          %\usepackage[dvips]{graphicx}     \graphicspath{{graphics/}}     \DeclareGraphicsExtensions{.eps}          \makeatletter     %\def\tagform@#1{\maketag@@@{\ignorespaces [#1]\unskip\@@italiccorr}}   % Anpassung der Formelnummerierung     \makeatother          \makeindex


title: initexmf.exe problem when installing lipsum

text: I was always afraid of using TeX, but now I have to, in order to put formulas graphically perfect in Corel Draw, which has nothing else to do it. And just as I thought, even by following step by step a simple, official tutorial, everything goes wrong at once:   * I want to use the `\lipsum[1-7]` command   * it says "undefined control sequence" when compiling   * I try searching for the lipsum package on my repository, I find it, try to install it   * it starts, and then says "the operation failed for some reason", and then `Data: C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\initexmf.exe`. (that "some reason" is a deliberate cruelty of the programmer, you have to recognize it!) Now, what to I do with that? Just as I thought, TeX is such a jungle that it beats any programming language at the insanity of the debugging! It was just a simple tutorial, found here, "first LaTeX document", with the latest installation of ProText, on Windows 7 64 bit! Simpler you cannot be! Why on earth does it have to be always so complicated! I am sorry to be so angry, but I have very few time left to finish a poster, and just for a few stupid equations I will have to go through the most marathonian debugging immediatly...I don't have time for this right now! And nothing on google, as always! EDIT: and now, in the package manager, I can **neither** install **nor** uninstall the lipsum package. But only in the normal mode, in the admin mode I can! But still with the stupid "initexmf.exe" error. I ANYONE could understand PRECISELY where the problem comes from, I would pray the god of insanity for a year EDIT 2: found this which seemed to be close to my case, I have almost tracked down all traces of the unfortunate "ï" in my username, but the name of the personnal folder is very difficult to change, don't have the time to try right now. If it works I will let you know! Because with all the rest (computer name, account name everywhere etc) it did not change anything (of course!)


title: Taming a TikZ flowchart's structure

text: After finally solving many issues with this flowchart, I get this... ![](http://i.stack.imgur.com/ybuRO.png) I'm new to TikZ and I'm having a hard time fixing this. I wanted the 5 nodes from row 5 to be inside a box with a vertical disposition. I have good vertical space, but I'm restricted to the column you see. Im using beamerposter btw. A not so great MWE               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows,matrix}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \begin{document}     \scriptsize     \begin{tikzpicture}     [auto,       block/.style={rectangle, draw=blue, thick, fill=blue!20,text width=10em, text centered, rounded corners,minimum height=4em},       ratos/.style={rectangle, draw=blue, thick, fill=blue!20,text width=20em, text centered, rounded corners,minimum height=4em},       line/.style={draw, thick, -latex,shorten >=2pt}]          \matrix [column sep=3mm,row sep=12mm, ampersand replacement=\tikzand]       {       % row 1        \tikzand \node [ratos] (ratos){\textbf{Ratos}\\            \begin{itemize}             \item Filogeneticamente próximos do Homem             \item Desenvolve a patologia rapidamente             \item Manipulação fácil e baixo custo           \end{itemize}}; \tikzand \\       % row 2         \node [block] (femea) {\textbf{Fêmea}\\            \begin{itemize}             \item Patologia do ovário           \end{itemize}};         \tikzand \node [block] (hibridos) {\textbf{Híbridos}\\            \begin{itemize}             \item Geneticamente iguais           \end{itemize}         };         \tikzand \node [block] (suprimidos) {\textbf{Imunossuprimidos}\\           \begin{itemize}             \item Ratos \textit{nude}, sem timo -- sem rejeição de transplante e interferência imunitária           \end{itemize}         }; \\       % row 3          \tikzand \node [ratos] (metodo1){Inoculação intrabursal ortotópica de células da linhagem humana do carcinoma de células claras, não metastizantes, preferencialmente no infundíbulo}; \\       % row 4         \tikzand \node [block] (grupos){5 grupos de 6 ratos\\ }; \\       % row 5         \node [block] (grupo1){\textbf{Grupo 1}\\ Sem tratamento}; \tikzand         \node [block] (grupo2){\textbf{Grupo 2}\\ Vorinostat \textit{pd} -- 50 mg/kg/dia};          \node [block] (grupo3){\textbf{Grupo 3}\\ Células tratadas com vorinostat \textit{in vitro} antes da inoculação}; \tikzand         \node [block] (grupo4){\textbf{Grupo 4}\\ Tratamento com fármaco de 1ª linha (paclixatel ou agentes de platina)}; \tikzand         \node [block] (grupo5){\textbf{Grupo 5}\\ Tratamento com fármaco de 1ª linha e vorinostat}; \\            % row 6         \node [block] (duração){\textbf{11 semanas de duração}           \begin{itemize}             \item 6 semanas para desenvolvimento tumoral             \item 5 semanas para se confirmar efeito terapêutico           \end{itemize}          }; \\       % row 7          \node [block] (eutanasia){Eutanásia de 2 ratos de cada grupo à 9ª, 10ª e 11ª semanas.          };\\       %row 8           \node [block] (analise){Análise macroscópica.         }; \tikzand          \node [block] (citologia){Citologia com coloração PAS.          };\\         };           \begin{scope}[every path/.style=line]       \path(ratos)-- (femea);       \path(ratos)-- (hibridos);       \path(ratos)-- (suprimidos);       \path(femea)-- (metodo1);       \path(hibridos)-- (metodo1);       \path(suprimidos)-- (metodo1);       \path(metodo1)-- (grupos);       \path(grupos)-- (grupo1);       \path(grupos)-- (grupo2);       \path(grupos)-- (grupo3);       \path(grupos)-- (grupo4);       \path(grupos)-- (grupo5);       \path(grupo1)-- (duração);       \path(grupo2)-- (duração);       \path(grupo3)-- (duração);       \path(grupo4)-- (duração);       \path(grupo5)-- (duração);       \path(duração)-- (eutanasia);       \path(eutanasia)-- (analise);       \path(eutanasia)-- (citologia);     \end{scope}     \end{tikzpicture}     \end{document}      Could someone give me a hand in taming this? This is a poster I'm doing for a conference for students of my uni. Thanks for your time!


title: Suggestions for tweaking wide root index

text: I don't like how the wide `mn` index of the roots is being displayed and am looking to see how others have handled this problem. I am using the closed square root from the references listed below which allows me to tweak the locations slightly and hence am able to get the `m` and `n` aligned on the left hand side, and tried moving the indices on the right, but am not pleased with the result: ![enter image description here](http://i.stack.imgur.com/HgetW.png) ## References:   * Using \leftroot{}, \uproot{} with closed square root symbol   * "Closed" (square) root symbol ## Code:               \documentclass{article}     \usepackage{amsmath}     \usepackage{xparse}     \usepackage{letltxmacro}          \LetLtxMacro{\oldsqrt}{\sqrt}          \def\DHLhksqrt#1#2{%       \setbox0=\hbox{$#1\oldsqrt{#2\,}$}\dimen0=\ht0\relax%       \advance\dimen0-0.25\ht0\relax%       \setbox2=\hbox{\kern-0.375pt\vrule height\ht0 depth -\dimen0}%       {%         \hbox{$#1\expandafter\oldsqrt\expandafter[\DHLindex]{#2\,}$}%         \lower\ifx\math@version\bold@name0.60pt\else0.4pt\fi\box2%       }%     }     \newcommand{\ClosedSqrt}[1][]{\def\DHLindex{#1}\mathpalette\DHLhksqrt}%          \RenewDocumentCommand{\sqrt}{O{\hphantom{3}} O{0} O{0}  m}{\ClosedSqrt[\leftroot{#2}\uproot{#3}#1]{#4}}%          \begin{document}     \begin{alignat*}{3}         \oldsqrt[m]{\oldsqrt[n]{x}} &= \oldsqrt[mn]{x} &\quad\text{original sqrt}\\         \sqrt[m][-3]{\sqrt[n][-1][2]{x}} &= \sqrt[mn]{x} = \sqrt[mn][-3][2]{x} &\quad\text{closed sqrt}     \end{alignat*}     \end{document}


title: Question about limits in lim command and scale in mathtools package

text: This is a follow up question regarding the limits in `\lim` command and `mathtools` package. To begin with how can I make the limits to start at the beggining of the lim symbol and not ahead of it? Meaning the lim symbol and the limits not to be centered. ![enter image description here](http://i.stack.imgur.com/Whso7.jpg) Also in the mathtool package if I use the scale option then the limits are scaled but as it seems to me around a point and so as the scale becomes smaller the larger the vertical gap between the limits and the lim symbol becomes. How can I fix that so that the vertical space will remail the same as the original in the lim command? And why is that happening? ![enter image description here](http://i.stack.imgur.com/g0NUe.jpg) This is a the code I used to try some cases, which belongs to Peter Grill who posted it to answer a previous question of mine.               \documentclass[12pt]{article}     \usepackage{mathtools}     \usepackage{graphicx}     \usepackage{calc}          % http://tex.stackexchange.com/questions/60453/reducing-font-size-in-equation/     \newcommand*{\Scale}[2][4]{\scalebox{#1}{$#2$}}%     \newcommand*{\Resize}[2]{\resizebox{#1}{!}{$#2$}}%          \begin{document}     \noindent     Without \verb|\mathclap|:     \[  \lim_{n\to +\infty}x(n) \]     But with \verb|\mathclap|::     \[ \lim_{\mathclap{n \to +\infty}}x(n) \]     Using \verb|\scriptstyle| to resize:     \[ \lim_{\scriptscriptstyle n \to +\infty} x(n) \]     Using \verb|\Scale|     \[ \lim_{\Scale[0.5]{n \to +\infty}} x(n) \]     Using \verb|\Resize|     \[ \lim_{\Resize{\widthof{$\lim{}$}}{n \to +\infty}} x(n) \]     \end{document}


title: Make listofalgorithms (algorithm2e) inside a section instead of chapter

text: I'm writing my thesis and I have a few algorithms (using algorithm2e) that I want to list in my appendix, but I don't want to start a new page. Also my listoffigures currently creates a section, not a chapter, same for my bibliography. Therefore I want to do the same for listofalgorithms, but I can't change it correctly. This is how the figure list is changed:               \renewcommand{\listoffigures}{%       \@cfttocstart       \par       \begingroup         \parindent\z@ \parskip\cftparskip         \section{\listfigurename}         \@starttoc{lof}%       \endgroup       \@cfttocfinish%     }%      I have tried not changing it from chapter to section, but change the layout of the chapter to section, but I can't get it perfectly, because I can't change the skip distance after the heading. This is what almost looks right:               \renewcommand\listalgorithmcfname{\thesection\hspace{3mm}List of Algorithms}     \begingroup         \let\cleardoublepage\relax  % book         \let\clearpage\relax        % report         \titleformat{\chapter} [hang] {\Large\bfseries\sffamily} {\thesection} {1em} {}         \listofalgorithms     \endgroup      I tried suggestions of similar threads, but they use other algorithm packages, so I think the algorithm2e handles things in some different manner. Any help is appreciated. Edit: @Werner: I can't tell you why, but it's not working. Maybe it isn't in fact using a chapter, I'm not sure. It starts on a new page and the indent is the same as chapter headers. This is a MWE:               \documentclass{report}     \usepackage{algorithm2e}     \begin{document}     \begin{algorithm}         \caption{Algorithm}     \end{algorithm}          \listofalgorithms     \end{document}


title: Why doesn't this code combining \foreach with \newtheorem work?

text: Here is an example document.               \documentclass[a4paper]{amsart}          \usepackage{tikz}          \theoremstyle{definition}     \newtheorem{baseTheorem}{Base Theorem}[section]     \foreach \x in                                         % 1         {conjecture, definition, example}                  % 2         {\newtheorem{\x}[baseTheorem]{\MakeUppercase{\x}}} % 3          \begin{document}          \section{Even numbers}          \begin{definition}         A number is called \emph{even} if its remainder on division by $2$ is zero.     \end{definition}          \begin{example}         $2$ and $0$ are both even numbers.     \end{example}          \begin{conjecture}         The sum of two even numbers is again an even number.     \end{conjecture}          \end{document}      This document does not compile. It produces the following error:               ! Undefined control sequence.     <argument> \x           l.16    A               number is called \emph{even} if its remainder on division by $2$ i...      However, if the lines numbered 1, 2 and 3 are replaced with the following lines...               \newtheorem{conjecture}[baseTheorem]{\MakeUppercase{conjecture}}     \newtheorem{definition}[baseTheorem]{\MakeUppercase{definition}}     \newtheorem{example}[baseTheorem]{\MakeUppercase{example}}      ... then the document does compile, and looks as I expect. (What I really want is to capitalise the first letter of "Conjecture" etc., not the entire word, but this is a separate problem.) Additionally, if `\x` is changed to `\t` in the original versions of lines 1 and 3, a different error message is obtained:               ! Argument of \UseTextAccent has an extra }.     <inserted text>                      \par      l.16     A                number is called \emph{even} if its remainder on division by $2$ ...      I reasoned that the issue might be that the third argument of `\newtheorem` was being recorded verbatim and only evaluated when it comes time to typeset an individual theorem environment. I tried the following:               \foreach \x in         {conjecture, definition, example}         {\def\uppercased\MakeUppercase{\x} \newtheorem{\x}[baseTheorem]{\uppercased}}      But it did not get around the problem:               ! Undefined control sequence.     <argument> \uppercased           l.16     A                number is called \emph{even} if its remainder on division by $2$ ...      What can I do?


title: \vspace behaving elastic in scrbook

text: In the following minimal example, I want to have three paragraphs. Paragraphs should be ...   * Spaced 1 cm apart each other OR   * Pushed to the next page, if the don't fit entirely on the present page I implemented this using minipages. The following code works beautifully for `scrreport`, but in `scrbook` the second box will be pushed towards the bottom of the page.               \documentclass[DIV12]{scrreprt} % try 'scrbook' here          \usepackage{lipsum}          \setlength{\parindent}{0mm}          \newcommand{\foo}{       \vspace{1cm}       \begin{minipage}{\linewidth}         \textbf{A box}         \lipsum[1-2]       \end{minipage}     }          \begin{document}          \foo          \foo          \foo          \end{document}      _Questions:_   * Why does that happen?   * Can it be overcome in `scrbook` or do you have a better suggestion than minipages for my purpose?


title: Different upper margin for the second page of table of contents

text: I am writing a thesis, and I need to change the upper margin for the second page for the table of contents only. The university demands 2in upper margin for first page of ToC, followed by 1.25in upper margin for next page. I need help. MWE is here:               \documentclass[12pt,letter]{report}     \usepackage{univ}     \usepackage{u-local}     \usepackage{local}          \usepackage{cite}     \usepackage{appendix}     \usepackage{float}     \floatstyle{boxed}     \usepackage{srcltx}          \begin{document}      \pagenumbering{gobble}          % \setlength{\headheight}{-0.01 in}     \begin{spacing}{1.45}      \tableofcontents     \end{spacing}     \clearpage          \pagestyle{fancy}      \lhead{}      \chead{}      \rhead{\thepage}      \lfoot{}      \cfoot{}      \rfoot{}      \renewcommand{\headrulewidth}{0.00in}      \renewcommand{\footrulewidth}{0.00in}          \titleformat{\chapter}[display]{\normalfont\normalsize\filcenter\bfseries}{\centering\chaptertitlename\ \thechapter}{0pt}{\normalsize\uppercase}          \input{chapters}     \clearpage     \appendixtitleon     \appendixtitletocon     \begin{appendix}         \input{appendices}     \end{appendix}          \begin{bibliography}     \bibliographystyle{IEEEtran}     \bibliography{bib}     \end{utdbibliography}          \pagestyle{empty}         \begin{vita}             \input{vita}         \end{vita}     \end{document}      In this, `chapters`, `appendices`, `bibliography` and `vita` are different files and the text is in those files. Also, `univ`, `local` and `u-local` are different .sty files for setting space and formats for different pages. For ToC page, the setting is as follows:               \usepackage[titles]{tocloft}          \setcounter{tocdepth}{3}          \renewcommand{\contentsname}{TABLE OF CONTENTS}     \renewcommand{\cftchapfont}{\normalsize}     \renewcommand{\cftchappagefont}{\normalsize}     \renewcommand{\cftchapdotsep}{\@dotsep}     \renewcommand{\cftchapleader}{\normalsize\cftdotfill{\cftchapdotsep}}


title: Recursion - splitting a group.

text: I've been trying to understand the notion of recursion in TeX - not easy given that my background is the high-level stuff in LaTeX. The only examples I can (just about) understand are very basic for-loop constructions, but I don't really feel like I have a picture for what expansion is or how it works. I'd like to write a function that will take as its argument a group               {{#1}{#2}...{#n}}      where n can take any positive-integer value, and return the pair of groups               {#1}{{#2}...{#n}},      when n is at least 2, and `{#1}` otherwise. This seems like it should be reasonably simple to do, but I don't know how I'd go about it. **edit:** I want to use this function in beamer to progressively overlay lines inside AMSMath environments such that   * Vertical spacing is preserved;   * Equation numbering (where applicable) appears in-time with the displayed lines of the equation array, and is preserved (i.e. not incremented) between overlays.


title: Is the parsing of --translate-file in the first line disabled by default?

text: I couldn't find any information in either MikTeX nor TeXlive docs. AFAIR, the parsing of the first line (with --translate-file etc.) is disabled by default in modern TeX distros; am I right?


title: Tabs and columns in LaTeX

text: I'm looking for a way to do something like this in LaTeX:               2006-now       good years                    had a lot of fun          2002-2005      not good years                    I just wish I knew how to do this      How do I achieve this? EDIT: My cobbled attempt is this:               2006-now \ \ \ \ \ \= good years               \> had a lot of fun          2002-2005 \> not good years               \> I just wish I knew how to do this      But this doesn't seem very professional.


title: My polygon graph ends up "wonky" and I don't know why

text: For a document I am working on, I wanted to be able to draw polygon graphs. The graphs are to be labelled with the integers from `0` to `n - 1`, for some n. I wanted to write a macro that could be called inside a tikzpicture to draw such a graph, when supplied with the number of edges (n) and the "radius" of the graph (distance of each vertex from the centre). It turned out to be quite a frustrating experience because trying to use mathematical expressions involving macro arguments in TikZ's `\foreach` is not straightforward and results in many baffling error messages, but eventually I realised I just need to use `\pgfmathparse` to avoid the hassle. Yet I now have a perfectly good graph, _except_ that the edges are "wonky" - each edge seems to connect from one node to a point slightly off the next node. Why is this happening? Here is a screengrab of what I am getting: ![](http://junk.orderofthehammer.com/wonky-graph.png) Here is a minimal working example.               \documentclass[a4paper]{amsart}          \usepackage{tikz}          \tikzset{graph/.style = {every node/.style = { draw,                                                    shape = circle,                                                    fill = black,                                                    minimum size = 0.8mm,                                                    inner sep = 0mm,                                                    label distance = 0.8mm                                                    }}}          \newcommand{\circumferencenode}[3]{\node (#1) at (#3: #2) [label = #3: $#1$] {};}     \newcommand{\polygon}[2]{         \pgfmathparse{subtract(#1, 1)}         \foreach \x in {0, ..., \pgfmathresult} {             \pgfmathparse{90 - 360 * \x / #1}             \circumferencenode{\x}{#2}{\pgfmathresult}         }         \pgfmathparse{subtract(#1, 1)}         \foreach \x in {0, ..., \pgfmathresult} {             \pgfmathparse{mod(\x + 1, #1)}             \draw (\x) -- (\pgfmathresult);         }     }          \begin{document}         \begin{tikzpicture}[graph]             \polygon{6}{10mm}         \end{tikzpicture}     \end{document}


title: How to write custom footer for some pages

text: I am using `fancyhdr` to hide header and footer in some pages but I also want to write custom footers for certain pages. Is there an easy way to do it? Or is there any way to put define text in the center of footer? I am using XeTeX.


title: Events overlap on chronology with chronosys

text: I'm trying to use the `chronosys` package and unfortunately the events are overlaping each other. Here is a minimal example :               \documentclass[article]     \usepackage{chronosys}     \begin{document}     \startchronology       \chronoevent{1500}{Texte A}       \chronoevent{1525}{Texte B}     \stopchronology     \end{document}      And here is the result : ![Overlaping events](http://i.stack.imgur.com/9MYsy.png) Can anyone help me on this?


title: Error: LaTeX Error: Command \iint already defined

text: I'm trying to just type an integral into Lyx and I'm getting the following error:               LaTeX Error: Command \iint already defined.      All I'm doing:               \iint      Thanks!


title: Getting the number of a chapter-numbered theorem but without the chapter number

text: Suppose in Chapter **3** I have Theorem **3**.17. I need to get the "17", NOT the "3.17" which would readily be obtained using `\label` then `\ref`. How do i do that? **Edit:** (Probably a more relaxing condition): I need that number "17" mostly inside or near (just below) the current theorem environment.


title: Dimension too large for tkzMarkAngle

text: I am a tikz beginning. Here is a figure I am working on. I cannot avoid the "Dimension too large" error.               \documentclass{standalone}     \usepackage{tikz}     \usepackage{tkz-euclide}     \usetkzobj{all}     \begin{document}       \begin{tikzpicture}[x=2cm,y=2cm,scale=0.75]         \coordinate [label=below:$O$](O) at (0,0);          \coordinate [label=below:$A$](A) at (0,-1);          \coordinate [label=below:$D$](D) at (-1.1,-1);          \coordinate [label=below:$E$] (E) at (1,-1);          \coordinate [label=0:$B$](B) at (15:1);          \coordinate [label=180:$C$](C) at (140:1);         \draw (0,0) circle (1);     \draw (C) -- (O) -- (B);         \draw (C) -- (A) -- (B);         \draw (D) -- (E);         \tkzMarkAngle[label=$124^{\circ}$,dist=0.35,arc=l,size=0.2,color=black,fill=none](B,O,C)         \tkzMarkAngle[arc=l,size=0.3,color=black](A,C,O)       \end{tikzpicture}     \end{document}      I find it works if I change "scale=0.75" to "scale=1". But I want to keep the figure small.


title: 'Undefined control sequence \byear'

text: I'm trying to build this bibliography according to the specifications of the Institute of Mathematical Statistics. As such, I've been using the `thebibliography` environment. My code looks like this:               \begin{thebibliography}{4}     % BibTex style file: imsart-number.bst, 2013-01-28     % Default style options (sort=1,type=number).     % Used options (sort=1,type=number).          \bibitem{finger1961}     \begin{barticle}[author]     \bauthor{\bsnm{Finger},~\bfnm{Harold~B.}\binits{H.~B.}}     (\byear{1961}).     \btitle{Nuclear rockets and the space challenge}.     \bjournal{Astronautics}     \bvolume{6}     \bpages{24}.     \end{barticle}     \endbibitem          \bibitem{moss2001moving}     \begin{bbook}[author]     \bauthor{\bsnm{Moss},~\bfnm{George}\binits{G.}} \AND       \bauthor{\bsnm{Thomas},~\bfnm{Evan~A}\binits{E.~A.}}     (\byear{2001}).     \btitle{Moving on: The American people since 1945}.     \bpublisher{Prentice Hall}.     \end{bbook}     \endbibitem          \bibitem{nasalaw}     \begin{barticle}[author]     \bauthor{\bsnm{Rayburn},~\bfnm{Sam}\binits{S.}} \AND       \bauthor{\bsnm{Nixon},~\bfnm{Richard}\binits{R.}}     (\byear{1958}).     \btitle{National Aeronautics and Space Act}.     \bjournal{U.S. Code}     \bvolume{85-567}     \bpages{426..438}.     \end{barticle}     \endbibitem          \bibitem{history2013}     \begin{b}[author]     (\byear{2013}).     \btitle{Space Race: Cold War Front}.     \end{b}     \endbibitem     \end{thebibliography}      The trouble is, I keep getting this error: > >         (/usr/local/texlive/2013/texmf-dist/tex/generic/oberdiek/se-ascii- > print.def) >         ./Space_race_bibliography.tex:112: Undefined control sequence. >         l.112 (\byear >                  {2013}). >         ? >   Is there some package I forgot to require? All I have in the preamble is `\usepackage{imsart}`. EDIT: Here is a MWE:               \documentclass{imsart}          \usepackage{amsthm,amsmath}     \usepackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}          % provide arXiv number if available:     %\arxiv{arXiv:0000.0000}          % put your definitions there:     \startlocaldefs     \endlocaldefs          \begin{document}          \begin{frontmatter}          % "Title of the Paper"     \title{Space Race Jackdaw Bibliography}     \runtitle{Space Race Jackdaw Bibliography}          % indicate corresponding author with \corref{}     % \author{\fnms{John} \snm{Smith}\thanksref{t2}\corref{}\ead[label=e1]{smith@foo.com}\ead[label=e2,url]{www.foo.com}}     % \thankstext{t2}{Thanks to somebody}      % \address{line 1\\ line 2\\ \printead{e1}\\ \printead{e2}}          \begin{aug}     \author{\fnms{Benji} \snm{Miller}\ead[label=e1]{benjim15@wildwood.org}}     \and     \author{\fnms{Noah} \snm{Goldman}\ead[label=e2]{noahg15@wildwood.org}}     \address{Wildwood School\\     11811 Olympic Blvd.\\     Los Angeles, CA 90064 \\     \printead{e1,e2}}     \end{aug}     %\begin{abstract}     %\end{abstract}          %\begin{keyword}[class=MSC]     %\kwd[Primary ]{}     %\kwd{}     %\kwd[; secondary ]{}     %\end{keyword}          %\begin{keyword}     %\kwd{}     %\kwd{}     %\end{keyword}          % history:     % \received{\smonth{1} \syear{0000}}          %\tableofcontents          \end{frontmatter}          \nocite{*}          \bibliographystyle{imsart-number}     \begin{thebibliography}{4}     % BibTex style file: imsart-number.bst, 2013-01-28     % Default style options (sort=1,type=number).     % Used options (sort=1,type=number).          \bibitem{finger1961}     \begin{barticle}[author]     \bauthor{\bsnm{Finger},~\bfnm{Harold~B.}\binits{H.~B.}}     (\byear{1961}).     \btitle{Nuclear rockets and the space challenge}.     \bjournal{Astronautics}     \bvolume{6}     \bpages{24}.     \bptok{imsref}     \end{barticle}     \endbibitem          \bibitem{moss2001moving}     \begin{bbook}[author]     \bauthor{\bsnm{Moss},~\bfnm{George}\binits{G.}} \AND       \bauthor{\bsnm{Thomas},~\bfnm{Evan~A}\binits{E.~A.}}     (\byear{2001}).     \btitle{Moving on: The American people since 1945}.     \bpublisher{Prentice Hall}.     \bptok{imsref}     \end{bbook}     \endbibitem          \bibitem{nasalaw}     \begin{barticle}[author]     \bauthor{\bsnm{Rayburn},~\bfnm{Sam}\binits{S.}} \AND       \bauthor{\bsnm{Nixon},~\bfnm{Richard}\binits{R.}}     (\byear{1958}).     \btitle{National Aeronautics and Space Act}.     \bjournal{U.S. Code}     \bvolume{85-567}     \bpages{426..438}.     \bptok{imsref}     \end{barticle}     \endbibitem          \bibitem{history2013}     \begin{b}[author]     (\byear{2013}).     \btitle{Space Race: Cold War Front}.     \bptok{imsref}     \end{b}     \endbibitem          \end{thebibliography}               \end{document}


title: Tableofcontents in Serbian Cyrillic

text: How can I write table of contents in Serbian Cyrillic? I can write text in Cyrillic, but I can't write table of contents.


title: Is there a default arara rule for ConTeXt?

text: I'm trying to make a simple Hello, World example for ConTeXt. The file itself works, but I can't manage to instruct `arara` to compile it with `texexec`.               % arara: context     \starttext     Hello, World!     \stoptext      Neither of the rules `context` or `texexec` exist in the search path, but I can't imagine there is _no_ rule for ConTeXt. (The absence of one though will make for a nice `arara`-'Hello World'.)


title: Patching \chapter command such that all lower sections are set in twocolumn in ToC

text: I've been trying to typeset my ToC like the one in the question How to make the ToCs part entry in onecolumn while the others are in two columns however, I don't have parts and therefore I want the chapters to be one-column while the `{sub}*sections` are in twocolumn mode. My approach:               \documentclass{scrbook}          \usepackage{tocloft}     \usepackage{etoolbox}     \usepackage{multicol}          \pretocmd{\chapter}{\protect{\ifnum\value{chapter}>0 \addtocontents{toc}{\protect\end{multicols}}\fi}}{}{}     \apptocmd{\chapter}{\protect{\addtocontents{toc}{\protect\begin{multicols}{2}}}}{}{}          \AtEndDocument{\ifnum\value{chapter}>0 \addtocontents{toc}{\protect\end{multicols}}\fi}          \begin{document}          \tableofcontents          \chapter{FOO}     \section{bar1}     \section{bar2}     \section{bar3}     \section{bar4}          \chapter{BAR}     \section{foo1}     \section{foo2}     \section{foo3}     \section{foo4}     \end{document}      However, this is not working properly: The Chapter name disappears.   * Is the approach fundamentally flawed or am I using `\pretocmd` and `\apptocmd` wrong?   * Which approach would **you** use to solve this problem?


title: Double superscript/subscript issue with macros

text: I would like to be able to define a macro like `\newcommand{\Zs}{Z^*}` and then somewhere within the text say `$\Zs^T$` and have the effect of writing `$Z^{* T}$`. It should also be possible to write `$\Zs$` without the subscript. Is there a simple solution to make this possible? Preferably, the solution should allow one to do this for many symbols with relative ease. I guess one way is to define a macro with an argument like `\newcommand{\Zss}[1]{Z^{* #1}}` and the use either `$\Zss{}$` or `$\Zss{T}$`, but this does not seem very elegant. Can we define a blueprint command, called `starred` so that whenever we want a starred symbol, we can write `\newcommand\Xs{\starred{X}}`?


title: Underline in metauml

text: \documentclass{article}     \usepackage[shellescape]{gmp}     \begin{document}     \begin{figure}     \begin{mpost}[use]     input metauml;          Class.A("A")            ("-instance: A")            ("-A()",             "+instance(): A");          drawObjects(A);     \end{mpost}     \caption{Class \texttt{A} as a singleton}     \label{fig:uml-a}     \end{figure}     \end{document}      How can I make `+instance(): A` underlined to mark it as a static method? Is it possible to disable converting `+` and `-` to graphics ? Egreg's solution below works but is there any way to draw "true" underline? For example if I add something below underlined part I would have to move line maually. I want to avoid this.


title: Put a node behind another in a TikZ diagram

text: I want to place a node, that is kind of a note, behind another node. However, I need to put the reference node before the note, so I can place the note in a relative position to the reference node. So, the reference node is draw behind the note. But I want the reverse. For example, in this figure the note is over the node. However, I want it below of the decision node.   * So, how can I place the note behind the reference. Or is there a way to put notes to the nodes natively in TikZ?   * The other thing is, why the text in the note is not centered? ![diagram](http://i.stack.imgur.com/nRaC1.png)               \documentclass{standalone}          \usepackage{tikz}     \usetikzlibrary{shapes,arrows,shadows,positioning}          \begin{document}     \tikzstyle{decision} = [diamond, draw, fill=blue!5, text width=6em, text badly centered, node distance=2.5cm, inner sep=0pt]     \tikzstyle{block} = [rectangle, draw, fill=blue!5,         text width=7em, text centered, rounded corners, minimum height=4em]     \tikzstyle{note} = [rectangle, dashed, draw, fill=white, font=\footnotesize,         text width=5em, text centered, rounded corners, minimum height=4em]     \tikzstyle{line} = [draw, very thick, color=black!50, -latex']     \begin{tikzpicture}[scale=2, node distance = 2cm, auto]       \node [block] (blk) {A block here};       \node [decision, below of=blk] (if) {Is something?};       \node [note,below right=-5mm of if, anchor=north west] (note1) {using a note here};       \path [line] (blk) -- (if);     \end{tikzpicture}     \end{document}