title: Documents in different directories calling the same .sty files

text: Suppose I have one folder (folder name: **stys** ) where I stored the following files:   * **main.sty**   * **other.sty** The full path for the **stys** folder is:               D:\a\b\c\stys      I created one document ( **doc1.tex** ) which I stored in the following directory               D:\a\b\c\daaa      **doc1.tex** requires **main.sty** , so I used the following line of code, given their relative paths, to call it:               \usepackage{../stys/main}       So far, no problems. Then, I need **main.sty** to call **other.sty**. I would think that since **main.sty** and **other.sty** are in the same folder, the command for calling **other.sty** would be simply:               \usepackage{other}      But I quickly found that even though both **.sty** files are in the same directory the command I need is:               \usepackage{../stys/other}      because **doc1.tex** is calling **main.sty** so the "current directory" is the one where **doc1.tex** is stored. My problem arises when I start working on a new document, **doc2.tex** , which is stored in a different path:               D:\a\b\c\dbbb\e      I want to call the same **main.sty** file, which as I said before calls **other.sty** The problem is that the line of code inside **main.sty** that works for calling **other.sty** for **doc1.tex** , which was:               \usepackage{../stys/other}      does not work ( _File `../stys/other.sty' not found._ ) for **doc2.tex** because the path of **other.sty** relatively to **doc2.tex** would be:               ../../stys/other      What is the clever way to make this work without having to change the line where **other.sty** is called inside **main.sty** every time I create a new document in a different directory? (I want to have **main.sty** stored in a single location so that is easy to customize it to my needs over time). Cheers, Fabio


title: Language (hyphenation patterns) not available

text: I'm using MiKTeX 2.9 on windows7. When compiling with pdflatex, I get the following warning from Babel (which is discussed elsewhere No hyphenation patterns were loaded for the language):               Package babel Warning: No hyphenation patterns were loaded for     (babel)                the language `German'     (babel)                I will use the patterns loaded for \language=0 instead.      The suggestions elsewhere (and in the MiKTeX manual) say to use MiKTeX Options (mo.exe, I assume), to update the language. When I use mo.exe, I navigate to the language tab and click on the language I want. The response I get is: `"This language is not yet available"` ![Warning screenshot](http://i.stack.imgur.com/uREOv.jpg) _Screenshot added by Infowanna_ Above is a screenshot from my system. Languages which are not present do not have check marks in their corresponding buttons. When I click on a button - any button, I get the message box. I assume that the screenshot below (from Speravir) shows how this dialog normally functions: ![Warning screenshot](http://i.stack.imgur.com/fH4CN.png)   _Screenshot added by Speravir_ How do I make a language available? First, I attempted updating my "`language.dat`" file. But then, I noticed this gets updated (silently) whenever I update the fndb via mo.exe. The update simply overwrites any edits with an empty file. So, editing the file is pointless (and something I know I shouldn't be doing since it's under the texmf directory tree). Second, following Ulrike's suggestion in a comment below, I've reviewed the file 'languages.dat' in the miktex config directory. (The first line says "Do not edit" - there's no clue on how it gets generated, or how to edit.) The languages I want at this moment (english, german, french) do not have an 'exclude' attribute. In fact, the entries are as follows:               [english]     attributes=     ...     [french]     attributes=     ...     [german]     attributes=      all other languages have:               attributes=exclude      Does a different attribute tell mo.exe to enable the button for a language? How do I set it?


title: Using 'Letter' paper with pdflatex

text: Apparently, the LaTeX distribution and its associated classes and drivers, as well as files in one's Linux distribution can all affect the page size that is ultimately used for the output of `dvipdf`, `pdflatex`, etc. Whether one converts a `.tex` file to `.pdf` directly or through an intermediate `.dvi` and/or `.ps` file can also affect the page size of the final document. I have encountered a number of sources on the web describing this problem and potential solutions (e.g., (1), (2), (3), (4), (5), (6)). There does not appear to be a standard solution. My question is: how can I ensure that my document is being output to 'letter'-sized paper. Which parameters of which files affect the choice of paper size: document classes, device drivers, Linux-specific files, others? Which LaTeX packages influence the choice of paper size? Which parameters override other parameters if conflicting paper sizes are specified? Which parameters should be changed to alter the page size on a one-time basis? Which parameters should be changed to alter the default page size?


title: Table/Figure Layout

text: I'm interested in good practice for table (`tabular`) and `figure` layout, especially in good references. What do typographers have to say about this. Please provide references if you can. To focus the question, I'd like to ignore (La)TeX solutions to implementing a table layout because if we have 10 `table`/`figure` designs and five packages for implementing tables/figures, we may end up with 50 different solutions and we won't be able to see the wood from the trees. I'm particularly interested in guidelines/good practice for aligning data in table rows, columns, and row and column headers. Finally, I'm interested in ideas that can be used to let `table`/`figure` blend in with the rest of the text, without interrupting the rhythm of the main text. I'm aware this group is about TeX and LaTeX and some may consider the question inappropriate because it doesn't ask for specific (La)TeX solutions. Still I think the question has its merits because the answers to the questions should be known by anybody trying to implement a table.


title: Strange highlighting in LaTeX-Suite

