title: LaTeX packages: automatic versus manual installation, and related issues

text: I often run into problems in LaTeX with packages. I did a reinstall (MiKTeX) and it seemed to fix some issues with knowing where packages coming from or going. In general, I am not sure what should or does happen when using `\usepackage` command. Is it standard that these packages are automatically pulled from the internet? Where do they go (by default)? Is there a better place to put them? If I am troubleshooting, and if we can say packages are usually installed automatically, when, and should I ever, install packages manually? If so, where would I put them? For instance, I believe the package `easylist` is installed on my computer. I was able, with some difficulty, to get into the roaming folder, looked around, and really the only package I saw, was several `easylist` files, such as `.sty`, and an associated `readme` file. I did a windows search for `easylist`, and only found one, with suffix `.tpm` and in the `Program Files (x86)\MiKTeX 2.9\tpm` folder. My problem currently, is that I am trying to use the `todonotes` package. It seems to require the `xcolor` package. But this "can not be found". It asks to choose a place to get it. I think default was "choose random", but I just switched it to internet, and some random mirror site in country (USA). That didn't work, and I'm afraid I've now fiddled with the default settings for getting packages, which will create problems later. Here are some other threads I have been fishing through:   * What is the preferable setup for MiKTeX to keep all packages up-to-date easily?   * Where do I place my own .sty files, to make them available to all my .tex files?   * How can I manually install a package on MiKTeX (Windows) * * * In lieu of picture, I have this: > >     miktex-pdftex.exe: No connection could be made because the target >     machine actively refused it. >   >     miktex-pdftex.exe: Data: connect failed in tcp_connect() >     {}====================================================================== >   >     ! LaTeX Error: File `xcolor.sty' not found. >   >     Type X to quit or <RETURN> to proceed, or enter new name. (Default >     extension: sty) >   >     Enter file name: >   and from clipboard: > >     MiKTeX Problem Report Message: No connection could be made because the >     target machine actively refused it. >   >     Data: connect failed in tcp_connect() >     Source: Libraries\MiKTeX\PackageManager\PackageManager.cpp >     Line: 2461 >     MiKTeX: 2.9 >     OS: Microsoft Windows 7 Home Premium Edition, 64-bit Service Pack 1 > (build 7601) >     Invokers: explorer >     SystemAdmin: no >     PowerUser: no >     Root0: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9 >     Root1: C:\Users\aUserName\AppData\Local\MiKTeX\2.9 >     Root2: C:\ProgramData\MiKTeX\2.9 >     Root3: C:\Program Files (x86)\MiKTeX 2.9 >     UserInstall: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9 >     UserConfig: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9 >     UserData: C:\Users\aUserName\AppData\Local\MiKTeX\2.9 >     CommonInstall: C:\Program Files (x86)\MiKTeX 2.9 >     CommonConfig: C:\ProgramData\MiKTeX\2.9 >     CommonData: C:\ProgramData\MiKTeX\2.9 >   (from "Package Installation" window below) > >     The required file >   >          tex\latex\xcolor\xcolor.sty >   >     is missing. It is part of the following package: >   >          xcolor >   >     The package will be installed from:  ftp://... [Change...] The package >     will be installed for... >   * * *


title: Using Dingbats font in xelatex

