title: Capitalisation of two-word surname in bibliography

text: I've created the following entry (in Jabref):               @ARTICLE{Key,       author = {Pico Della Mirandola},       title = {Title of Paper},       journal = {Working Paper, Institute},       year = {2013},       owner = {User},       timestamp = {2013.08.05}     }      That shows the following, however `Mirandola, Pico Della, 2013, Title of Paper, Working Paper, Institute.`, which is no good as the surname has been broken up. After reading www.tug.org/TUGboat/tb30-1/tb94mori.pdf, I changed the Jabref entry to having a lowercase `della` which keep the surname together: `della Mirandola, Pico, 2013, Title of Paper, Working Paper, Institute.`, but I'm just using this name as an example: the capitalisation in my document. I need it to show `Della Mirandola, Pico, 2013, Title of Paper, Working Paper, Institute.` I'm sure sure if this approach is using bibtex, biblatex or natbib or whatever, but I have to use a .bst file to format my bibliography as I need to follow a specified format, so I want to continue creating the .bbl file automatically in TexnicCenter like this:               \bibliographystyle{elsart-harv}     \bibliography{C:/jabrefBib}      and just citing the references in the document as usual (`\cite{Key}`). How can I implement a workaround for this to get the surname right?


title: Exactly position an image

text: I have an image that I want to postition between 2 pieces of text, however it is placing itself right at the end of the page. Here is the code:               \documentclass[10pt]{article}     \usepackage{geometry,color,graphicx,float}     \geometry{a4paper}          \begin{document}         SOME TEXT              \begin{figure}[!H]             \centering             \includegraphics[width=300pt]{image.pdf}             \caption{capt}         \end{figure}              BLAH BLAH BLAAH          \end{document}


title: Problems with alignment with landscape table

text: I'm writing a paper that includes a number of tables. Until now these have been in standard `table*` format, i.e.               \begin{table*}     \caption{Caption}     \label{label}     \begin{center}     \begin{tabular}{lccccccccccccccc|cc}     & \multicolumn{15}{c}{Title}& $\mu$ & $\sigma$\\          etc.      with about 15-20 subsequent rows, and renders correctly while (just) fitting the page width. However, I now need to add two further columns, making the `table*` too wide for portrait, and so need to switch to landscape mode. This should be a straightforward case of rotating through 90 degrees, as even in landscape there are not so many rows that the table needs to break across pages. However, I've tried two approaches and have hit problems with both. Firstly, I have tried wrapping the table with `\begin{landscape}` (including lscape in `\usepackage`), but there is a lot of whitespace at the bottom of the page, while the left hand edge of the table is pushed through the \runningtitle and off the top of the page. Secondly, I tried replacing `\begin{table*}` with `\begin{sidewaystable*}`, but now the table is correctly spaced vertically (i.e. there is not excessive whitespace at the bottom, or a collision with `\runningtitle`) but is now offset horizontally - the first table runs off the 'left' of the page (left as viewed in portrait, top as viewed in landscape) while the next is rotated 180 degrees and drops off the 'right'. In both cases, adding or removing `\begin{center}` or `\centering` doesn't appear to make any difference, and I'm out of ideas about what else to do. Apart from the usual LaTeX complaints about 'float too large for page' there is no apparent output to help me figure out what's wrong. The paper is in A&A format using the latest (v7) aa.cls. If I switch to referee mode (which triggers a shift from two-column to one-column with larger font and double spacing) then the table appears to render correctly, which makes me wonder if there's some issue with the .cls file. Does anybody have any suggestions for a solution, workaround or alternative that might just work? I've been bashing my head against this for a couple of hours and I'm no out of ideas.


title: How to make \parshape take indentation of first line into account?

text: In the minimal example below, I want to create an empty space to the right of the paragraph using `\parshape`. However, the first line is indented and spills over into the empty space. I don't want that. How do I get all the lines to end at the same place to create a neat, empty square?               \documentclass{article}     \usepackage{lipsum}          \begin{document}     \parshape=5     0pt 0.5\textwidth     0pt 0.5\textwidth     0pt 0.5\textwidth     0pt 0.5\textwidth     0pt \textwidth     \lipsum[1]     \end{document}      ![enter image description here](http://i.stack.imgur.com/wWRaR.png)


title: Why OSX Texstudio cannot compile this?

text: I have tried the following MWE on Windows 7 and OSX (Mavericks) with different front ends. Windows Tex system is Miktex 2.9 and on OSX it is MacTeX 2013. In all cases PdfLaTeX is run and write18 (or shell escape) is enabled. The result:   1. Winedt+Miktex on windows, code compiles with no problem.   2. Texstudio+Miktex on windows, code compiles with no problem.   3. Texmaker+Miktex on windows, code compiles with no problem.   4. Texshop+MacTex on Mavericks, code compiles with no problem.   5. Texmaker+MacTeX on Mavericks, code compiles with no problem.   6. Texstudio+MacTeX on Mavericks, code **does not** compile correctly, the figure does not show and is replaced by an empty square. My guess is that there is something wrong with the way auto-pst-pdf operates when it is called via Texstudio under OSX. Probably in the first run that latex+dvips+ps2pdf is called via shell. Can anyone verify this odd behavior of Texstudio under OSX or suggest a solution? Here is the MWE:               \documentclass{article}     \usepackage{graphicx}     \usepackage{microtype}     \usepackage{auto-pst-pdf}     \begin{document}     This is a test.      \bigskip     \includegraphics[width=5in]{example-image-a.eps}     \end{document}


title: What are the standard styles to format LaTeX source code?

text: In any other programming languages, we have several ways to format our source code. For example, some of the standard styles are:   1. Allman(ANSI)   2. K&R   3. GNU   .... Within LaTeX, I couldn't find a neat way to clean my code. Most of the time, I usually make them align with each other like so: **An example from TikZ Automaton**               \begin{tikzpicture}[shorten >=1pt, node distance=3cm,auto,on grid,initial text=, every state/.style={minimum size=3mm,draw=blue!50,very thick,fill=blue!20}]                 \node[state]            (q_1)                           {$q_1$};                  \node[state]            (q_2)   [right=of q_1]          {$q_2$};                  \node[state,accepting]  (q_3)   [right=of q_2]          {$q_3$};                      \path[->]                 (q_1) edge                      node             {a}        (q_2)                 (q_1) edge  [loop left]         node             {b}        (q_1)                      (q_2) edge  [bend right]        node[yshift=4mm] {a}        (q_1)                 (q_2) edge                      node             {b}        (q_3)                      (q_3) edge  [bend left]         node             {a}        (q_1)                 (q_3) edge  [loop right]        node             {b}        (q_3)                 ;            \end{tikzpicture}      Needless to say, manually doing this is very time-consuming and tedious. Additionally, since it does not follow any rule, the format won't be consistent and it could vary from file to file. So my question is, is there a standard style for formatting `.tex` source code?


title: Strange Underfull \vbox problem

text: This is the code:               \[       \left.       \begin{aligned}         K_1 \cos{\theta^{(1)}_4} - K_2 \cos{\theta^{(1)}_2} + K_3 & = \cos(\theta^{(1)}_4 - \theta^{(1)}_2) \\         K_1 \cos{\theta^{(2)}_4} - K_2 \cos{\theta^{(2)}_2} + K_3 & = \cos(\theta^{(2)}_4 - \theta^{(2)}_2) \\         K_1 \cos{\theta^{(3)}_4} - K_2 \cos{\theta^{(3)}_2} + K_3 & = \cos(\theta^{(3)}_4 - \theta^{(3)}_2)       \end{aligned}       \right\}     \]      It shows me:               Underfull \vbox (badness 10000) has occurred while \output is active []      But if I comment any equation line, so there are 2 of the 3, any message is shown. Any advice, please?


title: How to implement a command that checks for loaded packages?

