title: How to use a local variable inside a macro in expl3

text: I extended egregs answer by defining a macro, that creates and initializes an fp value in 1 line. Then put the variables into a sequence and printed the sequence:               \documentclass{article}     \usepackage{xparse}     \usepackage{expl3}     \setlength{\parindent}{0cm}     \begin{document}     \ExplSyntaxOn     \NewDocumentCommand{\newfpvar}{m}{\fp_new:N #1}     \NewDocumentCommand{\setfpvar}{mm}{\fp_set:Nn #1 { #2 }}     \NewDocumentCommand{\getfpvar}{m}{\fp_use:N #1}          %my new macro     \NewDocumentCommand{\define_fp_var}{mm}{       \newfpvar{#1}       \setfpvar{#1}{#2}     }          %define 3 variables     \define_fp_var{\One}{1}     \define_fp_var{\Two}{2}     \define_fp_var{\Three}{3}          %put them into sequence     \seq_new:N \fp_seq     \seq_put_right:Nn \fp_seq {\One}     \seq_put_right:Nn \fp_seq {\Two}     \seq_put_right:Nn \fp_seq {\Three}          %print sequence     \seq_map_inline:Nn \fp_seq     {       \getfpvar{#1}\\     }          \ExplSyntaxOff     \end{document}      Prints: ![enter image description here](http://i.stack.imgur.com/l6okj.png) I tried to create a macro, when I can define a value and push it into a sequence in 1 line, but it doesn't work:               \documentclass{article}     \usepackage{xparse}     \usepackage{expl3}     \setlength{\parindent}{0cm}     \begin{document}     \ExplSyntaxOn     \NewDocumentCommand{\newfpvar}{m}{\fp_new:N #1}     \NewDocumentCommand{\setfpvar}{mm}{\fp_set:Nn #1 { #2 }}     \NewDocumentCommand{\getfpvar}{m}{\fp_use:N #1}          %my new macro     \NewDocumentCommand{\define_fp_var}{mm}{       \newfpvar{#1}       \setfpvar{#1}{#2}     }          %this doesn't work     %#1 - sequence name     %#2 - value     \NewDocumentCommand{\seq_put_fp_var_right}{mm}{       \group_begin:       %variable redefined       \define_fp_var{\temp}{#2}       \seq_put_right:Nx #1 \temp       \group_end:     }          \seq_new:N \fp_seq     \seq_put_fp_var_right \fp_seq {1}     \seq_put_fp_var_right \fp_seq {2}     \seq_put_fp_var_right \fp_seq {3}          \seq_map_inline:Nn \fp_seq     {       \getfpvar{#1}\\     }          \ExplSyntaxOff     \end{document}      Prints an error:               Control sequence \temp already defined.          l.28 \seq_put_fp_var_right \fp_seq {2}      How can I define a variable locally and store it in a sequence? I read this: LaTeX3: how to define a variable locally, but still don't understand, how to do the task.


title: \ell in MinionPro

text: Is it possible to use the `\ell` character from the default font when using MinionPro? If so, how? The documentation actually mentions `\ell` on page 20; the letter is supposed to be taken from MinionPro, I suspect that `\ell` is not part of the fonts I took from Acrobat Reader to install MinionPro. This example               \documentclass[11pt,a4paper,oneside]{book}     \usepackage{minionpro}     \begin{document}     $\ell$     \end{document}      only produces a crossed out box for me. Maybe with some LaTeX skill it is possible to use something like               \DeclareMathSymbol{\ell} {\mathord}{letters}{’140}      to take the `\ell` from Computermodern. Edit: Could someone try to reproduce this problem?


title: IEEEtran: centering (double-column) figure captions

text: I'm looking for a method to center the figure captions in single- and double- column mode. Here is my code               \documentclass[journal]{IEEEtran}          \usepackage[caption=false]{subfig}     \usepackage{tabularx,tikz}     \begin{document}     \begin{figure*}     \tikz \draw [black] (0,0) rectangle (\linewidth,1cm);     \caption{caption}     \end{figure*}     \begin{figure*}     \subfloat[]{\tikz \draw [black] (0,0) rectangle (\linewidth/2,1cm);}     \subfloat[]{\tikz \draw [black] (0,0) rectangle (\linewidth/2,1cm);}     \caption{title}     \end{figure*}     \begin{figure}     \tikz \draw [black] (0,0) rectangle (\linewidth,1cm);     \caption{caption}     \end{figure}     \end{document}      which gives: ![enter image description here](http://i.stack.imgur.com/WQyvg.png) ![enter image description here](http://i.stack.imgur.com/88nbl.png) ![enter image description here](http://i.stack.imgur.com/6mgUI.png)


title: how to resize easily a pstricks picture?

text: I test my figures in an standalone file, and when I obtain what I want, I pass to my main file with text. How can I do to adapt the size? Because, sometimes I want to put 3 images in a row and I need to resize the original pstricks pictures. Suppose this code typed by Herbert in other post:               \documentclass{article}     \usepackage{pstricks}     \newpsobject{pslineA}{psline}{linewidth=6\pslinewidth, linecolor=green}     \newpsobject{pslineB}{psline}{linewidth=10\pslinewidth, linecolor=red}          \begin{document}     \begin{pspicture}(5,5)       \psline(0,1)(5,1)       \psline[linewidth=1mm](0,2)(5,2)       \pslineA(0,3)(5,3)       \pslineB(0,4)(5,4)     \end{pspicture}     \end{document}      Are there any easy way with `psset/xunit/yunit`? I thought that changing numbers in               \psset{xunit=1cm,yunit=1cm}      I could obtain what I want, but... no! I change this values and the picture is with the same length.


title: "\thechapter" as prefixnumbers for bibliography with biblatex

text: I have a huge document and would like to do the following with biblatex:   1. Have one (actually, several) seperate bibliography for each chapter.   2. Add a prefix to each citation number to make them distinguishable.   3. Have that prefix be the (individual) chapter marker. This works relatively smoothly for the bibliography itself, but does not work for citations since at the time these marks are generated, the `\thechapter` variable seems to be zero. Minimal working example:               \documentclass{report}          \usepackage{filecontents}     \usepackage[backend=biber,defernumbers=true,citestyle=numeric]{biblatex}          \begin{filecontents}{bibliography.bib}     @book{citation,         title = {Title},         author = {Author, Some},         location = {The City},         publisher = {Publisher},         date = {2005}     }     \end{filecontents}          \addbibresource{bibliography.bib}          \begin{document}          \renewcommand{\thechapter}{A.7}     \section{Text}          This~\cite{citation} is a citation.          \printbibliography[heading=subbibliography,prefixnumbers={\thechapter-}]          \end{document}      will give me: ![Result of the code](http://i.stack.imgur.com/cTVuP.png)


title: pgfplots: plot data table until n-th line

text: Is there a way to plot only the first n-th lines of a data file using pgfplots? Currently I'm plotting the whole csv-file using (MWE):               \documentclass{article}          \usepackage{pgfplots}     \pgfplotsset{compat=1.11}          \begin{document}          \begin{tikzpicture}         \pgfplotsset{}         \begin{axis}             \addplot+[mark = none] table[col sep = semicolon, x index = 1, y index = 2]{data.csv};         \end{axis}          \end{tikzpicture}          \end{document}      whereas `data.csv` is as follows:               0;0;0;1;1     0.01;10;0.0905176;0.983244;0.928149     0.02;20;0.142047;0.973638;0.938638     0.03;30;0.178988;0.966722;0.938958     0.04;40;0.208729;0.961136;0.937353     0.05;50;0.234025;0.956371;0.935212     0.06;60;0.256216;0.952181;0.932922     0.07;70;0.276083;0.948423;0.930621     0.08;80;0.294132;0.945001;0.928367     0.09;90;0.310716;0.941853;0.926181     0.1;100;0.326089;0.938929;0.924071     0.11;110;0.340442;0.936195;0.922037     0.12;120;0.353923;0.933624;0.920079     0.13;130;0.366646;0.931194;0.918191     0.14;140;0.378706;0.928888;0.916371     0.15;150;0.390177;0.926692;0.914613     0.16;160;0.401124;0.924594;0.912914     0.17;170;0.411598;0.922585;0.911271     0.18;180;0.421644;0.920656;0.909679     0.19;190;0.4313;0.918799;0.908135     0.2;200;0.4406;0.91701;0.906636     0.21;210;0.449573;0.915282;0.90518     0.22;220;0.458243;0.91361;0.903764     0.23;230;0.466632;0.911992;0.902385     0.24;240;0.474761;0.910422;0.901042     0.25;250;0.482647;0.908898;0.899733     0.26;260;0.490306;0.907417;0.898456     0.27;270;0.497752;0.905976;0.897209     0.28;280;0.504997;0.904572;0.89599     0.29;290;0.512054;0.903205;0.894799     0.3;300;0.518932;0.90187;0.893633      How to plot only the first n-th lines of the given data table? Let's say the first 10 lines for the sake of convenience.


title: Reduce number of input files for group plot in pgfplots

text: In the `pgfplots` groupplot below, I have three sets of data represented by `data1`, `data2` and `data3`. Each of the data have three subtypes. And I need to plot a graph for each of the subtype. The file `data1.dat` has data for all the three subtypes. So I manually strip the file into three files as `data1-1.dat`, `data1-2.dat` and `data1-3.dat`. Is it possible to avoid manually splitting the file and refer to parts of the file. For example to access `type1` of `data1`, I can refer to the first `n` lines of `data1.dat` file and to access `type2` of `data1`, I can refer to the next `n` lines of the same file. The # of lines for each subtype is constant.               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}     \usetikzlibrary{matrix,pgfplots.groupplots}          \begin{document}     \begin{figure*}     \centering     \begin{tikzpicture}[scale=1.0, transform shape]         \begin{groupplot}[group style={group size= 1 by 3},height=5.9cm,width=8cm,xmode=log,log basis x={2}]             \nextgroupplot[ylabel={Type 1},xtick=data]                     \addplot[red,semithick,mark=triangle]   table{Data/data1-1.dat};    \label{plots:data1}                     \addplot[blue,semithick,mark=asterisk]  table{Data/data2-1.dat};    \label{plots:data2}                     \addplot[green, semithick,mark=o]           table{Data/data3-1.dat};  \label{plots:data3}                     \coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot             \nextgroupplot[ylabel={Type 2},xtick=data]                     \addplot[red,semithick,mark=triangle]   table{Data/data1-2.dat};                     \addplot[blue,semithick,mark=asterisk]  table{Data/data2-2.dat};                     \addplot[green, semithick,mark=o]           table{Data/data3-2.dat};             \nextgroupplot[xlabel={Input in powers of 2},ylabel={Type 3},xtick=data]                     \addplot[red,semithick,mark=triangle]   table{Data/data1-3.dat};                     \addplot[blue,semithick,mark=asterisk]  table{Data/data2-3.dat};                     \addplot[green, semithick,mark=o]           table{Data/data3-3.dat};                                     \coordinate (bot) at (rel axis cs:1,0);% coordinate at bottom of the last plot         \end{groupplot}         \path (top-|current bounding box.west)-- node[anchor=south,rotate=90] {\small Throughput} (bot-|current bounding box.west);         \path (top|-current bounding box.north)-- coordinate(legendpos) (bot|-current bounding box.north);         \matrix[matrix of nodes, anchor=south, draw, inner sep=0.2em, draw] at ([yshift=1ex]legendpos)         {             \ref{plots:data1}& data1&[5pt]             \ref{plots:data2}& data2&[5pt]             \ref{plots:data3}& data3\\         };     \end{tikzpicture}     \label{fig:throughput}     \end{figure*}     \end{document}      Output: ![enter image description here](http://i.stack.imgur.com/83ggj.png)


title: Why do these two tikzpictures result in different output?

text: The following document has two tikzpictures in it, and they result in slightly different output. Why is this? I don't understand how the use of `draw` works in one but not the other. In the first one, the outline shows up and the rectangle is filled; in the second one just the labels "A" and "B" appear.               \documentclass[a4paper]{amsart}          \usepackage{fullpage,tikz}     \xdefinecolor{lightgrey}{RGB}{220,220,220}          \begin{document}          \begin{center}\begin{tikzpicture}     [ box/.style = {draw, rectangle, inner sep = 3mm, fill = lightgrey}       ]     \node (A) at (0,0) [box] {$A$};     \node (B) at (2cm,0) [box] {$B$};     \draw [->] (A.east) -- (B.west);     \end{tikzpicture}\end{center}          \begin{center}\begin{tikzpicture}     \begin{scope}[draw, rectangle, inner sep = 3mm, fill = lightgrey]         \node (A) at (0,0) {$A$};         \node (B) at (2cm,0) {$B$};     \end{scope}     \draw [->] (A.east) -- (B.west);     \end{tikzpicture}\end{center}          \end{document}


title: Error on including large videos with media9

text: I am trying to include a video of 17MB using the media9 package in a beamer presentation (I am using MiKTeX 2.9 on Windows 7):               \documentclass{beamer}     \usepackage[utf8]{inputenc}     \usepackage{media9}     %\usepackage[bigfiles=true]{media9}          \begin{document}     \begin{frame}     first page     \end{frame}     \begin{frame}       \frametitle{Title}       \includemedia[         width=0.4\linewidth,         height=0.3\linewidth,         activate=pageopen,         addresource=myvideo.mp4,         flashvars={source=myvideo.mp4}       ]{}{VPlayer.swf}     \end{frame}     \end{document}      If I produce a pdf using pdflatex, it will work without a problem. If I use latex, dvi2ps, ps2pdf, however, I will get an error "TeX capacity exceeded". I already tried increasing the main memory as recommended in the media9 package documentation and on Problems embedding a video with multimedia an media9. This works for smaller videos, but not for the one I am trying to include. When I activate the bigfiles option, the log states 'MiKTeX GPL Ghostscript 9.00: Unrecoverable error, exit code 1' and no pdf output is produced. Any ideas how this can be fixed? UPDATE: With updated MiKTeX and media9 package v0.33, the error disappears. New problem: Now the first page is displayed in A4 paper size (as shown in the screenshot) ![screenshot](http://i.stack.imgur.com/VV9Yl.png) If I comment the `\includemedia` part out and keep everything else the way it is, the file is created with its two pages just fine.


title: Page number appears twice in the page

text: I don't know why I am getting two page numbers on the same page, one in the center and one on the right:               \documentclass[a4paper,12pt]{report}     \voffset=-1in          %setting the header     \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhead[LO,LE]{Mohammad Noorani Bakerally}     \fancyhead[RO,RE]{Pattern-Based Development}     \rfoot{\thepage}     \begin{document}     The aim of the application is to create a Sushi plate and show its details.     \end{document}      ![output](http://i.stack.imgur.com/QxvSq.png) Why does the one in the center still appear?


title: Abbreviation index with nomenclature

text: **SOLVED: I don't know why, but I throwed one abbreviation out of the document. Then I compiled and it worked. After that I copied it back again and it still worked. And since I did that I had no further problems. Strange.** First, I have to say I'm a beginner in TeX. Im currently writing my master thesis with Texmaker and MiKTeX 2.9 (`pdftex`) under Windows 7. I actually wrote 70 pages without any problems. In my thesis I use the `nomenclature` package for the abbreviation index. Now, since a few days I've been getting the following error message(s):               ! LaTeX Error: Lonely \item--perhaps a missing list environment.      and               ! Extra \endgroup.      I get the "lonely item" message for a multiple abbreviation in the index. I'm trying to comment out some chapters and nomenclature uses. The problem is that it is not reproducible. Sometimes I can compile the document when I comment out this chapter and the next time compiling files again and then it doesn't compile at all. I searched Google, but there's no solution for me. I haven't multiple abbreviations in the index. I tried to compile it under Linux and with TeX Live under Windows and Linux. Same errors. Abbreviation index code in the main file:               \usepackage[intoc,german]{nomencl}     \let\abk\nomenclature     \renewcommand{\nomname}{Abkürzungsverzeichnis}     \setlength{\nomlabelwidth}{.20\hsize}     \setlength{\nomitemsep}{-\parsep}     \makenomenclature     \renewcommand{\nompreamble}{\markboth{\nomname}{\nomname}}     \renewcommand{\nomgroup}[1]{%     \vspace{12pt}     }      and               \newpage     \printnomenclature     \clearpage      When I comment out the `\printnomenclature` command it works, but there is no index in the document. In my chapter `.tex` files I use               \abk[PIN]{PIN}{Personal Identification Number}      I also checked the temporary file where MakeIndex generates the abbreviation index. But there are no syntax errors. The only idea left I have that there is a problem when the abbreviation index is longer then one page. Examples of the usage of the `\abk`-command:               \begin{itemize}     \item \textbf{Linear Threshold Unit}\index{LTU}\abk[LTU]{LTU}{Linear Threshold Unit} ~\\     following text     \end{itemize}      or               Sie präsentieren die Resultate einer Analyse von GUI-based Intrusion Detection (GUIID)\abk[GUIID]{GUIID}{GUI-based Intrusion Detection} Systemen.      Example from the `.nls`-File (XOR is throwing an lonely item error):               \begin{thenomenclature}      [...]      \nomgroup{X}     \item [{XaaS}]\begingroup Everything as a Service\nomeqref {0}         \nompageref{16}     \item [{XOR}]\begingroup eXclusive OR\nomeqref {0}\nompageref{43}     \end{thenomenclature}      After deleting all \abk from the whole document, so there are no(!) abbreviations in it, there are still two errors:               ! LaTeX Error: \begin{document} ended by \end{thenomenclature}.       and                ! Extra  \endgroup."


title: redefine theorem environment with beamer

text: beamer seems to define theorem-environments such as `definition`, but i want to be able to define them myself. In particular I want to use thmtools.               \documentclass{beamer}     \usetheme{Singapore}          \usepackage{amsmath}     \usepackage{mathtools}     \usepackage{thmtools}     \usepackage[english]{babel}          \theoremstyle{definition}     \declaretheorem[style=definition]{definition}          \begin{document}     \title{thmtools + beamer}     \date{\today}     \begin{frame}[plain]     \titlepage     \end{frame}           \end{document}      Compiling this yields               ! LaTeX Error: Command \definition already defined.      but I could not find anything like a `\redeclaretheorem` command.


title: Presentation including today's date in beamer?

text: The challenge here it create a beamer presentation such that it would show the date in which it was used, not the day it was compiled.               \documentclass{beamer}     \begin{document}     \begin{frame}       I compiled this presentation on \today, but I am presenting it today (\TODAY)!      \end{frame}      \end{document}


title: Make List of Algorithms formatting match LOT/LOF

text: I'm working on my thesis, and I have a minor formatting problem with my list of algorithms.   The entry is added properly in the TOC and the font, size dotting and numbering are perfect, but for some reason, the LOA is about a centimeter lower than the LOF/LOT from the top of the page. Here's my MWE:               \RequirePackage[l2tabu, orthodox]{nag}     \documentclass[12pt]{report}          \usepackage{setspace}     \usepackage{layout}     \usepackage{fullpage}          \usepackage{caption}     \usepackage[list=true, listformat=simple]{subcaption}          \usepackage{tocloft}          \usepackage{algorithm}     \usepackage[noend]{algorithmic}          \pagestyle{plain}          \begin{document}     \pagenumbering{roman}          \newpage     \singlespacing     \renewcommand{\contentsname}{Table of Contents}     \renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}     \renewcommand{\cftchapnumwidth}{7em}     \makeatletter     \newcommand*\updatechaptername{%        \addtocontents{toc}{\protect\renewcommand*\protect\cftchappresnum{\@chapapp\ }}     }     \makeatother     \tableofcontents     \updatechaptername          \newpage     \addcontentsline{toc}{chapter}{List of Figures}     \listoffigures          \newpage     \addcontentsline{toc}{chapter}{List of Tables}     \listoftables          \newpage     \addcontentsline{toc}{chapter}{List of Algorithms}     \listofalgorithms          \doublespacing          \newpage     \pagenumbering{arabic}     \chapter{Introduction}     \label{chap:intro}          \newpage     \chapter{Content}     \label{chap:content}          \end{document}


title: suddenly serifs in math mode

text: I have a problem since recently. When typesetting math, a new font is used, and I have no idea why. While usually, the variables look like this, `$\lambda, \mathcal{X}, x, \sum$`, i.e. without serifs on the Lambda, a more "round" `$x$` etc., they suddenly look like this: ![The wrong style](http://i.stack.imgur.com/vNlE8.png) The only thing I did in recent time is to add               \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}      in the preamble (was necessary to use Umlaute in the bibliography). I read that using `\usepackage{mathsf}` could help - but I never used this package before, so why would I need it now? I'd like to go back to where I've been instead of installing yet another package (furthermore, the automatic installing of this does not work; it says `mathsf.sty` not found, but that is another issue). I will try to give a MWE - can I attach files here? I'm posting my source code here (it seems not too minimal, but I felt the need to include all the loaded packages to ensure that you get all info). The reason why I post this even though there are many topics on the same question is that I need to find out why this suddenly changed (that, or I'm going crazy).               \documentclass[12pt]{scrartcl}     \usepackage[ngerman,english]{babel}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{listings}     \usepackage{cases}     \usepackage{mathtools}     \usepackage{pslatex}     \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}          \begin{document}          The broad field of robust optimization ...     \begin{alignat}{5}     \min_{x\in \mathcal{X} \subset \mathfrak{R}^n} & x^TQx |\mu^Tx \geq R \\     \max_{x\in \mathcal{X} \subset \mathfrak{R}^n} & \mu^Tx-\lambda x^TQx\\          \mathcal{X}=\left\{x\in\mathfrak{R}^n|\sum_{i=1}^n x_i=1, x_i\geq0,\lambda\right\}     \end{alignat}     ensures that short-sales are not allowed and the sum of all the asset weights is 1.          \end{document}


title: Package installed but not working

text: I installed the MacTEX package, and want to use the listings package for pretty printing code. According to the TeX Live Utility, the package is installed (I tried re-installing it as well). However, when I try typesetting via TeXShop, I get an error:               l.4 \usepackage                  {listings}     ?      Does anyone know what the problem is? EDIT: Complete document code:               \documentclass[twoside,a4paper,12pt,titlepage]{article}     \begin{document}     \author{--}     \usepackage{listings}     \title{--}     \maketitle     \section{1}     Lorem ipsum.     \end{document}


title: How can I add a word to all chapter titles in my document without also affecting the ToC?

text: I'm writing a constitution-type document for a sports competition. I want each chapter heading to be preceded by the word "Article", viz: "Article 1 Rules of the competition", "Article 2 blah blah blah". So I added the following at the start of the document:               \renewcommand{\chapter}{\@startsection{chapter}{1}{0mm}{\baselineskip}{0.5\baselineskip}{\textsc{Article} \centering\sc\large}}      Unfortunately, this has also added the word "Article" to the title of the table of contents itself , so that it is now titled "Article Contents" instead of just "Contents". How can I stop the word Article appearing in the title of the ToC? Or, is there a better way for me to add the word "article" to the header title for each chapter, but not the title of the ToC?


title: What packages are incompatible with KOMA-Script?

text: Triggered by the question why should I not use the koma script classes results practically necessarily a consequence question: _What packages are incompatible with`KOMA-Script`?_ `KOMA-Script` offers `scrhack` to fix certain well-known problems with the packages:   * `hyperref`,    * `float`,    * `floatrow`, and    * `listings`. In the question incompatibilities between babelfrench and koma script classes? special problems of `\usepackage[french][babel]` are reported. Which packages do you know having problems with `KOMA-Script`?


title: Renaming anchors in predefined shapes

text: I am drawing several dozen diagrams with TikZ that will be using equilateral triangles. My current setup is using the regular polygon construction. The anchor names corner 1, corner 2, and corner 3 are not very semantic for my purposes, so I would like to make a global declaration providing them new names. This is how I am currently declaring my triangular nodes:               \tikzset{     delta/.style={     regular polygon, regular polygon sides=3, minimum size=0.4cm, inner sep=0,     outer sep=0.025em, draw=black, very thick, fill=green!10}     }      I know that `(node.210)` will give me the same anchor position as `(node.corner 2)`, but I'd like to be able to do something like `(node.left copy)` to give the same anchor position, and `(node.right copy)` in the place of `(node.corner 3)` or `(node.330)`.   From the manual, it seems I ought to be able to do something like `\anchor{left copy}{\corner2}` if \corner2 is the name for that saved anchor, but I don't know where that code would fit into what I have, and I don't know if \corner2 is the correct name.   The following code is functional, but customizing the anchor names will make it easier to follow what's going on in a more complicated diagram.               \begin{tikzpicture}[-, thick]     \node[delta] (dub) {};     \node (copy1) [below left of=dub] {};     \node (copy2) [below right of=dub] {};     \node (input) [above of=dub] {};     \draw (input) -- (dub) (dub.corner 2) -- (copy1);     \draw (dub.corner 3) -- (copy2);     \end{tikzpicture}      The best workaround I have found so far is rotating the border in the style definition, `shape border rotate=120`, which lowers each of the used corner numbers by 1. Even if I end up using this hack here, rotation is not a panacea; I still want to know how to make new aliases for anchors in predefined shapes. A comment on another question (Creating pseudo anchors in TikZ drawing) indicated `\pgfdeclaregenericanchor` is an undocumented macro that can be used to access saved anchors of predefined shapes, but that's where I hit a dead end.


title: How to put a paragraph in the center of a page inside a box?

text: I want to put the following paragraph in the center of a page inside a box. Please suggest how to do this.               Z.<x> = ZZ[]           f = (x^3 - 45*x^2 - 11637*x - 344520)           K.<a> = f.root_field()          K          L.<b> = K.galois_closure();L


title: psfrag substitute when using pdflatex

text: My standard way of including math in figures so far was to use psfrag and latex+dvips+ps2pdf. I am now moving to pdflatex and tend to prepare my graphics in pdf format. I was wondering if there exists a way to include math in pdf graphics similar to psfrag. I am aware of auto-pst-pdf package but prefer not to use it since on large projects it runs much slower than pdflatex and I am not sure if it can handle microtype as well as pdflatex.


title: Floatrow package causing missing algorithm lines

text: Hi I started using floatrow and noticed that it is breaking functionality of my algorithm code, both the algorithm header and footer have disappeared. Here is a picture of before and after: ![enter image description here](http://i.stack.imgur.com/7JNed.png) Here are the packages I am using:               \usepackage[rawfloats=true]{floatrow}     \usepackage{algorithm}     \usepackage{algpseudocode}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{appendix}     \usepackage{caption}     \usepackage{cite}     \usepackage{xcolor}     \usepackage{color}     \usepackage{footnote}     \usepackage[top=1.0in, bottom=1.0in, left=1.0in, right=1.0in]{geometry}     \usepackage{graphicx}     \usepackage{pifont}     \usepackage{subfig}     \usepackage{times}     \usepackage[hyphens]{url}     \usepackage{comment}     \usepackage{xspace}     \usepackage{enumitem}      And code from my algorithm block:               \begin{algorithm}[t]     \begin{algorithmic}[1]     \Function{$P$}{$e$, $e'$, $t$, $T$}         \If{$e' < e$}             \Return 1.0          \Else             \State\Return $exp^{-4.6 * {(e' / e)}^2 * ((T - t) / T)}$         \EndIf     \EndFunction     \end{algorithmic}     \caption{Simulated Annealing}     \end{algorithm}      Any suggestions for a fix are appreciated.


title: Watermark via package 'draftwatermark' is not showing on page

text: I'm trying to add a watermark to my paper, simply by adding a                \usepackage{draftwatermark}      But the watermark doesn't appear to be showing up? On closer inspection, it's there, but offset from the page, so it only just shows in one corner. Any ideas? I'm using a journal specific style class (MNRAS / `mn2e.cls`). A MWE:               \documentclass{mn2e}     \usepackage{draftcopy}     \usepackage{lipsum}          \begin{document}          \lipsum[1-11]          \end{document}      ![enter image description here](http://i.stack.imgur.com/wezYk.png)


title: Problem with redefining \chapter{...} command

text: I want to change the definition of `\chapter[...]{...}` to `\chapter[...]{...}\thispagestyle{empty}`. To do this, I'm using the code below:               \documentclass{book}     \let\origchapter\chapter     \renewcommand{\chapter}[2][]{%     \origchapter[#1]{#2}     \thispagestyle{empty}     }     \begin{document}     \tableofcontents     \chapter{Bla Bla}     Some text ...     \newpage     \chapter{Bla Bla}     \end{document}      Everything is ok, but when I call `\tableofcontents` after the `\begin{document}`, I'll get the following error:               ! LaTeX Error: Something's wrong--perhaps a missing \item.      What am I doing wrong?


title: How many packages do MiKTeX and TeX Live contain?

text: > **Possible Duplicate:**   >  How many LaTeX classes and packages are there (say, on CTAN)? Where can I find the total package count for TeX Live 2012 and MiKTeX 2.9?


title: Page number is reset to 0 with \include command

text: I am writing a lengthy document that I have divided in chapters. Each chapter is in a separate file which is called from the master file by means of the command `\include`. The problem is that every time an `\included` file starts the page number is reset to 1. Of course, I can control it inserting manually `\setcounter{page}{number}` at the beginning of each chapter, but I must be doing something wrong. Any idea of why this is happening? Thanks.


title: Listings package not working properly with Exam class

text: When I gave my code in the exam class like               \begin{parts}     \part \begin{lstlisting}      echo The date is $date      \end{lstlisting}     \part \begin{lstlisting}      echo The date is $(date)      \end{lstlisting}     \end{parts}      I want is the line starting with echo in (a) and (b) respectively. Instead that only `\part` displays only (a)


title: Eurosign in alignment is not showing up

text: The eurosign is not showing up as I wanted in the following alignment-context:               \documentclass[fleqn]{scrartcl}     \setkomafont{disposition}{\normalfont\bfseries}     \makeatletter\let\TTTemp\cap\makeatother     \usepackage[greek,english]{babel}     \usepackage{teubner}     \makeatletter\let\cap\TTTemp\makeatother     \usepackage{eurosym}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{lgreek}     \usepackage{graphicx}     \usepackage{textcomp}     \usepackage{cancel}     \usepackage{soul}     \usepackage{cjhebrew}     \usepackage{mathtools}     \usepackage{rotating}     \usepackage{esvect}     \usepackage{natbib}          \usepackage{hyperref}     \usepackage{tocbibind}          \begin{document}     \begin{align*}         \textcjheb{n}(\euro)\triangleright []\\     \end{align*}     \end{document}


title: Specify timezone for \today and \currenttime

text: Is there a way I can specify the timezone LaTeX should use when printing the `\today` and `\currenttime` (or the datetime package in general)? I need this because travisCI does build my PDF automatically on every commit and their timezone seems to be set to GMT. I'd need GMT+1. Contrary to some other questions I don't want the timezone to be displayed, I just want the date & time to be in the specified timezone. For building I use `latexmk` with pdflatex set to LuaLaTeX.


title: Embedded png-Images still result in small pdf-fielsize

text: I read much about embedding images and screenshots the correct way in the last few days to avoid skewed or blurry texts in the screens. I embed them like this:               \begin{figure}[htb]     \centering     \includegraphics{blaa3.png}     \caption{....}       \label{fig:....}                 \end{figure}      using png uncompressed files. I set the DPI to a multiple of 72 so that it does fit well on the page (for bigger images I'm choosing higher DPI numbers so that it does fit on the page without the need of scaling `\includegraphics[scale=0.5]{blaa3.png}` so to not make it blurred. The strange thing is: When Im changing the DPI, the default DPI being displayed is 96, so should I rather chose a multiple of 96 instead of 72!? Okay and here comes the main question: I read somewhere on tex here that the PNG files are embedded as they are without actually being compressed etc. Now my uncompressed PNG files have about 3MB and I'm wondering why the resulting PDF file (embedding like 5 of those pngs) is only about 6MB in size!? So they are obviously being compressed, aren't they? Using latest TeCnicCenter with MiKTeX and TeXify for outputting under Windows 8.1. Thanks in advance


title: Frac or inference rule with dotted line

text: I would like to have a `\frac` or mathpartir-style inference rule with a dotted rather than solid line, so that I can put fractions into inference rules without overloading horizontal bar. The following example shows three possible steps towards this (ordered by increasing closeness to solution):   1. `genfrac`, which allows me to customise the thickness of the line but not the stroke   2. `dotuline` from the `dashundergaps` package, which allows dotted lines, but doesn't support proper fractional formatting   3. custom `inferrule` using `\mprset` of `mathpartir` package, which claims to support dotted lines, but doesn't seem to space the dots properly. Here are my attempts; I tried two different ways of customising `inferrule`.               \documentclass{article}          \usepackage{amsmath}     \usepackage{dashundergaps}          \begin{document}     \[\genfrac{}{}{1pt}{0}{a}{c+d}\]     \[{\dotuline{a}\atop c+d}\]     \[\mprset{fraction={\cdot\cdots\cdot}}\inferrule{a}{c+d}\]     \[\mprset{fraction={\cdot\hdotdot\cdot}}\inferrule{a}{C+D^{\beta}}\]     \end{document}      There is some discussion here but the proposed solution is to use dashundergaps. Since the width and vertical positioning of the dotted line are incorrect when compared with the behaviour of `\frac`, this cannot really be considered a solution. Using mathpartir and customising `inferrule` seems like the simplest direction to explore, but the results are somewhat unpredictable. The first attempt above doesn't space out the dots properly; the second does, but changes the vertical placement of the line (so that the superscripted 'beta' character now intersects with the bar). This may also be relevant.


title: Index that picks up on example numbers, not page numbers

text: I am producing some glossed linguistic texts in a Native American language. The sentences are labeled as, e.g., (2.3)—meaning “text 2, sentence 3”—and I’d like the index to pick up on these numbers, rather than page numbers. In terms of the picture below, I’d like: > Bratwurst, (2.1) > > Sauerkraut, (2.2) as opposed to what’s shown (Bratwurst, 2; Sauerkraut, 2). How can I achieve this? ![enter image description here](http://i.stack.imgur.com/taB8C.png) I’m using a version of expex for the example numbers. It's too long to include here, but I can email it to any interested parties. * * * *Clarification. I know how to label examples (by putting e.g., `<label>` after `\ex`) and how to call labels at a later point (`\getref{label}`). This questions isn't about example labelling however: I don't want to have to manually link _cabbage_ to, say, `\getref{Sauerkraut}`, `\getref{Kohl}`, `\getref{Wirsing}`. I want to piggyback off `makeindex` to produce an index that lists example numbers instead of page numbers. * * *               \documentclass{report}      \usepackage{expex-x2}      \usepackage{expexchapno}          \lingset{aboveexskip=0pt,glspace=1em plus .5em minus.2em,        glrightskip=0pt plus 8em,aboveglftskip=0pt,glneveryline={\it},        glstyle=nlevel,everygl={\hangindent=1.2em \hangafter=1},        exnotype=chapter.arabic}          \usepackage{makeidx}         \makeindex          \begin{document}              \gathertags          \chapter{First chapter}          \chapter{Second chapter}          \ex Bratwurst --- this example is followed by \verb"\index{Bratwurst}"     \xe \index{Bratwurst}           \ex Sauerkraut --- this example is followed by     \verb"\index{Sauerkraut}" \xe \index{Sauerkraut}          \printindex     \end{document}


title: Why $\bf \bar D$ displays as ``7016D in the pdf generated bookmark using hyperref package

text: I am using the the hyperref package in an arxiv preprint in RevTeX format. The relevant part of the code is:               \usepackage[colorlinks=true, citecolor=blue, urlcolor = blue, linkcolor= blue, bookmarks=true]{hyperref}      However, one of my sections is defined as               \section{${\bf D}$, ${\bf \bar D}$ and ${\bf J/Psi}$ $-$ Potential Candidates}      The `\bf` command has been used since the format, by default bolds out the headings. However, symbols aren't given that treatment automatically. Hence, this form displays correctly. The problem is - the part corresponding to `${\bf \bar D}$` displays in the bookmark as > ``7016D instead of the desired form. Q1. Why does that happen? Q2. Any work-around? Thanks :)


title: Error in display Vietnamese word in title

text: I got a problem with displaying my mother language in one title of my paper. Here is the code i use               \documentclass[12pt,a4paper]{amsart}               %% Packages that could be used          \usepackage{amscd,amssymb,amsthm}     \usepackage[utf8]{vietnam}     \usepackage{graphicx}     \usepackage{jipam}          \usepackage[utf8]{inputenc}     \usepackage[vietnam]{babel}               %\DeclareInputText               %% My definition     \newcommand{\mvec}[1]{\mbox{\bfseries\itshape #1}}               \title[Triangle inequality]{2 bất đẳng thức liên quan đến góc Brocard}     \author{Nguyen Duy Khanh}     \address{Hanoi, Vietnam}     \email{nguyenduykhanh@toanly.org}     \urladdr{http://www.toanly.org}          %\author{Author 2}     %\address{Line 3\\ Line 4\\ Address 2}     %\email{person2@inst.com}          %\keywords{Triangle,Inequality,Brocard angle}     %\subjclass[2000]{26D15}          \begin{document}          \begin{abstract}     Tiếng việt trong tiêu đề không hiển thị chính xác-The Vietnamese did not display correctly in the title.     \end{abstract}     \maketitle     \end{document}      The title should be **2 bất đẳng thức liên quan đến góc Brocard** but it appeared as **2 BT NG THC LIN QUAN N GÂC BROCARD** My question is, what is the missing package that can help me to display the correct words? Please help me solve my problem. I really need it for writing my paper. Thank you very much!


title: wrapfigure error

text: I'm using `memoir` (a beautiful `documentclass` that gets me in trouble too often)... and I'm trying to use `wrapfigure`. This is what I use:               \documentclass[a4paper,oneside,12pt,openright,final,oldfontcommands]{memoir}     \usepackage{wrapfig}          \begin{document}              \begin{wrapfigure}{./Images/13-SubdivisionRule}{o}{width=0.5\textwidth}     \caption[Shape Grammar Subdivision]{The subdivision of a surface by shape grammars for fabrication of the sheets \cite{shelden02}}     \label{SubdivisionSG}     \end{wrapfigure}          \end{document}      This is the error I get:               Package wrapfig Warning: wrapfigure used inside a conflicting environment on in     put line 129.


title: Strange latex font warnings with fontsize, tikz, fontspec

text: This is mostly the same code as in:   * Problem with itemize indentation in minipage in tikz node ... but with a few changes - notably, it uses `fontspec` with Junicode font, and so needs to be compiled with `xelatex`. This is the MWE:               \documentclass[12pt,a4paper]{article}          \usepackage[pass]{geometry}     \usepackage{tikz,enumitem}          \usepackage{fontspec}     \defaultfontfeatures{Ligatures=TeX}     \setmainfont{Junicode}               \begin{document}          \pdfpagewidth=148mm \pdfpageheight=210mm % for PDF output     \paperwidth=148mm \paperheight=210mm     % for TikZ               \begin{tikzpicture}[overlay,remember picture,y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt,anchor=north west]            \begin{scope}[shift={(0,0.34461553)}]% layer1            \fontspec[Scale=0.83]{Junicode}       \fontsize{21}{27.3}\selectfont % introduces: "LaTeX Font Warning:"...            \path[fill=blue] (10,10) node[below right] (text3134) {%           \begin{minipage}{150pt}%             \begin{itemize}[leftmargin=*,topsep=0pt,itemsep=0pt]%               \setlength{\parskip}{0pt}%               \item[\textcolor{red}{\textbullet}] Hello               \item 2\textsuperscript{\fontsize{9}{11.7}\selectfont nd} {\scshape Entry}             \end{itemize}%           \end{minipage}       }%path       ;            \end{scope}          \end{tikzpicture}     \end{document}      When I run `xelatex test.tex`; when the line `\fontsize{21}{27.3}\selectfont` the following warnings are generated:               [...]     *geometry* detected driver: xetex     ABD: EveryShipout initializing macros          LaTeX Font Warning: Font shape `OML/cmm/m/it' in size <10.5> not available     (Font)              size <10.95> substituted on input line 29.               LaTeX Font Warning: Font shape `OMS/cmsy/m/n' in size <10.5> not available     (Font)              size <10.95> substituted on input line 29.               LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <10.5> not available     (Font)              size <10.95> substituted on input line 29.          [1] (./test.aux)          LaTeX Font Warning: Size substitutions with differences     (Font)              up to 0.45pt have occurred.           )     Output written on test.pdf (1 page).     Transcript written on test.log.      Now, as far as I can read font warnings, shapes like `OT1/cmr/m/n` would refer to Computer Modern font - and yet, I never requested that font; I though Junicode was now default? Where did this warning come from, then - and why does it appear only when the very first `\fontsize{21}{27.3}\selectfont` is enabled? My idea with the code above was to specify a default font scale first (as in "global scale") with `\fontspec[Scale=0.83]{Junicode}`; then specify default font size with `\fontsize{21}{27.3}\selectfont` - then possibly override the default font size (like with `\fontsize{9}{11.7}`). ( _I'd expect both fontsize, 21 and 9, to be scaled by 0.83_ ). I'd say, the generated PDF does look like what I expect it to (though I haven't precisely measured whether the sizes are really scaled as I expect them) - however, these warnings confuse me - why do they appear and how to eliminate them? Many thanks in advance for any answers,   Cheers!


title: Problems with numbering compounds using bpchem

text: I have a problem numbering my compounds using `bpchem` in `chemstyle`. In the eps files, I use `TMP` and `TMP2` etc, when I insert the figure, I do it like this:               \begin{scheme}         \begin{center}             \schemeref[TMP]{1}             \schemeref[TMP2]{2}             \includegraphics[scale=0.6]{figure1}         \end{center}     \end{scheme}      When I first mention a compound, I use `\CNlabel`, later `\CNref`. The substitution of the `TMP` works just fine, my problem is that the labels in the text seem to be independent of the labels in the schemes. In the schemes, the numbers will run smoothly like 1, 2, 3... However, if I try to reference these compounds in the text, they get numbered by the order I mention them in the text. As the order is not the same the number assigned to a particular compound is not the same in the text as in the schemes. How can I fix this? ps: I am sorry that I did not provide a minimal example to demonstrate this, I just don't know how to reproduce my problem in a short easy way without having to send you all my eps files. Edit: Here is an example that gives a different numbering in the text relative to the pictures. In the pictures, the numbering is 1,2,3,4 and in the text the numbering is 1,2,3,4 as well, even though it should be 2,3,4,1. Before, I only had `bpchem` instead of `tracking=bpchem`. This old version works for this small example, but for some reason not in my large, more complicated file.               \documentclass{article}      \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage[runs=2]{auto-pst-pdf}     \usepackage{booktabs}      \usepackage{bpchem}     \usepackage[journal=rsc, tracking=bpchem]{chemstyle}     \usepackage{geometry}     \usepackage[version=3]{mhchem}     \usepackage{setspace}     \usepackage{bm}           \begin{document}           Text where I mention the compounds in a different order than in the schemes: \CNlabel{2}, \CNlabel{3}, \CNlabel{4}, \CNlabel{1}          \begin{scheme}         \begin{center}             \schemeref[TMP]{1}             \schemeref[TMP2]{2}             \includegraphics{bla}         \end{center}     \end{scheme}          \begin{scheme}         \begin{center}             \schemeref[TMP]{3}             \schemeref[TMP2]{4}             \includegraphics{blub}         \end{center}     \end{scheme}          \end{document}


title: Appearance of the name of the author in beamer

text: I am using the theme `CambridgeUS` for a `beamer` presentation. I encounter the following problem. Here is my heading.               \documentclass{beamer}     \usetheme{CambridgeUS}          \title{Title of my talk}     \author{John Smith}     \date{April 12, 2047}          \begin{document}     \frame{\titlepage}     ...          \end{document}      Now, LaTeX will print correctly "John Smith" as the name of the author on the first frame. It also appears at the bottom of every frame but then with "( )" after the name. I don't know how to get rid of those parentheses. Is there a way to do so?


title: Add a curved arrow and a bracket to a table

text: I'm a beginner to LaTeX. I want to add a curved arrow pointing from one row to another. And I also want to add a `{` on the other side of the table to mark several rows.               \begin{center}      \begin{tabular}{ | l | l |}       \hline        letter & number \\ \hline        A &  1 \\ \hline        A &  2 \\ \hline        A &  1 \\ \hline        B &  1 \\ \hline        B &  2 \\ \hline      \end{tabular}     \end{center}      So my idea is to add a curved arrow outside the table to mark the first line and the third line as "duplicated" on the right and add two `{` to mark the first 3 rows as "A" and the last 2 rows as "B" on the left. Any suggestion on how can I do it?


title: Drawing Karnaugh's maps in LaTeX

text: I've been using LaTeX for a couple of years, but I'm pretty new to the `tikz` package. In particular, I'd like to add Karnaugh's maps in my document. I've already found a solution that satisfy me (can be found here: How would you do Karnaugh's maps in LaTeX or ConTeXt?), and I'd like to slightly adjust it to make the boolean params appear at the very first cell which I want it to be diagonally split like in this example: Remove vertical lines for table. Would anybody help me? Thanks in advance!


title: Can the coding style of the algorithm environment be modified?

text: I'm using the packages               \usepackage{algpseudocode}     \usepackage{algorithm}      to produce a pseudocode of the following algorithm:               \begin{algorithm}         \centering         \caption{Octree based search algorithm}         \label{alg:octree-search}         {\small           \begin{algorithmic}     \Function{octree-search}{node=root, point, squaredDistance, nearestPoint=distant point}       \For{octants of node}         \State get subNode         \State pointSphere = sphere around point using squaredDistance          \If{subNode has child nodes}           \State subNodeBox = Axis Aligned Bound Box (subNode)           \If{subNodeBox overlaps with pointSphere}              \State \Call{octree-search}{subNode, point, squaredDistance, nearestPoint}           \EndIf         \ElsIf{subNode is a leaf node}           \State leafNodeBox = Axis Aligned Bounding Box (node)           \If{leafNodeBox overlaps with pointSphere}              \State minimalPoint = distant point              \For{shape in node shapes}               \State distanceToShape, shapePoint = \Call{signed distance}{shape, point}               \If{$\|\text{distanceToShape}\| < \|\text{minimalDistance}\|$}                 \State minimalPoint = shapePoint                \EndIf             \EndFor             \State nearestPoint = minimalPoint \Comment return point of the recursive search            \EndIf          \EndIf       \EndFor     \EndFunction           \end{algorithmic}         }     \end{algorithm}      And I'm using `\small` as the algorithm font size. Unfortunately, the page width causes problems and introduces line breaks like this: ![enter image description here](http://i.stack.imgur.com/z7mFo.jpg) As the whole point of the pseudocode (and clean code in general) is to use sensible names (for example squaredDistance in stead of sqD), I would like to re-format the output generated by the algpseudocode, for the function declaration so that it looks like this:               function OCTREE-SEARCH(          node = root,           point,           squaredDistance,          nearestPoint = distant point     )      without the ugly looking line break. _Programming side-note_ I'm aware that the functions should ideally be monadic/diadic, but I'm interfacing my code with legacy code at this point and I cannot change the function signature. Reducing the argument number is therefore not an option. **Edit** Also, can the large horizontal space that comes before the `Comment` be somehow shortened?


title: How to render LaTeX (math) in Sweave (R) code comments

text: ## background A asked this question on SO yesterday because it seemed to be more programming-oriented, but there weren't any responses. Perhaps someone here might have an idea? I am writing a Sweave document (LaTeX and R) and I would like to use LaTeX in some R comments. Essentially, I would like to do this:               \documentclass{article}     \begin{document}          Some introduction          <<example>>=          ## We will find all $k$ combinations:     ## $k = C^n_N = \frac{N!}{(N - n)! \cdot n!}$          k <- factorial(N) / (factorial(N - n) * factorial(n))          @          Some other information.          \end{document}      and have `$k$` and `$k = C^n_N = \frac{N!}{(N - n)! \cdot n!}$` formatted as they would be if they were not in the R code chunk. The `minted` and `listings` packages both support LaTeX in code comments, but I'm not sure how to combine this with Sweave/knitr. Here is an example from the `minted` package, page 7: ![enter image description here](http://i.stack.imgur.com/P9M9A.png) ## question Is there a way to put formatted LaTeX (math) in the comments of a Sweave code chunk?


title: TiKz: Text inside circles overlaps

text: How can I fit the text squarely inside the circles without it overlapping like this? ![enter image description here](http://i.stack.imgur.com/mKab3.png)               \documentclass[tikz,border=12pt]{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}        %\usepgfplotslibrary{external}     %\tikzexternalize     \begin{document}     \def\firstcircle{(90:1cm) circle (2.5cm)}       \def\secondcircle{(210:2.5cm) circle (2.5cm)}       \def\thirdcircle{(330:2.5cm) circle (2.5cm)}       \def\fourthcircle{(90:-3.5cm) circle (2.5cm)}     %\tikzsetnextfilename{4way_venn}         \begin{tikzpicture}     \begin{scope}[ fill opacity=0.5]             \fill[red] \firstcircle;             \fill[green] \secondcircle;             \fill[blue] \thirdcircle;         \fill[cyan] \fourthcircle;\end{scope}     %    \begin{scope}     %      \clip \firstcircle;     %      \clip \secondcircle;     %      \clip \thirdcircle;     %\fill[cyan]\fourthcircle;     %    \end{scope}           \draw \firstcircle node[text=black,above] {CO$_2$ reduction};           \draw \secondcircle node [text=black, left=1cm] {Cost-effectiveness};           \draw \thirdcircle node [text=black,right=-0.4cm] {Infection control};     \draw \fourthcircle node [text=black,below=1cm]{Customer satisfaction};              \end{tikzpicture}     \end{document}


title: Anti-chronological bibliography with sorting=ydnt and usage of sortyear

text: I'm trying to get a anti-chronological bibliography, that means I just want to appear the newest items at the top. After reading the the answer for this question I assumed, that the usage the sorting scheme ydnt and of sortyear (in the format 2012-1, 2012-2 and so on, where 2012-1 is older than 2012-2) should do that. But it does not, it seems that only the first four digits of sortyear or the entry in year are used (which are in fact the same). So, why that? And how could I get a new-to-old sorted bibliography without declaring a new sorting scheme? (Doing that I get the desired result.)               \documentclass{article}     \usepackage{filecontents}     \usepackage[english]{babel}     \usepackage[backend=biber,sorting=ydnt]{biblatex}          \begin{filecontents}{refs.bib}     @MISC{2012_1,       author = {Me},       title = {A Oldest, should be below},       year = {2012},       sortyear = {2012-1},     }     @MISC{2012_2,       author = {Me},       title = {C Second oldest, should be in middle},       year = {2012},       sortyear = {2012-2},     }          @MISC{2012_3,       author = {Me},       title = {B Newest, should be above},       year = {2012},       sortyear = {2012-3},     }     }\end{filecontents}          \addbibresource{refs.bib}          \begin{document}     \nocite{*}     \printbibliography     \end{document}      ![enter image description here](http://i.stack.imgur.com/kmp9i.jpg)


title: Seemingly random left margin after page break

text: My document seems to be switching left margins at random and I do not know what is causing this. I am running MacTex and compiling it like this               latex thesis.tex     bibtex A     bibtex B     latex thesis.tex     dvips -t letter -o thesis.ps thesis.dvi     ps2pdf14 -dPDFSETTINGS=/prepress -dEmbedAllFonts=true thesis.ps thesis.pdf      My header looks like this:               \documentclass[twoside,11pt,openright]{report}          \usepackage[latin1]{inputenc}     \usepackage[american]{babel}     \usepackage{a4}     \usepackage{latexsym}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{epsfig}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[labeled]{multibib}     \usepackage{color}     \usepackage{datetime}          \usepackage{etoolbox}     \makeatletter     \patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}     \makeatother          \renewcommand*\ttdefault{txtt}          \newcommand{\todo}[1]{{\color[rgb]{.5,0,0}\textbf{$\blacktriangleright$#1$\blacktriangleleft$}}}          \newcites{A,B}{Primary Bibliography,Secondary Bibliography}      Below is a link to a screenshot of what looks like, I inserted a ruler to highlight the issue. There is no command in the paragraph except the `\todo` you can see in red. The `\patchcmd` is simply to avoid pagebreaks for empty chapters, the problem persists if I remove it. ![enter image description here](http://i.stack.imgur.com/liRJR.png)


title: Left-justify text in LaTeX

text: How do I left-justify my whole report? I have tried               \begin{flushleft}\end{flushleft}      But the problem is that it removes the alignment of my pictures. So is there a way to align only the text globally?


title: What is the overflow limit for a named path in tikz / pgfplots?

text: I asked this question FillBetween library sometimes works and sometimes does not which led to this answer and discussion http://tex.stackexchange.com/a/180926/6908. There seems to be a limit of data points that can be loaded into a named path before the following warning appears: > package pgf warning: "fill between skipped: the second input path is empty" and the result will not be what is wanted. My question is how big can a named path in `pgfplots` be before such a warning is issued and why does it not tell me that instead of giving an obscure warning that my path is actually empty, which it obviously isn't? Bug? Feature? Limitation? Thank you for any clarifications, T. P.s.: I tagge tikz and pgf since I don't know where this behavior originates from.


title: Extending moderncv social command

text: I wrote the following code:               \documentclass[11pt,a4paper,sans]{moderncv}          \moderncvstyle{casual}     \moderncvcolor{blue}     \usepackage[scale=0.75]{geometry}          \makeatletter     \newcommand\faSkype{{\FA\symbol{"F17E}}}     \makeatother          \name{John}{Doe}     \extrainfo{\href{skype:jdoe}{\faSkype{} jdoe}}          \begin{document}          \makecvtitle          \end{document}      which add a clickable Skype profile on the CV. Is there a way to extend the existing social command in order to accept Skype as optional parameter, in order to write a more readable think like this?               \social[skype]{jdoe}


title: Blank pages after appendices titles

text: I have a couple of appendices whose title is followed by a blank page before actual content starts (usually in the form of figures or tables). Example (software.tex):               \chapter{Software}     \label{app:Software}     \begin{SCtable}     \footnotesize     \begin{tabularx}{\textwidth}{ p{0.22\textwidth} X }     \toprule     \textbf{Software}    & \textbf{Description, area of application} \\     \midrule     ...     \bottomrule     \end{tabularx}     \caption[Used software and database systems]{Used software and database systems.}     \label{tab:MethodsSoftware}     \end{SCtable}      This results in a blank page before the table is shown: ![enter image description here](http://i.stack.imgur.com/UJuCv.png) As far as I am concerned, the table would have more than enough space to be displayed right under the title of the appendix. Weirdly, when the title is followed by a listing (or by text), it works as expected (code.tex):               \chapter{Code}     \label{app:Code}          As can be seen, in this case, the \gls{json} response consists of structured and hierarchical information about each Tweet (from line 43), including the time when the Tweet was sent in \gls{utc} (field ``created\_at'' on line 45), and information about the user (line 56--61).           \begin{lstlisting}[caption={[An example GET request]An example GET request to the Twitter \gls{rest} \gls{api}, requesting the most recent Tweet of Justin Bieber (Retweets excluded).}, label=src:DataTwitterAPIGETRequest]     GET /1.1/statuses/user_timeline.json?count=1&include_rts=false&screen_name=justinbieber HTTP/1.1     X-HostCommonName:         api.twitter.com     Authorization:         OAuth oauth_consumer_key="...",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1374664745",oauth_nonce="1635874679",oauth_version="1.0",oauth_token="...",oauth_signature="q8kravuAKfKEZXMKtY2Q\%2Bsxdgew\%3D\"     ...     \end{lstlisting}      ![enter image description here](http://i.stack.imgur.com/nLuGq.png) The appendices are included as follows:               \appendix     \include {./back/code}     \include {./back/software}      What is wrong?


title: Graphics Question

text: I am trying to add pictures in my `.tex` file. I have added It keeps on giving me an error, that `picture.eps` is missing. Question: Do I need to create a directory somewhere where I need to store these picture? If yes, then what should be the location of the directory? Q: Can I store any kind of pictures, means JPEG, PNG, etc and include these in my document? I will appreciate if you can help me. I am working with MiKTeX 2.9.


title: \usepackage{glossaries} with 3 columns

text: I need to have extra column in the glossary. My application is list of symbols with   1. symbol   2. description   3. units               \documentclass{article}     \usepackage{glossaries}               \makeglossaries          \newglossaryentry{mwe}{name=MWE, description={Minimum Working Example}}          % the previous line should have some extra field, or i could define my own command.     % Something that would envolve description={ {some text} && {some unit}}          \begin{document}          \printglossaries          \clearpage          This is the call to the \Gls{mwe}          \end{document}      **Update** : for what it is worth if you are running ubuntu `< 12.04`, you need to update your packages. (refer to here)


title: Font installation in TeXShop on a Mac

text: I apologize for this being an extremely naive question, but I just can't seem to wrap my head around what the sources I've consulted so far are saying. I'm writing a Beamer presentation in TeXShop, on a Mac running Lion. I've download some Optima fonts from CTAN at http://www.ctan.org/tex- archive/fonts/urw/classico/ and would like to install them on my distribution, and then to use them in my document. Can anyone help a fellow TeXer out with a simple, step-by-step guide of what to do here, from installing, to the appropriate command line to paste into my TeX document? One confusing point is that I cannot seem to locate my texmf folder. If I go to ~/Library/texlive/2011, all I see there is something called temxf-var. Many thanks ahead of time to anyone kind enough to take this on.


title: Question about rotatebox and xy pic

text: I have the following question: I have heard that you can use $\xymatrix@1...$, if you want to put diagrams not into a separate line, but into the line you are writing text at the very moment. This does work, but unfortunately not in the following example... The problem is that I get error messages because of the `\rotatebox` command, when I put the lines below in the form `$\xymatrix@1...$...` ...but it works, if I use the `\begin{xy}...` environment, as I did it below. Unfortunately, then my triangle is placed in the middle of a new separate line. Does anybody have an idea, how to prevent this?               \documentclass[a4paper]{scrartcl}     \usepackage{ucs}     \usepackage[ngerman]{babel}     \usepackage[latin1]{inputenc}     \usepackage{dsfont}     \usepackage{rotating}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage[mathscr]{eucal}     \usepackage{amsthm}     \usepackage{amsfonts}     \usepackage{extpfeil}     \usepackage{textcomp}     \usepackage{graphicx}     \usepackage[pdftex]{color}     \usepackage{paralist}     \usepackage{hyperref}     \usepackage[arrow, matrix, curve]{xy}     \renewcommand{\ttdefault}{pzc}               \deffootnotemark{[\thefootnotemark]}     \deffootnote{1.5em}{1em}{\textsuperscript{[\thefootnotemark]}}          \begin{document}          \noindent Ist $\xymatrix@1{{A\ \ } \ar@{{>}->}[r]^f &  B }$ ein Monomorphismus, so erhalten wir:           $$     \begin{xy}          \xymatrix@1{{A\ \ } \ar@{{>}->}[rr]^f \ar@{->}[rd]_{\rotatebox{330}{$\sim$}} &  &  B \\ &  Im f \ar@{^{(}->}[ru]^n & }          \end{xy}     $$               \end{document}


title: embed a PDF page in plain XeTeX

text: In the dvipdfm documetation, there is a special command for including the first page of an embedded pdf (using `\special{pdf:epdf ... (file.pdf)}`. Is there a way to insert for instance the fifth page of a pdf file.


title: Exporting 3D graphics from Mathematica to TeX

text: So far, whenever I had to use a 3D plot generated in Mathematica in a LaTeX document, I used exported the graphics to either of the following:   * PDF   * PNG file format. Then I could easily include the graphics in my document. However, if the graphics is somehow complicated (for example contains several detailed surfaces), then this method produces poor results. By poor, I mean that either the `pdf` is of low quality, very "heavy" (i.e. takes long to load) etc. In case of the `png` option, then problems are clear; in particular the lack of scalability. I'm interested in the methods you guys are using in this context, namely the workflow `Mathematica->Graphics Object->Export->Include in LaTeX document`.


title: Replacing characters in argument strings

text: I am trying to create a LaTeX command that will allow me to insert pre-defined tables with a minimum of fuss. This will also allow me to change the overall format of tables (e.g. caption above or below) globally, without having to modify each instance. Ideally, I am thinking something along the lines of `\includetable{label}{caption}`, where `label` corresponds to the float's label (for linking purposes), and `caption` corresponds to the caption displayed above (or below) the table. I would like to use `label` for the filename also, e.g. the table contents would be defined in `label.tex`. The problem I have is that I use colons in my labels to distinguish tables, figures, and sections in a consistent manner. For example, a table relating to a structure's mass budget would have a label like `t:structure:mass`; in Windows, I cannot have colons in filenames, so I would like the function `\includetable` to replace colons with hyphens when calling `\input`. The closest thing I've found on Stack Overflow is http://stackoverflow.com/questions/95824/replace-a-character-with-a-string-in- latex, but I can't get this to work with colons instead of commas. Suggestions?


title: Why do \setcounter and \addtocounter commands have global effect, while \setlength and \addtolength commands obey the normal scoping rules?

text: > The `\setcounter` and `\addtocounter` commands have global effect, while the > `\setlength` and `\addtolength` commands obey the normal scoping rules. Why were they designed like this? Why are `\setcounter` and `\addtocounter` not defined to obey normal scoping rules?


title: Vertically align \framed with itemized list using ConTeXt

text: # Problem The numbers in the following itemized list are not aligned with the text: ![Vertically Offset Bullet List](http://i.stack.imgur.com/gUpKA.png) # Code It is possible to adjust the vertical alignment using the offset command:               % Itemized bullet list     \definesymbol[StyleBulletSymbolNumeric][{%       \offset[y=0.2\baselineskip]{%         \StyleBulletFramed[           width=1em,         ]{\small\small\currentitemnumber}       }     }]      However, the calculation of either `y=0.2\baselineskip` or `y=0.2\lineheight` does not quite vertically align the number and its background to the text. # Question How would you vertically align the number of an itemized list such that:   * the number is vertically aligned within the frame; and   * the frame is vertically aligned to the itemized text? # Ideas I have tried:   * `location=middle` - produces a frame that is much too low   * `command=\vcenter` - no discernible effect   * `\offset[y=0.15\baselineskip]{%` - comes closest: ![Offset Numbers](http://i.stack.imgur.com/XMZXG.png) In the above image, the numbered item should be 2px higher with respect to the `\framed` object, while the `y` value for the `offset` is almost perfect (I am concerned that varying the font and its size will cause the alignment to be off; that is, it's a fragile calculation that should use a constant rather than a magic number of `0.15`). # Example A complete example that shows the problem:               \setupcolors[state=start]          % Defines the frame style for bullets. This replaces the leader dots in the     % ToC as well as provides the starting point for all squares.     \defineframed[StyleBulletFramed][       frame=off,       width=0.5em,       height=\framedparameter{width},       background=color,       backgroundcolor=red,     ]          % Defines the bullet as a symbol, which can be used with bullet lists.     \definesymbol[StyleBulletSymbol]       [{\StyleBulletFramed{\strut}}]          % Defines the bullet as a symbol, which can be used with numbered lists.     % Twice small to ensure the number fits inside the bullet.     \definesymbol[StyleBulletSymbolNumeric][{%       \offset[y=0.15\baselineskip]{%         \StyleBulletFramed[           width=1em,           %location=middle,           command=\vcenter         ]{\small\small\currentitemnumber}       }     }]          \define[1]\instruction{\startitem #1. \stopitem}          \defineitemgroup[Instructions]     \setupitemgroup[Instructions][each][joinedup]     \setupitemgroup[Instructions][       symbol=StyleBulletSymbolNumeric,       location=middle,     ]          \starttext     \startbodymatter       \startInstructions         \instruction{Set up the video camera's tripod at the hallway door}         \instruction{Start the video recorder}         \instruction{Make sure the path to the hallway door is unobstructed}         \instruction{Ensure both laces on your running shoes are tied tight}         \instruction{Check that nobody else is in the room}         \instruction{Don safety goggles}         \instruction{Using metal serving tongs, hold the sodium over the water}         \instruction{Drop the sodium into the water}         \instruction{Run to the hallway}         \instruction{Prepare to call the fire department}         \instruction{Upload video to YouTube}       \stopInstructions     \stopbodymatter     \stoptext      # References   * http://wiki.contextgarden.net/Enumerations#.5Cdefineitemgroup   * Vertically aligning list bullet when using \infer   * ConTeXt: vertical spacing


title: Making an align environment begin on the same line as the question label

text: \textbf{Question 2}              a)          \begin{align*}         P(a<\mu<b|\mathbf{y}) & = P(a<\mu|\mathbf{y}<b) \\         & = \int_{a}^b p(\mu|\mathbf{y}) d\mu  \ \ \text{where} \ \ p(\mu|\mathbf{y}) \ \ \text{is a Student \textit{t} pdf.} \\         & = \int_{\mu} I_{(a<\mu|\mathbf{y}<b)} p(\mu|\mathbf{y}) d\mu         \end{align*}         \begin{align*}         \text{where} \ \ I_{(a<\mu|\mathbf{y}<b)} = \begin{cases} 1 & \text{if} \ a<\mu|\mathbf{y}<b \\ 0 & \text{otherwise}  \end{cases}         \end{align*}      produces: ![enter image description here](http://i.stack.imgur.com/EAmpz.png) But I want it to look like: ![enter image description here](http://i.stack.imgur.com/EVYQf.png) ie, the first line of the align starts on the same line as a) How can I adjust the code to do this?


title: What's a good way to write "x does not divide y"?

text: The way I currently do it is `$x \not | y$`, which looks awful. There's got to be something better available.


title: Use different color for moderncv subsections

text: I have made color style like below for moderncv. The color1 is used for all sections and subsections I want to use the newly added color3 for subsections instead of color1. How could I do it?               \begin{filecontents*}{moderncvcolorteal.sty}     % start of file 'moderncvcolorteal.sty'.          % identification     \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{moderncvcolorteal}[2013/02/09 v1.3.0 modern curriculum vitae and letter color scheme: teal]          % color scheme definition     \definecolor{color0}{rgb}{0,0,0}            % black     \definecolor{color1}{rgb}{0,0.5,0.5}        % teal     \definecolor{color2}{rgb}{0.45,0.45,0.45}   % dark grey     \definecolor{color3}{rgb}{0.56,0,0.13}      % burgundy     \endinput          % end of file 'moderncvcolorteal.sty'.     \end{filecontents*}


title: Switch author and title in beamer bibliography

text: When I include references in a `beamer` frame, the author is printed first, followed by the title, followed by the journal/note. I'm using bibtex for referencing.                   \bibliographystyle{unsrt}         \bibliography{report.bib}       The output looks as follows: ![bibliography](http://i.imgur.com/KFdFDQT.png) How can I make the title appear on top, followed by the author underneath? I have been looking at beamerbaselocalstructure.sty to redefine the newblock definition, but have been unsuccessful so far. Here's sample code that results in the output above (although it uses inline bibitems instead of bibtex). I do not want to switch the author and title field in the bibtex file.               \documentclass{beamer}          \begin{document}     \begin{frame}              \begin{thebibliography}{10}             \bibitem{patchdroid} Collin Mulliner, Jon Oberheide, William Robertson, and Engin Kirda. \newblock  Scalable Third-Party Security Patches for Android Devices. \newblock In \textit{Proceedings of the 29th Annual Computer Security Applications Conference}, pages 259--268. ACM, 20143.         \end{thebibliography}          \end{frame}     \end{document}


title: Put a curly brace under an ellipsis in a math setting?

text: so I have $m\times n = n + n + \dots + n$ in my text right now, but I would like to put a curly brace under the `\dots` to emphasize that there are m n's involved. How would I do this?


title: Scanning use error while compiling Devanagari text

text: I tried to run the Latex code posted by Stephen Kottwiz as an answer to this question: How to make Sanskrit Title in Devanagari Package Here's the same code repeated:               \documentclass[10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{devanagari}     \usepackage{fontspec,bera}     \begin{document}     \title{{\dn vivekachoodama.ni}}     \author{Sri Sankaracharya}     \maketitle     \begin{flushleft}     {\dn sarvavedaantasiddhaantagocara.m tamagocara.m | \\ govinda.m paramaananda.m {sad}guru.m pra.nato.asmyaham ||  1}               \end{flushleft}     \end{document}      I tried using PDFLatex to process the code and am getting the following error.   `line 0: File ended while scanning use of \iow_wrap_loop:w` Can anyone shed any light on this matter?


title: XeTeX/mathspec punctuation issue

text: In a previous question, a solution was given for changing the font of punctuation marks in a math environment when using mathspec. Unfortunately, this solution gives the punctuation marks in italics (like the rest of the Latin text in a math environment), whereas the punctuation marks are generally in Roman case. The difference for the comma is pretty subtle, so it's hard to see without a direct comparison to normal text. It is more clear with the semi-colon (but it's there with the comma as well). Here is a minimal example, using the previous question and solution, and a few other lines that I added:               \documentclass[a4paper,12pt]{article}     \usepackage{amsmath,amsthm}     \usepackage[MnSymbol]{mathspec}     \usepackage[no-sscript]{xltxtra}     \defaultfontfeatures{Mapping=tex-text}     \setallmainfonts{Minion Pro}               \makeatletter     \DeclareMathSymbol{,}{\mathpunct}{\eu@LatinLowercase@symfont}{`,}     \DeclareMathSymbol{.}{\mathord}{\eu@LatinLowercase@symfont}{`.}     \DeclareMathSymbol{<}{\mathrel}{\eu@LatinLowercase@symfont}{`<}     \DeclareMathSymbol{>}{\mathrel}{\eu@LatinLowercase@symfont}{`>}     \DeclareMathSymbol{/}{\mathord}{\eu@LatinLowercase@symfont}{`/}     \DeclareMathSymbol{;}{\mathord}{\eu@LatinLowercase@symfont}{`;}     \XeTeXDeclareMathSymbol{^^^^2026}{\mathinner}{\eu@LatinLowercase@symfont}{"2026}   [\mathellipsis]     \makeatother               \begin{document}          This, is some normal text; with weird punctuation.           $\phi, \varphi, \delta \ldots A \vee B$          We can see an italic \emph{x} and, some punctuation; $x_i;x_0,x_1,x_2, {\dots} = x_i +x_0/60+x_1/60^2+x_2/60^3 {\dots}$          \end{document}


title: Biblatex-chicago: \fullcite flips first and last name

text: I'm writing an annotated bibliography which requires full in-line citations in Chicago format. However, when I use biblatex-chicago and \fullcite to list the full citation, it varies from the reference format used in the bibliography. Specifically, the author's name is presented First M Last instead of Last, First M. The rest of the citation is fine. Any ideas why this might be and/or how to fix it?               \documentclass[12pt]{article}     \usepackage[authordate,numbermonth=false,doi=false,%                 isbn=false,backend=biber]{biblatex-chicago}     \addbibresource{<bibfilename>.bib}     \begin{document}     Here comes the full citation that I will be using:          \fullcite{<key>}          It looks different from the reference that you will see below,%     as the first and last name are reversed.     \printbibliography      I have tried other advice regarding customization of \fullcite but most other articles deal with a different biblatex format such as APA. Any help greatly appreciated!


title: How can I remove leading and trailing spaces from a macro argument?

text: Consider this minimal working example:               \documentclass[a4paper]{amsart}          \usepackage{tikz}          \tikzset{graph/.style = {every node/.style = { draw,                                                    shape = circle,                                                    fill = black,                                                    minimum size = 0.8mm,                                                    inner sep = 0mm,                                                    label distance = 0.8mm                                                    }}}          \newcommand{\circumferencenode}[4][]{\node (#1#2) at (#4: #3) [label = #4: $#2$] {};}          \newlength{\gr} % graph radius     \setlength{\gr}{15mm}          \begin{document}         \begin{tikzpicture}[graph]             \circumferencenode{0}{\gr}{ 90}             \circumferencenode{1}{\gr}{ 30}             \circumferencenode{2}{\gr}{330}             \circumferencenode{3}{\gr}{270}             \circumferencenode{4}{\gr}{210}             \circumferencenode{5}{\gr}{150}             \draw (0) -- (1) -- (2) -- (3) -- (4) -- (5) -- (0);         \end{tikzpicture}              \vspace*{10mm}              \begin{tikzpicture}[graph]             \circumferencenode{02}{\gr}{ 90}             \circumferencenode{ 3}{\gr}{  0}             \circumferencenode{ 4}{\gr}{270}             \circumferencenode{15}{\gr}{180}             \draw (02) -- (3) -- (4) -- (15) -- (02);         \end{tikzpicture}     \end{document}      This is what the output looks like: ![](http://junk.orderofthehammer.com/weird-graph.png) As you can see, the second example is weird-looking. Something has gone wrong with the placement of nodes. I could ask why this is happening, but some experimentation shows that if the second picture is changed to the following:               \begin{tikzpicture}[graph]         \circumferencenode{02}{\gr}{90}         \circumferencenode{3}{\gr}{0}         \circumferencenode{4}{\gr}{270}         \circumferencenode{15}{\gr}{180}         \draw (02) -- (3) -- (4) -- (15) -- (02);     \end{tikzpicture}      or even to this:               \begin{tikzpicture}[graph]         \circumferencenode{02}{\gr} {90}         \circumferencenode {3}{\gr}  {0}         \circumferencenode {4}{\gr}{270}         \circumferencenode{15}{\gr}{180}         \draw (02) -- (3) -- (4) -- (15) -- (02);     \end{tikzpicture}      then the problem disappears, and the second graph appears the way one would expect. So the problem is apparently the leading spaces in the arguments to the macro. I could get rid of them and do just fine. However, it is pleasing to me to arrange the calls to the `\circumferencenode` macro the way I did originally, so that the numbers and the sets of braces are vertically aligned. So a better solution would be to find out how to strip leading and trailing spaces from macro arguments.   * Why does the original example not work properly?   * How can I strip leading and trailing spaces from the arguments to macros I define?


title: Which font style is this?

text: Does anyone know which font style the 'a' circled in yellow in the image below is (this is in math mode)? My guess is `euscript` with `mathcal`, but it seems that `mathcal` does not apply to lowercase letters, unless I am wrong about that. ![enter image description here](http://i.stack.imgur.com/A6kfW.jpg)


title: Symbols for symmetric difference

text: I have problem with symbol for symetric difference (see http://en.wikipedia.org/wiki/Symmetric_difference). In common used is               \triangle     \ominus      But in Polish tradition often is used:               \dot{-}      and I would like to ask if it is possible to make dot to be a little bit down to (close to) line (here where is red dot). ![enter image description here](http://i.stack.imgur.com/czL26.png)


title: fancyvrb inline verbatim with \newcommand and \CustomVerbatimCommand

text: I've just registered. This is my first question to this site. I am trying to make a verbatim command for inline code. This has been asked and answered many times before, but I never found a direct answer that actually works for me. I am using MikTeX 2.9, completely updated. In my text - a technical manual - I am using `fancyvrb`. I have plain text and code snippets. These are handled by `\DefineVerbatimEnvironment`. It is working fine. Inline code, on the other hand, has been posing the usual problem of passing a parameter into the `\Verb`. I mean to have an inline environment suitable for code, but allowing for text formatting **AND** immune to backslashes and so, so that I can format inline code or Windows file paths without the need to encode every single backslash as `\textbackslash`. I can use `\CustomVerbatimCommand`, but this uses a single character for enclosing the target text, instead of curly brackets. I came up with this definition:               \CustomVerbatimCommand{\inCodeStub}{Verb}{commandchars=¬¦^}     \newcommand{\inCode}[1]{\inCodeStub¡#1¡} With this I can use the `\inCodeStub¡text¡` - which I did not wish to - but the attempt at the bracketed version is not working. Could anyone tell me why/offer a solution? Here is a MWE:               \documentclass{book}     \usepackage{fancyvrb}     \usepackage{inconsolata}     % New command/environment for code snippets     % Inline code fragments     \newcommand\InCode[1]{\texttt{\frenchspacing#1}}     % Code blocks     \newenvironment{Code}{         \begin{quote}\begin{tt}     }{\end{tt}\end{quote}}     % Code blocks, no left margin     \newenvironment{leftCode}{         \begin{tt}     }{\end{tt}}          % Complex code blocks, where too many encodings would be necessary     % Inline code fragments     % The inverted exclamation mark -- ¡ -- never occurs in code, so it is a good candidate to use as bracket     \CustomVerbatimCommand{\inCodeStub}{Verb}{commandchars=¬¦^}     \newcommand{\inCode}[1]{\inCodeStub¡#1¡}          % This is a stub for the fancyvrb starred environments below     \DefineVerbatimEnvironment%     {leftCodeStub}{Verbatim}{commandchars=¬¦^}     % NOTE: Inside this environment, intead of     % \command{object}, write     % ¬command¦object^     % as these characters -- ¬, ¦ and ^ -- are very rare in code          \newenvironment{Code*}{         \quote\leftCodeStub     }{\endleftCodeStub\endquote}          \begin{document}     Text outside. \inCode{Text inside. Works with plain text.} Text outside.          Now with backslashes it doesn't work: \inCode{\something and ¬textbf¦\something^}          But the same using the stub code works fine: \inCodeStub¡\something and ¬textbf¦\something^¡     \end{document}


title: plain xetex page labels

text: there are some PDF files that some reader displays the printed page number as the current page number. I also saw, that this can be achieved in latex with hyperref package. what I'm look for is what`\special` command I need to achieve the same result; I can't find it in the PDF reference.


title: Sync listings caption numbers and add all to List of Listings

text: I want to create a list of all listings. Listings itself allows to add captions and list them in a list using `\lstlistoflistings`, but they can not float. If I set up such a floating environment using `floatrow` they belong to a different list and the number of the caption is wrong. I would like to have the numbers correct in one numbering scheme and add both to the List of Listings. The caption of the first one is "Listing 1: " The caption of the second one is "Code 0.0.1: "               \documentclass{scrbook}          \usepackage{listings}     \usepackage{floatrow}     \DeclareNewFloatType{Code}%     {placement=tbhp,within=section,fileext=loc}          \begin{document}     \begin{lstlisting}[caption={LaTeX Listings}]     \begin{document}     \chapter{Introduction}     Some text ...     \chapter{Theory}     \end{document}     \end{lstlisting}          \begin{Code}[H]     \begin{lstlisting}[language={[Visual]Basic}]     Sub Main()         MsgBox "Hallo Welt!"     End Sub     \end{lstlisting}       \caption{Hello World in Visual Basic 6}       \label{lstLaTeXLinesOfCode2}     \end{Code}          \lstlistoflistings     \listof{Code}{List of Code listings}          \end{document}


title: Manual column spacing in tabular environment and centering

text: How can I adjust the column spacing in a tabular environment and also center the contents? The code I use is this:               \documentclass[12pt]{article}          \usepackage[utf8]{inputenc}          \usepackage{amsmath}     \usepackage{unicode-math}          \begin{document}          \begin{center}          \begin{tabular}{|p{8cm}|p{2cm}|}          \hline          1 & 2\\     \hline     3 & 4\\     \hline          \end{tabular}          \end{center}          \end{document}      Edit I: Also while I was working in that code trying to create a second table under the first one both with the same width I ended up with the second being larger, although the width I gave was the same. Why is that happening?               \documentclass[12pt]{article}          \usepackage[utf8]{inputenc}          \usepackage{amsmath}     \usepackage{unicode-math}          \begin{document}          \begin{center}          \begin{tabular}{|p{8cm}|p{2cm}|}          \hline          1 & 2\\     \hline     3 & 4\\     \hline          \end{tabular}          \begin{tabular}{|p{3cm}|p{3cm}|p{4cm}|}          \hline     1 & 2 & 3\\     \hline     4 & 5 & 6\\     \hline               \end{tabular}          \end{center}          \end{document}


title: Correct arrow for mathematical limits

text: I am currently using `$$\phi(\varepsilon) \overrightarrow{ \varepsilon \rightarrow 0 }0 $$` for writing down mathematical limits. But I am not very confident with this notation, as the text under the arrow is far too huge displayed. Does anybody here have a better suggestion


title: Using the same figure twice with no new number

text: I have a figure that relates to two different issues discussed at very different point in a long document. Rather then send the reader back 50 pages to look up a figure, I would like to include the figure again at the later point. However, I don't want it to appear twice in the list of figures or receive a new label number. In this example, I would like it to appear in chapter 2 as figure 2.5 and again in chapter 4 as figure 2.5. Is there a simple way to accomplish this? I am using Xelatex Version 3.1415926-2.5-0.9999.3 from the Texlive 2013 Arch Linux package.


title: Why does \label create an undesired white space after \phantomsubcaption?

text: Usually `\label` does not create any white spaces. However, It creates an white space when `\label` is used after `\phantomsubcaption` from `subcaption` package.   * Why?   * How can I get rid of this white space? Here is a MWE:               \documentclass{article}     \usepackage{subcaption}          \begin{document}          \section{a}     a\label{sec:a}b% no white space between `a' and `b'          \begin{figure}       \centering       {a\phantomsubcaption\label{fig:a}}%       {b\phantomsubcaption\label{fig:b}}       \caption{With label}% undesired white space between `a' and `b'     \end{figure}          \begin{figure}       \centering       {a\phantomsubcaption}%       {b\phantomsubcaption}       \caption{Without label}% no white space between `a' and `b'     \end{figure}          \end{document}


title: Format table with aligned values +/- errors and units (and parentheses)

text: I want to have a table with numbers ± errors and units (or a percent sign). Ideally, the numbers are aligned at the decimal separators and the ± sign. Here is my best solution so far using `siunitx` that does not have units:               \sisetup{     table-number-alignment=center,     separate-uncertainty=true,     table-figures-integer = 1,     table-figures-decimal = 2}     \begin{table}     \centering     \caption{Fancy caption describing the table}     \label{tab:fancy_table}     \begin{tabular}{l                     S[separate-uncertainty,table-figures-uncertainty=1]                     S[separate-uncertainty,table-figures-uncertainty=1]                     S[separate-uncertainty,table-figures-uncertainty=1]                     S[separate-uncertainty,table-figures-uncertainty=1]}     \toprule                   & \multicolumn{2}{c}{I} & \multicolumn{2}{c}{II} \\      {Category}    & {a} & {b} & {c} & {d} \\     \midrule     {A}           & 2.51 \pm 0.15   & 2.49 \pm 0.11 & 2.28 \pm 0.05 & 2.23 \pm 0.05 \\     {B}           & 2.51 \pm 0.15   & 4.20 \pm 0.05 & 4.20 \pm 0.05 & 4.20 \pm 0.05 \\     {C}           & 0.22 \pm 0.05   & 4.20 \pm 0.05 & 4.20 \pm 0.05 & 4.20 \pm 0.05 \\     \midrule     {Total}       & 4.20 \pm 0.05   & 4.20 \pm 0.05 & 4.20 \pm 0.05 & 4.20 \pm 0.05 \\     \bottomrule     \end{tabular}     \end{table}      Which produces this table: ![resulting table output](http://i.stack.imgur.com/6LIds.png) So far, so good. Now all these numbers have units. Or, in this example are percentages. The formatting rules I am bound to request to format these values as               (0.22 ± 0.05)%       or               (0.22 ± 0.05) mm      This can be achieved with `siunitx`:               \sisetup{separate-uncertainty=true}     \SI{100 \pm 12}{\percent}      However, putting both together and adding `\SI{x.xx \pm x.xx}{\percent}` in the table breaks the alignment. Can I achieve both, somehow?


title: Make a single reference list for multiple documents

text: How can I create a single reference list that contains precisely the items cited in at least one of several distinct documents? I do not want to include any references that not actually cited, but the citation can come from one of several documents, and the reference list should be, again, a separate document. Motivation: This seems to be what is requested by the grant proposal guidelines for the NSF. Additional information: I'm using BibTeX (with BibDesk on Mac OS X). The references all come from a single `*.bib` file.


title: Problem using tikz with a caption and floatrow together

text: I have this MWE drawing a caption over an image but when I load the `floatrow` package, the caption will be drawn under the image. When I only write a text over the image it works.               \documentclass{article}          \usepackage{graphicx}     \usepackage{tikz}          %problem!     \usepackage{floatrow}          \begin{document}          \begin{figure}         \begin{tikzpicture}          \node [draw=black, anchor=south west] at (0,0) {\includegraphics[width=\textwidth]{fig1}};               \node [draw=black, anchor=south west, text width=.3\textwidth] at (0,0) {        \caption{A picture of a X.}};         \end{tikzpicture}      \end{figure}     \end{document}


title: Beamer and babel packages in TeX

text: I tried to create slides with `beamer` and the `babel` package with Farsi option `\usepackage[farsi]{babel}`. When run I it with lualatex some error generate such as > String contains an invalid UTF-8 sequence. I use this code:               \documentclass[ucs]{beamer}     \usetheme{Aalborg}       \usepackage[utf8]{luainputenc}     \usepackage[T1]{fontenc}     % Or whatever. Note that the encoding and the font should match. If T1     % does not look nice, try deleting the line with the fontenc.     \usepackage{helvet}     \usefonttheme[onlylarge]{structurebold}     \setbeamerfont*{frametitle}{size=\normalsize,series=\bfseries}     \setbeamertemplate{navigation symbols}{}          % Standard packages          \usepackage[farsi]{babel}     \usepackage{fontspec}     \usepackage{amsmath}     \setmainfont[Script=Arabic,Numbers=Arabic]{XB Zar}\setsansfont[Script=Arabic,Numbers=Arabic]{XB Zar}      Setup TikZ          \usepackage{tikz}     \usetikzlibrary{arrows}     \tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]          % colored hyperlinks     \newcommand{\chref}[2]{%       \href{#1}{{\usebeamercolor[bg]{Aalborg}#2}}%     }          \begin{document}     % the titlepage     %{\aauwavesbg     %\begin{frame}[plain,noframenumbering] % the plain option removes the sidebar and header from the title page       %\titlepage     %\end{frame}}     \begin{frame}     سلام     \end{frame}     \end{document}


title: How do I process a comma separated list passed through a command

text: When passing a comma-separated list the commas are ignored, i.e. the list becomes a single item and I can't seem to find a way to prevent this. What should I do so that TEST C in the attached code will achieve the expected result of "extratcting" the itmes in the list?.               \documentclass{article}     \usepackage{pgffor}     \newcommand{\setstr}[2]{\expandafter\def\csname#1\endcsname{#2}}     \newcommand{\getstr}[1]{\csname#1\endcsname}     \newcommand{\PROCESS}[1]     {     The list items are:      \foreach \i in {#1}      {        (\i)      }     }     \newcommand{\SETC}[2]{\setstr{C#1}{#2}}     \newcommand{\RUN}[1]{     \expandafter\PROCESS\expandafter{\getstr{C#1}}     }     \begin{document}     %     % The following works     %     \noindent{TEST A:}     \PROCESS{a,b,c,d}     \newline     %     % and the following also works     %     \noindent{TEST B:}     \newcommand{\A}{a,b,c,d}     \expandafter\PROCESS\expandafter{\A}     \newline     %     % but this  does not work     %     \noindent{TEST C:}     \SETC{1}{a,b,c,d}%     \RUN{1}%     \newline     \end{document}


title: Can I calculate a square or square root to include as coordinates in a tikz picture?

text: I am trying to draw the folding lines of a paper plane. This as a template for my kids to learn how to fold a paper plane. I came as far as:               % based on http://michaelgoerz.net/blog/2009/07/printable-paper-with-latex-and-tikz/     \documentclass[a4paper, 10pt]{article} % for A4 size paper     \usepackage{tikz}     \begin{document}     \pagestyle{empty}     \begin{tikzpicture}[remember picture, overlay]        \tikzset{normal lines/.style={gray, very thin}}      \tikzset{margin lines/.style={gray, thick}}      \tikzset{mm lines/.style={gray, ultra thin}}      \tikzset{strong lines/.style={black, very thin}}      \tikzset{master lines/.style={black, very thick}}      \tikzset{dashed master lines/.style={loosely dashed, black, very thick}}       \node at (current page.south west){       \begin{tikzpicture}[remember picture, overlay]            \draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(0.5*\paperwidth,0); %middenlijn         \draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(\paperwidth,\paperheight-0.5*\paperwidth); %korte vleugel1         \draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(0,\paperheight-0.5*\paperwidth); %korte vleugel2       \end{tikzpicture}     };     \end{tikzpicture} \end{document}      The result: ![enter image description here](http://i.stack.imgur.com/wPMbg.jpg) For the next folding line I need to know the length of the first folding lines. To calculate this I need just to perform a simple Pythagorean theorem consisting of a square root of the sum of two times the square of 0.5*\paperwidth. I thought the following would do the trick.               \pgfmathparse{sqrt({(0.5*{\paperwidth})^2}+{pow((0.5*{\paperwidth})^2)})};     \draw[style=dashed master lines] (0.5*\paperwidth,\paperheight)--(0.5*\paperwidth,\paperheight-0.5*\pgfmathresult) ;       unfortunately I didn't get the expected result. What am I doing wrong, or how should I calculate a squareroot or square of \paperwidth?


title: How can I align the itemize with its title?

text: I want to align the list of items with its title, all start from the left margin of the page. For decreasing the space between the items, I have used "compactitem" package. But the result is like this: **Name list**   * item 1   * item 2   * item 3 But I want the bullets align with title "Name list" (i,e with no indent). I used \noindent for each item but it doesn't change. How can I do it?


title: How to enable --shell-escape when using pdflatexmk?

text: I want to use the `auto-pst-pdf` package and therefore I need the `\--shell- escape` option to be enabled. I did this in my TeXShop preferences as follows: ![enter image description here](http://i.stack.imgur.com/PtpLZ.png) However when I use `pdflatexmk` (by writing `% !TEX TS-program = pdflatexmk` on the first line) to compile my document the option is not taken into account and `auto-pst-pdf` can not be used.   How do I enable the `\--shell-escape` command with `pdflatexmk`? I use TeXShop 3.24 on Mac OSX with pdflatexmk version 4.37.