text: This must be a real-newbie-level question (which is kind of embarassing having used plain TeX to write my PhD thesis in 1992), but I am not be able to find an answer. Even if there are 5 millions similar questions here... so, my MWE is this:               \documentclass{article}     \usepackage{fontspec}     \newfontfamily\dingbatsfont{Dingbats}     \newcommand\ding[1]{{\dingbatsfont\symbol{#1}}}          \begin{document}     \ding{115} % no output     {\dingbatsfont ❤} % error --- comment out to have a PDF file      \end{document}      ...and running it with `xelatex` gives an error on the second line:               ** WARNING ** 1 glyph names (out of 1) missing Unicode mapping.     ** WARNING ** ToUnicode CMap "TZCCMX+Dingbats-UTF16" removed.     ** ERROR ** pdf_ref_obj(): passed invalid object.      whilst if I remove it, I have no error, but the `\ding{115}` gives nothing. The strange thing is that the PDF file generated (when I remove the second line) seems to have the font loaded:               (0)samsung-romano:~/education/LibroEje/tmp% pdffonts lalla.pdf     name                                 type              encoding         emb sub uni object ID     ------------------------------------ ----------------- ---------------- --- --- --- ---------     IPQPDZ+Dingbats-Identity-H           CID Type 0C       Identity-H       yes yes yes      5  0     WPNUQB+LMRoman10-Regular-Identity-H  CID Type 0C       Identity-H       yes yes yes      7  0      ...and the font is here and usable by LibreOffice: ![LibreOffice font selector](http://i.stack.imgur.com/ixPNH.png) I tried to substitute the `115` with the Unicode codepoint `"2773` but then I have the error above again. What am I doing (terribly) wrong?


title: \AtBeginDocument and \AtEndDocument for standalone

text: Using the commands `\AtBeginDocument` and `\AtEndDocument` with the `standalone` documentclass yields unexpected effects. I have the following three files.               % main.tex     \documentclass{scrartcl}     \usepackage[subpreambles]{standalone}     \AtBeginDocument{begin main \\}     \AtEndDocument{end main \\}     \begin{document}%       before       \input{sub1}       between       \input{sub2}       after     \end{document}      and               % sub1.tex     \documentclass{standalone}         \AtBeginDocument{begin sub1 \\}     \AtEndDocument{end sub1 \\}     \begin{document}%     \end{document}      `sub2.tex` looks like `sub1.tex` except for the numbers. Compiling `main.tex` results in a document that orders the text fragments like this. (I inserted some indentation here just to point out the structure.)               begin sub1      begin sub2       begin main        before        between        after       end main      end sub1     end sub2      But I would expect this.               begin main      before       begin sub1       end sub1      between       end sub2       begin sub2      after     end main      How can I instead get the second result?


title: can't put figures in a box

text: The other day I had a problem in creating an example that contained text and listings, I asked about that here: lstlisting in a box? David Carlisle found a very good solution for it, and after toying with his solution I ended up with another problem. It seems that this solution does accept listings but it does not accept figures. Below is an example of what I want. It basically is the solution David provided earlier with a figure added. As such it will fail. While I know the figure is maybe not really required here, I have other situations where I do want to use figures in examples, and this provides a working example. I have no clue how to resolve this. Any pointers and ideas are welcome. As a side remark I intend to use the final solution later as a newenvironment to serve as a template for all examples I got in my document. Thank you for reading this.               \documentclass{article}     \usepackage{color,listings}     \definecolor{lightgray}{rgb}{.7,.7,.7}     \newsavebox\lstbox     \begin{document}          \begin{lrbox}{\lstbox}\begin{minipage}{\textwidth}     An example text          \begin{lstlisting}[frame=single,language=XML,caption=A Fibonaci example\label{code:fibonaci}]        <xml></xml>     \end{lstlisting}             \begin{figure}[htb]     \begin{verbatim}       1 1 2 3 5 8 13 21 34 55 89     \end{verbatim}     \caption{\label{code:fibonaci:output}Output of the Fibonaci example}     \end{figure}       Some more text     \end{minipage}\end{lrbox}            \colorbox{lightgray}{\usebox\lstbox}               \end{document}


title: Multiple affiliations of an author in sig-alternate

text: I am trying to put two affiliations for an author in `sig-alternate` (ACM SIG Proceedings), for the second author. So effectively, the second author should be over both the second and the third affiliations. But there is no way I can keep the third author field blank and have only the affiliation there. Is there any other way to do this?               \author{     \alignauthor     First Author\\            \affaddr{Some lab, Some University}\\            \affaddr{New Found Land, NJ, USA}\\            \email{somemail@someserver.edu}     \alignauthor     Second Author\\            \affaddr{Some lab}\\            \affaddr{Some company}\\            \affaddr{Santa Clara, CA, USA}\\            \email{otheremail@company.com}     \alignauthor         Test author\\            \affaddr{The Th{\o}rv{\"a}ld Group}\\            \affaddr{1 Th{\o}rv{\"a}ld Circle}\\            \affaddr{Hekla, Iceland}\\            \email{larst@affiliation.org}     }


title: Interrupting Nested Lists in LaTeX

text: How do I interrupt and resume nested lists at any level in LaTeX? Something like               I. Item Level 1         A. Item Level 2             1. Item Level 3     comment at level 1             2. Item Level 3         B. Item Level 2             1. Item Level 3         comment at level 2     comment at level 1             2. Item Level 3     II. Item Level 1      (A similar question was asked and answered for non-nested lists: How to interrupt/resume a list in LaTeX?)


title: How I set the space between a fbox and the paragraphs above and below the fbox?

text: In my case, I do not use any command about it. So the text is very close with the box and it is not good.               \documentclass{article}     \usepackage{amsmath,bm}               \begin{document}          P_above     \fbox{      a=b     }     P_below     \end{document}


title: Inconsistent page clearing with \includeonly

text: I'm writing my thesis using memoir.cls, with a top-level document for preamble and front matter and the like, and a source file per chapter, organised like this:               \documentclass{memoir}          \begin{document}       \include{intro}       \include{a}       \include{b}       \include{conclusion}     \end{document}      To compile only the part of the document I'm working on at the moment, I use `\includeonly`, as you'd expect. Now, if I `\includeonly{a}` or `\includeonly{conclusion}` I get the output I expect, but if it's `intro` or `b` that's `\includeonly`-ed, the chapter opens on the left-hand side rather than the right-hand side as it should. There seems to be a stray `\newpage` getting inserted somehow. Does anyone know what's causing this?


title: Trouble creating basic table

text: I would like to create a table, which look like this: ![enter image description here](http://i.stack.imgur.com/9Gnqn.png)               \documentclass[a4paper,12pt,oneside]{article}     \usepackage[english]{babel}     \usepackage{tikz}     \usepackage{pgf}     \usetikzlibrary{shapes,arrows,positioning,calc,threeparttable}      \usepackage{tabu}     \usepackage{hyperref}     \usepackage{longtable}     \usepackage{array}     \usepackage{multirow,tabularx,booktabs}     \begin{document}     \begin{tabular}{|c|c|}     \hline      \bf{Text A:} & \bf{Text B:} \\      \hline      "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." & "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." \\      \hline      \end{tabular}      \end{document}      Can someone help me?


title: Colored Text in PostScript Files

text: I am using `\textcolor` command in the body of my TeX file. I need to generate Postscript file. When I go through the `"Option Menu\Configure TeXStudio\Build\PDF chain"`, every thing is fine and I can get the colored text as I have planed in the .tex file. However, when I go through the `"Option Menu\Configure TeXStudio\Build\PS chain"`, I get undefined control sequence error for `\textcolor` command. It seems `\textcolor` command is unknown when I am trying to generate PS output. Is there anyway so I can fix the problem? Perhaps, using an alternative command to change the text color or an alternative way to generate PS file?


title: Labeling diagonal arrows with the diagrams package

text: As far as I can tell, the following code               \usepackage[balance,small]{diagrams}          ...          \begin{diagram}     && X && \\     & \ldTo^\Phi & & \rdTo^\Psi &\\     Y &&&& Z     \end{diagram}      should produce a diagram with diagonal arrows and labels which are horizontal (i.e. not slanted with the arrows), at least that's what happens in Milne's documentation (http://www.jmilne.org/not/Mdiagrams.pdf). However my labels (Phi and Psi) are slanted along the arrow. How do I make it so the labels are horizontal?


title: Overlay an Entire Slide with a Semitransparent Rectangle in Beamer

text: Using tikz to overlay an entire slide with a semitransparent rectangle is a nice gimmick in presentations. There is only one drawback: If the theme that has a footer, the footer is not covered by the rectangle which looks kinda ulgy as you can see here: ![enter image description here](http://i.stack.imgur.com/rEpac.png) Using a theme without a footer is obviously a workaround, but it would be even nicer if the rectangle would cover the whole slide. Any ideas how this could be done? Here is the code:               \documentclass{beamer}     \usepackage{tikz}     \usetheme{Copenhagen}          \newcommand<>{\overlay}[1]{\uncover#2{%       \begin{tikzpicture}[remember picture,overlay]%       \draw[fill=black,opacity=0.70]        (current page.north east) rectangle (current page.south west);       \node at (current page.center) {#1};       \end{tikzpicture}}     }          \begin{document}     \section{Beamer}       \begin{frame}{Beamer}        Some text       \overlay<2>{        \huge \textcolor{white}{          \begin{minipage}{.8\linewidth}              \begin{block}{Really Important}            Some thing one should always KEEP in mind.            \end{block}          \end{minipage}         }        }       \end{frame}     \end{document}


title: Classes for LaTeX documentation

text: I wonder which classes are available to typeset LaTeX manuals. Until now I have used `ltxdoc`. I’m satisfied with its functions but not with its layout/design and it’s not really flexible when writing in a language other than English (see Class/package for German documentation). Furthermore the `{verbatim}` environment puts to much space after it. Are there any other classes that can take the place of `ltxdoc` without causing too much work in adapting my existing `.dtx` files? Is there a class that uses `listings.sty` instead of pure `{verbatim}`, to get syntax highlighting? I tried               \let\verbatim\relax     \let\endverbatim\relax     \lstnewenvironment{verbatim}{}{}      but this won’t work with a DocStrip input like               % Describing text for the following code     %    \begin{macrocode}     \newcommand{\foo}{FOO}     \newcommand{\bar}{BAR}     %    \end{macrocode}     % Some more text.


title: section format and style

text: When I write a tutorial for my students, it is always plane and simple by using the predefined section style of the `article` class. I looked at some other posts and saw that the code below changes the font style of the section to small caps.                \documentclass[letterpaper]{article}      \usepackage{lipsum}      \makeatletter      \renewcommand{\section}{\@startsection {section}{1}{0pt}%      {-3.5ex plus -1ex minus -.2ex}%      {2.3ex plus .2ex}%      {\normalfont\Large\scshape}}      \makeatother      \begin{document}      \section{test}      \lipsum[1-3]      \end{document}      But then I see in some of the textbooks my students use the following image: ![enter image description here](http://i.stack.imgur.com/nPHZU.png) I was wondering if you can assist me in understanding the process of editing the section style.


title: About xymtx-ps.sty file

text: At the time I’m learning how to use XyMTeX services, it offers to graphic chemical structures with a nice. I knew about `\usepackage{xymtex}`, however, this is not enough clear to perform some structures, some of them look rough at the end. I knew I could use `\usepackage{xymtexps}` but I don’t get satisfactory results. It simple does not compile. I have this:               \documentclass{article}     %\usepackage{xymtex}%XyMTeX plain     %\usepackage{xymtexpdf}%XyMTeX for PDF ... dvipdfmx ... .pdf     \usepackage{xymtexps}%XyMTeX for PostScript ...     \usepackage{txfonts}%Times Roman     \pagestyle{empty}     \begin{document}     \begin{center}     \let\substfontsize=\small%changing font size     \bzdrh{2==\ethylene{1==C;2==C}{1==H;2==H;3==(yl);4==H}}     \end{center}     \end{document}      I get `File 'xymtx-ps.sty' not found. \endinput` and it does not work. Please some help. I have that file on my Desktop but I don’t know what to do with it. Thanks in advance.


title: Need help making a data table from \plot function in Tikz

text: I want to be able to generate a list of points from a plot in Tikz, with an adjustable interval and range for the x-values. So basically something like this:               ++++++++++++++     +            +     +     ^      +     +    / \     +     +   /   \    +     +  /     \   +     ++++++++++++++           X | Y      -------     -3 | 1      -2 | 2      -1 | 3      0  | 4      1  | 3      2  | 2      2  | 1       Here is a minimal working example:               \documentclass{article}     \usepackage{xcolor}     \usepackage{float}     \definecolor{abmorange}{HTML}{F7D700}     \definecolor{abmred}{HTML}{EB5448}     \definecolor{abmblue}{HTML}{2C90C6}     \definecolor{abmgreen}{HTML}{9DAB6F}     \definecolor{abmcream}{HTML}{FEFEDD}     \definecolor{abmyellow}{HTML}{EEEE00}     \usepackage{caption}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.4}           \tikzset{       dim above/.style={to path={\pgfextra{             \pgfinterruptpath             \draw[>=latex,|<->|,black!50] let             \p1=($(\tikztostart)!2mm!90:(\tikztotarget)$),             \p2=($(\tikztotarget)!2mm!-90:(\tikztostart)$)             in(\p1) -- (\p2) node[fill=black!5,pos=.5,sloped,above,font=\sffamily]{#1};             \endpgfinterruptpath           }         }       },       dim below/.style={to path={\pgfextra{             \pgfinterruptpath             \draw[>=latex,|<->|,black!50] let              \p1=($(\tikztostart)!2mm!90:(\tikztotarget)$),             \p2=($(\tikztotarget)!2mm!-90:(\tikztostart)$)             in (\p1) -- (\p2) node[pos=.5,sloped,below,font=\sffamily]{#1};             \endpgfinterruptpath           }         }       },     }          \newenvironment{plots}[2][10]{     \begin{figure}\centering     \caption{#2}     \begin{tikzpicture}     \begin{axis}[axis x line= middle, axis y line= middle, width=\textwidth, samples=50,grid=both, domain=-10:10, xmin=-#1, xmax=#1, ymin=-#1, ymax=#1, ultra thick, scale only axis, enlargelimits=false, anchor=origin, disabledatascaling]     }{     \end{axis}     \end{tikzpicture}     \end{figure}     }          \newcommand{\func}[2][abmblue]{\addplot[color=#1] {#2};}          \newcommand{\parfunc}[3][abmblue]{\addplot[color=#1,domain=-200:200] ({#2},{#3});}     \begin{document}     \begin{plots}{Parametric Function of a Hyperbola}     \parfunc{2+4/cos(x)}{-3+3*tan(x)}     \end{plots}     \end{document}      An additional note: I have figured out how to do a table using \foreach:               \pgfkeys{/pgf/number format/.cd,fixed,fixed zerofill,precision=3}      \makeatletter      \let\globalappendtomacro=\pgfutil@g@addto@macro      \makeatother      \def\something{}     \foreach \i in {0,\the\numexpr2\relax,...,20}{     \pgfmathparse{cos(\i)}     \edef\temp{\i & \pgfmathresult\noexpand\\}      \expandafter\globalappendtomacro\expandafter\something\expandafter{\temp}     }           \begin{tabular}{rr}      \something     \end{tabular}      However, I have no clue how I would insert a parametric function into the \pgfmathparse{} command.


title: Tikz aligning matrix cells in different nodes

text: How can I overlap matrix cells in tikz relatively (using `m-2-2` instead of specifying the coordinates)? ![manual alignment](http://i.stack.imgur.com/iV2Nu.png) This is the code I have for manual alignment:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{matrix}     \begin{document}          \begin{tikzpicture}              \node(m) at (0,0) [matrix,matrix of nodes,ampersand replacement=\&] {1 \& 2\\3 \& abc\\};         \node(n) at (12pt,-13pt) [matrix,matrix of nodes,ampersand replacement=\&] {5 \& 6\\7 \& 8\\};               \end{tikzpicture}          \end{document}      I tried some combos of below/above/anchors which didn't really work.


title: LaTeX Arial Narrow font

text: I would like to use Arial Narrow font in LaTeX. But I cannot find the package used to do it.


title: Setting a New Command (or is it an Environment?)

text: Here's a small example of what I have to use. I have to reset the length everytime I use `\marginnote` because it restarts indenting and reformats the skip to 0.               \marginnote{\normalsize Some text goes here}     \setlength{\parindent}{0in}     \setlength{\parskip}{0.15in}      What I would like to be able to do is redefine this behaviour so I don't have to type so much junk (and keep my tex/Sweave document cleaner)               \somecommand Some text goes here       Is there a way to get it to do so?


title: pdfpages package and layoutsize (geometry package)

text: I tried to include a PDF page using the `pdfpages` package -- this works well for a standard case, f.e. (`t.pdf` is the first page of the PGF manual):               \documentclass{scrartcl}     \usepackage{geometry}     \geometry{papersize={155mm,220mm}}     \usepackage{pdfpages}     \usepackage{lipsum}          \begin{document}     \lipsum[1-2]     \includepdf{t.pdf}     \end{document}      This code produces the following output: ![Output of the first MWE](http://i.stack.imgur.com/9i7UU.jpg). In my case, my printer needs an additional trimming edge, since I use full- page images. For all other publications (there was no need to include other PDF files) I used the very comfortable option `layoutsize` in combination with `papersize` of the `geometry` package. Unfortunately, if I use this option, the `pdfpages` package does ignore it (exaggerated by intention):               \documentclass{scrartcl}     \usepackage{geometry}     \geometry{papersize={200mm,300mm}, layoutsize={155mm,220mm}}     \usepackage{pdfpages}     \usepackage{lipsum}          \begin{document}     \lipsum[1-2]     \includepdf{t.pdf}     \end{document}      This produces the following output: ![Output of the second MWE](http://i.stack.imgur.com/dPEVn.jpg) As you can see, the layout of the text content is untouched, but the included PDF is scaled to the paper size, not to the layout size. Is there a possibility to include a PDF file while respecting the layout size given by the `geometry` package? Thank you for your help in advance. **Edit:** I have forgotten to take the `layoutoffset` option of the `geometry` package into account in my question. A solution should not only respect the given layout size, but also its offset specification.               \documentclass{scrartcl}     \usepackage{geometry}     \geometry{papersize={200mm,300mm}, layoutsize={155mm,220mm}, layoutoffset={10mm,5mm}}     \usepackage{pdfpages}     \usepackage{lipsum}          \begin{document}     \lipsum[1-2]     \includepdf{t.pdf}     \end{document}


title: Citation style ‘author’ with optional year or index part for disambiguation only

text: With `authoryear.cbx` citation style – `\textcite` “Author (2012)” or `\parencite` “(Author 2012)” – you’ll usually get lowercase letter suffixes if there are multiple entries by the same author(s) from a single year: “Author (2013b)”. Otherwise the (mandatory) year part disambiguates multiple entries by the same author(s) and serves to show that there is a citation (with accompanying bibliography entry) at all. Page numbers and the like may be appended to the year with a colon prefix: “Author (2012:123)” / “(Author 2012:123)”. That’s a very useful style if one cites authors who wrote several texts relevant to your work. In some cases, though, the bibliography hardly contains multiple entries for authors, i.e. the year becomes redundant. A simple `author` citation style would suffice then – “Author” or “(Author)” –, although `\textcite` (and perhaps `\autocite`) should probably use some font styling, e.g. small caps or italics “ _Author_ ”, to emphasize that the name is to be treated as a citation and does not just appear arbitrarily. There can, of course, still arise the need for disambiguation. This could be done by adding the (possibly shortened) year – “ _Author14_ ” / “ _Author_ ’14” / “ _Author2014_ ” / “ _Author_ 2014” / “ _Author_ (2014)” – or by an alphabetic or numeric index: “ _AuthorA_ ” / “ _Author a_ ” / “ _Author (a)_ ” / “ _Author_ a” // “ _Author1_ ” / “ _Author_ 1” / “ _Author_ 1”. I tend to prefer superscript letters that cannot be mistaken for footnote marks. Is there an `author.cbx` that I overlooked which accomplishes just that? Would you derive such a style from `authoryear.cbx` or from something else? What additional code is necessary?               \documentclass{scrartcl}     \usepackage[style=authoryear]{biblatex}     \begin{filecontents}{\jobname.bib}     @book{foo12, Author={A. Uthor}, Title={Some Title}, Year={2012}, Publisher={Standard Press}, Address={Global}}     @book{foo13a, Author={A. Uthor}, Title={Another Title}, Year={2013}, Publisher={Standard Press}, Address={Global}}     @book{foo13b, Author={A. Uthor}, Title={Boring Title}, Year={2013}, Publisher={Standard Press}, Address={Global}}     @book{foos10, Author={A. Uthor and A. Uteur}, Title={International Title}, Year={2010}, Publisher={Standard Press}, Address={Global}}     @book{foos11, Author={A. Uthor and C. Utor}, Title={Collaboration Title}, Year={2011}, Publisher={Standard Press}, Address={Global}}     @book{foos12, Author={A. Uteur and B. Uteur}, Title={Foreign Title}, Year={2012}, Publisher={Standard Press}, Address={Global}}     @book{bar14, Author={B. Uteur}, Title={Interesting Title}, Year={2014}, Publisher={Standard Press}, Address={Global}}     @book{baz14, Author={A. Uteur}, Title={New Title}, Year={2014}, Publisher={Standard Press}, Address={Global}}     \end{filecontents}     \addbibresource{\jobname.bib}     \renewcommand*{\mkbibnamelast}[1]{\textsc{#1}} % smallcaps for last names     \begin{document}     Let’s cite some book \autocite{foo12} or a particular page therein \autocite[123]{foo12}.          Its author also published two works during the following year \autocite{foo13a,foo13b}.          Our friend did two collaborations \autocite{foos10,foos11},     but others worked together as well \autocite{foos12}.          Those two authors with same last name are also cited individually \autocite{bar14,baz14}.     \printbibliography     \end{document}      PS: I don’t like it when author-year citation styles are combined with a bibliography style where the authors come first, but the year comes (almost) last. I also dislike inconsistent name lists like “Uthor, A. and A. Uteur”, but that’s another story.


title: Choose citation style when using child documents

text: I am writing my thesis in Lyx, and have used the "thesis" template with have several child documents. My referencing style is "elsarticle-harv". My problem is that I can not choose the citation style when writing in the child documents. They all appear like this: Name (year). I want to able to choose where the parentheses show up, e.g: If I write a statement from a book, I want the reference to show up in parentheses in the end (Name, year). Or if I writhe "according to Name (year) the blabla..." When inserting citation in the child document my only option for citation style is [#ID]. Can someone help me with this?


title: LyX / LyZ / Zotero Refer to remote BibTex file located on dropbox folder

text: Does anyone know if there is any way of using `\addbibresource` pointing to remote files located on a Dropbox server and refered to by the unique Dropbox location link like:               \addbibresource[location=remote,type=file]{https://www.dropbox.com/s/h1x0l95hbcypij/TestBibliography.bib?dl=1}      So far for me it does not work.


title: Bad table references with \input{...}

text: I have been searching a bit, but couldn't find the proper answer to my problem. I have multiple tables defined for a report. Let's say some tables are presented in the main content of the report and for further clarity, are also defined in the appendix. Since they are subject to last minute modification, I didn't want to create twice the same tables, so I inserted them with the `\input` command. The problem is that when I call `\ref`, it is the reference of the table in the appendix that is given (ie: A.3 not 1.5). How could I manage this? Table definition:               \begin{table}[htbp]         \centering         \begin{tabular}{ccc} \hline         \multicolumn{3}{c}{value test}\\ \hline         Model & \multicolumn{2}{c}{3D} \\         $S$ & 102.60 & 66.90 \\         $S^{macro}$ & $93.43$ & $63.90$\\         Relative scatter (\%) & $-8.94$ & $-4.48$\\         \hline         \end{tabular}         \caption{$S_{12}$ analysis}         \label{tab:S12_analysis}         \end{table}      In the document for example               \begin{document}[report]          Table \ref{tab:S12_analysis}     \input{my_table.tex}          \appendix     Table \ref{tab:S12_analysis}      \input{my_table.tex}          \end{document}


title: Is there an "identity" (or "no-op") environment that simply uses its contents unaltered?

text: In the functional programming paradigm, it is common to have functions accept other functions as parameters. This paradigm can be followed in LaTeX, too: A macro can accept parameters which themselves can be macros or environment names. For this use case, the equivalent of an "identity function" is missing in LaTeX: A macro and an environment that behaves as if it wasn't there. Basically, I am looking for something along these lines:               \documentclass{article}     \begin{document}          \newenvironment{identity}{}{}     \begin{identity}       This will be parsed as if not surrounded by anything.     \end{identity}     \end{document}      I'm reluctant to define this environment if something similar already exists in standard LaTeX or in any "standard" package. How is "identity" called in LaTeX?


title: TikZ - move calculated point to origin

text: i am trying to draw a point relative to a rectangle and than shift the whole rectangle so that this point is aligned with another point.               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}     \begin{tikzpicture}         \coordinate (origin) at (0,0);         \fill (origin) circle (2pt);         \path (-1.5,-1.5) -- (1.5,1.5);         \begin{scope}             \draw (-1,-1) coordinate (rect_lower_left)                          rectangle (1,1)                         coordinate (rect_top_right);             \coordinate (rect_top_left) at (rect_lower_left |- rect_top_right);             \fill[red] (rect_top_left) circle (2pt);             \fill[blue] (rect_lower_left) circle (2pt);             \coordinate (ref_point) at ($(rect_top_left)!0.3!(rect_lower_left)$);             \fill[green] (ref_point) circle (2pt);         \end{scope}     \end{tikzpicture}     \end{document}      ![Result Picture](http://i.stack.imgur.com/wtztc.jpg) The result is shown in the picture above. I want the green point to be on the same hight as the black one. Of course I could shift the black one easily, but in the actual problem the black one is a point calculated in reference to points of the rest of the picture. This picture shows the desired result. ![enter image description here](http://i.stack.imgur.com/xjYh3.png) So my idea was to add a shifting operation to the scope. But of course I cannot use a point that is added within the scope. Another approach would be defining a new shape with anchor points. But this seems to be a bit extreme. Maybe you have a complete other approach for me. I am drawing a circuit with cicuitikz. But now I need an IC (integrated circuit) with 8 ports. And of course I would like to have the IC aligned with the rest of the circuit to get straight lines. Is there another way of achieving this? edit: with the right search terms I found: Circuitikz - IC circuit with relative coordinates Thanks for your help in advance, Gunter


title: How to prevent a series of tikz nodes from overlapping?

text: I have the following MWE for the `note` command I'm working on.               \documentclass{article}     \usepackage[a5paper,marginparwidth=15mm]{geometry}     \usepackage{tikzpagenodes}     \usetikzlibrary{calc}     \newcommand\note[2][0pt]{       \tikz[overlay,remember picture,baseline=-1ex] \coordinate (e);       \begin{tikzpicture}[remember picture, overlay]       \path let \p1 = (e), \p2 = (current page marginpar area.west) in node[yshift=-#1,text width=\marginparwidth,align=left,anchor=north west,inner ysep=0pt,inner xsep=0pt,font=\normalfont\tiny\color{red}] at (\x2,\y1) {#2};       \end{tikzpicture}     }     \usepackage{everypage}     \AddEverypageHook{         \tikz[remember picture,overlay] {\draw [blue] (current page text area.south west) rectangle (current page text area.north east);}         \tikz[remember picture,overlay] {\draw [green] (current page marginpar area.south west) rectangle (current page marginpar area.north east);}     }     \begin{document}     \section{\note{Note A}A Test Section}     Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.     Donec \note{Note B - pretty long one} vehicula augue eu neque. Pellentesque habitant morbi tristique senectus     et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra     metus rhoncus sem. \note{Note C} Nulla et lectus vestibulum urna fringilla \note{Note D} ultrices. Phasellus     eu tellus sit \note{Note E} amet tortor gravida placerat. Integer sapien est, iaculis in, pretium     quis, viverra ac, nunc.tus a mi. Morbi ac orci et nisl hendrerit mollis.     \end{document}      I would like the `Note E` to be shifted below `Note D`. Currently I could do that manually by precising `yshift`, but I think it can be easily done without the need of hand-tuning. I could think of an algorithm   1. Save bottom of the note position   2. When placing next note check if top position is less than previous bottom   3. Calculate required `yshift` However as a beginner I have no idea how to implement that behavior in `tikz`. Any help appreciated `:)` **Update** There is also a secondary question here - if I try to remove the optional argument (just to make it `\newcommand\note[1]{`) I end up with the error               ! Use of \use@tikzlibrary doesn't match its definition.     \pgfutil@ifnextchar ...1\def \pgfutil@reserved@a { #2}\def \pgfutil@reserved@...     l.20 \section{\note{Note A}A Test Section}      Of course I remember about changing references. What's going on? **Test code** To show what happens with `align` and `tabu`               \documentclass{article}     \usepackage[a5paper,marginparwidth=15mm]{geometry}     \usepackage{tikzpagenodes}     \tikzset{       marginpar node/.style={         text width=\marginparwidth,         align=left,         inner sep=+0pt,         font=\normalfont\tiny,         text=red}}     \makeatletter     \def\tikz@marginpar@node@page{-1}%     \protected\def\note#1{%       \tikzpicture[remember picture, overlay]         \pgfutil@ifundefined{pgf@sh@ns@tikz@marginpar@node}{%           \coordinate (@tikz@marginpar@node@c)at (0pt, 1ex-|current page marginpar area.west);         }{%           \ifnum\tikz@marginpar@node@page=\c@page\relax             \pgfpointdiff{\pgfpointanchor{tikz@marginpar@node}{south west}}                          {\pgfpoint{+0pt}{+1ex}}             \ifdim\pgf@y<-3pt\relax               \coordinate (@tikz@marginpar@node@c)                 at (0pt,1ex-|current page marginpar area.west);             \else               \coordinate (@tikz@marginpar@node@c)                 at ([yshift=-3pt]tikz@marginpar@node.south west);             \fi           \else             \coordinate (@tikz@marginpar@node@c)                 at (0pt,1ex-|current page marginpar area.west);           \fi         }         \node [marginpar node/.try, anchor=north west, alias=tikz@marginpar@node]                 at (@tikz@marginpar@node@c) {\setlength\baselineskip{0pt}#1};         \xdef\tikz@marginpar@node@page{\the\c@page}%       \endtikzpicture}     \makeatother     \usepackage{everypage}     \AddEverypageHook{%       \tikz[remember picture,overlay]{         \draw[blue]  (current page text area.south west) rectangle                         (current page text area.north east);         \draw[green] (current page marginpar area.south west) rectangle                         (current page marginpar area.north east);}%     }     \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhf{}     \fancyhf[HL]{\def\note##1{}\leftmark}     \renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}}     \usepackage{tabu}     \usepackage{multicol}     \usepackage{amsmath}     \begin{document}     {\def\note#1{}\tableofcontents}          \section{\note{Note A}A Test Section}     Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.     Donec \note{Note B - pretty long one} vehicula augue eu neque.     Pellentesque habitant morbi tristique senectus     et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra     metus rhoncus sem. \note{Note C} Nulla et lectus vestibulum urna fringilla     \note{Note D} ultrices. Phasellus eu tellus sit \note{Note E} amet tortor     gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac,     nunc.tus a mi. Morbi ac orci et nisl hendrerit mollis.          \newpage     \section{\note{Note A}A Test Section}     Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.     Donec \note{Note B - pretty long one} vehicula augue eu neque.     Pellentesque habitant morbi tristique senectus     et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra     metus rhoncus sem. \note{Note C} Nulla et lectus vestibulum urna fringilla     \note{Note D} ultrices. Phasellus eu tellus sit \note{Note E} amet tortor     gravida placerat. \note{Note F} Integer sapien est, iaculis in, pretium quis,      viverra ac, nunc.tus a mi. Morbi ac orci et nisl hendrerit mollis.          \newpage     Morbi dolor\note{More testing} nulla, malesuada eu, pulvinar at, mollis ac, nulla.      Cur-abitur auctor semper nulla. Donec varius orci eget risus.      \begin{center}     Duis nibh mi, congue \note{center}     eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim     rutrum.     \end{center}     \begin{displaymath}     a+b+c =\note{display math} d+e+f     \end{displaymath}     Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi     auctor lorem non justo. Nam lacus libero, pretium at, \note{Test} lobortis vitae,      ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula      aliquet magna, vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis.     \begin{multicols}{2}     Erat ligula aliquet magna,     vitae ornare odio metus a mi. Morbi nisl \note{Something is wrong here} mollis.      Donec aliquet, tortor sed accumsan bibendum. Suspendisse     ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et     magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna.      Nulla ullamcorper vestibulum turpis. Nulla ullamcorper      $f(x)=\note{This requires special attention}f(-x)$ vestibulum turpis.      Pellentesque cursus luctus mauris.     \end{multicols}          Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi     auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae,      ultricies et, tellus.          \begin{center}     \begin{tabular}{|c|c|c|c|c|}     \hline     Strop&Spag&H&Symbol&Nazwa\\\hline     0&4.05&\note{Table comment?}4.05&$Ps$&Piasek sredni\\\hline     4.05&5.30&1.25&$T$&Torf\\\hline     5.30&7.60&2.30&$Gz$&Glina zwiezla\\\hline     7.60&$\infty$&$\infty$&$P \pi$&Piasek pylasty\\\hline     \end{tabular}     \end{center}          \newpage     Morbi dolor\note{More testing} nulla, malesuada eu, pulvinar at, mollis ac, nulla.      Cur-abitur auctor semper nulla. Donec varius orci eget risus.      \begin{center}     Duis nibh mi, congue \note{center}     eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim     rutrum.     \end{center}     \begin{align}     a+b+c &= d+e+f \\     &\note{Rly equal?}= g +h \\     &= i.     \end{align}     Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi     auctor lorem non justo. Nam lacus libero, pretium at, \note{Test}      lobortis vitae, ultricies et,     tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna,     vitae ornare odio metus a mi. Morbi ac orci et nisl hendrerit mollis.     \begin{multicols}{2}     Erat ligula aliquet magna, vitae ornare odio      metus a mi. Morbi ac orci et nisl \note{Something is wrong here} mollis.      Donec aliquet, tortor sed accumsan bibendum. Suspendisse     ut massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque penatibus et     magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna.      Nulla ullamcorper vestibulum turpis. Nulla ullamcorper      $f(x)=\note{This requires special attention}f(-x)$ vestibulum turpis.      Pellentesque cursus luctus mauris.     \end{multicols}          Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi     auctor lorem non justo. Nam lacus libero, pretium at, lobortis vitae,      ultricies et, tellus.          \begin{center}     \begin{tabu}{|c|c|c|c|c|}     \hline     Strop&Spag&H&Symbol&Nazwa\\\hline     0&4.05&\note{Table comment?}4.05&$Ps$&Piasek sredni\\\hline     4.05&5.30&1.25&$T$&Torf\\\hline     5.30&7.60&2.30&$Gz$&Glina zwiezla\\\hline     7.60&$\infty$&$\infty$&$P \pi$&Piasek pylasty\\\hline     \end{tabu}     \end{center}          \newpage     Restart?\note{restart}          \end{document}


title: Better alignment for enumitem list

text: In the following screenshot, the alignment of the 2nd `A)` and the space between the label of the 2nd list and the fraction have been obtained empirically n: see `\hspace*{1.375em}` and `label*={\Alph*)\,\,}`. You can see some shifts in the following screenshot. **My method is not good.** I would like to use one better approach based on the settings of the standard vertical list. ![enter image description here](http://i.stack.imgur.com/ZnT41.png)               \documentclass{article}         \usepackage[utf8]{inputenc}         \usepackage{amsmath}         \usepackage[inline]{enumitem}         \usepackage{parskip}              \makeatletter             \newlist{@inlinechoices}{enumerate*}{1}             \setlist[@inlinechoices]{label*={\Alph*)\,\,},itemjoin={\qquad},labelindent=5em}             \newenvironment{inlinechoices}{\hspace*{1.375em}\begin{@inlinechoices}}{\end{@inlinechoices}}         \makeatother              \newlist{choices}{enumerate}{1}         \setlist[choices]{label*={\Alph*)},leftmargin=3em}         \newcommand{\choice}{\item}          \begin{document}          \begin{enumerate}         \item Which fractions are reduced ?              \begin{choices}             \choice $\dfrac{4}{7}$         \end{choices}              \item Which fractions are reduced ?              \begin{inlinechoices}             \choice $\dfrac{4}{7}$         \end{inlinechoices}     \end{enumerate}          \end{document}


title: Diagonal dots spanning multiple lines/columns of a matrix

text: I'm filling in large sparse matrices, for example               \begin{bmatrix}     0  & -2     & 1      &        & -1     & 2  \\     2  & \ddots & \ddots & \ddots &        & -1 \\     -1 & \ddots & \ddots & \ddots & \ddots &    \\        & \ddots & \ddots & \ddots & \ddots & 1  \\     1  &        & \ddots & \ddots & \ddots & -2 \\     -2 & 1      &        & -1     & 2      & 0     \end{bmatrix}      ![enter image description here](http://i.stack.imgur.com/gKDjX.png) I do not like the way the dots are spaced. I would like them to be equally spaced across the diagonals. I guess this can be done using TikZ but is there an easier way?


title: Right-centered columns in LyX

text: This is very near to my topic: How to align integers on the right, but still center them. However, I do not get it to work under LyX. This is the code I have:               \begin{table}[H]     \centering     \begin{threeparttable}\caption{\textbf{\label{tab:uebersicht-alle-mspatienten}Untersuchungsergebnisse der soziodemographischen und neurologischen Parameter aller untersuchten MS-Patienten} }     \begin{tabular}{>{\raggedright}p{0.35\columnwidth}>{\centering}p{0.1\columnwidth}>{\centering}p{0.1\columnwidth}>{\centering}p{0.1\columnwidth}>{\centering}p{0.1\columnwidth}}     \toprule       & \textbf{Anzahl (n)} & \textbf{Prozent} & \textbf{Mittelwert} & \textbf{SD}\tabularnewline     \midrule     \midrule      \textbf{Patienten} & 180 &  &  & \tabularnewline     \midrule      \textbf{Alter} (in Jahren) &  &  & 43,9 & 13,1\tabularnewline     \midrule      \textbf{Geschlecht:}     - Weiblich     - Männlich & ~     125     55 & ~     69,4     30,6 &  & \tabularnewline     \midrule      \textbf{Erkrankungsdauer der MS}     (in Jahren) &  &  & 12,3 & 8,8\tabularnewline     \midrule      \textbf{Verlaufsform:}     - RRMS     - SCP     - PPMS     - CIS & ~     86     67     24     3 & ~     47,8     37,2     13,3     1,7  &  & \tabularnewline     \midrule      \end{tabular}     \end{threeparttable}     \end{table}      It produces the following (correct) output: ![](http://i.stack.imgur.com/h4PDK.png) However, if I change the first line to:               \begin{tabular}{>{\raggedright}p{0.35\columnwidth}S[table-format=3.0]>{\centering}p{0.1\columnwidth}>{\centering}p{0.1\columnwidth}>{\centering}p{0.1\columnwidth}}      it gives the following (incorrect) output: ![](http://i.stack.imgur.com/xnuUo.png) My version of `siunitx` is `2.2i (2011/06/15)` from TeX Live 2011.


title: Custom switches (such as for underlining)

text: Some packages (ntheorem for example) take only text switches as arguments that can be used in the form `{\switch text}`, for example `\bfseries`. If I now want to have a suitable command for underlining, the `\underline` command does not work, as it requires the argument explicitly using parentheses. To make this clearer, I would like to convert something like               \underline{lorem ipsum}      to the form               {\ulswitch lorem ipsum}


title: Create a new integral symbol

text: Is it possible without creating a new font to define a new math symbol (e.g. with `\newcommand`) and then use it with such commands as `\limits`, `_` and `^` (up and down limits)? For example, I define it like this:               \usepackage{graphicx}     \newcommand{\bigrint}{\scalebox{1.2}[1] {\rotatebox[origin=c]{15}{$\displaystyle\int$}}}     \newcommand{\rint}[2]{ \substack{\hspace{-4pt} #2 \\ \hspace{-5pt} \bigrint \hspace{-3pt}\\ #1}\hspace{-1pt} }      And I want to use it like `\rint_1^2`.


title: How can I typeset parallel lists of paragraphs on facing pages?

text: (Not a duplicate of this question.) I'm trying to typeset a document for my father, which contains a list of paragraphs that must be printed aligned on facing pages. Page breaks must ideally not occur within a paragraph (on either page). Also, the text is a non-Latin script so I have to use xelatex. What would be the best way to typeset this? I've tried ledmac/ledpar. It doesn't seem to work with itemize, so for now I've typed paragraph numbers manually. The result is a pair of pages that looks like this (LaTeX source): ![Two pages using ledpar](http://i.stack.imgur.com/pkIpx.png) This is almost ok, except that   * The paragraphs 5 are not aligned for some reason (the one on the right is lower),   * I'm not sure how to prevent page breaks within a paragraph (I tried `samepage` and it didn't work, neither did `parbox`, and using `minipage` gave ledmac errors "The left page has ended on a right page" and "The right page has ended on a left page", which were reflected in the output. Inserting a manual `\pagebreak` also didn't seem to help),   * The "manual" itemize is ugly; at the very least one would like to have nothing below the item numbers. I've also tried the `parallel` package, but it seems to typeset each pair of paragraphs on a separate pair of pages. Is there a better solution, or some way to tweak the above into something better?


title: Reference in chapter's name. How does it look?

text: Have you ever come across to a reference in chapter's name? More precisely, I'm about to use reference to a equation in the name of one appendix - there is no way to describe that particular equation. E.g.               \documentclass{report}      \usepackage{hyperref}     \begin{document}          \chapter{A}     \begin{equation}     B     \label{equa}     \end{equation}          \appendix     \chapter{Explanation of~\ref{equa}}          \end{document}      What do you think about such thing?


title: Package tocloft change font size

text: So I have just started using `tocloft` in LaTeX for my report in order to generate a list of equations. The list works fine and it does what I need it to, but the only issue so far is that the heading 'List of Equations' is in much bigger font than the other headings for 'Contents' , ' List of Figures' etc... How can I change this? Here is the code I have for the list.               \usepackage{tocloft}     \newcommand{\listexamplename}{List of Equations}     \newlistof{example}{exp}{\listexamplename}     \newcommand{\example}[1]{%     \refstepcounter{example}     \par\noindent\text{Equation \theexample. #1}     \addcontentsline{exp}{example}     {\protect\numberline{\thechapter.\theexample}#1}\par}


title: Customizing Table of Contents Formatting

text: For the most part, the default formatting for the ToC, LoF, and LoT is fine. But I need to add an extra line (university's requirements for my thesis) between each numbered entry. In order to do this, I used the titletoc package and added the extra line with the following code:               \titlecontents{table}     [7.25em]     {\contentslabel[\thecontentslabel.]{4em}}     {\hspace*{-4pt}}     {}     {\titlerule*[0.5em]{.}\hspace*{0.0em}\contentspage}[\vspace{1em}]      However, when I do this the first line in the ToC, LoF, or LoT is slightly off. That is, the first line is either a little to the left (negative space) or a little to the right (positive space) of the other following lines in a multi-line caption. I would like the first line to be perfectly flush with the following lines like it was before I used titletoc. I tried adjusting the hspace but it is never just right. Any ideas how I can get around this? WARNING: I cannot use tocloft as it breaks my university's LaTeX template. Thanks in advance.


title: Error message when I try to run pdflatex with movie15 package

text: I am trying to use package movie15 to include videos in my PDF produced by the command `pdflatex`, however all the time I use this command the followed part of massage rises:               (/usr/share/texmf-texlive/tex/latex/fancybox/fancybox.sty     Style option: `fancybox' v1.3 <2000/09/19> (tvz)     ) (./movie15.sty (/usr/share/texmf-texlive/tex/latex/oberdiek/ifdraft.sty)     (/usr/share/texmf-texlive/tex/latex/ms/everyshi.sty)          ! LaTeX Error: Command \hyperlinkmovie already defined.                    Or name \end... illegal, see p.192 of the manual.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.4380 }      How should I proceed to avoid it? Cheers! PS: I have downloaded the file `movie15.sty` and place it in the same directory I run the command `pdflatex mylatexfile`


title: Horizontal chart-style arrows between nodes

text: I have five nodes defined and positioned as following:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning, fit, calc, shapes, arrows}     \renewcommand{\figurename}{Figure}         \begin{figure}[!htb]             \begin{tikzpicture} [title/.style={font=\fontsize{18}{18}\color{black!45}},                 block/.style={rectangle, draw, fill=blue!23, rounded corners, minimum height=4em},                 bloc/.style={rectangle, draw, fill=green!23, rounded corners, minimum height=2em},                 store/.style={cylinder, draw, shape border rotate=90, aspect=0.4, minimum height=1.5cm, minimum width=1.2cm, fill=cyan!23},                 dot/.style={circle, fill=black, minimum size=2pt, inner sep=0pt, outer sep=2pt},                 blob/.style={cloud, draw, cloud puffs=17.8, cloud ignores aspect, minimum width=4cm, minimum height=2.5cm, align=center},                 link/.style={latex-latex, shorten <=8pt, shorten >=1pt}]                 % Place nodes                 \node [title] (backend) at (5.5,10.05) {Sample};                 \node [block, outer sep=5pt, align=center] (server3) at (3.7,6.75) {Component A};                 \node [block, outer sep=5pt, align=center] (server1) at (7.15,9.0) {Component B\\(Blah)};                 \node [block, outer sep=5pt, align=center] (server2) at (7.15,7.45) {Component C\\(Blah)};                 \node [block, outer sep=5pt, align=center] (server4) at (7.15,5.9) {Component D\\(Blah)};                 \node [block, outer sep=5pt, align=center] (server5) at (7.15,4.35) {Component E\\(Blah)};                 \node [draw=black!50, fit={(backend) (server1) (server2) (server3) (server4) (server5)}] (sample) {};             \end{tikzpicture}             \caption{A Test Graph}         \end{figure}     \end{document}      I want to make float-chart-style arrows between `Component A` and the other four nodes, and I want them look like in the answer to this question: Horizontal hierarchy tree in tikz-qtree: bad layout for longer node-names, **but with arrow heads at both ends**. In other words, ignoring other parts, replace `nice-child0` with `Component A`, and `grandchild0-0`-`grandchild0-3` with `Component B`-`Component E` in my example. Is there any way to do this without using the tree packages?


title: Can I define a new unit that behaves like \ang in siunitx?

text: The `siunitx` package provides support for "astronomy style" placement of the degree symbol using the `angle-symbol-over-decimal` switch, and for simple entry of degree-minutes-second values using the form               \ang{6;7;6.5}      Is there a way to used the package's `\DeclareSIUnit` macro to define a corresponding formatting for right ascension so that, for example, one could use something like               \ra[ra-symbol-over-decimal]{5.237}     \ra{5.237}      \ra{5;15;6.5}       to produce (roughly) ![enter image description here](http://i.stack.imgur.com/B6yVM.png) with spacing and other behavior that follows the packages current settings for `\ang`?


title: Tables together

text: I want to put the following table together with a other similar table in two columns               \begin{table}[h]     \centering     {\fontfamily{ptm}\selectfont{     \rowcolors{1}{}{gray!20}     \begin{tabular}{cc}     \rowcolor{LightBlue} \textsf{Plazos} & \textsf{Tasa efectiva anual}\\     \textsf{$30 - 59$ d\'ias} & \textsf{2.00 \%}\\     \textsf{$60 - 90$ d\'ias} & \textsf{2.50 \%}\\     \textsf{$91 - 180$ d\'ias} & \textsf{4.00 \%}\\     \textsf{$181 - 366$ d\'ias} & \textsf{5.00 \%}\\     \textsf{$367 - 546$ d\'ias} & \textsf{6.00 \%}\\     \textsf{$547 - 731$ d\'ias} & \textsf{8.00 \%}\\     \textsf{$732 - 1096$ d\'ias} & \textsf{9.00 \%}\\ \hline     \end{tabular}}}     \caption{Pago de intereses al vencimiento.}     \end{table}      I tried with `multicols` but doesn't work.


title: Double solution in equation mode

text: I Want to do give two solutions to an equation, and do something like that:                                     / 0     If c = 0    =>    x =                           \ -b/a      ![What I want](http://i.stack.imgur.com/o6uHr.png) **Edit** : I've tried the `cases` environment or using `\left\\{ ... \right.`, still a good idea but not exactly what wanted.


title: ctable position in classicthesis with lyx

text: I'm using the classicthesis package with ctable. Normally it works just fine, but I have one file (chapter file) where I placed the following table with ctable:               \ctable[         cap = {Übersicht der Teilstichproben},         caption = {Übersicht der Teilstichproben\newline Quelle: \cite{Wagner:2008kq}},     label = Teilstichprobe,     width = 110mm,     pos   = ht,     center,     ]{cc>{\hsize=1\hsize\raggedright}X}{     \tnote[a]{Genauer: Haushalte, deren Haushaltsvorstand nicht türkischer, italienischer, jugoslawischer. griechischer oder spanischer Nationalität war. Dies waren ganz überwiegend (99\thinspace\%)  deutsche Haushaltsvorstände.}     \tnote[b]{Genauer: Haushalte, deren Haushaltsvorstand türkischer, italienischer, jugoslawischer. griechischer oder spanischer Nationalität war.}     \tnote[c]{Anstaltshaushalte sind nicht repräsentativ eingeschlossen; sie werden zwar auch nicht ausgeschlossen, wenn sie beim random walk gelistet werden und sind insofern in dem Bruttobestand enthalten, werden aber bei der Durchführung der Befragung in der Regel bei neuen Samples nicht berücksichtigt.}     }{         \FL         Stichprobe & Start in & Beschreibung    \NN         \cmidrule(l){1-1}\cmidrule(rl){2-2}\cmidrule(l){3-3}         A & 1984 & (Deutsche) Haushalte\tmark[a] in der Bundesrepublik Deutschland (Hauptstichprobe, $N=4528$ realisierte Haushalte)\NN         B & 1984 & Ausländische Haushalte\tmark[b] in der Bundesrepublik Deutschland ($N=1393$ realisierte Haushalte)\NN         C & 1990 & Privathaushalte in der DDR ($N=2179$ realisierte Haushalte)\NN         D & 1994 & Zuwanderer-Privathaushalte in Deutschland ($N=374$ realisierte Haushalte)\NN         E & 1998 & Haushalte\tmark[c] in Deutschland (Ergänzungsstichprobe, $N=1056$ realisierte Haushalte)\NN         F & 2000 & Haushalte\tmark[c] in Deutschland (Ergänzungsstichprobe, $N=6052$ realisierte Haushalte)\NN         G & 2002 & Hocheinkommens-Privathaushalte in Deutschland (Hocheinkommensstichprobe, $N=1224$ realisierte Haushalte)\NN         H & 2006 & Haushalte\tmark[c] in Deutschland, Ergänzungsstichprobe ($N=1506$ realisierte Haushalte)\LL     }      The problem is that the table is not displayed next to the position in the text, but at the very end. The other tables also got moved to the end. If I just use a small table like this               \ctable[         cap = {Reduktion des Datensatzes},         caption = {Reduktion des Datensatzes durch die Regeln},     label = Reduktion-Data,     width = 98mm,     pos   = ht,     center,     ]{llrrr}{     }{         \FL         Regel &  & Reduktion & Kummuliert & Anzahl\NN         \cmidrule(l){1-5}                          & &       &        & 28329\NN         {HHNR > 0}       & &       &      0 & 28329\NN         {GEBJAHR < 1987} & & -5697 &  -5697 & 22632\NN         {UPNAT == 1}     & & -4576 & -11955 & 16374\NN         $gk_reg_a < 6$   & & -5187 & -17142 & 11187\LL     }      The table appears at the right spot or close to it, depending on the text. The style files and the lyx file can be found on GitHub. Can someone help me please, because whatever I do, I can't figure out the mistake Thanks for your help. * * * **UPDATE** So far I found out, that it has something to do with the first large table. If I shorten the table to:               \ctable[         cap = {Übersicht der Teilstichproben},         caption = {Übersicht der Teilstichproben\newline Quelle: \cite{Wagner:2008kq}},     label = Teilstichprobe,     width = 110mm,     pos   = ht,     center,     ]{cc>{\hsize=1\hsize\raggedright}X}{     \tnote[a]{Genauer: Haushalte, deren Haushaltsvorstand nicht türkischer, italienischer, jugoslawischer. griechischer oder spanischer Nationalität war. Dies waren ganz überwiegend (99\thinspace\%)  deutsche Haushaltsvorstände.}     \tnote[b]{Genauer: Haushalte, deren Haushaltsvorstand türkischer, italienischer, jugoslawischer. griechischer oder spanischer Nationalität war.}     \tnote[c]{Anstaltshaushalte sind nicht repräsentativ eingeschlossen; sie werden zwar auch nicht ausgeschlossen, wenn sie beim random walk gelistet werden und sind insofern in dem Bruttobestand enthalten, werden aber bei der Durchführung der Befragung in der Regel bei neuen Samples nicht berücksichtigt.}     }{         \FL         Stichprobe & Start in & Beschreibung    \NN         \cmidrule(l){1-1}\cmidrule(rl){2-2}\cmidrule(l){3-3}         A & 1984 & (Deutsche) Haushalte\tmark[a] in der Bundesrepublik Deutschland (Hauptstichprobe, $N=4528$ realisierte Haushalte)\NN         B & 1984 & Ausländische Haushalte\tmark[b] in der Bundesrepublik Deutschland ($N=1393$ realisierte Haushalte)\NN         C & 1990 & Privathaushalte in der DDR ($N=2179$ realisierte Haushalte)\NN         D & 1994 & Zuwanderer-Privathaushalte in Deutschland ($N=374$ realisierte Haushalte)\NN         E & 1998 & Haushalte\tmark[c] in Deutschland (Ergänzungsstichprobe, $N=1056$ realisierte Haushalte)\NN         F & 2000 & Haushalte\tmark[c] in Deutschland (Ergänzu ) \NN         $gk_reg_a < 6$   &  -17142 & 11187\LL     }      Than the table appears at the right spot. If I add more characters in the next to last row (F) than this table and all following tables were moved to the document end. Any suggestions?


title: Can't compile XeLaTeX document with biblatex and gb4e together

text: The following document will not compile (using `xelatex`, `biber`) if the package `gb4e` is activated. If you comment out the `gb4e` package it works fine:               \documentclass{article}     \usepackage{fontspec}     \setromanfont{Times New Roman}     % \usepackage{gb4e} % <-- FAILS WITH THIS PACKAGE ACTIVATED          \usepackage[nopar]{lipsum} % for dummy text     \usepackage[american]{babel}     \usepackage[authordate,isbn=false,backend=biber]{biblatex-chicago}            \begin{filecontents}{\jobname.bib}     @book{Saussure1995,         Author = {Ferdinand de Saussure},         Origyear = {1916},         Publisher = {Payot},         Title = {Cours de Linguistique Générale},         Year = {1995}}     \end{filecontents}     \addbibresource{\jobname.bib}          \begin{document}     \section*{Les Présentations}     \lipsum[1] \autocite{Saussure1995}        \printbibliography     \end{document}      Any help would be greatly appreciated.


title: Preserve line breaks/newlines when parsing bib file with biber

text: Since the answer to the original question is "This is not possible", my new question is: How do I write a shell script, in which I can define the original bib file, the fields in which new line characters should be replaced, the string with which they should be replaced and the name of the new bib file? I feel this should be possible using automated expressions. (If this question is not sufficiently tex-related, feel free to close it.) The idea is to run this script before I call latexmk, to still be able to substitute new line characters with the \par command automotically instead of having to do it manually each time the bib file changes (the bib file itself is already created by an automated script). Original Question: In my bibliography, the abstract and annote fields will typically be several paragraphs long. The paragraphs are separated by two newlines I want to print a reading list using biblatex. If I parse the bib file with biber, biber will remove all newlines and render the fields as one long line. This is expected behaviour and apparently has been the same in bibtex. The question is: Is there an automatic way around it? More precisely, is there a way around it short from me manually adding macros instead of newlines into the bib file. Initially, I filed a bug report on the biber development site because I assumed it must be a bug, but Philipp Kime suggested I ask whether there is a known way around it without changing biber.


title: How to make the table caption look smaller

text: I am new to the world of LaTeX and I am trying make my correlation table look nice. My LaTeX code is below:               \documentclass{article}          \usepackage{geometry}                            \geometry{letterpaper}                               \geometry{landscape}                             \usepackage[parfill]{parskip}                 \usepackage{graphicx}                    \usepackage{amssymb}          \begin{document}     \begin{table}     \centering     \caption{ Correlation Table}     \def\x{%     \begin{tabular}{rlllllllllllllllllllllllllll}     %blah blah blah     \end{tabular}     }           \scalebox{0.12}{\x}     \end{document}        The scale box is to reduce the scale, in order to prevent the table from cutting off. I want to change the font size of the caption because otherwise the caption looks huge compared to the table (especially after the rescaling). How can I make my table look nice with the caption?


title: Is it possible to write an arara rule that invokes another arara rule?

text: Is it possible to create an `arara` rule which possibly invokes other `arara` rules? I've managed to write an `arara` rule which conditionally executes a command.               !config     # open rule for arara     # author: AEllett     # requires arara 3.0+     identifier: open     name: PREVIEW     commands:       - <arara>  @{isTrue ( isFile ("./.design/open.pdf.true"),                              "open ".concat(getBasename(file)).concat('".pdf"')                             ""                           )}     arguments: []      what I would like to do is write a similar rule which would conditionally invoke another `arara` rule.


title: Hyperref option clash error because unknown package requires/loads it too

text: I am currently hunting for errors in my template and these two I cannot solve after reading the log and researching:               ! LaTeX Error: Option clash for package hyperref.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.7           The package hyperref has already been loaded with options:       []      I already ruled out   * Bibliography-styles requiring it   * Package not loaded last   * Putting global hyperref options in Documentclass options (even more errors) My current knowledge is that some package/configuration file loads/requires hyperref. Therefore I looked at the log-file. But as a beginner I cannot decipher (a) which package causes the problem and (b) how I can solve/bypass it. Minimal example:               \documentclass[a4paper, 12pt, oneside]{book}          \usepackage{bookmark}     \usepackage[         ocgcolorlinks=false, %sample     ]{hyperref}          \hypersetup{            urlcolor=red, %sample     }          \makeatletter         \if@twoside             \hypersetup{pdfpagelayout=TwoPageLeft, linkcolor=red}             \fi     \makeatother          \begin{document}          This is a test.          \end{document}


title: Smash table footnotes of floatrow

text: I am using the smashcaption redefinition for small images and tables with their caption situated in the margin. It smashes the caption but not additional footnotes. Furthermore, since the caption is smashed the footnotes are overlayed onto the caption. Is it possible to add the footnotes smashed and aligned after the caption? ![enter image description here](http://i.stack.imgur.com/av39f.png) Source:                 \documentclass[twoside]{book}       \usepackage[           letterpaper,           includemp,           headheight=0.5in,            left=1.25in,           width=6.75in,           marginparsep=0.25in,           marginparwidth=2in,           bottom=1in,           top=1in]           {geometry}            \usepackage{blindtext}       \usepackage{floatrow}            \DeclareFloatSeparators{marginparsep}{\hskip\marginparsep}            \usepackage{booktabs}       \usepackage{caption}       \usepackage{hyperref}            \makeatletter       \newcommand*\smashcaption{%               \def\FR@makecaption##1##2{%                       \vbox to\z@{%                               \vss                               \captionfont                               {\captionlabelfont##1}\caption@lsep##2%                               \par                               \vss                       }%               }%               \caption       }       \makeatother       \begin{document}            \blindtext[1]            \thisfloatsetup{%       floatwidth=\linewidth,       capposition=beside,       capbesideposition={bottom,outside},       facing=yes,       justification=raggedleft,       margins=hangoutside,       capbesidewidth=\marginparwidth,       capbesidesep=marginparsep       }       \begin{table}[h]       %\ra{1.2}       {\small       \begin{tabular}{@{}ll@{}}       \toprule       Library & Purpose  \\       \midrule       aa &  AAA\tabularnewline        bb\footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}}       \footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}}       \footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}}       \footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}}\footnote{\url{http://www.abc.com}} &  BBB\tabularnewline        cc &  CCC \tabularnewline        dd &  DDD \tabularnewline        \bottomrule       \end{tabular}}       \captionsetup[table]{font={footnotesize,sf},margin=0pt}       \smashcaption{Some elaborate description about this awesome table.       Some elaborate description about this awesome table.       Some elaborate description about this awesome table.       Some elaborate description about this awesome table.       Some elaborate description about this awesome table.}       \end{table}            \blindtext[1]       \end{document}


title: How can one validate a bib file?

text: How do you validate the correctness of your BiBTeX files? By validate I mean mainly:   * Duplicated keys, and maybe also duplicated entries   * Make sure that all the mandatory fields of each entry (depending on its type) are filled.   * Make sure that it doesn't contain any bad TeX in it. For example, having something like `\emphh{foo bar}` in a `note` field. I found this site which seems to take care of the first item above. `AUCTeX/RefTeX` provides `bibtex-validate-globally` which seems to test for duplications of key (and strings?) What other tools do you have/use? I am particularly interested in tools that check a given `.bib` file. As mentioned in the comments - it seems like _reference managers_ can provide a solution as well. I mainly consider `BibTeX` and `BibLaTeX` as management tool.


title: Align pictures in text

text: I have some code for a picture that looks like this:               ...Text before pic...          \begin{figure}[h!]       \caption{caption stuff}       \centering       \includegraphics{somegraph.png}     \end{figure}          ... Text after pic...\\          \part{New Part}      However, LaTeX seems to be doing some weird positioning stuff, since what happens is this:               ...Text before pic...          ... Text after pic...          pic          New Part      Whereas what I want is this               ...Text before pic...          pic          ... Text after pic...          New Part      I can achieve what I want with only a `\includegraphics{somegraph.png}`, but I would like the captioning too, and the ability of LaTeX to automatically number figures for me. I tried isolating the problem, but the figure just keeps jumping around and eventually lands in the right place. `h!` worked before for a previous figure, but no longer... What should I be doing here?


title: poor font quality when exporting to pdf

text: I use LyX 2.0 and export with pdflatex. When writing standard text and exporting to pdf, the font gets rigid. Text written in math mode, though, is exported crystal clear. I've tested that on several computers - but they all show the same problem. I can't get it, since it's the same font in both cases. Even when choosing italics for standard text, which is how math mode text is showed, I get the same result. I attached the screenshot below , if for some reason the difference will not show on the pdf itself. (obviously that compromises the quality, but the difference can still be seen clearly). ![enter image description here](http://i.stack.imgur.com/30ALQ.jpg)


title: Hyphenation on next-to-last line

text: On the next-to-last line of a paragraph, I have some hyphenation and on the last line, I only have the end of the word.               blablabla cou-     cou.     New paragraph      I thought the command `\finalhyphendemerits` could resolve this problem, but it doesn't seems to… Any idea ? I’m using `memoir` class and XeLaTeX


title: Microtype and textpos

text: I have found an effect on the part of the `microtype` package that I'd wish to cancel somehow. In the MWE that I am including below I collect a couple of token contents to be typed as part of a footer in every odd page of a document. This footer is comprised of two boxes aligned horizontally, the first with its contents ragged left and a width given by that of a box with the string `Authors:` set in a typewriter face. The page placement where the boxes are to be typeset is specified in terms of a `textblock` environment (from the package `textpos`) to be aligned vertically with the left margin of the textblock. Finally, once the boxes have been typeset, there is a new paragraph comprised of a single line. The MWE is as follows:               \documentclass[12pt]{memoir}          \usepackage{calc}     \usepackage[absolute]{textpos}     \usepackage{microtype}          \newtoks{\tokname}     \newtoks{\toktitle}     \newtoks{\toklatexed}     \toklatexed={Another paragraph}          \newcommand{\docauthors}[1]{\global\tokname={#1}}     \newcommand{\doctitle}[1]{\global\toktitle={#1}}          \newlength{\tagsboxlen}     \settowidth{\tagsboxlen}{\scriptsize\texttt{Authors:}}          \newcommand{\tagsbox}{%        \parbox[t]{\tagsboxlen}{%          \raggedleft           Authors:\\           Title:\\}}          \newcommand{\datatagsbox}{%        \parbox[t]{\textwidth - \tagsboxlen - 1em}{%          \the\tokname\\          \the\toktitle\\}}          \newcommand{\footpaperdata}{%        \setlength{\TPHorizModule}{1in + \oddsidemargin}        \setlength{\TPVertModule}{1in + \textheight + \topmargin %                                  + \headheight + \headsep + \footskip  %                                  + 2\onelineskip}       \begin{textblock}{10}[0,0](1,1)          \scriptsize\ttfamily          \noindent\tagsbox\hfill\datatagsbox          \par\noindent\the\toklatexed       \end{textblock}     }          \makeoddfoot{plain}{\footpaperdata}{}{}          \doctitle{This is the title}          \docauthors{This is the author's name}          \begin{document}          \pagestyle{plain}          Please, look at footer.          \end{document}      If I don't load the package `microtype`, the string `Authors:` is typeset aligned vertically with the textblock, but if I load it, the string is shifted a bit to the right, whereas the paragraph following those boxes is nonetheless aligned vertically with the textblock as described above. Could anyone possibly explain what is going on here? After reading egreg's answer I have thought of leaving to the consideration of anyone who may be interested an alternative that is based on his approach and that resorts to the package `tabu`. The entire MWE thus amended follows:               \documentclass[12pt]{memoir}          \usepackage{calc,tabu}     \usepackage[absolute]{textpos}     \usepackage{microtype}          \newtoks{\tokname}     \newtoks{\toktitle}     \newtoks{\toklatexed}     \toklatexed={Another paragraph}          \newcommand{\docauthors}[1]{\global\tokname={#1}}     \newcommand{\doctitle}[1]{\global\toktitle={#1}}          \newcommand{\paperdatatabu}{%        \begin{tabu} spread0pt{@{}X[-1,r]X[-1,l]@{}}           Authors:  &  \the\tokname\\           Title:    &  \the\toktitle\\        \end{tabu}     }               \newcommand{\footpaperdata}{%        \setlength{\TPHorizModule}{1in + \oddsidemargin}        \setlength{\TPVertModule}{1in + \textheight + \topmargin %                                  + \headheight + \headsep + \footskip  %                                  + 2\onelineskip}       \begin{textblock}{10}[0,0](1,1)          \scriptsize\ttfamily          \paperdatatabu          \par\noindent\the\toklatexed       \end{textblock}     }          \makeoddfoot{plain}{\footpaperdata}{}{}          \doctitle{This is the title}          \docauthors{This is the author's name}          \begin{document}          \pagestyle{plain}          Please, look at footer.          \end{document}


title: Macro to allow for alignment points within its argument

text: I would like to have a macro that allows for alignment points inside it. As a specific example, I would like to be able to say:               \begin{align*}              a &= b\\       \bracr{c &= d}      \end{align*}      where `\bracr` places a round brackets around the argument. This command would parse through the tokens until an alignment character is encountered. At this point it would insert a `\right.`, add the alignment point, and then start a `\left`. I realize that this example seems kind of trivial to do manually, but for now if I could just have a command such as the above brace that converts: `\bracr{c &= d}` to: `\left( c \right. & \left. = d\right)` Ultimately, I would like to add a `\vphantom{c = d}` to both sides of the equation to get the correct size brackets. I want to do a lot more with this, but need some help to get started as I don't know how to parse through the characters in #1. Below is a code sample. Basically, I would like to uncomment out the lines below and have it be equivalent to the lines above (with approriate changes to the macro). Another example, is where I want to color the particular formula as below.               \documentclass{article}     \usepackage{amsmath}     \usepackage{color}          \newcommand{\bracr}[1]{\left(  #1 \right)}    % not quite what is needed     \newcommand{\makeRed}[1]{\textcolor{red}{#1}} % also not quite as versatile as desired          \begin{document}     \begin{align*}              a         &=        b \\       \left( c \right. &= \left. d \right)\\     %\bracr{ c         &=        d }\\  % would prefer something like this instead      \makeRed{c}&\makeRed{= d}     %\makeRed{c &= d} % would prefer something like this instead     \end{align*}          \end{document}      Clarification: I would like this to be able to work independent of how many align points are provided.


title: Problem with slanted numerals when combining siunitx and arev

text: There is a strange interaction between the `siunitx` and `arev` packages, whereby all the numerals appear slanted when using commands such as `\num` or `\SI`.               \documentclass{article}     \usepackage{siunitx}     \usepackage{arev}     \begin{document}     \begin{itemize}     \item This is is some normal math: \( 1 + 1 = 2\). Looks OK.      \item This is using the \verb|\num| macro from \texttt{siunitx}: \num{1.23e45}. Why are the numbers slanted? The problem only occurs with the \texttt{arev} font.      \item It is only the numerals that appear slanted, the units themselves are OK: \SI{20}{km/s}       \end{itemize}     \end{document}      Is there a simple way to fix this?


title: How to wrap around a figure in a theorem-like environment?

text: I want to illustrate my examples, which are set in a theorem-like environment. Is it possible to wrap the text and equations around the figures? I have read about several packages but I can't get them to work in a theorem. Am I doing something wrong?


title: Why are lstlang*.sty files from listings package loaded 3 times?

text: During compilation of the following MCE:               \documentclass{article}     \usepackage{listings}     \lstset{language=TeX}     \begin{document}     \begin{lstlisting}     Foo     \end{lstlisting}     \end{document}      the `lstlang*.sty` files are loaded 3 times (and `lstmisc.sty` 2 times):               [...]     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstmisc.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/listings.cfg))     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang1.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang2.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang3.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang1.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang2.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang3.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang1.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang2.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstlang3.sty)     (/usr/local/texlive/2013/texmf-dist/tex/latex/listings/lstmisc.sty)     [...]      Is it necessary?


title: Creating colorful plot using latex terminal of gnuplot?

text: Most output terminals of gnuplot draw different lines in a plot in different colors. I'm trying to create a plot inside my pdf document using gnuplot's latex terminal and the lines are only distinguishable by linestyle. What do I need to do to get the lines colored? I use pdflatex. From this example:               \documentclass{scrreprt}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage[miktex]{gnuplottex}     \usepackage{graphicx}          \begin{document}     \begin{figure}[htbp]     \centering     \begin{gnuplot}[terminal=latex]     plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine'     \end{gnuplot}     \end{figure}          \end{document}      I get this result: ![](http://i.stack.imgur.com/9gVDp.png) @texenthusiast provides part of the solution: set the options [terminal=epslatex,terminaloptions=color] when using gnuplot. And don't forget to load epstopdf in your preamble: \usepackage{epstopdf} The lines in the plot will now be colored but still have different styles. ![enter image description here](http://i.stack.imgur.com/Ta5Wb.png) To give them the same style you can now use something like               set style line 1 linecolor rgb '#0060ad' linetype 1 linewidth 2     set style line 2 linecolor rgb '#dd181f' linetype 1 linewidth 2     plot [0:2*pi] sin(x) with lines ls 1 title 'Sine', cos(x) with lines ls 2 title 'Cosine'      ![enter image description here](http://i.stack.imgur.com/NahXK.png)


title: Why does chemstyle display 'TMP1' rather than compound numbers?

text: The minimal document below compiles fine but the compound number in the scheme in the PDF output still says 'TMP1' rather than the desired '1'. I drew the scheme in `chemdraw`, used Helvetica for the TMP1 font, and saved it as an encapsulated postscript file. Any help greatly appreciated!               \documentclass[a4paper]{article}     \usepackage[T1]{fontenc}     \usepackage[runs=2]{auto-pst-pdf}     \usepackage{booktabs}     \usepackage[journal=rsc]{chemstyle}     \usepackage{geometry}     \usepackage{lmodern}     \usepackage[version=3]{mhchem}     \begin{document}          \begin{scheme}[h]     \centering     \caption{A scheme that doesn't work.}     \label{hello-figure}     \includegraphics[scale=1.0]{hello}     \schemeref[TMP1]{bocced}     \end{scheme}          Look at compound \compound{bocced}.          \end{document}


title: Sideways figure and caption to fit textwidth and no page break

text: I'm struggling with placing some plots in latex. I'm trying to include the plots (sideways, but not the heading) in an appendix, so the first plot needs to be placed at the same page as the appendix heading. Also the plots, including the caption need to be placed inside the top/bottom/left/right margins. When using sidewaysfigure i get (1) a pagebreak, such that the heading and plot are placed at two different pages and (2) when the caption is long, it gets outside the margins. Is there any way I can prevent the pagebreak? and how to prevent the plot and caption to break the margins? (is there any way to measure the total height of plot and caption, and scale the plot (graphic) so that it has width=textheight (inside margins?), and height=textwidth(inside margins?)-"captionheight".... my preamble               \documentclass[pdftex,10pt,b5paper,twoside]{report}     \usepackage[lmargin=25mm,rmargin=25mm,tmargin=27mm,bmargin=30mm]{geometry}      and               \begin{sidewaysfigure}     \captionsetup{width=0.75\textwidth}     \begin{center}     \includegraphics[keepaspectratio=true, width=\textwidth]{./Figur/fundvar.png}     \caption[Commercial crude oil inventories, SPX excess returns, S\&P GCSI excess return time series]{Commercial crude oil inventories calculated as the logarithm of the current value divided by the mean of same weekly values over the past 5 years, Log excess returns on the S\&P Goldman Sachs Commodity Index,  Log excess returns on the S\&P 500 index.}     \label{fig:fundvar}     \end{center}     \end{sidewaysfigure}


title: Header and Footer

text: > **Possible Duplicate:**   >  Header, footer and font customization I am writing on a larger project (a book) and I now there are lots of possibilities about headers. But I am a newbie and I do not know which is perhaps the best, so I wanted to ask you how I should implement a header in the best way? I want the header to display the page number and the section title and also there should be a line under it. I do not know how to implement this, also the page number which is now under the text should disappear and the text in the header should have a color, but the page number should be black. The line should be a little more than maybe 4 pt thick. Thanks a lot for your help! Here is my code:               \documentclass{book}     \usepackage{geometry}     \geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}      \usepackage{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}     \usepackage[ngerman]{babel}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{wallpaper}     \usepackage{color}     \usepackage[final]{pdfpages}      %,bookmarksopenlevel={1}     %\usepackage[hidelinks,bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,colorlinks=true,linkcolor=black,]{hyperref}     \usepackage[colorlinks,linkcolor=black,bookmarksopen=false,     hypertexnames=TRUE,pdfpagelabels=true]{hyperref}[2011/02/05]     \hypersetup{        pdftitle={},     %  pdfauthor={},       pdfsubject={Statistics Book},        pdfkeywords={},        }     \usepackage{xcolor,bookmark}     \usepackage{scrextend}     \usepackage{titlepic}     \usepackage{shorttoc}     \usepackage{courier}     \usepackage{type1cm}              \usepackage{zref-abspage}     \usepackage{makeidx}             \usepackage{graphicx}             \usepackage{multicol}             \usepackage[bottom]{footmisc}     \usepackage{tocstyle}     \usetocstyle{allwithdot}      \usepackage{shadethm}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{marginnote}     \usepackage{wrapfig}     \usepackage{paralist}     \usepackage{amssymb}     \usepackage[framemethod=tikz]{mdframed}     \usepackage{ulem}          \definecolor{shadethmcolor}{rgb}{.9,.9,.95}%          \newtheoremstyle{mystyle}       {\topsep}{\topsep}{}{}%       {\bfseries}{:}{.5em}{}%          \theoremstyle{mystyle}          \newmdtheoremenv[hidealllines=true,backgroundcolor=shadethmcolor,skipabove=\topsep,     skipbelow=\topsep]{example}{example}          \begin{document}     \frontmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %     \setlength{\marginparwidth}{2.1cm}     \marginparsep = -4pt     \pagestyle{plain}     \pagenumbering{Roman}     \include{dedic}     \newpage\section*{}      \include{foreword}     \newpage\section*{}      \include{preface}     \newpage\section*{}      \include{acknow}     \newpage\section*{}      \include{acronym}     %     \     \shorttableofcontents{Inhalts\"ubersicht}{1}     \bookmark[page=15,rellevel=1,keeplevel,view={XYZ},color=red]{Inhalts\"ubersicht}     \bookmark[page=17,rellevel=1,keeplevel,view={XYZ},color=red]{Inhaltsverzeichnis}     \tableofcontents     \clearpage     \pagenumbering{arabic}       %                    \mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \include{part1}      \include{chapter1}     \include{chapter2}     \include{chapter3}     \include{part2}     \include{chapter4}     \include{chapter5}     \include{chapter6}     \backmatter          \appendix           \include{appendix}          \listoffigures     \newpage     \listoftables     \backmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\include{glossary}     %\include{solutions}     \cleardoublepage     \phantomsection     \addcontentsline{toc}{part}{Index}     \printindex          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \cleardoublepage     \phantomsection     \addcontentsline{toc}{part}{\"Uber den Autor}     \includepdf{ueberautor}     \includepdf{back}     \end{document}


title: Complex ligatures in Devanāgarī

text: Ligatures are known to the Western European languages, however it isn't that common to spot vertical or complex form of them. As an exercise in typography I tried to get some complex ligatures in Devanāgarī script. I've downloaded the chandas.ttf file (Southern style; uttara.ttf would serve well as a test case) with complex ligatures in it as well as the Sanskrit 2003 font which doesn't contain complex ligatures to show common form of writing. I've opened the font in FontForge where we can see those ligatures and their names. Ligatures are properly mapped, so we can use them. I only changed some letters to fit transliteration schemes: `Y` as `nj` or `J`, `G` as `ng` and I am using Lexilogos and Sanscript to get the portion of words. ![a preview of complex ligatures in FontForge](http://i.stack.imgur.com/rZiMa.png) _Note:_ In case you are wondering what I am trying to achieve I can say that I try to convert transliterated words sorted in Xindy (Sanskrit, Pāḷi, hopefully even Tamiḻ and Siṇhala later) and I am checking what options I have to display index entries. As mapping is not supported in LuaTeX, I am trying to prepare standalone Lua scripts which will replace Latin letters. In theory, I have two problems now: **1)** How to turn off those complex ligatures locally in document and how to get regular form of writing, if needed? To preview a common form I used different font in the example below. After using `otfinfo -f chandas.ttf` we know there are three features, but it is not helping if we turn them off. **2)** How to get complex ligatures in LuaLaTeX? As far as I know the support for Indic languages is very limited. Under normal circumstances I am using `\char` to get a specific glyph, but those complex ligatures are not mapped as Unicode glyphs in the private use areas (PUA). I would be able to use `\XeTeXglyph` and the glyph's slot, but it is not easy as well. FontForge is showing 3417 (0x0D59) for `DNjYa` glyph, but the actual position got from XeTeX (`\the\XeTeXglyphindex"DNjYa"`) is 2510 (0x09CE). What a day! **A bonus.** There is even more fun, if we try to get two complex ligatures next to each other (I cannot say if it is correct linguistically, it is not almost certainly), e.g. DNjJ+DNjJa, the middle letters form ligature earlier while typing it. The solution is to use `\mbox{}`, see the last line in the example. I enclose an example and a preview of my efforts. We can run `xelatex` and `lualatex`. If you are interested, an encoding table can be obtained from http://www.sanskritweb.net/cakram/chandas-encoding.pdf and a preview of all ligatures from http://www.sanskritweb.net/cakram/saMyoga-pattra.pdf               % run: xelatex or lualatex mal-sanskrit.tex     \documentclass[a4paper]{article}     \pagestyle{empty}     \usepackage{ifxetex}     \usepackage{fontspec}     % Possible addtion for LuaLaTeX (1 line):     %\usepackage{luatextra}     % Possible addition for XeLaTeX (3 lines):     %\usepackage{polyglossia}     %\setmainlanguage{sanskrit}     %\newfontfamily{\devanagarifont}{Sanskrit2003}     \parindent=0pt     \begin{document}     Correct form in Xe\LaTeX, incorrect in Lua\LaTeX\ (2 lines):\par     \setmainfont[Script=Devanagari]{Sanskrit2003.ttf}     ड्ण्ज्ञ (common form; using different font [Sanskrit2003.ttf])\par % ड्ण्ज्ञ     \setmainfont[Script=Devanagari]{chandas.ttf}     ड्ण्ज्ञ (glyph DNjYa; DNjnja [Lexilogos] or DNjJa [Harvard-Kyoto])\par\medskip       % Y as nj or J, G as ng     \setmainfont[Script=Devanagari,RawFeature=-liga;-mkmk;-mark]{chandas.ttf}     ड्ण्ज्ञ (a form of ligature; Devanāgarī script)\par     \setmainfont[Script=Latin]{chandas.ttf}     ड्ण्ज्ञ (incorrect form; Latin script)\par     \setmainfont[Script=Devanagari]{chandas.ttf}     ड्\mbox{}ण्\mbox{}ज्ञ (incorrect form; separated glyphs, \verb.\mbox.)\par\medskip     \ifxetex     3417 as \XeTeXglyph"0D59\ versus % 3417     \the\XeTeXglyphindex"DNjYa"\ as % 2510     \XeTeXglyph2510\ or\ \XeTeXglyph"09CE\ (getting slot number)\par     ड्ण्ज्ञ्ड्ण्ज्ञ / ड्ण्ज्ञ्\mbox{}ड्ण्ज्ञ (DNjJ DNjJa)     \fi     \end{document}      ![output from xelatex](http://i.stack.imgur.com/IBp1F.png) ![output from lualatex](http://i.stack.imgur.com/TRmGH.png)


title: formatting like description label in beamer

text: While preparing a beamer presentation, I need to format a little string like `21.02.2012` exactly like the description-labels appear.   I tried by using usebeamertheme/color/font of `description item` - but this seems not to be working. I'm searching for a portable solution, thus when using another theme for the presentation, the result ever looks like those description labels.   For better understanding a MWE:               \listfiles     \documentclass[xetex]{beamer}     \usepackage{polyglossia}\setdefaultlanguage[spelling=new,babelshorthands=true]{german}     \begin{document}     \begin{frame}     \begin{description}[longest label]       \item [first label] describtive text       \item [second label] describtive text     \end{description}     The \underline{underlined text} should look like those description labels (first, second) above.\newline     Working with the solution from \emph{ejoerns}:      The \underline{\usebeamercolor*[fg]{description item}underlined text} should look like those description labels (first, second) above.     \end{frame}     \end{document}


title: LaTeX to HTML: PolyTeXnic and PlasTeX

text: I was stunned by the elegant appearance of the Tau manifesto page, for which the source is in LaTeX. The author used a home-made tool that he calls PolyTeXnic, but which he is not willing to release. How difficult would it be to reproduce his result? I'm leaning towards using PlasTeX as the base tool. **Edit** I was _not_ referring to the contents of the Tau manifesto page :-) but rather to its general _appearance_ : nice cross references, equations, figures, tables, cross-references to them, footnotes, bibliographical references, etc. The maths is actually what worries me the least, thanks to MathJax. I was rather thinking on all the other aspects of the document, and whether PlasTeX might be up to the task.


title: Loading hyphenation patterns in Texmaker

text: I've got problems making `TexMaker / MikTeX 2.9` use polish hyphenation rules. As from what I've read on this forum (e.g. here), `babel` package should automatically load polish hyphenation rules after setting:               \usepackage[polish]{babel}      but it doesn't seem to do so. Until now, I always end up creating a long list of               \hyphenation{ wordslist }      in the preamble to correct for mis-hyphenated words. Isn't there a way to configure `babel / TexMaker / MikTeX` to load a specific file, i.e. hyph_pl_PL.dic? I recall such a possibility in TeXnic Center (correct me if I'm wrong).


title: Understanding a certain TeX instruction

text: I want to understand the TeX instructions                 \ifx\@tempb`\edef\next##1{%      Especially, I want understand what meaning of ``` symbol before `\edef`.   As I know `ifx` compare two statements, symbol ``` for symbol taking - ``\A` takes a code of symbol `A`. Or I am wrong? Thanks.


title: Tabstop-like alignment of text possible?

text: I'd like to format some text around a tabstop such that what is left from the tabstop is `\flushright` and the text that is right from the line is `\flushright`. The Tabstop is at a specific position, for example 2.5cm away from the left margin. Example:   **Some Text on the left side** | some text, on the right side   | that continues over some paragraphs   **some other text** | some further text      **more text** | further text   and all `|` are at 2.5cm from left margin, so that it looks a little bit like this: ![enter image description here](http://i.stack.imgur.com/XdVnO.gif) I tried to use the tabular environment, but that does not allow me to specify the 2.5cm correctly. A solution without further packages is prefered.


title: Technical documentation and/or book templates?

text: I'm just getting started with LaTeX and wanted to see some templates for technical documentation and/or books. I'm writing a small book about PHP and wanted to use LaTeX with it, but i wanted to have more control about the appearance (header, footer, "tips" with icons, code samples, table of contents, etc.)


title: Bold emphasize parts of text

text: I have a pdf document made in latex. I have to make a new document following the same template but I only have the pdf, not the source `.tex` file. Some important words/sentences are "boldly emphasized" but I don't know which command I have to use to do this. (not with the `\emph` cmd) ![Example](http://i.stack.imgur.com/4ThWc.png) An example can be found in the image above (launchRiskEstimation, sensorData and receivedAt)