text: I use the following code to check if a package is loaded:               \RequirePackage{ltxcmds}     \newcommand{\IfPackageLoaded}[2]{\ltx@ifpackageloaded{#1}{#2}{}}      However, sometimes I want to check if more than one package is loaded. Therefore I would like to generalise the command, such that more than one package can be added in a list separated with commas:               \IfPackagesLoaded{xcolor, colortbl, hyperref}{     ...     }%      What would the typical implementation of the processing of such a list look like?


title: biblatex-mla bibliography: one redundant dot in second entry by same author (@collection)

text: when quoting two collections by the same author, biblatex-mla puts an extra dot before the title in the references entry, as may be seen here:               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[ngerman]{babel}     \usepackage[backend=biber,style=mla]{biblatex}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @COLLECTION{adorno-gs10.2,       editor = {Rolf Tiedemann},       year = {2003},       maintitle = {Gesammelte Schriften Bd. 10.2},       mainsubtitle = {Kulturkritik und Gesellschaft II. Eingriffe. Stichworte},       publisher = {Suhrkamp},       location = {Frankfurt am Main},       author = {Theodor W. Adorno},       howpublished = {Print},       options = {useeditor=false},       owner = {jakob},       shortauthor = {{In: GS 10.2}},       timestamp = {30.03.2012}     }          @COLLECTION{adorno-gs8,       editor = {Rolf Tiedemann},       year = {2003},       maintitle = {Gesammelte Schriften Bd. 8},       mainsubtitle = {Soziologische Schriften I},       publisher = {Suhrkamp},       location = {Frankfurt am Main},       author = {Theodor W. Adorno},       howpublished = {Print},       options = {useeditor=false},       owner = {jakob},       shortauthor = {{In: GS 8}},       timestamp = {30.03.2012}     }          \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     \nocite{*}     \printbibliography     \end{document}      Do you know any way to avoid that or is it even caused by an error in my bib entries?


title: Redefining "cited on" string (and others) in biblatex

text: I'm trying to modify the strings `biblatex` uses to set the "cited on" string used in the bibliography to identify the pages where a given references has been cited. What I gather from the `biblatex` documentation (e.g., § 4.9.2.16) is that something like               \renewbibmacro{backrefpage}{<newtext>}     \renewbibmacro{backrefpages}{<newtext>}      ought to work, but they have no effect for me (I'd also like to get this working for the "visited on" string, `urlseen`). My MWE is unchanged from How do I turn titles into hyperlinks in verbose mode using BibLaTeX and hyperref?, with the addition of these (and related lines) just about anywhere.


title: sans serif font with siunitx

text: My students found this problem, which I could not solve. The percent is always printed in the serif font. ![enter image description here](http://i.stack.imgur.com/yEqut.png) Here is a test code:               \documentclass[]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc} % T1 Schrift Encoding     \usepackage{lmodern}  % Latin Modern     \usepackage[ngerman]{babel}     \usepackage{float}     \usepackage{siunitx}          \sisetup{%       mode = math,       detect-family,       detect-weight,         exponent-product = \cdot,       number-unit-separator=\text{\,},       output-decimal-marker={\text{,}},       math-rm=\mathsf,       text-rm=\sffamily,     }          \begin{document}     \sffamily\noindent     Text \SI{1.23}{\%} and further text.     \begin{table}[H]     \sffamily     \begin{tabular}{ll}     \SI{1.23}{\%} & 1,23\,\%     \end{tabular}     \end{table}     \end{document}


title: How to fix layering with the 3d package?

text: I used the `3d` TikZ library to draw a circle in the z-y plane around a line along the x axis. But since the circle is drawn on top of the line, it does not look like the line passes through the circle. How can I fix this? The solution that comes to mind is to draw two semicircles or two line segment, but that would get messy with complex shapes. Is there a more general solution or a better package to achieve this? ![enter image description here](http://i.stack.imgur.com/JpxN8.png)               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{3d}     \begin{document}     \begin{tikzpicture}         \begin{scope}[canvas is xy plane at z=0]             \draw[color=green,very thick] (0,0) -- (2,0);         \end{scope}         \begin{scope}[canvas is zy plane at x=1]             \draw[color=blue,very thick] (0,0) circle (1);         \end{scope}     \end{tikzpicture}     \end{document}


title: Adjust bottom margin of a listing environment

text: I use the following settings for code listings.               \usepackage{listings}     \usepackage{textcomp}     \lstset{language=Java,         keywordstyle=\color{RoyalBlue},         basicstyle=\scriptsize\ttfamily,         commentstyle=\color{Green}\ttfamily,         rulecolor=\color{black},         upquote=true,         numbers=left,         numberstyle=\tiny\color{gray},         stepnumber=1,         numbersep=8pt,         showstringspaces=false,         breaklines=true,         frameround=ftff,         frame=single,         belowcaptionskip=.25\baselineskip     }      I want to add some white space at the bottom of the listing to separate it from the paragraph. How can I adjust the bottom margin below the code listing?


title: “Extra }, or forgotten \endgroup” error

text: Don't understand why this piece won't compile fluently. TeX file as following:               \begin{figure}     \centering     \includegraphics[width=\textwidth]{chapter2/epjb/groups_0.pdf}     \caption{\label{fig:epjbgroups} Schematic diagram indicating the presence of          coalescence     and fragmentation processes, for a population of $N=15$ objects     dynamically partitioned into clusters. The size of cluster $i$ is     $s_i=2$, while the size of cluster $j$ is $s_j=6$ etc. The     fragmentation process exhibits the richest range of possibilities,     given the combinatorial number of ways in which a cluster can in     principle be divided. There are many possible realizations of the     objects themselves, e.g.  humans, animals, macromolecules, though     for simplicity we show them as humans.}     \end{figure}      the output of pdfLaTeX is:               !Extra }, or forgotten \endgroup.     \color@endbox ->egroup     1.118 \end{figure}          ?      Don't understand where the extra `}` come from. ### MWE:               \newcommand{\papers}{umthesis}          \documentclass[letterpaper,12pt,oneside,onecolumn,final,openany,pdftex]{\papers/umdiss}          \usepackage{cite}     \usepackage{epstopdf}     \usepackage{amsmath,amssymb,nicefrac}     \usepackage{psfrag}     \usepackage{subfigure}     \usepackage{url}     \usepackage{multirow}     \usepackage{rotating}     \usepackage{pifont}     \usepackage{boxedminipage}     \usepackage{amssymb}     \usepackage{bbm}     \usepackage{float}     \usepackage{lscape}     \usepackage{amsfonts}     \usepackage{helvet}     \usepackage{amsxtra}     \usepackage{multirow}     \usepackage{titletoc}     \usepackage{algpseudocode}     \usepackage{lastpage}     \usepackage{verbatim}     \usepackage{graphicx}               \begin{document}          \begin{figure}     \centering     \includegraphics[width=\textwidth]{groups_0.pdf}     \caption{\label{fig:epjbgroups} blablabla}     \end{figure}          \end{document}       problem still exist. So please someone help me to check the \usepackage? Many thanks.


title: Unexpected Error in IEEEtrans.cls

text: I am new to LaTeX. I have been working on a .tex file and very unexpectedly, encountered the following error:                Error message - **There is a '}' missing: unexpected end of line.**      in the following line of my IEEEtrans.cls files.                {\catcode`\|=0 \catcode`\\=12      |xdef|@IEEEbackslash{\}}      Any pointers or remedies?


title: How to label an image inside tikz

text: I want to label the images img1 and img2.. can i do that inside my `\node`? If yes, how??               \documentclass{article}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}             \path (0,0) node(a) {\includegraphics[width=2cm] images/img1.png}};             \path (1,6) node(b) {\includegraphics[width=2cm]{images/img2.png}};             \path (9,6) node(c) {\includegraphics[width=2cm]{images/img3.png}};             \path (10,0) node(d) {\includegraphics[width=2cm]{images/img4.png}};             \draw[very thick,green] (a) -- (b) node [midway,right]{\parbox{4cm}{TLS Password Based\\ Authentication}};             \draw[very thick,red] (b) -- (c) node [midway,above]{Certificate based Authentication};             \draw[very thick,green] (c) --(d);     \end{tikzpicture}         \end{document}      What i mean by label is that something like this..               \path (\x,\y) node(a) [rectangle, draw,thick] {This is a rectangle};      Something like this as shown in figureas "Alice", "Bob", SIP Proxy Server Domain" etc.. ![enter image description here](http://i.stack.imgur.com/lr95o.png)


title: using AutoHotKey to streamline LaTeX document authoring

text: Is it possible to use AutoHotKey to facilitate LaTeX document authoring? In which ways? Is there any off the shelf AutoHotKey script for this purpose?


title: Get rid of empty page caused by \mainmatter

text: I'm writing a book in latex                   \listoftables         \listoffigures         \tableofcontents{}         \mainmatter      after the TOC, I have an empty page, when I delete the Mainmatter command, the empty page disappear. How can I solve this issue ?


title: Advanced conditionals

text: Is there some way to create more advanced conditional statements that can evaluate a logic expression and decide what to do based on the value of the expression? For example like in the following very simple pseudocode:               if A or B then         do something     else         do something else     end if      where `A` and `B` are flags or booleans. Or maybe `A` is a logic expression, checking if `x > y`, where `x` and `y` are real numbers. Is there some simple way to do this?


title: Wrong diacritic when using \"u

