title: Change on click in beamer

text: Is the following possible using the beamer class:   1. You have two images `image1.jpg` and `image2.jpg`   2. You define two "clickable" areas (a1 and a2) of your frame which you can overlay by an picture or tikzimage to simulate fancy buttons   3. If you click on a1 `image1.jpg` is shown, if you click on a2 `image2.jpg` is shown (i.e. image1 is replaced by image2). More generally I need this for n areas and n pictures. Here is an example. It doesn't work, since it is mainly pseudo-code and just want's to illustrate what I want. This example doesn't imply that the solution should be made of tikz or that it should be the same syntax. All what I want is what I described above.               \documentclass{beamer}          \usepackage[draft]{graphicx}          \usepackage{tikz}          \usepackage{boolexpr}          \def\show{1}          \begin{document}     \begin{frame}             \switch        \case{\show == 1}        \includegraphics[width=0.9\linewidth]{test1}        \case{\show == 2}        \includegraphics[width=0.9\linewidth]{test2}        \otherwise        \endswitch             \begin{tikzpicture}           \node[onclick={\show = 1}] at (0,0) {\includegraphics[width=0.5cm]{Button1}};           \node[onclick={\show = 2}] at (0,2) {\includegraphics[width=0.5cm]{Button2}};        \end{tikzpicture}     \end{frame}     \end{document}


title: Problem with special characters in listings

