title: How to get a circle over A

text: As given on this website, the command `\AA` is what I am looking for. However it simply produces `rA` instead of putting a circle over the top vertex of A. How do I fix this? I am trying to get someone's name right in the bibliography. The following is a MWE:               \documentclass[paper=A4, fontsize=12, toc=listof, toc=bib]{scrreprt}     \usepackage[inner=2.5cm, outer=2cm, bottom=3cm]{geometry}     \usepackage[super,sort&compress]{natbib}     \usepackage{natmove}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{fancyhdr}     \usepackage{setspace}     \usepackage{lmodern}     \usepackage[hypcap]{caption}     \usepackage[perpage, symbol*]{footmisc}     \usepackage{multirow}     \usepackage[hidelinks, breaklinks]{hyperref}              \makeatletter     \def\NAT@spacechar{}     \makeatother          \pagestyle{fancyplain}     \setcitestyle{comma}          \renewcommand{\chaptermark}[1]%         {\markboth{#1}{}}     \renewcommand{\sectionmark}[1]%         {\markright{\small\thesection\ #1}}     \lhead[\fancyplain{}{\small\thepage}]%         {\fancyplain{}{\small\rightmark}}     \rhead[\fancyplain{}{\small\leftmark}]%         {\fancyplain{}{\small\thepage}}     \cfoot{}          %\renewcommand{\footnoterule}{%     %    \vspace*{-3pt}%     %    \noindent\rule{\columnwidth}{0.4pt}%     %    \vspace*{2.6pt}%     %}          % % Math abbreviations start          \newcommand{\gLL}{\left|\bar{\gamma}\right|}     \newcommand{\gG}{\left|\gamma\right|}          \newcommand{\muB}{\mu_{\text{B}}}          \newcommand{\Ga}{\Gamma}          \newcommand{\B}{\mathbf{B}}          \newcommand{\D}{\overleftrightarrow{\mathbf{D}}}          \renewcommand{\H}{\mathbf{H}}     \newcommand{\Heff}{\H_{\text{eff}}}     \newcommand{\Hext}{\H_{\text{ext}}}     \newcommand{\Hexch}{\H_{\text{exch}}}     \newcommand{\Hdem}{\H_{\text{dem}}}     \newcommand{\Hanis}{\H_{\text{anis}}}     \newcommand{\Hbias}{\H_{\text{bias}}}     \newcommand{\Hsig}{\H_{\text{sig}}}          \newcommand{\I}{\mathbf{I}}          \newcommand{\J}{\mathbf{J}}          \newcommand{\M}{\mathbf{M}}     \newcommand{\Ms}{M_{\text{s}}}     \newcommand{\Mrf}{\tilde{m}({\bf r}, f)}     \newcommand{\Mrfv}{\left|\Mrf\right|}     \newcommand{\Mrfb}{\left(\Mrf\right)}          \newcommand{\X}{{\rm X}}     \newcommand{\Y}{{\rm Y}}     \newcommand{\Mp}{{\rm M}}          \newcommand{\N}{\overleftrightarrow{\mathbf{N}}}          \newcommand{\Py}{Ni$_{80}$Fe$_{20}$}          \newcommand{\fex}{f_{\text{ex}}}          \renewcommand{\k}{\mathbf{k}}     \newcommand{\kB}{k_{\text{B}}}          \newcommand{\lex}{\lambda_{\text{ex}}}          \newcommand{\mB}{\mu_{\text{B}}}          \newcommand{\m}{\mathbf{m}}          \newcommand{\mean}[1]{\left\langle #1 \right\rangle}          \newcommand{\ms}[1][r]{\mean{{#1}^2}}          \newcommand{\pd}[2]{\frac{\partial#1}{\partial#2}}          \renewcommand{\r}{\mathbf{r}}     \newcommand{\ri}{\r_i}     \newcommand{\rj}{\r_j}     \newcommand{\br}{\left( \r \right)}     \newcommand{\bri}{\left( \ri \right)}     \newcommand{\brj}{\left( \rj \right)}     \newcommand{\bridrj}{\left( \ri - \rj \right)}     \newcommand{\brt}[1]{\left( \r, t_{#1} \right)}     \newcommand{\hrt}[1]{\mathbf{h} \left( \M, \r, t_{#1} \right)}          \newcommand{\set}[1]{\left\lbrace #1 \right\rbrace}          \newcommand{\tc}[1]{\textcircled{\scriptsize #1}}     %4-1 = \tc{1}     %4-6 = \tc{2}     %3-3 = \tc{3}     %3-6 = \tc{4}          \newcommand{\se}{\mathbf{s}}     \newcommand{\bse}{\left( \se \right)}          \newcommand{\citesource}[1]{Source: Ref.$\:$\citenum{#1}}          \newcommand{\tens}[1]{\overleftrightarrow{\mathbf{#1}}}          \newcommand{\unit}[1]{\hat{\mathbf{#1}}}          \DeclareMathOperator{\sinc}{sinc}               % % Math abbreviations end          %\renewcommand{\familydefault}{\sfdefault}     \renewcommand{\sectfont}{\normalfont\bfseries}     %\setkomafont{disposition}{\rmfamily}          \def\chapterautorefname{Chap.}     \def\sectionautorefname{Sec.}     \def\subsectionautorefname{sub--Sec.}     \def\figureautorefname{Fig.}     \def\tableautorefname{Tab.}     \def\equationautorefname~#1\null{Eq.~(#1)\null}          \def\AAo{\textrm{A\kern -1.3ex\raisebox{0.6ex}{$^\circ$}}}          \newcommand{\Autoref}[1]{\begingroup\def\chapterautorefname{Chapter}\def\sectionautorefname{Section}\def\subsectionautorefname{Sub--Section}\def\figureautorefname{Figure}\def\tableautorefname{Table}\def\equationautorefname~##1\null{Equation~(##1)\null}\autoref{#1}\endgroup}          \begin{document}     Cited here \cite{Bonetti2009}.          \begin{thebibliography}{349}%     \makeatletter     \providecommand \@ifxundefined [1]{%      \@ifx{#1\undefined}     }%     \providecommand \@ifnum [1]{%      \ifnum #1\expandafter \@firstoftwo      \else \expandafter \@secondoftwo      \fi     }%     \providecommand \@ifx [1]{%      \ifx #1\expandafter \@firstoftwo      \else \expandafter \@secondoftwo      \fi     }%     \providecommand \natexlab [1]{#1}%     \providecommand \enquote  [1]{``#1''}%     \providecommand \bibnamefont  [1]{#1}%     \providecommand \bibfnamefont [1]{#1}%     \providecommand \citenamefont [1]{#1}%     \providecommand \href@noop [0]{\@secondoftwo}%     \providecommand \href [0]{\begingroup \@sanitize@url \@href}%     \providecommand \@href[1]{\@@startlink{#1}\@@href}%     \providecommand \@@href[1]{\endgroup#1\@@endlink}%     \providecommand \@sanitize@url [0]{\catcode `\\12\catcode `\$12\catcode       `\&12\catcode `\#12\catcode `\^12\catcode `\_12\catcode `\%12\relax}%     \providecommand \@@startlink[1]{}%     \providecommand \@@endlink[0]{}%     \providecommand \url  [0]{\begingroup\@sanitize@url \@url }%     \providecommand \@url [1]{\endgroup\@href {#1}{\urlprefix }}%     \providecommand \urlprefix  [0]{URL }%     \providecommand \Eprint [0]{\href }%     \providecommand \doibase [0]{http://dx.doi.org/}%     \providecommand \selectlanguage [0]{\@gobble}%     \providecommand \bibinfo  [0]{\@secondoftwo}%     \providecommand \bibfield  [0]{\@secondoftwo}%     \providecommand \translation [1]{[#1]}%     \providecommand \BibitemOpen [0]{}%     \providecommand \bibitemStop [0]{}%     \providecommand \bibitemNoStop [0]{.\EOS\space}%     \providecommand \EOS [0]{\spacefactor3000\relax}%     \providecommand \BibitemShut  [1]{\csname bibitem#1\endcsname}%     \let\auto@bib@innerbib\@empty          \bibitem [{\citenamefont {Bonetti}\ \emph {et~al.}(2009)\citenamefont       {Bonetti}, \citenamefont {Muduli}, \citenamefont {Mancoff},\ and\       \citenamefont {\AAo~kerman}}]{Bonetti2009}%       \BibitemOpen       \bibfield  {author} {\bibinfo {author} {\bibfnamefont {S.}~\bibnamefont       {Bonetti}}, \bibinfo {author} {\bibfnamefont {P.}~\bibnamefont {Muduli}},       \bibinfo {author} {\bibfnamefont {F.}~\bibnamefont {Mancoff}}, \ and\       \bibinfo {author} {\bibfnamefont {J.}~\bibnamefont {\AAo~kerman}},\ }\href       {\doibase http://dx.doi.org/10.1063/1.3097238} {\bibfield  {journal}       {\bibinfo  {journal} {Appl. Phys. Lett.}\ }\textbf {\bibinfo {volume} {94}},\       \bibinfo {eid} {102507} (\bibinfo {year} {2009})}\BibitemShut {NoStop}%          \end{thebibliography}%          \end{document}      The above example spits out these errors:               Use of \@item doesn't match its definition ...itenamefont {\AAo~kerman}}]{Bonetti2009}     Argument of \@rsbox has an extra } ...itenamefont {\AAo~kerman}}]{Bonetti2009}     Paragraph ended before \@rsbox was complete ...itenamefont {\AAo~kerman}}]{Bonetti2009}     Incomplete \iffalse; all text was ignored after line 1076 ...itenamefont {\AAo~kerman}}]{Bonetti2009}     Forbidden control sequence found while scanning text of \write ...itenamefont {\AAo~kerman}}]{Bonetti2009}      The bibliography part was auto-generated using BibTeX. Changing `\AAo~` to `{\AAo}` fixes the problem. But I would rather have it done automatically. Also getting `\AA{}` to work on its own will be even better.


title: How can I replace parts of an included PDF file?

text: I'm using `pdflatex` and `\epsfig{file=img.pdf}`. I'd like to replace some text in `img.pdf`. It seems that `psfrag` can do this with `latex`, and there is mention of `pstools` doing this with `pdflatex`, but it seems like `pstools` works with EPS not PDF files. Is there a way to replace some text in my PDF file?


title: How to put a line number every line of algorithmic

text: I am looking for a way to have a number for every line in `algorithmic`:               \documentclass{article}     \usepackage{algorithm}      \usepackage{algorithmic}     \begin{document}         \begin{algorithm}             \caption{Some alg}             \begin{algorithmic}                 \REQUIRE a,b, c                 \STATE d = a + b + c                 \STATE d = d/2                 \STATE d = d/3                 \RETURN d             \end{algorithmic}         \end{algorithm}     \end{document}      I would like to have:                Require: a,b,c     1 d = a + b + c     2 d = a + b + c     3 d = d/2     4 d = d/3       return d


title: Simplest way to typeset a double space

text: I have a very simple question. Sometimes I need to put two spaces between letters or words, like this:               a a    %this is a single space     a  a   %this is a double space      I want the double space to be as if was a single space*2. What is the simplest way to achieve this? Currently what I'm doing is               a\ \ a      but I'm under the impression this is not a clean way to achieve my goal


title: simple arithmetic on index of foreach statement in tikz

text: Is foreach really a tikz statement or is derived from some other package? I would like to draw a horizontal axis with 7 ticks spaced 1 cm apart. I'd like to place a label under each tick that is the ordinal number of the tick (1,2,3..) and a label above the tick that is the value of the ordinal number multiplied by the constant 3.14