text: I have a document where the `\"u` is not rendered as ü, but more like a u with a strikethrough mark: ![Example of wrong diacritic](http://i.stack.imgur.com/G7Zum.png) Directly using the UTF-8 encoded ü character in the input file works as expected, however. I have the following classes/packages loaded (all with their default options, in this order):   * `letter`   * `ifthen`   * `graphicx`   * `lastpage`   * `fontenc`   * `ragged2e`   * `ngerman`   * `hyperref` Anybody knows what could be the cause of this issue?


title: Plot two figures side by side in knitr without changing mfrow?

text: I would like to plot 2 figures side-by-side using knitr. I know I could use par(mfrow=c(1,2)), but I've done a lot of work making the figures just right as they are. I've seen this (Two column layout with text and knitr chunk), and it's not working for me. Ideally, I'd like to do something like this (which fails):               \documentclass[a4paper,11pt]{article}     \begin{document}     \begin{frame}        \begin{columns}           \begin{column}{.5\linewidth}               <<echo=FALSE,eval=TRUE,out.width='4cm',out.height='4cm'>>=                  plot(1:10)               @           \end{column}           \begin{column}{.5\linewidth}               <<echo=FALSE,eval=TRUE,out.width='4cm',out.height='4cm'>>=                  plot(1:10)               @           \end{column}         \end{columns}     \end{frame}     \end{document}      Using Sweave, I could do the following:               <<plot1, echo=FALSE,eval=TRUE>>=         plot(1:10)     @          \begin{figure}[htbp]       \begin{minipage}[h]{0.5\linewidth}         \begin{center}                  <<label=figplotFlowSingle,echo=FALSE>>=                 <<plot1>>             @         \subcaption{Default plot1}         \label{fig:plot1}         \end{center}       \end{minipage}       \begin{minipage}[h]{0.5\linewidth}         \begin{center}                  <<plot2, echo=FALSE,eval=TRUE>>=                  plot(1:10)             @                  <<label=plot22,echo=FALSE>>=                 <<plot2>>              @         \subcaption{Default plot2}         \label{fig:plot2}         \end{center}       \end{minipage}       \caption{}       \label{fig:plot1and2}     \end{figure}


title: How can I check/debug a .cls file?

text: I am editing a `.cls` file in order to customize the output of a particular document. However, I am occasionally coming up against errors. Is it possible to check that my `.cls` file is valid (i.e. no hanging "`{`")? Is there a decent way to debug edits to a `.cls` file? If possible, please suggest some open source tools available for Windows.


title: Problem with default values with pgfkeys

text: I try to make a fine macro to display the dimensions of lines inside a technical figure. This problem appears in several questions and answers but I would like to add some refinements. The next code is based on several codes and actually I have this :               \documentclass{scrartcl}     \usepackage{tikz}     \usetikzlibrary{decorations,decorations.markings,decorations.text}          \begin{document}     \pgfkeys{/pgf/decoration/.cd, distance/.initial = 10pt}            \pgfdeclaredecoration{add dim}{final}{     \state{final}{%      \pgfmathsetmacro{\dist}{\pgfkeysvalueof{/pgf/decoration/distance}}               \pgfpathmoveto{\pgfpoint{0pt}{0pt}}                            \pgfpathlineto{\pgfpoint{0pt}{2*\dist}}                  \pgfpathmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}                \pgfpathlineto{\pgfpoint{(\pgfdecoratedpathlength}{2*\dist}}                    \pgfsetarrowsstart{latex}               \pgfsetarrowsend{latex}               \pgfpathmoveto{\pgfpoint{0pt}{\dist}}               \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{\dist}}                \pgfusepath{stroke}                \pgfpathmoveto{\pgfpoint{0pt}{0pt}}               \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}}     }}          \tikzset{dim/.style args={#1,#2,#3}{%                     decoration = {add dim,distance=#2},                     decorate,                     postaction = {%                        decorate,                        decoration={%                             markings,                             mark=at position .5 with {\node[inner sep=0pt,                                                             font=\footnotesize,                                                             fill=white,                                                             #3] at (0,0) {#1};}                           }}}}          \tikzset{dim sloped/.style args={#1,#2}{%                     decoration = {add dim,distance=#2},                     decorate,                     postaction = {%                        decorate,                        decoration={%                                   text along path,                                   raise      = 3pt+\pgfkeysvalueof{/pgf/decoration/distance},                                   text align = {align=center},                                   text       = {#1}                              }}}}            \begin{tikzpicture}     \coordinate (A) at (0,0);     \coordinate (B) at (4,2);     \coordinate (C) at (8,-2);          \draw[dim={5 cm,10pt,above=12pt}]   (A) --  (B);     \draw[dim sloped={7 cm,10pt}]  (B) --  (C);           \draw[fill=gray] (A) circle(1pt);      \draw[fill=gray] (B) circle(1pt);     \draw[fill=gray] (C) circle(1pt);         \end{tikzpicture}           \end{document}       ![enter image description here](http://i.stack.imgur.com/4t9zX.png) The result is fine and it's what I want. Perhaps it's possible to add some styles to get something more friendly but now the problems : 1) With `dim` it's possible to write `dim={,10pt,}` but in this case I get a small white blank space on the main line. I can write `\draw[dim={,10pt,above=12pt}]` but it's not funny 2) If I can write `dim={,10pt,}`, I can't write `\draw[dim={5 cm, ,above=12pt}]`. I get the error "a number is missing". How to use the default or initial value of `distance` in this case ? 3) If it was possible to write `\draw[dim={,,}]` then I think it would be more fine to write `\draw[dim={}]` or perhaps `\draw[dim=]` . Perhaps something like `\draw[dim default]` is necessary ? 4) I would to have only one key like `dim` and not two keys with `dim sloped` but I try without success to modify one of theses keys. This is not very important because the mixt is a very bad thing. Sloped or not sloped , the user of the key needs to make a choice ! but i would to know if there is a solution.


title: How to make gv (DOT) files work under LyX

text: I'm using LyX. After adding this gv file using Insert->Graphics, LyX automatically generated a perfect preview of the file, as expected. ![Automatic preview of GraphViz in LyX](http://i.stack.imgur.com/DheM7.png) However, when I try to export or get a preview using dvi (Ctrl+D) or pdflatex (Ctrl+R), I get the following LaTeX error: > Package pdftex.def Error: File > `1_home_user_Documents_PATH_TO_FOLDER_fsm.png' not found. and the following LyX error (message box): > No information for converting format files to png. Define a converter in the > preferences. Background info:   1. After installing GraphViz I did Tools->Reconfigure.   2. The GraphViz Dot -> PNG converter is defined as `dot -Tpng $$i -o $$o`.   3. Converting the gv file manually to png doesn't help (unless of course if I use the png file directly as the graphics...).


title: Arrow Definition in PGF/TikZ

text: I'm trying to define an arrow for use in `tikzpictures` that (similar to the small arrows IPE uses) is 5pt long (tip to end) and 3.333pt wide (base). Here's what I came up with:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{arrows}          \pgfarrowsdeclare{ipe arrow}{ipe arrow}{       \arrowsize=5pt       \pgfarrowsleftextend{-.5\pgflinewidth}       \pgfarrowsrightextend{.5\pgflinewidth}     }      {        \arrowsize=5pt       \pgfpathmoveto{\pgfpointorigin}       \pgfpathlineto{\pgfpoint{-5pt}{-1.666pt}}       \pgfpathlineto{\pgfpoint{-5pt}{1.666pt}}         \pgfpathlineto{\pgfpointorigin}         \pgfusepathqfill     }          \begin{document}          \begin{tikzpicture}     \draw [<->,>=ipe arrow](0,0) -- (1,0);     \end{tikzpicture}     \end{document}      The line protrudes the arrow's tip, however (see the right side): ![enter image description here](http://i.stack.imgur.com/ktwXl.png) I guess the error must have something to do with `\pgfarrowsrightextend`, but I don't seem to get how it works.


title: PGF doesn't work under Ubuntu 11.10

text: I updated my Ubuntu to the newest version 11.10 recently. Today when I use PGF again, i find many of my old examples cannot compile. It always give the error information as:               ! Package PGF Math Error: The function `reciprocal' already exists.          See the PGF Math package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.156 ...@\pgfmath@reciprocaltemp0000000\pgfmath@}               ! Package PGF Math Error: The function `div' already exists.          See the PGF Math package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.212 }               ! Package PGF Math Error: The function `mod' already exists.          See the PGF Math package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.228 }      Does anyone have the same problem? EDIT: I have followed the suggestions by many people here that I have installed TeXLive 2011 manually and updated the path, and logout and login again. The sad thing is that the problem still exists. I am wondering whether the problem really comes from the TeXlive 2009? :-(


title: Need to export LyX doc as single file; figure files local, bib inline, and *tested*

text: The final submission process for a paper I've composed in LyX requires submission of a single `.tex` file. I've had some success toward that goal but I still have some major gaps towards getting that all ironed out. There are a couple of related questions on this site, which makes me wonder whether I should submit an "Export as Flat" feature request to the LyX folks, but this journal's requirements may be unusual; I don't really know. They can be found at 1. So, I dug into the `.tmp` files that LyX creates (and I'm on Mac, so that's a little tricky to start with) and found some of what I wanted: a `.tex` file with all of the file names for figures collapsed to remove all directories, all of the actual figure files, and a `.bbl` file. However, my first problem is that it's been so long since I've tried to use LaTeX directly, I'm at a loss of how to finish it all off. One complication being that the TeX utils don't even seem to be on my path at the command prompt. I thought that I'd be able to at least find the path to the LaTeX executable thingy in "Preferences", where it has the path for things like `dvips`, but alas I'm still stuck. I'm sure that the `.bbl` file gets turned into `.tex` and some point, but I haven't been able to find such a thing among the `.tmp` files produced by LyX, or figure out/remember how that part of it works. And I feel like to need to be able to do the `tex2dvi` thing on the files once I've got them ready for submission, so that I can make sure it all still works like it did in LyX to produce the PDF. And I thought that I would see the commands used in the `.log` file. But in there I could only see the _output_ from those commands, and not the actual commands used (maybe that should be a LyX feature request, too). Anyway, any insight that a LyX veteran could provide would be greatly appreciated.


title: How to reference to subfigure in latex

text: I have 2 figures with same meaning, So I put them in `subfigure` package, to make it easy to show their similarity. Here is the code that I used:               \usepackage{subfigure}               \begin{figure}[H]      \centering      \subfigure[]      {       \includegraphics[width=5.5cm, height=3.5cm]{Pattern_Images2/Result_Paper_17.eps}        }      \subfigure[]      {       \includegraphics[width=3.5cm, height=3.5cm]{Pattern_Images2/Result_Paper_24.eps}        }           \label{fig:Miss_Paper2417}      \caption{Misclassification because of the distance (a)Paper \cite{Paper17} (b)Paper \cite{Paper24}}     \end{figure}      I call the pic by               Figure \ref{fig:Miss_Paper2417}      The picture appear correctly, but the problem is when I call them in my paragraph, The figure number and caption are not correct.. ![enter image description here](http://i.stack.imgur.com/hqHQa.jpg) Im using WinEDT and bibtxtmng


title: Since the captions have different lengths, I cannot horizontally align the subfigures

text: \documentclass{article}          \begin{figure}[!]              \centering             \begin{subfigure}[b]{0.24\textwidth}                     \centering                     \includegraphics[width=\textwidth]{1.eps}                     \caption{1}                     \label{fig:1 is 0}             \end{subfigure}%             \hfill              \begin{subfigure}[b]{0.24\textwidth}                     \centering                     \includegraphics[width=\textwidth]{2}                     \caption{2}                     \label{fig:2 is the life like}             \end{subfigure}             \hfill             \begin{subfigure}[b]{0.24\textwidth}                     \centering                     \includegraphics[width=\textwidth]{3}                     \caption{3}                     \label{fig:3 is what people and the world like}             \end{subfigure}             \hfill             \begin{subfigure}[b]{0.24\textwidth}                     \centering                     \includegraphics[width=\textwidth]{4}                     \caption{4}                     \label{fig:4 is what the earth and the mars like}             \end{subfigure}          \end{figure}               \end{document}


title: how to link previous section

text: I have a document with multiple sections and a clickable TOC. I belive the TOC to be created by the following command in a package that I use. > \tableofcontents As I wanted the TOC to be clickable I added > \usepackage{hyperref} Now, in section 2.3 I want to write > As we saw in section 2.2 .. where 2.2 is clickable. In order to refer to section 2.2 should I make a new label or I can use some inner working that made the clickable TOC?


title: Change beamer theme mid document

text: Is it possible to change beamer theme mid document or do you have to make two pdfs and stick them together?


title: Legend in graph with tikz

text: I need to make a legend for my graph in TikZ, but I need that legend would be from 3 columns, how can I do this? I use this code:               \newenvironment{customlegend}[1][]{%         \begingroup              \csname pgfplots@init@cleared@structures\endcsname         \pgfplotsset{#1}%     }{         \csname pgfplots@createlegend\endcsname         \endgroup     }%          \def\addlegendimage{\csname pgfplots@addlegendimage\endcsname}     \pgfkeys{/pgfplots/number in legend/.style={%             /pgfplots/legend image code/.code={%                 \node at (0.125,-0.0225){#1}; % <= changed x value             },%         },     } \pgfplotsset{ every legend to name picture/.style={west} }          ------     \begin{customlegend}[legend cell align=left, %<= to align cells     legend entries={ % <= in the following there are the entries     ac, csv },     legend style={at={(-1,-9)},font=\tiny}] % <= to define position and font legend     % the following are the "images" and numbers in the legend         \addlegendimage{->,dash     pattern=on 4pt off 2pt on 4pt off 2pt on 4pt off 2pt on 1pt off     2pt,black!40!red,very thick}         \addlegendimage{->,dash pattern=on 4pt off 2pt on 4pt off 2pt on 4pt off     2pt on 1pt off 2pt,olive!30!purple,very thick}          \end{customlegend}      Thanks


title: Improper display of parentheses in fraction of fraction

text: The following code:               $\dfrac{\left( \dfrac{\left( \dfrac{1}{2}\right) }{2}\right) }{2}$      gives a nasty output: ![enter image description here](http://i.stack.imgur.com/KHsE7.png) It seems that the `$\left( \right)$` command doesn't do the job. Any idea how to solve this in general?


title: What are all the options for the "edge" part of the TikZ \path command?

text: I am drawing edges in a graph using a command like               \path (nodeName1) edge [->] (nodeName2)      The only way I have learned what options can go into the square brackets after "edge" is by looking at examples. Where can I find everything that can possibly be used as an option here?


title: How to draw microscope illumination light rays in tikz?

text: How would one go about drawing light / laser illumination rays using tikz? I would like to draw the schematic of an optical microscope illumination path. Examples of kinds of rays I would like to produce are:   * A linear gradient from out to in: ![olympus example](http://i.stack.imgur.com/6k4aB.jpg)   * A cone shaped beam with a radial gradient: ![olympus example 2](http://i.stack.imgur.com/GWIjv.jpg)   * The kind of laser illumination I am after is as follows: ![olympus laser](http://i.stack.imgur.com/F3AtM.jpg) Note: I am mainly interested in just the 'rays' in each picture. Not the optical elements or rest of the microscope setup. But they were the only pictures I could find that illustrate the look I am trying to achieve. I want to append them to my highly technical (lol) schematic so far:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \draw (-0.8,-0.2) -- (0.8,-0.2) -- (1.2,-0.6) -- (1.2,-1.8) -- (-1.2,-1.8) -- (-1.2,-0.6)--(-0.8,-0.2);     \draw  (-1.8,0.8) rectangle (1.8,0.4);     \draw (-1.2,1.4) -- (-1.6,2) -- (-1.8,3) -- (-1.8,3.8) -- (1.8,3.8) -- (1.8,3) -- (1.6,2) -- (1.2,1.4)--(-1.2,1.4);     \end{tikzpicture}     \end{document}      ![template](http://i.stack.imgur.com/TUyAh.png) **EDIT:** Thanks to the responses I have gotten 90% of what I am after:               \documentclass[tikz]{standalone}     \usepgfmodule{nonlineartransformations}     \tikzset{lasernode/.style={         left color=red,         right color=red,         middle color = white         }     }     \tikzset{lasernode2/.style={         left color=white,         right color=white,         middle color = red         }     }     \begin{document}     \begin{tikzpicture}     \draw[lasernode] (-3.8,9.4) rectangle (-3.2,6.4);     \draw[lasernode] (-6.8,9) -- (-6.8,7.8) -- (-6.2,6.8) -- (-5.6,7.8) -- (-5.6,9) -- (-6.8,9);     \draw[lasernode2] (-5.4,9) -- (-5.4,7.8) -- (-4.8,6.8) -- (-4.2,7.8) -- (-4.2,9) -- (-5.4,9);     \end{tikzpicture}     \end{document}      ![laser example](http://i.stack.imgur.com/0ASgj.png) What I want is for the shaded beam to stay perpendicular to the direction of propagation. Example of what I am after made with Photoshop is, but obviously with tikz correctly shading...: ![laser](http://i.stack.imgur.com/PxysP.png) Thanks all **EDIT 2** Thanks to suggestions I am getting very close:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{fadings}     \tikzfading[name=fade right, left color=transparent!100, right color=transparent!10, middle color=transparent!100]     \tikzfading[name=fade rect, left color=transparent!100, right color=transparent!70, middle color=transparent!100]     \begin{document}     \begin{tikzpicture}[fill opacity=0.9,thick, line cap=round,line join=round]         \fill[red,path fading=fade right, fading angle=-30] (-0.2,1.8) -- (-1.6,3.4) -- (1.2,3.4) -- cycle;         \fill[red,path fading=fade right, fading angle=210] (-0.2,1.8) -- (-1.6,3.4) -- (1.2,3.4) -- cycle;         \draw (-1.6,3.4) -- (-0.2,1.8) -- (1.2,3.4);              \fill [red,path fading=fade rect] (-0.2,3.4) rectangle (1.2,6.4);         \fill [red,path fading=fade rect, fading angle=180]  (-1.6,3.4) rectangle (-0.2,6.4);         \draw (-1.6,3.4) -- (-1.6,6.4);         \draw (1.2,3.4) -- (1.2,6.4);          %    \fill  [blue,path fading=south](-0.8,7.8) rectangle (0.4,-3.4);              \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/FwcBw.png) I am very happy with it but as you can see my implementation is quite messy. Basically after drawing a triangle I play around with rotations until it matches how I want, and then I draw another triangle behind it with the same rotation mirror vertically. The final problem is matching the horizontal beam up with the rotated one. Right now I am just doing trial and error. Thanks for all getting me onto the right track. If there is a solution to joining them together then I will be satisfied 100%.


title: Lining up margins in lists to text below

text: Suppose I have a resume made in LaTeX. I want to line up the margin of a specific section (or multiple sections, such that it lines up with the rest of the main text of the page. In particular, I want to line up the text in `Margin1` and `Margin2` below, such that the text in `\itemize` ends before the `\hfill`. Is this possible? Setting up custom margins (in particular, redefining the right margin for a single paragraph/section) seems to only cause the text to shift left, which is undesirable. I want the left margin to stay the same, while changing the right margin.               \documentclass{res}     \usepackage{enumitem}     \begin{document}          \section{Margin1}     \begin{itemize}     \item LONG sentence that goes to the next line Long sentence that goes to the next line Long sentence that goes to the next line     \end{itemize}          \section{Section}     \textbf{Text \hfill YYYY}     SENTENCE          \section{Margin2}     \begin{itemize}     \item LONG sentence that goes to the next line Long sentence that goes to the next line Long sentence that goes to the next line     \end{itemize}          \end{document}      Is it possible to do such a thing without manually setting the margins for each section. If yes, how do I do it? If no, how do I prevent LaTeX from shifting the text away from the left margin? Similarly, is there a method of approach for the left hand margin? In particular, I would like to line up `SENTENCE` with the start of the itemization (where `LONG` starts).


title: Getting the line number in the source code for an equation?

text: I have a long file (about 5000 lines, the pdf is about 100 pages) and I want to find an equation with a specific number (for example: 11.5) in the source code. Of course, I have access to all the `.aux`, `.log` files etc. Is there a way to locate the equation in the source code? I don't want to use inverse-search from DVI, because I'll have to do this for a large number of equations.


title: Change font style for \texttt

text: I am afraid if this is a repeat question. I have checked the following links for any hints: Change font size of \texttt globally? Using same font for \texttt and \Verb The question is simply. I want to change the font style for `\texttt`. The bigger problem is I am unsure of the 'exact' font I want but it's one of the popular fonts used for code listings. It's probably similar to Palatino but I am not sure about it.


title: Beamerposter does not automatically change font size of equation number

text: I'm using the beamerposter package. While I'm able to change the font size of my equations, I cannot change the size of their corresponding labels. Consider the code below as a MWE. Is this possible to fix?               \documentclass{beamer}     \usepackage{tcolorbox}     \usepackage{beamerposter}          \setlength{\paperwidth}{11in}     \setlength{\paperheight}{8.5in}               \begin{document}     \begin{frame}     \begin{tcolorbox}[width = 0.7\paperwidth]          \begin{tiny}     \begin{equation}     1+1=2     \end{equation}     \end{tiny}          \begin{equation}     1+1=2     \end{equation}     \end{tcolorbox}          \end{frame}     \end{document}      This produces: ![enter image description here](http://i.stack.imgur.com/Cccl3.png)


title: Does the package pst-solides3d affect images made with pst-3dplot?

text: I am working in a simple project creating some 3D representations of math surfaces and shapes for a calculus course. Most of all the pictures I have created rely heavily on `pst-3dplot`. Once I found out that pst-solides3d had certain features useful for upcomming chapters, I included it in my preamble to start working with it. My first surprise was to find that the order of the packages does have an effect on output, especially on anything created with `pst-3dplot` (plots seem to lose scale and spread all over the place). ~~My second surprise is that trying to recreate the examples from the`solides3d` documentation produces unruly results (AFAIK, wrong line color, size is out-of-whack).~~ _I have discovered my problem with this._ **update** If anyone needs to know, the unruly sizes is due to the fact that the `Decran` optional parameter is _paramount_ to regulate the size of the images. The color discrepancy must have been a typo in the example or my own fault. Either way, it's fixed   * I would like to know if there is anyone else out there who has had these issues.   * Is there any place where these side-effects are documented?   * Does pst-solides3d introduce a default configuration that produces chaos in pst-3dplot?   * If so, is there any way to compensate such configuration?   * Should I be using a special package to control the units and lengths? **Update: a working example** This is recycled from another question but it still works and it still demonstrates the strange behaviour of these 2 packages               \documentclass[11pt]{book}     % the order of these 2 packages produces strange results     \usepackage{pst-solides3d}     \usepackage{pst-3dplot}     \begin{document}     \begin{pspicture}(-2,-1)(3,3)     \psset{Beta=15}     \pstThreeDCoor[         Beta=15,         nameX=$X$,xMin=-1.7,xMax=1.7,         nameY=$Y$,yMin=-1.7,yMax=1.7,         nameZ=$Z$,zMin=-0.5,zMax=2.4,         linecolor=lightgray,linewidth=1.3pt,arrowscale=2.0     ]     %--------------BACKGROUND--------------     \psset{linecolor=lightgray,linewidth=0.7pt,yPlotpoints=1}     %horizontals     \parametricplotThreeD[yPlotpoints=2](0,360){t cos 1.5 mul t sin 1.5 mul 2.25}     %verticals     \parametricplotThreeD(0,1.55){-39 cos t mul -39 sin t mul t t mul}     \parametricplotThreeD(0,1.55){129 cos t mul 129 sin t mul t t mul}     %--------------FOREGROUND--------------     \psset{linecolor=black,linewidth=1.0pt}     %curvas coordenadas     \parametricplotThreeD(-45,135){t cos 1.2 mul t sin 1.2 mul 1.44}     \parametricplotThreeD( 0,1.60){80 cos t mul 80 sin t mul t t mul}     %punto P     \pstThreeDDot(0.208,1.182,1.44)     \pstThreeDPut[pOrigin=br](0.208,1.182,1.55){$P$ }     %VECTORS     \psset{arrowscale=1.3}     %vector Circu < -0.99 , 0.16 , 0 >     \pstThreeDLine{->}(0.208,1.182,1.44)(-0.782,1.342,1.44)     %vector Parab < 0.06 , 0.36 , 0.72 >     \pstThreeDLine{->}(0.208,1.182,1.44)(0.268,1.542,2.16)     %vector Norm < 0.115 , 0.713 , -0.366 >     \pstThreeDLine{->}(0.208,1.182,1.44)(0.323,1.895,1.074)     \pstThreeDPut[pOrigin=l](0.305,1.863,1.014){$\textbf{N}$}     %Plano Pi     \pstThreeDLine[linestyle=dashed,linewidth=0.8pt](-1.205,1.93,2.46)%     (-1.385,0.85,0.30)%     ( 1.585,0.37,0.30)%     ( 1.765,1.45,2.46)%     (-1.205,1.93,2.46)     \pstThreeDPut[pOrigin=l](-1.205,1.97,2.5){$\Pi$}     \end{pspicture}     \end{document}      Image compiled with `pst-solides3d` loaded before `pst-3dplot` ![Image compiled with solides3d loaded before](http://i.stack.imgur.com/VwSyz.png) Image compiled with `pst-solides3d` loaded after `pst-3dplot` ![Image compiled with solides3d loaded after](http://i.stack.imgur.com/aKzSU.png) ~~PS: if a MWE is required, please tell me and I'll get on it _tout-de-suite_ ~~ PPS: this is my first question in tex.stackexchange, I came from SO


title: Is there an alternative way to double quote in Latex?

text: I am editing my Latex code using MS Word. Before you get any ideas (I know it's weird) please refer How to run Latex from Word? Having found myself in this unusual predicament, I also have to use double quotes quite often. So what is `’’` becomes `’’` which is correct, but what I really want is `''`. To make it clear, I am trying to end the double quotes with the aforementioned two characters, but word modifies the standard apostrophe. So is there a different way to double quote a "phrase" in Latex? I was looking for something similar to `\dbquote{phrase}`. P.S.: Needless to add, the modification that MS Word does on `''` results in an incorrect output. For example, `"phrase"` is rendered with just the initial double quotes like `"phrase`.


title: How does one modify \xoverline for subscripts/superscripts?

text: The `\xoverline` command (see the-bar-and-overline-commands) works beautifully except that it assumes normalsize. So it blows up the size of subscripts as in               $A_{\xoverline{K}}$ vs $A_{\overline{K}}$


title: SplitArgument on colon doesn't work under expl3 syntax

text: \documentclass{article}     \usepackage{xparse}          \DeclareDocumentCommand\TestA{>{\SplitArgument{1}{:}}m}{%       \Example #1     }          \ExplSyntaxOn     \DeclareDocumentCommand\TestB{>{\SplitArgument{1}{:}}m}{       \Example #1     }     \ExplSyntaxOff               \DeclareDocumentCommand\Example{mm}{%       \begin{enumerate}       \item #1       \item #2       \end{enumerate}     }          \begin{document}     \TestA{one : two}     \TestB{one : two}     \end{document}      ![output](http://i.stack.imgur.com/OQYVM.png)


title: Remove bibliography from beamer template

text: I'm doing a presentation using the following beamer template:               \usepackage{beamerthemeshadow}      I have a file that has my bibliography. I include it has:               \begin{frame}{References}     \begin{minipage}{1\linewidth}     \bibliographystyle{unsrt}     \bibliography{bib}     \end{minipage}     \end{frame}      The problem is that this adds the bibliography to the left side of the template. ![Problem](http://i.stack.imgur.com/gBPfk.png) I want to remove/hide the bibliography from the template, but keep the slide. I tried to do something like:               \begin{frame}{References}     \begin{minipage}{1\linewidth}     \bibliographystyle{unsrt}     \bibliography*{bib}     \end{minipage}     \end{frame}      But it doesn't work. Can anyone help me? The main code is:               \documentclass[10pt]{beamer}     \usepackage{beamerthemeshadow}     \usepackage{graphicx}     \usepackage{epsfig}     \usepackage{hyperref}     \usepackage{tikz}     \usepackage{tikzpagenodes}     \usepackage{enumitem}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{natbib}          \tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]          \title{Presentation}      \author{}     \today          \setcounter{tocdepth}{1}          \begin{document}          \frame{\maketitle}           \begin{frame}{Contents}         \vspace{-1.20cm}         \tableofcontents     \end{frame}          \include{Objective}     \include{References}          \end{document}          Objective:          \section{Objective}     \begin{frame}{Objective}     \vspace{-1.80cm}     \begin{center}     Presentation     \end{center}     \end{frame}      References:               \begin{frame}{References}     \vspace{-0.50cm}     \begin{minipage}{1\linewidth}     \bibliographystyle{unsrt}     \bibliography{biblio}     \end{minipage}     \end{frame}      As you can see, I don't have a section in references, but it is still appearing in the template.


title: Exclude functions and procedures completely from list of algorithms in algorithm2e

text: I'm referring to this answer of the question on 'how to exclude functions from \listofalgorithms in algorithm2e'. The solution provided in the answer just omits the word `function` within the list of algorithms, but still prints the function name without a number (the number is replaced by a `-`). I would like to completely remove the entries for all functions and procedures from the list of algorithms. Is this possible?


title: Draw register map with TikZ

text: I was wondering if there was a way to easily draw a register map (like the one below) in LaTeX, possibly in TikZ? ![enter image description here](http://i.stack.imgur.com/7Ij6L.png) The closest I've gotten is just using the tabular environment and that's not even close to what I want, my result is listed below.               \begin{table}[h!]     \begin{tabular}{p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt} p{20pt}  >{\centering\arraybackslash}m{20pt}}     \centering 15 & \centering 14 & \centering 13 & \centering 12 & \centering 11 & \centering 10 & \centering 9 & \centering 8 & \centering 7 & \centering 6 & \centering 5 & \centering 4 & \centering 3 & \centering 2 & \centering 1 & 0\\\hline     \multicolumn{1}{|c|}{SEL} &      \multicolumn{1}{c|}{SEL} &      \multicolumn{1}{c|}{SEL} &      \multicolumn{5}{|c|}{\cellcolor{gray!25}} &      \multicolumn{1}{c|}{DIR} &      \multicolumn{7}{c|}{PWM} \\\hline     \end{tabular}     \end{table}      ![enter image description here](http://i.stack.imgur.com/BCaI0.png)


title: TeXnicCenter project - Print to separate chapter pdf

text: I have a project that includes 2 chapters and when I compile the main program it combines the pdf's of these two into one single file. How can I configure it to print to separate pdf's ?


title: Slight customization to bibtex cites in LyX

text: I am using `LyX` and `BibTeX` for my bibliography. I would like the following setup for my citations: 1) In the text a cite should have a comma between the last author name and year `(LAST_NAME, YEAR)`. 2) Every time four or more authors are on a paper I want the first use to spell out each author and then use et al. All authors should be listed if the total number of authors is less than or equal to 3 3) In the bibliography it should follow the format `LAST_NAME, FIRST_INITIAL.` for the first author and `FIRST_INITIAL. LAST_NAME` for subsequent authors. I am using `natbib` with the style `author-year` and have tried using a lot of different threads to fix this issue. A few hours later, I thought it would be easier to ask.


title: "The LaTeX Companion" example environment

text: I'm a new LaTeX learner. Is there anybody who knows "Example environment" in "The LaTeX Companion" book? Thanks in advance.


title: Setting margins exactly

text: My thesis formatting requires 1.5-inch margin on the left side and a 1-inch margin on the three remaining sides. Since all pages must be printed on one side of the page, I used the following:               \documentclass[oneside,12pt]{book}     \usepackage[top=1in, bottom=1in, left=1.5in, right=1in]{geometry}     \pagestyle{plain}     \begin{document}          some text here          \end{document}      But something is wrong. On the even pages the left margin is little smaller than 1.5 inch. And on the odd pages the right margin is less than 1 inch. I couldn't figure out what's wrong.


title: Specify number of columns in brqalign

text: Some time ago David Carlisle wrote an awesome `brqalign` function in this answer: http://tex.stackexchange.com/a/51543/4011. See the cited code below. How to modify the `brqalign` environment such that one can specify in an optional argument the number of columns or at least the maximal number of columns? As in the original `brqalign` the columns should also be equally distributed over the whole textwidth.               \documentclass{article}     \usepackage[leqno]{amsmath}          \renewcommand\theequation{\alph{equation}}          \newenvironment{brqalign}{%     % START CODE     %%%%%%%%%%%%     % Do everything an a box, as you can not remove     % things from the main vertical list.     \setbox0\vbox\bgroup     % Allow \\ for ends of row.     \let\\\cr     % Use an \halign (I experimented with using one     % of the AMS alignments but they tend to want to      % be full width, or already in math mode, so just     % use a primitive \halign here with two display math     % entries in its preamble.     \halign\bgroup       \refstepcounter{equation}\theequation)\quad       \hfil$\displaystyle##$&$\displaystyle{}##$\hfil\cr}%     {%     % END CODE     %%%%%%%%%%     % Finish the \halign.     \crcr\egroup     % Now, at this point the vertical list being assembled in     % box0 contains all the rows of the alignment these will be     % a sequence of \hboxes (which will all be forced to be the     % same width) and baselineskip glue. (While testing with the     % AMS alignments there was additional glue and penalties     % as well.     %     % We will discard all the glue and penalties but assemble     % a horizontal list of the boxes in box1.     % start by making box1 and empty hbox.     \global\setbox1\null     % Then loop backwards up the vertical list discarding any glue     % and penalties and grabbing hold of each box.     \loop     % This combination removes two adjacent glue items     % or glue followed by penalty, it may be more than needed     % but better be safe than sorry.     \unskip\unskip\unpenalty\unskip\unpenalty     % Glue and penalties we discard, but the boxes have the     % formula so remove this one from the current list and     % save it in box 4.     \setbox4\lastbox     % If there was no box box4 is void and we reached the top     % of the original vertical alignent so stop.     \ifvoid4     \else     % Otherwise Put this box4 at the front of the horizontal     % list being built in box1, followed by an em of space.     \global\setbox1\hbox{\box4\hskip 1em\unhbox1}%     % Go round the loop again.     \repeat     % End the group for the working box 0.     % The horizontal list is globally assigned     % to box 1 so will be visible after this group end.     \egroup     % Now put out all the boxes flush left, the usual paragraph breaker     % will fit as many on a line as it can. As each box is the same width     % vertical alignment is automatic.     \begin{flushleft}\unhbox1 \end{flushleft}%     % Ignore white space after the end of the environment     \ignorespacesafterend     }          \begin{document}          \begin{brqalign}       x^2 + y^2 &= 1\\       a + b &= c\\       r-x &= y+z \\       f - y &= z\\       a - b &= 2d\\       r+x &= 2y-3z     \end{brqalign}               \end{document}


title: Different footer for each chapter

text: I would like to have a different custom footer for each chapter. For e.g each chapter has a version, i would like to print that version for that chapter in the footer.


title: Problem with my unique bibliography format

text: My thesis bibliography format has a unique requirement as below. > Cadenas, E; and Rivera, W., Renewable Energy, 35(12), **2010** , 732-742. Author without article title and bold year etc. I could generate almost everything using latex makebst, except that year is misplaced as below > Cadenas, E. and Rivera, W., Renewable Energy, **2010** , 35(12), 732-742 that is year is placed between vol(issue) and journal name, but it should come between vol(issue) and page number as shown earlier reference. This specific change is not available in latex makebst options. How can I do this?


title: A table that grows horizontally

text: I have a two column table that is rather "thin" on the page and leaves a lot of blank space. I wish to grow it sideways by limiting the maximum number of rows it produces. Let us say I have a 12x2 table. I want to reduce the height of this table and end up with a maximum number of rows limited to 6. That should produce a 6x4 table, with columns 1 & 2 for the first six entries in the original table, and columns 3 & 4 for entires 7-12. The "data type" in columns 1 & 3 is the same. Ditto for columns 2 & 4. For instance:               Num1 & 1\\     Num2 & 2\\     Num3 & 3\\     Num4 & 4\\     Num5 & 5\\     Num6 & 6\\     Num7 & 7\\     Num8 & 8\\     Num9 & 9\\     Num10 & 10\\     Num11 & 11\\     Num12 & 12\\      Becomes (in terms of markdown):               Num1 | 1 || Num7  | 7     Num2 | 2 || Num8  | 8     Num3 | 3 || Num9  | 9     Num4 | 4 || Num10 | 10     Num5 | 5 || Num11 | 11     Num6 | 6 || Num12 | 12      How would one do it? I have not found any table environment that does this out of the box. So, we need a \newenvironment or something like that. Extensions - what if I want to limit the number of rows to 4? Then I should have a 4x6 table with three sets of columns instead of 2 above.


title: Pass a macro (with arguments) as an argument for another macro

text: In Pass a command as argument for another command, a notion of invoking TeX macros as methods was described. In my case, I'm attempting to use arguments within the call structure. My example below uses two passes of `\StrSubstitute` to replace characters that I want to modify:               \usepackage{xstring} % for StrSubstitute          \newcommand*{\changeslash}[1] {%         \StrSubstitute{#1}{/}{5c}%     }     \newcommand*{\changedollars}[1] {%         \StrSubstitute{#1}{\$}{24}%     }     \newcommand*{\changeboth}[1] {%         \changeslash{\changedollars{#1}}%     }      I've experimented with adding `\expandafter` in different places, but this problem has me stumped.


title: Hyphenation problem

text: I am having trouble with the hyphenation of a project I am writing. More precisely it will not hyphenate the word $\ast$-homomorphism. I have tried with `\hyphenation{ho-mo-mor-phism}`, but to no luck. Of course I suspect that it is the `$\ast$-` which courses the problem, but why? and how do I make the word hyphenate? Here is an example where my problem occurs:               \documentclass[a4paper,10pt,draft]{article}          \hyphenation{ho-mo-mor-phism}          \begin{document}          I would really much like to have the---frequently     appearing---word $\ast$-homomorphism hyphenated.          \end{document}


title: How to change the order of first/last name in biblatex?

text:
I have a question on changing the order of first/last names of authors using `biblatex`. For example, the `.bib` file contains one entry as:               @incollection{Liu:2001vx,
     author = {Liu, Jane and West, Mike},
     title = {{Combined parameter and state estimation in simulation-based filtering}},
     booktitle = {Sequential Monte Carlo methods in practice},
     year = {2001},
     editor = {Doucet, Arnaud and de Freitas, Nando and Gordon, Neil},
     pages = {197--224},
     publisher = {Springer}
     }      I want the compiled output of author names to be in the form of First von Last, Jr. How to make `biblatex` to output the author names in the desired order. For example, the West, Mike is in the `.bib` file, I want the name to be printed as Mike West. I appreciate for your kind and prompt help.


title: LyX: add multiple authors

text: In Lyx, I have to insert 3 authors in an article. For each one of them I will have to specify their email address and the university they belong to. Two belong to the same one:               author_a, author_a@email.com, university_1     author_b, author_b@email.com, university_2     author_c, author_c@email.com, university_2      How do I do this in Lyx? I tried looking at this, but it's quite confusing. Could anybody write me step-by-step how to do this? Thanks a lot.


title: Hypotheses and Subhypotheses with ntheorem

text: The goal is to have an environment that can, depending on a trigger, either create this: **Hypothesis 1** The better the answer, the higher the score. or that **Hypothesis 2a** Higher score is positive correlated with shoesize. **Hypothesis 2b** Lower score is negative correlated with shoesize. I tried a code I found in Google Groups, and it works. However it produces some error messages which I don't understand. Please see the minimal example below:               \documentclass{article}     \usepackage{ntheorem}     \newtheorem{hyp}{Hypothesis}      \newcounter{subhyp}      \newcommand{\subhyp}{        \setcounter{subhyp}{0}        \renewcommand\thehyp{\protect\stepcounter{subhyp}%        \arabic{hyp}\alph{subhyp}\protect\addtocounter{hyp}{-1}}      }      \newcommand{\normhyp}{        \renewcommand\thehyp{\arabic{hyp}}        \stepcounter{hyp}      }      \begin{document}          \normhyp     \begin{hyp}     The better the answer, the higher the score.     \end{hyp}          \subhyp     \begin{hyp}     Higher score is positive correlated with shoesize.     \end{hyp}          \begin{hyp}     Lower score is negative correlated with shoesize.     \end{hyp}          \end{document}


title: How do I highlight particular authors in a bibliography?

text: I'd like to indicate one or more authors in a bibliography entry that should be highlighted, e.g., boldface. This solution allows one to indicate _one_ author from the list, using an index provided in the auxiliary field `usera`. How would the solution be changed in order to allow multiple authors, e.g.,               author = {J. Doe and J. Smith and J. Quincy}     usera = {1,3}      This would result in the first and third authors being highlighted.


title: Creating a handout with the notes of a second screen

text: How can I print slides and their accompanying note pages from a second screen as a handout? I try to accomplish this look: ![enter image description here](http://i.stack.imgur.com/ddXqy.png) (preferably 3 slides and their 3 note pages per page, the spaces between the slides are not important). * * * Now when using `\pgfpagesuselayout{8 on 1}` some slides are missing and the positioning is completely wrong:               \documentclass{beamer}     \usepackage{pgfpages}          \setbeameroption{show notes on second screen}           \pgfpagesuselayout{8 on 1}          \setbeamercolor{background canvas}{bg=gray}          \begin{document}              \fontsize{60}{64}\selectfont              \begin{frame}              Slide 1             \note{\fontsize{60}{64}\selectfont Note 1}         \end{frame}              \begin{frame}             Slide 2             \note{\fontsize{60}{64}\selectfont Note 2}         \end{frame}              \begin{frame}             Slide 3             \note{\fontsize{60}{64}\selectfont Note 3}         \end{frame}          \end{document}      ![enter image description here](http://i.stack.imgur.com/lZhEO.png) If possible I would like to keep `\setbeameroption{show notes on second screen}`, because of this Beamer section page and show notes for every page question


title: robust version of \@ifnextchar?

text: The command `\@ifnextchar` cannot be used in a `\section` and the like. It fails with a "TeX capacity exceeded" message. This is pretty clearly related to the recycling of the section name for the table of contents and/or page marks, as shown by the following minimal pair:               \documentclass{article}          \begin{document}     \makeatletter     \section[Safe command]{This: \@ifnextchar /{A}{B} works fine}          \section{This: \@ifnextchar /{A}{B} triggers an error}     The end.      \end{document}      I believe I have ruled out superficial name clashes, so I'm putting my hopes on robustness. Is there a robust version I can try out, or some other way around this limitation? # Notes   1. I've seen some discussion of the `expl3` equivalent (e.g., here, but they don't discuss robustness.   2. I'm actually using a self-constructed variant of `\@ifnextchar` that does not skip over whitespace, so ultimately I'm looking for a solution with the same property.    3. This is all related to a bug report on gb4e, called to my attention by Alan Munn.  # Edit: Since apparently my minimal example was _too_ minimal, here's the actual use case (still simplified): In `gb4e`, `^` and `_` are made into `\active` characters so that they can be used outside math mode. In order to switch in and out of math mode correctly, they need to check if the next command is also a sub- or super-script command, hence the call to `\@ifnextchar` (or really to a modified version, but that's irrelevant here).               \documentclass{article}       \makeatletter       \catcode`\_=\active       \catcode`\^=\active       \def_#1{\@ifnextchar^{\automath@two_{#1}}{\ensuremath{\sb{#1}}}}       \def^#1{\@ifnextchar_{\automath@two^{#1}}{\ensuremath{\sp{#1}}}}       % handle consecutive sub- and super- scripts:       \def\automath@two#1#2#3#4{\ensuremath{#1{#2}\relax #3{#4}}}          \begin{document}         \section{This A_B fails}     \end{document}


title: place floating tables and figures in order of appearance

text: In my document I number tables and figures with the same counter, using the answer to http://stackoverflow.com/questions/3865036/using-a-single-count-for- figures-and-tables-in-latex/7771554#7771554. I'd like them to appear in numerical order. That usually happens, but in one case I see Figure 1.2 after Table 1.3 - probably because the Table is smaller and happens to fit on the current page. I could fix this by _calling_ this Table a Figure without torturing the text too much, but a `LaTeX` solution would be automatic. If no one answers soon I can put together an MWE by playing with Figure, Table and page lengths. The question and answer at Order of float types on float pages seems to deal with the opposite of what I want.


title: Using \@author variable to put authors name in fancy header

text: I'm using `\@author` variable to put authorname in header of my document. Currently, header shows authorname and footnotemark which incerements every page:               \makeatletter     \let\runauthor\@author     \let\runtitle\@title     \makeatother          \fancyhead[OC]{\runauthor}     \fancyhead[EC]{\sc \runtitle}      For example, if author is John Doe, I get printed               John Doe^1 (1.page)     John Doe^2 (2.page)     ...     etc.      Any ideas ?


title: letting long/many footnotes 'flow' over two pages (eledpar)

text: I'm using the eledmac and eledpar packages for typesetting several critical editions. I have facing pages with the original foreign language on the left, even pages and the accompanying translation on the right, uneven pages. The foreign text on the left pages has textual variants in the apparatus/footnote series, the translation has two separate series of footnotes with references and comments. The problem now is that usually the translation and its footnotes take up lots of space while there is unused space on the left pages with the foreign text. Is there a way to let the footnotes belonging to a right page begin on a left facing page and then flow over to the right page (in the lower space for footnotes) when the left page is full? Here is a current minimal example with all the footnotes on the pages they 'belong' to:               \documentclass[twoside,12pt,a4paper]{scrbook}     \usepackage[english]{babel}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{eledmac}     \usepackage{eledpar}     \usepackage{setspace}          \setlength{\parindent}{2em}     \onehalfspacing     \setlength{\parskip}{0pt}          \footparagraph{A}     \renewcommand*{\thefootnoteA}{\alph{footnoteA}}          \begin{document}          \begin{pages}          \begin{Leftside}     \beginnumbering\pstart     Lorem ipsum dolor sit amet, \edtext{consectetuer}{\Afootnote{insectetuer M}} adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum \edtext{sociis}{\Afootnote{socialis M}} natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, \edtext{vulputate}{\Afootnote{vultures}} eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum \edtext{felis}{\Afootnote{felidae D}} eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. \edtext{Aenean}{\Afootnote{Herculean T}} leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum.          Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, \edtext{lorem}{\Afootnote{ipsum Q}}. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet \edtext{orci}{\Afootnote{Orcs S}} eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc.     \pend\endnumbering     \end{Leftside}          \begin{Rightside}     \beginnumbering\pstart     One morning, when Gregor Samsa\footnoteA{Obscure reference 1} woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding\footnoteB{Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.} was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked. "What's happened to me?" he thought. It wasn't a dream. His room, a proper human room\footnoteB{One day however a small line of blind text by the name of Lorem Ipsum decided to leave for the far World of Grammar. The Big Oxmox advised her not to do so, because there were thousands of bad Commas, wild Question Marks and devious Semikoli, but the Little Blind Text didn’t listen.} although a little too small, lay peacefully between its four familiar walls. A collection of textile samples lay spread out on the table - Samsa\footnoteA{Obscure reference 2} was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather.          A wonderful serenity\footnoteB{Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean.} has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine. I am so happy, my dear friend, so absorbed in the exquisite sense of mere tranquil existence, that I neglect my talents. I should be incapable of drawing a single stroke at the present moment; and yet I feel that I never was a greater artist than now. A collection of textile samples lay spread out on the table - Samsa\footnoteA{Obscure reference 3} was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather.     \pend\endnumbering     \end{Rightside}     \Pages          \end{pages}          \end{document}      In the end it should more like the pdf that is linked here. I was not sure if I'm allowed to link the pdfs of that website of professional typesetters here, hence the link. I'm grateful for any ideas or suggestions. Patrick


title: Insert a linebreak only if there was none before

text: I am looking for a way to tell TeX: Please break that line if and only if you are not on new line already. I need this for a new environment which should always start in a new line. But I don't (how could I?) know, whether the author has typed a linebreak in front of that manually. I tried `\linebreak`, `\\`, and `\newline`, all of them caused the > LaTeX Error: There's no line here to end. error, which I expected to show up, when trying               \newenvironment{mynewenvironment}{\\ \emph{Header:} }{}     [...]     random text \\     \begin{mynewenvironment}     text again     \end{mynewenvironment}      One can observe the same behavior with predefined environments, for instance               random text      \begin{itemize}     \\ \item text     \end{itemize}      is causing the error but not               random text          \begin{itemize}     \item text     \end{itemize}          random text\begin{itemize}     \item text     \end{itemize}      Both are doing exactly how I want my environment to react, therefore I expect my problem to be solvable fairly easy, but I don't know how.


title: Randomly bouncing balls with constant tails in a spherical constraint

text: How easy is the following animation made with TikZ, PSTricks, and Asymptote? ![enter image description here](http://i.stack.imgur.com/jBjTg.gif) Use the following as a starting template to save your time.               \documentclass[border=12pt]{standalone}     \begin{document}     .     \end{document}


title: How to label arrows in tikz-cd diagrams with matrices?

text: I'm using `tikz-cd` for some commutative diagrams, but if I try to label an arrow with a matrix, `&` appears to be "undefined control sequence". So all the entries in a row get concatenated, and it looks like a column vector. The following is a (minimal) working example.               \documentclass{article}     \usepackage{amsmath}     \usepackage{tikz-cd}     \begin{document}          $\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$          \begin{tikzcd}     A \arrow{r}{ \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} } & B     \end{tikzcd}          \end{document}


title: Referencing label with conditional page info

text: I would like to have an easy way to reference a label and if that label is not on the current page then its page should be printed in the reference like "See example 2.3 (p.4)". I tried the `varioref` and the `cleveref` packages but their text output using `\vref` or `\cref` is too verbose for me. I couldn't find anything in the documentation to just print (p.4) instead. Or is there another alternative?


title: How to center floating in enumerate environment?

text: I would place the floating center, while it is left.               \documentclass[11pt]{article}     \usepackage[charter,uppercase = upright]{mathdesign}     \usepackage[no-math]{fontspec}     \usepackage{polyglossia}     \usepackage{luamplib}     \usepackage{float}     \def\a{blabla blabla blabla blabla  blabla blabla }     \begin{document}     \selectlanguage{USenglish}     \begin{enumerate}     \item \a     \begin{figure}[h!]     \centering     \begin{mplibcode}      beginfig(1);      u:=1cm;      defaultscale := 0.9;      z0=(0,0);      z1=(4u,0);      z2=(6u,3u);      z3=(2u,3u);      z4=whatever[z0,z2]=whatever[z1,z3];      path p ;      p=z0--z3;      draw z0--z1--z2--z3--cycle;      draw z1--z3;      draw z2--z0;      label.lrt("B",z1);      label.urt("C",z2);      label.ulft("D",z3);      label.llft("A",z0);      label.top("E",z4 shifted(0,0.1u));      draw (1u,0) withpen pencircle scaled 3bp withcolor red;            draw point (1/3)*length(p) of p withpen pencircle scaled 3bp withcolor red;      label.bot(btex $\color{red}I$ etex,(1u,0));      label.lft(btex $\color{red}J$ etex,point (1/3)*length(p) of p);      endfig;     \end{mplibcode}     \end{figure}     \a     \begin{enumerate}     \item \a     \item \a     \end{enumerate}     \end{enumerate}     \end{document}


title: Origin shift in pgfplots

text: I want to shift the origin in such a way as the following code will cause the circle to appear with center at the point marked in red.               \documentclass{article}     \usepackage{amsmath}     \usepackage{pgfplots}     \usepackage{color}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[shift={(0,0)}]     \begin{axis}[          ticks=none,         axis lines = middle,         axis line style={->},         ymin=0,         xmin=-3,         xmax=3,         xlabel={$Y$},         ylabel={$\pi$}]     \addplot[black, domain=-2:2] {x+3};     \addplot[red,mark=*] coordinates {(0,3)};     \node[coordinate, pin=0:{target}] at (axis cs:0.5, 3){};     \end{axis}     \draw (0,0) circle[radius=1];     \end{tikzpicture}     \end{document}


title: how to plot error bars on top of previous data using pgfplots?

text: I am trying to plot a set of points with error bars on top of a very dense scatter plot, and the error bars are hidden behind the data as shown in the attached figure.               \documentclass{standalone}          \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}       \begin{semilogyaxis}         \addplot[blue,mark=x] table [x index=0,y index=1]           {PSF_blue_0_prof.dat};         \addplot[green,mark=x, error bars/.cd,y explicit,y dir=both]           table [x index=0,y index=1,y error index=2]           {PSF_blue_1.0_prof.dat};       \end{semilogyaxis}     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/nWDKz.png) Data files are available here:   * https://docs.google.com/file/d/0B3Hv-zV2q5IcR3l2YTRHTm9qdkE/edit   * https://docs.google.com/file/d/0B3Hv-zV2q5IcbzZmSVU5bHhjOFk/edit The green data points are added in the end using `error bars/.cd,y explicit,y dir=both` but the error bars appear behind the previous blue and red data. How could I plot the error bars in this figure?


title: Sectioning in letter-type documents

text: I want to use sectioning in letters (`section`, `subsection`, etc), but here I read that basically all of these sectioning commands do not apply to letters. What is the proper way to create sections in letters? Using: `documentclass[stdletter]{newlfm}`


I have a not-that-complicate table like below, but I always got a error "Underfull \vbox (badness 10000) detected at line 127", hopefully you can reproduce it. Does anybody know the reason and how to fix it? This is a just an example and I may have about 100 tables in one file and I would like to fix it at the beginning.               \documentclass{article}     \usepackage{array}     \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \usepackage{geometry}     \usepackage[parfill]{parskip}       \geometry{letterpaper}      \usepackage{graphicx}        \usepackage{longtable}     \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \usepackage{colortbl, xcolor}     \usepackage{amssymb}     \usepackage{enumitem}     \usepackage{float}     \usepackage{color}     \usepackage{multirow}     \usepackage{epstopdf}        \hfuzz=\maxdimen        \tolerance=10000        \hbadness=10000               \begin{document}     \begin{longtable}{rL{2cm}L{3.5cm}L{2cm}L{4cm}L{1.8cm}}       \hline      & Variable & Description & Type & Values & Missing \\        \hline     1 & sid & child id & string &  &  \\         \rowcolor[gray]{0.8}2 & specnum & specimen number  & string &  &  \\        3 & specseq & specimen sequence & string &  &  \\         \rowcolor[gray]{0.8}4 & spectype & specimen type  & string &  &  \\        5 & vstnum & visit number & integer &  &  \\         \rowcolor[gray]{0.8}6 & vstwk & visit week & string &  &  \\        7 & vstdetail & visit details  & string &  &  \\         \rowcolor[gray]{0.8}8 & lps & α lps gmu/ml (endocab) & integer &  -9= missing & -9 \\        9 & rept & do you need to repeat sample? & categorical & 1 = yes, 2 = no &  \\         \rowcolor[gray]{0.8}10 & resn & reason for repeating & categorical & 3=sample out of range, 4 = assay failed, -9 = not applicable & -9 \\        11 & comnt & comment & string &  &  \\         \rowcolor[gray]{0.8}12 & specdt & date of specimen collection dd/mm/yy & date &  & 1999-09-09 \\        13 & assydt & date assay performed dd/mm/yy & date &  & 1999-09-09 \\         \rowcolor[gray]{0.8}14 & dedt & date entered & date &  & 1999-09-09 \\        15 & qcdt & date checked & date &  & 1999-09-09 \\         \rowcolor[gray]{0.8}16 & batch & assay batch \# & integer &  &  \\        17 & version & batch version & string &  &  \\         \rowcolor[gray]{0.8} \hline     \hline     \end{longtable}     \end{document}


title: Vim latex suite "alt" macro not working

text: I tried using the alt+i macro to insert list item intelligently, but it didn't work and neither did other alt macros for latex suite. Any insight to resolve this problem is very well appreciated!


title: manipulate slides in Latex Beamer

text: I created a beamer slide, What I want to do in the next slide is:   1. Blur the previous slide and have it as background of the new slide   2. Creating a box and write a few lines in it.  note that the in the first slides I have columns containing pictures and TikZ picture. Is there an elegant way to this except of a copy and paste solution?


title: comment.sty and UTF8 encoding

text: I noted that if I use comment.sty and a there is a block of text containing UTF8 characters inside a comment environment, the compilation aborts! **Minimal Example**               \documentclass{article}     \usepackage[T1]{fontenc}     \RequirePackage[utf8]{inputenc}%this file is stored as UTF8 file!     \RequirePackage{comment}     \specialcomment{privateSolution}         {\begingroup\itshape\noindent\textbf{Solution}\\}         {\endgroup}     %\excludecomment{privateSolution}%Use it to remove solutions!          \begin{document}     \title{Comment.sty and UTF8 test file}     \maketitle     \section{UTF8 character test}     In which alphabet characters àìùòè are common?     \begin{privateSolution}         The Italian alphabet contains àìùòè.     \end{privateSolution}          \begin{comment}         The Italian one! It contains àìùòè.     \end{comment}     \end{document}      Has anyone the same problem? Any workaround? Thanks in advance.


title: How to make the comment package work with german umlauts

text: I want to use the commentpackage with special german characters (umlauts), but it doesn't work. I get the following error message:               ERROR: Undefined control sequence.          --- TeX said ---     \UseTextAccent ...up \@firstofone \let \@curr@enc                                                        \cf@encoding \@use@text@en...     l.24   Deutsche Umlaute: äüö      Here is my example:               \documentclass{article}               \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{ngerman}     \usepackage{ascii}          \usepackage{comment}     \specialcomment{testcomment}{\asciifamily}{\normalfont}          \begin{document}          Here is a comment which works.           \begin{testcomment}       Test     \end{testcomment}          Here is a comment that doesn't work.          \begin{testcomment}        Deutsche Umlaute: äüö     \end{testcomment}          \end{document}      Any idea, how to make this work? **Edit** Using               \renewcommand\ThisComment[1]{%       \immediate\write\CommentStream{\unexpanded{#1}}%     }      after `\usepackage{comment}` solved the problem completely.


title: Moving in TeXstudio on a Mac

text: is there a way to make TeXstudio's shortcuts behave as one would expect on OS X? In particular, Command+Left usually moves the cursor to the beginning of the line, but in TeXstudio it takes me left a word. Similarly, Alt-Left usually moves the cursor a word to the left, but in TeXstudio it moves the cursor to the previous edit location.


title: TikZ coordinate calculations

text: I have very simple problem, and I also have a solution to the problem. But I am hoping for a better solution:) Consider the following code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}       \begin{tikzpicture}         \foreach \x in {1,2,3} {           \coordinate (V\x) at ($(\x-1,0)$);         }         \foreach \x in {1,2} {                     \draw[black] ($(V\x)$) -- ($(V{\x+1})$);         }       \end{tikzpicture}     \end{document}      In the first `\foreach` loop the calculation `\x+1` works fine, however in the second loop the problem is that `$(V{\x+1})$` expands to `V{1+1}` and not `V2`.. I hope there is way to avoid defining another variable to solve this.. I know I could solve this writing               \foreach \x in {1,2} {        \pgfmathtruncatemacro{\y}{\x+1};        \draw[black] ($(V\x)$) -- ($(V\y)$);      }      But this feels like overkill to me :).. Is there a way to avoid using `\pgfmathtruncatemacro` here?


title: Force multiple lines for the name tag

text: I'm currently entering authors an a paper and I came across this problem: ![enter image description here](http://i.stack.imgur.com/KfsrB.jpg) As you can see there are multiple names on one line, though outside the page. I would like to get them on two lines. At the moment I'm using the \name tag. I tried separating the lines the sentence by adding two backslashes, but it did not help. ( I get "! Missing } inserted." error). I tried replacing the \name tag by \author, but it did not work. example:               \documentclass{article}      \usepackage{spconf,amsmath,graphicx}     \usepackage{amsmath}      \usepackage{algorithm}      \usepackage{algpseudocode}      \usepackage{color}     \usepackage{cite}           \title{Title}                \name{Name1$^{1}$, Name2$^{3}$, name3$^{3}$ name4 $^{1,2}$, name5,$^{2}$ name6 $^{2}$, name7$^{3}$}               %      \maketitle      %           \begin{abstract}      I tried:                \name{Name1$^{1}$, Name2$^{3}$, name3$^{3}$ name4\\ $^{1,2}$, name5,$^{2}$ name6 $^{2}$, name7$^{3}$}      But I get an error.


title: Why does Context line-break my quotation and leave the quotation sign on it's own row?

text: Using Context to set a book I have the following problem: Context linebreaks some quotations in a way that makes the quotation sign (in my case a guillemet [sic!]) appear on its own row. How can i prevent this? I guess I could in some way use a `\hbox{around the quote}` but I would like to prevent this from happening in the whole document. How can I achieve that? ![Above MWE compiled](http://i.stack.imgur.com/ppEjv.jpg) # NSMWE (Not so minimal working example ...)               \enableregime   [utf-8]     \mainlanguage   [sv]          \setupbodyfont [cmr,10pt] % 10.6 för att fylla 64 sidor           \setupindenting[9mm]          % Indentera kommande rader i stycken     \definestartstop       [exdent]       [before={\startnarrower[left]\setupindenting[-\leftskip,yes]},        after=\stopnarrower]          \setupdelimitedtext[quotation:1][left=»,right=»]     \setupdelimitedtext[quotation:2][left=',right=']          %% Layout %%     \setuppapersize[A5][A5] % ,landscape     \setuplayout [location=middle,         height=189mm, % höjd på text+sidfot+sidhuvud -- Dessa tre första är de enda som påverkar brödtextsfältets storlek             width=95mm, % bredd på text     topspace=22mm, % utrymme över sidhuvud         backspace=17mm, % utrymme mellan text och rygg         headerdistance=10pt, % mellan sidhuvud och text         header=10pt,         footerdistance=4mm, % text till sidfot         bottomspace=4mm, % mellan sidfot och sidslut         footer=37mm,         leftmargindistance=2mm, % text till vänstermarginal         leftmargin=13mm,         leftedge=2mm, % vänstermarg rygg         rightmargindistance=2mm,         rightmargin=32mm, %33 justera rightedge och margin efter skrivarens fysiska marginal         rightedge=3mm, %2         grid=yes,         marking=on,]          \starttext          \indenting[yes]     När jag som liten uppgett att teckningen föreställer \quotation{Tomtarnas eld i skogen} kanske det inte alls var menat som en optisk liknelse av denna händelse, utan som en annan typ av {\em teckning} av tomtarnas eld i skogen.          \stoptext


title: Biblatex 2.1 bug

text: After updating my texlive 2012 installation using `tlmgr update --all --self` the `biblatex` was updated to version 2.1 and `biber` to version 1.1. Now I cannot compile my document. I get the following error:               compiling main.tex...     /usr/local/texlive/2012/texmf-dist/tex/latex/biblatex/biblatex.sty:86: Missing number, treated as zero.     /usr/local/texlive/2012/texmf-dist/tex/latex/biblatex/biblatex.sty:86: Missing = inserted for \ifnum.     /usr/local/texlive/2012/texmf-dist/tex/latex/biblatex/biblatex.sty:86: Missing number, treated as zero.     /usr/local/texlive/2012/texmf-dist/tex/latex/biblatex/biblatex.sty:86: Missing \begin{document}.     main.tex:268: Missing number, treated as zero.     main.tex:268: leading text: \addbibresource     main.tex:268: Missing = inserted for \ifnum.      main.tex:268: leading text: \addbibresource     main.tex:268: Missing number, treated as zero.     main.tex:268: leading text: \addbibresource     main.tex:268: Missing \begin{document}.     main.tex:268: leading text: \addbibresource     main.tex:704: Missing number, treated as zero.     main.tex:704: leading text: \begin{document}     main.tex:704: Missing = inserted for \ifnum.     main.tex:704: leading text: \begin{document}     make: *** [pdf] Error 1      With the previous version everything was ok!


title: Adding a TikZ figure to a document

text: I really hate to post "what's wrong with my code" questions, but I'm a bit clueless and couldn't find a good guide about it. Anyway, I'm trying to add a figure which was created by TikZ to my document. I'm trying this code, which gives me a blank page:               \documentclass[english,hebrew,fleqn]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9,utf8x]{inputenc}     \usepackage{tikz}     \usepackage{babel}     \begin{document}     טקסט לפני תמונה     \begin{tikzpicture}[scale=1]     \draw (0,0) -- (1,1);     \end{tikzpicture}     טקסט אחרי תמונה     \end{document}      (I put down some Hebrew because the document is in Hebrew; I don't know if it matters) Anyhow, I want to be able to put figures "inline", like in the example above, and in a different file, that is making the figure in a different file and loading it to my document. Thanks for all replies!


title: Typesetting a directed, weighted graph with TikZ

text: I just started doing things with TikZ today and I run into a problem: there is just no example code snippets for typesetting directed, weighted graphs. Can anyone supply one simple example in an answer?