text: I'm having problems with my TeX document. I'm trying to import my java file in listings to get syntax colouring and stuff. My java files contains comments in Danish, which means they contain special characters (æ, ø and å). I managed to view those by adding `\lstset{inputencoding=utf8, extendchars=\true}` to my premable. even though I can see the characters in my document, it still isn't right. The syntax colouring isn't applied to the special characters and they aren't in the right place in the words. You can see an example here: ![enter image description here](http://i.stack.imgur.com/8O0XO.png) It's supposed to say "...du fortsætte med at åbne programmet?..." It's like the special characters jump to the beginning of the word and then the syntax colouring isn't applied. Hope someone is able to help.. Thanks.. **EDIT** I got it working by using ansinew charset in stead of using UTF8 as inputenc. This is exactly how I did:                    \documentclass[a4paper,oneside]{memoir}     \usepackage{ucs}     \usepackage[utf8]{inputenc}     \usepackage[danish]{babel}     \usepackage[T1]{fontenc}      \usepackage{listings}     \lstset{literate=%     {æ}{{\ae}}1     {å}{{\aa}}1     {ø}{{\o}}1     {Æ}{{\AE}}1     {Å}{{\AA}}1     {Ø}{{\O}}1     }     \lstset{extendedchars=\true}     \lstset{inputencoding=ansinew}          \begin{document}     \begin{lstlisting}     public class Main     {         public Main(String args[])         {             // Java logic         }     }     \end{lstlisting}     \end{document}


title: Number of newtheorem overlaps with newtheorem in the Appendix

text: I have the following code:               \documentclass[a4paper,12pt]{article}      \renewcommand{\proofname}{\textbf{Beweis}}     \newtheorem{Satz}{Satz}[section]     \newtheorem{code}[Satz]{MATLAB-Code}           \begin{document}          \section*{Anhang}     \renewcommand\thesection{\hspace{-1em}}     \sectionmark{Anhang}     \addcontentsline{toc}{section}{Anhang}     \begin{code}     ...     \end{code}     \end{document}      The problem is that the number of the code overlaps with the word MATLAB-Code in the appendix (Anhang). I guess it has something to do that there is no section number for the appendix. How can I fix that? If I write               \newtheorem{code}{MATLAB-Code}       then the number of the newtheorem and the word MATLAB-Code don't overlap, but then the codes get numberes from 1 on instead of using the section number. Thanks a lot!!!


title: Is there a left-handed equivalent of \implies?

text: I’m aware of and use the `\implies` and `\iff` commands to denote right-handed implication and if and only if (so A=>B and A<=>B). I’ve been looking for a similar command for left-handed implication (i.e., A<=B). I was hoping there might be a `\leftimplies` command or similar, but some Googling and inspection of documentation hasn’t found anything. Does anybody have any suggestions where I might find such a command, or a package that provides it? Or am I stuck with using `\Longleftarrow`?


title: What should go into index of the document?

text: So I have written a programming book and now I am adding `\index` for different keywords and terms. I am wondering what should I really put into index? If I mention `keyword` in the document 10 times, should I `\index{keyword}` every one of them or just the first? What makes the index good and what doesn't?


title: Raggedleft paragraph in a table

text: I am trying to typeset a table of two columns, where each column consists of paragraphs and the paragraphs in the right hand column are set raggedleft. Here is a minimal example of the code I thought would work:               \documentclass{article}     \usepackage{array}     \newcommand{\lorem}{Lorem ipsum dolor sit amet, consectetur adipisicing elit.}     \begin{document}       \begin{tabular}{p{50mm}>{\raggedleft}p{50mm}}       \lorem&\lorem\\       \lorem&\lorem       \end{tabular}     \end{document}      However, that produces the error message               ! Extra alignment tab has been changed to \cr.     <recently read> \endtemplate          l.7   \lorem&          \lorem     ?       and the output is not at all what I expected either. Is there a better way?


title: How to change the size of the institutional logo on Lyx- breamer?

text: I tried to use the following codes to insert logo in to my `beamer`, but they dont work with LyX. > If you have a file called "institution-logo-filename.xxx", where xxx is a > graphic format that can be processed by latex or pdflatex, resp., then you > can add a logo by uncommenting the following: >   >   >     %\pgfdeclareimage[height=0.5cm]{institution-logo}{institution-logo- > filename.JPG} >   I end up by using `\titlegraphic{\includegraphics{uni-logo-filename}}` How to change the size of the institutional logo on LyX/`beamer` using above codes?


title: If \section is followed by a \subsection, should there be nothing in between?

text: If `\section` is followed by a `\subsection`, should there be nothing in between? > ## 2.1 The art of the bla > > some text > > ### 2.1.1 The details of bla > > blaaaa > > ### 2.1.2 Further details of bla > > blaaaaaaaaaa Is "some text" allowed there? What's considered "best practice" in TeX ? (I know from _some_ uni theses guides, "some text" would _not_ be considered good practice). Also, does the dot of the previous sentence belong inside or outside the closing bracket?


title: pgfplots: How to remove all axis lines of polaraxis?

text: I need to draw a polar coordinate system **without border lines**. Adding `axis lines=none` (without star) to pgfplot's polaraxis argument list blanks out the coordinate system completely (including grid lines, tick lines, etc). Adding **`axis lines*=none`** (with star) as in the following MWE removes the black axis line at the inner edge and the left edge of the sector. That's already half the job -- **how can I remove the outer edge and the right edge?** (cf. screenshot below)               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{pgfplots.polar}     \pgfplotsset{compat=newest}     \begin{document}         \begin{tikzpicture}              \begin{polaraxis}[%                             xmin=-5,%                             xmax=95,%                             ymin=10,%                             ymax=30,%                             axis lines*=none,%                             ]             \end{polaraxis}         \end{tikzpicture}     \end{document}      ![result of MWE with only the outer and right axis line remaining](http://i.stack.imgur.com/sssxh.png)


title: Color and legend for 3d surface

text: I'm trying to plot a 3d surface using `pgfplots` and this is what I have done so far:               \usepgfplotslibrary{patchplots}     \begin{tikzpicture}     \begin{axis}[%     width=12cm,height=12cm,     xlabel={$J_1$},     ylabel={$J_2$},     zlabel={$J_3$},     legend style={at={(-0.2,0.14)},anchor=north west,draw=black,fill=white,legend cell align=left},     label style={font=\scriptsize}, ticklabel style={font=\scriptsize}     ]          \addplot3[patch,patch type=triangle quadr,opacity = 0.2,         shader=faceted interp]     coordinates {       (349.9671,  349.9671,  195.8676)       (195.8676,  349.9671,  349.9671)       (349.9671,  195.8676,  349.9671)       (226.6197,  330.3199,  226.6197)       (226.6197,  226.6197,  330.3199)       (330.3199,  226.6197,  226.6197)};     % \addlegendentry{Pareto Front};          \end{axis}     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/Wm995.png) I need it in a single color (and it is not), I can't add a legend and I want to change the point of view rotating it. Any advice? Thanks.


title: How to remove the keyword 'figure'?

text: I am writing a slide in Latex, however I wonder if there is a way to remove the word "Figure" when inserting an image in Latex ?               \begin{figure}[!h]     \centering     \includegraphics[width=3cm, height=2cm]{picture.jpg}     \caption{Favorite Picture}     \end{figure}      _Outuput_ :   **Figure:** Favorite Picture      _I want to get this, instead_ :   Favorite Picture      How could I do that ?      **EDIT:**      Here is a sample of the code I used:               \documentclass[10pt]{beamer}     \usepackage{graphicx}     \begin{document}     \section{Introduction}     \subsection{About me}     \begin{frame}{Introduction}     \begin{figure}     \includegraphics[width=6cm, height=1cm]{picture.png}     \caption{  Favorite Picture}     \end{figure}         \end{frame}     \end{document}


title: How to hide todo notes without deleting them manually?

text: I'm using the package `todonotes`. How can I disable the todo notes for printing my final document? (I know it's possible, but I can't find it and I _don't want to_ (manually) delete all my notes in the document...) I've read the documentation, but I still have NO clue on what to type to disable `todonotes`. This is all I have in my preamble:               \usepackage{todonotes}     \newcommand{\td}[1]{\todo[inline]{#1}}      but commenting any of those will keep my note's text on the spot and just remove the formatting. I couldn't figure out what to type to fully remove that unless I go one by one and do it.


title: Ruled lines on the bottom half of each page?

text: I'm trying to typeset a version of a document that will have the document on the half of each page, but I want the bottom half to have thin ruled lines for note taking. Any one have any thoughts about how I could do this automatically? Could I some how make a custom footer for each page?


title: Proper indentation in acronym package

text: I am using the acronym package in the thesis. This is the first time I am using this so don't know much. But I did something like this.               \begin{acronym}       \acro{2G}{2nd Generation}       \acro{3GPP}{3rd Generation Partnership Project}     \end{acronym}      This is ok and gives me the acronym list but I find that the output is not properly indented. so its like               2G 2nd Generation     3GPP 3rd Generation Partnership Project      I want the abbreviations and full forms properly indented so that it looks better. So something like.               2G         2nd Generation     3GPP       3rd Generation Partnership Project      How do I do this? **EDIT: Also, I find that the list is not sorted. How do I get the acronym list sorted by alphabets.**


title: Can \draw .. controls .. be found in pgfplots?

text: I just want to use something like .. controls .. in an addplot command. Unfortunately, the option "smooth" does not produce the image I desire. I haven't found it in the manual so far. The reason I'm not uusing tikz directly, is because i want to use the legend of pgfplots. Any other ideas? If necessary I will post a MWE. Edit: It is not really a MWE but i hope it helps. I couldn't use draw with controls in axis (even though I expressed the coordinates in the axis cs). The red "graph" is only shows how i want the blue line to be bend               \documentclass{minimal}     \usepackage{tikz,pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}      \addplot[blue,thick] coordinates      {(0,0)(0.2,0)(0.8,1)(1,1)};     \end{axis}     \end{tikzpicture}          \begin{tikzpicture}[scale=5]       \draw[red] (0,0) .. controls (0.2,0) and (0.8,1)      .. (1,1);     \end{tikzpicture}     \end{document}


title: customizing footnotes

text: There is a spacing difference (both vertical and horizontal) between using               \makeatletter     \newcommand*{\wackyfn}[1]{\expandafter\@wackyfn\csname c@#1\endcsname}     \newcommand*{\@wackyfn}[1]{\ifcase#1\or*\or$\spadesuit$\else\@ctrerr\fi}     \renewcommand\thefootnote{\wackyfn{footnote}}     \makeatother      and               \renewcommand*{\thefootnote}{\fnsymbol{footnote}}      which seems the proper way to do things: is it possible to have something close to the second command, but which is also able to have footnotes with $\spadesuit$ etc. instead of * and similar, keeping the correct spacing and dimensions? A complete example is               \documentclass[12pt]{article}     \usepackage{amsmath}          \begin{document}          \makeatletter     \newcommand*{\wackyfn}[1]{\expandafter\@wackyfn\csname c@#1\endcsname}     \newcommand*{\@wackyfn}[1]{\ifcase#1\or*\or$\spadesuit$\else\@ctrerr\fi }     \renewcommand\thefootnote{\wackyfn{footnote}}     \makeatother          Wrong\footnote{footnote}, compare to Wrong$^*$          \setcounter{footnote}{0}     \renewcommand*{\thefootnote}{\fnsymbol{footnote}}          Right\footnote{footnote2}          \end{document}


title: Flushright square mark

text: I write the codes below to get a square as if to say q.e.d.               $$equation$$\textbox{\hfill\square}          Text\textbox{\hfill\square}      I want the square at the right extreme of the same line. I succeed only when the rest of the line has text and/or an equation within $ $, but not when it has an equation within $$ $$. In this case the square appears in the extreme right but in the next line but I want it on the same line. Any help is appreciated.


title: Is there a simple way of improving the precision of pgfmath for trig functions?

text: I wanted to build a table of trig values using `pgfmath`. However, the precision is a bit off. Is there a way to improve this within `TikZ`? This is related to a similar question I just posted: Is there a way to pad zeros to the end of a rounded number with Expl3? Here's my current working example:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{calc,fixedpointarithmetic}          \def\mynum{0}     \def\myvoffset{0pt}          \usepackage[margin=0.5in]{geometry}          \begin{document}          Using \texttt{TikZ}          \begin{tikzpicture}[/pgf/number format/.cd,fixed,precision=4,verbatim]            \coordinate(UL) at (0,0);            \node at (UL) {Degrees};       \node[anchor=west] at ($(UL.west)+(1cm,0)$) {$\sin$};       \node[anchor=west] at ($(UL.west)+(2.75cm,0)$) {$\cos$};       \node[anchor=west] at ($(UL.west)+(4.50cm,0)$) {$\tan$};            \foreach \myn in {1,2,3,...,45}       {         \pgfmathparse{int(mod(\myn-1,5))}         \ifnum\pgfmathresult=0\relax           \xdef\myvoffset{\dimexpr\myvoffset+1.350\baselineskip}%%         \else           \xdef\myvoffset{\dimexpr\myvoffset+1.00\baselineskip}%%         \fi              \coordinate (DEG/\myn)   at ($(UL.west)-(0,\myvoffset)$);         \coordinate (DEG/S/\myn) at ($(DEG/\myn)+(1cm,0)$);         \coordinate (DEG/C/\myn) at ($(DEG/S/\myn)+(1.75cm,0)$);         \coordinate (DEG/T/\myn) at ($(DEG/C/\myn)+(1.75cm,0)$);              \node[anchor=east] at (DEG/\myn) {$\myn^\circ$};         \pgfmathparse{sin(\myn)} \node[anchor=west] at (DEG/S/\myn) {\texttt{\pgfmathprintnumber{\pgfmathresult}}};         \pgfmathparse{cos(\myn)} \node[anchor=west] at (DEG/C/\myn) {\texttt{\pgfmathprintnumber{\pgfmathresult}}};         \pgfmathparse{tan(\myn)} \node[anchor=west] at (DEG/T/\myn) {\texttt{\pgfmathprintnumber{\pgfmathresult}}};            }          \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/ArjjG.png)


title: Beamer: error ! ==> Fatal error occurred, no output PDF file produced!

text: Having problems with LaTeX. The PDF file isn't being created and I have looked numerous times online. I think the problems lies in the user packages. Here is the end the log code:               Package pdftex.def Warning: Option `bb' does not make sense,     (pdftex.def)                using `viewport' instead on input line 154.          <use riskcenter2.jpg> [12])     Runaway argument?     \let \AtEndDocument \@firstofone \@enddocumenthook \@checkend {docume\ETC.     ! File ended while scanning use of \beamer@collect@@body.     <inserted text>                      \par      <*> Copulas.tex          ! Emergency stop.     <*> Copulas.tex          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on Copulas.log.      * * * and here is the beginning of the document the user packages;               \documentclass[notes=show, Spanish]{beamer}     \usepackage{graphicx}     \DeclareGraphicsRule{.emf}{bmp}{}{}     \DeclareGraphicsExtensions{.pdf,.png,.jpg, .gif}           \usepackage[Spanish]{babel}     \usepackage{amssymb}     \usepackage{eurosym}     %%%%%%%%%%%%%%%%%%%%%%%%     \usepackage{mathpazo}     \usepackage{hyperref}     \usepackage{multimedia}     \usepackage[latin1]{inputenc}     \usepackage{color}     \definecolor{Red}{rgb}{0.9,0.05,0.05}     %\usepackage{subfig}       * * * If you need me to send the files I can do so.


title: makecell package vertical centering of vertical text

text: I'm using makecell package to write vertical text to my table cells. It works fine, but I have trouble centering it. Normal vertical text (within a {tabular}) is displayed as:                   \rothead{Some lenghthy\\ sentence}       Using                   \rothead[c]{Some lenghthy\\ sentence}       does center it, but adds a @ to the end ?? I'm not good at tex macros, this is the definition:               % \begin{macro}{\rothead}     % The macro for rotated tabular column heads. If no \package{rotating} package     % loaded this macro works like |\thead|.     %    \begin{macrocode}     \newcommand\rothead{\@ifundefined{turn}%       {\PackageWarning{makecell}{\string\rothead\space         needs rotating package}%        \let\tabg@pe\theadgape        \def\t@bset{\cellset\theadfont\theadset}\thead@}%       {\let\theadgape\rotheadgape        \@ifnextchar[{\@rothead}{\@@rothead}}}     %    \end{macrocode}     % For rotated column head default column setting is similar to     % |p{\rotheadsize}| (plus some additional justification settings)     %    \begin{macrocode}     \@ifdefinable\@rothead{}     \def\@rothead[#1]#2{\thead{\\[-.65\normalbaselineskip]       \turn{\cellrotangle}\thead[#1]{#2@{}}\endturn}}     \newcommand\@@rothead[1]{\thead{\\[-.65\normalbaselineskip]       \turn{\cellrotangle}\thead[c{>{\rightskip0explus         \rotheadsize\hyphenpenalty0\pretolerance-1%         \noindent\hskip\z@}p{\rotheadsize}         @{}}]{#1}\endturn}}     %    \end{macrocode}     % \end{macro}      Can anyone explain please? I'd really like to center my vertical column headers :(


title: Symbols used in partitions

text: What is the LaTeX could for the symbols for the set of all odd partition and the set of all distinct partitions? I need to use them for a chapter on Euler's theorem in a report about partition theory. http://www.emis.de/journals/EJC/ojs/index.php/eljc/article/download/v19i3p41/pdf They are both on page 3 of this article on the last line of theorem 1.1 Many thanks


title: Why does adding color to a table row increase the height?

text: I'm trying to make a beamer slide containing a table with the text in a row styled in a different color. However, the row's height increases when colored, as opposed to the default. The same problem occurs if I use the `\rowfont` command. How do I correct this?               \PassOptionsToPackage{table}{xcolor}     \documentclass[compress]{beamer}          \begin{document}     \begin{frame}         Example 1         \rowcolors{1}{gray!30}{blue!30}         \begin{tabular}{|p{0.5\textwidth}|}             \hline             \color{blue}{Foo} \\             Bar\\             Baz\\             \hline         \end{tabular}\\[1in]              Example 2         \rowcolors{1}{gray!30}{blue!30}         \begin{tabular}{|p{0.5\textwidth}|}             \hline             Foo \\             Bar\\             Baz\\             \hline         \end{tabular}     \end{frame}     \end{document}      ![enter image description here](http://i.stack.imgur.com/mzcjF.png) I want the table to look like "Example 2", but with the row text colored as in "Example 1".


title: The label of an enumerate list on its own line using enumitem

text: I would like to use the `enumitem` package to define a custom `enumerate` list such that the label occupies its own line. An example would be:               \documentclass{article}          \usepackage[shortlabels]{enumitem}          \setlength{\parindent}{0pt}     \setlength{\parskip}{1ex}          \begin{document}          \begin{center}     {\Large\sc Assignment 1}\\[2ex]     \end{center}          \begin{enumerate}[label={\large\bf Problem \arabic*.},wide]          \item          \begin{enumerate}[(a)]         \item First question.         \item Second question.     \end{enumerate}          \item          \begin{enumerate}[(a)]         \item First question.         \item Second question.     \end{enumerate}          \end{enumerate}          \end{document}      ![Example](http://i.stack.imgur.com/lTYe9.png) I would like the labels (Problem 1., Problem 2.) to appear on their own line, i.e., to force a line break right after the label. According to this post putting `\mbox{}\\` after `\item` works, but I thought it could be possible to avoid that using features of `enumitem`.


title: Spacing before punctuation in displayed equations

text: What is the correct spacing before punctuation in a displayed equation? I have the habit of writing               Let     \begin{equation}       y = f(x) \,,     \end{equation}     where     \begin{equation}       x = 3 \,.     \end{equation}      with a thinspace (`\,`) before the punctuation. In an answer to another question it was mentioned that this is not correct mathematical typesetting. So what would be the correct spacing?


title: Effect of changing \fontfamily and \familydefault

text: Assume I would like to change the font for a section of text, e.g. use Bookman for both headings and paragraphs (similarly to the explanations in this community wiki guide). If I change the `\familydefault`, as in section (1), only headings are affected. If on the other hand I select Bookman as the `\fontfamily`, it affects only paragraph text but not headings (2). Combining both commands gives the desired result (3), as does adding a `\normalfont` command to `\familydefault`* (4). What causes this behaviour? Does `\fontfamily` set some "currentfont" variable which is not accessed when headings are formatted? And why does changing `\familydefault` immediately affect headings, but not text? *This was pointed out in a comment by @mpg.  ![enter image description here](http://i.stack.imgur.com/xsyhN.png)               \documentclass{article}     \usepackage[T1]{fontenc}          %print a _short section of lipsum text     \newcommand{\shlipsum}{%         \section{A quick brown fox}         Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.\\%     }          %reset font to typewriter CM     \newcommand{\resetfont}{\renewcommand{\familydefault}{cmtt}\normalfont}          \begin{document}          \resetfont     \renewcommand{\familydefault}{pbk}  %sets heading only     \shlipsum          \resetfont     \fontfamily{pbk}\selectfont         %sets paragraph text only     \shlipsum          \resetfont     \renewcommand{\familydefault}{pbk}     \fontfamily{pbk}\selectfont     \shlipsum          \resetfont     \renewcommand{\familydefault}{pbk}     \normalfont     \shlipsum          \end{document}


title: How to refer Appendix in a paper?

text: I put `\label{}` after each section and use `\nameref` with that label name for referring section names in the document. But that doesn't work with `\appendix`. What is the correct way to refer a section in a paper?               \label{appendix}          \section{Background}     \label{sec:background}      How do I refer to background section?


title: Natbib citations do not show the full author name

text: I am using the `ucthesis` class with `natbib` package. None of the `\cite`, `\citet` and `\citep` commands, show the full author name. They just show the very last part of the author's name in the bib file Example               @article{bj1996,         author = {Bjornstad J.F.},         title = "On the generalization of the likelihood function and likelihood principle",         year = "1996",         journal="Journal of the American Statistical Association"         volume = "91",         number = "36",         pages = "791-806"     }          \cite{bj1996}\\     \citep{bj1996}     \citet{bj1996}      prints               J.F. [1996]     [J.F., 1996]     J.F. [1996]      Just the last part of the author's name. Any idea why?


title: Why this 'Perhaps a missing \item' error with the algorithmic package?

text: I am trying to imitate an example I found in the LaTeX wikibook to write my own algorithm using the `algorithmic` package. I can't understand it clearly, though, and I am getting errors all the time.                \documentclass{article}      \usepackage{times}      \usepackage{amsthm}      \usepackage{algorithm}      \usepackage{algorithmic}      \usepackage{alltt}      \usepackage{mathtools}      \usepackage{parskip}      \begin{document}      \begin{algorithm}      \caption{Assigning j to a center}      \begin{algorithmic}        INITIALIZE $C = \emptyset$      \FOR {i=1,...,r}  <------Error      \IF {$N_i \cap N_{i_0} \neq\emptyset$ for some $i_0 \leq i$      \STATE assign to $p_{i_0}$ all demand nodes j with $i \in   \widetilde{p_j}$      \ELSE      \STATE $C = C \cup \{ i \}$ and assign to $p_i$ all the demand nodes $j$ with  $i \in   \widetilde{p_j}$      \ENDIF      \ENDFOR      \end{algorithmic}      \end{algorithm}      \end{document}      I am getting the error: `Something is wrong. Perphaps a missing \item` on the line with the `\FOR` command. Can anybody help?


title: Precisely placing a letter on another with tikz

text: I'm trying to design a logo using tikz although I'm a total beginner. I pretty much would like to show 2 capital letters each with a lowercase letter placed on it's vertical leg. I tried               \documentclass[tikz]{standalone}     \usetikzlibrary{positioning}     \begin{document}     \begin{tikzpicture}       \node [anchor=base, scale=5] (0,0) {EF} ;       \node (s) [fill=white,scale=.8] at (-.9,.9) {e};       \node [right=.95cm of s,fill=white,scale=.8] {f};     \end{tikzpicture}     \end{document}      which produces ![imageEF](http://i.stack.imgur.com/lUxdR.jpg)   1. Is there a way to precisely change the space between the two letters E and F? I'd like to have them almost touching each other. I suspect the best approach would be first to glue the lower case letter on top of it's capital letter and then place each entity to a specific distance of each other. But I don't know how to do that.   2. Besides, how can I make sure to place the lowercase letters in the middle of the thick vertical leg of the capital letters?    3. I would also like the box around the lowercase letters to be as small as possible. Could this box be a circle instead of a rectangle?


title: Breaks in tikzpicture graph

text: I have a graph drawn using tikzpicture and even though I've increased the resolution there are still gaps in the graph itself.               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[domain=-{sqrt(2)}:{sqrt(2)}]         \draw[very thin,color=gray] (-1.2,-1.2) grid (1.2,1.2);         \draw[<->] (-1.7,0) -- (1.7,0) node[right] {$x$};         \draw[<->] (0,-1.3) -- (0,1.3) node[above] {$y$};         \draw[color=red]  plot [samples=100](\x,{abs(\x)*sqrt(2 - \x*\x)});         \draw[color=green]  plot [samples=100] (\x,{-abs(\x)*sqrt(2 - \x*\x)});     \end{tikzpicture}     \end{document}      This produces: ![Example Graph Print Out](http://i.stack.imgur.com/VbxsF.png) You can see just either side of the x-axis on the right, the green part of the graph doesn't meet with the red part. I'm allowing the package to calculate the domain boundaries. If this is the problem, I can't step outside them because of the nature of the domain in the first place. Curiously enough, when I increased the resolution from 100 to 1000, the gap got bigger.


title: Blur the text so it's not readable

text: On a related note to How do I make my document look like it was written by an Cthulhu worshipping madman?, I want to create a LaTeX command that blurs the text so it's unreadable. Unfortunately, whatever I google to get ideas on how to do this, I find forum posts from everyone and his aunt having problems with the fonts being blurry. Nothing about how to get there...


title: What type of packages are available to produce emoticons in LaTeX?

text: I will need to use emoticons for a document that I am producing and I want to know which is the state-of-the-art in the available packages to produce emoticons in LaTeX?


title: Why won't my subsection appear correctly in the contents?

text: I need to show one subsubsection title in the main body of the text and another in the contents page. I have been using:               \subsubsection[contents title]{text title}      This had worked really well. Now one of the titles that I need in the contents has square brackets in and so gives me loads of error messages (I assume because the brackets are getting confused). This is my minimum working example (`\subsubsection[$[\text{PtL}^5\text{(ppy)Cl}]^+$]{Title in text}` is the line causing the problem):               \documentclass[12pt,a4paper,oneside]{memoir}          \begin{document}     \tableofcontents          \chapter{1}     \subsubsection{Title in text}     \subsubsection[$[\text{PtL}^5\text{(ppy)Cl}]^+$]{Title in text}          \end{document}      Thanks for your help, sorry, I'm still relatively new to LaTeX!!


title: Possibility to show notes on included PDF pages

text: I include pages from an pdf in my document:               \includegraphics[page=4, clip, width=\textwidth, keepaspectratio]{graphics/lorem.pdf}      However, if I make notes in the PDF (i.e. used Skim, exported to "PDF with embedded notes") they don't show in the compiled document. Is there a way to fix this?


title: Double Smithchart with pgfplot

text: I'm trying to plot a smithchart, which has negative impedances, too. This is how far i got till now:               \documentclass[]{standalone}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{pgfplots.smithchart}          \makeatletter          \begin{document}              \begin{tikzpicture}         \begin{smithchart}[             yticklabel around circle,             show origin,             xtick={-0.3,-0.2,-0.1,0.1,0.2,0.3,0.4,0.5,1,1.5,2,3,4,5,10,20,-20,-10,-5,-4,-3},         ]             \addplot[mark=none,line width=2]            coordinates{                (1, 0) (1, 0.1) (1,0.2) (1,0.3) (1,0.4) (1,0.5) (1,0.5)            };        \end{smithchart}        \end{tikzpicture}           \end{document}      The result is not very pleasant, the circles of the y-axis just stop, when the x-values start to get negative: ![enter image description here](http://i.stack.imgur.com/LAlgV.png) The goal would be a look similar to this, but I would be happy, if the y-axis would be continued :) ![enter image description here](http://i.stack.imgur.com/cjN1P.png) EDIT: So I made same progess. first, I could move the outer circle labeling the x-axis:               \documentclass[preview]{standalone}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{pgfplots.smithchart}          \makeatletter          \begin{document}              \begin{tikzpicture}         \begin{smithchart}[             yticklabel around circle,             show origin,             xtick={-0.3,-0.2,-0.1,0.1,0.2,0.3,0.4,0.5,1,1.5,2,3,4,5,10,20,-20,-10,-5,-4,-3},             xmin=-0.3, %works quite well             xmax=-3,    %xmax seems to be always infinty?!?!?             ticklabel style={opacity=0.5},         ]             \addplot[mark=none,line width=2]            coordinates{                (1, 0) (1, 0.1) (1,0.2) (1,0.3) (1,0.4) (1,0.5) (1,0.5)            };        \end{smithchart}        \end{tikzpicture}           \end{document}      The result looks like this, which is not quite satisfying, as xmax is ignored (always near infinty) and drwing lines is just possible inside the old, small (positive-x) circle: ![x-axis of smithchart moved](http://i.stack.imgur.com/RWuWN.png) And the next thing, drawing y-circles when x is negative, seems also to be possible in some way.               ...... %just as before         \begin{smithchart}[             yticklabel around circle,             show origin,             xtick={-0.3,-0.2,-0.1,0.1,0.2,0.3,0.4,0.5,1,1.5,2,3,4,5,10,20,-20,-10,-5,-4,-3},             ygrid each nth passes x={-3},             ticklabel style={opacity=0.5},         ]             \addplot[mark=none,line width=2]            coordinates{                (1, 0) (1, 0.1) (1,0.2) (1,0.3) (1,0.4) (1,0.5) (1,0.5)            };        \end{smithchart}         .....      And the result: ![enter image description here](http://i.stack.imgur.com/4IFaR.png) EDIT again: By overlaying two smith charts, it comes again a bit closer to the desired look... But one can't draw lines, where x is negative!               \documentclass[preview]{standalone}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{pgfplots.smithchart}         \makeatletter         \begin{document}              \begin{tikzpicture}         \begin{smithchart}[             show origin,             xtick={-0.3,-0.2,-0.1,0.1,0.2,0.3,0.4,0.5,1,1.5,2,3,4,5,10,20,-20,-10,-5,-4,-3},             ygrid stop at x={0.2:-.3,-0.2:-.3,  0.5:-.3,-0.5:-.3,  1:-.3,-1:-.3,  2:-3,-2:-2.99,  5:-6,-5:-5.99,},             xmin=-0.3, %works quite well             %xmax=-3,   %xmax seems to be alwys infinty?!?!?             ticklabel style={white,opacity=0},         ]        \end{smithchart}             \begin{smithchart}[             show origin,             xtick={-0.3,-0.2,-0.1,0.1,0.2,0.3,0.4,0.5,1,1.5,2,3,4,5,10,20,-20,-10,-5,-4,-3},             ygrid stop at x={0.2:-3,-0.2:-3,0.5:-3,-0.5:-3,1:-3,-1:-3,  2:-3.01,-2:-3.0,  5:-6.01,-5:-6.0,},             xmin=-0.3, %works quite well             %xmax=-3,   %xmax seems to be alwys infinty?!?!?             ticklabel style={opacity=0},         ]             \addplot[mark=none,line width=2]            coordinates{                (1, 0) (1, 0.1) (1,0.2) (1,0.3) (1,0.4) (1,0.5) (1,0.5)            };        \addplot[mark=none,line width=0.5]            coordinates{                (1, 0) (-0.3, 0)  % this one is not drawn outside!!!            };        \end{smithchart}        \end{tikzpicture}           \end{document}      ![enter image description here](http://i.stack.imgur.com/23h8z.png)


title: Vertically aligning a marginnote and a section title

text: In the following code, the marginnote is logically aligned to the lipsum text. I would like to align the marginnote to the title of the section. What's the trick to use ?               % Source : http://tex.stackexchange.com/questions/36432/tiks-draw-in-left-margin-putting-old-calendar-style-date-in-margin          \documentclass[12pt]{article}         \usepackage{lipsum}         \usepackage{marginnote}         \usepackage{tikz}         \usetikzlibrary{calc}         \usetikzlibrary{backgrounds}              \newcommand*{\Date}[4]{%             \begin{tikzpicture}[show background rectangle,inner frame sep=0pt,text width=1cm,align=center]                 \node [fill=orange] at (0,0)                                (dayofweek)  {#1};                 \node [fill=white ] at ($(dayofweek)  +(0,-\baselineskip)$) (dayofmonth) {#2};                 \node [fill=white ] at ($(dayofmonth) +(0,-\baselineskip)$) (month)      {#3};                 \node [fill=orange] at ($(month)      +(0,-\baselineskip)$) (dayofmonth) {#4};             \end{tikzpicture}         }              \reversemarginpar % To put the margin pars on the left               \begin{document}          \section*{One day} \marginnote{\Date{Mon.}{28}{Nov}{2011}}     \noindent\lipsum[1]          \end{document}


title: Printing a double-sided A5 document on A4 paper

text: I have a doubled-sided A5 landscape document with the following page order: ![page order: page 1 front, page 1 back, page 2 front, page 2 back, page 3 front, page 3 back, ...](http://i.stack.imgur.com/F7ard.png) As my printer supports only A4 paper, I want to print two of these pages on one portrait A4 paper so that I can cut it in half to get sheets of the original size. In other words, what I need is the following page layout: ![desired result](http://i.stack.imgur.com/rvGuX.png) (The line separating the two pages is for demonstration purposes only, it is not part of the final result.) **How can I achieve this layout with`pdfpages`?** * * * The "naive" approach               \documentclass[a4paper]{article}     \usepackage{pdfpages}     \begin{document}         \includepdf[pages=-,nup=1x2]{a5-document}     \end{document}      yields ![naive approach](http://i.stack.imgur.com/KnWJH.png) so the front and back side of each page are one the _same_ side of the paper, instead of appearing on opposite faces. * * * At the moment, I'm using the following manual solution, which is quite tedious and error-prone, especially for large documents:               \documentclass[a4paper]{article}     \usepackage{pdfpages}     \begin{document}         \includepdf[pages={1,3,2,4,5,7,6,8,...},nup=1x2]{a5-document}     \end{document}


title: Newtheoremstyle: start counting at 0

text: I defined a `\newtheoremstyle` and I want it to start counting at 0 instead of 1. How do I do that?


title: LaTeX related jobs

text: Well for the things in life, I've learned LaTeX. I'm not a guru, but I think that I can perform some good quality documents. I want to know if is possible to get a part-time job in an editorial, journal or something like that. I'm outside of the U. S., but I think that perhaps is possible to work by Internet.


title: RefTeX broken in Emacs 24.3.1?

text: I'm not sure if this is the right place to ask this question, so if not, please let me know where it would be more appropriate. Since upgrading to Ubuntu 13.10, something seems to have gone wonky with RefTeX. It seems that Emacs was "upgraded" to 24.3.1, and I think this may be the culprit. The problem: when I type `C-c )` to insert a label, instead of just going to my list of references as usual, the frame splits in half and the following appears in the bottom half: > SELECT A REFERENCE FORMAT > > [^M] \ref > > [p] \pageref If I hit `C-m` then it goes to my reference list and I can choose the reference as I normally would. I really don't want to have this extra step there, any idea how to disable that and restore the previous behavior? In case it matters, I'm also using the solution from this answer to make RefTeX work with cleverref.


title: Axis tick options, ticks and labels inside axis area

text: I know the title can be misleading, but I don't know how to put it better. I will correct it when I get better proposals. I try drawing plots from external tables with pgfplots. Alas, the template I have to use is pretty narrow, thus I have to place multiple steps tightly together. This means, I define a style for my plots, such that the axis borders are in line with my document `\linewidth`. Unfortunately, I want to use one style for many plots, thus I do not set tick count manually (and don't want to). In the attached example, the ticks are all fine (I do not really care about them, it's for qualitative purposes only) but the outmost ticks stretch my bounding box outside, overlapping in case of two plots placed next to each other. See the attached image for my problem, problematic parts encircled in red. Blck boxes around are fboxes displaying the image border. ![pgflpots with overlay tick labels](http://i.stack.imgur.com/WQhCf.jpg) Packages used are               \usepackage{pgfplots}     \pgfplotsset{compat=1.10}      My style is defined as follows and applied to the axis environment: (neglecting colour, thickness and other irrelevant parts)               gek1d/.style={             enlargelimits=false,             scale only axis,             xlabel={$x$},             ylabel={$f(x)$},             axis lines=middle,             xtick align=center,             enlarge x limits=false,             x axis line style={-stealth},             width=\linewidth ,              height=0.618\linewidth,                    yticklabel style={overlay},             xticklabel style={overlay},         }      So what I want to do is: command the ticks to be only inside the axis. I do not want to set them manually nor move the labels nor delete the labels entirely. This means, I am fine with +-8 being the most outside ticks in this case, I would also be fine with +-9 being the most outside ticks, but I do not want the +-10 ticks in there. Does anyone have any ideas?


title: Command \cs already defined in memoir class but not in amsart?

text: Consider the following code:               \documentclass{memoir}     \newcommand{\cs}{\Sigma}     \title{Rings and Modules}     \author{}     \begin{document}     \maketitle     \end{document}      This fails to compile and I get the following error.                ! LaTeX Error: Command \cs already defined.                Or name \end... illegal, see p.192 of the manual.           See the LaTeX manual or LaTeX Companion for explanation.      Type  H <return>  for immediate help.      ...                                                         l.2 \newcommand{\cs}{\Sigma}      P.S. The code is perfectly fine with `amsart` class. Also, please tell me what is "the manual" referred to in the error message.


title: How can I mark a point in a pgfplot and make sure its visible (on top of the plot)?

text: Recently, I have TikZ'ed the following image for Wikipedia (see file) ![enter image description here](http://i.stack.imgur.com/rqYQN.png) I would like to mark the green dot like it was done here: ![enter image description here](http://i.stack.imgur.com/HvlyQ.png) I've tried a couple of different things, but no matter what I did the text was always below the plot. How can I mark the green dot with its coordinates? ## MWE ### TeX               \documentclass[varwidth=true, border=5pt]{article}     \usepackage[active,tightpage]{preview}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}     \usepackage{tikz}     \usetikzlibrary{arrows, positioning}      \usepackage{helvet}     \usepackage[eulergreek]{sansmath}          \begin{document}     \begin{preview}     \begin{tikzpicture}         \begin{axis}[             width=13.4cm,             height=10.0cm,             % Grid             grid = major,             % size             xmin= 40,     % start the diagram at this x-coordinate             xmax= 90,   % end   the diagram at this x-coordinate             ymin= 0,     % start the diagram at this y-coordinate             ymax= 60, % end   the diagram at this y-coordinate             % Legende             legend style={                 font=\large\sansmath\sffamily,                 at={(0.5,-0.18)},                 anchor=north,                 legend cell align=left,                 legend columns=-1,                 column sep=0.5cm             },             % Ticks             tick align=inside,             every axis/.append style={font=\large\sansmath\sffamily},             minor tick style={thick},             scaled y ticks = false,             % Axis             axis line style = {very thick,shorten <=-0.5\pgflinewidth},             axis lines = middle,             axis line style = very thick,             xlabel=Gesamtausgaben,             x label style={at={(axis description cs:0.5,-0.05)},                            anchor=north,                            font=\boldmath\sansmath\sffamily\Large},             ylabel=Luxusausgaben,             y label style={at={(axis description cs:-0.05,0.5)},                            anchor=south,                            rotate=90,                            font=\boldmath\sansmath\sffamily\Large}             ]     \addplot[     scatter,     only marks,     point meta=explicit symbolic,     scatter/classes={     a={mark=x,red!90!black},%     b={mark=x,cyan!50!black}},     ]     table[col sep=comma, meta=label] {data.csv};          \addplot[     scatter,     only marks,     point meta=explicit symbolic,     scatter/classes={     b={mark=*,mark size=4pt,red!30!white,draw=black},%     c={mark=*,mark size=4pt,cyan!30!white,draw=black},%     a={mark=*,mark size=4pt,green!70!black,draw=black,pin=135:{\color{black}$(65, 35)$},label={(65, 35)}] {}}},     ]     table[meta=label] {         x   y   label         65  35  a         70  40  b         60  20  c     };     % \addlegendentry{Gruppe 1}     % \addlegendentry{Gruppe 2}     \end{axis}     \end{tikzpicture}     \end{preview}     \end{document}      ### Data The data was generated by the following Python script               #!/usr/bin/env python          import matplotlib.pyplot as plt     import numpy     import csv               def main(n):         cov = [[25, 20], [20, 25]]              meanI = [70, 40]         datapointsI = n              meanII = [60, 20]         datapointsII = n              dataI = numpy.random.multivariate_normal(meanI, cov, datapointsI).T         x, y = dataI         plt.plot(x, y, 'x')              dataII = numpy.random.multivariate_normal(meanII, cov, datapointsII).T         x, y = dataII         plt.plot(x, y, 'x')              plt.axis('equal')         plt.show()              data = []         xs, ys = dataI         for x, y in zip(xs, ys):             data.append([x, y, 'a'])         xs, ys = dataII         for x, y in zip(xs, ys):             data.append([x, y, 'b'])              # Write data to csv files         with open("data.csv", 'wb') as csvfile:             csvfile.write("x,y,label\n")             spamwriter = csv.writer(csvfile, delimiter=',',                                     quotechar='"', quoting=csv.QUOTE_MINIMAL)             for datapoint in data:                 spamwriter.writerow(datapoint)          if __name__ == "__main__":         from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter         parser = ArgumentParser(description=__doc__,                                 formatter_class=ArgumentDefaultsHelpFormatter)         parser.add_argument("-n",                             dest="n", default=2000, type=int,                             help="how many points should get generated")         args = parser.parse_args()         main(args.n)      If you don't want to execute that script, you can also download the data from the repository: https://github.com/MartinThoma/LaTeX- examples/tree/master/tikz/csv-2d-gaussian-multivarate-distributions


title: Biblatex: Don't print 'Vol' when the string in the VOLUME field doesn't begin with a numeral

text: This is a follow-up to Character strings in biblatex's PART and VOLUME fields. The answer provided there covered most of what I asked for, but it left out the specification "begin" in: "When the field `volume` doesn't begin with a numeral, print the field as it is (no word `Vol.`)". The suggested solution was to add the following to the preamble:               \DeclareFieldFormat{volume}{\ifnumerals{#1}{\bibstring{volume}\addspace#1}{#1}}      But this will not print the word `Vol.` in the cases where the the `volume` field begins with a numeral, and then contains non-numeric characters afterwards. I would like it to do that. Below a MWE:               \documentclass{article}     \usepackage{filecontents}     \usepackage[style=authoryear]{biblatex}     \DeclareFieldFormat{volume}{\ifnumerals{#1}{\bibstring{volume}\addspace#1}{#1}}     \begin{filecontents}{\jobname.bib}     @BOOK{hogg1992,         AUTHOR = "Richard M. Hogg",         TITLE = "A grammar of Old English",         YEAR = "1992",         LOCATION = "Oxford",         PUBLISHER = "Blackwell",         VOLUME = "1: Phonology"}     \end{filecontents}     \addbibresource{\jobname.bib}     \begin{document}     \nocite{hogg1992}     \printbibliography     \end{document}      ![enter image description here](http://i.stack.imgur.com/AB0zW.png)


title: How to define the proper space between elements of a matrix?

text: I need to draw a simple matrix, with column corresponding to some sets. I tried the following:               \[D^{4}_{2}=     \left[\begin{array}{cc}             \diagdown & {\begin{array}{cccccc} \{1,2\} & \{1,3\} & \{2,3\} & \{1,4\} & \{2,4\} & \{3,4\} \end{array}} \\            {\begin{array}{c}           \{1,2\} \\          \{1,3\} \\          \{2,3\} \\          \{1,4\} \\          \{2,4\} \\          \{3,4\}           \end{array}} &            {\left(\begin{array}{cccccc}              0 & 0 & 0 & 0 & 0 & 1 \\              0 & 0 & 0 & 0 & 1 & 0 \\              0 & 0 & 0 & 1 & 0 & 0 \\                 0 & 0 & 1 & 0 & 0 & 0 \\              0 & 1 & 0 & 0 & 0 & 0 \\              1 & 0 & 0 & 0 & 0 & 0 \\       \end{array}\right)}     \end{array}\right]      \]      which resulted with: ![matrix with titles](http://i.stack.imgur.com/AlQkF.png) how can I space out the inner matrix elements, so it would fit the rows and columns of the entire table?


title: Double Y-Axis Sometimes Both on Left

text: I've developed a chart for my paper: https://www.writelatex.com/502050hhmmqs As you can see, there are two y-axes, with their labels correctly placed on opposite sides of the chart. However, when I go to use it in my paper, I get the labels overlapping: ![Overlapping y-axes](http://i.stack.imgur.com/sbBW3.png) The only difference I can think of is that the document class is somewhat different, but I don't know how that would affect this, nor how to fix it. Aside: I'd also like to get rid of all spacing between bars within a bar group.


title: Biblatex formatting, seek formatting Bibliography, but not in body

text: I am seeking to format certain components of my bibliography (say author names in a different color), however, the formatting is also applying to citations used in the body of the document. ![Example](http://i.stack.imgur.com/4W0Br.png) In the above example, I want the name in the references to be formatted (small caps, in red), however, I **DONT** want it to apply in the actual citation. Below is the MWE code for the above example. I would be highly appreciative if someone knows how to achieve this.               \documentclass{article}     \usepackage{helvet}     \usepackage{xcolor}     \renewcommand\familydefault\sfdefault     \usepackage[natbib,backend=biber,firstinits=true,citestyle=numeric-comp,backref=true,sorting=none]{biblatex}          \begin{filecontents}{dummy.bib}         @ARTICLE{einstein1905electrodynamics,           author = {Einstein, Albert},           title = {On the Electrodynamics of Moving Bodies},           journal = {Annalen der Physik},           year = {1905},           volume = {17},           pages = {50},           number = {891},           abstract = {N/A},         }     \end{filecontents}          \addbibresource{dummy.bib}          %THE FORMATTING IN BIBLIOGRAPHY     \renewcommand{\finentrypunct}{}     \renewcommand{\mkbibnamefirst}[1]{\textcolor{red}{\textsc{#1}}}     \renewcommand{\mkbibnamelast}[1]{\textcolor{red}{\textsc{#1}}}     \renewcommand{\mkbibnameprefix}[1]{\textcolor{red}{\textsc{#1}}}     \renewcommand{\mkbibnameaffix}[1]{\textcolor{red}{\textsc{#1}}}          %COMMENCE     \begin{document}         Test citation by \citet{einstein1905electrodynamics}         \printbibliography     \end{document}


title: Text over page (including text and floating object)

text: I'd like to add an oblique label: typically it would be a large gray banner that says "Accepted". I want it on each page and over any other "objects" including text, table, figures, anything. Ideally, because I'm travelling, I do not have the TeX source of the PDF, so my idea was to create a `.tex` which includes the manuscript (in PDF) over multiple pages and then add the oblique banner all over it. Is this something doable with LaTeX?


title: How to suppress the initial of citations?

text: I am writing my dissertation and some citations are really wired. For example, some paper citations are shown as **T.Yang & Pan (2013)** and **T.Yang & Pan (2011)** (those are two different papers by the same authors); Also most of the citations with more than two authors are shown as **Tang et al. (1999)** (this paper has four authors) but some of them show the first two authors' name as **Goldfarb, Borror, et al. (2004)** (This paper has four authors). So I need to just show the last name of the authors as **Yang & Pan (2013)** even they might be different papers(required by school format) and only the first author's last name as **Goldfarb et al. (2004)** if there are more than two authors. I have checked some questions here and seems like this one similar question. However, I have download the .bst file from APA website but didn't find the function mentioned in the solution and also not sure how to replace the .bst file. (I use WinEdit)/ Hope someone can give me some help on my question! Thanks! My bibtex file as               @article{GBMA2004,       title={Three-dimensional variance dispersion graphs for mixture-process experiments},       author={Heidi B. Goldfarb and Connie M. Borror and Douglas C. Montgomery and Christine M. Anderson-Cook},       journal={Journal of Quality Technology},       volume={36},       number={1},       pages={109--124},       year={2004},       publisher={American Society for Quality}     }          @ARTICLE{YP2013,     AUTHOR={Tao Yang and Rong Pan},     year={2013},     title={A Novel Approach to Optimal {ALT} Planning with Interval Censoring},     journal={Reliability, IEEE Transaction on,},     volume={to appear on June Issue},       number =       {},       pages =        {},       month =        {},       note =         {},       abstract =     {},       keywords =     {},       source =       {},     }      And my tex file as               \documentclass[oneside,12pt]{memoir}     \usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}     \usepackage{apacite}     \usepackage{amssymb}     \usepackage{indentfirst}     \usepackage{algorithm2e}     \usepackage{natbib}     %\usepackage[cmex10]{amsmath}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{multirow}     \usepackage{amsthm}     \usepackage{setspace}     \newtheorem{thm}{Theorem}[chapter]     \newtheorem{proposition}{Proposition}[chapter]     \newtheorem{lem}[thm]{Lemma}     \newtheorem{definition}{Definition}[chapter]     \usepackage{caption}          \usepackage{mathptmx}     \DoubleSpacing             \usepackage{pwasu}          \usepackage{graphicx}           \usepackage{pwasu}         \usepackage{graphicx}          \def\listofsymbols{\input{memoir/symbols} \clearpage}     \def\addsymbol #1: #2#3{$#1$ \> \parbox{5.45in}{#2 \dotfill \pageref{#3}}\\}     \def\newnot#1{\label{#1}}          \chapter{INTRODUCTION}     \DoubleSpacing     \setlength{\parindent}{0.5in}     \section{Overview}     Reliability is defined as the ability of a system or component to perform its required functions under stated conditions for a specified period of time. An easier definition is: reliability is the quality over time (\citet{GBMA2004}). Nowadays, with the rapid development. And \citet{YP2013} ....     ...     ...     \newpage     \SingleSpace     \setlength{\beforechapskip}{-0.1in}     \renewcommand{\bibname}{REFERENCES}%\addcontentsline{toc}{chapter}{REFERENCES}     \bibliographystyle{apacite}     \bibliography{FinalReferences}     \clearpage     \addtocontents{toc}{%      \protect\vspace{\lineskip}%      \protect\noindent APPENDIX\protect\par      \protect\vspace{-\lineskip}%     }     \renewcommand{\theequation}{A.\arabic{equation}}     \setcounter{equation}{0}          \end{document}


title: Colored "sum" in display math mode

text: The line               \[ \textcolor{green}{\sum}_{k=0}^n \]      makes the `k=0` and `n` parts go to the right of Sigma instead of at the top and bottom, as it should be. Can we retain `k=0` and `n` at the top and bottom?


title: Proper syntax for z-levels inside Forest

text: After reading "Z-level" in TikZ I tried to implement z-layers in my Forest chart, but unsuccessfully:               \documentclass{standalone}     \usepackage{forest}     \usetikzlibrary{backgrounds}          \tikzset{zlevel/.style={%         execute at begin scope={\pgfonlayer{#1}},         execute at end scope={\endpgfonlayer}     }}          \begin{document}          \begin{forest}      for tree={         draw=black, align=center, l sep=4ex, parent anchor=south, child anchor=north,         node options={font=\footnotesize, minimum width=14em, minimum height=10ex, rounded corners=1ex},         edge path={             \noexpand\path[\forestoption{edge}]             (!u.parent anchor) -- +(0,-2ex) -| (.child anchor)\forestoption{edge label};         }     }     [Parent,name=Parent         [SubParent,name=SubParent             [Child1,name=Child1                 [Child11]                 [Child12,name=Child12]             ]             [Child2                 [Child21]                 [Child22,name=Child22,node options={dashed}]                 [Child23,name=Child23]             ]             [Child3                 [Child31,name=Child31]                 [Child32]             ]         ]     ]     %     \tikzset{every node/.style={font=\footnotesize, draw=green, minimum width=14em, minimum height=10ex, rounded corners=1ex}}     %     \begin{scope}[zlevel=1]     \draw[->,dashed] (Child22) to (SubParent);     \draw[->,dashed] (Child31) to[out=north east,in=south east] (SubParent);     \end{scope}     \end{forest}     \end{document}      The goal is to draw the dashed arrows behind the forest nodes they are crossing. What changes would be required to achieve that?


title: change color of nodes in pgfplots bar plot

text: I have a bar plot which print the number next to the bar. The text is however not very well readable due to the color applied to it. Therefore I would like to know how to modify its style.               \documentclass[border=5mm]{standalone}     \usepackage{pgfplots, pgfplotstable}          \begin{document}          \pgfplotstableread[header=false, col sep=comma]{ % Read data table.      % First row doesn't have column names, hence the "header=false"     1, first item     5, second item     }\datatable          \begin{tikzpicture}       \begin{axis}[         ,xbar         ,bar width=2ex, y=3ex         ,nodes near coords          ,nodes near coords align={horizontal}          % my approach:         ,every node near coords/.append style={color=red}         %%                 ,enlarge y limits={abs=0.75}         ,ytick={data} % (\empty,data,{coordinate list})         ,yticklabels from table={\datatable}{1}       ]       \addplot table [         y expr=-\coordindex, % Use negative coordinate index as y coordinate         x index=0 % Use first column as x coordinate       ] {\datatable};       \end{axis}     \end{tikzpicture}          \end{document}


title: coloring every chapter name in the document

text: My question is directly related to post-processing using authoring packages like `etoolbox` for instance. I've included the package as follow :               \usepackage{etoolbox}      what i try to do is to prepend `\color{myColor}` to every `\chapter` commands in the whole document. I'm using :               \preto\chapter{\color{myColor}}      That could actually work, but not only colors my chapter but also all the text after _`\chapter`_ commands (therefore all my document..). Is there some way to wrap the color to only every chapter ? **ps** : I'm using report class


title: Putting solutions next to T/F choices

text: **Setup** I have the following MWE:                 \documentclass[addpoints,12pt]{exam}            \usepackage{color}       \usepackage{amsmath}       \usepackage{amssymb}            \checkboxchar{$\Box$}       \checkedchar{$\blacksquare$}            \bracketedpoints       \shadedsolutions       \renewcommand{\solutiontitle}{\noindent\textbf{Solution:}\par\noindent}                 \begin{document}            \textbf{\textsc{True/False:}  [1pt each]}       \vspace{0.1in}        \begin{questions}             \question Every normal distribution has a bell-shaped graph.             \begin{oneparcheckboxes}        \correctchoice T        \choice F        \end{oneparcheckboxes}             \question If $X$ is a binomial random variable, then $X$ is approx. normal.            \begin{oneparcheckboxes}       \choice T       \correctchoice F       \end{oneparcheckboxes}            \question Why did the chicken cross the road?       \begin{solution}[1.0in]       To get to the other side!       \end{solution}            \end{questions}       \end{document}      Which produces a perfectly fine (short) exam. Now if I add the `answers` option - that is, change the first line to `\documentclass[addpoints,12pt,answers]{exam}` \- then I will get the correct T/F choices bubbled in, and a solution for the short answer question. **Question** What I'd like to also do is add a short one-line solution next to each T/F question, with some reasoning. This solution would:   * have shaded background   * be on the same line as the T and F choices   * only be present when the `answers` option is given Is there an easy way to do this?


title: How can I insert address blocks on the left and right side of the page?

text: I want to insert my local address on the left side of the page and my permanent address on the right side of the page. However, I want both address blocks to be left-aligned. Basically, I want something that looks like this: ![enter image description here](http://i.stack.imgur.com/SroXH.png) I originally rendered this with the `res` package, which simply asks you to input the address with the `\address` command and renders it when you use `\begin{resume}...\end{resume}`. The package is not very flexible with how I can render the rest of the page, which is why I want to manually render this. How do I emulate this behavior? I've tried fiddling around with boxes (particularly the `\makebox` and `\mbox` commands, which apparently don't support newlines) but I haven't had any luck yet.


title: Having a table and a picture on top of the title

text: I am trying to put a logo and also a table before a document title. When I add a title, it adds to number of pages and starts the actual document from the next page. I was wondering if there is a way to fix this problem. Thank you, I apologize if my MWE is too long, I did not remove any of the packages cause I thought it might have something to do with the packages I use. Thank you               \documentclass[12pt, xcolor=pdftex,x11names,table]{article}          \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \usepackage{pgf}     \usepackage{geometry}     \usepackage{amsmath}     \usepackage{mathtools}     \usepackage{amssymb}     \usepackage{natbib}     \usepackage{bm}     \usepackage{booktabs}     \usepackage{microtype}     \usepackage{todonotes}     \usepackage{amsfonts}     \usepackage{footnote}     \usepackage{pdfpages}     \usepackage{setspace}     \usepackage{array}     \usepackage{paralist}     \usepackage{verbatim}     \usepackage{subfig}     \usepackage{csquotes}     \usepackage{multicol}     \renewcommand{\familydefault}{\sfdefault}     \usepackage{pxfonts}     \usepackage{IEEEtrantools}     \usepackage{relsize}     \usepackage{type1cm}     \usepackage[compact,small]{titlesec}     \usepackage[titles,subfigure]{tocloft}     \usepackage[nottoc,notlof,notlot]{tocbibind}     \usepackage{sectsty}     \usepackage{fancyhdr}     \usepackage{url}     \usepackage[pdftex]{hyperref}     \usepackage{bookmark}     \usepackage{comment}     \setcounter{MaxMatrixCols}{10}          \geometry{left=25mm,right=20mm,top=25mm,bottom=25mm}     \geometry{letterpaper}      \setcounter{secnumdepth}{1}     \clubpenalty = 10000     \widowpenalty = 10000     \onehalfspacing      \setlength{\parskip}{0ex}          \pagestyle{fancy}      \lhead{I}     \rhead{}     \lfoot{H}     \cfoot{}     \rfoot{\thepage}     \renewcommand{\headrulewidth}{1pt}     \renewcommand{\footrulewidth}{1pt}     \hypersetup{      pdftitle={F},      pdfauthor={G},     bookmarks=true, bookmarksopen=true, pdftoolbar=true,      pdffitwindow=false,     colorlinks=false,     linkcolor=red,      citecolor=red,     filecolor=magenta,     urlcolor=black }     %\input{tcilatex}     \title{Test}     \date{}     \begin{document}               \hspace*{-0.35in}%     \begin{tabular}{l}     {%     \includegraphics[     natheight=1.042100in,     natwidth=2.989700in,     height=1.0758in,     ]{logo.eps}}%     \end{tabular}     \qquad\qquad\qquad\qquad\quad\quad      \begin{tabular}{r}     \emph{A} \\      \emph{B} \\      \emph{C} \\      \emph{D}%     \end{tabular}     \title{Test Title}     \maketitle     \end{document}


title: any workaround to allow using hyperref package with combine package?

text: I need to use combine package so that each included latex document shows up with its its own toc in the main document, with its own heading. (similar to how papers appear in journal books, each as a separate document within one large document) The problem is that it seems not to work with `hyperref`, and I have to use `hyperref`. I googled around, and can't find any help on this. This seems to be a known issue. Hence the reason to ask, may be someone knows something. Any one knows of a work around? It does not matter if I add `\usepackage{hyperref}` in the main document, or in the included document. Nothing seems to work for me. I also tried using standalone in the main document. But another problem showed up. So not sure what to do now. The included file does build OK on its own ofcourse but not when combined. Here is a MWE: main.tex               \documentclass[report]{combine}     %\usepackage{hyperref}     \title{my book}     \author{me}          \begin{document}     \pagestyle{combine}     \maketitle     \tableofcontents          \section{papers}          \begin{papers}        \import{art1}     \end{papers}          \end{document}      here is art1.tex (in same folder)               \documentclass{article}     \usepackage{hyperref}          \title{my paper 1}     \author{me inside article 1}          \begin{document}     \maketitle     \tableofcontents          \href{someURL}{home}    %problem is here          \end{document}      and now               pdflatex main.tex     This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)      restricted \write18 enabled.     entering extended mode     (./main.tex     LaTeX2e <2011/06/27>     ...................     No file art1.aux.     (./art1.toc)     ! Undefined control sequence.     l.11 \href               {someURL}{home}    %problem is here     ?       Update: I tried the trick shown here. But did not work:               \documentclass[report]{combine}     %\usepackage{hyperref}     \title{my book}     \author{me}          \begin{document}     \pagestyle{combine}     \maketitle     \tableofcontents          \section{papers}          \makeatletter    %see link above. Is this supposed to fix this? it did not for me     \let\@begindocumenthook\relax     \makeatother          \begin{papers}        \import{art1}     \end{papers}          \end{document}


title: How to reduce font size of TOC on lyx beamer

text: I am using a LyX beamer template which can be downloaded from this link. I'm having trouble with a large TOC, which can't fit on one page. How can I reduce the font size of TOC, so that it can be fit on one page?


title: Adjusting Vertical and Horizontal Space between nodes in tikz flow chart

text: I got the following flow chart diagram in tikz. ![enter image description here](http://i.stack.imgur.com/mEmkn.png) * * * ## **MWE**               \documentclass{standalone}     \usepackage[latin1]{inputenc}     \usepackage{tikz}     \usetikzlibrary{calc, shapes, arrows, positioning}          \begin{document}               % Define block styles          \tikzstyle{block} =          [             rectangle           , draw          % , fill=blue!20           , text width=12.5em           , text centered           , node distance=1.5cm           , rounded corners           , minimum height=2em           ]          \tikzstyle{block2} =          [             rectangle           , draw          % , fill=blue!20           , text width=6.5em           , text centered           , node distance=1.5cm           , rounded corners           , minimum height=2em           ]          \tikzstyle{line} =          [             draw          , -latex'          ]                    \begin{tikzpicture}[node distance = 1cm, auto]                 % Place nodes         \node [block] (ZeroSlopes) {Test Slopes are equal to Zero, i.e.,\\ $\textrm{H}_{0}:\beta_{1}=\beta_{1}=\ldots=\beta_{t}=0$};         \node [block, below left = 2.0cm and 0.1cm  of ZeroSlopes] (CommonSlopes) {Test Slopes are equal, i.e.,\\ $\textrm{H}_{0}:\beta_{1}=\beta_{1}=\ldots=\beta_{t}=\beta$};         \node [block, below right = 2.0cm and 0.1cm   of ZeroSlopes] (ZeroSlope) {Fit Common  Slope \& Test Slope is equal to Zero, i.e.,\\ $\textrm{H}_{0}:\beta=0$};                        \node [block2, below left of=CommonSlopes, node distance=4.5cm] (UnequalSlopes) {Fit Unequal Slopes Model};         \node [block2, below right of=CommonSlopes, node distance=4.5cm] (CommonSlope) {Fit a Common Slope Model};         \node [block2, below left of=ZeroSlope, node distance=4.5cm] (ParallelLines) {Fit Parallel Lines Model};         \node [block2, below right of=ZeroSlope, node distance=4.5cm] (ANOVA) {Fit ANOVA Model};                 % Draw edges         \path[line] let \p1=(ZeroSlopes.south), \p2=(CommonSlopes.north) in (ZeroSlopes.south) --  +(0,0.5*\y2-0.5*\y1) -| node [pos=0.3, above] {Reject} (CommonSlopes.north);         \path[line] let \p1=(ZeroSlopes.south), \p2=(ZeroSlope.north) in (ZeroSlopes.south) -- +(0,0.5*\y2-0.5*\y1) -| node [pos=0.3, above] {Retain} (ZeroSlope.north);              \path[line] let \p1=(CommonSlopes.south), \p2=(UnequalSlopes.north) in (CommonSlopes.south) -- +(0,0.5*\y2-0.5*\y1) -| node [pos=0.3, above] {Reject} (UnequalSlopes.north);         \path[line] let \p1=(CommonSlopes.south), \p2=(CommonSlope.north) in (CommonSlopes.south) -- +(0,0.5*\y2-0.5*\y1) -| node [pos=0.3, above] {Retain} (CommonSlope.north);              \path[line] let \p1=(ZeroSlope.south), \p2=(ParallelLines.north) in (ZeroSlope.south) -- +(0,0.5*\y2-0.5*\y1) -| node [pos=0.3, above] {Reject} (ParallelLines.north);         \path[line] let \p1=(ZeroSlope.south), \p2=(ANOVA.north) in (ZeroSlope.south) -- +(0,0.5*\y2-0.5*\y1) -| node [pos=0.3, above] {Retain} (ANOVA.north);               \end{tikzpicture}          \end{document}      * * * **Question** * * * I've problem with adjusting the horizontal and vertical distances between the nodes. You can see that the nodes horizontally are far apart from each other. Is there any better better approach to make flow charts with tikz? Any help to resolve the problem will be highly appreciated. Thanks in advance.


title: adding a node to a qroof in tikz-qtree

text: I need a node in the head element of a qroof in tikz-qtree (using tikz-qtree- compat). I need the 'np' to be a node so I can draw an arrow to it. However, the following breaks:               \documentclass[10pt]{article}     \usepackage{tikz-qtree}     \usepackage{tikz-qtree-compat}     \begin{document}     \begin{tikzpicture}     \Tree [ .TP I [ .T' T[past] [ .\node(vp){vP}; { } [ .v' v\\saw [ .VP { } [ .V' V(saw) \qroof{a man}.\node(nP){nP} ] ] ] ] ] ]     \end{tikzpicture}     \end{document}      The error is: `Undefined control sequence \node(nP)nP`. Any ideas on how to accomplish a node there?


title: Inner theme doesn't work in Russian

text: I'm using a template, almost the same for Russian and English presentation. English one works fine, while in Russian innertheme                \useinnertheme{circles}      breaks rendering:               ! Improper `at' size (0.0pt), replaced by 10pt.     <to be read again>                         relax      l.3 ...mer@sectionintoc {1}{Раздел}{2}{0}{1}      Here's a full MWE:               \documentclass[dvipsnames,professionalfont]{beamer}     \usetheme{default}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{DejaVu Sans}     \setsansfont{DejaVu Sans}     \setmonofont{DejaVu Sans Mono}          % Russian/English document:     \usepackage{xecyr}     \newfontfamily\cyrillicfont{DejaVu Sans}          \setmainlanguage[numerals=cyrillic]{russian} % \setdefaultlanguage{russian} is obsolete and not needed     \setotherlanguage[variant=american]{english}               % beamer:     \useinnertheme{circles}     % \setbeamertemplate{itemize item}{\blacktriangleright}     % \setbeamertemplate{itemize subitem}{\smblksquare}     % \setbeamertemplate{itemize subsubitem}{\smblkcircle}          % toc:     \AtBeginSection[]     {       \begin{frame}         \frametitle{Обзор}         \tableofcontents[currentsection]       \end{frame}     }          \begin{document}                \frame{       \frametitle{Структура доклада}       \tableofcontents[       pausesections,       ]     }          \section{Раздел}          \frame{       \frametitle{Слайд!}       Текст!     }          \end{document}


title: Problem in bibtex when using authordate1 bibliography style

text: I need to use the "authordate1" style in my thesis. When I compile, it always shows a lot of errors from bibtex. My bibtex file is:               @Book{ Card:1983:PHI:578027,         author = "Stuart K. Card and Allen Newell and Thomas P. Moran",         title = "The Psychology of Human-Computer Interaction",         year = "1983",         isbn = "0898592437",         publisher = "L. Erlbaum Associates Inc.",         address = "Hillsdale, NJ, USA"     }      * * * My tex file is               \documentclass[spanish,a4paper,10pt]{book}     \usepackage{babel}     \usepackage[latin1]{inputenc}          %\usepackage[square,sort]{natbib}          \begin{document}     Lista de referencias          \nocite{*}     \bibliographystyle{authordate1}     \bibliography{biblio}     \end{document}      * * * When I compile without \usepackage[square,sort]{natbib}, I always get erros from bibtex (one from each reference), and I have to pulse the "intro" key for each one.               /usr/share/texmf-texlive/tex/latex/base/latin1.def)) (./listareferencias.aux)     (./listareferencias.bbl [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]     [2]     ! Undefined control sequence.     <argument> \protect \citename                                    {Card {\em et~al.\ }\relax , }1983     l.4   }1983]{Card:1983:PHI:578027}      And my bibliography looks:               [Card et al. , 1983] Card, Stuart K., Newell, Allen, & Moran, Thomas P. 1983.     The Psychology of Human-Computer Interaction. Hillsdale, NJ, USA: L. Erl-     baum Associates Inc.      However, f i use natbib, I get no errors, but my bibliography has no brackets:               Card, Stuart K., Newell, Allen, & Moran, Thomas P. 1983. The Psychology     of Human-Computer Interaction. Hillsdale, NJ, USA: L. Erlbaum Associates     Inc.      Thanks in advance, I really appreciate your help.