title: Temporarily changing the spacing between Chinese text and numerals

text: When mixing Chinese text and non-math mode numbers together within a sentence, narrow numbers are given the same amount of space as characters:               \documentclass{article}     \usepackage{ctexcap}     \usepackage{fontspec}     \usepackage{xeCJK}     \setCJKmainfont{Adobe Heiti Std}     \begin{document}         第1号     \end{document}      In most situations, this appearance is probably ideal, however, in my case, I need to temporarily change this spacing, in a small number of instances. How can I force the characters to be printed closer to the "1" one has the same spacing it would have if it were placed among English text (with no spaces on either side)?


title: Disable warning messages in pgfplots

text: When I plot a graph with `pgfplots` sometimes I got such warning message               NOTE: coordinate (500,0) has been dropped because of the y-coordinate filter.      However in may case such points are legal. How can I disable such NOTE messages. Here is a code example:               \begin{figure}       \begin{tikzpicture}       \begin{axis}[xmode=normal,ymode=log]       \addplot table[x=k,y=Time]{fig_xxx.data};       \end{axis}       \end{tikzpicture}     \end{figure}      Thanks.


title: Draw cylinder from pst-solides3d "lying down"

text: I would like to draw a 'horizontal' cylinder connecting the two upper spheres from Herbert's answer here. I have looked at the `pst-solides3d` manual but I cannot find out how to do that. How do I do that?


title: Bar Graph from a matrix

text: [     -1       0       1       2       3       4       5       6]     [  66247    5598 6541358   40899    1674     192      30       3]     [     58    9773     680  850448    5569     304      38       4]     [      0       0      31       1    1415      10       0       0]      I have the following matrix which I want to represent the data in the form of a bar graph/bar chart. The first row (-1 to 6) is the valuation and should be the labels for the x-axis. The following rows have the labels 'rank 1', 'rank 2', 'rank 3' correspondingly. Essentially, I want the graph to be grouped according to the valuation. So the bars I get will be in the order: (-1, 66247), (-1, 58), (-1,0) [small space] (0, 5598), (0, 9773), (0,0) [small space] etc. I saw this example from pgfplots, bar graph, axis distance and wish to follow it closely.               \begin{tikzpicture}     \begin{axis}[     %legend columns=-1,     legend cell align=left,     every axis plot post/.style={/pgf/number format/fixed},      ybar=2pt,     bar width=10pt,     x=10cm,     y=4.5cm,     ymin=0,     axis on top,     %ymax=12,     xtick=data,     %xlabel=Cores,     ylabel=N_E\in[0,20000)$,     enlarge x limits=0.2,     %enlarge y limits={abs=0.5},     symbolic x coords={FCC,Beta pi},     %restrict y to domain*=0:11, % Cut values off at 14     visualization depends on=rawy\as\rawy, % Save the unclipped values     after end axis/.code={ % Draw line indicating break     \draw [ultra thick, white] (rel axis cs:0,1.05) -- (rel axis cs:1,1.05);     },     nodes near coords={\scriptsize{\pgfmathprintnumber{\rawy}}     },     axis lines*=left,     clip=false,     area legend     %legend style={at={(0.6,0.8)},anchor=west}     ]     \addplot[fill=red!40] coordinates {(FCC,0.7) (Beta pi,0.66) };     \addplot[fill=yellow!40] coordinates {(FCC,1) (Beta pi,0.81) };     \addplot[fill=blue!40] coordinates {(FCC,0.6) (Beta pi,0.74)};     \addplot[fill=green!40] coordinates {(FCC,0.5) (Beta pi,0.7)};     \legend{x264,bodytrack,swaptions,blacksholes};     \end{axis}     \end{tikzpicture}      So from that previous example, I want to replace FCC and Beta pi with -1 and 0 as well as create 7 more labels for 0-6. This is what I have so far by replacing the appropriate data and labels.               \begin{tikzpicture}     \begin{axis}[     %legend columns=-1,     legend cell align=left,     every axis plot post/.style={/pgf/number format/fixed},     ybar=2pt,     bar width=10pt,     x=10cm,     y=4.5cm,     ymin=0,     axis on top,     %ymax=12,     xtick=data,     %xlabel=Cores,     ylabel=$N_E\in[0,20000)$,     enlarge x limits=0.2,     %enlarge y limits={abs=0.5},     symbolic x coords={-1,0,1,2,3,4,5,6},     %restrict y to domain*=0:11, % Cut values off at 14     visualization depends on=rawy\as\rawy, % Save the unclipped values     after end axis/.code={ % Draw line indicating break     \draw [ultra thick, white] (rel axis cs:0,1.05) -- (rel axis cs:1,1.05);     },     nodes near coords={\scriptsize{\pgfmathprintnumber{\rawy}}     },     axis lines*=left,     clip=false,     area legend     %legend style={at={(0.6,0.8)},anchor=west}     ]     \addplot[fill=red!40] coordinates {(-1,66247) (0,5598) (1,6541358) (2,40899) (3,1674) (4,192) (5,30) (6,3)};     \addplot[fill=yellow!40] coordinates {(-1,58) (0,9773) (1,680) (2,850448) (3,5569) (4,304) (5,38) (6,4)};     \addplot[fill=blue!40] coordinates {(-1,0) (0,0) (1,31) (2,1) (3,1415) (4,10) (5,0) (6,0)};     \legend{rank 1,rank 2,rank 3};     \end{axis}     \end{tikzpicture}      However, I keep getting the following error: Dimension too large. How may I rectify this? If you have suggestions to better represent this data, please share it too.


title: Can't get rid of indentation (even with \noindent)

text: I'd like to have the indentation in front of `\begin{tabular}{l} \textsc{code}\\\ 11-22-33-44 \end{tabular}%` removed: ![enter image description here](http://i.stack.imgur.com/nsXVm.png) If it's a really easy problem, I must admit I'm not seeing it at the moment. **MWE**               \documentclass[     fontsize=12pt,     a4paper,     DIV=15,     parskip=half     ]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{     lmodern     }          \listfiles          \begin{document}     %\vspace{0.5cm}     \begin{flushleft}     Words\\     More Words     \end{flushleft}%     %\noindent%     %\begin{flushleft}     %\begin{minipage}[t]{\textwidth} %     %\begin{flushleft}     \noindent\begin{tabular}{l}     \textsc{code}\\     11-22-33-44     \end{tabular}%     %\end{flushleft}     %\end{minipage} %     \hfill     %\begin{minipage}[t]{6cm}     %\begin{flushright}%     \begin{tabular}{ll}     \textsc{place,} & \textsc{date}\\     Place, & \today     \end{tabular} %     %\end{flushright}     %\end{minipage}     %\end{flushleft}     \begin{flushleft}     \bfseries Words     \end{flushleft}     \begin{flushleft}     Something,     \end{flushleft}     \end{document}


title: Automated placement of text and graphics within presentations

text: The `beamer` package creates very professional presentations. Are there any additional packages which can be used with beamer which allows users to focus on content, while leaving TeX to decide where to place everything? E.g.:   * Users make a list, TeX displays attempts two-column mode if there are many short items.   * Users type an outline and specify a prefered density per page for the information, TeX decides when to add page breaks.   * Users link graphics to items in the outline, TeX decides where to position the graphics. Are these features within the capabilities of `beamer`?


title: why mathtools does not work for showing only equations which are referred to in the text?

text: I am using `mathtools` in the following way:               \usepackage{mathtools}     \mathtoolsset{showonlyrefs,showmanualtags}      Then, to refer to equations I use `\refeq{equation}`. What happens is that there is a numbering for the equation that appears in the text, but the (Eq-Number) does not appear next to the equation itself. In fact, there are no (Eq-Number) for any of the equations. Any ideas what could cause that? Is there a way to force to have an equation number next to an equation? **Edit** Minimal example:               \documentclass[11pt,letterpaper]{article}     \usepackage{latexsym}     \usepackage{times}     \usepackage{amsfonts,eucal,amsbsy,amsthm,amsopn,amssymb}     \usepackage{color}     \usepackage{graphicx}     \usepackage{array}     \usepackage{url}     \usepackage{mathtools}          \mathtoolsset{showonlyrefs,showmanualtags}                    \begin{document}               \begin{eqnarray}     A & = & B \label{eq:first}     \end{eqnarray}          see Equation ~\refeq{eq:first}          \end{document}


title: How can I write multi line equations with alignment  in inline math mode?

text: Is there any way to override the fact that certain environments in LaTeX are automatically "displayed"? One such example is the `align*` environment. I want to keep my aligned equations inline. So basically I want something like               \begin{align*}     x+y&=z\\     u+v&=w     \end{align*}      embedded into a line of text.


title: How to let minted highlight a whole file from disk

text: I am using the `minted` package to highlight source code in LaTeX. It works well for a piece of code embedded in `\begin{minted} ... \end{minted}`. Now the question is if it is possible to highlight a whole file whose path is specified in `.tex`. Going further, is it possible to let `minted` to choose an appropriated `lexer` to use in according to the suffix of a file?


title: A table font size smaller than tiny?

text: I have looked and there are answers for LaTeX documents, but not a way to implement it in LyX. If I have a table and it just does not fit, is there a way to get a text size smaller than `\tiny` in LyX? I am inserting my table using insert -> float -> table, and it looks great just a LITTLE too small.


title: \vspace vs. \vskip

text: What is the difference between `\vspace{-1em}` and `\vskip -1em`, for example? I guess the first is LaTeX, and the latter is TeX. When is the proper time to use one and not the other, and why?


title: My titleclass breaks subsubsection headings

text: I am using the `titlesec` package in conjunction with the ACM SIG Alternate document class to create a special kind of subsubsection as follows:               \documentclass{sig-alt-full}          % +++++ Begin Experiment Subsection ++++++     \newcommand{\subparagraph}{} % not defined in cls template     \usepackage{titlesec}     \titleclass{\experiment}{straight}[\subsection]     \newcounter{experiment}     \renewcommand{\theexperiment}{(\roman{experiment})}     \titleformat{\experiment}[hang]{\normalfont\normalsize\bfseries}             {Experiment\,(\roman{experiment}):}{.5em}{}[]     \titlespacing{\experiment}{0pt}{*2.5}{.5em}     % +++++ End Experiment Subsection ++++++          \begin{document}     \section{Section}     \subsection{Subsection}     \subsubsection{Subsubsection}     \subsection{Experiments}     \experiment{Not a Subsubsection}     \end{document}      The problem is that elsewhere in my document I want to use plain old subsubsections. However, with the definition of my new `titleclass`, the formatting of the plain old subsubsection heading looks different than before and the numbering is also gone from the heading. How can I get my `\experiment` subsubsections while leaving the regular subsubsections untouched?


title: Problem with beamer and listings package, cannot obtain pdf

text: I want to use `\usepackage{listings}` in a beamer presentation. I obtain "Process exited normally" but it says "Error no file found". The process exits normally but texmaker doesn't find any pdf file. Do you know where is the problem? Here is my code:               \documentclass[11pt]{beamer}     \usetheme{Warsaw}     \usepackage[utf8]{inputenc}     \usepackage[francais]{babel}     \usepackage[T1]{fontenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{listings}     \begin{document}               \begin{frame}     hello world     \end{frame}          \end{document}      when I put an `%` before `\usepackage{listings}` all is good and I obtain my pdf...


title: Problems with colorbox in Enumerate Environment

