title: AUCTeX: global pdf mode stop working after typesetting error occurs

text: Update: I've tested the problem in detail, and the results are appended at the end of the question. I guess now the problem becomes: **How to avoid stupid diagnostic of AUCTeX when curly braces mismatch?** * * * Original question: I have the following line               (add-hook 'LaTeX-mode-hook 'TeX-global-PDF-mode)      in my `~.emacs` that turns on global pdf mode by default. This way, by configuring TeXShop for external editor, I can use it as the previewer every time I `C-c C-c LaTeX` in emacs. However, sometimes after a typesetting error occurs and `C-c (backtick)` is used to view error (details below), the pdf mode seems to be disabled. After fixing the mistake, dvi is generated rather than pdf, and the pdf never gets updated again. I need to exit emacs and restart to restore pdf mode. Why does this behavior occur? Any fix? I'm using Emacs 24.3.0 with AUCTeX 11.87 (both are the current version). * * * Update: The detailed workflow that triggers the problem:   1. Start emacs with a `.tex` file and `(add-hook 'LaTeX-mode-hook 'TeX-global-PDF-mode)` in startup file. The initial mode is `LaTeX/P Fill`, `LaTeX-mode` major mode, with `TeX-PDF-mode` and `auto-fill-mode` minor modes (that autofill mode may be due to my turning on auto fill in my startup file; I didn't test whether AUCTeX start with autofill by default).   2. Make a non-standard curly braces mismatch error, for instance,              % header          \begin{document}       \MACRO{     \end{document}      where `\MACRO` is not a default macro, but maybe something defined in `% header` with `newcommand`. Still `LaTeX/P Fill`.   3. `C-c C-c RET` (use `LaTeX` to typeset by default). Error is reported:              LaTeX errors in `*DIR/FILE output*'. Use C-c ` to display.      Still `LaTeX/P Fill`.   4. `C-c (backtick)` to trigger function `TeX-next-error`. A strange buffer appears, named `TeX Live 2012`. The minibuffer below prompts for `options, RET:` At this time, the mode becomes `LaTeX Fill`; pdf mode is toggled away.   5. `C-g` to quit the function. The buffer is returned to the original editing buffer (but note that the `TeX Live 2012` buffer is still in the background; you will be prompted to save it when you try to quit emacs). Still `LaTeX Fill`.   6. Now fix the buggy code and `C-c C-c RET` again. This time, dvi is generated instead of pdf since now `TeX-PDF-mode` is `nil`. Stray away: if I follow the prompts in step 4 instead of `C-g`, I will end up with the buffer `TeX Live 2012` containing                  \documentclass[OPTIONS]{CLASS}             \begin{document}             \end{document}      A new file! Well, not very helpful. I just missed one curly brace... And you ask me to rewrite the file... Nevertheless, the `TeX Live 2012` buffer at this time will be `LaTeX/P Fill`. * * * At last, a small working example that triggers this behavior:                   \documentclass{amsart}         \newcommand{\set}[1]{\left\{#1\right\}}              \begin{document}         $\set{$         \end{document}


title: How to make a caption (via \captionof and extra margins) adhere to minipage margins?

text: I made use of the caption-package to define a custom layout of the captions. Their width is set to `0.8\columnwidth`. As far as I understood the problem, this measure is not used when the caption is set in a minipage environment. I'd like the captions be treated accordingly to their defined width when they are in a minipage evironment. How can I achieve that? The catch is, it works without the extra definitions by the caption-package, but then the caption is just the vanilla ragged left style which I don't like that much. **Picture of the Status Quo** ![enter image description here](http://i.stack.imgur.com/dzs1L.png) **MWE**               \documentclass[     11pt     ]{scrartcl}          \usepackage{     tikz,     relsize,     amsmath,     booktabs,     tikz     }          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}               \usepackage[     labelfont=sf,     %labelfont=sc, %Kapitälchen, passt nicht wg. nicht-osf Ziffern     %%%%labelfont=it, %italics,      %%%labelfont=sl, %slanted,     hypcap=false,     format=hang,     %margin={2cm,2cm}     width=0.8\columnwidth     ]{caption}          \usetikzlibrary{     calc,trees,shadows,positioning,arrows,chains,     decorations.pathreplacing,     decorations.pathmorphing,     decorations.shapes,     decorations.text,     shapes,     shapes.geometric,     shapes.symbols,     matrix,     patterns,     intersections,     fit}          \pgfdeclarelayer{background layer}     \pgfdeclarelayer{foreground layer}     \pgfsetlayers{background layer,main,foreground layer}          \tikzset{     >=latex     }          \begin{document}          \begin{figure}[btc]     %\begin{center}     \begin{minipage}[c]{0.48\columnwidth}     \begin{center}     \captionof{table}{Dataset for Something  with an Arbitrary Caption to Highlight the Problem}     \begin{tabular}{lrrrrr}     \toprule     Store & A & B & C & D & E \\     \cmidrule(r{0.125em}){1-1}%     \cmidrule(lr{0.125em}){2-2}%     \cmidrule(lr{0.125em}){3-3}%     \cmidrule(lr{0.125em}){4-4}%     \cmidrule(lr{0.125em}){5-5}%     \cmidrule(l{0.25em}){6-6}%     Input & 0.75 & 1 & 2 & 5 & 5\\     Output & 0.5 & 2 & 4 & 2 & 5\\     \bottomrule     \end{tabular}     \end{center}     \end{minipage}     \hfill     \begin{minipage}[c]{0.48\columnwidth}     \begin{center}     \begin{tikzpicture}[font=\sffamily\small]     %     \draw[style=help lines,step=0.5cm] (0,0) grid (6,6);     %     \draw[->,thick] (-0.1,0) -- (6.5,0) node[midway,below=8pt]{Output}; %X-Achse     \draw[->,thick] (0,-0.1) -- (0,6.5) node[above=5pt]{Input}; %Y-Achse     %     \foreach \x in {0,1,...,6} \draw [thick](\x cm,-2pt) -- (\x cm,2pt);     \foreach \y in {0,1,...,6} \draw [thick](-2pt,\y) -- (2pt,\y);     %     \foreach \x in {0,1,...,6} \draw (\x cm, 0 cm) node[anchor=north]{\x} coordinate (x axis);     \foreach \y in {0,1,...,6}  \draw (0 cm, \y cm) node[anchor=east]{\y} coordinate (y axis);     %     \draw     (0,0) coordinate (orig)     (0.75,0.5) coordinate (A)     (1,2) coordinate (B)     (2,4) coordinate (C)     (5,2) coordinate (D)     (5,5) coordinate (E)     ;     %     \foreach \pt/\labpos in {A/right,D/below left,E/below}{       \fill (\pt) circle (2pt) node[\labpos=3pt,fill=white]{\pt};     };     \foreach \pt/\labpos in {B/above left,C/above left}{       \fill (\pt) circle (3pt) node[\labpos=3pt,fill=white]{\pt};     };     \end{tikzpicture}     \captionof{figure}{Graphical Illustration of Dataset with an Arbitrary Caption to Highlight the Problem}     \end{center}     \end{minipage}     \end{figure}          \end{document}


title: Incompability of kpfonts and hyperref?

text: I use `hyperref` with the optional argument `breaklinks=true`. I later wanted to inlcude kpfonts via:               \usepackage{kpfonts}     \usepackage[T1]{fontenc}      What I got after compiling was the following error message: > ! pdfTeX error (ext4): \pdfendlink ended up in different nesting level than > \pd fstartlink. \AtBegShi@Output ...ipout \box \AtBeginShipoutBox > > \fi \fi > > l.278 > > ! ==> Fatal error occurred, no output PDF file produced! Transcript written > on pirates.log. texify: pdflatex failed for some reason (see log file). When I put all the existing references in my .tex-file into a box (for example by framing them in a `\fbox{}` then the compiler did his job, but (of course) without breaking the links. Has anybody an idea what the problem might be? (I hope the part of the error- code I posted is sufficient...)


title: `\protect` with `\cite` inside `\caption`

text: I've read several posts and other webpages now on using `\protect` in front of `\cite` inside `\caption`. They all advise using `\protect` in this situation, and many go as far as to say that you _must_ use it. Now, I've been able to use `\cite` inside `\caption` without `\protect` and still get no errors. For example, the following works fine:               \documentclass{article}          \begin{document}          \begin{figure}     Hello     \caption{I cite this \cite[p. 41]{lang:cyc}.}     \end{figure}          \begin{thebibliography}{1}          \bibitem{lang:cyc}     S.~Lang.     \newblock {\em Cyclotomic fields {I} and {II}}, volume 121 of {\em Graduate Texts in Mathematics}.     \newblock Springer-Verlag, New York, second edition, 1990.     \newblock With an appendix by Karl Rubin.          \end{thebibliography}          \end{document}      I'm interested to know, therefore, whether `\protect` is strictly necessary in this context. Could it be that it's sometimes not necessary (as in the above), but that it's best to use it anyway because you never know when some intricate circumstance might make it necessary? Thanks for your help.


title: Is there a version of pdfTex that does not ignore non-pdf special commands?

text: To make hyperlinks to theorems in plaintex one can use commands that are available in a file called Hyperbasics. When running pdftex instead of tex on the file, Miktex ignores some of the special commands of Hyperbasics. This leads to the question in the title.


title: How can I reverse the caption numbering in listing

text: How can I make a reverse numbered caption with listings? So the package makes ''Listing 1.1'' style captions but I need it in form ''1.1 Listing'' .


title: How combine several .bib files into one?

text: When I download a .bib files from a journal it is stored on my computer as a single .bib file with the entry of the article. Do one have to manually copy paste all the information into one **gigantic** .bib file?


title: Beamer note page: Reduce left margin

text: I am using the beamer notes, but to my mind, the left margin is a bit too large since it reduces the usable space significantly. Is it possible to reduce this? Here is my code:               \documentclass{beamer}     \usepackage{pgfpages}     \setbeamertemplate{note page}[compact]     \setbeameroption{second mode text on second screen=left}     \setbeameroption{show notes on second screen}          \begin{document}          \section{bla}     \begin{frame}{bla}     Some text.     \note[item]{This is a note item}     \note{only text note}     \end{frame}          \end{document}      And here a picture with the margin I mean marked in red ![enter image description here](http://i.stack.imgur.com/LFxAx.png)


title: How to suppress page 13?

text: A lot of buildings have no 13th floor, some planes have no 13th row etc. How do I set up a document that automatically suppresses page 13, figure 13, chapter 13 and so on, say, by jumping the counter. Bonus points if it does not break the odd/even page constructions of the `book` class.


title: Making refcheck work with cleveref

text: It seems that `refcheck` does not recognize references made by cleveref:               \documentclass{article}     \usepackage{amsmath}     \usepackage{cleveref}     \usepackage{refcheck}          \begin{document}     \begin{align}       a & = b \label{eq:a} \\       c & = d \label{eq:b}     \end{align}          See~\eqref{eq:a}, \cref{eq:b}.          \begin{figure}       \caption{Figure 1}       \label{fig:a}     \end{figure}     \begin{figure}       \caption{Figure 2}       \label{fig:b}     \end{figure}          See Figure~\ref{fig:a}, \cref{fig:b}.          \end{document}      Here, `refcheck` marks `eq:b` and `fig:b` as unreferenced.   1. Is there a way to make the two packages work together?   2. Alternatively, are there replacement packages that do work better?   3. If the answer to 1) is yes, can this even be achieved for `\crefrange`?


title: \lstlistoflistings causing error

text: my problem is, I added some listings to my Tex document. On the first run everything went fine and all was shown. After the second rerun, it does not compile anymore. Error:                !Paragraph ended before \contentsline was complete. <to be read again> \par l.6 ...9.4169pt}\xdef 101.60083pt{101.60083pt}\par \noindent \hbox {}\global... I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best.      As soon as I delete the               \lstlistoflistings       to show the listings in the table of content, it does compile again. I already deleted all captions from the listings. But it is still not working. Every help is appreciated. The MWE:               \documentclass[a4paper,12pt,headsepline]{scrartcl}         % Use PNG graphics     \usepackage{graphicx}          \usepackage{glossaries}     \makeglossaries          % Listing     \usepackage{listings}     \usepackage{color}          % Package for textcolors     \usepackage{color}          % picture captions     \usepackage{capt-of}          % create indexes     \makeindex     % Href     \usepackage{nameref}          % Colors for background of listing     \definecolor{myGrey}{gray}{0.9}     % Style of the listing     \lstset{     language=java,                      % Code language     basicstyle=\scriptsize\ttfamily,    % Style     keywordstyle=\color{red}\bfseries,  % Style for keywords     identifierstyle=\color{blue},       % Identifier get special color     stringstyle=\ttfamily,              % Stil of the Strings      breaklines=true,                 numbers=left,                    numberstyle=\tiny,               frame=single,                    backgroundcolor=\color{myGrey},          caption={Java-Code},            % Caption     tabsize=2                    }                    \begin{document}          % Main Page%     \include{latex_settings}     % show table of contents     \newpage     \tableofcontents      %show all figures in table of content      \listoffigures      %show all listings in table of content      \lstlistoflistings (**this caused the error**)      %input other tex documents      \input{tex}           \printglossaries           \end{document}


title: left justifcation only similar to the LaTeX3 newsletter

text: How does one gets a layout similar to the LaTeX3 newsletter? Specifically, the text is left justified only and I cannot figure out how. I have tried `raggedright`/`raggedleft` commands without success.


title: Pretty lists for sorting algorithms

text: I would like to obtain easily something like in this picture so as to illustrate several sorting algorithms. ![sorting](http://i.stack.imgur.com/qLZuH.png) To produce one line, I would like to use one command of the following kind where the numbers of values is not fixed by advance.               \list{\style1}{value1}{\style2}{value2}{\style3}{value3}      Here `\style` can define both the background and the border colors.


title: Append to an argument

text: I have a command that receives some argument, like:               \newcommand{\myappend}[1]{     \ifthenelse{\equal{#1}{aaaBB}}{\dothis}{\dothat}     }      Assume that the argument is 'aaa'. How to append (inside the command) 'BB' to #1, that is, how to edit #1 ?


I am trying to use subfig in ACM class file, but it issues an error that 'caption' package not loaded. I downloaded the 1.3 version of caption (as suggested by ACM), but still the same. Here is the code               \documentclass{sig-alternate}     \usepackage{graphicx, booktabs, multicol,multirow,bigstrut,rotating}     \usepackage{caption}     \usepackage{subcaption}     \begin{document}     \begin{figure}[t]     \centering      \begin{subfigure}[b]{0.3\textwidth}      \includegraphics[scale=0.12]{figures/fig3} \caption{Comparison} \label{Fig:Speed}      \end{subfigure}       \begin{subfigure}[b]{0.3\textwidth}      \includegraphics[scale=0.12]{figures/fig3} \caption{Comparison} \label{Fig:Time}       \end{subfigure}%     \end{figure}     \end{document}      when compiling there are couple of errors including:   1. subcaption: `caption' package not loaded   2. Environment subfigure undefined. \begin{subfigure}   3. Missing number, treated as zero \begin{subfigure}[b]{0.3\textwidth} Any hint is appreciated.


title: Concatenating regex variables in fieldvalue

text: Friends, I'm stuck with a doubt about how to concatenate values from `regex` parenthesis into the `fieldvalue` mapping option. Let's see a quick working example:               \documentclass{article}     \usepackage{filecontents}          \begin{filecontents*}{\jobname.bib}     @book{fruits,       title = {The apple and the banana},       publisher = {Tomatopress},       editor = {Straw Berry},       author = {Annoying Orange},       year = {1970}     }     \end{filecontents*}          \usepackage[utf8]{inputenc}     \usepackage{biblatex}     \addbibresource{\jobname.bib}          \DeclareSourcemap{         \maps[datatype=bibtex]{             \map[overwrite]{                 \step[fieldsource=title,                       fieldset=title,                       match=\regexp{(\w+)\s+(\w+).*},                       fieldvalue={$1}                 ]                 \step[fieldset=title,                       fieldvalue={~$2},                       append                 ]             }         }     }          \begin{document}          Hello world \cite{fruits}.          \printbibliography          \end{document}      The idea here is quite simple: get the first two words of the `title` key, in my case, `$1 = The` and `$2 = apple`. The output is as expected: ![Output](http://i.stack.imgur.com/FtgX5.png) Note that in my code I used two `\step`'s: one setting `fieldvalue` to `$1` and the other appending `$2` (preceded by a non-breaking space) to it. I was hoping to save a step and try the following code (preferably I'd prefer a breakable space):               \DeclareSourcemap{         \maps[datatype=bibtex]{             \map[overwrite]{                 \step[fieldsource=title,                       fieldset=title,                       match=\regexp{(\w+)\s+(\w+).*},                       fieldvalue={$1~$2}                 ]             }         }     }      but it doesn't work. I know I could use the `replace` mapping option - actually, this MWE is too simple - and the expansion of those two variables work, but for the project we are working on, we have to use `fieldvalue`. I was wondering how can I add an arbitrary number of variables in a `fieldvalue` all at once instead of incrementally using `\step`'s to append the values. Any ideas? `:)`


title: How can I plot stacked pie charts using LaTeX?

text: I need to plot the following diagram: ![data-chart](http://i.stack.imgur.com/pTOdT.png) But how I do not know any of the packages   * datatool,   * PGF/TikZ,   * PSTricks,   * datapie. I know how to do simple pie charts with `datapie`, but this one it a bit tricky.


title: Alternatives to LaTeX

text: Are there any **professional** alternatives to TeX/LaTeX which produce **equal or even better** typesetting? Maybe expensive commercial ones. The software counts if it is comparable or superior to LaTeX (with microtype) in typesetting text _or_ math (or both). In any case, please mention both aspects in your answer. I am only aware of ConTeXt (which is partly based on TeX). Note that I am not looking for an alternative for my personal use, I am just asking out of curiosity.


title: Path clipping in 3D only works in two out of three planes?

text: In the following code, I'm trying to draw three clipped circles in three orthogonal planes. I'm using this approach to clip the appropriate sections of the circles. This works nicely in the xy and yz planes, but not in the xz plane, as shown in the output. ![enter image description here](http://i.stack.imgur.com/AAA18.png) Based on the output, it seems I have made a simple mistake, but I just can't find it. I've tried checking the coordinates in the scope for the xz plane (red circle), and they appear to be correct. I've attached three figures which show the clipping paths for each scope. (The drawn clipping paths show some minor inaccuracies, but these are irrelevant to the problem.) Any help finding the error would be much appreciated. Some mathematical properties which might make the code clearer:   * The center of the box is the point (1,1,1)   * The drawn axes meet at (1,1,1), not the origin, so the figure is essentially shifted [1,1,1]   * All the circles are concentric with center point (1,1,1)   * The radius of the circles is 2 * * *               \documentclass[11pt]{standalone}     \usepackage[utf8]{inputenc}     \usepackage{tikz,tikz-3dplot}         \usetikzlibrary{arrows}          \begin{document}          \definecolor{darkgreen}{rgb}{0.1,0.7,0.1}     \tdplotsetmaincoords{60}{125}          \begin{tikzpicture}[tdplot_main_coords,>=latex]              \pgfsetlinewidth{0.8}              \tdplotsetcoord{P}{3.4641}{54.74}{45}              % box         \draw[fill=black!10] (Px) -- (Pxy) -- (Py) -- (Pyz) -- (Pz) -- (Pxz) -- cycle;         \draw (Pxy)  --  (P);         \draw (Pxz)  --  (P);         \draw (Pyz)  --  (P);              \pgfsetlinewidth{1.4}              \begin{scope} % blue circle, xy plane             \color{blue}             \tikzstyle{reverseclip}=[insert path={(3.1,3.1,1) -- (-1.1,3.1,1) -- (-1,-1.1,1) -- (3.1,-1.1,1) -- (3.1,3.1,1)}]             \begin{pgfinterruptboundingbox}                 \path[clip] (1,1,1) -- (1.3,-1.1,1) -- (-1.1,-1.1,1) -- (-1.1,2,1) -- cycle [reverseclip];             \end{pgfinterruptboundingbox}             \pgfpathellipse{\pgfpointxyz{1}{1}{1}}{\pgfpointxyz{2}{0}{0}}{\pgfpointxyz{0}{2}{0}}             \pgfusepath{draw}         \end{scope}              \begin{scope} % green circle, yz plane             \color{darkgreen}             \tikzstyle{reverseclip}=[insert path={(1,3.1,3.1) -- (1,3.1,-1.1) -- (1,-1.1,-1.1) -- (1,-1.1,3.1) -- (1,3.1,3.1)}]             \begin{pgfinterruptboundingbox}                 \path[clip] (1,1,1) -- (1,-1.1,1.8) -- (1,-1.1,-1.1) -- (1,1.7,-1.1) -- cycle [reverseclip];             \end{pgfinterruptboundingbox}             \pgfpathellipse{\pgfpointxyz{1}{1}{1}}{\pgfpointxyz{0}{2}{0}}{\pgfpointxyz{0}{0}{2}}             \pgfusepath{draw}         \end{scope}              \begin{scope} % red circle, xz plane             \color{red}             \tikzstyle{reverseclip}=[insert path={(3.1,1,3.1) -- (-1.1,1,3.1) -- (-1.1,1,-1.1) -- (3.1,1,-1.1) -- (3.1,1,3.1)}]             \begin{pgfinterruptboundingbox}                 \path[clip] (1,1,1) -- (-1.1,1,2) -- (-1.1,1,-1.1) -- (1.5,1,-1.1) -- cycle [reverseclip];             \end{pgfinterruptboundingbox}             \pgfpathellipse{\pgfpointxyz{1}{1}{1}}{\pgfpointxyz{2}{0}{0}}{\pgfpointxyz{0}{0}{2}}             \pgfusepath{draw}         \end{scope}              % axes         \draw[line width=0.8pt,->]  (2,1,1)  --  (4,1,1)  node[anchor=north  east]{\textbf{x}};         \draw[line width=0.8pt,->]  (1,2,1)  --  (1,4,1)  node[anchor=north  west]{\textbf{y}};         \draw[line width=0.8pt,->]  (1,1,2)  --  (1,1,4)  node[anchor=south]{\textbf{z}};          \end{tikzpicture}          \end{document}      * * * ![enter image description here](http://i.stack.imgur.com/5HbrH.png) ![enter image description here](http://i.stack.imgur.com/ekVZX.png) ![enter image description here](http://i.stack.imgur.com/Zl5tV.png)


title: Template of old research document

text: I've been looking at this PDF, and I can't figure out what template it is. It looks _vaguely_ similar to this post: Showcase of beautiful typography done in TeX & friends What I'm trying to accomplish is to replicate the style of the header, more specifically the size of the font and the type of the font. ![enter image description here](http://i.stack.imgur.com/oQ1yW.jpg) http://www.wiwi.uni- jena.de/uiw/publications/pub_before_1999/Audretsch_Fritsch_1994b.pdf I'm trying to replicate this document in TeX. This is what I have so far.               %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode          \documentclass[12pt]{extarticle}           \usepackage[protrusion=true,expansion=true,tracking=true,kerning=true]{microtype}     \usepackage{multicol}     \usepackage{lipsum}          \usepackage[margin=0.5in,top=1in,bottom=1in]{geometry}          \setlength{\columnsep}{20pt}               \usepackage{fontspec,xltxtra,xunicode}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont[Mapping=tex-text]{Adobe Caslon Pro}     %\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}     %\setmonofont[Scale=MatchLowercase]{Adobe Caslon Pro}          \title{Fancy title goes here.}     \author{Author name}     \date{November $21^{st}$, 2012}                                           % Activate to display a given date or no date          \begin{document}     \maketitle          \begin{center}     \rule[1cm]{17cm}{0.01cm}     \end{center}          \abstract{This paper will assess various aspects of a certain topic. \lipsum[24]}     \bigskip          \noindent Keywords: Something blah geography               \begin{multicols}{2}     \subsubsection*{\centerline{\bf{INTRODUCTION}}}          \lipsum[1-10]               \end{multicols}                                   \end{document}


title: Ê character used in a template leads to square characters being added

text: I've downloaded a CV template to play with from here, all is going well when I'm outputting with XeLaTeX apart from one thing, I can't understand the use of the string               Ê Ê Ê Ê&      In this piece of markup               \begin{tabularx}{0.97\linewidth}{>{\raggedleft\scshape}p{2cm}X}     \gray Period & \textbf{March 2009 --- August 2010 (Part Time)}\\     \gray Employer & \textbf{Buy More} \hfill New York, USA\\     \gray Job Title & \textbf{Supermarket Clerk}\\     Ê Ê Ê Ê& Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et auctor neque. Nullam ultricies sem sit amet magna tristique imperdiet.     \end{tabularx}      Outputting with that string in makes the document format properly however leaves behind four square characters, removing them causes the format of the entire document to fall apart. What's going on here? I'm using a different font to the template as I don't have the font specified on my OS (linux mint).


title: Solid portable LaTeX installation

text: The MikTeX installation has a huge number of files which causes issues with my file system(bloats it). Is there any distribution that has a solid (and portable) installation so that essentially it is either one file or a mountable file. I'd like to have a portable (but upgradable) installation that is a few files. (similarly with `cygwin`, as it takes up over `4x` the size on a `ReFS` system and is very slow to delete because of it's 100k's of files). I guess I could install the system to a small drive dedicated to it if necessary. I tried the MikTeX portable but found it had issues.


title: Gaussian random numbers

text: The Tikz manual has all sorts of different options regarding math, but the following is the first version which actually worked. Is there a better way to do this?               \documentclass{article}     \usepackage{tikz}          \usetikzlibrary{calc}          \newcount\gaussF     \edef\gaussR{0}     \edef\gaussA{0}          \def\gauss{      \advance\gaussF by 1\relax      \ifodd\gaussF       \pgfmathrnd       \edef\temp{\pgfmathresult}       \pgfmathln{\temp}       \edef\temp{\pgfmathresult}       \pgfmathmultiply{-2}{\temp}       \edef\temp{\pgfmathresult}       \pgfmathsqrt{\temp}       \edef\gaussR{\pgfmathresult}%radius = $sqrt(-2*ln(rnd))$       \pgfmathrnd       \edef\temp{\pgfmathresult}       \pgfmathmultiply{360}{\temp}       \edef\gaussA{\pgfmathresult}%angle = $360*rnd$       \pgfmathcos{\gaussA}       \edef\temp{\pgfmathresult}       \pgfmathmultiply{\gaussR}{\temp}      \else       \pgfmathsin{\gaussA}       \edef\temp{\pgfmathresult}       \pgfmathmultiply{\gaussR}{\temp}      \fi      \pgfmathresult     }          \begin{document}          \noindent     \gauss\\     \gauss\\     \gauss\\     \gauss          \end{document}


title: Color/Opacity of a circle segment

text: I'd like to know how to color a segment of a circle, more specifically using the provided example in this link. For example I want to color the circle in 45 degree segments or similar. I'd also like to control the color of the painted segment as well as its opacity. While I am at it, I'd also like to know how to convert that code to display instead of a circle, a rectangle which will be segmented in similar angular sections as the above. (much like how you do angle segmentation in pixel rectangles)! Thanks a lot in advance.


title: How can I select the engine for portable Texmaker?

text: I have a portable TexMaker in my memory.   Portable TexLive 2012 is installed on it too.   I want to make my documents with TexMaker using engine which in TexLive.


title: How could we fix the legend in the x-axis with bar chart?

text: How could we fix the problem with the x-axis ? Also, would it be possible to have written above or in the middle of each column each number ? ![enter image description here](http://i.stack.imgur.com/FPi4r.png) So as to make my bar chart, I have used the following code:               \documentclass{article}          \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[             width  = 0.85*\textwidth,             height = 8cm,             major x tick style = transparent,             ybar=2*\pgflinewidth,             bar width=14pt,             ymajorgrids = true,             ylabel = {Deaths per 1,000 live births},             symbolic x coords={World,Low income,Middle income, High income},             xtick = data,             scaled y ticks = false,             enlarge x limits=0.25,             ymin=0,             legend cell align=left,             legend style={                     at={(1,1.05)},                     anchor=south east,                     column sep=1ex             }         ]     \addplot     coordinates     {(World,51) (Low income,95) (Middle income,46) (High income,6)};     \addplot     coordinates     {(World,63) (Low income,115) (Middle income,57) (High income,7)};     \addplot     coordinates     {(World,73) (Low income,133) (Middle income,67) (High income,7)};     \addplot     coordinates     {(World,87) (Low income,164) (Middle income,82) (High income,12)};     \legend     {2011,2005,2000, 1990}     \end{axis}     \end{tikzpicture}     \end{document}


title: What causes the following gaps?

text: I have tried to remove any possible white spaces by appending `%` but the gaps still exist. What causes these gaps?               \documentclass[pstricks,border=12pt,12pt]{standalone}     \usepackage{graphicx}     \newsavebox\IBox     \savebox\IBox{\includegraphics[scale=.5]{example-grid-100x100pt}}          \begin{document}     \begin{pspicture}(2\wd\IBox,2\ht\IBox)%         \rput[bl](0,0){\usebox\IBox}%         \rput[bl](\wd\IBox,0){\psscalebox{-1 -1}{\usebox\IBox}}%         \rput[bl](\wd\IBox,\ht\IBox){\psscalebox{1 -1}{\usebox\IBox}}%         \rput[bl](0,\ht\IBox){\psscalebox{-1 1}{\usebox\IBox}}%     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/BwI9V.png)


title: How to put many psmatrix figures as graphics with subcaption? (or similar solution)

text: I have an image created with \begin{figure} and inside \psmatrix. How could I put 6 similar images as a 2 x 3 matrix? similar to ![enter image description here](http://i.stack.imgur.com/mOFo2.jpg)               \documentclass[10pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{pstricks}%[pdf]     \usepackage{pst-node}     \usepackage{pst-blur}     \newpsobject{cnodeblue}{cnode}{fillstyle=solid,fillcolor=blue}     \newpsobject{cnodepink}{cnode}{fillstyle=solid,fillcolor=pink}     \newpsobject{cnodegreen}{cnode}{fillstyle=solid,fillcolor=green}     \newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}          \pagestyle{empty}     \begin{document}     \begin{figure}[h!]     \centering     \resizebox{3cm}{!}{    % if you want to resize     \psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm}     \def\pscolhookii{\hskip 2cm}          \begin{psmatrix}[rowsep=1.9, colsep=2.9]% defines the distance between two frames     %       &       [name =Vecino1]       \psframegray(.00,.00)(3.5,1.7)         \pspolygon(0.5,0.2)(0.5,1.2)(2.3,1.2)(2.3,0.2)         \rput[t](2.3,-.15){Vecino 1}         \\ %[0.88cm]       &       [name =Vecino2]       \psframegray(.00,.00)(3.5,1.7)         \pspolygon(0.5,0.2)(0.5,1.2)(2.3,1.2)(2.3,0.2)         \rput[t](2.3,-.15){Vecino 2}        \\     %       [name =SA]       \psframegray(.00,.00)(3.5,1.7)         \pspolygon(0.5,0.2)(0.5,1.2)(2.3,1.2)(2.3,0.2)         \rput[t](2.3,-.15){Solución Actual}        &        [name =Vecino3]       \psframegray(.00,.00)(3.5,1.7)         \pspolygon(0.5,0.2)(0.5,1.2)(2.3,1.2)(2.3,0.2)         \rput[t](2.3,-.15){Vecino 3}     %     \end{psmatrix}     %%% Links     \psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos = 0.4}     \ncline[nodesepA = 2.0cm,nodesepB=0.5]{SA}{Vecino1}%     \ncline[nodesepA = 3.0cm,nodesepB=0.5]{SA}{Vecino2}%     \ncline[nodesepA = 3.7cm,nodesepB=0.5]{SA}{Vecino3}%          }\\[0.5cm]     %\vspace{2.85cm}     \caption{Forma 1 de Generar Vecinos}\label{Forma1GenerarVecinos}     \end{figure}     \end{document}


title: Problem with csquotes and hyperref color links together

text: I have a problem running "csquotes" and "hyperref" with the option `colorlinks` together, producing the error:               ! Missing = inserted for \ifnum.     <to be read again>                         \bgroup      l.13   }      A MWE is:               \documentclass{article}          \usepackage{csquotes}     \usepackage[colorlinks]{hyperref}          \MakeAutoQuote*{<}{>}          \begin{document}     This is a test!     \end{document}      Does anyone know how to solve the problem? This is on TeXLive 2014 on Linux, fresh install.


title: Section Commands Inside Enumerate Environment

text: Good Morning, I would like to have subsection commands both before and inside an `enumerate` environment:               \subsection*{Instantaneous Velocity}          \begin{enumerate}         \item[\textsf{\textbf{Example 1}}] The table below gives the position $s$ of a car at time $t$.              \begin{enumerate}              \item Find the average velocity over the following intervals.                 \begin{enumerate}                     \item $0 \leq t \leq 0.4$                 \end{enumerate}             \item Estimate the instantaneous velocity at $t=0.4$.         \end{enumerate}      \vfill          \subsection*{Defining Instantaneous Velocity Using the Idea of a Limit}                  \item[\textsf{\textbf{Example 2}}] Yackety yack yack              \vfill          \end{enumerate}      When I compile this, the subsection inside the `enumerate` environment is indented (clearly, to match the `enumerate` environment) but I would like for it to align with the subsection that is outside of the `enumerate` environment. I am aware of `\suspend` `\resume` and `\interitemtext`, but was wondering if there might be some simple(er) solution to this, or a basic concept that I might be missing. Thanks for your help, Randy Scott, Santiago Canyon College, Orange, CA


title: text wrapping around an image across several A4 sheets

text: I am doing a project that intends to cover a wall with the words of a book. It will consist of 84 sheets of A4 paper, (cut to remove the margin), with six columns on each sheet. The text is printed in a 5pt font. The sheets are arranged 14 across and 6 down. If that were all it would be easy and I would do it in LibreOffice. However, I have a large "white" image that I need to superimpose on the sheets. The image is formed by the words wrapping round the invisible image. I thought Latex might help, but cannot see how it can work across multiple sheets of paper in a matrix layout. Is there a free software package that could handle this, or will I have to resort to writing some code? ( I've 30 years C experience, and interested in learning python. )


title: Lyx on Ubuntu 14.04: Spell checker has no dictionaries

text: **Situation:** I'm trying to spell check for German in _Lyx on Ubuntu 14.04_. Currently I'm having Enchant selected under Preferences, but I'm open to any alternative to gain "in document" spell checking functionality. **Problem:** There is no spelling checked. F7 prints out "Spell checker has no dictionaries." **Note:** Spell checking for German works wonderfully in all my other applications I use like browsers or LibreOffice.


title: Closed shape with different line colors

text: The following code defines a MWE: ![enter image description here](http://i.stack.imgur.com/sB1Il.png)               \documentclass[dvipsnames]{article}     \usepackage{tikz}     \begin{document}         \begin{tikzpicture}         \draw[dashed,Cerulean] (0,0)--(1,0)--(1,4);         \draw[thick,OrangeRed] (0,0) -- (1,4);         \draw[|-|] (1.3,4) -- (1.3,0) node[xshift=5ex,align=center,midway] {\scriptsize height (4)};         \draw[|-|]  (0,-0.25) -- (1,-0.25) node[below,midway] {\scriptsize base (1)} ;         \end{tikzpicture}     \end{document}      The issue I have is that the shape is not a closed one and the corners where the hypotenuse and the other two sides meet are obviously unpleasant. Is there a way to have a closed path with different decorations and colors as in my example? Of course, much consideration needs to be given to the smoothness of the vertices.


title: Which encoding supports this symbol ƒ?

text: I have this encoding in my file:               \usepackage[utf8]{inputenc} %unicode support      but I still get the error               Package inputenc Error: Unicode char \u8... not set up for use with ...      **How can you make LaTeX understand the symbol ƒ?**


title: Embedding PDF graphics with TeXShop causes issues

text: I'm trying to import PDF graphics (created in Illustrator CS3) into a TeX document. Here is the code for including the figure:               \begin{figure}[htbp] %  figure placement: here, top, bottom, or page            \centering              \includegraphics[width=3.5in]{BPQM01PSa.pdf}              \caption{caption..}.}            \label{fig:BPQM ptps}         \end{figure}      The following error message appears > id=25, 845.0471pt x 597.50829pt> ! Extra }, or forgotten \endgroup. > \@endfloatbox ...pagefalse \outer@nobreak \egroup > > \color@endbox   >  l.298 \end{figure} > > ? (I don't know how to post a pdf graphic to this site, of someone knows of an easy way to post one to the web i'll provide a link to it). After clicking the the error console-log window the glitch _sometimes_ rights itself and a pdf document is produced with the graphic embedded. Does anyone know what might be causing this issue?


title: Resetting line count in dtx files

text: I'm writing a `dtx` file containing several source files. Is there a way to reset the line counter when commenting the code of a different file? My `dtx` file looks something like this:               ....     %\iffalse     %<file1>     %\fi     % .... comments and code of file 1     %\iffalse     %</file1>     %<file2>     %\fi     % .... comments and code of file 2 ... etc.      and I would like the line numbers of the code of file2 to start with 1 again.


title: How to include abstract into titlepage (variant)?

text: I am facing a problem similar to this post: How to include abstract into titlepage? where I would like to include the abstract in the title page. This I managed thanks to the post #8. However,the journal format requires the abstract to be in-between authors's name and address... and this is where I could not find a simple solution by moving around the key command               \vskip\z@\@plus2fill\box\abstractbox\vskip\z@\@plus1fill      and this is where I reach my limits too... Could anyone come with a workaround for this problem?


title: How to install a font on MacTeX 2013

text: I don't understand why fonts that work perfectly fine on Windows with TeXLive 2013 don't work on my Mac with MacTeX-2013, but whatever. I need to install "Linux Libertine O," but do not know how to do it. The instructions I find online all seem to be for older versions of MacTeX and OS X. I need the font to work with XeLaTeX. If there is a large font distribution/package of some sort that I can use that would be ideal so that I don't keep having to install fonts one by one.


title: Drawing line around obstacle in circuit diagram

text: I have a circuit diagram with 3 DFFs (rectangles) and an xor gate (pointy bit on the right). ![enter image description here](http://i.stack.imgur.com/7pWUm.png) For reference, let's identify the components from left to right as x[n], DFF0, DFF1, DFF2 and XOR0. What I want is for DFF1.Q to be routed to XOR0.input 2. The problem is that the connection cannot go over DFF2, and it must use vertical or horizontal lines only. Here is a freehand representation of what I am trying to do: ![enter image description here](http://i.stack.imgur.com/RCoDa.png) I have tried different things and reading for a few hours and can't get what I want. Here is my code, my most recent effort is at the bottom, commented out.               \documentclass[a4paper,landscape]{article}          \usepackage{pgf,tikz}     %%%<     \usepackage{verbatim}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{5pt}%     %%%>          \usetikzlibrary{calc,arrows}     \usepackage{amsmath}     \usepackage[left=1cm,right=1cm]{geometry}          \usetikzlibrary{arrows,shapes.gates.logic.US,shapes.gates.logic.IEC,calc}     \tikzstyle{branch}=[fill,shape=circle,minimum size=3pt,inner sep=0pt]          \pagestyle{empty}          \makeatletter          % Data Flip Flip (DFF) shape     \pgfdeclareshape{dff}{       % The 'minimum width' and 'minimum height' keys, not the content, determine       % the size       \savedanchor\northeast{%         \pgfmathsetlength\pgf@x{\pgfshapeminwidth}%         \pgfmathsetlength\pgf@y{\pgfshapeminheight}%         \pgf@x=0.25\pgf@x         \pgf@y=0.25\pgf@y       }       % This is redundant, but makes some things easier:       \savedanchor\southwest{%         \pgfmathsetlength\pgf@x{\pgfshapeminwidth}%         \pgfmathsetlength\pgf@y{\pgfshapeminheight}%         \pgf@x=-0.25\pgf@x         \pgf@y=-0.25\pgf@y       }       % Inherit from rectangle       \inheritanchorborder[from=rectangle]            % Define same anchor a normal rectangle has       \anchor{center}{\pgfpointorigin}       \anchor{north}{\northeast \pgf@x=0pt}       \anchor{east}{\northeast \pgf@y=0pt}       \anchor{south}{\southwest \pgf@x=0pt}       \anchor{west}{\southwest \pgf@y=0pt}       \anchor{north east}{\northeast}       \anchor{north west}{\northeast \pgf@x=-\pgf@x}       \anchor{south west}{\southwest}       \anchor{south east}{\southwest \pgf@x=-\pgf@x}       \anchor{text}{         \pgfpointorigin         \advance\pgf@x by -.5\wd\pgfnodeparttextbox%         \advance\pgf@y by -.5\ht\pgfnodeparttextbox%         \advance\pgf@y by +.5\dp\pgfnodeparttextbox%       }            % Define anchors for signal ports       \anchor{D}{         \pgf@process{\northeast}%         \pgf@x=-1\pgf@x%         \pgf@y=.5\pgf@y%       }       \anchor{CLK}{         \pgf@process{\northeast}%         \pgf@x=-1\pgf@x%         \pgf@y=-.5\pgf@y%       }       \anchor{Q}{         \pgf@process{\northeast}%         \pgf@y=.5\pgf@y%       }       \anchor{Qn}{         \pgf@process{\northeast}%         \pgf@y=-.5\pgf@y%       }       % Draw the rectangle box and the port labels       \backgroundpath{         % Rectangle box         \pgfpathrectanglecorners{\southwest}{\northeast}         % Angle (>) for clock input         \pgf@anchor@dff@CLK         \pgf@xa=\pgf@x \pgf@ya=\pgf@y         \pgf@xb=\pgf@x \pgf@yb=\pgf@y         \pgf@xc=\pgf@x \pgf@yc=\pgf@y         \pgfmathsetlength\pgf@x{1.6ex} % size depends on font size         \advance\pgf@ya by \pgf@x         \advance\pgf@xb by \pgf@x         \advance\pgf@yc by -\pgf@x         \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}         \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}         \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}         \pgfclosepath              % Draw port labels         \begingroup         \tikzset{flip flop/port labels} % Use font from this style         \tikz@textfont              \pgf@anchor@dff@D         \pgftext[left,base,at={\pgfpoint{\pgf@x}{\pgf@y}},x=\pgfshapeinnerxsep]{\raisebox{-0.75ex}{D}}              \pgf@anchor@dff@Q         \pgftext[right,base,at={\pgfpoint{\pgf@x}{\pgf@y}},x=-\pgfshapeinnerxsep]{\raisebox{-.75ex}{Q}}              \pgf@anchor@dff@Qn         \pgftext[right,base,at={\pgfpoint{\pgf@x}{\pgf@y}},x=-\pgfshapeinnerxsep]{\raisebox{-.75ex}{$\overline{\mbox{Q}}$}}              \endgroup       }     }          % Key to add font macros to the current font     \tikzset{add font/.code={\expandafter\def\expandafter\tikz@textfont\expandafter{\tikz@textfont#1}}}          % Define default style for this node     \tikzset{flip flop/port labels/.style={font=\sffamily\scriptsize}}     \tikzset{every dff node/.style={draw,minimum width=2cm,minimum         height=2.828427125cm,very thick,inner sep=1mm,outer sep=0pt,cap=round,add         font=\sffamily}}          \makeatother          \begin{document}          \begin{tikzpicture}[font=\sffamily,>=triangle 45]            % place dffs and draw connections       \node [shape=dff] (DFF0) at (0,0) {};       \node [shape=dff] (DFF1) at (1.5,0) {};       \node [shape=dff] (DFF2) at (3,0) {};       \draw [<-] (DFF0.D) -- +(-0.5,0) node [anchor=east] {$x[n]$} ;       \draw [|-] (DFF0.Q) -- (DFF1.D);            % place xor and draw connections       \node[xor gate US, draw, logic gate inputs=nn, anchor=input 1] at       ($(DFF2.Q)+(0.5,0)$) (XOR0) {};       \draw (DFF2.Q) -- (XOR0.input 1);     %  \draw (DFF1.Q) |- ([xshift=0.25]DFF1.Q) |- ([yshift=-1.25]DFF1.Q) |- (XOR0.input 2);          \end{tikzpicture}          \end{document}      Credit to Martin Scharrer for DFF code


title: Running latex through perl batch file

text: I am interested in running multiple latex files in a directory from perl. I will have as many as 100 .tex files to run at once, and I was wondering if someone could suggest a perl script or package that I could modify to do this quickly. I am planning on generating the .tex files using exceltex (since it is a large database of questions), and then executing the perl script on the folder to generate the .pdf files. Any advice would be appreciated.


title: Is there a good plain TeX tutorial that explains about doing automation and making layout?

text: I am interested in learning plain TeX especially in   1. automation: looping, conditional branching, jumping, iterating, etc.   2. layout: creating custom smart tables and boxes that can span cross pages. What is the most often used commands for doing those above? At least I have a rough direction to the target. * * * **EDIT 1:** Reading Knuth's book needs much time. I want to be more practical and instant first. Later after grasping the rough and basic understanding, I will read the Knuth's book.


title: Automated removal of unneeded packages

text: As others certainly do, I generally use a template for my papers, which contains everything I usually need (packages, macros, ...) to typeset my documents. However, my needs sometimes vary, and in the end I find myself including packages that I did not need. What I generally do in the preamble is `\usepackage{P} % R`, where R is the reason (e.g. set of commands) for including package P. This then allows me to check that R applies to my document, and remove P if not, but this is still a rather tedious process. Does anyone know of a script that checks for unneeded packages or commands in a document?


title: Splitting an algorithm across two columns

text: Consider the following short example, where a two column page is selected, and the algorithm is split across the two columns using a manual `\pagebreak` _within the algorithm's code_ :               \documentclass[twocolumn]{article}     \usepackage[english]{babel}     \usepackage{algpseudocode}     \begin{document}          \begin{algorithmic} [1]         \State Let $a \gets b + c$         \State Let $a \gets b + c$         \pagebreak         \State Let $a \gets b + c$         \State Let $a \gets b + c$     \end{algorithmic}          \end{document}      Here's the result: ![enter image description here](http://i.stack.imgur.com/v0ctr.png) Now, by putting the code inside a float, I no longer can split the algorithm by `\pagebreak`:               \documentclass[twocolumn]{article}     \usepackage[english]{babel}     \usepackage{algorithm}     \usepackage{algpseudocode}     \begin{document}     \begin{algorithm*}[t]     \caption{Test}          \begin{algorithmic} [1]         \State Let $a \gets b + c$         \State Let $a \gets b + c$         \pagebreak         \State Let $a \gets b + c$         \State Let $a \gets b + c$     \end{algorithmic}          \end{algorithm*}     \end{document}      and the result: ![enter image description here](http://i.stack.imgur.com/ETeAq.png) How can I get the same effect within a float? Could you please suggest a method which is not specific to `algpseudocode`, and applies to `algorithm2e` as well? (The latter does not support `\pagebreak` within the code.)


title: How to show only chapter name in each page only?

text: Hello respected everyone. I need little help from you. Please tell the (simpler) latex commands etc using which I can prepare every page lay out in documentclass "book" so that in each page there will be a horizontal line in above and only the chapter name will be seen. I tried with "fancyheader" but I am not satisfied as it is showing the sections as well as chapter name both. I want only the chapter name. What to do ? Please help me               \documentclass[10pt, twoside]{book}     \usepackage{lastpage}     \usepackage{fancyhdr}     \cfoot{\thepage \,of \pageref{LastPage}}     \fancyhead{}     \chead{\leftmark}     \pagestyle{fancy}                    \setlength{\topmargin}{-.3in}     \setlength{\headsep}{0in}     \setlength{\textheight}{10.2in}     \setlength{\textwidth}{7in}     \setlength{\oddsidemargin}{-.3in}     \setlength{\evensidemargin}{-.3in}     \setlength{\topskip}{.2in}                                        \begin{document}     text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.      text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           text text text. text text text. text text text. text text text. text text text.      text text text. text text text. text text text. text text text.           \end{docuemnt}


title: Matlab2tikz, alignment of subplot ylabel (large distance from plot)

text: Matlab2tikz came to my attention in the past month and have been using the simple tutorial from HowToTeX. It has worked great so far only one issue remains, I am unable to anchor the `ylabel` to the `yaxis`. I use matlab to plot multiple subplots (for instance 3x3) and matlab2tikz to acquire a `.tik`z input file. I use a code similar to:               \begin{figure} [H]       \scriptsize       \centering        \setlength\figureheight{3cm}       \setlength\figurewidth{3cm}       \input{fig_matlab2tikz.tikz}       \caption{A great subplot.}        \label{fig:matlabfigure}        \normalsize     \end{figure}      The `ylabel` is located too far away from the plot, so it looks like the `ylabel` belongs to a subplot to the left. I have tried to use the following code to move the labels closer but nothing changed.               \pgfplotsset{       /pgfplots/xlabel near ticks/.style={         /pgfplots/every axis x label/.style={           at={(ticklabel cs:3)},anchor=near ticklabel}},         /pgfplots/ylabel near ticks/.style={           /pgfplots/every axis y label/.style={             at={(ticklabel cs:3)},rotate=90,anchor=near ticklabel}}}


title: PGF Plot correlation table shade negative/ positive values gradient

text: I am trying to extend the results from Parametrize shading in table through TikZ for negative values. I searched extensively for the absolute value function but could not find one. I tried abs(), but it does not work. The code with edits for negative values:               \documentclass{article}     \usepackage[table]{xcolor}     \usepackage{pgfplotstable}     \usepackage{calc}          \pgfplotstableset{         color cells/.style={             col sep=comma,             string type,             postproc cell content/.code={%                     \pgfkeysalso{@cell content=\rule{0cm}{2.4ex}\ifnum ##1 < 0 {\cellcolor{red!abs(##1)} \pgfmathtruncatemacro\number{##1}\ifnum\number>50\color{white}\fi##1}\else\                     {\cellcolor{green!##1}\pgfmathtruncatemacro\number{##1}\ifnum\number>50\color{white}\fi##1}\fi                     }%                     },             columns/x/.style={                 column name={},                 postproc cell content/.code={}             }         }     }                    \begin{document}     \begin{table}\caption{Correlation or something}     \centering     \pgfplotstabletypeset[color cells]{     x,a,b,c,d     a,90,-10.5,0,0     b,0,80,10,-10     c,0,0,-95,5     d,0,10,5,-85     }     \end{table}     \end{document}      Please let me know how to extend it for negative values, thanks


title: Change font color of multiple rows in a table

text: I found the following post to change the font color of a single row in a table: How to color the font of a single row in a table? My row is a long table with 70 rows and for about 25 the I want to change the font color. I was wondering if there is a better way of coloring these 25 rows rather than using `\rowfont{\color{red}}` 25 times?


title: knitr generated pdf cut border off from figure

text: I have a a problem with a figure that is correctly generated in RStudio but when knitted its right margin is not set correctly. Please consider the following MWE               \documentclass[a4papera4paper, twocolumn]{article}     \begin{document}          \begin{figure}     <<dev='tikz', dev.args=list(pointsize=5),dev='pdf',fig.env='figure*'>>=     library(igraph)          g <- graph.full(5, loops=TRUE)          E(g)$weigth <- 200          par(mar = c(0, 0, 0, 16))     plot(g, layout=layout.circle, edge.width=log(E(g)$weigth), edge.label=E(g)$weigth)     @     \end{figure}          \end{document}      which produces ![enter image description here](http://i.stack.imgur.com/DcTQM.png) while in _RStudio_ the same script produces ![enter image description here](http://i.stack.imgur.com/1gmN2.png)


title: How to draw on axis from pgfplots?

text: How can I draw on an `axis` from `pgfplots`? I already found out, that I somehow have to use `axis cs:` in front of the coordinates (what does `cs` mean?), but the following example does not draw the ellipse:               \begin{tikzpicture}       \begin{axis}         \draw (axis cs:0,0) ellipse (1cm,1cm);       \end{axis}     \end{tikzpicture}      What am I doing wrong? What's the general way of drawing on an axis plot?


title: Always \textrm, never \rm? A counterexample?

text: Let us see the following code:               \documentclass{article}     \begin{document}     \newtheorem{theorem}{Theorem}          \begin{theorem}     TFAE     \begin{itemize}     \item[(i)]     $0<1$;     \item[(ii)]     $1>0$.     \end{itemize}     \end{theorem}          But I want (i)'s Roman:          \begin{theorem}     TFAE     \begin{itemize}     \item[\textrm{(i)}]     $0<1$;     \item[\textrm{(ii)}]     $1>0$.     \end{itemize}     \end{theorem}          Alas, still italic, but\ldots          \begin{theorem}     TFAE     \begin{itemize}     \item[\rm(i)]     $0<1$;     \item[\rm(ii)]     $1>0$.     \end{itemize}     \end{theorem}          \end{document}      ![enter image description here](http://i.stack.imgur.com/Y829W.png) And `\textrm`, which should be better than an obsolete `\rm` (I know the differences of using them) doesn't work as one can expect. Is it an argument for using `\rm` from time to time?


title: last line of algorithms ends with =0

text: I wrote some algorithms on shareLatex, but when compiling the document, each algorithm ends with =0 for example: End If=0. and so on what I have to do to avoid this problem. I use these packages:               \usepackage{algorithm, algorithmic}     \usepackage[noend]{algpseudocode}          \begin{algorithm}        \caption{Algorithm CheckState (X)}         \label{alg:check-state}        \begin{algorithmic}[1]          \IF {$P_{k}\leq \epsilon$}          \STATE $T \leftarrow 0 $          \STATE $State \leftarrow safety$          \ELSE [/*the beginning of a critical situation*/]          \STATE Calculate time $T$ during which the system remains in this situation          \STATE $State \leftarrow critical$          \IF { $T\prec\sigma$}          \STATE /*a peak load period*/          \STATE Refuse or delay any new command          \ELSE [/*the critical situation persists*/]          \ENDIF          \ENDIF       \end{algorithmic}      \end{algorithm}


title: Best practices for setting figure width/hight ratio across the document in a consistent fashion

text: When I have many plots in a document I usually lose a lot of time to individually set width and hight of each pictures to make them appear _right_ within the document. Additionally complicating the matter is that some figure is produced in `R` adding other variables to each final-size equation, but also that figures can't be simply of strictly the same size since (of course) content must always influence the aspect ratio (e.g. time-series could require a 1/3 height/width ratio while a simple bar chart might only require something close to 1/1). According to Edward Tufte "[g]raphics should tend toward the horizontal" (Tufte, E. R. (2001). The visual display of quantitative information. P. 186). I agree. Tufte also proposes two ratios: the Golden rectangle--1/1.618 (the same used in Grecian temples)--or a simpler 1/1.5. I know this could sound as a vague question but I wonder if someone has successfully experimented in this sense with any technique to consistently render figures across a LaTex document (maybe by setting in the preamble base- line values as variable to be used across the document--still allowing locally for minor tweaks).


title: Why two intersected paths can't buildcycle in MetaPost?

text: Suppose that I have two path:               beginfig(0)     u:=10pt;     vardef randomcirc(expr O, r, w) =        save p,i; pair p; numeric i;         p=O+right*r;         p for i=1 upto 9: .. (p rotatedaround(O, 36i))+(uniformdeviate w, uniformdeviate w) endfor .. cycle     enddef;     path pat[];     pair p[];     p0:=(0,5u); p3:=(-8u,0);     pat0:=randomcirc(p0,8u,.5u);     pat3:=randomcirc(p3,5u,0.4u);     fill buildcycle(pat0, pat3) withcolor red;     draw pat0; draw pat3;     endfig;      why their intersection are not filled with red color? I think it's due to the precision of MetaPost too low, how to fix it?


title: Error?? texmaker's build-in viewer

text: I made a eps file from gnuplot. But, texmaker's build-in viewer can't view it correctly.Other viewer works. The problem is that the Greek letters change to a diifferent letter.And some other letter's too. example: mu to "propotion", pi to "unequal". alpha, beta and chi are viewed correctly. What is wrong??? gnuplot code               set terminal postscript enhanced 'Helvetica, 50'     set output "picture.eps"     plot x title "{/Symbol abcmp\325\326\327}"      tex code               \documentclass{article}     \usepackage[dvipdfmx]{graphicx}     \begin{document}     \begin{figure}     \includegraphics[width=10cm]{picture.eps}     \end{figure}     \end{document}      They are viewing the same PDF file made from Texmaker. Texmaker's build-in viewer ![Texmaker's build-in viewer](http://i.stack.imgur.com/xdYZJ.png) Adobe Reader ![Adobe Reader](http://i.stack.imgur.com/IGdbs.png) Thanks for answering my question, but it doesn't work.I tried this.               set terminal postscript eps enhanced color 'Times, 30'     set output 'picture.eps'     plot x title "$\\alpha \\beta \\chi \\mu \\pi \\prod \\sqrt$",\     -x title '$\\alpha \\beta \\chi \\mu \\pi \\prod \\sqrt$',\     x/2 title "$\alpha \beta \chi \mu \pi \prod \sqrt$",\     -x/2 title '$\alpha \beta \chi \mu \pi \prod \sqrt$'      ![enter image description here](http://i.stack.imgur.com/T6Gn3.png) The Texmaker is `Texmaker4.1.1`. I "was" using `latex(platex)` and `dvipdfm(dvipdfmx)`. `latex -version` > pdfTeX 3.1415926-1.40.11+tagged-pdf-2.2 (Web2C 2010)   >  kpathsea version 6.0.0   >  Copyright 2010 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).   >  There is NO warranty.   >  Redistribution of this software is covered by the terms of both the pdfTeX > copyright and the Lesser GNU General Public License.   >  For more information about these matters, see the file named COPYING and > the pdfTeX source.   >  Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh > (pdfTeX).   >  Compiled with libpng 1.4.4; using libpng 1.4.4   >  Compiled with zlib 1.2.5; using zlib 1.2.5   >  Compiled with xpdf version 3.02pl5 `platex -version` > pdfTeX 3.1415926-1.40.11+tagged-pdf-2.2 (Web2C 2010)   >  kpathsea version 6.0.0   >  Copyright 2010 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).   >  There is NO warranty.   >  Redistribution of this software is covered by the terms of both the pdfTeX > copyright and the Lesser GNU General Public License.   >  For more information about these matters, see the file named COPYING and > the pdfTeX source.   >  Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh > (pdfTeX).   >  Compiled with libpng 1.4.4; using libpng 1.4.4   >  Compiled with zlib 1.2.5; using zlib 1.2.5   >  Compiled with xpdf version 3.02pl5 `dvipdfmx --help` > This is dvipdfmx-20120420 by the DVIPDFMx project team,   >  modified for TeX Live,   >  an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks. I installed new `latex(platex)` and `dvipdfmx`, but it doesn't work neither. `platex -version` > e-pTeX 3.14159265-p3.5-130605-2.6 (sjis) (TeX Live 2014/W32TeX)   >  kpathsea version 6.2.0   >  ptexenc version 1.3.2   >  Copyright 2014 D.E. Knuth.   >  There is NO warranty.   >  Redistribution of this software is covered by the terms of both the e-pTeX > copyright and the Lesser GNU General Public License.   >  For more information about these matters, see the file named COPYING and > the e-pTeX source.   >  Primary author of e-pTeX: Peter Breitenlohner. `dvipdfmx --version` > This is dvipdfmx Version 20140317 by the DVIPDFMx project team,   >  modified for TeX Live,   >  an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks. I tried hard, and finally I did it! Thanakyou. but there are few problems. see below.   gnuplot code               set terminal epslatex size 9cm,7cm       set output 'picture_test.tex'       set xlabel '$x$'       set ylabel '$\left(\frac{\mu\sin(x)}{x}\right)^{2\alpha}$'       set xrange [-10:10]       set yrange [-10:10]       plot x title "abc$\\alpha \\beta \\chi \\mu \\pi \\prod \\sqrt{123}$",-x       set output       set terminal wxt      tex code               >\documentclass{article}       \usepackage{graphicx}       \usepackage{epstopdf}       \begin{document}       \begin{figure}[htbp]       \centering       \input{picture_test}       \caption{graph$graph$}       \end{figure}       \end{document}        Texmaker User Quick Build Command               platex -interaction=nonstopmode %.tex|dvips %.dvi|ps2eps -f %.ps|epstopdf %.eps      Warnings               ....Package epstopdf Warning: Drivers other than `pdftex.def' are not supported....      I removed the texcode `\usepackage{epstopdf}`, then it dissapeared. Texmaker Build-in Viewer ![enter image description here](http://i.stack.imgur.com/x2Idc.png) the problem's is that the picture size is too big? it doesn't fit in to the page.   I have a another question, how can I call build-in viewer from the User Quick Build command? Nevermind these questions. I got it.   I changed tex code to`\usepackage[dvipdfmx]{graphicx}`and the command to `latex`(platex)and`dvipdfmx`. It works! ![enter image description here](http://i.stack.imgur.com/tUBCF.png)


title: Book fancyhdr confusion

text: I am writing my master's thesis and would like to have my headers as in this book. I would like my even pages with the page number in the left margin and the chapter aligned to the left. My odd pages should have the page number in the right margin, and the section number aligned to the right. Somewhat opposite to the example presented in the fancyhdr manual (p. 13):               \documentclass{book}     \usepackage{fancyhdr}     \pagestyle{fancy}     \usepackage{calc}     \fancyheadoffset[LE,RO]{\marginparsep+\marginparwidth}     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}     \fancyhf{}     \fancyhead[LE,RO]{\bfseries\thepage}     \fancyhead[LO]{\bfseries\rightmark}     \fancyhead[RE]{\bfseries\leftmark}     \fancypagestyle{plain}{%         \fancyhead{} % get rid of headers         \renewcommand{\headrulewidth}{0pt} % and the line     }      However, I am unable to edit this code to my liking, after having fiddled with it for an hour. Can you guys and gals help a fella out? Left page: ![Left page.](http://i.stack.imgur.com/Y1l5S.png) Right page: ![Right page.](http://i.stack.imgur.com/Cb4PB.png)


title: How can I set the width of a landscape figure to the textwidth?

text: I would like to have a figure in landscape format to fill the whole page, i.e. I would like the width to be the textheight of a portrait page or the textwidth of a landscape page, respectively. Here is an example of my code:               \documentclass[a5paper, 11pt]{scrbook}          \usepackage{graphicx}     \usepackage{color}     \usepackage{pdflscape}              \begin{document}         \begin{landscape}      \begin{figure}      \centering      \def\svgwidth{\textwidth}      \input{figure.pdf_tex}      \caption{Example Figure}      \end{figure}     \end{landscape}         \end{document}      When running this through pdfLaTeX I get a landscape figure that is as wide as the textwidth of a portrait page. Using               \def\svgwidth{\textheight}      does not change the output. How can I get the figure to fill the whole page? * * * I cannot include figure.pdf since this format is not allowed to upload, but you can find figure.png further down. The following is the code content of figure.pdf_tex:               \begingroup%       \makeatletter%      \providecommand\color[2][]{%      \errmessage{(Inkscape) Color is used for the text in Inkscape, but the      package 'color.sty' is not loaded}%             \renewcommand\color[2][]{}%      }%      \providecommand\transparent[1]{%      \errmessage{(Inkscape) Transparency is used (non-zero) for the text in Inkscape, but the package 'transparent.sty' is not loaded}%        \renewcommand\transparent[1]{}%       }%      \providecommand\rotatebox[2]{#2}%     \ifx\svgwidth\undefined%     \setlength{\unitlength}{782.075bp}%      \ifx\svgscale\undefined%       \relax%      \else%       \setlength{\unitlength}{\unitlength * \real{\svgscale}}%      \fi%      \else%     \setlength{\unitlength}{\svgwidth}%      \fi%      \global\let\svgwidth\undefined%      \global\let\svgscale\undefined%      \makeatother%      \begin{picture}(1,0.48489595)%       \put(0,0){\includegraphics[width=\unitlength]{figure.pdf}}%       \put(0.21413974,0.24055332){\color[rgb]{0,0,0}\makebox(0,0)     [lb]{\smash{Text}}}%     \end{picture}%     \endgroup%      ![figure](http://i.stack.imgur.com/DjqnM.png)


title: TikZ rectangle split parts with fixed height

text: I was wondering if there is a way to set the height of rectangle split parts. I had no luck finding something in the pgfmanual. (Using `\phantom` seems just like a quickfix.) Here is an example to illustrate my problem.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes}     \tikzstyle{data}=[rectangle split,rectangle split parts=2,draw,text centered]          \begin{document}     \begin{tikzpicture}[node distance=2cm]              \node [data]                (A)    {data \nodepart{second} \phantom{null}};         \node [data, right of=A]    (B)    {data};         \node [data, right of=B]    (C)    {data \nodepart{second} null};          \end{tikzpicture}     \end{document}      **Output** ![Result of the example.](http://i.stack.imgur.com/x5JFZ.png)


title: captions not appearing below subfigure

text: Code:               \documentclass[fleqn,11pt,a4paper]{article}     \usepackage{geometry,array,graphicx,float,caption}     \usepackage{subcaption}          \begin{document}     \begin{figure}[H]         \centering         \begin{subfigure}{0.5\textwidth}             \includegraphics[width=6cm]{initial_normal.eps}             \caption{Normal Distribution}             \label{fig1a}         \end{subfigure}%         \begin{subfigure}{0.5\textwidth}[H]             \includegraphics[width=6cm]{initial_uniform.eps}             \caption{Uniform Distribution}             \label{fig1b}         \end{subfigure}     \caption{distributions}     \end{figure}     \end{document}      The captions should come below the figure but I am getting them to the right of the figures and the caption text is aligned centrally with respect to the page instead of the subfigure. Am I making a mistake here?


title: LuaLaTeX and PDF Viewer

text: Is there any way to make Texmaker automatically display my LuaLaTeX generated PDF in his internal PDF viewer ? It works if I use an external PDF viewer: > lualatex --interaction=nonstopmode %|"C:\Program Files (x86)\Foxit > Software\Foxit Reader/Foxit Reader.exe" %.pdf But then I have to manually close the PDF to run LuaLaTeX again. With pdfLaTeX this works automatically, but LuaLaTeX can't seem to find the PDF. (I'm using Texmaker 4.0.2, MikTeX 2.9 and Windows 7)


title: LaTeX in iBooks Author

text: I first what to thank everyone, I have been trolling around for a while and getting tons of help from the entire community. I am looking to see if anyone has had experience with iBooks Author and LaTeX. And most importantly made a list of what works and what doesn't work. How do you use packages within iBooks Author? I am sure there a lot of us with the same questions. Thank you and I look forward to see where this goes.


title: Set tipa font to Times for phonetic characters

text: I've read in the tipa manual that you can have the tipa font set as Computer Modern (the default) or Times. I'm using Libertine, so Computer Modern doesn't look great, and Times would look better. However, I'm not sure how to change the tipa font to Times without changing the whole document to Times. I figure there must be a way if it's built in. Any ideas? ![enter image description here](http://i.stack.imgur.com/Pztmf.png)


title: Can I change the options of an individual vertex in \Vertices?

text: Consider the following code that produces vertices on a line.               \documentclass[12pt,a4paper]{article}     \usepackage{tkz-graph}          \begin{document}          \begin{figure}     \begin{tikzpicture}          \GraphInit[vstyle=Classic]     \tikzset{VertexStyle/.append style = {minimum size = 8pt, inner sep = 0pt}}               % Lpos=90 now affects every vertex in this "set"!     \Vertices[Lpos=90,unit=2]{line}{a,b,c,d,e,f}          \end{tikzpicture}     \end{figure}          \end{document}      By adding things like `Lpos=90` as an option to `\Vertices`, I can affect the style of each vertex in the "set" that happens to be a `line`. However, is it possible to set options for individual options in a "set"? For example, could I pass in some options to only have a label visible for say the vertices b and e? **Motivation:** I already have a picture using a `line`, and other vertices that depend on the vertices in it. However, I realized some vertices on the `line` need a label. I'd like to avoid removing the `\Vertices` command and drawing each vertex on the line as an individual vertex.


title: auto-starting itemize with \item?

text: I frequently write slides in beamer, and besides a few macros I use (e.g. for two-column frame), I often type `\begin{itemize}` and `\end{itemize}`. What would be a nice TeXish way for either starting the itemization automatically when `\item` outside of itemization/enumeration is encountered? Or alternately, how to write a macro which would do something like (pseudocode, this does not work unfortunately as it is):               \documentclass{beamer}     \usepackage{etextools}     \def\firstitem{\begin{itemize}\AfterGroup{\end{itemize}}\item}     \begin{document}         \begin{frame}{title}             \firstitem a             \item b         \end{frame}     \end{document}


title: The role of %&latex at the beginning of a source latex file

text: Could someone please explain what is the role of `%&latex` which is put in a source LaTeX file before `\begin{document}` command?


title: Vertically centered tilde with \raisebox includes space when copying from pdf

text: I'm trying to use the hack suggested here (option 1) in order to obtain a vertically centered tilde (using Computer Modern font) and it works fine. However, when I try to copy this symbol **together** with some succeeding text, e.g. `~/foo`, from the PDF into an editor or terminal it ends up including an extra space between `~` and the succeeding symbols, i.e. `~ /foo`. Note that this does not happen when copying simply the `~`. The command I use to obtain the vertically centered tilde is: `\newcommand{\ctilde}{\raisebox{0.5ex}{\texttildelow}}` I'm mainly using this in a texttt- or verbatim-environment if that can be of any help, but the problem is present in normal text also. Here's a MWE:               \documentclass{article}     \usepackage{textcomp}          \newcommand{\ctilde}{\raisebox{0.5ex}{\texttildelow}}          \begin{document}          \ctilde{}/foo          \end{document}      **Edited to add:** What's added after `~` depends on the PDF reader I'm copying from. On Windows, when copying from SumatraPDF an extra space is added, while using FoxitPDF a newline is added! Trying the native PDF-reader in Google Chrome copying works correctly (i.e. no spaces added), and also in Adobe Reader (according to Steven B. Segletes in the comments).


title: Problems installing BasicTex on Mac OS

text: I was following this tutorial to install BasicTex. Running `latex` command immediately returns without any warning or error. My environment variables are:               $ echo $PATH     /usr/local/texlive/2012basic/bin/universal-darwin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin     $ which latex     /usr/local/texlive/2012basic/bin/universal-darwin/latex      How should I troubleshoot it further?


title: Public database of bibtex entires of LaTeX packages

text: When I want to cite a research paper, I typically look up the respective BibTeX entry in some online catalogue (such as DBLP or the ACM and IEEE digital libraries for computer science). The quality of the entries is not always great, but at least a good start. Now I am in the situation that I am writing a research article in which I also need to cite a couple of LaTeX packages. Of course, I could just enter all the respective BibTeX entries manually. However, given how many package documentations cite other packages, I hope that there is some BibTeX database of all CTAN packages available, somewhere? I found it extremely hard to look for this. As you can imagine, googling for `"latex package" AND bibliography` or variants thereof does yield many, but no useful results.


title: Alphabetical order in natbib

text: I have read questions about this, and people say that it is just to include the `natbib` package and the `plainnat` style. For some reason my references will not sort alphabetically. Any help on this would be much appreciated! I am really new to LaTeX ... My commands:               \documentclass[a4paper,norsk]{article}     \usepackage{amstext}     \usepackage{makeidx}     \usepackage{graphicx}     \usepackage[comma,authoryear]{natbib}     \usepackage[norsk]{babel}     \usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}     \pagestyle{plain}          \begin{document}          \begin{thebibliography}{56}          \end{thebibliography}          \printindex          \bibliographystyle{plainnat}          \end{document}


title: siunitx update breaks things

text: I upgraded to v2.1 of `siunitx` since the version in ubuntu's package manager (1.3?) is pretty old. Things seem to have broken. I might have got something wrong with the installation, or I might be missing a dependency or something. I can't read log files well enough to work out what the issue might be. I installed it by copying the `.dtx` file to my local texmf tree under `texmf/tex/latex/siunitx/` and then running `tex siunitx.sty` from that directory. When I try and use the package, I get this error:               ! Undefined control sequence.     \siunitx_cs_if_macro:NT #1->\exp_last_unbraced:No                                                        \siunitx_cs_if_tl_aux:w {\...     l.6 \begin{document}          Runaway argument?     {\token_to_meaning:N \bar macro\q_stop }{\prg_return_true: }{\prg_return_false: \ETC.     ! Paragraph ended before \siunitx_cs_if_tl_aux:w was complete.     <to be read again>                         \par      l.7       Here is `\listfiles`                *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)      siunitx.sty    2010/11/24 v2.1f A comprehensive (SI) units package        expl3.sty    2009/08/12 v1458 L3 Experimental code bundle wrapper      l3names.sty    2009/08/08 v1452 L3 Experimental Naming Scheme for TeX Primitives     l3basics.sty    2009/08/08 v1453 L3 Experimental basic definitions      l3expan.sty    2009/08/16 v1464 L3 Experimental Argument Expansion module         l3tl.sty    2009/09/03 v1505 L3 Experimental Token Lists        l3num.sty    2009/08/08 v1451 L3 Experimental token numbers     l3intexpr.sty    2009/03/20 v1086 L3 Integer Expressions      l3quark.sty    2009/05/31 v1365 L3 Experimental Quark Commands        l3seq.sty    2009/06/17 v1415 L3 Experimental sequences and stacks       l3toks.sty    2009/06/14 v1412 L3 Experimental Token Registers        l3int.sty    2009/05/28 v1362 L3 Experimental Integer module        l3prg.sty    2009/09/20 v1545 L3 Experimental control structures      l3clist.sty    2009/08/05 v1441 L3 Experimental comma separated lists      l3token.sty    2009/09/22 v1550 L3 Experimental token investigation and manipulation         l3io.sty    2009/05/31 v1369 L3 Experimental i/o module       l3prop.sty    2009/09/16 v1536 L3 Experimental Property Lists        l3msg.sty    2009/09/01 v1502 L3 Experimental LaTeX Messages module       l3skip.sty    2009/05/28 v1362 L3 Experimental skip registers        l3box.sty    2009/06/01 v1375 L3 Experimental Box module     l3keyval.sty    2009/07/13 v1424 L3 Experimental keyval processing       l3keys.sty    2009/09/17 v1542 L3 Experimental key-value support     l3precom.sty    2009/08/08 v1453 L3 Experimental precompilation module       l3calc.sty    2009/05/28 v1362 L3 Experimental calc module       l3xref.sty    2009/05/28 v1362 L3 Experimental cross referencing       l3file.sty    2009/05/28 v1352 L3 Experimental file loading      amstext.sty    2000/06/29 v2.01       amsgen.sty    1999/11/30 v2.0        array.sty    2008/09/09 v2.4c Tabular extension package (FMi)     l3keys2e.sty    2009/08/24 v1494 Parsing LaTeX3 keyvals as LaTeX2e package options       xparse.sty    2009/08/31 v1497 Generic document command parser     translator.sty    2007/03/11 ver 1.00       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)     translator-language-mappings.tex      And a MWE:               \documentclass{article}     \listfiles     \usepackage{siunitx}     \begin{document}     Foo     \end{document}


title: TOC Section & Subsection coloring

text: Is it possible to create a TOC with section headings in one color and subsection headings in different color.               \tableofcontents     \setcounter{tocdepth}{2}      I am using above lines to create TOC, do I need to use any special package?


title: MiKTeX and Sphinx : problems on complex TeX output

text: I've installed the complete package of **MiKTeX 2.8** because I have to manage the PDF rendering of a TeX file generated by _Sphinx 1.0.4_ (Python 2.6) from a ReST source file. I underline that the HTML output went fine either for Mathematical or graphical part, but when I take the `.tex` file and try to convert via **pdfLaTeX** I catch over 200 recursive errors. I don't know if the OS is the key, I'm running Sphinx under Windows 7 (no Cygwin) and all works but it generates errors for tables that I haven't. I'll attach the log file with the main errors extracted. It refers on a _mathematical research_.               (C:\Python26\Scripts\_build\latex\sphinxmanual.cls     Document Class: sphinxmanual     2009/06/02 Document class (Sphinx     manual)     (C:\Python26\Scripts\MikTex\tex\latex\base\report.cls     Document Class: report 2007/10/19     v1.4h Standard LaTeX document class     (C:\Python26\Scripts\MikTex\tex\latex\base\size10.clo)))     (C:\Python26\Scripts\MikTex\tex\latex\base\inputenc.sty     (C:\Python26\Scripts\MikTex\tex\latex\base\utf8.def     (C:\Python26\Scripts\MikTex\tex\latex\base\t1enc.dfu)     (C:\Python26\Scripts\MikTex\tex\latex\base\ot1enc.dfu)     (C:\Python26\Scripts\MikTex\tex\latex\base\omsenc.dfu)))     (C:\Python26\Scripts\MikTex\tex\latex\base\fontenc.sty     (C:\Python26\Scripts\MikTex\tex\latex\base\t1enc.def))     (C:\Python26\Scripts\MikTex\tex\generic\babel\babel.sty     *************************************     * Local config file bblopts.cfg used     *(C:\Python26\Scripts\MikTex\tex\latex\00miktex\bblopts.cfg)     (C:\Python26\Scripts\MikTex\tex\generic\babel\english.ldf     (C:\Python26\Scripts\MikTex\tex\generic\babel\babel.def)))     (C:\Python26\Scripts\MikTex\tex\latex\psnfss\times.sty)     (C:\Python26\Scripts\_build\latex\fncychap.sty)     (C:\Python26\Scripts\MikTex\tex\latex\tools\longtable.sty)     (C:\Python26\Scripts\_build\latex\sphinx.sty     (C:\Python26\Scripts\MikTex\tex\latex\base\textcomp.sty     (C:\Python26\Scripts\MikTex\tex\latex\base\ts1enc.def     (C:\Python26\Scripts\MikTex\tex\latex\base\ts1enc.dfu)))     (C:\Python26\Scripts\MikTex\tex\latex\fancyhdr\fancyhdr.sty)     (C:\Python26\Scripts\MikTex\tex\latex\fancybox\fancybox.sty     Style option: `fancybox' v1.4     <2010/05/15> (tvz) )     (C:\Python26\Scripts\MikTex\tex\latex\titlesec\titlesec.sty)     (C:\Python26\Scripts\_build\latex\tabulary.sty     (C:\Python26\Scripts\MikTex\tex\latex\tools\array.sty))     (C:\Python26\Scripts\MikTex\tex\latex\ams\math\amsmath.sty     For additional information on amsmath,     use the `' option.     (C:\Python26\Scripts\MikTex\tex\latex\ams\math\amstext.sty     (C:\Python26\Scripts\MikTex\tex\latex\ams\math\amsgen.sty))     (C:\Python26\Scripts\MikTex\tex\latex\ams\math\amsbsy.sty)     (C:\Python26\Scripts\MikTex\tex\latex\ams\math\amsopn.sty))     (C:\Python26\Scripts\MikTex\tex\latex\base\makeidx.sty)     (C:\Python26\Scripts\MikTex\tex\latex\framed\framed.sty)     (C:\Python26\Scripts\MikTex\tex\latex\graphics\color.sty     (C:\Python26\Scripts\MikTex\tex\latex\00miktex\color.cfg)     (C:\Python26\Scripts\MikTex\tex\latex\pdftex-def\pdftex.def))     (C:\Python26\Scripts\MikTex\tex\latex\fancyvrb\fancyvrb.sty     Style option: `fancyvrb' v2.7a, with     DG/SPQR fixes, and firstline=lastline     fix  <2008/02/07> (tvz)     (C:\Python26\Scripts\MikTex\tex\latex\graphics\keyval.sty))     (C:\Python26\Scripts\MikTex\tex\latex\threeparttable\threeparttable.sty)     (C:\Python26\Scripts\MikTex\tex\latex\mdwtools\footnote.sty)     (C:\Python26\Scripts\MikTex\tex\latex\wrapfig\wrapfig.sty)     (C:\Python26\Scripts\MikTex\tex\latex\ltxmisc\parskip.sty)     (C:\Python26\Scripts\MikTex\tex\latex\graphics\graphicx.sty     (C:\Python26\Scripts\MikTex\tex\latex\graphics\graphics.sty     (C:\Python26\Scripts\MikTex\tex\latex\graphics\trig.sty)     (C:\Python26\Scripts\MikTex\tex\latex\00miktex\graphics.cfg)))     (C:\Python26\Scripts\MikTex\tex\plain\misc\pdfcolor.tex)     (C:\Python26\Scripts\MikTex\tex\latex\hyperref\hyperref.sty     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\ltxcmds.sty)     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\infwarerr.sty)     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\kvsetkeys.sty     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\etexcmds.sty))     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\pdfescape.sty     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\pdftexcmds.sty     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\ifluatex.sty)))     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\ifpdf.sty)     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\ifvtex.sty)     (C:\Python26\Scripts\MikTex\tex\generic\ifxetex\ifxetex.sty)     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\hycolor.sty     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\xcolor-patch.sty))     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\letltxmacro.sty)     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\kvoptions.sty)     (C:\Python26\Scripts\MikTex\tex\latex\hyperref\pd1enc.def)     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\intcalc.sty)     (C:\Python26\Scripts\MikTex\tex\latex\00miktex\hyperref.cfg)     (C:\Python26\Scripts\MikTex\tex\latex\ltxmisc\url.sty)     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\bitset.sty     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\bigintcalc.sty))     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\atbegshi.sty))          Package hyperref Message: Driver     (autodetected): hpdftex.          (C:\Python26\Scripts\MikTex\tex\latex\hyperref\hpdftex.def     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\atveryend.sty)     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\rerunfilecheck.sty     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\uniquecounter.sty)))     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\hypcap.sty))     Writing index file TiberCAD.idx     (C:\Python26\Scripts\_build\latex\TiberCAD.aux)     (C:\Python26\Scripts\MikTex\tex\latex\base\ts1cmr.fd)     (C:\Python26\Scripts\MikTex\tex\latex\psnfss\t1ptm.fd)     (C:\Python26\Scripts\MikTex\tex\context\base\supp-pdf.mkii     [Loading MPS to PDF converter (version     2006.09.02).] ) (C:\Python26\Scripts\MikTex\tex\latex\hyperref\nameref.sty     (C:\Python26\Scripts\MikTex\tex\latex\oberdiek\refcount.sty)     (C:\Python26\Scripts\MikTex\tex\generic\oberdiek\gettitlestring.sty))     (C:\Python26\Scripts\_build\latex\TiberCAD.out)     (C:\Python26\Scripts\_build\latex\TiberCAD.out)     Underfull \hbox (badness 10000) in     paragraph at lines 108--108          (C:\Python26\Scripts\MikTex\tex\latex\psnfss\t1phv.fd)     [1{C:/ProgramData/MiKTeX     /2.9/pdftex/config/pdftex.map}] [2]     (C:\Python26\Scripts\_build\latex\TiberCAD.toc)     Adding blank page after the table of     contents. pdfTeX warning (ext4):     destination with the same identifier     (name{page.i}) has  been already used,     duplicate ignored <to be read again>                         \relax  l.108 \tableofcontents    [1]pdfTeX warning     (ext4): destination with the same iden     tifier (name{page.ii}) has been     already used, duplicate ignored <to be     read again>           ! Undefined control sequence. l.1     \chapter{Drift-diffusion simulation of     electrons and holes}          ! LaTeX Error: Missing     \begin{document}.          Overfull \hbox (7.80904pt too wide) in     paragraph at lines 12--15     $\OML/cmm/m/it/10 P$          Overfull \hbox (20.0pt too wide) in     paragraph at lines 19--20 []          ! LaTeX Error: \caption outside float.          l.63 \caption  {Solution/Plot     variables}          ! LaTeX Error: \begin{document} ended     by \end{table}.          l.65 \end{table}          ! LaTeX Error: Something's     wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX     Companion for explanation. Type  H     <return>  for immediate help.  ...                   l.295 \end{tabulary}          ! Missing } inserted. <inserted text>                      } l.671 \end{tabulary}


title: How can I import an exam or assignment from Word into LaTeX?

text: This is a counterpart to "How can I typeset an exam or assignment paper in LaTeX?", which was from a teacher looking for a template to compose assignments and exams. I'm a student, and I'd like to submit PDFs or printouts composed in LaTeX in response to assignments submitted as Word documents. As a math and engineering student, I regularly receive emailed or uploaded assignments with .doc (and now .docx) attachments, which generally contain a numbered list of questions (often with parts A, B, C, etc.) to answer. Styles or other advanced Word structuring tools are rarely used. These assignments also frequently contain equations, tables, and images or Microsoft drawing objects (Usually circuits, graphs, or timing diagrams). I don't really mind copying the images over, or, if they're simple, drawing them myself (as I'll likely have to make changes to it in my answer anyways). However, on a long math assignment, the equations get tedious, and a little error in copying is a big problem. From the tug.org converter page, I see winw2ltx, Word2TeX and Word-To-LaTeX (These utilities have such clever names...) which have some support for equation transformation. One thing which isn't clear from the documentation is whether the MathType extension to Word must be used to create the equation, or whether it can simply convert an Equation Editor or .docx equation to LaTeX if it's installed on my computer. The holy grail of answers to this question would be a utility which:   * Recognizes MS Word numbered lists and outlines (I, 1, a, i, etc.).   * Is faster than copy-pasting the text of each question into, say, the exam document class, writing the equations, and drawing the diagrams. This is what I do right now. Not too bad, but it adds half an hour to every assignment.   * Makes better looking documents than the original Word document. I'd like to do a little evangelism here.   * Includes support for equations, tables, and images.   * Can import both .doc and .docx files. Saving the .docx as a .doc is not acceptable, as it renders the equations as bitmaps. Saving the .doc as .docx might be acceptable. I don't really need it to structure the document; if it just sticks some selected text into a section of my LaTeX document, that would be plenty.


title: Cleveref range format for gb4e “(1a-c)"

text: I managed to get cross-referencing with cleveref to examples in the format "examples (1a-1c)" using               \crefrangeformat{xnumi}{examples~(#3#1#4--#5#2#6)}      but how can I get "examples (1a-c)"? I found this question, but I'm afraid the solution is dependent to the package in use, in this case `gb4e`, so I decided to post my answer anyway. Here's my MWE:               \documentclass[a4paper]{article}     \usepackage{gb4e}     \usepackage{cleveref}     \newcommand{\crefrangeconjunction}{--}     \crefname{xnumi}{example}{examples}     \creflabelformat{xnumi}{(#2#1#3)}     \crefname{xnumii}{example}{examples}     \creflabelformat{xnumii}{(#2#1#3)}     \crefname{xnumiii}{example}{examples}     \creflabelformat{xnumiii}{(#2#1#3)}     \crefname{xnumiv}{example}{examples}     \creflabelformat{xnumiv}{(#2#1#3)}     \crefrangeformat{xnumi}{examples~(#3#1#4--#5#2#6)}     \crefrangeformat{xnumii}{examples~(#3#1#4--#5#2#6)}     \crefrangemultiformat{xnumii}{examples~(#3#1#4--#5#2#6)}{ and~(#3#1#4--#5#2#6)}{, (#3#1#4--#5#2#6)}{ and~(#3#1#4--#5#2#6)}          \begin{document}          \section{Prova}          \begin{exe}     \ex\label{e:pro} uno due tre     \begin{xlist}     \ex\label{e:1} uno     \ex\label{e:2} due     \ex\label{e:3} tre     \ex\label{e:4} quattro     \end{xlist}     \end{exe}          In \cref{e:pro}, in \crefrange{e:1}{e:3}.          \end{document}


title: Arrange four images with letter captions and vertical/horizontal separators

text: I would like to arrange four images in a similar style to this code taken slightly modified from Four Arranged Figures are offset .               \documentclass{article}     \usepackage[demo]{graphicx} % leave off demo option in real program     \renewcommand{\thefigure}{\alph{figure}}     \begin{document}               \begin{figure}         \begin{minipage}[t]{0.5\textwidth}     \includegraphics[width=\linewidth]{a.pdf}     \caption{a)}     \label{fig:immediate}     \end{minipage}          \begin{minipage}[t]{0.5\textwidth}     \includegraphics[width=\linewidth]{b.pdf}     \caption{b)}     \label{fig:proximal}     \end{minipage}               \begin{minipage}[t]{0.5\textwidth}     \includegraphics[width=\linewidth]{c.pdf}     \caption{c)}     \label{fig:distal}     \end{minipage}          \begin{minipage}[t]{0.5\textwidth}     \includegraphics[width=\linewidth]{d.pdf}     \caption{d)}     \label{fig:combined}     \end{minipage}          \end{figure}     \end{document}      My images are mostly white so I would like them to touch but to add a vertical and horizontal line in a cross shape to separate them. The two lines should cross in the middle and stretch to the top and bottom and left and right of the images respectively.


title: copy&paste: diacritics and special characters

text: Why can't I correctly copy&paste from my pdf documents (created by LuaLaTeX)? E.g., I get `Faḫr al-Din̄ al-Rāzī` instead of `Faḫr al-Dīn al-Rāzī`. Surprisingly, most other things (including Arabic text, Greek text, umlauts work well). I use (almost without any options):   * hyperref   * csquotes   * babel   * microtype   * xspace   * ellipsis


title: no Bounding Box

text: Using TexMaker I am compiling with PDFLaTex the following and I get the error: ! LaTeX Error: Cannot determine size of graphic in Figures/chl.png (no Bounding Box).               \documentclass[draft,grl]{AGUTeX}     \usepackage[dvipdf]{graphicx}     \begin{document}          \begin{figure}[H]     \includegraphics[width=7.5cm]{Figures/chl.png}     \end{figure}     \end{document}


title: Running the animate package documentation

text: I downloaded the tex file for the documentation of `animate` package by Alexander Grahn and tried to run it on MikTeX instead of giving me the PDF output it generate the following error:               ! LaTeX Error: Please use LaTeX to compile this documentation.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.46   \makeatother      Kindly let me know how can I fix this.