title: memoir: change numwidth in list of figures

text: I am trying to change the width of figure numbers in the toc, lof, and lot. This works fine for the toc:               \documentclass{memoir}     \newcommand{\Fig}{\begin{figure}\caption{test}\rule{10pt}{10pt}\end{figure}}     \setlength{\cftchapternumwidth}{20mm}     \setlength{\cftsectionnumwidth}{20mm}     \setlength{\cftsectionindent}{0mm}     \begin{document}     \tableofcontents     \listoffigures     \chapter{One} \Fig     \section{OneOne} \Fig     \section{OneTwo} \Fig     \chapter{Two} \Fig     \section{TwoOne} \Fig     \section{TwoTwo} \Fig     \end{document}      But the list of figures is unchanged; how can I change that, too? Here is my output: ![enter image description here](http://i.stack.imgur.com/sOMNJ.png)


title: How can I plot sin(1/x) with a logarithmic x-axis?

text: I would like to plot the function `f(x) = sin(1/x)` and it should look like this. I get this so far: ![current plot](http://i.stack.imgur.com/pHKl8.png) You might notice, that my image doesn't look as good as the linked one because of the axis. **How can I get a logarithmic axis for my plot?** Why does it currently produce an error with a logarithmic axis?               \documentclass{article}     \usepackage[pdftex,active,tightpage]{preview}     \setlength\PreviewBorder{2mm}          \usepackage{pgfplots}     \usepackage{tikz}     \usetikzlibrary{arrows, positioning, calc, intersections}          \begin{document}          \begin{preview}     \begin{tikzpicture}         \begin{axis}[         axis x line=middle,         axis y line=middle,             width=15cm, height=15cm,     % size of the image             grid = major,             grid style={dashed, gray!30},             %xmode=log,log basis x=10, % <- doesn't work:             % ! Missing number, treated as zero.             % <to be read again>              %                    p             % l.33 ..., red, thick,samples=500] {sin(deg(1/x))};             %                                                                % ?              % ! Emergency stop.             % <to be read again>              %                    p             % l.33 ..., red, thick,samples=500] {sin(deg(1/x))};             %                                                                % !  ==> Fatal error occurred, no output PDF file produced!             %ymode=log,log basis y=10,             xmin=-0.7000, % start the diagram at this x-coordinate             xmax=-0.0062, % end   the diagram at this x-coordinate             ymin=-1,      % start the diagram at this y-coordinate             ymax= 1,      % end   the diagram at this y-coordinate             axis background/.style={fill=white},             ylabel=y,             xlabel=x,             %xticklabels={,,},             %yticklabels={,,},             tick align=outside,             tension=0.08]           \addplot[domain=-0.700:-0.0062, red, thick,samples=500] {sin(deg(1/x))};         \end{axis}      \end{tikzpicture}     \end{preview}     \end{document}      If you plot it with a logarithmic y-axis it looks ... hmm ... lets call it interesting. The latest LaTeX-Code of this plot can be found on GitHub.


title: pgf math error, division by zero

text: I have a valid `gnuplot` function (plots fine in `gnuplot`), with `pgfplots` fails to use:               \documentclass{article}          \usepackage{graphicx}     \usepackage{pgfplots}          \begin{document}     \begin{figure}[H]     \pgfplotsset{width=0.8\textwidth, height=0.6\textwidth}     \pgfplotsset{samples=200}     \centering     \begin{tikzpicture}     \begin{axis}[mark=none, style=solid,                  enlargelimits=false,                   xmin=0,xmax = 2.5,                  ymin=0,ymax = 2.5]     %     \addplot gnuplot{3*(x**(3-1))*exp(-x**3)};     %     \end{axis}      \end{tikzpicture}     \end{figure}     \end{document}      The error is               PGFPlots: reading {testplots.pgf-plot.table}     ! Package pgfplots Warning: Axis range for axis y is approximately empty; enlarging it (it is [0.0:0.0])     ! Package PGF Math Error: You've asked me to divide `231.00105000000000' by `0.0', but I cannot divide any number by `0.0'.


title: Section open right in scrbook

text: Using `scrbook`, I would like sections to open on a new odd page, like chapters do. How can I achieve that?


title: pgfplotsinvokeforeach is invoked only twice

text: I would like to plot the family of curves with equation _xy=c_ for several values of _c_. I also want each curve to be labeled with the value of _c_ it corresponds to. Here is my MWE:               \documentclass{standalone}     \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}         \begin{axis}[             xmin=-3.0,xmax=3.0,             ymin=-3.0,ymax=3.0,             axis x line=middle,              axis y line=middle,             axis equal image,             cycle list={blue}             ]             \pgfplotsinvokeforeach{-3.0,-2.5,...,-0.5,0.5,1.0,...,3.0}{                 \addplot+[domain=-3:-0.1,forget plot] {#1/x};                 \addplot+[domain=0.1:3] {#1/x} node[pos=0.5] {$#1$};             }         \end{axis}     \end{tikzpicture}     \end{document}      I get each curve plotted, but only two of them are labeled: ![sample code output](http://i.stack.imgur.com/fGhH2.png) How do I get all twelve curves labeled?


title: expex "everylabel=\actualexno" causes error in later references

text: I am having problems with numbers of examples. When I refer to the example (by its label) before it actually occurs, the number is correct. But referencing it after it has been defined gives a wrong number. It happens only when I use the `everylabel=\actualexno` within the `\definestyle` command, and the example is divided into subexamples.                   \documentclass[10pt, a4paper]{article}         \usepackage{expex}         \definelingstyle{IJAL}{everylabel=\actualexno}  % HERE IS THE PROBLEM         \lingset{lingstyle=IJAL}                        % (and here)              \begin{document}         \gathertags         Referencing ahead of the definition gives            correct number of the whole example (\getref{a}),            as well as its part (\getref{a.A}),            although the full reference gives us too much (\getfullref{a.A}).              \pex<a>           \a<A> some example         \xe                   The reference to the whole example is still correct afterwards (\getref{a}),            but the reference to its part has a one too large prefix (\getref{a.A})            and the full reference is just a concatenation of both, as usual (\getfullref{a.A}).              \end{document}      ![enter image description here](http://i.stack.imgur.com/iy4YY.jpg)


title: Formatting multiple equations in one displaymath line?

text: If I want to write multiple equations in the same line in displaymath mode, I would do something like this:               \[     a + b = c     \qquad\text{and}\qquad     a^2 + b^2 = c^2     \]      But I know it's not good to rely on manual spacing. Is there a better way to get the same effect?


title: Using key-value interface for pgfkeys results in error

text: I've been reading a lot of posts lately on the difference between using the key-value interface and the handler interface of `pgfkeys`. To my understanding, the same values can be stored and retrieved in both ways. For example:               \documentclass{article}     \usepackage{tikz}     \pgfkeys{         /testa/.initial,         /testb/.store in=\testbvalue,     }     \begin{document}         \def\foo{bar}         \pgfkeys{/testa=\foo,/testb=\foo}         \pgfkeysvalueof{/testa}              \testbvalue              \pgfkeysgetvalue{/testa}\testavalue              \meaning\testavalue              \meaning\testbvalue          \end{document}      Here the same value can be retrieved through `\pgfkeysvalueof{/testa}` and `\testbvalue`. In fact the meaning of `\testavalue` and `\testbvalue` is the same (which is no surprise). But then, why does the following code work               \documentclass{article}     \usepackage{tikz}     \usepackage{etoolbox}     \usepackage{overpic}          \pgfkeys{         /icon/.cd,         width/.initial,         overlay/.store in=\iconoverlay,         set defaults/.unknown/.code={\pgfkeys{/icon/\pgfkeyscurrentname/.default=#1}}     }     \newcommand\icondefaults[1]{%         \pgfkeys{/icon/set defaults/.cd, #1}%     }     \newcommand\ifkeyempty[3]{%         \pgfkeysgetvalue{#1}{\keyvalue}%         \ifempty{\keyvalue}{#2}{#3}%     }     \newcommand\ifempty[3]{%         \def\novalue{\pgfkeysnovalue}%         \def\empty{}%         \ifboolexpr{test {\ifdefequal{#1}{\empty}} or test {\ifdefequal{#1}{\novalue}}}{#2}{#3}%     }     \newcommand{\icon}[2][]{%         {%             \pgfkeys{/icon/.cd,width,overlay,#1}% Reset to default values             \def\options{}%             \ifkeyempty{/icon/width}{}{\edef\options{width=\pgfkeysvalueof{/icon/width},\options}}%             \ifempty{\iconoverlay}{%                 \edef\graphic{\noexpand\includegraphics[\options]{#2}}%             }{%                 \edef\overlay{\noexpand\begin{overpic}[\options]{#2}}%                 \def\graphic{\overlay\put(0,0){\iconoverlay}\end{overpic}}%             }%             \graphic%         }%     }%          \begin{document}          \icondefaults{width=6cm}     \icon{example-image} % Image gets default width 6cm     \icon[width=2cm,overlay={\icon{example-image-overlay}}]{example-image} % Image gets width 2cm, while the overlaid image gets default width 6cm     \icon{example-image} % Image gets default width 6cm          \end{document}      While next section of code does not work. The only difference is that `/.store in` is not used for the key `overlay`, and hence `\pgfkeysvalueof` is used to access the value of the key. It results in an error `TeX capacity exceeded`.               \documentclass{article}     \usepackage{tikz}     \usepackage{etoolbox}     \usepackage{overpic}          \pgfkeys{         /icon/.cd,         width/.initial,         overlay/.initial,         set defaults/.unknown/.code={\pgfkeys{/icon/\pgfkeyscurrentname/.default=#1}}     }     \newcommand\icondefaults[1]{%         \pgfkeys{/icon/set defaults/.cd, #1}%     }     \newcommand\ifkeyempty[3]{%         \pgfkeysgetvalue{#1}{\keyvalue}%         \ifempty{\keyvalue}{#2}{#3}%     }     \newcommand\ifempty[3]{%         \def\novalue{\pgfkeysnovalue}%         \def\empty{}%         \ifboolexpr{test {\ifdefequal{#1}{\empty}} or test {\ifdefequal{#1}{\novalue}}}{#2}{#3}%     }     \newcommand{\icon}[2][]{%         {%             \pgfkeys{/icon/.cd,width,overlay,#1}% Reset to default values             \def\options{}%             \ifkeyempty{/icon/width}{}{\edef\options{width=\pgfkeysvalueof{/icon/width},\options}}%             \ifkeyempty{/icon/overlay}{%                 \edef\graphic{\noexpand\includegraphics[\options]{#2}}%             }{%                 \edef\overlay{\noexpand\begin{overpic}[\options]{#2}}%                 \def\graphic{\overlay\put(0,0){\pgfkeysvalueof{/icon/overlay}}\end{overpic}}%             }%             \graphic%         }%     }%          \begin{document}          \icondefaults{width=6cm}     \icon{example-image} % Image gets default width 6cm     \icon[width=2cm,overlay={\icon{example-image-overlay}}]{example-image} % Image gets width 2cm, while the overlaid image gets default width 6cm     \icon{example-image} % Image gets default width 6cm          \end{document}      Can anyone explain this behavior? Is my understanding wrong, that the same value is stored and retrieved in both cases, just in different ways?


title: Documentclass `book': How to prevent numbered examples to start over each chapter

text: So, I am writing my thesis (topic is to do with linguistics) and am using the documentclass book to do this. For my numbered examples I am using the `linguex' package.                  \documentclass[12pt, a4paper, oneside]{book}         \usepackage{linguex}                              \begin{document}                              \chapter{This is chapter one}     I have a nice sentence here:                              \ex. This is an example.                              And a nice additional example:     \ex. This is another example.                              \chapter{This is chapter two}     This is the most important example in the thesis and I will refer to it often!     \ex.\label{important} This is a very important example.                              \chapter{This is chapter three}     As you can see, \Next and \NNext are very different from \ref{important}.     \ex. This is an example.                              \ex. This is another example.                    \end{document}      The counter for the numbered examples now gets reset at the start of each chapter. So the first example in each chapter is now numbered (1). This is not what I'd like since I sometimes need to refer to an example of another chapter and then it is unclear which example I mean exactly. The output of chapter 3 now looks like this. As you can see, the referencing gets confusing :). ![Output for chapter 3](http://i.stack.imgur.com/fgwQl.png) Anyone know how to fix/alter this? Ideally Chapter three would look something like: As you can see (4) and (5) are very different from (3). (4) This is an example. (5) This is another example. I have read the linguex manual but couldn't find any hints towards a solution and I have not been able to find an answer on the Internet. Could be that I don't know where to look, of course ;).


title: ! Package tikz Error: missing semicolon

text: I have found this sample of code from here: Block diagram generation in LaTeX. Initially I had some problems while I was compiling the code and I solved them due to copy paste features some of the characters where altered. Although that the code seems correct to me, I keep getting this error:               ! Package tikz Error: Giving up on this path. Did you forget a semicolon?.           See the tikz package documentation for explanation.      Type  H <return>  for immediate help.      ...                                                         l.20 \draw [->] (controller)                                     �� node[name=u] {$u(k)$} (system);      ?       Since I am new to tikz package I can not see the error, all parts of the node seems to have the semi-column. What am I missing here?               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows,automata}     \usepackage{pgfplots}     \pgfplotsset{compat=1.8}          \begin{document}          \tikzstyle{block} = [draw, rectangle, minimum height=2em, minimum width=4em]     %fill=blue!20     \tikzstyle{sum} = [draw, fill=blue!20, circle, node distance=1cm]     \tikzstyle{input} = [coordinate] \tikzstyle{output} = [coordinate]     \tikzstyle{pinstyle} = [pin edge={to-,thin,black}]          \begin{tikzpicture}[auto, node distance=2cm,>=latex']     \node [input, name=input] {};     \node [sum, right of=input] (sum) {};     \node [block, right of=sum, node distance=3.5cm] (controller) {$C(z^{-1})$};     \node [block, right of=controller, pin={[pinstyle]above:$d(k)$}, node distance=4cm] (system) {$P(z^{-1})$};     \draw [->] (controller) – node [name=u] {$u(k)$} (system);     \node [output, right of=system] (output) {};     \node [block, below of=u] (measurements) {$F(z^{-1})$};     \draw [draw,->] (input) – node {$r(k)$} (sum);     \draw [->] (sum) – node {$e(k)$} (controller);     \draw [->] (system) – node [name=y] {$y(k)$}(output);     \draw [->] (y) |- (measurements);     \draw [->] (measurements) -| node[pos=0.99] {$-$} node [near end] {$y_m(k)$} (sum);     \end{tikzpicture}          \end{document}


title: Nested rectangles with different widths

text: The following code               \documentclass[a4paper,10pt]{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \path [style={draw}] (0,0) rectangle (4,1);     \path [style={draw}] (0,1) rectangle (4,2);     \path [style={draw,thick,fill=orange}] (0,1) rectangle (1,2);     \end{tikzpicture}     \end{document}      Produces an image like this: ![enter image description here](http://i.stack.imgur.com/BfRZY.png) On closer observation one can see that the rectangles don't intersect properly on the border (drawn a bit exaggerated for better visibility): ![enter image description here](http://i.stack.imgur.com/Z8aYT.png) Is there a way to make the rectangles fit perfectly? I know that adding/subtracting 0.01 to some coordinates works but that isn't really a clean fix.


title: Gradient fill in PDF figure turns out solid filled in compiled document

text: **UPDATE** : It turns out it was a compatibility issue with the PDF viewers. Apple Preview, Adobe Acrobat Professional 8 and Firefox display the compiled document wrongly. Under TeXWork and Adobe Reader 11, Google Chrome it is displayed as intended. I have a pdf file included as a figure in my document. It has a shape with a gradient fill. I'am afraid, in the compiled (pdflatex) document the shape is filled with a solid colour. Since there is no compile error or warning indicating the gradient fill, I would like to know where to start correcting this misbehaviour.               \documentclass{article}     \usepackage{graphicx}     \begin{document}     \begin{figure}[htbp]     \centering     \includegraphics[width=100mm]{filename}     \caption{figure caption}     \label{fig:figurelable}     \end{figure}     \end{document}      Link to pdf file Link to compiled pdf file I included screenshots to illustrate the situation. ![Image of correct figure](http://i.stack.imgur.com/pJeYr.png) ![enter image description here](http://i.stack.imgur.com/qOxGH.png)


title: How can I move the arrow inside the commutative diagram into the centre?

text: I have the following diagram: ![enter image description here](http://i.stack.imgur.com/KLd9L.png)               \documentclass{article}     \usepackage[all]{xy}     \begin{document}     \xymatrix@R.8pc@C.8pc{     F(Y) \ar[rr]^{E_{Y}} \ar[dd]_{F(f)} && F(Y) \ar[dd]^{F(f)} \\      & \mbox{\phantom{$x$}} \ar@{<=}[ur]^{\alpha_{f}}  && \\     F(X) \ar[rr]_{E_{X}} && F(X)     }     \end{document}      I wish to get the arrow inside the diagram to be placed in the centre. Is there a way to do this in the `xy` package without using `dvips` or `2cell`?


title: How do I use my .bib file with TexShop

text: I am completely new to using LaTex (I just started a week ago), and I'm using the templates posted on  this website. I downloaded all the files, including the .bib file and the .cls file and they are all in the same directory. I am able to compile and display the .tex file, but when it appears, all citations have a [?] in them. I'm not sure what I'm supposed to do. I'm sure there's a step I'm missing... perhaps there is a special way to use TexShop to make it work? Or am I supposed to use another program? Any help would be greatly appreciated.


title: How can I decrease spaces between equations?

text: \documentclass[12pt,a4paper]{mwrep}         \renewcommand\baselinestretch{1.5}     \begin{document}     \chapter{Test}     Text text text text text text text text text text           \begin{equation}     1 + 2 + 3 = 6     \end{equation}       Text text text text text text text text text text       \begin{equation}     1 + 2 + 3 = 6     \end{equation}     \begin{equation}     1 + 2 + 3 = 6     \end{equation}     \end{document}      Spaces between two equations and between equations and text are too big. How can I lower them? I know that using `\renewcommand\baselinestretch{1.5}` is responsible for that but I need this command.


title: Changing ALL spacing in a TeX document

text: I'm taking an exam and I'm allowed a two side page with information on it. Naturally I want to put as much as possible on it so: What are all the spaces that I can change to fit as much information as possible on two pages? And how do you change them? I.e. How do you change:   * line spacing   * text size   * margins   * space between bullet points   * space between equations   * etc.


title: Line numbering using listings package starts at random number

text: I'm using the `listings` package to include code directly from a file. In the first instance my code is numbered as I want it 1 at the 1st line, 11 at the 11th, ... However, the second block of code it numbers 2 on the 2nd line, 12 on the 12th line, ... then the first numbering 8 on the 8th line. Any suggestions on how to fix this? Here is my code:               \documentclass{article}     \usepackage{listings, color, setspace, graphics}     \usepackage{fancyhdr, amsmath, amssymb, setspace, amssymb}     \usepackage{pdfpages}          \definecolor{dkgreen}{rgb}{0,0.6,0}     \definecolor{gray}{rgb}{0.5,0.5,0.5}     \definecolor{mauve}{rgb}{0.58,0,0.82}          \lstset{ %       language=C++,                % the language of the code       basicstyle=\footnotesize,           % the size of the fonts that are used for the code       numbers=left,                   % where to put the line-numbers       numberstyle=\tiny\color{gray},  % the style that is used for the line-numbers       stepnumber=10,                   % the step between two line-numbers. If it's 1, each line                                        % will be numbered       numbersep=5pt,                  % how far the line-numbers are from the code       backgroundcolor=\color{white},      % choose the background color. You must add \usepackage{color}       showspaces=false,               % show spaces adding particular underscores       showstringspaces=false,         % underline spaces within strings       showtabs=false,                 % show tabs within strings adding particular underscores       tabsize=2,                      % sets default tabsize to 2 spaces       captionpos=b,                   % sets the caption-position to bottom       breaklines=true,                % sets automatic line breaking       breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace       keywordstyle=\color{blue},          % keyword style       commentstyle=\color{dkgreen},       % comment style       stringstyle=\color{mauve},         % string literal style     }          \renewcommand{\baselinestretch}{1}     \setlength{\textheight}{9in}     \setlength{\textwidth}{6.5in}          \setlength{\topmargin}{0in}     \setlength{\oddsidemargin}{0in}     \setlength{\evensidemargin}{0in}     \setlength{\parindent}{.3in}          \pagestyle{fancy}          \sloppy     \definecolor{lightgray}{gray}{0.5}     \setlength{\parindent}{0pt}          \begin{document}     \setcounter{page}{11}     \lhead{John Haase}     \chead{AME 60614 Numerical Methods - Homework 2}     \rhead{\thepage}     \cfoot{}          \section*{Problem 1 Source Code}     \subsection*{C++ Code}     \lstset{language=C++}     \lstinputlisting{Problem1/Problem1.cpp}     \clearpage          \section*{Problem 2 Source Code}     \subsection*{C++ Code}     \lstset{language=C++}     \lstinputlisting{Problem2/Problem2.cpp}     \clearpage          \subsection*{MATLAB Code}     \lstset{language=Matlab}     \lstinputlisting{Problem2/Problem2.cpp}     \clearpage          \end{document}


title: Fault Tree: reducing gap between levels

text: 1. I am facing problem moving the level of the tree UP. I wanna move the row with yellow boxes and OR gate up, to conserve some space. i tried adding "level distance" in level 3/.style, but that didn't help.    2. For the text "k/n" in the AND gate, How do I level-shift it?  Code:               \documentclass[border=10pt]{standalone}     \usepackage{tikz}     \usetikzlibrary{trees,calc,shadings,shapes.gates.logic.US,positioning,arrows, fit}     \usetikzlibrary{shapes}          \begin{document}          \begin{tikzpicture}      [     % Gates and symbols style         and/.style={and gate US,thick,draw=black,fill=red!60,rotate=90,             anchor=east,xshift=-1mm, scale=1.3},         or/.style={or gate US,thick,draw=black,fill=blue!60,rotate=90,             anchor=east,xshift=-1mm},         be/.style={circle,thick,draw=black,fill=green!60,anchor=north,             minimum width=0.7cm},         tr/.style={buffer gate US,thick,draw=black,fill=purple!60,rotate=90,             anchor=east,minimum width=0.8cm},         sq/.style={regular polygon,regular polygon sides=4,thick,draw=black,fill=orange!60,anchor=north, scale=0.2},         tri/.style={regular polygon,regular polygon sides=3,thick,draw=black,fill=black!60,rotate=180, anchor=south, scale=0.5},     % Label style         label distance=3mm,  every label/.style={blue},     % Event style         event/.style={rectangle,thick,draw=black,fill=yellow!20,text width=2cm, text centered,font=\sffamily,anchor=north},         event2/.style={rectangle,draw=white, fill=white,},         and2/.style={and gate US,draw,fill=red!60,rotate=90, scale=0.5 },     % Children and edges style         edge from parent/.style={very thick,draw=black!70},         edge from parent path={(\tikzparentnode\tikzparentanchor) --  ++(0,-1.05cm) -| (\tikzchildnode\tikzchildanchor)},         parent anchor=south,         child anchor=north,         level 1/.style={sibling distance=3cm,level distance=1.5cm, growth parent anchor=south,nodes=event},         level 2/.style={sibling distance=2cm},         level 3/.style={sibling distance=1.5cm},         level 4/.style={sibling distance=2cm},         level 5/.style={},         level 6/.style={},         ]         \node (g1) [event] {System Failure}                 child {node [be, scale=0.2] (e1) {}}                 child[child anchor=east] {node [and, text width=3pt, ] (e2) {k/n}                     {[parent anchor=west,growth parent anchor=west,child anchor=north]                     child {node [sq] (e2a) {}}                     child {node [sq] (e2b) {}}                     child[child anchor=east]  {node (e2c) [or, text width=0pt] {}}                     child {node [sq] (e2d) {}}                     child[sibling distance=3cm] {node [sq] (e2e) {}}                     }                 }                 child {node [be, scale=0.2] (e3) {}}                 child {node [be, scale=0.2] (e4) {}}                 ;     %  Remove what follows if no gates are required        \node [or]   at (g1.south)   []  {};     %   \node [and]   at (e2.south)   []  {};     % text descriptions go here           \node [rotate=360] at ([yshift=-3mm]e1.south)    {Midplane};        \node [rotate=360] at ([yshift=-3mm]e3.south)    {Cooling};        \node [rotate=360] at ([yshift=-3mm]e4.south)    {Power domain 1};        \node [rotate=360] at ([xshift=20mm]e2d.east)    {$\dots$};          \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/Rkhyk.png)


title: TikZ: can I get an arbitrary list format for foreach?

text: I'd like very much to define a foreach loop that looks like this:               \foreach \pointA-\pointB in {(1,0)-(2,2),(3,4)-(2,1)}{         \draw \pointA -- \pointB     }      so that for each couple of points the lines between them would get drawn. Can I get `\foreach` to accept this kind of input? Or is there another way to do this? I'm going to define a macro to quickly draw lines between couples of points. I know I could use `/` instead of `-` but then I would also have to wrap the coordinates in `{` `}`, which is a lot of work.


title: how to include photo and format section headings

text: I would like to include an image on the top right of the document (above the horizontal line). Also, I would like to format the section headings (which appear on the left margin of the document) to red color.               \documentclass[10pt]{article}          \usepackage{calc}     \usepackage{comment}     \usepackage{soul}          \makeatletter     \newlength{\bibhang}     \setlength{\bibhang}{1em} %1em}     \newlength{\bibsep}      {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}     \newenvironment{bibsection}%             {\begin{enumerate}{}{%            \setlength{\leftmargin}{\bibhang}%            \setlength{\itemindent}{-\leftmargin}%            \setlength{\itemsep}{\bibsep}%            \setlength{\parsep}{\z@}%             \setlength{\partopsep}{0pt}%             \setlength{\topsep}{0pt}}}             {\end{enumerate}\vspace{-.6\baselineskip}}     \makeatother          \reversemarginpar          \usepackage{titlesec}          \usepackage[paper=letterpaper,                 %includefoot, % Uncomment to put page number above margin                 marginparwidth=1.2in,     % Length of section titles                 marginparsep=.05in,       % Space between titles and text                 margin=1in,               % 1 inch margins                 includemp]{geometry}          \setlength{\parindent}{0in}          \usepackage[shortlabels]{enumitem}          \usepackage{fancyhdr,lastpage}     \pagestyle{fancy}     \fancyhf{}\renewcommand{\headrulewidth}{0pt}     \fancyfootoffset{\marginparsep+\marginparwidth}     \newlength{\footpageshift}     \setlength{\footpageshift}               {0.5\textwidth+0.5\marginparsep+0.5\marginparwidth-2in}     \lfoot{\hspace{\footpageshift}%            \parbox{4in}{\, \hfill %                         \arabic{page} of \protect\pageref*{LastPage} % +LP                         \hfill \,}}          \usepackage{color,hyperref}     \definecolor{darkblue}{rgb}{0.0,0.0,0.3}     \hypersetup{colorlinks,breaklinks,                 linkcolor=darkblue,urlcolor=darkblue,                 anchorcolor=darkblue,citecolor=darkblue}                     \newcommand{\makeheading}[2][]%             {\hspace*{-\marginparsep minus \marginparwidth}%              \begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%                  {\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%                      \rule{\columnwidth}{1pt}%              \end{minipage}}          \renewcommand{\section}[1]{\pagebreak[3]%         \hyphenpenalty=10000%         \vspace{1.3\baselineskip}%         \phantomsection\addcontentsline{toc}{section}{#1}%         \noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\raggedright #1}}}%         \vspace{-\baselineskip}\par}          \newenvironment{outerlist}[1][\enskip\textbullet]%             {\begin{itemize}[#1,leftmargin=*]}{\end{itemize}%              \vspace{-.6\baselineskip}}          \newenvironment{lonelist}[1][\enskip\textbullet]%             {\begin{list}{#1}{%             \setlength{\partopsep}{0pt}%             \setlength{\topsep}{0pt}}}             {\end{list}\vspace{-.6\baselineskip}}          \newenvironment{innerlist}[1][\enskip\textbullet]%             {\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}             {\end{itemize}}          \newenvironment{loneinnerlist}[1][\enskip\textbullet]%             {\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}             {\end{itemize}\vspace{-.6\baselineskip}}          \newcommand{\blankline}{\quad\pagebreak[3]}     \newcommand{\halfblankline}{\quad\vspace{-0.5\baselineskip}\pagebreak[3]}          \newcommand\doilink[1]{\href{http://dx.doi.org/#1}{#1}}     \newcommand\doi[1]{doi:\doilink{#1}}          \providecommand*\url[1]{\href{#1}{#1}}     \renewcommand*\url[1]{\href{#1}{\texttt{#1}}}          \providecommand*\email[1]{\href{mailto:#1}{#1}}          \providecommand\BibTeX{{B\kern-.05em{\sc i\kern-.025em b}\kern-.08em         \TeX}}     \providecommand\Matlab{\textsc{Matlab}}          \begin{document}      \makeheading{Abhimanyu Arora}          \section{Contact Information}          \newlength{\rcollength}\setlength{\rcollength}{2in}     \begin{tabular}[t]{@{}p{\textwidth-\rcollength}p{\rcollength}}     Off no. 123  & 123 456 789  \\     Belgium     & \email{abhi@yahoo.com}\\     \end{tabular}               \section{Research Interests}          Development Economics, Microeconomics          \section{Education}          \textbf{University of Belgium},     \begin{outerlist}          \item[] Ph.D. Student, {Economics}             \begin{innerlist}             \item Thesis Topic: \emph{Essays in Development Economics}             \end{innerlist}     \end{outerlist}          \end{document}      * * * I tried the command               \makeheading[\includegraphics[height=1.5in]{my_picutre}]{Your Name}      where I just have `\makeheading`, but it didn't work out. The error message says it couldn't find out the end of the line...


title: Displaying plus and minus of a length

text: I know that \the\somelength will show me the value of \somelength. But how do I find out what the current stretch on that length is? For instance, if I have `\setlength{\footnotesep}{10 pt plus 5pt minus 3pt}` and I later want to display what the plus and the minus are for debugging purposes, how do I do that? First response was to use `\showthe`. I tried that, but it doesn't give the plus and minus. Minimal example:               \documentclass{report}     \begin{document}     \scrollmode     \typeout{The footnotesep is \the\footnotesep,}     \showthe\footnotesep     \setlength{\footnotesep}{10 pt plus 5pt minus 3pt}     \typeout{The footnotesep is now \the\footnotesep,}     \showthe\footnotesep     \end{document}      Output on the console:               `The footnotesep is 6.65pt,      > 6.65pt.      l.6 \showthe\footnotesep           The footnotesep is now 10.0pt,      > 10.0pt.      l.9 \showthe\footnotesep      ` But I want to see the plus and minus values.


title: Avoid warnings in TeXlipse

text: I'm using TeXlipse, an Eclipse plugin, to create my TeX documents. To structure my files I use `\input{filename}`. Now the problem is, that every file is one section or subsection. TeXlipse shows me a warning "Subsection has no preceding section" at the beginning of every file in the Eclipse window. How can I avoid this warning? This is not really a problem, because if a file contains only a subsection and is included by `\input{}` into another file, where the section is located, there IS a preceding section. I'd like to avoid this warning to use it for other things like overfull hboxes. The warning is displayed in Eclipse as shown in the figure: ![enter image description here](http://i.stack.imgur.com/Km7eD.png) Here is a MWE: **main.tex**               \documentclass{scrbook}     \begin{document}     \chapter{Foo}     \section{Foo2}     \input{test}     \end{document}      **test.tex**               \subsection{Foo3}      In the file `test.tex` I get the warning described above.


title: Drawing arrow with text using TikZ

text: I made some matrices with TikZ, but I also would like to show that the second one is a focus over a sub matrix of the first one (I made an ugly example with PS here) and to add an arrow with a text above it, as the image below shows: ![enter image description here](http://i.stack.imgur.com/uHeIW.png) This is my code so far. And this is what I achieve: ![enter image description here](http://i.stack.imgur.com/pZ3T8.png) I would like to know how to do the "focus" thing and how to change the "bootstrap" label size. Also, I would like to know if it possible to do this and put (a), (b) and (c) labels for each matrix and if I can change the color of the text of an specific matrix. This my first time using TikZ, so this may be a stupid question.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{matrix,backgrounds}     \begin{document}     \begin{tikzpicture}     \matrix(A) [matrix of math nodes,%                 left delimiter  = |,%                 right delimiter = |] at (0,0)     {      a & b & c & d \\      e & f & g & h \\       i & j & l & m \\       n &     o & p & q \\     };     \begin{scope}[on background layer]        \fill[blue!30,opacity=.5] (A-1-1.west|-A-1-3.north) rectangle (A-3-3.south east);     \end{scope}          \matrix(B) [matrix of math nodes,%                 left delimiter  = |,%                 right delimiter = |] at (3.1cm,0)     {      a & b & c \\      e & f & g \\       i & j & l \\      };          \matrix(C) [matrix of math nodes,%                 left delimiter  = |,%                 right delimiter = |] at (6cm,0cm)     {      l & l & c \\      f & j & i \\       g & b & e \\      };          \matrix(D) [matrix of math nodes,%                 left delimiter  = |,%                 right delimiter = |] at (0cm,-2.5cm)     {      l & l & c \\      f & j & i \\       g & b & e \\      };          \matrix(K) [matrix of math nodes] at (0cm,-2.5cm)     {      k_{1} & k_{2} & k_{3} \\      k_{4} & k_{5} & k_{6} \\       k_{7} & k_{8} & k_{9} \\      };          \draw[->,thick] (B) -- (C) node [pos=0.66,above] {bootstrap};     \end{tikzpicture}     \end{document}      Thank you in advance.


title: Minted cross reference line

text: I used to use `listings` a lot but `minted+pygmentize` has outstanding output. However, there are a few features from `listings` that are hard to find in `minted`, like having the line numbers on the right. Is there a way to cross reference lines in a `minted` environment as in `listings`?


title: Headings of 2nd abstract page in KOMA

text: I'm writing my thesis with scrartcl, using the KOMAoption `abstract=true`. My abstract has two pages, and while on the 1st page, the pagestyle is empty, on the 2nd page of the abstract all the additional elements (headsepline, footsepline, page number, heading) are shown. The whole text of the abstract is written within the `abstract` environment. Here is an MWE:               \documentclass[oneside]{scrartcl}          \KOMAoptions{titlepage=true, abstract=true}          \usepackage[automark]{scrpage2}     \pagestyle{scrheadings}      \chead[]{}     \ihead[]{}     \lehead[]{}     \ohead{\headmark}     \setheadsepline{.6pt}     \setfootsepline{.6pt}          \usepackage{lipsum}          \begin{document}          \title{My Thesis}     \author{It's me}     \maketitle          \thispagestyle{empty}     \addsec{Plagiarism Statement}     I'm not a plagiarist     \newpage          \begin{abstract}         \lipsum     \end{abstract}          \end{document}       I'd like the second page of the abstract to have the same layout as the first one (probably keeping the headings would be better, but I'm not sure yet). I don't understand why the pages are different now as the abstract text is enclosed within the same environment. Does anyone have an idea?


title: Acronyms with description environment

text: I have an editorial template to write a book's chapter. The publisher wants the authors to use the description environment to display acronyms. However, due to `acronym`'s package facilities I am trying to use it also. The MWE is below.               \documentclass{article}          \usepackage[nolist,printonlyused]{acronym}          \begin{document          \let\olditem\item          \makeatletter     \ifAC@printonlyused         \renewcommand{\item}[2]{%             \expandafter\ifx\csname acused@#1\endcsname\AC@used                 \acrodef{#1}{#2}                 \olditem[#1]{#2}             \else                 \olditem[]{}\vspace{-\baselineskip}             \fi}     \else         \renewcommand{\item}[2]{%             \acrodef{#1}{#2}             \olditem[#1]{#2}}     \fi     \makeatother          \begin{description}         \item{3GPP}{Third Generation Partnership Project}         \item{D2D}{Device-to-Device}         \item{M2M}{Machine-to-Machine}     \end{description}          \let\item\olditem          %\ac{3GPP}     \ac{D2D}     \ac{M2M}          \end{document}      The problem is when a certain acronym isn't used, because it leaves an empty line. I tried to remove the empty line with `\olditem[]{}\vspace{-\baselineskip}` but it is ugly. Is there a better way to achieve the same result?


title: Rstudio output in Hebrew

text: (Follow-up to Making LaTeX documents with Hebrew? (in Sweave + RStudio)) Trying to reproduce the above answer, I followed these instructions without success, under Windows 7. The best result I got so far is a document containing correct Hebrew text, but backwards (meaning RTL) R output. It means that the whole document is right- aligned, even the English parts. BTW, I was using the knitr function, as sweave was not functioning at all. My Encoding is UTF-8. I would appreciate any tips or solution! MWE:               %  This document must be compiled with Sweave and xelatex (not pdflatex)     \documentclass{article}     \usepackage{booktabs}     \usepackage{caption}     \usepackage[noae]{Sweave} % you must load Sweave with the `noae` option     % load polyglossia late in the package load order, since the bidi package (which is     % loaded when an RTL language is set) redefines lots of package code.     \usepackage{polyglossia}      \setmainlanguage{hebrew}     \setotherlanguage{english}     \setmainfont{David CLM}     % for R work with Hebrew, it's important to have a mono font that supports     % the Hebrew script.  Miriam Mono is one that I know of     \setmonofont[Script=Hebrew]{Miriam Mono CLM}       \title{\textenglish{Side-by-side xtables}}     \author{}     \date{}     \begin{document}     \maketitle     ראשית קצת קוד R כדי ליצור כמה נתונים.     <<>>=     myData <- matrix(c(19,89,23,23,74,44,16,39,67),ncol=3,byrow=TRUE)     colnames(myData) <- c("A","B","C")     rownames(myData) <- c("1","2","3")     myData2 <- myData * 2     @          כעת אנו שמים את הנתונים בשני צדדי על ידי צד טבלאות:          \begin{table}[htb]     \begin{minipage}{.45\textwidth}     \centering     \captionof{table}{\textenglish{First Table}}     <<echo=FALSE,results=tex>>=     library("xtable")     print(xtable(myData),       floating=FALSE,       hline.after=NULL,       add.to.row=list(pos=list(-1,0, nrow(myData)),       command=c('\\toprule\n','\\midrule\n','\\bottomrule\n')))     @          \end{minipage}     \begin{minipage}{.45\textwidth}     \centering     \captionof{table}{\textenglish{Second Table}}     <<echo=FALSE,results=tex>>=     print(xtable(myData2),       floating=FALSE,       hline.after=NULL,       add.to.row=list(pos=list(-1,0, nrow(myData2)),       command=c('\\toprule\n','\\midrule\n','\\bottomrule\n')))     @          \end{minipage}     \end{table}     \end{document}      (sorry, the system doesn't allow me to upload pics... but believe me, the whole page is right-aligned, and the R code is reversed)


title: Kile inverse search fails with Texlive 2011

text: I am using Scientific Linux 6.1. When I installed Kile it came with Texlive 2007 so I installed Texlive 2011 and made necessary changes to make Kile use Texlive 2011. The problem is , am unable to get pdf inverse search working. I was an Ubuntu user before and I have used kile + texlive 2009 with pdf inverse search for some years now. 1\. I have configured things as before (modern configuration, synctex=1, set kile as default in okular etc) 2\. the synctex.gz file is created, but when I shift+click on pdf file, nothing happens. I dont see any error/output messages either. Please help.


title: vedic symbols in XeTeX

text: How do I produce the vedic, anudatta and udatta via XeTeX. The one in this links gives > > http://mirrors.ctan.org/language/devanagari/velthuis/doc/generic/velthuis/xetex- > examples.tex The normal Sanskrit compilation works but the vedic accents if compiled with similar commands doesn't work. >   * Does anyone how we can work with XeTeX for typesetting Vedic Mantras or > Texts. >               \documentclass[12pt]{article}     \usepackage{ifxetex}     \RequireXeTeX     \usepackage{fontspec}     \newcommand\dn{\catcode`\~=12                \fontspec[Script=Devanagari,Mapping=velthuis-sanskrit]{Nakula}}          \let\origlabelitemi\labelitemi     \renewcommand\labelitemi{{\normalfont\origlabelitemi}}          \parindent=0pt          \begin{document}          \section{Examples}          {\dn     \begin{center}     \setlength{\fboxrule}{2pt}     \framebox[3.2cm][s]{.o ga.ne"saaya nama.h}     \end{center}     }     \end{document}      > The above command works perfectly for non-vedic sanskrit, but once I start > using udatta and anudatta it doesn't work at all. Commands like this:   * \dn\dnveda _{a} which work well in devanagari doesn't seem to work here.


title: biblatex: change inproceedings

text: I'd love to change the bibliography representation of @inproceedings. I use biblatex without biber (since I can't get biber to work) and my bibliography definitions currently read as follows:               \usepackage[style=alphabetic,maxbibnames=99,sorting=anyt,firstinits=true,url=false,doi=false]{biblatex}         \renewcommand*{\newunitpunct}{\addcomma\space}         \renewcommand{\labelalphaothers}{}         \renewcommand{\labelnamepunct}{\addcolon\space}         \renewbibmacro{in:}{}         \DeclareFieldFormat*{journaltitle}{#1}         \DeclareFieldFormat*{title}{\enquote{\textsl{#1}}}         \DeclareFieldFormat*{volume}{\textbf{#1}}         \renewbibmacro*{volume+number+eid}{\printfield{volume}}         \AtEveryBibitem{\clearfield{issn}}       This pretty much worked for journals and books, but inrpoceedings do not looks as I want them to. With a typical entry like that:               @inproceedings{Wilis2001,     address = {Les Ulis, France},     author = {Wills, A.},     booktitle = {JDN 9 – Neutrons et Magn\'{e}tisme},     doi = {10.1051/jp4:2001906},     file = {:D\:/NP430 MasterThesis/Bibliography/2001_JDN9_Wills_Magnetic structures and their determination.pdf:pdf},     issn = {1155-4339},     pages = {133--158},     publisher = {EDP Sciences},     title = {{Magnetic structures and their determination using group theory}},     url = {http://www.edpsciences.org/10.1051/jp4:2001906},     year = {2001}     }      I get something like this: A. Wills: " _Magnetic structures and their determination using group theory_ ", _JDN 9 - Neutrons et Magnétisme_ , Les Ulis, France: EDP Sciences, 2001, pp. 133-158 Now first of all I wanted the year to be in parentheses, as it is done for journal articles. I tried the following               \DeclareFieldFormat[inproceedings]{year}{(#1)}      but it didn't change a thing. And second, I would like to get rid of the publisher and address (or maybe only the address, I need to see what it gives...). And while you're at it, maybe you could also let me know how to supress the month, that is printed for journal articles. Thanks. \---------EDIT------------- Here is the MWE:               \documentclass{book}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          \usepackage[backend=biber,style=alphabetic,maxbibnames=99,sorting=anyt,firstinits=true,url=false,doi=false]{biblatex}     \renewcommand*{\newunitpunct}{\addcomma\space}     \renewcommand{\labelalphaothers}{}     \renewcommand{\labelnamepunct}{\addcolon\space}     \renewbibmacro{in:}{}     \DeclareFieldFormat*{journaltitle}{#1}     \DeclareFieldFormat*{title}{\enquote{\textsl{#1}}}     \DeclareFieldFormat*{volume}{\textbf{#1}}     \renewbibmacro*{volume+number+eid}{\printfield{volume}}     \AtEveryBibitem{\clearfield{issn}}     \DeclareFieldFormat[inproceedings]{booktitle}{Conference: #1}     \DeclareFieldFormat[inproceedings]{date}{\ifbibliography{\mkbibparens{#1}}{#1}}          \AtEveryBibitem{%       \ifentrytype{article}         {\clearfield{month}%          \clearfield{day}}         {}%         \ifentrytype{inproceedings}         {\clearlist{address}          \clearfield{month}          }         {}}          \begin{filecontents}{\jobname.bib}     @inproceedings{Wilis2001,     address = {Les Ulis, France},     author = {Wills, A.},     booktitle = {JDN 9 -- Neutrons et Magn\'{e}tisme},     doi = {10.1051/jp4:2001906},     file = {:D\:/NP430 MasterThesis/Bibliography/2001_JDN9_Wills_Magnetic structures and their determination.pdf:pdf},     issn = {1155-4339},     pages = {133--158},     month = {July},     publisher = {EDP Sciences},     title = {{Magnetic structures and their determination using group theory}},     url = {http://www.edpsciences.org/10.1051/jp4:2001906},     year = {2001}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}     \nocite{*}     \printbibliography     \end{document}      As you can see, I managed to get biber to work (a simple update can work miracles...). But I still don't access the year, even with               \DeclareFieldFormat[inproceedings]{date}{\ifbibliography{\mkbibparens{#1}}{#1}}      Also I could get rid of the publisher and months with the suggested \clearfields etc. but not the address...


title: What is a nice design/implementation for "back to the top"?

text: I want the reader of output of a PDFLaTeX be able to go back to the table of content or first page. What is a good way of doing this? Most PDF readers provide a TOC and navigation system but I was looking for something noticeable within the document and at the same time not obtrusive!


title: How to force a page break in LyX?

text: Page break, New page, Clear page, Clear double page functions does not work for me in LyX. I tried to enter them via Insert ->.... and via LaTeX code `\pagebreak` etc. But I desperately need to brake a page between two figures, because second picture occur inside the next subsection on the next page and that new subsection starts (in compiled PDF) right after the first figure. These two figures are too big to be placed at one page. **EDIT:** MWE can be downloaded here **EDIT 2:** Here is the screenshot for MWE: ![enter image description here](http://i.stack.imgur.com/Kf8mT.png) LyX version 2.0.6, OS openSUSE 12.3.


title: Package biblatex Warning: Data encoding is 'utf8'. Use backend=biber

text: After a few days break I went back to working on a report. When I tried to compile I got the following warning:               Package biblatex Warning: Data encoding is 'utf8'.     (biblatex)                Use backend=biber.      I haven't changed a thing since last week, when it worked. I did open the file on someone else's laptop, but didn't touch the code. I am using ShareLaTeX. The relevant code is (I think):               \documentclass[11pt]{report}     \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \graphicspath{ {images/} }          \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}     \usepackage{float}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage[backend=bibtex,style=authoryear,sorting=none]{biblatex}     \addbibresource{references.bib}          \printbibliography      References are in the form of:               @book{griffiths,         author        = {D.J. Griffiths},         title         = {Introduction to Quantum Mechanics},         year          = {2005},         publisher     = {Pearson Education Inc.},         location      = {USA, New Jersey, Upper Saddle River}     }      EDIT: When I change the backend to biber, the file doesn't recognise any references, and the log says:               Package biblatex Warning: Please (re)run Biber on the file:     (biblatex)                output     (biblatex)                and rerun LaTeX afterwards.      I'm unsure how to do this in ShareLaTeX. Consider me a simple mortal, who is not knowledgeable about much outside of basic report writing.


title: Add hyphenation pattern for word with special characters

text: The `\hyphenation` command can be used to add extra hyphenation patterns globally to a document. This is useful for special words, that are not present in the general hyphenation patterns.               \hyphenation{       chro-no-ampe-ro-met-ric       mic-ro-graphs}      The above example results in LaTeX being able to optionally hyphenate the two words "chronoamperometric" and "micrographs" at all places where they contain dashes.               \hyphenation{       chro-mium-(III)       chro-no-am-pe-ro-met-ric       mic-ro-graphs}      I would like to add words such as "chromium(III)" to the hyphenation patterns (as in the example above), but the parentheses cause an error ("Not a letter"). How can words with parentheses be automatically hyphenated? Ideally, I would also like to be able to specify to LaTeX that for any word that is already in the hyphenation rules, continue to hyphenate it also if it is followed by something within parentheses, and add the possibility to hyphenate between the word and the left parenthesis.


title: How to calc y coordinate of the block to put it between 2 other?

text: Suppose, we have a flowchart with 2 branches:               \documentclass{standalone}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{tikz}     \usetikzlibrary{calc,shapes, positioning}     \begin{document}     \def\len{1cm}     \begin{tikzpicture}[node distance = \len, auto]     \tikzset{         line/.style = {draw},         block/.style = {rectangle, draw, text centered, minimum height=2em},         question/.style = {shape=chamfered rectangle, chamfered rectangle xsep=2cm, draw},     }     %branch 1     \node [question] (1-1) {1-1};     \node [block, below = of 1-1] (1-2) {1-2};     \path [line] (1-1) -- (1-2);     \node [block, below = of 1-2] (1-3) {1-3};     \path [line] (1-2) -- (1-3);     \node [coordinate, below = of 1-3] (1-4) {};     \path [line] (1-3) -- (1-4);     \node [block, below = of 1-4] (1-5) {1-5};     \path [line] (1-4) -- (1-5);     %branch 1     \node [block, right = of 1-2] (2-1) {2-1};     \path [line] (1-1) -| (2-1);     \path [line] (2-1) |- (1-4);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/ucIrl.png) Branch 2 has only 1 block. While branch 1 can have more, then 1 block (I used 2 for simplicity). How can I set node (2-1.y) coordinate = (1-1.south.y) + ((1-1.south.y) - (1-4.y))? Note: 1-4 is not visualized on the image.


title: A problem with "Tikz + Gnuplot", set terminal table

text: When I use Tikz to plot a function. I followed the instruction to use gnuplot to do so. I did that half year before. But now when I recompile, the gnuplot has problem with the first line of its generated .gnuplot file:               set terminal table      Does anyone know the problem? My gnuplot version is 4.4 patchlevel 2. Do I need to use an older version? Thank you very much! EDIT: my file is here: A minimal example               \documentclass{minimal}          \usepackage{graphicx,url,psfrag}     \usepackage[noxcolor,usenames]{pstricks}     \usepackage{tikz}     \usetikzlibrary{decorations.pathreplacing,calc,decorations.fractals,through}     \usepgflibrary{plotmarks}     \usepackage{pgfmath}     \usepackage{amsmath,amssymb,amsthm,amscd}          \pagestyle{empty}          \begin{document}          \def\tI{1}     \def\xI{3}     \def\tII{2}     \def\xII{1}          \begin{tikzpicture}[scale=0.7,domain=\tII:5]          \draw[help lines,step=1] (0,-3) grid (5,5.5);     \draw [->] (-0.5,0) -- (0,0) coordinate [label=-135:$O$] (O) -- (6,0)     coordinate [label=right:$t$] (T);     \draw [->] (0,-3.2)  -- (0,6) coordinate [label=above:$x$] (X);          \draw [dashed,thick] (0,\xI) coordinate [label=left:$x_1$] -- (\tI,\xI) --     (\tI,0) coordinate [label=below:$t_1$] ;     \draw [dashed,thick] (0,\xII) coordinate [label=left:$x_2$] -- (\tII,\xII) --     (\tII,0) coordinate [label=below:$t_2$] ;          \foreach \r in {-3,-2,-1,0,1,2,3}     {     \draw plot [id=HeatSample-\r]     function{     ((x-\tI)*\xII+(x-\tII)*\xI)/(2*x-\tI-\tII)+sqrt((x-\tI)*(x-\tII)/(2*x-\tI-\tII)     ) * \r} node [right] {$\r$};     }          \end{tikzpicture}     \end{document}      Even with the basic examples in http://www.texample.net/tikz/examples/tag/gnuplot/, my system has problems with               set terminal table;      I think it is the problem of my gnuplot


title: Vdots are taller than the rest of text

text: When I use `\vdots` within the align environment, its size is bigger than of the rest of characters. I want to get rid of the gap (purple colour on the picture below) or somehow move `\vdots` upward (`\vspace{-Xmm}` didn't work at all). My code is               \documentclass[12pt]{article}     \usepackage{amsfonts, amsmath}          \begin{document}     \begin{align}         A &= B \nonumber\\           &=  C \nonumber \\           &=  \vdots \nonumber \\           &=  Z \nonumber     \end{align}          \end{document}      which gives you ![enter image description here](http://i.stack.imgur.com/5abiG.png) Cheers!


title: Can't make greek sign of question ";" shown right

text: I tried to make a greek text in Latex. But there is a small problem the sign of question ";" shows as upper dot.               \documentclass[twoside,a5paper,12pt]{book}     \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage[greek]{babel}     \usepackage{epigraph}     \usepackage[a5paper]{geometry}     \sloppy          \begin{document}          --- Καλά αν είναι έτσι! Αλλά θα λειτουργεί;     Τι θα κάνουμε, απλά θα καθίσουμε απ’ έξω,     θα βγάλουμε φωτογραφίες και αυτό ήτανε;     Δεν θα ανάψουμε ούτε ένα κεράκι;          \end{document}      ![Result](http://i.stack.imgur.com/m71jD.jpg) I tried `\usepackage[iso-8859-7]{inputenc}` and got more problem with encoding. After I tried `\usepackage{ucs}` but result was the same. Could somebody help me? Thank you in advance.


title: Penalty inserted by output routine

text: I am using plain TeX (actually plain e-TeX) processed by a relatively recent version of MiKTeX (pdfTeX). Consider the following fragment of code that can be processed with plain TeX:               \noindent     A\par     \output={\unvbox255}     \break     \vskip 1pt     \noindent     B     \output={\showbox255 \plainoutput}     \end      According to my knowledge, I was expected that as the `\break` appears, the output routine re-inject the content of `\box255` inside the main vertical list, the `\vskip 1pt` be cleaned and a `\skip\topskip` inserted before the letter B. But this is not at all what happens: after the output routine has been first called as the break appears, a `\penalty10000` is (inexplicably) inserted into the main vertical list, and the `\vskip 1pt` is not cleaned but left in place (this is shown by the `\showbox` inside the definition of the second `\output` above). Is it a normal behavior of TeX or is it a bug?


title: Number of pages decreases when font size increases

text: Number of pages in my pdf-document [`article`] decreases when font size increases - and v.v.! It kind of resembles an optimum of maximum page numbers as function of font size (which I don't want). When increasing the font size:               \documentclass[pdftex,18pt,a4paper,twoside,openright]{report}      to, e.g. 16pt or 18pt, the resulting font size as appears in the pdf-file, decreases as compared to 12pt! Any thoughts on that? The resulting font size as appears in the pdf-file also decreases for decreasing font size given in `\documentclass[...]`.


title: Put a vertical line to separate 2 subgraphs

text: I have one figure which contains 2 figures:               \begin{figure*}       \begin{center}         \subfigure[A]{           \begin{tikzpicture}           ....           \end{tikzpicture}         }         \quad         \subfigure[B]{           \begin{tikzpicture}           ....           \end{tikzpicture}         }       \end{center}     \end{figure*}      Could anyone tell me how to add a vertical line between them to visually separate them?


title: Page number on Index page

text: I define the style of page numbering using `fancy` package, however, on Index page number is set in the center of footer. How to get the number in right place or remove it at all from Index page (at least...)?               \documentclass[]{article}          \usepackage{lastpage}          \usepackage{fancyhdr}     \pagestyle{fancy}          \fancyhf{}     \rhead{\thepage/\pageref{LastPage}}     \renewcommand{\headrulewidth}{0pt}          \usepackage{makeidx}     \makeindex          \begin{document}          \section{A} \index{A}     \newpage     \section{B} \index{B}          \printindex          \end{document}


title: Changing the fontsize without affecting chapter, ToC and bibliography titles

text: I need to change the fontsize to `8pt`, however I want to change only the regular text - chapter titles, table of contents and bibliography fonts must stay the same. Is it possible to change it the way I want to? I tried changing the fontsize in the `documentclass` using               \documentclass[a4paper,8pt]{<class>}      but it seems that it affected the entire document. Here is my preamble                   \documentclass[a4paper,12pt]{mwrep}     \usepackage[MeX]{polski}     \usepackage[cp1250]{inputenc}     \usepackage[left=3.0cm,right=3cm,top=3.0cm,bottom=3.0cm]{geometry}     \usepackage{amsmath,amssymb}         \usepackage{graphicx}     \usepackage{setspace}     \usepackage{algorithmic}     \usepackage{colortbl}     \usepackage{dcolumn}     \usepackage{float}     \usepackage{tabularx}     \usepackage{longtable}     \usepackage[centerlast]{caption}     \usepackage{multirow}     \usepackage[section] {placeins}     \usepackage{booktabs}     \usepackage{xcolor}     \usepackage{changepage}     %\usepackage{lipsum}     \linespread{1.3}     \makeatletter     \def\hlinewd#1{%     \noalign{\ifnum0=`}\fi\hrule \@height #1 %     \futurelet\reserved@a\@xhline}     \makeatother     \newcommand{\mytoprule}{\specialrule{2pt}{0em}{0em}}     \newcommand{\mybottomrule}{\specialrule{2pt}{0em}{0em}}      \renewcommand{\labelitemii}{$\bullet$}     \setlength{\belowcaptionskip}{-10pt}     \newcommand{\eightptsize}{%         \fontsize{8}{9.5}\selectfont}


title: Chapter comment with regulation

text: ![enter image description here](http://i.stack.imgur.com/sXfeU.png)               \documentclass[a4paper,11pt]{memoir}               \newenvironment{introduction}     {\centering%       \begin{minipage}{.8\textwidth}%     %  \centering%       \itshape\footnotesize\hspace{-1em}\ignorespaces%     }     {%       \end{minipage}%       \par\addvspace{2\baselineskip plus 0.2\baselineskip minus 0.2\baselineskip}%     }               \begin{document}     \begin{introduction}     Nunc condimentum, metus non ullamcorper fringilla, tellus tortor laoreet quam,      eu pulvinar elit sem sed libero. Aliquam erat volutpat. Mauris sodales auctor      turpis, nec convallis nisi auctor quis. Nunc rhoncus auctor dolor, malesuada      posuere diam vestibulum scelerisque.     \end{introduction}     \end{document}


title: Arrow is too long when \vec followed by subscript or superscript after using unicode-math package

text: The code is below               \documentclass[12pt]{article}         \usepackage{unicode-math}         \setmathfont{XITS Math}         \begin{document}         \large         $\vec{a}^{12345}$         \end{document}      Then the arrow of `\vec` is too long and penetrate the superscript 12. I just want the the arrow of `\vec` is above `a`, not whole of `a^{12345}` And I use `xelatex` to run the code. However, if I replace `$\vec{a}^{12345}$` with `$\vec{ab}^{12345}$`, then it looks quite good. The arrow of `\vec` is just above `ab`, it do not stretch and penetrate 12. Can anyone tell me how to fix the problem?


I use Inkscape on Windows 7 platform. The principle to enter integrals and other mathematical symbols in Inkscape seems that the best thing to do and write them in a LaTeX compiler and cut them in Adobe PDF and paste it into Inkscape as figures. Seems to be how you make pictures like this in Inkscape: ![enter image description here](http://i.stack.imgur.com/lcPMd.png) Is there any way to type LaTeX code directly into the text boxes Inkscape? I know this question is ultópica but it never hurts to try.


title: What do hscale and vscale in the geometry package mean?

text: What are `hscale` and `vscale`? How can I use them? If I use `geometry` package like the code below, what will happen to the `total body`?               \usepackage{geometry}     \geometry{hscale = 0.6, vscale = 0.5}      I didn't understand the use even after reading the `user manual` page number = 6, 7.


title: Colored line numbers with algorithmicx?

text: The `fancyvrb` allows me to customize line number style which I find very useful. I'm using it to give line numbers a different color and then use that same color in the text describing the code. I believe this makes it easier to locate the text describing a particular image. ![Colored line numbers example.](http://i.stack.imgur.com/eu4Fv.png) Is there a way to do the same thing for pseudo code listings using `algorithmicx`?


title: Problem with \hbox inside list

text: In the example below, the first `\hbox to \linewidth` ends up at the left of the page, despite the fact that it is inside an `itemize` environment. The presence of `\hspace*{0pt}` before the second seems to eliminate the problem.               \documentclass[12pt]{article}     \begin{document}     This is some text which shows the width of the whole page.     We must make sure it is long enough to occupy at least one whole line.     \begin{itemize}     \item      Inside the itemize environment, the text is not so wide.      \par     \hbox to \linewidth{\rule{\linewidth}{1pt}}     \par     \hspace*{0pt}\hbox to \linewidth{\rule{\linewidth}{1pt}}     \end{itemize}     \end{document}      What is going on here?


title: How to extract parts of (La)TeX document?

text: I want to run queries against LaTeX documents like these:   1. get list of all equations, even if one declares `\def\be{\begin{equation}}` and uses it;    2. get list of all arguments of some command (e. g. `\marginpar`), where it has been used in document (again, even if one declares `\def\m\marginpar` and calls this macro);    3. get the theorem with given counter value.  The task seems to require full compiling of all macros, but I want to get arguments in _not_ expanded form --- that is not as blocks and glue, but as user's input (if possible). How can I do such things? **Update:** ideally, I want to use "semantic markup" to mark parts of documents and generate different views of them. Assume I have smth like this:               \beginBlock{calculus}     \beginBlock{content}     ... lectures...     \endBlock     \beginBlock{exam}     ... problems...       \beginBlock{comments}       ... comments about criteria and how to evaluate typical mistakes...       \endBlock     \endBlock[exam]     \endBlock[calculus]      and similar for linear algebra in other file; I want to generate a report with sections for calculus and linear algebra, containing only exam problems, e. g.


title: Overfull \hbox error on a blank line in LaTeX?

text: I'm getting really confused by this. In my code, line 39 is completely blank, there's no errors anywhere else and everything fits in the margins yet I'm still getting an `Overfull \hbox (34.204pt too wide) in paragraph` error. It has nothing to do with what's on the line, because empty or not, the error is always line 39. I've included my code below, does anyone else have this problem?               \documentclass[11pt]{article}          \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{mcode}          \renewcommand{\arraystretch}{1.5}     \renewcommand{\theenumi}{(\roman{enumi})}     \renewcommand{\labelenumi}{\theenumi}          % \mcodelisting{Program/Function descriptor}{Usage}{filename with extension}     \newcommand{\mcodelisting}[3]{\pagebreak     \appendix{\textbf{#1} \mcode{2-3/#3} \textbf{#2}}     \lstinputlisting{C:/Users/******/Documents/MATLAB/2-3/#3}     }               \title{2.3 Continued Fractions}         % used by \maketitle     \author{}     \date{}          \begin{document}     \maketitle          \section*{Rational Numbers}          \subsubsection*{Programming Task}     A program using the given algorithm to compute the partial quotients and convergents of a fraction $u/v$ is shown on page ??.               \begin{enumerate}     \item Taking $u = 112, v = 27$ gives partial quotients $a_n$ as 4,6,1,3 and convergents $p_n/q_n$ as $\frac{4}{1}, \frac{25}{6}, \frac{29}{7}, \frac{112}{27}$     \item Taking $u = 4803, v = 3395$ gives partial quotients 1,2,2,2,3,6 and 13 with convergents $\frac{1}{1}, \frac{3}{2}, \frac{7}{5}, \frac{17}{12}, \frac{58}{41}, \frac{365}{258}, \frac{4803}{3395}$     \item Taking $u = 276272, v = 72159$ gives partial quotients 3,1,4,1,5,9,2,6,5 and 3 with convergents $\frac{3}{1}, \frac{4}{1}, \frac{19}{5}, \frac{23}{6}, \frac{134}{35}, \frac{1229}{321},     \frac{2592}{677}, \frac{16781}{4383}, \frac{86497}{22592}, \frac{276272}{72159}$     \item Finally, if $u = 11683474147$ and $v = 863334886$ then the partial quotients are 13,1,1,7,11,1,2,5,2,3,1,1,9,1,2,12,9,5 and the convergents are $\frac{1}{1}$     \end{enumerate}               % Page break inserted by \mcodelisting     \mcodelisting{Program}{for question 1}{question1.m}          \end{document}             % End of document.      (Line 39 in this case is the blank line immediately before `% Page break ...`)


title: Change paragraph font and background color

text: I'm submitting a project that involves blocks of code. I figured a nice way to present it by be that paragraphs of code are black text on a light gray background, in courier font. I'm wondering if it would be possible to create an environment, called "code" for example, such that,               \begin{code}     ...     ...     \end{code}      would have the gray background, and be in courier font. Any ideas would be greatly appreciated!


title: Which package is best/easiest for a TeX newbie to lay out a book for print?

text: This question may be a little general and _is_ subjective, but I am asking because I am not sure where my (limited) time should be invested for the problem I have to solve (I'll detail that in a moment). I'm the technical guy for my wife's books that we are publishing (the print version is through Lulu). For her first book that we published, I created the layout in Pages.app and used styles to format it exactly as I wanted it to look. I've got measurements for the size of the page we designed for, the size of the margins and the placements of the header and footer, and can calculate the text block size. I know how far down on the page I want text to start appearing for new chapters. These are all specified as styles in Pages. I know that I want to have a more _flexible_ publishing process, because when we found some typos during the ebook production phase, I had to edit three different texts (the Pages document, our original source, and the ebook HTML). I want to have a single publishing system—and I see something TeXish as an intermediate output format for the print version (just as the HTML is an intermediate output format for the ePub and Mobi ebook versions). I can write all of the software that I need to take my input format (which will probably be a variant of Markdown) and transform it into a input file to XeTeX or LuaTeX—but I need to have something to write it _into_ (or at least know how to write all of the bits that I need for the parts that I've got). So far, I've been trying to decide between learning LaTeX + `memoir`, ConTeXt, or KOMA-Script. I've spent a few hours each with `memoir` and ConTeXt and as of yet haven't spent any time with KOMA. I'm looking for something with high ROI that lets me work with Unicode and my system TrueType fonts (the book is set in Baskerville). My goal is to re-typeset the original book using TeX so that I understand the process involved before trying to typeset the second book using a 'fill' process. I like what I've played with, but I can't get a sense of which of these packages is going to give me the best result for the limited time that I have (working on my wife's book is sort of a second job). Remember: I'm also looking to reproduce a layout that I'm very happy with. Thanks (and this is probably a good "Community Wiki" question).


title: How to compile properly a document using "fontspec" package?

text: How to compile properly a document using `fontspec` package? Example code (15.1. XeTeX @ LaTeX-wikibooks.pdf)               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Arial}     \begin{document}     Lorem ipsum...     \end{document}       Result with `$latex fontspec.tex`               This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)      %&-line parsing enabled.     entering extended mode     (./fontspec.tex     LaTeX2e <2005/12/01     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, ancientgreek, ibycus, ar     abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc     h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono     greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, la     tin, mongolian, mongolian2a, bokmal, nynorsk, polish, portuguese, romanian, rus     sian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, ukenglis     h, ukrainian, uppersorbian, welsh, loaded.     (/usr/share/texmf/tex/latex/base/article.cls     Document Class: article 2005/09/16 v1.4f Standard LaTeX document class     (/usr/share/texmf/tex/latex/base/size10.clo)) (./fontspec.sty     (/usr/share/texmf/tex/latex/expl3/expl3.sty     (/usr/share/texmf/tex/latex/expl3/l3names.sty)     (/usr/share/texmf/tex/latex/etex-pkg/etex.sty)     (/usr/share/texmf/tex/latex/expl3/l3basics.sty)     (/usr/share/texmf/tex/latex/expl3/l3expan.sty)     (/usr/share/texmf/tex/latex/expl3/l3tl.sty)     (/usr/share/texmf/tex/latex/expl3/l3intexpr.sty)     (/usr/share/texmf/tex/latex/expl3/l3quark.sty)     (/usr/share/texmf/tex/latex/expl3/l3seq.sty     ! Undefined control sequence.     l.129 \int_new:N                    \g_seq_nesting_depth_int     ?      Result with `$lualatex fontspec.tex`               This is LuaTeX, Version snapshot-0.25.4-2009102410 (Web2C 7.5.7)     (fontspec.tex>     LaTeX2e <2005/12/01>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, ancientgreek, ibycus, ar     abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc     h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono     greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, la     tin, mongolian, mongolian2a, bokmal, nynorsk, polish, portuguese, romanian, rus     sian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, ukenglis     h, ukrainian, uppersorbian, welsh, loaded.     (/usr/share/texmf/tex/latex/base/article.cls     Document Class: article 2005/09/16 v1.4f Standard LaTeX document class     (/usr/share/texmf/tex/latex/base/size10.clo)) (fontspec.sty     (/usr/share/texmf/tex/latex/expl3/expl3.sty     (/usr/share/texmf/tex/latex/expl3/l3names.sty     (/usr/share/texmf/tex/generic/oberdiek/luatex.sty     (/usr/share/texmf/tex/generic/oberdiek/infwarerr.sty)     (/usr/share/texmf/tex/generic/oberdiek/ifluatex.sty)     (/usr/share/texmf/tex/latex/etex-pkg/etex.sty)     (/usr/share/texmf/tex/generic/oberdiek/luatex-loader.sty     (/usr/share/texmf/scripts/oberdiek/oberdiek.luatex.lua)))     (/usr/share/texmf/tex/generic/oberdiek/pdftexcmds.sty     (/usr/share/texmf/scripts/oberdiek/oberdiek.pdftexcmds.lua)))     (/usr/share/texmf/tex/latex/expl3/l3basics.sty)     (/usr/share/texmf/tex/latex/expl3/l3expan.sty)     (/usr/share/texmf/tex/latex/expl3/l3tl.sty)     (/usr/share/texmf/tex/latex/expl3/l3intexpr.sty)     (/usr/share/texmf/tex/latex/expl3/l3quark.sty)     (/usr/share/texmf/tex/latex/expl3/l3seq.sty     ! Undefined control sequence.     l.129 \int_new:N                      \g_seq_nesting_depth_int     ?      Result with `$xelatex fontspec.tex`               This is XeTeXk, Version 3.1415926-2.2-0.999.6 (Web2C 7.5.7)      %&-line parsing enabled.     entering extended mode     (./fontspec0.tex     LaTeX2e <2005/12/01>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, ancientgreek, ibycus, ar     abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc     h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono     greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, la     tin, mongolian, mongolian2a, bokmal, nynorsk, polish, portuguese, romanian, rus     sian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, ukenglis     h, ukrainian, uppersorbian, welsh, loaded.     (/usr/share/texmf/tex/latex/base/article.cls     Document Class: article 2005/09/16 v1.4f Standard LaTeX document class     (/usr/share/texmf/tex/latex/base/size10.clo)) (./fontspec.sty     (/usr/share/texmf/tex/xelatex/expl3/expl3.sty     (/usr/share/texmf/tex/xelatex/expl3/l3names.sty>          ! Package l3names Error: Required primitive not found: \pdfstrcmp.>          See the l3names package documentation for explanation.>     Type  H <return>  for immediate help.>      ...>          l.121     }>      Second example (#2:3 Test F-autofake @ fontspec/fontspec-testsuite.pdf)               \documentclass{testsuite}     \usepackage{fontspec}     \begin{document}     \Large     \def\text{ABC \textit{ABC} \textbf{ABC}               \textbf{\textit{ABC}}\\}     \fontspec{Inconsolata}     \fontspec[AutoFakeSlant]{Inconsolata}     \fontspec[AutoFakeBold]{Inconsolata}     \fontspec[AutoFakeSlant,AutoFakeBold]              {Inconsolata}     \fontspec[AutoFakeSlant=0.4]{Inconsolata}     \fontspec[AutoFakeBold=5]{Inconsolata}     \fontspec[AutoFakeSlant=0.4,AutoFakeBold=5]              {Inconsolata}     \end{document}      Result with `$latex/lualatex/xelatex fontspec1.tex`               This is XeTeXk, Version 3.1415926-2.2-0.999.6 (Web2C 7.5.7)      %&-line parsing enabled.     entering extended mode     (./fontspec1.tex     LaTeX2e <2005/12/01>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, ancientgreek, ibycus, ar     abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc     h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono     greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, la     tin, mongolian, mongolian2a, bokmal, nynorsk, polish, portuguese, romanian, rus     sian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, ukenglis     h, ukrainian, uppersorbian, welsh, loaded.>          ! LaTeX Error: File `testsuite.cls' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: cls)          Enter file name:          (./fontspec.sty (/usr/share/texmf/tex/latex/expl3/expl3.sty     (/usr/share/texmf/tex/latex/expl3/l3names.sty)     (/usr/share/texmf/tex/latex/etex-pkg/etex.sty)     (/usr/share/texmf/tex/latex/expl3/l3basics.sty)     (/usr/share/texmf/tex/latex/expl3/l3expan.sty)     (/usr/share/texmf/tex/latex/expl3/l3tl.sty)     (/usr/share/texmf/tex/latex/expl3/l3intexpr.sty)     (/usr/share/texmf/tex/latex/expl3/l3quark.sty)     (/usr/share/texmf/tex/latex/expl3/l3seq.sty     ! Undefined control sequence.     l.129 \int_new:N                      \g_seq_nesting_depth_int     ?      Please, may you tell me what is the problem here?


title: mdframed: how to prevent a box from splitting if the remaining content (or the initial content) is too small?

text: ## Question I would like to prevent `mdframed` to split a box too early or too late. By this, I mean that I would like the remaining part of the box to always be greater than a fixed length, given before. It seems to be impossible with the normal options of `mdframed`. **Does anyone know how to modify the`mdframed` macros so that it has this feature?** ## Picture and code ![enter image description here](http://i.stack.imgur.com/4W7VU.png)               \documentclass[a5paper]{article}     \usepackage{mdframed}     \begin{document}          \begin{mdframed}[     innerrightmargin = 0.5cm,      innertopmargin = 0.5cm,      innerbottommargin = 0.5cm,      innerleftmargin = 0.5cm,      skipbelow = 5mm,      skipabove = 5mm,      userdefinedwidth = 5cm,      splitbottomskip = 5mm,      splittopskip = 5mm,     backgroundcolor = red,       roundcorner = 5pt,     align = center]               Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo. Pellentesque tristique consequat molestie. Donec non porttitor risus. Praesent adipiscing elementum tortor, commodo ullamcorper justo consequat eget. Aenean eget nulla enim. Nam purus massa, hendrerit quis faucibus eget, consectetur ac dui. Curabitur ornare non ipsum elementum suscipit. Sed a dignissim ligula, nec vestibulum dui. Fusce sed varius tellus.          Vestibulum lectus metus, tincidunt at fermentum non, pellentesque at lorem. Vivamus nisl sem, tempor ac mi et, elementum feugiat justo.          Vestibulum lectus metus.          \end{mdframed}          This is after the \verb+mdframed+ environment.     \end{document}


title: Why aren't the braces showing

text: I have this `tex`: `\(\mu_{A}\left(x\right)\in \[0,1 \right\]\)` The issue here is that `[` and `]` are not showing around `0,1`, why is that? Thanks.


title: lof alphabetically sorted

text: Writing a special dictionary, I have inserted some hundred figures. The normal list of figures does not make much sense in this case as nowbody is really interested in the order of occurrence but in the contents -> what I am looking for is a list of figures alphabetically sorted according to the captions. Any idea how this can be done? Thanks


title: Automatically Detect Foreign Language for Hyphenation?

text: Is there a LaTeX package that automatically detects which foreign language a particular part of a multi-language TeX document is so that it can hyphenate it appropriately, or do I have to manually specify the foreign language, using, e.g., the Babel package's command `\foreignlanguage{}`?


title: Block diagram in Tikz with absolute positioning?

text: I'm trying to recreate an image using Tikz from a presentation about market structure: ![enter image description here](http://i.stack.imgur.com/GaVqS.jpg) I'm having a very hard time specifying absolute positions for each node. What's the best way to assign block positions for something like this? Here's what I have so far:               \tikzstyle{trade} = [rectangle, minimum height=0.5cm, text     centered, color=white, draw=black, fill=red]     \tikzstyle{order} = [rectangle, minimum height=0.5cm, text     centered, color=white, draw=black, fill=blue]          \begin{tikzpicture}[node distance=1cm]          \node (trade) at (0, 0) [trade, minimum width=6cm] {Marketable Order};          \node (o1) [order, below of=trade, minimum width=0.5cm, xshift=-2.75cm, node     distance=2cm] {1};      \node (o2) [order, right of=o1, minimum width=1cm] {2};     \node (o3) [order, right of=o2, minimum width=3cm, xshift=1cm] {3};     \node (o4) [order, right of=o3, minimum width=1cm, xshift=2cm] {4};          \draw[->] (trade.west) -- (o1.west);     \draw[->] (o1.north) to [out=180] (o2.north);          \end{tikzpicture}


I want to turn the first author into hyperlinks using BibLaTeX and hyperref- I found this related question that aims to turn titles into hyperlinks in verbose mode using BibLaTeX and hyperref. I did a little modification of the best submitted answer by changing the format in authors definition as:               % Use new format in authors     \newbibmacro*{author}{%       \ifboolexpr{         test \ifuseauthor         and         not test {\ifnameundef{author}}       }         {\printtext[linked]{\printnames{author}%          \iffieldundef{authortype}}            {}            {\setunit{\addcomma\space}%             \usebibmacro{authorstrg}}}         {}\usebibmacro{clearlinks}}      This allowed me to have ![Output](http://i.stack.imgur.com/ep3l0.png) Question: How do modify the command `\cite` such that it only prints the author and year? The entire tex file is similar to Audrey's solution  plus the code above substituting the codes `\newbibmacro*{author}{...}`. I tried this suggestion from another question but it doesn't seem to work for my case. It only gives me a green colored author but without hyperlink ![result2](http://i.stack.imgur.com/xFZJP.png)


title: Circuitikz: arrows on the path and changing directions of arrow with variable resistor

text: For my `R_2(t)`, I would like the arrow bottom left to top right of the resistor. Is there a way to swap the arrow direction? Also, above the non-linear resistor, how can I add an arrow on the path? Here is what I am going for: ![enter image description here](http://i.stack.imgur.com/NOACf.png) Here is my code:               \documentclass[convert = false]{standalone}     \usepackage[american, cuteinductors]{circuitikz}     \usepackage{siunitx}          \begin{document}     \begin{circuitikz}[scale = 2]       \draw                                             (0, 0)             to[american voltage source, v^ = $e(t)$]    (0, 3)             to[R, l^ = $R_1$, -*]                       (1.5, 3)             to[vR, l_ = $R_2(t)$]                       (1.5, 1.5)             to[L, l^ = $i_L(t)$, i = $ \ $, -*]         (1.5, 0)             to[short]                                   (0, 0);       \draw                                             (1.5, 0)             to[short, -*]                               (3, 0)             to[C, l^ = $v_c(t)$, -*]                    (3, 3)             to[short]                                   (1.5, 3);       \draw                                             (3, 3)             to[short]                                   (4.5, 3)             to[R]                                       (4.5, 0)             to[short]                                   (3, 0);            \node at (1.25, .75) {$L$};       \node at (3.35, 1.5) {$C$};       \node at (3.1, 1.65) {$+$};       \node[align = left] at (5.1, 1.5) {Nonlinear \\ resistor};     \end{circuitikz}     \end{document}      Here is what I have: ![enter image description here](http://i.stack.imgur.com/iZSKp.png)


title: Specify color of the first row in table (in "newenvironment")

text: I am using an specific style for my tabulars and I am looking to specify automatically the color of the text in the first row. Currently I must specify manually the color of the text of each cell in the row.               \documentclass[a4paper]{article}     \usepackage[english]{babel}     \usepackage[utf8x]{inputenc}     \usepackage{tikz}     \usetikzlibrary{backgrounds,calc}     \usepackage{booktabs}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}          \newsavebox{\dataTableContent} % Box     \newenvironment{dataTable}[1] % \new environment     {%     \begin{lrbox}{\dataTableContent}%     \begin{tabular}{#1}}%     %     {%     \end{tabular}     \end{lrbox}     \begin{tikzpicture}     \node [inner xsep=0pt] (tbl){\usebox{\dataTableContent}};     \begin{pgfonlayer}{background}     % table     \draw[rounded corners=1pt,top color=gray!1,bottom color=gray!30,draw=black]     (tbl.north east) rectangle (tbl.south west);     % top line     \draw[rounded corners=1pt,top color=gray!10!black,bottom color=gray!50!black,draw=black]%     ($(tbl.north west)$) rectangle ($(tbl.north east)-(0,1.5\baselineskip)$);     % bottom rule     \draw[rounded corners=0.25pt,fill=gray,draw=black]%     (tbl.south west) rectangle ($(tbl.south east)+(0,0)$);     \end{pgfonlayer}     \end{tikzpicture}}     \begin{document}     \begin{dataTable}{lc}     \color{white}Rien&\color{white}tout\\\midrule     si&non     \end{dataTable}     \end{document}      ![example](http://i.stack.imgur.com/CVKB2.png) The idea to create the a table using classical commands:               \begin{dataTable}{lc}     Rien&tout\\\midrule     si&non     \end{dataTable}      Thank you for your help.


title: Centering contents of table cells horizontally and vertically

text: I'd appreciate help centering the contents of the topmost row vertically and horizontally in their cells(?). I've tried using \multicolumn without luck.                   \documentclass[10pt,a4paper]{scrreprt}              \usepackage{classicthesis-ldpkg}         \usepackage{multicol}         \usepackage{multirow}         \usepackage{rotating}              \begin{document}                      \begin{sidewaystable}                  \centering                     \renewcommand\multirowsetup{\centering}                     \begin{tabular}{|>{\centering}p{20mm}|>{\centering}p{18mm}|>{\centering}p{20mm}|>{\centering}p{18mm}|>{\centering}p{20mm}|>{\centering}p{20mm}|>{\centering}m{15mm}|>{\centering}m{20mm}|>{\centering}m{15mm}|m{20mm}<{\centering}|} \hline                     \multirow{2}{20mm}{Head Model} & \# SG computed & \# Computed directly & \# SG Corrected & \# SG Approximated & SMAS triangle count & \multicolumn{2}{>{\centering}p{35mm}|}{Machine~1} & \multicolumn{2}{>{\centering}p{35mm}|}{Machine~2} \\ \cline{7-10}                      & & & & & & Runtime & \% spent calc geodesics  & Runtime & \% spent calc geodesics \\ \hline                     African & 1102 & 994 & 102 & 56 & -- & 499~sec. (8.3~min.) & 77\% & -- & -- \\ \hline                     \end{tabular}                 \end{sidewaystable}                 \end{document}


title: Is there a way to use ebgaramond lining numbers in math mode in pdflatex?

text: \DeclareSymbolFont{numbers}{T1}{EBGaramond}{m}{n}     \SetSymbolFont{numbers}{bold}{T1}{EBGaramond}{bx}{n}     \DeclareMathSymbol{0}\mathalpha{numbers}{"30}...      Can we use these commands to use Eb garamond in math in pdf latex? if possible, what do i have to write instead of EBGaramond in the commands.


title: Error message while compiling labeled equation in align in newenvironment. It says some other labels will be lost

text: \newenvironment{pfof10}[1]{\vspace{1ex}\noindent{\bf Proof of     Theorem $\ref{n}$}\hspace{0.5em}}{\hfill\qed\vspace{1ex}}     \begin{pfof10}     \\     soooooooo     \begin{align}\label{part3}     x&=y \\      \end{align}           We know there exists a unique solution of $(\ref{part3})$     \end{pfof10}     \end{document}      Here I am getting an error: > ! Package amsmath Error: Multiple \label's: label 'dif' will be lost. > > See the amsmath package documentation for explanation. Type H for immediate > help. ... > > l.887 ...x&=y\end{align}


title: Is it possible make the section names globally title case?

text: I don't want to change them one by one. I am wondering how to make the section names globally title case? That is "This is a Title Case Section Name". It would be nice if you can also give answers applied to such as concerning subsection as well. Or using Small Capitals etc... Thanks I am using article document class, that is used for journal publications. * * * ## Edit: As shown in this website, the Title Case I want is: ### TitleCase exceptions Articles, conjunctions, and prepositions less than six letters long are changed to lower case unless they are at the beginning of a sentence. These include: `(01)a` `(02)abaft` `(03)about` `(04)above` `(05)afore` `(06)after` `(07)along` `(08)amid` `(09)among` `(10)an` `(11)apud` `(12)as` `(13)aside` `(14)at` `(15)atop` `(16)below` `(17)but` `(18)by` `(19)circa` `(20)down` `(21)for` `(22)from` `(23)given` `(24)in` `(25)into` `(26)lest` `(27)like` `(28)mid` `(29)midst` `(30)minus` `(31)near` `(32)next` `(33)of` `(34)off` `(35)on` `(36)onto` `(37)out` `(38)over` `(39)pace` `(40)past` `(41)per` `(42)plus` `(43)pro` `(44)qua` `(45)round` `(46)sans` `(47)save` `(48)since` `(49)than` `(50)thru` `(51)till` `(52)times` `(53)to` `(54)under` `(55)until` `(56)unto` `(57)up` `(58)upon` `(59)via` `(60)vice` `(61)with` `(62)worth` `(63)the` `(64)and` `(65)nor` `(66)or` `(67)yet` `(68)so`


title: two documents sharing same reference numbering

text: I am writing a scientific paper with supplementary information in an additional document. The paper and the supplement share many references, which in the paper are numbered by first appearance in the text. I would like the references in the supplement to have the same numbers as in the paper. I have additional references there and not all references from the paper show up in the supplement. I am still working on the documents and the `.bib`-file is changing. It is generated by Icculus Referencer. Is there a way to achieve the numbering the way I like? I haven't tried, but I think, that one way could be to create a `.bib`-file with all references that I want to use and then number all of them, regardless of their use in the current document. The problem is, that when I change the first appearance of one reference, I have to change the order of the bibtex-entries in the `.bib`-files, which is not very handy.


title: conditional highlighting with soul

text: The journal PLoS ONE, says in the FAQ               When submitting your revision, you will need to include the following new files:     [...] A ‘clean’ copy of your revised manuscript.     A revised manuscript with tracked changes. [...]      I'm using `soul`'s `\hl` to highlight changes. So, I also need a version that doesn't highlight changes. To accomplish this, I added the following code. The `\renewcommand{\hl}[1]{#1}` is intended as a no-op. So the "clean" version would use `\highlightfalse` and the version with tracked changes would use `\highlighttrue`. This appears to work, but I'm wondering if there are any problems with this approach, or better ways to do it.               \newif\ifhighlight     % COMMENT OUT \highlighttrue or \highlightfalse     \highlighttrue % or     %\highlightfalse     \ifhighlight     \else     \renewcommand{\hl}[1]{#1}     \fi


title: side-by-side xtables in Sweave

text: I use `xtable` to manage my tables in `Sweave` like this               <<label=tab1, echo = FALSE, results = tex>>=     print(xtable(Table1))     @               <<label=tab2, echo = FALSE, results = tex>>=     print(xtable(Table2))     @      I wonder how to get these tables side by side. Any help will be highly appreciated. Thanks


title: Natbib and bibhang don't get along with numbers or super

text: I am using natbib.sty chicago.bst as my bibtex style sheets. My natbib call looks like               \usepackage[numbers,sort&compress,super]{natbib}      when I try to change the hanging indent in my bibliography nothing happens:               \setlength \bibhang{1in}      However, if I remove the `numbers` and `super` options from the `natbib` options, the hanging indent happens? It appears that `bibhang` doesn't work with the numbers and super options? Any clue whats going on here? I'm stumped and have spent the better part of the afternoon searching for an answer.


title: Flexible equation, align, multline environment

text: I'm looking for a command (say `\foo{}`) or pair of commands (say `\foos`, `\fooe`) that behave like: `equation` environment if there is no `\\` nor `&` `multline` if there is a single `\\` `align` if there are both `&` and `\\` Also, automatically switches between the `*` variants if there is no `\label` command. The commands should be compatible with usual packages (`amsmath` etc), and should support the usual `\tag`, `\label`, `\ref` commands. Just to be clear, using it should not slow down compilation by any perceptible amount. Bonus gratitude if you also give me a command to switch the behavior of `\[` `\]` from the usual one to the above one, back-and-forth in a paper. I am constantly switching between the three environments and it is really annoying. Thanks! **Note:** I am telling LaTeX where to break the equation. All I want is LaTeX to be smart enough to use the appropriate environment!


title: Prevent newline in title of beamer presentation

text: How can I prevent the new line indicated in the picture below? ![enter image description here](http://i.stack.imgur.com/xVzUo.png) Here is a MWE:               \documentclass[svgnames,9pt]{beamer}     \usepackage[latin1]{inputenc}     \usetheme{Warsaw}     \setbeamertemplate{headline}{}     \setbeamerfont{footline}{size=\fontsize{6}{8}\selectfont}     \makeatletter     \setbeamertemplate{frametitle}     {%       \nointerlineskip%       \vskip-2pt%       \hbox{\leavevmode         \advance\beamer@leftmargin by -12bp%         \advance\beamer@rightmargin by -12bp%         \beamer@tempdim=\textwidth%         \advance\beamer@tempdim by \beamer@leftmargin%         \advance\beamer@tempdim by \beamer@rightmargin%         \hskip-\Gm@lmargin\hbox{%           \setbox\beamer@tempbox=\hbox{\begin{minipage}[b]{\paperwidth}%               \vbox{}\vskip.50ex% NEW: original \vskip-.75ex               \leftskip0.3cm%               \rightskip0.3cm plus1fil\leavevmode               \insertframetitle%               \ifx\insertframesubtitle\@empty%                 \strut\par%               \else                 \par{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par\vskip2ex}% NEW: added \vskip2ex               \fi%               \nointerlineskip               \vbox{}%               \end{minipage}}%           \beamer@tempdim=\ht\beamer@tempbox%           \advance\beamer@tempdim by 2pt%           \begin{pgfpicture}{0pt}{0pt}{\paperwidth}{\beamer@tempdim}             \usebeamercolor{frametitle right}             \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}{\beamer@tempdim}}             \pgfusepath{clip}             \pgftext[left,base]{\pgfuseshading{beamer@frametitleshade}}           \end{pgfpicture}           \hskip-\paperwidth%           \box\beamer@tempbox%         }%         \hskip-\Gm@rmargin%       }%       \nointerlineskip         \vskip-0.2pt         \hbox to\textwidth{\hskip-\Gm@lmargin\pgfuseshading{beamer@topshade}\hskip-\Gm@rmargin}         \vskip-2pt     }     \makeatother     \addtobeamertemplate{frametitle}{\vspace*{0.5cm}}{\vspace*{0.5cm}}               \title[short title]{\huge \textbf{Long Title}}     \author[Me]{}     \date{}          \begin{document}     \begin{frame}          \begin{figure}[h!]        \includegraphics[scale=0.2]{../Thesis/images/Logo_Unisi_2012.jpg}     \end{figure}          \begin{center}           \begin{minipage}[b]{0.5\textwidth}         \centering         University of Siena\\Master Thesis in Computer Science Engineering     \end{minipage}%     \end{center}          \titlepage          \begin{minipage}[t]{0.5\textwidth}         \vspace{-2cm}         \begin{flushleft}             { \textit{Author}:\vspace*{0.1cm} \\ Me }         \end{flushleft}     \end{minipage}%             %     \begin{minipage}[t]{0.5\textwidth}         \vspace{-2cm}         \begin{flushright}             {\textit{Supervisor}:\vspace*{0.1cm} \\ Prof. Him \\}         \end{flushright}         \end{minipage}%          \vspace{-0.7cm}     \begin{center}           \begin{minipage}[b]{0.5\textwidth}         \centering           \small           December 10, 2012\\Academic Year 2011/2012     \end{minipage}%     \end{center}              \end{frame}     \end{document}