text: I'm writing solutions to an exam. For one of the multiple-choice problems, I've decided to shade all correct answers using colorbox. By the way, more than one choice for the problem may be correct (not that LaTeX cares). I have two issues: (1) colorbox makes my text run off the page; (2) Even when breaking the line, there is a thin white space (which should be shaded) between the lines. Moreover, the width of the shaded lines are different. How can I make my colorbox break lines automatically? How can I make the entire correct answer (even after a line break) be shaded? Is there a nicer, prettier way to shade answers to multiple-choice questions? Below is an example.               \documentclass[11pt]{article}     \usepackage{amsmath,amssymb,amsfonts}     \usepackage{color}          \definecolor{SolutionColor}{gray}{0.85}          \begin{document}          Choose all correct statements.     \begin{enumerate}     \item \colorbox{SolutionColor}{\bfseries Here is a true sentence.}     \item \colorbox{SolutionColor}{\bfseries If the rank of a $\boldsymbol{2 \times 2}$ matrix $\boldsymbol{A}$ is 1, then one can always find a vector $\boldsymbol{\mathbf{b} \in \mathbb{R}^2}$ so that $\boldsymbol{A \mathbf{x} = \mathbf{b}}$ does not have a solution.}     \end{enumerate}          Choose all correct statements.     \begin{enumerate}     \item \colorbox{SolutionColor}{\bfseries Here is a true sentence.}     \item \colorbox{SolutionColor}{\bfseries If the rank of a $\boldsymbol{2 \times 2}$ matrix $\boldsymbol{A}$ is 1, then one can always find a vector $\boldsymbol{\mathbf{b} \in \mathbb{R}^2}$} \par \colorbox{SolutionColor}{\bfseries so that $\boldsymbol{A \mathbf{x} = \mathbf{b}}$ does not have a solution.}     \end{enumerate}               \end{document}      ![enter image description here](http://i.stack.imgur.com/YHNzn.png)


title: lyx export suitable for journal publication

text: I know there are a few posts about this but i dont think they are sufficient. I wrote a paper in lyx and need to submit the contents of it to a journal (a common need). So the figures (png's, pdf's, eps's, etc) are scattered all over my filesystem. I need a way to translate what i have to what the publisher needs. This means consolidating all the necessary files, and exporting them to a new directory along with the tex source code, and bibtex file. I have tried the lyx export-> archive, but this does not export all of my figures. Also in the exported lyx file, all the images point to the original files, NOT the exported ones. I have tried export->latex(plain) but it sends the output all over my filesystem, where they come from. in summary, I want an `export to publisher` option. since this is a very common application I am sure it exists and i just missing it. thanks


title: Large block diagrams with auto positioning

text: I need to make some (large) maintainable block diagrams. Some small diagrams I already made using Tikz, but I always need to specify the placement of every block. Now for large diagrams this could be pretty hard, especially when you add a block in the middle and a lot of directions need to be changed. Now my question: Is there a package/macro that accepts a bunch of nodes and edges, and arranges them automatically in such a way that edge overlapping is minimal?


title: Caption inside of a minipage

text: I'm looking to include my a figure title (caption) inside of a footnote below the figure rather than above. I commonly use the minipage command, thought including the caption below destroys my alignment. I've included my code below:               \begin{figure}[H]     %{\caption*{Historical Output and Welfare Multipliers\label{figure:historical_mult}}}     %\caption{HISTORICAL OUTPUT AND WELFARE MULTIPLIERS\label{figure:historical_mult}}     \vspace{-5mm}     \begin{center}     \includegraphics[height=4in,width=6in]{multiplier_graph.pdf}     \end{center}     \vspace{-15mm}     \hfill\begin{minipage}[t]{140mm}     \captionof{figure}{Historical output and welfare multipliers.\label{figure:historical_mult}}          {Big long footnote text.}          \end{minipage}     \end{figure}      Any help would be greatly appreciated!


title: Positioning content at the top of a beamer slide (by default)

text: When I create beamer frame, the content is centred in the slide. How do I make the content move to the top of the slide by default?


title: Can we set the contents of each frame be top aligned?

text: Is there any way to make the contents of each frame top aligned? We know that               \begin{frame}[t]{The test}     This is a top aligned frame.     \end{frame}      will work, but how to change it into one such that work for each frame? Can we done this by `\setbeamertemplate`?


title: Vertical centering of text in Beamer Boadilla

text: In the Boadilla theme of Beamer, text in each frame is vertically centered: Example of vertically centered text               \documentclass{beamer}     \usetheme{Boadilla}     \begin{document}     \begin{frame}     \frametitle{A demonstration page}          When there is little text, the vertical centering looks     awkward.          How can I customize the theme so as to flush text against the     top margin?          \end{frame}     \end{document}      When there is little text, this seems aesthetically undesirable. How can I customize the theme to make text flush with the top of the frame? Example of text flush with the top margin


title: Citing - how to get pp. 78.

text: I often want to cite with pp.78, denoting page 78 and following. Is there a way to do that directly in a way of `\autocite[78]{title}`?


title: partially filled, tilted cylinder in TikZ

text: I have a diagram I'd like to reproduce in TikZ: ![enter image description here](http://i.stack.imgur.com/mxK6r.png) Picture a can (cylinder of radius r and height L) that has liquid in it. In each diagram, the can is tilted so that the surface of the liquid just touches where the top meets the sides. In the first diagram, the liquid covers the entire bottom, while in the second, only half. **Edit:** Yes, I could do this myself given the time, but I'd like to see how others would handle the 3D aspect. Is there a better way to draw a projected circle than to draw an ellipse? [There you go @Andrew.] The optimal code would use styles and named coordinates so that one could alter the diagram by changing only a few parameters.


title: Calculations in TikZ for iterative procedure

text: In many `\foreach` iterative procedures in TikZ I would like to relate the generic node called `n\x` -- where `x` is a natural number -- to another node the name of which is obtained by applying basic mathemathical relationships to the number used in the name of the former. Just to be clear, I wolud like to let's say draw a line from `n\x` to `n\x+1` or to `n\x*2` or to `n\x-3`, etc. So if `x=4` I would like to draw lines like:               (n4)--(n5)     (n4)--(n8)     (n4)--(n1)      Is this possible? In the following MWE I would like to draw lines between the nodes using an iterative procedure as previously mentioned.               \documentclass{article}     \usepackage{tikz}     %\usetikzlibrary{calc} <-- Would it be necessary?          \begin{document}          \begin{tikzpicture}       \matrix[column sep=1cm]{       \node (n1) {1}; & \node (n2) {2}; & \node (n3) {3}; & \node (n4) {4};\\       };       %\foreach \x in {1,...,3} <-- Something like this       %\draw (n\x)--(n\x+1);      \end{tikzpicture}          \end{document}      **EDIT:** This might be related, especially the comment at the end by @Mark Wibrow, but I can't get it to work.


title: How can I display an array (as in the data structure from Computer Science, not the mathematical version) in LaTeX?

text: I'm finding this extraordinarily difficult to search for, as the mathematical meaning of "array" is much more common in LaTeX documentation. I essentially want a single row of boxes, into which I can put numbers, strings, etc. Can someone point me in the right direction? **Edit:** ![enter image description here](http://i.stack.imgur.com/6MSmQ.png) The picture above is an example of the sort of thing I am looking for (it doesn't have to be exactly like this).


title: How to keep highlighted the mini frames of already discussed slides?

text: I would like for the dots in the mini frame of my beamer presentation to be full circles and remain highlighted once I already discussed the corresponding slide. Let me make this clearer: when you are showing a slide of your presentation, the corresponding dot in the mini frame on top highlights in order to make the audience follow you up. I would like, once I change slide, for the already coloured dots to remain coloured in black. Like in a loading bar. Is that possible to achieve in a simple way? I have, unfortunatly, no time to create my own theme :) Thanks a lot in advance to anyone who will have the time and patient to answer.               \documentclass{beamer}          % Stile for Beamer     \usetheme{Singapore}     \usecolortheme{rose}     \usepackage[english]{babel}     \useoutertheme[]{miniframes}           \begin{document}          \section{hello}     \subsection{}     \begin{frame}     hello     \end{frame}          \begin{frame}     hello     \end{frame}          \end{document}


title: What is the least invasive way to set the font for listings?

text: As has been asked often enough, to get bold keywords in `lstlisting` environments, one has to use a different typewriter font. Most answers suggest to include this or that package. If just including a package changes the font, then the package must be applying some magic in the background to install itself. And unless the package was specifically made for listings, this means it potentially also changes other stuff. How can I use another font in my listings while being sure that nothing else is affected, or at least that nothing but the default typewriter font is changed?


title: Subbottom giving weird errors when I use captions for my subfigures

