title: Setup SyncTeX with Emacs

text: I want to setup SyncTeX with Emacs, or, more specifically, with AUCTeX, and Evince in Ubuntu. How can I do that? I would like both forward search (from source to output) and inverse search (from output to source). I have tried the following without success:   * I tried to do as http://www.emacswiki.org/emacs/AUCTeX#toc19 describes but when I try backward search (`Ctrl`+left click) I get the following message in Emacs: > apply: Wrong number of arguments: (lambda (file linecol) (let ((buf (get- > buffer file)) (line (car linecol)) (col (cadr linecol))) (if (null buf) > (message "Sorry, %s is not opened..." file) (switch-to-buffer buf) (goto- > line (car linecol)) (unless (= col -1) (move-to-column col))))), 3   * If I try the solution in http://ubuntuforums.org/showpost.php?p=11010827&postcount=12 I get the following message in Emacs: > Symbol's value as variable is void: TeX-view-program-list   * When I try http://ubuntuforums.org/showthread.php?p=11010827#post11010827 Emacs freezes a while and then I get the following message in Emacs: > let*: D-Bus error: "Did not receive a reply. Possible causes include: the > remote application did not send a reply, the message bus security policy > blocked the reply, the reply timeout expired, or the network connection was > broken." I am using AUCTeX 11.86 with Emacs 23.3.1 and Evince 3.2.1 in Ubuntu 11.10.


title: Set horizontal width on custom listings environment

text: I want to create a custom listings environment and want to set its width as something like 90% of textwidth, centred. Per an earlier question for algorithms, the first thing I tried was to embed the listing in a minipage environment. However, custom listing environments must be done through the `\lstnewenvironment` command. I found a way to still make standard environment work, but it requires to use the escape command every time before ending the environment. The second thing I tried was this latter command, but as far as I can see, it doesn't offer a feature to set the width of the listing or centre it.               \documentclass{article}     \usepackage{listings}     \usepackage{lipsum}               \lstnewenvironment{queryl} %% APPROACH 1      {\lstset{frame=shadowbox,escapechar=`}}      {}          \newenvironment{query} %% APPROACH 2      {\begin{minipage}{4cm}\centering\begin{queryl}}      {\end{queryl}\end{minipage}}               \begin{document}     %% APPROACH 1     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis.     \begin{queryl}     begin     { do nothing }     end ;     \end{queryl}     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis.          %% APPROACH 2     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis.          \begin{query}     begin     { do nothing }     end ;`%<- needs escape-to-LaTeX character to work     \end{query}          Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,     vestibulum ut, placerat ac, adipiscing vitae, felis.     \end{document}      ![enter image description here](http://i.stack.imgur.com/Xl84G.png) One can note that for the first environment, the frame extends beyond the width of the text. Also, puzzlingly the `minipage` environment doesn't seem to want to centre and swallows space (though I guess I could _perhaps_ at least get that to work with tinkering). In any case, does anyone have any ideas on how to set a width for a custom listings environment and centre it without requiring use of the escape character each time to end the environment?


title: Beamer: Missing $ in frame

text: Trying to compile the following code in a `beamer` presentation:               \subsection{I servizi LBS oggi}          \begin{frame}     \frametitle{La privacy negli odierni servizi LBS}     \begin{block}{Cosa ci dicono gli studi}     \begin{itemize}         \item Gli utenti sono ormai sempre più sensibili alla privacy delle loro informazioni di posizione         \item Il successo di un applicativo LBS è fortemente influenzato dalle modalità offerte all'utente di specificare le preferenze nella gestione dei propri dati sensibili (la propria posizione)     \end{itemize}     \end{block}          \begin{columns}[C]     \column{.5\textwidth}     \begin{block}{Le tecniche utilizzate}     Attualmente:     \begin{itemize}     \item blacklist     \item profili     \item invisibilità on-the-fly (\textit{Hide me!})     \end{itemize}     Cosa manca?     \begin{itemize}     \item Regole di autorizzazione a carattere spazio-temporale \Rightarrow \textit{"I miei colleghi di lavoro mi possono vedere solo nei giorni e negli orari lavorativi e solo quando sono in ufficio"}     \end{itemize}     \end{block}     \column{.5\textwidth}     \begin{figure}[ht!]     \centering     \includegraphics[width=.99\columnwidth]{chiesa}     \end{figure}     \end{columns}     \end{frame}      I'm getting the good ol' "Missing $ inserted" error in the `\end{frame}` line. I'm quite new to `beamer`: it could be related to the `column` commands? In every example I found columns are declared at the beginning of the frame, but I don't think it would be such a problem if I choose to put another block before them...anyone?


title: Overfull bad boxes with natbib

text: I have a problem with the `\citep` command of `natbib`, namely, that I get a lot of bad boxes (overfulls). Most of these happen within a citation. I tried `\usepackage[square, authoryear]{natbib}` (as suggested by somebody else) but it doesn't work. I cannot use `\linebreak` because, as I said before, the overfulls happen exactly at the citation, which apparently cannot be broken or hyphenated. Here comes the code:               \documentclass[11pt,a4paper]{article}          \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsmath}     \setcounter{tocdepth}{3}     \usepackage{latexsym,epsfig}     \usepackage{graphicx} %To include graphics     \usepackage[usenames,dvipsnames]{color} %To use color     \usepackage{hyperref}     \usepackage{breakurl} %This package should be use instead of url, when compiling to .PS     \usepackage{soul} %To use highlighting of the text     \usepackage{array} %To use arrays     \usepackage{verbatim}     \usepackage[hang,small,bf]{caption} %To manipulate figure and table captions     \setlength{\captionmargin}{30pt}     \usepackage{natbib}   % To use bibliography in the style of natural sciences - must come before algorithm2e     \usepackage[ruled,linesnumbered]{algorithm2e}  %To create nice algorithms - must be loaded *after* natbib     \usepackage{url}     \usepackage{enumerate} %To choose enumerator symbols          \title{Synthetic...}          \begin{document}     \maketitle          \begin{thebibliography}{4}          \bibitem[Aarts and Lenstra (1997)]{Aarts97} Aarts, E., Lenstra, J.K. (editors): Local Search in Combinatorial Optimization. John Wiley and Sons (1997).          \end{thebibliography}     \end{document}      * * *


title: How to set figure - caption spacing individually in a floatrow environment?

