title: Why does \numexpr integer division round rather than truncate?

text: In my use of `\numexpr`'s integer division `/` I have never gotten any advantage from the fact that it rounds rather than truncates. `TeX`'s own `\divide` truncates. If we were dealing with floating point numbers, I could understand. But here the operations are on integers. Again, any time this has been an issue for me in coding, always and systematically the "rounding" was a nuisance and generated extra coding to get around it. Is there any reason rounding has been preferred to truncating?


title: \frac overlapping in nested itemize in beamer

text: When I try this MWE, the fractions are overlapping:               \documentclass{beamer}          \begin{document}     \begin{frame}          \begin{itemize}     \item      \begin{itemize}     \item $\frac{5}{8}$     \item $\frac{5}{2}$     \end{itemize}          \end{itemize}          \end{frame}     \end{document}      ![](http://i.stack.imgur.com/81Aer.png) What is the best way to fix this problem?


title: Newlines after section headings in amsart

text: This latex code:               \documentclass[9pt]{amsart}          \begin{document}       \subsubsection*{Animals}       Rabbit horse monkey cow     \end{document}      Generates something that looks approximately like this: > _Animals_. Rabbit horse monkey cow. I'd like to add a newline after the section heading, but if I use `\\\` with               \subsubsection*{Animals}\\      I get: > ! LaTeX Error: There's no line here to end. If I put the `\\\` inside the brackets, with Animals, then I get a newline but it separates "Animals" from the period: > Animals > > . Rabbit horse monkey cow. How can I put a newline after the section heading without separating it from the period? EDIT: A good solution is provided below using redefinition of \subsubsection, but a simpler method is to do               \subsubsection*{Animals}\hspace*{\fill} \\     Rabbit horse monkey cow.


title: Reviewing hyphenations with LuaTeX

text: > **This question led to a new package:**   >  `lua-check-hyphen` I wrote a question (Accessing pointers in LuaTeX) hoping it would lead me to a way of reviewing the hyphenations with LuaTeX, and without external programs. I was encouraged to write this question. The answers to the question “Check all hyphenations within a document” point to external tools. I’m hoping for a solution which writes the hyphenation to the log file everytime a word is split across two lines, for easy reviewing.


title: How to change spacing before subsections?

text: I can't seem to remove the space that appears before my subsections. I know this is discussed in other posted by it's not working for me for some reason. Any help appreciated.               \documentclass[letterpaper, fontsize=11pt]{scrartcl} % letter size paper and 11pt font size     \usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}     \usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs     \usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default     \usepackage[english]{babel} % English language/hyphenation     \usepackage{amsmath,amsfonts,amsthm} % Math packages     \usepackage{natbib}     \usepackage{color}     \usepackage{graphicx}     \newtheorem{guess}{Hypothesis}     \usepackage{titlesec}     %\setlength{\parskip}{0.4cm plus4mm minus3mm}     %\usepackage[font={small}]{caption}     %\titlespacing*{\subsection}{0pt}{0ex plus 0ex minus 0ex}{4.3ex plus .2ex}          \usepackage{sectsty} % Allows customizing section commands     \allsectionsfont{\center \normalfont\scshape} % Make all sections centered, the default font and small caps          \usepackage{fancyhdr} % Custom headers and footers     \pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers     \fancyhead{} % No page header - if you want one, create it in the same way as the footers below     \fancyfoot[L]{} % Empty left footer     \fancyfoot[C]{} % Empty center footer     \fancyfoot[R]{\thepage} % Page numbering for right footer     \renewcommand{\headrulewidth}{0pt} % Remove header underlines     \renewcommand{\footrulewidth}{0pt} % Remove footer underlines     \setlength{\headheight}{13.6pt} % Customize the height of the header          %\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)     %\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)     \numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)          \setlength\parindent{1cm} % Sets indentation of paragraphs


title: Line break at a whitespace in inline code listing

text: How can I automatically break the following inline code at a whitespace? **The problem is that I have to use`breaklines=false`**.               \documentclass{article}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{listings}     \usepackage{blindtext}          \lstset{breaklines=false,             literate={,}{}{0\discretionary{,}{}{,}}}          \begin{document}     \lstinline{ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC, ABC}\\     \blindtext     \end{document}      **edit** I adapt the `literate` parameter from another example but it doesn't work with spaces.


title: How can I have inline code (delimited by |) in a footnote or in a caption?

text: I've defined `|` as a "short inline character", using               \lstMakeShortInline|      I'd like to use that delimiter to typeset inline code in a footnote or a caption, e.g.               \footnote{Java uses the |break| keyword...}.      However, upon compilation, I get the following error:               Argument of \lst@temp has an extra }.      How can I overcome this problem?


title: Equation number for each row of a matrix equation

text: Is it possible to give an equation number to each row of a matrix equation? ![enter image description here](http://i.stack.imgur.com/DvCvZ.png) How could I have equation labels in the vein of subequation numbers, one for each row of the matrix equation? Here, I'd like equation numbers such as, e.g., (3.1a), (3.1b), (3.1c) (I don't mean row/column labels as in a bordered matrix). Thanks!


title: Textual subscript in math mode

text: I want to put some short words in certain subscripts when I am in math mode, for example:               \[W_{total} = \sum{W_i}\]      but I think LaTeX understands this as the product of `t`, `o`, `t`, `a` and `l`. Is in any case this way the right way, or is there any other one? By the way, I have tried               \[W_{\text{total}}\]      ~~but it is not fine for me. (A bit ugly)~~ Forget that.


title: Threeparttable centering

text: I know that someone already asked pretty much the same but I cannot solve the problem of centering my table after using `threepartatble` command for the notes. Here it is:               \begin{table}[h!tb]      \centering     \begin{threeparttable}[b]     \caption{Table1}     \label{one}     \begin{tabular}{l r r r}      \toprule     \hline     \multirow{2}{*}{country} & region & county & village \\     North Africa & 13.0 & 11.0 & 7.0 \\     Central and South Africa & 2.0 & 5.0 & 7.3 \\     Middle East & 5.3 & 3.0 & 3.0 \\     Asia & 19.0 & 24.0 & 16.7 \\      Southern Europe & 10.6 & 4.0 & 3.0 \\     ACP countries & 43.6 & 43.0 & 46.0 \\     Unallocated & 6.5 & 10.0 & 17.0 \\     \bottomrule     \end{tabular}     \begin{tablenotes}\footnotesize     \item Source: book     \end{tablenotes}     \end{threeparttable}     \end{table}


title: XeLaTeX: Accents (with Linux Libertine font) require T1-fonts

text: I need special characters (accents, cyrillic glyphs) in my file. Cyrillic seems to work well with Linux Libertine, but accents trigger warnings:               LaTeX Font Warning: Font shape `OT1/LinLibertine_R.otf(0)/m/it' undefined     (Font)              using `OT1/cmr/m/n' instead on input line 26.      Question is: how do I need to fix my code/how can I use accents in this setup (xelatex + Libertine OTF fonts) without falling back to OT1/cmr? Here is my example file:               \documentclass[a4paper,11pt]{scrreprt}          % General font-related definitions at the top! (Taken from     % http://www.linuxlibertine.org/fileadmin/user_upload/PDF/Libertine-XeTex-DE.pdf)     \usepackage{xunicode}     \usepackage{fontspec}     \usepackage{xltxtra}     \usepackage{polyglossia}     %\usepackage{csquotes} % Causes some error messages?          % Load font from current working directory.     \setmainfont[       BoldFont          = LinLibertine_RZ.otf,       ItalicFont        = LinLibertine_RI.otf,       BoldItalicFont    = LinLibertine_RZI.otf,       Ligatures=TeX]{LinLibertine_R.otf}     \setsansfont[       BoldFont          = LinBiolinum_RB.otf,       ItalicFont        = LinBiolinum_RI.otf,       BoldItalicFont    = LinBiolinum_RI.otf, % FIXME?!       Ligatures=TeX]{LinBiolinum_R.otf}     \setmainlanguage{german}     \setotherlanguage{russian}          \begin{document}     .\\     zas\'{y}pat’\\ % This is line 27.     zasypat’\\     \end{document}      (I have all the *.otf files in my current working directory.) Thanks in advance.


title: Creating a specific chapter style using memoir

text: I'm completely new to using TeX but have managed over the past couple of days to get a basic setup working for my thesis using `memoir`. I've been exploring the chapter heading styles at http://www.tex.ac.uk/tex- archive/info/MemoirChapStyles/MemoirChapStyles.pdf to try and figure out how to customise chapter heading layouts. I have a specific style which I'm trying to recreate (see image below), but I'm unsure how to go about positioning and aligning the chapter numbers and titles side by side in this manner. ![enter image description here](http://i.stack.imgur.com/cwrVZ.png) The key features are that the elements are:   * Next to each other   * With a slightly wider margin than usual   * With the chapter title extending to the right of a fixed point, potentially onto multiple lines and the chapter number to the left of it


title: How to include a # sign in a url using the \endnotes package

text: I am trying to include a URL in my Latex document which contains a pound sign, #, in it. If I run it without escaping the # sign, I get an error. If I escape it, then the escape character is printed out in the URL also. ("`\\#`" instead of "`#`") Any ideas on how to fix this?               \documentclass[12pt, a4paper, twoside]{article}     \usepackage[T1]{fontenc}     \usepackage{endnotes}     \usepackage{url}     \begin{document}     Hello World\endnote{\url{http://www.rossettiarchive.org/docs/nb0005.duke.rad.html#0.1.19}}     \end{document}


title: How to put stuff in the margin every first line with the listings package?

text: I am writting a book and I use the listings package to type some matlab code. I would like to highlight every code block with an arrow or whatever hanging in the margin at the first line. Moreover The code should be indented. More specifically, I would like to define a listings environment, say 'matlabcode', so that the latex code                 \documentclass{article}     \usepackage{listings}     \usepackage{lipsum}          \lstnewenvironment{matlabcode}{}{}          \begin{document}     \lipsum[1]     \begin{matlabcode}     >> plot(sin(1:10))     more matlab code     more matlab code     \end{matlabcode}     \end{document}      gave something like ![enter image description here](http://i.stack.imgur.com/vs97w.png) where the arrow might be a latex symbol, a pgf/tikZ picture, etc.


title: What causes those warnings and how can I avoid them?

text: I have a bunch of warnings as follows:               l.3387 \end{align}                       pdfTeX warning (ext4): destination with the same identifier (     name{equation.0.24}) has been already used, duplicate ignored     <to be read again>                        \relax     l.3392 \end{align}      However, I haven't duplicated naming any equations or figures. Then it is finished off with:               LaTeX Warning: There were multiply-defined labels.      Again, there are no `??` in the document and nothing was labeled with the same name. What can cause this, and how can it be avoided? I have equations and figures labeled that aren't referenced since I didn't know if I would reference it so I labeled it any ways. Is that an issue? Just to verify, I am not using `equation` or `eqnarray` environments. ![enter image description here](http://i.stack.imgur.com/pdJvU.png) Here is possibly the important stuff from the preamble:               \documentclass[11pt, letter]{article}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{capt-of}     \usepackage{subfig}     \captionsetup[subfigure]{labelformat = parens}     \usepackage[pdfencoding = auto, psdextra, bookmarksdepth = 4]{hyperref}     \usepackage[noabbrev]{cleveref}     \usepackage{bookmark}     \usepackage[all]{hypcap}      I label the items as `\label{somenameIcreate}`. If it is a figure, I name it after the `.tex` file that created the standalone graphic. So if I created a graphic in a tex file called `ellipticaltrajmars.tex`, its label would be `\label{ellipticaltrajmars}`. Would `.aux` file have anything useful in it? I know it has labels, but what would I be looking for in it if there was something to gleam from it?


title: How to change font size in table of contents?

text: I would like to know how to change the font size in the table of contents. Maybe make it 14pt or 16pt.               \documentclass[12pt]{report}     \begin{document}     \tableofcontents     \addcontentsline{toc}{chapter}{Introduction}     \addcontentsline{toc}{chapter}{Factoring the Group Determinant}     \addcontentsline{toc}{section}{Finite Abelian Groups}     \addcontentsline{toc}{chapter}{References}          \end{document}


title: How do I create an automatic break in long math expressions

text: Is there a way to allow long math expressions to break automatically, whenever (and only) in situations where they extend beyond the body text of a document? For example, I would like something like the following to break over two lines _if_ (and only if) it finds itself in a narrow column of text (say, if `<class>` is `IEEEtran`), but otherwise remain on a single line (if, for example `<class>` is `article`), as long as it fits within a single (wider) column.               \documentclass{article}     \usepackage{lipsum}          \begin{document}          \lipsum[1]     \[      \hat{S}=\sum_{l\in\left\{ 1,\ldots L\right\} }\left[\bigl[1\!-\! f_{p}(l\!+\!1)\bigr]\;\overline{w}(l-1)\;\biggl[\,\prod_{i=0}^{l-1}\; f_{p}(i)\;\,\overline{\! N}(i)\biggr]\;\hat{H}_{S}(l-1)\right]     \]        \lipsum[2]          \end{document}


title: Tikz right-angle edges between nodes

text: In the example below I'd like to have angled edges which just go vertically and horizontally. My aim is to get the edges like in this image (the rounded edges are not a must) ![BPMN image](http://i.stack.imgur.com/DJWYA.gif): Here is my minimal working example:               \documentclass{article}          \usepackage{tikz}          \usetikzlibrary{arrows,positioning, shapes.symbols,shapes.callouts,patterns}               \begin{document}     \begin{tikzpicture}[         pre/.style={<-,shorten <=1pt,>=stealth',semithick},         post/.style={->,shorten >=1pt,>=stealth',semithick}         ]          \node[draw](start){start};          \node[draw, right=of start] (split) {+}                 edge[pre](start);          \node[draw, right=of split](pricedb){PriceDB}         edge[pre](split);          \node[draw, below=of pricedb](stockdb){StockDB}         edge[pre](split);          \node[draw, above=of pricedb](orderpage){OrderPage}         edge[pre](split);             \node[draw,right=of pricedb](join){+}         edge[pre](pricedb)         edge[pre](stockdb)         edge[pre](orderpage);          \node[draw, right=of join](invoice){invoiceservice}         edge[pre](join);          \node(silent)[right=of invoice]{}         edge[<-,shorten <=1pt,>=stealth',semithick, dashed](invoice);     \end{tikzpicture}     \end{document}


title: How to retain the double-column formatting of the previous page after \clearpage?

text: I'd like to have some additional material after a paper, starting on a new page. For this purpose I'm using `\clearpage` or `\cleardoublepage` (`\newpage` doesn't work the way I want). Unfortunately, while the new material indeed starts on a new page, the previous page (the last page of the paper) loses the proper double-column formatting. That last page only displays one column for a shorter text or two columns unequal in length. How can the proper double-column formatting be retained for that page also? Here is an MWE:               \documentclass[twocolumn,twoside]{revtex4}     \usepackage{lipsum}     \begin{document}     \maketitle     \section*{Main Text}     \lipsum[1-7]     \clearpage     \section*{Additional Material}     \lipsum[8-10]     \end{document}


title: Long vs. short labels for cross-references

text: @DavidCarlisle argued in his answer that there is no need to use very long labels and it is actually a misuse! In my dissertation I find myself using very long labels all over the place. For the same reason I normally use long and descriptive file names, I tend to use long labels that are informative. The only drawback of this approach that I could think of, so far, was the following. When referring to a label the `\ref{very-long-label}` macro pollutes the code and makes it harder to read. Otherwise, this usage makes it easier to find the labels you need while writing. I learned the second drawback yesterday, when I got to know the `showkeys` and `showlables` packages. These packages become useless when long labels are used (see Tweak showlabels/showkeys - wrap the label). One last piece of information. I use `emacs+AUCTeX`, so I can always get a nice list of labels that are defined in the document, and this list handles long labels fine. So what is the best practice here? What is considered a _good_ choice of labels?


title: Are there some predefined directories for .tex file inclusion?

text: My question is simple, are there some predefined directories (in the _texmf_ file system) where I can save my _.tex_ files for further inclusions ? > If yes :   * which ones are they ?   * Can I defined mine manually editing a configuration file ? > If not :   * Is there some way to include a .tex file (placed anywhere on the disk) in a .tex file I write (anywhere on the disk too) ? > For instance : I'm writing a document located at `/media/XXX/documents/latex/foo/bar.tex` And I need to include a file let's say located at `~/texmf/includes/style1.tex` **ps** : and between include or input, which one seems more appropriate in my case ?


title: How to abort compilation in TeXstudio?

text: I'm using TeXstudio to compile my LaTeX code. However, for some reason in my code, the compilation will be immersed in a endless loop. Hence, when I fix the problems in my code (or may be not) and need to recompile it, I have to kill the engine first. What's more annoying, if the problem that causes the never-ending loop remains, I have to kill the process in terminal window again and again and again. Is there any way to abort compilation in TeXstudio?


title: How to remove space before enumerate?

text: How can i remove space before enumerate?               % before \begin{document}     \usepackage{enumerate}      This is first line and i need to remove space between this line and item list below it.               % after \begin{document}     \begin{enumerate}[-]      \item asdasd      \item dsfdsf     \end{enumerate}


title: Lowercase small caps in section/subsection/…

text: I'm interested in setting the titles of section and more in lowercase small caps. And I don't know how to automatically achieve this.               \documentclass{scrartcl}     \setkomafont{sectioning}{\scshape}     \usepackage{hyperref}     \begin{document}         \section{Hello}         \section{hello}         \subsection{helloHello}     \end{document}      But if I write everything in lowercase, then the `\tableofcontents` doesn't look good unless I use small caps there too. I know about `\MakeLowercase{}` but this needs an argument. By the way, as I noted, I just want to show them in lowercase small caps in the document, not in the table of contents, …. Any ideas? PS: I don't know if this is necessary, but I'm using the `MinionPro` package. **EDIT** : after some research, apart from what is answered here, in classicthesis.sty you can look at other different (or semi-different) method.


title: xindy: formatting the first letter of the first entry of a letter group

text: How do I format the first letter of the first entry of a letter group in an index generated with xindy? The result should look something like this:               ...     \indexspace          \item \textbf{b}athroom\quad{}1     \item beginner\quad{}9     \item boldface\quad{}2     ...


title: How to eliminate certain vertical lines in tables

text: I'd appreciate if somebody could help me with this. I'd like to eliminate the vertical lines of the 8th row. I haven't been able to get it.               \begin{table}     \footnotesize     \begin{tabular}{| >{\centering\arraybackslash}m{0.50in} | >    {\centering\arraybackslash}m{0.9in} || >{\centering\arraybackslash}m{0.50in} | >{\centering\arraybackslash}m{0.9in} || >{\centering\arraybackslash}m{0.50in} | >{\centering\arraybackslash}m{0.9in}|}\hline     Category Index  & Category Name & Category Index  & Category Name & Category Index  & Category Name\\     \hline\hline     1         & animation  & 7   & sci-fi   & 13 & war \\     \hline     2         & action     & 8   & comedy   & 14 & mystery \\     \hline     3         & film-noir  & 9   & thriller & 15 & musical \\     \hline     4         & children's & 10  & fantasy  & 16 & romance \\     \hline     5         & adventure  & 11  & horror   & 17 & IMAX \\     \hline     6         & crime      & 12  & western  & 18 & drama \\     \hline               &            &     &          & 19  & documentary\\ \cline{5-6}     \end{tabular}     \end{table}      Many thanks in advance for your help.


title: One table/figure per page in LaTeX

text: I am struggling with `figure`/`table` positioning in LaTeX. Basically, I'd like to have one `figure`/`table` per page. I found how to, but the problem is that LaTeX puts the `table`/`figure` in a single page, but the page before the figure page is not filled with text. So, basically I have a page filled for an half, a page with my `figure`/`table` and lastly a page filled normally with text. I'd like to have the two pages filled homogeneously with text. Is there any option that I'm missing? I am using the package `float` with `p` option and a `\clearpage` at the end of each `figure`/`table`. I hope I've been clear in my explanation.


title: How to draw an arrow with a different head?

text: I need to draw an arrow but with different head. The head should look like `$\dashv$`. And I do need to change the line. I tried with `$--\dashv$`, but it wasn't nice. Any idea? It should look like a horizontal T.


title: LaTeX to HTML conversion with Kile

text: I am using Kile to convert a `.tex` file to HTML (LaTeX to web) but when I look at the HTML page it does not show me the images. I tried including them in PostScript and PNG but still the HTML page does not show the images. Here is an example that show the LaTeX file with the image:               \documentclass[12pt]{article}     \usepackage{graphicx}          \begin{document}     text     .     .     .     \begin{figure}[hr]          \centering           \resizebox{0.6\textwidth}{!}{\includegraphics[angle=-90]{./sey1.png}}            \label{sey1}     \end{figure}          \end{document}      I tried with both PostScript and PNG and got the same result. It also complained about using the `graphicx` package. Any suggestions?


title: Creating abbreviations list with manual entries

text: How do I create list of abbreviations if I want to add them manually and not tag each abbreaviation in the file first (the file is already written)?


title: TeXworks bite+TAB

text: I like to use TeXworks as a text editor for latex documents. I just have a question with a keyboard shortcut. When I type bite + `TAB`, I've got the following result :               \begin{itemize}     \item          \end{itemize}•      I'm just wondering why there is a dot at the end. Does anyone has an answer ?


title: Short line in math expression?

text: I have a mathematical terminology, and I can not do it correctly using LaTex. The origin form is in picture below: ![enter image description here](http://i.stack.imgur.com/0i9VV.png) My version is: ![enter image description here](http://i.stack.imgur.com/Qk79g.png) The main problem is the line between a number and the word simplex. Can you help fix it, and provide the correct LaTex expression?


title: Redefine quotation mark usage

text: I would like to be able to manually redefine quotation mark usage, preferably without having to load an external package. Judging by the answer to How does TeX's mechanism for sorting out quotation marks work?, it seems that TeX and LaTeX use fonts that feature built-in ligatures to handle quotation mark conversion, while XeTeX and XeLaTeX refer to a map file that has the same function. The quotation marks are effectively ligatures, and not directly defined by the typesetting system. However, I would like to be able to directly define the expected quotation mark result. For example, I would like to define commands similar to the following (which do not work):               \def```{\char"201C\char"202F\char"2018\relax}      which should render as something like `“‘`.               \def'''{\char"2019\char"202F\char"201D\relax}      which should render as something like `’”`. I would prefer a solution that could use any character or set of characters as the replacement, because I may have to customize the usage further in the future.


title: Equation on papyrus with TikZ

text: **First of all to apologize for my English.** So, many times when I teach on the board used to include the final result on papyrus (and that likes too students). Just I think that would be a good idea to do it and at my notes. * * * **So my question:** How can I get one papyrus inside to have a mathematical relationship or a text. I want to create something maybe whith TikZ that listens to commands               \papyrustrue % on the preamble          \startpapyrus      $ E = m c^2 $     \stoppapyrus      The `\papyrustrue` will switch to the papyrus displayed or not (if I comment it out `%\papyrustrue`). Certainly the mathematical relationship I always want to appear. I mean if I comment out the `\papyrustrue` not disappear and the relationship but only the papyrus. Rather it should be the papyrus as a layer over the ralationship ( .... that's what I think, maybe this idea is wrong) At the final result I imagine something like this ( sorry for handmade figure, if I knew how to do it will not ask you, currently the score is: papyrus - karathan = 1 - 0 :-) ) I have seen this \boxed{}, TikZ and colored equation background but if on LateX I am relatively new I am ultimately irrelevant on TikZ ![enter image description here](http://i.stack.imgur.com/wQvza.jpg) * * * I know my question sounds rather do this for me, and I don't feel good for it... but I don't know what else to do... Of course, I would like to hear your opinion if the idea of the papyrus is something worthwhile. * * * Here I put the stolen code from jpgfdrew than I use, but certainly that no help very much . Just think maybe through the jpgfdraw and flowframe that it include maybe to manage something . . . but rather I try in vain without results ... .... never mind I survive without papyrus :-) the score is: papyrus - karathan = 2 - 0               \documentclass{article}     \usepackage{tikz}          \begin{document}     \begin{pgfpicture}{0bp}{0bp}{420.849709bp}{179.390961bp}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{32.278702bp}{137.07737bp}}     \pgfpathcurveto{\pgfpoint{5.113533bp}{147.962151bp}}{\pgfpoint{26.937674bp}{155.673503bp}}{\pgfpoint{37.413107bp}{145.194173bp}}     \pgfpathcurveto{\pgfpoint{45.642968bp}{139.580246bp}}{\pgfpoint{46.640999bp}{127.003489bp}}{\pgfpoint{34.337142bp}{127.252997bp}}     \pgfpathcurveto{\pgfpoint{0.747145bp}{137.108558bp}}{\pgfpoint{-15.689186bp}{157.100377bp}}{\pgfpoint{34.150011bp}{161.778649bp}}     \pgfpathcurveto{\pgfpoint{103.887462bp}{161.404387bp}}{\pgfpoint{428.247698bp}{121.857389bp}}{\pgfpoint{415.897059bp}{164.398482bp}}     \pgfpathcurveto{\pgfpoint{404.575639bp}{186.604683bp}}{\pgfpoint{351.368085bp}{173.848593bp}}{\pgfpoint{370.704945bp}{159.720209bp}}     \pgfpathcurveto{\pgfpoint{403.140969bp}{148.211659bp}}{\pgfpoint{410.71977bp}{167.236634bp}}{\pgfpoint{387.453161bp}{167.766838bp}}     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{37.892612bp}{39.289968bp}}     \pgfpathcurveto{\pgfpoint{107.630063bp}{38.915706bp}}{\pgfpoint{431.990299bp}{-1.754077bp}}{\pgfpoint{419.63966bp}{40.787015bp}}     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{4.343639bp}{143.814082bp}}     \pgfpathcurveto{\pgfpoint{25.92607bp}{73.0786bp}}{\pgfpoint{7.462488bp}{43.387163bp}}{\pgfpoint{2.846592bp}{23.301779bp}}     \pgfpathcurveto{\pgfpoint{15.44674bp}{3.216395bp}}{\pgfpoint{48.631287bp}{-3.146055bp}}{\pgfpoint{42.144082bp}{12.448187bp}}     \pgfpathcurveto{\pgfpoint{39.898511bp}{59.729929bp}}{\pgfpoint{31.914259bp}{104.391838bp}}{\pgfpoint{41.76982bp}{128.469348bp}}     \pgfpathcurveto{\pgfpoint{35.532123bp}{127.097055bp}}{\pgfpoint{19.064604bp}{128.344594bp}}{\pgfpoint{4.343639bp}{143.814082bp}}     \pgfclosepath     \color[rgb]{1.0,1.0,1.0}\pgfseteorule\pgfusepath{fill}     \pgfpathmoveto{\pgfpoint{4.343639bp}{143.814082bp}}     \pgfpathcurveto{\pgfpoint{25.92607bp}{73.0786bp}}{\pgfpoint{7.462488bp}{43.387163bp}}{\pgfpoint{2.846592bp}{23.301779bp}}     \pgfpathcurveto{\pgfpoint{15.44674bp}{3.216395bp}}{\pgfpoint{48.631287bp}{-3.146055bp}}{\pgfpoint{42.144082bp}{12.448187bp}}     \pgfpathcurveto{\pgfpoint{39.898511bp}{59.729929bp}}{\pgfpoint{31.914259bp}{104.391838bp}}{\pgfpoint{41.76982bp}{128.469348bp}}     \pgfpathcurveto{\pgfpoint{35.532123bp}{127.097055bp}}{\pgfpoint{19.064604bp}{128.344594bp}}{\pgfpoint{4.343639bp}{143.814082bp}}     \pgfclosepath     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{20.156201bp}{144.469041bp}}     \pgfpathcurveto{\pgfpoint{22.744845bp}{140.071464bp}}{\pgfpoint{21.372552bp}{136.4536bp}}{\pgfpoint{20.343332bp}{132.679793bp}}     \pgfpathcurveto{\pgfpoint{27.17361bp}{129.280249bp}}{\pgfpoint{31.446432bp}{128.812421bp}}{\pgfpoint{33.255364bp}{128.84361bp}}     \pgfpathcurveto{\pgfpoint{32.10139bp}{132.461474bp}}{\pgfpoint{32.475652bp}{134.675856bp}}{\pgfpoint{32.787537bp}{137.264501bp}}     \pgfpathcurveto{\pgfpoint{30.198893bp}{138.075401bp}}{\pgfpoint{25.489431bp}{139.073433bp}}{\pgfpoint{20.156201bp}{144.469041bp}}     \pgfclosepath     \color[rgb]{1.0,1.0,1.0}\pgfseteorule\pgfusepath{fill}     \pgfpathmoveto{\pgfpoint{20.156201bp}{144.469041bp}}     \pgfpathcurveto{\pgfpoint{22.744845bp}{140.071464bp}}{\pgfpoint{21.372552bp}{136.4536bp}}{\pgfpoint{20.343332bp}{132.679793bp}}     \pgfpathcurveto{\pgfpoint{27.17361bp}{129.280249bp}}{\pgfpoint{31.446432bp}{128.812421bp}}{\pgfpoint{33.255364bp}{128.84361bp}}     \pgfpathcurveto{\pgfpoint{32.10139bp}{132.461474bp}}{\pgfpoint{32.475652bp}{134.675856bp}}{\pgfpoint{32.787537bp}{137.264501bp}}     \pgfpathcurveto{\pgfpoint{30.198893bp}{138.075401bp}}{\pgfpoint{25.489431bp}{139.073433bp}}{\pgfpoint{20.156201bp}{144.469041bp}}     \pgfclosepath     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{416.499459bp}{161.030126bp}}     \pgfpathcurveto{\pgfpoint{418.994537bp}{145.934899bp}}{\pgfpoint{391.829368bp}{77.694496bp}}{\pgfpoint{420.148511bp}{40.892084bp}}     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{366.25481bp}{165.147006bp}}     \pgfpathcurveto{\pgfpoint{370.621198bp}{159.034063bp}}{\pgfpoint{372.367753bp}{151.424073bp}}{\pgfpoint{368.126119bp}{145.685391bp}}     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{387.026341bp}{167.673273bp}}     \pgfpathcurveto{\pgfpoint{389.864493bp}{163.805901bp}}{\pgfpoint{389.802116bp}{159.751398bp}}{\pgfpoint{387.961995bp}{156.164722bp}}     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgfsetlinewidth{1.0bp}     \pgfsetrectcap      \pgfsetmiterjoin \pgfsetmiterlimit{10.0}     \pgfpathmoveto{\pgfpoint{399.714409bp}{150.471577bp}}     \pgfpathcurveto{\pgfpoint{396.876257bp}{154.338949bp}}{\pgfpoint{398.997074bp}{157.364232bp}}{\pgfpoint{400.837194bp}{160.950908bp}}     \color[rgb]{0.0,0.0,0.0}     \pgfusepath{stroke}     \end{pgfscope}     \begin{pgfscope}     \pgftransformcm{1.0}{0.0}{0.0}{1.0}{\pgfpoint{148.434436bp}{90.668905bp}}     \pgftext[left,base]{\sffamily\mdseries\upshape\normalsize     \color[rgb]{0.0,0.0,0.0}$E = m c^2$}     \end{pgfscope}     \end{pgfpicture}     \end{document}      ![the output from jpgfdraw](http://i.stack.imgur.com/ePR26.png) **Eventually realize that what I ask is far more complex than I imagined** I realize why some of you ( gurus in TeX-TikZ) maybe you haven't responded to my question. Without much comment in following figure...problems of overlap has begining....... (The figure isn't through code, but with editing in Gimp) ![enter image description here](http://i.stack.imgur.com/dhYTq.png) ... **addition 1** ...after the response of @PeterGrill I show here some figures with a scale corresponding to both x-y, scale-x, scale-y (factor=2). Here I have posted the jpgfdraw file which I use to experiment https://docs.google.com/open?id=0BxaG1GVbo3S5ZkJDbmMwYlROTUk ![enter image description here](http://i.stack.imgur.com/jh41c.png) **I think the red lines must somehow remain stable. And black points to make connections with curves that vary** ![enter image description here](http://i.stack.imgur.com/1wbTH.jpg) * * * ... **addition 2** At the moment I am trying to create the red curves through TikZ as shown in handmade figure but my skills in the TikZ does not help me. ( _I think maybe something good will come out from this ...maybe not_ ) ... I think the solution will not come out of one single piece of code but rather will be piece by piece...obviously you probably have some better ideas, I would really like to hear those, really I have stuck


title: adding "and" between authors in biblatex

text: I see several questions asking how to _remove_ the and between authors, but my question is how can I add it? After much pain I was able to obtain the citing (author, year) but this resulted in loosing the "and" between authors (in norwegian "and" is "og") how can this be fixed? =)               \documentclass[a4paper,10pt]{article}     \usepackage{filecontents}     \begin{filecontents}{jobname.bib}     @Book{test1,       author    = {Einar M. Skaalvik, Sidsel Skaalvik},       title     = {Skolen som læringsarena: \emph{Selvoppfatning , motivasjon og læring}},       publisher = {Universitetsforlaget},       location  = {Oslo},       year      = {2002},     }     \end{filecontents}     \usepackage[T1]{fontenc}                             % Vise norske tegn.     \usepackage[norsk]{babel}                            % Tilpasning til norsk.     \usepackage[utf8]{inputenc}                          % For å kunne skrive norske tegn.     \usepackage{lipsum}     \def\andname{and}     \usepackage{csquotes}     \usepackage[citestyle=authoryear,backend=bibtex]{biblatex}     \renewcommand{\nameyeardelim}{, }     \addbibresource{jobname.bib}     \usepackage[colorlinks=true,citecolor=blue]{hyperref}     \author{Øistein Søvik, Silje, Magnus , Maja}     \title{PPU4000 \\ Examen Paedagogicum}          \begin{document}     \maketitle           \tableofcontents          \section{Innledning}          \section{Teori}          \section{Metode og beskrivelse}               \subsection*{Lærerens rolle i klasserommet}           Hello hello somewhat of a test \autocite{test1}      Do not mind me, plow plow plow your boat,               \section{Drøftning}          \section{Avslutning}          \printbibliography          \end{document}


title: How to add a unit to a command argument?

text: Currently I set up a box of given length `#1` and width `#2` like this:               \newcommand{\mybox}[2]{        This is a box of #1 by #2 centimeters:        \framebox{\hbox to #1cm {\vbox to #2cm}}     }          % Usage:     \mybox{5}{8]      However this causes an error as it's not allowed to append `cm` to the parameters `#1` and `#2`. Is there a way to append a unit to a command argument? Unfortunately, it is not possible to pass the unit as an argument because I also use the parameters in their original raw form.


title: biblatex: test whether a command is inside a cite command

text: The idea is the following: Normally, `\fullcite` just prints the full bibliography entry by calling `\usedriver`. In my style `biblatex-fiwi` I added the option to suppress stuff like `foreword` and `afterword`. At the moment, this option is for both, the bibliographic entry and the result of `\fullcite`. I'd like to have the possibility to distinguish between the result of `\printbibliography` and `\fullcite`. But since `\fullcite` relies on the same mechanism as `\printbibliography`, this is tricky. What I need is a test which tells me whether we are currently inside a `\cite` command. This would then allow me to add a `\fullcite`-only option. As far as I know, no test of this kind exists.


title: Without playing with "border" option of "standalone", how to remove the top white space?

text: Without playing with `border` option of `standalone`, how to remove the top white space?               \documentclass[preview]{standalone}          \usepackage{amsmath}          \begin{document}     \abovedisplayskip=0pt     \[     F(V, T) = E(V) + D(T)     \]     \end{document}      ![enter image description here](http://i.stack.imgur.com/zO2oI.png)


title: \polylongdiv with multiple variables

text: I'm fairly new to LaTeX and wanted to to do a polynomial division with 3 variables. So I found the `polynom` package and tried:               \polyset{style=C, div=:,vars=x}     \polylongdiv{49a^2 - 9b^2 - 30bx - 25x^2}{7a + 3b + 5x}      But it goes on and on without compiling and the pdflatex process runs at 100%. Is there another command? Or did I make a mistake?


title: How to skip the complete left-hand margin

text: How LaTeX calculates margins has already seemed somewhat complicated to me. In my attempt to improve my answer to this question about how to have a graphics span the complete paper with I tried again to understand it – and after reading the answer of TH to this question I thought I got it how the left margin is calculated: > `\hoffset` + 1in + `\oddsidemargin` + `\leftskip` My expectation was that if I skip the given amount to the left, I will end up at the real paper margin. However, apparently that does not work:               \documentclass{article}     \usepackage{lipsum}     \begin{document}       \lipsum[3]       \hskip\dimexpr -\hoffset-1in-\oddsidemargin-\leftskip\relax\rule{\paperwidth}{4pt}       \lipsum[3]     \end{document}      This gives the following result: ![enter image description here](http://i.stack.imgur.com/rhFBV.gif) So there is still some space between the left-hand paper margin and the output of the `\rule` command. So which length is still missing?


title: Mimic BibTeX "apalike" with BibLaTeX - (biblatex-apa broken?)

text: I am trying to move on to BibLaTeX. With BibTeX the Style `apalike` provides everything I need, as illustrated by the following MWE:               \documentclass{article}     \usepackage{xcolor}     \usepackage{natbib}     \usepackage{hyperref}     \hypersetup{%         colorlinks=true,          citecolor=blue}           \begin{document}     Some text as written by \cite{Attanasio2010} and \citep{Galindo2002}     \bibliographystyle{apalike}     \bibliography{bib}     \end{document}      where the content of the `bib` is produced by Mendeley and looks like:               @article{Attanasio2010,     abstract = {This paper provides a critical survey of the large literature on the life cycle model of consumption, both from an empirical and a theoretical point of view. It discusses several approaches that have been taken in the literature to bring the model to the data, their empirical successes and failures. Finally, the paper reviews a number of changes to the standard life cycle model that could help solve the remaining empirical puzzles.},     author = {Kaminsky, Graciela Laura and Schmukler, Sergio L.},     journal = {NBER Working Paper},     month = feb,     shorttitle = {Consumption and saving},     title = {{Consumption and saving: models of intertemporal allocation and their implications for public policy}},     url = {http://papers.ssrn.com/sol3/papers.cfm?abstract\_id=1558816 http://www.nber.org/papers/w15756},     volume = {756},     number = {12},     year = {2010}     }          @article{Galindo2002,     author = {Galindo, Arturo and Schiantarelli, Fabio and Weiss, Andrew},     journal = {American Economic Review},     month = apr,     shorttitle = {Does Financial Liberalization Improve the Allocati},     title = {{Does Financial Liberalization Improve the Allocation of Investment?: Micro Evidence from Developing Countries}},     url = {http://ideas.repec.org/p/idb/wpaper/4295.html},     volume = {47},     number = {2},     year = {2002}     }      What I need is actually quite simple and is demonstrated by my example   * **Citations** as shown in the example (cite: year in parentheses or citep: Author-Year separated by coma)   * Use of et al. when more than 2 authors.   * **Bibliography** : Only initials for first/middle name.   * Last name, First name   * Never use et al.    * Only show year, even when month is specified   * Never show URL (retrieved from...)   * Issue in parentheses, next to volume   * If using hyperlink, creating link for the full citation and not just the year. The result should look like: ![BibTeX example](http://i.stack.imgur.com/sbnd0.png) I have probably forgotten something, but that's the obvious stuff. I have played all day with different styles of BibLaTeX, including authoryear and apa, but I was unable to reproduce the simple apalike style. In fact, I have been unable to get apa for BibLaTeX to work as I get errors such as:               Package biblatex Warning: Bibliography string 'retrieved' undefined(biblatex) at entry 'Attanasio2010'      **Edit 1:** The biblatex-apa MWE that I cannot get to work is:               \documentclass{article}     \usepackage{xcolor}     \usepackage{hyperref}     \hypersetup{%         colorlinks=true,          citecolor=blue}           \usepackage{polyglossia}     \setmainlanguage[variant=american]{english}          \usepackage{csquotes}          \PassOptionsToPackage{             natbib=true,             style=apa,             hyperref=true,             backend=biber,             maxbibnames=99,             firstinits=true,             maxcitenames=2,             parentracker=true                 }   {biblatex}     \usepackage{biblatex}     \DeclareNameAlias{default}{last-first}         \DeclareLanguageMapping{american}{american-apa}          \addbibresource{bib.bib}          \begin{document}     Some text as written by \cite{Attanasio2010} and \citep{Galindo2002}          \printbibliography          \end{document}      which produces the errors:               Undefined control sequence: <argument> \mkbibdateapalongextra :         Package biblatex Warning: Bibliography string 'retrieved' undefined(biblatex) at entry 'Galindo2002'     Package biblatex Warning: Bibliography string 'from' undefined(biblatex) at entry 'Galindo2002'      and looks like this: ![enter image description here](http://i.stack.imgur.com/lY62u.png) **Edit 2:** The issue lies with polyglossia. When using \usepackage[american]{babel} instead there are no errors. **Edit 3:** Further testing shows that, when using polyglossia, one has to use `\DeclareLanguageMapping{english}{american-apa}`. This takes care of the `Bibliography string 'retrieved' undefined` errors, but the dates are still wrong and the `Undefined control sequence: \mkbibdateapalongextra` is still there.


title: Is there a similar manpage for LaTeX packages/template?

text: In Unix like systems, there are always manpages for the packages installed.When I'm using latex, I have to use some templates or packages. But I'm not familiar with the usage of some package.For example, `pifont` provides me with wonderful special symbols, however I would not bother to try all numbers using such like `\ding{43}` to find what it'll output. And there seems not so many cheatsheets when I try Google. It is always said that RTFM and STFW are two good ways for learning. But how for LaTeX learning?


title: foreach loop and calc

text: Why doesn't `\posx` in the following loop change? I have added manually what should be the result (second picture on the left). Any way to fix this?               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{pgfplots}     \usepackage{tkz-fct}     \usetkzobj{all}          \usepackage{ifthen}          \begin{document}          \newcommand{\vt}[1]{       \pgfmathsetmacro{\posx}{0}       \foreach \x/\y in {#1}{         \draw[color=red,thick] (\posx,\y) -- (\x + \posx,\y);         \pgfmathsetmacro{\posx}{\x + \posx};       }       \node at (5,3) {posx: \posx};     }          \begin{tikzpicture}        \tkzInit[xmax=6,ymax=4]        \tkzGrid        \tkzAxeXY        \vt{1/1,2/2,3/3}     \end{tikzpicture}     \begin{tikzpicture}        \tkzInit[xmax=6,ymax=4]        \tkzGrid        \tkzAxeXY        \draw[color=red,thick] (0,1) -- (1,1);        \draw[color=red,thick] (1,2) -- (3,2);        \draw[color=red,thick] (3,3) -- (6,3);     \end{tikzpicture}               \end{document}      ![loop.jpg](http://i.stack.imgur.com/Z48hq.jpg)


title: Refrange in \ref Endash

text: I am just a beginner in Latex, I am facing a problem in Ref Range, Here is the Latex document content               \documentclass{article}          \begin{document}          \begin{figure}     \caption{Figure 1.\label{figa}}     \end{figure}          Figure~Sample Text follows     Figs~\ref{figa} \ref{figa,figb,figc} and \ref{figd,fige}.          \begin{figure}     \caption{Figure 2.\label{figb}}     \end{figure}          \begin{figure}     \caption{Figure 3.\label{figc}}     \end{figure}          \begin{figure}     \caption{Figure 4.\label{figd}}     \end{figure}               \begin{figure}     \caption{Figure 5.\label{fige}}     \end{figure}               \end{document}      Is it possible to redefine \ref in a way it is used in \cite, where single cite, 2 citations separated by "and" and multiple citations in endash, For example: \ref{figa} - Figure 1 - already coming correctly,               \ref{figa,figb,figc} should come as Figs 1-3               \ref{figd,fige} should come as Figure 4 and Figure 5,      I tried cleverref, but it adds a extra work to change the \ref coding to \cref, is it possible to do it without changing the latex coding, please guide me


title: Execute lua file out of a pdf, lua doesn´t execute "io.open" command

text: I would like to run program out of the compiled pdf via link.               \documentclass[12pt]{article}      \usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = blue]{hyperref}           \begin{document}     \href{run:bat.lua}{name}     \end{document}      and it works so far, but it doesn´t execute the open/create commmand:               file = io.open("bla.lua", "w")     file:write()     file:close()      The compilation is ok and all of the other commands like               print("Hello")      will be executed. What´s wrong? Or does somebody know a different "easy" way to execute lua files from a pdf?


title: Format mathematical definitions

text: I want to define a list of definitions. This is what I have:               \begin{align*}     Let & L_{1} = (Q_{1},\sum,\delta_{1},q_{1},F_{1}), and \\     & L_{2} = (Q_{2},\sum,\delta_{1},q_{2},F_{2}).     \end{align*}      I basically want it to say `Let` and then the two definitions to be lined up. But for some reason there is no space between `Let` on the first definition and also the sum symbol is huge.


title: Curlier mathcal?

text: In my LaTeX document, `$\mathcal{N}$` is not being rendered 'curly' enough for my liking: ![enter image description here](http://i.stack.imgur.com/Fa40e.png) If my document class is 'article' then I get the curlier N. The problem occurs when my document class is 'elsarticle' (Elsevier template). Presumably there's something that I can override?


title: How can I stop defined points that are not displayed from influencing image size?

text: I have the following image ![enter image description here](http://i.stack.imgur.com/sSSrB.png) that was created with this code:               \documentclass[varwidth=true, border=2pt]{standalone}     \usepackage{tikz}     \usepackage{tkz-euclide}          \begin{document}     \usetkzobj{all}     \begin{tikzpicture}         \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]         \tkzSetUpLine[line width=1]         \tkzDefPoints{0/0/A, 3/0/B', 2/2/C, 4/4/C'}         \tkzDefLine[parallel=through C](B',C') \tkzGetPoint{Phelper}         \tkzInterLL(A,B')(C,Phelper) \tkzGetPoint{B}         \tkzDrawLine[add=0 and 0.2](A,B')         \tkzDrawLine[add=0 and 0.2](A,C')         \tkzDrawSegment(B',C')              \node at ($(A)+(-0.1,-0.2)$)  {$A$};         \node at ($(B')+(0.2,-0.2)$)  {$B'$};         \node at ($(C')+(0,0.4)$)  {$C'$};         \node at ($(B)+(0.2,-0.2)$)  {$B$};         \node at ($(C)+(0.28,0.5)$)  {$C$};         \tkzDrawPolygon[ultra thick,color=blue,fill=blue!20](A,B',C')          \tkzDrawPolygon[line width=0.3pt,color=red,fill=red!20](A,B,C)          \tkzDrawPoints(A,B',C',B,C)         \tkzLabelSegment[below,red](A,B){$c$}         \tkzLabelSegment[left,red](A,C){$b$}         \tkzLabelSegment[right,red](B,C){$a$}         \tkzLabelSegment[below,blue,pos=0.8](A,B'){$c'$}         \tkzLabelSegment[left,blue,pos=0.8](A,C'){$b'$}         \tkzLabelSegment[right,blue](B',C'){$a'$}     \end{tikzpicture}     \end{document}      As you might notice, the space above `C'` is bigger than necessary. This is because of `Phelper`. I need `Phelper` for the construction, but it should not influence the image size in any way. I've tried to get `Phelper` closer to `C`, but that seems not to be possible. **How can I stop defined (but not visible) points from influencing image size?** Please note: I wrap code like this in a figure. So images like the one above are only a part of the whole document. So working with `standalone` does not solve my problem.


title: Unable to reference figures

text: I have inserted the following figure into my latex document               \begin{figure}       \centering       \includegraphics[width=0.5\textwidth]{Figures/magnetic-sandwich.jpg}\\       \caption{A magnetic multilayer (a trilayer or ``sandwich'') that exhibits the GMR effect.  Magnetic iron (red) and chromium (grey).}\label{setup}     \end{figure}      later on in the document I want to reference this figures which I am trying to do like so:                By constructing multilayers as depicted in Fig \ref{setup} devices....      however when I typeset the document I get the following warning: LaTeX Warning: Reference `setup' on page 2 undefined on input line 64. which persists even after I typeset the document again. The text where the reference is contained is within a subsection of the section where the figure is inserted. I also have this same problem with another figure in the document but all others work ok. I am not sure on the cause of this issue and any help troubleshooting / fixing it would be appreciated. Edit: Here is a sample document which should replicate the problem:               \documentclass[10pt]{iopart}     \usepackage{graphicx}     %Uncomment next line if AMS fonts required     \usepackage{iopams}     \usepackage{placeins}     \usepackage{url}     \usepackage{multicol}     \usepackage{blindtext}          \begin{document}          \section{Giant Magnetoresistance}     \begin{multicols}{2}          %\blindtext          \begin{figure}     \centering           \includegraphics[width=0.5\textwidth]{Figures/magnetic-sandwich.jpg}\\           \caption{A magnetic multilayer (a trilayer or ``sandwich'') that exhibits the GMR     effect.  Magnetic iron (red) and chromium (grey).}\label{setup}         \end{figure}               %\blindtext               \end{multicols}               \begin{figure}     \centering     \includegraphics[width=\textwidth]{Figures/initial-results.png}     \caption{The initial results displaying GMR effect by Gr\"unberg (left) and Fert (right).\\         Left: To the far right and left the iron layers are parallel to the external magnetic field.  In the middle the iron layers are antiparallel to the external magnetic field.\\         Right:  To the far left and right the magnetisation of the iron layers are parallel to the external magnetic field.  In the middle every second iron layer is magnetised perpendicular to the external magnetic field.} \label{fig-initial-results}     \end{figure}          \begin{multicols}{2}          %\blindtext          \subsection{GMR cause and effect}     By constructing multilayers as depicted in Fig \ref{setup} devices such as spin-valves can be constructed which depend on being able to switch between different resistivity, this resistivity can be understood by analysing the following diagram.          \end{multicols}          \end{document}      The source files for iopart class can be found here: http://authors.iop.org/atom/usermgmt.nsf/AuthorServices select latex guidelines and class file on the left hand side, which should start the download.


title: How to change font of reference header into boldface using apacite

text: I am relatively new to latex, most things work however amazingly easily, nevertheless I have a small problem with the the font of the reference header. The start of my code looks like:               \documentclass[doc]{apa6}                \usepackage[american]{babel}     \usepackage{apacite}     \usepackage{endnotes}     \let\footnote=\endnote      And at the end of the document I have this:               \bibliographystyle{apacite}     \bibliography{References}      So as it say, everything works fine, and i get a complete reference list with the correct references, however, the font of the reference header is normal like this: > References However as the APA manual dictates is that it should be in boldface like this > **References** Any ideas or suggestions?


title: part bookmarks and toc style

text: Within the `book.cls` class, I redefined the `\part` section to customize the respective toc entry as follows:               \def\@part[#1]#2{%     \ifnum \c@secnumdepth >-2\relax     \refstepcounter{part}%     \addcontentsline{toc}{part}{\noindent\fcolorbox{ocre}{black!5}{\protect\makebox[\linewidth-2\fboxsep]{\Large\sffamily\strut #1}}}%     \else%     ...      The problem is that the `\fcolorbox` somehow does not go well with the created part bookmark in the pdf file. For instance, instead of `parttitle`, I am getting the following bookmark in the built pdf file:               push0 g 0 Gpop[-2]parttitleocreblack!5push0 g 0 Gpoptowidthheightdepthottheight-0.5 -widthheightdepthd- widthheightdepthheightted      I have been trying some `\protect` commands, without success so far. Would you be aware of a systematic way to correct this behavior. If not, I can still redefine the part titles directly in the pdf.


title: Use \singlespacing in scrheading and \onehalfspacing in the main document

text: I'm writing an article using KOMA-script `scrartcl` class. The main text uses `\onehalfspacing` option from `setspace` package. In my article I have headings with couple lines of text set up using `scrpage2` package. What I'm trying to achieve is to use `\singlespacing` only in headings. Something like this:               \documentclass[fontsize=14pt,headlines=3,headinclude]{scrartcl}     \usepackage{xltxtra}     \setmainfont{CMU Serif}     \usepackage{setspace}     \usepackage{lipsum}     \usepackage{scrpage2}     \chead{Some really long text\\ that takes\\more than one line}     \pagestyle{scrheadings}          \begin{document}     \onehalfspacing     \lipsum     \end{document}      ![Result](http://i.stack.imgur.com/TopHR.png) I'd like that _some really long text_ to have single spacing. Is it possible? Reading KOMA-script manual I didn't find anything suggesting about spacing in headings.


title: Changing the writing language

text: I write in greek (having before load all the necessary packages and own commands - babel etc). In order to change the language and write a word in english I type `\gre` and the letters appear with english characters (that is correct!). The problem is that whenever I want to come back and write greek again I use the command `\eng` and typeset the desired word ...but the first letter of it is in english! My own commands are:               \newcommand{\eng}[1]{\latintext#1\greektext} % Change language     \newcommand{\gre}[1]{\greektext\latintext#1} % Change language


title: how to configure epstopdf in ubuntu?

text: I have a problem with an eps figure in latex. When I try to compile my document I get this error:               ! Package pdftex.def Error: File `BD-SDS1-eps-converted-to.pdf' not found.     See the pdftex.def package documentation for explanation.     Type H <return> for immediate help.     ...     l.741 ...{40mm}{!}{\includegraphics{BD-SDS1.eps}}}     Using draft setting for this image.     Try typing <return> to proceed.     If that doesn't work, type X <return> to quit.     LaTeX Warning: File `PCA-AWSPCA-p1.eps' not found on input line 788.      I think this is a problem related to the epstopdf package. I have already installed the full version of tex live. So maybe I am missing something. I also tried these command :               donbeo@donbeo-K56CM:~$ echo $TEXINPUTS          donbeo@donbeo-K56CM:~$ sudo apt-get install texlive-font-utils     [sudo] password for donbeo:      Reading package lists... Done     Building dependency tree            Reading state information... Done     texlive-font-utils is already the newest version.     texlive-font-utils set to manually installed.     The following packages were automatically installed and are no longer required:       kde-l10n-engb openjdk-7-jre-lib     Use 'apt-get autoremove' to remove them.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     donbeo@donbeo-K56CM:~$ ^C     donbeo@donbeo-K56CM:~$


title: How to revert the effect of a wrongly manually installed font?

text: ## What I did... **First try.** The readme-file of uarial says actually, it should be installed in                <texmf>/fonts/type1/...      I downloaded the TDS directory, uncompressed somewhere, and then tried to copy to carpets where the files should likely to be placed: e.g.   * `/usr/share/texlive/texmf-dist/tex/` but also   * `/usr/share/texmf/` At that time, when I typed `kpsewhich uarial.sty` that file was in `/usr/share/texlive/texmf-dist/tex/latex/`. I compiled the code bellow, and I got no arial. **Second try**. Then I installed the via "getnonfreefonts", and it says I have Arial istalled (not sure if it's the same as `uarial` though).               Installation directory: /home/<myself>/texmf     ----------------------------------------     arial-urw      Arial (URW)                                  [installed]     [...]                                                       [installed]     webomints      Webomints (Galapagos Design Group)           [installed]      At that time `kpsewhich uarial.sty` said the file was located in `/home/<myself>/texmf/tex/latex/ua1/uarial.sty`. I compiled the code bellow, and I got no arial. **Third attempt**. I installed as here says, according to comments below. In short, I located the tree with `kpsewhich --var-value=TEXMFLOCAL` (mine was `/usr/local/share/texmf/`, which surprisingly, it only had a `doc/` carpet) and unpacked there the content of the `arial.tds.zip`. I compiled the code bellow, and I got no arial. I'm in Ubuntu 13.10 and installed the full latex package, if that says somehting. * * * ## Status now. **Question:** My actual problem is that I want to use arial. So I tried to install `uarial` by some methods described below. I compile (with PDFLaTeX) following code, it renders no warning, no error whatsoever; but also no arial whatsoever.               \documentclass[11pt]{article}     \usepackage[T1]{fontenc}     \usepackage[scaled]{uarial}          \begin{document}          Text here, which should be in arial, but isn't.          \end{document}      How to revert following errors and do the right installation? (If it helps to bound the problem, slightly changing the code into               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage{uarial}     \renewcommand\familydefault{\sfdefault}     \begin{document}          foo \textbf{bar}          \end{document}      which should work, as it comes from this answer, for me doesn't work.)


title: How to access last node in TikZ?

text: I am trying to make a simple figure using TikZ. ![Simple figure](http://i.stack.imgur.com/bbTwC.png) Here is my code               \documentclass{minimal}          \usepackage{tikz}     \usetikzlibrary{calc}     \usetikzlibrary{positioning}          \begin{document}          \begin{tikzpicture}       \tikzset{memory/.style={draw,minimum width = 100pt, minimum height = 25pt, node distance = 0}}            % Draw memory cells with addresses.       \newcounter{add}  % memory address       \setcounter{add}{202}       \node [memory, label=left:0x\theadd] (a)  {a};       \stepcounter{add}  % name of above node       \newcounter{aboveNode}       \setcounter{aboveNode}{1}       \foreach \n in {b,c,d,e,f} {         \node [memory, label=left:0x\theadd, below = of {\alph{aboveNode}}] (\n)  {\n};         \stepcounter{add}         \stepcounter{aboveNode}       }     \end{tikzpicture}          \end{document}      It seems to me that I should be able to do this without having to use the `aboveNode` counter. I found out about `\tikzlastnode` but using it as follows does not work.               \documentclass{minimal}          \usepackage{tikz}     \usetikzlibrary{calc}     \usetikzlibrary{positioning}          \begin{document}          \begin{tikzpicture}       \tikzset{memory/.style={draw,minimum width = 100pt, minimum height = 25pt, node distance = 0}}            % Draw memory cells with addresses.       \newcounter{add}       \setcounter{add}{202}       \node [memory, label=left:0x\theadd] (a)  {a};       \stepcounter{add}       \foreach \n in {b,c,d,e,f} {         \node [memory, label=left:0x\theadd, below = of \tikzlastnode] (\n)  {\n};         \stepcounter{add}       }     \end{tikzpicture}          \end{document}      LaTeX gives the error               ERROR: Undefined control sequence.          --- TeX said ---     <argument> of \tikzlastnode           l.20       }      Is there some way to access the last node drawn? Or a simpler way to draw my diagram? At the moment I use more lines than if I had drawn each node manually. ## UPDATE As pointed out in the answer below, `remember` can be used to get rid of the `aboveNode` counter. Can the `add` counter be similarly eliminated?


I am getting this warning in the bibliography.               BibTeX> Warning -- there's a number but no series in "AAK04"      I don't have series information on this particular conference proceedings but can't get rid of the warning. This is the particular entry -               @CONFERENCE{AAK04,       author =       {Agarwal, R. and Kornhauser, A.A.},       title =        {Energy Balance for a Direct Carbon Molten Carbonate Fuel Cell},       booktitle =    {ASME Heat Transfer / Fluids Engineering Summer Conference},       address =      {Charlotte},       number =       {HT-FED2004-56887},       year =         {2004},       series =   {}       }      And this is the entry in the main document using the `database.bib` file.               \bibliographystyle{plainnat}     \bibliography{database}      Could anyone tell me what is wrong here or how to correct it? I am using TeXnicCenter and MikTeX package. UPDATE 7/6/14 As per @egreg recommendation which made sense, I've changed the entry in .bib file to this:               @CONFERENCE{AAK04,       author =       {Agarwal, R. and Kornhauser, A.A.},       title =        {Energy Balance for a Direct Carbon Molten Carbonate Fuel Cell},       booktitle =    {ASME Heat Transfer / Fluids Engineering Summer Conference},       volume =       {3},       address =      {Charlotte},       note =         {Paper no. HT-FED2004-56887},       year =         {2004}       }      My output is like this: > R. Agarwal and A.A. Kornhauser. Energy balance for a direct carbon molten > carbonate fuel cell. In ASME Heat Transfer / Fluids Engineering Summer > Conference, volume 3, Charlotte, 2004. Paper no. HT-FED2004-56887. Also, the original issue in this post was regarding the warning. The warning is because number and series go together for "conference" or "inproceedings" but not for "journal" where volume and number go together. This is the inference I could draw in case somebody encounters this issue.


title: putting rectangle inside tabular environment

text: Someone can help me to do like this exemple : ![rectangle in tabular ](http://i.stack.imgur.com/7Kzg9.png)


title: how to insert arabic glyphs in pdflatex

text: I'm trying to create an English document using `pdflatex` and want to insert a few cyrillic and arabic glyphs. something like               the letter Я is cyrillic, whereas ش is arabic      I tried to follow advice found Inserting some Arabic script in an English article, but it seems that `xetex` and `pdflatex` are mutually exclusive. my feeble attempts until now look like:               \documentclass[letterpaper, 12pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[T2A,LAE]{fontenc}     \usepackage[russian,USenglish,arabic]{babel}     \begin{document}     the letter Я is Cyrillic, whereas ﺵ is arabic     \end{document}      any hints how to achieve this?


title: Issues switching from BibTex to BibLaTeX

text: I was having issues with the regular BibTeX with trying to get it to print a citation style I wanted. Particularly for SAE papers where it is useful to print the SAE Paper number. So I thought I would give BibLaTeX a try as this will allow me to easily make my own style should I need to. However, as of right now I can't seem to get BibLaTeX (using the `biber` backend) to even print the citations as they were. Instead of putting a `[1]` at the cite location its putting the citation key from the `bib` file with an awkward space at the end like this `[Schmidt2011 ]`. And the command `\printbibliography` doesn't do anything at all!. I get this error on running Biber making me think that there is something up with my `bib` file which is generated by Mendeley.               INFO - This is Biber 1.0      INFO - Logfile is 'BiblatexTESTwithUpdatedDPFstuff.blg'      INFO - Reading 'BiblatexTESTwithUpdatedDPFstuff.bcf'      INFO - Found 1 citekeys in bib section 0      INFO - Processing section 0      INFO - Looking for bibtex format file 'Alex.bib' for section 0     INFO - Decoding LaTeX character macros into UTF-8 INFO - Found BibTeX data source      'Alex.bib' WARN - Entry Gel does not parse correctly      WARN - BibTeX subsystem:      C:\Users\mmam16\AppData\Local\Temp\3y7590B5Os\Alex.bib_7160.utf8, line 4, warning: 95      characters of junk seen at toplevel      ERROR - BibTeX subsystem:      C:\Users\mmam16\AppData\Local\Temp\3y7590B5Os\Alex.bib_7160.utf8, line 1427, syntax error:      found "and1990", expected ","      INFO - WARNINGS: 2 INFO - ERRORS: 1      and this is my `tex` File:               \documentclass[12pt,a4paper,final]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \graphicspath{{./Diagrams/}}     \usepackage[labelfont={sf,bf}, textfont=it, margin=1cm, center]{caption}     \usepackage{subcaption}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage[backend=biber,citestyle=numeric-comp,doi=true,url=true]{biblatex}     \addbibresource{Alex.bib}     \begin{document}     Stuff in here \cite{Schmidt2011}.     \begin{figure}[h!]     \centering     \includegraphics[width=0.8\textwidth, keepaspectratio=true]{FilterPoreFunc}     \caption{Cordierite DPF behavior with PM loading. Redrawn and modified from        \cite{Schmidt2011}}     \label{fig:Pores}     \end{figure}     \begin{figure}[h!]     \centering     \includegraphics[width=0.8\textwidth, keepaspectratio=true]{FilterBehave}     \caption{Cordierite DPF behavior with PM loading - Old diagram for comparison. Copied directly from \cite{Schmidt2011}}     \label{fig:Pores2}     \end{figure}     %\bibliographystyle{unsrt}     %\bibliography{Alex}     \printbibliography     \end{document}      What am I doing wrong? The documentation with BibLaTeX is very complete, but it inst half difficult to follow. Any help would be much appreciated (virtual beers all round). Or should I just keep to the older `bibtex`?


title: Factorial-design diagrams in TikZ

text: I'd highly appreciate if someone could give me hand to draw this diagram in `TikZ`. ![enter image description here](http://i.stack.imgur.com/8O0pn.png)


title: SIrange typeset different in text and math mode

text: I observe a difference in the dashes typesetting when using `SIrange` in text or math modes. Any idea of why this happens? Here's the MWE:               \documentclass{article}     \usepackage{siunitx}     \sisetup{         range-phrase= -}          \begin{document}         \SIrange{e-12}{e-10}{\second}         $\SIrange{e-12}{e-10}{\second}$     \end{document}      This is how it looks: ![enter image description here](http://i.stack.imgur.com/CyZtq.png)


title: Problem with drawing an arrow using Pstricks

text: I'm trying to draw an arrow by using pstricks, but I cannot do that. The code is below:               \documentclass{book}     \usepackage{pstricks}     \begin{document}     \psline[linewidth=20pt]{<-}(2,1)     \end{document}               What should I change with this code?


title: A good template for note taking

text: One of the problems that I have read that people say about LaTeX is it isn't very good for quick note taking. Has anyone used LaTeX for quick note taking? If so what template have you used? And how have you setup your system so it is relatively easy to make quick notes? **EDIT** In response to some of the comments, I am currently using vim as my editor. Which I am very proficient in using.


title: Capitalize the first letter in acronym list

text: When using the `acronym` package I would like to capitalize the first letter in the acronym description (e.g., Direct current). But when used in text I would like to have the word in lower letters.               \documentclass{article}     \usepackage{acronym}          \begin{document}     \begin{acronym}     \acro{DC}{direct current}     \end{acronym}          Batteries run on \ac{DC}.     \end{document}      Output: > DC direct current > > Batteries run on direct current (DC).


title: a divided rectangle in tikz

text: I am trying to draw the following using tikz, but I don't even know where and how to begin. Any assistance would be much appreciated. ![enter image description here](http://i.stack.imgur.com/RApZe.jpg)


title: How can I add a director name in line with author name in beamer?

text: I would like to write director name in line with author name in a beamer like:               \author{Made by:\\Author name}     \director{Directed by:\\Director name}      but if I try to define director:               \def\director#1{\def\Director{#1}}\director{Director's Name}      Then it writes on the top of the first frame. Any suggestions?


title: generating flow of content in pdf (aka using the **zoombox** feature)

text: i am sure this feature is called something else entirely, but i have seen some recent pdfs in arxiv that seem to have information about the layout of the pdf such that when we click on a twocolumn paper it zooms to the appropriate content as shown in the figure below. ![The image shows the sections to which the pdfviewer zooms sequentially](http://i.stack.imgur.com/cgyc9.jpg) What is this feature called anyway? If it helps, i have seen something similar in marvel's digital comics, where they zoom on panels sequentially. It would help even if someone can tell me how to implement this manually in acrobat or something similar.


title: \thanks not creating footnote in twocolumn article

text: I am trying to use `\thanks` inside `\author` in a twocolumn article. The document shows an asterisk next to the author's name, but the footnote is not appearing at the bottom of the first page or anywhere else in the document. The abstract is one column and `\thanks` works if the multicol package is used, however it would be easier if the article is simply twocolumn. Here is a working example.               \documentclass [11pt, twocolumn] {article}     \usepackage[affil-it]{authblk}     \usepackage{blindtext}     \usepackage{abstract}          \begin{document}     \title{Latin text\\ \textit{and}\\ It's in Latin}     \author{James Smith%     \thanks{The author would like to thank someone.}}     \affil{USA University}     \date{November 2012}     \twocolumn[     \begin{@twocolumnfalse}     \maketitle     \begin{abstract}      \blindtext     \vspace{1cm}     \end{abstract}     \end{@twocolumnfalse}     ]     \section{Introduction}     \blindtext     \end {document}


title: Troubles with number formatting in groupplots

text: This question has already been answered for `axis` here but I have troubles to apply the approach to `groupplots` (please see `%additional code` in MWE). If I uncomment the `%additional code` the code is compiled correctly but the number formatting is not as I want it to be (thousands sep=. (or empty) and decimal sep=,) Maybe it has nothing to do with each other but I don't understand why I get the following message: > Package pgfkeys Error: I do not know the key '/pgfplots/use comma' and I'm > going to ignore it. Perhaps you misspelled it. **MWE:**               \documentclass{article}     \usepackage{pgfplots}     \usepgfplotslibrary{groupplots}           \begin{document}          \begin{figure}[htbp]     \label{fig:PlotDemand}     \centering     \begin{tikzpicture}         \begin{groupplot}[                  group style={                 group size=2 by 2,                 vertical sep= 1.5cm,                 every axis y label/.style={at={(ticklabel cs:0.5)},rotate=90,anchor=near ticklabel}             },            /pgf/number format/.cd,%additional code            use comma,%additional code            1000 sep={},%additional code             footnotesize,             xtick={42,44,46,48}          ]         \nextgroupplot[title=\#1]             \addplot[blue] coordinates{(42, 255) (43, 1584) (44, 1296) (45, 432) (46, 972) (47, 540) (48, 1104) (49, 0)};         \nextgroupplot[title=\#2]             \addplot[blue] coordinates{(42, 400) (43, 400) (44, 0) (45, 400) (46, 0) (47, 0) (48, 0) (49, 0)};         \nextgroupplot[title=\#3]             \addplot[blue] coordinates{(42, 1800) (43, 2100) (44, 1800) (45, 900) (46, 2100) (47, 2100) (48, 2100) (49, 0)};         \nextgroupplot[title=\#4]             \addplot[blue] coordinates{(42, 6800) (43, 2800) (44, 2800) (45, 2800) (46, 2000) (47, 2800) (48, 0) (49, 0)};         \end{groupplot}     \end{tikzpicture}     \end{figure}               \end{document}


title: Adding a shadow to a longtable?

text: I've already found this answer on how to add a shadowbox around a normal tabular environment. I'd like to add a shadowbox to a `longtable` environment. Is this possible at all?               \documentclass{article}     \usepackage{longtable}          \begin{document}       \begin{longtable}{|l|l|}         \hline         \textbf{Ze} & \textbf{Header} \\         \hline         \endhead         \hline         \endfoot         Lorem & ipsum \\         dolor & sit \\         amet & consectetur \\         adipiscing & elit \\         Nunc & nec \\         sem & eu \\         dolor & ultrices \\         suscipit & Donec \\         eleifend & leo \\         a & urna \\         vulputate & suscipit \\         Praesent & in \\         nunc & purus \\         Quisque & ut \\         nulla & varius \\         aliquam & risus \\         consectetur & dictum \\         nulla & Nullam \\         at & aliquet \\         nisi & Suspendisse \\         quis & mattis \\         leo & Curabitur \\         non & neque \\         mollis & porta \\         quam & feugiat \\         molestie & mi \\         Curabitur & ornare \\         nibh & nec \\         orci & euismod \\         auctor & Nulla \\         sagittis & nunc \\         non & euismod \\         porta & Morbi \\         molestie & dictum \\         purus & a \\         pharetra & magna \\         dictum & vitae \\         Aliquam & bibendum \\         dui & quam \\         vitae & euismod \\         lorem & tristique \\         nec & Morbi \\         lacinia & tellus \\         et & hendrerit \\         mollis & Cras \\         et & sem \\         in & sapien \\         mattis & hendrerit \\         ac & vitae \\         velit & Maecenas \\         interdum & gravida \\         dui & fringilla \\         vehicula & mauris \\         adipiscing & ac \\         Ut & dignissim \\         sapien & dignissim \\         semper & fermentum \\         diam & purus \\         mattis & dui \\         ut & consectetur \\         ligula & nibh \\       \end{longtable}     \end{document}


title: Where's my backslash gone?

text: When I try to use one of the more "hacky" methods of getting a literal "special character" (such as backslash or a brace) then I get a different character: backslash seems to be an open quote, left brace a dash, and right brace a close quote. What happened to my special characters?               \documentclass{minimal}          \begin{document}          \char`\\     \char`\{     \char`\}          \end{document}      produces: `"-"` (only the two `"`s are different).


title: Aligning elements in set

text: How can I create a set with aligned elements? Example: ![enter image description here](http://i.stack.imgur.com/Mqe0M.png) I tried using align but it does not align as nicely as in the example.               \begin{align*}         &P = \set{ &A &\rightarrow &a | &b | &c | &d | &e,         \\& &B &\rightarrow &a | &b | &c}     \end{align*}


title: Draw tilted arrow on a diagram using overpic

text: I have an image in PNG format. I wanted to draw some arrows over it. These arrows are neither horizontal nor vertical. I am facing problem while assigning the directions to vector. Below is the image (in which I have drawn the lines from image editor, just to show) ![enter image description here](http://i.stack.imgur.com/Lxy6u.png) Below is the code to draw an arrow-               \documentclass{article}     \usepackage[percent]{overpic}     \usepackage{xcolor}          \begin{document}     \begin{overpic}{tube}     \put(36,36){\color{green}\vector(2.5,1){50}}     \end{overpic}     \end{document}      Below is the output- ![enter image description here](http://i.stack.imgur.com/7xMqS.jpg) Notice that .5 is getting printed. I have following questions-   1. How to align arrows in any direction easily?   2. How to draw dotted lines and arrows?   3. How to set thickness of the arrow?


title: MiKTeX can't write on pdf file

text: I am using MiKTeX 2.9 on Windows 7. I'm getting the error: "can't write on pdf file." The pdf doesn't reflect what I wrote. What did I do wrong? My input:               \documentclass[12pt]{article}     \usepackage{epsf}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{amsmath}     \usepackage{rotate}     \usepackage{endnotes}     %\usepackage{harvard}     \usepackage{vmargin}     \usepackage[nolists,noheads,tablesfirst,nomarkers]{endfloat}     \usepackage{natbib}     \bibliographystyle{apsr}          \oddsidemargin=1.0in\evensidemargin=0.in     \textheight=8.5in\textwidth=6.6 in \baselineskip=18pt \parskip=6pt          \begin{document}  % added, was missing          TEXT          \newpage \baselineskip=12pt     \doublespacing          \bibliographystyle{apsa}     \bibliography{Dissertation_Proposal}               \end{document}


title: How to center text and a rule in a heading

text: I'm working on my resume, found a nice template as a starting place, but I want my name to be centered on the top above a horizontal rule. Also, rather than two arguments, I just want one, my name. I would have like to have simplified that part away already, but when I remove the second argument, I start getting the below error, which I don't understand: > LaTeX Error: There's no line here to end.               \newcommand{\makeheading}[2][]     {     \begin{minipage}[t]{\textwidth}     {\Large \scshape{ #2 \hfill #1}}\\[-0.15\baselineskip]     \rule{\columnwidth}{1pt}     \end{minipage}     }      How can I modify this new command to take just the name argument, and produce a centered heading above the same horizontal rule? Many thanks.


title: Problem with missing spaces when having >9 subsections in table of contents (using the beamer class)

text: I have googled extensively and found no answer to my specific question. My problem is: I am creating lecture slides using the `beamer` class. My style file is University-specific. I have, in my first `\section`, more than 9 `\subsections`. When I create the `\tableofcontents`, this looks like here: ![tableofcontents](http://i.stack.imgur.com/2oi1o.jpg) Notice that the subsections with number >9 have a missing (or, at least, not visible) space between the number and the name of the subsection (e.g.: 1.10Vibromyogramm (VMG)). How can I prevent this and make my TOC more legible? **EDIT1** After following some initial answers, `\usepackage{tocloft}` is not the solution since it does not work with the `beamer` class (others have noticed that, too - see List of Figures + Beamer?). Using `tocloft` causes pdflatex to fail with `!LaTeX Error: \l@section undefined` (it fails in the file `tocloft.sty` - and, as a previous poster said, lying to tocloft by defining the command as empty beforehand doesn't do any good either). **EDIT2** In reply to some comments by my fellow Latexers: If I only have, say, 3 `\subsections`, the spacing is exactly the same. Also, I do not think the reason is not only the style file; however, here is one line from the `beamer font theme` that is needed to understand the answer:               % Schriftart Helvetica     \usepackage[scaled]{helvet}     \renewcommand*{\familydefault}{\sfdefault} % Standard ist serifenlos      **EDIT3** Thanks to Heiko's answer (see below), I have now found the solution to my problem. Thanks a bunch!


title: ZephGreek and ZephText

text: Greetings to all TeX lovers! I have been reading Xenophon's "Cyrus' Anabasis" these days in my free time. The book is from the Loeb Classical Harvard Library. Usually I use Garamond to write my papers or other work in English and the standard Didot for Greek (Gulliver is also good for Latin script, but you need to purchase it). Yet, I would say that I prefer the glyphs from LCL. In the book it says that they use ZephGreek and ZephText. I was wondering if there is a close substitute for TeX.


title: visualize code indentation

text: How can I visualize code indentation? What I want is to draw a vertical line along the indentation. Since an example is easier to show then to explain you can see one in this paper (on page 2)


title: What's up with the spacing between letters inside $...$?

text: When I write `$VSS$` in my LaTeX studio, it behaves it as if there is a space between V and S (i.e. V SS). Is there a way to fix this? I tried `\scalebox{.85}[1.0]{$VSS$}`, but it did not work well. Any suggestion would be appreciated.


title: Passing variable as argument

text: I need to pass a variable to a command, but I cannot get it to work. Here is a short example that shows that #1 can be sent to a command, but not a variable that is a copy of #1. Why is this?               \documentclass{article}     \usepackage{tikz}          \pgfkeys         { /mypgf/.cd         , options/.store in = \options         , options/.get = \options         }          \newcommand{\img}[2][]{         \pgfkeys{/mypgf/.cd, options=#1}         \def \test {#1}              % This works:         \includegraphics[#1]{#2}              % This does not work:         \includegraphics[\options]{#2}              % This does not work either:         \includegraphics[\test]{#2}     }          \begin{document}          \img[width=0.1\textwidth]{image.png}          \end{document}


title: Advantages of longtabu? compared with longtable

text: I know to use `longtabu`, we need to have the packages `tabu` and `longtable`. What are the advantages of `longtabu`? By now, i just found `longtabu` can break lines automatically in a table cell, but seems `longtable` can not do it. Any more advantages?


title: Problem with font OT1-Greek letters

text: I am having this problem. I got this sample by net:               \documentclass[paper=a4,fontsize=11pt]{scrartcl}     \usepackage[iso-8859-7]{inputenc}          \usepackage{kerkis}     \usepackage{a4}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage[vcentering,dvips]{geometry}     \usepackage{calc}     \input{epsf.tex}     \usepackage[english,greek]{babel}     \usepackage{amsmath,amsfonts,amsthm}     \usepackage[svgnames]{xcolor}     \usepackage{geometry}     \textheight=700px     \usepackage{url}     \usepackage{wrapfig}     \frenchspacing     \pagestyle{empty}          \newcommand{\MyName}[1]{        \Huge \usefont{OT1}{phv}{b}{n} \hfill #1        % Name        \par \normalsize \normalfont}          \newcommand{\MySlogan}[1]{        \large \usefont{OT1}{phv}{m}{n}\hfill \textit{#1} % Slogan (optional)         \par \normalsize \normalfont}               \begin{document}     \MyName{Constantinou Philippos}     \MySlogan{Curriculum Vitae}     \end{document}      My problem is that in commands `\MyName` and `\MySlogan` I want to use Greek characters but I know I cannot because I use font `OT1` which doesn't support Greek letters. How can I solve this problem?


title: What makes TeX so easy to write?

text: I have tried various different markup/markdown languages and have found myself coming back to TeX for the ease of typing. I have always wondered what are the features which make TeX such an easy-to-type language. For example, the backslash `\` is an excellent method to differentiate commands from the text since they do not require much more than a single keypress. Also, I have found that customizing/writing small shortcuts for features in LaTeX is quite easy due to the same features. Does this flexibility extend to the bigger packages as well? Is this the reason almost every university is able to model its own thesis class and every guy is able to model his own paper style? I would like to study the features of TeX which make it so easy to customize and write. At the same time, I want to study the features which make it so hard to operate with the backend programmatically. I am aware that some of the features are dual in nature, they increase writing prowess and as an effect reduce the programming ease. So, basically, I am interested in three kinds of lists:   1. Features which make TeX easy to write/customize   2. Features which make TeX hard to program at the backend   3. Features which inherently do both of the above. The idea is that if the backend can be written in a more maintainable language and a frontend to backend compiler can be built to easily convert the user written package code into a backend. Then, it will be possible for us to develop a programmatically better version of TeX. The bottom line is that the TeX code is really great for user customization and writing technical stuff, however, the same code causes lot of anguish at programming level. However, if it is possible to "shift gears" at some level, then there might be a better way to implement TeX.


title: Problem on subfigure 2X2

text: I try to put figures in 2X2, but they appear in 4 rows.               \begin{figure*}     \begin{minipage}{\textwidth}     \centering     \begin{subfigure}[b]{1\textwidth}     \centering         \includegraphics[scale=0.3]{images/mean/N14.png}         \caption[Network2]%         {{\small Network 1}}         \label{fig:mean and std of net14}     \end{subfigure}     \quad      \begin{subfigure}[b]{1\textwidth}        \centering              \includegraphics[scale=0.29]{images/mean/N24.png}             \caption[]%             {{\small Network 2}}                 \label{fig:mean and std of net24}             \end{subfigure}              \begin{subfigure}[b]{1\textwidth}         \centering              \includegraphics[scale=0.29]{images/mean/N34.png}             \caption[]%             {{\small Network 3}}                 \label{fig:mean and std of net34}             \end{subfigure}             \quad             \begin{subfigure}[b]{1\textwidth}         \centering              \includegraphics[scale=0.29]{images/mean/N44.png}             \caption[]%             {{\small Network 4}}                 \label{fig:mean and std of net44}             \end{subfigure}                       \caption[ The average and standard deviation of critical parameters ]             {\small The average and standard deviation of critical parameters: Region R4}              \label{fig:mean and std of nets}             \end{minipage}     \end{figure*}      Any suggestion please?


title: Drawing a root-less graph of nodes with shared children

text: My aim is to produce a graph as illustrated by the code below: ( I am not yet allowed to post pictures)               \documentclass[tikz]{standalone}          \begin{document}         \begin{tikzpicture}[node distance=4cm]             \node [circle,draw](a){XY};             \node [circle,draw][right of = a](b){YZ};             \path (a) -- (b) node[circle,draw] [below, midway, yshift = -2 cm] (d) {Y};             \node [circle,draw][right of = b](c){XZ};             \path (b) -- (c) node[circle,draw] [below, midway, yshift = -2 cm] (e) {Z};             \node [circle, draw][below right of = c,yshift = 0.45 cm, xshift = -1 cm](f) {X};                  \draw (a) -- (d);             \draw (b) -- (d);                  \draw (b) -- (e);             \draw (c) -- (e);                  \draw (a) -- (f);             \draw (c) -- (f);               \end{tikzpicture}     \end{document}      The code successfully generates the required output, however, as can be observed, it is a little messy, since I have to manually adjust the distances using xshift and yshift to acquire the desired results. So, I was wondering if there exists a better approach to achieve the same (or yet, better) results. ![enter image description here](http://i.stack.imgur.com/tsJff.png)


title: Suppress bulleting in itemize environment

text: I have a nested list, and I wish to suppress any bullet/diamond/hyphen that appears only in the sub-list. For example:               \begin{itemize}     \item blah     \begin{multicols}{2}     \begin{itemize}     \item a      \item b     \item c      \item d     \item e     \item f     \item g     \end{itemize}     \end{multicols}     \item blah...      \end{itemize}      I dont want anything to be prefixed to the a,b,c,d,... sublist. Is there any way to do this, other than creating the sub-list as a table rather than an itemized list?


title: Draft option in TikZ like graphicx

text: We know the use of [draft] in **graphicx** package               \usepackage[draft]{graphicx}      Do we have any option like [draft] in **tikz**? Sothat we need not compile the tikz picture for every run and need not look at the picture...Is it possible to have something like this?               \usepackage[draft]{tikz}      or **do i have any other method to do it?**


title: Remove name of the source in bibliography list

text: I use TeX for writing my thesis. In bibliography list I need to remove a source number. Now when I cite some source I use standard `cite` tag, e.g.: `\cite[p.~234]{AuthorName}` and in document there will a citation "[12, p. 234]" (I need to change "[]" for "()") where number 12 is number of the source in bibliography list. But I need to change citation style to cite name of the author, year (and page), e.g.: "(Horstmann, 2001, p. 234)" I can do it when I set author name and year in bibliography: > \bibitem[Horstmann, 2001]{Horstmann} HORSTMANN, C.S. \textit{Big Java: > Programming and Practice}. 1st. ed. New York, USA: John Wiley \& Sons, Inc., > 2001, 1231 s. \ISBN{978-0471402480}. ut on the left side of this citation there is a name of this source "[Horstmann, 2001] ....." and I don't want it there. Is it possible to remove this name of the source so the citation will be only: HORSTMANN, C.S. Big Java: .... ?


title: Word Margins to Latex margins

text: I have a word template that specificies Top = 2.5cm Bottom = 2.5cm Inside = 4cm Outside = 2cm Gutter =0cm Multiple pages = Mirror Margins I am working with a book document class and trying to configure the margins that uses the above. I have looked at the wiki but to no avail. It will be printed doubled sided. I currently have this in the code               \setlength{\topmargin}{-1.74cm}     \setlength{\headheight}{1cm}     \setlength{\headsep}{0.74cm}     \setlength{\textheight}{24.62cm}     \setlength{\textwidth}{15.5cm}     \setlength{\oddsidemargin}{0.46cm}     \setlength{\evensidemargin}{0.46cm}      Any help would be greatly appreciated


title: Shift every second ticklabel

text: I have a chart with long xaxis tick labels (text). There a way to shift every second tiklabel as it is done in Axis tick numbers overlap in TikZ for all tick labels?


title: \begin{citacao} abntex top and bottom margin

text: How can I remove the top and bottom margin of the `citacao` item in `abntex`? It currently looks like this image: ![enter image description here](http://i.stack.imgur.com/XkUeR.png) I need it to have just a single space between lines. The `abntex` implementation is               \newenvironment{citado}%       {\begin{espacosimples}%        \small        \begin{list}{}{%            \setlength{\listparindent}{0cm}%            \setlength{\itemindent}{\listparindent}%            \setlength{\rightmargin}{0cm}%            \setlength{\leftmargin}{4cm}%            \setlength{\parsep}{0pt}}%         \item\relax}%       {\end{list}\end{espacosimples}}          \newenvironment{citacao}%       {\begin{citado}}%       {\end{citado}}%


title: What is the differences between mathcode and catcode and how can I use mathcode?

text: The command `\catcode` is often used to change some internals. E.g. the command `\makeatletter` changes the catcode `@`. But what is `\mathcode` and how does it work? catcodes are well explained here: Wiki TeX catcode Related to `\mathcode` you can find the command `\delcode`. Please add some information about the coherence of these commands.


title: Can I define a macro with same name as an already defined command?

text: Somewhere in my document, I have a               \newcommand{\macomm}{blabla}      Later, I would like to define a TeX macro with the same name:               \def\macomm{blabla}       So my questions:   1. Is it possible?   2. Will this make any problem?   3. Should/can I "kill" the definition of the command, before defining the TeX macro?


title: \newmdtheoremenv-environment unnumbered

text: I would like to have a `\newmdtheoremenv` environment without any number, like I get it from `\newtheorem*`. How can I do this? This is my `\newmdtheoremenv` environment at the moment.               \newmdtheoremenv[outerlinewidth=2,leftmargin=20,%     rightmargin=20,backgroundcolor=blue,%     outerlinecolor=blue,innertopmargin=\topskip,%     splittopskip=\topskip,skipbelow=\baselineskip,%     skipabove=\baselineskip,ntheorem,]{schwartz}%     {The Schwartz-space}


title: pdflatex error: latex.fmt doesn't match pdftex.pool

text: I'm having some problems trying to get a portable TeX Live installation working. It started off great, but I tried to use `tlmgr` to add some packages and now whenever I run `pdflatex` I get a weird error. Google isn't being much help - most of the discussions are about a bug in the system install for some Linux distros (which I'm not using) or they suggest I run `fmtutil --all` which completes without error but doesn't fix the problem. I'm not sure what to try next. This is what happens when I run pdflatex:               $ ./bin/x86_64-linux/pdflatex     This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)      restricted \write18 enabled.     **t     ---! ./texmf-var/web2c/pdftex/pdflatex.fmt doesn't match pdftex.pool     (Fatal format file error; I'm stymied)      There is no `pdftex.pool` file in the portable install or in my system installation (which does work.) Any idea what the problem is or what I can try next?