text: I have a figure with the following syntax:               \begin{figure}[h!] \centering     \subbottom[$H_n = A_n / e$]{     \begin{tikzpicture}[every node/.style=defnode]     ...     \end{tikzpicture}     }     \subbottom[$S_n = A_n - e$]{     \begin{tikzpicture}[every node/.style=defnode]     ...     \end{tikzpicture}     }     \end{figure}      But when I try to compile I get the two following errors:               undefined control sequence {      and               undefined control sequence \end{figure}      pointing at the last two lines of my figure. These do not make much sense to me. If I try to remove the caption [..] of my subbottoms, I do not get this mistake. I have included `\usepackage{subfig}` in a `memoir` document. This is a minimum working example:               \documentclass[12pt,a4paper,showtrims,final]{memoir}     \usepackage[utf8]{inputenc} % danske tegn          \usepackage{./memfonts}          \usepackage{tikz}     \usepackage{subfig}     \tikzstyle{defnode}=[circle,fill=white,draw=black,inner sep=0pt,minimum size=5pt]          \begin{document}          \begin{figure}[h!]\centering     \subbottom[$F_n$]{     \begin{tikzpicture}[every node/.style=defnode]     \draw (0,0) node(a) {};     \draw (2.2,1) node(b1) {};     \draw (2.5,0.5) node(b2) {};     \draw (2.6,0) node(b3) {};     \draw (2.5,-0.5) node(b4) {};     \draw (2.2,-1) node(b5) {};     \draw (a) to (b1);     \draw (a) to (b2);     \draw (a) to (b3);     \draw (a) to (b4);     \draw (a) to (b5);     \draw (b1) to (b2) to (b3) to (b4) to (b5);     \end{tikzpicture}     } \hspace{1cm}     \subbottom[$G_n$]{     \begin{tikzpicture}[every node/.style=defnode]     \draw (0,0) node(a) {};     \draw (2.2,1) node(b1) {};     \draw (2.5,0.5) node(b2) {};     \draw (2.6,0) node(b3) {};     \draw (2.5,-0.5) node(b4) {};     \draw (2.2,-1) node(b5) {};     \draw (a) [bend left=10] to (b1);     \draw (a) [bend right=10] to (b1);     \draw (a) to (b2);     \draw (a) to (b3);     \draw (a) to (b4);     \draw (a) to (b5);     \draw (b1) to (b2) to (b3) to (b4) to (b5);     \end{tikzpicture}     }     \end{figure}          \end{document}


title: Proper nesting of tikzpicture environments: Reset all PGF values to their defaults

text: Sometimes, nesting `tikzpicture` environments seems inevitable, e.g., if you want a `node` to contain a TikZ picture on its own. (Is it?) However, nesting `tikzpicture` environments is problematic, also because the inner environment inherits all TikZ attributes from the surrounding `tikzpicture` environment. In a comment to a similar question, Martin Scharrer has suggested that > a command [that resets all TikZ/PGF attributes] would be very difficult to > maintain, because all TikZ attributes would need to be set with it > explicitly. Is there a way, with the current implementation, to save/restore _all_ of TikZ/PGF's internal state, in order to apply it to a nested `tikzpicture` environment? If not, what would be really necessary to implement a "clean start with default values" for nested `tikzpicture` environments? Any thoughts?


title: beamer blocks disposal in circle

text: I am happy with my beamer slides and I think blocks are nice to separate ideas... But I've seen some Cisco presentations (most probably powerpoint) with like an image in the middle and then multiple blocks disposed around it (in a circle shape) I think the effect is very nice, and I don't know how to do it in beamer: do you have an idea? The idea is to have this kind of shape:               C1  C2 C3       \ | /     C4-Im-C5       / | \     C6 C7  C8      Im is the image and all Cn are comments (and should be nice inside blocks) Thank you Louis PS: a perfect solution should allow to place some `\pause` in the blocks, so that we have first the image, then first comment and so on...


title: What is TeX used for?

text: I'm a student right now and I'm wondering if it would be beneficial for me to learn LaTeX as of right now and if it would have any use of it to me. I do quite a lot of writing but they don't require a lot of formatting. For my Graphic Design work, I usually use Pages (Mac) for simple briefs for projects, Adobe Illustrator CS5 for combining vector imagery with some commentary on it, or Adobe InDesign CS5 if I really need to arrange a document together. Essays are also done in History classes as well as English, although interestingly History essays are longer than English. (Not that it would affect me in terms of using Tex.) Would it be worth learning TeX? What kind of people doing different subjects/occupations use it, and why?


title: List of Equations in standard list style

text: I'm using this solution to generate a list of equations. Running my minimal example below, there are two points I want to change: [A] Using the standard "list of" style, means: using the same spaces after the caption and indent the entries like the list of figures. [B] Use a seperate variable as the Caption instead of the label               \documentclass[         pdftex,         listof=totoc,     ]{scrreprt}          \usepackage{amsmath}     \usepackage{xstring}     \usepackage{tocloft}     \usepackage{blindtext}     \usepackage[demo]{graphicx}          \makeatletter     \numberwithin{equation}{chapter}          % we use this for our refernces as well     \AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}          % redefinition of \equation for convenience     \let\oldequation = \equation     \let\endoldequation = \endequation     \AtBeginDocument{\let\oldlabel = \label}% \AtBeginDocument because hyperref redefines \label     \newcommand{\mynewlabel}[1]{%       \StrBehind{#1}{eq:}[\Str]% remove "eq:" from labels       \myequations{\Str}\oldlabel{#1}}       \renewenvironment{equation}{%       \oldequation       \let\label\mynewlabel     }{\endoldequation}          \newcommand{\listequationsname}{List of Equations}     \newlistof{myequations}{equ}{\listequationsname}     \newcommand{\myequations}[1]{%           \addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}}     \setlength{\cftmyequationsnumwidth}{3em}          \makeatother          \begin{document}          \begin{figure}[!htb]         \centering             \includegraphics[width=5cm,height=4.5cm]{image1}           \caption{figure 1}         \label{fig:1}     \end{figure}          \begin{figure}[!htb]         \centering             \includegraphics[width=5cm,height=4.5cm]{image1}           \caption{figure 2}         \label{fig:2}     \end{figure}     \begin{figure}[!htb]         \centering             \includegraphics[width=5cm,height=4.5cm]{image1}           \caption{figure 3}         \label{fig:3}     \end{figure}          \blinddocument          \begin{equation}     1 + 1 = 2     \label{eq:first}     \end{equation}          \begin{equation}     2 + 2 = 4     \label{eq:second}     \end{equation}          \begin{figure}[!htb]         \centering             \includegraphics[width=5cm,height=4.5cm]{image1}           \caption{figure 4}         \label{fig:4}     \end{figure}          \begin{figure}[!htb]         \centering             \includegraphics[width=5cm,height=4.5cm]{image1}           \caption{figure 5}         \label{fig:5}     \end{figure}          \listoffigures     \listofmyequations          \end{document}


title: Are ae and aeguill only needed when using CM fonts?

text: I am using the `memoir` class with the option `extrafontsizes` so as I understood this uses the LM fonts and at the same time set the T1 encoding. If this is correct, are the packages `ae` and `aeguill` still needed ? I think they are not.


title: How to use the exact same file for handout and presentation modes in beamer

text: I want to use the **_exact_** same file for my beamer presentation and handout. I do not like the need to comment out lines in order to create the handout or presentation (my current solution), nor do I want to have multiple files with an `\input` command. I realized that I can have a link (I work in linux or bsd) pointing to my main file, say               talk_handout.tex -> talk.tex      then the macro `\jobname` will let me know if I'm compiling the main file or the link. Using `\endswith` from the `xifthen` package I could then figure out if I should do handout or presentation mode. This is all nice in theory, but in practice I have no idea how to do this. I usually have either `[handout]` or `[beamer]` in my `\documentclass` line and I don't know how to combine that with my desired use of `\jobname`. Of course, I could have to files with an `\input` command right after the `\document` class line.....but I was wondering if there's another way. Any ideas?


title: Distance between chapter title and text

text: In my `scrreprt` I've changed distance between paragraphs with `\setlength{\parskip}{9pt}`. But `\parskip` changes also distance between chapter title and the paragraph. How can I change distance between chapter title and the paragraph?


title: How to enable the tree view in TeXShop?

text: Im new with TeXshop and i would like to know if it´s possible to enable the tree view in the right side of the screen. I´m making my thesis and i have several folders and i want to manipulate them all at once with only one screen. If this possible?


title: Using biblatex and memoir together

text: I am getting to know the `memoir` class, as I understood this should be the most suitable one for a big project. On the other hand, I'm used to work with `biblatex` and I want to keep it this way. I found the `\chapterstyle{ell}` nice and I would like to use it. However, at the end of the document I added:               \backmatter     \printbibliography      which typesets the bibliography section _but_ it also typesets an empty "corner" which is derived from the chapter style I'm using: ![enter image description here](http://i.stack.imgur.com/mCkXR.png) For reference, this is how a normal chapter looks like: ![enter image description here](http://i.stack.imgur.com/Twz4e.png) How can I make it look nice? For example, typeset the **Bibliography** in the corner? Or any other suggestions? What would be the best practice here?


title: How to decrease 1cm arrow length in commutative diagram on the base?

text: \documentclass{article}     \usepackage{xypic}          \begin{document}          $\xymatrix{     & Y\ar[ldd]_{\psi_{i}}\ar[rdd]^{\psi_{j}}\ar[d]^{h} & \\     & S \ar[ld]^{\pi_{i}} \ar[rd]_{\pi_{j}} & \\     R_{i} \ar[rr]_{\mu_{ji}} & & R_{j} }$          \end{document}      ![enter image description here](http://i.stack.imgur.com/h9i2h.png)


title: Drawing a line betwen two nodes which are in separate images

text: Is it possible to draw a line between two circles in the below code?               \documentclass[border=1cm]{standalone}     \usepackage{tikz}     \begin{document}           \tikzset{         crcl/.style={draw, thick, shape=circle }     }          \newcommand*{\MyPic}[2]{         \begin{tikzpicture}             \draw #1 rectangle #2;             \node[crcl] at #1 (c) {};         \end{tikzpicture}     }          \begin{tikzpicture}         \node[fill=blue] at (0,0) (a) {\MyPic{(0,0)}{(1,1)}};          \node[fill=green] [xshift=2cm] at (0,0) (b) {\MyPic{(0,0)}{(1,1)}};          \draw[thick] (a) -- (b);     \end{tikzpicture}     \end{document}


title: scrwfile removes partial Toc created with titletoc

text: I am using `titletoc` to create a partial toc at the beginning of each `\part`. Now I introduced the package `scrwfile` to get more `\write` outputs. This however also removes the partial toc. Is there a way to get it back using titletoc? Otherwise I would be interested in an alternative.               \documentclass{scrbook}     \usepackage{scrwfile}     \usepackage{titletoc}             \newcommand{\PartialToc}[1]{%         \startcontents[part]         \section*{\contentsname}         \printcontents[part]{}{0}{\setcounter{tocdepth}{#1}}     }          \begin{document}     \mainmatter     \tableofcontents          \part{Part Heading First}     \PartialToc{1}     \chapter{first}     \chapter{second}     \stopcontents[part]          \part{Part Heading Second}     \PartialToc{1}     \chapter{One}     \chapter{Two}     \stopcontents[part]          \end{document}


title: Using tikzcd in newcommand (for inline arrows)

text: I’m using `tikz-cd` for diagrams, and have a medium-sized diagram that I want to re-use several times. However, when I try using a definition like:               \newcommand{\myarrow}{$\begin{tikzcd} A \ar{r} & B \end{tikzcd}$      I get an error:               ERROR: Package pgfbasematrix Error: Single ampersand used with wrong catcode.      Is it possible to put a `tikz-cd` diagram into a defined command somehow?


title: smallmatrix with vertical line as column separator, how to do it

text: Since this   `\begin{smallmatrix}[cc|cc] ... \end{smallmatrix}`   is not possible with smallmatrix, I am wondering how can I get a vertical line as column separator in the smallmatrix environment? (smallmatrix does not support alignment parameters like `[c|c]`)   I know the vertical line will probably touch the matrix entries, but that's something I can tolerate.


title: Error finding callig15

text: The font calligra is not working on my system (Ubuntu, installed LaTeX by installing Texmaker, which installs the dependencies). When I try to compile this minimal example at the command line,               \documentclass[12pt]{article}     \usepackage[T1]{fontenc}     \usepackage{calligra}     \begin{document}     \calligra     This is a test of a calligraphy font.     \normalfont     \end{document}      I get the following:               kpathsea: Running mktexmf callig15     ! I can't find file `callig15'.     <*> ...ljfour; mag:=1; nonstopmode; input callig15          Please type another input file name     ! Emergency stop.     <*> ...ljfour; mag:=1; nonstopmode; input callig15          Transcript written on mfput.log.     grep: callig15.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input callig15' failed to make callig15.tfm.     kpathsea: Appending font creation commands to missfont.log.     ! Font T1/calligra/m/n/12=callig15 at 17.28003pt not loadable: Metric (TFM) file not found.      I tried creating my own `texmf/tex/latex/calligra` directory with callig15.mf and calligra.mf in it and running `texhash` on it according to the Ubuntu Community Help Wiki, but this did not change anything. According to `dlocate`, calligra is located in the `texlive-latex-extra` package, which I have installed. `dlocate` does not find callig15, however. Could this be the problem?


title: Page numbers and headers

text: By default TeX prints the page number at the bottom of the page. I added a custom header so that the page number appears in the top right hand corner. So I have the page number in two places, at the bottom of the page and in my header. How do I get rid of the page number that is at the bottom of the page?


title: Draw arrows to show multiplication pattern (distributive property)

text: Based on this question: How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)? I got some nice tools for illustrating to my students how to find the product of a number or a variable and a parenthesis. However, the solution fails when I should have two sources in one line, for instance when expanding `(a+3)(b+4)`. I would also be able to place a small number next to or above the arrowhead to indicate the first calculation, the second, etc. The second set of arrows could just as well go below the expression, not above it, to simplify things. I could of course define myself a new set of macros similar to the existing ones, for instance `\sourceTwo` and `\targetTwo`, but it feels like this could be done more elegant. MWE:               \documentclass[]{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}          \newcommand\source[1]{%         \tikz[remember picture,baseline,inner sep=0pt] {%             \node [name=source,anchor=base]{$#1$};         }%         \setcounter{target}{0}     }     \newcounter{target}     \newcommand\target[1]{%         \tikz[remember picture,baseline,inner sep=0pt] {%             \node [name=target-\thetarget,anchor=base]{$#1$};         }%         \stepcounter{target}%     }     \newcommand\drawarrows{         \tikz[remember picture, overlay, bend left=45, -latex] {             \foreach \i [evaluate=\i as \n using int(\i-1)] in {1,...,\thetarget} {                 \draw (source.north) to (target-\n.north);             }         }     }          \begin{document}          \begin{equation}         (\source{a}+4)(\target{b}+\target{3}) = \drawarrows     \end{equation}          \end{document}


title: only expand next macro if its depictable content is placed at a specific place on the page

text: I'm looking for a conditional that checks if the visual processor puts the depictable content of the macro that is going to be expanded at a specific place on the page where the content is placed. The conditional should help me with the following task: I have consecutive paragraphs that are separated by ornaments. Each ornament should only be processed if it's not the first box on the current page and if it's not the last box on the current page. If my limited knowledge is right `TeX`'s text processor has nothing to do with the placement of the calculated boxes on the actual page. So the questioned conditional should instruct the visual processor to put the wanted information into an auxiliary file that could be read on the second pass. Is it possible to request such information from the visual processor to operate with it in the source file? * * * **Addendum:** Although it takes a while until i grasp the effect of the `\leaders` directive i managed it with your help! This is how it looks without using any leaders directive: ![enter image description here](http://i.stack.imgur.com/QBbPk.png)![enter image description here](http://i.stack.imgur.com/TlbAW.png) This is how it looks with `\cleaders`: ![enter image description here](http://i.stack.imgur.com/umn0q.png)![enter image description here](http://i.stack.imgur.com/Ge1sg.png)               \documentclass{article}          \usepackage[pdf]{pstricks}     \usepackage{psvectorian}     \usepackage{lipsum}          \newlength\TextDividerHeight     \setlength\TextDividerHeight{11ex}          \newcommand{\TextDivider}{%         \cleaders             \vbox to \TextDividerHeight{%                 \vfil                 \centering%                 \psvectorian[color=black,scale=0.35]{88}%                 \vfil             }%         \vskip \TextDividerHeight     }          \begin{document}              \section{section}         \lipsum[1]         \TextDivider         \lipsum[1]         \TextDivider         \lipsum[1]         \TextDivider         \lipsum[1]         \TextDivider         \lipsum[1]         \TextDivider         \lipsum[1]         \TextDivider         \lipsum[1]         \TextDivider         \lipsum[1]         \TextDivider              \section{section}          \end{document}


title: Is there a good reason for lstlistings code to look so ugly by default?

text: I thought, the purpose of LaTeX was to make it easy to create _beautiful_ documents. Yet every time I see one of those `lstlistings` I can't help but wince at the mutilated kerning. Take for example this simple snippet taken from the `\tikzmark` documentation: ![What's happening here?](http://i.stack.imgur.com/fqAIB.png) It's not monospace and not proportional but something... else. I added vertical lines between the top characters to showcase the wacky alignment. This is also the reason I normally don't use that package at all and resort to `tabular`s with `\ttfamily` or `verbatim` environments. So, why does it do this? Why make ugly the default and make people search for a way to make it look good (which nobody seems to be bothered with, judging from the amount of papers and lecture notes containing ugly listings), instead of making it look by default? Is there a good, technical or typographic reason to do it this way instead of using a proper monospace font (that should always be present) or at least properly using the proportional font? Are there other packages that do a better job at listing actual program code (not algorithms in pseudocode) by default? There have been other questions about making `lstlisting`s look better, like How can I make lstlisting look exactly like verbatim? or lstlisting, tt fonts, and alignment., so that is not really the topic here.               \documentclass{article}     \usepackage{listings}     \begin{document}     \begin{lstlisting}     \usepackage{tikz}     \usetikzlibrary{tikzmark}     \end{lstlisting}     \end{document}


title: Spacing problem with microtype and Hoefler Text under xelatex

text: I'm seeing an odd spacing problem with microtype and Hoefler Text under XeLaTeX. A minimal example is provided below. When typeset with xelatex, the word "he" and the emphasized word "ought" overlap as shown here: ![image depicting spacing problem](http://i.imgur.com/vLys2tA.png) The problem disappears if I use a different font (e.g., Palatino), or drop the microtype package, or even drop the first sentence. Any insights as to what's causing this problem greatly appreciated.               \documentclass{article}          \usepackage{microtype}     \usepackage{fontspec}     \setmainfont{Hoefler Text}          \begin{document}          For some cause, which I could not at the moment divine,     Arthur was unusually grave and silent during our walk home.     It could not be connected with Eric Lindon, I thought, as he     had for some days been away in London: so that, having Lady     Muriel almost ‘all to himself’—for \emph{I} was only too     glad to hear those two conversing, to have any wish to     intrude any remarks of my own—he \emph{ought},     theoretically, to have been specially radiant and contented     with life.          \end{document}      Update for reference: I'm using current versions of TeX Live 2013, microtype (2.5a) and XeLaTeX (0.9999.3) as described in the questions below.


title: Globally set a word in Small Caps (or italics)

text: I am using Lyx with Preamble. I am working on a project where the abbreviation "hon." needs to be set to small caps globally. (/sc). Tried to use `\renewcommand`, no luck there. ![example](http://i.stack.imgur.com/g8kiY.png)


title: The meaning of $\rightsquigarrow$?

text: Perhaps this is not the good place to ask this question. In order to write a scientific paper, I would like to use the symbol $\rightsquigarrow$ (works also with $\leadsto$ which has a clearer meaning, but not so much for me...) I'm wondering about the usual meaning and use of this symbol.


title: TikZ: computation in node name

text: I want to place a variable number of nodes on a page, but I also want to be able to give these nodes a (integer) name. However, I run into the problem that only certain kind of commands can appear in the label of a node (see this question). My naive attempt to achieve what I want is...               \documentclass{article}     \usepackage{tikz}     \def\n{3}     \begin{document}     \begin{tikzpicture}      \node[draw, circle] (\n + 1) {4};      \node[draw, circle] (\n + 2) [right of=4] {5};     \end{tikzpicture}     \end{document}      ...but this gives the error message...               ! Package pgf Error: No shape named 4 is known.      ...since the name of the node is actually "3 + 1" (or something close to it). I found this hack...               \documentclass{article}     \usepackage{tikz}     \def\n{3}     \begin{document}     \begin{tikzpicture}      \pgfmathtruncatemacro{\nPlusOne}{\n + 1}      \node[draw, circle] (\nPlusOne) {4};      \node[draw, circle] (\n + 2) [right of=4] {5};     \end{tikzpicture}     \end{document}      ...which has the right behavior. However, when calling nested functions that also use this hack, they redefine `\nPlusOne` using their given value of `\n`. ## Question What is a better way to assigned a computed integer to the label of a node?


title: Line breaks in custom command that uses tabular environment

text: I am using a resume template I found here - http://www.davidgrant.ca/latex_resume_template There is a custom command, based around the tabular environment, which is in the MWE below. I would like to be able to start a new line in the first argument, but I am unsure how to do this (currently \newline does nothing, whilst \ or \* just breaks the compilation) MWE:                \documentclass[letterpaper,11pt]{article}           \newcommand{\ressubheading}[4]{      \begin{tabular*}{6.5in}{l@{\extracolsep{\fill}}r}              \textbf{#1} & #2 \\              \textit{#3} & \textit{#4} \\      \end{tabular*}\vspace{-6pt}}           \begin{document}           \ressubheading{A very long piece of text that I wish to break\newline over two lines goes here}{Some other reasonably long piece of text}{Less tex    t}{Less text}           \end{document}


title: Is there a painless way to get self-loop decorations on mathematical symbols?

text: In mathematics, we often write               X \rightarrow Y      to mean a function from X to Y. Now I'd like to denote a function from X to X via a looping-arrow decoration on the top right-hand corner of X. Is there a painless way to do this?


title: Problem with biber command on TeXStudio on a Mac

text: I have a working TeXStudio set-up under Windows 7, and I'm trying to create a similar set-up on a Mac. In the Mac TeXStudio preferences, I configured the following commands: > /usr/texbin/pdflatex -synctex=1 -interaction=nonstopmode -output- > directory=./pdf/ %.tex > > /usr/texbin/biber ./pdf/% As can be seen above, I use an auxiliary `./pdf` directory for the intermediate files. Now, pdfLaTeX works without a problem, and biber also runs and it can find the `.bcf` file. But then `biber` dies with a "Cannot find" the `.bib` file error. I checked the system paths and the directory permissions; the `.bib` file is in the local tree. The curious thing is: if I run biber from the command line in the `.tex` file directory, it can find the bib file and runs without a problem. Can anyone enlighten me here?


title: Dame latex macros

text: I am in the initial stages of writing my thesis (Maths). I once wrote a joint paper with someone and because they had an existing template we used it, with all the latex macros it had. Basically there were so many macros that I would have to repeatedly go, look and find the macro for the symbols. When I programme (c, python) I just give the variables full names, instead of calling a variable r, or rem, I just use the full word remainder for example. I just need someone to tell me that they wrote their thesis without any macros so that I can get on with the job. I have been deciding for the past 5 hours what macros to have and what to call them. But I do not want to use them. What are some good choices one can make with writing latex code? With programming there are ones like, write comments to clarify, write code that matches the symbols and names in the equations as much as possible.


title: Closing phrase (from \closing) & signature (variable) in the same line (scrlttr2)

text: The `\closing` command in `scrlttr2.cls` is               \newcommand*{\closing}[1]{{%         \setparsizes{\z@}{\z@}{\z@ plus 1fil}\par@updaterelative\nobreak\par%         \nobreak\vskip\baselineskip%         \stopbreaks\noindent%         \setlength{\@tempdima}{0pt}%         \expandafter\@tempdimaismaxwidthof\scr@signature@var\\\@nil         \expandafter\@tempdimaismaxwidthof\strut\ignorespaces#1\\\@nil         \setlength{\@tempdimb}{\hsize}%         \addtolength{\@tempdimb}{-\useplength{sigindent}}%         \ifdim\@tempdima>\@tempdimb\setlength{\@tempdima}{\@tempdimb}\fi%         \hspace{\useplength{sigindent}}%         \parbox{\@tempdima}{\raggedsignature\strut\ignorespaces%           #1\strut\\[\useplength{sigbeforevskip}]           \strut\usekomavar{signature}\strut}}\par       \nobreak\vskip\baselineskip%     }      How can one lift the `signature` variable right next after the closing-phrase (in the same line), and add the `\encl{}`, `\cc{}` commands (from `scrlttr2`) right after? The code above is somewhat complicated (for there are instructions unknown to me). Likewise, trying to follow an example for the `lettr.cls`, so as to renew the `\closing` command in How to type specifically on this part of the page?, isn't easy.


title: How to do \flushleft and \flushright with tikzpictures

text: I have two charts, one is drawn with `pgfplots`, the other with `pgf-pie`. I want put these two chart in align horizontally, so one is on the left and the other is on the right. I have read Aligning using flushleft and flushright, but it seems this `minipage` trick does not work in my case. This is an example. I expected the two charts stand side-by-side, but they are not. About the _width_ of the `minipage`, I tried many values. Maybe I don't understand it correctly.               \begin{minipage}{0.5 \linewidth}     \begin{flushleft}     \begin{tikzpicture}       \begin{axis}[         title=\# of players in a class,         ybar,         %enlargelimits=0.15,         legend style={at={(0.5,-0.2)},           anchor=north,legend columns=-1},         ylabel={Population},         symbolic x coords={Warrior,Wizard,Archer},         xtick=data,         nodes near coords,         nodes near coords align={vertical},         x tick label style={rotate=45,anchor=east},       ]         \addplot coordinates {(Warrior,100) (Wizard,100) (Archer,200)};       \end{axis}     \end{tikzpicture}     \end{flushleft}     \end{minipage}          \begin{minipage}{0.5 \linewidth}     \begin{flushright}     Ratio of players in a class     \begin{tikzpicture}       \pie{ 25/ \textsc{Warrior} , 25/ \textsc{Wizard} , 50/ \textsc{Archer} }     \end{tikzpicture}     \end{flushright}     \end{minipage}


title: Young diagram as float in tufte-book

text: I am trying to place Young diagrams (using youngtab) in the margin, as in the tufte-book document class. I have tried the obvious               \begin{figure}     \centering      $\young(\hfil\hfil\hfil\hfil\hfil,\hfil\hfil\hfil\hfil,\hfil\hfil,\hfil\hfil)$       \caption{Diagram of shape $(5,4,2,2)$}\label{fig:diagramExample}     \end{figure}      But this does not work; the diagram is centred in the middle, and not at the side. I also get the error message "figure with no caption on input line xx". If I use say amsart document class, then everything works as expected. So, what is the solution to this problem? I would appreciate a solution which makes it easy to switch back to amsart if I would like to. EDIT: So this is part of my preable:               \documentclass[symmetric,sfsidenotes,numbers]{tufte-book}     \usepackage{amsmath,amssymb,amsthm,latexsym,enumerate,youngtab}     \usepackage{epigraph,graphicx}      The result I get is as below, but I want the diagram to appear on the left hand side, like a normal pictures ![A picture describing my output](http://i.stack.imgur.com/ltJPp.png) Minimal example               \RequirePackage[l2tabu, orthodox]{nag}     \documentclass[sfsidenotes,numbers]{tufte-book}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{microtype}     \usepackage{amsmath,amssymb,amsthm,latexsym,enumerate,youngtab}     \usepackage{epigraph,graphicx}          \title{Minimal}     \author{John Doe}          \begin{document}     \maketitle     \begin{figure}        \centering         $ e^x $       \caption{Caption here}\label{fig:skewDiagramExample}     \end{figure}     \end{document}


title: Revtex warning with bibtex

text: I get a warning every time I run bibtex on files using revtex4-1. The warning is               Warning--jnrlst (dependency: not reversed) set 1      This even happens with files revtex supplies as examples, but I've cut it down to a (nearly) minimal working example: `SimpleTex.tex` is               \documentclass[aps,prd,10pt]{revtex4-1}     \begin{document}     Refer to Ref.~\cite{ArticleKey}.     %\bibliographystyle{apsrev4-1}     \bibliography{SimpleBib}     \end{document}      and `SimpleBib.bib` is               @Article{ArticleKey,       title =    {Cited work},       journal =  "Awesomeness",       author =   {Annie Author},       year =     1999     }      Then, `latex SimpleTex` followed by `bibtex SimpleTex` gives me the warning. Interestingly, it appears to be using `apsrev4-1.bst`. But by explicitly giving the bibliographystyle (uncommenting the line in `SimpleTex.tex`), the warning goes away. I realize that this is just a warning and could be ignored, but my automatic compilation scheme (emacs) complains that there's a warning every time, so I'd really like to get rid of it. Is it safe to just use the `\bibliographystyle` statement? Any idea why that appears to work?


title: Reverse labels without reversing the coordinates in circuitikz

text: How do I flip the label to the bottom without having to flip the coordinates?               \documentclass[preview, american, convert]{standalone}          \usepackage[siunitx]{circuitikz}          \begin{document}     \begin{circuitikz}         \draw         (0,0) to[C=\(C_f\)] ++(1,0);     \end{circuitikz}      ![enter image description here](http://i.stack.imgur.com/5RnXd.png) How do I flip the label to the bottom without having to flip the coordinates?


title: Modifying backreference page numbers in references

text: One can use the optional in `hyperref` package `\usepackage[pagebackref=true]{hyperref}` so that at the end of the each reference in the list of references there is something like `2` appended if that reference is cited on page 2 etc. In a paper I saw on the archiv, there was a very nice style where all the page numbers that appeared at the end of the citation in the references were preceded by a single 'upward-pointing-arrow' (something like `$\uparrow$`). I was hoping to do something like this with my paper but I was hoping not to have to go through `biblio.bbl` modifying this for each citation, since I have an aweful lot of citations. Anyone know how such a thing could be done with little pain?


title: Sudden vertical spacing in latex document with MDPI template

text: Using the MDPI journal stylesheet (http://www.mdpi.com/authors/latex), I encounter a sudden vertical spacing after some equation followed by arbitrary text. Here's my document header, as well as the code of the relevant part and a screenshot. I would really appreciate any feedback on how to solve this. Please apologize for not providing a real minimal example. Unfortunately, the dependency on the MDPI template makes this hard. Header:               \documentclass[entropy,article,submit,moreauthors,pdftex,12pt,a4paper]{mdpi}     \usepackage[table]{xcolor}     \usepackage{epstopdf}     \usepackage{subcaption}     \usepackage{graphicx}     \usepackage{tikz}     \usepackage[all]{xy}     \usetikzlibrary{arrows,automata,shapes,positioning,decorations.pathreplacing}     \theoremstyle{mdpi}      Text fragment:               \subsection{Experiment: The Impact of Anticipation on Survival}\\     Foo     \begin{equation}     \mathfrak{R}(\#\phi)=\frac{|\{i:X_{i,t}>0 \text{ at }t=(\#\phi \cdot N)\}|}{|\{i:X_{i,0}>0\}|}     \end{equation}     Foo Foo Foo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo Foo Foo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo FooFoo Foo      Screenshot: ![Please see the vertical spacing between line number 295 and 396](http://i.stack.imgur.com/PqsXu.png) I'm using pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian) in TeXstudio 2.6.2 (SVN 4110). Thank you very much!


title: Cleaning up figure placement in Beamer/minipage

text: I've placed three figures on the same page through the `minipage` option. However, it looks quite ugly right now. My latex (beamer) code for this page looks like:               \frame{     \frametitle{Various initial conditions}     %      % Nomenclature:     % \begin{align}     %  1-0.05(\cos [2 \pi x/L]+\sin [2 \pi x/L])\underbrace{\cos[2 \pi y/L]}_\text{Trailing term}     % \end{align}          \begin{center}      \begin{figure}[ht]           \begin{minipage}[b]{0.35\linewidth}\includegraphics[width=.65\linewidth]{/home/dnaneet/Research/Dissertation/wigner/ic/L=lambda/dftdata/L_lambda_max_1wl_zg_E_0001_Cos_profile_0}     \caption{$1-0.05(\cos [2 \pi x/L]+\sin [2 \pi x/L])\cos[2 \pi y/L]$}      \end{minipage}     \begin{minipage}[b]{0.35\linewidth}\includegraphics[width=.65\linewidth]{/home/dnaneet/Research/Dissertation/wigner/ic/L=lambda/dftdata/L_lambda_max_1wl_zg_E_0001_Sin_profile_0}     \caption{{\tiny $1 - 0.05(\cos [2 \pi x/L] + \sin [2 \pi x/L]) \sin[2 \pi y/L]$}}       \end{minipage} \\     \begin{minipage}[b]{0.35\linewidth}\includegraphics[width=.65\linewidth]{/home/dnaneet/Research/Dissertation/wigner/ic/L=lambda/dftdata/L_lambda_max_1wl_zg_E_0001_Cos_rot45_profile_0}     \caption{{\tiny $1 - 0.05(\cos [2 \pi (x+y/\sqrt{2}L)] + \sin [2 \pi (x+y/\sqrt{2}L)]) (\cos[2 \pi (x-y/\sqrt{2}L)])$}}       \end{minipage}                         \end{figure}     \end{center}                         }       And the figures look like: ![Screenshot of page](http://i.stack.imgur.com/QNY5F.png) Any suggestions on how I can clean this up? I also find that the figure caption has too many spaces between the math symbols. Whats up with that? My preample is:               \documentclass{beamer}          \usepackage{graphicx}     \usepackage{subfigure}     \usepackage{subfig}     \usepackage{epstopdf}     \usepackage{hyperref}     \usepackage{amsmath}     \usepackage[labelformat=empty]{caption}     \usepackage{setspace}     \usepackage[T1]{fontenc}     \usepackage[super,numbers,sort&compress]{natbib}     \usepackage{caption}     % \captionsetup{labelformat=empty,labelsep=none}     % \usepackage{makeidx}     % \usepackage{sidecap}          \setbeamertemplate{footline}[page number]     \setbeamercolor{structure}{bg=yellow, fg=black}


title: Hyphen (-) , prime symbol ( ′ ), double prime symbol ( ″ ) are missing

text: \documentclass[conference]{IEEEtran}     \hyphenation{op-tical net-works semi-conduc-tor}          \begin{document}          \title{Paper Title (use style: paper title)}      \author{\IEEEauthorblockN{Authors Name/s per 1st Affiliation (Author) }          \IEEEauthorblockN{Dept. name of organization (Line 1 of Affiliation - optional) }     \IEEEauthorblockN{Name of organization - acronyms acceptable (line 2) }     \IEEEauthorblockN{City, Country (line 3) }     \IEEEauthorblockN{name@xyz.com � optional (line 4) }}          \maketitle          \begin{abstract}     This electronic document is a �live� template. The various components of your paper [title, text, heads, etc.] are already defined on the style sheet, as illustrated by the portions given in this document. DO NOT USE SPECIAL CHARACTERS, SYMBOLS, OR MATH IN YOUR TITLE OR ABSTRACT.     \end{abstract}          \IEEEpeerreviewmaketitle           \section{Content}     All manuscripts must be in English. These guidelines include complete descriptions of the fonts, spacing, and related information for producing your proceedings manuscripts. Please follow them and if you have any questions, direct them to the production editor in charge of your proceedings (see author-kit message for contact info).          \subsubsection{Equations}     \begin{equation}     \beta \theta     \end{equation}          \section*{Acknowledgement}     The preferred spelling of the word �acknowledgment� in America is without an �e� after the �g�. .� Instead, try �R. B. G. thanks�.          \begin{thebibliography}{1}     \bibitem{} J. Clerk Maxwell, A Treatise on Electricity and Magnetism, 3rd ed., vol. 2. Oxford: Clarendon, 1892, pp.68�73.     \bibitem{} I. S. Jacobs and C. P. Bean, �Fine particles, thin films and exchange anisotropy,� in Magnetism, vol. III, G. T. Rado and H. Suhl, Eds. New York: Academic, 1963, pp. 271�350.     \end{thebibliography}          \end{document}      The symbols are missing and cannot generated in the pdf format. May I know what comment should I put it into the `.tex` file?


title: Subcaption with margin to the left only

text: I have a subfigure and I need to move its subcaption more to the middle of the subfigure. So I want to use something like `\subfigcapmargin`, but only with the margin on the _left_ side, not on the right side. What can I do?


title: How to rename an existing command?

text: I would like to know if renaming a command is possible in LaTeX. For instance, could I change the `\section` by `\sec` ? I read that some people used something called "alias".


title: Compatible versions of AUCTeX and Ghostscript on Mac

text: When I run preview-at-point (in emacs), I get a minus (do not enter) sign rather than the figure. I followed the suggestion here and downloaded the development version of AucTeX. The problem remains. Is there a way at this time to resolve this issue? I am on OSX, have Ghostscript 9.04, and tried AucTeX 11.86 as well as the development version. **Edit** For the sake of those consulting the archives, I have not resolved this issue. Perhaps it's best to just wait for a new release of auctex.


title: Equivalent symbol not working and subscript on vertical line

text: I have couple of issues here. I am making a presentation on beamer and I am using the following code:               \begin{align*}         & F_{in} = \int \frac{\partial Q}{\partial s}|_{in} ds,                    F_{out} = \int \frac{\partial Q}{\partial s}|_{out} ds \\         & S_{in} \equiv \frac{F_{in}}{Q_{in}},                    S_{out} \equiv \frac{F_{out}}{Q_{out}}     \end{align*}      However, the result of `\equiv` I am getting is `:=` and I would also appreciate if someone points how to make something like this in LaTeX `|_{out}` to fit with the equation height.


title: page numbering in table of contents

text: I'm writing a big report, and I have a minor problem with the page numbering in my table of contents. MWE: (sorry for the many \chapters, it is to ensure a two-page TOC)               \documentclass[11pt,a4paper,openright,twoside]{report}          % Fixing the appearance of the footer in the empty pages in between chapters.     \let\origdoublepage\cleardoublepage     \newcommand{\clearemptydoublepage}{%       \clearpage       {\pagestyle{empty}\origdoublepage}%     }     \let\cleardoublepage\clearemptydoublepage     % Finished fixing appearance          \begin{document}          \begin{titlepage}     This is the title page     \mbox{}     \end{titlepage}          \cleardoublepage     \pagenumbering{roman} % Yay, roman numbering (i, ii, iii, iv) for the abstract and table of contents.     \begin{center}     \subsection*{Abstract}     \end{center}     Abstract text          \cleardoublepage     \tableofcontents          \chapter{First chapter}     \pagenumbering{arabic} % And moving back to arabic numbering (1,2,3,4) for the body.     \setcounter{page}{1}   % Starting the page numbering at 1 again.     \section{First section}     \section{Second section}     \section{Third section}          \chapter{Second chapter}     \section{First section}     \section{Second section}     \section{Third section}          \chapter{Third chapter}     \section{First section}     \section{Second section}     \section{Third section}          \chapter{Fourth chapter}     \section{First section}     \section{Second section}     \section{Third section}          \chapter{Fifth chapter}     \section{First section}     \section{Second section}     \section{Third section}          \chapter{Sixth chapter}     \section{First section}     \section{Second section}     \section{Third section}          \chapter{Seventh chapter}     \section{First section}     \section{Second section}     \section{Third section}          \chapter{Eight chapter}     \section{First section}     \section{Second section}     \section{Third section}     \end{document}      I want my titlepage, abstract, and first page of TOC to be a right-hand page, as well as every first page of a chapter. That works. The abstract nicely has i for page number. However, I want the first page of my TOC to have page number ii, rather than iii which it is now (the second toc page should be iii). I've tried adding               \setcounter{page}{2}      immediately before or after `\tableofcontents`, but that doesn't work. Immediately before produces an extra unwanted white-page (and the toc starts at iii), while immediately after sets the second page of the toc to page number ii, while the first stays at iii. Any suggestions on how I can have my toc start at page ii here?


title: I don't know what is wrong: cases and itemize

text: I don't know what is wrong, because I can see the output but it is compiling with error.               \documentclass{tufte-book}          \usepackage{amsmath}          \begin{document}     \begin{itemize}     \item \begin{tabular}{cc}     \[     \begin{cases}     & x=0.99 \\ & y=0.99     \end{cases} \]     & $\rightarrow$ \qquad $P\left( B | A \right) = 0.33$.     \end{tabular}     \item \begin{tabular}{cc}     \[     \begin{cases}     & x=0.99 \\ & y=0.995     \end{cases} \]     & $\rightarrow$ \qquad $P\left( B | A \right) = 0.498$.     \end{tabular}     \item \begin{tabular}{cc}     \[     \begin{cases}     & x=0.99 \\ & y=0.999     \end{cases} \]     & $\rightarrow$ \qquad $P\left( B | A \right) = 0.83$.     \end{tabular}     \end{itemize}     \end{document}      Any ideas?


title: Tikz bug with math in decoration text?

text: Following this example, I write:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{         decorations.text,         }     \begin{document}     \begin{tikzpicture}     \coordinate (a) at (0,0);     \coordinate (b) at (6,0);     \draw[->, >=latex, blue!20!white, bend left=20, line width=15pt] (a) to (b) ;     \draw [bend left=20, decoration={raise=-0.8ex,text along path, text={{$start$}.}, text align={align=left}}, decorate] (a) to (b);     \draw [bend left=20, decoration={raise=-0.8ex,text along path, text={{$end\qquad$}.}, text align={align=right}}, decorate] (a) to (b);     \end{tikzpicture}     \end{document}      But, if I remove the "." characters, latex either repeats the text forever or else goes into an infinite loop.


title: A macro for looping through a pgfplotstable set by cell

text: Hi following on from the following question on multi-line headers with pgfplotstable, the solution was to set each affected cell individually. I decided to throw together a command to do that but keep hitting an the error `Argument of \reserved@a has an extra }. <inserted text> \par` The snippet I'm using is attached below -               \DeclareRobustCommand{\pgfplotstableeach}[4][1]{         \foreach \col in {#1,...,#2}             \foreach \ro in {0,...,#3}             {\ifthenelse{\col=#2 \AND \ro=#3}{every row \ro\  column \col/.style=\{#4\}}{every row \ro\  column \col/.style=\{#4\},}}        }      and this works fine to produce the text outside a `pgfplotstabletypeset` environment but fails inside one. I've tried `\newcommand` and `\newcommand{\protect\pgfplotstableeach}{<macro>}` but neither works. If I replace the macro with the text I want to input e.g. `"every row 0 column 1/.style=..."` it fails with a `Missing \endcsname inserted. <to be read again> \protect`. I actually thought this would be fairly straightforward but I'm completely bewildered by the error. What am I doing wrong? edited to include MWE below               \documentclass{article}     \usepackage{array,datatool,pgfplotstable}              \begin{filecontents}{sample.csv}            item,2008,2009,2010,2011                ,Actual,Actual,Forecast,Forecast                ,GBP,GBP,GBP,GBP                ,('000),('000),('000),('000) rounded            Area 1 OP, 1000000,1500000,1750000,250000            Area 2 OP, 400000,500000, 450000,-50000            Area 51 OP, 300000,375000,390000,15000            No P, 1250000, 1000000, 950000, 50000            Residuals, 800000, 80000, 90000, 10000       \end{filecontents}            \DeclareRobustCommand{\pgfplotstableeach}[4][1]{            \foreach \col in {#1,...,#2}               \foreach \ro in {0,...,#3}                {\ifthenelse{\col=#2 \AND \ro=#3}                            {every row \ro\  column \col/.style=\{#4\}}                            {every row \ro\  column \col/.style=\{#4\},}}          }          \begin{document}          \pgfplotstableread[col sep=comma,header=false]{sample.csv}\mystuff          \pgfplotstabletypeset[fixed,     \pgfplotstableeach{4}{4}{string type}]\mystuff          \end{document}


title: \cmidrule one column wide

text: What's the problem with a `\cmidrule(lr){1}`? Please consider the following MWE               \documentclass{article}          \usepackage{booktabs}          \begin{document}          \begin{table}     \centering     \footnotesize     \begin{tabular}{rcccccc}     \hline     & \multicolumn{3}{c}{Something} & \multicolumn{3}{c}{Something} \\      \cmidrule(lr){2-4} \cmidrule(lr){5-7}     Median &            1 &            1 &            0 &            1 &            2 &            3 \\     \cmidrule(lr){1} % <---- Here the issue     SD &           70.4 &            2.5 &            1.71 &            57.61 &            114.53 &            308.42 \\     N &            15481 &            118 &            30 &            15481 &            118 &             30 \\     \end{tabular}     \end{table}          \end{document}


title: Lost float in exam class

text: For some reason, I can't seem to put a figure or a table environment inside a solution environment while using the exam class. It produces a float is lost error. Has anyone found a way to bypass this or has an explanation as to why it does not work. I'm thinking it might have to do with how the solution environment is defined, perhaps as a float itself. Here is a sample of code that produces the error.               \begin{solution}     Voici le tableau demandé:\\     \begin{table}[h!]     \begin{tabular}{|c|c|c|}     \caption{Répartition des collèges publics du Québec selon la langue d'enseignement}     \hline     Langue d'enseignement & Effectifs & Fréquences\\     \hline     Français & $41$ &$ 0.854$\\     \hline     Anglais  & $ 5$ &$ 0.104$\\     \hline     Bilingue & $ 2$ &$ 0.042$\\     \hline     \end{tabular}     \caption{Répartition des collèges publics du Québec selon la langue d'enseignement}     \label{langue2}     \end{table}     \end{solution}


title: Use bullets from mini-frames in sidebar outer theme

text: I would like to reproduce the individual "bullets" you have under section names in the "mini-frames" outer theme under the subsection names in the navigation sidebar created in the "sidebar" outer theme.   From another question, Multiple navigation dots in Beamer for one frame, I found out that the code that produces each mini-frame is from the function \slideentry.   What I have done so far is to modify the navigation command in the sidebar outertheme, \insertverticalnavigation (beamerbasenavigation.sty, lines 548-627) such that it no longer redefines \slideentry to be blank (line 572). This would give, for a example, a MWE as:                           \documentclass[compress]{beamer}                 \useoutertheme[right,width=50pt,height=25pt]{sidebar}                 \usetheme{Copenhagen}                 \makeatletter                      %Sidebar navigation code                      \def\insertverticalnavigation#1{%                   \vbox{%                     \def\sectionentry##1##2##3##4##5{%                       \ifnum##5=\c@part%                       \def\insertsectionhead{##2}%                       \def\insertsectionheadnumber{##1}%                       \def\insertpartheadnumber{##5}%                       \hbox{{%                         \usebeamerfont{section in sidebar}\usebeamercolor[fg]{section in sidebar}%                           \hyperlink{Navigation##3}{%                           \ifnum\c@section=##1%                             \ifnum\c@subsection=0\relax%                               {\usebeamertemplate{section in sidebar}}%                             \else%                               \ifx\beamer@nav@css\beamer@hidetext%                                 {\usebeamertemplate{section in sidebar}}%                               \else%                                 {\usebeamertemplate{section in sidebar shaded}}%                               \fi%                             \fi%                           \else                             {\usebeamertemplate{section in sidebar shaded}}%                           \fi}}}%                       \beamer@currentsubsection=0\relax\fi}%                          %code commented out:                     %\def\slideentry##1##2##3##4##5##6{}%                     %                          \def\beamer@subsectionentry##1##2##3##4##5{%                       \ifnum##1=\c@part%                       \def\insertpartheadnumber{##1}%                       \def\insertsectionheadnumber{##2}%                       \def\insertsubsectionheadnumber{##3}%                       \def\insertsubsectionhead{##5}%                        \beamer@tocifnothide{\ifnum\c@section=##2\ifnum\c@subsection=##3\beamer@nav@css\else\beamer@nav@oss\fi\else\beamer@nav@ooss\fi}%                       {\hbox{{%                         \usebeamerfont{subsection in sidebar}\usebeamercolor[fg]{subsection in sidebar}%                           \hyperlink{Navigation##4}{%                           \ifnum\c@section=##2%                             \ifnum\c@subsection=##3%                               \ifnum\c@subsubsection=0\relax%                                 {\usebeamertemplate{subsection in sidebar}}%                               \else%                                 {\usebeamertemplate{subsection in sidebar shaded}}%                               \fi%                             \else%                               {\usebeamertemplate{subsection in sidebar shaded}}%                             \fi%                           \else%                             {\usebeamertemplate{subsection in sidebar shaded}}%                           \fi}}}%                       }%                       \fi}%                     \def\beamer@subsubsectionentry##1##2##3##4##5##6{%                       \ifnum##1=\c@part%                       \def\insertpartheadnumber{##1}%                       \def\insertsectionheadnumber{##2}%                       \def\insertsubsectionheadnumber{##3}%                       \def\insertsubsubsectionheadnumber{##3}%                       \def\insertsubsubsectionhead{##6}%                       \beamer@tocifnothide{\ifnum\c@section=##2\ifnum\c@subsection=##3\beamer@nav@css\else\beamer@nav@oss\fi\else\beamer@nav@ooss\fi}%                       {\hbox{{%                         \usebeamerfont{subsubsection in sidebar}\usebeamercolor[fg]{subsubsection in sidebar}%                           \hyperlink{Navigation##5}{%                           \ifnum\c@section=##2%                             \ifnum\c@subsection=##3%                               \ifnum\c@subsubsection=##4%                                 {\usebeamertemplate{subsubsection in sidebar}}%                               \else                                 {\usebeamertemplate{subsubsection in sidebar shaded}}%                               \fi%                             \else%                               {\usebeamertemplate{subsubsection in sidebar shaded}}%                             \fi%                           \else%                             {\usebeamertemplate{subsubsection in sidebar shaded}}%                           \fi}}}%                       }%                       \fi}%                     %\beamer@currentsubsection=0\relax%                     \dohead%                   }%                 }                           \makeatother                           \begin{document}                 \section{Foo}                 \begin{frame}{Test1}                 content...                 \end{frame}                 \subsection{foo}                 \begin{frame}{Test2}                 content...                 \end{frame}                 \begin{frame}{Test3}                 content...                 \end{frame}                 \begin{frame}{Test4}                 content...                 \end{frame}                 \begin{frame}{Test5}                 content...                 \end{frame}\section{Goo}                 \begin{frame}{Test6}                 content...                 \end{frame}                 \begin{frame}{Test7}                 content...                 \end{frame}                 \section{goo}                 \begin{frame}{Test8}                 content...                 \end{frame}                 \begin{frame}{Test9}                 content...                 \end{frame}                 \begin{frame}{Test10}                 content...                 \end{frame}                 \begin{frame}{Test11}                 content...                 \end{frame}                                \end{document}      However with this the mini-frames don't format as they would with the standard mini-frame outer theme. See the picture below (I apologise for the bad formatting in the MWE, it is minimal). ![Second Frame from MWE](http://i.stack.imgur.com/yUoHS.png)   As you can hopefully see from the picture of from the MWE, instead of aligning on a single row beneath each subsection each new mini-frame appears on a seperate line. Does anyone know how one would get the mini-frames to generate properly or which code I could hack to attempt to get the correct behaviour? Cheers.


title: How to create counters that display and increment dates in ConTeXt?

text: I need to create a document that has section titles named "October 1, 2012", "October 2, 2012", etc., like this:               \section{October 1, 2012}         This is text for the first day.     \section{October 2, 2012}         This is text for the second day.      Is there a simple way to create a counter, set to the initial date, and then to increment it? E.g.:                \section{\insertdate\incrementdate}          This is text for the first day.      \section{\insertdate\incrementdate}          This is text for the second day.        * This would need to know about leap years.   * When displayed in the table of contents, this should match the sections. In some situations, I may need to query the current value of `year`, `month`, and `day`, e.g.:               This is month \month and year \year.      This would display:               This is month 10 and year 2012.      In other situations, I may need to use the current value of `year`, `month`, and `day`, in a conditional, e.g.:               IF day IS 1, THEN:         "This is the start of a new month."     ELSE:         "It is not the start of a new month."      How can such a counter be created in ConTeXt?


title: Line breaking of URLs at "-"

text: I have a URL in my bibliography which line-breaks in an unpleasant way. The URL breaks as follows: http://www.mathworks.se/help/matlab/matlab_oop/( _break_ ) implementing-operators-for-your-class.html I want to allow breaks at "-" so that the URL would look something like: http://www.mathworks.se/help/matlab/matlab_oop/implementing-operators-( _break_ ) for-your-class.html I'm using a customized plainnat.bst file in order to get surnames first if that makes some difference.


title: How to insert a nice tilde in a lstlisting?

text: How do I insert a nice tilde that is centered in the middle in a `lstlisting`? I found another thread about tildes but I can't apply it because the method described there only works outside of `lstlisting` as `lstlisting` displays all the text literally. Any ideas? Here is how the tilde looks in my document at the moment - it's at the very top of the font and I would like it to be in the middle (like `~` this). ![enter image description here](http://i.stack.imgur.com/R4B7O.png) Here is the LaTeX for this fragment:               \section{Remove duplicate, consecutive lines (emulate "uniq")}          \begin{lstlisting}     awk 'a !~ $0; { a = $0 }'     \end{lstlisting}          Variables in Awk don't need to be initialized or declared before they are being used.


I have the following problem: The Builder pdflatex (tex2pdf) does not work. As a result of compilation I got the statement `Error: Builder (#2) for pdf output format has an invalid configuration`. The required Path for the TeX distribution seems to be right: `\usr\bin`. I use the operating system ubuntu 14.04 LTS 64 bit, as editor eclipse 3.8.1 with the texlipse-plugin and as viewer the newest acroread. As result I do not get any output. * * * Example edited in from comments               \RequirePackage[patch]{kvoptions}      \documentclass{DissOnlineLatex}     \usepackage[ngerman]{babel}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{graphicx}     \usepackage{subfigure}     \usepackage{amsmath,amssymb}     \usepackage{amsthm}     \usepackage{amsfonts}     \usepackage{tabularx}     \usepackage{rotating}     \usepackage{longtable}     \usepackage{lscape}     \usepackage{setspace}     \usepackage[style=chem-angew,backend=bibtex8,]{biblatex}     \usepackage{csquotes}     \usepackage{hyperref}     \usepackage[printonlyused]{acronym}     \bibliography{Literatur.bib}     \onehalfspacing     \usepackage{fancyhdr}     \usepackage[version=3]{mhchem}     \usepackage{eurosym}     \newcommand{\Natural}{{\mathbb{N}}}     \renewcommand{\topfraction}{1.0}     \renewcommand{\bottomfraction}{1.0}     \renewcommand{\floatpagefraction}{1.0}     \renewcommand{\dbltopfraction}{1.0}     \renewcommand{\dblfloatpagefraction}{1.0}     \include{hyphenations}     \begin{document}     \pagenumbering{roman}     \pagestyle{empty}     \include{titlepage}     \maketitle     \include{dedication}     \include{acknowledgement}     \include{abstract}     \setcounter{page}{1}     \tableofcontents     \newpage     \pagenumbering{arabic}     \pagestyle{fancy}     \fancyhf{}     \fancyhead[R]{\nouppercase{\leftmark}}     \addtolength{\headheight}{14.5pt}     \renewcommand{\headrulewidth}{0.4pt}     \fancyfoot[C]{\thepage}     \include{Chapters}     \begin{appendix}\include{appendix}     \end{appendix}     \listoffigures     \addcontentsline{toc}{chapter}{Abbildungsverzeichnis}     \listoftables     \addcontentsline{toc}{chapter}{Tabellenverzeichnis}     \printbibliography     \addcontentsline{toc}{chapter}{Literatur}     \clearpage     \end{document}


title: Missing pplr7t font file

text: I'm a new Ubuntu user and I'm trying to use all the programs I regularly use on Windows on Ubuntu, one of which is TeXworks. When I try to compile my `.tex` file using the green arrow circle in the top left corner of the window, this error pops up:               (/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1ppl.fd)     kpathsea: Running mktextfm pplr7t     /usr/share/texlive/texmf/web2c/mktexnam: Could not map source abbreviation  for pplr7t.     /usr/share/texlive/texmf/web2c/mktexnam: Need to update ?     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input pplr7t     This is METAFONT, Version 2.718281 (TeX Live 2012/Debian)          kpathsea: Running mktexmf pplr7t          ! I can't find file `pplr7t'.     <*> ...:=ljfour; mag:=1; nonstopmode; input pplr7t          Please type another input file name     ! Emergency stop.     <*> ...:=ljfour; mag:=1; nonstopmode; input pplr7t          Transcript written on mfput.log.     grep: pplr7t.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input pplr7t' failed to make pplr7t.tfm.     kpathsea: Appending font creation commands to missfont.log.          ! Font OT1/ppl/m/n/10.95=pplr7t at 10.95pt not loadable: Metric (TFM) file not      found.     <to be read again>                         relax      l.13 \begin{document}          ?      Process interrupted by user      I am missing this font file `pplr7t` and I can't figure out how to either add it or update whatever file or directory I need to update. Any help with this specific problem, and then some advice for general problem solving with LaTeX packages (where their directories are located, how to get and update packages) would be greatly appreciated.


title: Tufte-book title page customization

text: I have this code:               \documentclass{tufte-book}          \begin{document}              \title{Some stuff\\ \& \\Some other stuff}         \author{Me}         \date{Fall 2014}              \maketitle          \end{document}      The title doesn't break into three lines; instead I get an error. Is there a way to fix this? I also want to add an image to the cover. What's the best way? Do I need to redefine `\maketitle` (ugh), or is there something simpler?


title: How to avoid \cellcolor overflowing when changing the space in the column?

text: I reduced the space in the columns through the use of `@{}` in the column type:               \newcolumntype{M}{@{}c@{}}      The problem is that, when I combined this with the `\cellcolor` command, it overflows into the other columns. And if I remove the `@{}` space modification, then it sets it right. So, how can I let the `\cellcolor` command now that I reduced the space of that column?               \documentclass{article}          \usepackage[table]{xcolor}     \usepackage{array}     \newcolumntype{M}{@{}c@{}}          \begin{document}     \pagestyle{empty}     \begin{table}     \begin{tabular}{l|M|c|M|M}       & a & b & c & d\\     a & \cellcolor{black!50} 90.6 & 10 & 0 & 0\\     b & 0 & \cellcolor{black!50} 90.0 & 10 & 10\\     c & 0 & 0 & 95 & \cellcolor{black!50} 5\\     d & 0 & 10 & 5.5 & 8\\     \end{tabular}     \end{table}     \end{document}      ![Overflowed cellcolor table](http://i.stack.imgur.com/R4G8Y.png)


title: xypic not showing arrowheads

text: I have (supposedly) successfully installed xypic and am attempting to draw some diagrams. Everything is compiling just fine, but no matter what I do I cannot get the heads of the arrows to appear. All that shows up is the base of the arrow. For instance,               \begin{xy}     {\ar (0,0)*+{A}; (25,0)*+{A}};     \end{xy}      shows no arrow head.