text: I use Vim 7.3 and LaTeX-Suite 1.8.23. But every time when I use the function in LaTeX-Suite , such as `$e^^` and `amsmath<F5>`, the whole source code will be highlighted. How to fix it up? ![All be highlighted](http://i.stack.imgur.com/f1vxP.jpg)


title: Suppress top skip between own frame environment and itemize

text: I need to typset a book with a given definition of `{itemize}` and I added a `{framed}` environment by using `mdframed`. If the first line inside `{framed}` is normal text everything is fine ![normal text](http://i.stack.imgur.com/yJ5aL.png) but if it starts with an `{itemize}` environment there is some extra space I can’t delete. ![itemize](http://i.stack.imgur.com/LYibZ.png) The skip before the end of the frame is okay in both cases. If I comment out the redefinition of `{itemize}` the skips are also okay. **Code**               \documentclass{scrartcl}          \usepackage[latin1]{inputenc}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}          \makeatletter     \renewenvironment{itemize}{%         \begin{list}{\labelitemi}{%             \setlength{\itemsep}{\z@}%             \setlength{\parsep}{\z@}%             \setlength{\parindent}{1em}%             \setlength{\labelwidth}{\parindent}             \setlength{\labelsep}{0pt}             \setlength{\leftmargin}{\labelwidth+\labelsep}%             \def\makelabel##1{\rlap{\normalfont\nobreak ##1}\hss}         }%     }{%         \end{list}     }               \usepackage[framemethod=TikZ]{mdframed}     \usepackage{xparse}% doesn't work without this package ... ???     \newenvironment{framed}{%         \begin{mdframed}[%             skipabove=\baselineskip plus 2pt minus 1pt,             skipbelow=\baselineskip plus 2pt minus 1pt,             middlelinewidth=0.5pt,             splittopskip=8pt,             splitbottomskip=2pt,             innertopmargin=9.39749pt,             innerbottommargin=9.39749pt,             innerleftmargin=9.39749pt,             innerrightmargin=9.39749pt,         ]%     }{%         \end{mdframed}     }     \makeatother          \usepackage{blindtext}               \begin{document}     \blindtext     \begin{framed}         \blindtext     \end{framed}     \blindtext     \begin{framed}         \blinditemize     \end{framed}     \end{document}      I tried to compare the new definition with the one from `source2e` but I didn’t find the difference causing the extra space. I found the `\@minipagetrue` trick but that doesn’t help. **Question**   How can I tell `{itemize}` to not insert space if it starts a frame?


title: Typesetting UTF8 listings with German Umlaute

text: I'm having some issues with `listings` that include `German` Umlaute. The following example code generates a completely messed up PDF.               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[]{listings}     \begin{document}     \begin{lstlisting}[language={[LaTeX]TeX},inputencoding={utf8},extendedchars=false]     Staatsangehörigkeit     \end{lstlisting}     \end{document}      Does anyone have an idea how to fix this? ![Umlaute](http://i.stack.imgur.com/kvaIH.jpg)


title: Indenting the items in description environment

text: I have Q & A command that indents the start of the sentence, however using description environment breaks the indentation. How can I indent the description environment? ![enter image description here](http://i.stack.imgur.com/8acN9.png) This is the source code.               \documentclass{article}     \newcounter{question}     \setcounter{question}{0}          \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}     \newcommand{\Hrule}{\rule{\linewidth}{0.3mm}}          \makeatletter% since there's an at-sign (@) in the command name     \renewcommand{\@maketitle}{%       \parindent=0pt% don't indent paragraphs in the title block       \centering       {\Large \bfseries\textsc{\@title}}       \HRule\par%       \textit{\@author \hfill \@date}       \par     }     \makeatother% resets the meaning of the at-sign (@)          \newcommand\Que[1]{%        \leavevmode\par        \stepcounter{question}        \noindent        Q\thequestion: \textit{#1}\par}          \newcommand\Ans[2][]{%         \leavevmode\par\noindent        {\leftskip10pt         A: \textbf{#1} #2\par}}          \title{Title}     \author{A and B}          \begin{document}     \maketitle          %\section{MapReduce}     \Que{Q}     \Ans{     A     \begin{description}     \item[X] Y     \end{description}     }          \end{document}


title: Next subsequent letter in the alphabet

text: Getting the next letter of the alphabet is no problem in most programming languages I know. However, in LaTeX, it doesn't seem to be that trivial. I have looked at how to make 26 macros (here at stackoverflow) but that question and its answers does not involve manipulations of the underlying unicode or something like that. It is fine if the boundary case (e.g. the lowercase “z”) is not handled at all. I was thinking myself of something like the following:               \mydefalphabet abcdefghijklmnopqrstuvwxyz \mydefalphabet     \mydefalphabetshifted bcdefghijklmnopqrstuvwxyza \mydefalphabetshifted      Can I return in this case the symbol at the shifted range when given the nonshifted range perhaps? The envisioned command would be:               \newcommand\nextletter[1]{      }      And used as `$\nextletter{i}$` in math mode. I can then use `$\robotindex$` (equal to `i`) and `$\other{\robotindex}$` in my formulas (with `other` equivalent to `nextletter`).


title: How do I get a equals sign under letters?

text: To show that a letter is a matrix my math book puts a equals sign under the letter. How do I do this?


title: Fancyhdr vertical overlap with body section title

text: I am writing up a product report, and building my header with fancyhdr. On the first page, the section header (in the body) is overlapping with the page header, as shown here: ![Overlapping header and text body](http://i.stack.imgur.com/fNtwZ.png) This is not repeated on following pages: ![Non-overlapping body text](http://i.stack.imgur.com/HJgYM.png) The header is specified as a 2-line table in the left side, and a 3-line table in the right side. How can I remove the overlap with the section title? Thanks!


title: Missing $ inserted issue

text: Trying to get my dissertaion sorted (due in a few hours) and I keep getting this error:               ! Missing $ inserted.     <inserted text>                      $     l.190 ... pp. 225--236, 10.1007/978-0-387-68772-8_                                                       18. [Online].     ?       Really struggling to sort it out. I'm fairly new to LaTeX. Edit: This is 189-204 of the bibtex               @inproceedings{davis,      author = {Davis, Alan and Dieste, Oscar and Hickey, Ann and Juristo, Natalia and Moreno, Ana M.},      title = {Effectiveness of Requirements Elicitation Techniques: Empirical Results Derived from a Systematic Review},      booktitle = {Proceedings of the 14th IEEE International Requirements Engineering Conference},      series = {RE '06},      year = {2006},      isbn = {0-7695-2555-5},      pages = {176--185},      numpages = {10},      url = {http://dx.doi.org/10.1109/RE.2006.17},      doi = {10.1109/RE.2006.17},      acmid = {1174006},      publisher = {IEEE Computer Society},      address = {Washington, DC, USA},      keywords = {Systematic review, software engineering, elicitation techniques, empirical studies},     }       Please help!


title: Create new counter and give it a specific value

text: Consider the following:               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage{fancyhdr}     \usepackage{caption}     \usepackage{subcaption}     \usepackage{expl3}     \usepackage{pst-eucl}     \usepackage{hyperref}               \ExplSyntaxOn       \cs_new_eq:NN \calculate \fp_eval:n     \ExplSyntaxOff               \def\hoejde{\calculate{3*\figurnummer}}     \def\bredde{\calculate{2*\figurnummer}}     \def\areal{\calculate{3*\figurnummer^2}}     \def\faktorA{\calculate{\hoejde+1}}     \def\faktorB{\calculate{\bredde+1}}     \def\faktorC{\calculate{\hoejde-1}}     \def\faktorD{\calculate{\figurnummer-1}}     \def\skalering{\calculate{1.9/\figurnummer}}          \def\betegn#1#2#3{%       \rput(!#1 4 div \figurnummer mul #2 4 div \figurnummer mul){\small{$#3$}}     }          \def\figur#1{%     \begin{figure}[htbp]     \def\figurnummer{#1 }     \centering     \psset{unit=\skalering}     \begin{subfigure}{0.56\textwidth}     \centering       \begin{pspicture}(0,0)(\bredde,\hoejde)         \pnodes{P}(\figurnummer,0)(0,\bredde)(\figurnummer,\hoejde)(\bredde,\bredde)         \betegn{3}{7}{A}         \betegn{3}{9}{B}         \betegn{5}{9}{C}         \betegn{5}{7}{D}       {\psset{linestyle=dashed,linecolor=blue}         \multido{\iA=0+1}{\faktorA}{\psline(0,\iA)(\bredde,\iA)}         \multido{\iB=0+1}{\faktorB}{\psline(\iB,0)(\iB,\hoejde)}}        \psset{linewidth=1pt}         \psline(P0)(P2)         \psline(P1)(P3)         \pspolygon[linejoin=2,linecolor=red](P0)(P1)(P2)(P3)       \end{pspicture}      \subcaption{Before.}     \end{subfigure}     \begin{subfigure}{0.40\textwidth}     \centering       \begin{pspicture}(0,0)(\figurnummer,\hoejde)         \pnodes{P}(0,0)(0,\bredde)(0,\hoejde)(\figurnummer,\hoejde)(\figurnummer,\bredde)(\figurnummer,0)         \betegn{3}{7}{A}         \betegn{3}{9}{B}         \betegn{1}{11}{C}         \betegn{1}{1}{D}       {\psset{linestyle=dashed,linecolor=blue}         \multido{\iC=1+1}{\faktorC}{\psline(0,\iC)(\figurnummer,\iC)}         \multido{\iD=1+1}{\faktorD}{\psline(\iD,0)(\iD,\hoejde)}}        \psset{linewidth=1pt}         \psline(P1)(P4)         \psframe(P0)(P3)         \psline[linejoin=1,linecolor=red](P5)(P1)(P3)       \end{pspicture}      \subcaption{After.}     \end{subfigure}     \caption{Figure number~$\figurnummer$ with area~$A_{\figurnummer} = \areal$.}     \end{figure}     \vspace{6ex}     }          \cfoot{\thepage}               \begin{document}          \pagenumbering{roman}     \pagestyle{plain}     \tableofcontents     \newpage          \pagenumbering{arabic}          Test.     \newpage          \section{Appendix}     \label{appendix}     \def\sider{3}     See the figures on \autopageref{appendix}--[the value of $\texttt{\textbackslash pageref\{appendix\}} + \texttt{\textbackslash sider} - 1$].          % Figurerne.     \multido{\iE=1+2,\iF=1+1}{\sider}{%       \multido{\iG=\iE+1}{2}{\figur{\iG}}       \newpage     }          \end{document}      How do I create a counter with the value of               \pageref{appendix} + \sider - 1      ? The point is that this value is equal to the page number on the last page.


title: Why is the left bracket [ darker than the right bracket ] in equations?

text: I was writing up some formulas with concentrations on Chemistry.SE, and the left brace is noticeably darker than the right brace. I replaced them with `\lvert` and `\rvert`, but it is harder to write. is there a reason for this? Example:               $$ K_{eq} = \frac{[\ce{NO}][\ce{O2}]}{[\ce{NO2}]^2} $$      Here's a link to the question on Chemistry.SE, where you can see the bracing difference, and my answer below where I substituted `\lvert` and `\rvert`.


title: Less hyphenations - any value to change?

text: I don't want to prevent LaTeX from hyphenating - unfortunately I write in a language, which consists of rather long words. That results in quite a lot of hyphenations, not to mention that I have to deal with plenty of them manually. Albeit I use babel package. My guess is LaTeX operates with a certain value, which says how many percent of line can be blank/without characters. It probably takes into consideration all lines in the paragraph or on the page. Am I correct? Any way to change such parameter? Or should I rather make the text block wider? That could help?


title: Creating an error message

text: Is there a way to create my own error message that is given if the main font size isn't set to 11pt and then the compilation of the document begin stopped? * * * ## Update I'm trying to write a package, and I use:               \documentclass{scrreprt}%or scrbook or scrartcl          \usepackage{classicthesis}


title: How to add a second e-mail address with moderncv

text: I'm using `moderncv` to write my CV. I'm using the `classic` style and I want to add a second e-mail address. It doesn't work if I simply do that:               \mail{email1}          \mail{email2}      Is there a way to do it?


title: How to remove footline on the title page of beamer slides

text: I am using the default theme, and use the following to customize the footline,               \useoutertheme{infolines}     \setbeamertemplate{footline}{\hspace*{.5cm}\scriptsize{\insertshorttitle     \hspace*{50pt} \hfill\insertframenumber\hspace*{.5cm}}\\     \vspace{9pt}}       I don't like it also appears on the title page. Is there a simple way not to show it on the first page?


title: What is a good way to write exponentials within paragraph?

text: I want write a paragraph that has an exponential term in it, like `the complexity is on the order of 10^5'. This exponential changes the spacing between the lines of the paragraph. I have seen in some textbooks that they make the size of the base smaller so that it blends in the paragraph. I wanted to ask what is a good way to have exponential terms in a paragraph in LaTeX without changing the format of the paragraph. The code can be found here -- the required style file spconf is here (http://www.ieee.ca/ccece09/templates/spconf.sty):               \documentclass[pdftex]{article}     \usepackage{spconf}     \usepackage{amsmath,amsthm,amssymb,mathtools}     \usepackage{subdepth}          \begin{document}          \ninept          \title{Example code}      \name{}     \address{}          \maketitle          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque egestas     posuere eros at feugiat. Morbi adipiscing tempus arcu, et suscipit purus laoreet     eget. Maecenas pulvinar faucibus leo eget feugiat. Pellentesque aliquet placerat     dui id mollis. Etiam convallis tristique tortor, in tempus leo $10^5$ accumsan     sed. Pellentesque interdum metus eu orci convallis mattis. Nunc accumsan     lobortis mi vitae blandit. Integer rhoncus eros dui, ut vestibulum justo ornare     ut. Suspendisse id enim lacus. Proin non blandit neque. Donec lacinia, ipsum     quis vestibulum pulvinar, metus nibh laoreet ante, in semper ligula mi porttitor     purus. Curabitur tempus, leo 10\textsuperscript{5} et cursus congue, tellus     felis ornare neque, ac sagittis tortor leo sit amet sapien. Praesent diam felis,     rhoncus ut eros eget, placerat scelerisque tellus. Quisque elementum turpis non     massa lacinia, condimentum malesuada nisl tincidunt.          \end{document}      ![enter image description here](http://i.stack.imgur.com/u19rY.png)


title: Using Figures with chemscheme/chemstyle

text: I use the chemstyle package to automatically number my chemical compounds inside the 'scheme' environment. Is there a way to use adapt/hack this feature for Figures? I'm aware you can, for a single float, change the 'Scheme' part of the caption to 'Figure', but this is very bad because it will still use the Scheme counter, and therefore the Figure # will clash with another Figure. Basically I want to use the compound referencing functions inside a Figure environment, or make the scheme environment use "Figure X" in the caption, where X is an incrementation of the Figure counter rather than the Scheme counter.


title: Add white page after table of contents before abstract

text: How can I add a white pages after the table of contents in order to have the abstract on a right page? If I add               \clearpage     \newpage      I cannot get the white page added. Ideas?


title: Shrinking monospace style for listings package

text: I am working on a thesis and putting together a "pretty" listing. I'm looking at setting up a small font style for a code view. What I have here is:               \usepackage{listings}     \lstset{language=C,     numberstyle=\footnotesize,     basicstyle=\footnotesize,     numbers=left,     stepnumber=1,     frame=shadowbox,     breaklines=true}     %\usepackage[subsection]{placeins}     \usepackage{float}      But this comes out in a typical kerned font, vs. I am looking for smaller monospace, say, 10 points or so.


title: Subscript sizing of text in math formulas

text: I am using Plain TeX, not LaTeX. Right now, I have               \def\text#1{\hbox{#1}}      This works for things like               $$A + \text{foo bar}$$.      However, not for things like:               $$\Sum_{ \text{foo} = a}$$.      How do I fix this? In particular, I want `\text` to somehow take into account the size of the current math font.


title: Pop-up effect in beamer?

text: The elements in a beamer presentation are all neatly laid out so that they do not overlap each other. Is there a way, e.g. an overlay-specification, that allows to have a box or note or speech-bubble occurring that is positioned over the other elements of the slide? (Maybe similar to a tool-tip)


title: Color gradient as background in margins

text: Currently I am using an external PDF image to get a color gradient provide in the margins. See the output below. I achieve this by using command `\ULCornerWallPaper{1}{./pictures/wallpaper_1.pdf}` However, this method is very inefficient because importing the external picture every time results in a long compilation time. Is there a better way of doing it? The gradient is only applied to some of the pages so it would be ideal if you provided me with a solution which I can include in `\ULCornerWallPaper{1}{}` so I can undo gradient after a while using command `\ClearWallPaper`. Could I achieve this using `tikz`? I'm not very familiar with it, but it looks like a possible tool for solving my problem. ![two muppets](http://shrani.si/f/3D/7Y/4tK5ZuOV/gradient.png)


title: Getting undefined control sequence even the command is defined

text: I want to add a command to `pgfgantt` package that draw vertical line at a specified date (like the one for the today line). Here's what' I want to get (green line) : ![enter image description here](http://i.stack.imgur.com/DsENJ.png) So I looked to `pgfgantt.sty` to see how the today line was drawn and I came with this code that I added into `pgfgantt.sty` file :               \newcommand\drawverticalline[1]{%      \begingroup%       \begin{pgfinterruptboundingbox}%        \begin{scope}         \gtt@tsstojulian{#2}{\gtt@today@slot}         \gtt@juliantotimeslot{\gtt@today@slot}{\gtt@today@slot}%          \pgfmathsetmacro\x@mid{%            (\gtt@today@slot - 1 + \ganttvalueof{today offset})%                       * \ganttvalueof{x unit}%          }%          \draw [/pgfgantt/today rule]                     (\x@mid pt, \y@upper pt) -- (\x@mid pt, \y@lower pt)                     node [/pgfgantt/today label node] {\ganttvalueof{today label}};%          \end{scope}         \end{pgfinterruptboundingbox}%         \endgroup%     }        Now normally I could use the command like this : `\drawverticalline{2014-05-07}` but when I do this I got this error :               ! Package PGF Math Error: Unknown function `pt' (in 'pt').      The error came from this code :               \pgfmathsetmacro\x@mid{%            (\gtt@today@slot - 1 + \ganttvalueof{today offset})%                       * \ganttvalueof{x unit}%          }%      that doesn't have `pt` on it. So I decided to comment it and replace `\x@mid` by a constant (5) but now I get this error :               ! Undefined control sequence.      Why I get this error? the command is defined! Here's the code from `pgfgantt` that draw the today line :               \def\@tempa{none}%     \edef\@tempb{\ganttvalueof{today}}%     \ifx\@tempa\@tempb\else%       \pgfmathsetmacro\x@mid{%         (\gtt@today@slot - 1 + \ganttvalueof{today offset})%         * \ganttvalueof{x unit}%       }%       \draw [/pgfgantt/today rule]         (\x@mid pt, \y@upper pt) -- (\x@mid pt, \y@lower pt)         node [/pgfgantt/today label node] {\ganttvalueof{today label}};%     \fi%        **MWE**               \documentclass{article}     \usepackage[frenchb]{babel}       \usepackage{pgfgantt}     \usetikzlibrary{shadows}          \begin{document}     \begin{tikzpicture} % optional        \begin{ganttchart}[x unit=1.8mm,                        y unit chart=0.87cm,                        time slot format=isodate,                        vgrid=*{5}{dotted},                      ]                       {2014-04-14}{2014-07-11}            \gantttitlecalendar{month=name} \\                  \ganttbar[progress=100]{title1}{2014-04-14}{2014-04-15} \\                 \ganttbar[progress=100]{title2}{2014-04-15}{2014-04-17} \\                 \drawverticalline{2014-05-07}        \end{ganttchart}     \end{tikzpicture}     \end{document}


title: Is there such a thing as a LaTeX code formatter

text: I was looking for this a while back for JavaScript, but I was wondering a general purpose one exists for all, or most languages. For example for LaTeX I would put the following in a text box               $f_i^k+10=x$      and it spits out the better formatted version               %%%     %% Insert comment describing function here     %%%     $ f_{i}^{k} + 10 = x $      I can't be the only person on the planet that does not wish to go through a massive .tex file and fix these tedious problems.


title: Non-slanted vector sign for numbers

text: I recently begun to worry about using `\vec` on numbers. The arrow is both off-center and slanted, which only works for italics. Is there a simple command to typeset number vectors properly?               $\vec{x}$ % ok     $\vec{0}$ % not ok      ![example](http://i.stack.imgur.com/4ksRo.png)


title: How to make landscape mode rotate in a twoside book both for pdfviewer and printer?

text: I wanted the even pages' text, to face outwards, to be easy to read the text/table. I combined two different approaches that made the desired result happen for the pdf viewer. But when I print the pages, they are printed upside down. Is there any applicable solution to my problem? Thank you Source 1: http://stackoverflow.com/questions/4982219/how-to-make-landscape- mode-rotate-properly-in-a-twoside-book/5320962#5320962 Source 2: Problem with rotated pages (pdflscape package) and double-sided printing               \documentclass[twoside]{book}     \usepackage[a4paper, inner=4cm, outer=2cm]{geometry}     \usepackage{pdflscape,lipsum}     \usepackage{fancyhdr}          % Source 1: http://stackoverflow.com/questions/4982219/how-to-make-landscape-mode-rotate-properly-in-a-twoside-book/5320962#5320962     % Source 2: http://tex.stackexchange.com/questions/45278/problem-with-rotated-pages-pdflscape-package-and-double-sided-printing/45279#45279          \makeatletter     \global\let\orig@begin@landscape=\landscape%     \global\let\orig@end@landscape=\endlandscape%     \gdef\@true{1}     \gdef\@false{0}     \gdef\landscape{%         \global\let\within@landscape=\@true%         \orig@begin@landscape%     }%     \gdef\endlandscape{%         \orig@end@landscape%         \global\let\within@landscape=\@false%     }%     \@ifpackageloaded{pdflscape}{%         \gdef\pdf@landscape@rotate{\PLS@Rotate}%         \def\myrotate{\ifodd\c@page\else-\fi 90}         \g@addto@macro{\landscape}{\PLS@Rotate{\myrotate}}     }{         \gdef\pdf@landscape@rotate#1{}%     }     \let\latex@outputpage\@outputpage     \def\@outputpage{         \ifx\within@landscape\@true%             \if@twoside%                 \ifodd\c@page%                     \gdef\LS@rot{\setbox\@outputbox\vbox{%                         \pdf@landscape@rotate{270}%                         \hbox{\rotatebox{270}{\box\@outputbox}}                         }%                     }%                 \else%                     \gdef\LS@rot{\setbox\@outputbox\vbox{%                         \pdf@landscape@rotate{90}%                         \hbox{\rotatebox{90}{\box\@outputbox}}                         }%                     }%                 \fi%             \else%                 \gdef\LS@rot{\setbox\@outputbox\vbox{%                     \pdf@landscape@rotate{+90}%                     \hbox{\rotatebox{90}{\box\@outputbox}}                     }%                 }%             \fi%         \fi%         \latex@outputpage%     }     \makeatother               \begin{document}         \chapter{Chapter 1}         \lipsum[1-3]              \begin{landscape}             \lipsum[1-3]         \end{landscape}              \begin{landscape}             \lipsum[1-3]         \end{landscape}              \lipsum[6]          \end{document}


title: Compile a file when images are missing/not available

text: I don't have access to my image files so I want to only compile with the text. I figured using `draft` mode would solve this problem but I still get a "cannot find image file" error. How can I compile without having to copy some random picture I _do_ have. Here is my header               \newcommand{\rootFolder}{/home/pa06r/pa06r-thesis}          \documentclass{\rootFolder/latex_templates/tex/latex/ecsdocs/ecsthesis}                \graphicspath{{\rootFolder/images/}}  % Location of your graphics files          \usepackage[demo]{graphicx}     %Use for graphics          \usepackage{subfigure}      %Use for side-by-side figures          \usepackage{float}      % Use for floating figuress          \usepackage[round]{natbib}      % Use Natbib style for the refs.          \usepackage{multirow}       %Use for multirow tables          \usepackage{rotating}       %Use for rotating tables          \usepackage{colortbl}       %Use for coloring table backgrounds          \usepackage{algorithmic}    %Use for algorithms          \usepackage{algorithm}      %Use for algorithm labels          \usepackage{ulem}       %Use for strikethroughs          \usepackage{listings}       %Use for Pseudocode          \usepackage{color}      %package listings needs this          \usepackage{textcomp}       %Used for tilde character          \hypersetup{colorlinks=true}    %Set to false for black/white printing          \usepackage{lscape}     %For rotating pages with long images      * * * Minimal example as per Joseph Wrights request. I created a `.tex`file with the following               \RequirePackage[demo]{graphicx}     \documentclass{article}     \begin{document}     \includegraphics{'img.jpg'}     \end{document}      Here is the log file               This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=pdflatex 2010.5.13)  5 OCT 2011 22:08     entering extended mode     **test.tex     (./test.tex     LaTeX2e <2003/12/01>     Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b     ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e     stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis     h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur     kish, ukrainian, nohyphenation, loaded.     (/usr/share/texmf/tex/latex/graphics/graphicx.sty     Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)          (/usr/share/texmf/tex/latex/graphics/keyval.sty     Package: keyval 1999/03/16 v1.13 key=value parser (DPC)     \KV@toks@=\toks14     )     (/usr/share/texmf/tex/latex/graphics/graphics.sty     Package: graphics 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR)          (/usr/share/texmf/tex/latex/graphics/trig.sty     Package: trig 1999/03/16 v1.09 sin cos tan (DPC)     )     (/usr/share/texmf/tex/latex/graphics/graphics.cfg     File: graphics.cfg 2005/02/03 v1.3 graphics configuration of teTeX/TeXLive     )          ! LaTeX Error: Unknown option `demo' for package `graphics'.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.72 \if             !\Gin@driver!     ?      Package graphics Info: Driver file: pdftex.def on input line 80.     (/usr/share/texmf/tex/latex/graphics/pdftex.def     File: pdftex.def 2002/06/19 v0.03k graphics/color for pdftex     \Gread@gobject=\count79     ))     \Gin@req@height=\dimen102     \Gin@req@width=\dimen103     )     (/usr/share/texmf/tex/latex/base/article.cls     Document Class: article 2004/02/16 v1.4f Standard LaTeX document class     (/usr/share/texmf/tex/latex/base/size10.clo     File: size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)     )     \c@part=\count80     \c@section=\count81     \c@subsection=\count82     \c@subsubsection=\count83     \c@paragraph=\count84     \c@subparagraph=\count85     \c@figure=\count86     \c@table=\count87     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen104     )     No file test.aux.     \openout1 = `test.aux'.          LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.     LaTeX Font Info:    ... okay on input line 3.     (/usr/share/texmf/tex/context/base/supp-pdf.tex     (/usr/share/texmf/tex/context/base/supp-mis.tex     loading : Context Support Macros / Miscellaneous (2004.10.26)     \protectiondepth=\count88     \scratchcounter=\count89     \scratchtoks=\toks15     \scratchdimen=\dimen105     \scratchskip=\skip43     \scratchmuskip=\muskip10     \scratchbox=\box26     \scratchread=\read1     \scratchwrite=\write3     \zeropoint=\dimen106     \onepoint=\dimen107     \onebasepoint=\dimen108     \minusone=\count90     \thousandpoint=\dimen109     \onerealpoint=\dimen110     \emptytoks=\toks16     \nextbox=\box27     \nextdepth=\dimen111     \everyline=\toks17     \!!counta=\count91     \!!countb=\count92     \recursecounter=\count93     )     loading : Context Support Macros / PDF (2004.03.26)     \nofMPsegments=\count94     \nofMParguments=\count95     \MPscratchCnt=\count96     \MPscratchDim=\dimen112     \MPnumerator=\count97     \everyMPtoPDFconversion=\toks18     )          LaTeX Warning: File `'img.jpg'' not found on input line 4.               ! LaTeX Error: Unknown graphics extension: .jpg'.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.4 \includegraphics{'img.jpg'}          ?      (./test.aux) )      Here is how much of TeX's memory you used:      868 strings out of 94500      10335 string characters out of 1176766      56775 words of memory out of 1000000      4098 multiletter control sequences out of 10000+50000      3640 words of font info for 14 fonts, out of 500000 for 2000      580 hyphenation exceptions out of 1000      25i,1n,19p,220b,36s stack positions out of 1500i,500n,5000p,200000b,5000s     PDF statistics:      0 PDF objects out of 300000      0 named destinations out of 131072      1 words of extra memory for PDF output out of 65536          No pages of output.


title: How to resize Feynman diagrams drawn with FeynMF / FeynMP (and their labels)?

text: This seems like an easy question, but I haven't found any hints on this, so: How do I resize the output of `FeynMF` and the labels within it? I use it like this:               \begin{enumerate}       \item Feynman diagram:\\         \begin{fmffile}{fgraph_tau}           \begin{fmfgraph*}(8,5)             \fmfleft{i1,i0}             \fmfright{o1,o0}             \fmf{fermion,label=$e^+$}{i1,w1}             \fmf{fermion,label=$\overline\nu_e$}{w1,o1}             \fmf{boson,label=$W$}{w0,w1}             \fmf{fermion,label=$\overline\nu_\mu$}{i0,w0}             \fmf{fermion,label=$\mu^+$}{w0,o0}           \end{fmfgraph*}         \end{fmffile}       ...     \end{enumerate}      and compile using this SE answer, which gives a nice Feynman diagram in the output pdf in the place I'd like it to be. Now I would like to have a) the labels a bit larger and b) the overall graph itself a bit smaller. How can I achieve this?


title: How to adjust tableofcontents?

text: How Can I adjust \tableofcontents in this way ? ![enter image description here](http://i.stack.imgur.com/CscFQ.png)               \documentclass[12pt,a4paper,x11names]{article}     \usepackage[spanish]{babel}     \usepackage{lipsum}     \usepackage{blindtext}          \begin{document}          \tableofcontents     \newpage     Here stars the document... after the index\\     \part{Part I One}     \blindtext     \section{Section A of I}     \blindtext     \subsection{Subesction Jei}     \blindtext     \subsection{Subesction Jeii}     \blindtext     \section{Section B of I}     \blindtext     \subsection{Subesction Jeiii}     \blindtext     \subsection{Subesction Jeiiiii}     \blindtext     \section{Section C of I}     \blindtext     \subsection{Subesction Jeei}     \blindtext     \subsection{Subesction Jeeei}     \blindtext     \part{Part II Two}     \blindtext     \subsection{Subesction Jeeeei}     \blindtext     \section{Section A of II}     \blindtext     \subsection{Subesction Jerr}     \blindtext     \subsection{Subesction Jeddd}     \blindtext     \section{Section B of II}     \blindtext     \subsection{Subesction Jesss}     \part{Part III Three}     \blindtext     \section{Section A of III}     \subsection{Subesction Jerr}     \section{Section B of III}     \blindtext     \subsection{Subesction Jer}     \part{Part IV Four}     \section{Section A of IV}     \blindtext     \subsection{Subesction Jeittiii}     \blindtext\subsection{Subesction Jeiit}     \blindtext     \end{document}


title: Correctly skipping pages for page numbering

text: I have a book I'm laying out in pdflatex. The page numbers are on the outer corners of the pages (along with some other header and footer stuff.) Occasionally, the document has a full-page image inserted like a plate, where that page has no style at all, just the image. The catch is that these pages also shouldn't be counted for page numbers, so that you get page 54 page with image page 55 I've got it skipping the page for page numbering purposes, but it doesn't skip the page for determining whether it's a right or left handed page, which means that after an image page the page numbers seem to jump from the outer corners to the inner corners. The code I'm using is this:               %end of page 54          \newpage     \thispagestyle{empty}     %insert image     \newpage     \setcounter{page}{55}          %begin page 55 content      (with the details of inserting the page hand-waved away since each image is a slightly different size and needs unique handling.) (And the outer margin is close enough to the gutter margin that I can't tell if the margins are correctly flip-flopping as well, but I _think_ they are.) So, how do I tell TeX to keep the page numbers in the right place after skipping a page?


title: Showing what pages citations appear using the harvard style file

text: I am using the `harvard` package from CTAN to typeset my document. E.g.,               \documentclass{book}     \usepackage{harvard}     \begin{document}     ...     \bibliographystyle{apsr}     \bibliography{mybib}     \end{document}      How can I add information about what pages my citation appear. Can I do this while using `apsr`relatively easily?


title: How to center the whole tabular, center the header line cells, and have some space after it?

text: I have a few questions about tables that are probably pretty basic. Here is the code for my table.               \begin{table}       \begin{tabular}{| r | l | l |}         \hline         \textbf{Species} & \textbf{Abbrev.} & \textbf{Common Name} \\ \hline         \textit{Arabidopsis thaliana} & At & Thale cress \\         \textit{Oryza sativa} & Os & Rice \\         \textit{Brachypodium distachyon} & Bd & Purple false brome \\         \textit{Glycine max} & Gm & Soybean \\         \textit{Vitis vinifera} & Vv & Grape \\         \textit{Sorghum bicolor} & Sb & Sorghum \\         \textit{Medicago truncatula} & Mt & Barrel clover \\         \textit{Zea mays} & Zm & Maize \\ \hline       \end{tabular}       \caption{This study presents a comprehensive analysis of the intron distribution in these 8 model plant species.}     \end{table}      Here are my questions.   1. How can I change the alignment of the first row of headers (center) without affecting the alignment of the subsequent rows?   2. How can I add space between the bottom of the table and the caption? The caption text is right up against the bottom of the table.   3. How can I horizontally center this table in the available space? I tried the `\begin{center}` environment but that did not work.


title: Use unicode font for cyrillic in gnuplot

text: Why I need to do this? I'n writting my diploma in laTeX and almost finish them, but I want to use in graph labels and legend the same font that LateX uses. As I know, the default LaTeX font in CM, so I opened example font from /usr/share/texmf/fonts/type1/public/cm-super and /usr/share/texmf/fonts/type1/public/cm-unicode in font viewer and expect that they support cyrillic. Next, according to http://gnuplot.sourceforge.net/demo_4.0/fontfile.html, I changed my gnuplot script:               set encoding utf8     set terminal postscript eps enhanced size 8in,5.4in fontfile "./sfci0900.pfb" "SFCI0900" 30          set output "./graph_new_font.eps"          set xlabel "{/SFCI0900 z/L_d}"     set xrange [0:0.1]     set ylabel "{/SFCI0900 Пиковая интенсивность}"     set yrange [0:10]      I view the produced EPS with Evince, but only "z/L_d" font have changed, but ylabel is empty. :( IDIW?


title: A letter in the same space as another

text: I have, in different overlying slides in a Beamer presentation, the letter y, in equation mode, being changed by \alert{z}. To create the overly I am using `\only<1>{}` and `\only<2>{}`, so that the only change is that letter being changed. It seems to be that the two letters take different space and then the rest of the equation moves around when one passes from one slide to the other. How to solve this?


title: Cancellation in fractions

text: This came up in Math.SE. Is there any way to produce a single cancellation across two fractions, like this? ![enter image description here](http://i.stack.imgur.com/uHvZ8.jpg) Ideally, it should be MathJax compatible, since that's what we use over there. Unfortunately, MathJax doesn't support the `cancel` package.


title: How can I insert Sweave code inside a Beamer block?

text: I'm currently trying to automate a report-generating routine in R, and I imagine the best way to try this is through Sweave and beamerposter. The report should have one page with several sections in it, so I'm using one `frame` with several `block` environments inside it. The problem I'm having is with inserting Sweave-generated figures inside those blocks (or any Sweave code, for that matter). For example, this yields an error:               \documentclass{beamer}     \begin{document}     \SweaveOpts{concordance=TRUE}       \begin{frame}         \begin{block}{Title}         <<>>=         1 + 1         @         \end{block}       \end{frame}     \end{document}      From what I've read, `block` environments are supposed to contain only text, but I can't imagine another way to structure my report that would match my client's expectations (he want it to look as much as possible as their current Excel-generate report). So my primary question is: how can I insert Sweave code inside a `block` environment?


title: Where is this whitespace coming from in align*?

text: I am trying to align 2 simple equations using the `align*` environment:               \begin{align*}     \phi(\gedge{\tilde{v}_{i_1}}{\tilde{u}_i}) & = \phi(\gedge{\tilde{v}_{i_2}}{\tilde{u}_i}) & = \gedge{v}{u} \\     \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_1}}) & = \phi(\gedge{\tilde{u}_i}{\tilde{v}_{i_2}}) & = \gedge{u}{v} & \qquad\mathrm{(z\,wl.\,2)}\\     \end{align*}      unfortunately the result I am getting is horrible: ![enter image description here](http://i.stack.imgur.com/2zQDr.png) Why is there so much horizontal space before the second `=` sign?!? Do not worry about `\gedge`, it is just an arrow:               % graph edge     \newcommand{\gedge}[2]{%     #1 \to #2%     }%


title: TikZ: scaling the tikz picture environment

text: If I scale the TikZ picture environment, everything should scale by a factor of `x` correct? If that is the case, why would some code not scale or scale incorrectly when it is in the environment? For instance,                \begin{tikzpicture}[scale = 3]        code      \end{tikzpicture}      The reason I ask is some code that Qrrbrbirlbel helped with doesn't scale when I enter the scaled value as an environment option. When I scale the picture, I receive the following error:               ERROR: Package pgf Error: No shape named F'-2 is known.          --- TeX said ---          See the pgf package documentation for explanation.     Type  H <return>  for immediate help.      ...          l.62       }                                          %!?     --- HELP ---     From the .log file...      * * * Here is the code:               \documentclass[convert = false]{standalone}          \usepackage{tikz}     \usetikzlibrary{calc, intersections}          \begin{document}     \tikzset{circle with radius/.style = {shape = circle, inner sep = 0pt,           outer sep = 0pt, minimum size = {2 * (#1)}}}       \begin{tikzpicture}[scale = .5         ]       \coordinate (O) at (0, 0);            \pgfmathsetmacro{\as}{3}       \pgfmathsetmacro{\bs}{2.25}       \pgfmathsetmacro{\c}{sqrt(\as^2 - \bs^2)}       \pgfmathsetmacro{\al}{3.75}       \pgfmathsetmacro{\bl}{2.9}       \pgfmathsetmacro{\cl}{sqrt(\al^2 - \bl^2)}       \pgfmathsetmacro{\xs}{abs(\c - \cl)}            \coordinate (O) at (0, 0);            \coordinate (F) at (\c, 0) {};            \path[name path global = line1] (\c, 0) -- ++(60:{\as} and \bs);       \path[name path global = line2] (\c, 0) -- ++(150:6cm);              \draw[name path global = ell1] (O) ellipse         (\as cm and \bs cm);              \draw[name path global = ell2] (-\xs, 0)         ellipse (\al cm and \bl cm);            \path[name intersections = {of = line1 and ell1, by = P1}];       \coordinate (A) at (P1) {};            \path[name intersections = {of = line2 and ell2, by = P2}];       \coordinate (B) at (P2) {};       \begin{scope}[declare function = {doubleA = 5.8cm;}]         \clip ($(A.center) + (1, 0)$) rectangle ($(B.center) + (0, 1)$);         \begin{pgfinterruptboundingbox}           \path let           \p1 = ($(A) - (F)$),           \p2 = ($(B) - (F)$),           \n1 = {veclen(\x1, \y1)},           \n2 = {veclen(\x2, \y2)}           in           (A) node[name path global = aCircle, circle with radius = doubleA-\n1]           {}           (B) node[name path global = bCircle, circle with radius = doubleA-\n2]           {}           (F) node[name path global = fCircle,           circle with radius = .5 * doubleA] {};                \tikzset{name intersections = {of = aCircle and bCircle, name = F'} }           \foreach \solA in {2} {             \path ($(F)!.5!(F'-\solA)$) coordinate (C'-\solA)             ($(C'-\solA)!doubleA/2!(F)$) coordinate (xDir-\solA)             (F'-\solA) node[name path global/.expanded = f'Circle-\solA,             circle with radius = .5 * doubleA] {};           }                         %!?                                                            \foreach \solA in {2} { %!?                                                                \path[name intersections = {of = fCircle and f'Circle-\solA,               by = {yDir-\solA}}]             ($(xDir-\solA)-(C'-\solA)$) coordinate (xDir'-\solA)             ($(yDir-\solA)-(C'-\solA)$) coordinate (yDir'-\solA)             ;           }         \end{pgfinterruptboundingbox}         \foreach \solA in {2}         \draw[x = (xDir'-\solA), y = (yDir'-\solA),         name path global = traj]         (C'-\solA) circle [radius = 1];       \end{scope}     \end{tikzpicture}     \end{document}      Without scaling: ![enter image description here](http://i.stack.imgur.com/mFmLv.png) With scaling: ![enter image description here](http://i.stack.imgur.com/8r2Lq.png) Is there a way for me to scale this `tikzpicture` environment? * * * **Edit 2:** Since I only produced a MWE, fixing the problem in code only created another unforeseen issue. Therefore, I have posted the whole code with the `transform shape` and the new issue it brought to the table. From Peter's and Qrrbrbirlbel's suggestion, I was able to fix the scaling issue but a new problem cropped up (see the image below): ![enter image description here](http://i.stack.imgur.com/uy1wW.png) The 1 shouldn't be upside down, those nodes, and line shouldnt be in the location they show. Why would `transform shape` cause this issue? I just read Andrew Stacey's post here How to scale a tikzpicture including texts?. He talks about `transform shape` will apply rotation to the node. So I just tried adding:               \tikzset{global scale/.style={         scale=#1,         every node/.style={scale=#1}       }     }      the above code to the picture as Andrew suggested but nothing changed. I am adding the code that isnt MWE because not having doesn't help here. This is because when I implemented one change, something else was affected. Therefore, the people helping don't know what else is going on in the code.               \documentclass[convert = false]{standalone}     \usepackage{tikz}     \usetikzlibrary{calc, intersections, backgrounds, decorations.markings, arrows}     \begin{document}     \begin{tikzpicture}[line join = round, line cap = round, >=triangle 45,         every label/.append style = {font = \scriptsize},         dot/.style = {inner sep = +0pt, shape = circle,           draw = black, label = {#1}},         small dot/.style = {minimum size = .05cm, dot = {#1}},         big dot/.style = {minimum size = .1cm, dot = {#1}},         transform shape, scale = .75         ]         \tikzset{circle with radius/.style = {shape = circle, inner sep = 0pt,             outer sep = 0pt, minimum size = {2 * (#1)}           }         }         \tikzset{global scale/.style = {             scale = #1,             every node/.style = {scale = #1}           }         }              \coordinate (O) at (0, 0);              \pgfmathsetmacro{\as}{3}         \pgfmathsetmacro{\bs}{2.25}         \pgfmathsetmacro{\c}{sqrt(\as^2 - \bs^2)}         \pgfmathsetmacro{\al}{3.75}         \pgfmathsetmacro{\bl}{2.9}         \pgfmathsetmacro{\cl}{sqrt(\al^2 - \bl^2)}         \pgfmathsetmacro{\xs}{abs(\c - \cl)}              \coordinate (O) at (0, 0);              \clip (-1, .25) rectangle (-6, 4);              \node[fill = black, big dot = {below left: \(F\)}] (F) at (\c, 0) {};              \path[name path global = line1] (\c, 0) -- ++(60:{\as} and \bs);         \path[name path global = line2] (\c, 0) -- ++(150:6cm);              \begin{scope}[decoration = {markings,             mark = at position 0.25 with {\arrow{>}},             mark = at position 0.375 with {\node[draw, shape = circle,               inner sep = .04cm, fill = white, font = \tiny] {\(1\)};},             mark = at position 0.75 with {\arrow{>}},           } ]           \draw[postaction = decorate, name path global = ell1, blue] (O) ellipse           (\as cm and \bs cm);         \end{scope}              \begin{scope}[decoration = {markings,             mark = at position 0.25 with {\arrow{>}},             mark = at position 0.6 with {\node[draw, shape = circle,               inner sep = .04cm, fill = white, font = \tiny] {\(2\)};},             mark = at position 0.75 with {\arrow{>}},           },           on background layer                                                                     ]           \draw[postaction = decorate, name path global = ell2, red] (-\xs, 0)           ellipse (\al cm and \bl cm);         \end{scope}              \path[name intersections = {of = line1 and ell1, by = P1}];         \node[fill = black, big dot = {right: \(A\)}] (A) at (P1) {};              \path[name intersections = {of = line2 and ell2, by = P2}];         \node[fill = black, big dot = {above: \(B\)}] (B) at (P2) {};              \draw[blue] (F) -- (A);         \draw[red] (F) -- (B) node[font = \scriptsize, fill = white,         inner sep = 0cm, pos = .5] {\(r_B\)};              \begin{scope}[on background layer]                                                         \draw[dashed, -latex] ($(-\al , 0) - (1, 0)$) -- ($(\al, 0) + (.5, 0)$)           coordinate (P3);           \draw[dashed, -latex] ($(F) - (0, 3)$) -- ($(F) + (0, 3)$);         \end{scope}              \begin{scope}[declare function = {doubleA = 5.8cm;},           decoration = {markings,             mark = at position 0.175 with {\arrow{>}},             mark = at position 0.225 with {\node[draw, shape = circle,               inner sep = .04cm, fill = white, font = \tiny] {\(3\)};}           } ]           \clip ($(A.center) + (1, 0)$) rectangle ($(B.center) + (0, 1)$);           \begin{pgfinterruptboundingbox}             \path let               \p1 = ($(A) - (F)$),               \p2 = ($(B) - (F)$),               \n1 = {veclen(\x1, \y1)},               \n2 = {veclen(\x2, \y2)}             in             (A) node[name path global = aCircle, circle with radius = doubleA-\n1]             {}             (B) node[name path global = bCircle, circle with radius = doubleA-\n2]             {}             (F) node[name path global = fCircle,             circle with radius = .5 * doubleA] {};                  \tikzset{name intersections = {of = aCircle and bCircle, name = F'} }             \foreach \solA in {2} {               \path ($(F)!.5!(F'-\solA)$) coordinate (C'-\solA)               ($(C'-\solA)!doubleA/2!(F)$) coordinate (xDir-\solA)               (F'-\solA) node[name path global/.expanded = f'Circle-\solA,               circle with radius = .5 * doubleA] {};             }                         %!?                                                             \foreach \solA in {2} { %!?                                                                 \path[name intersections = {of = fCircle and f'Circle-\solA,                                by = {yDir-\solA}}]                                                                     ($(xDir-\solA)-(C'-\solA)$) coordinate (xDir'-\solA)                                      ($(yDir-\solA)-(C'-\solA)$) coordinate (yDir'-\solA)                                      ;                                                                                }                                                                                \end{pgfinterruptboundingbox}                \foreach \solA in {2}                                                                     \draw[x = (xDir'-\solA), y = (yDir'-\solA), postaction = decorate,                        name path global = traj]                                                                  (C'-\solA) circle [radius = 1];                                                         \end{scope}                                                                               \draw[on background layer, red] let                                                         \p0 = (F),                                                                                \p1 = (B),                                                                                \p2 = (P3),                                                                               \n1 = {atan2(\x1 - \x0, \y1 - \y0)},                                                      \n2 = {atan2(\x2 - \x0, \y2 - \y0)},                                                      \n3 = {.75cm},                                                                            \n4 = {(\n2 + \n1) / 2}                                                                 in (F) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]                   node[font = \tiny, fill = white, inner sep = 0cm] at                                      ([shift = (F)] \n4:\n3) {\(\nu_B\)};                                                           \draw[blue] let                                                                             \p0 = (F),                                                                                \p1 = (A),                                                                                \p2 = (P3),                                                                               \n1 = {atan2(\x1 - \x0, \y1 - \y0)},                                                      \n2 = {atan2(\x2 - \x0, \y2 - \y0)},                                                      \n3 = {.5cm},                                                                             \n4 = {(\n2 + \n1) / 2}                                                                 in (F) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]                   node[font = \tiny, fill = white, inner sep = 0cm] at                                      ([shift = (F)] \n4:.75cm) {\(\nu_A\)};                                                                                \path[name path = circ] (B) circle [radius = 1bp];                                                                                \draw[name intersections = {of = circ and traj}, -latex] (B) --                           ($(intersection-1)!1.25cm!(intersection-2)$) node[pos = .4, font = \tiny,                 below, fill = white, inner sep = 0cm] {\(\mathbf{v}_1\)} coordinate (P3);                 \draw[name intersections = {of = circ and ell2}, -latex, red] (B) --                      ($(intersection-1)!2cm!(intersection-2)$) node[pos = .5, font = \tiny,                    above] {\(\mathbf{v}_2\)} coordinate (P4);                                                \draw[-latex, name path = line3] (P3) -- (P4) node[pos = .5, font = \tiny,                fill = white, inner sep = 0cm] {\(\Delta\mathbf{v}\)};                                    \draw[name path = line4] (B) -- ($(B)!2.1cm!-90:(F)$) coordinate (P5);                         \path[name path = circ2] (P3) circle [radius = 1bp];                                      \path[name intersections = {of = circ2 and line3}, name path = line5]                     (P3) -- ($(intersection-1)!2cm!(P3)$);                                                    \path[name intersections = {of = line5 and line4, by = P6}];                                   \draw[dotted] (P3) -- (P6);                                                                    \path[name intersections = {of = circ and traj}] (B) --                                   ($(intersection-1)!1.5cm!(intersection-2)$) coordinate (P7);                                   \draw (P3) -- (P7);                                                                            \path[name intersections = {of = circ and ell2}] (B) --                                   ($(intersection-1)!2.5cm!(intersection-2)$) coordinate (P8);                                   \draw (P4) -- (P8);                                                                            \draw let                                                                                \p0 = (B),                                                                                \p1 = (P5),                                                                               \p2 = (P3),                                                                               \n1 = {atan2(\x1 - \x0, \y1 - \y0)},                                                      \n2 = {atan2(\x2 - \x0, \y2 - \y0)},           \n3 = {1.4cm},           \n4 = {(\n2 + \n1) / 2}         in (B) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         coordinate (P9) at ([shift = (B)] \n4:\n3);              \draw (P9) .. controls ($(P9) - (.15, .15)$) .. ($($(P9) - (.15, .15)$) +                 (.25, -.3)$) node[font = \tiny, fill = white, inner sep = 0cm]         {\(\gamma_1\)};              \draw[-latex] let           \p0 = (B),           \p1 = (P5),           \p2 = (P8),           \n1 = {atan2(\x1 - \x0, \y1 - \y0)},           \n2 = {atan2(\x2 - \x0, \y2 - \y0)},           \n3 = {2.1cm},           \n4 = {(\n2 + \n1) / 2}         in (B) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         node[fill = white, inner sep = 0cm, font = \tiny] at ([shift = (B)]         \n4:\n3) {\(\gamma_2\)};              \draw let           \p0 = (B),           \p1 = (P3),           \p2 = (P4),           \n1 = {atan2(\x1 - \x0, \y1 - \y0)},           \n2 = {atan2(\x2 - \x0, \y2 - \y0)},           \n3 = {1cm},           \n4 = {(\n1 + \n2) / 2}         in (B) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         node[fill = white, inner sep = 0cm, font = \tiny] at         ([shift = (B)] \n4:\n3) {\(\Delta\gamma\)} coordinate (DG);              \begin{scope}[on background layer]           \draw[-latex] let             \p0 = (P6),             \p1 = (P5),             \p2 = (P4),             \n1 = {atan2(\x1 - \x0, \y1 - \y0)},             \n2 = {atan2(\x2 - \x0, \y2 - \y0) - 360},             \n3 = {.75cm},             \n4 = {(\n2 + \n1) / 2}           in (P6) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]           node[fill = white, inner sep = 0cm, font = \tiny] at ([shift = (P6)]           \n4:\n3) {\(\phi\)};       \end{scope}                                                                         \end{tikzpicture}     \end{document}


title: Spirograph, Continuous Rotations in TikZ or PSTricks

text: Spirograph-like drawings are obtained when one repeatedly draws a closed curve on a continuously rotated canvas. Is there a nice way to make spirograph drawings using TikZ or PSTricks? There is a nice PSTricks example from the PracTeX journal, but it only covers the case where circles rotate about circles. I have in mind a more general question. Is it possible to continuously rotate a parameterized, closed curve to obtain a spirographic image like the one below? ![Spirographic image obtained by continuously rotating the canvas while drawing a triangle](http://i.stack.imgur.com/MWZai.png) The ideal answer to this question would be code that would allow one to specify a parameterization of a closed curve together with the number of times that the curve must repeat.


title: Cleverref does not use default language after \foreignlanguage

text: I have the following code:               \documentclass[a4paper]{article}          % PACKAGES     \usepackage[english,ngerman]{babel}     \usepackage[utf8]{inputenc}          \usepackage[ngerman]{varioref}     \usepackage{hyperref}     \usepackage[ngerman]{cleveref}          \begin{document}          \section{Test}\label{test}          \foreignlanguage{english}{here some english text..}     %\selectlanguage{ngerman}          german text.. \cref{test}.          \end{document}      The reference should be in german, because the default language is set to german. But cleverref always prints references in english language after `\foreignlanguage{english}{some english text..}`. I can avoid this strange behaviour by appending `\selectlanguage{ngerman}` but this look more like a hack instead of a real solution. Does anyone have a solution for that (or do I misunderstand the concept of `\foreignlanguage`)?


title: Colored Curly Brackets spanning across multiple pages

text: This is just a thought that came for the notes I am working on, **I have a need to create curly brackets which span across multiple pages.** ![enter image description here](http://i.stack.imgur.com/r5X3u.jpg) I don't know if this is possible to do or not. my curly bracket knowledge is limited to http://en.wikibooks.org/wiki/LaTeX/Mathematics


title: Arrow within a signal (timing diagram)

text: I want to draw a Manchester code and need arrows to better show the falling and rising flag within the signal, something like that: ![](http://i.stack.imgur.com/pfhLr.jpg) In LaTeX, it is possible to use the package `timing`. Is it possible to draw an arrow within a timing diagram using the package `timing`? If not, how else is it possible?


title: Underlining a coloured DNA sequence

text: In the posts to the question of Timtico (here) several ways have been proposed to colour the As,Ts,Cs and Gs differently within a DNA sequence. What I want is also to be able to underline some nucleotides to emphasise them, e.g.: \dna{ATACAG$\underbar{AG}$CATA} but I didn't manage to do so. Does anyone have suggestions to this problem? Thank you very much!


title: Drawing a central composite design

text: Please I would like to draw a central composite design using PSTricks, or possibly tikz. This is the cube with the axes showed below. I have tried pst-3d but this is not easy. If you had an example of a similar figure this would be ideal. ![central composite](http://i.stack.imgur.com/Roepe.gif) **EDIT (later):** Ok I am back to home and I have found some time to do the figure with pst3d-plot. This is not the final figure but now it is easy to modify with the help of the pst3d-plot documentation (except that the options are not all documented e.g. for `pstThreeDBox` \- do you know another doc?)                   \documentclass[12pt]{article}              \usepackage{pst-all}         \usepackage{pst-3dplot}              \begin{document}             \begin{pspicture}(-6,-6.5)(6 ,6)          \psset{Alpha=30,Beta=20}          \pstThreeDBox[fillstyle=gradient,RotSequence=xyz](-4,-4,-4)(0,8,0)(8,0,0)(0,0,8)          \pstThreeDDot(6.7,0,0)           \pstThreeDDot(0,6.7,0)            \pstThreeDDot(0,0,6.7)            \pstThreeDCoor[linecolor=black, IIIDticks, IIIDlabels,          IIIDOffset={(0,0,0)},            xMin=-7.95,  yMin=-7.95,  zMin=-7.95,           xMax=8,  yMax=8,  zMax=8,            IIIDxTicksPlane=xz, IIIDxticksep = 0.4, , Dx=1,  deltax=4,             IIIDyTicksPlane=xz, IIIDyticksep = -0.4, , Dy=1,  deltay=4,           IIIDzTicksPlane=xz, IIIDzticksep = -0.4, , Dz=1,   deltaz=4]          \end{pspicture}              \end{document}      ![enter image description here](http://i.stack.imgur.com/JtWE8.png)


title: Changing citation style using biber

text: I have two problems regarding the citation style, see example.   1. At first, the citation should be without the title of the work for space sparing reasons.   2. Second, the `volume.number (Month Year)` notation should be replaced by a `\bf{volume}, number (year)` notation. Here is the LaTeX code:               \documentclass[open=right,titlepage=on,headsepline=on,numbers=enddot,ngerman,12pt,draft]{scrbook}     \usepackage[ngerman]{babel}     \usepackage[citestyle=verbose-ibid,bibstyle=authortitle,labelyear=true,backend=biber,isbn=false,url=false,doi=false,eprint=false]{biblatex}      \bibliography{mini}     \begin{document}     \footcite{sigmund_mechanism_1973}     \printbibliography     \end{document}      and this is the `mini.bib` file:               @article{sigmund_mechanism_1973,         title = {A mechanism of surface micro-roughening by ion bombardment},         volume = {8},         issn = {0022-2461, 1573-4803},         url = {http://link.springer.com/article/10.1007/BF00754888},         doi = {10.1007/BF00754888},         abstract = {},         language = {en},         number = {11},         urldate = {2014-02-24},         journal = {J Mater Sci},         author = {Sigmund, Peter},         month = nov,         year = {1973},         keywords = {Characterization and Evaluation Materials, Industrial {Chemistry/Chemical} Engineering, Mechanics, Polymer Sciences},         pages = {1545--1553},         file = {}     },


title: Expanding a macro as many times as possible without error

text: I'd like compute cosets using the `permute` package. Here's what I have so far:               \documentclass{article}     \usepackage{expl3,xparse,permute}          \ExplSyntaxOn     % Create a new command to compute the right coset Hg, taking in the element and the set     %% Clear a local clist for use     %% For each element in the set (#2)     %%% Set the current permutation to the identity     %%% Set the current permutation to the one we are looking at in the iteration     %%% Compose it with the element we were given in #1 on the right     %% Type the clist; Print the clist     \NewDocumentCommand \PMTCosetR { m m } {       \clist_clear:N \l_tmpa_clist       \clist_map_inline:nn { #2 } {         \pmtid          \pmtdo{##1}      \pmtdo{#1}  % compressed to avoid scrollbar on TeX.SX         \clist_put_right:NV \l_tmpa_clist \pmtprint       }       \clist_show:N \l_tmpa_clist       \ensuremath{\Big\{\clist_use:Nn \l_tmpa_clist {,}\Big\}}     }     \ExplSyntaxOff          \begin{document}     \PMTCosetR{(12)}{(),(123),(132)} \par     Expecting values:     \begin{itemize}     \item \pmt{(12)()}     \item \pmt{(12)(123)}     \item \pmt{(12)(132)}     \end{itemize}     \end{document}      The critical problem is actually what is being put into the list:               The comma list \l_tmpa_clist contains the items (without outer braces):     >  {\pmt@GetPrintArgs {\pmt@PrintPmt \pmt@curr }}     >  {\pmt@GetPrintArgs {\pmt@PrintPmt \pmt@curr }}     >  {\pmt@GetPrintArgs {\pmt@PrintPmt \pmt@curr }}.      Unfortunately, changing the appropriate argspec (`V|o`→`x`) results in an error:               ERROR: Undefined control sequence.          --- TeX said ---     \pmt@GetPrintArgs #1->\let \pmt@order                                            \pmtprintorder \def \pmt@next {#1}\@if...     l.27 \PMTCosetR{(12)}{(),(123),(132)}      I figure there must be a way to control how many times `\pmtprint` is expanded, since one expansion is obviously not cutting it. Can I expand it exactly twice? Three times? As many times 'as necessary', whatever _that_ means?


title: Little graphs of groups

text: I am writing a little document about graphs of groups, and I would like to illustrate the theory with the simple examples of graphs with only one edge: ![enter image description here](http://i.stack.imgur.com/qkmD0.jpg) Unfortunately, I do not know how to write such vertex and loop. Is there a simple way to to do this?


title: Resetting a dictionary in TexStudio/MikTeX

text: I accidentally "always ignore"d a wrong wrong word. How do I undo it and make the old dictionary clean again?


title: Are there any differences between a "newly defined" path and a path using predefined nodes?

text: I am not sure how I should phrase my question. consider the following example               \documentclass{article}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}          \node[inner sep=0] at (0,0) (a) {};     \node[inner sep=0] at (3,0) (b) {};     \node[inner sep=0] at (3,3) (c) {};     \node[inner sep=0] at (0,3) (d) {};          \draw[fill=black!10] (a) -- (b) -- (c) -- (d) -- cycle;     \draw[fill=black!30] (b) -- (6,0) -- (6,3) -- (c) -- cycle;          \end{tikzpicture}     \end{document}      Only the second \draw command gets filled. In the first case not even the cycle operation works. As far as I checked, when you use consecutive (predefined) nodes in a path (e.g. `(a) -- (b)`) then the filling operation doesn't work correctly. If you define new coordinates in the path (e.g. `(6,0) -- (6,3)`) then there are no problems. Is this behavior normal? ![enter image description here](http://i.stack.imgur.com/XdJK0.png)


title: Show solution to each part of a multipart question right after that part in exam package

text: I use the great `exam` package to write my exams as a teacher. It lets me typeset solutions too, but for multipart questions, I want the solution to each part printed right after that part. By default, `exam` writes the solution to the parts of a multipart question _together_. Here's a minimum example:               \documentclass{exam}          \begin{document}     \printanswers          \begin{questions}     \question Below is the data for an ``E-core.''     \begin{parts}         \part Describe what an E is.         \part Describe what a core is.     \end{parts}          \begin{solution}     \begin{parts}         \part E usually comes before F.         \part Core is usually inside a crust.     \end{parts}     \end{solution}          \end{questions}          \end{document}


title: biblatex: How to get 'Annual Reviews' (Style 2) references?

text: I struggle with some `biblatex` settings (Style 2 of Annual Reviews): 1) The citations in the text should appear with parentheses instead of brackets and ampersand instead of 'and', so: Tex et al. (1), Ba & Rise (2). 2) In the references, the entries should appear like this   1. Tex L, Bar F, Rate P. 2011. Minimal title. _Journal of LaTeX questions_. 1(1):110--20   2. Ba K, Rise S. 2012. Minimal title. _Journal of BibLaTeX questions_. 1(1):110--31 I tried to adapt the numeric style (in order to get consecutively numbered citations), but that might not be a good idea (?). For example, concerning 1), I found biblatex: How to remove the parentheses around the year in authoryear style? but the trick by A. Munn there to get rid of the parentheses around the year does not seem to carry over to numeric citation styles. I know that some requirements are probably hard to get (for, example, the page range 110--20 instead of 110--120), but any help towards achieving 1) and 2) is appreciated.               \documentclass{scrartcl}          \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[american]{babel}     \usepackage{blindtext}          \usepackage{csquotes}     \usepackage[     backend=bibtex,     style=numeric,     sorting=none,     firstinits=true,     terseinits=true,     uniquename=init,     maxcitenames=2,     date=iso8601,     urldate=iso8601     ]{biblatex}          \usepackage{filecontents}     \begin{filecontents*}{bib.bib}     @Article{foo,         author={Tex, La and Bar, Foo and Rate, Pi},         journal={Journal of LaTeX questions},         pages={110--120},         title={{Minimal title}},         volume={1},         number={1},         year={2011}}     @Article{bar,         author={Ba, Ka and Rise, Sun},         journal={Journal of BibLaTeX questions},         pages={110--131},         title={{Minimal title}},         volume={1},         number={1},         year={2012}}      \end{filecontents*}          % bibliography     \DeclareFieldFormat{labelnumberwidth}{#1.}% use 1., 2., ... in the references     \DeclareNameAlias{default}{last-first}     \renewbibmacro*{volume+number+eid}{% use volume(number) for articles for example       \setunit*{\adddot\space}%       \printfield{volume}%       \printfield{number}}     \DeclareFieldFormat*{number}{(#1)}     \DeclareFieldFormat*{title}{#1}% remove quotes from title     \renewbibmacro*{in:}{}% remove in label     \DeclareFieldFormat{isbn}{ISBN #1}% format isbn number     \bibliography{bib.bib}% bibliography data     \renewcommand*{\cite}[2][]{\textcite[#1]{#2}}          \begin{document}     \blindtext[1]; see \cite{foo}, \cite{bar}.     \printbibliography     \end{document}


title: A problem with \textsc

text: I started to write my CV in LaTeX. My document begins as               \documentclass[a4paper]{amsart}     \usepackage[latin1]{inputenc}     \usepackage[finnish]{babel}     \begin{document}     \begin{center}     {\large \textbf{\textsc{ANSIOLUETTELO}}}      But pdfTeX for Mac says:               This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010)     ....     LaTeX Font Warning: Font shape `OT1/cmr/bx/sc' undefined     (Font)              using `OT1/cmr/bx/n' instead on input line 6.          [1{/usr/local/texlive/2010/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]     [2] (./ansioluettelomod.aux)      What am I doing wrong?


title: Description numbering

text: I have an `article` document. In this document I have sections and subsections. In a subsection there are nested 'description' lists. I want that items of this description have numbers which use the number of the subsection and nested case the number of the parent description.               4.1. Subsection       4.1.1. Item 1 of Description 1         4.1.1.1. Item 1 of Description 2         4.1.1.2. Item 2 of Description 2       4.1.2. Item 2 of Description 1      How I can achieve that?


title: How to make add tick to node in tikz

text: I'm trying to draw a simple timeline in tikz. Here's what I have:               \documentclass[12pt,a4paper,bibtotoc]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[ngerman]{babel}     \usepackage{microtype}     \usepackage{tikz}               \begin{document}     Ablauf der Schadenregulierung bei einem typischen Schadenfall     \\ \\          % Zeitstrahl zur Schadenregulierung     \begin{tikzpicture}     \draw[black, ultra thick, ->]     (0,0)      -- (2,0) node [below]{Schadeneintritt}     --(14,0);     \end{tikzpicture}     \end{document}      What I would like is for there to be a tick on the line at node "Schadeneintritt". I've tried adding `tick` to the options of the node but that produces an error (apparently tickz doesn't know the `tick` option). I'm still new to tikz and so far I've only found solutions for full blown axes / coordinate systems. I know that I could do:               \draw (2,0.2) -- (2,-0.2);      but I wonder whether there's an easier solution (i.e. specifying this directly at the node). Cheers!


title: Reduce space between subfigure and the subfigure captions

text: How can I reduce the space between subfigure and the sufigure captions ? Preamble               \usepackage{float}%exact location      \usepackage{graphicx}      \usepackage{caption}      \usepackage{subcaption} % for subfigures      Example.               \begin{figure}[H]             \centering             \begin{subfigure}[b]{0.4textwidth}                     \includegraphics[width=\textwidth]{Pictures/pic0.pdf}                     \caption{}                     \label{fig:lab0}             \end{subfigure}                    \begin{subfigure}[b]{0.4\textwidth}                     \includegraphics[width=\textwidth]{Pictures/pic1.pdf}                     \caption{}                     \label{fig:lab1}             \end{subfigure}                  \caption{A long caption}\label{fig:lab}      \end{figure}


title: How to avoid footnote split?

text: Maybe the second footnote is too long, it splits into two parts at the bottom of the page as following picture shows. ![enter image description here](http://i.stack.imgur.com/dxnc7.jpg) What should I do to avoid this? Thanks


title: How to make the rmligs script available globally on Windows?

text: Hopefully on-topic as about "(La)TeX related software and tools" I just learned about the rmligs script. Since it isn't available through MiKTeX (and neither through TeX Live), I downloaded the archive manually and unpacked it. Using Windows command prompt, rmligs runs successfully when I'm in the directory where the file `rmligs` (without a file extension) is, typing `perl rmligs testfile.tex`. Now I tried to make the script available globally, just like e.g. latexmk is, but didn't succeed. **How do I make rmligs globally available** , so that I can use it no matter in which directory I am? I tried putting all the rmligs files in a directory in different places, seeking to follow the texmf tree order:   * `C:\Program Files (x86)\MiKTeX 2.9\scripts\rmligs\perl\`   * `C:\Program Files (x86)\MiKTeX 2.9\scripts\rmligs\`   * `C:\mtpak\scripts\rmligs\perl\` (`C:\mtpak\` is my local/personal/custom root, which works for other additions.)   * `C:\mtpak\scripts\rmligs\` After each of these attempts, I refreshed the file name database, but calling `perl rmligs foo.tex` or `rmligs foo.tex` didn't work. I'm using ActivePerl 5.12.4 Build 1205 (64-bit) on Windows 7 (64-bit). I'm not an advanced command line user nor a Perl programmer or anything, I installed Perl in the first place to use latexmk.


title: How to prevent lstlisting from splitting code between pages?

text: Is it possible to prevent `lstlisting` from splitting a code between pages if it does not fit on one page? Instead splitting I would like to have the code on the next page. I tried to put all `lstlisting` inside `\begin{figure}[h!]...\end{figure}` but the order of code and header is lost.


title: How to use poetrytex with cyrillic letters

text: I am trying to use `poetrytex` with cyrillic letters like this:               \documentclass[11pt]{article}     \usepackage{poetrytex}     \usepackage[paperwidth=140mm,paperheight=210mm]{geometry}     \begin{document}     \thispagestyle{empty}     \renewcommand{\poetryheadings}{\pagestyle{myheadings} \markboth{}{}}     \begin{poem}{Title}{Author\\2014}     Мороз и солнце, день чудесный\\     The sea is calm to-night.\\     \end{poem}     \end{document}      But `pdflatex` generates this: ![enter image description here](http://i.stack.imgur.com/B7jvr.png) How to tell `poetrytex` package what I want?


title: How can I set default font size to [bp] instead of [pt] in order to use Lyx with XeTex?

text: I want to use the [bp] font size for the whole document in Lyx 2.0.4 for compilation with XeLatex. My LaTex preamble looks like this: `\usepackage{fontspec} \usepackage{xunicode} \usepackage{xltxtra} \date{}`. If I specify `\documentclass{article}[12bp]` I get these errors: `LaTex Error: Two \documentclass or \documentstyle commands` and `LaTex Error: Missing \begin{document}`.


title: Animated equation in Beamer

text: I would like to animate an equation in Beamer with the `\alt` command. Unfortunately, there is some "movement" between the two equations. Consider the following example:               \documentclass{beamer}          \begin{document}     \begin{frame}<-2>{Example}     \[\alt<1>{\max}{\min}(1,2)=\alt<1>{2}{1}\]     \end{frame}     \end{document}      Then, my `\max` and `\min` commands have not the exact same length. Therefore, the sign `=` for instance (but also the `(1,2)`) moves between slides 1 and 2. Is there a way to avoid this?


title: What is the difference between \vskip and \vspace?

text: I found myself writing:               \vspace 1 \baselineskip      and then when not compiling changing without thinking to:               \vskip 1 \baselineskip      but what is the difference? Perhaps knowing this will make me write the right one from the start in the future...


title: how to select math font in document

text: I want to show in one document different font examples of math fonts, for example Latin Modern, Times and Charter. I know the command `\usefont{T1}{lmr}{m}{n}`, but have no idea how to combine that with a math environment.


title: pgfplot gives an error despite using the latest version v1.7

text: I keep getting this error every time I compile using the `pgfplot` package > "! Package pgfkeys Error: I do not know the key '/pgfplots/error bars/ .cd' > and I am going to ignore it. Perhaps you misspelled it." I am using the latest version of `pgfplo`t v1.7 Can some one please help me * * * Firstly I am a complete novice to Latex. So I am not sure what a "MWE" is and setting up the problem is extremely challenging in itself. But I will try my best to pose the problem. Secondly, please note that the code given below is NOT at all complete and simply copy-pasting it might not work. I just want to show the bare necessities. Thirdly, if the experts require more information, let me know and I will do my best to fill in the blanks. ### Code:               \documentclass[%     12pt,        oneside,     ]{report}     %Packages used     \usepackage{graphicx}     \usepackage{makeidx}      \usepackage{amssymb, amsmath}      \usepackage[]{hyperref}          \usepackage[greek,english]{babel}     \usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption} % Figure captions     \usepackage[all=normal,floats,leading,paragraphs, charwidths,tracking,wordspacing]{savetrees}      \setlength{\parskip}{\baselineskip}      \usepackage{pgfplots} %Uses pgfplots packages to make plots inside LATEX environment          \begin{document}     \chapter{section}     \markright{section}     %==================================================================     \section{calculations}     %==================================================================     \begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[     xlabel = xxx     ylabel = yyy     ]     \addplot [red, only marks, error bars/.cd, y dir=both,y explicit]     coordinates {     (1,1)+-(0,0.2)     (2,2)+-(0,0.2)     (3,3)+-(0,0.1)       };     \end{axis}     \end{tikzpicture}     \end{figure}     \end{document}      * * * ### Error: > "! Package pgfkeys Error: I do not know the key '/pgfplots/error bars/ .cd' > and I am going to ignore it. Perhaps you misspelled it." ### Solution: **Change`error bars/.cd` to `error bars`** ### Reason: I think its because the program cannot find the correct directory path. But I am not sure so don't take my word on it.


title: Set standard default scaling of \includegraphics

text: I am using Sphinx and the plantuml package to include UML diagrams. The plantuml package for Sphinx generates the following LaTeX code:               \includegraphics{%s}      Anyways - the diagrams are to big, so what I want is               \includegraphics[scale=0.75]{%s}      Can I - without patching the plantum package - set a default scale for `\includegraphics` in my LaTeX preamble?


title: Linespacing only for main text body

text: In a LaTeX beamer document, is there a way to change line spacing only for the main text body - i.e. for everything between `\begin{frame}` and `\end{frame}`? In particular if using `\linespread` and its variants in the preamble the line spacing will also increase in multi-line titles or if the respective beamertheme uses newlines in its layout. I also tried using `\linespread` within a frame but to no avail.


title: Visual separation when using linerange in listings

text: I have read through the `listings` documentation and couldn't find an answer to the following question: How do I insert some sort of visual feedback in a listings listing when using the `linerange` option. It works fine on my source code files, but the only visible feedback that there is a gap in the listed code is the change in numbering. I would like some more visual feedback, e.g. a line or maybe some sort of waves that I come across in some books on programming. Any idea on how to achieve this?


title: LaTeX - Multiple pages on a code listing inside a beamer frame

text: I'm trying to put some Python code on a beamer slide. I would like to take one big file and print it with `lstinputlisting`. I've tried to set the frame fragile with:               \begin{frame} [fragile]         \lstinputlisting{my_big_file.py}          \end{frame}      It compiles ok, but LaTeX seems to ignore me =( Am I missing something?


title: Using an array element to specify end iteration point in TikZ "\foreach"?

text: Is it possible to access an array and use one of its elements to specify the last iteration point in a TikZ `\foreach`? I've tried with the code below but I keep getting a compilation error:               ! Argument of \pgffor@@dotscharcheck has an extra }.     <inserted text>                     \par     l.49   }      And here's a minimal example:               \documentclass{standalone}          \usepackage{tikz}     \usetikzlibrary{shapes}     \usetikzlibrary{arrows}     \usetikzlibrary{positioning}          \begin{document}          \begingroup     \newdimen\bitSize     \bitSize=2mm     \newdimen\bitSep     \bitSep=0.5mm     \newdimen\bitBigSep     \bitBigSep=3mm     \begin{tikzpicture}[%         auto,         every node/.style={%           node distance=0pt,         },         bit/.style={%           draw,           rectangle,           minimum size=\bitSize,           inner sep=0pt,           node distance=\bitSep,         },       ]            \def\numBits{{4, 8, 4}}       \foreach \i in {1, 2, 3} {%         \pgfmathtruncatemacro\prevI{\i-1}         \foreach \j in {1, ..., \numBits[\prevI]} {%           \pgfmathtruncatemacro\prevJ{\j-1}                % Draw bit           \ifnum \j=1             \ifnum \i=1               \node [bit] (bit\i-\j) {};             \else               \node [bit, right=\bitBigSep of bit\prevI-\numBitsArray[\prevI-1]]                 (bit\i-\j) {};             \fi           \else             \node [bit, right=of bit\i-\prevJ] (bit\i-\j) {};           \fi         }       }     \end{tikzpicture}     \endgroup          \end{document}


title: ConTeXt two columns two margins

text: I have two columns and I want to have some pictures in margin. I want in left column pictures in left margin and in right column pictures in right margin. It this possible in ConTeXt? This is minimal example: There is much more text and all margin texts are present in left side of all columns.               %interface=en translate-file=utf-8      \starttext          \startcolumns[n=2]          Praesent ut nibh leo, eget commodo enim. \inmargin{2asdf} Aenean ac risus in lacus ultrices porttitor.               Praesent ut nibh leo, eget commodo enim. \inmargin{2asdf} Aenean ac risus in lacus ultrices porttitor.          \stopcolumns      \stoptext


title: The _ character but not in math mode

text: My TeX voodoo has some special behaviour for WIP documents. One of those is printing labels and filenames in marginpars whenever encountered. This breaks whenever there are labels and filenames that contain a `_` character. While `\includegraphics{file_name}` and `\label{foo_bar}` are obviously ok, a simple               \begin{document}     [... has to appear after \begin{document} ...]     \let\somelabel\label     \def\label#1{%         \somelabel{#1}%         #1     }      breaks at `\label{foo_bar}` with the good old `!Missing $ inserted` at the first occurrence of a `\label` containing a `_` character. I tried some things to have latex replace the `_` but it seems the problem is recursive. :-) The obvious solution would be to not use labels and filenames containing `_`-characters, but that's not feasible for my current projects. Can I make latex not trip over the `_`-character?


title: How to get "and," "with," "for," etc. to print small and with diagonal banners behind

text: There was a typography contest from which an answerer featured these diagonal instances of "and," "with," "for," etc. which were slightly tilted and had banner-like symbols behind them. How can I do this without purchasing a font? * * * Showcase TeX Typography for TUG's Calendar


title: How to color a cell of a table using multirow and center the cell content?

text: I have checked for other similar questions. I followed the suggested solution in the question Color in multirows. After implementing this solution, I still have a problem. I want to develop the following table: ![enter image description here](http://i.stack.imgur.com/INvY2.jpg) I want to color specific cells, but I am using multirow, so I used the following code,               \documentclass[journal]{IEEEtran}          \usepackage{tabularx}     \usepackage[dvips]{graphicx}     \usepackage{multirow}     \usepackage[skip=5pt]{caption}   % Unifies the distance between caption and float     \usepackage{array}     \usepackage[table]{xcolor}% http://ctan.org/pkg/xcolor          \begin{document}          \begin{table*}[ht]     \center{\caption{\label{tab:grid} The Grid.}     \scalebox{1}     {{     \begin{tabular}{m{2.25cm} m{3cm} m{3cm} m{3cm} m{3cm}}     \cline{2-5}     \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\multirow{2}{*}{\textbf{A}}}&\multicolumn{1}{|c|}{\multirow{2}{*}{\cellcolor{blue!25}}} & \multicolumn{1}{|c|}{\multirow{2}{*}{\cellcolor{blue!25} \textbf{C}}}& \multicolumn{1}{|c|}{\multirow{2}{*}{\textbf{D}}} \tabularnewline     \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{}&\multicolumn{1}{c|}{\cellcolor{blue!25} \textbf{B}} & \multicolumn{1}{c|}{\cellcolor{blue!25}}&\multicolumn{1}{c|}{} \tabularnewline     \cline{1-5}     \multicolumn{1}{|c|}{\multirow{2}{*}{\textbf{D}} }& \multicolumn{1}{|c|}{\multirow{4}{*}{A/CD}} & \multicolumn{1}{|c|}{\multirow{4}{*}{B/CD}} &  \multicolumn{2}{|c|}{\multirow{4}{*}{CD}}   \tabularnewline     \multicolumn{1}{|c|}{}&\multicolumn{1}{|c|}{}&\multicolumn{1}{|c|}{}& \multicolumn{2}{|c|}{}   \tabularnewline     \cline{1-1}     \multicolumn{1}{|c|}{\multirow{2}{*}{\textbf{C}}} &\multicolumn{1}{|c|}{} &\multicolumn{1}{|c|}{}& \multicolumn{2}{|c|}{}  \tabularnewline     \multicolumn{1}{|c|}{}&\multicolumn{1}{|c|}{}&\multicolumn{1}{|c|}{}& \multicolumn{2}{|c|}{}   \tabularnewline     \cline{1-5}     \end{tabular}     }}}     \end{table*}          \end{document}       and here is what I got: ![enter image description here](http://i.stack.imgur.com/m6HIA.jpg) You can notice that I used two different methods for C and B. My questions are: 1- In case of C, I colored the first row of the two-row cell, inserted C, then colored the second half, so the color in the second half overlapped the C. To solve this, I colored the upper row, then the lower row, and then inserted B, which gives a better result, but now B is not centered in the cell, how can I do that? 2- In both cases, the color overlaps the cell boarders. I could overcome the problem in the vertical lines around C and B by adding "|" in C and D to thicken the line, however, the horizontal lines above and below B and C disappeared. Could **_colortbl_** provide a better solution?


title: Howto typeset the direct current symbol in LaTeX?

text: How can I typeset the following symbol for direct current (i.e. a `=` symbol where the lower line is dashed)? ![Direct current symbol](http://i.stack.imgur.com/49K9t.png) The image above is an enlarged version, the size I need is like `=`, `\approx`, `\simeq` etc.


title: How can I lower position of page number?

text: \documentclass{mwrep}          %margins     \usepackage{anysize}     \marginsize{3cm}{3cm}{2cm}{2cm}          \usepackage{lipsum}          \usepackage{fancyhdr}     \pagestyle{fancy}     \lhead{}\chead{}\rhead{}\lfoot{}\cfoot{}\rfoot{\thepage}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}          \begin{document}     \chapter{AAAAAAA}     \section{aaaaaaa}     \lipsum     \section{bbbbbbb}     \lipsum     \section{ccccccc}     \lipsum     \chapter{BBBBBBB}     \section{aaaaaaa}     \lipsum     \section{bbbbbbb}     \lipsum     \section{ccccccc}     \lipsum     \chapter{CCCCCCC}     \section{aaaaaaa}     \lipsum     \section{bbbbbbb}     \lipsum     \section{ccccccc}     \lipsum     \end{document}      How can I lower the page number (something about 0.5 cm) without modyfying the rest of page?   (Only visible change should be different position of page number).


title: Using both BBL and BIB in one LaTeX document

text: I have a `.bib` file that contains information about some of my papers. I also have a `.bbl` file, automatically produced by BibTeX, that contains the compiled information (`\bibitem{}` series) of another set of papers. How can I use both `.bib` and `.bbl` in one LaTeX document? If I simply use `\input` for the BBL, the numberings of references (and even themselves) will not be correct. A solution that let's me decompile the `.bbl` also works. In this very case, using `.bbl` is no problem because it's in the bibliography style I am using. Also, all references in `.bbl` will be used in the file document.


title: How to place image on same page as text

text: I am new to LaTeX. I am trying to include and graph in `.eps` format in my LaTeX document. I shrink the image to half its size, but for some reason, LaTeX still putting it on its own page, with a small graph in the middle and a lot of white space. I would like this graph to be placed at the top of the page with text underneath. Any help would be greatly appreciated. My packages are:               \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{mitpress}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{float}     \usepackage{booktabs}     \usepackage{rotating}     \usepackage[left=63.2363pt,right=63.2363pt,top=90.3375pt,bottom=90.3375pt]{geometry}      And the code for my figure is:               \begin{figure}[ht]     \centering     \includegraphics[trim = 0 0 0 0,clip=true,scale = 0.5]{graphs/fig_hazards_comb}     %\caption{This is the caption}     \end{figure}     \clearpage