title: Optional argument not getting set to \makebox through expl3 key assignment

text: The basic idea that I wanted was to create a key to pass a value that would inform `\makebox` how the contents of the box should be aligned. Big fail here. The intended contents of the `\makebox` are not passed as arguments to `\makebox` and I seem to have random components of my keys ignored or inserted into the text. What's happening here?               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn          \tl_new:N  \l_aefl_position_tl     \tl_set:Nn \l_aefl_position_tl { [l] }          \keys_define:nn { aefl }         {             pos   .code:n   = {                                 \str_case:nnn { #1 }                                 {                                     { left   } { \tl_set:Nn \l_aefl_position_tl {[l]} }                                     { center } { \tl_set:Nn \l_aefl_position_tl {}    }                                 }                                 {                                     { right } { \tl_set:Nn \l_aefl_position_tl {[r]} }                                 }                               },         }          \NewDocumentCommand{\aecurrfile}{ o }         {             \group_begin:             \IfNoValueF{#1}{\keys_set:nn { aefl }{#1}}                  \makebox[0pt] \l_aefl_position_tl                           { contents ~ of ~ my ~ box }             \group_end:         }          \ExplSyntaxOff     \pagestyle{empty}     \begin{document}          \begin{tabular}{lcl}     unexpected & \verb=[l]=      & \aecurrfile                        \\     unexpected & \verb=[l]=      & Front \aecurrfile[pos=left] Back   \\                &                 & Front \aecurrfile[pos=center] Back \\     unexpected & \verb=right[l]= & Front \aecurrfile[pos=right] Back     \end{tabular}          \end{document}      _EDIT_ Finally, I see why I'm getting the _unexpected_ right in my output. Argh!


title: Do I need LaTeX?

text: I read that LaTeX is all about "typesetting". What does that mean? What is typesetting? I read some FAQs, they showed the code, not the output. Following are my needs and I am not sure whether LaTeX is what I need, or I am looking in the wrong direction.   * I don't write books, but I study a topic from different online sources and then plug in what is important in a text file.   * I need to create an index (like we have in books). I should be able to click on that index link to be taken to that chapter. It should be easy to edit the indexes, and well as insert new chapters in between the previous ones.   * I am a programmer, therefore I need to write properly indented code in a text file (which doesn't support automatic indenting). The code and the explanation has to be in the same file.   * Sometimes, I need to create some flowcharts/UML too. I have tools for doing the same, but I want that those images be pasted in my text file. Is LaTeX perfect for these needs?


title: Extend keyword list for fancyvrb / listings, based on a given language

text: I use `fancyvrb` and `listings` packages, and I have defined a language `scala`, which is the default to use. In one occasion, I have an extension of that language, `escala`, which adds additional keywords. Can I add these keywords for one block of `\begin{Verbatim} ... \end{Verbatim}`, so that they are also highlighted like other keywords (in my case boldface)? Or can I easily define a new language based on `scala`, merely adding the new keywords without a full copy of the scala definition? It appears that this is a similar question, however it destructively adds keywords to a language (e.g. `python`), whereas I want to preserve `scala` and instead have a second language.


title: Align environment inside TikZ

text: I'm new to TikZ, and I'm trying to use the `align` enviroment to align some text then draw something on it using some TikZ lines. But the problem that pdfLaTeX is generating an error whenever I try to put the `alignment` enviroment inside a TikZ picture. Here's my code:               \begin{figure}     \centering     \begin{tikzpicture}          \begin{align}         \notag &a_1,\ &b_1,\ &c_1,\ &d_1,\ &e_1\ \mbox{etc.}\\         \notag &a_2,\ &b_2,\ &c_2,\ &d_2,\ &e_2\ \mbox{etc.}     \end{align}           %% draw some stuff using tikz on the the aligned text.     \end{tikzpicture}     \end{figure}      but I'm always getting this error:               ! Missing \endgroup inserted.     <inserted text>                      \endgroup      l.358 \end{align}      P.S. If I put the `align` outside the TikZ enviroment, everything works normally.


title: Missing $ inserted in block environment

text: I tried to compile the following using the `beamer` class:               \begin{block}         $$T(\mathcal{P})=\mathbb{R}$$  and       $$\mathrm{M}(\mathcal{P})=\mathbb{R}_{+}^{3}/ \mathrm{S}_3$$     \end{block}      If I complie the math stuff alone, it works just fine, but when I put them inside a `block` environment, it says `missing $ inserted`. What should I do?


title: What are the generally accepted guidelines for adjusting \linespread to avoid extra spreading from inline math?

text: # General Background I am just starting to think about typesetting and LaTeX in anything close to a serious manner, and am getting lots of questions that perhaps are appropriate for this site, but perhaps are either too open-ended and opinion based, or too much about typesetting and design in general and not enough about tex; here is an attempt to ask one of these questions in an acceptable way. I asked a professional mathematician with some serious (but, as far as I know, amateur) interest in typesetting about easy ways to improve the look of the basic amsart math documents that I upload to the arxiv (so, most people will be reading it on a computer monitor; a few studying it more deeply will print it out from their own printer in some fashion), and he gave three points:   1. `\usepackage{microtype}`   2. `\usepackage{mathpazo}`   3. `\linespread{1.2}` From what I've seen browsing around here, the first two points seem uncontroversial (with of course choice of font being a matter of taste); it is the third point I am trying to figure out now. # What I've observed/thought I have gathered that it is widely accepted that it is good idea to increase the line spread when using Palantino, with the recommended range I've seen being between 1.05 and 1.10; see, in particular Why exactly is \linespread{1.05} appropriate for Palatino?; in a comment toward the bottom of the page, we have Yiannis Lazarides: "Also I think for mathematical texts using a lot of inline math one should use 1.10" The situation Yiannis mentions is, of course, exactly my situation; but the advice I've quoted above, and my own quick experimentation, suggests that 1.1 may not be large enough. Testing `\linespread{1.1}` on the article I'm currently writing, I get several large increased line spaces because of inline math -- `\left(\frac{2\pi i}{r}\right)` and `\Hom^{(c,d)}` (`\Hom` being a mathoperator) causing problems. Increasing to `\linespread{1.2}` seems to remove the extra space between lines from the inline fraction, but still seems to have a very small increase in line space from the second case. Personally, I find the extra skipped white space very distracting from the text and something to be avoided, but I don't think I've ever noticed it flagged with a warning, so perhaps this isn't the general view among people who worry about these things. Several 'pure' responses to this problem occur to me:   1. Increase the linespread enough so that increased white spaces never happen   2. Live with increased line separations   3. Change the text to avoid inline math happening   4. Set it so the increased white space doesn't happen by setting `\lineskiplimit` to a negative value as is done here There could be approaches I have not considered, and of course mixes of the approaches above are possible and probably optimal --- for instance, setting `\linespread` high enough so that the spreading is rare and small, and then either living with the spreading that does happen, or setting `lineskiplimit` to be negative in addition to the large \linespread. # Attempt at a real question To try to hammer my confusion into something approaching an appropriate question: what do professional mathematical typesetters / very experienced mathematical latexers think and deal with these questions? I am not so much interested in any individuals personal preference, but in general accepted guidelines and ways of thinking about this problem. Are there large differences of opinion in such matters? If so, are there nice sources out there that 'teach the controversy'? # UPDATE I realize now what it is really causing the problem is having both a sub- and super- script on the math operators. Here is a picture of this in the wild , pulled from this arxiv entry, that is using mathpazo and `\linespread{1.15}`. ![In the wild](http://i.stack.imgur.com/INeOx.jpg) Here are some paragraphs from a paper in progress, pulled to illustrate the same problem in something approaching context:               \documentclass[12pt]{article}          \usepackage{amsmath}          \DeclareMathOperator{\Hilb}{Hilb}     \DeclareMathOperator{\Hom}{Hom}     \newcommand{\C}{\mathbb{C}}          \usepackage{mathpazo}               \begin{document}          The case $\Hilb^G_G$ where $v=G$ is the regular representation of $G$ has been studied     in particular depth, and is frequently referred to as GHilb.  Since the ideal sheaf of        a generic point on $[\C^2/G]$ corresponds to the regular representation of $G$, the     Hilbert-Chow morphism $\Hilb^G_G\to\C^2/G$ is an isomorphism away from $0$.  Since     $\Hilb^G_G$ is smooth, this is a resolution of singularities.  In fact, it turns out     that it is the minimal resolution of $\C^2/G$, and has been much studied.          The action of $(\C^*)^2$ on $\C^2$ induces an action on $\Hilb_n(\C^2)$, and since if     $G\subset (\C^*)^2$ then in particular $G$ and $(\C^*)$ commute, we also have a     $(\C^*)^2$ action on $\Hilb_G(\C^2)$.  The fixed points of this action on     $\Hilb_n(\C^2)$ are precisely the monomial ideas.  Since $G\subset (\C^*)^2$, we see     that the monomial ideals are also the fixed points of the action on $\Hilb_n(\C^2)^G$.          The space of $\Hom^{(c,d)}_\C(\mathcal{I},R/\mathcal{I})$ of weight $(c,d)$ vector      space maps corresponds to the cells in $\lambda$ and above $P_\lambda(c,d)$, while the      space $\Hom^{(c,d)}_R (\mathcal{I},R/\mathcal{I})$ of weight $(c,d)$ maps of $R$-     modules corresponds to the bounded regions below $P_\lambda$ and above      $P_\lambda(c,d)$.          \end{document}       And the output: ![Output](http://i.stack.imgur.com/oGQxZ.jpg) Even where there aren't horrendous extra spreads, as in the second paragraph, it still seems rather dense to my eyes, but I'm hardly an expert.


title: Good packages to typeset doctor prescription pad

text: I want to typeset a prescription pad for a doctor using LaTeX. I want to be able to style the header with relevant information and a image for the "cross", also I would like to specify the page size. Which are best packages to achieve this?


title: Numbered ordering of multiple citations

text: I am using `\bibliographystyle{ieeetr}` to ensure citations are numbered by their appearance in the paper. With multiple citations however, the numbers can be out or order because of the order they appeared somewhere earlier in the paper: `\cite{paper1, paper2, paper3}` ==> `[5, 3, 10]` Is there a way to ensure that the numbers appear in order with multiple citations?


title: Use "default" figure if file is missing?

text: I was recently in charge of organizing all of the references and labels in a very large scientific proposal document. My workflow typically involved compiling the document, seeing a " _There were undefined references._ " statement, and then searching the resultant PDF file for the usual " _?_ " or " _??_." Sometimes those missing references were in regard to labels for figures that were used throughout the text and not something in our bibliography. It got me wondering: **Is it possible to have a "dummy" or "default" figure to use in** `\includegraphics` **statements if the requested file is missing?** Perhaps a use case would be if in the LaTeX document there were a command such as `\includegraphics{scaling.pdf}`, but _scaling.pdf_ doesn't exist in the current directory, so we use the existing _dummy.pdf_ automatically. I assume this involves `renewcommand`'ing the `includegraphics` command, but how should one go about doing it for this scenario?


