title: Listings for Tikz code?

text: I am trying to quote (not compile!) LaTeX code (including TikZ code) within a LaTeX document. The `verbatim` package works, but it doesn't wrap text and doesn't look very nice. So I am trying to use the package `listings`, but am having problems: It is giving me issues on the quoted code when I try to compile, when it should just be treating it like text! I imagine this is because it is trying to color the syntax or something, but at this point that would be a bonus — I just want the code to look nice and wrap (and not compile within `\begin{lstlisting}`). Also, it seems that the TikZ code that I use within a LaTeX document is also giving `listings` trouble.               \usepackage{listings}          \lstset{     language=TeX,                            defaultdialect=empty,     basicstyle=\footnotesize,                numbers=left,                                numberstyle=\footnotesize,               stepnumber=5,                                numbersep=5pt,                           backgroundcolor=\color{white},       showspaces=false,                        showstringspaces=false,                  showtabs=false,                          frame=single,                        tabsize=2,                       captionpos=b,                    breaklines=true,                     breakatwhitespace=false,             escapeinside={\%}{)}                 }               \begin{document}     The document begins.  A bunch of regular Latex code and TikZ pictures here.     \begin{lstlisting}          %Set domain, range, and scale of picture.     \begin{tikzpicture}[domain=0:100,range=0:200,scale=0.7,thick]     \usetikzlibrary{calc}          %Define linear parameters      \def\inc{10}            %Total freight.     \def\pa{1}              %Price of x1.     \def\pb{1}              %Price of x2.     \def\panew{0.5}     %New price for x1.          % Define coordinates.     \coordinate (x2) at  (0,{\inc/\pb});     \coordinate (x1) at  ({\inc/\pa},0);     \coordinate (x1') at  ({\inc/\panew},0);          \end{lstlisting}     \end{document}      Note: I do not want the TikZ picture to render within `\begin{lstlisting}`, I just want to be able to show the code. Same with the the LaTeX code within it. Is there a better way to tackle this?


title: Mendelian Inheritence Chart

text: I would like to be able to create a simple chart that depicts Mendelian Inheritence, like this one: ![Inheritence](http://anthro.palomar.edu/mendel/images/genotypes_of_pea_plants.gif) I'm not too picky about how it looks, as long as it depicts it accurately. Thanks!


title: Replacing greek glyphs in math mode

text: I want to switch fonts, away from computer modern. I'm pretty sure that I will end up with a mixture of fonts. I can't provide a full list of required features, but Linux Libertine's feature set pretty much covers it. It is, at the moment, my base font for text work, together with Linux Biolinum. I need to adjust the math glyphs, though. They are still taken from the cm fonts and obviously don't fit. As a start, I want to use those provided by GFS, like GFS Bodoni (too playful), or GFS Didot (all available as OTF). To achieve this glyph replacement, I started with one of the mathastext examples:               \documentclass{article}          \usepackage[T1]{fontenc}     \renewcommand{\rmdefault}{bodoni}     \usepackage[LGRgreek,defaultmathsizes,italic]{mathastext}     \usepackage{libertine}     \let\varphi\phi     \linespread{1.06}          \begin{document}       ff fi fj fi ffj fl ffl äÄ öÖ üÜ ß\\       01234567890\\       \begin{equation}     abcdefghijklmnopqrstuvwxyz       \end{equation}       \begin{equation}     \alpha \beta \gamma \delta       \end{equation}     \end{document}      This compiles without any errors, and the math glyphs are replaced by those from GFS Bodoni, I get ligatures, correct Umlauts (the next problem arises here: LL provides an alternative O-umlaut, which I prefer). However, I don't know how to access text figures from either LL or GFS Bodoni, while both provide them. My plan was to translate the above mwe to valid code for LuaLaTeX, gaining more control over the font selection. I failed:               \documentclass{article}          \usepackage[no-math]{fontspec}     \renewcommand{\rmdefault}{bodoni}     \usepackage[LGRgreek,defaultmathsizes,italic]{mathastext}     \setmainfont{Linux Libertine O}     \setsansfont{Linux Biolinum O}      This sets mathnormal, mathrm, mathbf and mathit to computer modern (bad), but uses greek glyphs (which is good). The symbols used are still taken from the CM fonts, but I have not yet tried to replace them. I will need to, because the default int-symbol's terminals are - as an example - ball-shaped. I then found the unicode-math package, but from what I read it is meant to be used for fonts which provide a full unicode math alphabet, which the GFS fonts do not. I tried to use unicode-math, but with less success than with the examples given above. Ultimately, I need a font selection procedure which is not hacked to fit one specific situation. I want to see how the different glyphs work together on the same page, and I might even buy a font that suits the text and its purpose, and not the technical limitations caused by my lack of skill. How can I develop a procedure of selecting fonts and glyphs that is robust and gives me the required flexibility? Is unicode-math the way to go? * * * Regarding \setmainfont instead of \renewcommand: I now used               \documentclass{article}     \usepackage{fontspec}     \setmainfont[%     ]{GFSBodoni}     \usepackage[LGRgreek,defaultmathsizes,italic]{mathastext}      as you suggested, with and without the no-math option for fontspec, and lualatex complains:               ! Font \LGR/GFSBodoni(0)/m/it/7=grmn0700 at 7pt not loadable: metric data not found or bad.     ! Font \LGR/GFSBodoni(0)/m/it/5=grmn0500 at 5pt not loadable: metric data not found or bad.      These errors occur in               \begin{equation}       abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ     \end{equation}      This could either be caused by my usage of the font or by an error in my miktex 2.9 installation. However, a pdf is produced, with the following features:   * The main fonts are GFS Bodoni,   * The greek glyphs in math mode are upright, not CM anymore, but not to be found in the GFS Bodoni Specimen sheet either. I don't know where they come from. The preamble above is what I used, it is directly followed by \begin{document}. I then downloaded the otf files from the GFS website, and told fontspec to use them directly. I even renamed them to make sure that lualatex does not find any other Bodoni files elsewhere:               \setmainfont[%       ItalicFont=GFS-Bodoni-Italic.otf,       BoldFont=GFS-Bodoni-Bold.otf,       BoldItalicFont=GFS-Bodoni-Bold-Italic.otf     ]{GFS-Bodoni.otf}      I'm puzzled. I'll now start trying the same thing with unicode-math, as you suggested. * * * unicode-math: After switching back and forth between different combinations of options, this is what I first came up with:               \documentclass{article}     \usepackage{unicode-math}     \setmathfont{XITS Math}     \setmainfont{Linux Libertine O}     \setsansfont{Linux Biolinum O}     \setmathfont[         math-style=ISO,         range=\mathit/{greek,Greek},     ]{GFSBodoni-Italic}     \setmathfont[         math-style=ISO,         range=\mathrm/{greek,Greek},     ]{GFSBodoni}      Greek glyphs are now replaced, as intended. I can change the latin characters to Linux Libertine with the same trick, using two new blocks and {latin,Latin} in the range option. My original question has been answered, in the sense that I was encouraged to use unicode-math. Thanks Ulrike! However, the quest goes on. Using a unicode math font left me with undesired figures, which I could also replace by figures from GFS Bodoni or Linux Libertine. Unfortunately, none of the following ideas work (the first is taken from the unicode-math documentation):               \setmathfont[       math-style=ISO,       range=\mathit/{num},     ]{Linux Libertine O}          \setmathfont[       math-style=ISO,       range=\mathrm/{num},     ]{Linux Libertine O}          \setmathfont[       math-style=ISO,       range=\mathit/{"0030-"0039},     ]{Linux Libertine O}          \setmathfont[       math-style=ISO,       range=\mathrm/{"0030-"0039},     ]{Linux Libertine O}      A major drawback is that I need to use a unicode math font, as above. My choice is at the moment limited to XITS, Asana Math, and (partially) Neo Euler. Neo Euler seems to have problems with scaling parentheses. Apart from that, I don't really like any of these choices, judging just by the more prominent math symbols (like int, parentheses, n-ary sum and n-ary product sign), but that's not the point of this question.


title: Laying out two footnote streams one beside the other

text: I am working with an author that needs two different footnote streams. This can quite easily be done by using `bigfoot`. * * * **EDIT** Also note that the margins used are narrow, like 10mm or so. Therefore the 2nd stream should be "under" the text. * * * I did things like that :               \documentclass[a5paper,11pt]{scrbook}     \usepackage{geometry}     \usepackage{perpage}     \usepackage[ruled]{bigfoot}     \MakePerPage{footnote}          \renewcommand{\thefootnote}{\alph{footnote}}     \DeclareNewFootnote{A}[arabic]          \begin{document}     Lorem\footnote{a footnote stream} ipsum dolor sit amet, consectetur adipiscing elit.                  Vestibulum ut lorem\footnote{a footnote stream} ligula. Pellentesque eget nibh quam.          Etiam molestie iaculis dictum. Ut fringilla odio quis quam aliquet egestas. Nam          dignissim ante eu nibh bibendum, a laoreet ipsum\footnoteA{another footnote stream}      aliquam. Donec euismod erat ac malesuada sodales. Fusce viverra feugiat ligula vel      rhoncus. Aliquam erat volutpat. Nullam consequat sollicitudin quam, id dapibus tellus.          Nulla tempus mattis justo, eget aliquam elit vehicula sed.          Curabitur ante felis, rutrum sed sem nec, fringilla rhoncus metus. Mauris blandit, dui      non tempus porttitor, sapien urna fermentum ligula, nec molestie dolor lacus vel      ipsum\footnoteA{another footnote stream}. Maecenas odio enim, vulputate sit amet nulla      nec, laoreet imperdiet sapien. Cum sociis natoque penatibus et magnis dis parturient      montes, nascetur ridiculus mus. Integer sed tincidunt dolor. Nunc laoreet interdum      condimentum. Maecenas neque urna, porttitor ac neque id, gravida cursus odio.          In egestas lobortis nisi eu malesuada. Donec leo nibh, vulputate vel arcu vel,      adipiscing pharetra ipsum\footnoteA{another footnote stream}. Maecenas vitae augue      luctus, ultrices nisi sed, hendrerit ipsum\footnoteA{another footnote stream}.      Suspendisse potenti. Mauris id blandit arcu, et sodales massa. Sed laoreet dapibus      lectus id bibendum. Nunc eget orci id lectus auctor sagittis. Vivamus tincidunt semper      mattis. Curabitur quis lorem\footnote{a footnote stream} tortor.          Sed volutpat urna ligula, eget posuere neque condimentum eu. Integer feugiat erat ac      lorem interdum, ut pharetra quam blandit. Nulla blandit sit amet tellus at cursus. Nam      eget eleifend felis. Aliquam pulvinar mi sit amet magna gravida congue. Mauris      pellentesque dui et turpis laoreet dictum. Donec commodo ultricies risus, eget      fringilla sapien hendrerit eu.     \end{document}      * * * ![enter image description here](http://i.stack.imgur.com/LClUk.png) * * * But the author is asking me if there is any possibility of having one stream beside the other and not below the other. And of course if only the second stream is present in a given page, to have it on the right alone. * * * ![enter image description here](http://i.stack.imgur.com/Yp4T6.png) * * * Any way to achieve this ? I tried to use `scrextend` package that helps me in settings the left and right margins of the footnote, but that does not seem to solve my problem.


title: How to display numbers in the format 12.3 (4.56) in a table column?

text: I would like to print numbers in a table in the form `12.3 (4.56)` using `siunitx`. How can this be achieved? I'm a bit worried that `siunitx` changes the numbers in various ways and I would like to understand why. Here is an example:               \documentclass{article}          \usepackage{tabularx}     \usepackage{booktabs}     \usepackage{siunitx}     \usepackage{xcolor}          \begin{document}          \begin{tabular}{S[separate-uncertainty]                     S[separate-uncertainty, uncertainty-separator={\ }]                     S[uncertainty-separator={\ }]} % table-format=2.1(1.2) doesn't help here       \toprule       12.3 (456) & 12.3 +- 4.56 & 12.3 +- 4.56\\       \bottomrule     \end{tabular}          \end{document}      My first trial was actually `12.3 (4.56)` but that gives an error. It seems that there is no second dot allowed (I was hoping that this is possible with `table-format`, but it didn't work) unless one uses a syntax like `12.3 +- 4.56`. Note:   * That both numbers (the 'main' number and the 'uncertainty') are perfectly formatted in my case. They shouldn't be changed/adjusted.   * I am not looking for a solution with separate columns for the 'main' number and the 'uncertainty'.   * I am specifically looking for a solution with `siunitx` in order to have the numbers nicely aligned (ideally according to both decimal dots) and to be able to colorize certain table entries.


title: how to align an image using Tex/LaTex so it is above text

text: I am using the `res.cls` class to write my resume. And I thought it would be nice to put an image of myself just above the name. However when I have used the `\includegraphics[scale =.09]{josh.JPG}` I have the option of it being aligned to the left, or centred. Now given I want the image to be above my name in the resume, I thought `\centre` would do. But it is still to the left. In Microsoft word I would just make the image free-transform and drag it where I want. Is there a way to define how many pixels/cm etc an image is positioned from left or right? **Question** I am not sure how to align the image directly over the Name in the resume document? **Other Information** Example --> Attached .gz file tex, class file Tex Editor --> Linux Mint 16 TexMaker Required Packages/Classes (res.cls) **Update:** I have managed to centre the image, and would now be happy to get either the normal text John. D. Doe or the /name formatting from the resume class to sit directly under the image.               \documentclass[margin]{res}      \textwidth=5.2in % increase textwidth to get smaller right margin          \usepackage{graphicx}          \begin{document}           \hfill \includegraphics[scale =.05]{josh2.jpg}\hspace*{\fill}\\     \begin{center}     {\bf John. Doe} \hspace*{\fill}     \end{center}          \name{John D. Doe\\}          \begin{resume}     \section{\underline{Objective}}              \begin{itemize} \itemsep -2pt             \item To teach              \end{itemize}                        \section{Skills}       {\bf Excel Automation:}           \section{Work \\ History}     {\bf Business Analyst}                 \begin{itemize}               \item Dot Point               \end{itemize}                        \end{resume}      \end{document}       ![headshot](http://i.stack.imgur.com/DhLp6.png)


title: Can TeX/LaTeX draw lines at precise positions?

text: I need to draw lines at specific distances (in mm). For example:               ---- line 0     ---- line 1 at 35.64 mm below line 0     ---- line 2 at 33.64 mm below line 1      The macro I'm using is as follows (I don't remember from where I copied it):               \def\fr#1{       \vbox{           \dimen0=#1         %\advance \dimen0 by -2.41pt         \advance \dimen0 by -1pt         \vskip \dimen0         \vrule height 0.5pt depth 0.5pt width 2in       }     }      And I use it as follows:               \parindent=0pt     \baselineskip=-\maxdimen     \lineskiplimit=\maxdimen     \lineskip=0pt               \#0 \fr{1mm}     \#1 \fr{35.64}     \#2 \fr{33.64}      However I cannot get the lines to appear at the desired positions.


title: Alignment inside a curve rubric

text: I have the following problem with my CV using Curve: I have two files, namely main.tex:               \NeedsTeXFormat{LaTeX2e}     \documentclass[a4paper]{curve}          \usepackage[nohead,nofoot,hmargin=1.5cm,vmargin=1.5cm]{geometry}     \linespread{1.3}          \title{CV}          \leftheader{}     \rightheader{}          \begin{document}       \makeheaders       \maketitle            \makerubric{Degrees}          \end{document}      and a file containing a list of degrees, called "Degrees.tex":               \begin{rubric}{Degrees}     \entry*[2010] Bachelor of Science, Computer Science, Some University     Thesis:    "XXX"     Reviewers: "ABC"                "DEF"               \end{rubric}      I would like the content of the rubric to be properly aligned, as they are in the source code, but I just can't figure out how to do that. I have tried using the tabular environment, which works but has the drawback that the text inside it is not left-justified with respect to the text above it               \begin{tabular}{ll}      Thesis: & "XXX" \\      Reviewers: & "ABC" \\      & "DEF" \\     \end{tabular}      I also tried an itemize, but this fails completely.               \begin{itemize}     \item[Thesis:] "XXX"     \item[Reviewers:] "ABC"     \item[] "DEF"     \end{itemize}      I would appreciate any help with this.


title: Latex code for power electronic inverters

text: I need a code so as to get following circuit diagrams.![it is a voltage source inverter.](http://i.stack.imgur.com/wrw2g.png) ![Z-source inverter](http://i.stack.imgur.com/sFTze.png)


title: Determining the height of the current line, especially in displayed math

text: Is there a way to determine the height of the current line? More specifically, after the hbox comprising the current line is finalized, I'd like to determine it's height (and perhaps also depth) and write this information to an auxiliary file. The application I have in mind is placing something in the margin which is vertically aligned with the center of the current line, rather than with the baseline of the current line. I'm primarily interested in the case where the current line is a displayed equation. (This is a more focused version of this older question.)


title: How to make columns in itemize?

text: I want to put two/three columns of short formulas under one item in itemize. Like this:   * Item name % and now here come two columns under this item                  formula 1      formula 2        formula 3      formula 4        formula 5      formula 6


title: Remove space around bullet points in itemized or enumerated list

text: How can I reduce the amount of space around items in an itemized or enumerated list? I would like to reduce the vertical space between items, the space to the left of the bullet, and the space between the bullet and the text.


title: Symbols instead of numbers as footnote markers

text: How can I make LaTeX use symbols (*, †, ‡, and so on) instead of numbers to mark footnotes? (The numbers are confusing because I use superscripted numbers for citations.)


title: Libertine newtxmath and text (oldstyle) figures in headers

text: This is closely related to the OP with title "lining figures in tables and math, old style figures in text", and to the answer provided therein. The following (semi)MWE is to be run with pdfLaTeX:               \documentclass[12pt]{memoir}          \usepackage{etoolbox}% I tried with \AfterEndPreamble     \usepackage{textcomp}     \usepackage[T1]{fontenc}     \usepackage{libertine}     \usepackage[libertine]{newtxmath}          \AfterEndPreamble{%         \def\libertine@figurealign{}         \libertineOsF         \noindent% memoir indents at the very start      }          \begin{document}     Text figures: 0123456789     \par\noindent     Math figures: $0123456789$     \end{document}      It leads to lining figures in math mode and text (oldstyle) figures in text mode, but only on the textblock and not so on the headers, where we still get lining figures, as can be seen in the numeral for the page number. How can we get oldstyle figures on the headers, too?


title: List acronyms in nomenclature which are not used

text: Is it possible to have some of the acronyms, which are defined but not used in the text, in the list of nomenclatures (using glossaries package)? Or in other words, how can I add some more entries to the list of nomenclature where the entries are not used in the text. Example: Say I have defined two acronyms like following               \newacronym[user1={$\AA$}]{ao}{$a_o$}{equilibrium bond length of pure X}     \newacronym[user1={$\AA$}]{a1}{$a_1$}{equilibrium bond length of pure Y}      But in the text usual `\gls{ao}` and `\gls{a1}` cannot be used due to particular sentence construction. But as these symbols are there in the equations, so should go to the list of nomenclature. Thanks.


title: Get current font size as length

text: I understand from THIS question that the current font size can be determined. But how can I convert this to a length value?               \documentclass[10pt,a4paper]{article}     \newlength{\mytextsize}             %This part fails....         \makeatletter           \setlength{\mytextsize}{\f@size pt}        \makeatother          \begin{document}         %do something.             \end{document}      In other words, I want to use the 10pt declared in the `\documentclass{...}` elsewhere.


title: To cite something of Association in the author field

text: My Bibtex               @ARTICLE{aami,         title = {Ambulatory electrocardiographs},         author = {Association for the Advancement of Medical Instrumentation},         year = {1998},         address = {Arlington, \uppercase{USA}},         note = {\uppercase{ANSI/AAMI} EC38:1998}     }      I get in IEEE style ![enter image description here](http://i.stack.imgur.com/fYbCc.png) The title field is not shown correctly. **What should you write for the author field for a publication?**


Good day, I am using the following code:               \documentclass[]{report}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{breqn}     \usepackage{hyperref}     \usepackage{amstext}     \hypersetup{linktocpage}     \usepackage{float}     \usepackage{array}     \usepackage{url}      \usepackage{chngpage}     \usepackage{cleveref}     \usepackage[parfill]{parskip}     \usepackage[labelfont={bf},font=small, margin=0.5cm]{caption}          \begin{document}     \begin{align*}     \left \{ NJ^{-1}T_d \right \}_\text{worst case}=\begin{bmatrix}      0.0016  \\       \pm 0.0003 \\       0.0016       \end{bmatrix}     \end{align*}          \end{document}      I end up with the error:               *Argument of \text@ has an extra } \end{align*}*      Any ideas?


title: Text Wrap with algorithm2e

text: I'm using `algorithm2e` for algorithms and for some of the longer algorithms, (eyeballed at > 50% of a page) there is no other text on the page with just an embarrassing amount of white space above and below the algorithm. The other figures and floats in my document are positioned just fine with text flowing below them, and I have no special commands regarding the placement of floats. I've checked the `algorithm2e` documentation, but there is nothing about this. Any tips?


title: Cleveref: cleveref appears to not be so clever (sorry for the pun but I couldn't help myself)

text: ![enter image description here](http://i.stack.imgur.com/PmqUA.png) This didn't happen when I wasn't using `cleveref`.               \documentclass{article}     \usepackage{amsmath}     \usepackage[retainorgcmds]{IEEEtrantools}     \usepackage{hyperref}     \usepackage[noabbrev]{cleveref}     \begin{document}     \begin{IEEEeqnarray}{rCr}       \ddot{x} - 2\Omega\dot{y} - \Omega^2x & = &       -\frac{\mu_1}{r_1^3}(x + \pi_2r_{12}) - \frac{\mu_2}{r_2^3}(x - \pi_1r_{12})       \label{xjacobi}\\       \ddot{y} + 2\Omega\dot{x} - \Omega^2y & = &       -\frac{\mu_1}{r_1^3}y - \frac{\mu_2}{r_2^3}y\label{yjacobi}\\       \ddot{z} & = & -\frac{\mu_1}{r_1^3}z - \frac{\mu_2}{r_2^3}z\label{zjacobi}     \end{IEEEeqnarray}     Let's multiple \cref{xjacobi} by \(\dot{x}\), \cref{yjacobi} by \(\dot{y}\), and \cref{zjacobi} by \(\dot{z}\).     \end{document}


title: href not working in beamer (not clickable)

text: I have a beamer presentation and I would like to include a beamer presentation. the label from `\href` shows on the screen, but not as a link and it is not clickable. Same thing happens with `\url`. Reduced example:               \documentclass{beamer}     \usetheme[darktitle]{UniversiteitAntwerpen}     \usepackage[utf8]{inputenc}     \usepackage{default}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{verbatim}     \usepackage{booktabs}     \usepackage{pdfpages}     \usepackage{hyperref}           \begin{document}         \begin{frame}         \frametitle{Historic data}         \begin{itemize}          \item Evolution over time $\rightarrow$ \href{http://drupalfun.com/dance/index.html}{Time machine}         \end{itemize}     \end{frame}     \end{document}


title: What is the difference between the basic MiKTeX and the complete MiKTeX?

text: I am just starting out with LaTeX on Windows XP, and I was advised to install MiKTeX. What would I get in the complete MiKTeX that isn't in basic MiKTeX?


title: Avoid inputting a file multiple times

text: I have a revision string automatically saved to a file VERSION (it is the output of `git describe` and usually looks like v2.2-19-g0a51c27), and define a command               \newcommand*\fileversion{\input{VERSION}}      However, each time the command is used, the file is read once. So if I put the command on every page, VERSION will be read many times (= number of pages). Currently I use savebox to avoid this problem but unfortunately this can not pick up the surrounding formatting style, for example, if surrounding text is in footnotesize, the savebox still uses normal size. I also tried `\edef\fileversion{\input{VERSION}}` but somehow TeX gave me 'stack limit' error. So my question is how to define a command that expands to the contents of VERSION and not \input{VERSION}.


title: Referring to a complete subequation environment. Is there a recommended style?

text: I have a subequations environment which is labelled and inside it I have an alignat environment which has a label for each line. Would you say it is ok to refer to the complete model as I do it in the MWE, because the concrete label (0.1) cannot be found directly as equation number? Or is there a better way to refer to the complete model, except referring to the range of equations like `(0.1a)--(0.1b)`? MWE:               \documentclass{scrbook}     \usepackage{amsmath}          \begin{document}     I'm referring to the complete model \eqref{eq:MainLabel} and here to the restrictions \eqref{eq:Sub1} and \eqref{eq:Sub2}     \begin{subequations}     \label{eq:MainLabel}     \begin{alignat}{2}         \sum_{m \in M}  x_m     & = 1      & \quad & , \forall m \in M \colon a \neq b  \label{eq:Sub1} \\                               x_m     & = 1      && , \forall m \in M \colon e \neq f \label{eq:Sub2}                \end{alignat}     \end{subequations}     \end{document}


title: How can I mimick the listing caption style for my custom "Listing (cont.)" caption?

text: I have the following LaTeX code which works fine:               \documentclass[12pt,a4paper]{article}     \usepackage[a5paper]{geometry}% just for the example     \usepackage[utf8x]{inputenc}     \usepackage{listings}     \usepackage[labelfont=bf, font=small]{caption}     \usepackage[framemethod=tikz]{mdframed}               \lstset{     breaklines=true,     breakatwhitespace=false,     xleftmargin=1em,     frame=single,     numbers=left,     numbersep=5pt,     }          \newcommand\mylstcaption{}          \surroundwithmdframed[     hidealllines=true,     middleextra={       \node[anchor=west] at (O|-P)         {\lstlistingname~\thelstlisting\  (Cont.):~\mylstcaption};},     secondextra={       \node[anchor=west] at (O|-P)         {\lstlistingname~\thelstlisting\  (Cont.):~\mylstcaption};},     splittopskip=2\baselineskip     ]{lstlisting}          \begin{document}          \renewcommand\mylstcaption{Example listing of code}     \begin{lstlisting}[language=C, caption=\mylstcaption, label=lst:c1]          struct safe_buffer {     struct list_head node;          /* original request */     void    *ptr;     size_t  size;     int direction;          /* safe buffer info */     struct dmabounce_pool *pool;     void    *safe;     dma_addr_t  safe_dma_addr;     };          struct dmabounce_pool {     unsigned long   size;     struct dma_pool *pool;     #ifdef STATS     unsigned long   allocs;     #endif     };          struct dmabounce_device_info {     struct device *dev;     struct list_head safe_buffers;     #ifdef STATS     unsigned long total_allocs;     unsigned long map_op_count;     unsigned long bounce_count;     int attr_res;     #endif     struct dmabounce_pool   small;     struct dmabounce_pool   large;          rwlock_t lock;          int (*needs_bounce)(struct device *, dma_addr_t, size_t);     };          #ifdef STATS     static ssize_t dmabounce_show(struct device *dev, struct device_attribute *attr,     char *buf)     {     struct dmabounce_device_info *device_info = dev->archdata.dmabounce;     return sprintf(buf, "%lu %lu %lu %lu %lu %lu\n",     device_info->small.allocs,     device_info->large.allocs,     device_info->total_allocs - device_info->small.allocs -     device_info->large.allocs,     device_info->total_allocs,     device_info->map_op_count,     device_info->bounce_count);     }          static DEVICE_ATTR(dmabounce_stats, 0400, dmabounce_show, NULL);     #endif          \end{lstlisting}          \end{document}      Part of the result looks like: page 1 ![page1snippet](http://i98.photobucket.com/albums/l272/Pinokkio89/ScreenShot2014-01-08at232003_zps2caf6546.png) page 2 ![page2snippet](http://i98.photobucket.com/albums/l272/Pinokkio89/ScreenShot2014-01-08at232009_zps087511a2.png) Now I would like to have similar looking captions (same font size etc.) which is currently not the case.


title: table in LaTeX giving error

text: I'm trying to create the table using the below script and its giving this error > >     "! Missing $ inserted.<inserted text> $ l.689 \end{tabularx}" >                 \begin{table*}[t]     \centering\setlength{\tabcolsep}{.3\tabcolsep}     \begin{tabularx}{\linewidth}{|*2{>{\centering\hsize=1.6666\hsize}X|}*8{>{\centering\arraybackslash\hsize=.83333\hsize}X|}}     \hline     {\bf Point of Comparison} & {\bf X} & {\bf Y} & {\bf Z} & {\bf Average_entropy} & {\bf TC & {\bf RT}\\          \hline     \end{tabularx}     \caption{specs}     \label{tab:template}     \end{table*}


title: Figure reference problems

text: My problem seems to be simple although I could not find any solutions for it yet. I am writing my thesis in LaTeX, but I am totally new to this type of language. I am trying to reference a figure as:               (see Figure~\ref{fig:transistor1})      whereas the figure is defined right after the reference as:               \begin{figure}[htb]     \centering     \includegraphics[width=0.4\linewidth]{./_pic/transistor1}     \caption[The first transistor]{The first point-contact transistor developed by Bell Laboratories}     \label{fig:transistor1}     \end{figure}      During compilation, I get the error " _Paragraph ended before \Hy@setref@link was complete_ ", and of course in the compiled pdf there is not any number after the word Figure, moreover the ) symbol is also missing. I've tried changing the order of the figure and its reference, leaving the () marks but nothing helped. I am waiting for your help guys, and thank you in advance :) **Update:** MWE:               \documentclass[a4paper,12pt,twoside,openright]{report}          \usepackage[pdfusetitle, colorlinks, filecolor={[rgb]{0,0,1}},urlcolor={[rgb]{0,0,1}}, citecolor={[rgb]{0,0,0.4}}, linkcolor={[rgb]{0,0,0.4}}, bookmarks]{hyperref}          \begin{document}     \chapter{MEMS technology}          \ref{fig:transistor1}          \begin{figure}[htb]     \centering     \caption[The first transistor]{The first point-contact transistor developed by Bell Laboratories}     \label{fig:transistor1}     \end{figure}          \end{document}      Now if you compile this without the hyperref package, than with it, you can get the same error. If you compile again, the error disappears in the MWE (however in the whole document the error stays). **Update#2:** Now I have managed to find the proper MWE, the problem occours when the \selectlanguage command is used:               \documentclass[a4paper,12pt,twoside,openright]{report}     \usepackage[british,german,hungarian]{babel}     \usepackage[pdfusetitle, colorlinks, filecolor={[rgb]{0,0,1}},urlcolor={[rgb]{0,0,1}}, citecolor={[rgb]{0,0,0.4}}, linkcolor={[rgb]{0,0,0.4}}, bookmarks]{hyperref}          \begin{document}     \selectlanguage{british}     \chapter{MEMS technology}          \ref{fig:transistor1}          \begin{figure}[htb]     \centering     \caption[The first transistor]{The first point-contact transistor developed by Bell Laboratories}     \label{fig:transistor1}     \end{figure}          \end{document}      Thank you in advance Adam


title: General questions regarding Bakoma

text: 1. How do I enter a mathematical symbol like alpha or Beta? Is there a nice keyboard shortcut like CTRL-beta (as in scientific workplace)?   2. Can I define my own keyboard shortcuts?   3. How do I paste figures from MATLAB?   4. Can I give names to MY references, equations and figures, etc. like `eq:LagrangeFormula`? Like automatic referencing.   5. How many formats/packages do I have?   6. Can the output be read by regular LaTeX software?


title: Xetex does not use any of my installed fonts in Beamer document

text: I recently upgraded to Xubuntu 14.04 which has texlive 2013 in the repositories. Before, I used Ubuntu 12.04 with texlive 2012. Everything works except that when I compile my XeTeX documents they come out with the LM-Modern font. No matter what font I choose with `\setmainfont`. I have not deleted any fonts from my systems home directory and e.g. Libreoffice sees all fonts. I already run `texhash` in terminal but this had no effect. Could somebody help me? I urgently need to compile a document that should look nice.


title: Nomenclature not being assigned proper page number

text: The following is my MWE:               \documentclass[12pt,twoside]{report}          \usepackage[intoc]{nomencl}          \newenvironment{preliminary}%     {\pagestyle{plain}\pagenumbering{roman}}%     {\pagenumbering{arabic}}          \makenomenclature          \begin{document}     \nomenclature{$m$}{The mass of one angel}          \begin{preliminary}       \tableofcontents         \printnomenclature[6cm]        \end{preliminary}          \chapter{Should be on page 1}     text     \newpage     \chapter{Should be on page 2}     more text          \end{document}      Whats happening is that the nomenclature should be assigned a page value of ii as it is part of the preliminary environment however instead it is being assigned the page value 1.


title: Tree like items list

text: I'm trying to build a list in a file based on the Tufte-Latex book template: https://code.google.com/p/tufte-latex/ In keeping with the clean design, I don't need any font changes, blod or italics, and would prefer to avoid bullet points. Any idea how I can recreate the neat line-marking of this example? ![Picture of layout](https://i.stack.imgur.com/8U1qT.png)


title: How can I create "unbound" horizontal bar plots?

text: I'm trying to replicate the following using tikz and/or pgfplots: ![Segments with time points](http://i.stack.imgur.com/zuiRH.png) I've tried to adapt the code from ybar stacked plot with negative coordinates, but the bars seem to be bound to the axes (i.e., I wasn't able to output anything like the red segment in the diagram). Your help is much appreciated! Edit: Added sample code. I would like the bottom orange segment (at -4) to disappear, and to be able to add dashed vertical lines.               \documentclass{article}     \usepackage{pgfplots}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}         \begin{axis}[             xbar stacked,             bar width=10pt,             axis lines*=middle,             axis on top=false,             after end axis/.code={                 \node at ({rel axis cs:0,0}|-{axis cs:0,0}) [anchor=east] {0};             }         ]           \addplot[             fill=cyan,             draw=none,             bar shift=-8pt,             mark options={                 gray,                 thick,                 dashed             },             mark=waterfall bridge           ] coordinates { (1, 3) (2, 3) (3,3) (4,3) };           \addplot[             fill=orange,             draw=none,             bar shift=8pt           ] coordinates { (1,-4) (2,-4) (3,4) (4,4) };         \end{axis}       \end{tikzpicture}            \end{document}     \end{filecontents*}


title: How to use \rightarrow in normal sentence construction

text: I want to use the `\rightarrow` without the `\mathit` command. Here is what I want to write: `[ID, List of symbols] \rightarrow Sequence of rules` but when I write it using `\mathit` command all the spaces are collapsed.               (\mathit{[ID, List of symbols]  \rightarrow  Sequence of rules }\)      How do I correct this?


title: = in algorithm when using hebrew and algorithm2e

text: For some reason an = sign appears at the beginning of every line in an algorithm block when using hebrew and algorithm2e. Removing hebrew removes the line. For example:               \documentclass{article}     \usepackage{algorithm2e}     \usepackage[hebrew,english]{babel}          \begin{document}     \begin{algorithm}       \KwData{$x$}          $y \gets x$\\       \KwOut{$y$}     \end{algorithm}      \end{document}      Renders: ![enter image description here](http://i.stack.imgur.com/m914a.png) While:               \documentclass{article}     \usepackage{algorithm2e}     \usepackage[english]{babel}          \begin{document}     \begin{algorithm}       \KwData{$x$}          $y \gets x$\\       \KwOut{$y$}     \end{algorithm}      \end{document}      Gives ![enter image description here](http://i.stack.imgur.com/Y24mk.png) Any ideas? Just in case you're thinking there's something wrong with my install, try it yourself on sharelatex Edit: Added sharelatex public example Edit(2): Found possible related post algorithmic + babel with Hebrew conflict: Numbering missing


title: Avoid background to be shown in ToC and chapter page

text: I'm using the background package. Is there any option to remove the background from the ToC and from the first page of each chapter? Besides, is it possible to override the background on some pages and then getting back to the globally set one?


title: Changing Theorem(AMS) in Lyx

text: I use the theorem(AMS) module in Lyx. If i use the Lemma, Definition etc. enviroment then Lemma for example is written in bold letters. If i use the remark enviroment its in italic. I would like to change it, so that it is in bold as well. How can I do that?


title: minted package call from function

text: My aim is to call source(highlighted by minted package) in one of the input.tex file instead of master tex. This one does not work :               \documentclass{uoyths}     \usepackage{minted}     \begin{document}     \input{chap0.tex}   %Content          \begin{mainMatterEnv}          \CallMintedCodeFromAnotherFile{}              \end{mainMatterEnv}     \end{document}      in chap0.tex file :               \def\CallMintedCodeFromAnotherFile     {     \begin{minted}{c}     int main()     {         printf("hello, world");         return 0;     }     \end{minted}     }      This one does work in the same file and same pc, any idea ?               \documentclass{uoyths}     \usepackage{minted}     \begin{document}     \input{chap0.tex}   %Content          \begin{mainMatterEnv}     \begin{minted}{c}     int main()     {         printf("hello, world");         return 0;     }     \end{minted}                     \end{mainMatterEnv}     \end{document}      Error message is : ![enter image description here](http://i.stack.imgur.com/nzrCe.jpg) I found the solution and post it to my blog as well. http://www.ozturkibrahim.com/highlighting-source-code-for-latex/ The solution is : I have put the piece of code to hello.cpp instead of directly inside \def and then I read it from this source file inside \def. It works perfectly:               \def\CallMintedCodeFromAnotherFile     {     \inputminted{c++}{hello.cpp}     }


title: Relative paths when using tikz externalize + subfiles

text: I have a large document which consists of ~100 smaller files which are compiled together using the subfiles package. To be able to use a common style file for them, whose relative path should be the same from every compilable file, I use the following folder structure:               Project folder             projectstyle.sty          -- Main folder          main.tex          -- Subfolder 1          subfile1a.tex          subfile1b.tex          -- Subfolder 2          subfile2a.tex          subfile2b.tex      and write               \usepackage{../projectstyle}      at the top of the file main.tex. However, since the project is large and contains a lot of tikz file, the compilation now takes quite a long time. I can speed up the compilation of the main file by using the externalize command from the tikz/pgf package by writing e.g.               \usetikzlibrary{external}     \tikzexternalize[prefix=tikz/]       at the top of the main file. This works when compiling the main file, given that I put a folder named tikz in the Main folder. However, I would also make this work when compiling the subfiles by them selves, as this is the whole point of using the subfiles package. Here it would be optimal if I could use a relative path to the folder in which to externalize the graphics, and put this on the same level as the style file, and then write               \tikzexternalize[prefix=../tikz/]       but this does not seem to work, as the compiler (pdflatex) complains that               ! I can't write on file `../../tikz/main-figure0.md5'.      when I try to compile the main file. Is there any way to get around this? I do realize one solution would be to write               \tikzexternalize[prefix=tikz/]      in the main file (or in the style file), and then add a folder named tikz to all folders which contains compilable documents, but then I would have two copies of each image, which seems to be quite a waste of space...


title: \endnote inside \author tag

text: I have a rather complicated document of the {scrartcl} class, derived from the .tex file I downloaded off this page http://www.howtotex.com/templates/template-added-two-column-color-article/ I try to use the endnotes package to specify the authors' affiliations (it won't fit in the template prescribed format). Sadly I cannot use the \endnote{} macros inside the \author{} field. Compilation fails on that line with:               ./openpr.tex:81: Argument of \reserved@a has an extra }.      I have tried the enotez package but the line where I put the endnote fails with:               ./openpr.tex:81: Use of \enotez_endnote_aux:w doesn't match its definition.      I get the error with this minimal example:               \documentclass[DIV=calc,paper=a4,fontsize=11pt,twocolumn,hyperref]{scrartcl}                        % KOMA-article class     \usepackage[english]{babel}                                     % English language/hyphenation     \usepackage{endnotes}                                           % Used for annoting author affiliations at the ened          \usepackage{titling}                                                            % For custom titles          \title{Concepts}                    % Title of article goes here          \author{Lala \endnote{a}}                                   % Authors' names goes here     \begin{document}     \maketitle     \theendnotes     \end{document}      Apparently it works if I remove \usepackage{titling}, but I need that to make my title sexy :( Could you guys help me get an endnotes' section with all my author affiliations?


title: Pie chart slice with pattern background

text: I was able to create a pie chart based on the answer in How to draw Bar & Pie Chart. I realized my document is printed in grayscale and learned about patterns (Where is the pattern list gallery for pgfplots?) that can be applied to a plot object. In bar charts I can easily provide one using `\addplot` based from my question before in Add background pattern to tikzpicture vertical bars. How can I do this with a pie chart with each slice having a unique pattern background? Here is the code I used with flat colors:               \documentclass{standalone}     \usepackage{tikz,pgf}           \definecolor{rosso}{RGB}{220,57,18}     \definecolor{giallo}{RGB}{255,153,0}     \definecolor{blu}{RGB}{102,140,217}     \definecolor{verde}{RGB}{16,150,24}     \definecolor{viola}{RGB}{153,0,153}          \makeatletter          \tikzstyle{chart}=[         legend label/.style={font={\scriptsize},anchor=west,align=left},         legend box/.style={rectangle, draw, minimum size=5pt},         axis/.style={black,semithick,->},         axis label/.style={anchor=east,font={\tiny}},     ]          \tikzstyle{bar chart}=[         chart,         bar width/.code={             \pgfmathparse{##1/2}             \global\let\bar@w\pgfmathresult         },         bar/.style={very thick, draw=white},         bar label/.style={font={\bf\small},anchor=north},         bar value/.style={font={\footnotesize}},         bar width=.75,     ]          \tikzstyle{pie chart}=[         chart,         slice/.style={line cap=round, line join=round, very thick,draw=white},         pie title/.style={font={\bf}},         slice type/.style 2 args={             ##1/.style={fill=##2},             values of ##1/.style={}         }     ]          \pgfdeclarelayer{background}     \pgfdeclarelayer{foreground}     \pgfsetlayers{background,main,foreground}               \newcommand{\pie}[3][]{         \begin{scope}[#1]         \pgfmathsetmacro{\curA}{90}         \pgfmathsetmacro{\r}{1}         \def\c{(0,0)}         \node[pie title] at (90:1.3) {#2};         \foreach \v/\s in{#3}{             \pgfmathsetmacro{\deltaA}{\v/100*360}             \pgfmathsetmacro{\nextA}{\curA + \deltaA}             \pgfmathsetmacro{\midA}{(\curA+\nextA)/2}                  \path[slice,\s] \c                 -- +(\curA:\r)                 arc (\curA:\nextA:\r)                 -- cycle;             \pgfmathsetmacro{\d}{max((\deltaA * -(.5/50) + 1) , .5)}                  \begin{pgfonlayer}{foreground}             \path \c -- node[pos=\d,pie values,values of \s]{$\v\%$} +(\midA:\r);             \end{pgfonlayer}                  \global\let\curA\nextA         }         \end{scope}     }          \newcommand{\legend}[2][]{         \begin{scope}[#1]         \path             \foreach \n/\s in {#2}                 {                       ++(0,-10pt) node[\s,legend box] {} +(5pt,0) node[legend label] {\n}                 }         ;         \end{scope}     }          \begin{document}          \begin{figure}[!htbp]     \centering     % \footnotesize     \sffamily     \noindent\begin{tikzpicture}     [         pie chart,         slice type={comet}{blu},         slice type={legno}{rosso},         slice type={coltello}{giallo},         slice type={sedia}{viola},         slice type={caffe}{verde},         pie values/.style={font={\small}},         scale=2     ]              \pie{2008}{73/comet,13/legno,7/sedia,7/coltello}         \pie[xshift=2.2cm,values of coltello/.style={pos=1.1}]%             {2009}{52/comet,23/legno,17/sedia,3/coltello,5/caffe}         \pie[xshift=4.4cm,values of caffe/.style={pos=1.1}]%             {2010}{56/comet,26/legno,9/sedia,7/coltello,2/caffe}              \legend[shift={(0cm,-1cm)}]{{Comet (Pordenone)}/comet, {Wood and furniture (Livenza)}/legno, {Knife (Maniago)}/coltello}         \legend[shift={(3cm,-1cm)}]{{Chair (Manzano)}/sedia, {Coffee (Trieste)}/caffe}          \end{tikzpicture}     \caption{This is a caption}     \label{fig:this-is-a-label}     \end{figure}          \end{document}


title: add urls in reference

text: i want to add urls in my reference i am using the following code in my .tex file                   \bibitem{bl}Business Logic layer, \url{http://en.wikipedia.org/wiki/Business_logic_layer}, 23 12 2011.      however, i get the following output in my console                   ! Undefined control sequence.         l.477 \bibitem{bl}Business Logic layer, \url                                             {http://en.wikipedia.org/wiki/Bu...              ?          ! Missing $ inserted.         <inserted text>                  $         l.477 ...rl{http://en.wikipedia.org/wiki/Business_                                                   logic_layer}, 23 12 2011.         ?          ! Extra }, or forgotten $.         l.477 ....wikipedia.org/wiki/Business_logic_layer}                                                   , 23 12 2011.         ?               ! LaTeX Error: Command \item invalid in math mode.      whereas my .pdf file entry against this code is this.                   Business Logic layer,      http://en.wikipedia.org/wiki/Businesslogiclayer; 23122011 what is this error about and how can i set this right?


title: How can I get the .dvi file from Latex in addition to or instead of a pdf

text: What is the command and parameters that I would type in to generate and save a dvi output from my latex file? In other word I want the dvi file instead of/ or in addition to the pdf file. I use TexWorks. What folder would I run this command from? I am not an experienced Latex user. Will the command and parameters be different if I am using TexWorks to run a LuaLatex vs a pdfLatex? I also use Windows 7 64bit operating system. I am trying to get an image of tikz graphics I have produced with braille labels (using a systems font) that is SVG/JPEG/GIF so that I can import it into Tiger embosser software. The procedure that I was told to use by my boss is to take a screenshot of the pdf, copy and paste that into word, and then paste from word into the Tiger Software suite. So far, when I copy and paste a screenshot of the graphic the braille labels are misread. One dot is seen as 2 or 3 dots, which I assume is because of the difference in resolution. Then I have to spend time erasing all the labels and redoing them in the printer software suite, which is like paint, but worse. I read that one can convert the dvi file to image file types like jpeg etc here. I am also trying to get an image file so that I can set the resolution of the image in another software like Gimp. I think I need a resolution of 20 dpi because the image is to be "printed" with an embosser printer that has that resolution. The file type that the printer uses as an input is a .prn. Ultimately, I am trying to convince the staff here at Disability services that working in Latex would be beneficial, but it is a hard sell since no one else wants to learn it. I think it would make a difference if I could show them that it could save them time and make better graphics.


title: Edge labels at same distances from the center

text: The attached code draws a vertex with five labelled outgoing edges. The labels should all be placed at the same distance from the center, but at least perceptually they are not. How can I fix this?               \tikzstyle{vertex}=[circle,fill=red,draw=black,line width=0.8 pt]     \tikzstyle{none}=[]     \tikzstyle{edge}=[-,draw=black,line width=0.8 pt]     \tikzstyle{label}=[pos=0.4, auto, font=\scriptsize]          \begin{tikzpicture}         \path [use as bounding box] (-1,-1) rectangle (1,1);         \node [style=vertex] (0) at (0, 0) {};         \node [style=none] (1) at (-0, 1) {};         \node [style=none] (2) at (0.95, 0.31) {};         \node [style=none] (3) at (0.59, -0.81) {};         \node [style=none] (4) at (-0.59, -0.81) {};         \node [style=none] (5) at (-0.95, 0.31) {};              \draw [style=edge] (0) to node[style=label]{1} (1);         \draw [style=edge] (0) to node[style=label]{2} (2);         \draw [style=edge] (0) to node[style=label]{3} (3);         \draw [style=edge] (0) to node[style=label]{4} (4);         \draw [style=edge] (0) to node[style=label]{5} (5);     \end{tikzpicture}      ![Labels not at \(visually\) equal distances from center](http://i.stack.imgur.com/7rtfA.png)


title: "Missing $ inserted" error; can't figure out what is causing it

text: Here is the code, getting an error involving a missing `$` but I'm certain it's all correct. My guess is I am missing some subtle thing. Here is the specific error message:               Missing $ inserted. <inserted text> $ l.70 \textbf{Theorem. (Cancellation)}\\      And the input:               \documentclass{article}     \usepackage{amssymb, amsmath, amstext, amscd, verbatim}          \newenvironment{parts}{\vspace{1ex}\begin{enumerate}\renewcommand{\itemsep}{1ex}          \renewcommand{\labelenumi}{(\alph{enumi})}}{\end{enumerate}}          \DeclareMathOperator*{\inter}{int}     \DeclareMathOperator*{\clos}{cl}     \DeclareMathOperator*{\bound}{bd}          %\everymath{\displaystyle}          \begin{document}          \title{Notes}     \author{}     \date{}     \maketitle          \tableofcontents     \pagebreak          \noindent     \textbf{Definition.} A \emph{group} $G$ is a pair $(S,*)$. Let $S \neq \varnothing$ be a set and $*$ a binary operation satisfying     \begin{parts}     \item $*$ is associative     \item $\exists e \in S$ such that $e*a=a*e=a \forall a \in S*$     \item $\forall a \in S, \exists b \in S$ such that $a*b=b*a=e$.     \end{parts}          \noindent     \textbf{Definition.} A group $G = (S,*)$ is \emph{abelian} if $*$ is commutative.\\          \noindent     \textbf{Examples.}\\     (1) $(\mathbb{Z},+)$ with $e=0, b=-a$ is an abelian group.     (2) $(\mathbb{Z},\cdot)$ is \textbf{not} a group.     (3) $(\mathbb{R}\setminus \{0\}, \cdot)$ with $e=1, b=a^{-1}$ is an abelian group.     (4) Let $n \in \mathbb{P}$ be a positive integer, $T = \{1,2,\ldots,n\}$, and $S =$ set of permutations of $T =$ set of bijections on $T$.     S is function composition, hence associative.     (5) $S_n$ is the symmetric group on $n$ letters.     Let $n = 3$.     $ \left( \begin{matrix}     1 & 2 & 3 \\     3 & 1 & 2 \end{matrix} \right) *      \left( \begin{matrix}     1 & 2 & 3 \\     3 & 2 & 1 \end{matrix} \right) =      \left( \begin{matrix}     1 & 2 & 3 \\     2 & 1 & 3 \end{matrix} \right)     \left( \begin{matrix}     1 & 2 & 3 \\      3 & 2 & 1\end{matrix} \right) *     \left( \begin{matrix}     1 & 2 & 3 \\     3 & 1 & 2 \end{matrix} \right) =     \left( \begin{matrix}     1 & 2 & 3 \\     1 & 3 & 2 \end{matrix} \right) $.     \textbf{Note.} $\left| S_n \right| = n!$     (6) $n \in \mathbb{P},\quad M_n(\mathbb{Q}),\quad S =$ the set of non-singular $n \times n$ matrices,\quad $*=$ matrix multiplication.\\     Have the \emph{general linear group} $GL(n,\mathbb{Q})$ and     $e = \left( \begin{matrix}     1 & 0 & \ldots & \ldots 0\\     0 & \ddots & 0 & \ldots & 0\\     0 & \ldots & \ldots & \ldots & 1$     $GL(n,\mathbb{Z}_p), p$ is a prime. $\mathbb{Z}_p = \left\{ [0],[1],\ldots,[p-1]\right\}$.     \textbf{Theorem. (Cancellation)}\\     If $G = (S,*)$ is a group and $a*b = a*c$, then $b=c$ (and $b*a = c*a \Rightarrow b=c$).\\     \textbf{Proof.}\\     Let $d \in S$ satisfy $d*a = a*d = e$ ($e$ is the identity element). Then $d*(a*b) = d*(a*c)$.      By associativity, we get $(d*a)*b = (d*a)*c \Rightarrow b = e*b = e*c = c$.\\          \noindent     \textbf{Corollary.}\\     If $a,b \in G$ and $a*b = a$, then $b=e$.\\     \textbf{Proof.} $a*b = a = a*e$. So $b=e$.          \noindent     \textbf{Corollary.}\\     Let $a,b,c \in G$. If $a*b=e=a*c$, then $b=c$.\\          \noindent     Therefore,     \begin{parts}     \item identity element is unique     \item for each $a \in G$, the inverse of $a$ is unique.     \end{parts}          \textbf{Notation.}\\     For multiplication, we write $a\cdot b$ and the inverse of $a$ as $a^{-1}$. Also, we have that $e=1$.\\     For addition in abelian groups, we write $a+b$ and the inverse of $a$ as $-a$. Also, we have that $e=0$.\\          \end{document}


title: List of Figures: How do I get a vertical space between figures from my final chapter and my first appendix?

text: I'm using `tocloft` with the `report` document class. I have four chapters and some appendices. My List of Figures produces vertical spacing between figures from different chapters, but it does _not_ add a vertical space between the last figure from my last chapter and the first figure from my first appendix:               3.7     3.8          <-- appropriate spacing     4.1     4.2     A1   <-- no preceding v-space     A2      Can anyone suggest what I might be doing wrong (and/or how to fix this)?


title: LaTeX beamer presentation-package 16:9 aspect ratio?

text: I'm programming a presentation in LaTeX using the `beamer` class. However, it defaults to 4:3 aspect ratio slides, while everything I use is 16:9. Is there an easy way to change this using a command or two?


title: What is the best way to typeset an algorithm with several procedures?

text: The title question sums it all.


title: Adding colour to table cells when decimals are aligned with arrays and {.} used in the column definition

text: I've got a table (below) that aligns the decimal points of my data - I wish to highlight a value (2 adjacent cells), however this leaves a white space where the decimal point is! If I increase the left or right overhang it eventually cover the decimal point completely! Here's the basic table:               \begin{tabular}{m{30mm}r@{.}lr@{.}lr@{.}lr@{.}l}          Point 1 & -0&0569& 0&0138& -0&1133& 0&1275      \tabularnewline           Point 2 & -0&1239& -0&0189& -0&1092& 0&1662 \tabularnewline          Point 3 &  0&0209& 0&1032& -0&2188& 0&2428  \tabularnewline           Point 4 & -0&3064& -3&2415& 0&1353& 3&2588  \tabularnewline          \end{tabular}         I can't find the answer to this anywhere else... please help!


title: TikZ Document Navigation (\label and \ref commands)

text: I am currently a university student studying engineering. I have been a user of LaTeX for a few years now and cannot work out how to solve the following issue. In Australia, there are standards which describe the way in which referencing within technical drawings should be done. I am trying to create a method within LaTeX to allow me to create a set of drawings (all TikZ pictures) where sections, elevations and details can all be navigated between within the document (using the hyperref package). Unfortunately, I am currently receiving an error stating that the labels are undefined and thus the referencing breaks down. I think this is because the labels are not being associated with a 'figure' type environment. Ideally, these links would appear as text that, when clicked, would take the viewer to the page on which the section is shown. In addition, and if possible, it would also be great if reference could be made to the page on which the section is shown. I have included below a minimal example that shows my thoughts. Perhaps someone has already managed to solve this issue.               \documentclass{report}          \usepackage{tikz,hyperref}          \begin{document}          \begin{tikzpicture}          \node at ( 20 mm , 20 mm ) {Hello World!\label{hello}} ;     \end{tikzpicture}          \newpage          \begin{tikzpicture}          \node at (20 mm , 20 mm ) {Reference\ref{hello}};          % This (hopefully) would make it possible to link          % from Page X to Y within the .pdf document.     \end{tikzpicture}          \end{document}      Thank you to everyone who takes the time to read this and I look forward to receiving your response.


title: Align a Table with the Edge of Text

text: In a document I am working on, I want to use a table. However, the point at which the table belongs is heavily indented due to multiple enumerations. This results in the table being placed much farther to the left than is visually appealing. How do I make the table's left edge be in line with the left edge of the text directly above it? I am aware of the ability to center the table, and this option is certainly better than leaving it awkwardly to the left, but I would much prefer having it pleasantly and, if possible, perfectly aligned. An example of my predicament is as follows:               \documentclass{article}     \usepackage[utf8]{inputenc}     \begin{document}     \noindent I can align a table to the left.     \begin{enumerate}     \item However, it stays as far left as the margin allows.     \begin{enumerate}     \item This looks pretty ugly.     \begin{enumerate}     \item The effect is compounded with indentations such as the ones that result from a list.     \end{enumerate}     \end{enumerate}     \end{enumerate}     \begin{table}[h]     \begin{tabular}{|r|c|c|c|c|c|}     \hline                 & A & B & C & D & E \\ \hline     First Row:  & 1 & 2 & 3 & 4 & 5 \\ \hline     Second Row: & 6 & 7 & 8 & 9 & 10 \\ \hline     Third Row:  & 11 & 12 & 13 & 14 & 15 \\ \hline     \end{tabular}     \end{table}     \end{document}      Thank you in advance for any assistance you can provide. **Disclaimer:** I am quite new to using LaTeX, and most of the stuff I am using is already generated for me, with me just filling in the content. As a result, with respect to LaTeX, I rarely know what I'm talking about.


title: How can I use line numbers with leading zeros?

text: I use the `listings` package for source-code and have read all documentation. However, it appears that leading zeros for line numbers are not implemented as standard option yet. How can I redefine the line numbering so that it uses additional zeros?               Given: 1 ... 10 ... 100 ... 1000 ....     Want: 01 ... 10 ... 99 (if largest printed number <100)     Want: 001 ... 010 ... 100 ... 999 (if largest printed number <1000) etc.      Alternatively: How can I redefine the alignment after the number with the most digits?               Given:    Want:     1            1     ...        ...     10          10     ...        ...     100        100      Added Latex sample:               \documentclass{article}     \usepackage{listings}      \lstset{language=Ruby,             basicstyle=\ttfamily,              numbers=right,             numberstyle=\ttfamily,            % solution for right alignment:           % numberstyle=\ttfamily\makebox[3em][r],             showstringspaces=false}          \begin{document}     \begin{lstlisting}     #!/usr/bin/env ruby     # test of latex listings package     # uses line numbering with 1-12.      # should be using leading zeros, like 01-12.     puts "line number 05."     puts "line number 06."     puts "line number 07."         puts "line number 08."     puts "line number 09."     puts "line number 10."     puts "line number 11."     puts "line number 12."     \end{lstlisting}     \begin{lstlisting}[firstnumber=98]     puts "line number 098."     puts "line number 099."     puts "line number 100."     puts "line number 101."     puts "line number 102."     \end{lstlisting}     \begin{lstlisting}[firstnumber=998]     puts "line number 0998."     puts "line number 0999."     puts "line number 1000."     puts "line number 1001."     puts "line number 1002."     \end{lstlisting}     \begin{lstlisting}[firstnumber=9998]     puts "line number 09998."     puts "line number 09999."     puts "line number 10000."     puts "line number 10001."     puts "line number 10002."     \end{lstlisting}     \begin{lstlisting}[firstnumber=8]     puts "line number 08."     puts "line number 09."     puts "line number 10."     puts "line number 11."     puts "line number 12."     \end{lstlisting}     \end{document}


title: exam class - permute mc answer choices, generate answer key

text: I happily use the `exam` document class to create exams and quizzes. I often make at least part of my exams multiple choice, and I'd like to be able to   1. generate multiple versions of the exam by permuting the answer choices (automatically, rather than by hand as I do now), and    2. generate an answer key for each version when compiling the exam with answers on.  Do any of you do that or have suggestions about how I might be able to implement that?


title: Change font family in pgfplots (followup)

text: The MWE below shows that the solution at How can I change the font family in pgfplots? does not cover all the cases. The digits in the plot itself and the subscript in math mode in the title need further attention. ![enter image description here](http://i.stack.imgur.com/TDgYf.png)               \documentclass{standalone}     \usepackage{tikz,pgfplots}     \usepackage{pgfplotstable}          %deal with warning message in log     \pgfplotsset{compat=1.8}          \usepackage{helvet}     \usepackage[eulergreek]{sansmath}     \pgfplotsset{       tick label style = {font=\sansmath\sffamily},       every axis label = {font=\sansmath\sffamily},       legend style = {font=\sansmath\sffamily},       label style = {font=\sansmath\sffamily}     }          \pgfplotstableread[col sep=comma]{     name, footprint     Google search,  0.2     Movie download, 20     }\carbonfootprints          \begin{document}     \begin{tikzpicture}[font=\sffamily]          \begin{axis}[            xbar, xmin=0,           tick style={draw=none},           width=8cm, height=3cm,            title={Estimated carbon footprint, g CO${}_2$},            enlarge y limits=0.3,           ytick=data,           yticklabel style={align=right},           yticklabels={             2. Google search,              1. Movie download           },           nodes near coords,           nodes near coords align={horizontal},          ]         \addplot [fill=red] table [x=footprint, y expr=\coordindex]                   {\carbonfootprints};     \end{axis}      \end{tikzpicture}     \end{document}


title: `\write` non-printable ASCII characters to a file

text: `\immediate\write\SomeStream{x}` writes `x` to the file open in `\SomeStream`. I would like to write non-printable ASCII characters, such as ``, to a file. My naive guess is               \begingroup         %To keep the catcode change local     \catcode`\=11     \immediate\write\SomeStream{}     \endgroup      But this writes the three characters `^^A` instead of the single character ``. Is there a way to prevent TeX from sanitizing its output? MWE:               \documentclass{minimal}     \newwrite\SomeStream     \immediate\openout\SomeStream NonPrintableASCII.test          \begingroup         %To keep the catcode change local     \catcode`\=11     \immediate\write\SomeStream{}     \endgroup          \immediate\closeout\SomeStream     \begin{document}     \end{document}      EDIT: My goal was to write a file and reread it with potentially crazy catcode changes (And I am using non-printable characters rather than `^^A` to be more robust.). `\scantokens` does the job (see below).


title: Which commands does LyX run to generate PDF (pdflatex) and other export formats?

text: What commands should I run manually to repeat all the steps LyX makes to generate a final output (like pdflatex PDF) for a specific document? I need it for using in a report generator written in another language. I've looked into "LaTeX Log", but is seems like having outputs of commands, not commands itself.


title: reproduce section at different position

text: I would like to reproduce a `\section` at a later position, with the same number as at the original position. I tried               \newsavebox{\meinebox}     \savebox{\meinebox}[80mm][l]{\section{Hier}}     \usebox{\meinebox}     A lot of text.     \usebox{\meinebox}      but LaTeX gives an error, `LaTeX Error: Something's wrong--perhaps a missing \item.`


title: Command \* already defined ... see p.192 of the manual

text: My code had:               \newtheorem*{theI}{Thesis I}      And it gives me the error:               Command \* already defined. Or name \end... illegal, see p.192 of the manual.          1.16 \newtheorem*{theI}{                             Thesis I}


title: How to parse optional arguments without keyval?

text: The current implementation only supports rounding with the specified digits in the optional arguments.               \documentclass{beamer}     \usepackage{multido}     \usepackage{pstricks}     \usepackage[nomessages]{fp}          % \pstVerb concatenator     \def\LoadConstants{}          % Constant declarator invoked in the preamble     \newcommand\const[3][]{%         \if\relax\detokenize{#1}\relax             \edef\temporary{#3}%         \else             \edef\temporary{round(#3:#1)}%         \fi         \expandafter\FPeval\csname#2\expandafter\endcsname             \expandafter{\expandafter{\temporary}}%         \toks0=\expandafter{\LoadConstants\pstVerb}         \edef\LoadConstants{\the\toks0 {/#2 \csname#2\endcsname\space def}}}          \makeatletter     \def\pst@@picture@i[#1]#2(#3,#4){%     % BEGIN - redefine \const for invocation inside pspicture         \renewcommand\const[3][]{%         \if\relax\detokenize{##1}\relax             \edef\temporary{##3}%         \else             \edef\temporary{round(##3:##1)}%         \fi         \expandafter\FPeval\csname##2\expandafter\endcsname             \expandafter{\expandafter{\temporary}}%             \pstVerb{/##2 \csname##2\endcsname\space def}\ignorespaces}%     % END - redefine \const for invocation inside pspicture         \@ifnextchar(% ignore anything between [] and ()     % BEGIN - inject \LoadConstants into pspicture         {\pst@@@picture[#1](#3,#4)\LoadConstants}%         {\pst@@@picture[#1](0,0)(#3,#4)\LoadConstants}%     % END - inject \LoadConstants into pspicture         }     \makeatother          \usepackage[active,tightpage]{preview}     \PreviewEnvironment{pspicture}     \PreviewBorder=25pt\relax               \SpecialCoor     \const{Side}{root(2,17)}% the square root of 17          \begin{document}     \begin{frame}        \begin{pspicture}(\Side,\Side)         \psframe(!Side dup)\pause         \multido{\i=0+30}{12}{%             \const[5]{temp}{cos(\i*pi/180)}             \rput{\i}(!Side 2 div dup dup \i\space PtoC 3 1 roll add 3 1 roll add){$\temp$}\pause         }     \end{pspicture}     \end{frame}     \end{document}      ## Objective: I want to make `\const` behave as follows. If we invoke   * `\const[4,r]{...}{...}`, it will use `round` with 4 digits after .   * `\const[4,t]{...}{...}`, it will use `trunc` with 4 digits after .   * `\const[c]{...}{...}`, it will use `clip` to trim all trailing zeros Any idea to improve the code is welcome!


title: XeLaTeX: how do I make paper to be exactly the size of the content?

text: In LaTeX I can make a document to be exactly the size of the content:               \documentclass{article}     \usepackage[active]{preview}     \begin{document}     \begin{preview}       \[       \pi = \sqrt{12}\sum^\infty_{k=0} \frac{(-3)^{-k}}{2k+1}       \]     \end{preview}     \end{document}      And compile that with               latex foo.tex     dvipng -T tight -D 231.26 -o foo.png foo.dvi      it makes an image exactly the size of the content (formula). How do I get the same with XeLaTeX? I need that because I use inkscape export to latex for images -- and sometimes I need the images as standalone files, not inside a tex document. **Edit** : Here's a full MWE:               \documentclass{article}     \usepackage{todonotes}          \begin{document}          \missingfigure[figwidth=6cm]{}          \end{document}      I actually use               \begin{figure}       \centering       \def\svgwidth{1\columnwidth}       \input{2dSqFermi_2el.pdf_tex}     \end{figure}      as a figure (that's what "inkscape export to latex" is about) -- but that's not important. So in the initial MWE I've just used formula. I see that the given answers already solve that.


title: overbrace/underbrace but with an arrow instead

text: Is there a similar command to `\overbrace{foo}^{bar}` but instead of braces, an arrow pointing up/down? EDIT: Here's a little demonstration of how I'd expect something like this to work: ![alt text](http://i.stack.imgur.com/lZMRX.jpg) And possible syntax would be `\overarrow{a=b}^{\text{theorem X}}`


title: How to embed a letter?

text: Suppose I am writing a novel using the book class, in which a correspondence from the hero to the heroine needs to be embeded, like this: > Dear Marie, > > I miss you very much, I'll come home in a week. > > Yours, > > Joseph How can this be done?


title: \Shortstack - Why it produces one line in Scriptsize

text: \documentclass[fleqn,12pt,a4paper]{article}     \usepackage{amstext, amsmath}          \begin{document}     \[       \alpha \xrightarrow[\stackrel{Alpha}{\shortstack[c]{\text{is Reactant}\\ \text{converting  to}}}]                          {\stackrel{Beta}{\shortstack[c]{\text{is a product }\\ \text{of reaction}}}}       \beta     \]     \end{document}      I have no clue why the first line in `\stackrel` is showing in scriptsize. How to get all the three lines to same fontsizes? I am doing this to get three lines over the arrow. Is there a different and easy way to produce 3 lines over and below the arrow? ![alt text](http://i.stack.imgur.com/J7yG2.jpg) Thanks for your help.


title: Is there a nag package for TikZ?

text: It turns out that I've been using several deprecated commands, such as `\tikzstyle` and `right of`. Is there any way to have TikZ or pdfLaTeX warn in those cases, such as `nag` does?


title: Expanding a macro into a long list for use with pgfplotstable

text: Failing again to get macros to work. I have the following M(n)WE               \documentclass[10pt]{article}     \usepackage{pgfplotstable}               \begin{document}          \xdef\mydef{     \foreach \a/\b in {3/0,3/2,10/2,20/2,24/0,25/2}{%     every row no \a\  col no \b/.style={postproc cell content/.style={@cell content=\fbox{{##1}}}},}     }}          \pgfplotstableset{\mydef}     \end{document}      and I'm trying to produce               \pgfplotstableset{     every row no 3 col no 0/.style={postproc cell content/.style={@cell content=\fbox{##1}}},     every row no 3 col no 2/.style={postproc cell content/.style={@cell content=\fbox{##1}}},     every row no 10 col no 2/.style={postproc cell content/.style={@cell content=\fbox{##1}}},     every row no 20 col no 2/.style={postproc cell content/.style={@cell content=\fbox{##1}}},     every row no 24 col no 0/.style={postproc cell content/.style={@cell content=\fbox{##1}}},     every row no 25 col no 2/.style={postproc cell content/.style={@cell content=\fbox{##1}}}     }      I'd love to say I have some glimmering of what I'm doing wrong but I have to confess that I absolutely don't. Any help very gratefully received. As an aside is there an easy way to pass a list as an argument to a `\def` or `\xdef` macro? That would make the final macro a lot more functional.


title: Problem with bibliography in Harvard style

text: I am trying to input Harvard style bibliography in my master thesis but I cant do it,in the Pdf file,I see the references but either they do not have the names at all, but they have the title of the book the publisher and the year or they are not placed in the appropriate position or either the url that I have inserted is not is not recognised. I am using a different file (.bib)               @InBook{Renewal,     ALTauthor = {Breuer, L. and Baum, D.},     ALTeditor = {•},     title = {An Introduction to Queueing Theory and Matrix-Analytic Methods},     chapter = {6},     publisher = {Springer},     year = {2005},     OPTkey = {•},     OPTvolume = {•},     OPTnumber = {•},     OPTseries = {•},     OPTtype = {•},     OPTaddress = {•},     OPTedition = {•},     OPTmonth = {•},     OPTpages = {•},     OPTnote = {•},     OPTannote = {•}     }      > [1] An Introduction to Queueing Theory and Matrix-Analytic Methods, chap- > ter 6. Springer, 2005. in the main program of my dissertation I have :               \bibliographystyle{plain}     \bibliography{Dissertation}     \end{document}      Am I doing something wrong?


title: Using macros in \DeclareGraphicsRule statement using shell command

text: I am currently working on a document which i am compiling under both linux and windows. As one of the images I use is a tif image, I'd like to have lualatex converting it on-runtime to a format it understands. Therefore, I managed to do this under linux using               \DeclareGraphicsRule{.tif}{png}{.png}%     {%       `convert #1 `dirname #1`/`basename #1 .tif`-tif-converted-to.png %     }     \AppendGraphicsExtensions{.tif}      This however is not portable to windows because of the `dirname` and `basename` commands (as installing ImageMagick makes `convert` available). Therefore, I would like to use the file parsing from latex to do this, but I could not find my way around it. The code I am currently trying to use is :               \makeatletter     \newrobustcmd*\dirname[1]{\filename@parse{#1}\filename@area}%     \newrobustcmd*\basename[1]{\filename@parse{#1}\filename@base}%     \DeclareGraphicsRule{.tif}{png}{.png}%     {%       `convert #1 \dirname{#1}/\basename{#1}-tif-converted-to.png %     }%     \makeatother     \AppendGraphicsExtensions{.tif}      However, `\DeclareGraphicsRule` seems to just ignore I have used macros in my command. So my question is the following :   * What am I doing wrong ?    * Is there a way around it ?  **EDIT :** Slightly changing the working command


title: Latex to ODF/DOC using mk4ht oolatex failing on equation arrays

text: Title says it all. **Anyone got any ideas on what I'm doing wrong? Is this a fundamental fault with oolatex conversion? Is there an alternative math format I can use?** Same math builds fine in latex and pdflatex. Example input (test.tex)               \documentclass{article}     \begin{document}     \begin{equation}                   x = \begin{array}{cc}                      1, & \mbox{for } 0.5\leq p \leq 1 \\                     0, & \mbox{for } 0\leq p \le 0.5 \\                        \end{array}          \end{equation}         \end{document}      Execute:               mk4ht oolatex test.tex      Error:               ! Undefined control sequence.     <argument> ...\a:mathml columnlines="\columnlines                                                        " \a:mathml equalcolumns="...     l.5                 1                          , & \mbox{for } 0.5\leq p \leq 1 \\     ?


title: Writing \\ to a File

text: I have a local class that a number of people use. One of the new things I want it to do is write out various user-defined data to a file, so that a follow-up LaTeX document can do something different, but with the same user-defined parameters. I'm somewhat new to reading and writing external files, so my question may be elementary. Here's an MWE that demonstrates the problem:               \documentclass{article}     \begin{document}     %% USER CONTROLS THIS DEFINITION     \def\userdef{abc}        % Works Great     %\def\userdef{abc\\def}  % Breaks \write     %% I CONTROL THE FOLLOWING     \def\userdefContent{\noexpand\def\noexpand\userdef{\userdef}}%     \newwrite\tempfile%     \immediate\openout\tempfile=userdata.tex     \immediate\write\tempfile{\userdefContent}     \immediate\closeout\tempfile     \end{document}      The user defines some known variable using a `\def` and I'd like to write it to a file in the form of `\def\userdef{blah blah blah}` where `blah blah blah` is how the user defined it. In this way, I can `\input` it into another file and have that second document pre-initialized with the same data the user defined for the first round. The problem is that there are some user variables I want to write that may be populated with `\\\` characters which, apparently, break the `\write`. Uncomment the one line in the MWE to demonstrate this. I am flexible on a solution. Ideally, I would like my output file to contain               \def \userdef {abc\\def}      but I would be willing to settle for               \def \userdef {abc*LINEFEED*def}      where `*LINEFEED*` is an arbitrary string sequence to alert me that I will later need to stick back in a `\\\`. I would even, as a last resort, settle for               \def \userdef {abc def}      where the `\\\` has been stripped. I suppose I would, if there were no other solution, instruct the userbase not to use `\\\` in their `\def` but some other macro that I define (which I can then redefine prior to the `\write`). But I think they might resist this last approach. I also would resist it, because it would break backward compatibility to older documents. I am also open to a totally different approach, if there is a standard LaTeX way of transferring data between different documents. I would add that I have a `stringstings` solution that works when `\userdef` is composed purely of catcode 11 and 12 material and `\\\` characters, but I can't guarantee in advance that the user won't stick some other macros in his `\def`.


title: biblatex - comma with space behind every unit (style=authoryear)

text: I'd like to have a comma behind every unit in a bibliography entry except the year and at the end of an entry. How can I achieve that? This is what I have so far.               \usepackage[     language=auto,     style=authoryear,     backend=bibtex,     hyperref=true,     isbn=false,     doi=false,     citereset=chapter,     maxcitenames=3,     dashed=false,     sorting=nyt,     block=par,     natbib=true, %faking natbib-commands     firstinits=true,     terseinits=false     maxbibnames=99,     autopunct=true     ]{biblatex}          \DeclareBibliographyDriver{book}{%     \printnames{author}%     \newunit     \printfield{year}%     \newunit\newblock     \printfield{title}%     \newunit     \printlist{edition}%     \newunit     \printlist{publisher}%     \newunit     \printlist{location}%     \finentry}          %\DeclareBibliographyDriver{article}{%     %\printnames{author}%     %\newunit     %\printfield{year}%     %\newunit\newblock     %\printfield{title}%     %\newunit     %\printlist{edition}%     %\newunit     %\printlist{journal}%     %\newunit     %\printlist{location}%     %\finentry}          %% Jahresangabe bei Referenzen in Biblipographie fett     \DeclareFieldFormat{year}{\bfseries{(#1)}}     %% Jahresangabe bei Referenzen im Dokument nicht fett     \DeclareFieldFormat{labelyear}{(#1)}     %% Zeilenumbruch vor Ausgabe der URL bei Internetquellen     \DeclareFieldFormat{url}{\newline URL: \url{#1}}     %% Ausgabe des letzten Seitenbesuchs nach Richtlinien     \DeclareFieldFormat{urldate}{(Last Visit: \urldate{#1})}          \DefineBibliographyStrings{american}{%     bibliography = {Bibliography},     shorthands = {Abbreviations},     editor = {editor},     editors = {editors},     }          \renewcommand*{\bibpagespunct}{%     \ifentrytype{article,inbook,incollection,inproceedings,patent,thesis,unpublished,online}{\addspace}{\addcomma\space}}          %% no indent     \setlength{\bibhang}{0pt}      %% eine Leerzeile zwischen zwei Bib-Einträgen     \setlength{\bibitemsep}{12pt}           %% Doppelpunkte nach dem Datum sicherstellen     \renewcommand{\labelnamepunct}{\addcolon}      \renewcommand{\intitlepunct}{\addcolon}     %% Names... Lastname, Firstname     \DeclareNameAlias{sortname}{last-first}      %% Format der Titelausgabe im Dokument bei Referenzen auf normal setzen     \DeclareFieldFormat{citetitle}{#1\isdot}      \DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished,online]{citetitle}{#1}     %% Format der Titelausgabe in Bibliographie     \DeclareFieldFormat{title}{#1\isdot}      \DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished,online]{title}{#1}          \AtBeginBibliography{%     %% auschließlich Slash zwischen den Autorennamen     \renewcommand{\multinamedelim}{/}     \renewcommand{\finalnamedelim}{/}     %% auschließlich Slash zwischen den Orten     \renewcommand{\multilistdelim}{/}     \renewcommand{\finallistdelim}{/}     %% alle Teile der Autoren fett formatieren     \renewcommand*{\mkbibnamefirst}[1]{\bfseries{#1}}     \renewcommand*{\mkbibnamelast}[1]{\bfseries{#1}}     \renewcommand*{\mkbibnameprefix}[1]{\bfseries{#1}}     \renewcommand*{\mkbibnameaffix}[1]{\bfseries{#1}}     }          \addbibresource{Bibliography/SA-bib}      I thought the               \renewcommand*{\bibpagespunct}{%     \ifentrytype{article,inbook,incollection,inproceedings,patent,thesis,unpublished,online}{\addspace}{\addcomma\space}}      would go in the right direction, but that is about it. I have a couple of other specific questions but I intend to open another thread for each one if that is alright. Also, if anyone would like to comment on improving the config, I'd gladly take that advice too.


title: How to change the Figure style in achemso

text: I'm writing a full paper for JACS using the achemso package. I am asked to an "S" in front of the number (eg. Figure S1 or Scheme S2 etc.) in all graphics (figures, schemes etc.) in the supporting information. How could I do it?


title: PGF Keys differences between .initial and .default

text: I am not too sure just by reading the manual as to the subtle differences between the `.initial` and `.default` PGF key types. Can someone explain and demonstrate the differences with a minimal example?


title: center and \centering both add space above; \centerline does not

text: The `nag` package suggests I use the `center` environment in LaTeX, rather than the TeX `\centerline` command. When I do that, however, I find that the former inserts a blank line above the line (in my case), whereas the latter does not. I'd prefer to use the "correct" LaTeX env, but I don't want the extra blank line. I tried `\centering`, as recommended here, but that still added space above, although that link suggests that it should not. I'm doing this within the `letter` class, if that makes a difference.


title: Use biblatex and utf8

text: For my thesis, I use biblatex for the bibliography. As seen here, biblatex is not compatible, with `\usepackage[utf8x]{inputenc}`. It was reported as close but I still have the same problem with my version of bibtex (last one on archlinux 2011.24688-1). I want to use the € symbol inside my report but it fails without utf8.               ! Package biblatex Error: Incompatible package 'ucs'.          See the biblatex package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.7 \begin{document}      Any idea idea how to fix ?               \documentclass{report}          \usepackage[utf8x]{inputenc}     \usepackage{biblatex}     \bibliography{includes/mybib}{}          \begin{document}          X said Y \cite{bib1}          \printbibliography          \end{document}      and the file mybib               @online { bib1,            title = {Refrence title},            author = {X},            url = {http://site.com/y}}


title: Tikz: placing a node at the intersection of two circles along a hyperbola

text: I know one can use the intersection package to find the point of intersection but I don't understand how to do it yet. I would like to label the increasing order of the intersections `F^*_2`, `F^*_1`, `F^*_m`. `F^*_1` (but over set with a ~), and `F^*_2` with the same over set. **Note: I am ignoring the lower and upper most intersections.** The code is:               \documentclass[tikz,convert=false]{standalone}     \usetikzlibrary{through,calc}     \makeatletter     \tikzset{circle through extra radius/.code={% unorthodox addon for the through library                                                 % needs to be used after 'circle through'!                                                 % this can be avoided by slightly changing the source       \tikz@addoption{%         \pgfmathsetlengthmacro\pgf@tempa{\pgfkeysvalueof{/pgf/minimum width}+2*(#1)}%         \pgfset{/pgf/minimum width/.expanded=\pgf@tempa}%       }%     }}     \tikzset{       special style/.code={%         \if#1\tikz@nonactiveexlmark           \pgfkeysalso{@special style}%         \else           \pgfkeysalso{style/.expanded=#1}%         \fi       },       @special style/.style={draw=none,fill=none}     }     \makeatother     \begin{document}     \begin{tikzpicture}[       every label/.append style={font=\small},       dot/.style={fill,outer sep=+0pt,inner sep=+0pt,minimum size=2pt,shape=circle,draw=none,label={#1}},       dot/.default={}     ]     \begin{scope}[rotate around ={-20.5560452:(1, -.75)}]           \node[scale = .75, dot = {right: \(P_1\)}] (P1) at (3cm, 0) {};           \node[scale = .75, dot = {\(P_2\)}] (P2) at (-1, 0) {};           \node[scale = .75, dot = {below: \(F\)}] (F) at (1cm, -.75cm) {};           \path[blue] (F) edge (P1) edge (P2) (P1) edge (P2);           \path ($(P1)!.75!(P2)$) coordinate (half-center);           \foreach \sStyle/\xFocus in {{draw, thick}/half}             \foreach \cPoint in {1, 2}               \foreach \sStyleR/\dDeltaRadius[count = \cRadius from 0] in               {/.0cm, /.5cm, /1cm, /1.5cm}               {                 \node[style/.expanded = \sStyle,                 special style/.expanded = {\sStyleR}] at (P\cPoint.center)                 ({\xFocus:\cPoint:\cRadius}) [circle through/.expanded =                 {(\xFocus-center)}, circle through extra radius = \dDeltaRadius] {};                 \global\let\cRadius\cRadius              }                \clip(-4, -5) rectangle (8, 5);           \draw [samples = 50, domain = -0.99:0.99, xshift = 1cm, red,           thick] plot ({(-1 - (\x)^2) / (1 - (\x)^2)},           {1.73 * (-2) * (\x) / (1 - (\x)^2)});         \end{scope}       \end{tikzpicture}       \end{document}      ![enter image description here](http://i.stack.imgur.com/nQkJq.png) From my post Tikz: drawing concentric circles with specified origins and the arc that connects the intersections Qrrbrbirlbel found the intersections with               \foreach \cSolution in {1,2}         \foreach \cRadius in {1,...,3}         \coordinate (i-\cRadius-\cSolution) at (intersection cs: first node={F:1:\cRadius}, second node={F:2:\cRadius}, solution=\cSolution);      but I am not clear on how to adapt the solution for my problem. **Edit 1:** I don't know if there is a smooth way to automate the process, but I have the middle point defined as:               \node[scale = .75, dot = {right:\(\overset{\mbox{~}}{F}_m^*\)}] (Fm)           at ($(P1)!.75!(P2)$) {};      How can I make the the dot bigger and the overset `~` wont appear. I have tried `\~` and `~` but nothing works. **Edit 2:** Close up of the output from Qrr.. answer: The `\tilde` isn't overset and the node placement isn't similar. ![enter image description here](http://i.stack.imgur.com/HD2t6.png) **Edit 3:** I was able to adjust some of the nodes but for the nodes along the hyperbola, if I adjust them more, the top nodes will be out of place. ![enter image description here](http://i.stack.imgur.com/v01tk.png)               \begin{tikzpicture}[scale = .7,         every label/.append style = {font = \small},         dot/.style = {fill, outer sep = +0pt, inner sep = +0pt,           shape = circle, draw = none, label = {#1}},         dot/.default =,         small dot/.style = {minimum size = 2pt, dot = {#1}},         small dot/.default =,         big dot/.style = {minimum size = 3pt, dot = {#1}},         big dot/.default =       ]         \begin{scope}[rotate around ={-23.9625:(.75, -1)}]           \begin{scope}             \clip(-2, -4) rectangle (0, 4);             \draw [samples = 50, domain = -0.99:0.99, xshift = 1cm, red, thick]             plot ({(-1 - (\x)^2) / (1 - (\x)^2)},             {1.73 * (-2) * (\x) / (1 - (\x)^2)});           \end{scope}           \node[scale = .75, small dot = {right: \(P_1\)}] (P1) at (3, 0) {};           \node[scale = .75, small dot = {below, left = 3.5pt: \(P_2\)}] (P2) at           (-1, 0) {};           \node[scale = .75, small dot = {below, left = 3.5pt: \(F\)}] (F)           at (.75, -1) {};           \path[blue] (F) edge (P1) edge (P2) (P1) edge (P2);           \path ($(P1)!.75!(P2)$) coordinate (Fm) node[big dot =           {below = 10pt, right = 3pt: \(F_m^*\)}] {};           \foreach \cPoint in {1, 2}             \foreach \sStyleR/\dDeltaRadius[count = \cRadius from 0] in             {.0cm, .5cm, 1cm}               \node[draw, thick] at (P\cPoint.center) (\cPoint: \cRadius)               [circle through = (Fm), circle through extra radius = \dDeltaRadius]               {};           \foreach \cSolution in {1, 2}             \foreach \cRadius in {1, 2}               \node[black, big dot = {right = 2pt, below = 2pt:                 $\ifnum\cSolution = 2\expandafter\tilde\fi F^*_\cRadius$}]               (n-\cRadius-\cSolution) at               (intersection cs: first node = {1: \cRadius},                                 second node = {2: \cRadius},                                 solution = \cSolution) {};         \end{scope}       \end{tikzpicture}


title: Reusing saveboxes

text: Since `\newsavebox{\name}` assigns the box register number to `\name`, there are probably a maximum of 256 boxes available. Is there a way to release a `\savebox` after you are through with it?


title: problem with .cls in pdflatex always only on second run

text: when i try to compile my document with pdflatex it says `'elsarticle.cls' not found` but if i re run pdflatex it suddenly works. tried everything i found on the interwebs (reinstalling the package using tlmgr install elsarticle, texhash,..)... maybe you have an idea? here is the log (textmate):               Processing: ./projectletter.tex     ! LaTeX Error: File `elsarticle.cls' not found.     Latex Error: ./projectletter.tex:6 Emergency stop.     Complete transcript is in projectletter.log     Found 2 errors, and 0 warnings in 1 runs     pdflatex -interaction=nonstopmode -file-line-error-style exited with status 1      ----- here i press 're run pdf latex'               Processing: ./projectletter.tex     Document Class: elsarticle 2009/09/17, 1.2.0: Elsevier Ltd         Document Class: article 2007/10/19 v1.4h Standard LaTeX document class      ----- problem solved. What was the solution? Apparently there were two separate tex distributions installed. After finding and removing the one I thought I had, all tex related commands still worked. The remaining one is the distribution with all the packages installed correctly.