text: In the preamble I use :               \usepackage[labelformat=empty]{caption}     \usepackage[heightadjust=all,floatrowsep=none,captionskip=3pt]{floatrow}      With this package I'm able to put two figures horizontally and vertically aligned besides one another, and refer to them individually. It also puts the captions at the desired distance (3pt) below the figure base. However, this applies to all such setups in the document. Unfortunately things become messy, and the vertical spacing between the figures and their captions seem to vary randomly. How can I fix that individually for some figure pair with the wrong caption spacing ? Example :               \documentclass[pdftex,12pt,a4paper,english,dutch,leqno]{article}     \usepackage[top=1cm,right=1cm,bottom=1cm,left=1.5cm,noheadfoot]{geometry}     \usepackage{babel}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{tikz}     \usetikzlibrary{arrows,decorations.markings,patterns,calc}          \usepackage[labelformat=empty]{caption}     \usepackage[heightadjust=all,floatrowsep=none,captionskip=3pt]{floatrow}          \begin{document}          \begin{figure}[h!]     \begin{floatrow}     \ffigbox[\FBwidth]     {\begin{tikzpicture}[>=stealth']     \draw[line width=1mm] (0,0) circle (3);     \end{tikzpicture}}     {\caption{\footnotesize\bf Figure 1.}\label{fig:1}}     \hspace{1cm}     \ffigbox[\FBwidth]     {\begin{tikzpicture}[>=stealth']     \draw[line width=1mm,rotate=45] (0,0) rectangle (2,2);     \end{tikzpicture}}     {\caption{\footnotesize\bf Figure 2.}\label{fig:2}}     \end{floatrow}     \end{figure}          \end{document}      The `floatrow` package manual is mostly gibberish to me, and lacks examples.


title: Optimizing a piece of TikZ code (involving rotation of ellipses)

text: I have the following piece of TikZ code and I was wondering if it can be optimized? (I am actually sure that it can be!) The main issue is this: When I rotate the first batch of nodes surrounded by the ellipse to create the second batch, the ellipse is out of place. (It is not where I expect it to be. I am not sure which point is fixed in the rotation.) I have to tweak it blindly to move it to the desired place. The same goes for the labels "Community 2" and "Community 3". The rotated coordinates don't seem to match what I expect, and I have to blindly adjust them with limited success. On an unrelated note: I have also experimented with for-loops, but since I want the edges in each community to be slightly different, it seems that a direct copy-paste is easier? Other optimizations are also welcome. ## code               \documentclass[tikz]{standalone}          \begin{document}     \begin{tikzpicture}[scale = 1,node distance = 10mm]          \tikzset{       every node/.append style={circle, thick,         inner sep=0pt, minimum size = 3mm},       every label/.append style={red},       c1/.style={draw=blue!50,fill=blue!20},       c2/.style={draw=green!80,fill=green!40},       c3/.style={draw=red!80,fill=red!40}     }             \filldraw[rotate=30,blue!10] (0.8,0.1) ellipse (30pt and 25pt);     \node at (1,1.7) {Community 1};     \node[c1] (1) at (0,0) {};     \node[c1] (2) at (1,1)  {}     edge (1);     \node[c1] (3) at (0.7,0.2) {}     edge (2)     edge (1);     \node[c1] (4) at (0.2,0.7) {}     edge (3)     edge (2);     \node[c1] (5) at (1.3,0.5) {}     edge (2)     edge (4);          \begin{scope}[yshift=-2cm,rotate around={-40:(0,0)}]     \filldraw[rotate=30,green!10] (0.8,0.1) ellipse (30pt and 25pt);     \node at (1.2,-0.2) {Community 2};     \node[c2] (A) at (0,0) {};     \node[c2] (B) at (1,1)  {}     edge (A);     \node[c2] (C) at (0.7,0.2) {}     edge (B)     edge (A);     \node[c2] (D) at (0.2,0.7) {}     edge (C)     edge (B);     \node[c2] (E) at (1.3,0.5) {}     edge (C)     edge (D);     \end{scope}          \begin{scope}[xshift=2cm,yshift=-0.5cm,rotate around={-40:(0,0)}]     \filldraw[rotate=30,red!10] (0.8,0.1) ellipse (30pt and 25pt);        \node[c3] (a) at (0,0) {};     \node[c3] (b) at (1,1)  {}     edge (a);     \node[c3] (c) at (0.7,0.2) {}     edge (b)     edge (a);     \node[c3] (d) at (0.2,0.7) {}     edge (a)     edge (b);     \node[c3] (e) at (1.3,0.5) {}     edge (c)     edge (d);     \node[above of=b] {Community 3};     \end{scope}          \draw (3) -- (A);     \draw (4) -- (D);     \draw (5) -- (a);     \draw (c) -- (E);     \draw (e) -- (B);          \end{tikzpicture}     \end{document}      ## Output ![enter image description here](http://i.stack.imgur.com/rIzGp.png)


title: Does LaTeX store any potentially personally revealing data from my source in some log file somewhere?

text: I'd like to know if I'm leaking personal data if I hop from computer to computer running my `.tex` file without deleting some hidden log of some kind that retains, say, an address I have in an invoice within my TeX doc. Am I safe?


title: Text is "Clipped" in Animation

text: I want to animate text and equations (no pictures) in LaTeX. I tried out the animate package, but I find that my text is often clipped at the top and bottom. Here is a minimal example.               \documentclass{article}     \usepackage{animate}          \begin{document}     \begin{animateinline}[autoplay,loop]{2}     \multiframe{10}{n=0+1}{     \n     }     \end{animateinline}     \end{document}      When I compile it with pdflatex and view the result in Adobe Reader XI, the numbers are clipped at the top and bottom, as you can see here with the number 8 (zoom @ 800%): ![Picture of Number 8 missing the top of its head](http://i.stack.imgur.com/SbX4W.png) Is there a method to prevent this? Or is the animate package not the right tool for this job?


title: Urdu in latex (bold font)

text: \documentclass[12pt]{article}          \usepackage{arabxetex}          \newfontfamily\urdufont[Script=Arabic]{Jameel Noori Nastaleeq Kasheeda}          \begin{document}          \begin{urdu}          مندرجہ ذیل مساوات کو حل کریں $x_2 + m$           \end{urdu}          $x^2 + m$          \end{document}      I am running this program it works fine but the mathematical part is not shown properly within the `\begin{urdu} ... \end{urdu}` section, along with it i can't get the bold font while using the command `\textbf` and if someone suggests me using `polyglossia` then please provide me with an example :)


title: Best practice for writing comments in LaTeX documents

text: I would like to find out about recommended practices when using comments in LaTeX documents. Some programming languages are quite clear about how to use comments in source code: for instance, [here] are some guidelines about using comments in OCaml, and [here] are some guidelines for Java. But what about LaTeX? Here are a few questions that answerers might like to address:   * Should I put comments above/below/within each command I define?    * Should comments come at the end of an existing line, or on a line by themselves?    * Is there an accepted way of using comments to define each parameter of a command?    * What about using lines of comment symbols as a sectioning device?   * What sort of comments should one put at the head of a file? Below is some (abridged) code of mine that makes liberal use of comments. I thought it might be useful as a starting point.               \documentclass{article}          % ===================================================================     % TODO LIST     %     % * make "draw grid" key work properly     %     % * make a macro for partially-rounded rectangle          \usepackage{tikz}     \usetikzlibrary{showgrid}     \usetikzlibrary{calc}     \usepackage{etextools}          \makeatletter          % ===================================================================     % GENERAL-PURPOSE COMMANDS          % Extension of the ExpandNextTwo command provided by etextools     \def\ExpandNextThree#1#2#3#4{%       \ExpandNext{\ExpandNext{\ExpandNext{#1}{#2}}{#3}}{#4}}          % ===================================================================     % CONSTANTS          \newcommand\jusColor{black!50} % bg colour of "justification" steps     \newcommand\comColor{black}    % bg colour of "command" steps           % ===================================================================     % MINOR COMMANDS          % The expression     %   \@defineShape{foo}{34}{57}     % expands to the following definitions     %   \xdef\shapes@foo@left{34}     %   \xdef\shapes@foo@right{57}     \newcommand*\@defineShape[3]{%       \expandafter\xdef\csname shapes@#1@left\endcsname{#2}       \expandafter\xdef\csname shapes@#1@right\endcsname{#3}     }          \newenvironment{mydiagram}[1][]{%       %       % Process keys       \pgfkeys{/mydiagram/.cd,scale=1,start shapes={},#1}       %       % Nudge vertical cursor up a bit. This is a hack to        % counteract the fact that the first row does not have       % any steps in it. Without this hack, the labels in        % the first row would be printed too far down.       \setcounter{VCursor}{-\defaultStepHeight}       %       % Make the \\ command a synonym for \finishrow. The       % reason for this is mainly to exploit the syntax       % highlighting in AucTeX, which emphasises \\ commands.       \renewcommand\\{\finishrow}


title: Shortcut to compile the .tex and .bib in one go with Texmaker?

text: As known, Texmaker requires the user to PDFLaTeX first, then BibTeX, and then PDFLaTeX twice. This is really tedious. Is there any shortcut that allows me to do it in one go? **Update:** Some say that it can be done by the so-called quick build. But I have checked my quick build options as shown. There is **no** such a proper option called **"PDFLaTeX + BibTeX + view PDF"**. ![enter image description here](http://i.stack.imgur.com/cZH4t.png) How may I make it possible in this case?


title: Does it make sense to convert lightgray into cmyk for more legible printing results? Does this necessitate choosing a (different and) darker colour?

text: In my document I'm using the colour `lightgray` which looks nice on screen, but is barely decipherable when printed (with a BW-laser-printer). Using the `xcolor` pkg:   * Would it make sense to try and convert `lightgray` with `\convertcolorspec` to a `cmyk` equivalent for more legible _printing_ results?   * Would this necessitate choosing a _darker_ colour, or could a `cmyk` 1:1 equiv. of `lightgray` be chosen that looks exactly like the original `lightgray` on _screen_ ?   * If so, how to code it? A pretty plain MWE:               \documentclass{article}          \usepackage{lipsum}          \usepackage{xcolor}          \begin{document}               \lipsum[6]          {\textcolor{lightgray} {\lipsum[3]}}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%% Some more or less random snippets from the xcolor manual %%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % \extractcolorspec{lightgray}\tmpa     % \expandafter\convertcolorspec\tmpa{cmyk}\tmpb     % \expandafter\convertcolorspec\tmpa{RGB}\tmpc          % {\textcolor{\extractcolorspec{lightgray}{\tmpa\expandafter\convertcolorspec\tmpa{cmyk}\tmpb}}{\lipsum[2]}}          % \convertcolorspec          %%%%%%%%%%%%%%%%%%%%%%%%%     % Colors via svgnames option          % LightSlateGray     % LightSlateGrey          % Silver     %%%%%%%%%%%%%%%%%%%%%%%%%          % - enhanced color deﬁnition syntax to allow for target-model speciﬁc color parameters, e.g., \definecolor {red}{rgb/cmyk}{1,0,0/0,1,1,0}, facilitating the usage of tailor-made colors both for displays and printers;           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%               \end{document}      * * * See also here.


title: Converting Latex to MsWord .doc or .rtf

text: I understand, that similar questions were already asked here, and I have tried some of suggested solutions (latex2rtf, converting output pdf to doc with different convertors), but didn't find one that works for me. What are my circumstances: I work on Windows 8.1, in TexStudio, using TexLive. I use xelatex, because I need Times New Roman Cyrillic in output pdf. My text are mostly in Russian and English, don't contain equations, but contain illustrations and text fragments in Oldchurchslavonic and Greek. I use biblatex and biber for building bibliography. Often I need to send documents in .doc format, because many journals in my knowledge area don't accept articles in .tex or .pdf. So LaTeX fits perfectly in my workflow except of the final stage. I tried to use latex2rtf, but run into some encoding problems. What I did finally was converting pdf to doc with trial verstion of Nitro PDF and then spending about two hours cleaning the file from double spaces, hyphens turned into dashes, unexpected line breaks etc. It was definitely not the best solutoin, but I don't have time to search a different one. Is there any solution for converting latex to .doc or .rtf that will work under described circumstances OR a pdf to doc converter that produces editable .doc?


title: Permanent Transparent Block in a Frame in Beamer

text: In a frame I have two block: the first is visible, while the second should be transparent. With               \frame{     \frametitle{title}     \begin{block}{title visible block}     \end{block}     \invisible{\begin{block}{title invisible block}     \end{block}}     }      I have the first block visible and the second one invisible. I would like to make the second block transparent rather than invisible. What is the command? EDIT: This is partially the code of 3 slides.               \frame{     \frametitle{title}     \begin{block}<1->{procedure-1}      \begin{center}        \includegraphics[height=1.3in,width=4in]{images/procedure-1.png}      \end{center}     \end{block}     \invisible{\begin{block}{Mathematical Formulation}     \begin{equation}      0+0=0     \end{equation}     \end{block}}     }     \frame{     \frametitle{title}     \begin{block}<1->{procedure-2}      \begin{center}        \includegraphics[height=1.3in,width=4in]{images/procedure-2.png}      \end{center}     \end{block}     \invisible{\begin{block}{Mathematical Formulation}     \begin{equation}      0+0=0     \end{equation}     \end{block}}     }     \frame{     \frametitle{title}     \begin{block}<1->{procedure-3}      \begin{center}        \includegraphics[height=1.3in,width=4in]{images/procedure-3.png}      \end{center}     \end{block}     \begin{block}<2->{Mathematical Formulation}     \begin{equation}      0+0=0     \end{equation}     \end{block}     }


title: Minitoc numeration overlaps with subsection titles

text: I have long `minitoc` numeration depth `\setcounter{minitocdepth}{3}`. I have a problem with it:               \documentclass{report}     \usepackage{newcent}     \usepackage{minitoc}     \setcounter{tocdepth}{1}     \setcounter{secnumdepth}{5}     \dominitoc     \nomtcrule     \setlength{\mtcindent}{5pt}     \setcounter{minitocdepth}{5}     \renewcommand{\mtcSfont}{\small\bfseries\rmfamily}     \renewcommand{\mtifont}{\large\bfseries\rmfamily}     \begin{document}     \tableofcontents     \appendix     \chapter{X}     \minitoc     \newpage     \section{X}     \section{X}     \section{X}     \section{X}     \section{X}     \section{X}     \section{X}     \subsection{X}     \subsection{X}     \subsection{x}     \subsection{X}     \section{X}     \section{X}     \section{X}     \section{X}     \section{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \subsection{X}     \end{document}      ![enter image description here](http://i.stack.imgur.com/n0lMp.jpg) As you can see `A.12.10` overlaps with `X`. How I can change setting of `minitoc` to overcome this problem?


title: Hyperrefs in advanced ToC in XeTeX

text: I'm trying to apply this awesome template. I'm using XeTeX and russian -- and it gives:               ! Missing \endcsname inserted.     <to be read again>                         \csname\endcsname     l.5 ...ter}{Предисловие}{i}{chapter*.1}      Here's MWE:               \RequirePackage[l2tabu,orthodox]{nag} % checks for some discouraged practice     \documentclass[a5paper, oneside]{book}          \usepackage{xltxtra}          % Customizing the page:     \usepackage[top=1.2cm, bottom=1.8cm, left=1.5cm, right=1.7cm]{geometry} % required by MISiS PH          % XeTeX technologies:     \usepackage{fontspec}     \usepackage{polyglossia}     \usepackage{xecyr}               % fonts:     \setmainfont[Mapping=tex-text]{Arial}     \setsansfont{Arial}     \setromanfont{Arial}     \setmonofont{DejaVu Sans Mono}               % Russian:     \newfontfamily\cyrillicfont{Arial}          \setmainlanguage{russian}     \setdefaultlanguage{russian}     \setotherlanguage{english}               % ToC:     \usepackage{titletoc}     \usepackage{tocloft}     \usepackage[nottoc]{tocbibind}     \usepackage{afterpage}          % Change the name of the ToC     \AtBeginDocument{%     \renewcommand\contentsname{Table of Contents}}          % Headings for every page of ToC, LoF and Lot     \newcommand\tocheading{\par\bigskip\MakeUppercase{\chaptername}\hfill Page\par}     \newcommand\lofheading{\par\bigskip\figurename\hfill Page\par}     \newcommand\lotheading{\par\bigskip\MakeUppercase{\tablename}\hfill Page\par}          % Centering titles for the ToC, Lof and Lot     \renewcommand{\cfttoctitlefont}{\hfill\normalfont\MakeUppercase}     \renewcommand{\cftaftertoctitle}{\hfill}     \renewcommand{\cftloftitlefont}{\hfill\normalfont\MakeUppercase}     \renewcommand{\cftafterloftitle}{\hfill}     \renewcommand{\cftlottitlefont}{\hfill\normalfont\MakeUppercase}     \renewcommand{\cftafterlottitle}{\hfill}          % Chapter entries formatting for frontmatter chapters     \newcommand\frontmatterchaptoc{%     \titlecontents{chapter}       [1.5em]{\addvspace{\baselineskip}}       {\contentslabel{1.5em}\MakeUppercase}       {\hspace*{-1.5em}\MakeUppercase}       {\titlerule*[1pc]{.}\contentspage}     }          % Chapter entries formatting for mainmatter chapters     \newcommand\mainmatterchaptoc{%     \titlecontents{chapter}       [5em]{\addvspace{\baselineskip}}       {\contentslabel{3em}\hspace*{-1em}\MakeUppercase}       {\MakeUppercase}       {\titlerule*[1pc]{.}\contentspage}     }          % Section, subsection, table and figure entries formatting     \titlecontents{section}       [7em]{}{\hspace{-1em}}{}{\titlerule*[1pc]{.}\contentspage}     \titlecontents{subsection}       [7.5em]{}{\hspace{-1em}}{}{\titlerule*[1pc]{.}\contentspage}     \titlecontents{figure}       [5em]{}       {\contentslabel{3em}\hspace*{-1em}}{}       {\titlerule*[1pc]{.}\contentspage}     \titlecontents{table}       [5em]{}       {\contentslabel{3em}\hspace*{-1em}}{}       {\titlerule*[1pc]{.}\contentspage}               % figures:     \usepackage{graphicx}               % colors:     \usepackage[usenames,dvipsnames]{xcolor}               % hyperref:     \usepackage{hyperref}     \hypersetup{       xetex,       pdftitle={Электронная теория металлов: задачи с решениями},       pdfauthor={Boris Kheyfets},       pdfcreator={XeLaTeX},       breaklinks,       backref,       colorlinks,       CJKbookmarks=true,       citecolor=black,       filecolor=black,       linkcolor=black,       urlcolor=black,     }     % hyperref links to table/figures issue:     \usepackage[hypcap]{caption}               % better looking tables with `\toprule`,`\midrule`,`\bottomrule`:     \usepackage{booktabs}               \begin{document}          \frontmatter     \frontmatterchaptoc % activation of chapter entries formatting in the frontmatter          \chapter{Предисловие}          \cleardoublepage     \tableofcontents     \cleardoublepage     \addtocontents{lof}{\lofheading}% add heading to the first page in LoF     \listoffigures     \cleardoublepage     \addtocontents{lot}{\lotheading}% add heading to the first page in LoT     \listoftables     \cleardoublepage          \mainmatter     \addtocontents{toc}{\tocheading}% add heading to the first page in ToC, after frontmatter entries          \mainmatterchaptoc% activation of chapter entries formatting in the mainmatter          \chapter{Introduction}     \section{Section One One}     \begin{figure}     \centering     A     \caption{Test figure one}     \label{fig:test}     \end{figure}     \chapter{Policy divergence and traditional research}     \section{Section Two One}     \begin{figure}     \centering     A     \caption{William Adolphe Bouguereau, \emph{Youth of Bacchus}  (initial sketch), 1884}     \label{fig:wab}     \end{figure}     \subsection{Section Two One One}          \end{document}      I found that if I comment hyperref -- it works. Also if I remove some advanced stuff from ToC -- it also works.


title: One source text, two outputs

text: I have very long source text. I want to create two outputs:   1. All text   2. Only small pieces of this source text, selected by condition command MWE (precisely: _not working_ )               \documentclass{article}     \usepackage{lipsum}     \begin{document}     \newif\ifPIECES     \PIECEStrue     \section{Lorem ipsum dolor}     \lipsum[1]          \ifPIECES This is first small piece. I want this piece in two outputs.      When PIECES is folse, I want all source text. \else\fi          \lipsum[2]          \ifPIECES This is second small piece.  \else\fi          \lipsum[3]           \ifPIECES This is third small piece.  \else\fi          \lipsum[4]          \end{document}      How I should define LaTeX command? I am nowbe in programming, as you see.


title: Chapter reading order diagram

text: I need to create a diagram for a book, indicating the order in which chapters may be read. For example: ![enter image description here](http://i.stack.imgur.com/YlfdC.jpg) (Taken from http://www.proba.jussieu.fr/pageperso/giacomin/pub/RPM/Site/Contents_files/dep.jpg \-- not mine.) Further (due to publisher requirements) it needs to be done in TeX, rather than imported as a diagram. (I imagine TikZ might work well, but positioning all the nodes by hand would be tortuous.) What's the best way of producing an attractive diagram?


title: Integration of arara in Texmaker - follow up

text: I'm very new using LaTeX and I'm stuck trying to run arara in TeXmaker (MiKTeX). I'm following the post Integration of arara in Texmaker but at the end I get > Error : could not start the command I suspect it's because I should write something different to `arara %.tex` during the configuration?


title: How can I get a symbol to behave like an infix operator?

text: For example, how can I get "`x \overline{*} y`" to parse like "`x * y`"? I know I can adjust the manual spacing using "`\,`", but is there a less superficial way?


title: Color Background of Rows for better Readibility

text: I want to add different background colors of the rows of table for better readability. My (not jet minimal working) example is the following:               \documentclass{article}     \usepackage{amssymb,pifont,booktabs,caption,fixltx2e}     \usepackage[flushleft]{threeparttable}          \usepackage{multirow}          \begin{document}      %\begin{landscape}     \begin{table}[htbp]     \begin{threeparttable}     \centering     \caption{Open Market Operations }     \begin{tabular}{p{3cm} p{3cm}cccccccc}     \hline     &                      & \textbf{A} & \textbf{B} & \textbf{Bh} & \textbf{I} & \textbf{Ma} & \textbf{Ne} & \textbf{Pa} & \textbf{S} \\     \hline          \multirow{5}{3cm} {\textbf{Frequency}}      & Once a day           & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\     & More than once a day & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\     & Weekly               & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{55} \\     & Fortnightly          & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\     & Others               & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\     \hline          \multirow{4}{3cm} {\textbf{Tenor}}          & Overnight            & \ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\     & 2-7 days             & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{55} & \ding{51} & \ding{51} \\     & 8-14 days            & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\     & More than 14 days    & \ding{55} & \ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{51} \\     \hline          \multirow{2}{3cm} {\textbf{Eligible Assets for Collateral} }     & Government securities& \ding{55} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} \\     & Central bank bills   & \ding{51} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{51} \\     \hline          \multirow{3}{3cm} {\textbf{Nature of Transaction}}      & Outright             & \ding{51} & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{51} \\     & Repo                 & \ding{55} & \ding{51} & \ding{55} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} \\     & Other                & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\     \hline          \multirow{2}{3cm} {\textbf{Interest Rate Determination}}     & Auction              & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} & \ding{51} \\     & Fixed rate           & \ding{55} & \ding{55} & \ding{55} & \ding{51} & \ding{55} & \ding{55} & \ding{55} & \ding{55} \\     \hline     \end{tabular}          \begin{tablenotes}     \small     \item Source:      \item 1 OMOs through.     \item 2 Daily and weekly Liquidity Adjustment Facility.     \item 3 91 days     \item 4 By way of secondary market transactions     \item A: S     \end{tablenotes}          \end{threeparttable}     \label{tab:addlabel}     \end{table}     \end{document}


title: Testing for number

text: How do I test if a given parameter is a number, in order to apply a different style? And if not, just ignore... Like:               \domorestuffifnumber{things} -> things     \domorestuffifnumber{123}    -> \emph{123}      Thanks.


title: specific table layout

text: I want to draw a table like this: ![table](http://i.stack.imgur.com/Txp2A.png) with the table width being a portion of the line width, like e.g. 0.8 * linewidth. But I cant figure out how to do it. Anyone? edit: MWE:               \documentclass[a4paper,12pt,headsepline]{report}     \geometry{left=2cm, right=2cm, top=2.5cm, bottom=2cm}     \linespread {1.25}\selectfont     \usepackage[nottoc]{tocbibind}     \frenchspacing     \usepackage{tabularx}     \usepackage{longtable}     \usepackage{booktabs}     \usepackage{geometry}          \begin{document}              %...         % need table here         % ...          \end{document}


title: How to make the pdf output of better print quality?

text: The pdf output generated from by LaTeX is usually not as clear or black as the standard documents would usually be preferred. The search so far suggests that either the fonts used or the Ghostscript viewer may be a problem (latest is version 9.0 and MikTeX comes with 8.7), but I have not found any information for making the fonts themselves have darker ink so to say. How can the pdf text be made of clearer print? Please specify the exact packages/fonts/software required.


title: Convert table from excel to latex with format $10^{-n}$

text: I would like to convert a table from Mircosoft Excel to latex (on Winedt) based on Microsoft Windows operation system. The number in excel is, for instance, * * * 1 2 1.00E-02 1.05E-03 * * * I would like to have 1.00 $\times 10^{-2}$ and 1.05$\times 10^{-3}$ in latex table directly. I have tried excel2latex.xla, it could convert table, but does not change formatting as $\times 10^{-2}$. Is there any simple way to do that? though I am somehow doubt about it...


title: Summing a list and specifying number of elements on list

text: How would I create something like either of the following on LaTeX? ![enter image description here](http://i.stack.imgur.com/etXEL.png)


title: How do you fix when my writing stops half way the A4 page and goes to next column

text: I began my document with               \documentclass[a4paper]{article}          \usepackage{amsmath}          \usepackage{amssymb}          \usepackage{graphicx}          \usepackage[margin=0.1in]{geometry}          \usepackage{multicol}          \begin{document}     \begin{small}     \begin{multicols}{3}      AND THEN I WROTE MY STUFF HERE AND FINISHED WITH               \end{multicols}     \end{small}     \end{document}      Then it looks like this as shown in the picture. It doesn't go down the A4 page and it stops half way and goes to the next column. How could I fix this? ![enter image description here](http://i.stack.imgur.com/NZWHd.png)


title: Vertically align the tops of matrices in an equation

text: The following matrix equation looks great:               \begin{align*}     \overset{A}{\left[\begin{matrix}t_{1}&1\\      \vdots&\vdots\\     t_{n}&1     \end{matrix}\right]}     \overset{x}{\left[\begin{matrix}     x_{1}\\x_{2}     \end{matrix}\right]}     &=     \overset{b}{\left[\begin{matrix}     b_{1}\\ \vdots \\ b_{n}     \end{matrix}\right]}     \end{align*}      Except I am accustomed to having the tops of my matrices aligned when I write on scratch paper. How can I accomplish this in LaTeX?


title: How to draw lines and put objects relative to other lines

text: I'm trying to draw a simple line, and at the end of that line include a table. I would like to do it without having to compute myself the position where the table needs to be drawn. How can I do that? many thanks


title: biblatex: bbl wrong format version

text: I am using texlive 2012, and both pdflatex and biber are executed with full path to ensure the correct binary. biblatex has version 2.2, biber 0.9.9. If I run pdflatex, biber, pdflatex I get the following output of biber               INFO - This is Biber 0.9.9     INFO - Logfile is 'LaTeXTemplate.blg'     INFO - Reading 'LaTeXTemplate.bcf'     WARN - Warning: Found biblatex control file version 2.0, expected version 1.7     INFO - Found 1 citekeys in bib section 0      and in the end I get the error from pdflatex               Package biblatex Info: Trying to load bibliographic data...     Package biblatex Warning: File 'LaTeXTemplate.bbl' is wrong format version - expected 2.1.          Package biblatex Info: ... file 'LaTeXTemplate.bbl' found.     (./LaTeXTemplate.bbl     ! Undefined control sequence.     <argument> ...c@refsection @entry@\blx@slist@name       What is going wrong ? I already deleted all biblatex and the aux file, but it is reproducible. Why is the bcf and bbl file version expected wrong?


title: transparency groups in asymptote

text: The Asymptote file               size(5cm);     draw(unitcircle ^^ expi(-3pi/4) -- expi(pi/4), red + linewidth(1cm) + opacity(0.5));     settings.outformat="pdf";      produces this ![enter image description here](http://i.stack.imgur.com/TYrib.png) which is clearly not what was intended. I'd like to be able to draw (fill, etc.) several paths (or perhaps even an entire `picture`) that draw over each other as though they were opaque, but such that things drawn before the entire group are still visible (as in transparency). In TikZ, I can do this using `transparency groups` (although that feature has minor issues if you combine it with enough other esoteric features; see this question). How can this be done using Asymptote?


title: Table with an itemized list in second column

text: A colleague of mine asked me for help creating the following picture using tex code. ![table with lists in second column](http://msemac.redwoods.edu/~darnold/questions/MichelleTable.png) Can someone share a bit of code, maybe for the first two rows? ======================================================================================= Thanks to suggestions below and the following link: mori table article I was able to do the following:               \documentclass{article}     \usepackage[table]{xcolor}          \begin{document}          \rowcolors{1}{white}{gray!20}     \begin{tabular}{|l|p{8cm}|}     \hline     Strengths &      - Increase the number of tourists\newline     - Easy to start a business\newline     - Favorable tax System\\     \hline     Weakness &      - Limited Resources\newline     - High start-up costs\\     \hline     Opportunities &      - target markets by country of origin or interests\\     \hline     Threats &      - High level of competition\newline     - Difficulty in attracting and maintaining customers\\     \hline     \end{tabular}          \end{document}      The result was this image. My colleague is grateful. ![enter image description here](http://i.stack.imgur.com/4Hluo.png)


title: How to forward a command parameter?

text: I am defining a new command and a flag with:               \newcommand{\setActorsStyle}[1][1]{       \ifnum#1=1          \setActorsStyleColor{}       \else          \setActorsStyleBW{}       \fi     }          \newcommand{\flag}{0}      Calling the command as following with               \setActorsStyle[\flag{}]{}      results in compilation error `Missing = inserted for \ifnum` as if the parameter given to `\ifnum` is not an integer. What am I missing here ?


title: How to increase the dot resolution of implicit curves produced by `\psplotImp`?

text: ## Normal View ![alt text](http://i.stack.imgur.com/Duu01.png) * * * ## Zoomed-In View ![alt text](http://i.stack.imgur.com/ahtu5.png) * * * ## "Minimal" Code Snippet               \documentclass[11pt,rgb]{article}     \usepackage{pst-func}     \renewcommand\pshlabel[1]{{\color{gray}\tiny#1}}     \renewcommand\psvlabel[1]{{\color{gray}\tiny#1}}     \usepackage{graphicx}     \usepackage{bera}     \begin{document}     \noindent\scalebox{2}{%     \begin{pspicture*}[showgrid=false](-3,-3)(3,3)       \psframe[fillcolor=black,fillstyle=solid](-3,-3)(3,3)         \psaxes       [%        linecolor=gray,        tickcolor=gray,        linewidth=0.25pt,        xlabelPos=top,        xticksize=-0.05 0.05,        yticksize=-0.05 0.05%       ]{<->}(0,0)(-2,-1.75)(2,2)[$\color{gray}x$,0][$\color{gray}y$,90]       \rput[br](-1.75,1.5){\Large\bf\color{cyan}We}       \rput(1.75,-1){\Large\bf\color{white}PSTricks}       \psplotImp[linecolor=red,linewidth=0.5pt](-2.5,-1.75)(2.5,2.5)%       {x 2 exp 1.25 y mul x abs sqrt sub 2 exp add 2.5 sub}          \rput(0,-2.25){\color{yellow}$x^2 + \left(\frac{5y}{4}-\sqrt{|x|}\right)^2=\frac{5}{2}$}     \end{pspicture*}}     \end{document}        * * * I noticed the produced curve is NOT symmetric about y-axis. It has to be symmetric about y-axis actually.


title: Systems of equations in ConTeXt

text: In LaTeX+`amsmath`, I can say               \documentclass{article}     \usepackage{amsmath}          \begin{document}     \begin{equation*}       \left\{         \begin{aligned}           px-y-4&=0\\           2x-2y-6m&=0         \end{aligned}       \right.     \end{equation*}     \end{document}      to get an aligned system of equations with a brace on the left. How to achieve a similar effect in ConTeXt? I tried saying `\startalign[left=\{]` and similar things with no effect. **Edit:** thanks to Aditya's and Marco's comments below I came up with this:               \starttext     \startformula       \startmathmatrix[left={\left\{},right={\right.},distance=0pt,align={right,left}]         \NC px-y-4\NC{}=0\NC\NR         \NC 2x-2y-6m\NC{}=0\NC\NR       \stopmathmatrix     \stopformula     \stoptext      Now my question is: can this be made better? I do not like the `distance=0pt` and `{}` stuff very much (but I guess this keeps the spacing on _both_ sides of the equation sign uniform).


title: Can small-caps be automated for abbreviations and acronyms?

text: Is there a way to force LaTeX to automatically use small-caps for abbreviations and acronyms (or more specifically, strings of two or more uppercase letters)?


title: Adding a legend header

text: I would like to add a legend header to one of my pgfplot. So far I get that               \documentclass{standalone}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}       \begin{axis}[         ymin=0,         ymax=1,         enlargelimits=false,         legend pos=north west,         legend style={area legend},         legend columns=-1        ]        \addlegendimage{empty legend}        \addlegendentry[yshift=10pt]{Header legend}        \addplot          [const plot,fill=blue,draw=black]          coordinates          {(0,0.1)    (0.1,0.15)  (0.2,0.5)   (0.3,0.62)           (0.4,0.56) (0.5,0.58)  (0.6,0.65)  (0.7,0.6)           (0.8,0.58) (0.9,0.55)  (1,0.52)}          \closedcycle;        \addlegendentry{histo 1}        \addplot           [const plot,fill=red,draw=black]          coordinates          {(0,0.1)    (0.1,0.15)  (0.2,0.5)   (0.3,0.62)           (0.4,0.56) (0.5,0.58)  (0.6,0.65)  (0.7,0.6)           (0.8,0.58) (0.9,0.55)  (1,0.52)}          \closedcycle;        \addlegendentry{histo 2}     \end{axis}     \end{tikzpicture}     \end{document}      which gives me that ![enter image description here](http://i.stack.imgur.com/paIOW.png) I would like to have the second row to be left aligned with respect to the first one. I do not want to fix the number of row because there may be more histograms to come and I would like to have them horizonthally aligned (that's why I use `legend columns=-1`). I read here that pgfplots `legend` is nothing else than tikz `matrix` so maybe there is a way to x-shift the second row (as I already did with the `yshift=10pt` command).


title: Problems installing MiKTeX

text: I have managed to download the ProTeX package and install TeXstudio. However, I keep failing in installing MiKTeX. (I have tried to download it several times from different places to insure that it was not due to errors in the file.) The file report is               Loading package database...     starting package maintenance...     installation directory: "C:\Program Files\MiKTeX 2.9_3"     package repository: C:\Users\roenholt\AppData\Local\Temp\mik8802     visiting repository C:\Users\roenholt\AppData\Local\Temp\mik8802...     repository type: local package repository     loading lightweight database...     lightweight database digest: 619596a31709591ed2c339e41c0fb1d7     going to install 9522 file(s) (159 package(s))     problem: C:\Program Files\MiKTeX 2.9_3\miktex/bin\MiKTeX209-core-PS.dll does not exist     problem: C:\Program Files\MiKTeX 2.9_3\miktex/bin\MiKTeX209-core.dll does not exist     problem: C:\Program Files\MiKTeX 2.9_3\miktex/bin\MiKTeX209-packagemanager-PS.dll does not exist     problem: C:\Program Files\MiKTeX 2.9_3\miktex/bin\MiKTeX209-packagemanager.dll does not exist     extracting files from ae.tar.lzma...     extracting files from amsfonts.tar.lzma...     extracting files from amslatex.tar.lzma...     extracting files from avantgar.cab...     extracting files from babel.tar.lzma...     extracting files from bidi.tar.lzma...     extracting files from bookman.cab...     extracting files from carlisle.tar.lzma...     extracting files from cbcoptic.tar.lzma...     extracting files from cm.tar.lzma...     extracting files from courier.tar.lzma...     extracting files from dehyph-exptl.tar.lzma...     extracting files from ec.tar.lzma...     extracting files from elhyphen.tar.lzma...     extracting files from enctex.tar.lzma...     extracting files from euenc.tar.lzma...     extracting files from eurosym.tar.lzma...     extracting files from float.cab...     extracting files from fontspec.tar.lzma...     extracting files from geometry.tar.lzma...     extracting files from graphics.tar.lzma...     extracting files from helvetic.cab...     extracting files from hoekwater.tar.lzma...     extracting files from hyperref.tar.lzma...     extracting files from hyph-utf8.tar.lzma...     extracting files from ifxetex.tar.lzma...     extracting files from jknappen.cab...     extracting files from latex-fonts.tar.lzma...     extracting files from latex2e-help-texinfo.tar.lzma...     extracting files from lm.tar.lzma...     extracting files from ltxbase.tar.lzma...     extracting files from ltxmisc.tar.lzma...     extracting files from lua-alt-getopt.tar.lzma...     extracting files from luainputenc.tar.lzma...     extracting files from lualibs.tar.lzma...     extracting files from luamplib.tar.lzma...     extracting files from luaotfload.tar.lzma...     extracting files from luatexbase.tar.lzma...     extracting files from luatextra.tar.lzma...     extracting files from mflogo.cab...     extracting files from miktex-arctrl-bin-2.9.tar.lzma...     extracting files from miktex-biber-bin.tar.lzma...     extracting files from miktex-bibtex-base.cab...     extracting files from miktex-bibtex-bin-2.9.tar.lzma...     extracting files from miktex-bibtex8bit-base.cab...     extracting files from miktex-bibtex8bit-bin-2.9.tar.lzma...     extracting files from miktex-bin-2.9.tar.lzma...          Error: Permission denied: C:\Program Files\MiKTeX 2.9_3\miktex/bin/internal/miktex-update.exe      Does anyone in this forum have an idea of how to solve the problem?


title: Changing color and bullets in Beamer's table of contents

text: Does anyone know how to change the color scheme and/or bullets used in Beamer's table of contents (without changing the overall structure color or theme)? Unfortunately, the following doesn't work:               \setbeamertheme{enumerate item}[default]     \setbeamercolor{enumerate item}{black}      I would even be fine removing the numbering altogether.


title: How can I find out how this thesis was TeXed?

text: This is the thesis in question. I have never seen this style, both with the transparent large numbering in the top right of the page, and the style of `\mathbb{}`. So I'm wondering how to find this out.


title: Generate HTML from document that uses autoref/cleveref

text: I have an existing document that was written using hyperref and natbib, and am trying to generate a website alongside the PDF that is already built. The document was written using autoref references and natbib author-year citations. I am using hevea to generate the HTML version, and am having problems with cross-references. If I use hyperref, hevea encounters these errors, and inline citations and references appear as ??:               ./text.aux:14: Giving up command: \addtokens     ./text.aux:4: Giving up command: \AtBeginDocument     ./text.aux:4: Giving up command: \HyperFirstAtBeginDocument     ./text.tex:15: Giving up command: \input     ./text.tex:15: Giving up command: \@readaux     ./text.tex:15: Warning: Failure while reading .aux, reading .haux      (note that if I use `hevea -fix` or `bibhva` to make an `.haux`, natbib fails in other ways, so I'd like to stick with the `.aux` file.) If I use cleveref and not hyperref, the citaions work, but cross references still have ?? where words like "Figure", "Section," etc. ought to be generated. In either case the PDF compiles fine. I stripped down my document to something minimal, included below, with a Makefile, bibliography and other assets in this Gist.               \documentclass[english]{article}     \usepackage{hevea}     \usepackage{graphicx}     \usepackage[english]{babel}          %use one or the other of these     %\usepackage{hyperref}     %\newcommand{\Xref}[1]{\autoref{#1}}     \usepackage{cleveref}     \newcommand{\Xref}[1]{\Cref{#1}}          \usepackage[authoryear]{natbib}     \usepackage{trouble}          \begin{document}          \section{Introduction}\label{sec:intro}     This document has citations \cite{Ilg:2010vn}, using authoryear style     (\cite{Wertheimer:1912aa}, \cite{Wertheimer:2012aa};     \cite{Steinman:2000ap}). It should also have figure graphics and     internal references using cleveref or hyperref, such as the imminent reference     to \Xref{sec:graphics}.          \section{Section 2}\label{sec:graphics}          \begin{figure}     \includegraphics[height=2in,width=5in]{demo_carenv}     \caption{\label{fig:label} This is a figure, with a label.}     \end{figure}          \Xref{fig:label} has a picture in it, as was described in     \Xref{sec:intro} \cite{De-Valois:1991jt,Ramachandran:1990aa}.          \bibliographystyle{plain}     \bibliography{bib}          \end{document}


title: Free, non-upright, blackboard, Type1 font

text: Is there a free package to get non-upright (i.e. italic or slanted) blackboard symbols in a Type1 font? It's easy to get three of the four properties (i.e. blackboard italic font, http://www.pctex.com/mtpro2.html), but I failed to find a package with all four properties combined. If there is some alternative to blackboard which also looks like a set symbol it would be fine, too.


title: Apparent Instability in REVTeX4 After Adding xpatch Package

text: This is a follow-up question to How can Acrobat features be controlled from within LaTeX? It seems that `xpatch` package makes REVTeX unstable and even appears to turn off some of its features. Thus, instead of making an Acrobat 5 document it makes Acrobat 9 if both are installed. More worrisome, however, is the sudden change of behavior for unknown reasons. I was working with a document and all went just fine but all of a sudden my WinEdt refused to compile it. Numerous errors showed cross-referencing problems. It turned out the culprit is `\affiliation{}`. As soon as I removed it, the problem disappeared. Unfortunately, I cannot demonstrate it in a MWE because it doesn't show up there. What shows up in a MWE is another problem---`\section{}` does not accept `\textbf{}`:               \documentclass[onecolumn,twoside]{revtex4}          \usepackage{xpatch}% http://ctan.org/pkg/xpatch     \makeatletter     \xpatchcmd{\@ssect@ltx}{\@xsect}{\edef\@currentlabelname{#8}\@xsect}{}{}%     Patch \<section>*     \xpatchcmd{\@sect@ltx}{\@xsect}{\edef\@currentlabelname{#8}\@xsect}{}{}% Patch \<section>     \makeatother     \usepackage{hyperref}% http://ctan.org/pkg/hyperref          \hypersetup{pdfstartview=FitH,pdfpagemode=UseNone}          \begin{document}          \title{Title}     \author{Author}     \affiliation{Affiliation}          \maketitle          %\section*{FirstSection--$E \times H$ vs.$\ \textbf{E} \times \textbf{H}$}      \section*{FirstSection}           \label{sec:marker1}     In \nameref{sec:marker2} it is stated that \ldots          \section*{SecondSection} \label{sec:marker2}     You can also see in \nameref{sec:marker1} that \ldots     \end{document}      As you can see, the above example works as long as `\section*{FirstSection--$E \times H$ vs.$\ \textbf{E} \times \textbf{H}$}`, containing `\textbf{}` characters, is remmed out. If you un-rem it and instead rem out `\section*{FirstSection}` the compilation crashes. Do you think I should live with it and have the affiliation follow the author in `\author{}` and instead of `\textbf{Something}` should use `\bf Something \rm` instead or there are radical solutions of this instability, if at all?


title: beamer: How to change border size of beamercolorbox?

text: Is it possible to style a border of a "beamercolorbox"? Like in the theme Szeged, but with ONE thin line above the footer instead of the two thick lines.


title: TikZ: node placement when using draw let in syntax

text: When using the `\draw let ... in` syntax to construct an arc between 2 lines, the arc is placed in the correct location even if the arc's focal point isn't the origin. However, this isn't the case with the node placement. For example, consider this code:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}       \coordinate (F) at (2, 0);            \draw (F) -- ++(30:1cm and 2cm) coordinate (A);       \draw (F) -- ++(100:1cm) coordinate (P3);            \draw let           \p0 = (F),           \p1 = (A),           \p2 = (P3),           \n1 = {atan2(\x1 - \x0, \y1 - \y0)},           \n2 = {atan2(\x2 - \x0, \y2 - \y0)},           \n3 = {1cm},           \n4 = {(\n2 - \n1) / 2}         in (F) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         node[scale = .75, fill = white, inner sep = 0cm] at         (\n4:\n3) {\(\nu_A\)};     \end{tikzpicture}     \end{document}      This produces: ![enter image description here](http://i.stack.imgur.com/ZDKlR.png) If I `xshift = 2` the node, I get: ![enter image description here](http://i.stack.imgur.com/5i2jg.png) I don't understand why the node placement isn't along the arc since I specified the placement at `(\n4:\n3)` which is half the arc angle with the same radius. That is, it should be along the arc equidistant from both lines. If add to the node options `pos = .5`, the node is still not placed where one would anticipate. ![enter image description here](http://i.stack.imgur.com/Jplty.png) What is the correct nodal syntax for this situation with `\draw let .. in`?


title: What would be a suitable replacement for ifcsname in a non-etex situation?

text: From the `pgfkeys.code.tex` file:               % This is useful:          \def\pgfkeys@ifcsname#1\endcsname#2\else#3\fi{\expandafter\ifx\csname#1\endcsnam     e\relax#3\else#2\fi}%     \ifx\eTeXrevision\undefined%     \else%       \expandafter\let\expandafter\pgfkeys@ifcsname\csname ifcsname\endcsname%     \fi      The command `\pgfkeys@ifcsname` is used internally to check if a key exists. If `etex` is present, it is simply `\ifcsname`. If not, then it is a fallback which (in the cases where it is used) is deemed good enough. However, it doesn't work well with nested conditionals. It is sometimes used via another command:               \long\def\pgfkeysifdefined#1#2#3{\pgfkeys@ifcsname pgfk@#1\endcsname#2\else#3\fi}      The problem here is that if `#2` or `#3` contains another conditional then because `\pgfkeys@ifcsname` uses macro parameter matching instead of conditional matching, then an `\else` or `\fi` inside `#2` or `#3` can get matched instead of the given ones. Adding braces wouldn't work since that would add an extra set of braces. Now, I intend reporting this on the PGF bug list, but thought I'd have a go at coming up with a replacement first. I thought of:               \def\pgfkeys@ifcsname#1\endcsname{\ifx\csname#1\endcsname\relax\expandafter\iffalse\else\expandafter\iftrue\fi}      So my question: does this suffer from any more problems that the original didn't already suffer from? (So the fact that `\csname undefinedcommand\endcsname` makes `\undefinedcommand` into `\relax` is not an objection to the new definition as it already exists in the original one.)


title: Is there a good replacement for stmaryrd?

text: I am getting various warnings because of St. Mary Rd. fonts (stmaryrd) which I get around using tricks like this and anyfontsize. Is there a good replacement for St. Mary Rd. (like Latin Modern fonts in place of Computer Modern fonts) that I can use with pdfLaTeX?


title: How to draw an arrow in the middle of the line of a circle and how to position the arrow?

text: my problem ist related to TikZ: How to draw an arrow in the middle of the line?: My Example: I like to have two circles - I want to position the arrow of circle no. 1 at south.south west of circle no. 1 and the arrow of circle no. 2 at north.north east of circle no. 2. My personal "Hack":                    \usetikzlibrary{decorations.markings}     \usetikzlibrary{arrows}     \usetikzlibrary{through}     \usetikzlibrary{automata,backgrounds}     \begin{tikzpicture}[node distance=2cm]     \begin{scope}[every node/.style={sloped,allow upside down,circle,       fill=black,inner sep=2pt}]     \node[draw,fill=white,inner sep=10pt, xshift=-0.49cm] (loop) {};     \node (n1){} ;     \node[draw,fill=white,inner sep=10pt,right of=n1,xshift=0.49cm] (loop2) {};     \node (n2) [right of=n1] {};     \end{scope}     \draw (loop)-- node {\midarrowcirc} (loop);     \draw (n1)-- node {\midarrow} (n2);     \draw (loop2)-- node {\midarrowcirc} (loop2);     \end{tikzpicture}           Unfortunately I am not able to position the arrows. Thank you for any help! P.S. Sorry, maybe to much librarys - it is based to my trials ...


title: Align multiline RHS

text: I have the following MWE:               \documentclass{report}     \usepackage{amsmath}     \begin{document}     \begin{align}         L_W&=\frac{L}{W}    & \text{words per line}&=\frac{\text{bytes per line}}{\text{bytes per word}} \\         s&=\frac{l}{s}      & \text{number of sets}&=\frac{\text{number of lines}}{\text{associativity}} \\         a_{off}&=ld_2(w)    & \text{address offset bits}&=ld_2(\text{words per line}) \\         a_{s}&=ld_2(s)      & \text{address set bits}&=ld_2(\text{number of sets}) \\         t&=a_b-a_s-a_{off}  & \text{address tag bit}&=\begin{aligned}          &\text{address bits} \\             -&\text{address set bits}\\             -&\text{address offset bits}         \end{aligned}     \end{align}     \end{document}      The output, with what I would like to change highlighted is this: ![mwe plus highlight](http://i.stack.imgur.com/bGbA8.png)   1. I would like to move the RHS of the second equation in row (5), so that address bits aligns with `=` and the equation number. http://tex.stackexchange.com/a/44451/19326 comes close but the equation number is centered. (http://tex.stackexchange.com/a/105639/19326 comes close as well but here I can't see how to handle the equation number and alignment of the formulas in the first column). Note that I want to align by the variable name and not by the sign. especially note the gap left between the equals sign and the first variable, so that the signs of the rows below wont vertically overlap with the equals sign)   2. I would like to add equal spacing, I tried: http://tex.stackexchange.com/a/9151/19326 (by adding `\savebox\strutbox{$\vphantom{\frac{\text{bytes per line}}{\text{bytes per wordi}}\frac{L}{W}}$}`) but this still seams to give different spacing. (see between 3/4 with the addition) (currently not included since I am afraid that this will extend the entire enviornment downwards.


title: TikZ: drawing 3 intersecting circles and shading

text: How can I draw the three intersection circles/ellipse with that shading paradigm (not necessarily the same colors) effectively? It appears that the original image doesn't have overlapping colors whereas I do.   1. Is there a better way to construct the drawing of the circles/ellipse than what I have done?   2. How can I make this a precise rotation for alignment with the equatorial   and ecliptic plane with the x axis ray?   3. How can I clip the circle at the origin out the all the `filldraw`s so the blue sphere isn't over come by the background colors in it?    4. Also, how can I create the curve arrows to the point? I know I can use `controls`, but my control curves never look close to that. ![enter image description here](http://i.stack.imgur.com/yZPSS.png) When adding in the axis, I had to fiddle with the angle of ecliptic plane in order for the equatorial and the ecliptic plane to intersect at the x axis. However, this cant be precise just close. Here is what I have now. The clips are really sloppy but I couldn't figure out a way to clip the area concisely.               \documentclass[convert = false, tikz]{standalone}     \usepackage[utf8]{inputenc}     \renewcommand{\rmdefault}{ppl}     \linespread{1.05}     \usepackage[scaled]{helvet}     \usepackage{courier}     \usepackage{eulervm}     \normalfont     \usepackage[T1]{fontenc}     \usepackage{textcomp}          \usepackage{amsmath}     \usepackage{tikz-3dplot}     \usetikzlibrary{intersections}     \tikzset{       partial ellipse/.style args = {#1:#2:#3}{         insert path = {+ (#1:#2) arc (#1:#2:#3)}       }     }     \begin{document}     \tdplotsetmaincoords{60}{130}     \begin{tikzpicture}[tdplot_main_coords,       every lable/.append style = {font = \tiny},       dot/.style = {outer sep = 0, inner sep = 0,         shape = circle, label = {#1}},       dot/.default =,       small dot/.style = {minimum size = .1cm, dot = {#1}},       small dot/.default =,        big dot/.style = {minimum size = .15cm, dot = {#1}},       big dot/.default =       ]       \coordinate (O) at (0, 0);            \def\rad{5cm}       \def\moonangle{45}       \def\sunangle{13.7}            \draw[-latex] (O) -- (6.5, 0, 0) node[font = \scriptsize, pos = 1.1]       {\(x(\gamma)\)};       \draw[-latex] (O) -- (0, 6, 0) node[font = \scriptsize, pos = 1.05] {\(y\)};       \draw[-latex] (O) -- (0, 0, 6.5) node[font = \scriptsize, above] {\(z\)};            \draw (O) circle[radius = \rad];       \draw[name path = arc] (90:\rad) arc[x radius = 3cm, y radius = \rad,       start angle = 90, end angle = 270];       \draw[name path = equa] (O) ellipse[x radius = \rad, y radius = 1.675cm];       \draw[rotate = {\moonangle}, name path = moon] (O) ellipse[x radius = \rad,       y radius = 2.25cm];       \draw[rotate = {\sunangle}, name path = eclip] (O) ellipse[x radius = \rad,       y radius = 1cm];            \node[coordinate, name intersections = {of = moon and equa}] (P1) at       ($(intersection-1)$) {};       \node[coordinate, name intersections = {of = moon and equa}] (P2) at       ($(intersection-4)$) {};       \node[coordinate, name intersections = {of = moon and eclip}] (P3) at       ($(intersection-4)$) {};       \node[coordinate, name intersections = {of = equa and eclip}] (P4) at       ($(intersection-4)$) {};            \draw (P1) -- (P2);       \draw (O) -- (P3);            \begin{scope}         \begin{pgfinterruptboundingbox}           \clip (P1) -- ($(P1) + (3, -8)$) -- ($(P1) + (50, 20)$) --           (P2) -- cycle;         \end{pgfinterruptboundingbox}              \filldraw[green, opacity = .3, rotate = {\moonangle}] (O)         ellipse[x radius = \rad, y radius = 2.25cm];         \filldraw[yellow, opacity = .3, rotate = {\sunangle}] (O)         ellipse[x radius = \rad, y radius = 1cm];         \filldraw[blue, opacity = .3] (O) ellipse[x radius = \rad,         y radius = 1.675cm];       \end{scope}            \begin{scope}         \begin{pgfinterruptboundingbox}           \clip (P1) -- ($(P1) + (-20, -5)$) -- ($(P1) + (20, 40)$) -- (P2) --           cycle;         \end{pgfinterruptboundingbox}              \filldraw[blue, opacity = .3] (O) ellipse[x radius = \rad,         y radius = 1.675cm];         \filldraw[yellow, opacity = .3, rotate = {\sunangle}] (O)         ellipse[x radius = \rad, y radius = 1cm];         \filldraw[green, opacity = .3, rotate = {\moonangle}] (O)         ellipse[x radius = \rad, y radius = 2.25cm];       \end{scope}            \begin{scope}         \begin{pgfinterruptboundingbox}           \clip (O) -- (P4) -- +(1, 1) -- (P3) -- cycle;         \end{pgfinterruptboundingbox}              \filldraw[yellow, opacity = .3, rotate = {\sunangle}] (O)         ellipse[x radius = \rad, y radius = 1cm];       \end{scope}            \filldraw[blue, opacity = .3] (O) circle[radius = .5cm];            \draw (180:.5cm) arc[x radius = .5cm, y radius = .25cm, start angle = 180,       end angle = 360];            \path[name path = greenwhich] (O) -- (128.5212:\rad);       \path[name path = moonrot] (O) -- (35:\rad);       \path[name path = sun] (O) -- (9:\rad);       \path[name intersections = {of = arc and greenwhich, by = P5}];       \path[name intersections = {of = moon and moonrot, by = P6}];       \path[name intersections = {of = sun and eclip, by = P7}];            \draw[-latex, blue, shorten <= .3cm, shorten >= .05cm] (O) -- (P5);            \node[fill = black, small dot = {right: }] at (P5) {};            \draw[-latex, purple, shorten <= .3cm, shorten >= .05cm] (O) -- (P6);            \node[fill = black, small dot = {right: }] at (P6) {};            \draw[-latex, red, shorten <= .3cm, shorten >= .05cm] (O) -- (P7);            \node[fill = orange, draw = orange, small dot = {right: }] at (P7) {};       \node[coordinate, name intersections = {of = arc and equa}, fill = black,       small dot = {left: }] (P8) at ($(intersection-2)$) {};            \draw[-latex] (226:4.75cm and 1.55cm) arc[x radius = 4.75cm,       y radius = 1.55cm, start angle = 226, end angle = 242];       \draw[rotate = {\moonangle}, -latex] (332:4.75cm and 2cm)       arc[x radius = 4.75cm, y radius = 2cm, start angle = 332, end angle = 348];       \draw[rotate = {\sunangle}, -latex] (327:5.25cm and 1.25cm)       arc[x radius = 5.25cm, y radius = 1.25cm, start angle = 327, end angle = 345];     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/W69YE.png) * * * We can see the intersection looks good, but unless I am extremely luckily, it isn't precise. ![enter image description here](http://i.stack.imgur.com/e6aqL.png)


title: Alignment with multicolumn in table

text: I'm trying to get three centred columns, evenly spaced under the (rather long) column heading (...). Can anyone help? Thanks!                   \begin{table}[!]         \centering         \begin{tabular}{ c c c | c c c |c c  c  }          $Z$ &  &$\Delta z$ [cm] & \multicolumn{3}{c}{$\langle dE/dX \rangle$ [MeV     g$^{-1}$cm$^{2}$]} &  \multicolumn{3}{|c}{$\Delta E$~[MeV]} \\         \hline         1 & LH$_{2}$ & $35$ & 5.10   &4.39  & 4.21 & 12.63 & 10.86 & 10.42   \\          \hline         & & $p_z$~[MeV/c] & 140 & 200 & 240 & 140 & 200 & 240\\         \hline     \hline     \end{tabular}     \label{tab:Targets}     \end{table}


title: Can someone explain what is the 'extended mode'?

text: During latex compilation with pdflatex+shellescape, the compiler enters: _This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) entering extended mode_ And stays there for a while, before starting building the pdf output.   * What is it running during that step?   * And is there a way to speed up the process?


title: Command for fontsize-dependent code selection

text: I have heard of a LaTeX-command which provides font-dependent code selection in math mode, but I forgot the name of it and cannot find it – Here is what I mean:               \unknownCommand{display size code}{text size code}{script size code}{scriptscript size code}      so that one could write               $\unknownCommand{...}$ % => outputs "display size code"     $e^{\unknownCommand{...}}$ % => outputs "script size code"      Do you know what command it is?


title: External PDF from pgfplots contains several pages when with floatrow

text: Plotting with pgfplots and the external library creates the single PDFs for every plot as wanted. But every of those PDFs contains several pages, each showing the same plot. Sometimes there are three pages, sometimes much more. I couldn't figure out, what triggers the amount of pages. Since only the first page is included into the master document, I get correct results. But I guess the compilation slows down quite a bit, because all equal pages have to be created individually. When I compare compilation with and without the external library I experience a much longer time with it. Does it behave equally for you? What could be done about it? Edit: Minimal example. It seems the floatrow package is the problem here... In this case two files are generated. If you uncomment the \tikzsetnextfilename{testplot} you get only one file but with two pages in it.               \documentclass{standalone}          \usepackage{floatrow}          \usepackage{pgfplots}     \usepgfplotslibrary{external}     \tikzexternalize[mode=list and make]     \tikzset{external/system call={lualatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}               \begin{document}          Testplot:          %\tikzsetnextfilename{testplot}     \ffigbox         {}         {\begin{tikzpicture}         \begin{axis}[]         \addplot {sin(x)};         \end{axis}         \end{tikzpicture}}     \end{document}      Edit 2: The log file reports as well that the drawing is done twice...               Opening 'test.figlist' for writing.     Opening 'test.makefile' for writing.     \tikzexternal@outmakefile=\write5     Writing 'test-figure0' to 'test.figlist'.     Writing 'test-figure0' to 'test.makefile'.     Writing 'test-figure1' to 'test.figlist'.     Writing 'test-figure1' to 'test.makefile'.      Edit 3: When including a simple PDF image instaed of the tikzpicture, the log also tells two calls...               <test-figure0.pdf, id=4, 248.42511pt x 179.13223pt>     File: test-figure0.pdf Graphic file (type pdf)      <use test-figure0.pdf>     Package pdftex.def Info: test-figure0.pdf used on input line 25.     (pdftex.def)             Requested size: 248.42448pt x 179.13177pt.     File: test-figure0.pdf Graphic file (type pdf)     <use test-figure0.pdf>     Package pdftex.def Info: test-figure0.pdf used on input line 25.     (pdftex.def)             Requested size: 248.42448pt x 179.13177pt.


title: Add a eps picture

text: Recently,I want to add a picture: My code               \documentclass{article}     \usepackage{amsmath}     \usepackage{graphicx}     \begin{document}     \[            \begin{bmatrix}             a_{11} & b_{12} & \cdots & a_{1n} \\             a_{21} & b_{22} & \cdots & a_{2n} \\             \vdots & \ddots & \vdots & \ddots & \vdots\\             a_{i1} & b_{i2} & \cdots & a_{in} \\             \vdots & \ddots & \vdots & \ddots & \vdots\\             b_{n1} & a_{n2} & \cdots & b_{ns}             \end{bmatrix}      \begin{bmatrix}         b_{1}  \\         b_{2} \\         \vdots \\         b_{i} \\         \vdots \\         b_{n}      \end{bmatrix}     =     \begin{bmatrix}         c_{1}  \\         c_{2} \\         \vdots \\         c_{i} \\         \vdots \\         c_{n}         \end{bmatrix}       \]          \[     \begin{bmatrix}     a_{11} & a_{12} & a_{31} \\      a_{21} & a_{22} & a_{32} \\      a_{31} & a_{32} & a_{33} \\      a_{42} & a_{42} & a_{43}     \end{bmatrix}      \]          \includegraphics{pic.eps}          \end{document}      However, it shows `! LaTeX Error: Unknown graphics extension: .eps.` So my question is how to revise it?


title: how to import images into Memoir chapter style

text: Another Memoir style I'm trying to create... I grabbed bits of code from here and there and I almost have it working, but the imported image isn't centered over the chapter title... spent many hours on this before coming to you...I'm trying! I would appreciate if someone could fix it and suggest any clean up to any blunders I've made.. Also, I would like to suppress all chapter numbers in the document (but keep them in the toc) is there a good way to do that, or do I just need to use the asterisk. in brief... what I'm trying to do is get an image over centered text with some numbers in there that I can tweak to adjust the v spacing between the image and title and between the title and the first paragraph.               \makechapterstyle{test1}{%       \chapterstyle{default}       \chapterstyle{article}%       \renewcommand*{\printchapternonum}{%     %    \vphantom{\printchaptername \chapnumfont 1}         \afterchapternum        }      \renewcommand*{\afterchapternum}{%        \vspace*{\beforechapskip}        \smash{%           \raisebox{0cm}{%            \includegraphics[width=2in]{chantheader.jpg}}}              \aliaspagestyle{chapter}{headings}      }%     }


title: Can't get rid of blank page at beginning of document

text: I want to assemble some application documents into a single pdf-file using TeX. Each single document file originally was in `DinA4`. I scanned them and have them as pictures now. To assemble all individual files so that they fill the whole page I found this nice package written by Jochen. After having saved this package as `fullpagegraphic.sty` I do the following:               \documentclass[a4paper]{scrreprt}     \usepackage[english]{babel}     \usepackage{graphicx}     \usepackage{fullpagegraphic}     \begin{document}     \includegraphicsfullpage{document1}     \includegraphicsfullpage{document2}     \end{document}      I end up with two problems:   1. The first page is always blank.   2. On the second page, there is the number 2 in the lower left area. This appears only on the second page and not on the first or third etc. Does any know how to get rid of the blank page and the number 2 on the second page? Changing the document class does not help.


title: Scaling down all the equations using one single command?

text: I am about to submit an article with lots of equations in there (defined in both equation and align environments and I also have lots of inline math of course). There is a maximum page limit for the article and mine is quite above it. So, what I need to do is to scaling down all the equations to say 85% using minimum effort and edits to the text. Please note that I do not want inline math expressions to be affected by that macro, so that the text looks coherent at the end. Just wondering if a macro can be defined at the document preamble to do that for me?


title: Make ltxdoc class use report as underlying class

text: The `ltxdoc` class, designed for documenting LaTeX source files, is based on the `article` class. Beyond a certain threshold, the documentation may need to be divided in chapters and another class, e.g. the `report` one, would be more appropriate. Hence my question: is there a way to document LaTeX source files using the `ltxdoc` class but with `report` as underlying class? Or is the best way to build the documentation in a separate document where the class can be chosen?


title: Using \vtop affects indentation of \intertext

text: I am using the `\iteminput` macro from the solution at How to adjust macro to respect current \linewidth? to import content from other TeX files. However, this appears to be effecting the indentation of text from `\intertext{}`. The red text below is where the problem is. When using the normal `\input` things work great and the text is left aligned as desired, as shown in (a). However, when using the `\iteminput` macro the `\intertext` is shifted to the right, as shown in (b): ![enter image description here](http://i.stack.imgur.com/jcOWW.png) I found out that if I remove the `\vtop{}` from the `\iteminput` macro, I get the desired behavior. But since this is from an _egreg_ solution, I am reluctant to do that without knowing if that will result in some other problem. ## References:   * How to adjust macro to respect current \linewidth?   * Top-aligning imported graphics ## Code:               \documentclass{article}     \usepackage{showframe}     \usepackage{xcolor}% to highlight the problem area in the output     \usepackage[fleqn]{amsmath}     \usepackage{enumitem}     \usepackage{filecontents}          \begin{filecontents*}{foo.tex}         Two well known equations are:         \begin{alignat*}{3}             E & = mc^2 \\             \intertext{\textcolor{red}{and}}             F &= ma         \end{alignat*}     \end{filecontents*}               \newcommand{\MyInput}[1]{%           \begingroup%           The grouping here is not currently causing a problem.             \input{#1}%        But do need grouping here (for a unrelated reason).         \endgroup%                  }%          % http://tex.stackexchange.com/questions/18247/how-to-adjust-macro-to-respect-current-linewidth/     \newcommand{\iteminput}[2][\topskip-1bp]{%         \leavevmode%         \vtop{%  Removing this fixs the problem.             \hsize=\noexpand\linewidth\hrule height 0pt\kern-\dimexpr#1\relax%             \MyInput{#2}%         }%     }%          \begin{document}     \begin{enumerate}[label={(\alph*)}]         \item \input{foo}            % This works great         \item \iteminput[2.5ex]{foo} % This shifts "and" to right!!     \end{enumerate}     \end{document}


title: I'm trying to redefine the plain pagestyle as empty

text: I tried to use this command, but doesn't work.               \makeatletter         \let\ps@plain\ps@empty     \makeatother      I put it in the beginning, in the middle and just before the `\begin{document}`.


title: How can I automatically identify certain boxes in the \tracingoutput log?

text: I have a program that is automatically generating a tex file describing a document. I want to be able to record the position and page number where a few boxes were ultimately laid out. Is there any simple way to match up parts of the document with the matching part of the log file created by `\tracingoutput`? For example, is it possible to name boxes somehow and have those names show up in the log?


title: MiKTeX: connect failed in tcp_connect

text: I already read these threads: 1, 2, 3 and 4 which address the connection error `connect failed in tcp_connect()`. I found out that the address I can't connect to is 178.77.68.21 but there is nothing `ftp://178.77.68.21` and `http://178.77.68.21`. It would even be helpful if someone could validate that this process works for him _right now_. Which file do I need to change to force a repository change to something like CTAN. This is a clean fresh installation (but reinstalling seems to have helped this guy at least temporarily). Also I do not have any other problems with my internet connection on any port. I have no firewall. And get the following: ![Installation dialog comes up](http://i.stack.imgur.com/hVLK6.png) ![Installation failed](http://i.stack.imgur.com/o1Tmg.png) ![Synchronize failed](http://i.stack.imgur.com/SWjdP.png) ![Repo change failed](http://i.stack.imgur.com/I4gfF.png) # Update1 Obviously this issue can't be generalized some of us suffer sometimes from it and have to deal with it while generating specific solutions. When I solved this problem I will post (in detail) what was the cause and the fix to it. # Update2 The solution is that MikTex won't use the systems default proxy settings. It always assumes that there is no proxy. On Windows use the console `cmd.exe` and type `ipconfig /all` and `proxycfg -u` to find all necessary information about your NICs. The line `Proxyserver` from proxycfg command will tell you what to enter here: ![enter image description here](http://i.stack.imgur.com/L2Ick.png) Yes, I am behind a proxy on this machine and didn't take this into account...


title: Per-subsection figure numbering

text: I want to have per-subsection figure numbering in the appendix of the following MWE: it should read "Figure A.1" instead of "Figure 2".               \documentclass{article}          \usepackage{amsmath}       \numberwithin{equation}{section}          \usepackage[demo]{graphicx}        \usepackage{caption}     \captionsetup[figure]{figurewithin=section}          \newcommand*{\appheading}[1][Appendix]{%       \setcounter{secnumdepth}{0}\section{#1}\setcounter{secnumdepth}{3}%       \renewcommand*{\thesubsection}{\Alph{subsection}}       \numberwithin{equation}{subsection}       }          \begin{document}          \section{Foo}           \begin{equation}       x = 4     \end{equation}          \begin{figure}[htbp!]       \centering       \includegraphics{foo}       \caption{Fooo}     \end{figure}          \appheading     \appendix     \subsection{Baz}          \begin{equation}       y = 3     \end{equation}          \begin{figure}[htbp!]       \centering       \includegraphics{baz}       \caption{Baz}     \end{figure}          \end{document}      I tried changing the `thefigure` counter and also using the `chngcntr` package but couldn't make it work.


title: Z-Order of plots pgfplots

text: Simple question: I can’t seem to control the z-order (i.e. which comes in front, which comes in the back) of the plots in a 2D axis. MWE:               \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}       \begin{axis}         \addplot+[only marks] table {           0 2           1 1           2 2         };         \addplot+[mark=none, line width=2pt] table {           0 2           1 1           2 2         };       \end{axis}     \end{tikzpicture}     \end{document}      Obligatory screenshot: ![screenshot](http://i.stack.imgur.com/6ST1Z.png) The problem here is that the first plot, `only marks` _always_ comes in front of the other plot. If I reverse the order of the respective `\addplot` commands then the colours and marks are switched but _not_ the order of the plots. That is, the `only marks` are still in front of the line. How can I change this? (Yes, I need two separate plots here since the line will actually be a regression curve that uses different data but there is a huge overlap and the curve is barely visible below the point cloud).


title: List of figures with sources

text: What is the best way to place the source of images in my document? I have some images and they are shown in the `\listoffigures` like expected, but how can/should I point out where they come from? Should I just add the source to the bibliography and just use the `\cite{...}` in the `\caption` of my figure?


title: Apply gradient (shading) background to algorithm listing

text: ## Background A number of source files are included within floating algorithm boxes. The source files are PNG images with a transparent background. The document is edited using LyX. ## Problem The source code listings (algorithms) are applied to the document as follows:               % Change the background colour of algorithm boxes.     \let\oldalgorithm\algorithm     \let\endoldalgorithm\endalgorithm     \renewenvironment{algorithm}[1][htbp]{       \let\graphicsformat\justifiedandcolored       \oldalgorithm[#1]     }%       {\endoldalgorithm}          % Change the background colour of the algorithm floats.     \def\justifiedandcolored#1{%       \setlength\fboxrule{0pt}%       \setlength\fboxsep{0pt}%       \kern-1.35pt       \colorbox{sourcecolour}{%         \hbox to\linewidth{#1}%       }%       \par       \kern-1.5pt     }      I would like to change the `colorbox` to a gradient (rather than a solid colour), using the `pst-grad` package or perhaps the `tikz` package. All the examples I could find for `pst-grad` show how to apply a gradient to a box with known dimensions. In this situation, the width and height are unknown. The dimensions depend on:   1. The resolution of the image.   2. The scaling of the image (large images are scaled down to the page margins). ## Example Here is a small source document:               % Preview source code          %% LyX 1.6.7 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[letterpaper,oneside,english,twoside,pointlessnumbers,obeyspaces,plainpages=false,pdfpagelabels ]{scrbook}     \usepackage{lmodern}     \usepackage{helvet}     \usepackage{courier}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \usepackage{babel}          \usepackage{pifont}     \usepackage{float}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{amssymb}     \usepackage[unicode=true, pdfusetitle,      bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,      breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]      {hyperref}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     \special{papersize=\the\paperwidth,\the\paperheight}          %% A simple dot to overcome graphicx limitations     \newcommand{\lyxdot}{.}          \floatstyle{ruled}     \newfloat{algorithm}{tbp}{loa}[chapter]     \floatname{algorithm}{Algorithm}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \input{example-preamble.tex}          \AtBeginDocument{       \def\labelitemi{\ding{233}}       \def\labelitemii{\ding{219}}       \def\labelitemiii{\normalfont\bfseries{--}}     }          \makeatother          \begin{document}     \input{chapter.tex}               \chapter{Chapter}          %     \begin{algorithm}[H]     \includegraphics{source/sql/beautify-after\lyxdot sql}          \caption{\label{alg:After-Beautification}After Beautification}          \end{algorithm}          \end{document}      Here is the example-preamble.tex:               \usepackage{algorithm}     \usepackage{caption}     \usepackage{float}     \usepackage{graphicx}     \usepackage[T1]{fontenc}     \usepackage{mathptmx}     \usepackage[automark,nouppercase]{scrpage2}     \usepackage[dvipsnames,svgnames,x11names,table]{xcolor}          % Use a hyphen for captions, and make links give a bit of space.     \captionsetup{hypcapspace=0.5\baselineskip}     \captionsetup{labelfont=bf,labelsep=endash}     \captionsetup[ruled]{labelfont=bf,labelsep=endash}          % Change algorithm to "Listing".     \floatname{algorithm}{Listing}     \newcommand{\algorithmname}{Listing}          % Colour definitions.     \input{colours.tex}          % Determine if the image is too wide for the page.     \makeatletter     \def\ScaleIfNeeded{%       \ifdim\Gin@nat@width>\linewidth         \linewidth       \else         \Gin@nat@width       \fi     }     \makeatother          % Resize figures that are too wide for the page.     \let\oldincludegraphics\includegraphics     \renewcommand\includegraphics[2][]{%       \graphicsformat{%         \oldincludegraphics[width=\ScaleIfNeeded]{#2}%       }%     }          % Centre graphics within non-Algorithm floats.     \let\graphicsformat\centering          % Change the background colour of algorithm boxes.     \let\oldalgorithm\algorithm     \let\endoldalgorithm\endalgorithm     \renewenvironment{algorithm}[1][htbp]{       \let\graphicsformat\justifiedandcolored       \oldalgorithm[#1]     }%       {\endoldalgorithm}          % Change the background colour of the algorithm floats.     \def\justifiedandcolored#1{%       \setlength\fboxrule{0pt}%       \setlength\fboxsep{0pt}%       \kern-1.35pt       \colorbox{sourcecolour}{%         \hbox to\linewidth{#1}%       }%       \par       \kern-1.5pt     }          % Required by LyX...     \makeatletter      Example image: ![enter image description here](http://i.stack.imgur.com/EhdCa.png) Example PDF: ![enter image description here](http://i.stack.imgur.com/MueEu.png) ## Question What is the best way to replace `colorbox` with a gradient? ## Ideas One idea I had was to use ImageMagick on the image and add a gradient that way. If I decide to change the gradient colours, I'd have to regenerate dozens of source files. This solution would work, but is not ideal. Thank you!


title: List environment inside the tabular environment: extra line at top preventing alignment

text: I have a LaTeX question that is bugging me. I have been trying to get a list environment to appear correctly inside the tabular environment. So far I have gotten everything to my liking except one thing: the top of the list does not align with other entries in the table, in fact it looks like it adds one line above the list... I would like to have these lists at the top. This is what I have, a custom list environment:                 \newenvironment{flushemize}{         \begin{list}{$\bullet$}         {\setlength{\itemsep}{1pt}           \setlength{\parskip}{0pt}           \setlength{\parsep}{0pt}           \setlength{\partopsep}{0pt}           \setlength{\topsep}{0pt}           \setlength{\leftmargin}{12pt}}}{\end{list}}      Renamed ragged right:               \newcommand{\rr}{\raggedright}      and here is my table:               \begin{table}[H]\caption{Tank comparisons}\label{tab:tanks}         \centering         \rowcolors{2}{white}{tableShade}              \begin{tabular}{p{1in}p{1.5in}p{1.5in}rr}              \toprule              {\bf Material} & {\bf Pros} & {\bf Cons} & {\bf Size} & {\bf Cost} \\              \midrule              \rr Reinforced concrete &\rr  \begin{flushemize}\item Strong \item Secure \end{flushemize}&\rr  \begin{flushemize}\item Prone to leaks \item Relatively expensive to install \item Heavy \end{flushemize} & 100,000 gal & \$299,400  \\              \rr Steel & \begin{flushemize}\item Strong \item Secure \end{flushemize} & \begin{flushemize}\item Relatively expensive to install \item Heavy \item Require painting to prevent rusting \end{flushemize} & 100,000 gal & \$130,100  \\              \rr Polypropylene & \begin{flushemize}\item Easy to install \item Mobile \item Inexpensive \item Prefabricated \end{flushemize} & \begin{flushemize}\item Relatively insecure \item Max size available 10,000 gal \end{flushemize} & 10,000 gal & \$5,000  \\              \rr Wood & \begin{flushemize}\item Easy to install \item Mobile \item Cheap to install \end{flushemize} & \begin{flushemize}\item Prone to rot \item Must remain full once constructed \end{flushemize} & 100,000 gal &  \$86,300\\              \bottomrule              \end{tabular}     \end{table}      Thank you for any advice :)


title: Close a cycle in a TikZ graph with a loop

text: Consider the following simple flow diagram. I like using the graph drawing library in TikZ for its simplicity and semantics:               \documentclass{standalone}          \usepackage{tikz}         \usetikzlibrary{graphdrawing}         \usegdlibrary{trees}          \begin{document}              \tikz[>=latex]             \graph[                 tree layout,                 node pre sep = 0.2em,                 grow=right,                 },             ]             {                 A -> B -> C -> D -> E -> (A.south)             };          \end{document}      This code connects an arrow from `E.west` to `A.south` that crosses the other nodes. How can I create a loop that leaves `E.south` or `E.east` and then goes downwards to enter `A.south` or maybe `A.west` in the end again?


title: How to restrict tables under same section

text: I have a problem in managing tables in LyX. Problem is that I need tables under the same section, but I could not. Can anybody help me in this regard?


title: What is MiKTeX Cairo? How about MikTeX Graphite2?

text: I am finally updating my MiKTeX installation, and I noticed that the wizard wants to install something called miktex-cairo-.... miktex-graphite2-... What are they?


title: Customize \chaptermark for \mainmatter

text: Hey guys it's me again, I tried to add `\leftmark` to my header, but I want to change it from `Chapter 1. Introduction` to `1 Introduction`. My MWE:               \documentclass[12pt, oneside, a4paper]{book}     \usepackage{titlesec}     \titleformat{\chapter}{\huge\bfseries}{\thechapter}{20pt}{\huge}     \usepackage{fancyhdr}     \fancypagestyle{plain}     {         \fancyhf{}         \fancyhead[L]{\rightmark}         \fancyfoot[R]{\thepage}         \renewcommand{\headrulewidth}{0.5pt}         \renewcommand{\footrulewidth}{0pt}     }          \begin{document}         \frontmatter             \tableofcontents         \mainmatter             \chapter{Introduction}             \chapter{Blablabla}     \end{document}      I googled a lot a found `\renewcommand{\chaptermark}[1]{\markboth{#1}{}}` and other variations and inserted it at different places of the preamble, but it doesn't work. Am I missing something important again? Guess so, but I couldn't point it out.


title: gauss curves inside minipage and node

text: I am really new to Latex and this has been my place of reference for the last weeks, so I wanted to ask you about a really weird thing that I have no clue how to solve... Following this thread: Plotting bell shaped curve in TikZ-PGF I am trying to include Normal distributions inside a minipage and node, but strangely, while the distributions outside the minipage look correct, inside it they sort of lose resolution... I am including a working example below. I would really appreciate your help. Thanks a lot in advance!               \documentclass[ignorenonframetext, xcolor={dvipsnames,table}]{beamer}     \mode<presentation> {     \usetheme{Berkeley}     \usecolortheme{dolphin}          \usepackage{tikz} %for transparency     \usetikzlibrary{positioning,shadows,calc}     \usepackage{pgfplots}     \pgfmathdeclarefunction{gauss}{2}{%         \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%     }     }               \begin{document}          \begin{frame}     \begin{center}     \begin{tikzpicture} %these distributions look flawless, but I don't want to picture them         \begin{axis}[         no markers, domain=0:10, samples=100, smooth,         axis lines*=left,         height=3cm, width=5cm,         xtick=\empty, ytick=\empty,         enlargelimits=upper, clip=false,         grid=major]         \addplot [cyan!50!black] {gauss(4,0.5)};         \addplot [thick,cyan!50!black] {gauss(6,1)};         \end{axis}     \end{tikzpicture}          \begin{minipage}{\textwidth}         \begin{tikzpicture}             \node[text width=.985\textwidth,             draw=green!70!black,             line width=3pt,             inner sep=7.5pt,             rounded corners,             outer sep=0pt] at (0,0) {                 \small{\textcolor{green!70!black}{Tissue-specific expression\\}}                 \begin{tikzpicture} %these distributions look really distorted, and are the ones I want to include, inside the minipage                     \begin{axis}[                     no markers, domain=0:10, samples=100, smooth,                     axis lines*=left,                     height=3cm, width=5cm,                     xtick=\empty, ytick=\empty,                     enlargelimits=upper, clip=false,                     grid=major]                     \addplot [cyan!50!black] {gauss(4,0.5)};                     \addplot [thick,cyan!50!black] {gauss(6,1)};                     \end{axis}                 \end{tikzpicture}             };         \end{tikzpicture}     \end{minipage}     \begin{minipage}{\textwidth}         \begin{tikzpicture}             \node[text width=.985\textwidth,             draw=pink,             line width=3pt,             inner sep=7.5pt,             rounded corners,             outer sep=0pt] at (0,0) {             \small{\textcolor{pink}{Ubiquitous expression}}                       };         \end{tikzpicture}     \end{minipage}     \end{center}     \end{frame}               \end{document}


title: Biblatex: use doi only if there is no URL

text: Is there a way to insert a `doi` of an entry only in case it is missing a `URL` field? It happens a lot that the `doi` and `URL` are essentially the same, and inserting them both yields a redundancy. I am using `biblatex` with `biber`. PS: If you think this goal doesn't make sense please share your thoughts!


title: save optional parameter of command

text: I want to have a command that by default uses a default string and if supplied the optional parameter. I tried it using let, but that gives strange results               \documentclass{minimal}          \newcommand{\standardstring}{standard}     \newcommand{\printresult}[1][\standardstring]{%         \let\printstring#1         \printstring     }          \begin{document}        \printresult          \printresult[abc]     \end{document}      This results in               standard     bc a


title: Centering numbered equations

text: I am writing a document using the BioMed Central style. I have to insert some equations, which I would like to number. For example I wrote:               \begin{equation}     \hat{a} = aV_kV_k^T     \end{equation}      but I got this result: ![enter image description here](http://i.stack.imgur.com/6K7ky.jpg) The math part is on the left-side. How can I center it?