title: Drawing arrows indicating path's length in TikZ

text: I want to redraw this image using TikZ: ![enter image description here](http://i.stack.imgur.com/tgOlR.png) I've written this code so far:               \documentclass[tikz]{standalone}          \usetikzlibrary{intersections}     \tikzset{help lines/.style={dashed, thick}}          \begin{document}     \begin{tikzpicture}[scale=3]     \clip (-2,-1.5) rectangle (1.5,1.5);            % draw x axis and small ticks at centers of circles       \draw[name path={xaxis}] (-2,0) -- (2,0);       \draw (-1.5,0.05) -- (-1.5,-0.05);       \draw (0,0.05) -- (0,-0.05);            % set coordinate of center of big circle       \coordinate (centerbig) at (-1.5,0);            % draw small circle and invisible big circle       \draw[name path={small circle}] (0,0) circle (1);       \draw[style=transparent,name path={big circle}] (-1.5,0) circle (2) {}; % just to get name for bigcircle            % calculate and name intersections of both circles and big circle with x axis       \draw [name intersections={of=small circle and big circle, by={first intersect, second intersect}}];       \draw[name intersections={of=big circle and xaxis, by={middle intersect}}];            % draw help lines of big circle       \draw[style=help lines] (middle intersect) arc (0:35:2);       \draw[style=help lines] (middle intersect) arc (0:-35:2);            % draw radius lines of big circle       \draw (centerbig) -- +(20:2);       \draw (centerbig) -- (second intersect);              % indicatior for diameter of small circle        \draw[thick,style = ->] (135:1.3) -- (135:1);        \draw[thick,style = ->] (-45:1.3) node[above right] {\(2 D\)} -- (-45:1);            % draw the section of big circle inside the small circle       \pgfsetlinewidth{1.5pt}       \pgfsetstrokecolor{black}       \pgfpathmoveto{\pgfpointanchor{first intersect}{south}}       \pgfpatharcto{2cm}{2cm}{1}{0}{0}{\pgfpointanchor{second intersect}{south}}       \pgfusepath{stroke}     \end{tikzpicture}     \end{document}        It yields this image: ![enter image description here](http://i.stack.imgur.com/0zWm5.png) As you can see, tthe indicator for the angle γ is missing. To keep things tidy I am looking the an answer to another question: **How can I draw the arrows above the two lines reading vT and r?** (Answers to the other missing feature are also welcome...)


title: TikZ: "Inline" pgfonlayer?

text: > **Possible Duplicate:**   >  "Z-level" in TikZ When using layers in tikz I usually do the following:               \begin{pgfonlayer}{background}         \draw[red] (0,0)--(1,0);     \end{pgfonlayer}      Is there a way of using the layers inline? e.g.:               \draw[layer=background, red] (0,0) -- (1,0);


title: Converting a pdf into a form ready for binding

text: I have a pdf that is 118 pages long, and I want to end up with a bindable form, so that I have on one sheet pages:               1    4     2    3      What is the simplest way in LaTeX to accomplish this? Would quire work, and if so - how do I go about using it--as I am a bit confused about how to do so. Thanks.


title: How could I use \input within soul arguments?

text: So, I basically want to do something like this:               \documentclass{article}     \usepackage{soul}     \begin{document}          \so{Hello}          \so{\input{key.tex}}          \end{document}      Now the first "so" works but the second does not. It does not find the file no matter how I specify the file location. Why does this not work and how could I fix it? Perhaps modifying the soul source code but what should I modify? I would rather use the soul to do this because this is continuation from How to make overlaid text?.


title: TeX capacity exceeded, sorry [semantic nest size=500]

text: Reading through `tex.web`, I note that there is a difference between grouping levels and semantic nesting (i.e., the nesting of math, horizontal, and vertical modes). I can think of commands which increase the grouping level without changing modes: `\begingroup`, `\bgroup`. Are there commands which nest modes without affecting the grouping level, and is it possible to reach the overflow "semantic nest size" exceeded seen in the procedure `push_nest`:               @p procedure push_nest; {enter a new semantic level, save the old}     begin if nest_ptr>max_nest_stack then       begin max_nest_stack:=nest_ptr;       if nest_ptr=nest_size then overflow("semantic nest size",nest_size);     @:TeX capacity exceeded semantic nest size}{\quad semantic nest size@>       end;     nest[nest_ptr]:=cur_list; {stack the record}     incr(nest_ptr); head:=get_avail; tail:=head; prev_graf:=0; mode_line:=line;     end;      A naive               \def~{\hbox\bgroup}     \edef~{~~~~}     \edef~{~~~~}     \edef~{~~~~}     \edef~{~~~~}     ~ % 256 times \hbox\bgroup      leads to TeX's capacity being exceeded because of the number of grouping levels.


title: MAction for PDF files?

text: The MathJax JavaScript library contains a command that lets you create LaTeX slideshows, namely the `\toggle` command. I would find it incredibly useful to produce the same effect in a PDF file, most prominently to consecutively draw complicated commutative diagrams. Hence, my questions:   1. Can modern PDF documents contain slideshow elements of some kind?   2. If so, is there a LaTeX package that allows me to create this effect in a PDF document? **Edit:** By popular request, here's an example:               <!DOCTYPE html>     <html lang="en">         <head>             <meta charset="utf-8">             <title>Toggle Math</title>             <meta name="viewport" content="width=device-width, initial-scale=1.0">             <meta name="description" content="Toggle Math">             <meta name="author" content="Jesko">             <script type="text/x-mathjax-config">             MathJax.Hub.Config({                 tex2jax: {                     inlineMath:  [['$',  '$'  ]],                     displayMath: [['\\[','\\]'], ['$$','$$']],                     processEscapes: true                 },                 TeX: {                      equationNumbers: { autoNumber: "AMS" },                     extensions: ["AMSmath.js", "AMSsymbols.js","action.js" ]                 }              });             </script>                     <script type="text/javascript"               src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">             </script>         </head>              <body>         <script type="math/tex">                \toggle{x=1}{x=2}{x=3}\endtoggle              </script>         </body>     </html>      Just put that in a **.html** file and check it out.


title: What happens when \textheight changes mid-document?

text: I know it's generally considered to be unwise, but I need to understand what happens when `\textheight` changes mid-document. From this example, it appears that the change takes effect on the _next_ page, when `\vsize` is changed.               \documentclass{article}     \begin{document}     \typeout{Page 1:}     \showthe\textheight     \showthe\vsize     abc     \newpage     \typeout{Page 2:}     \addtolength{\textheight}{1cm}     \showthe\textheight     \showthe\vsize     def     \newpage     \typeout{Page 3:}     \showthe\textheight     \showthe\vsize     ghi     \end{document}      Is this always the case?


title: Multiple lines of TeX output between btex and etex in METAPOST

text: As you know, this is how to create labels in METAPOST:               label(btex some text etex, (0,0));      How do I place text on multiple lines -- in this case such that "some" appears on one line, and "text" appears on the next line? Putting "\\" between them doesn't seem to work at all. Here is the skeleton of my file:               verbatimtex     %&latex      \documentclass[10pt]{article}     \begin{document}     etex     input mp-tool;     beginfig(0);          label(btex some text etex, (0,0));          endfig;     verbatimtex     \end{document}     etex     end


title: Using node shapes or self made tikzpicture as image in legend

text: I am using the solutions of Using a pgfplots-style legend in a plain-old tikzpicture and Legend in tikzpicture to create a legend in a tikzpicture. In this legend I need a cylinder as image. I know that a node can be shaped as a cylinder. But I don't now how I can use this to create a legend image.               \begin{tikzpicture}          % node shaped as cylinder     \node[shape=cylinder](c) at (0,0){};          % cylinder drawn myself     \draw(3,3)--(4,3);     \draw(3,4)--(4,4);     \draw(3,2.5) ellipse (0.1 and 0.5);     \draw(4,2.5) ellipse (0.1 and 0.5);          \begin{customlegend}[legend cell align=left,     legend entries={ cylinder},     legend style={at={(6,3)},font=\footnotesize}]     \addlegendimage{ ??????? }     \end{customlegend}          \end{tikzpicture}


title: What is the correct way to delineate directories in Lua?

text: I have been experimenting with some Lua code to list directories and provide them to the TeX engine. I have been using the `Lua File System (lfs)` module. The first part list the current directory (code line 4) and it is printed using `\`, as `C:\Users\Admin\\...` In the second part I iterate over the directory which I am providing as a variable,               `local z="C:/test"`      This also works if I provide it as: `local z="C:\test" The library accepts this as a valid directory. I am curious to find out how well this will work on other operating systems (I have tested on Windows) and what is the best practice in this regard. ![enter image description here](http://i.stack.imgur.com/m6nM3.jpg) Full MWE listing follows. (Warning it can print 100s of pages if you test on `C:` alone, create a small temporary directory to test).               \documentclass{tufte-book}     \usepackage[listings]{tcolorbox}     \lstloadlanguages{[LaTeX]TeX, [primitive]TeX}     \usepackage{luacode} % loads luatexbase as well     % Emphasis     %\renewcommand{\ttdefault}{cmtt}            % prefer old tt font     \newcommand\emphasis[2][blue]{\lstset{emph={exec,if,then,else,do,end,while,for,print,sprint,directlua,#2},        emphstyle={\ttfamily\textcolor{#1}}}}%          \lstset{language={[LaTeX]TeX},           escapeinside={{(*@}{@*)}},            numbers=left,            gobble=0,           stepnumber=1,numbersep=5pt,             numberstyle={\footnotesize\color{gray}},%firstnumber=last,           breaklines=true,           framesep=5pt,           basicstyle=\small\ttfamily,           showstringspaces=false,           keywordstyle=\ttfamily\textcolor{blue},           stringstyle=\color{orange},           commentstyle=\color{black},           rulecolor=\color{gray!10},           breakatwhitespace=true,          showspaces=false,  % shows spacing symbol          xleftmargin=0pt,          xrightmargin=5pt,          aboveskip=3pt, % compact the code looks ugly in type          belowskip=7pt,  % user responsible to insert any skips           backgroundcolor=\color{gray!15}}     \begin{document}          %\begin{tcblisting}{} uncomment if you have the latest version of tcolorbox     \begin{luacode}       require "lfs"       local temp=lfs.currentdir()       tex.sprint(-2, temp)       tex.sprint("\\par")       function attrdir (path)         for file in lfs.dir(path) do             if file ~= "." and file ~= ".." then                 local f = path..'/'..file                 tex.sprint (-1, f.."\\par     ")                 local attr = lfs.attributes (f)                 assert (type(attr) == "table")                 if attr.mode == "directory" then                     attrdir (f)                 else                    -- for name, value in pairs(attr) do                         --tex.sprint (-2,name, value)                     -- end                 end             end         end       end       local z="C:/test"       attrdir (z)     \end{luacode}     %\end{tcblisting}     \end{document}


title: Increase the gap before and after the dots in inline list

text: How to increase the gap before and after the dot? ![enter image description here](http://i.stack.imgur.com/V0JLI.png) Here's a MWE:               \documentclass[a4paper]{article}          \usepackage[inline]{enumitem}          \begin{document}          \begin{itemize*}       \item[] First point       \item Second point       \item Third point     \end{itemize*}          \end{document}


title: A thicker wave underline

text: I have found `\uwave` in the `ulem` package, and its definition in `ulem.sty`:               % Now define various special underlines.  All the definitions go like     % \def \command {\bgroup \markoverwith{something} \ULon}          % For drawing a wavey underline instead of a straight one the command     % is \uwave (under-wave) which uses the wiggle from 6-pt lasy font:          \def\uwave{\bgroup \markoverwith{\lower3.5\p@\hbox{\sixly \char58}}\ULon}     \font\sixly=lasy6 % does not re-load if already loaded, so no memory problem.      I would like to keep the underline wave, but **much thicker** , does anyone know how to do it?


title: Is it possible to change the font of line numbers in a code listing?

text: Using LyX I can add line numbers to my code listing. However, these are in the document (serif/Roman) font and look strange next to code blocks (Typewriter font). Is it possible to change the font of the line numbers to match that of the code block? Can this be achieved using either listing parameters or some LaTeX code in the preamble?


title: How reduce badbox sensitivity locally?

text: In my document I have a `Underfull \vbox (badness 2662)`. I want to ingnore this specific badbox but none of the others. Therefore, I want to make LaTeX locally less sensitive to badboxes. I tried               \vbadness=3000     <some code>     \vbadness=0      where the last command is intended to turn the "ignore badboxes mode" off again. However, I then get a lot of "badness < 100 or somehing like that" messages, which I didn't get before. I suppose `\vbadness=0` is somewhat too little. What's LaTeX's default mode, I mean, if I don't interfere at all which is the badness threshold under which LaTeX doesn't complain?


title: How to invoke latex with the -shell-escape flag in TeXMakerX?

text: _This is a follow-up question on the post:Creating a table around a java script code highlighted using minted where invoking `-shell-escape` flag in TeXStudio is one of the two questions posted by the OP._ When running my document in TeXMakerX with `minted` package, I get the error               minted Error: You must invoke LaTeX with the `-shell-escape` flag      How can I invoke `-shell-escape` in TeXMakerX?


title: Referencing a text like a hyperreference inside a document

text: I have a table with many entries and I want to reference the key so another person can quickly look up what the key means. Here is some pseudocode:               Table     snippet1\label{?key1} & longexplanatory text     snippet2\label{?key2} & longexplanatory text     snippet3\label{?key3} & longexplanatory text          connect \ref{key1} with \ref{key13}      After compilation I want the text to read               connect snippet1 with snippet3      The reader should be able to quickly jump to the table when clicking on `snippet-N`.


title: How to Create Colored Text Boxes with DIFFERENT colors using "\leftbar" command?

text: I am using the following code to generate a Colored Box in Latex:               \renewenvironment{leftbar}[1][\hsize]%     {%             \def\FrameCommand%             {%                                    \fboxsep=\FrameSep\colorbox{Lavender!25}%             }%             \MakeFramed{\hsize#1\advance\hsize-\width\FrameRestore}%     }%     {\endMakeFramed}          \leftbar     \textbf<\textbf{Data Type}> <\textbf{Array Name}> \textbf{[RowSize]  [ColumnSize]};      \endleftbar      The **Settings** for the colored box are fixed before: "`\begin{document}`". Everytime, I draw a box using "`\leftbar`" "`\endleftbar`" -- it is always of the same color I mentioned in the Settings above. But I want to get Boxes with **Different Colors** (Rest of the settings same as above). It seems that "`\leftbar`" don't take the "color" as an Argument. Can anybody please guide me on how to generate boxes with Different colors using "`\leftbar`"?


title: How can I change my Bibliography to enumerate the supplemental references like [S1], [S2],...,instead of [1],[2],

text: I'm writing a scientific paper, using `\documentclass[aps,prl,...]{revtex4-1}` with supplemental Material. The Supplemental Material is an extra tex file and I want that the references there to be numbered like [S1],[S2],... I'm using `\bibliographystyle{apsrev4-1}`. Is there any way doing it like this?


title: How to left-align particular equations using own environment?

text: I'm trying to left align particular equations. To do that I created a new environment (because I need it a few times). Now, I found that there are various options to do that:   * using the `fleqn` option - but that does a left alignment for all the equations in the document   * `flalign` - but for that I always have to write `&&` at the end and it doesn't seem to work in an environment I defined I would like to be able to use for this kind of special equations some code like this               \begin{leftalignedequation}     ...     \end{leftalignedequation}      and it should do all the magic itself. And so my question is: What would you see as the best way to achieve that? I don't seem to find a good solution.


title: How to Hyperlink the Citation

text: At present I am using WinEdt v 5.5. My question is, how can I hyperlink the citation such that by clicking the cited number in the article(of a .pdf file) it will automatically take me to corresponding reference(in the same .pdf file)?


title: Use \label and cross-references in xymatrix

text: Whenever I am trying to use `\caption`, `\label` and cross-references in `xymatrix`, it is not working. An MWE :               \documentclass{book}     \usepackage[a4paper,margin=.45in]{geometry}     \usepackage{xypic}          \begin{document}     $$     \xymatrix{ A \ar[r]\ar[d] & B\ar[d]\\     C\ar[r] & D     \caption{Rectangular diagram}     \label{Fig1}     }     $$     The above figure \ref{Fig1} is a commutative diagram.     \end{document}      Anyone can tell me how do I fix this problem ?


title: preview and standalone crop too much of tikz picture

text: When I try to fit the page size to my tikz image, too much is cropped. No matter whether I use `\documentclass{standalone}`, `\documentclass[preview=true]{standalone}` or `\usepackage[active,tightpage]{preview}\PreviewEnvironment{tikzpicture}`. The complete source:               \documentclass{minimal}          \usepackage{tikz}     \definecolor{darkred}{rgb}{0.5,0,0}          \begin{document}          \begin{tikzpicture}         \begin{scope}[color=lightgray]             \draw (-8,0) -- (8,0);             \filldraw[shift={(8,0)},scale=0.25] +(-210:1) -- +(210:1) -- +(0:1) -- cycle;             \draw (0,-8) -- (0,8);             \filldraw[shift={(0,8)},scale=0.25,rotate=90] +(-210:1) -- +(210:1) -- +(0:1) -- cycle;         \end{scope}         \newcommand\hyper[4][]{\draw[mark=*,mark options={fill=black}] plot [#1] ({#2*exp(#4)+#3*exp(-#4)}, {#2*exp(#4)-#3*exp(-#4)})}         \newcommand\hyperline[6]{\draw ({#1*exp(#3)+#2*exp(-#3)}, {#1*exp(#3)-#2*exp(-#3)}) -- ({#4*exp(#6)+#5*exp(-#6)}, {#4*exp(#6)-#5*exp(-#6)})}         \pgfsetplotmarkrepeat{6}         \foreach \a in {-1, 1}{%             \foreach \b in {-1, 1}{%                 \begin{scope}[very thin, color=gray]                     \begin{scope}[domain=-2:2]                         \hyper\a0\x;                         \hyper0\b\x;                         \hyper\a\b\x;                     \end{scope}                     \begin{scope}[domain=-1.3:1.3]                         \hyper{\a*2}{\b*2}\x;                     \end{scope}                 \end{scope}             }         }         \begin{scope}[color=darkred]             \foreach \k in {0,...,2}{%                 \hyperline0{-1}\k1{-1}\k;                 }         \end{scope}     \end{tikzpicture}          \end{document}      This looks like this: ![enter image description here](http://i.stack.imgur.com/IpnHw.png) After reading Transparency in tikz, preview package and xelatex, I tried to set the size manually:               \usepackage{geometry}     \geometry{paperwidth=163mm,paperheight=163mm,margin=0mm}      But this gives me the error message: > ! Package geometry Error: \paperwidth (0.0pt) too short.


title: Color a block of texts inside tabbing

text: I am editing a frame of a presentation in `beamer`. This frame has 2 parts side by side. The left side is a program by `tabbing` containing 5 lines:               \begin{frame}       \frametitle{A motivating example}       \begin{columns}         \begin{column}{0.48\textwidth}           \begin{framed}             \resizebox{0.85\textwidth}{!}{%               \begin{minipage}{\textwidth}                 \begin{tabbing}                   \quad \= \hspace{-0.3cm} \quad \= \hspace{-0.1cm} \quad \= \hspace{-0.1cm} \quad \= \hspace{-0.1cm} \quad \= \hspace{0cm} \= \\[-\baselineskip]\kill                   1 \> \> line 1 \\                   2 \> \> line 2 \\                   3 \> \> line 3 \\                   4 \> \> line 4 \\                   5 \> \> line 5                 \end{tabbing}               \end{minipage}}           \end{framed}         \end{column}         \begin{column}{0.48\textwidth}         ...         \end{column}       \end{columns}     \end{frame}      I would like to make Lines 3, 4 and 5 in blue, instead of black. I try to put `\color{blue}` in front of `3`, but it doesn't color things after `3`. I try to put `\textcolor{blue}{...line 3...line 4...line 5...}`, but it gives an error. Does anyone know if it is possible to color 3 lines together?


title: Lyx: fails to insert nomenclature

text: I am having problems inserting nomenclature entries using Lyx. I enter the symbol and description, press OK, and the nomenclature entry is not made ( ie no box Nom: ...) [no error messages]. I haven't worked out what triggers this ( ie sometimes insertion works, sometimes doesn't)...Its very frustrating.   I am mainly dealing with mathematical symbols so I tend to (try to) insert in formula or after formula... I feel that the problem has to do with where I place the insertion, but I haven't worked it out. Similarly I haven't got a little test file to demonstrate it


title: Question about WinEdt

text: I am planning to write a book on project management. A colleague clued me in to LaTex as a platform in which to write this book (for ultimate self- publishing). So I realize I have a learning curve ahead of me but am willing to tackle it. However, I recall him saying (or my hearing) that I needed to get an editor called WinEdt. If so, is that a component of LaTex? Or a separate editor that I must get that works in conjunction with LaTex? I have a copy of "The not so short introduction to LaTex" and a search shows no mention of WinEdt. So, did I misunderstand? Is this a component of LaTex that handles editing? Or do I need no such thing and LaTex is sufficient for writing/editing and it is all-in-one? If, however, I do need WinEdt where do I find it? Thanks.


title: Redefine ToC entry style without packages

text: I've redefined the section, subsection and subsubsection styles in my preamble as               \renewcommand\section{%       \@startsection{section}{1}                     {\z@}%                     {-3.5ex \@plus -1ex \@minus -.2ex}%                     {2.3ex \@plus.2ex}%                     {\normalfont\normalsize\bfseries\uppercase}%     }          \renewcommand\subsection{%       \@startsection{subsection}{2}                     {\z@}%                     {-3.25ex\@plus -1ex \@minus -.2ex}%                     {2.3ex \@plus.2ex}%                     {\normalfont\normalsize\MakeUppercase}     }          \renewcommand\subsubsection{%       \@startsection{subsubsection}{3}                     {\z@}%                     {-3.25ex\@plus -1ex \@minus -.2ex}%                     {2.3ex \@plus.2ex}%                     {\normalfont\normalsize\bfseries}     }      And I want it to appear the same way in the ToC. I've tried using tocloft but it messes around with other stuff. How could I do it without the use of any package?


title: How does an academic publisher work with LaTeX file to produce html pages?

text: My teacher sent an academic paper written with LaTeX format file to hindawi.com publisher. They did something with our paper and has a public html page like this: http://www.hindawi.com/journals/jam/2011/464832/ I want to ask what they are doing to have a html page with same format as the LaTeX file (with math equation, annotation, ...like that) I want to build a website to store academic papers (with input is LaTeX file, output is html page). And I don't know how work with my LaTeX file? (Don't say with me that I must typing all again) Thanks in advance!


title: \newcommand defined for declarative formatting works for \it but not \textit or \emph

text: I defined this `\newcommand` for binomial genus/species names, which should be in italics:               \newcommand{\taxon}[1]{{\it #1}}      For whatever reason, it only renders the relevant text in italics if I use `\it`; `\emph` or `\textit` do not work (the text is unchanged). Is there a reason for this strange behaviour? `\textit` and `\emph` work perfectly well if I apply them directly.


title: TikZ: clipping and shade or fill drawing

text: I have re-written some code I wrote 3 months ago from here Filling between an ellipse and a line However, I cant fill in the smaller triangle no matter what I try. What I have tried so far is:               \begin{scope}                                                                        \clip (S) -- (F) -- (V) -- (S);                                                    \filldraw[bottom color = cyan!50!blue, top color = green!20]                       (S) -- (F) -- (V) -- (S);                                                         \end{scope}       and               \begin{scope}                                                                         \clip (S) -- (F) -- (V) -- cycle;                                                     \filldraw[bottom color = cyan!50!blue, top color = green!20]                        (S) -- (F) -- (V) -- (S);                                                         \end{scope}       and               \begin{scope}                                                                             \clip (S) -- (F) -- (V) -- cycle;                                                         \filldraw[bottom color = cyan!50!blue, top color = green!20]                            (S) rectangle (V) -- (S);                                                             \end{scope}       I have tried more but I am not going to list them all. The new code is:               \documentclass{article}       \usepackage{tikz}       \usetikzlibrary{cal, intersections, arrows}       \begin{document}       \begin{tikzpicture}[         every label/.append style = {font = \small},         dot/.style = {outer sep = +0pt, inner sep = +0pt, shape = circle,           draw = black, label = {#1}},         small dot/.style = {minimum size = .05cm, dot = {#1}},         big dot/.style = {minimum size = .1cm, dot = {#1}},         extended line/.style = {shorten >=-#1, shorten <=-#1},         extended line/.default = 1cm,         one end extended/.style = {shorten >=-#1},         one end extended/.default = 1.25cm, line cap = round, line join = round,         >=triangle 45]         \pgfmathsetmacro{\a}{3}         \pgfmathsetmacro{\b}{2.5}         \pgfmathsetmacro{\c}{sqrt(\a^2 - \b^2)}              \node[fill = black, big dot = {below left: \(A\)}] (A) at (-3, 0) {};         \node[fill = black, big dot = {below right: \(P\)}] (P) at (3, 0) {};         \node[fill = black, big dot = {below left: \(D\)}] (D) at (0, -2.5) {};         \node[fill = black, big dot = {above left: \(B\)}] (B) at (0, 2.5) {};         \node[fill = black, big dot = {below left: \(F\)}] (F) at (\c, 0) {};         \node[fill = black, big dot = {below left: \(O\)}] (O) at (0,0) {};              \draw (0, -3.25) -- (0, 3.25) node[scale = .75, fill = white,         inner sep = 0cm, pos = .7] {\(b\)};         \draw[name path = xline] (-3.25, 0) -- (5, 0) node[scale = .8, fill = white,         inner sep = 0cm, pos = .2] {\(a\)};         \draw[red, name path = circle] (O) circle (3cm);         \draw[blue, name path = ellipse] (O) ellipse (3cm and 2.5cm);         \path[name path = line] (2.25, 3) -- (2.25, -1);              \path[name intersections = {of = circle and line, by = P1}];         \node[fill = black, big dot = {above: \(Q\)}] (Q) at (P1) {};         \path[name intersections = {of = line and xline, by = P2}];              \draw[black] (Q) -- (P2) node[fill = black, big dot = {below right: \(V\)}]         (V) at (P2) {};         \path[name intersections = {of = line and ellipse, by = P3}];         \node[fill = black, big dot = {right: \(S\)}] (S) at (P3) {};              \draw (O) -- (Q) node[scale = .75, pos = .5, fill = white, inner sep = 0cm]         {\(a\)};         \draw[one end extended] (F) -- (S) node[scale = .8, pos = .5,         fill = white, inner sep = 0.03cm] {\(r\)};              \begin{scope}           \clip (S) rectangle (P);           \shadedraw[blue, outer color = blue!30!black, inner color = red!30]           (O) ellipse (3cm and 2.5cm);         \end{scope}       \end{tikzpicture}       \end{document}      ![enter image description here](http://i.stack.imgur.com/osvfK.png) So no matter what I do, I cant fill in `(S) -- (F) -- (V) -- cycle`


title: TikZ: Complicated Flow Chart

text: I do know how to build easy flow charts with TikZ, but now I'm completely overextended with this one. I need to rebuild the following Flow Chart. It doesn't need to look exactly like it, but the structure should be the same. I would really appreciate every help! My main questions are:   1. I have my `tikzpicture` inside a `figure` environment and I would like to have my whole `tikzpicture` rotated by 90 degree (landscape). How do I do this?    2. Can I build a Flow-Chart inside a node like you can see in the figure?    3. Is it possible to create this nice looking headline boxes on top of the actual node-boxes? ![FlowChart](http://i.stack.imgur.com/qhR5k.png) My Code so far:               \documentclass{article}          \usepackage{tikz} %für Flow Charts     \usetikzlibrary{shapes.geometric, arrows, positioning, calc, matrix}          \begin{document}          \begin{figure}[!h]      \centering     \tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!25]     \tikzstyle{block} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!25]     \tikzstyle{line} = [draw, very thick, color=black!80, -latex']           \begin{tikzpicture}[scale=1.0, align=center, on grid, auto],      % Place nodes     \node (A) [block] {header \\ formular \\ formular \\ text \\ formular };     \node (B) [process, right of=A, node distance=7.0cm] {text \\ formular};     \node (C) [process, right of=B, node distance=7.0cm] {header \\ formular \\ formular};     \node (D) [process, below of=A, node distance=5.0cm] {header \\ text \\ formular};     \node (E) [block, right of=D, node distance=14.0cm] {header \\ formular \\ formular \\ text \\ forular};          % Draw edges     \path [line] (A) -- (C);     \path [line,dashed] ($(A.east)+(0.2,0)$) |- (B);     \path [line,dashed] (B.east) -| ($(C.west)-(0.2,0)$);     \path [line] (C) -- (E);     \path [line,dashed] ($(E.west)-(0,1)$) -| (D.south);     \path [line,dashed] (D) -- (A);     \end{tikzpicture}          \caption{caption}          \end{figure}          \end{document}


title: How to find the error line in a multi file document

text: How can I find the error line in a multi file document? Usually WinEdt5 goes to the error line when double clicking on an error (at least with single files). When I include files, this is not working anymore and it jumps to the last line of the main file. I also don't know where to look up the error line by hand as it gives me e.g. an error on line 906, which is somewhere in the included files but I have no idea where. Is the an output file where I can look up the line numbers and find the error? (I'm using PDFLatex). Jumping to the error line would of course be even better.


title: Statistical significance stars

text: What's wrong with my code for three stars (`***`)? It's so ugly compared to my `**` and `*`.               \documentclass{article}     \newcommand{\oneS}{\ensuremath{{}^{\textstyle *}}}     \newcommand{\twoS}{\ensuremath{{}^{\textstyle **}}}     \newcommand{\threeS}{\ensuremath{{}^{\textstyle ***}}}          \begin{document}          0.11\oneS \newline          0.11\twoS \newline          0.11\threeS          \end{document}


title: How to use biber with keywords

text: When I try to compile references with keywords with `biber`               %adapted from http://tex.stackexchange.com/questions/97218/how-to-automate-biber-within-texniccenter     \listfiles                % shows used packages in a list in log file     \RequirePackage{filecontents}     \begin{filecontents*}{\jobname.bib}     @article{author2000,       author  = {AuthorA},       title   = {Title of Article},       journal = {Name of Journal},       year    = {2000},       keywords = {Key},     }     \end{filecontents*}          \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english]{babel}     \usepackage{csquotes}          \usepackage[%       style=authoryear      ,backend=biber         % to force biblatex to use biber     ]{biblatex}     \addbibresource{\jobname.bib}          \begin{document}          Hello \nocite{*}              % all bib entrys are printed          \printbibliography[keyword=Key]          \end{document}      But it always fails:               >biber texmwe     INFO - This is Biber 1.7     INFO - Logfile is 'texmwe.blg'     INFO - Reading 'texmwe.bcf'     WARN - Warning: Found biblatex control file version 2.0, expected version 2.5     INFO - Using all citekeys in bib section 0     INFO - Processing section 0     INFO - Looking for bibtex format file 'texmwe.bib' for section 0     Use of uninitialized value in string eq at C:\Users\user\AppData\Local\Temp\par-646572617269\cache-c3e641bac9e7e4b5ab17068122bff38686710985\inc\lib/Biber/Input/file/bibtex.pm line 119.     Use of uninitialized value in string eq at C:\Users\user\AppData\Local\Temp\par-646572617269\cache-c3e641bac9e7e4b5ab17068122bff38686710985\inc\lib/Biber/Input/file/bibtex.pm line 123.     Use of uninitialized value in string eq at C:\Users\user\AppData\Local\Temp\par-646572617269\cache-c3e641bac9e7e4b5ab17068122bff38686710985\inc\lib/Biber/Input/file/bibtex.pm line 127.     INFO - Decoding LaTeX character macros into UTF-8     INFO - Found BibTeX data source 'texmwe.bib'     INFO - Overriding locale 'English_United States.1252' default tailoring 'variable = shifted' with 'variable = non-ignorable'     INFO - Sorting 'entry' list 'nyt' keys     INFO - No sort tailoring available for locale 'English_United States.1252'     Can't use string ("Key") as an ARRAY ref while "strict refs" in use at C:\Users\derari\AppData\Local\Temp\par-646572617269\cache-c3e641bac9e7e4b5ab17068122bff38686710985\inc\lib/Biber/Output/bbl.pm line 436.      It works with bibtex, except that it complains about unsupported utf-8 encoding.


title: Separation of content structure and style in LaTeX?

text: In HTML, over the last decade or so, there has been a strong push toward complete separation of content structure and style. Most websites are now built using HTML for structural mark-up, and CSS for presentation of that markup. This makes it really easy to apply different styles over the same content: If you aren't aware of how powerful this is, see for instance http://www.csszengarden.com/. There is a W3c document making the case for separation of semantic and presentational markup. I'm relatively new to LaTeX, but I have been designing websites for a while. Yes, they're different fields, but they're trying to do the same thing: present content well. My experience with LaTeX over the last 6 months leaves me feeling that this concept of separation of content and style hasn't worked it's way into the TeX world very far. For instance, to define the wrapping rules of a table cell in HTML+CSS is as simple as adding a class to the cell, and adding one line to your CSS document. In LaTeX, you need to do something horrible like this. So, am I missing something, or is LaTeX? Is this concept of separation of content and style used in the design of LaTeX? Is it just poorly implemented? Is it likely to be implemented better in future versions (LaTeX3? ConTeXt?)? _Note: I mean no offence to LaTeX devs: the system is really nice for many other reasons. I just see this gaping hole, and little discussion around it, and I am wondering why._


title: How to cite an article from a webmagazine, which is between an article and a webpage

text: I found an article in the web magazine from Sony "CX-news" as PDF and as website. It is not exactly an article (it has no clear author, but the name of the magazine and the volume number) and its not just a unspecific webpage. How should in such an "in-between case" the citation look like and what information to put where in the bibtex file? The PDF contains more information and is thus probably better to cite.


title: increase length of a \node option and change its color

text: I would like to increase the vertical length of a node in a way that it can also stretch outside of my image. Moreover, I need to choose different color for each line.               \documentclass{article}     \usepackage{graphicx} % more modern     \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}     \begin{figure}     \vspace{0.5cm}     \centering     \begin {tikzpicture}     \begin {axis}[     title=LastFM,     width=\textwidth,     height=5cm,     grid=both,     unbounded coords=discard,     ylabel=Distance,     xlabel=Days,     ]     \addplot+[color=black,sharp plot, mark=none] coordinates{(1,123.247718031613)    (2,111.79445424528)(3,117.439346047226)(4,111.588529876507)(5,110.715852523476)(6,107.172757732551)(7,114.908659377786)(8,129.313572373514)(9,133.656275572829)(10,138.246157270284)(11,125.865007051205)(12,128.171759760097)(13,108.148046676766)(14,119.063008529098)(15,120.166551086398)(16,108.554133960895)(17,128.241958812239)(18,125.650308395961)(19,122.237473795886)(20,110)(21,107.990740343791)(22,113.877126763894)(23,125.283678106927)(24,130.107647738325)(25,131.818056426273)(26,134.476763792114)(27,101.133575038164)(28,119.674558699834)(29,116.952982005591)(30,117.413798166996)(31,110.571244001323)(32,104.019228991567)(33,95.9374796416917)(34,103.923048454133)};     \node[coordinate,pin=above:{10}] at (axis cs:16,128.241958812239) {};     \node[coordinate,pin=above:{10}] at (axis cs:37,117.524465538032) {};     \end{axis}     \end{tikzpicture}     \label{fig}     \caption{My Results}     \end{figure}     \end{document}      Result: ![Result](http://i.stack.imgur.com/B0Uqc.png)


title: Is there a difference between "" and {} in BibTeX?

text: I see in some examples each field in a BibTeX entry is given within `""`, while in others it is given within `{}`. For example,               @Book{Torre2008,      author    = "Joe Torre and Tom Verducci",      publisher = "Doubleday",      title     = "The Yankee Years",      year      =  2008,      isbn      = "0385527403"     }          @PROCEEDINGS {conference:06,      editor    = {First Editor and Second Editor},      title     = {Proceedings of the Xth Conference on XYZ},      booktitle = {Proceedings of the Xth Conference on XYZ},      year      = {2006},      month     = oct,     }      What are the differences between the two? Which one should I use?


title: Import and Export LaTeX presentations in graphical presentation editor

text: I want to find (or create) a graphical presentation editor (or say Winedt macros) that allows text, graphics images and latex formulas to be inserted and formatted interactively. It should also allow to import/export latex beamer presentations. I use WinEdt with MikTeX under Windows 7. Few months ago I tried to use Powerpoint 2010 with MathType 6.8, but it works very slow and often freezes.


title: Line style not updated when using gnuplot within pgfplots

text: I have a large data file with multiple columns. This makes it impossible for me to add multiple `\addplot` commands manually, so I am using `gnuplot` from within `pgfplots`. The problem is that `gnuplot` does not seem to utilise `cycle list` and all columns plotted are the same style. Is there a way for `gnuplot` to change the line style with every new column? Ideally, it will have exactly the same behaviour as using numerous `\addplot` commands, and also utilise custom `cycle list`s if possible. # MWE:               \documentclass{article}     \usepackage{tikz,pgfplots}     \pgfplotsset{compat=newest}          \begin{document}       \begin{tikzpicture}         \begin{axis}[           width=\columnwidth,           height=\columnwidth,]              \addplot+ gnuplot [raw gnuplot] {%           set key outside;           plot for [col=2:6] 'data.dat' using 1:col;         };         \end{axis}       \end{tikzpicture}%     \end{document}      # Data File | `data.txt`:               1   0   0   0   0   0     20001   0.036388    0.028517    -0.033069   -0.034961   -0.025119     40001   0.078273    0.041198    -0.05016    -0.040372   -0.036597     60001   0.083334    0.080893    -0.067594   -0.062035   -0.048915     80001   0.10042 0.097744    -0.08017    -0.086433   -0.083851     1e+05   0.13486 0.12073 -0.097362   -0.10287    -0.093411     1.2e+05 0.15235 0.15038 -0.10748    -0.11208    -0.10857     1.4e+05 0.1604  0.15882 -0.11528    -0.15034    -0.12262     1.6e+05 0.18981 0.19139 -0.13932    -0.15833    -0.12653     1.8e+05 0.2069  0.21622 -0.13932    -0.16647    -0.15685     2e+05 0.21894 0.22313 -0.14568  -0.19297  -0.2045      # Result: ![enter image description here](http://i.stack.imgur.com/2UQiu.png)


title: How to draw two Tkiz pictures are parallel to each other?

text: I want to draw two automaton figures next to each other; however I can't put them in one \begin{} \end{} tag because the node distance can be changed, further the distance between two pictures is also different. A minimal example would be greatly appreciated. Thank you.               \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]          \node[state,initial]    (q_0)                   {$q_0$};          \node[state,accepting]  (q_1)   [right=of q_0]  {$q_1$};          \node[state]            (q_2)   [right=of q_1]  {$q_2$};               \path[->]         (q_0) edge                  node {a}            (q_1)         (q_1) edge                  node {$\lambda$}    (q_2)         (q_2) edge  [bend right]    node {$\lambda$}    (q_0)         ; %end path      \end{tikzpicture}


title: Symbolic functions: changing catcodes and \tl_rescan:nn

text: The goal is to have the user input (for the sake of argument) a linear function in one variable, for example `2*x+3` along with the variable (this isn't crucial) and a value for the variable. I would then like to calculate the value of the function. The following works, but I'm thinking now that it works more by accident than anything else.   1. My original attempt `\findvalueB` failed and didn't seem to like the underscore, so I tried the method of `\findvalueA` which worked. Why does one of these work and the other not?   2. When deciding to switch variable names to test, I ran into the obvious problems (e.g. using `y` breaks `\mytoks`. So I tried to hardcode a variable name, again failure. The basic idea seems to work as shown at the bottom. Why does this try fail? Presumably there's a common thread to what I'm not getting and it's likely a fundamental misunderstanding of something that I'd like to correct. I'm more interested in the explanation than a code solution although both would be nice.               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn     \newtoks\mytoks          \NewDocumentCommand {\findvalueA} { m m m }         {             \group_begin:             \char_set_catcode_active:N #1             \tl_rescan:nn{}{\def#1{#2}}             \tl_rescan:nn{}{\mytoks={#3}}             \fp_set:Nn \l_tmpa_fp {\the\mytoks}             \fp_use:N \l_tmpa_fp             \group_end:         }          \NewDocumentCommand {\findvalueB} { m m m }         {             \group_begin:             \char_set_catcode_active:N #1             \tl_rescan:nn{}{\def#1{#2}}             % underscores=bad             \tl_rescan:nn{}{\tl_set:Nn \l_tmpa_tl {#3}}             % or             % \tl_rescan:nn{}{\fp_eval:n {#3}}             \fp_use:N \l_tmpa_fp             \group_end:         }              \NewDocumentCommand {\findvalueC} { m m }         {             \group_begin:             \char_set_catcode_active:N x             \tl_rescan:nn {} {\defx{#1}}             \tl_rescan:nn {} {\mytoks={#2}}             \fp_set:Nn \l_tmpa_fp {\the\mytoks}             \fp_use:N \l_tmpa_fp             \group_end:         }          \ExplSyntaxOff     \begin{document}          % works     \findvalueA{x}{5}{2*x+3}          % fails     %\findvalueB{x}{5}{2*x+3}          % fails     %\findvalueC{5}{x+2}          The method of findvalueC works down here but not above: if $x=5$, then $x+2=$     \ExplSyntaxOn     \group_begin:     \char_set_catcode_active:N x     \defx{5}     \fp_eval:n {x+2}     \group_end:     \ExplSyntaxOff          \end{document}


title: How can I fix the unequal space between my references if I combine apacite and \flushleft

text: I have a problem with my references done by `apacite`. My references have to be formatted as flush left entries:                  \documentclass[a4paper,fontsize=14pt,DIV=10,twoside, numbers=noenddot, bibliography=totoc, cleardoublepage=empty]{scrbook}     \pagestyle{plain}          \usepackage[utf8]{inputenc}     \usepackage[english,ngerman]{babel}     \usepackage{pxfonts}     \usepackage[natbibapa]{apacite}      \usepackage[osf,sc]{mathpazo}     \usepackage[T1]{fontenc}     \usepackage{fixltx2e}     \usepackage{ellipsis}     \usepackage{ragged2e}     \usepackage[tracking=true]{microtype}     \DeclareMicrotypeSet*[tracking]{my}{ font = */*/*/sc/* }      \SetTracking{ encoding = *, shape = sc }{ 45 }     \usepackage{hyperref}          \setcounter{tocdepth}{1}     \setkomafont{caption}{\fontsize{12}{14}\normalfont}     \setkomafont{captionlabel}{\fontsize{12}{14}\bfseries}     \setkomafont{descriptionlabel}{\fontsize{14}{16}\bfseries}     \setcapindent{0em}     \setkomafont{footnote}{\fontsize{12}{14}\normalfont}     \setkomafont{chapter}{\fontsize{18}{20}\normalfont\bfseries}     \setkomafont{chapterentry}{\fontsize{16}{20}\normalfont\bfseries}     \setkomafont{section}{\fontsize{16}{18}\normalfont\bfseries}     \setkomafont{subsection}{\fontsize{14}{16}\normalfont\bfseries}     \setkomafont{subsubsection}{\fontsize{14}{16}\normalfont\bfseries}          \clubpenalty=10000     \widowpenalty=10000     \displaywidowpenalty=10000     \brokenpenalty=10000     \doublehyphendemerits=5000      \finalhyphendemerits=5000     \tolerance=10000     \urlstyle{same}     \deffootnote{0.75cm}{1em}{\makebox[0.75cm][l]{\thefootnotemark}}          \author{XX} \title{YYY}     \begin{document}      \maketitle      \citep{APA1, APA2, Ambady1}     \bibliographystyle{apacite}     \begin{flushleft}     \bibliography{test}     \end{flushleft}          \end{document}      I am using apacite with the natbibapa-option (\usepackage[natbibapa]{apacite}). The test.bib file contains the following three entries:               @article{Ambady1,        author = {Ambady, Nalini and Rosenthal, Robert},        title = {{Half a minute: Predicting teacher evaluations from thin slices of nonverbal behavior and physical attractiveness}},        journal = {Journal of Personality and Social Psychology},        volume = {64},        number = {3},        pages = {431-441},        year = {1993}     }     @book{APA1,        author = {{American Psychological Association}},        title = {Publication manual of the {A}merican {P}sychological {A}ssociation},        publisher = {American Psychological Association},        address = {Washington},        year = {2010}     }     @book{APA2,        author = {{American Psychological Association}},        title = {{APA} Dictionary of Psychology},        publisher = {American Psychological Association},        address = {Washington},        year = {2007}     }      When I am combining `apacite` with `\flushleft` I got unequal line-spacing between some of my references. How can I fix this problem?


title: Different labels pointing to the same object

text: I have the following code (an MWE) which creates two A4 pages, each with one `figure` which is composed of three `subfigures`. On the second page there are also two references: one to a subfigure of the first figure and one to a subfigure of the second figure. However, both references, when clicked, are leading to the first figure. Here is a link to the resulting .pdf file. Clicking on either of the references at the bottom (1(a) or 2(a)) takes you to 1(a). How does one solve this? What am I missing?               \documentclass[12pt]{book}     \usepackage{graphicx}     \usepackage{subfigure}     \usepackage[backref=page,dvipdfm,colorlinks=false,bookmarksopen=true,breaklinks=true]{hyperref}     \begin{document}     \begin{figure}[htbp]         \centering         \subfigure[Perfil e elevao da viga, com traado do cabo]         {             An image             \label{fig:f1a}         }         \\         \subfigure[do cabo]         {             Another image             \label{fig:f1b}         }         \\         \subfigure[Ancoragem do cabo e da viga]         {             Yet another image             \label{fig:f1c}         }         \caption{Viga com protenso axial}         \label{fig:f1}     \end{figure}     \pagebreak     \begin{figure}[htbp]         \centering         \subfigure[Perfil e elevao da viga, com traado do cabo]         {             An image 2             \label{fig:f2a}         }         \\         \subfigure[Perfil de tenses na]         {             Another image 2             \label{fig:f2b}         }         \caption{Viga com excentrica}         \label{fig:f2}     \end{figure}     \ref{fig:f1a}     \ref{fig:f2a}     \end{document}      **EDIT 25/06:** EDIT: I've noticed a few things:   * The error only occurs for `\refs` made to `labels` inside `subfigures`. `\refs` made to `labels` pointing to the `figures` as a whole (fig:f1 and fig:f2) work just fine.   * If the `captions` are removed from the `figures`, the `subfigure \refs` work just fine. However, the format is now incorrect, with all the `subfigures` appearing on the same counter even though they are in different `figures`. In the code above for instance, the `subfigures` are labeled with (a) (b) (c) (d) (e) (f) even though three are in one figure and three in the other. Also, the \captions are important, format-wise, so they can't be removed.   * According to the `subfigure` documentation on page 27, it states that in order to improve compatibility with `hyperref`, one could use a new mode of `label` with an optional parameter `\label(bookmark){key}`, but I couldn't get this to work. It didn't improve the references (in fact, it usually broke them) and it made the counters behave incorrectly (it prefixed them with the bookmark, so `(a)` becomes `mark(a)`)   * @Sigur apparently made this compile correctly using TeXlive 2014 on Linux. In case this is relevant, I am using the latest Texmaker (downloaded and installed just a few days ago, with MikTex 2.9) on Windows. I've tried running this through `LaTeX` and/or `pdflatex` (twice each), but to no success.


title: Pseudocode: \Function vs. \Procedure?

text: The title says it all. What is the difference between a `Function` and a `Procedure`? When should I use which?


title: \phantom inside tabularx

text: I tried to improve the alignment in the following table using a `\hphantom`:               \documentclass{article}          \usepackage{tabularx}          \begin{document}     \begin{tabularx}{\linewidth}{p{2.8cm} X}         1/00\,--\,2/00 & text text \\        \hphantom{0}1/00\,--\,2/00 & text text \\        01/00\,--\,2/00  & text text \\        10/00\,--\,11/00 & text text     \end{tabularx}     \end{document}      but somehow this adds a lineskip in the cell containing the `\hphantom`: ![sample output](http://i.stack.imgur.com/luhXj.png) Being fully aware that the error is on my side, and not in the `tabularx` package, my two questions are:   1. Can I make the `\hphantom` work somehow inside the the `tabularx`?   2. Even without the offending row containing the `\hphantom` I get an `Overfull \hbox (15.0pt too wide)`, which should not be there. What can I do to get rid of this warning?


title: Math mode in knitr

text: How do one use a math-mode in `knitr`? For example as a label for X-Y axis:               <<fe, echo=FALSE, sanitize=TRUE, dev="tikz">>=         plot(1:10, main="${}^{57}Fe$", xlab="$\\\\lambda$", ylab="\\\\$I\\\\$", pch=20, family="CM Roman")     @      This produces the `$I$` and `$lambda$` as a labels.


title: How to increase pool size in MiKTeX 2.9

text: I'm using **MiKTex 2.9.4196** with **TeXnicCenter 2.0 beta** on Windows 7. As I have to compile very large tikzpictures I use **tikz externalize**. Nevertheless some tikzpicture still produce an error.               ! TeX capacity exceeded, sorry [pool size=3147270].      I already did increase the main memory, but I couldn't find out how to change the pool-size.


title: Precision for one row only

text: I have an array with three rows and I would like that the last row has a specific format. There is a command `every row no/.style`, but it wouldn't work in our context because the processing is applied quite late, see PGFplotstable: Is it possible to set a number format for a *row* instead of a column?. Here is the code from Jake with the result. My question is now : how can I define, say `precision=0` for the third row ? ![enter image description here](http://i.stack.imgur.com/w6r2E.jpg)                   \documentclass{standalone}     \usepackage{pgfplotstable}          \begin{document}          \pgfplotstableset{         row style/.style 2 args={             postproc cell content/.append code={%                 \count0=\pgfplotstablerow                 \advance\count0 by1\relax                 \ifnum\count0=#1                     \pgfkeysalso{#2}%                 \fi             }         }     }               \pgfplotstabletypeset[         row style={3}{@cell content=\bfseries #1\,\%},         col sep=&,row sep=\\     ]{     colA & colB & colC \\     11 & 12 & 13 \\     21 & 22 & 23.4 \\     33.3 & 43.3 & 12 \\     }          \end{document}


title: Using \newcommand with \write\@auxout inside

text: I have read some related posts but still cannot resolve the problem with                    \newcommand{\myLabel}[2]{\makeatletter\write\@auxout{\string\newlabel{#1}{{#2}{\thepage}}}\makeatother}      I would like to write a line to .aux that will be later read as a label. When executed on page 11 in subsection 3.1,                   \myLabel{Rings}{\thesubsection.2}      would write the line                   \newlabel{Rings}{{3.1.2}{11}}      I am unable to make this work. Could you kindly explain what I do wrong and perhaps correct the problem?


title: How to improve my PSTricks code to construct a triangle diagram?

text: This question is similar to How to improve my PSTricks code to construct a triangle number diagram?. Consider the following example. **Code**               % pdflatex -shell-escape test.tex          \documentclass{article}          \usepackage{       auto-pst-pdf,       pstricks-add     }          \begin{document}          \begin{figure}     \def\laengde{6}     \def\startX{3}     \def\startY{0}     \pstFPdiv\konstA{\laengde}{2}     \pstFPsub\Bmin{\startX}{\konstA}     \pstFPadd\Bmaks{\startX}{\konstA}     \pstFPadd\Hmin{\startY}{0}     \pstFPdiv\konstB{3 sqrt}{2}     \pstFPmul\Hmaks{\konstB}{\laengde}      \centering      \psset{        radius=0.2      }       \begin{pspicture}(\Bmin,\Hmin)(\Bmaks,\Hmaks)        \Cnode*(\startX,\startY){A}        \Cnode*(!\startX\space \laengde\space   8 div     sub \startY\space   3 sqrt     8 div \laengde\space mul add){B}        \Cnode*(!\startX\space \laengde\space   8 div     add \startY\space   3 sqrt     8 div \laengde\space mul add){C}        \Cnode*(!\startX\space \laengde\space   4 div     sub \startY\space   3 sqrt     4 div \laengde\space mul add){D}        \Cnode*(!\startX\space                                \startY\space   3 sqrt     4 div \laengde\space mul add){E}        \Cnode*(!\startX\space \laengde\space   4 div     add \startY\space   3 sqrt     4 div \laengde\space mul add){F}        \Cnode*(!\startX\space \laengde\space 3 8 div mul sub \startY\space 3 3 sqrt mul 8 div \laengde\space mul add){G}        \Cnode*(!\startX\space \laengde\space   8 div     sub \startY\space 3 3 sqrt mul 8 div \laengde\space mul add){H}        \Cnode*(!\startX\space \laengde\space   8 div     add \startY\space 3 3 sqrt mul 8 div \laengde\space mul add){I}        \Cnode*(!\startX\space \laengde\space 3 8 div mul add \startY\space 3 3 sqrt mul 8 div \laengde\space mul add){J}        \Cnode*(!\startX\space \laengde\space   2 div     sub \startY\space   3 sqrt     2 div \laengde\space mul add){K}        \Cnode*(!\startX\space \laengde\space   4 div     sub \startY\space   3 sqrt     2 div \laengde\space mul add){L}        \Cnode*(!\startX\space                                \startY\space   3 sqrt     2 div \laengde\space mul add){M}        \Cnode*(!\startX\space \laengde\space   4 div     add \startY\space   3 sqrt     2 div \laengde\space mul add){N}        \Cnode*(!\startX\space \laengde\space   2 div     add \startY\space   3 sqrt     2 div \laengde\space mul add){O}        \pspolygon(A)(K)(O)        \ncline{B}{N}        \ncline{D}{M}        \ncline{G}{L}        \ncline{B}{C}        \ncline{D}{F}        \ncline{G}{J}        \ncline{C}{L}        \ncline{F}{M}        \ncline{J}{N}        \pnode(!\startX\space \laengde\space 3 8 div mul add \startY\space 3 sqrt 8 div \laengde\space mul add){S}        \rput(S){\footnotesize{$15$~prikker}}        \end{pspicture}     \end{figure}          \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/eoCKw.jpg) **Question** I have the desired output but the code is rather messy; can anyone help me simplify if? (The code can probably be made even 'simpler' than in the other post.) **Update** Using the second method of @Herbert in the other post, I now have the following:               \documentclass{article}          \usepackage[pdf]{pstricks}     \usepackage{pst-eucl}          \newcounter{No}     \setcounter{No}{0}     \def\trekanttal#1#2{%     \psset{       radius=#2,       yunit=0.8660254     }          \begin{pspicture}(#1,#1)     \pspolygon[       linecolor=black,       linewidth=1.5pt     ](0,#1)(#1,#1)(!#1 2 div 0)     \multido{\iRow=0+2,\iStep=1+1}{\numexpr#1/2+1}{%       \multido{\iCol=0+2}{\iStep}{%         \stepcounter{No}%         \pnode(!#1 2 div \iStep\space sub 1 add \iCol\space add \iRow){N\theNo}         \rput(N\theNo){           \pscircle[             fillstyle=solid,             fillcolor=black           ]{#2mm}         }       }     }     \end{pspicture}     }          \begin{document}          \begin{figure}[htbp]     \trekanttal{10}{3}     \end{figure}          \end{document}      but the lines between all the dots are missing.


title: How to convert mediawiki syntax to latex?

text: I think I've seen a script for converting mediawiki syntax to Latex. Also, in case there are more than one solution for this, it might be nice to summarize them here.


title: Figures in tables

text: I want to make a table with lots of figures.               \begin{table}     \centering     \begin{tabular}{c|c|c}     Index   & Stand. Residuals & acf\\ \hline\hline     BEL 20  & \vspace{-10pt}\includegraphics[scale=0.6]{res_B}\vspace{-10pt} & \vspace{-10pt}\includegraphics[scale=0.6]{acf_B}\vspace{-10pt} \\ \hdashline     CAC 40  & \includegraphics[scale=0.6]{res_C}\vspace{-10pt} & \vspace{-10pt}\includegraphics[scale=0.6]{acf_B}\vspace{-10pt}\\ \hdashline     DAX & \vspace{-10pt}\includegraphics[scale=0.6]{res_D} \vspace{-10pt} & \vspace{-10pt}\includegraphics[scale=0.6]{acf_B}\vspace{-10pt}\\ \hdashline     FTSE 100    & \vspace{-10pt}\includegraphics[scale=0.6]{res_F}\vspace{-10pt} & \vspace{-10pt}\includegraphics[scale=0.6]{acf_B}\vspace{-10pt}     ...     \end{tabular}     \end{table}      The problem is that i want my text in the first column to be horizantally centered. Without having too much trouble with the size of my figures. This is what i get (don't look at the size of the figures i will manage that, for instance only the first 4 indices). ![enter image description here](http://i.stack.imgur.com/cbHBM.jpg)


title: Collect the input of all \TODO commands used in the document at the end

text: I have a command `\TODO` (and `\FIXME`) that display a review note in the document. I'd like to collect all those notes at the end of the document as well, like a list of figures. Is there some easy way to do this with the remark and the page number? Extra points for listing the section as well.


title: listings frame for multiple page code

text: My code is really long. And I really want to use the frame Shadowbox in my code. But the problem is since it is going over a single page, the box is actually completing at the end of the code ....which makes the box look ugly...Is there any way, I can use Shadowbox but at the end of every page it will show a complete box (rather then incomplete portion until the end) This is my lstset               \lstset{ %     frame=shadowbox,     rulesepcolor=\color{black},     backgroundcolor=\color{white},        basicstyle=\footnotesize\ttfamily,            breaklines=true,                      captionpos=b,                         commentstyle=\color{dark slate grey}\itshape,         escapeinside={\%*}{*)},               keywordstyle=\color{blue},            stringstyle=\color{red},             numberstyle=\tiny,               numbersep=5pt,                  tabsize=2,                     extendedchars=true,                   showspaces=false,           showtabs=false,            xleftmargin=17pt,     framexleftmargin=17pt,     framexrightmargin=5pt,     framexbottommargin=2pt,     showstringspaces=false,      }


title: Probem with Bookmarks and Linking and page numbering

text: I have several problems with my latex book:   1. I want the appendix bookmark as an extra bookmark on part level, now it is under my second part. In the table of content its is right, but not on the pdf bookmarks.   2. The bookmark link of the Index is not correct, if I click on it, I go to the list of tables, not to the Index   3. The page numbering is totaly wrong. How can I do big roman Letters for the frontmatter and normal letters on the mainmatter without getting problems with the linking? I want that page numbers on every page, now there is no number or totally wrong. My Latex - Code:               \documentclass{book}     \usepackage{geometry}          \geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}           \usepackage{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}     \usepackage[ngerman]{babel}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{wallpaper}     \usepackage{color}     \usepackage[final]{pdfpages}      %,bookmarksopenlevel={1}     %\usepackage[bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,colorlinks=true,linkcolor=black]{hyperref}     \usepackage[colorlinks,linkcolor=black,bookmarksopen=false]{hyperref}     \hypersetup{        pdftitle={test},       pdfauthor={\textcopyright test},       pdfsubject={test},        pdfkeywords={test},        }          \usepackage{xcolor,bookmark}     \usepackage{scrextend}     \usepackage{titlepic}     \usepackage{shorttoc}     \usepackage{courier}     %     \usepackage{type1cm}                             \usepackage{makeidx}         % allows index generation          \usepackage{graphicx}        % standard LaTeX graphics tool                                  % when including figure files     \usepackage{multicol}        % used for the two-column index     \usepackage[bottom]{footmisc}% places footnotes at page bottom     \usepackage{tocstyle}     \usetocstyle{allwithdot}                \makeindex             % used for the subject index                            % please use the style svind.ist with                            % your makeindex program     \setcounter{tocdepth}{4}     \setcounter{secnumdepth}{4}          \begin{document}     \author{test}     \bookmark[page=\thepage,rellevel=1,keeplevel,view={XYZ},bold,color=blue]{Cover}          \includepdf{cover}      \pagestyle{empty}     \newpage          \section*{}      \newpage     \huge     \textbullet \hspace{0.1cm} test \hspace{-0.1cm} \textbullet\\     \\     \vspace{7cm}     \\     \large     test test\\     \vspace{4cm}     \\     \bookmark[page=\thepage,rellevel=1,keeplevel,view={XYZ},bold,color=blue]{Info}     Die Verlagsseite               \frontmatter     \include{dedic}     \newpage\section*{}      \include{foreword}     \newpage\section*{}      \include{preface}     \newpage\section*{}      \include{acknow}     \newpage\section*{}      \include{acronym}     %     \     \shorttableofcontents{Inhalts\"ubersicht}{1}     \bookmark[page=15,rellevel=1,keeplevel,view={XYZ},color=red]{Inhalts\"ubersicht}     \bookmark[page=17,rellevel=1,keeplevel,view={XYZ},color=red]{Inhaltsverzeichnis}     \tableofcontents          %                    \mainmatter     \include{part1}      \include{chapter1}     \include{chapter2}     \include{part2}     \include{chapter3}     \include{chapter4}     \backmatter          \appendix           \include{appendix}          \listoffigures     \newpage     \listoftables     \backmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\include{glossary}     %\include{solutions}               \printindex     \addcontentsline{toc}{part}{Index}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \includepdf{ueberautor}     \includepdf{back}     \end{document}      I tried a lot and hard for it and I could find no solution - would be great, if you could help me. Thanks


title: Perpendicular line to two-points-line given the length

text: I have two points A and B, I call the line consisting of A and B as LAB:ax+by+c=0, I would like to draw a line segment starting from the point B perpendicular to LAB and with length len such that the line segment stays on positive side of the line LAB, which is the semi-space ax+by+c>0. How is it possible in Tikz? I managed to calculate and draw such line in Matlab, here is the code. It might be helpful to understand what I mean:               %% input data     A.x = 2;     A.y = 2;     B.x = 6;     B.y = 5;     d = 2.5; % the length len     P = B; % selected end point      %% calculation     v.x = B.x - A.x;     v.y = B.y - A.y;          X = v.y*d/sqrt(1+v.x^2);     Y = -v.x/v.y*X;          % in one side of the line LAB     C.x = X + P.x;      C.y = Y + P.y;          % in another side of the line LAB     D.x = P.x - X;     D.y = P.y - Y;     %% visualization     figure(1);hold on; axis equal;     plot(A.x,A.y,'ro',B.x,B.y,'bo',C.x,C.y,'go',D.x,D.y,'yo');     plot([A.x B.x],[A.y B.y],'-k');     plot([B.x C.x],[B.y C.y],'-k');     plot([B.x D.x],[B.y D.y],'-k');      ![enter image description here](http://i.stack.imgur.com/stEOn.png)


title: Tikz Venn Diagram

text: > **Possible Duplicate:**   >  How to generate all possible Venn diagrams (with the case below) > efficiently? I want to shade a diagram involving three sets A, B and C. The specific region that needed to be shaded is what is in set C which is not overlapping with any of the other sets A and B. In the code below, I don't know how to exclude shading the portion which involves intersection of A, B and C.               \begin{tikzpicture}     \def \leftcircle{(0, 0) circle(1.5 cm)}     \def \rightcircle{(2cm, 0cm) circle(1.5 cm)}     \def \bottomcircle{(315:2cm) circle(1.5 cm)}          \def \cliprect {(-1.5, -3.0) rectangle (3.5, 1.5)};          \draw \cliprect;          \begin{scope}[even odd rule]         \clip \leftcircle \rightcircle \cliprect;         \fill[pattern=vertical lines] \bottomcircle;     \end{scope}          \draw \leftcircle node[above] {$A$};     \draw \rightcircle node[above] {$B$};     \draw \bottomcircle node[below] {$C$};          \end{tikzpicture}


title: Is there a way to manually set the height of a bracket?

text: I am aware one can change the size of a single bracket to be slightly bigger than the object attached to it using `\left\\{<object>\right.` What I would really like to do though, is to manually set the exact height of a curly open bracket. (For example to `\baselineskip`). Does anyone know how exactly the height of a bracket as compared to the contained object is determined? (One could then use a strut of appropriate height to force the behaviour of the bracket). Or perhaps there is a completely different method for achieving the effect I am looking for, one that does not make use of the `\right` and `\left` commands at all?


title: pdflatex error: I can't find file `../6001mac'

text: I run into this error when I try to use pdflatex to compile a tex file. I got the file from this site: http://mitpress.mit.edu/sicp/psets/ps1/readme.html If it matters, I'm running Ubuntu 14.04 and texlive is up to date.               occamsblade013@occamsblade013:~/Documents/Sicp$ pdflatex ps1_1.tex      This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)      restricted \write18 enabled.     entering extended mode     (./ps1_1.tex     LaTeX2e <2011/06/27>     Babel <3.9h> and hyphenation patterns for 4 languages loaded.     ! I can't find file `../6001mac'.     l.2 \input ../6001mac          (Press Enter to retry, or Control-D to exit)      Please help! I can't get anything done without tex compilation!


title: How to introduce line numbers on specified lines

text: I'm trying to introduce line numbers in a hymn on specific lines. I'm using the `lineno` package but I'm having no luck with it. Ideally I'd like a macro that I can use to say place line number here. I'm manually breaking the lines using `\\\` so there is no confusion about where the lies will be. Any good packages or ideas?


title: Multiple outputs for beamer handouts

text: I'm currently generating some presentations with `beamer` for students of my course. Some like to print the material, so I created a handout. Some students prefer to have 2,3,4,6 etc. pages per sheet of A4 paper. How can I go about to automatize the following code, so that it outputs 4 different files in 1x2,1x3,2x2,2x3 format? I'd like to avoid having to compile it again everytime for the different formats.               \documentclass[a4paper]{article}     \usepackage{pdfpages}          \begin{document}     \includepdf[pages=1-last,nup=1x2,landscape=false,frame=true,                 noautoscale=false,scale=1,delta=0mm 5mm]{Pres7Chap13-Handout.pdf}     \end{document}


title: Create a vertical line in a table that spans a range of rows but not all rows

text: I'm interested in methods to create a vertical line in a table that spans a range of rows but not all rows. I've found one solution below, but is there another solution such as `\cline` which allows you to specify which columns you would like your horizontal line to span? http://www.latex-community.org/forum/viewtopic.php?f=45&t=3849 Vertical line that spans all rows               \documentclass[a4paper]{article}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \begin{document}          \begin{tabular}{c c|c c c c|}       \multicolumn{2}{c}{} & Piano & Trumpet & Flute & Viola\\       \multicolumn{2}{c}{}& \textbf{pno} & \textbf{tpt} & \textbf{flt} & \textbf{vla}\\       \cline{3-6}       Piano & \textbf{pno} & 0 & 0.5 & 0.25 & 0.75\\       Trumpet & \textbf{tpt} & 0 & 0 & 0.25 & 0.5\\       Flute & \textbf{flt} & 0 & 0 & 0 & 0.75\\       Viola & \textbf{vla} & 0& 0 & 0 & 0\\       \cline{3-6}     \end{tabular}          \end{document}      Vertical line that spans a range of rows               \documentclass[a4paper]{article}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \begin{document}          \begin{tabular}{c c|c c c c|}     \multicolumn{2}{c}{} & Piano & Trumpet & Flute & \multicolumn{1}{c}{Viola}\\     \multicolumn{2}{c}{}& \textbf{pno} & \textbf{tpt} & \textbf{flt} & \multicolumn{1}{c}{\textbf{vla}}\\     \cline{3-6}     Piano & \textbf{pno} & 0 & 0.5 & 0.25 & 0.75\\     Trumpet & \textbf{tpt} & 0 & 0 & 0.25 & 0.5\\     Flute & \textbf{flt} & 0 & 0 & 0 & 0.75\\     Viola & \textbf{vla} & 0& 0 & 0 & 0\\     \cline{3-6}     \end{tabular}          \end{document}


title: Manipulating table and multicols

text: I am trying to make a template for my master's homework. This master is organised by a university and a research center. So I thought of having on top of page(left and right) their logos. Bellow those logos I want to place their names. I didn't have any trouble creating the logos. For their names I thought of using a table with left and right alignment so as to write their names, but despite the fact that I am teling it to place it `[H]` exactly here, it goes to the next page. I also tried with `multicols` but I don't seem to be able to manipulate it either. My code is               \documentclass[a4paper,11pt]{article}          \usepackage[greek,english]{babel}     \setcounter{secnumdepth}{3}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage[margin=2.8cm]{geometry}     \usepackage{subfigure}     \usepackage{multicol}     \newtheorem{exe}{¢óêçóç}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}          \begin{document}          \begin{figure}%     \subfigure{\includegraphics[width=0.1\columnwidth]{ntua-logo}}\hfill     \subfigure{\includegraphics[width=0.1\columnwidth]{demokritos-logo}}     \end{figure}          \begin{table}[H]     \begin{center}     \begin{tabular}{lC{1cm}r}     National Technical University of Athens & ${}$ &National Research Center of Physical        Sciences\\     School of Applied Mathematics and Physical Sciences & ${}$ & Demokritos\\     \end{tabular}     \end{center}     \end{table}          %\begin{multicols}{2}     %National Technical University of Athens \columnbreak National Research Center of Physical        Sciences\\     %School of Applied Mathematics and Physical Sciences \columnbreak Demokritos     %\end{multicols}          \begin{center}\textbf{Master Title}\end{center}          \begin{exe}     $1+1=2$     \end{exe}          \end{document}      My output is ![](http://i.imgur.com/iHpox.jpg) Any ideas on that?


title: Change size of the inline image for Latex fragment in emacs org-mode

text: I recently started using org-mode in emacs for my paper writing needs. One problem I have is that when I render latex equation fragments, the resulting inline images are too small for me to read easily. Is there a way to scale up the rendered images?


title: Citing with exact chapter/pages/etc directly in text [scientific publication]

text: I am writing a scientific publication and am wondering if it is correct to cite an exact chapter, page from a book/publication directly in the text, like so: `Brown describes this in \cite[Chapter 6.6]{brown2430}` From my point of view it is perfectly usable to point a reader to the exact place where he/she might find the details about the subject, instead of citing the whole article/book, but this logic has been questioned (by "scientific" people ;) ). I cannot find any guidelines in the internet. Can you point me in the right direction? (as I write the question I realized it is not as much TEX-related, as content related, but hopefully this is a crowd that should know that)


title: How to control whether and when a macro gets expanded during another definition?

text: I wish to define a meta-command that, whenever invoked, will define an instance of another command; but this inner command must include a progressive number (somewhat similar to what happens with numbered equations, theorems etc). However, in my attempts so far, the number appears to be evaluated too late (at the time of processing the inner command, rather than at the time of defining it) because all inner commands end up with the final value of the counter (off by one, no less) instead of the value the counter when each of the inner commands was defined. Perhaps the best way to explain the problem is with a small commented example, consisting of two files. The first file is meant to be included by several other files. The second is one of the several other files that would include the first. First file (testdef.tex):               % This file may be included by several other files.          % In this example, we are creating a number of proverb-like "rules"     % that other documents will need to refer to.          % All the rules are defined in this file, each with a RULENAME and a     % text. Each rule is given a number, starting from 1, based on the     % order in which they appear here. By defining a rule, we create a new     % internal macro \ruleRULENAME that expands to the text of the rule,     % prefixed by the rule number. The command \showrule{RULENAME}     % displays the rule in the approved way (say in a box) and defines the     % anchor for the label RULENAME: \ref{RULENAME} gives the rule number     % and \pageref{RULENAME} gives the page where \showrule{RULENAME} was     % first issued. Because \showrule{RULENAME} is the anchor for the     % matching label, you cannot issue \showrule{RULENAME} more than     % once. If you need to show the rule without (re)defining the label, use     % \showrulenolabel{RULENAME}.          \newcounter{rule}          \newcommand{\defrule}[2]{       \stepcounter{rule}       \expandafter\newcommand\csname rule #1\endcsname{\textbf{Rule \therule:} #2}     }          \newcommand{\showrulenolabel}[1]{       \noindent\framebox{\csname rule #1\endcsname}     }          \newcommand{\showrule}[1]{       \label{#1}       \refstepcounter{rule}       \showrulenolabel{#1}     }          % the actual rules are defined here          \defrule{vegetables}{Eat more vegetables}          \defrule{smile}{Smile}          \defrule{stairs}{Take the stairs}      Second file, which includes the first:               \documentclass{report}     \begin{document}     \input{testdef}          This is one of several documents that will include the rules file.           In here I should be able to display any rule by name, for example\ldots          \showrule{smile} (should be 2)          %The actual text of that rule is ``\rulesmile'' but I am not really supposed     %to be using that. Strangely, if I do, it says undefined control sequence.          The rules I know about are, in order:          \showrulenolabel{vegetables} (should be 1)          \showrulenolabel{smile} (should be 2)          \showrulenolabel{stairs} (should be 3)          and I should be able to say that           \end{document}      Processing the second file yields a document in which all the rules are numbered 4, rather than the expected 1, 2, 3. I am reasonably comfortable with Latex but not with plain Tex and I suspect this is why I can't quite get at the correct answer. The most relevant suggestions I found came from this other question and I tried applying some of them but my limited understanding of the raw Tex commands prevented me from achieving the desired results.


title: framed equations

text: I'm aware of possibilities to frame an "important" equation in Latex as the one suggested in mathmode for instance but I thought it would be nice to have a dedicated environment instead of putting frames or boxes around equations on the fly. So I came up with what follows by just adapting the existing equation environment:               \documentclass[fleqn,12pt]{book}     \usepackage{microtype}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{kpfonts}     \usepackage{xcolor}     \usepackage{amsmath}     \usepackage{framed}          \renewcommand*\FrameCommand{\fcolorbox{red!80}{red!20}}%     \makeatletter     \newenvironment{fequation}{%     %\setlength\abovedisplayskip{3pt}     %\setlength\belowdisplayskip{3pt}       \incr@eqnum%       \mathdisplay@push%       \st@rredfalse \global\@eqnswtrue%       \MakeFramed{%       \vspace*{-\baselineskip}%       \FrameRestore}%       \mathdisplay{equation}%     }{%       \endmathdisplay{equation}%       \mathdisplay@pop%       \ignorespacesafterend%       \vspace*{-\baselineskip}       \endMakeFramed\noindent%     }%     \makeatother          \begin{document}     Suspendisse lectus tortor, dignissim sit amet, adipiscing nec     \begin{equation}     \cos t=\pi     \end{equation}     porttitor, orci nec nonummy molestie, enim est eleifend mi, non     \begin{fequation}     \cos t=\pi     \end{fequation}     vitae, consequat in, pretium a, enim. Pellentesque congue.     \begin{fequation}     \begin{aligned}     &\cos t=\pi\\     &\sin t=-\pi     \end{aligned}     \end{fequation}     vitae, consequat in, pretium a, enim. Pellentesque congue.     \begin{fequation}     \biggl(\int_\Omega \frac{t^2}{t+1}\D{t}\biggr)=1     \end{fequation}     \end{document}      I've been playing around the `\vspace*` as well as `\abovedisplayskip` and `\belowdisplayskip` commands for tuning but I am wondering how to control the vertical white space between main text and framed equations? Also, any improvement that you find interesting is welcome.


title: revtex-4.1 no bibliography

text: I have exactly the same problem as: Trouble generating bibliography in LaTeX using Revtex 4, but there is no solution :// Does someone know how to solve it? My os is gentoo-linux, I have installed revtex from repository.


title: Vertical Spacing inside theorem enviroment

text: I am using theorem enviroment to seperate different exercises assigned as homework. So my plan is to write exe's description, move a few lines below and then give my solution. I am using `\vspace{3cm}` but it's not working.My code is               \documentclass[a4paper,11pt]{article}          \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \setcounter{secnumdepth}{3}     \usepackage{kerkis}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{resizegather}%allows the automatically resizing of equation to line width, if     equation is too large     \usepackage{units}     \usepackage{array}     \usepackage{framed}     \usepackage{extarrows}     \usepackage{cancel}     \usepackage[pdftex]{graphicx}     \usepackage[margin=2.8cm]{geometry}          \linespread{1}     \newcommand{\sw}{\selectlanguage{english}}     \newcommand{\sq}{\selectlanguage{greek}}     \newcommand{\eng}[1]{\latintext#1\greektext}     \newcommand{\gre}[1]{\greektext\latintext#1}          \theoremstyle{definition}     \newtheorem{exe}{Άσκηση}          \begin{document}     \begin{exe}     \sw     Prove \textit{Thomson's theorem}: If a number of surfaces are fixed in position and a given     total charge is placed on each surface, then the electrostatic energy in the region bounded     by the surfaces is an absolute minimum when the charges are placed so that every surface is     an equipotential, as happens when they are conductors.\\ \sq     \vspace{3cm}     \noindent \textbf{Λύση:}μπλα μπλα μπλα          \end{exe}          \end{document}


title: When to use \edef, \noexpand, and \expandafter?

text: I'm quite happy hacking TeX macros and cobbling together bits and pieces from different style files to suit my own ends, but I have a suspicion that my resulting hacks are not quite as elegant as they could be. In particular, with regard to when to expand and when not to expand macros. A common occurrence for me is defining a meta-command that defines a whole slew of sub-commands. So the _names_ of the sub-commands will contain parameters depending on the parameter passed to the meta-command, and the _contents_ of the sub-commands will also vary a little depending on what the meta-command got. Often it won't be a direct substitution but rather a "if #1 is 'a' do \this else do \that", but `\this` and `\that` need expansion at define time, not call time. Here's a very simple example just involving direct substitution:               \def\cohtheory#1{     \expandafter\newcommand\expandafter{\csname #1func\endcsname}[1][*]{%     \MakeUppercase{#1}^{##1}}     }      Sometimes I worry that my commands are more complicated than they need be. For example, if I want to call a command with two arguments and the arguments expand before the command, here's how I've coded it:               \expandafter       \expandafter       \expandafter       \command\expandafter                 \expandafter                 \expandafter                   {\expandafter                     \argone                     \expandafter                   }\expandafter                   {\argtwo}      So I'm looking for guidance on when and how to control expansion in defining macros. I strongly suspect that such cannot be given in a simple answer, so to make this a focussed question, let me phrase it thus: > Where's a good reference for writing TeX macros that includes advice on how > to best deal with how to handle expansions? Of course, if anyone can formulate some advice in short answer, I'd be only to happy to read it. (Note: this was partially motivated by juannavarroperez's adaptation of my answer to this question where over 20 `\expandafter`s got condensed down to just 1!)


title: How can I create a pdf document exactly as big as my tikz picture?

text: I often create pictures in tikz that I want to either send to someone, or include in an email. The problem with that is that there is a big white space around and and especially below my pictures. To get around this, I usually print screen my figure and crop it to get the size I want. Another solution is to use beamer and then scaling to make the figure as big as the slide size. Those two solutions, though, are not all that good. What I would really like is a way to get the pdf file to be just as big as my picture, as if it was cropped from start. Is there a package to do that?


title: R console output spills into LaTeX when using rgdal

text: I can't avoid the R console output from spilling into the `LaTeX` document compiled by `knitr`. Please consider the following               \documentclass{article}          \begin{document}          <<Map, dev='jpeg', dpi=300, fig.cap='Italy', fig.env='figure',message=FALSE,echo=FALSE,warning=FALSE,error=FALSE>>=     library(rgdal)          # Download shape file from here: http://thematicmapping.org/downloads/TM_WORLD_BORDERS-0.3.zip     shape_file = "TM_WORLD_BORDERS-0.3.shp"          # Build map     map <- readOGR(shape_file, layer = "TM_WORLD_BORDERS-0.3")          par(mar=c(0,0,0,0))     plot(map, xlim = c(6.70, 18.32), ylim = c(35.2, 47.6), border="grey")               @           \end{document}      When I `knit()` it I get in the `.tex` document as picture               \begin{knitrout}     \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}     \begin{verbatim}     ## OGR data source with driver: ESRI Shapefile      ## Source: "TM_WORLD_BORDERS-0.3.shp", layer: "TM_WORLD_BORDERS-0.3"     ## with 246 features and 11 fields     ## Feature type: wkbPolygon with 2 dimensions     \end{verbatim}     \end{kframe}\begin{figure}[]          \includegraphics[width=\maxwidth]{figure/Map} \caption[Italy]{Italy\label{fig:Map}}     \end{figure}               \end{knitrout}      Why the options `message=FALSE,echo=FALSE,warning=FALSE,error=FALSE` don't kick in?


title: Cite right and layout bibliography

text: I have two problems with the citiation and the appendent reference inside the bibliography. The citiation should look like that               (Author, 2012, S. 3)      but with the styles i found it woun't be formatted like that. And the reference should look like that:               For books:      Author, (1987c). Title. publisher.          For website references:     Name, V. (year, day/month of publication). page title. accessed on:  date.     Link: website.      I created a bib file at the beginning of my assay and most of my references are websites and look like this:               @online{blackberry,         author = {Blackberry},         title = {BlackBerry Smart Card Reader},         year = {2012},         url = {http://uk.blackberry.com/ataglance/security/products/smartcardreader/},         OPTnote = {https://www.evernote.com/shard/s206/sh/055c5f0f-fb82-4197-a733-5b48c91f5f1b/71e1a2ed70610cd308e6aa6609023e73},         OPTdate = {20.09.2012},     }      I read, there can be created a new bibliographystyle, but therefore i would need to learn a new syntax. Is there another possibility to do that. If not, is there a manually way to get this work?


title: cancel with different colors

text: I have equations with a lot of terms and I would like to be able to specify the reason of the cancelation of those terms using a color code (for example : red if the term is null, blue if it cancels out with another term, green if it can be considered as very small...). How to define new commands to be able to cancel these terms with different colors using the `cancel` package?


title: New titleclass not counted in the table of contents

text: The following defines a new `titleclass` which I would prefer not counted in the table of contents defined. How can this be achieved?               \documentclass{book}     \usepackage{titlesec}      \usepackage{titletoc}          \titleformat{\chapter}[display]           {\bfseries\Large}           {\filright\MakeUppercase{\chaptertitlename} \Huge\thechapter}           {1ex}           {\titlerule\vspace{1ex}\filleft}           [\vspace{1ex}\titlerule]          \titleclass{\sample}{straight}[\chapter]     \newcounter{sample}     \renewcommand{\thesample}{\arabic{sample}}          \titlespacing*{\sample}{0pt}{3.5ex plus 1ex minus .2ex}{1ex plus .2ex}          \titleformat{\sample}[block]     {\titlerule*[.6em]{\bfseries.}\normalfont\sffamily\Large\leavevmode\\[-11pt]}     {\bfseries\Large Sample \thechapter.\thesample}     {0pt}     {\enspace\bfseries}     []          \begin{document}         \chapter{Test Unnumbered Chapter}         \startcontents[chapters]%         \printcontents[chapters]{}{1}{}         \sample{ex1}         \sample{ex2}         \chapter{Test Numbered Chapter}     \end{document}      ![enter image description here](http://i.stack.imgur.com/McXqB.png)


title: \mathbbm{1} not working well with XeLaTeX/mathspec

text: it seems that `\mathbbm{1}` doesn't display with double lines when one changes to a different font using `mathspec` in XeLaTeX. For example, the MWE below uses Palatino, but I couldn't get it to work with any other font (Times New Roman, etc.). The problem occurs when I try to specify that the math font be applied to numbers: `\setmathsfont(Digits){Palatino}` in the preamble. The `\mathbbm{1}` symbol displays correctly if you remove the `(Digits)`, but then numbers in a math environment don't match those in the text. If this is a font issue, is there a way to change font temporarily in a math environment so that I could call something like `\LatinModern{ \mathbbm{1} }`? As a separate but related issue, I don't even know how to include the Latin Modern (or whatever the default LaTeX font is) using XeLaTeX since it's not a font in my library. Thanks for any help you can provide. MWE below. Minimal Working Example:               \documentclass{article}     \usepackage{bbm, dsfont}     \RequirePackage{mathspec}           \setmathsfont(Digits){Palatino} % causes problem          \begin{document}          This blackboard bold $\mathbbm{1}$ isn't double lined.      Doublestroke package doesn't work either, $\mathds{1}$.          \end{document}


title: PS- to-PK converter has stopped working

text: I compile the latex file using miktex, during the preview in `yap` it shows `PS- to-PK converter has stopped working` error. There is no problem during compilation. Please suggest me the correct. ![enter image description here](http://i.stack.imgur.com/gAJ3z.png)


title: Why am I processing a comma-separated list incorrectly when using etoolbox and kvoptions?

text: I'm trying to pick something out of a list that has been passed from some package options by `kvoptions`, but `docsvlist` doesn't appear to be recognising the commas. I suspect this may be something to do with the Knuth "mouth and stomach" paradigm, but I'm not enough of a TeXnician to understand why, nor how to do it correctly. Can someone explain what's going on? Here's my MWE: testx.sty:               \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{testx}     \RequirePackage{kvoptions}     \RequirePackage{etoolbox}     \SetupKeyvalOptions{family=test,prefix=test@}     \DeclareStringOption{refnames}     \ProcessKeyvalOptions*     \newcommand{\vtag}{(None)}     \csdef{xferret}{}      % This is what I want to extract     \newcommand{\testtag}[1]{%         \PackageWarning{testx}{Processing #1}         \def\do##1{%             \ifcsdef{x##1}{%                 \renewcommand{\vtag}{##1}%                 \listbreak             }{%                 \PackageWarning{testx}{##1 not selected}             }         }%         \docsvlist{#1}%     }%     \testtag{\test@refnames}      test.tex:               \documentclass[10pt,a4paper]{article}     \usepackage[refnames={rat, ferret, 1.0, mole}]{testx}     \begin{document}     \vtag     \testtag{rat, ferret, 1.0, mole}     \vtag     \end{document}      The first `\vtag` (set in the package) produces "(None)" The second `\vtag` produces "ferret" in the log, we have this: (from the package):               Package testx Warning: Processing rat, ferret, 1.0, mole on input line 22.     Package testx Warning: rat, ferret, 1.0, mole not selected on input line 22.      (from the call in the document body)               Package testx Warning: Processing rat, ferret, 1.0, mole on input line 5.     Package testx Warning: rat not selected on input line 5.


title: TeX macro and command expansion?

text: I have implemented couple of macros that should remove commas from numbers. It's nasty dirty stuff, but it works when input is number:               \removecommas{12,34,56.7} % => 123456.7      But it stop working when the input is given by some command, such as:               \newcommand\mynumber{12,34,56.7}     \removecommas\mynumber      Why is this happening? How can I force TeX to expand `\mynumber` before commas? I've tried:               \expandafter\removecommas\mynumber      but that didn't seem to help.


title: List of higher-level LaTeX commands corresponding to TeX commands

text: Since LaTeX is a format built on top of TeX, it surely has several high level abstractions that perform similarly to TeX commands, with some added error- handling functionality, for example. I always find scattered advice saying > Instead of `\def`, use `\newcommand` ...which I'm sure also applies to other commands. Is there a document compiling such matches? If not, how about we compile them here? So far, I can think of the following. I may or may not be right with some of them, but I hope it illustrates my point.               \def --> \newcommand, \renewcommand     \hskip --> \hspace     \vskip --> \vspace      The objective is to avoid using low-level TeX commands unless absolutely necessary. And even if it were necessary, confine them inside macro definitions. I imagine this to be community wiki. ~~So one matchup per answer~~. A big-list community wiki answer has been started below, categorized according to problem domains. Feel free to edit and/or add problem domains and matchups. A `TeX --> LaTeX` matchup means that they tackle the same problem domain, so one or more TeX commands may match one or more LaTeX commands. Also include with your answer the reasons (or a link) explaining why the LaTeX alternative is better as a high-level implementation.


title: How do I know if a math font fits well with the text font

text: In terms of fonts, I have the following:               \usepackage{charter}     \usepackage[scaled=0.92]{helvet}     \renewcommand{\ttdefault}{cmtt}     \renewcommand{\familydefault}{\rmdefault}     \usepackage[charter]{mathdesign}     \usepackage[T1]{fontenc}      My question is: What are the criteria that tell me the math font is indeed "working well" with the text font (to me, looking at them, sure, they look fine, but why, and would other people agree?). Secondly, and maybe this is another question altogether, how do I know if my Sans-Serif and Typewriter font fit well with the Roman font? More specifically, do my choices make sense? (Roman = Charter, Sans-Serif= Helvetica and Typewriter=Computer Modern Typewriter). Many thanks!


title: Table footnote symbol - fatal error?

text: I am trying to use:               \tablenotetext{$\dag$}{comments}      to add an annotation to the values in my table marked with a dagger, but I get an error when I try to use the dagger symbol in the tablenotetext{}:               ! TeX capacity exceeded, sorry [input stack size=5000].     \font@name ->              \OT1/cmr/m/sc/8      l.49 \tablenotetext{$\dag$}{comments}          !  ==> Fatal error occurred, no output PDF file produced!      I am not why this is not working. The greek letter symbols work just fine as the table symbol...


title: isov2 document class and symbols list

text: I am currently using the **isov2** document class. I would like to create a list of symbols. I currently have the following output (style) ![Current Symbols List Formatting](http://i.stack.imgur.com/04R1N.png) using the code:               \begin{symbols}     \symboldef{ACSE}{association control service element}     \end{symbols}      However, I'd like instead for the abbreviation and "definition" to be on one line, no extra line break in between the lines and _without_ an indent similar to the image below: ![Ideal Symbols List Formatting](http://i.stack.imgur.com/ZMM1d.png)