title: Tikz/Forest: highlighting level background

text: I am using the Forest package and I am trying to paint a gray background for odd and even rows, as well as a label. I already had a version of this diagram that I wrote "manually" with tikz. But it was laid out horizontally (I want it to be vertically laid out, as in the code), and there were also some changes I wanted to make. I was trying to do it from scratch using Forest... ![tree result](http://i.stack.imgur.com/omwBG.png) The code I am stuck trying to draw the background .. (I can seem to be able to paint beneath the tree ..)               \documentclass{standalone}          \usepackage{forest}          \begin{document}          \begin{forest}     for tree={draw, circle, l sep+=0.5em, inner sep=0.05em}     [,fill         [{$-$}, edge label={node[midway,left]{$0.70$}}             [$-$, edge label={node[midway,left]{$0.78$}}                 [$-$, edge label={node[midway,left]{$0.80$}}                     [$-$, edge label={node[midway,left]{$0.82$}}]                     [$+$, edge label={node[midway,right]{$0.18$}}]                 ]                 [$+$, edge label={node[midway,right]{$0.20$}}                     [$-$, edge label={node[midway,left]{$0.49$}}]                     [$+$, edge label={node[midway,right]{$0.51$}}]                 ]             ]             [$+$, edge label={node[midway,right]{$0.22$}}                 [$-$, edge label={node[midway,left]{$0.50$}}                     [$-$, edge label={node[midway,left]{$0.70$}}]                     [$+$, edge label={node[midway,right]{$0.30$}}]                 ]                 [$+$, edge label={node[midway,right]{$0.50$}}                     [$-$, edge label={node[midway,left]{$0.57$}}]                     [$+$, edge label={node[midway,right]{$0.43$}}]                 ]             ]         ]         [{$+$}, edge label={node[midway,right]{$0.30$}}             [$-$, edge label={node[midway,left]{$0.50$}}                 [$-$, edge label={node[midway,left]{$0.71$}}                     [$-$, edge label={node[midway,left]{$0.75$}}]                     [$+$, edge label={node[midway,right]{$0.25$}}]                 ]                 [$+$, edge label={node[midway,right]{$0.29$}}                     [$-$, edge label={node[midway,left]{$0.53$}}]                     [$+$, edge label={node[midway,right]{$0.47$}}]                 ]             ]             [$+$, edge label={node[midway,right]{$0.50$}}                 [$-$, edge label={node[midway,left]{$0.50$}}                     [$-$, edge label={node[midway,left]{$0.72$}}]                     [$+$, edge label={node[midway,right]{$0.28$}}]                 ]                 [$+$, edge label={node[midway,right]{$0.50$}}                     [$-$, edge label={node[midway,left]{$0.44$}}]                     [$+$, edge label={node[midway,right]{$0.56$}}]                 ]             ]         ]     ]     \draw[draw=none,fill=black!2] (-5,-2) rectangle (5,-3);     \end{forest}          \end{document}


title: Change font inside document to specific point size

text: Although this question has a duplicate flavor to it, the question that allegedly provides the solution, LaTeX -- specify font point size?, is hard to use since neither the question nor the answer contains a MWE or any code snippet at all to demonstrate the effect. The answer is also according to comments incomplete with respect to the necessary macros to include. So I'll ask again. I need to set my tables in a 9pt font, whereas the document text should be in a 12pt font, and the document should throughout be double spaced. How?               \documentclass[12pt]{article}     \usepackage{setspace,lipsum}         \doublespacing     \begin{document}     \lipsum[2]          \begin{tabular}{*3{l}} % <- this table should be set in 9pt         Word & Word & Word\\         Word & Word & Word\\         Word & Word & Word\\     \end{tabular}          \lipsum[2]     \end{document}      I would have thought there was a package for something as fundamental as this? * * * **EDIT** The example above was intended to be as minimal as possible (so that it's helpful to other people who find this question - I am always bothered by finding questions that are so unnecessarily specific and complicated that I'm not able to use it for my own document). So what I really need this for is for floating tables (the caption should have 12pt as the document text). Below is such a MWE. The output does not, for some reason, have double spacing in the table.               \documentclass[12pt]{article}     \usepackage{setspace,lipsum}         \doublespacing     \usepackage[justification=centering, font=normalsize, labelfont=bf]{caption}          \begin{document}     \lipsum[2]          \begin{table}     \centering\fontsize{9}{11}\selectfont     \begin{tabular}{*3{l}}         Word & Word & Word\\         Word & Word & Word\\         Word & Word & Word\\     \end{tabular}     \caption{My table}     \end{table}          \lipsum[2]     \end{document}


title: renewing \citeauthor while using natbib to remotely access .bib.file

text: My institute provides its own bibliography style .bst-file. Since the latest bibtex versions don't support \bibliographystyle anymore, I changed to natbib. The provided .bst-file is not a author-year scheme (see natbib documentation) so that `\citeauthor` will always create the error `Package natbib Warning: Author undefined for citation'lit:Fer08' (natbib)` Below, you'll find a MWE.   My **question** is simply: Can I **access data from my .bib-file remotely** and then simply redefine `\citeauthor` (or \citeyear as well)? Heres the LWE                 \documentclass{scrbook}     \usepackage[squared]{natbib}     \setcitestyle{square}          \begin{filecontents*}{lit.bib}     @book{lit:Fer08,      author = {Ferziger, Joel and Peri\'{c}, Milovan},      title = {Numerische Strömungsmechanik},      year = {2008},      isbn = {978-3-540-67586-0},      publisher = {Springer-Verlag},      address = {Berlin},     }     \end{filecontents*}               \begin{document}     \bibliographystyle{plain}          \verb+\cite{lit:Fer08}+ produces \cite{lit:Fer08}, yet \verb+\citeauthor{lit:Fer08}+ produces \citeauthor{lit:Fer08}.          \bibliography{lit}          \end{document}


title: Avoiding math mode inside a lstlisting

text: I'm using `listings` to highlight some PHP code. My problems comes when the code to insert contains the '$' symbol, for example:               \begin{lstlisting}[style=PHP]     Select * FROM users WHERE user_name = $_POST['user'];     \end{lstlisting}      The $ set maths mode and the text after the lstlisting is included until I type another $. I've been looking for solution but unluckily. Using '`\$`' to escape the symbol $ does not work inside the lstlisting (in my pdf it would appear '`\$`' and obviously I don't want that to happen). The PHP lst style is set like follows:               \lstdefinestyle{PHP}{      frame=tb, to wrap the text with black horizontal lines      language=php,      aboveskip=3mm,      belowskip=3mm,      showstringspaces=false,      basicstyle      = \small\ttfamily,      keywordstyle    = \color{cyan},      stringstyle     = \color{gray},      identifierstyle = \color{blue},      commentstyle    = \color{green},      emph            =[1]{php},      emphstyle       =[1]\color{black},      emph            =[2]{if,and,or,else},      breaklines=true,      breakatwhitespace=true,      tabsize=3,      %emphstyle       =[2]\color{dkyellow}     }


title: Including a PDF for dvi output

text: I want to include a multipage-pdf in latex and get `.dvi` output. I know `\include{pdfpages}` only works with pdfLaTeX. I can't convert PDF to `.eps` since it is multi-page. I want to have `.dvi` output with a PDF included. Any way to do that?


title: Apa style bibliography with author year footcite

text: So for a report my teacher gave us exact prerequisite for the layout. He wants in text footnote citations in the author-year style and the bibliography in the APA (5th) style. EDIT: The reference list should be numberd and sorted according to the appearence and I think corresponding to the footnote number. Because I do not want to merge 5 `.doc` (MS Word) files from my group members and format everything in MS Word I need to get this to work in LaTeX. Currently I am trying to get this to work with `biblatex` and Biber, but the combination of the two styles turns out to be very difficult to me. I am not set on `biblatex`. So, if it can be done with BibTeX or whatever, that is fine.


title: How export LaTeX to OpenDocument format with Biblatex references

text: I am trying to export a LaTeX document to OpenDocument (.odt) format. This operation is requested by some publishers which do not know how to handle LaTeX files. I can't find a way of exporting LaTeX documents **with Biblatex references** in a proper way. Here is a example. I use TeX4ht to convert .tex files to .odt               \begin{filecontents}{biblio.bib}     @Book{author00:_title,      author =    {Author},      title =     {Title},      publisher =     {Publisher},      year =      2000}     \end{filecontents}          \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[style=authoryear-comp,hyperref]{biblatex}     \renewcommand*{\newunitpunct}{\addcomma\space}     \bibliography{biblio}     \title{Test}     \author{Title}     \begin{document}          Test\cite{author00:_title}          \printbibliography     \end{document}      TeX4ht command lign to export to .odt is :               mk4ht oolatex test.tex       This command works but create a OpenDocument file without references. References are replaced by their keys (in our example : author00:_title). The output of `mk4ht oolatex` says about biblatex :               No file test.bbl.          LaTeX Warning: Citation 'author00:_title' on page 1 undefined on input line 11.          LaTeX Warning: Empty bibliography on input line 13.          [1] (./test.aux)          LaTeX Warning: There were undefined references.               Package biblatex Warning: Please (re)run Biber on the file:     (biblatex)                test     (biblatex)                and rerun LaTeX afterwards.           )      So I re-run Biber which found the reference :               biber test     defined(@array) is deprecated at /usr/share/perl5/Log/Log4perl/Config.pm line 864.             (Maybe you should just omit the defined()?)     INFO - This is Biber 1.7     INFO - Logfile is 'test.blg'     INFO - Reading 'test.bcf'     INFO - Found 1 citekeys in bib section 0     INFO - Processing section 0     INFO - Looking for bibtex format file 'biblio.bib' for section 0     INFO - Decoding LaTeX character macros into UTF-8     INFO - Found BibTeX data source 'biblio.bib'     INFO - Overriding locale 'fr_FR.UTF-8' default tailoring 'variable = shifted' with 'variable = non-ignorable'     INFO - Sorting 'entry' list 'nyt' keys     INFO - Writing 'test.bbl' with encoding 'UTF-8'     INFO - Output to test.bbl      And I re-run TeX4ht (`mk4ht oolatex test.tex`) which ends unexpectedly :               (/usr/share/texmf/tex/generic/tex4ht/ooffice-mml.4ht)) (./test.aux) (./test.bbl     )     ! Undefined control sequence.     \blx@begunit ...penalty \@M \hskip -\blx@unitmark                                                        \relax \hskip \blx@unitmar...     l.11 Test\cite{author00:_title}          ?       How can I fix this error and export my biblatex references into odt format?


title: Make entire document look heavier using pdfrender package

text: \documentclass[paper=a4]{scrartcl}          \usepackage[utf8]{inputenc}          \usepackage[T1]{fontenc}          \usepackage{pdfrender,xcolor}          \begin{document}          \pdfrender{StrokeColor=black,TextRenderingMode=2,LineWidth=0.2pt}          \end{document}      I am using this code, i want entire document to be same. For example, figure titles are NOT coming darker, the page numbers in table of contents NOT darker, numbering of equation arrays NOT darker, etc. I am using TexStudio for typing my thesis. Thanks for your time!


title: Problem with installing mathtime pro 2 font

text: Okay I know there have been posted very similar questions like these. However their solutions do not seem to work in my case. I tried to install Mathtime Pro 2. I have texlive 2013 and Ubuntu 14.04. I first did found this topic: Help using MathTime Pro 2 fonts in Ubuntu Linux with tex-live after which it refers to Problems installing MathTime Professional 2 font on TexLive. I tried their solutions but I still keep getting the error               kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 4+0/600 --dpi 2400 mt2exf     mktexpk: don't know how to create bitmap font for mt2exf.     kpathsea: Appending font creation commands to missfont.log.      )     !pdfTeX error: pdflatex (file mt2exf): Font mt2exf at 2400 not found      ==> Fatal error occurred, no output PDF file produced!       The log file from the installer provided by Problems installing MathTime Professional 2 font on TexLive can be found here: http://pastebin.com/Gk9AHuFP I also tried with the lite version but that does not seem to work either. I have to note that I recently also installed MinionPro font. During the install of that font I also stumbled onto problems. I hope someone can help me with this problem. --edit-- So I removed all my texlive installations and all files and folders. I downloaded the new texlive version, 2014, and installed it using the installer. I installed it with the following settings: ![enter image description here](http://i.stack.imgur.com/erogl.png) Now where do I need to put (merge) the `texmf` folder of mtpro2? `/usr/local/texlive/texmf-local` or `/usr/local/share/texmf` or `~/.texmf`? Afterwhich I need to run               sudo texhash     sudo updmap-sys --disable mt-belleek.map --nomkmap     sudo updmap-sys --disable belleek.map --nomkmap     sudo updmap-sys --disable mt-yy.map --nomkmap     sudo updmap-sys --disable mt-plus.map --nomkmap     sudo updmap-sys --enable Map mtpro2.map      and maybe `vim $(kpsewhich updmap.cfg)`, add `Map mtpro2.map` and run `sudo updmap-sys`. Correct?


title: How to draw a circular cone

text: I want to draw the circular cone given by the equation z²=x²+y². (I do not mind using any given package.) I tried to use the `pst-solides3d` package with the help of its manual to generate the following code. However, my code produced only the axes. I received the following error messages (I am using TeXShop with XeLaTeX and "TeX and DVI" options selected to typeset):               ** WARNING ** Image format conversion for PSTricks failed.     ** WARNING ** Interpreting special command pst: (ps:) failed.                    \documentclass{article}     \usepackage{pst-solides3d}     \begin{document}          \psset{Decran=20}     \begin{pspicture}(-5,-5)(5,5)     \axesIIID(4,4,4)     \psSurface(0,0)(3,3){sqrt(x^2+y^2)}     \psSurface(-3,-3)(0,0){-sqrt(x^2+y^2)}     \end{pspicture}          \end{document}


title: \newenvironment text exceeds the text width

text: I set up a `\newenvironment`, some texts in this environment exceed the text width, but this doesn't happen always. The following is the `\newenvironment` setup               % is used for parameters within a detailed function description     \newenvironment{DoxyParamCaption}{%        \renewcommand{\item}[2][]{##1 {\em ##2}}%     }{%     }          \subsubsection[{j1939\_\-initialize\_\-stack}]{\setlength{\rightskip}%     {0pt   plus 5cm}void j1939\_\-initialize\_\-stack (     \begin{DoxyParamCaption}     \item[{{\bf j1939\_\-stack\_\-id\_\-t}}]{stack\_\-id, }     \item[{{\bf ProtocolRXTablePtr}}]{rx\_\-table\_\-ptr, }     \item[{{\bf J1939TransmitMessagePtr}}]{tx\_\-table\_\-ptr, }     \item[{{\bf uint16}}]{tx\_\-table\_\-size, }     \item[{{\bf uchar8} $\ast$}]{rx\_\-buff, }     \item[{{\bf uint16}}]{rx\_\-buff\_\-size}     \end{DoxyParamCaption}     )}}      The result will be like as follows ![enter image description here](http://i.stack.imgur.com/JWCGJ.png) As you can see, the function's head goes into the right margin of the paper. But some other examples works fine. See another one in the same environment as follows ![enter image description here](http://i.stack.imgur.com/y9OZs.png) I don't why this happens. Could anyone tell me how to fix this? Thank you very very much.


title: Problem using a .bst file in TeXShop--TeXShop cannot find file

text: I am trying to use `spbasic.bst` to work on a manuscript for a journal. I copied the file into               /usr/local/texlive/2010/texmf/tex/bibtex/bst      and ran texhash. However, TeXShop doesn't find the file. When I run bibtex I get the error:               I couldn't open style file spbasic.bst     ---line 12 of file MyDocument.aux      : \bibstyle{spbasic      :                  }       If the `.bst` file is in the same folder as the .tex document it works fine. I would like to use this `.bst` file for other projects as well and I don't want to have to copy and paste it every time. Have I put the `.bst` file in the wrong location? Or is there something I am missing? I am running TeXShop 2.41 on OSX 10.6.8.


title: thebibliography environment printing cite key

text: Using the basic bibliography environment, when I have               \begin{thebibliography}     \bibitem{key01}     Beeblbrox, Zaphod, Galactic University Press     etc. etc.`     \end{thebibliography}      For some reason it prints the key in the document. So in the final document bibliography I end up with > key01 Galactic University Press etc. etc. How can I prevent that key01 from ending up in the final document? I believe I'm following the instructions for the bibliography and cite usage on the Latex wiki to a t. Also I'm ending up with a "[?]" where the citation is supposed to be. It's not working how it the latex wiki seems to say it should work for some reason.


title: Custom beamer blocks for pros and cons?

text: I want to be able to define custom block environments in Beamer. That is, where for now I use `alertblock` and `exampleblock` I would rather use `problock` and `conblock` for a pro/con discussion. This just seems more appropriate because a con is not an alert and a pro is not an example. The code should then look something like this:               \begin{problock}{Pros}     \begin{itemize}     \item Good reason     \item Better reason     \end{itemize}     \end{problock}          \begin{conblock}{Contra}     \begin{itemize}     \item Small drawback     \item Big drawback     \end{itemize}     \end{conblock}      For each defined block environment I would then provide the proper formatting overrides in the preamble such as `bg`, `fg` and especially the structure color for bullets and such. which would be the most _beamer-like_ way to go?


title: Label and non-plain text arguments

text: I have a custom macro:               \NewDocumentCommand\includefigure{mo}{       ...       \caption{#2}       \label{fig:#2}     }      The optional argument is used for the caption and the label. The problem is that when I have parts of this argument formatted like `\includefigure{pic}[Hi \textit{there}!]` I get errors like "Missing \endcsname inserted." since `\label` does not allow arguments with commands in it. Is there a meta-command like `\plaintext` so I could use `\label{\plaintext{fig:#2}}` in my command and then `\includefigure{pic}[Hi \textit{there}!]` would result in `\label{fig:Hi there!}`? Or maybe there is an alternative for label.


title: Prerendering PostScript commands in EPS with GhostScript makes transparent objects opaque

text: ## Background If the following PSTricks diagram               % Circle.tex     \documentclass{article}     \usepackage{pstricks}     \pagestyle{empty}          \begin{document}     \pspicture(-1,-1)(1,1)     \rput(0,0){$E\not=mc^2$}     \pscircle*[linecolor=yellow,opacity=0.5]{1}     \endpspicture     \end{document}      is compiled with `MethodA.bat` below,               rem MethodA.bat takes an input file name without extension     latex %1     dvips -D10000 %1 -E -o %1-temp.eps     epstool --copy --bbox %1-temp.eps %1.eps      I got a huge EPS output to which the raw PSTricks libraries are attached. In How to remove PSTricks dictionary or library codes in an EPS file produced by dvips?, I asked this issue and Herbert suggested me to reprocess the resulting EPS with GhostScript in advance. I have tried it with `MethodB.bat` instead of `MethodA.bat` as follows.               rem MethodB.bat takes an input file name without extension     latex %1     dvips -D10000 %1 -E -o %1-temp.eps     gswin32c -r10000 -dNOCACHE -dPDFSETTINGS=/prepress -dNOPAUSE -dBATCH -sDEVICE=epswrite -sOutputFile=%1.eps %1-temp.eps      ## Issue & Question I import the resulting EPS image from within the following main input file,               % Main.tex     \documentclass{article}     \usepackage{graphicx}          \begin{document}     \includegraphics{Circle}     \end{document}      which is compiled with `Batch.bat` as follows,               rem Batch.bat takes an input file name without extension.     latex -interaction=nonstopmode %1     latex -interaction=nonstopmode %1     dvips -D10000 -t unknown %1     ps2pdf -r10000 -dCompatibilityLevel#1.5 -dAutoRotatePages#/None -dPDFSETTINGS#/prepress %1.ps      The EPS produced by `MethodA.bat` preserves the transparency but the one produced by `MethodB.bat` does not. Thus invoking GhostScript in `MethodB.bat` is the source of problem, GhostScript seems to be unable to work with transparency. How to fix it?


title: Is it possible to color blocks of source text in TeXmaker?

text: This is a question about the software itself, not how to code something in latex. I am currently in the process of editing, which for me involves copying and pasting large blocks of text around, modifying paragraphs, and creating new ones. I am finding it hard to keep track of what I consider "finished" for now, what I'm in the process of editing, and what I have copy pasted to aid my writing. I'm wondering if a plugin exists for texmaker which allows me to color blocks of source text in different colors, to help me keep track of what is what.


title: How to loop over R objects OUT OF chunks

text: I want to typeset with TeX a report based on data from an R object (dataframe). The idea is to print a nice TeX table from each line of a R dataframe. Something like               \begin{tabular}{ l c r }        A1 & B1 & C1  \\     \end{tabular}          \begin{tabular}{ l c r }        A2 & B2 & C2  \\     \end{tabular}          \begin{tabular}{ l c r }        A3 & B3 & C3  \\     \end{tabular}      Please consider the following MWE               \documentclass{article}          \begin{document}          <<prepare data>>=     one   <- c("A1","B1","C1")     two   <- c("A2","B2","C2")     three <- c("A3","B3","C3")     df <- data.frame(one,two,three)     @          <<loop data>>=     for (i in 1:nrow(df)) {       print(df[i])     }     @          \end{document}      which produces ![enter image description here](http://i.stack.imgur.com/kMa4S.png) How could I typeset the values outputted by the R loop with TeX? In other words, how to `\loop...\repeat` with TeX over R loop variables.


title: Insert Sweave into LaTeX

text: I have already done most of my final paper using normal LaTeX and inserted a table using pgfsplotstable. However, I find it particularly difficult to edit/ style the table using this packages syntax. So question is, can I genereate the table from Sweave and insert into my Tex file somehow, not as an image either.


title: Right align \komavar entries inside a column defined by \setplength

text: I am scratching a custom invoice template based on `scrlttr2` from the KOMA- Script and example code provided by Markus Kohm (specifically, the files `asymTypB.lco` and `briefwbk.tex` to be found under `KOMA- Script-3/Anhang-E/source`). In the quest to retouch the design and fit, as well, various information inside the right positioned _Info-Block_ , I would like to right-align ( **`flushright` or `\raggedleft`? Are they identical?**) the entries `\usekomavar{date}`, `\usekomavar{place}` and `\usekomavar{frombank}`. As almost everything seems to work-out quite nice, instructing `\raggedleft` for the variables in question, they are hooked to the edge of the A4-sized paper. ![Partial screenshot picturing the current *Info- Block*](http://i.stack.imgur.com/p8wNs.jpg). The code in question that derives this result is sourced from a custom version of the `asymTypB.lco` file:               % Main block of Info-Column     \put(0,0){\parbox[t]{\useplength{infocolwidth}}{%     \raggedleft%         \vspace{\useplength{refvpos}}%         \vspace{\useplength{refaftervskip}}%         \usekomavar{date}\\%         \usekomavar{place}\\[9\baselineskip]%         %         \raggedright%         \usekomavar{fromname}\\[\baselineskip]%         \ifkomavarempty{company}{}{%           \\           \usekomavar{company}%         }~\\%         \usekomavar{professiona}\\[\baselineskip]%         \usekomavar{professionb}\\[2\baselineskip]%         \usekomavar{fromaddress}\\[\baselineskip]%         \usekomavar*{fromphone}\usekomavar{fromphone}\\[\baselineskip]%         \ifkomavarempty{fromfax}{}{%       \\       \usekomavar*{fromfax}\usekomavar{fromfax}%         }%         \usekomavar{fromemail}\\[\baselineskip]%         %\usekomavar{fromurl}\\%         \usekomavar{fromlinkedin}\\[2\baselineskip]%         \usekomavar{fromvatin}\\%       }%     }%     % Banking information     \put(0,0){\parbox[t]{\useplength{infocolwidth}}{%         \raggedleft         \vspace{\useplength{firstfootvpos}}%         \vspace{-\footskip}%         \usekomavar{frombank}%       }%     }%     \end{picture}%     \hspace*{\useplength{infocolwidth}}%      What I am after is to get the lengthiest entry in the info-block (i.e. the _LinkedIn_ entry currently) and use its distance to the edge of the paper as a margin for _date_ , _place_ and _frombank_ so as to align them in the virtual right border of the info-block. The `infocolwidth` is defined in the same `.lco` file by `\@setplength{infocolwidth}{.2.5\paperwidth}`. How can I make this look nice? Besides, although I've read http://tex.stackexchange.com/a/4692/8272 and http://tex.stackexchange.com/a/7459/8272, I still can't fix all of the `"There's no line here to end" \opening{text}` errors. **Update** Files for a (not exactly) Minimal Working Example attached. custom_AsymTypB.lco               % Custom Template for an Inoice (Letter)     % Based on:          % asymTypB.lco     % Copyright 2008 Markus Kohm          % Metadata about this file     \ProvidesFile{asymTypB.lco}%                  [2011/09/20 v0.2 unsupported LCO-file]%          % DIN 676 B     \LoadLetterOption{DINmtext}%          % Place letter body to the left     \setlength{\oddsidemargin}{\useplength{toaddrhpos}}%     \addtolength{\oddsidemargin}{-1in}%          % Again... ?     \AfterCalculatingTypearea{%       \setlength{\oddsidemargin}{\useplength{toaddrhpos}}%       \addtolength{\oddsidemargin}{-1in}%     }%     \activateareas          % Head     \@setplength{firstheadvpos}{0pt}%     \@setplength{firstheadwidth}{\paperwidth}%          % Foot     \@setplength{firstfootvpos}{\paperheight}%     \@addtoplength[-]{firstfootvpos}{\useplength{toaddrvpos}}%          % Reference     \@addtoplength{refvpos}{-1.5\baselineskip}%          % New variable(s) here!     \newkomavar{company}%     \newkomavar{professiona}%     \newkomavar{professionb}%     \newkomavar[VATin]{fromvatin}%     \newkomavar{fromlinkedin}%          % New variables that concern the client here!     % \newkomavar*[Your VATin]{yourvatin}%          % Set pseudo-length for infocol     \@newplength{infocolwidth}%     \ifdim \textwidth<0.666\paperwidth% How is this supposed to work?       \@setplength{infocolwidth}{.22222\paperwidth}%     \else       \@setplength{infocolwidth}{.2.5\paperwidth}%{0.1667\paperwidth}%     \fi               % Set Head first... ?     \setkomavar{firsthead}{%       \fontsize{8}{9}\sffamily% Font size(s)       \hspace*{\fill}%       \begin{picture}(0,0)%         % Logo?         \put(0,0){\parbox[t]{\useplength{infocolwidth}}{%             \vspace{\useplength{toaddrvpos}}%             \usekomavar{fromlogo}%           }%         }%         % Main block of Info-Column         \put(0,0){\parbox[t]{\useplength{infocolwidth}}{%         \flushright%             \vspace{\useplength{refvpos}}%             \vspace{\useplength{refaftervskip}}%             \usekomavar{date}\\%             \usekomavar{place}\\[9\baselineskip]%             %             \raggedright%             \usekomavar{fromname}\\[\baselineskip]%             \ifkomavarempty{company}{}{%               \\               \usekomavar{company}%             }\\[\baselineskip]%             \usekomavar{professiona}\\[\baselineskip]%             \usekomavar{professionb}\\[2\baselineskip]%             \usekomavar{fromaddress}\\[\baselineskip]%             \usekomavar*{fromphone}\usekomavar{fromphone}\\[\baselineskip]%             \ifkomavarempty{fromfax}{}{%           \\           \usekomavar*{fromfax}\usekomavar{fromfax}%             }%             \usekomavar{fromemail}\\[\baselineskip]%     %         \usekomavar{fromurl}\\%             \usekomavar{fromlinkedin}\\[2\baselineskip]%             \usekomavar{fromvatin}\\%           }%         }%         % Banking information         \put(0,0){\parbox[t]{\useplength{infocolwidth}}{%             \raggedleft             \vspace{\useplength{firstfootvpos}}%             \vspace{-\footskip}%             \usekomavar{frombank}%           }%         }%       \end{picture}%       \hspace*{\useplength{infocolwidth}}%     }%     \KOMAoption{refline}{nodate}     \setkomavar{nexthead}{%       \@tempswatrue       \if@twoside\ifodd\number\value{page}\else           \@tempswafalse       \fi\fi       \if@tempswa         \makebox[0pt][l]{%           \hspace*{-\oddsidemargin}\hspace{-1in}%           \hspace{\paperwidth}%           \hspace{-\useplength{infocolwidth}}%           \normalfont\fontsize{7}{8}\sffamily           \begin{picture}(0,0)             \put(0,0){\parbox[t]{\useplength{infocolwidth}}{%                 \vspace*{-\topmargin}\vspace{-1in}%                 \vspace{-\headheight}%                 \vspace{\useplength{toaddrvpos}}%                 \begin{tabular}{@{}c@{}}                   \usekomavar{fromlogo}\\                   \usekomavar{company}\\                 \end{tabular}%               }%             }%           \end{picture}%         }%       \fi     }%     \pagestyle{headings}%     \endinput      custom_invoice_template.tex               % custom invoice template -- Minimal Working Example     % Based on:          % brieftemplate.tex     % Copyright 2008 Markus Kohm               \RequirePackage{fix-cm}          % \usepackage{mathpazo}     \usepackage[LGR,T1]{fontenc} % Also for ``Greek'' Content     \usepackage[latin9]{inputenc}     \usepackage{babel}          \usepackage{geometry}     \geometry{verbose,tmargin=0cm,bmargin=0cm}          \setlength{\parskip}{\smallskipamount}          % No indentation at all!     \setlength{\parindent}{0pt}          \usepackage{color}          \usepackage{array}     \usepackage{textcomp}          \usepackage{fixltx2e}     \usepackage{graphicx}               \usepackage{charter}     \usepackage[scaled]{helvet}     \usepackage[scaled=0.87]{luximono}     % \usepackage[scaled=0.92]{frutigernext}% Does not play nice!          %     \usepackage{setspace}     \setstretch{1.1000000000000001}          % hyperref     \usepackage[%       pdftitle={PDF-Title},       pdfauthor={Author},       pdfsubject={PDF-Subject},       pdfkeywords={keyword1, keyword2, keyword3},       linkcolor=magenta,       urlcolor=marineblue2,       citecolor=blue,       pdfstartview={FitH},       hyperfootnotes=false,       unicode=true,       bookmarks=false,       breaklinks=false,       pdfborder={0 0 0},       backref=false,       colorlinks=true]{hyperref}          % \providecommand{\SetSize}{%     %   \AtBeginDvi{\special{papersize=210mm,210mm}}%     %   \AtBeginDocument{%     %     \ifpdfoutput{%     %       \pdfpagewidth=210mm     %       \pdfpageheight=210mm     %     }{}%     %   }%     % }     % \SetSize               %     \makeatletter          % Martin Vogels Symbols     \usepackage{marvosym}     \usepackage{ocr}          % Colors     \usepackage{xcolor}          % define marine blue     \definecolor{marineblue}{rgb}{0.05,0.1,0.4}     \definecolor{marineblue2}{rgb}{0.05,0.1,0.5}          % define lightgray     \definecolor{lightgray}{gray}{0.6}     \definecolor{lightgray2}{gray}{0.8}     \definecolor{lightgray-coursework}{gray}{0.3}          %% Remove preceeding '%' to uncomment an item     \KOMAoptions{%     DIV=last%     ,headsepline=true%            separate the header with a line on page >1     %,footsepline=true%             separate the footer with a line on page >1     %pagenumber=botcenter%   position of the page number (see docu)     %,parskip=false%          Use indent instead of skip (more options cf. docu)     % ,fromalign=center%        alignment of the address     ,fromrule=aftername%    separate the address with a line?     ,fromphone=true%         print sender phone number     ,fromfax=false%          print sender fax number     ,fromemail=true%           print sender e-mail address     ,fromurl=true%               print sender URL     ,fromlogo=true%         print a logo (position depends on fromalign)     %,addrfield=false%        print an address field?     ,backaddress=false%  print the back address?     ,subject=left%,titled% alternative subject layout and position     %,locfield=narrow%      width of the (extra) location field     ,foldmarks=false%      print foldmarks?     %,numericaldate=true%  date layout     ,refline=wide%             layout of the refline     }          %% Customize Separators     %\setkomavar{placeseparator}{ -- }     \setkomavar{backaddressseparator}{ $\cdot$ }     %\setkomavar{emailseparator}{ --> }     %\setkomavar{enclseparator}{ > }     %\setkomavar{faxseparator}{ --> }     %\setkomavar{phoneseparator}{ --> }     %\setkomavar{subjectseparator}{ >>> }          %% Customize fonts     %% Use LaTeX's standard font commands     %% Modify with \setkomafont or \addtokomafont     %% (see KOMA documentation)     % \setkomafont{backaddress}{\rmfamily}     %\setkomafont{descriptionlabel}{}     % \setkomafont{fromaddress}{\small}     \setkomafont{fromname}{\scshape}     %\setkomafont{pagefoot}{}     %\setkomafont{pagehead}{}     %\setkomafont{pagenumber}{}     %\setkomafont{subject}{}     %\setkomafont{title}{}          % Logo     \setkomavar{fromlogo}{\includegraphics[clip,width=3cm,height=3cm,bb = 0 0 200 100, draft, type=eps]{qr_coded_mecard}\\     {\scriptsize{\textcolor{lightgray}{MECARD}\hfill{}}}}          % Name     \setkomavar{fromname}{\noun{First & Last Name}}          % Signature     \setkomavar{signature}{\includegraphics[width=84mm,height=24mm,keepaspectratio,bb = 0 0 200 100, draft, type=eps]{signature}\\     {\small{First Last Name}}}          % Professional Identity     \setkomavar{company}{Company}     \setkomavar{professiona}{Professional Activities A}     \setkomavar{professionb}{Professional Activities B}          % VATin     \setkomavar{fromvatin}{VAT\,in \ocr{ZZ\,000\,000\,000}\\Public Financial Service}     % \setkomavar{yourvatin}{Your \ocr{VAT}}          % Address(es)     \setkomavar{fromaddress}{{\small\Letter~}\\Address Line 1\\Postal Code, City\\Country}     % \setkomavar{fromzipcode}          % Phone     \setkomavar{fromphone}[]{{\large\Mobilefone}\\{\ocr{+00\,9999\,666\,333}}}          % FAX     % \setkomavar{fromfax}[]          % e-Mail     \setkomavar{fromemail}{{\large\Email}\\{\href{mailto:userd-id@domain.name}{user-id\,@\,domain.name}}}          % Web     \setkomavar{fromurl}{{\Info}~\href{web:website.ext}{website.ext}}     \setkomavar{fromlinkedin}{\includegraphics[width=0.25cm,height=0.25cm]{linkedin.png}\\{\href{http://gr.linkedin.com/pub/AccountName}{linkedin.com/pub/AccountName}}}          % Banking     \setkomavar{frombank}{Account holder\\%     \textcolor{blue}{\ocr{First Name, Last Name}}\\%     IBAN\\%     \textcolor{blue}{\ocr{zz0000011111222223333344444}}\\%     SWIFT\,-\,BIC\\%     \textcolor{blue}{\ocr{QWERTYUI}}}%      custom_invoice_mwe.tex               %% custom invoice template -- Minimal Working Example     %% Based on:          % briefwbk.tex     % Copyright 2008 Markus Kohm          \documentclass[%       english,       custom_asymTypB,       DIV=8,       fontsize=11pt]{scrlttr2}          % What, Where, When?     \setkomavar{subject}{Quotation for... \textbf{yyy}}          % \setkomavar{toname}     % \setkomavar{toaddress}          % \setkomavar{customer}     % \setkomavar{refname}     % \setkomavar{refvalue}          % \setkomavar{invoice}               \setkomavar{myref}{Project: yyy}          % Place, Location     % \setkomavar{placeseparator}     \setkomavar{place}{Place}     % \setkomavar{location}{Location}          % Date     \setkomavar{date}{\today}          % Structure and Basic Information     \input{custom_invoice_template.tex}          \begin{document}            \begin{letter}{Mr. xxx xxx\\       Institution\\       Description\\       Address Line 1\\       Address Line 2\\       Country}            \opening{Dear xxx,}            \begin{flushleft}       herewith I am sending you a quotation...       \end{flushleft}            \closing{Sincerely yours,}            \encl{Enclosures}       \cc{}            \end{letter}          \end{document}


title: Spaces between Hebrew letters

text: I am writing in Hebrew, but my output doesn't look so good because the spaces between thew Hebrew words are too big. They are somehow bigger than usual, and also the font itself, just doesn't look good! ![enter image description here](http://i.stack.imgur.com/ev7f8.png) I am using MiKTeX distribution, and installed Culmus fonts. I may have also installed "ivritex" once, before. Could "ivritex" interfere with "Culmus" and cause the problem? Has anyone encountered this problem or know how to solve it? I have tested the hebrew on LyX too, and it also produces this problem. I wanted to attach a picture to show the problem, but as I am a new user, I can't do it :-(


title: The \bar and \overline commands

text: I want to represent, say, the closure of a set or the extended reals, e.g., `$\bar{\mathbb{R}}$` but unfortunately this creates a bar that is much too small (horizontally) and can barely be seen. On the other hand, `$\overline{\mathbb{R}}$` creates a line that is too long. I need something that's just right, in between the bar and the overline. What would be my best choice?


title: nccmath affecting minipage widths

text: It seems that `nccmath` is affecting the layout of minipages. In the MWE, you can see the left `minipage` is clearly not taking up 70% of the page as I wanted. I'm hoping that there is an easy fix for this, otherwise I need to get rid of `nccmath`. I have had problems with `nccmath` previously as discussed in Alignment of item number in list containing a minipage so I'm wondering if I should try to work without that package.               \documentclass[fleqn,preview=false]{standalone}          \usepackage{amsmath}     \usepackage{nccmath}% Needed for fleqn environment          \begin{document}     \begin{minipage}{0.70\linewidth}     \begin{align*}         y &= x      \end{align*}     \end{minipage}     \begin{minipage}{0.30\linewidth}         Note: abcd     \end{minipage}     \end{document}


title: How to add a two column header before the title on the first page?

text: I'd like to add two columns at the top of my first page, before the title of my article. It should look like this (I only highlighted the top with a red rectangle to show what I want to achieve): ![Two columns before the title](http://i.stack.imgur.com/X62LA.png) My current code looks like this:               \documentclass[a4paper, 12pt]{article}          \title{SPSS opdracht Kansrekening en Statistiek}     \author{Eerste zittijd}          \begin{document}     \maketitle          Here is some text...          \tableofcontents     \newpage          \end{document}      How can I work further with this? _(For those who understand Dutch: don't mind the meaning of the text. Of course "Eerste Zittijd" is not the author. I'm just adapting it to the screenshot.)_


title: Manually set figure and table labels while compiling

text: I would like to manually set certain figure and table labels in LaTeX2e. I imagine the process to go something like: latex -> edit .aux file (?) to revise some labels -> pdf The problem: the apa6e package mislabels figures in certain cases when using an appendix (see example below). I would like to change Figure A1, etc., throughout the body to Figure 1, preferably as a batch search-and-replace, while still retaining the automatic labelling for the rest of the document. Example: The following code --               \documentclass{apa6e}     \title{}     \author{}     \shorttitle{}     \authornote{}     \begin{document}          This figure, in the body, should reference as Figure~1, not     Figure~\ref{bodyfigure}.          \begin{table*}     \caption{Body table.}     \end{table*}          \begin{figure}     \caption{Body figure.}     \label{bodyfigure}     \end{figure}          \appendix     \section{}          \begin{table*}     \caption{Appendix Table.}     \end{table*}          \end{document}      -- produces `Figure A1` rather than `Figure 1`. I would like to either (1) find a way to manually set labels before compiling the PDF, or (2) find a work-around for apa6e.


title: How to prevent my PSTricks codes from interfering the imported EPS files?

text: My main input file not only contains PSTricks codes but also imports EPS images produced by `epstool` from standalone PSTricks input files compiled with `dvips input.dvi -E -o output.eps`. I am worried whether the following warning that I got from epstool will endanger me. > The PostScript code must avoid using PostScript operators that would > interfere with the embedding. These include operators with global effects > such as changing the page size and changing the half tone screen. How to make sure I am safe?


title: Hanging Indents in Tables for Equations

text: I currently have the following code               \begin{center}     \begin{tabular}{l|p{5in}}     Differential Equation & $(1273628x^{4} + 1237129387x^{3} + 12831729x^{2})f'''(x)        + (9x^{3} + 12392183012938120x^{2} + x)f'(x) + 120938120xf(x) = 0$\\\hline     Notes & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam imperdiet,      nunc ac euismod adipiscing, arcu erat pellentesque turpis, a tincidunt velit      est sed sem. Proin dolor purus, eleifend vel pellentesque sit amet, lobortis      non nibh. Duis in lacus eget odio varius interdum. Fusce pretium lectus sit      amet metus molestie sit amet mollis ante viverra. Fusce eget augue vitae elit      blandit facilisis. Nullam ultrices felis quis magna dignissim auctor. Cras      dignissim porttitor nisl, id viverra sapien ornare ac. Proin adipiscing, dui      at tempor faucibus, purus lacus aliquet nulla, ac dictum arcu erat nec felis.      Aliquam rutrum nunc nec ligula euismod scelerisque. Nam interdum tincidunt      tellus id malesuada. Pellentesque id elit nibh, vel scelerisque turpis. Proin      \end{tabular}     \end{center}      How do I get Notes centered with respect to the height of the Lorem ipsum paragraph and how does one do a hanging indent on the equation in the differential equation row?


title: How does each of ps2pdf, pdfcrop, pdftops, epstool and epstopdf invoke GhostScript behind the scene?

text: I want to know the syntax to invoke GhostScript directly to get the same effect as each of the following command does.   1. `ps2pdf input.ps`   2. `pdfcrop --hires input`   3. `pdftops -eps input.pdf`   4. `epstool --copy --bbox input.eps output.eps`   5. `epstopdf --hires input.eps`


title: \newcommand vs \DeclareRobustCommand

text: I sort of understand the difference between the two. But that's not what I'm interested in—I just want to know, **which one should I use**? In general, when I'm creating commands in a package or class, which one should I use all the time?


title: Is it possible to have \listoffigures and \begin{bibliography} on the same page?

text: I'm trying to have the \listoffigures and the bibliography on the same page. I'm using the following commands:               \documentclass [a4paper,11pt,oneside]{scrbook}      \usepackage[left=2.5cm,right=2.5cm,top=3.5cm,bottom=3.5cm]{geometry}     \usepackage[ngerman]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{float}     \restylefloat{figure}      \usepackage{graphicx}           \usepackage{hyperref}      \usepackage{scrpage2}      \usepackage{nameref}      \usepackage{gensymb}      \usepackage{amsmath}           \clearscrheadings     \clearscrplain     \clearscrheadfoot          \renewcommand{\chapterpagestyle}{scrheadings}          \ihead{\headmark}            \setheadsepline{0,4pt}      \setfootsepline{0,4pt}       \rofoot{Seite \thepage\ von 11}     \lofoot{Protokoll: ...,...}          \setheadwidth{text}     \setfootwidth{text}     \pagestyle{scrheadings}          \parindent 0pt      \parskip 0pt          \title{\textbf{Protokoll: Versuch 10/1 - Dünne Linsen}\vspace*{20mm}}     %     \author{\rmfamily von \textbf{...} und \textbf{...}\\     \\\textbf{\rmfamily Assistent:}\rmfamily\ ...}      %     %     \date{\textbf{\rmfamily Datum:}\rmfamily\ 26. Mai 2014 - 02. Juni 2014}                    \begin{document}      ...               \listoffigures     % % %     \begin{bibliography}{9}          %          \bibitem{name}             Prof. ...        Filename...        Date...          %          \bibitem{name2}             Prof. ...        Filename2        Date2      ... and so on... Now, the command above gives me both. The listoffigures und the bibliography but each on a different page. I'd like them to be both on the same page. Is this possible? Thanks EDIT: for documentclass


title: TikZ "scale" key not behaving at all in the expected way when scaling tikzpicture

text: I am having difficulty with TikZ remembering node positions, or just reconciling things between different coordinate systems (such as nodes named within a given coordinate system and then refered from outside of the coordinate system), when scaling the `tikzpicture`. Here's a simple `standalone` document that I want including in my document.               \documentclass[border=6pt]{standalone}     \usepackage{pgfplots}     \usetikzlibrary{calc}          \pgfplotsset{every axis/.append style={         font=\scriptsize,         x=.75cm,         y=.75cm,             axis x line=center,         axis y line=center,         x axis line style={<->},         y axis line style={<->},         xtick={-5,-4,...,5},         ytick={-5,-4,...,5},         xlabel={$x$},         ylabel={$y$},         xlabel style={below},         ylabel style={left},         xmin=-5.5, xmax=5.5,         ymin=-5.5, ymax=5.5,         }     }          \pgfmathdeclarefunction{myfncG}{1}{\pgfmathparse{ #1 + sqrt(#1^2+1)}}     \pgfmathdeclarefunction{fncLN}{1}{\pgfmathparse{ln(#1)}}          \begin{document}          \begin{tikzpicture}[>=latex]%,scale=0.75]     \begin{axis}       \addplot[domain=-5.5:2.5, blue, samples=200,line cap=round,arrows=<->]  {myfncG(x)} node [pos=0.25,above] (g) {};       \addplot[domain=0.025:5.5, blue, samples=200,line cap=round,arrows=<->] {fncLN(x)} node [pos=0.95,above] (ln) {};     \end{axis}       \node at ($(g)+(0,2ex)$) {$y=x + \sqrt{x^{2}+1\,}$};       \node[anchor=east] at ($(ln)+(0,0.5ex)$) {$y=\ln(x)$};     \end{tikzpicture}          \end{document}      which generates: ![enter image description here](http://i.stack.imgur.com/Bj1A7.png) But in the master document, I want to rescale the image. Here's an example of how I could approach this in the master document:               \documentclass{article}     \usepackage{graphicx}          \begin{document}          This time I'm using \verb=\includegraphics=          \includegraphics[width=2in]{combined}          \end{document}      which produces: > ![enter image description here](http://i.stack.imgur.com/duOsn.png) But I'm not happy with the font size. So, I thought I could just _rescale_ the `standalone`.   That requires just one change in the first MWE. Change               \begin{tikzpicture}[>=latex]%,scale=0.75]      to               \begin{tikzpicture}[>=latex,scale=0.75]      Then things go all wonky on me: ![enter image description here](http://i.stack.imgur.com/rGU7o.png) And notice that it's not just that the nodes for my annotations that get placed improperly, but also the labels for the axes' names. I do have a work around. I could use the following for my `standalone` document:               \documentclass[border=6pt]{standalone}     \usepackage{pgfplots}     \usetikzlibrary{calc}          \pgfplotsset{every axis/.append style={         font=\scriptsize,         x=.75cm*0.75,%% <---- scaling HERE!         y=.75cm*0.75,%% <---- scaling HERE!         axis x line=center,         axis y line=center,         x axis line style={<->},         y axis line style={<->},         xtick={-5,-4,...,5},         ytick={-5,-4,...,5},         xlabel={$x$},         ylabel={$y$},         xlabel style={below},         ylabel style={left},         xmin=-5.5, xmax=5.5,         ymin=-5.5, ymax=5.5,         }     }          \pgfmathdeclarefunction{myfncG}{1}{\pgfmathparse{ #1 + sqrt(#1^2+1)}}     \pgfmathdeclarefunction{fncLN}{1}{\pgfmathparse{ln(#1)}}          \begin{document}          \begin{tikzpicture}[>=latex]%%,scale=0.75]     \begin{axis}       \addplot[domain=-5.5:2.5, blue, samples=200,line cap=round,arrows=<->]  {myfncG(x)} node [pos=0.25,above] (g)  {};       \addplot[domain=0.025:5.5, blue, samples=200,line cap=round,arrows=<->] {fncLN(x)}  node [pos=0.95,above] (ln) {};     \end{axis}       \node at ($(g)+(0,2ex)$) {$y=x + \sqrt{x^{2}+1\,}$};       \node[anchor=east] at ($(ln)+(0,0.5ex)$) {$y=\ln(x)$};     \end{tikzpicture}          \end{document}      Resulting in: ![enter image description here](http://i.stack.imgur.com/EpOh5.png) But it seems that this is more of a hack than a general principal I should follow. In fact, it can be a rather annoying work around when every time I want to generate coordinates and nodes with given coordinates, I've got to remember to include my scale factor:               \def\aesf{0.75}     \coordinate (A) at (3*\aesf,4*\aesf);      Additionally, I thought `scale` does not effect the font size. According to the TikZ manual, `scale` should be multiplying the coordinate by the named `factor`. But in this final MWE by changing the scale, you get different scaled labels too! (I've chosen a ridiculously small scale to emphasize the effect.)               \documentclass[border=6pt]{standalone}     \usepackage{pgfplots}     \usetikzlibrary{calc}          \pgfplotsset{every axis/.append style={         font=\scriptsize,         x=.75cm,         y=.75cm,         axis x line=center,         axis y line=center,         x axis line style={<->},         y axis line style={<->},         xtick={-5,-4,...,5},         ytick={-5,-4,...,5},         xlabel={$x$},         ylabel={$y$},         xlabel style={below},         ylabel style={left},         xmin=-5.5, xmax=5.5,         ymin=-5.5, ymax=5.5,         }     }          \pgfmathdeclarefunction{myfncG}{1}{\pgfmathparse{ #1 + sqrt(#1^2+1)}}     \pgfmathdeclarefunction{fncLN}{1}{\pgfmathparse{ln(#1)}}          \begin{document}          \begin{tikzpicture}[>=latex,scale=0.5]     \begin{axis}       \addplot[domain=-5.5:2.5, blue, samples=200,line cap=round,arrows=<->]  {myfncG(x)} node [pos=0.25,above] (g) {\normalsize$y=x + \sqrt{x^{2}+1\,}$};       \addplot[domain=0.025:5.5, blue, samples=200,line cap=round,arrows=<->] {fncLN(x)} node [pos=0.95,above left] (ln) {\normalsize$y=\ln(x)$};     \end{axis}     %  \node at ($(g)+(0,2ex)$) {$y=x + \sqrt{x^{2}+1\,}$};     %  \node[anchor=east] at ($(ln)+(0,0.5ex)$) {$y=\ln(x)$};     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/UHtvu.png) Is there a better approach to this? What am I not understanding about how `scale` works?


title: Drawing arrows in beamer

text: I want to add the arrows as shown in the picture. I an new to latex. Can someone tell the code? i am using beamer class ![This was made using powerpoint](http://i.stack.imgur.com/MAFIy.jpg) It was made in powerpoint.


title: Is it possible to use the `verbatim` environment in a dot2tex node?

text: Is it possible to use the verbatim environment (i.e. `\begin{verbatim}...\end{verbatim}`) in a dot2tex node? If so, please could you provide a MWE? * * * Update: this is the closest I've got so far:               digraph g {     d2tdocpreamble = "\usepackage{varwidth} \usepackage{verbatim} \renewcommand{\familydefault}{\sfdefault}";     graph [ rankdir = "TB" ];     node  [ style="rounded,bold,filled" fillcolor="azure" shape = "box" ];          assume_git         [ texlbl="\begin{varwidth}{30em}We'll assume that Git is to be used for source control; so as a precaution against accidentally checking in temporary files used by Vim or OS X, enter the following at the command prompt:\\\verb|echo '*.swp'      >> .gitignore|\\\verb|echo '.DS\_Store'  >> .gitignore|\end{varwidth}" ];          START              -> assume_git;     }      And this is the output from turning it into a PDF via the command `dot2tex --crop --margin 1em --autosize dot2tex_test_006_mwe.dot > dot2tex_test_006_mwe.tex; pdflatex dot2tex_test_006_mwe.tex`: ![enter image description here](http://i.stack.imgur.com/k1zPY.png) This is unsatisfactory in at least two ways:   1. instead of              \\\verb|echo '*.swp'      >> .gitignore|\\\verb|echo '.DS\_Store'  >> .gitignore|      I would much prefer to have been able to use              \begin{verbatim}     echo '*.swp'      >> .gitignore     echo '.DS_Store'  >> .gitignore     \end{verbatim}      to avoid the need for unnecessary markup for every newline in the code block, but the latter generated the following errors:              ERROR    Failed to process input     Traceback (most recent call last):       File "build/bdist.macosx-10.6-universal/egg/dot2tex/dot2tex.py", line 2928, in main         s =  conv.convert(dotdata)       File "build/bdist.macosx-10.6-universal/egg/dot2tex/dot2tex.py", line 794, in convert         return self.do_preview_preproc()       File "build/bdist.macosx-10.6-universal/egg/dot2tex/dot2tex.py", line 1105, in do_preview_preproc         hp,dp,wt = pp.texdims[name]     KeyError: 'assume_git'     This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts 2011_5) restricted \write18 enabled.     entering extended mode     (./dot2tex_test_006_mwe.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, czech, slovak, dutch, ukenglish, usenglishmax, basque, french, german-x-2009-06-19, ngerman-x-2009-06-19, german, ngerman, swissgerman, italian, polish, portuguese, spanish, catalan, galician, loaded.     )     *        2. The `\\\\\verb|...|` approach in the MWE does not render the code verbatim. Even my short example has the following problems:     * in order to avoid error messages, I had to add a backslash in front of the underscore, but now the backslash is rendered. So I need a way to render _just_ an underscore;     * the straight single quote marks around `*.swp` and `.DS\\_Store` have been replaced by right single quote marks;     * one member of each pair of greater-than signs has disappeared.


title: Shortened bibliography style based on abbrv.bst; shortened author list, title omitted

text: I'm using beamer, beamerposter and natbib and hope to include very short bib entries in a bibliography, bottom right, on a poster. In the file abbrv.bst found here the function for formatting author names is:               FUNCTION {format.names}     { 's :=       #1 'nameptr :=       s num.names$ 'numnames :=       numnames 'namesleft :=         { namesleft #0 > }         { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=           nameptr #1 >             { namesleft #1 >                 { ", " * t * }             { numnames #2 >                 { "," * }                 'skip$               if$               t "others" =                 { " et~al." * }                 { " and " * t * }               if$             }           if$         }         't       if$       nameptr #1 + 'nameptr :=       namesleft #1 - 'namesleft :=     }       while$     }      I would like _et al._ to be used to replace all but the first author in the case that there are 3 or more authors. Might someone suggest changes to this particular code above in order to achieve conditional shortening of the list? I also modified the title formatting like so:               FUNCTION {format.title}     { title empty$         { "" }         { "" }       if$     }      I suspect that there is redundancy here, however, this does result in an omitted title. Any suggestions are greatly appreciated.


title: Problem with smoothbars in beamer package

text: > **Possible Duplicate:**   >  How can I get multiple lines of frame dots in beamer navigation? I'm using `beamer` package for a presentation using `smoothbars` to display an index in the top. The problem is that the presentation is rather big and one section has a lot of frames. So there is not enough space to put all dots and it's not displaying right for the last sections. I've attached an image and a MWE showing the problem. Does anyone know a workaround for this? ![enter image description here](http://i.stack.imgur.com/hmysn.jpg) MWE:               \documentclass{beamer}     \usepackage{pgffor}  %< - For lots of frames     \usepackage{lmodern} %<- For suppresion some of the warnings     \mode<presentation>     {      \usetheme{Warsaw}             \useoutertheme{shadow}             \useoutertheme[subsection=false]{smoothbars}     }     \begin{document}                           \section{section 1}                     \subsection{sub1}     \foreach \x in {1,...,30}{\begin{frame}\end{frame}}                  \section{section 2}                     \subsection{sub2}     \foreach \x in {1,...,45}{\begin{frame}\end{frame}}                  \section{section 3}                     \subsection{sub3}                             \begin{frame}\end{frame}                  \section{section 4}                     \subsection{sub4}                             \begin{frame}\end{frame}                  \section{section 5}                     \subsection{sub5}                             \begin{frame}\end{frame}                             \begin{frame}\end{frame}                             \begin{frame}\end{frame}          \end{document}


title: checking for whitespace inside verbatim environment

text: I would like to determine whether a line inside a `verbatim` environment starts with 3 spaces. I'm using `pdflatex` and the `\pdfmatch` primitive. I see that the `verbatim` environment sets the category code of space to `\active`, so I do not know how to represent a space character in the test at the time it is reached (from within the verbatim environment). If I perform the test below using a 'normal' character instead of a space, it works as expected.               \documentclass{article}     \usepackage{verbatim}     \begin{document}       \makeatletter       \def\verbatim@addtoline#1{         \ifnum\pdfmatch{^   myline}{#1}=1            #1 matched         \else            #1 did not match         \fi}         \makeatother          \begin{verbatim}       myline1        myline2         myline3          myline4     \end{verbatim}     \end{document}


title: Changing Font Size globally via package

text: I'd like to write a package that performs the following tasks (it's essentially reformatting the document to make it suitable for being printed 2-pages-side-by-side on a printer): - adjust the margins to make them smaller - adjust the global fontsize of the document I know how to do the first (adjusting margins), but am stumped on how to adjust the second. What I'd like is to have the same effect as specifying               \documentclass[12pt]{article}      at the beginning of the document. But I'd like to achieve this effect by calling a package. I've looked at the question How to change font size mid-document?, but could not make it work, by trying               \input{size12.clo}       either in the pre-amble or in the main body of the document). I'd like accomplish all of this without wrapping my document in any extra environments, etc. I've also tried using the \fontsize command, to no effect (you can see my attempt in the bare bones package below). Here are the MWE. First, the main document               \documentclass{article}          \usepackage{lipsum} % For filler text          \usepackage{double-duplex} % This is the package I'd like to use to alter the size---the target of my question here.          \begin{document}          \lipsum[1-3]     \end{document}      And then the package, which I've called double-duplex.sty               \ProvidesPackage{double-duplex}          \fontsize{12pt}{12pt}\selectfont


title: Customized table of contents

text: I need to format the table of contents for a compilation of articles in a very specific format:               About this volume     Author 1         Preface........................first page-last page          Articles          Author 2         Title 2........................first page-last page     Author 3         Title 3........................first page-last page     Author 4         Title 4........................first page-last page      Except for a small difference concerning the page number it should look like this (German) example: ![](http://i.stack.imgur.com/rUVqR.jpg) Does anyone have ideas how to do it, what packages to use or maybe some coded example?


title: expandable unit conversion

text: I'm writing a package to assist typesetting documents for some special Pen & Paper Fantasy RPG. In this fantasy setting, there are three types of coins: gold, silver and copper pieces, which convert 10:1 each. However, many groups play with a different conversion factor (100:1). Because I want to make things as flexible as possible, I define a command `\gold` that will just take the number of copper pieces and convert into the appropriate pricing string. However, as an additional gimmick, I want to support writing out the data of all purchasable items into an external file (using `\addcontentsline`) which can then be re-read to produce a table with all the pricing information collected in one spot. Here is my solution:               \documentclass{article}          \usepackage{etoolbox}          \makeatletter          \def\makedatalines#1{       \AtEndDocument{         \clearpage         \if@filesw         \expandafter\newwrite\csname tf@#1.data\endcsname         \immediate\openout\expandafter\csname tf@#1.data\endcsname%         \jobname.#1.data\relax         \fi       }     }     \def\adddataline#1#2{\expandafter\addtocontents{#1.data}{#2}}          \newcommand{\copperpiecesAlias}{CP}     \newcommand{\silverpiecesAlias}{SP}     \newcommand{\goldpiecesAlias}{GP}          \numgdef{\CopperPerSilver}{10}     \numgdef{\SilverPerGold  }{10}     \newcommand {\setCopperPerSilver}[1]{\numgdef{\CopperPerSilver}{#1}}     \newcommand {\setSilverPerGold}[1]{\numgdef{\SilverPerGold}{#1}}     \newcommand{\gold}[1]{%       \numdef{\copperpieces}{#1}%       \ifnumless{\copperpieces}{\CopperPerSilver}{%         \numdef{\silverpieces}{0}%       }{%         \numdef{\silverpieces}{(10*\copperpieces/\CopperPerSilver - 5)/10}%         \numdef{\copperpieces}{\copperpieces - (\CopperPerSilver * \silverpieces)}%       }%       \ifnumless{\silverpieces}{\SilverPerGold}{%         \numdef{\goldpieces}{0}%       }{%         \numdef{\goldpieces}{(10*\silverpieces /\SilverPerGold - 5)/10}%         \numdef{\silverpieces}{\silverpieces - (\SilverPerGold * \goldpieces)}%       }%       \ifnumgreater{\goldpieces  }{0}{%         \goldpieces\,\goldpiecesAlias%         \ifnumgreater{\silverpieces}{0}{ }{%           \ifnumgreater{\copperpieces}{0}{ }{}%         }%       }{}%       \ifnumgreater{\silverpieces}{0}{%         \silverpieces\,\silverpiecesAlias%         \ifnumgreater{\copperpieces}{0}{ }{}%       }{}%       \ifnumgreater{\copperpieces}{0}{%         \copperpieces\,\copperpiecesAlias%       }{}%     }          \makedatalines{prices}          \newcommand\purchasable[2]{\textit{#1} (#2)\adddataline{prices}{#1: #2}}          \makeatother          \begin{document}          \purchasable{Longsword}    {\gold{1000}}     \purchasable{Broadsword}   {\gold{500}}     \purchasable{Magic Staff}  {\gold{50000}}     \purchasable{Loaf of Bread}{\gold{5}}     \purchasable{Chicken}      {\gold{10}-\gold{50}}          \end{document}      The conversion works nicely - however: the external file now contains lines like               Longsword: \numdef {0}{1000}\numdef {0}{0}\numdef {10}{0}10\,GP     Broadsword: \numdef {0}{500}\numdef {0}{0}\numdef {5}{0}5\,GP     Magic Staff: \numdef {0}{50000}\numdef {0}{0}\numdef {500}{0}500\,GP     Loaf of Bread: \numdef {5}{5}\numdef {0}{0}\numdef {0}{0}5\,CP     Chicken: \numdef {0}{10}\numdef {5}{0}\numdef {0}{0}5\,SP-\numdef {0}{50}\numdef {5}{0}\numdef {0}{0}5\,SP       which is clearly not what I was hoping for (please note especially how messed- up the last line is - these are not even the correct numbers). I would need the external file to contain lines like               Longsword: 10\,GP     Broadsword: 5\,GP     Magic Staff: 500\,GP     Loaf of Bread: 5\,CP     Chicken: 1\,SP-5\,SP      After a bit of research, I concluded that the problem is that the `\gold` command is not fully expandable. Can anybody help me write a fully expandable variant of the `\gold`, or else help me to achieve what I want by other means and enlighten my quest to write this package? Also, I would be very greatful for a more compact and elegant way to write the `\gold`-function, which looks quite bloated to me.


title: Index will not show up in table of contents

text: I am new to LaTeX and still on the steep learning curve. I am writing some documentation for a school project which has a bibliography and an index, using ShareLaTeX. I am having difficulty getting the index to show in the table of contents. This bare-bones code sample illustrates my problem.               \documentclass[a4paper]{report}          \usepackage{lipsum}     \usepackage{makeidx}          \makeindex     \begin{document}     \tableofcontents     \clearpage{\pagestyle{empty}\cleardoublepage}          \chapter{Introduction}     Some random \index{random} text \index{stuff!text} about fact \cite{fact}.     \clearpage{\pagestyle{empty}\cleardoublepage}          \chapter{Main}     \lipsum[6]     \clearpage{\pagestyle{empty}\cleardoublepage}          \addcontentsline{toc}{chapter}{Bibliography}     \begin{thebibliography}{9}         \bibitem{fact}         Factual stuff,         \emph{The types of Facts}. \\         XXXX, Publisher         \end{thebibliography}     \clearpage{\pagestyle{empty}\cleardoublepage} %Line 1          \addcontentsline{toc}{chapter}{Index} %Line 2     \printindex     \clearpage{\pagestyle{empty}\cleardoublepage}          \end{document}      If I change Line 1 to `\clearpage{\pagestyle{empty}}` then the index shows up in the table of contents, however I want to ensure the index starts on an odd page. I have tried using the `hyperref` package but doing this with the package:               \phantomsection     \addcontentsline{toc}{chapter}{Index}     \printindex     \clearpage{\pagestyle{empty}\cleardoublepage}      seems to have no effect. I've been looking all over the internet for an answer and I haven't found it. I would appreciate any help and if you need more info please let me know I will do my best :-)


title: AUCTeX and TikZ does not work in emacs for me : HELP T

text: This is no duplicate. I am unsure how things work here. But I wasn't able to save my last username as it was a temporary username and cannot access my previous post which was marked as duplicate. However, rest assured it was no duplicate. so, whenever I click on my previous post it automatically redirects me to Preview TikZ figure in AUCTeX? which is not the problem. HELLO WHOEVER CLOSED THAT AND MARKED IT AS DUPLICATE. PLEASE REFRAIN FROM DOING SO, since this is a different problem. As I advised on my previous post, I already followed all the instructions provided in the this tex forum that are related to resolving how tikz and auctex work for the preview.... Can someone please help me make this work ? The minimum working example that does not work for the C-c C-p C-s command for previewing is :               \documentclass{article}     \usepackage{tikz}     \begin{document}          \section{test}          \begin{tikzpicture}     \draw (1,1) rectangle (2,2);     \end{tikzpicture}     \end{document}      What I get when I attempt to preview is an [stop symbol] icon before               [icon appears here]\begin{tikzpicture}      When I click on the icon I can select two options:               [View Error]     [View Source]      The error is as follows.               gs -dOutputFile\=\(_region_.prv/tmp10394KqL/pr1-1.png\) -q -dDELAYSAFER         -dNOPAUSE -DNOPLATFONTS -dPrinted -dTextAlphaBits\=4-dGraphicsAlphaBits\=4               -sDEVICE\=png16m -r127.763x127.523          GS>{<</PermitFileReading[(_region_.prv/tmp10394KqL/preview.ps)]>>      setuserparams .locksafe} stopped pop {DELAYSAFER{.setsafe}if}stopped      pop/.preview-BP currentpagedevice/BeginPage get dup null eq{pop{pop}bind}if           def<</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1 get 1      ne or{.preview-BP }{pop}ifelse}bind/PageSize[1 1]>>setpagedevice/preview-        do{[count 3 roll save]3 1 roll dup length 0 eq{pop}{setpagedevice}{ifelse           .runandhide}stopped{handleerror quit}if aload pop restore}bind def           [(_region_.prv/tmp10394KqL/preview.ps)(r)file]aload exch dup 0      setfileposition 25160()/SubFileDecode filter cvx .runandhide aload pop dup      dup 25271 setfileposition 387()/SubFileDecode filter cvx<<>>preview-do          Error: /undefined in pgfo          Operand stack:               Execution stack:     %interp_exit   .runexec2   --nostringval--   --nostringval--             --nostringval--   2   %stopped_push   --nostringval--   --nostringval--             %loop_continue   --nostringval--   --nostringval--   false   1             %stopped_push   .runexec2   --nostringval--   --nostringval--             --nostringval--   2   %stopped_push   --nostringval--   --nostringval--             false   1   %stopped_push   1148   --nostringval--   %end_runandhide             --nostringval--               Dictionary stack:     --dict:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:83/200(L)--             --dict:106/300(L)--          Current allocation mode is local          Last OS error: 2                Preview-Ghostscript finished      What I did Pre-included in my .emacs file is:               ;; To integrate RefTeX with AUCTeX, use     (setq reftex-plug-into-AUCTeX t)     (add-hook 'LaTeX-mode-hook 'turn-on-reftex)     (add-hook 'bibtex-mode-hook 'turn-on-auto-revert-mode)      and               ;; Automatic Parsing of TeX Files     (setq TeX-parse-self t ; Enable parse on load.     TeX-auto-save t ; Enable parse on save.     LaTeX-math-mode t ; ` will read a character from the keyboard,     ; and insert the symbol as specified...     TeX-electric-sub-and-superscript t ; If non-nil, insert braces     ; after typing  and  in     ; math mode.     preview-scale-function 1.33 ; determines by what factor images     ; and formulas should be scaled when     ; appearing on the screen     )      1) Yes, I included the following into my .emacs file:               (eval-after-load "preview"     '(add-to-list 'preview-default-preamble "\\PreviewEnvironment{tikzpicture}"     t)     )      2) I also included the following command in my .emacs file right after the one above               (setq auto-mode-alist     (append     '(("\\.tikz\\'" . latex-mode))     auto-mode-alist))      At last, someone suggested to include something like \PreviewEnvironment{tikzpicture} I tried that but this does not seem to have made any changes to the error. It's been nagging and bugging me a lot over the last 20 hours to get this silly preview working. I am no complete retard but I am a newbie. Can someone please help me ? thanks.


title: Scaling an \input within a subfigure

text: I'm including latex files with \input within a subfigure environment:               \documentclass[a4paper]{report}     \usepackage[usenames,dvipsnames]{color}     \usepackage{linegoal}     \usepackage{graphicx}     \usepackage{xcolor}     \usepackage{subcaption}          \begin{document}     \begin{figure}[ht]         \begin{subfigure}[b]{0.5\textwidth}             \scalebox{.4}{\input{figures/steps/step-001.tex}}             \caption{Step 1 of the example run}             \label{step1er}         \end{subfigure}         \begin{subfigure}[b]{0.5\textwidth}             \scalebox{.4}{\input{figures/steps/step-002.tex}}             \caption{Step 2 of the example run}             \label{step2er}         \end{subfigure}     \end{figure}     \end{document}      But they simply refuse to scale, and the output is completely messed up. The right figure stretches even more vertically. Here is what it looks like in the PDF: ![http://imgur.com/48JqT5N](http://i.stack.imgur.com/LccZD.png)


title: want to center a table / tabular

text: I am using memoir template. I have a small table (attached is the word version) and I tried to center it against the page. But it becomes left aligned after I added `[H]` behind `\begin{table}`. Here is the link of the template and the code: https://sites.google.com/site/biometricbiometrie/template/monStyle.tex?attredirects=0&d=1 ![enter image description here](http://i.stack.imgur.com/z2dKz.jpg)               \definecolor{c1}{rgb}{0.30980, 0.50588, 0.73725}     \definecolor{c2}{rgb}{0.82353, 0.87843, 0.92941}          \begin{center}     \setlength{\arrayrulewidth}{1pt}     \setlength{\extrarowheight}{1.2pt}     \color{c1}     \arrayrulecolor{white}       \begin{table}[H]     \caption{Table}     \label{tb33}     \begin{tabular}{|l|l|c|}         \rowcolor{c1}         &   \color{c2}F1A    &   \color{c2}F3A  \\     \hline          \rowcolor{c2}     F2A  &  0.4693 (14.2\%)  &  0.5073 (15.3\%)   \\     \hline          \rowcolor{c2}     F1A  &    &  0.4191 (12.6\%)    \\     \hline     \end{tabular}     \end{table}     \end{center}


title: titlesec versus titling; mangling \thetitle

text: I want to have the chapter name and title of the document appear in the header; I know how to do that with `fancyhdr` and `titling`, one of the miscellaneous functions of the latter is to preserve the `\thetitle` command which can be used to extract the title of the document later on. Now I added on the `titlesec` package to make the section/chapter headings look better. But here I run into a problem: `titlesec` seems to be overwriting `\thetitle` with the contents of `\thesection` or `\thesubsection`! An example to show the problem:               \documentclass{report}     \usepackage{titling}     \usepackage{titlesec}          \newpagestyle{testfancy}{%       \headrule%        \sethead{\thetitle}{}{\chaptertitle}}     \pagestyle{testfancy}          \title{My title}     \author{This author}          \begin{document}     \maketitle          \chapter{A chapter}          some filler text          \newpage          some more filler text          \newpage          \section{Now a section is added}     \end{document}      On page 3, the left header is displayed (as defined and intended) to be the value of `\thetitle`, which in this case is "My title". On page 4, however, after the new section, the left header now shows as "1.1", the value of `\thesection`. Is this conflict documented somewhere? And is there a fix/workaround?


title: Update package of TeX Live 2009

text: I have a CLSI (LaTeX server) instance running on Ubuntu 10.04: http://code.google.com/p/common-latex-service-interface/ Now I want to install a new package and also upgrade an existing package. The packages contain only `.cls` (class) and `.sty` (style) files, thus I added a new folder in `texmf-live/tex/latex`, copied the new files there while updating the files in the existing folders with new files. Restarted box. But the new package is not being recognized! :( I tried `texhash` but it did not work. There is no `tlmgr` in the instance installed in CLSI package (from above link). Anyone has an idea how I can accomplish this?


title: How to use shell environment variable with import/include/input?

text: I would like to create a folder in my home directory to store a few files in it that should serve as templates e.g. handout.tex. I begin to write my specific file somewhere in my filesystem. Now I want to use something like:               \input{~/Templates/handout}      or perhaps use an extra variable so I can put the template folder somewhere else and change only the variable. Does anybody know how to use environment variables in LaTeX commands?


title: How do I use \pgfextractx, \setlength and so on together, to achieve a task using paths?

text: The following code attempts to absolutely position two nodes with rectangular outlines, then draw a line that goes from the right-hand side of one to the left-hand side of the other, along orthogonal lines with the vertical segment lying directly between the two nodes. But instead of getting that result, this happens: ![alt text](http://i.stack.imgur.com/C56ta.png) I can't get the hang of how LaTeX and TikZ length commands work. How can I fix what I've got here?               \documentclass[a4paper]{amsart}          \usepackage{calc,fullpage,tikz}     \usetikzlibrary{arrows}          \newlength{\mylengthA}     \newlength{\mylengthB}     \newlength{\mylengthC}          \begin{document}          \begin{center}\begin{tikzpicture}     [yscale = -1]          \begin{scope} % Boxes     [ every node/.style = { draw,                             rectangle,                             inner sep = 3mm,                             }       ]         \node (a) at (0,20mm) {Apple};         \node (b) at (28mm,0) {Banana};     \end{scope}          \begin{scope} % Arrows     [->, > = angle 90, very thick]         \pgfextractx{\mylengthA}{(a.east)}         \pgfextractx{\mylengthB}{(b.west)}         \setlength{\mylengthC}{\mylengthA/2 + \mylengthB/2}         \draw (\mylengthA,20mm) -- (\mylengthC,20mm) |- (\mylengthB,0);     \end{scope}          \end{tikzpicture}\end{center}          \end{document}


title: Date declaration in datenumber

text: In the following MWE, `\today` prints the date in British format, e.g. 14th January 2013. However, `\datedate` prints the date as January 28, 2013. I wonder how the latter can be changed to the former.               \documentclass{article}     \usepackage{datenumber}     \usepackage[british]{babel}          \begin{document}          \today          \setdatetoday     \addtocounter{datenumber}{14}%     \setdatebynumber{\thedatenumber}%     In 14 days is \datedate          \end{document}


title: What do empty math character class symbols ("\mathpunct{}") do, and when are they used?

text: Every once in a while, one will encounter empty math characters with a specific math character class. For example, `amsmath` uses `\mathpunct{}` in its definition of `\colon`: > >     \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript >       \mkern-\thinmuskip{:}\mskip6muplus1mu\relax} >   Let's explore the issue with some tests: ![enter image description here](http://i.stack.imgur.com/Va0Y0.png) Here is the code that was used to generate this:               \documentclass{article}     \usepackage[margin=1.5in]{geometry}     \usepackage{mathtools} % for \mathclap     \usepackage[T1]{fontenc} % to disable a warning generated by \textbackslash          \newcommand{\specialcell}[1]{\begin{tabular}[t]{@{}l@{}}#1\end{tabular}}       % for multi-row cells       % macro adapted from egreg's answer here: http://tex.stackexchange.com/a/19678               \begin{document}          \begin{tabular}{lll}     \(abc\) & \verb|\(abc\)| &  \\[\bigskipamount]     \(a\mathpunct{b}c\) & \verb|\(a\mathpunct{b}c\)| &        \specialcell{\texttt{\textbackslash mathpunct} will close up to \\                     a \texttt{\textbackslash mathord} on the left and \\                     create a \texttt{\textbackslash thinmuskip} (\texttt{\textbackslash 3mu}) \\                     before a \texttt{\textbackslash mathord} on the right \\[\bigskipamount]} \\          % \verb doesn't work inside of macro arguments, therefore we need \texttt.         % There ought to be a better way of getting the tablerow spacing I want, one that           % doesn't require explicit \\[\bigskipamount] (sometimes placed within the           % \specialcell by necessity).     \(ab\mathpunct{}c\) & \verb|\(ab\mathpunct{}c\)| &        empty \texttt{\textbackslash mathpunct} \\[\bigskipamount]     \(ab\mathrel{}c\) & \verb|\(ab\mathrel{}c\)| &        \specialcell{empty \texttt{\textbackslash mathrel}: \texttt{\textbackslash thickmuskip} \\        (\texttt{5mu} (\texttt{plus 5mu})) by default \\[\bigskipamount]} \\     \(ab\mathrel{}\mathrel{}c\) & \verb|\(ab\mathrel{}\mathrel{}c\)| &        \specialcell{two empty \texttt{\textbackslash mathrel}s are like \\                     one empty \texttt{\textbackslash mathrel} \\[\bigskipamount]} \\     \(ab\mathrel{\mathclap{\vert}}c\) & \verb|\(ab\mathrel{\mathclap{\vert}}c\)| &         \\%[\bigskipamount]     \end{tabular}          \end{document}      (The last line shows that `\mathrel{}` is like an infinitesimally thin `\mathrel` with `\thickmuskip` (`\;`) spacing on both sides.) That two successive empty `\mathrel`s are like a single one is just because there is no spacing between _any_ two successive `\mathrel`s. Therefore there is nothing special here. **When might one use "null characters" with specific math character classes? Is there anything important to know?**


title: microtype font expansion and DVI output; problem with kpathsea

text: Consider the following file `test.tex`               \documentclass[11pt]{report}          \usepackage[T1]{fontenc}     \usepackage[protrusion,expansion]{microtype}           \begin{document}     \chapter{A new chapter}     Some actual testing text here. Let us make this long enough so that it     will run over at least one line so I can test to see if protrusion is     the problem. Ha Ha Ha.!!     \end{document}      If I process it with `pdflatex`, the file generates just fine. If I try to process it with `pdflatex -output-format dvi`, it fails with               kpathsea: Running mktextfm ecrm1095+20     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ecrm1095+20     This is METAFONT, Version 2.718281 (Web2C 2009)               kpathsea: Running mktexmf ecrm1095+20     ! I can't find file `ecrm1095+20'.     <*> ...our; mag:=1; nonstopmode; input ecrm1095+20          Please type another input file name     ! Emergency stop.     <*> ...our; mag:=1; nonstopmode; input ecrm1095+20          Transcript written on mfput.log.     grep: ecrm1095+20.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input ecrm1095+20' failed to make ecrm1095+20.tfm.     kpathsea: Appending font creation commands to missfont.log.          ! Font csnameendcsname=ecrm1095+20 at 10.95pt not loadable: Metric (TFM) file n     ot found.      If I set the option `expansion=false` to `microtype`, the DVI output compiles just fine. Questions: > (a) Is this normal, and is there a good explanation why DVI output breaks > while PDF output works? (b) Can this be fixed? or is font expansion > something I just shouldn't play with in DVI output?


title: How to rotate text inline?

text: I used the rotating package to rotate the symbol 90 positive degrees and that worked well. But I also want to rotate it 270 positive degrees and then it ends up hanging down on the line below. How can one rotate symbols any degree while it stays on the same line?


title: Can I use pgfplots to make a boxplot

text: My current plotting tool for my papers is pgfplots for nice consistent plots. Now I would like to add a boxplot. Is this possible with help of pgfplots, or any helper package?


title: How do I format the document?

text: I have a document. This is my code               \documentclass[a4paper, 12pt]{article}     \usepackage{fouriernc}     \usepackage{amsmath,amsfonts,enumerate,tabularx,calrsfs,esvect, multicol}     \usepackage{graphics}     \usepackage[left=15mm,right=20mm,top=15mm,bottom=10mm]{geometry}     \usepackage[thmmarks,standard,thref]{ntheorem}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}     \pagestyle{empty}          \theoremseparator{.}     \theorembodyfont{\upshape}     %\theorembodyfont{\normalfont}     \newtheorem{pro}{Problem}     \renewcommand{\baselinestretch}{1.5}     \begin{document}          \thispagestyle{empty}     \begin{pro}     Solve  the following equations:     \begin{enumerate}[\quad 1)]     \item $\dfrac{\cos^2 2x}{\cos x + \cos\dfrac{\pi}{4}} = \cos x - \cos\dfrac{\pi}{4}$;     \item $\dfrac{\cos^2 2x}{\cos x + \cos\dfrac{\pi}{4}} = \cos x - \cos\dfrac{\pi}{4}$;          \item $(\sqrt{3}\sin x + 2\cos x)\cdot (1 - \cos x) = \sin^2 x$.     \end{enumerate}     \end{pro}               \begin{pro}     \begin{minipage}[b]{0.3\textwidth}     \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]     \clip(-0.5,-0.5) rectangle (4.3,4.5);     \draw (0,0)-- (4,0);     \draw (4,0)-- (2,3.46);     \draw (2,3.46)-- (0,0);     \begin{scriptsize}     \fill [color=black] (0,0) circle (1.5pt);     \draw[color=black] (-0.03,-0.19) node {$B$};     \fill [color=black] (4,0) circle (1.5pt);     \draw[color=black] (4.1,-0.19) node {$C$};     \fill [color=black] (2,3.46) circle (1.5pt);     \draw[color=black] (1.99,3.72) node {$A$};     \end{scriptsize}     \end{tikzpicture}     \end{minipage}     \begin{minipage}[b]{0.615\textwidth}     Write the equation of the plane which passes the point and perpendicular to the line $\Delta$      \end{minipage}     \end{pro}     \end{document}       I want to Problem 2 above, the equilateral triangles on the left and content of the problem on the right. Moreover, the total widths of the two minipapes equal to width of the page. How do I do that? Thank you.


title: Insert figure in a multicol article

text: I am trying to insert a figure with a caption into a `multicol` article. When the figure was inserted on its own, it was fine: `includegraphics[width=0.5cm]{image}` However, when I tried to insert the caption [see below], the caption did not appear anywhere in the article and the figure disappeared.               \documentclass{article}     \usepackage[hmarginratio=1:1,top=30 mm,columnsep=20pt,hmargin=2.5cm]{geometry}     \usepackage[font=it]{caption}     \usepackage{paralist}     \usepackage{multicol}     \usepackage{setspace}     \usepackage{graphicx}          \begin{document}     \begin{multicols}{2}     text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text          \begin{figure}[h!]      \caption{Fig.1 xxxxx}     \includegraphics[width=0.5cm]{image}     \end{figure}          text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text          \end{multicols}     \end{document}      What might be the issue and how could I fix it?


title: Decorate path with just a colored thick line

text: Is it possible to decorate a path with just a thick colored line above or below it? In the following example I faked manually the result, but how can I do it with decorations? In particular I want to be able to choose the color and the line width and use the raise option of the decoration.               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}          \begin{tikzpicture}        \coordinate (A) at (0,0);        \coordinate (B) at (1,1);        \coordinate (v) at ($(B) - (A)$);             \path let \p1 = (v) in ($1/(\x1^2 + \y1^2)^(0.5)*(\y1,-\x1)$) coordinate (p);        \pgfmathsetmacro{\dist}{0.7}        \coordinate (AA) at ($(A) + \dist*(p)$);        \coordinate (BB) at ($(B) + \dist*(p)$);             \draw (A) -- (B);        \draw[thick,orange] (AA) -- (BB);     \end{tikzpicture}     \end{document}      ![output](http://i.stack.imgur.com/njihL.png) **Edit:** If it is not possible to get it via decorations is it possible to define a style just for straight lines which allows you to draw two or three colored lines just like here: http://tex.stackexchange.com/a/36858/4011 in the case of circles.


title: variable for color in latex

text: I am using beamer for writing my presentation. I was initially using latex+dvipdf, then with the help of other tex.exchange users I recognized that I cannot use transparency in this way. So now I am switching to pdflatex. Because I use personalized colors and didn't want to use RGB names, I was using names from dvipsnames, but now I have to switch to svgnames, and the color names are of course different. I would like to use a variable that stores the color name, so that I can choose a color to be defined either in svgnames or in dvipsnames, depending if I am using pdflatex or not. I tried this               \ifpdf color1=cyan     \else color1=PineGreen \fi      but it doesn't work, what should I do?


title: changing loop size and shape in tikz

text: I would like to make the small loop around the circle (loop above) a bit rounder and nicer. below is a short example of my code:                \documentclass{scrbook}      \usepackage{tikz}      \usetikzlibrary{positioning,automata}      \begin{document}           \begin{tikzpicture}[shorten >=1pt,auto]        \tikzstyle{place}=[circle,thick,draw=blue!75,fill=blue!20,minimum                           size=6mm]        \node[place] (foo) [label=above left:Foo] {$1$};        \path[->] (foo) edge  [loop above] node {1} ();       \end{tikzpicture}      \end{document}


title: Partition Numbering and PDF Bookmark Generation

text: I'm trying to figure out how to manage the interaction of numbering features of various document parts, e.g., parts, chapters, sections, etc. and the bookmarks generated for a PDF document. First, the number of document partition is only showing up for parts in the bookmarks. The numbers of chapters and section are not part of the names that are displayed. Is there a way to fix this? Also, I've noticed that if a partition is not numbered (e.g., an unnumbered subsection) it doesn't show up as a bookmark. I would like to be able to have unnumbered subsections, for example, but still have them show up as bookmarks. Is there a way to do this? To be clear on what I want to achieve, consider the following example:               \documentclass{book}     \begin{document}     \part{A} %Shows up as a bookmark named "I A"; this is fine         \chapter{B} %Shows up as a bookmark named "B"; what I want is "1 B"           \section{C} %Shows up as a bookmark named "C"; what I want is "1.1 C"             \subsection*{D} %Doesn't show up as bookmark; what I want is "D"       \part{E} %Shows up as a bookmark named "II B"; this is fine         \chapter{F} %Shows up as bookmark named "F"; what I want is "2 F"         %...and so on     \end{document}      `


title: Compute asin from y-value of a coordinate or: Angle between two lines in tikz

text: **Edit** (The almost ultimate solution) After sorting everything out and having some nice code - thanks to cjorssen :) - I cam up with a general solution with which you are able to use the connector with two arbitrary nodes: (The previous code needed the circled node to be at the origin (0,0).               %usage: \arcconnector[color]{Satellite Node}{Circled Node}{rim radius}     \newcommand\arcconnector[4][black]%     {%         \path [name path=S--C] (#2) -- (#3);         \path [name path=Rim] (#3.center) circle(#4);         \path [name intersections={of=S--C and Rim}];         \pgfmathanglebetweenpoints{%             \pgfpointanchor{#3}{center}}{%             \pgfpointanchor{intersection-1}{center}}         \let\myendresult\pgfmathresult         \path [draw,color=#1] (intersection-1) arc[start angle=\myendresult,delta angle=-40,x radius=#4,y radius=#4];         \path [draw,color=#1] (intersection-1) arc[start angle=\myendresult,delta angle=40,x radius=#4,y radius=#4];         \path [draw,#1] (#2) -- (intersection-1);     }      So for the example depicted below we can do this:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{intersections}     \begin{document}     \begin{tikzpicture}       \node [shape=circle,draw,minimum size=1cm,red] (C) {};       \node at (0.8,1.5) [shape=rectangle,draw,blue] (P) {P};       \arcconnector{P}{C}{0.6cm}     \end{tikzpicture}     \end{document}      Another useful parameter that you may want to adjust is the length of the arc wings (here const 40°). **Edit** (after first answer and comments) I want to draw an arc at an intersection in that way, that the intersection is the middle of the arc. But I don't know how to define `\myendresult` to be the angle between (Origin intersection-1) and the x-axis.               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{intersections}     \begin{document}     \begin{tikzpicture}       \coordinate (Origin) at (0,0);       \coordinate (Xaxis) at (1,0);       % Note: the minimum size is the diameter, so radius = .5cm       \node [shape=circle,draw,minimum size=1cm,red] (C) {};       \node at (0.8,1.5) [shape=rectangle,draw,blue] (P) {P};       \path [name path=P--C] (P) -- (C);       \path [name path=Rim] (0,0) circle(0.6cm);       \path [name intersections={of=P--C and Rim}];       % How to define \myendresult?       %\path [draw] (intersection-1) arc[start angle=\myendresult,delta       %  angle=-40,radius=0.6cm];        %\path [draw] (intersection-1) arc[start angle=\myendresult,delta       %  angle=40,radius=0.6cm];        \path [draw] (P) -- (intersection-1);     \end{tikzpicture}     \end{document}      This should look like the following: ![enter image description here](http://i.stack.imgur.com/TjbRY.png) The base problem is to find the correct start angle for arc. Maybe this is also possible by using some tangent calculations? * * * **Original question** The base problem is, that I'd like to compute the angle between two lines given by two coordinates in `tikz`. That seems to be difficult and because one of the lines is the x-axis (1,0), we can reduce that to: Calculate the asin from the y-value of the second coordinate (here `intersection-1`). But this seems to be a problem. I tried to use `\pgfextracty` with `\pgfmathasin`:               \newdimen\myyvalue     \pgfextracty{\myyvalue}{intersection-1}     \node at (1,1) {\myyvalue};     \pgfmathsetmacro{\myendresult}{asin(\myyvalue)}     \path [draw,blue] (intersection-1) arc[start angle=\myendresult,delta angle=30,x radius=0.6cm,y radius=0.6cm];      At line 3 I get "missing number treated as zero". So I tried using the `let` command:               \path [name intersections={of=A and B},draw,blue] let \p1=(intersection-1) in (intersection-1) arc[start angle=\pgfmathasin{\y1},delta angle=30,x radius=0.6cm,y radius=0.6cm] (intersection-1);      But now I get the error:               ! Incomplete \iffalse; all text was ignored after line 821.     <inserted text>                      \fi      I don't get the errors and am I little bit helpless. It seems no one else ever tried to compute the angle between to vectors/coordinates/points in `tikz` (at least Google doesn't find anything).


title: Bibliography in blocks in beamer

text: Is it possible to write the bibliography in a block in each frame in beamer? I have used the following code to split the bibliography into frames:               \begin{frame}[allowframebreaks]     \frametitle{References}         \tiny{\bibliographystyle{abbrv} }         \bibliography{refs}     \end{frame}      But what should I do if I want to include the references in each frame inside a single block? Any suggestion please?


title: An environment with custom justification

text: I would like to create an environment called "question" with one argument (being the question number) with a certain alignment/justification. How might I define one so that it comes out like how it does in one of the two ways here? In the linked example, it is just the alignments that I am talking about (not the fonts, sizing, etc.).   There are two kinds of alignments here:   * One is like #5.66 where the question's body is in line with the end of "5.66".   * The other kind, like in #5.64, has the bodies of the questions (i),(ii), etc. in line with lettering, which is itself further right of the question number. In each case how might I phrase my environment's definition?