title: Make TeX Live on linux/mac system available

text: I am currently giving a LaTeX course for students. Most linux users have TeX Live 2009 installed which is much too old, since I want to use `biblatex` and `biber`. If they install TeX Live from the website they can not access it because the PATH is not set up correctly. I now found out that one can solve this by adding the PATH               PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH       to `.bashrc` and `.profile`. However I wonder if this could be configured for all users? Furthermore I have a problem with the mac users. `pdflatex` starts from within TeXShop, but is not found from any other editor. We use TeXstudio for example. Any hint what could be wrong there?


title: \caption full features, but no showing at list of figures?

text: Using tocloft for my list of figures, I am looking for some method that enables me to select some specific entires (\caption) such as that one further down, which shouldn't goes to the list of figures, but in the content still be counted/numbered in the usual way.               \begin{figure}     \centering     \includegraphics[width=1.0\textwidth]{rhythmus.pdf}     \caption[Own grafic.]{Beispielrhythmus: Ta ta tatata, tata tataa ta taa.}     \label{rhythmus}     \end{figure}      I use the list of figure to show the sources of the figures, but I have many selfmade grafics, where I don't need to specify the source. Respectively I will specifiy them just with one sentence. I have following settings in the preamble, which might play a role.               \usepackage{tocloft}          \usepackage{etoolbox}     \usepackage{lipsum}           % This is for using numbering for the sections, chapters, etc. in the content, but not in the table of content.     \makeatletter     \let\oldnumberline\numberline     \patchcmd{\@caption}{\numberline}{\oldnumberline}{}{} %     \renewcommand*{\numberline}[1]{}     \makeatother      Then:               \chapter{List of Figures}     {\makeatletter     %\let\@cftmakeloftitle\relax     \@starttoc{lof}% Print List of Figures     %\listoffigures     \makeatother}     \begingroup\noindent \footnotesize{Abb. 1.1, 1.2 ... here some more.. are made by myself}\endgroup


title: TextMate 2 , LaTex : preview in Skim