title: Make a table span multiple pages

text: I have a table that takes up a full page, but I want it to start on a page that already has some text and then continue onto the next page (i.e. it's ok if the table gets broken up and spans two pages). It is a simple two column table:               \begin{table}[h]     \centering     \begin{tabular}{| p{.20\textwidth} | p{.80\textwidth} |}      \hline     foo & bar \\ \hline      foo & bar \\ \hline      ...     \end{tabular}     \end{table}      I guess I need `longtable`? How do I use it?


title: Why does my hierarchy look so ugly?

text: ![enter image description here](http://i.stack.imgur.com/NyvdP.png) Asymmetric and with extra line on the top! Why is it so ugly?               \documentclass[12pt]{article}     \usepackage{tikz-qtree}     \begin{document}          \break     \begin{center}     \textit{Hierarchical Structure of Interest}          \tikzset{edge from parent/.style=     {draw, edge from parent path={(\tikzparentnode.south)     -- +(0,-8pt)     -| (\tikzchildnode)}},     blank/.style={draw=none}}     \begin{tikzpicture}     \matrix     {     \node{\Tree         [.\textit{Level-2} \edge[blank];          [.\textit{Level-1} ]]};     &     \node{\Tree         [[.{Store1}  UPC1 UPC2   ]              [.{Store2}  UPC1 UPC2  UPC3 ]              [.{Store3}  UPC1 UPC2   ]             [.{...}    ] ]};\\     };                \end{tikzpicture}     \end{center}     \end{document}


title: Wrong page number of References in toc (scrreprt)

text: I got a problem with one page number in the toc: the one of the 'References' generated by biblatex. I am always using the command `\addcontentsline{toc}{chapter}{title}` to add stuff to the TOC, and in all other cases it worked fine (list of tables etc.). Problem description: The page number in the toc is always the last page of the References. This means if the References are from page 80 to page 84, then in the TOC page 84 is used (instead of page 80 where the References begin). edit: KOMA script provides `bibliography=totoc` which solves the issue. However, if anyone could explain why `\addcontentsline{toc}{chapter}{title}` works for other lists but not for the library, I would be thankful. I cannot hand out my lib-file (named Lib1 in the code), but you could simply import one of yours which is a few pages long to see the problem. Here is my preamble. As I don't know what the reason is, I have kept most of the definitions and macros generated from helpful users of these forums in. I only removed stuff which I was certain that it is harmless (e.g. table definitions etc.). The appendices have been made by @karlkoeller. But I don't think they are the problem because they start after the bibliography. Thanks for any help!               \documentclass[a4paper, 12pt, headsepline, headings=small, numbers=noendperiod]{scrreprt}     \usepackage{float}     \usepackage[onehalfspacing]{setspace}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{mathptmx}     \usepackage[a4paper,showframe]{geometry}     \geometry{left=2cm,right=5cm,top=2cm,bottom=2cm,foot=1.5cm}      \usepackage{csquotes}     \usepackage{environ}     \usepackage[backend=bibtex8,         style=authoryear-icomp,         dashed=false,         autocite=footnote,         maxcitenames=3,         mincitenames=1,         maxbibnames=100,         firstinits=true,         sorting=nyvt         ]{biblatex}     \bibliography{Lib1}     \usepackage{chngcntr}     \counterwithout{figure}{chapter}     \counterwithout{table}{chapter}      \counterwithout{equation}{chapter}      \counterwithout{footnote}{chapter}       \renewcommand{\floatpagefraction}{0.85}      \renewcommand\bottomfraction{0.65}      \setcounter{topnumber}{1}                     \newcommand\appendicesname{Appendix}     \newcommand\listofloaname{List of Appendices}     \newcommand*{\listofappendices}{\listoftoc{loa}}     \setuptoc{loa}{totoc}          \makeatletter     \g@addto@macro\appendix{%     \counterwithin{table}{chapter}     \renewcommand*{\tableformat}{\tablename~\thetable}     \let\oldaddcontentsline\addcontentsline     \newcommand\hackedaddcontentsline[3]{\oldaddcontentsline{loa}{#2}{#3}}     %     %\newcommand\hackedtableaddcontentsline[3]{\oldaddcontentsline{loa}{#2}{\tableformat}}     %     \newcommand\hackedtableaddcontentsline[3]{\oldaddcontentsline{loa}{#2}{#3}}     %     \let\oldpart\part     \renewcommand*\part[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldpart{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldchapter\chapter     \renewcommand*\chapter[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldchapter{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldsection\section     \renewcommand*\section[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldsection{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldsubsection\subsection     \renewcommand*\subsection[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldsubsection{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldsubsubsection\subsubsection     \renewcommand*\subsubsection[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldsubsubsection{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldtable\table     \renewcommand*\table{%     \let\addcontentsline\hackedtableaddcontentsline%     \oldtable%     }     \let\oldendtable\endtable     \renewcommand*\endtable{%     \oldendtable%     \let\addcontentsline\oldaddcontentsline%     }     }     \makeatother          \newlength\myindention     \setlength\myindention{1em}     \let\oldcaption\caption     \renewcommand*\caption[2][]{%     \oldcaption[#1]{#1\\\hspace*{\myindention}#2}%     }               % Biblatex:               \DeclareNameAlias{sortname}{last-first}     \DeclareNameAlias{default}{last-first}          \DeclareFieldFormat{title}{#1}     \DeclareFieldFormat       [article,inbook,incollection,inproceedings,patent,thesis,unpublished]       {title}{#1}     \DeclareFieldFormat{journaltitle}{#1}     \renewbibmacro*{cite:labelyear+extrayear}{%     \iffieldundef{labelyear}       {}       {\printtext[bibhyperref]{%        \printtext[parens]{%         \printfield{labelyear}%        \printfield{extrayear}}}}}          \renewbibmacro*{date+extrayear}{%       \iffieldundef{\thefield{datelabelsource}year}         {}         {%\printtext[parens]{%            \setunit{\addcomma\space}%            \iffieldsequal{year}{\thefield{datelabelsource}year}              {\printdateextralabel}%              {\printfield{labelyear}%               \printfield{extrayear}}}}%}%          \renewbibmacro*{publisher+location+date}{%     %       \printlist{publisher}%       \setunit*{\addcomma\space}%       %\printlist{publisher}%        %\setunit*{\addperiod\space}%      %       \printlist{location}%       \setunit*{\addcomma\space}       \usebibmacro{date}%       \newunit}          \renewbibmacro*{institution+location+date}{%       \printlist{institution}%       \setunit*{\addcomma\space}%       \printlist{location}%       \setunit*{\addcomma\space}       \usebibmacro{date}%       \newunit}     \renewbibmacro*{organization+location+date}{%       \printlist{organization}%       \setunit*{\addcomma\space}%       \printlist{location}%       \setunit*{\addcomma\space}       \usebibmacro{date}%       \newunit}          \renewbibmacro{in:}{%         \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}          \renewbibmacro*{volume+number+eid}{%       \printfield{volume}%       \setunit*{\addspace}%       \printfield[parens]{number}%       \setunit{\addcomma\space}%       \printfield{eid}}               \begin{document}          \tableofcontents          \listoftables      \addcontentsline{toc}{chapter}{List of tables}               \nocite{*}     \printbibliography[title={References}]     \addcontentsline{toc}{chapter}{References}          \listofappendices     \begin{appendix}     \setlength{\abovecaptionskip}{-8pt}     \chapter{Appendix Chapter}     \end{appendix}          \end{document}


title: Center-justifying first part of multline

text: Consider the following MWE. With my document setup, the equation has to be broken into two lines. Luckily I can get the entire matrix on one line, so I can break the equation after the equals sign. By breaking the equation with `multline`, however, the name of the matrix is left justified. I think it would be better to have the name center justified, as illustrated below. How can I center justify the first part of a `multline`?               \documentclass[11pt,b5paper]{scrreprt}     \usepackage[left=2.8cm,right=2.8cm]{geometry}     \usepackage{amsmath,amsfonts}          \begin{document}          \begin{multline}         \mathbf{R} = \\         \begin{bmatrix}             \mu + n_x^2 \left( 1 - \mu \right)      & n_x n_y \left( 1 - \mu \right) - n_z \nu  & n_x n_z \left( 1 - \mu \right) + n_y \nu  \\             n_y n_x \left( 1 - \mu \right) + n_z \nu    & \mu + n_y^2 \left( 1 - \mu \right)        & n_y n_z \left( 1 - \mu \right) - n_x \nu  \\             n_z n_x \left( 1 - \mu \right) - n_y \nu    & n_z n_y \left( 1 - \mu \right) + n_x \nu  & \mu + n_z^2 \left( 1 - \mu \right)         \end{bmatrix}     \end{multline}          \end{document}      ![illustration](http://i.stack.imgur.com/ASdQF.png)


title: Extra space above boxed multi-line equation

text: Well, this question is not new. It was asked back in 2007 in texhax, and answered at the same time. However, I couldn't apply the patch as mentioned in the answer, so I decided to ask it here. Consider this code:               \documentclass{article}     \usepackage{amsmath,amssymb}          \begin{document}     \fbox{\begin{minipage}{6cm}     \begin{align*}         &H(x) \colon \\         &\qquad \textnormal{Select a random $|x|$-bit prime $q$.} \\         &\qquad \textnormal{Let } r \in_R \mathbb{Z}^*_q \\         &\qquad \textnormal{Output } \langle r, r^{h(x)} \bmod q \rangle     \end{align*}     \end{minipage}}     \end{document}      It generates something like this: ![Output with an extra line](http://i.stack.imgur.com/wTfXS.png) As you can see, there's an extra empty line above H(x). How can I remove it?


title: Check if next char is {

text: Using `\@ifnextchar` one can detect if _e.g._ the next Character is a `[`, _e.g._ :               \@ifnextchar[%     {         %% code to execute if [ scanned.     }{         %% code to execute if [ scanned.     }      However, I can’t seem to use `\@ifnextchar{` to test if the next Character is `{`. Is there any way to use `\@ifnextchar` to detect a `{`? Is there any way at all to detect a `{`? If so, please let me know. * * * **Update 1:** Okay, I think that **\bgroup** is a successful Answer. I think I know now (sort of) why it didn’t work when I first used it. The Purpose I needed it for was to be able to have a Macro that can take an indefinite Number of Arguments. ( _E.g._ listing out Authors.) These seems to run into issues once we want to place the resulting String in an Header. * * * **Update 2:** Regarding my secondary Problem (which was my original Application for all of this), is there a way to **delay** Commands in TeX. In particular, I want to first run a Macro which _waits for an arbitrary Amount of Arguments_ , **then** run a second Command on this. Here is the kind of thing I’m trying to do: `\def\headerauth#1{\rhead{#1\ifnextchar\bgroup{\@headerauth}{.}}}` `\def\@headerauth#1{\& #1\ifnextchar\bgroup{\@headerauth}{.}}}` Without the `\rhead`, Things work fine. But once I use `\rhead`, it will only read the first Argument. The others are ignored. _E.g._ `\headerauth{S. Mishkin}{L. Polotov}` results in _»S. Mishkin.«_ being placed in the Header, and _»L. Polotov«_ placed in the main Text. Whereas if I define `\headerauth` **omitting** the `\rhead`, and then use: `\rhead{\headerauth{S. Mishkin}{L. Polotov}}` I obtain _»S. Mishkin & L. Polotov.«_ in the Header as desired. Why doesn’t the first Thing work? (I realise that this Question probably belongs to a new Topic…) _**P.s._** * _@doncherry_ * & **@Yossi Farjoun** : I’ve figured it out — turns out I was using the wrong Key Combination to access the ` Symbol on my Keyboard. (The same Key produces `'˚´ depending on Key Combinations.) (Took me a short while to figure out how to quote-not-use the Symbol ` (as well as \\) via \\` and \\\ — ah, the Standard coding Tricks. Glad to see it’s very logical.)


title: TeXLive 2011 and updmap

text: Well, I'm trying to install and configure TeXLive 2011 on Windows XP. As usual, a nightmare :-(. After six or seven attempts, it seems I've managed to do it but when trying to update font maps, I'm getting the following error:               Can't locate TeXLive/TLUtils.pm in @INC (@INC contains: /tlpkg       C:/Aplicaciones/TeXLive/tlpkg/tlperl/lib c:/aplicaciones/TeXLive/tlpkg      /tlperl/lib .) at c:/Aplicaciones/TeXLive/texmf/scripts/tetex/updmap.pl     line 18. BEGIN failed--compilation aborted at c:/Aplicaciones/TeXLive/texmf     /scripts/tetex /updmap.pl line 18.     C:\Aplicaciones\TeXLive\bin\win32\runscript.tlu:575: command failed with     exit code 2:     perl.exe c:/Aplicaciones/TeXLive/texmf/scripts/tetex/updmap.pl -nohash     -enable Map=courier82.map      (Here, courier82 is a map of my own.) Update. I've installed both TL2010 and TL2011. With the former updmap runs smoothly, with the latter fails. (Edited to remove unnecessary comments. For the “solution”, see below.)


title: pgfplotstable: read gnuplot generated table and typeset

text: I am new to `pgfplotstable`, I am trying to read gnuplot exported table in `pgfplotstable`. gnuplot script:               set samples 91     set table "file.dat"     set angles degrees     plot [0:90] sin(x),cos(x),tan(x);     unset table      gnuplot table `file.dat` is given below (5 points given to be concise):               # Curve 0 of 3, 91 points     # Curve title: "sin(x)"     # x y type      0  0  i      1  0.0174524  i      2  0.0348995  i      3  0.052336  i      4  0.0697565  i      5  0.0871557  i          # Curve 1 of 3, 91 points     # Curve title: "cos(x)"     # x y type      0  1  i      1  0.999848  i      2  0.999391  i      3  0.99863  i      4  0.997564  i      5  0.996195  i          # Curve 2 of 3, 91 points     # Curve title: "tan(x)"     # x y type      0  0  i      1  0.0174551  i      2  0.0349208  i      3  0.0524078  i      4  0.0699268  i      5  0.0874887  i      Note: It's possible to read table header and format (all data arranged in columns) given below compared to the above case (all data arranged sequentially)               # A B C        1 2 3        4 5 7       8 9 10      **Question** Is it possible to read custom format ASCII file in `pgfplotstable` by `\pgfplotstableset{}` or any other workarounds in gnuplot to make it read well and typeset in `pgfplotstable`?


title: Inserting a portrait page into landscape presentation using beamer

text: I am doing the presentation of my PhD using `beamer`. I have done the diagram flux of my algorithm and I want to show it in my presentation. The problem that I have is that when I wrote down the diagram flux in my `phd_doc.tex` file I didn't have any problem because the orientation of it was portrait. But when I use the same LaTeX code of the diagram flux into `beamer.tex` file I have the problem of the orientation. I would like to know how I can change the orientation (landscape) of a single frame in `beamer` into _portrait_? Because as I know, the orientation default in `beamer` is landscape.


title: placement of QED symbol on numbered equation line

text: This question is both on LaTeX and on mathematics writing style; I hope that's still apropriate here. I have a proof that ends with a (right) numbered equation, and I'm pondering about where to put the QED symbol. The standard right margin position conflicts with the equation number, so what would be considered best style for the QED placement? Secondly, I use the ntheorem package, but cannot place the QED symbol using `\qedhere` on this equation line. Is there a (simple) way to solve this?


title: Draw the discontinuity symbol with tikz

text: Is there an easy way to draw the discontinuity symbol with tikz? It is the symbol shown at the y axis in the following picture (taken from the pgfplots documentation. I can always draw it manually but it is not always easy especially if the line has an angle. I tried to do it with a style, but I couldn't figure it out. Optimally I would like to just specify the start and the end point of a line segment and the sign should be drawn in the center. ![my picture](http://i.stack.imgur.com/wJ3pN.png) ## Update Jake solution is nice, but it doesn't work nicely with filling. Is there a way to draw the symbol while filling continues to work? Leo Liu's answer works with filling but you have to tweak the parameters each time you use it.


title: Luatex Pattern matching %b

text: I have never tried to include Lua code in a document before so please be gentle. I am after a pattern matching expression that will eventually take `(stuff1)->(stuff2)` and replace it with `!(stuff1)||(stuff2)` but baby steps first... At the bottom of this page: Programming In Lua is a mention of a pattern for matching balanced strings. After modifying some code I found on site I decided to try the following:               \documentclass{article}          \def\swap#1{%         \directlua{%           local s, _ = string.gsub("#1","%b()%b()","%2%1")           tex.sprint(s)}     }          \begin{document}          \swap{(a)(b)}          \end{document}      Which does not work at all. Can anyone explain what I've done wrong?


title: Drawing a hyperbola of a certain eccentricity in TikZ

text: This question is a follow-up question to half of a hyperbola. When constructing a hyperbola in TikZ, how can I specify the eccentricity to be `1.44022`?


title: Why (La)TeX can not work with true type fonts?

text: I know that if one wants to use true type fonts, there are solutions via `xelatex` or `lualatex`. My question however is, why it is like so? What is the fundamental difference between latex fonts and ttf that dictates this behavior and how [xe/lua]latex overcome this problem?


title: Creating PDF documents from .texi files

text: I don't really know if the question I'm going to ask is appropriate for this site. I'd like to create PDF documents from .texi files that are bundled in most packages from the GNU project (for example tar, coreutils, bash) as I prefer reading documentation in a PDF reader instead of a terminal. After several failed attempts, I managed to create working PDF documents with the following command: `texi2dvi --pdf <name>.texi` (sometimes the `-e` option is also needed, but the reason is obscure to me). Is this method correct? Is there perhaps a better way to accomplish this? For example, here there's a reference to a shell script called `gendocs.sh`. Should I use it instead?


title: tikz: arrow tips |<->|

text: I want to use a variant of `|<->|` in my draw command, but I want the tips to be the `stealth` arrow head. Unfortunately, `|stealth-stealth|` isn't understood in the draw options command. How can I have stealth arrow heads?               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}       \draw[|stealth-stealth|] (0, 0) -- (1, 0);       \draw[| stealth-stealth |] (0, 0) -- (1, 0);     \end{tikzpicture}     \end{document}


title: Using 3dplot package in Beamer

text: I'm trying to make a 3d plot by adapting the one from the beamer gallery. I'm using LyX 2.0. I keep getting an error that LyX can't compile the file because it can't find               \begin{document}      Obviously, you don't put this in the LaTeX preamble in Lyx. My document compiled fine before downloading the .sty file and inserting the following line into the preamble.               \usepackage{3dplot}      This is my full preamble:               %\usetheme{Warsaw}     \usetheme{CambridgeUS}     % or ...          \usecolortheme{beaver}     \usefonttheme{serif}     \setbeamertemplate{footline}[text line]{} % makes the footer EMPTY     \usepackage{tikz}     \usetikzlibrary{arrows}     \beamertemplatenavigationsymbolsempty     \definecolor{burntorange}{cmyk}{0,0.52,1,0}          \AtBeginSection[]     {         \begin{frame}          \frametitle{Table of Contents}          \tableofcontents[currentsection,currentsubsection]           \end{frame}     }       \usepackage{3dplot} %requires 3dplot.sty to be in same directory, or in your LaTeX              installation      How can I resolve this?


title: Wide table problem when generating PDF

text: I have a LaTeX wide table generated from a data frame in R using `xtable`, but when the PDF is created not all the data is shown, just a part of it, and the other part is hidden on the right of the PDF. How this can be solved?               cat("\\documentclass{article}\n\begin{document}\n", file=txt)      print(xtable(table), include.rownames=TRUE, floating=FALSE, file=txt, append=TRUE)          cat("\\end{document}\n", file=txt, append=TRUE)      where should i place the scalebox thing ??


title: How to get a medium-sized otimes

text: What is a good way to get an O-times between the sizes of `\otimes` and `\bigotimes`? I should add that I want it to act as a math operator as in `\bigotimes` (so that I can use subscripts below it.) I managed to get it by ` \DeclareMathOperator*{\Motimes}{\raisebox{-0.25ex}{\scalebox{1.2}{$\bigotimes$}}} ` using one of the approaches here: A medium dot in math mode I was wondering if there a better way?


title: Text Editor Autocompletion vs direct LaTeX macros

text: In terms of research paper writing and in general usage, is there a preferred convention for one or the other? I'd like to know simply so that I get into the habit of using the norm as opposed to forcing myself to adopt a new procedure in the future. By "text editor autocompletion", I mean the text editor has the feature that writing something like `bb` expands into `\mathbb{}`, where as for LaTeX macros, we define a new command in the preamble and employ it as `\bb{}`. I apologize if this is too soft a question for StackExchange, although I do not know a better location to ask this.