title: Can I test if a file exists?

text: Can I somehow test if a file exists? And can I use this to do only things when it exists? I like to do something like               if(exist('members.csv')) {      do something     }


title: how do I use the \input command on windows, combined with \IfFileExists?

text: I'm trying to use a command in my LaTeX file that inputs a file if it exists, and if it doesn't exit, inputs another one. This is the command:               \IfFileExists{/media/kingstonGB/LaTeX/preamble}{\input{/media/kingstonGB/LaTeX/preamble}}{\input{E:\\LaTeX\\preamble}}      In short, the command searches for the file in `/media/kinstgonGB` (which should succeed on my unix systems, and if it finds it, inputs it. Otherwise, if that file is not found, it means the LaTeX is being compiled on a Windows system, so it should look for files in `E:\`. However, I get this error message:               ! LaTeX Error: Missing \begin{document}.      I've also tried wrapping `E:\LaTeX\preamble` in quotes, or escaping it (as done here), or both, and the error is the same.


title: Is there a 'try' command for LaTeX?

text: What I'm trying to do is input _file1_ if it exists and input _file2_ otherwise, without having to deal with an 'I can't find file' error. I would like to accomplish this using TeX, without using symbolic links. What I would like is some kind of `\try` command:               \try{\input{file1}}     \catch{\input{file2}}      Of course, this would try to input _file1_ and, if it encounters an error, input _file2_ instead. I'm sure people who are more proficient than I am with plain TeX could accomplish this easily. (Please feel free to edit the tags.)


title: Left aligned Abstract

text: The following is an example code. I want to make the title of "Abstract" left- aligned. And how to change the size of "Abstract"? Thank you for answers!               \documentclass{article}     \begin{document}     \begin{abstract}       The abstract goes here.     \end{abstract}     \end{document}


title: How to use listings inside pgfplots captions?

text: I need to add a (general) listings code in a plot caption. For some reason `listings` (inline) doesn't interact well with `\addlegendentry`, what can I do to make the same code work outside and inside an `\addlegendentry` environment? Note that it even gives an strange result (see image), where the phrase is in the wrong order.               \documentclass[]{article}     \usepackage{pgfplots}     \usepackage[]{listings}     \begin{document}     \lstinline[]|(double x){bbbb}| %ok          \begin{tikzpicture}     \begin{axis}[]     \addlegendentry{\lstinline[]|(double x){bbbb;}|}; %not ok, garbage     \addplot+[mark=none, line join=round, fill opacity = 0.5, ] coordinates {     ( 1, 2 )     ( 3, 4)     };      \end{axis}     \end{tikzpicture}     \end{document}      ![weird listing inside pgfplot](http://i.stack.imgur.com/nXHWJ.png) One workaround I found is to put `\{`...`\}` in the `\legendentry` case, but doing so doesn't do the same thing outside the `pgfplot` and I want to use the _same_ code regardless if possible. Maybe the solution is an option that I have to pass to the `tikzpicture` environment, or to the `tikz` package or to the `listing`. (These `verb`-like environments always give me headaches.) * * * **EDIT** : Thanks to Gonzalo's clarification, I made this code that allows to use the same code inside and outside the caption, it uses a hack (`\textrm`, other solutions are welcomed):               \documentclass[]{article}     \usepackage{pgfplots}     \usepackage[]{listings}     \begin{document}     \textrm{\lstinline[]|(double x)\{bbbb\}|} %ok     \begin{tikzpicture}     \begin{axis}[small]     \addlegendentry{\textrm{\lstinline[]|(double x)\{bbbb\}|}}; %now ok     \addplot+[mark=none, line join=round, fill opacity = 0.5, ] coordinates {( 1, 2 )};      \addlegendentry{\lstinline[]|(double x){bbbb;}|}; % not ok, garbage     \addplot+[mark=none, line join=round, fill opacity = 0.5, ] coordinates {( 1, 2 )};      \addlegendentry{\lstinline[]|(double x)\{bbbb\}|}; % not what one expects     \addplot+[mark=none, line join=round, fill opacity = 0.5, ] coordinates {( 1, 2 )};      \end{axis}     \end{tikzpicture}     \end{document}


title: Creating a colormap in tikz/pgfplots, no axis

text: I'd like to replicate this colormap in `TiKz` or `pgfplots`. Let me clarify, I don't need a plot of any kind, these are screen-shots from another application. But since the labels on the pic below are poor I'd like to make it more professional. ![enter image description here](http://i.stack.imgur.com/PV2C8.png) So far I have this rubbish: ![enter image description here](http://i.stack.imgur.com/WkyZ0.png) Is there a way to cut out the adjoining plot altogether and put my own tick labels on the contour?               \documentclass[tikz,border={12pt,12pt}]{standalone}     \usepackage{pgfplots}     \usetikzlibrary{plotmarks}     \pgfplotsset{compat=newest}     \begin{document}     \begin{tikzpicture}           \begin{axis}[hide axis,colorbar,colormap/jet,       colorbar style={yshift=-2cm,         xtick={18,22,26,30,34,38,42,45},         xticklabel={18,22,26,30,34,38,42,45},         rotate=270,         yticklabel pos=left,         yticklabel style={anchor=south},},         ]        {        };      \end{axis}     \end{tikzpicture}          \end{document}


title: LuaTeX font database cannot be created in MiKTeX 2.9

text: Quite in a hurry I am trying to setup MiKTeX 2.9 on the computer of a friend of mine. We started with the portable version but the problem is the same in the normal install. Before the compilation of the `.tex`-file LuaLaTeX needs the font name database and the creation fails with this error message:               C:\miktex>mkluatexfontdb -vvv          luaotfload | Updating the font names database:     luaotfload | Font names database not found, generating new one.                  This can take several minutes; please be patient.     luaotfload | Updating the font names database:     [...]     luaotfload | blacklisted file: /System/Library/Fonts/STHeiti Light.ttc     luaotfload | Scanning TEXMF and OS fonts...mkluatexfontdb: Windows API error 67:      The network name cannot be found.     mkluatexfontdb: Data: \\MiKTeX\]MPM[\fonts\opentype      The issue seems similar to this question, which unfortunately received no answers. Any help would be greatly appreciated. What I can deduce so far from the error message is that `mkluatexfontdb` wants to access the network server `\\MiKTeX` which does not exist, and which I have never given as an option to search for. This happens with the current (25.03.12) portable version of MiKTeX 2.9 on Windows 7 64 but I could also reproduce it with the normal version. In the documentation to `luaotfload` it is mentioned that `%WINDIR%\Fonts` will be searched but not any network server and there seems no way to disable this. Edit: The only vaguely related environment variables are:               HOME=C:\\Users\user     HOMEDRIVE=C:     HOMEPATH=\Users\user     LOCALAPPDATA=C:\Users\user\AppData\Local     LOGONSERVER=\\WIN7     MIKTEX_BINDIR=C:\miktex\miktex\bin     MIKTEX_COMMONSTARTUPFILE=C:\miktex\miktex\config\miktexstartup.ini     MIKTEX_GS_LIB=C:\miktex\ghostscript\base;C:\miktex\fonts     MIKTEX_USERSTARTUPFILE=C:\miktex\miktex\config\miktexstartup.ini     Path=C:\miktex\miktex/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbe     m;C:\Windows\System32\WindowsPowerShell\v1.0\     SystemDrive=C:     SystemRoot=C:\Windows     TEMP=C:\miktex\miktex\temp\     TEMPDIR=C:\miktex\miktex\temp\     TMP=C:\miktex\miktex\temp\     TMPDIR=C:\miktex\miktex\temp\     USERDOMAIN=win7     USERNAME=user     USERPROFILE=C:\Users\user     windir=C:\Windows      2nd edit: The path to the fonts can also not be accessed (MWE):               \documentclass[11pt]{article}          \begin{document}     Example text.     \directlua{tex.print(-2,kpse.expand_path("$OPENTYPEFONTS"))}     \end{document}      leads to the following output of `lualatex`:               This is LuaTeX, Version beta-0.70.1-2011080216 (rev 4277)     (C:/temp/test1.tex     LaTeX2e <2011/06/27>     LuaTeX adaptation of babel <v3.8l-luatex-1.4> and hyphenation patterns for engl     ish, loaded.     (C:/miktex/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (C:/miktex/tex/latex/base/size11.clo))     No file test1.aux.     lualatex: Windows API error 67: The network name cannot be found.     lualatex: Data: \\MiKTeX\]MPM[\fonts\opentype      This is the output of kpsewhich in the directory of the .tex file:               C:\temp>kpsewhich --expand-path=$OPENTYPEFONTS     kpsewhich: Windows API error 67: The network name cannot be found.     kpsewhich: Data: \\MiKTeX\]MPM[\fonts\opentype


title: Yasnippet, Sweave: How to make snippets work from .Rnw files?

text: I use `yasnippet`'s defined in `~/.emacs.d/plugins/yasnippet-0.6.1c/snippets/text-mode/latex-mode` to insert small pieces of code when working with LaTeX. I recently started to use Sweave and therefore work on `.Rnw` files. However, I noticed that the (ya)snippets don't work anymore - hitting `TAB` after a trigger word just does not expand the defined snippet. Instead, nothing happens. I thought that's a simple problem to solve, just copy the snippets to `~/.emacs.d/plugins/yasnippet-0.6.1c/snippets/text-mode/rnw-mode` or `.../noweb-mode`. But that did not work either (meaning that hitting `TAB` does not expand trigger words). What I can do, however, is `M-x yas/expand` right after the trigger word, so it's working, but just not with `TAB`. How can I use yasnippets from .Rnw files? **Update 1** I found http://groups.google.com/group/smart- snippet/browse_thread/thread/8206a23037f598b1/39ed819692df63ad?lnk=gst&q=rnw#39ed819692df63ad I have exactly that problem -- `<tab>` is bound by noweb-mode. However, the solution posted in the last post does not work for me/does not seem to have an effect on the problem (so, as above, `TAB`-expansion of trigger words does not work). As described in that post, the mode changes from LaTeX to noweb depending on where the point is in the .Rnw file. I only need my LaTeX macros to expand when in LaTeX mode (of course). In case this matters, I work with Emacs 24 on Mac OS X 10.7.3. **Update 2** `C-h k TAB` leads to (either with or without the solution posted on the above line):               <tab> runs the command noweb-indent-line, which is an interactive Lisp function     in `noweb-mode.el'.          It is bound to <tab>.          (noweb-indent-line)          Indent the current line according to mode, after narrowing to this chunk.      So obviously, `TAB` is used by noweb. **Update 3** When the point is in a LaTeX part of the .Rnw file, then the modes displayed in the mode line are: LaTeX/MP Ref Fly yas pair vl Wrap Fill Noweb NWFL. If the point is in an R chunk of the file, then the modes are: ESS[S] [none] Rox Fly ElDoc pair vl Wrap Noweb NWFL. So indeed, the modes change when out of/within R chunks. However, I still can't `TAB`-expand snippets. My `.emacs` contains (which is obviously not working as expected):               (add-hook 'LaTeX-mode-hook       '(lambda ()          (make-variable-buffer-local 'yas/trigger-key)          (setq yas/trigger-key [tab])))


title: Theorem decorations that stay with theorem environment

text: I am typesetting a document using the `memoir` documentclass. Currently, my theorems have the following definition (using macros provided by the `ntheorem` package):               % THEOREMS     \theoremheaderfont{\sffamily\bfseries\upshape}%     \theorembodyfont{\itshape}%     \theoremsymbol{}%     \theoremseparator{\ }%     \theoremprework{\needspace{2\baselineskip}\noindent\theoremhang\vspace*{-1.3ex}}%     \theorempostwork{\nopagebreak\noindent\theoremhung}%     \setlength{\theorempreskipamount}{-1ex}     \setlength{\theorempostskipamount}{-1ex}     \newtheorem{theorem}{Theorem}[chapter]%      where the `\theoremprework` and `\theorempostwork` respectively use the following two macros to decorate the theorem:               \newcommand{\theoremhang}{% top theorem decoration       \begingroup%         \setlength{\unitlength}{.005\linewidth}% \linewidth/200         \begin{picture}(0,0)(1.5,0)%           \linethickness{0.45pt} \color{black!50}%           \put(-3,2){\line(1,0){206}}% Top line           \multido{\iA=2+-1,\iB=50+-10}{5}{% Top hangs             \color{black!\iB}%             \put(-3,\iA){\line(0,-1){1}}% Top left hang             \put(203,\iA){\line(0,-1){1}}% Top right hang           }%         \end{picture}%       \endgroup%     }%          \newcommand{\theoremhung}{% bottom theorem decoration       \nobreak       \begingroup%         \setlength{\unitlength}{.005\linewidth}% \linewidth/200         \begin{picture}(0,0)(1.5,0)%           \linethickness{0.45pt} \color{black!50}%           \put(-3,0){\line(1,0){206}}% Bottom line           \multido{\iA=0+1,\iB=50+-10}{5}{% Bottom hangs             \color{black!\iB}%             \put(-3,\iA){\line(0,1){1}}% Bottom left hang             \put(203,\iA){\line(0,1){1}}% Bottom right hang           }%         \end{picture}%       \endgroup%     }%      Here is a common view of a theorem based on these definitions: ![Theorem decorations](http://i.stack.imgur.com/zJSFc.png) The problem I am experiencing occurs around page breaking, where either of the graphics (`\theoremhang` or `\theoremhung`) occur close to the end of the page. I sometimes have `\theoremhang` being orphaned at the bottom of a page and not 'sticking' to the `theorem` environment. Other times `\theoremhung` ends up being orphaned on a following page if the `theorem` environment ends right at the bottom of the page. My attempts at trying to keep things together used `\needspace` and some negative vertical alignment (via `\vspace`s). Although the former may help, the latter feels like a bit of a hack and neither sticks to the `theorem` environment like I'd hope it would. Any idea how I can fix the problem and perhaps even optimize this look? * * * For completeness, here is a minimal working example containing the above definitions (including a `proof` environment, also via `ntheorem`) as well as a sample theorem/proof:               \documentclass{memoir}     \usepackage{amsmath}     \usepackage[amsmath]{ntheorem}%     \usepackage{lipsum,multido,graphicx,xcolor}          % THEOREMS     \theoremheaderfont{\sffamily\bfseries\upshape}%     \theorembodyfont{\itshape}%     \theoremsymbol{}%     \theoremseparator{\ }%     \theoremprework{\needspace{2\baselineskip}\noindent\theoremhang\vspace*{-1.3ex}}%     \theorempostwork{\nopagebreak\noindent\theoremhung}%     \setlength{\theorempreskipamount}{-1ex}     \setlength{\theorempostskipamount}{-1ex}     \newtheorem{theorem}{Theorem}[chapter]%          % PROOF     \theoremheaderfont{\sffamily\bfseries\upshape}%     \theorembodyfont{\upshape}%     \theoremstyle{nonumberplain}%     \theoremseparator{\ }%     \theoremsymbol{}%     \setlength{\theorempreskipamount}{1ex}%     \newtheorem{proof}{Proof}%          \newcommand{\theoremhang}{% top theorem decoration       \begingroup%         \setlength{\unitlength}{.005\linewidth}% \linewidth/200         \begin{picture}(0,0)(1.5,0)%           \linethickness{0.45pt} \color{black!50}%           \put(-3,2){\line(1,0){206}}% Top line           \multido{\iA=2+-1,\iB=50+-10}{5}{% Top hangs             \color{black!\iB}%             \put(-3,\iA){\line(0,-1){1}}% Top left hang             \put(203,\iA){\line(0,-1){1}}% Top right hang           }%         \end{picture}%       \endgroup%     }%          \newcommand{\theoremhung}{% bottom theorem decoration       \nobreak       \begingroup%         \setlength{\unitlength}{.005\linewidth}% \linewidth/200         \begin{picture}(0,0)(1.5,0)%           \linethickness{0.45pt} \color{black!50}%           \put(-3,0){\line(1,0){206}}% Bottom line           \multido{\iA=0+1,\iB=50+-10}{5}{% Bottom hangs             \color{black!\iB}%             \put(-3,\iA){\line(0,1){1}}% Bottom left hang             \put(203,\iA){\line(0,1){1}}% Bottom right hang           }%         \end{picture}%       \endgroup%     }%          \begin{document}     \chapter{First chapter}     \lipsum[1]          \begin{theorem}%     If~$G$ is a connected graph of order $n\geq 3$ and size~$m$, then     \[         g(G)\geq \frac{m}{6}-\frac{n}{2}+1.%     \]          \begin{proof}%     Suppose a connected graph~$G$ of order $n\geq 3$ and size~$m$ is embedded in a surface of genus~$g(G)$, thus producing~$f$ faces. Then it follows by Theorem~XX that every face is a 2-cell and hence by Theorem~YY that $n-m+f=2-2\,g(G)$. An identical argument as in the proof of Theorem~ZZ shows that $3f\leq 2m$ and so     \[         2-2\,g(G)=n-m+f\leq n-m+\frac{2m}{3},%     \]     from which the desired inequality follows.%     \end{proof}%     \end{theorem}%          \lipsum[2]          \end{document}


title: Multicols custom column width

text: I need to use `multicol` package to create columns of custom width. I am unable to figure out how to achieve this. I would also need to switch from one column to another based on specific content.


title: Putting equations in \intertext to annotate a proof

text: I'm trying to typeset a proof with Latex. When I do proofs, I like to alternate between a line of text, to explain each step, and the resulting equation. I also like to have the equations align at the `=`. I can do this quite easily with `begin{align}` and `\intertext{}`. My issue, though, is that I would now like to put an equation into the `\intertext`. Essentially, it's a side equation which isn't directly part of the proof but is important to get from one step to the next. Obviously, I could just abandon `begin{align}` and alternate between `text mode` and `math mode`, but then lines of my proof wouldn't be aligned at the `=`. Is there some way that I can force `\intertext` to accept my equation? Otherwise, what do people generally do when they have an equation that's important to the proof but not part of the direct logic? Thanks in advance for your advice!


title: How do you superimpose two symbols over each other?

text: I want to superimpose two symbols, e.g. I want to superimpose `\vee` and `\wedge` and `>` and `<` symbols over each other (not above each other as in `stackrel`) and `Q` with a horizontal strike through like bar across it. I am using LyX 2.0.


title: Ps2pdf: checking version on a Windows machine

text: I use TexLive 2011 and `Ghostscript 9.05` on `Windows XP`. I see that my WinEdt when calling `ps2pdf` for the `ps > pdf` conversion is using `Ghostscript 9.04` (which I do not have anymore on my machine). Thus I would like to verify from the command prompt in Windows the version of `ps2pdf`. Which command to use? A related question: Is `gswin32c.exe` called by `ps2pdf.exe` ? Thanks a lot...


title: Typesetting BiBTeX in TikZ

text: I am wondering if there is a way to print a BiBTeX bibliography in a TikZ node. I am making a huge poster, created as a large TikZ image. I want to include a small bibliography list. Is there a way to print this list in a TikZ node, in the correct layout. I know one could just type in in LaTeX code, but I want the bibliography be easy to maintain without worrying about the official standards. thanks.


title: \renewcommand only in subordinated file with subfiles package

text: Is there a way to renew a command only when the child file is compiled with the `subfiles`-package? `main.tex`:               \documentclass{article}     \usepackage{subfiles}     \newcommand{\foo}{foo}          \begin{document}       \foo % always returns foo       \subfile{content}     \end{document}      `content.tex`:               \documentclass[main.tex]{subfiles}     \renewcommand{\foo}{bar}          \begin{document}       Here is some content.       \foo % always returns bar     \end{document}      When I compile `main.tex` the `\foo` called from inside `content.tex` returns bar. I want it to return foo when I compile `main.tex` and bar when I compile `content.tex`. Is this possible? The documentation for `subfiles`, section 2.2, state that: > • If the subordinated file was `\subfile`’d, it ignores everything before > and including `\begin{document}`, and the ignores `\end{document}` too. (The > body of the file, nothing else, is effectively `\input`.) This does not seem to be the case.


title: fbox drawn incorrectly after \noindent

text: What's going on here that the first and last `\fbox` are not getting drawn correctly when immediately following `\noindent`?               \documentclass{article}     \usepackage{pst-node}     \pagestyle{empty}     \begin{document}          \noindent\fbox{A\rule{0.4pt}{3ex}}          \fbox{A\rule{0.4pt}{3ex}}               \noindent\fbox{A}          \fbox{A}          \noindent%     \begin{pspicture}(0,0)         \psset{linecolor=red,linewidth=0.4pt}         \rput(1.45em,6.5\baselineskip){\cnode{0.05}{A}}         \rput(2.9em,1.84\baselineskip){\cnode{0.05}{B}}          \end{pspicture}     \end{document}      It's barely noticeable: but now that I see it, it annoys me. ![enter image description here](http://i.stack.imgur.com/CyPqw.png)


title: Inserting MATLAB files with a lot of lines

text: I have a few MATLAB files with over 100 lines of code but when I use `\lstinputlisting`, I only get about the first 50 lines or so and it doesn't show up on the next page. Presumably, it's floating away somewhere on the same page. I've tried using `\afterpage`, `\clearpage`, `\cleardoublepage`, `\pagebreak`, and `\newpage`, but none of them help. I'm a beginner with LaTeX and would appreciate any help that I can get. Thanks!!               \lstset {language=Matlab,%           %basicstyle=\color{red},           breaklines=true,%           morekeywords={matlab2tikz},             keywordstyle=\color{blue},%           morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},           identifierstyle=\color{black},%           stringstyle=\color{mylilas},           commentstyle=\color{mygreen},%           showstringspaces=false,           numbers=left,%           numberstyle={\tiny \color{black}},% size of the numbers           numbersep=9pt,            emph=[1]{for,end,break},emphstyle=[1]\color{red},             %emph=[2]{word1,word2}, emphstyle=[2]{style},           }


title: Need some help getting started with TikZ, groupplots and color mapping of matrix

text: I used Python to make the plot shown below (saved as png). It should have a common colorbar and all data is read from a `h5` file, but I thought saving it to a txt file or something using a Python script to read in for the TikZ figure. There are 5 plots and 1 colorbar: The first plots only has one variable (with values 0,25,33,50,66,75 %), each colored square represents the corresponding output, which can be represented by an array of length 6. The four other plots have two variables (with values [0,25,33,50,66,75 %] and [0,1,2,3,4,5,6,7,8]) and can thus be represented by a 6x9 matrix. I would like to make a TikZ figure just like the PNG, but off course with non- overlapping text and maybe a title for each subplot and a better outline of the colorbar (the png was quick and dirty to be able to quickly view the output). Can anyone help me out here? (If having the values is usefull, please tell me in what format it would be easiest and I'll upload a `txt` file asap.) Edit: Adding the data in `data.txt` data.txt Edit2: I forgot to mention that I would like to be able to use \figureheight and \figurewidth, defined in the `tex` file, to adjust the dimensions (like I did in the figure from another question). ![enter image description here](http://i.stack.imgur.com/gGD3b.png)


title: Package collision matlab2tikz and legend in polaraxis. pgfplotset and multiple size definition problem

text: How can plots, created by matlab2tikz and common tikzpicture-polaraxis be correctly used within the same document? The example is of the structure packages, matlab2tikz-pic1, matlab2tikz-pic2 and polaraxis-pic. The matlab2tikz-pictures are just copy paste. They work well (according to its source) with the following codelines used after \begin{document}               \pgfplotsset{compat=1.3,         every axis legend/.style={         y tick label style={/pgf/number format/1000 sep=},                           x tick label style={/pgf/number format/1000 sep=}}}         \newlength\figureheight         \newlength\figurewidth      These lines badly affect the legend in polaraxis-pic (frame and alignment). Putting these lines in the corresponding figure enviorement (after \begin{ figure}) works just for the first time. The second call creates an "already- defined" error message. Putting one layer deeper into \begin{tikzpicture} causes a hang up of texmaker. Any suggestions?               \documentclass[12pt,a4paper]{report}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage[ngerman]{babel}                             % Sprache mit Umlauten     \usepackage[{top=3cm,bottom=3cm,left=3cm,right=2cm}]{geometry}     \usepackage{graphicx}     \usepackage[utf8]{inputenc}                             % Kodierung     \usepackage{mathcomp}     \usepackage{pgfplots}                                   % für matlab2tikz     \usepgfplotslibrary{polar}                              % für Polarplots     \usetikzlibrary{shapes.geometric}                       % für Polarplots     \setlength{\parindent}{0pt}     \newcommand{\xfrac}[2]{%     \mbox{\raisebox{0.6ex}{\ensuremath{\displaystyle #1}}%     {\Large /}%     \raisebox{-0.6ex}{\ensuremath{\displaystyle #2}}}}               \begin{document}     \begin{figure}[h]     \pgfplotsset{compat=1.3,         every axis legend/.style={         y tick label style={/pgf/number format/1000 sep=},                           x tick label style={/pgf/number format/1000 sep=}}}         \newlength\figureheight         \newlength\figurewidth     \begin{center}     \footnotesize     \setlength\figureheight{4cm}     \setlength\figurewidth{8cm}      % This file was created by matlab2tikz v0.4.2.     \begin{tikzpicture}     \begin{axis}[     width=\figurewidth,     height=\figureheight,     scale only axis,     xmin=0,     xmax=5,     xlabel={Tiefe [$\mu$m]},     ymin=0,     ymax=105,     ylabel={Temperaturanstieg [K]}     ]     \addplot [     color=black,     solid,     forget plot     ]     table[row sep=crcr]{     0 98.3383266017213\\     0.6 75.7037719551423\\     1.4 44.0308586761605\\     1.8 31.8836282059977\\     2.6 15.3339893333299\\     3.9 3.79795619734343\\     5 0.987919017813002\\     };     \addplot [     color=black,     solid,     forget plot     ]     table[row sep=crcr]{     0.5 80.10874197629\\     1 90.10874197629\\     };     \node[above, right, inner sep=0mm, text=black]     at (axis cs:1,90.10874197629,0) {\scriptsize 30 ns, 0 mm};     \end{axis}     \end{tikzpicture}%     \hspace{2cm}     \end{center}     \caption{Text}     \end{figure}               %%\begin{figure}[h]     %\pgfplotsset{compat=1.3,     %   every axis legend/.style={     %   y tick label style={/pgf/number format/1000 sep=},                       %   x tick label style={/pgf/number format/1000 sep=}}}     %    \newlength\figureheight     %    \newlength\figurewidth     %\begin{center}     %\footnotesize     %\setlength\figureheight{4cm}     %\setlength\figurewidth{8cm}      %% This file was created by matlab2tikz v0.4.2.     %\begin{tikzpicture}     %\begin{axis}[     %width=\figurewidth,     %height=\figureheight,     %scale only axis,     %xmin=0,     %xmax=5,     %xlabel={Tiefe [$\mu$m]},     %ymin=0,     %ymax=105,     %ylabel={Temperaturanstieg [K]}     %]     %\addplot [     %color=black,     %solid,     %forget plot     %]     %table[row sep=crcr]{     %0 98.3383266017213\\     %0.6 75.7037719551423\\     %1.4 44.0308586761605\\     %1.8 31.8836282059977\\     %2.6 15.3339893333299\\     %3.9 3.79795619734343\\     %5 0.987919017813002\\     %};     %\addplot [     %color=black,     %solid,     %forget plot     %]     %table[row sep=crcr]{     %0.5 80.10874197629\\     %1 90.10874197629\\     %};     %\node[above, right, inner sep=0mm, text=black]     %at (axis cs:1,90.10874197629,0) {\scriptsize 30 ns, 0 mm};     %\end{axis}     %\end{tikzpicture}%     %\hspace{2cm}     %\end{center}     %\caption{Text1}     %\end{figure}               \begin{figure}[h]     \begin{center}     \footnotesize     \begin{tikzpicture}     \definecolor{lgray}{rgb}{0.7,0.7,0.7}     \definecolor{dgray}{rgb}{0.3,0.3,0.3}     \makeatletter     \def\pgftransform@angle{0}     \pgfplotsset{         xticklabel style={             inner xsep=1pt,             ellipse,             anchor=\tick-(180-\pgftransform@angle)         },         yticklabel style={             anchor=90 + \pgftransform@angle         }     }     \makeatother     \begin{polaraxis}[       rotate=-90,       xmin=00,       xmax=90,       %xtick={0,30,60,90}       xticklabel=$\pgfmathprintnumber{\tick}^\circ$,       xtick={0,15,...,90},     legend style={xshift=3.5cm,yshift=-.2cm}     %legend style={anchor=north west, at={(axis cs:45,4)}}       ]       \addplot[red,no markers,smooth] table{        0 1        30 2        60 3        90 2         };         \addlegendentry{Text1}     \addplot[no markers,smooth] table{        0 2        30 3        60 1        90 1         };     \addlegendentry{Text2}     \end{polaraxis}     \end{tikzpicture}          \hspace{2cm}     \end{center}     \caption{Text}     \end{figure}          \end{document}


title: How to make \StrLeft understand the math expressions as full words in headers?

text: Here How to cut a section title in the header we learn how to use `\StrLeft` with the package titleps. However, LaTeX outputs an error when there is a math expression in my header say,               \section{The set  $\mathbb{A}$ }      This is linked to the second defect: `\StrLeft` breaks the title and generally it will output a single letter before the three dots. Like so, > the se... Is it possible to count the words (including the maths expressions between `$` `$`) instead of the letters so as to cut the title always after a full word ? is it possible to do the same when the math is entered via a personal command which included a `\ensuremath`, like so,               \newcommand{\rr}{\ensuremath{\mathbb{R}}\xspace}


title: How to rename \cref{} for lstlisting

text: At the moment I'm working on my Diploma thesis and after a long time of searching and trying, I still can't find a solution for my problem. Long story short: I want to refer to a **lstlisting** -enviroment via \cref{} and I want to change the displayed name. I already did this for some other enviroments:               \renewcommand\figureautorefname{Abbildung}     \renewcommand\tableautorefname{Tabelle}     \renewcommand\sectionautorefname{Kapitel}     \renewcommand\subsectionautorefname{Kapitel}     \renewcommand\equationautorefname{Gleichung}      I need to use \cref{} because I implemented a special format for the first use of \cref{}. The result should be something like:               This is a test-Code: Program-Code 1      instead of               This is a test-Code: Listing 1      Could anybody help me? Thanks a lot! Chris Edit: I found the part, that causes the failure of the solution under this post: There is a part in the template of the university. In this part the german/english terms for supervisor/Examiner are defined for the titlepage. If I select the german version within the document-enviroment, Program-Code changes to Listing again. :-( I updated the Code. * * * Here is my example:               \documentclass{scrreprt}          \usepackage[T1]{fontenc}                %% ermöglicht Sonderzeichen     \usepackage{lmodern}                    %% verbessert die Darstellung der Sonderzeichen     \usepackage[ngerman, english]{babel}    %% deutsche oder englische Schreibweisen     \usepackage[utf8]{inputenc}             %% deutsche Tastatur wg. Umlauten     \usepackage[ngerman, english]{babel}      \usepackage[fixlanguage]{babelbib}          \usepackage{subfig}                     %% Bilder => Unterbilder (a),(b),.. innerhalb einer Figure          \usepackage{hyperref}     \usepackage{xcolor}                     %% farbige Schrift und Schrifthinterlegung          \usepackage{listings}               %% SOURCE CODE     \lstset{%                                                       settings for the listing package:         numbers=left, numberstyle=\tiny,%                           line numbers         showstringspaces=false,%         frame=b, framerule=1pt,%         aboveskip=0.75\baselineskip, belowskip=0.75\baselineskip,%  space above and below listing         breaklines, prebreak=\mbox{$\hookleftarrow$},%              break overlong lines and puts prebreak at the end         stringstyle=\color{cyan}\ttfamily, % Farbe der String         showspaces=false, % Leerzeichen anzeigen ?         showtabs=false, % Tabs anzeigen ?         xleftmargin=17pt,         framexleftmargin=17pt,         framexrightmargin=5pt,         framexbottommargin=4pt,         commentstyle=\color{8},         showstringspaces=false, % Leerzeichen in Strings anzeigen ?         morekeywords={__global__} % CUDA specific keywords         }     \lstset{         language=python,         basicstyle=\ttfamily,         keywordstyle=\color{orange},     }     \lstloadlanguages{python}     \renewcommand*\lstlistingname{Programm-Code}     \DeclareCaptionFont{white}{\color{white}}     \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{\hspace{15pt}#1#2#3}}}     \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white, singlelinecheck=false, margin=0pt, font={bf,footnotesize}}          \renewcommand\figureautorefname{Abbildung}     \renewcommand\tableautorefname{Tabelle}     \renewcommand\sectionautorefname{Kapitel}     \renewcommand\subsectionautorefname{Kapitel}     \renewcommand\equationautorefname{Gleichung}          \usepackage[ngerman]{cleveref}     \crefname{listing}{Program-code}{Program-codes}       \Crefname{listing}{Program-code}{Program-codes}          \usepackage{letltxmacro}     \AtBeginDocument{%        \LetLtxMacro\oldref\cref%        \renewcommand{\cref}[1]{%        \ifcsname[#1]\endcsname\relax%       {\oldref{#1}}%       \else%       {\textbf{\oldref{#1}}%       }%       \expandafter\gdef\csname[#1]\endcsname{1}%       \fi%       }%      }          %-----          \declarebtxcommands{english}{%     \def\btxprue#1{\protect\foreignlanguage{english}{Examiner}}%     \def\btxsuper#1{\protect\foreignlanguage{english}{Supervisor}}%     }     \declarebtxcommands{ngerman}{%     \def\btxprue#1{\protect\foreignlanguage{ngerman}{Prüfer}}%     \def\btxsuper#1{\protect\foreignlanguage{ngerman}{Hochschulbetreuer}}%     }          \declarebtxcommands{ngerman}{%     \renewcommand{\figurename}{Abb.}     \renewcommand{\tablename}{Tab.}     }     \declarebtxcommands{english}{%     \renewcommand{\figurename}{Fig.}     \renewcommand{\tablename}{Tab.}     }     %-----          \begin{document}     %% SPRACHAUSWAHL VOR TEXTBEGINN     \selectlanguage{ngerman}   % <-------     %\selectlanguage{english}     \selectbiblanguage{ngerman}     %%\selectbiblanguage{english}               This is a test-Code: \cref{lst:example1}\\     second reference: \cref{lst:example1}     \begin{lstlisting}[caption={Test},label={lst:example1}]     test     \end{lstlisting}          Beispieltabelle: \cref{tab:test}\\     second reference: \cref{tab:test}     \begin{table}[h]     \centering      \captionabove{test-table}      \begin{tabular}{|c|c|}      \hline      hello & world \\      \hline      \end{tabular}     \label{tab:test}      \end{table}     \end{document}


title: Setting a single equation in a paragraph in a smaller font

text: I'm trying to figure out the best way of making a single equation just a little bit smaller. Of course, I could try and break up the equation into pieces and proceed that way, but I'd like to understand the best way to accomplish this task. Here's the problem:               \documentclass{article}     \begin{document}     Here is a bunch of text that I'm writing for no good reason.      The overall purpose is to demonstrate how to make an equation      set in a different font size from the surrounding paragraph     without messing up the spacing, like we do here:     {\footnotesize \[ f(x) = g(x) \] }     with an equation set as \verb#{ \footnotesize \[  f(x) = g(x) \]}#     \end{document}      This results in a terribly scrunched looking paragraph, because the \footnotesize command changes the baseline, I believe. How do I avoid this?


title: How to replace lipsum text with online text in LaTeX?

text: The packages `lipsum` and `blindtext` work well enough to flesh-out and format LaTeX documents, but are these packages all that's available? The question to answer in this thread: how can I use newly generated web content in place of the usual text produced by more standard text generators?


title: Undesired Placement of Footnotes in Blocks

text: Depending on the theme of a `beamer-document`, footnotes will either be placed inside or outside of a block-environment. It would like to do combine a style, which places the footnotes _inside_ a block-environment e.g. `Copenhagen`, with footnotes _outside_ of blocks. Strangely, no option I have tried for `\setbeamertemplate{blocks}[option]` seems to do that - whether I used `default, circles, rectangles,`nor `inmargin`. Is there any other way to tell beamer that footnotes should be placed at the bottom of the frame? On the left you can see the desired result with theme `Berlin`, both footnotes are at the bottom of the frame. On the right you see the the outcome with theme `Copenhagen` that unfortunately places one footnote inside the block- environment, which I would like avoid. ![enter image description here](http://i.stack.imgur.com/sHMWs.jpg) **UPDATE:** So here is my new MWE with some code from here:               \documentclass{beamer}     \usepackage[english]{babel}     \usepackage{csquotes}     \usetheme{Copenhagen}     \usepackage[style=numeric-comp, backend=biber, citetracker=true,sorting=none]{biblatex}     \usepackage{hyperref}     \addbibresource{biblatex-examples.bib}     \setbeamertemplate{navigation symbols}{}          \makeatletter     \newtoggle{cbx@togcite}     % Citation number in brackets     \renewcommand\@makefntext[1]{%       \iftoggle{cbx@togcite}         {{\normalfont[\@thefnmark]}\enspace #1}         {{\normalfont\@thefnmark}\enspace #1}%       \global\togglefalse{cbx@togcite}}          \DeclareCiteCommand{\sfcite}[\cbx@superscript]%       {\usebibmacro{cite:init}%        \let\multicitedelim=\supercitedelim        \iffieldundef{prenote}          {}          {\BibliographyWarning{Ignoring prenote argument}}%        \iffieldundef{postnote}          {}          {\BibliographyWarning{Ignoring postnote argument}}}       {\usebibmacro{citeindex}%        \usebibmacro{sfcite}%        \usebibmacro{cite:comp}}       {}       {\usebibmacro{cite:dump}}          \newbibmacro*{sfcite}{%       \ifciteseen       {}       {\xappto\cbx@citehook{%        \global\toggletrue{cbx@togcite}%        \noexpand\footnotetext[\thefield{labelnumber}]{%          \fullcite{\thefield{entrykey}}\addperiod}}}}          \newrobustcmd{\cbx@superscript}[1]{%       \mkbibsuperscript{\mkbibbrackets{#1}}%       \cbx@citehook%       \global\let\cbx@citehook=\empty}          \let\cbx@citehook=\empty     \makeatother          \begin{document}         \begin{frame}{A frame}     \begin{block}{Classic theory}       As we already know from classic theory\sfcite{reese}, ...       \begin{itemize}         \item Fact 1         \item Fact 2       \end{itemize}     \end{block}     Now there are some new developments\sfcite{bertram} challenging the classic view.     \end{frame}     \end{document}      **Update 24.02.** I found that in `beamerbaseboxes.sty` this minipage seems to be responsible for the footnote inside the block-environment.               \newcommand\beamerboxesrounded[2][]{%       [...]       % line 120       \setbox\bmb@box=\hbox\bgroup\begin{minipage}[b]{\bmb@width}%       \vskip2pt%       \usebeamercolor[fg]{\bmb@lower}%       \colorlet{beamerstructure}{upper.bg}%       \colorlet{structure}{upper.bg}%       %\color{.}%     }          \def\endbeamerboxesrounded{%       \end{minipage}\egroup%      Removing the minipage is not a good solution though, since it messes up the layout. Also taking `\end{minipage}\egroup%` inside `\newcommand\beamerboxesrounded` takes the footnote to the bottom of the slide, but messes up the layout.


title: Long format of acronyms in italic

text: I'm using the acronym package and I would like to know if is there anyway I can set the expanded text of **all** acronyms to appear in italic, even if I'm calling them with \ac{}. Thanks in advance


title: How to add horizontal whitespace in my text?

text: I have the following problem: ![enter image description here](http://i.stack.imgur.com/sBrQI.png) Is there an easy and quick way to change the upper part to the lower? I tried using `\hspace`, but it had no effect. I'm new to TeX so bear with me ;D


title: Less than or equal comparison within a whiledo

text: I am in the process of cleaning up the code for Sieve of Eratosthenes in tikz, but saw that when I initially did the code, I could not figure out how to do a `<=` comparison within the `\whiledo`, and had resorted to doing a `<` comparison with one more than the desired number. This feels like a hack to me, and since @StefanKottwitz is considering posting this on another site with `tikz` examples, I'd prefer to not have to resort to such hackery. ## Question: How do I implement a `<=` comparison within a `\whiledo` such as:               \whiledo{\value{MyCounter} <= \MaxValue}{      ## Notes:   * As much as I would like to, I can't use the `\foreach` from `pgf`. ## Code:               \documentclass{article}     \usepackage{ifthen}          \newcounter{MyCounter}          \def\StartValue{5}     \def\MaxValue{10}          \begin{document}     Note that 10 is missing when comparing to MaxValue:          \setcounter{MyCounter}{\StartValue}     \whiledo{\value{MyCounter} < \MaxValue}{         \theMyCounter         \stepcounter{MyCounter}     }          \bigskip     \textbf{Hack:} Comparing to MaxValuePlusOne does the job:          \newcounter{MaxValuePlusOne}     \setcounter{MaxValuePlusOne}{\MaxValue}     \stepcounter{MaxValuePlusOne}     %     \setcounter{MyCounter}{\StartValue}     \whiledo{\value{MyCounter} < \value{MaxValuePlusOne}}{         \theMyCounter         \stepcounter{MyCounter}     }     \end{document}


title: Saving tex file in its pdf form

text: I have a .tex file but I need to email it as its pdf in order to send it via email and have the receiver print it. is there a way to do this?


title: Why does 65* become 65∗ when using dcolumn package to align digits?

text: I am using `dcolumn` package to align some numbers after the decimal point. However, some of this numbers have "`***` signs" in order to relate them to additional information at the end of the table. However, as soon as I compile the `0.098*` becomes `0.098∗`. This happens only when I define the column center as `.` instead of `c` or `l` . For instance `begin{tabular}{l . c}`. Preamble:               \usepackage[dvips,letterpaper,margin=1in]{geometry}     \usepackage{booktabs}     \usepackage{tabularx}     \setlength{\abovecaptionskip}{6pt}       \setlength{\belowcaptionskip}{6pt}       \usepackage[large, bf, justification=centering]{caption}     \usepackage{rotating}     \usepackage{dcolumn}     \newcolumntype{.}{D{.}{.}{5,6}}      Here's the rest of the code: Code: Select all               \begin{table}     \footnotesize     \caption*{Table 5: Ordered logit results for men and women living in Denmark}     \centering     \begin{tabular}{l . .}     \toprule     \toprule     %     \multicolumn{1}{l}{taste for redistribution} & \multicolumn{1}{c}{\bf Men} & \multicolumn{1}{c}{\bf Women} \\          \multicolumn{1}{l}{in Denemark} & \multicolumn{1}{c}{\bf b/se} & \multicolumn{1}{c}{\bf b/se} \\          \midrule     &          \\     %     %                        age       & 0.018*  &       0.020* \\          \midrule     * p<0.05, ** p<0.01, *** p<0.001 \\     \bottomrule     \addlinespace[0.75em]     %     \scriptsize{\emph{Source: }stayers survey}     \end{tabular}     \end{table}      Anyone having a hint?


title: TikZ picture arrow overlapping

text: I want something like this: ![enter image description here](http://i.stack.imgur.com/zgZMx.png) but the arrows get overlapped in TikZ! I have tried the following code, but is there a better way than this?               \documentclass{article}     \usepackage{color}     \usepackage[dvipsnames]{xcolor}     \usepackage{tikz}               \begin{document}     \begin{tikzpicture}         \path (0,0) node(a) [rectangle,draw, fill=blue, text=white] {\LARGE EP};         \path (2,3) node(b) [rectangle,draw, fill=Cyan] {\LARGE GK};         \path (7,3) node(c) [rectangle,draw, fill=Cyan] {\LARGE GK};         \path (9,0) node(d) [rectangle,draw, fill=blue, text=white] {\LARGE EP};              \draw[thick,<-] (a.north) -- (b.west) node[midway, below right=0.3cm]{\parbox{2cm}{1. Request permission to place call}};         \draw[thick,->] (a.east) -- (b.south) node[midway, above left=0.3cm]{\parbox{2cm}{4. Grant permission to place call}};         \end{tikzpicture}     \end{document}


title: TexLive 2014 iso file doesn't work to install it

text: I am trying to install TexLive 2014 on my Windows XP. I create virtual drive with the iso.torrent file downloaded from here `http://anorien.csc.warwick.ac.uk/mirrors/CTAN/systems/texlive/Images/` And then nothing works. On my computer there is created virtual disk TexLive 2014 but when I open it I receive message that "no access to the image file". From different mirrors I tried another downloaded .iso files, not torrent files, I checked md5, everything is matched but still the same issue. When I do the same procedure with TexLive2012.iso file everything works. What I am I doing wrong?


title: Automatically spacing the tilde (~) symbol as a prefix number using the `siunitx` package

text: I'm trying to work out if there is a way to get `siunitx` to natively handle the ~ symbol (`\sim`) in the same way that it can handle the < and > operators before a number, as I would like to be able to use ~ as short hand for approximately. For example:               \documentclass[12pt,a4paper]{report}     \usepackage{siunitx}     \begin{document}          % Values output the same, with spacing after the < and before the % symbol     \SI{< 10}{\percent} \\     \SI{<10}{\percent} \\          % When writing in math mode a space in placed after the ~ symbol, but not before the % symbol     $\sim10\%$ \\          \end{document}      Ideally I'd like to be able to write something like `\SI{~ 10}{\percent}` or `\SI{\tilde}{10}{\percent}`, where `{\tilde}` is a custom value defined using the `DeclareSIUnit\tilde{~}` command. But I can't seem to find anything like this for prefix symbols in the documentation. Has anyone else come across a solution to this?


title: Selecting a single word in ereaders

text: ebook readers let user select only a single word in the most PDF documents. However, when I try to select a word in a PDF generated with `pdflatex` (and also with `latex`), the ereader (i.e. sony prs600) selects the entire sentence between the 2 punctuation marks. The same problem was also discussed in the following two links:   1. Force pdflatex to create one box per word   2. Selection in PDF files These discussions are a little bit old. Therefore, I wanted to learn if recently any new progress has been made about this problem. It seems creating tagged PDFs is a solution for this. Does any recent TeX release have this tagging property? Furthermore, I noticed that any PDF viewer (e.g. evince, adobe etc.) can select a single word for any document generated with `pdflatex`. Does anyone have any idea about why the ebook readers need tagged PDFs to select a single word in the whole documents?


title: How do I know what symbols/characters are available in a font package?

text: I usually use `xelatex`, but I'm exploring `pdflatex` now. When loading specific fonts in `xelatex`, I can always know what characters the font has available, since I can inspect the font file in any font viewing program, or I can find out the hard way by just entering the unicode and see if the character is displayed in the output. But how does this work with a font package? Say, for instance, that I would like to use phonetic symbols in the gentium font. How do I know whether the font has phonetic symbols (I assume it does), and how do I know what command I need to type in order to make them appear? My only resource is the comprehensive LaTeX symbols list, but this only tells me what characters/commands there are available in LaTeX2e by default (depending on the font encoding), and what symbols I can find in specific packages. Phonetic symbols, for instance, are said to be in the `tipa` package. Does that mean I am locked to `tipa` if I want to use phonetic symbols with `pdflatex`? Here's a pointless MWE:               \documentclass{article}     \usepackage{gentium}     \begin{document}     Please give me some phonetic symbols here?     \end{document}


title: Why does the Animate package inflate the file size of all of my externalized TikZ pictures?

text: I am using TikZ externalization to compile the figures in my thesis that use TikZ or PGF Plots. Ever since I included an animation using the `animate` package, the size of the PDFs of each of my externalized figures has _increased significantly_ \- by almost exactly the same size as the animation increases my final compiled PDF. Example: in the MWE below, I have an externalized TikZ figure and an animation. There are three cases:   * Case 1: The animation is commented out and excluded   * Case 2: The animation and TikZ file are both included   * Case 3: The externalized TikZ file is excluded Now in case 1, the file sizes are as follows:   * animateMWE.pdf: 9,002 bytes   * extfig-pdfout.pdf: 1,175 bytes In case 2, the file sizes are:   * animateMWE.pdf: 594,282 bytes   * extfig-pdfout.pdf: 584,854 bytes Case 3:   * animateMWE.pdf: 593,569 bytes Note how the "excess data" in the externalized file _does not contribute_ to the size of the final compiled document. The document at the end isn't overly inflated in size, but all of the externalized PDF output files are. So it's not a thesis-breaking issue, merely a matter of curiosity. _Why does this occur?_ The source files (which include the animation) are available on Dropbox. Compilable with `pdflatex -shell-escape animateMWE`. **animateMWE.tex:**               \documentclass[]{article}          \usepackage{animate}     \usepackage{pgfplots}        \usepgfplotslibrary{external}          \makeatletter     \newcommand{\useexternalfile}[1]{%         \tikzsetnextfilename{#1-pdfout}%         \input{\tikzexternal@filenameprefix#1.tikz}}     \makeatother          \tikzexternalize     \tikzset{external/system call={pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}          \tikzset{external/force remake=true}          \begin{document}          \begin{figure}     \centering     \animategraphics[height=8cm,controls,loop]{10}{./3-3mode/img-}{0}{39}     \end{figure}          \begin{figure}     \centering     \useexternalfile{extfig}     \end{figure}          \end{document}      **extfig.tikz:**               \begin{tikzpicture}       \draw (-1.5,0) -- (1.5,0);       \draw (0,-1.5) -- (0,1.5);       \draw (0,0) circle (1cm);     \end{tikzpicture}


title: Plotting line contours using pgftikz

text: Is there a way to plot line contours from a data file specifying the value of the line such as the one shown in example here. It takes a lot of time to plot, export and enter the PDF in to the thesis. ![Contour of a fluid flow problem](http://i.stack.imgur.com/v1VuD.jpg)


title: Page numbers > 99 in the table of content are not aligned correctly (cleanthesis)

text: How can I correctly align page numbers > 100 in the table of content? I use the `cleanthesis` template.               \documentclass[draft=on]{scrbook}     \usepackage{blindtext}     \usepackage[ngerman]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[svgnames]{xcolor}     \usepackage{cleanthesis}               \begin{document}     \tableofcontents          \section{Section 1}     \blindtext[100]     \section{Section 2}     \blindtext[500]     \section{Section 3}     \end{document}


title: Overfull \hbox in toc for large page-numbers when using mathdesign

text: I am using the `mathdesign` package to use the `bitstream-charter` font. In my table of contents, starting from page 100 and up, the page numbers for subsections are slightly of to the right and cause an overfull `\hbox` . Two-digit page numbers are fine and do not cause problems. MWE (with `\usepackage[showframe]{geometry}` to show page margins):               \documentclass{scrreprt}          \usepackage[ngerman]{babel}     \usepackage[bitstream-charter]{mathdesign}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage[showframe]{geometry}          \begin{document}     \tableofcontents     \setcounter{page}{90}     \chapter{Title}     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage          \chapter{Title}     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage     \section{section}     \newpage               \end{document}      Result: ![result](http://i.stack.imgur.com/DUemp.png) How can I fix this?


title: Usage of algorithm inside animateinline creates unexplainable offset

text: **Update** : Using `pgfmathsetmacro` in combination with an actual function, inside `tikzpicture` seems to be the issue. Some of the white space can be circumvented by the usage of `\relax` inside `\pgfmathsetmacro`, but this produces a random `@` in the tikzpicture. * * * I made an algorithm inside `pgfmath` which I intend to use inside my animation (see below). For some reason a weird offset to the right is created only when I use this algorithm (`qnorm` inside `\pgfmathdeclarefunction` in preamble). Why is this happening? ![http://i.imgur.com/UK5Te9M.png?1](http://i.stack.imgur.com/MfWJG.png) I believe it's self-explanatory that the alignment of the animated tikzpicture is completely wrong in the above picture. To understand what's happening, try setting the values to: `\pgfmathsetmacro\static{10}` and `\pgfmathsetmacro\qqq{14}` I simply cannot explain why the calculated value produces this behaviour contrary to the an approximation set directly inside `\pgfmathsetmacro`.               \documentclass{article}     \usepackage{pgfplots}     \usepackage{tikz}     \usepackage{animate}     \usepackage{geometry}     \usepackage{hyperref}     \usepackage{hypcap}     \pgfplotsset{compat=newest}     \usepgfplotslibrary{fillbetween}     \usetikzlibrary{intersections}     \usetikzlibrary{shadows}     \pgfmathdeclarefunction{normal}{2}{%       \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%     }     %     \makeatletter     \pgfmathdeclarefunction{qnorm}{4}{%       \begingroup         \pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}         \pgfmathparse{#1}         \edef\p{\pgfmathresult}         \pgfmathparse{#2}         \edef\mu{\pgfmathresult}         \pgfmathparse{#3}         \edef\sigma{\pgfmathresult}         %         \pgfmathparse{\sigma < 0 ? 1 : 0}                    \edef\sigma@neg{\pgfmathresult}         \pgfmathparse{\sigma == 0 ? 1 : 0}                   \edef\sigma@zero{\pgfmathresult}         %         \pgfmathparse{\p - .5}                           \edef\q{\pgfmathresult}         %         \pgfmathparse{abs(\q) <= .425 ? 1 : 0}               \edef\q@i{\pgfmathresult}                        %         \pgfmathparse{                                 \q@i ?                                     .180625 - \q * \q                          :                                  sqrt(-ln(min(\p,(1-\p))))                                 }         \edef\r@{\pgfmathresult}        %          \pgfmathparse{\q@i ?            \r@          :            (\r@ <= 5 ?               \r@ - 1.6 %           :              \r@ - 5           )}         \edef\r{\pgfmathresult}         \pgfmathparse{\q@i ?          (\q * (((((((\r * 2509.0809287301226727 +                            33430.575583588128105) * \r + 67265.770927008700853) * \r +                          45921.953931549871457) * \r + 13731.693765509461125) * \r +                        1971.5909503065514427) * \r + 133.14166789178437745) * \r +                      3.387132872796366608)                 / (((((((\r * 5226.495278852854561 +                          28729.085735721942674) * \r + 39307.89580009271061) * \r +                        21213.794301586595867) * \r + 5394.1960214247511077) * \r +                      687.1870074920579083) * \r + 42.313330701600911252) * \r + 1.))                                         : ( \r@ <= 5 ?                                               ((((((((\r * 7.7454501427834140764e-4 +     %                            .0227238449892691845833) * \r + .24178072517745061177) *     %                          \r + 1.27045825245236838258) * \r +                        %                         3.64784832476320460504) * \r + 5.7694972214606914055) *     %                       \r + 4.6303378461565452959) * \r +                        %                      1.42343711074968357734)                                %                     / (((((((\r *                                       %                              1.05075007164441684324e-9 + 5.475938084995344946e-4) *     %                             \r + .0151986665636164571966) * \r +                    %                            .14810397642748007459) * \r + .68976733498510000455) *       %                          \r + 1.6763848301838038494) * \r +                     %                         2.05319162663775882187) * \r + 1))                      %                                             :                                                    ((((((((\r * 2.01033439929228813265e-7 +                            2.71155556874348757815e-5) * \r +                           .0012426609473880784386) * \r + .026532189526576123093) *                         \r + .29656057182850489123) * \r +                        1.7848265399172913358) * \r + 5.4637849111641143699) *                      \r + 6.6579046435011037772)                     / (((((((\r *                              2.04426310338993978564e-15 + 1.4215117583164458887e-7)*                             \r + 1.8463183175100546818e-5) * \r +                            7.868691311456132591e-4) * \r + .0148753612908506148525)                          * \r + .13692988092273580531) * \r +                         .59983220655588793769) * \r + 1.))                         )                      }         \edef\val{\pgfmathresult}         \pgfmathparse{\q@i ? \val :         (\q > 0 ? \val : -\val)}                    %         \edef\@tmp{\pgfmathresult}         \pgfmathparse{\p > 1 ? sqrt(-1) :           (\p < 0 ? sqrt(-1) :             \sigma@neg ? sqrt(-1) :             %              (\sigma@zero ? \mu :               %                (#4 ? \mu+\sigma*\@tmp :                                   \mu-\sigma*\@tmp)              %               )            )         }         \pgfmath@smuggleone\pgfmathresult       \endgroup     }     \makeatother     \begin{document}     \newcommand*\samplesize{7}\relax       \let\mean\relax\newcommand\mean{9}\relax       \let\sd\relax\newcommand\sd{3}\relax       \let\lowertail\relax\newcommand\lowertail{0}\relax     \begin{figure}[ht]     \capstart     \begin{center}     \begin{animateinline}[controls]{15}       \multiframe{15}{ik=1+2}{     \begin{tikzpicture}     \begin{axis}[           hide y axis,           axis lines*=center,            axis on top,           no markers,            domain=4:20,            samples=4*\samplesize-7,           xlabel=\empty,            ylabel=\empty,           every axis x label/.style={at=(current axis.right of origin),anchor=west},           every axis y label/.style={at=(current axis.above origin),anchor=south},           width=.8\linewidth,           height=.3\linewidth,           xmin = 4, xmax=20,           xtick=, ytick=\empty,           enlargelimits=false,            clip=false       ]       \pgfmathsetmacro\result{1/((\ik/25+.65)^2+(ln(\ik/25+.65)^2+1.5))/1.2}       \pgfmathsetmacro\static{qnorm(0.05,\mean,\sd,\lowertail)}       \pgfmathsetmacro\qqq{qnorm(\result,\mean,\sd,\lowertail)}       \pgfmathsetmacro\colorq{(.1+.2*\ik/180)*100}       \pgfmathsetmacro\colorr{(.3+.55*\ik/180)*100}       \pgfmathsetmacro\colort{(.9-.8*\ik/180)*100}       \pgfmathsetmacro\colors{(.85-.55*\ik/180)*100}       \node at (axis cs:5,0.2) {};       \node at (axis cs:10.25,0.025) {\ifnum\ik>75{\textcolor{red}{waarschijnlijk een effect! $\rightarrow$}}\else{waarschijnlijk geen effect}\fi};       \node at (axis cs:\qqq,{1/(\sd*sqrt(2*pi))*exp(-((\qqq-\mean)^2)/(2*\sd^2))+.02}) {\ifnum\ik<75$\downarrow$\else\textcolor{red}{$\downarrow$}\fi};        \path[name path=line] (axis cs:\static,0) -- (axis cs:\static,\pgfkeysvalueof{/pgfplots/ymax}*1.1);       \addplot [name path=normaal,very thick,cyan!85!black!50] {normal(\mean,\sd)};       \path[name path=axis] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);       \addplot[cyan!\colort!red!\colorq,draw=cyan!\colors!red!\colorr,thick]   fill between[of=normaal and axis,soft clip={domain=\qqq:\pgfkeysvalueof{/pgfplots/xmax}}];       \node at (axis cs:{\mean+1.65*\sd},{.055-.003*\sd^.5-.0015*\sd^2}) [pin=45:$\alpha$] {};        \node at (axis cs:{\mean*.85},{1/(\sd*sqrt(2*pi))-.015}) [pin=135:$H_0$] {};       \node at (axis cs:{4+\mean+1.65*\sd},{.08+.055-.003*\sd^.5-.0015*\sd^2}) [rectangle,draw=blue!60,fill=cyan!10] {\ifnum\ik<75$p=\result$\else\textcolor{red}{$p=\result$}\fi};        \path[name intersections={of=line and normaal, by={interp}}];       \draw[draw=red!80!black] (axis cs:\static,0) -- (interp);     \end{axis}     \end{tikzpicture}     }     \end{animateinline}     \caption{De verdeling die hoort bij een nulhypothese en een aantal mogelijke meetresultaten (weergegeven door het pijltje) - wanneer je meetresultaat erg afwijkt van de aanname waarbij er geen effect zou plaatsvinden, is er dus waarschijnlijk kans op een effect}\label{fig:p.waarde.anim}     \end{center}     \end{figure}     \end{document}


title: Problem about double space in list of figures when using endfloat package

text: I'm writing a manuscript using `endfloat` to make all the figures at the end of the article. However, when using the code below to eliminate numbers from lists of figures, the definition `\AtBeginDelayedFloats{\renewcommand{\baselinestretch}{1.4}}` does not work:               \renewcommand*{\l@figure}[2]{%     \setlength\@tempdima{2.3em}%     \noindent\hspace*{1.5em}#1\hfil\newline }      By the way, `\renewcommand{\baselinestretch}{1.4}` works well if the above code does not exist. Any suggestion? MWE               \documentclass{article}     \usepackage[lists]{endfloat}          \AtBeginDelayedFloats{\renewcommand{\baselinestretch}{1.4}}          \makeatletter     \renewcommand*{\l@figure}[2]{%     \setlength\@tempdima{2.3em}%     \noindent\hspace*{1.5em}#1\hfil\newline }     \makeatother          \begin{document}          \section{title}     text text text text text text text text text text text text text text text   text text text text text text text text text text text          \begin{figure}[!ht]\caption{This is caption 1}\end{figure}     \begin{figure}[!ht]\caption{This is a long caption 2 This is a long caption 2 This is a long caption 2 This is a long caption 2}\end{figure}               \end{document}


title: Plotting 3D graphs in specified axial direction in tikz

text: I am a complete tikz noob and just taking snippets of examples to draw my first diagram. To get my head around orientations I am starting with the polarizing microscope example (http://www.texample.net/tikz/examples/polarizing-microscope/) I am trying to now plot a sine wave starting from the origin and extending out along the x, y and z directions. So far the x axis has been quite straight forward:               \documentclass[11pt]{article}     \usepackage{tikz}     \usetikzlibrary{arrows}     \begin{document}     \begin{tikzpicture}         [x={(0.866cm,-0.5cm)}, y={(0.866cm,0.5cm)}, z={(0cm,1cm)}, scale=1.0,         %Option for nice arrows         >=stealth, %         inner sep=0pt, outer sep=2pt,%         axis/.style={thick,->},         wave/.style={thick,color=#1,smooth},         polaroid/.style={fill=black!60!white, opacity=0.3},]              % Colors         \colorlet{darkgreen}{green!50!black}         \colorlet{lightgreen}{green!80!black}         \colorlet{darkred}{red!50!black}         \colorlet{lightred}{red!80!black}              % Frame         \coordinate (O) at (0, 0, 0);         \draw[axis] (O) -- +(14, 0,   0) node [right] {x};         \draw[axis] (O) -- +(0,  2.5, 0) node [right] {y};         \draw[axis] (O) -- +(0,  0,   2) node [above] {z};              \draw[thick,dashed] (-2,0,0) -- (O);              % Electric field vectors         \draw[wave=blue, variable=\x,samples at={0,0.25,...,10}]         plot (\x,{sin(2*\x r)},0)node[anchor=north]{$\vec{E}$};          \end{tikzpicture}     \end{document}      resulting in: ![http://i.imgur.com/W8lThM4.png](http://i.stack.imgur.com/RozRc.png) But now I have no idea how to change the 'axis' tikz chooses to draw the y and z sine wave. I have tried changing the variables but it just plots them directly over the x one.


title: Problems in Generating the Reference List with TexMaker

text: I have my `.tex` file as follows:               \documentclass[12pt]{article}     \usepackage{natbib} % for the bibliography          \begin{document}          A much longer \LaTeXe{} example was written by Gil~\cite{label1}.          \bibliographystyle{unsrt}     \newpage \bibliography{Weekly Report 10}          \end{document}      My `Weekly Report 10.bib` file is as follows:               @InProceedings{label1,     author = {author},     title = {title},     booktitle = {booktitle},     OPTcrossref = {OPTcrossref},     OPTkey = {OPTkey},     OPTpages = {OPTpages},     OPTyear = {OPTyear},     OPTeditor = {OPTeditor},     OPTvolume = {OPTvolume},     OPTnumber = {OPTnumber},     OPTseries = {OPTseries},     OPTaddress = {OPTaddress},     OPTmonth = {OPTmonth},     OPTorganization = {OPTorganization},     OPTpublisher = {OPTpublisher},     OPTnote = {OPTnote},     OPTannote = {OPTannote}     }      I have them together in one folder. I have also run PDFLaTeX first, and then BibTeX, and then PDFLaTeX twice more. However, **my reference list is always empty**. The error messages are as follows: ![enter image description here](http://i.stack.imgur.com/DjrQ5.png) Where goes wrong?


title: Hyperref: possible page numbering conflict with \alph and \roman

text: I remember reading somewhere (can't seem to find the actual page now) that in order to avoid duplicate references with `hyperref` one should switch the page numbering to an "unused" one (say, `\alph`) for unnumbered pages (eg. the title pages, copyright pages, etc.). Additionally, one usually uses roman numbers (say, `\roman`) for the front matter (eg. table of contents, list of figures/tables, introductions, etc.). It just crossed my mind that, where one to have a longish front matter, this two numberings could clash and you would still get duplicate references. For example, suppose you have 10 unnumbered pages "numbered" a through j, and suppose you have 60 pages of front matter numbered i to dx: wouldn't the "d" in the unnumbered part clash with the "d" in the front matter? is there a way to avoid this?


title: error when generating index

text: The `.ilg` file is fulll of errors, and no `\index` command is accepted.               This is makeindex, version 2.15 [TeX Live 2011] (kpathsea + Thai support).     Scanning input file thesis.idx...     !! Input index error (file = thesis.idx, line = 1):        -- Illegal page number \thepage.     ...        -- Illegal page number \thepage.     !! Input index error (file = thesis.idx, line = 28):        -- Illegal page number \thepage.     done (0 entries accepted, 28 rejected).     Nothing written in thesis.ind.     Transcript written in thesis.ilg.      There is issued `\makeindex` before document, and the `\printindex` command is redefined (and issued at the end after `\bibliography`).               \let\my@prnt@nd@x\printindex     \renewcommandx\printindex{%       \cleardoublepage%       \addcontentsline{toc}{chapter}{\indexname}%       \my@prnt@nd@x%     }      The `.idx` file has these lines (among others):               ...     \indexentry{oscila\textcommabelow tie,~ecua\textcommabelow tie}{\thepage }     \indexentry{natural~numbers}{\thepage }     \indexentry{category,!balanced~definition}{\thepage }     ...      For some reasons, in the class `.dtx`, i have redefined `\protected@write` which seems to be used by `\@wrindex`.               % \begin{macro}{\protected@write}     % \begin{macro}{\protected@write@immediate}     % \begin{macro}{\immediateaddtocontents}     % \begin{macro}{\addtocontentsline}     %    \begin{macrocode}     % redefine \protected@write to use \protected@write@immediate below     \long\def\protected@write#1#2#3{\protected@write@immediate#1{#3}[#2]}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% Code borrowed from `multitoc.dtx' CTAN /macros/latex/contrib/ms %%     %%% Copyright [1998..1999]  Martin Schr\"oder. All rights reserved. %%     % \write with appropriate handling of |\protect| and |\thepage|; args:     % an output stream, some text to write, and some initialization code.     \newcommandx*\protected@write@immediate[3][3]{%       \begingroup         \let\thepage\relax         #3%         \let\protect\string         \edef\reserved@a{\immediate\write#1{#2}}%         \reserved@a       \endgroup       \if@nobreak\ifvmode\nobreak\fi\fi%     }     %%%                                                                 %%     %%%                                                                 %%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %    \end{macrocode}     % \end{macro}     % \end{macro}     % \end{macro}     % \end{macro}      There is only a blank page after the bibilography, and usually i had all index entries in the following page, but nothing is generated; appreciate any help or fix on this. Thank s.


title: Why memoir does not respect babel when printing \thedate

text: Why does `memoir` fail to recognize language specific dates (with `\today`) outside its own `\maketitle`? It works fine when I add such metadata after `\begin{document}`, but I've never done this before (should I and if so, why?) See the following MWE               \documentclass{memoir}     \usepackage[brazil]{babel}     \title{A title}     \author{A. Uthor}     \date{\today}     \begin{document}     \maketitle          thedate: \thedate     \end{document}      ![enter image description here](http://i.stack.imgur.com/t8lSF.png) As opposed to `article` (needed to print `@date` here before `\maketitle` since it is erased afterwards):               \documentclass{article}     \usepackage[brazil]{babel}     \makeatletter     \newcommand\thedate{\@date}     \makeatother     \title{A title}     \author{A. Uthor}     \date{\today}     \begin{document}     thedate: \thedate          \maketitle     \end{document}      ![enter image description here](http://i.stack.imgur.com/op6GO.png)


title: Table of contents and renumbered pages with \setcounter{page}

text: In this document, I need all of the parts before the first chapter to be numbered with roman numerals (i, ii, iii, etc.) and afterwards with arabic numerals, starting with 1. The problem I've got is in the table of contents. The page numbering correctly starts at 1, but in the table of contents, it says the first section begins on page 4 (there are 3 pages of ToC). In other words, the page numbers in the ToC don't match those actually printed on the bottoms of the pages. (Code below)               \begin{document}     \renewcommand{\thepage}{\roman{page}}     \tableofcontents     \pagebreak     \setcounter{page}{1}     \renewcommand{\thepage}{\arabic{page}}


title: Custom Header Directory

text: On Windows Vista, I created a custom directory C:\MikTex\tex\latex\myheader for all my header files (mostly just .tex). Now I've installed Windows 7 and I can't seem to work out how I did it the last time. I'm using TexNicCenter for compiling and it always says that it can't find the files at all. I think I had to do texhash whenever I changed something in the directory back then, but now doing texhash does nothing. Any help?


title: Simple speech bubbles, arrows or balloon like shapes in beamer

text: I have to highlight the grammatical categories in a sentence like this:               There is a beautiful flower in the garden.      Now, by either using balloons or arrows, I have to highlight which word belongs to which grammatical category (e.g. verb, noun, preposition, article ...). I'm looking for a solution which is very simple and basic, as I have to use it for many more sentences in the presentation. I don't mind if it is very basic and clumsy. It is just to highlight and describe words in a sentence. The simplest and the easiest one will do for me. Edit1: All the answers to this question have been very usefull for me. A small issue I experienced was if a sentence covers two lines then there should be balloon from the bottom side of the sentence. The answer by `persusse` has a solution. But, both of those (arrow and pointer) go out of margin if they are on the left side, and also if there is a bit long text inside.


title: Long table of contents makes page numbers wrong

text: I have created a table of contents page using `\tableofcontents` and I have enough chapters and sections that it fills an entire page and goes into another. The problem is that since it takes a second page all of the page numbering is off by 1. Is there a way that I can fix that?


title: Good arguments to make other people use TeX

text: I am a high-school student on the way to my graduation. I like TeX very much, as it gives me much more satisfaction with the quality of my homework than using libre office and friends. But when I try to explain my classmates, why TeX is that great, the usually just shake their heads and say something about TeX being a "geek toy" or similar. What is a good way to show them why TeX is that great?


title: Resume option in enumitem with \includeonly

text: If I use `\includeonly` to include file `foo2.tex`, `\begin{enumerate}[resume]` does not resume the numbering of the last enumerate environment in file `foo1.tex`. What I've done is to run all parts, see what's the last item's number in `foo1.tex` and then write               \begin{enumerate}[resume]     \setcounter{enumi}{6}      in `foo2.tex`. Is there a way to do this without hardcoding the first item's number in my second, and subsequent, parts?


title: Truncation of "year" field in author-year citations using Natbib

text: I use the `natbib` package (with the default `authoryear` option) and the `apalike` bibliography style for bibliographies. I would like to cite a forthcoming paper in such a way that "forthcoming" or "to appear" is used in place of a year of publication -- both in inline citations and in the bibliography. If I use the following bibtex entry...               @Unpublished{ key,        title="Title",         author="F. Lastname",         year="to appear",         note="Manuscript under submision" }      ...then `\citep{key}` expands to `(Lastname pear)` rather than the desired `(Lastname to appear)`. Similarly, if I use "forthcoming" in the year field, `\citep{key}` expands to `(Lastname ming)`. It appears that the year field is being truncated to its last four characters. Is there a workaround for this?


title: What characters in a normal text document will screw up LaTeX?

text: I'm thinking of making a simple script to turn Project Gutenburg texts into LaTeX documents, so that they are nicely typeset and ready for reading. However to do that I'll need a fairly good list of what characters I should be handling specially. My plan is to run a sed script on it, making substitutions, then add a basic preamble at the start, end document at the end, then run LaTeX on it. It doesn't seem too hard, but given the length of most of these ebooks I'd rather not try and find all the things my script misses by hand. Here is the list I have so far:   * If I use UTF8 I should already be able to use most fancy characters without adjustment.   * `"foo"` for ```foo''`   * `'foo'` with ``foo'`   * Replacing `...` with `\ldots`   * Replacing hyphens with --- when appropriate (that could be a challenge)   * `~` with `$\sim$` What else am I missing? I know using the HTML versions would look a lot nicer, but the eBooks have lots of fancy stuff that looks really hard to convert. Also, does anyone know much about GutenMark? It seems to do the same thing as I just proposed.


title: fncychap package - vertical gap/space between text and heading too large - how to reduce?

text: The below example shows the table large gap between the top of the table of contents its section heading.   How can this gap be reduced?               \documentclass{book}          \usepackage[Bjornstrup]{fncychap}          \begin{document}     \tableofcontents      \chapter{This is an unnecessary huge gap!!?}     Here is some text in the section.     \end{document}


title: How to put the triangle arrow

text: I am looking for this symbol: > **▷** I have seen it in the _tutorials and manuals_ in menu **Help**. I think it's the code:               \lyxarrow{}      But in the example it isn't code; I can see: > • Open a new file with **File ▷ New** **Edit:** _I know i can put the triangle writing`$\triangleright$` but I'm looking for how to write using the menu. I want to see the triangle in the text directly, without input ERT._


title: memoir `\sideparfont undefined` on my Ubuntu machine but not on my Mac

text: When I run a tex file containing `\renewcommand*{\sideparfont}{\small\itshape}` on my MacBook it works perfectly but when I am running it on my Ubuntu 10.10 machine I get: `!LaTeX Error: \sideparfont undefined`. I just upgraded my Ubuntu machine to the latest version so it feels unlikely that it should be a too old version but then again maybe that is it? If so, how can I get a version where this works? (It says it is version: `pdfTex 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)`)


title: show "continued" for nested description list item on page break

text: I'm using enumitem to create a description list. These lists can sometimes be nested and can get very long. When a list item with a lot of description text breaks over a page it is difficult to tell to which item the current description belongs. In these cases, I would like to put a note at the top of the page that shows the preceding item name, "continued". Here is a MWE. I have put in the textsuperscript text manually; what I would like to do is make that happen automatically any time the list goes over a pagebreak.               \documentclass{book}     \usepackage{enumitem}          \newlist{Options}{description}{5}     \setlist[Options]{topsep=0.25em plus 0.2em minus 0.1em,             parsep=0.5\baselineskip plus .1\baselineskip minus .1\baselineskip,             itemsep=0.25em plus 0.2em minus 0.1em,             partopsep=0pt,     }     \newcommand*{\Option}[1]{%         \item[#1]\mbox{}\newline%     }          \begin{document}          \begin{Options}         \Option{first item} and explanatory text         \Option{second item} and more text%             \clearpage\textsuperscript{second item \emph{continued}}\newline%             more text describing the second item.         \end{Options}          \end{document}      Here is another case using nested options:               \begin{Options}         \Option{first item} and explanatory text         \Option{second item} and more text%             \begin{Options}                 \Option{nested option} text             \end{Options}              text that belongs to \emph{second item}\clearpage         more text about \emph{second item}          \end{Options}