text: I have tried to configure TextMate 2 in order to typeset and view latex files. I have configured the bundle preferences as in this figure ![enter image description here](http://i.stack.imgur.com/7Jvcu.png) but I only manage to typeset the file and eventually view it within TextMate: after the compilation, nothing happens (no error, no visualization of the pdf). As far as I have understood, Skim is recommended for jumping from the pdf to the LaTex source and viceversa. Any suggestion?


title: Recreate efficiently this figure

text: I am writing a technical document, and I need to explain several steps of a construction which use matrices and linear equations. I was puzzled how I would create my figures and one paper I reference use this : ![how a step look like](http://i.stack.imgur.com/ZLKh8.png) I have to do 6 or 7 of these, and I would like to know what is the most efficient way of doing it. In each figure the number of components and the value of equation will be different. I already know how to create individually matrices and tables. I want to know how to produce such a figure without too much sweat. I don't use latex a lot, but if you point out packages, references or any material to look at it will be a good start.


title: How do you effectively debug overfull \hbox warnings?

text: I still haven't found out how to effectively solve `Overfull \hbox (0.80913pt too wide) has occurred while \output is active` warnings. For instance, this piece of latex generates such a warning and I am stumped why:               \newcommand\Header{%     \noindent\makebox[\textwidth][l]{     \parbox{0.5\textwidth}{\contactinfo}     \parbox{0.5\textwidth}{%     \hfill\includegraphics[height=25pt]{logo}}}\par\vskip1ex%     \par\ColTopRule\par}      `\contactinfo` is defined as follows:               \newcommand\contactinfo{\fontsize{8pt}{8}\selectfont\headerfnt Streetname 12324 \\ PostalCode City \\ +31655555555555}      Error:               *geometry detected driver: pdftex*     <logo.eps>     Overfull \hbox (0.80913pt too wide) has occurred while \output is active      []      [1] <logo.eps>     Overfull \hbox (0.80913pt too wide) has occurred while \output is active      []      [2] <logo.eps>     Overfull \hbox (0.80913pt too wide) has occurred while \output is active      []      [3] <logo.eps>     Overfull \hbox (0.80913pt too wide) has occurred while \output is active      []       Expected output is:               Streetname 12324                                       here comes     PostalCode City                                          the logo     +31655555555555                                     right aligned     -----------------------------------------------------------------      I mean, both boxes have a length of `0.5\textwidth`, the text is obviously smaller than this, as is the logo. How come it still generates such a warning? And how can I found out why?


title: Table of contents with indents and dots

text: I have a table of contents that looks like the following in my working example.               \documentclass[a4paper,12pt]{amsart}          \usepackage{tikz}     \usepackage{graphicx}     \usepackage{ellipsis}     \usepackage{soul}     \usepackage{amsthm}     \usepackage{amsmath,amssymb}     \usepackage{colortbl}     \usepackage{multirow}     \usepackage{caption}     \usepackage{rotating}     \usepackage{pdflscape}     \usepackage{hyperref}     \hypersetup{         colorlinks,%         citecolor=black,%         filecolor=black,%         linkcolor=black,%         urlcolor=black     }          \begin{document}          \tableofcontents               \section{Introduction}     \subsection{Subsection}     \subsubsection{Subsubsection}          \section{Section}     \subsection{Subsection}          \end{document}      I would like to indent the subsections in the table of contents, and if possible have dots to the page numbers. Most of other peoples problems seem to be with getting rid of these...any help?!


title: Displaying medieval scriptures and neumes in TeX

text: We have a friend who is trying to write his PhD thesis in LaTeX. In his thesis, he has to use old scriptures and medieval music notations (neumes). Unfortunately, for the kind of neumes (St. Gallen Neumes) he has to use, there aren't any packages. So we're looking for some (awesome) person, who could help us to find a way to displaying these scriptures in TeX/PDF. We already found out, that there is a way to create own TTF's through graphics and Corel Draw, but this won't be enough to display them in the PDF later, right? The notations should appear above the lyrics (similar to simple chord- symbols). Anyone any ideas?


title: One-line equation with two columns

text: I try to write an equation with two similar formulas, i.e.   ` \begin{equation} \qquad A_1 = B + C \qquad A_2 = D + E \qquad \end{equation} ` Of course, instead of `\qquad`s I want to use something like `\hfill`. I would also like to do the same with some text within, like ` \begin{equation} \qquad A_1 = B + C \quad \text{and} \quad A_2 = D + E \qquad \end{equation} ` Is there any prefered/"best" way for this?


title: To label different parts of pdf page

text: Assume you have a PDF file with 3x4 pictures. You want to label each picture. **How can you label such pictures without cutting manually each picture out separately?** Next problem is how you can show each steadily separated picture from a pdf- file, but let's concentrate on the first question here only.


title: Macros in \special

text: I tried to compute a bounding box in LaTeX and pass the value on to dvisvgm via DVI specials. The resulting code (which I copy-and-pasted together from all over the internet) looked as follows:               \newlength{\mywidth}     \newlength{\myheight}     % ...     \special{dvisvgm:bbox a 0 0 \the\mywidth \the\myheight}      This resulted (predictably after the fact) in the following output in the DVI file:               dvisvgm:bbox a 0 0 147.00748pt26.3999pt      After considerable amounts of googling I came up with the following workaround:               \newtoks\spacetoken     \spacetoken={ }     \special{dvisvgm:bbox a 0 0 \the\mywidth\the\spacetoken\the\myheight}      However, that just looks horridly wrong to my eyes. Hence, my questions:   1. How does `\special` work?   2. Is there any better way to do this?


title: Time stamping my TeX documents

text: I use Texmaker as my LaTeX editor. I prefer to split my input into multiple files and I would like to have a way where on top/bottom of each (tex) file there is an automatic time stamp, saying when the file was last opened. This is a version control issue but I am wondering if there is a low-key solution to this at all?


title: TeX Programming questions (and stuff about parcolumns)

text: I'm trying to modify the inner workings of `parcolumns`. I'm starting to understand the TeX macro "programming" language a bit but I have some issues. In `paracolumns` there are three issues I want to resolve:   1. Remove vertical space between rows   2. Remove extra column space at end of column   3. Make the above optional. I've narrowed down, I think the problem to the first to the following code:               \vsplit\csname pc@column@\number\count@\endcsname to \dp\strutbox%     \vbox{\unvbox\@tempboxa}%      I've tried everything to remove the space that `\vsplit` is suppose to add but I get any different results. Does               \csname pc@column@\number\count@\endcsname to \dp\strutbox%      Create a simple macro name by concatenating `pc@column` with the value in number and count? * * * The `parcolumns` code loops over the columns then the rows. It uses a `\repeat` and also recursively calls `\pc@placeboxes`. It has some code to check if the loop is currently at the last column and adds some `\hfill`. I think it does it ad               \ifnum\count@<\pc@columncount%     \strut\hfill%     \ifpc@rulebetween\vrule\hfill\fi%     \fi%      but commenting all this out doesn't change much if anything. (These are the only lines of code that have `\hfill` them) * * * I see               \define@key{parcolumns}{distance}{%     \@tempdimc#1\relax%     }%      Creates a keyvalue pair used in the options. I've tried to duplicate this without luck               \define@key{parcolumns}{extratopspace}{%     \@tempdimq#1\relax%     }%      but I get errors about `\tempdimq` not existing or whatever. The code looks to simply be assigning `\tempdimc` to the first argument and I don't see anywhere where `\tempdimc` is being initalized or created so I figure it is a internal temp variable but then `\tempdimq` should work(unless there are only a,b,c, and d as I've tried e). * * * Any ideas or useful comments? One of the biggest issues I have with the code is there is no indentation. Is it ok to indent code or will the whitespace cause problems? BTW, I just stumbled on this reference which seems pretty good: > http://www.tug.org/utilities/plain/cseq.html


title: Glossary and list of figures have the same page number in the table of contents

text: In my table of contents the glossary and the list of figures have the same page number. However, these two areas are not on the same page. Can anyone help me to get the correct number of pages set? My glossary is called "Akronyme" because it is in German. ![enter image description here](http://i.stack.imgur.com/QlhdW.png) Here is my code:               \printglossary[type=\acronymtype,style=dontgroup]     \addcontentsline{toc}{chapter}{List of figures}     \listoffigures


title: How to suppress a line completely from a LuaTeX process_input_buffer callback?

text: I'm using a process_input_buffer callback to look at lines read from LuaLaTeX input before passing them on to TeX, to be processed as »verbatim« text (code and command examples). There are some lines in the input that I don't want to pass to TeX at all. If I return »nil«, then TeX gets the original line (as the documentation says). If I return an empty string, an empty line results in the TeX output, which I don't want. How can I arrange for the callback to throw the line away altogether without passing anything on to TeX? (One obvious approach would be to read all of the example into a buffer and then simply cut out the undesired stuff before passing the complete buffer on to TeX, en bloc. This doesn't work for me due to other considerations.) The idea is that in an environment like               \begin{example}       # foo       bar       baz     \end{example}      the »#« line should not be passed to TeX but the other lines should. (In the real world, the »#« line is somewhat more complicated but is being processed on the Lua side of things.) (In the meantime, I found a workaround such that I'm basically inserting a control-B character in front of the »#« on the Lua side, and declaring ^^B to be the fancyvrb »commentchar«, which causes anything after a ^^B, including the newline, to be ignored. I'd still be interested to see whether there is a simpler method.)


title: Why do 2 identical function definitions with different names produce two different plots?

text: In the code snippet below I would have expected both `r(x)` and `s(x)` to be the same line, but the output is two radically different lines as shown below. ![enter image description here](http://i.stack.imgur.com/jLjmT.png) If there is a problem using the name `r` as a function name, then I would have expected some sort of error message, but did not find one.               \documentclass{article}     \usepackage{amsmath}     \usepackage{pgfplots}          \pgfmathdeclarefunction{r}{1}{\pgfmathparse{(2.0)}}     \pgfmathdeclarefunction{s}{1}{\pgfmathparse{(2.0)}}          \tikzstyle{MyPlotStyle}=[domain=-5:5, samples=50, ultra thick]          \begin{document}     Plot of $r(x)=2$ and $s(x)=2$ using PGF Version \pgfversion.          \begin{tikzpicture}       \begin{axis}         \addplot[MyPlotStyle, red ]{r(x)};         \addplot[MyPlotStyle, blue]{s(x)};       \end{axis}     \end{tikzpicture}     \end{document}


title: How to put a reference into nlset command of algorithm2e package

text: I would like to provide an alternative version of only some part of already existing algorithm, using the algorithm2e package. My source looks like:               \begin{algorithm}[t]     \dots \;     \nlset{\ref{alg:previous:ref}} alternative line content \;     \dots \;     \end{algorithm}      This source however result in the following compilation error: _! Argument of \reserved@a has an extra }_. Any help? **EDIT** Minimal document that simulates the error:               \documentclass{article}     \usepackage{algorithm2e}     \usepackage{hyperref}     \begin{document}          \begin{algorithm}     line content \; \label{alg:previous:ref}      \end{algorithm}          \begin{algorithm}     \nlset{\ref{alg:previous:ref}} alternative line content \;     \end{algorithm}          \end{document}      The problem seems to occur when hyperref package is loaded, without it works well.


title: Remove spaces after a custom definition

text: As scientific species names should be written in _italic_ , I have adopted a shortcut to do this in LaTex by creating a definition in the preamble:               \def\GM{{\it Gadus morhua~}}       Then it's easy to call for `\GM is a fish`, which returns " _Gadus morhua_ is a fish". Note that I have added `~` to the definition, so that I won't need to write `\GM~`. This works except, if I want to write `The fish is called \GM.`, which would return "The fish is called _Gadus morhua_ ." (with a space between morhua and period). In order to maximize my lazy writing style I would like to find a way to "eat away" that space I defined earlier. I know that a negative space exists in math mode, but writing `$\GM\!$` does not lead to a right result. Is there a way adding a negative space to text mode?


title: Raggedbottom before Headings

text: I'm using the scrbook class, which uses flushbottom paragraphs by default. Usually this is OK, as a book looks better when the bottom part of the pages are aligned. But when a new section starts, a huge amount of space is inserted in the previous page to flush the bottom of the page. Example:               \documentclass[draft=true,fontsize=10pt,pagesize,paper=148mm:215mm]{scrbook}     \usepackage[english]{babel}     \usepackage{blindtext}     \begin{document}       \chapter{Chapter 1}            \section{Section 1}            \blindtext[1]            \blindtext[4]            \blindtext[1]            \blindtext[2]            \section{Section 2}            \blindtext[4]     \end{document}      Is there a way to use `\flushbottom` paragraphs by default, but `\raggedbottom` on pages preceding a new section?


title: Right-align chapter/section/subsection header

text: How can I change the alignment of a chapter/section/subsection heading? Preferably, I want this to be something I specify in the header, as this will be necessary for all headers in the document.


title: Why do I get this undesired vertical space between "chapter #" and Chapter Heading?

text: In my document, one of my chapter title lasts more than one line, so I want to increase the space between its lines. To do this, I used `\linespread{1.8}\selectfont` in the code below, but by using that, the space between "`Chapter #`" and the `Chapter Heading` increases, too. How can I avoid this latter undesired space? By the way, I'd prefer not to use additional packages like `titlesec` or `setspace`.               \documentclass{book}     \makeatletter     \def\@makechapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright \normalfont         \ifnum \c@secnumdepth >\m@ne           \if@mainmatter             \huge\bfseries \@chapapp\space \thechapter             \par\nobreak             \vskip 20\p@           \fi         \fi         \interlinepenalty\@M         \Huge \bfseries \linespread{2}\selectfont #1\par\nobreak         \vskip 40\p@       }}     \makeatother     \begin{document}     \chapter{Chapter Heading which is very very very long}     Some text ...     \end{document}


title: Beamer - customising the Frankfurt theme

text: I use `beamer` together with `\usetheme{Frankfurt}`. My slides look like this: ![enter image description here](http://i.stack.imgur.com/qu2f8.png) Is that possible to change the color of the bullet in the header?               \documentclass[compress]{beamer}          \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{lmodern}               \usetheme{Frankfurt}     \useinnertheme{default}     \useoutertheme{default}     \usecolortheme{default}            \usefonttheme{professionalfonts}            \setbeamercolor{title}{bg=white, fg=red}     \setbeamercolor{frametitle}{bg=white, fg=red}     \setbeamercolor{section in head/foot}{fg=black, bg=white}          \begin{document}          \section{Section 1}     \stepcounter{subsection}     \begin{frame}     \frametitle{Slide 1}     \end{frame}          \begin{frame}     \frametitle{Slide 2}     \end{frame}          \end{document}


title: automatic nomenclature breaks with subfigure

text: I am using the method recommended in List of symbols/abbreviations and macros to automatically generate an entry to the nomenclature (nomencl package) when I first use a command, i.e.               \defsym{\Rn}{\mathbb{R}^n}     [...]     the first occurance $\Rn$ generates an orrurance in the nomenclature,     [...]     the second occurance $\Rn$ does not.      This works nicely, and as in the second version described in List of symbols/abbreviations and macros it also works for `\section{\Rn}` and in figure captions, however it fails when used in subfigures `\subfigure[\Rn]{}` if that is the first occurrence of the macro. A minimum example to demonstrate the error:               \errorcontextlines2     \documentclass[paper=a4,11pt]{scrbook}     \usepackage[refpage,noprefix]{nomencl}     \usepackage{subfigure}          \makeatletter     \newcommand*{\defsym}[3][]{\def#2{%       \ifx\protect\@unexpandable@protect         #3%       \else         \nomenclature{$#3$}{#1}\gdef#2{#3}#3%       \fi}     }     \makeatother     \makenomenclature     \begin{document}     \defsym{\MeshMacro}{{\cal M}^{\rm mac}}     % $\MeshMacro$ works nicely     \begin{figure}     \subfigure[$\MeshMacro$ goes to hell]{ }     \end{figure}     \printnomenclature     \end{document}      and the error message is               ! TeX capacity exceeded, sorry [input stack size=15000].     \nomenclature ->\protect \@nomenclature           \MeshMacro ...cal M}^{\rm mac}\else \nomenclature                                                        {${\cal M}^{\rm mac}$}{}\g...          \MeshMacro ...al M}^{\rm mac}$}{}\gdef \MeshMacro                                                        {{\cal M}^{\rm mac}}{\cal ...     ...     l.20 \subfigure[$\MeshMacro$ goes to hell]{ }      How can I avoid this problem?


title: how to escape special chars in \write18?

text: This is what I'm trying to do (it's just an example, not a real code):               \immediate\write18{echo "price: $5.00" > temp.tex}     \input{temp.tex}      This is what I see in `temp.tex`:               price: .00      What is a possible workaround?


title: Best way to use Linux Biolinum Keyboard with fontspec?

text: I am trying to typeset keyboard shortcuts in my document, e.g. `CTRL`+`SHIFT`+`S`. The Linux Libertine font family includes a nice keyboard font that I would like to use. What's the best way to use it with fontspec? I tried the following and while it works, my latex-foo isn't that great and I was wondering if there is a better way. I also tried to use `\char"XXXX` instead of using the unicode character directly, but that didn't work.               \newfontface{\keyboardfont}{Linux Biolinum Keyboard O}     \newcommand{\key}[1]{{\keyboardfont #1}}     \newcommand{\ctrl}{\key{}}     \newcommand{\shift}{\key{}}     \newcommand{\alt}{\key{}}     % etc.      This allows you to typeset "normal" keys by using the `\key` macro, but special keys all have to be set up individually. For example, you can type:               \ctrl+\shift+\key{S}       which results in: ![enter image description here](http://i.stack.imgur.com/ysei6.png) Is there a way to define a "smart" `\key` command that understands special keys? So that the above can be typed like this?               \key{ctrl}+\key{shift}+\key{S}       A similar question that unfortunately doesn't provide an answer for fontspec: Keyboard Font for LaTeX


title: Why won't this Metapost while loop terminate?

text: The following loop fails to terminate and I have no idea why. I've either violated some syntax rule, there's an issue with the self reference in `n:= floor (n/2);`, or I've missed something embarrassingly obvious.               \documentclass{article}     \usepackage{luamplib}     \begin{document}     \begin{mplibcode}          def divtwo(expr n)=         forever: exitunless n>1;             n:= floor (n/2);         endfor;     enddef;          divtwo(5);          end;          \end{mplibcode}     \end{document}      Edit: Thanks for the answers! The actual use case was to find the binary digits of a number (order irrelevant). Corrected (probably still bad) code:               \documentclass{article}     \usepackage{luamplib}     \begin{document}     \begin{mplibcode}     numeric k[];          def divtwo(expr n)=       save m;       m:=n;       j = 1;       forever: exitunless m>0;         b:= m mod 2;         m:= floor (m/2);         k[j]:=b;         j:=j+1;       endfor;     enddef;          divtwo(5);          end;          \end{mplibcode}     \end{document}


title: Why can't I set hyperref's pdfinfo from within a group? (Is it a bug?)

text: When I run the following code (using `hyperref` version `2012/09/27 v6.83g`), I do not get any errors or warnings, but the metadata I set using `pdfinfo` doesn't appear. If I uncomment the `\@firstofone` line, effectively removing the group, it does. I could not see any documentation in the manual that states one must be careful to use `pdfinfo` outside of all groups, so I have a feeling this might be a bug. Due to the grouping issue, I suspect this bug is caused by internal assignments in `hyperref` being local instead of global. I get a bit lost when reading the `hyperref` code, so I have so far been unable to determine the cause (and therefore a solution) to this problem.               \documentclass{article}     \usepackage{hyperref}          \makeatletter     %\@firstofone     {         \hypersetup{pdfinfo={extrainfo={yes please}}}     }          \begin{document}         Check the pdf metadata.     \end{document}      (Of course, in my actual example, I don't know how many levels deep I need to 'escape', and neither do I know any such way to escape! I cannot easily test my assumption about assignment locality as I am not aware of any trick to set a flag or something to make all assignments in a group global even if they were not defined `\global`, and I expect that may have other unwanted consequences anyway.) Is anyone able to offer a fix or a workaround?


title: Replacing text with another one

text: I need a command to replace the text from left to right given below. for example the command should change `Ã¼` into `\"{u}`. I found some command about this but i could't apply.               {Ã¼}{\"{u}}     {ÄŸ}{\u{g}}     {Ä±}{\i}     {ÅŸ}{\c{s}}     {Ã§}{\c{c}}     {Ã}{\"{o}}     {Ãœ}{\"{U}}     {Ä}{\u{G}}     {Ä°}{\.{I}}     {Å}{\c{S}}     {Ã‡}{\c{C}}     {Ã--}{\"{O}}


title: How to define a parameterized command to be consumable in \pgfmathdeclarefunction?

text: This is the solution to defining a piecewise function for pgfplots. However, I would like to be able to use a macro to define each of the pieces of the function. It is simple to do this if one is using a local `declare function` as shown in the MWE below which uses `\LocalPieceA` and `\LocalPieceB` as the definition of what the function does in the two separate domains. But, how do I do modify `\PieceA` and `\PieceB` so that I can use them in the `\pgfmathdeclarefunction`? I attempted to use the `##` trick that works when defining macros within macros that need to access the parameters of the outer macro, and Jake tried the `\edef\PieceA{\noexpand#1}` in the above referenced question and that too did not work.               \documentclass{article}     \usepackage{amsmath}     \usepackage{pgfplots}          \newcommand{\rLabel}{     $r(x)=     \begin{cases}         x & 0 < x < 1\\        -x+2 & 1 < x < 2\\         0 & \text{otherwise}     \end{cases}$     }          % Want to be able to use \PieceA and \PieceB in the \pgfmathdeclarefunction instead      % of (#1) and (-#1+2).  With [declare function], this is easy as shown below     \newcommand{\PieceA}{(##1)}     \newcommand{\PieceB}{(-##1+2)}          \pgfmathdeclarefunction{q}{1}{%       \pgfmathparse{((and(#1>0, #1<1)*#1)+(and(#1>1, #1<4)*(-#1+2)))}%     }          \tikzstyle{MyPlotStyle}=[domain=-5:5, samples=50, ultra thick]     \tikzstyle{rLabelStyle}=[above, yshift=-15ex, xshift=-25ex]          \begin{document}     %------------------ Using \pgfmathdeclarefunction -----------     Plot of $r(x)$ using PGF Version \pgfversion.          \begin{tikzpicture}       \begin{axis}[clip=false]         \addplot[MyPlotStyle, red]{q(x)} node [rLabelStyle] {\rLabel};       \end{axis}     \end{tikzpicture}          % --------------------- Using "declare function" -------------     Using declare function to define localp(x) and localq(x):          \newcommand{\LocalPieceA}{(\x)}% These two works great!!     \newcommand{\LocalPieceB}{(-\x+2)}     \begin{tikzpicture}     [declare function={localr(\x) =  and(\x > 0, \x < 1)*\LocalPieceA+and(\x > 1, \x < 4)*\LocalPieceB;}]       \begin{axis}[clip=false]         \addplot[MyPlotStyle, blue]{localr(x)}  node [rLabelStyle] {\rLabel};       \end{axis}     \end{tikzpicture}     \end{document}


title: Spacing for subscripts in mathmode with \textcolor

text: It is possible to use `\textcolor` in math-mode; however, it changes the spacing of subscripts.               \documentclass{article}     \usepackage[usenames]{xcolor}     \begin{document}     $Y_i$ vs $\textcolor{red}{Y}_i$ vs $\mathord{\textcolor{red}{Y}}_i$ vs $\color{red}Y\color{black}_i$ vs $\begingroup\color{red}Y\endgroup_i$     \end{document}      Is there any way of fixing the spacing? This suggestion (the last two examples) also didn't help. An additional complication is that I intend to use this within a macro. So, I am aiming for something like:               \newcommand{\parameter}{\textcolor{red}{Y}}     We use both $\parameter$ and $\parameter_i$      `tex --version` outputs `TeX 3.1415926 (TeX Live 2013)`.


title: Why figures are after references in Bidi texmaker?

text: I use Biditexmaker and Xepersian package to write my document.   In the last chapter i have some figures which appear after the references when i run the file. How can i fix this problem?


title: Can anyone help me mimick the style of ltxdockit?

text: First, I'd like you to take a look at the documentation of the `mathspec` package. Now I'm not interested in the package as such, but I'd like to use a style like the one used in the documentation. For instance:   * ~~The short title, subtitle and author section~~   * ~~two-pane TOC~~   * ~~all text is indented, things like list numbers and section numbers are "outset" to the left.~~   * certain keywords (like `\usepackage`) are also outset to the left, while the parameters are indented to the same level as the rest of the text.   * ~~table descriptions, with the nice title, etc.~~   * the "Advanced" sections, with an extra indentation, or whatever this is.   * ~~line numbers of listings are at the same level as section numbers, while the sourcecode is at the same indentation as the body text.~~ I know this is rather a lot, but I like this style very much, and I think it would do great on manuals, and general shorter reports/papers. Stuff like colors, fonts, etc. are no problem for me with XeLaTeX, but getting the keywords indentation right, I can't seem to do that. * * * So far, I've succeeded making the short title with `scrartcl`, and the short and two column TOC with `multitoc` Making the section numbering be in the margin, I made that with               \makeatletter         \def\@seccntformat#1{\protect\makebox[0pt][r]{\csname the#1\endcsname\hspace{\marglistsep}}}     \makeatother      The problem that I try to tackle now, is to have list items appear in the margin as well. What I mean is exactly like for instance the `\usepackage` item in the PDF. When considering the left margin, I need zero indentation (the content is flush with the left margin), while the item name, is set to the left inside the margin, and ends just at the end of the left margin - I hope this is descriptive enough. the `listings` package predefines line numbers in margins, so that was rather easy to achieve. Getting the "nice" table as it is defined in `ltxdockit` was rather complicated: Using the packages `caption` and `booktabs`, as well as `floatrow`:               \DeclareCaptionFont{spot}{\color{spot}}          \DeclareCaptionLabelSeparator{enskip}{\enskip}     \DeclareCaptionLabelFormat{lc}{\MakeLowercase{#1}~\MakeLowercase{#2}}          \captionsetup{         font=small,         labelformat=lc,         labelfont={sc,bf,spot},         labelsep=enskip,         indention=0pt,         format=plain,     }      _(color "spot" must be defined further above in this example)_ The table itself must be made like this:               \begin{table}[h] \centering     \ttabbox{         \caption{this is the caption\label{tab:cap}}     }{         \begin{tabular}             ...         \end{tabular}     }     \end{table}


title: Table Row Spacing

text: I created a table in LaTex using TeXstudio and cannot properly horizontally space the content within the last column.               \documentclass[12pt,a5paper,onecolumn]{book}     \usepackage{fontspec}     \usepackage{array}     \usepackage{setspace}      \usepackage[width=5.25in, height=8.00in, left=0.50in, right=0.50in, top=0.25in, bottom=0.25in]{geometry}     \begin{document}     \begin{tabular}{ | m{2cm} | m{1.491cm} | c | c | m{1.4cm} | }     \hline     & \centering{Front} & Near-front & Central & \hspace{1.25ex}Back\\     \hline     \centering Close & \centering 〈ii〉 [i]&  &  &\\[5mm]     \hline     \centering Near-close &  & \centering 〈e〉 [ɪ] &  & \\[5mm]     \hline     \centering Mid & \centering 〈a〉 [e̞] &  &  & 〈y〉 [o̞]\\[5mm]     \hline     \centering Open-mid & \centering 〈i〉 [ɛ] & & 〈o〉 [ɞ] &\\[5mm]     \hline     \centering Open & \centering 〈ee | u〉 [ɶ] & & \centering 〈ȧ〉 [ä] &\\[10mm]     \hline     \end{tabular}     \end{document}      ![1](http://i.imgur.com/vFCtf7c.png) As you can see, the "Back" column is giving me issues. Without the `\hspace{1.25ex}` the word becomes no longer centered and applying`\centering` to the word returns an error. Also, although I have `m{1.4cm}` for middle alignment in the last column, it seems to ignore it completely. I am not sure what I am doing wrong since middle alignment and `\centering` have worked in the other columns.


title: How to use \futurelet to define optional parameters

text: I am trying to create a simple macro using TeX with optional parameters:                \elide[options]{}      I understand a common way is to use `\futurelet`. So far the code is as follows:               \documentclass[11pt]{article}     \begin{document}          \def\elidebefore[#1]#2{[$\ldots$] #2}     \def\elideafter#1{#1$\ldots$}          \def\elide {%     \futurelet\ifoptions         \choosemacro     }          % The \choosemacro, based on     % the lookahead of \elide, calls     % either \elidebefore or \elideafter                \def\choosemacro{%      \ifx\ifoptions [%          \let\choice = \elidebefore       \else         \let\choice = \elideafter      \fi     \choice     }          Testing \elide[b]{Lorem ipsum}          \elide{Lorem Ipsum}          \elide[b]{Lorem ipsum}          \end{document}      This works ... but since I am only checking if the square bracket exists and switching to either macro1 or macro2 `elide[]{}` will work with anything in- between the square brackets. How, can I extend the macro to read the letters between the square brackets? Is there a predefined LaTeX macro that one can use? (I know about `keyval`, but I just prefer to do this with basic commands).


title: package wallpaper for landscape, latex

text: I'm using `wallpaper` package to put background image on each page. I'm facing problem to put image on landscape on right position. I need to put it upper left corner of the page. I It seems that it is not rotating with landscape.               \documentclass[a4paper,twoside,10pt]{report}          \usepackage[ngerman]{babel}     \usepackage{pst-all}      \usepackage[pdftex]{graphicx}      \usepackage{wallpaper}     \usepackage{pdflscape}     \usepackage{fancyhdr}      \begin{document}          \URCornerWallPaper{0.20}{Grafik/AA_Logo.jpg}     .     .     \newpage     \begin{landscape}     .     .     \newpage          ...     \end{landscape}          \newpage     .          \end{document}


title: I'm not managing to download from CTAN. How can I select the mirror I use?

text: Yesterday I was stumped while not managing to download any package from CTAN. While I could navigate and browse the directories, any time I selected a file to download the request would time-out. A web search reveled nothing. No-one else seemed to have the same problem, and I was stumped. After while, I realized that CTAN is distributed on many mirrors across the globe and most likely the actual downloading is undertaken by an automatically selected mirror. What I didn't manage to find out was how to control the mirror I am downloading from. So: my questions are: > How can I download a file from CTAN from a manually selected mirror rather > than the automatically selected one? How can I find out which mirror is > automatically selected for me? I guess I could use this as a platform to suggest a possible improvement to the powers (at CTAN.org) that be: Add a little randomization to the mirror selection algorithm. Even if you don't know whether the best mirror for me is up or down, if you have 5 mirrors close to me, I don't need the closest one all the time, I'd rather not risk getting stuck with a broken mirror for 12 hours...


title: Why the thebibliography cannot use Chinese?

text: **_Toady,I want to add reference to my paper,I use the command`thebibliography`,my trial as below:_**               \documentclass[a4paper,cs4size,UTF8]{ctexart}     \begin{document}     \section{数学软件Wolfram Mathematica\cite{one}}     本文的主要是关于SCARA机器人的运动学和动力学研究，涉及到符号计算、数值计算和图形的可视化，这恰好是Mathematica所擅长的领域，因此首先对Mathematica做一个简单的介绍。          Mathematica是美国Wolfrmn Research公司研制开发的著名数学软件系统，是一种强大的数学计算、处理和分析的工具。自1987年发布系统的1.0版本开始，便迅速广为流传，后经不断改进和完善，现在的最新版本是Wolfram Mathematica 9.0。          \begin{thebibliography}{99}     \bibitem[one]{(美).Saeed B. Niku 著.机器人学导论：分析、控制及应用[M].电子工业出版社，     2013(TP24/36)}      \bibitem[two]{袭宗燕 著. Mathematica数学软件系统的应用及其程序设计[M].电子工业出版社，     1996(TP198)}     \end{thebibliography}     \end{document}        **However,The LaTeX cannot compile.So my question is how to revise it?**


title: custom mapping for >italicize marked text / text under cursor< (using vim)

text: I can't find this here, nor anywhere else. Either it's too simple, or I'm looking at the wrong places, or whatever. (Maybe the answer is out there somewhere, or worse, in here somewhere without my knowing). I'd like to create a "shortcut". when my cursor is on a certain word, I want this word to become (in output) italic, meaning to surround it by \emph{some word}. I'm using vim (with LaTeX-Suite) so it is quite straightforward to use `FEM` to start italic "mode" and `ctrl`-`j` to "end it". but on already written text, it becomes more complicated. after researching,   I tried               :call IMAP ("< S-F6>", "b i FEM < ESC> d e i { < ESC> e a } < ESC>", "tex")*      (I will translate this into words: go to beginning of word, insert, create \emph environment, escape(to normal mode), delete to end of word (i.e., to end of <++>), insert {, escape, go to end of word, insert } (after), then escape back into normal mode. sounds complicated, I guess there's millions of other ways of doing it but that's not the problem)   I tried with various versions of adding `\` before `< ESC>` and `}` (i think vim likes that), not using spaces, and the like. nothing happened. I also tried               :nm {< S-F6>} {see above}        and then I ran out of energy and gave up. alright, so maybe   * the function already exists somewhere    * `shift`-`f6` is not an accepted operator    * ??? in any case, I hope you can help *N.B. I have added a _space_ after every `<` because otherwise it wouldn't print. it is not in the code (attempts)


title: Adding double arrows to the middle of a line with TikZ

text: I am using `tkz-euclide` package and I am drawing a figure where I would like to put two arrows in the center of the line, exactly as seen in this figure: ![enter image description here](http://i.stack.imgur.com/tHQRR.png) Ideally, I may want to create a single arrow, two arrows, three arrows, etc. in the center of a line, so a generalized solution would be great.


title: Coloring a black and white PDF graphic

text: I have a graphic in PDF format (originally converted from an SVG) that is monochromatic (black on white). Is it possible using TikZ or PSTricks but not (Illustrator or Inkscape) to include this image in a different color? **Example** : ![enter image description here](http://i.stack.imgur.com/ut8JC.png) While it lasts (there seems to be no long term way to host a pdf), you can download the above image as a PDF. **Edit:** Simple was perhaps a bit of a misnomer - the pdfs are cropped and monochromatic, but to intricate to redraw on my own. The above example is a character from a font (which I _can_ recolor), but it gives a good example of what shapes I am talking about.


title: Side-by-Side threeparttable?

text: I have an minor issue in which I have two threeparttables that are small enough to fit onto one landscape page, but I can't figure out how to get them to be side by side. Including two threeparttable environments inside the table environment only puts them above and below each other (for me at least). Any suggestions? I posted the tables below. Sorry they're not simpler, but I wanted to include everything that I'm working with (in case it's some other package I'm using that's causing the problem.)               \usepackage{threeparttable}     \usepackage{dcolumn}     \usepackage{multicolumn}     \usepackage{multirow}     \usepackage{amsmath}          \begin{document}          \begin{table}[p]      \centering          \begin{threeparttable}          \caption{Variance Decomposition: 1915--1963$^a$}          \label{VarDecomp}          \begin{tabular}{c | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{1.2} | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{2.2} }          \hline \hline     \multirow{2}{*}{Period} & \multicolumn{3}{c |}{Output Growth} & \multicolumn{3}{c}{Deficit Ratio} \\     &  \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c |}{$\varepsilon_g$} & \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c}{$\varepsilon_g$} \\ \hline          1 & 3.13 & 89.86 & 7.01 & 0.99 & 24.41 & 74.60 \\          2 & 2.04 & 88.74 & 9.22 & 1.05 & 29.32 & 69.63 \\          3 & 1.45 & 94.10 & 4.45 & 0.98 & 35.78 & 63.24 \\          4 & 1.64 & 98.15 & 0.21 & 0.98 & 39.97 & 59.06 \\          5 & 2.25 & 96.10 & 1.65 & 1.04 & 42.31 & 56.65 \\ \hline          6 & 2.92 & 89.87 & 7.21 & 1.16 & 43.50 & 55.34 \\          7 & 3.40 & 84.91 & 11.69 & 1.31 & 43.82 & 54.87 \\          8 & 3.64 & 84.18 & 12.18 & 1.46 & 43.52 & 55.02 \\          9 & 3.68 & 86.36 & 9.96 & 1.56 & 42.92 & 55.52 \\          10 & 3.60 & 89.09 & 7.30 & 1.61 & 42.31 & 56.08 \\ \hline          11 & 3.49 & 91.13 & 5.38 & 1.59 & 41.87 & 56.53 \\          12 & 3.39 & 92.28 & 4.33 & 1.55 & 41.65 & 56.80 \\          13 & 3.34 & 92.75 & 3.91 & 1.50 & 41.61 & 56.89 \\          14 & 3.34 & 92.78 & 3.88 & 1.46 & 41.67 & 56.87 \\          15 & 3.38 & 92.55 & 4.07 & 1.44 & 41.76 & 56.80 \\ \hline          16 & 3.46 & 92.22 & 4.32 & 1.42 & 41.85 & 56.73 \\          17 & 3.56 & 91.88 & 4.56 & 1.41 & 41.90 & 56.68 \\          18 & 3.68 & 91.59 & 4.73 & 1.41 & 41.93 & 56.65 \\          19 & 3.80 & 91.38 & 4.82 & 1.41 & 41.94 & 56.65 \\          20 & 3.92 & 91.23 & 4.85 & 1.41 & 41.93 & 56.66   \\           \hline \hline     \end{tabular}          \begin{tablenotes}         \footnotesize         \item[a] Results are expressed as a percent of variation.         \item[b] The shock $\varepsilon_\tau$ represents the cumulative effects of shocks to the top marginal rate $\varepsilon_m$ and the capital gains rate $\varepsilon_c$.     \end{tablenotes}          \end{threeparttable}           \quad          \begin{threeparttable}          \caption{Variance Decomposition: 1964--2012$^a$}          \label{VarDecomp}          \begin{tabular}{c | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{1.2} | D{.}{.}{1.2} D{.}{.}{2.2} D{.}{.}{2.2} }          \hline \hline     \multirow{2}{*}{Period} & \multicolumn{3}{c |}{Output Growth} & \multicolumn{3}{c}{Deficit Ratio} \\     &  \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c |}{$\varepsilon_g$} & \multicolumn{1}{c}{${\varepsilon_\tau}^b$} & \multicolumn{1}{c}{$\varepsilon_y$} & \multicolumn{1}{c}{$\varepsilon_g$} \\ \hline          1 & 3.13 & 89.86 & 7.01 & 0.99 & 24.41 & 74.60 \\          2 & 2.04 & 88.74 & 9.22 & 1.05 & 29.32 & 69.63 \\          3 & 1.45 & 94.10 & 4.45 & 0.98 & 35.78 & 63.24 \\          4 & 1.64 & 98.15 & 0.21 & 0.98 & 39.97 & 59.06 \\          5 & 2.25 & 96.10 & 1.65 & 1.04 & 42.31 & 56.65 \\ \hline          6 & 2.92 & 89.87 & 7.21 & 1.16 & 43.50 & 55.34 \\          7 & 3.40 & 84.91 & 11.69 & 1.31 & 43.82 & 54.87 \\          8 & 3.64 & 84.18 & 12.18 & 1.46 & 43.52 & 55.02 \\          9 & 3.68 & 86.36 & 9.96 & 1.56 & 42.92 & 55.52 \\          10 & 3.60 & 89.09 & 7.30 & 1.61 & 42.31 & 56.08 \\ \hline          11 & 3.49 & 91.13 & 5.38 & 1.59 & 41.87 & 56.53 \\          12 & 3.39 & 92.28 & 4.33 & 1.55 & 41.65 & 56.80 \\          13 & 3.34 & 92.75 & 3.91 & 1.50 & 41.61 & 56.89 \\          14 & 3.34 & 92.78 & 3.88 & 1.46 & 41.67 & 56.87 \\          15 & 3.38 & 92.55 & 4.07 & 1.44 & 41.76 & 56.80 \\ \hline          16 & 3.46 & 92.22 & 4.32 & 1.42 & 41.85 & 56.73 \\          17 & 3.56 & 91.88 & 4.56 & 1.41 & 41.90 & 56.68 \\          18 & 3.68 & 91.59 & 4.73 & 1.41 & 41.93 & 56.65 \\          19 & 3.80 & 91.38 & 4.82 & 1.41 & 41.94 & 56.65 \\          20 & 3.92 & 91.23 & 4.85 & 1.41 & 41.93 & 56.66   \\           \hline \hline     \end{tabular}          \begin{tablenotes}         \footnotesize         \item[a] Results are expressed as a percent of variation.         \item[b] The shock $\varepsilon_\tau$ represents the cumulative effects of shocks to the top marginal rate $\varepsilon_m$ and the capital gains rate $\varepsilon_c$.     \end{tablenotes}          \end{threeparttable}          \end{table}          \end{document}


title: Increase font size in a .sty file

text: I've a .sty file that contains the theme for a beamerposter file. I'm trying to increase the font size of the blocks (for both the title and the text within it), but whatever change I do, nothing happens. Can anyone help me to figure out the specific changes I need to make in the file. I'd really appreciate any help.               \ProvidesPackage{beamerthemeI6dv} % this style was created by David Vilar          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \selectcolormodel{cmyk}     \mode<presentation>          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          % custom colors     \definecolor{i6blue}{cmyk}{1,0.305,0,0.06}     \definecolor{i6bluedark}{rgb}{0.0156,0.2578,0.5625}      % http://www.colorsontheweb.com/colorwizard.asp#wizard, used start set: #0066cc     \definecolor{i6colorscheme1}{HTML}{FF6518}  % e.g. for block title     \definecolor{i6colorblockbg}{HTML}{0033cc}     \definecolor{i6colorblockfg}{HTML}{FCE94F}     \definecolor{i6colorscheme2}{HTML}{000000}  % e.g. title in headline     \definecolor{i6colorscheme3}{HTML}{C3DFFF}  % e.g. for poster background     \definecolor{i6colorscheme4}{HTML}{000000}      \definecolor{i6colorschemeHeadline}{HTML}{0033cc}  % for headline bg     %\definecolor{i6colorschemeFootline}{HTML}{000000}  % for headline bg     \definecolor{i6colorschemeFootline}{HTML}{100D09}  % for headline bg          % headline colors and fonts     \setbeamercolor{headline}{fg=white,bg=i6colorschemeHeadline}     \setbeamercolor{title in headline}{fg=white}     \setbeamercolor{author in headline}{fg=lightgray}     \setbeamercolor{institute in headline}{fg=lightgray}     \setbeamercolor{logo in headline}{fg=black,bg=lightgray}     \setbeamercolor{separation line}{bg=i6colorscheme1}          % footline colors and fonts     \setbeamercolor{footline}{fg=white,bg=i6colorschemeHeadline}     \setbeamerfont{footline}{fg=white, size=\normalsize}          % body colors and fonts     \setbeamercolor*{normal text}{fg=black,bg=i6colorscheme3}          % block environment     \setbeamercolor*{block body}{bg=white,fg=black}     \setbeamercolor*{block title}{fg=i6colorblockfg,bg=i6colorblockbg}     \setbeamerfont{block title}{size=\large,series=\bf}          % example environment     \setbeamercolor*{example title}{fg=white,bg=i6colorscheme1}     \setbeamerfont{example title}{size=\large,series=\bf,bg=i6colorscheme1,fg=white}               %\setbeamercolor*{example body}{fg=white,bg=i6colorscheme4}     %\setbeamercolor*{example title}{fg=white,bg=i6colorscheme1}               %  \setbeamercolor{framesubtitle}{fg=ta3orange, bg=ta2gray}     %  \setbeamercolor{author in head/foot}{fg=tabutter, bg=black}     %  \setbeamercolor{title in head/foot}{bg=tabutter, fg=black}               \setbeamercolor{alerted text}{fg=i6colorscheme1}     %\setbeamercolor{structure}{fg=i6blue}          %  \setbeamertemplate{itemize/enumerate body begin}{     %  }     %  \setbeamertemplate{itemize/enumerate body end}{     %  }          \setbeamertemplate{itemize items}[triangle]     \setbeamertemplate{navigation symbols}{}  % no navigation on a poster          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \setbeamertemplate{block begin}{       \vskip.75ex       \begin{beamercolorbox}[leftskip=1cm,colsep*=.75ex]{block title}%         \usebeamerfont*{block title}\insertblocktitle       \end{beamercolorbox}%       {\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%       \usebeamerfont{block body}%       \begin{beamercolorbox}[colsep*=.75ex,sep=.75ex,vmode]{block body}%         \ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%       }       \setbeamertemplate{block end}{       \end{beamercolorbox}     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \setbeamertemplate{headline}{         \leavevmode            \begin{beamercolorbox}[wd=\paperwidth]{headline}         \begin{columns}[T]           \begin{column}{.02\paperwidth}           \end{column}           \begin{column}{.07\paperwidth}             \begin{center}               %\includegraphics[width=.6\linewidth]{logos/i6-hks44}             \end{center}             \vskip1ex           \end{column}           \begin{column}{.68\paperwidth}             \vskip4ex             \raggedleft             \usebeamercolor{title in headline}{\color{fg}\textbf{\LARGE{\inserttitle}}\\[3.5ex]}             \usebeamercolor{author in headline}{\color{fg}\large{\insertauthor}\\[1ex]}             \usebeamercolor{institute in headline}{\color{fg}\large{\insertinstitute}\\[1ex]}                \end{column}           \begin{column}{.25\paperwidth}             \vskip1cm             \begin{center}               \includegraphics[width=0.9\linewidth]{TUOS_Logo.jpg}             \end{center}             \vskip1.5cm           \end{column}           \begin{column}{.03\paperwidth}           \end{column}         \end{columns}       \end{beamercolorbox}          %%      \begin{beamercolorbox}[sep=0.1cm,wd=.1\paperwidth,center]{logo in headline}     %%        \vskip2ex     %%      \end{beamercolorbox}       %%      \begin{beamercolorbox}[sep=1cm,wd=.7\paperwidth]{headline}     %%        \usebeamercolor{title in headline}{\raggedright\color{fg}\textbf{\LARGE{\inserttitle}}\\[1ex]}     %%        \usebeamercolor{author in headline}{\raggedright\color{fg}\large{\insertauthor}\\[1ex]}     %%        \usebeamercolor{institute in headline}{\raggedright\color{fg}\large{\insertinstitute}\\[1ex]}          %%      \end{beamercolorbox}%     %%      \begin{beamercolorbox}[sep=0.1cm,wd=.18\paperwidth,center]{logo in headline}     %%        \includegraphics[height=5cm]{logos/rwth-hks44}     %%        \vskip2ex     %%      \end{beamercolorbox}       %%    \end{beamercolorbox}            \begin{beamercolorbox}[wd=\paperwidth]{lower separation line head}         \rule{0pt}{2pt}       \end{beamercolorbox}     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \setbeamertemplate{footline}{       \begin{beamercolorbox}[wd=\paperwidth]{upper separation line foot}         \rule{0pt}{6pt}       \end{beamercolorbox}            \begin{beamercolorbox}[ht=1\baselineskip,leftskip=1cm]{footline}%         Department of Automatic Control and Systems Engineering - The University of Sheffield - UK \hfill -- \hfill         Email: \texttt{jrayalasolares1@sheffield.ac.uk} %\hfill --\hfill     %    \texttt{http://www-i6.informatik.rwth-aachen.de}           \end{beamercolorbox}            \begin{beamercolorbox}[wd=\paperwidth]{lower separation line foot}         \rule{0pt}{2pt}       \end{beamercolorbox}     }          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \mode<all>                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% Local Variables:      %%% mode: latex     %%% TeX-master: "poster"     %%% TeX-PDF-mode: t     %%% End:


title: compiling pdflatex from the terminal in vim

text: A file I can compile in Texmaker won't compile after editing in Vim. I am giving the error hw9problem1xplot can't be found. This is from an includegraphics command. However, the pdf image file is in the same folder as the tex file, and I was able to compile this file with the includegraphics from Texmaker. What I have been doing is `:w` and `:!pdflatex %` but I am told that the pdf image file doesn't exist or it can't find it. How can this be? I can compile the file in Texmaker without an issue. **So I found the problem, Vim is saving the file elsewhere and not where I pulled the file from. So it is looking for the pdf in the wrong directory. How can I change where Vim saves the file?** What do I need to setup to correct this issue? After vonbrand's a suggestion, I tried running `:!pdflatex -shell-escape %`. Unfortunately, I received the same error message.               ! LaTeX Error: File `hw9problem1xplot' not found.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.     ...                                                        l.86 ...degraphics[width = 3in]{hw9problem1xplot}}      I have tried hw9problem1xplot with and without .pdf too. I commented out the figure with the with the includegraphics and it compiled without an issue. I double checked the folder and the pdfs are present so I don't know what the problem is.


title: Creating temporary definitions for commands

text: In the context of writing something like homework solutions for a math class, I often face an awkward situation. Each problem will have some idiomatic functions that are cumbersome and error prone to rewrite. For example,               f(x)=\sup_{\xi\in\mathcal{A}}\sum_{k=1}^\infty \phi_k(x,\xi)      One solution, to avoid rewriting the right hand side is               \newcommand{\f}[1]{\sup_{\xi\in\mathcal{A}}\sum_{k=1}^\infty \phi_k(#1,\xi)}      This allows me to write out the right hand side in its entirety with less chance of typos, when I don't need to manipulate the subparts of the expression, making for cleaner code. However in some cases, the function `f` may take on different definitions in different problems, so I would often need to redefine it. Is there a way to make a definition local to some part of the code so that the redefinition will have less chance of affecting the other parts of my code in case I forget to redefine the variable? This is especially important if formatting the function requires some manual spacing adjustments which make the code cluttered.


title: Compiling a Latex template to a PDF file

text: I'm trying to compile a LaTeX template to a PDF, but it's not working. The template is available in this link (on the right side in Article Templates). I'm using TeXnic Center. Can anyone please try to compile this and let me know if it's working.


title: `Don't talk to me': - How to render apostrophe within single quotation?

text: I have issues rendering with LaTeX ``Don't talk to me':` I have this title as bibliographic entry in Zotero (it starts exactly like that). LaTeX & Biber complain when I try to parse the `.bib` file with that entry. How could I correct the entry in Zotero to avoid problems by playing safe with encoding problems (but also to keep Zotero compatible with other apps)?


title: Bug in glossaries package while using hyperref?

text: I compile the following code:               \documentclass{scrreprt}     \usepackage{blindtext}     \usepackage[         bookmarks=true,         bookmarksopen=true,         colorlinks=true,         anchorcolor=blue,         filecolor=blue,         citecolor=black,         urlcolor=black,         linkcolor=black,         menucolor=blue,         breaklinks=true     ]{hyperref}     \usepackage{glossaries}          \makeglossaries               \newglossaryentry{symb:band_energy}{     name=\ensuremath{\epsilon_k},     description={Band energy in momentum space}     }          \title{Title goes here}     \author{Me of course}          \begin{document}          \maketitle     \pagenumbering{Roman}     \blindtext     \clearpage          \pagenumbering{arabic}     \blindtext     We will refer to the band structure as \gls{symb:band_energy}.          \printglossary[style=index]          \end{document}      The problem is, when clicking in the pdf on the page number given in the glossary (which is the correct one), one will end up on the title page! Is this a bug or did I miss something? I'Ve been reading about problems with `hyperref` and `glossaries` but this wasn't mentioned anywhere.


title: What's a good editor for (La)TeX programming?

text: I've found several questions about editors for writing LaTeX _documents_ ( LaTeX Editors/IDEs seems to be the definitive one). But I'd like to know which editors are out there that help you develop LaTeX _packages_ or _classes_ ; editors that make it easier to _program_ in LaTeX; a completely different activity. When I'm programming I don't really care about symbol lookup, instant previews, SyncTeX or anything like that. I'd be more interested in features such as those in the following non-exhaustive list:   * an integrated build system and syntax highlighter that understand `.dtx` (and friends)   * smart auto-complete that draws from included packages   * hyper-linking between command definitions and usages   * tool-tips that show command documentation   * native support for `etoolbox`, `etextools`, `latex3` and the like (in some shape or form)   * step-by-step expansion preview of selected code (a form of debugging)   * ability to recognize / select tokens (in addition to characters)   * an `\expandafter`-helper (you just point, the editor inserts the necessary `\expandafter`s)   * automatic searching on CTAN Well, I could go on, but you get the point. I call upon all package authors: Which editor do you like? And why? (One editor per answer, please.)


title: Placing points on a curve generated using PGF plot

text: Using methods like this one (and with more details here) can be useful when one tries to draw _"free"_ curves. However, once a free curve is obtained it can be very useful to access arbitrary points on it. Unfortunately, the following naive approach is useless:               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}       \draw[->] (-2,0) -- (2,0);       \draw[->] (0,-2) -- (0,2);            \draw[thick,mark=ball] plot [smooth,tension=1.5] coordinates{(1,1) (1.4,0.5) (0.4,-0.2) (0.6,-0.2) (0.2,-1.4) (-0.5,-1.1) (-1,-1.6) (-1.4,0.4)}       node[pos=0.5]{A} node[pos=0.9]{B};     \end{tikzpicture}     \end{document}      since it yields the following: ![enter image description here](http://i.stack.imgur.com/z0F9c.png) So what is the right way to specify points on a curve generated as above?


title: Using collect to gather content with listings, comments or verbatims

text: I was looking into a way to set up a project with multiple files, in which several files could declare content to be included in different sections of the main tex document. After this Q&A, I decided to go with the `collect` package. However, if the text I'm including has any `verbatim`, `lstlisting` or `comment` content, the compilation fails. As an example, based on the answer provided by Gonzalo Medina in the previous question: First, to declare environments which will collect the content in the subfiles:               \usepackage{collect}          \definecollection{notes}     \definecollection{examples}          \makeatletter     \newenvironment{note}       {\@nameuse{collect}{notes}{\par\noindent}{\par}{}{}}       {\@nameuse{endcollect}}     \newenvironment{example}       {\@nameuse{collect}{examples}{\par\noindent}{\par}{}{}}       {\@nameuse{endcollect}}     \makeatother      In files `a.tex` and `b.tex`, which will provide the content for the main file: ### File `a.tex`:               \begin{note}     First note in file \texttt{a.tex}.     \end{note}          \begin{note}     Second note in file \texttt{a.tex}.     \begin{comment}     Hidden note in file \texttt{a.tex}.     \end{comment}     \end{note}          \begin{example}     \begin{lstlisting}     Code example with listings in file \texttt{a.tex}.     \end{lstlisting}     \end{example}          \begin{example}     \begin{verbatim}     Code example in verbatim in file \texttt{a.tex}.     \end{verbatim}     \end{example}      ### File `b.tex`:               \begin{note}     First note in file \texttt{b.tex}.     \end{note}          \begin{note}     Second note in file \texttt{b.tex}.     \begin{comment}     Hidden note in file \texttt{b.tex}.     \end{comment}     \end{note}          \begin{example}     \begin{lstlisting}     Code example with listings in file \texttt{b.tex}.     \end{lstlisting}     \end{example}          \begin{example}     \begin{verbatim}     Code example in verbatim in file \texttt{b.tex}.     \end{verbatim}     \end{example}      Main document then includes both files and renders first the `notes` collection followed by the `examples` collection: ### File `document.tex`:               \documentclass{article}     \usepackage{collect}     \usepackage{listings}     \usepackage{verbatim}     \usepackage{comment}          \definecollection{notes}     \definecollection{examples}          \makeatletter     \newenvironment{note}       {\@nameuse{collect}{notes}{\par\noindent}{\par}{}{}}       {\@nameuse{endcollect}}     \newenvironment{example}       {\@nameuse{collect}{examples}{\par\noindent}{\par}{}{}}       {\@nameuse{endcollect}}     \makeatother          \input{a}\input{b}          \begin{document}          \section{Notes}     \includecollection{notes}          \section{Examples}     \includecollection{examples}          \end{document}      So the result should be:               Notes          First note in file a.tex     Second note in file a.tex     First note in file b.tex     Second note in file b.tex          Examples          Code example with listings in file a.tex     Code example with verbatim in file a.tex     Code example with listings in file b.tex     Code example with verbatim in file b.tex


title: biblatex - How can I force a colon after a period?

text: I'd like to print a colon after a period, i.e. after _Hrsg._ (German version of _eds._ ). How can I achieve to have a colon after the string for `{editors}`? ## Picture ![enter image description here](http://i.stack.imgur.com/omT5b.png) ## MWE               \documentclass[     a4paper,     12pt,     ngerman     ]{scrartcl}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage[ngerman]{babel}          \usepackage[     language=german,     style=authoryear-ibid,     backend=biber,     hyperref=true,     dashed=false,     isbn=false,     doi=false,     maxcitenames=2,     maxbibnames=99,     sorting=nyt,     firstinits=true,     uniquename=init,     uniquelist=false,     autocite=footnote,     ibidtracker=true,     date=comp,     mincrossrefs=1,     ]{biblatex}     \usepackage{xpatch}          \DefineBibliographyStrings{german}{%         byeditor = {Hrsg.},%         byeditor = {Hrsg.},%         andothers={et \addabbrvspace al\adddot},     }     \renewbibmacro*{byeditor+others}{%         \ifnameundef{editor}         {}         {\usebibmacro{byeditor+othersstrg}%             \setunit{\addcolon\addspace}%             \printnames[byeditor]{editor}%             \newunit%             \clearname{editor}%             \newunit}         \usebibmacro{byeditorx}%         \usebibmacro{bytranslator+others}}          \begin{filecontents}{\jobname.bib}     @incollection{abc,     Title                    = {Stuff},     Author                   = {Lamp, Jones},     Date                     = {2011},     Crossref ={ddd}     }     @collection{ddd,         Title= {Words},         Editor={Smith, John and Doe, Jane},         Date={2012},         Location={Towntown}     }     \end{filecontents}          \addbibresource{\jobname.bib}     \nocite{*}          \listfiles          \begin{document}     Words.          \printbibliography     \end{document}


title: Bibliography in LaTeX: Spaces between words

text: I'm writing the bibliography. LaTeX don't write it well. I don't know why. I have tried the tow methods: `\begin{thebibliography}` and using BiBTeX. The result is the same. The result is longer spaces between some words. ![enter image description here](http://i.stack.imgur.com/APZvi.png) Anybody can help me? Thanks!


title: Beamer - define highlight color

text: I am using Beamer for the first time. I use `setbeamercolor` to change most of the colors of the `miniframes` and so on. But how to I change the color of the highlighted text in the headline and table of content. Right now it is bright green.               \documentclass[xcolor=dvipsnames,compress,12pt]{beamer}%     \mode<presentation>          %% General document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage{beamerthemeshadow}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %% Beamer Layout %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \useoutertheme[subsection=false,shadow]{miniframes}     \usecolortheme{seahorse}     \usecolortheme{rose}     \usefonttheme{serif}


title: TL2011 installation keeps failing due to error

text: Installing [0960/2311, time/total: 22:33/56:42]: hfoldsty [598k]     Installing [0961/2311, time/total: 22:39/56:53]: hhtensor [167k]     Installing [0962/2311, time/total: 22:43/57:02]: histogr [95k]     ./tlpkg/installer/xz/xzdec.x86_64-linux: (stdin): Unexpected end of input     tar: Unexpected EOF in archive     tar: Unexpected EOF in archive     tar: Error is not recoverable: exiting now     untar: untarring /home/peter/texlive/2011/temp/histogr.source.tar failed (in /home/peter/texlive/2011/texmf-dist)     untarring /home/peter/texlive/2011/temp/histogr.source.tar failed, stopping install.     Installation failed.     Rerunning the installer will try to restart the installation.     Or you can restart by running the installer with:       install-tl --profile installation.profile [EXTRA-ARGS]     Writing log file to current working directory.      Why is this happening? I can I proceed? Debian 6 64 bit, `~/home/peter/texlive/2011/` is where the installation has been directed to.


title: LaTeX - ConTeXt converter or there and back again:)

text: I'm looking for some converter LaTeX -> ConTeXt and perhaps LaTeX <\- ConTeXt (just in case). I can write simple script and implement translation of basic syntax, but perhaps someone did it?


title: Define an align environment that always aligns to the first equal sign

text: I noticed that 98% of the times I use `align` or `aligned` I place the `&` just before the first `=` of each line. Is there a way to define a new environment that automatically aligns equations to the first equal sign (as if placing an invisible `&` there)? Ideally, this code               \begin{myalign}     a = b \\     = c = d     \end{myalign}      would be completely equivalent to this code               \begin{align}     a &= b \\     &= c = d     \end{align}


title: png not scalable LaTeX using TexShop on Mac

text: After searching for a long time unfortunately I couldn't find a proper answer or used everything I found without any change. I have several PNG files to include into my thesis but after including a `.png` image it's not possible to scale it or get it in the right position. Just a short excerpt from my TeX document:               \documentclass[11pt,a4paper,twoside,openright]{memoir}     \usepackage[ngerman]{babel}     \usepackage[latin1]{inputenc}     \usepackage[dvips]{color}     \usepackage[pdftex]{graphicx}     \usepackage{epstopdf}     \usepackage{epsfig}          \begin{document}         \section{Motivation}         \label{sec:motivation}         Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie.         Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit 1500,         als ein unbekannter Schriftsteller eine Hand voll Wörter nahm und diese         durcheinander warf um ein Musterbuch zu erstellen.              %         \begin{figure}[!ht]            \centering            \includegraphics[width=\textwidth]{chapter/intro/images/image.png}            \caption{caption}            \label{fig:label}         \end{figure}         %              Lorem Ipsum ist ein einfacher Demo-Text für die Print- und Schriftindustrie.         Lorem Ipsum ist in der Industrie bereits der Standard Demo-Text seit 1500,         als ein unbekannter Schriftsteller eine Hand voll Wörter nahm und diese         durcheinander warf um ein Musterbuch zu erstellen.     \end{document}      And it looks like this: Link to screenshot with png floating out of document The image is neither scaled nor on the chosen position. The LaTeX template above is provided by my university and recommended to use for my thesis. Before using that template I created clean, new document to play around and learn how to use latex. There I used `.png` images as well with no problems, I could center it, place it in position and scale it. This document looks as follows:               \documentclass[12pt,a4paper]{scrartcl}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[ngerman]{babel}     \usepackage{graphicx}     \usepackage{capt-of}     \usepackage{url}     \usepackage{bibgerm}     \bibliographystyle{alphadin}          \begin{document}         %         \begin{figure}            \centering            \includegraphics[scale=.3]{image.png}            \caption{caption}            \label{fig:label}         \end{figure}         %     \end{document}      Now I'll just go on writing and hope to get any help in here because I don't know what to do anymore except creating a totally new document.


title: Having Problem using math environment in LuaLaTeX

text: I am at learning stage of LaTeX. While working with `lualatex` with `fontspec` package, i am not being able to use any math environment. My document's preamble:               \documentclass[a4paper, 14pt]{memoir} %          \usepackage{amsmath} %Never write a paper without using amsmath for its many new commands     \usepackage{amssymb} %Some extra symbols          \usepackage{makeidx} %If you want to generate an index, automatically     \usepackage{graphicx} %If you want to include postscript graphics      \usepackage{microtype} %     \usepackage{cleveref} %     %\usepackage[T1]{fontenc}   % font encoding     \usepackage[a4paper,bottom=2cm]{geometry} % geometry/margins of page     \usepackage{multicol}       % multicolumn environments     \usepackage{tikz}           % used for the 'logo' (remove if unwanted)     \usepackage{lipsum}     \usepackage{calc, blindtext}     \usepackage{xcolor, colortbl}     \usepackage{longtable}     \usepackage{mathptmx}     \usepackage[no-math]{fontspec}     \usepackage{unicode-math}     \usepackage{titlesec}     \usepackage{kpfonts}     \usepackage{enumitem}     \defaultfontfeatures{Ligatures=TeX}     \setSingleSpace{1.1}     \SingleSpacing          \definecolor{MSBlue}{RGB}{0, 85, 255}     \definecolor{MSLightBlue}{RGB}{42, 127, 255}     \definecolor{WaterBlue}{RGB}{0, 212, 255}     \definecolor{RHlight}{RGB}{255, 170, 0}          % %setting section style     \newfontfamily\sectionFont{Interstate BoldCondensed} %     \newfontfamily\emphFont{Bell MT Bold}     \titleformat*{\section}{\Large\bfseries\sectionFont\color{MSBlue}}     \titleformat*{\subsection}{\large\bfseries\sectionFont\color{MSLightBlue}}     \titleformat*{\subsubsection}{\normalsize\sectionFont}          % %setting enumeration style     \setlist[description]{font=\bfseries, labelindent=\parindent, leftmargin=*} %     \setlist[enumerate]{labelindent=\parindent} %          \definecolor{chaptercolor}{gray}{0.8}     % helper macros     \setmainfont{Cambria}      Whenever I use `$...$` inside of begin{document}, I am having the following error:               miktex-makepk: / is an unknown METAFONT mode.     Process exited with error(s)      I have tried with `no-math` option with `fontspec` package and using `unicode- math` package but it seems it is conflicting with `kpfonts` package and giving following error:               Command `\mathscr' already defined. ...}{U}{jkp\kp@famillem syd\kp@widerm}{m}{n}      Using `mathspec` package is giving following error:               Undefined control sequence {\relax}      So, my questions are:   1. why actually I am having these error.   2. how can I work with math environment by keeping `fontspec` and `kpfonts` package?


title: Is there any horizontal skip after which the space character `\ ` is removed automatically?

text: Let's consider the following TeX macro: `\def\theorem#1{Theorem (#1).\enspace}` Try to use it: `\theorem{Dirac} A simple graph with $n$ vertices\dots` Then TeX produces two spaces after "Theorem (Dirac).", an `\enspace` and a regular space `\`, as expected. Of course, there are some workarounds, e.g. `\theorem{Dirac}A simple graph with $n$ vertices\dots`, which is ugly (even if I use `%` after `\theorem{Dirac}`), and I will forget this. Is there any clean way to replace `\enspace` to some more clever horizontal skip in the macro? EDIT (2nd question): What can I do in "reverse order", i.e. when my macro starts with \enspace (you can think of a \qed-like macro here), and I want to use that macro after a regular space?


title: Problem using italics in fonts with optical size feature

text: I come across a strange problem when using fonts with different optical sizes. When compiling the following example (using either lualatex or xetex)               \documentclass[10pt]{memoir}     \usepackage{fontspec}     %\setmainfont{Arno Pro}     \setmainfont{EB Garamond}     \begin{document}     01. Everything is fine \emph{Everything is fine}          02. Everything is fine \emph{Everything is fine}          03. Everything is fine \emph{Everything is fine}          04. Everything is fine \emph{Everything is fine}          05. Everything is fine \emph{Everything is fine}          06. Everything is fine \emph{Everything is fine}          07. Everything is fine \emph{Everything is fine}          08. Everything is fine \emph{Everything is fine}          09. Everything is fine \emph{Everything is fine}          10. Everything is fine \emph{Everything is fine}          11. Everything is fine \emph{Everything is fine}          12. Everything is fine \emph{Everything is fine}          13. Everything is fine \emph{Everything is fine}          14. Everything is fine \emph{Everything is fine}          15. Everything is fine \emph{Everything is fine}          16. Everything is fine \emph{Everything is fine}          17. Everything is fine \emph{Everything is fine}          18. Everything is fine \emph{Everything is fine}          19. Everything is fine \emph{Everything is fine}          20. Everything is fine \emph{Everything is fine}          21. Everything is fine \emph{Everything is fine}          22. Everything is fine \emph{Everything is fine}          23. Everything is fine \emph{Everything is fine}          24. Everything is fine \emph{Everything is fine}          25. Everything is fine \emph{Everything is fine}          26. Everything is fine \emph{Everything is fine}          27. Everything is fine \emph{Everything is fine}          28. Everything is fine \emph{Everything is fine}          29. Everything is fine \emph{Everything is fine}          30. Everything is fine \emph{Everything is fine}          31. Everything is fine \emph{Everything is fine}          32. Everything is fine \emph{Everything is fine}          33. Everything is fine \emph{Everything is fine}          34. Everything is fine \emph{Everything is fine}          35. Everything is fine \emph{Everything is fine}          36. Everything is fine \emph{Everything is fine}          37. Everything is fine \emph{Everything is fine}          38. Everything is fine \emph{Everything is fine}          39. Everything is fine \emph{Everything is fine}          40. Everything is fine \emph{Everything is fine}          41. Everything is fine \emph{Everything is fine}          42. Everything is fine \emph{Everything is fine}          43. Everything is fine \emph{Everything is fine}          44. Everything is fine \emph{Everything is fine}          45. Everything is fine \emph{Everything is fine}          46. Everything is fine \emph{Everything is fine}          47. Everything is fine \emph{Everything is fine}          48. Everything is fine \emph{Everything is fine}          49. Everything is fine \emph{Everything is fine}          50. Everything is fine \emph{Everything is fine}          51. Everything is fine \emph{Everything is fine}          52. Everything is fine \emph{Everything is fine}          53. Everything is fine \emph{Everything is fine}          54. Everything is fine \emph{Everything is fine}          55. Everything is fine \emph{Everything is fine}          56. Everything is fine \emph{Everything is fine}          57. Everything is fine \emph{Everything is fine}          58. Everything is fine \emph{Everything is fine}          59. Everything is fine \emph{Everything is fine}          60. Everything is fine \emph{Everything is fine}          \end{document}      I get the following message in the log file               LaTeX Font Info:    Font shape `EU2/EBGaramond(0)/m/sl' in size <10> not available     (Font)              Font shape `EU2/EBGaramond(0)/m/it' tried instead on input line 100.      This error always shows up in the second line of the second page (to check this i've inserted vertical spaces to change the place where the new page starts), and when using fonts with different optical sizes available. In the case of EB Garamond, this is not very problematic, since the output looks as it should. But, when using Arno Pro (at 10pt), the italics from the second line of the second page on are larger than they should be (because the wrong size is being used). Here is what the start of the second page looks like (using Arno Pro, 10pt) ![enter image description here](http://i.stack.imgur.com/3EQSL.png) The pdf reader i'm using (evince) tells me that the fonts used are ArnoPro- SmTex, ArnoPro-ItalicSmTex (as expected) and ArnoPro-Italic (that should not be used). Is there anyway to solve this problem? I'm using texlive. `This is LuaTeX, Version beta-0.76.0-2013070107 (rev 4627) (format=lualatex 2014.5.3) Package: fontspec 2013/05/20 v2.3c Font selection for XeLaTeX and LuaLaTeX`


title: Psfrag or comparable tagging method with XeTeX

text: I understand from this question that using psfrag to replace tags in eps-files works well with pdfLaTeX. I also think I understand from this question that there was no working mechanism to accomplish the same thing using Xe(La)TeX? I have tried nonetheless to retag an image with psfrag and the pstool workaround, and was slightly surprised by the error message `Undefined control sequence` which reproduceably rendered the first (and reduced to only) `\psfrag` command undefined. Working without pstool, the `Undefined control sequence` turned out to be the `\includegraphics` command. Is there any workaround known for replacing eps-image tags in or around XeTeX? If possible, I would like to have the appropriate font inserted no earlier than compilation, so I can compile the document to two different pdfs with two different fonts. May I present the following as a minimal non-working examples? They contain the only _changes_ to the code of a working document which caused the above cited error: Version 1: No pstool:               \usepackage{psfrag}     [... some document text]     \begin{figure}\psfrag{pfeildreiunten}{Dioxan/HCl konz}     \includegraphics{imagefilename.eps}     \caption{arbitrary caption}     \label{recognise}     \end{figure}      Version 2: with pstool:               \usepackage{psfrag}     \usepackage{pstool}     [... some document text]     \begin{figure}\psfragfig{imagefilename}{ %     \psfrag{pfeildreiunten}{Dioxan/HCl konz}}     \caption{arbitrary caption}     \label{recognise}     \end{figure}      One more pinch of information that might be useful: The eps was generated with ChemDraw. The label as I entered it was in one text box in the ChemDraw- drawing. I hope that was generaly the right usage for `\psfrag`. Edit (16/07/2012)   After doing even more search engine research, I am pretty positive that I won't get psfrag or a direct workaround to work directly in XeLaTeX. Now I'm asking myself which of the following ideas would be feasible or are maybe already implemented (and I haven't found them because I'm not looking hard enough): ~~Idea 1:   I have no clue how text parts are handled in (E)PS or PDF files. All I know is that one can mark and search for text in PDFs, so it must be encoded in a somehow plaintext way. Is it possible to convert the EPS files I have to PDF, include them, and still tell Xe(La)TeX to look for tag xyz in the file and replace it with tag abc? If so, which packages can do that?~~   I have found this question which renders the answer to my idea 1 'no'. Idea 2:   Many of the workarounds I have found are made to work with pdfLaTeX. Even some suggest creating the properly replaced text with LaTeX, creating a PDF file out of the EPS and inserting that later. Problem: I'm using one of the benefits of XeTeX, i.e. a non-TeX-standard font (Liberation family). Is it 'easy' to get this to work with LaTeX, create the correct labels, convert PDF, insert? Before this is suggested, the following is _not_ an immediate option:   I cannot (atm) create the images using the correct font directly. ChemDraw, which I use for generating images, is running on my Windows-based desktop, while XeLaTeX is used on my Lubuntu-based laptop (where Liberation is installed). If all else fails, I will probably resort to Arial text in graphics and leave it unfitting to the font used in the text.


title: How to redeclare $$ or the \[, \] pair

text: There might be probably many reasons not to do it, but what would be the proper way to redeclare the `$$` sequence or the `\[`,`\]` pair to open by default some special display math environment, such as `\begin{align*}`,`\end{align*}`? (And, of course, what are the reasons not to do it?)


title: Vertical cell alignment in tables?

text: This problem drives me crazy right now. How can I draw a table with the following properties in Latex?   * width = \textwidth   * 1 column: horizontal alignment = left, vertical alignment = bottom   * 2 column: horizontal alignment = center, vertical alignment = bottom   * 3 column: horizontal alignment = center, vertical alignment = bottom MWE:               \documentclass{scrartcl}     \usepackage{tabularx}     \usepackage{blindtext}          \begin{document}     \begin{tabularx}{\textwidth}{|X|p{0.4cm}|p{3cm}|}       \hline       \blindtext & \begin{center}A\end{center} & \begin{center}B\end{center} \\       \hline     \end{tabularx}     \end{document}


title: Automate the description of the paper

text: Most or all papers have a final paragraph in the introduction that describes the sections that are present. I'd like to generate it automatically, I guess this should be possible because it is mostly like an index, but in fact I have no idea about how this could be done (therefore I can't provide a mwe, I'm very sorry for this). My guess is that it should be possible to add a description for each section, something like:               \section{Preliminaries}     \label{sec:preliminaries}     \description{we introduce the concepts that will be relevant along the paper}      What I would like is to insert at the end of the introduction something like this:               \descriptions{}      Which should expand to: > The structure of the paper is as follows: In Section 2 we introduce the > concepts that will be relevant along the paper. In Section 3 we... This is pretty much like the table of contents (TOC) that you would find in any book, this is prose and not a table and there is one additional field, but in short it's the same. Seems feasible. Pointers to what should I check are also welcome, I really have no idea. I don't know how those TOCs are generated either. PD: I'd prefer not to destroy the possibility of having a regular TOC additionally to this, i.e. I'd prefer not to modify the commands for the TOC (but maybe duplicate some of them). PD: I found this package, but I get an error (`\l@paragraph undefined`) http://texblog.org/2008/07/13/define-your-own-list-of/


title: Clickable chapters on the right side of each page

text: Is it possible with pdfLaTeX to create a clickable "table of contents" on the right side of each page as you could see here (it is a screenshot of a PDF): ![enter image description here](http://i.stack.imgur.com/Nzlms.png)


title: Z vector in TikZ

text: When using 3D coordinates in TikZ, is there a way of changing the direction of the Z vector so that it doesn't point at a 45 degree angle in the X-Y plane? Given a drawing of a cube like the following, I would like a nice way to shift the face at the back around without having to tweak the coordinates.               \begin{tikzpicture}     \draw (0,0,0) -- (1,0,0) -- (1,1,0) -- (0,1,0) -- cycle;     \draw (0,0,1) -- (1,0,1) -- (1,1,1) -- (0,1,1) -- cycle;     \draw (0,0,0) -- (0,0,1); \draw (1,0,0) -- (1,0,1); \draw (0,1,0) -- (0,1,1); \draw (1,1,0) -- (1,1,1);      \end{tikzpicture}      Looking at the manual, I was only able to find the ability to change the length of the Z vector, not its direction.


title: TikZ is printing the coordinate location and not the actual point. What am I missing?

text: I was trying to draw a picture of a triangle. Adjacent to the triangle is supposed to be a line with points along it whose distances from the top end point are the lengths of the sides of the triangle. But I'm unable to draw the line.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{tkz-euclide}     \pagestyle{empty}     \begin{document}      Verify that the following triangle has been constructed per the      specificiations.          \begin{tikzpicture}[every node/.style={circle,inner sep=2pt,fill}]       \coordinate (A) at (0,0);       \coordinate (B) at (0,3in);              %\draw (A) circle (3.5in);       %\draw (B) circle (4in);       \tkzInterCC[R](A,2.5in)(B,4.5in) \tkzGetPoints{C}{D}       \draw (A) -- (B) -- (C) -- cycle;            \node at (A) {};       \node at (B) {};       \node at (C) {};            \node[fill=none] at ($(A)+(-90:2ex)$) {$C$};       \node[fill=none] at ($(B)+(+90:2ex)$) {$B$};       \node[fill=none] at ($(C)+(-90:2ex)$) {$A$};            \coordinate (D) at (2in,3in);            \path let \p1=(A),                 \p2=(B),                 \p3=(C)             in             coordinate (E) at  ($(D)-(0,{veclen(\p1,\p2)})$)             coordinate (F) at  ($(D)-(0,{veclen(\p1,\p3)})$);            \node at (D) {};       \node at (E) {};       \node at (F) {};       \draw (D) -- (F) -- (E);          \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/nBmLS.png)


title: Use tex to generate a html page with an embedded video, possible?

text: I want to use tex to generate a html page with an embedded video. I know that I can use latex2html to convert tex to html. I also know about media9 but I think it can only be used to render videos in pdf. I think that if javascript can be embedded in tex and rendered as html then I could use a javascript based video player to show the video in the html page. So is it possible? Why do I want to do this? : I want videos in my document and I am frustrated with the intermittent support of this in the pdf standard and its associated viewers.


title: Axis Multiplier near middle-axis

text: In PGFPlots I would like to have the multiplier for the specific axis near this axis when the axis is in the middle. The option `xlabel near ticks` does that, but moves the axis-label to the center of the plot. I would prefer to have the multiplier and the axis label at the right end of the axis. I couldn't find a solution in the pgfplots manual. Example:               \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}         \begin{axis}[%                         width=0.8\textwidth,%                         legend style={%                         at={(0,0.5)},                         anchor=south west },%                         title={\bfseries Plot},%                         axis x line=middle,%                         axis y line=middle,%                         minor tick num=9,%                         xlabel=X-Axis,%                         ylabel=Y-Axis ,%                         scaled x ticks=base 10:3,%                         %xlabel near ticks,%                     ]                          \addplot [domain=-0.03:0.03, mark=none, thick,blue,]                      {10000*x + 50};                          \legend{Line}              \end{axis}     \end{tikzpicture}     \end{document}


title: Package incompatibilty between alphalph, and hyperref with amsmath subequations

text: I have a document which makes use of `subequations` and `alphalph`, which compiles without `hyperref`, but throws an error when using `hyperref`. Loading `hyperref` after the `alphalph` package does not help. The error is:               ! Undefined control sequence.     \GenericError  ...                                                                                #4  \errhelp \@err@     ...     l.39    \end{align}      MWE:               \documentclass{article}          \usepackage{amsmath}     \usepackage{hyperref}     \usepackage{alphalph}          \begin{document}     \begin{subequations}     \renewcommand{\theequation}{\theparentequation \alphalph{\value{equation}}}     \begin{align}         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\         Blah\\     \end{align}     \end{subequations}     \end{document}      Does anyone know a fix?


title: Bug related to \hat{} in amsmath

text: I'm trying to typeset an equation that contains the following:               \begin{align*}     \hat{\E[(R_{i}-\hat R_{i})^{2}]}      \end{align*}      However, this is what I get ![Bug?](http://i.stack.imgur.com/I2nJa.png) Is this a bug? Is there any way around it? I'd like the "hat" to be over the whole expression, not just the expectation operator which I've defined as:               \newcommand{\E}{\mathbb{E}}


title: How do I execute some commands conditionally?

text: What would be the correct way to execute commands conditionally in LaTeX? Here is the problem I am having. I have a `book_pdf.tex` where I wish to define the style of the book as it would look in a PDF. Then I have `book_epub.tex` where I wish to define the style of the book as it would look in an EPUB format. Then I also have `chapter1.tex`, `chapter2.tex`, etc. In each of these chapters I have to do micro adjustments for each format. So I am thinking that I need to define a variable in either `ebook_pdf.tex` (something like `var pdf = true` in pseudosyntax), and then in `chapter1.tex`, I want to check if it's the pdf template that is used (something like `if pdf then insert \newline`). Or if it's the epub format, then I want to define `epub` variable and do stuff like `if epub then \begin{lstlistings}[basicstyle=\smaller] else insert \begin{lstlistings}[basicstyle=\small]`. Any ideas how to accomplish this?


title: Importing csv file into latex as a table

text: I am using the \csvautotabular function to import data from a csv file. It has worked beautifully; however, I only want to import certain columns from the file. How can I exclude certain columns? EDIT: Okay, here is my csv file:               Time (s),Zeroed time (s),Y Position in pixels,Zeroed Y Position in pixels,Y Position in meters using original trans. Eq.,Y Position In Meters using new trans. Eq.     43.97,0,734,528,14.22624,18.26294     44.01,0.04,731,525,14.11335,18.14345     44.04,0.07,729,523,14.03819,18.06389     44.07,0.1,726,520,13.9256,17.9447     44.11,0.14,720,514,13.70096,17.70686     44.14,0.17,718,512,13.62624,17.62774     44.17,0.2,714,508,13.47704,17.46974     44.21,0.24,711,505,13.36535,17.35145     44.24,0.27,706,500,13.1796,17.1547     44.27,0.3,700,494,12.95736,16.91926     44.31,0.34,696,490,12.8096,16.7627     44.34,0.37,690,484,12.58856,16.52846     44.37,0.4,685,479,12.40491,16.33381     44.41,0.44,679,473,12.18519,16.10089     44.44,0.47,672,466,11.92976,15.83006     44.47,0.5,664,458,11.63904,15.52174     44.51,0.54,659,453,11.45799,15.32969     44.54,0.57,651,445,11.16935,15.02345     44.57,0.6,642,436,10.84616,14.68046     44.61,0.64,633,427,10.52459,14.33909     44.64,0.67,625,419,10.24011,14.03701     44.67,0.7,616,410,9.9216,13.6987     44.71,0.74,607,401,9.60471,13.36201     44.74,0.77,597,391,9.25451,12.98981     44.77,0.8,587,381,8.90631,12.61961     44.81,0.84,577,371,8.56011,12.25141     44.84,0.87,567,361,8.21591,11.88521     44.87,0.9,554,348,7.77144,11.41214     44.91,0.94,541,335,7.33035,10.94245     44.94,0.97,528,322,6.89264,10.47614     44.97,1,515,309,6.45831,10.01321     45.01,1.04,503,297,6.06039,9.58889     45.04,1.07,490,284,5.63256,9.13246     45.07,1.1,475,269,5.14311,8.61001     45.11,1.14,458,252,4.59384,8.02334     45.14,1.17,444,238,4.14584,7.54454     45.17,1.2,427,221,3.60711,6.96841     45.21,1.24,410,204,3.07416,6.39806     45.24,1.27,393,187,2.54699,5.83349     45.27,1.3,377,171,2.05611,5.30741     45.31,1.34,361,155,1.57035,4.78645     45.34,1.37,346,140,1.1196,4.3027     45.38,1.41,328,122,0.58464,3.72814     45.41,1.44,309,103,0.02699,3.12869     45.44,1.47,289,83,-0.55221,2.50549     45.48,1.51,269,63,-1.12341,1.89029     45.51,1.54,246,40,-1.7704,1.1927     45.54,1.57,224,18,-2.37936,0.53534     45.58,1.61,203,-3,-2.95161,-0.08311     45.61,1.64,206,0,-2.8704,0.0047      The following columns I want to remove: Time (s), Y Position in pixels, Zeroed Y Position in pixels, Y Position in meters using original trans. Eq. Here is what I have typed in TeXstudio, which doesn't work:               \begin{filecontents*}{Basket_ball.csv}     Time (s),Zeroed time (s),Y Position in pixels,Zeroed Y Position in pixels,Y Position in meters using original trans. Eq.,Y Position In Meters using new trans. Eq.     43.97,0,734,528,14.22624,18.26294     44.01,0.04,731,525,14.11335,18.14345     44.04,0.07,729,523,14.03819,18.06389     44.07,0.1,726,520,13.9256,17.9447     44.11,0.14,720,514,13.70096,17.70686     44.14,0.17,718,512,13.62624,17.62774     44.17,0.2,714,508,13.47704,17.46974     44.21,0.24,711,505,13.36535,17.35145     44.24,0.27,706,500,13.1796,17.1547     44.27,0.3,700,494,12.95736,16.91926     44.31,0.34,696,490,12.8096,16.7627     44.34,0.37,690,484,12.58856,16.52846     44.37,0.4,685,479,12.40491,16.33381     44.41,0.44,679,473,12.18519,16.10089     44.44,0.47,672,466,11.92976,15.83006     44.47,0.5,664,458,11.63904,15.52174     44.51,0.54,659,453,11.45799,15.32969     44.54,0.57,651,445,11.16935,15.02345     44.57,0.6,642,436,10.84616,14.68046     44.61,0.64,633,427,10.52459,14.33909     44.64,0.67,625,419,10.24011,14.03701     44.67,0.7,616,410,9.9216,13.6987     44.71,0.74,607,401,9.60471,13.36201     44.74,0.77,597,391,9.25451,12.98981     44.77,0.8,587,381,8.90631,12.61961     44.81,0.84,577,371,8.56011,12.25141     44.84,0.87,567,361,8.21591,11.88521     44.87,0.9,554,348,7.77144,11.41214     44.91,0.94,541,335,7.33035,10.94245     44.94,0.97,528,322,6.89264,10.47614     44.97,1,515,309,6.45831,10.01321     45.01,1.04,503,297,6.06039,9.58889     45.04,1.07,490,284,5.63256,9.13246     45.07,1.1,475,269,5.14311,8.61001     45.11,1.14,458,252,4.59384,8.02334     45.14,1.17,444,238,4.14584,7.54454     45.17,1.2,427,221,3.60711,6.96841     45.21,1.24,410,204,3.07416,6.39806     45.24,1.27,393,187,2.54699,5.83349     45.27,1.3,377,171,2.05611,5.30741     45.31,1.34,361,155,1.57035,4.78645     45.34,1.37,346,140,1.1196,4.3027     45.38,1.41,328,122,0.58464,3.72814     45.41,1.44,309,103,0.02699,3.12869     45.44,1.47,289,83,-0.55221,2.50549     45.48,1.51,269,63,-1.12341,1.89029     45.51,1.54,246,40,-1.7704,1.1927     45.54,1.57,224,18,-2.37936,0.53534     45.58,1.61,203,-3,-2.95161,-0.08311     45.61,1.64,206,0,-2.8704,0.0047     \end{filecontents*}          \begin{document}          \maketitle          \section*{Theory}               %\csvautotabular{Basket_ball.csv}                    \begin{tabular}{| l | r |}\hline%     \bfseries Time (s) & \bfseries Position (m)     \csvreader[head to column names]{Basket_ball.csv}{} %      {\\\Time (s)\ \Y Position in pixels & \Zeroed Y Position in pixels & \Y Position in meters using original trans. Eq. } %      \\\hline     \end{tabular}


title: Quote environment with long reference at the end right – without widows

text: I need a `quote`-environment to end with source-references in a new line, flush right. Simply using               \begin{quote}         QUOTED TEXT        \begin{flushright}           SOURCE        \end{flushright}     \end{quote}      more or less gives the result I want. But when QUOTED TEXT happens to end at the end of a page, SOURCE (usually only a single line) is moved to the new page, looking silly. These pseudo-widows can be corrected manually (adding `\pagebreak` or `\enlargethispage` where needed), but for a whole book with a lot of block- quotes, this is quite a nuisance... `\nopagebreak` between the environments is ignored. Using               \begin{quote}         QUOTED TEXT     \par     \nopagebreak     \hfill         SOURCE     \end{quote}      instead, doesn't produce widows, but SOURCE is only formatted correctly as long as it isn't longer than one line. Is there a way to make two environments behave as if they were one and thus the widow-control to be in effect?


title: Can we remove the ( ) bracket from Theorem 1.2.1 ( [7])

text: Can we remove the ( ) bracket from the environment like Theorem 1.2.1 ( [7]).