title: When should you use \vskip (\hskip) rather than \vspace (\hspace) in a LaTeX document?

text: I assume that, to guard against strange errors, you should use `\vspace` rather than `\vskip` whenever possible in a LaTeX document. But are there any situations in which you must use `\vskip`? I'm wondering the same thing about `\hspace` vs. `\hskip`.


title: $\quad$ in different lines are not the same effect?

text: %% AMS-LaTeX Created by Wolfram Mathematica 9.0 : www.wolfram.com          \documentclass{article}     \usepackage{amsmath, amssymb, graphics, setspace}          \newcommand{\mathsym}[1]{{}}     \newcommand{\unicode}[1]{{}}          \begin{document}          \section*{ORDERED SETS }          \subsection*{1.5 Definition}          $\quad $Let \(S\) be a set. An order on \(S\) is a relation, denoted by \(<\), with the following two properties: \\     (i) If \(x\in S\) and \(y\in S\) then one and only one of the statements          \[x<y, x=y, y<x\]          is true. \\     (ii) If \(x, y, z \in S\), if \(x < y\) and \(y < z\), then \(x < z\).          $\quad $The statement $\texttt{"}$\(x < y\) may be read as \(x\) is less than \(y\) or \(x\) is smaller than \(y\) or \(x\) precedes \(y\)$\texttt{"}$.               $\quad $It is often convenient to write \(y > x\) in place of \(x < y\).          $\quad $The notation \(x < y\) indicates that \(x < y\) or \(x = y\), without specifying which of these two is to hold. In other words, \(x < y\)     is the negation of \(x > y\).                    \end{document}      ![enter image description here](http://i.stack.imgur.com/SOqPN.png)


title: Repeating environment contents twice

text: I'm writing a document where I have many code blocks like so:               \begin{align}     d = \sqrt{ (x'-x)^2 }      \end{align}          \begin{minted}{latex}     d = \sqrt{ (x'-x)^2 }     \end{minted}      So the first line renders the latex code, and the second shows the source. Is there any way of wrapping this whole thing in its own environment? For example, it would look like:               \begin{eqnexample}     d = \sqrt{ (x'-x)^2 }     \end{eqnexample}      Thoughts?


title: Combine Document Class and TikZ

text: I'm trying to combine several articles into a single volume using the `combine` document class. Some of the articles use the `TikZ` package, which seems to cause problems during compilation. For example, if my main file is               \documentclass{combine}     \usepackage{tikz}     \begin{document}     \begin{papers}     \coltoctitle{Paper 1}     \coltocauthor{A.~Author}     \import{./author1/paper}     \end{papers}     \end{document}      and the document `paper.tex` in the directory `author1` has the contents               \documentclass{article}     \title{My Paper}     \author{A.~Author}     \date{2013}     \begin{document}     \maketitle     My paper.     \end{document}      then compiling the main document fails with the message `! TeX capacity exceeded, sorry [save size=5000].` But if I remove the `TikZ` package from the main document, then everything works fine. (Of course that's not an option when the included file actually makes use of the package.) Short of manually converting all the `TikZ` pictures to image files, is there any way to fix this?


title: Four Arranged Figures are offset

text: How can I ensure that the four plots (which are all the same size pdfs) appear with the same spacing: see they are offset here: ![Offset Image](http://i.stack.imgur.com/RNbLQ.png) % Actual versus predicted plots               \begin{figure}[H]     \begin{minipage}[b]{0.45\linewidth}     \centering     \includegraphics[width=\textwidth]{figs/immediate_formula_s_avp.pdf}     \hspace{0.1cm}     \end{minipage}     \begin{minipage}[b]{0.45\linewidth}     \centering     \includegraphics[width=\textwidth]{figs/immediate_formula_s_avp.pdf}     \end{minipage}     \begin{minipage}[b]{0.45\linewidth}     \centering     \includegraphics[width=\textwidth]{figs/immediate_formula_s_avp.pdf}     \hspace{0.1cm}     \end{minipage}     \begin{minipage}[b]{0.45\linewidth}     \centering     \includegraphics[width=\textwidth]{figs/immediate_formula_s_avp.pdf}     \end{minipage}     \caption{Actual Versus Predicted Plots}\label{multiavp}     \end{figure}


title: TeXmaker: Need syntax highlight for command in black color

text: I saw almost everyone who uses TeXmaker has syntax highlight, why I don't ? I have used the default in `option`->`editor` The others:               \documentclass[12pt,letterpaper]{article}       my: I need **not black color for below command** ` \documentclass[11pt]{article} `


title: How can I automatically replace subscripts and highlight GoTo labels?

text: I have to show a lot of autogenerated code throughout my document. The generated code represents loops with explicit block labels and `goto`s. The following code applies function `f` to each element of an array yielding a new array (i.e. `ys = map f xs`):               \documentclass{article}     \usepackage{listings}     \begin{document}     \begin{lstlisting}          init_2:       i_1 = 0       arr_2 = newArray (length arr_1)       goto guard_2          guard_2:       guard i_1 < length arr_1 | done_2       goto body_2          body_2:       elt_1 = readArray arr_1 i_1       elt_2 = f_2 elt_1       writeArray arr_2 i_1       i_1 := i_1 + 1       goto guard_2          done_2:       return arr_2          \end{lstlisting}     \end{document}      Seeing underscores and integer suffixes everywhere is not very readable. I'd much prefer something like the following:               \documentclass{article}     \usepackage{listings}     \usepackage{xcolor}     \begin{document}     \begin{lstlisting}[mathescape=true, basicstyle=\ttfamily]          $\color{red}{init_{ys}}$:       i$_{xs}$ = 0       arr$_{ys}$ = newArray (length arr$_{xs}$)       goto $\color{red}{guard_{ys}}$          \end{lstlisting}     \end{document}      ![Nicely formated code](http://i.stack.imgur.com/bqVx7.png) However, this requires tediously formatting each listing individually. I was wondering if there is a more automated solution? * * * My question is whether it is possible to do one or more of the following in a listing:   1. Automatically subscript part of the symbol after underscore (I have a partial solution below)   2. Automatically replace `_1` with `_xs` and `_2` with `_ys`   3. Automatically markup matching strings, e.g. make labels `init_1`, `guard_2` bold I don't mind using a different listings package if it lets me typeset code more easily. * * * I have managed to partially solve question 1 with the help of this answer but it only works for regular text, not listings code:               \documentclass{article}     \usepackage{listings}     \usepackage{fixltx2e}          %% Automatically make code after underscore subscripted     \def\SubscriptWord#1 {\check#1\relax\textsubscript{#1} }     % Check function parses world until space/newline     \def\check#1{%     \ifx\relax#1%     \else     \ifcat a#1%     \else     \typeout{illegal character #1}%     \fi     \expandafter\check     \fi}          \begin{document}          \catcode`\_=\active     \def_{\SubscriptWord}          normal_foo          \begin{lstlisting}     listing_bar     \end{lstlisting}          \end{document}


title: Unicode characters in a listing environment are not colorized!

text: When using the package `listing`, colorized comments will not yield colorized exotic unicode characters. ![exotic unicode characters within a comment are not colorized](http://i.stack.imgur.com/KOs7k.png) This is a minimal working example:               \documentclass{minimal}              \usepackage{             listings,             color,             fontspec         }              \setmainfont{Linux Libertine}              \lstset{           commentstyle=\color{green},         }          \begin{document}         \begin{lstlisting}[language=Java,showtabs=false]             // Comments are green, yet ‘•’ and ‘≤’ are not.         \end{lstlisting}     \end{document}      Colorizing these characters generally works within listing environments: ![unicode characters colorized by basicstyle](http://i.stack.imgur.com/X0V4N.png)                   \lstset{           basicstyle=\color{green},         }          \begin{document}         \begin{lstlisting}[showtabs=false]           Everything is green, even ‘•’ and ‘≤’.         \end{lstlisting}     \end{document}      Is this a bug? How can I colorize the unicode characters within comments? I’m using TeXLive 2013 and lualatex.


title: standardmakeup layer in ConTeXt

text: Need to place a PDF file as a watermark behind the title page and part break pages. These have been laid out using `\standardmakeup`. Have created the layer and can place it on a normal text page but cannot work out how to force it to work on the `\standardmakeup`. I have been using MkIV from TeXLive 2012. Here is a minimal example of what I have tried so far               \startenvironment[Test]          % -- Title page setups     \definelayer[jikishin][position=no,repeat=no,width=\paperwidth,height=\paperheight]     \setlayerframed[jikishin][x=0cm,y=3cm]{\externalfigure[images/Jikishin.pdf][size=artbox]}             \definemakeup[title][doublesided=no,page=right,headerstade=empty,footerstate=empty]               \setuppapersize             [A5][A5]          \setuppagenumbering      [alternative=doublesided]          \stopenvironment                    \startfrontmatter  % --- here not sure how to get the layer activated         \startmakeup[title]             \title{Jikishin Ju Jitsu}         \stopmakeup     \stopfrontmatter          \startbodymatter         \chapter{Body of document}         \input knuth     \stopbodymatter


title: How to Generally Increase the Size and Line Spacing of the Footnotes?

text: I think that the footnotes are generally a little too small, and I would like to increase their size globally (for the entire document). How do I go about doing this? Moreover, I think that the spacing between footnotes, and the line spacing for footnotes generally, is too small. How can I configure these ( _two different_ ) properties of footnotes? Here is the MWE:               \documentclass[12pt]{article}       \usepackage[margin=1in]{geometry}              \makeatletter       \renewcommand\@makefntext[1]{\leftskip=0em\hskip-0em\@makefnmark#1}       \makeatother            \begin{document}       Caesar non supra grammaticos\footnote{''even Caesar is not above grammar/grammarians.''}. Tu enim Caesar civitatem dare potes hominibus, verbis non potes.\footnote{This is going to be a longer footnote: ''Caesar, you can grant citizenship to men but not to words.''}        \end{document}


title: How to diagonally divide a table cell … properly?

text: There have been many threads discussing solutions to the task of drawing a diagonal line in a table cell. There are also two packages to do this, `slashbox` and the better looking `makecell` with its `\diaghead` command. Apparently, better looking doesn't mean good looking though. I just stole a MWE from one of the threads: http://tex.stackexchange.com/a/11694/13450               \documentclass{standalone}     \usepackage{makecell}     \begin{document}     \begin{tabular}{|l|c|c|}\hline     \diaghead{\theadfont Diag ColumnmnHead II}%     {Diag\\Column Head I}{Diag Column\\Head II}&     \thead{Second\\column}&\thead{Third\\column}\    \hline     & foo & bar \    \hline     \end{tabular}     \end{document}      Which yields this: ![result from MWE](http://i.stack.imgur.com/8qM1e.png) Looks more or less fine at first glance at this low resolution (which is not always the case BTW) but with a better resolution, the lower right corner looks somewhat awkward: ![the line end point does not seem to lie in the line crossing](http://i.stack.imgur.com/cdOsF.png) These things even show in print and it doesn't look like being off by just one pixel so it's probably not just a rendering problem. Does anyone know why this happens and how to prevent it? (Preferably without drawing the whole table as a TikZ picture as has been suggested.) * * * **Edit in response to Joseph's answer:** This TikZ solution by Leo Liu also has similar issues http://tex.stackexchange.com/a/17748 ![TikZ screenshot with two end sticking out](http://i.stack.imgur.com/1K0v3.png) It appears to be rather manual, too, so maybe it's just a calibration issue. But is it really necessary to go down to the 6400% level in Adobe Reader to fine-tune parameters every time you change the content of the "diagonal cell" (for lack of a better word)?


title: pgfdeclareshape : how is a fill color recognized?

text: my custom made shape `triangle` does not recognize the fill color (or stroke color), if set as an option like `fill=green`, say. It does recognize the fill option though. I seem to miss some initialization code (though I use `\tikz@mode`). The same problem is true for setting the color of the border of the shape. The code in an executable file looks like:               \documentclass{article}     \usepackage{amsmath,amsfonts,amssymb,tikz}     \usetikzlibrary{shapes}     \usetikzlibrary{arrows,backgrounds}     \usetikzlibrary{decorations.pathreplacing}     \usetikzlibrary{decorations.markings}     \pgfdeclarelayer{foreground}     \pgfdeclarelayer{background}     \pgfsetlayers{main,foreground,background}     %     \newenvironment{pic}[1][]%     {\begin{aligned}\begin{tikzpicture}[#1]}%     {\end{tikzpicture}\end{aligned}}     %     % Styles     \tikzstyle{string}=[line width=1.25pt]     %%%%%%%%%%%%     % Triangle     \newlength\stateheight     \setlength\stateheight{0.6cm}     \newlength\minimumstatewidth     \setlength\minimumstatewidth{0.8cm}     \newif\ifhflip\pgfkeys{/tikz/hflip/.is if=hflip}     %%     %%     %%     \makeatletter     %%     %%  triangle shape for states in categorical quantum computation     %%     -- Based on some code by Chris Heunen,     %%     -- expanded by BF.     %%     %%  options:  hflip   (horizonatlly flipps the triangle)     %%     \pgfdeclareshape{triangle}     {% -- some dimensions          \saveddimen{\halfbaselength}{%              \pgf@x=0.5\wd\pgfnodeparttextbox              % get xsep              \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner xsep}}%              \advance\pgf@x by \pgf@xc%              % get \ht of textbox, add to baselength               \advance\pgf@x by \ht\pgfnodeparttextbox              % get minimum width              \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum width}}%              \divide\pgf@xb by 2              \ifdim\pgf@x<\pgf@xb%                  % yes, too small. Enlarge...                  \pgf@x=\pgf@xb%              \fi%          }          %          % do NOT split code here \halfbaselinelength is pased on in \pgf@x           %          \saveddimen\triangleheight{%              % \pgf@x    contains \halfbaselength              %get ysep              \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/inner ysep}}%              \advance\pgf@x by \pgf@xc%              %get minimum height              \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/minimum height}}%              \divide\pgf@xb by 2              \ifdim\pgf@x<\pgf@xb%                  %yes, too small. Enlarge...                  \pgf@x=\pgf@xb%              \fi%          }          % -- anchors          \savedanchor\centerpoint{%  midpoint on base line              \pgf@x=0pt               \pgf@y=0pt          }          \anchor{center}{\centerpoint}          \anchor{text}{%              % horrizontal midpoint of pgfnodeparttextbox              \pgf@x=-0.5\wd\pgfnodeparttextbox              % vertical positioning (dependent on hflip flag)              \ifhflip                 \pgf@y=-1.2\ht\pgfnodeparttextbox                 \advance\pgf@y by \dp\pgfnodeparttextbox                 \advance\pgf@y by -3pt              \else                 \pgf@y=\dp\pgfnodeparttextbox                 \advance\pgf@y by -\dp\pgfnodeparttextbox                 \advance\pgf@y by 4pt              \fi          }          \anchor{left}{%             \pgf@x=-\halfbaselength             \pgf@y=0pt          }          \anchor{right}{%             \pgf@x=\halfbaselength             \pgf@y=0pt          }          \anchor{tip}{%             \pgf@x=0pt             \ifhflip                \pgf@y=-\triangleheight             \else                \pgf@y=\triangleheight             \fi           }          \anchor{a}{%             \pgf@x=-\halfbaselength             \divide\pgf@x by 2             \pgf@y=0pt          }          \anchor{b}{%             \pgf@x=\halfbaselength             \divide\pgf@x by 2             \pgf@y=0pt          }         %% -- draw the outline of the triangle         %% -- fill the triangle if necessary         \backgroundpath         {           \tikz@mode     %% set stuff           \tikz@options  %% needed??           % -- draw mode           \iftikz@mode@draw             \begin{pgfonlayer}{foreground}               \pgf@xa=\halfbaselength               \pgf@ya=\triangleheight            \ifhflip                 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgf@ya}}               \pgfpathlineto{\pgfqpoint{-\pgf@xa}{0pt}}               \pgfpathlineto{\pgfqpoint{\pgf@xa}{0pt}}               \pgfpathclose           \else                  \pgfpathmoveto{\pgfqpoint{0pt}{\pgf@ya}}                \pgfpathlineto{\pgfqpoint{-\pgf@xa}{0pt}}                \pgfpathlineto{\pgfqpoint{\pgf@xa}{0pt}}                \pgfpathclose               \fi               \pgfusepath{stroke}             \end{pgfonlayer}           \fi           % -- fill mode           \iftikz@mode@fill             \begin{pgfonlayer}{background}               \pgf@xa=\halfbaselength               \pgf@ya=\triangleheight            \ifhflip                 \pgfpathmoveto{\pgfqpoint{0pt}{-\pgf@ya}}               \pgfpathlineto{\pgfqpoint{-\pgf@xa}{0pt}}               \pgfpathlineto{\pgfqpoint{\pgf@xa}{0pt}}               \pgfpathclose           \else                  \pgfpathmoveto{\pgfqpoint{0pt}{\pgf@ya}}               \pgfpathlineto{\pgfqpoint{-\pgf@xa}{0pt}}               \pgfpathlineto{\pgfqpoint{\pgf@xa}{0pt}}               \pgfpathclose               \fi               \pgfusepath{fill}             \end{pgfonlayer}           \fi         }         \anchorborder          {%  -- works only on the base line (yet)           %  -- range restricted to 0..100           % fetch key           \pgfkeysgetvalue{/pgf/shape border rotate}{\rotate}%           %           % Save x and y.           %           \edef\externalx{\the\pgf@x}%           \edef\externaly{\the\pgf@y}%           %           % Adjust the location of the external            % point relative to \centerpoint.           %           \centerpoint%           \pgf@xa\externalx\relax%           \pgf@ya\externaly\relax%           \advance\pgf@xa\pgf@x%           \advance\pgf@ya\pgf@y%           \edef\externalx{\the\pgf@xa}%           \edef\externaly{\the\pgf@ya}%           %           % Get the angle of the external point to the \centerpoint.           %           \pgfmathanglebetweenpoints{\centerpoint}{\pgfqpoint{\externalx}{\externaly}}%           \pgfmathsubtract@{\pgfmathresult}{\rotate}%           \ifdim\pgfmathresult pt<0pt\relax%          \pgfmathadd@{\pgfmathresult}{360}%           \fi%           \let\externalangle\pgfmathresult%           %           % left tip           %           \pgf@xc=-\halfbaselength           \pgf@yc=0pt           %           %  we use a border parameter in the range 0..100 to parametrize           %  the base line from left to right, 50 is the center           %  hence \externalangle/50 gives the multiplicator for the           %  \halfbaseline   (2\halfbaseline is the length of the baseline)           %           \pgfmathdivide@{\externalangle}{50}           \pgfmathparse{\halfbaselength*\pgfmathresult}           \advance\pgf@xc by \pgfmathresult pt%           %           % set the anchor point           %           \pgf@y=0pt           \pgf@x=\pgf@xc         }     }     \makeatother          \begin{document}          \begin{align*}       \begin{pic}         \node (o1) at (0,1) {};         \node (o2) at (1,1) {};         \node (o3) at (2,1) {};         \node[triangle,draw,blue,string,hflip] (t1) at (0,0) {};         \node[triangle,fill=blue!40,string,hflip] (t2) at (1,0) {};         \node[triangle,draw,fill=green,string,hflip] (t3) at (2,0) {};         \draw[blue] (o1) to (t1.center);         \draw (o2) to (t2.center);         \draw (o3) to (t3.75) (o3) to (t3.25); % tests anchorborder       \end{pic}     \end{align*}     \end{document}      The result looks like: ![output example](http://i.stack.imgur.com/FLu7x.png) I have to work on the \anchorborder bit too, but I guess I can do that myself, as it works already on one side of the triangle. Any help and explanation why my code is wrong is greatly appreciated.


title: How to force \paragraph to start on a new page

text: If               \paragraph{abc}     text text text text text text text text text text ... text      is on the bottom of page `\paragraph` stays at the bottom while the content is moved to top of the next page. How to force `\paragraph` to also get moved to the top of next page instead of standing alone at the bottom of last page.


title: Indexing the topics

text: I have a collection of math contest. After each question, i am writing the topics of the question like               \index {Cyclic Quadrilateral}     \index {Euler's $\phi$ function}      But makeindex refers a page number, not the problem itself. How can I achieve such an indexing.


title: parsing LaTeX to output number of arguments for each command defined

text: Let's say I have a file foo.sty that contains the following:               \newcommand{\a}{x}     \newcommand{\b}[2]{x}     \newcommand{\c}[2][y]{x}     \newenvironment{d}[3]{}{}      I would like to be able to run this through some software and produce a data file saying what commands and environments have been defined, and how many optional and mandatory arguments they have -- something like this:               command,a,0,0     command,b,0,2     command,c,1,1     environment,d,0,3      I could code up something in perl that would work most of the time, but I'm wondering if there's any way to do it so that it's highly reliable. The impression I get is that completely correct parsing of LaTeX is hard, and basically the only thing that does it is LaTeX. Is there some way of getting LaTeX to do this, maybe with an appropriately constructed .tex file that pulls in foo.sty, introspects, and then does write18's...? I'm looking for a solution that's open-source and that I can run on linux in an automated way (not a GUI).


title: How to change the colour of specific arrows on a flow chart

text: It appears my flowchart is nonplanar (it contains a subdivided K_3,3...) How do I colour specific arrows, so I can make it visually clearer what's going on when they inevitably cross? (by 'arrows', I mean the whole arrow as opposed to just the arrow head). Thanks (/how can I create a 3D flow chart?)


title: TeX Live on a network

text: I don't really understand how TeX Live works over the network. Say, I have TeX Live installed on my Ubuntu server. Can I use my favorite LaTeX editor in Windows, and use the TeX Live that is on my server to compile my document? If so, can someone point me to a guide as to how to do that, or explain it to me?


title: "mdwlist.sty" file not found

text: I am new to latex, whenever I quick build my latex document it shows an error ("`mdwlist.sty`" file not found). I googled it many times but I am not getting anything, please tell me how to solve this problem.


title: Installing Packages on Mac OS

text: I am using Texmaker with MacTex v2013 on OS X Mavericks 10.9. I want to install some packages that don't come by default with MacTeX (e.g. `wrapfig.sty`). One way to do this would be download the `.sty` files and place them in the current working directory (cwd), but since I have a lot of packages to download, this might take a long time. Alternatively, I tried using the TeX Live Utility application, and going to packages, selecting all and then install, but unfortunately TeX Live Utility just sits there doing nothing, is there any way that I can download and install all the TeX packages that I am missing?


title: Replacement for copyright symbol within newtx package

text: When compiling my document using `newtx` font I get the following error               LaTeX Font Warning: Font shape `OMS/ntxrx/m/n' undefined     (Font)              using `OMS/ntxsy/m/n' instead on input line 209.          LaTeX Font Warning: Some font shapes were not available, defaults substituted.      I did some research and concluded that this error is most probably due to the fact that LaTeX does not find `\textcopyright` symbol within `normalfont` part of `newtx` package. I also concluded that LaTeX then replaces it with the same symbol from some other part of `newtx` package. Since replacement is done by LaTeX automatically, I could probably ignore the error message altogether. Still, for the curiosity and pedantic sake, I wonder if I could direct LaTeX to the right sub-font and avoid annoying error messages. Is that possible to do?


title: How to alter .bst file to suit journal requirements

text: I am trying to format my references to suit the journals' (Journal of Physical Chemistry B) requirements. Their LaTeX template is not correct (frustrating!) I have used the "latex makebst" command as others have suggested. I have gotten this .bst file very close to the journal's requirements via "latex makebst". However, there are a few minor details that the .bst file I created got wrong, and I am unable to redo by recompiling the .dbj file. I am trying to follow the American Chemical Society as closely as I can so I don't have to type 200 references manually. I would like to give this to the journal so they can post it to other authors so they don't have this difficulty in the future. There are a few issues I wish to correct in the .bst file:   1. There is a comma after the last author in articles.   2. Page numbers for books are omitted. How can I edit the .bst file to correct these two errors? The .bst file is 1254 lines long. Much appreciated and Merry Christmas!


title: Exam : Extras space above and below question

text: I'm trying to write exam paper using Latex, sample tex file is mentioend below:               \documentclass[a4paper,addpoints,answers,11pt]{exam}     \usepackage[T1]{fontenc}     \usepackage{multicol}     \usepackage{tikz}     \usepackage{graphicx}     \usepackage{tabularx}     \usepackage{nonfloat}     \usepackage{caption}     \usepackage{amsmath,amssymb}     \usepackage{lmodern}     \usepackage{textcomp}     \usepackage{ifpdf}     \usepackage[export]{adjustbox}     \usepackage{wallpaper}     \renewcommand{\choiceshook}{%     \settowidth{\leftmargin}{W.\hskip\labelsep\hskip 0em}     }     \TileWallPaper{\paperwidth}{1\paperheight}{dummy}     \newenvironment{Figure}       {\par\medskip\noindent\minipage{\linewidth}}       {\endminipage\medskip\par}     \newcommand*\circled[1]{%       \tikz[baseline=(char.base)]         \node[           shape=circle,           fill,           inner sep=1.5pt,           text=white,           minimum size=1.5em         ] (char) {#1};     }     \renewcommand{\questionlabel}{\circled{\thequestion}}     \begin{document}     \begin{questions}     \question How did he solve the problem?     \begin{multicols}{2} \begin{choices}     \choice He searched for food.     \choice He ate a carrot from the nearby farm.     \choice He ate a carrot from the snowman's nose.     \choice He ran away.     \end{choices} \end{multicols}     \question Which pair has rhyming words?     \begin{multicols}{2} \begin{choices}     \choice lunch, nibble     \choice little, chubby     \choice suppose, stick     \choice man, ran     \end{choices} \end{multicols}     \question Which of these is a noun?     \begin{multicols}{2} \begin{choices}     \choice hungry     \choice nibble     \choice bunny     \choice grabbed     \end{choices} \end{multicols}     \end{questions}     \end{document}      It's output is mentioned below: ![enter image description here](http://i.stack.imgur.com/Lkc4q.png) There is extra space coming above & below question (highlighted in orange box in the image) can you please suggest how to (1) reduce space above the question (2) reduce space below the question ?


title: installing mtpro2 latex font on server based TeXLive 2013 distribution?

text: I am trying to get the `mtpro2` latex fonts installed on our linux server, which hosts `TexLive 2013`. From the client machines the users can then call the respective compilation commands however needed. I cannot seem to figure out how to get the fonts installed though. Wouldn't they be installed locally only? Do they need to be available on the server and client machines? Has anyone tried to accomplish this?


title: What is wrong with my long table code?

text: I got the code for the table from excel2latex tool, then I noticed about I need `\longtable` package. After adding the longtable to table environment my code is giving error:               \begin{landscape}      \begin{longtable}{|l|l|l|l|l|l|l|}       \centering       \caption{Add caption}         \toprule         \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{A} \\         \midrule         \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\               &       & \multicolumn{1}{l}{} &       &       &       &  \\         \multicolumn{1}{c}{\multirow{8}[0]{*}{77 K}} &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & TS : 1 minute &       &       & TS : 1 minute \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       &       &  \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{Adsorption} & P: 28 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       &       & TS : 30 minute \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       &       &  \\         \multicolumn{1}{c}{\multirow{12}[0]{*}{87 K}} &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Adsorption} & P: 32 bar &       & \multicolumn{1}{l}{} & TS: 1 minute \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar &       & \multicolumn{1}{l}{Adsorption} & P: 28 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar &       & \multicolumn{1}{l}{} &  \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & TS: 40 minute &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{} & TS: 20 minute \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{Adsorption} & P: 28 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{} &  \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} &       &       & \multicolumn{1}{l}{} & TS: 40 minute \\               &       & \multicolumn{1}{l}{} &       &       &       &  \\         \multicolumn{1}{c}{\multirow{8}[0]{*}{97 K}} &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar &       & \multicolumn{1}{l}{Desorption} & DP: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & TS: 1 minute &       & \multicolumn{1}{l}{} & TS: 1 minute \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar &       &       &  \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar &       &       &  \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar &       &       &  \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & TS: 13 minute &       &       &  \\               &       & \multicolumn{1}{l}{} &       &       &       &  \\         \multicolumn{1}{c}{\multirow{4}[0]{*}{112 K}} &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & $\Delta$P: 8 bar -> 10 > $\mathrm{P_{eq}}$ > 25 bar &       & \multicolumn{1}{l}{} & DP: 8 bar -> 10 > Peq > 25 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & TS: 1 minute &       & \multicolumn{1}{l}{} & TS: 1 minute \\               &       & \multicolumn{1}{l}{} &       &       &       &  \\         \multicolumn{1}{c}{\multirow{4}[0]{*}{127 K}} &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{} & TS: 1 minute &       & \multicolumn{1}{l}{} & TS: 1 minute \\               &       & \multicolumn{1}{l}{} &       &       &       &  \\         \multicolumn{1}{c}{\multirow{2}[0]{*}{RT}} &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 6 bar -> 0 > $\mathrm{P_{eq}}$ > 25 bar &       & \multicolumn{1}{l}{Adsorption} & $\Delta$P: 4 bar -> 0 > $\mathrm{P_{eq}}$ > 25 bar \\         \multicolumn{1}{c}{} &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar &       & \multicolumn{1}{l}{Desorption} & $\Delta$P: 10 bar \\               &       &       & Ts: 120 minutes &       &       & Ts: 120 minutes \\         \bottomrule       \label{tab:meacon}%     \end{longtable}%     \end{landscape}      The error that I get after trying to compile the code;               > LaTeX Warning: Reference `tab:meacon' on page 58 undefined on input     > line 178.     >      > [58] ! Misplaced \noalign. \caption ->\noalign      >                     \bgroup \@ifnextchar [{\egroup \LT@c@ption \@firstofone ... l.184   \caption     >                 {Add caption} ?      >      > Process has been terminated ...      What can I do to create such a table ?


title: How to control the vertical distance between the descender and the ascender?

text: I want a text to be 0.5 cm tall, that is, the vertical distance between the descender and the ascender should be exactly 0.5 cm. How can I achieve that? **Edit:** The locations of the ascender, meanline, baseline and descender should be independent of whether the text contains any letter that stretches above the meanline or below the baseline. For example, if the three pieces of text "crane", "aardvark" and "ape" are written separately but on the same row, with no space in between, it should give the same result as if the text "craneaardvarkape" had been written.


title: Poisson disc sampling implemented in luatex

text: In this answer by @Jake to the question Filling specified area by random dots in TikZ I learned about the poisson disc sampling technique to generate nice looking random patterns. Jake's answer provided a link to a page where the algorithm is described in detail, and some implementations (in Java, Python and Ruby) are provided. Of course this immediately sparked my urge to do a lualatex implementation which will allow to generate this kind of patterns from tikz. So I did it. So this is not a real question, since I have the answer (which I will post in short), but I needed to share it :-) But I don't want to miss the opportunity to ask about nice applications for this technique in tikz. In my answer I'll focus on pattern generation, but perhaps someone more imaginative than me can think of more awesome showcases (for example, tag cloud generation?)


title: Put a text on the left top corner of a tabular

text: I have several `tabular` as follows in my article. To save some space, I don't want `Step 2` to occupy a whole line, maybe just putting it on the left top corner of the `tabular` is a good idea... Does anyone know how to realize it?               \documentclass[runningheads,orivec]{llncs}     \usepackage{calc}% http://ctan.org/pkg/calc     \usepackage{mathtools}     \usepackage{array}     \newcolumntype{C}[1]{>{\centering\arraybackslash$}p{#1}<{$}}     \begin{document}     \noindent Step 2:     \begin{center}       \begin{tabular}{lllll}         &$\begin{array}{C{\widthof{$0$}}|*{3}{C{\widthof{$-2$}}}}           & i &  0\\ \hline           i & 0 & 0 \\           0 & 0 & 0\\          \end{array}$ \quad         &$\left(\begin{array}{C{\widthof{$0$}}|*{2}{C{\widthof{$-7$}}}|*{2}{C{\widthof{$-7$}}}}             & x & \multicolumn{1}{c}{y} & i & 0 \\ \hline             x & 0 & \multicolumn{1}{c}{} & 0 & 0 \\             y & & \multicolumn{1}{c}{0} &  &  \\ \cline{4-5}             i & 0 & & 0 &0\\              0 & 0 &  & 0 & 0           \end{array}\quad,\text{int}\right)$ \quad \quad         &$\begin{array}{C{\widthof{$0$}}|*{3}{C{\widthof{$-2$}}}}           & i &  0\\ \hline           i & 0 & 0 \\           0 & 0 & 0 \\          \end{array}$ \quad         &$\left(\begin{array}{C{\widthof{$0$}}|*{2}{C{\widthof{$-7$}}}|*{2}{C{\widthof{$-7$}}}}             & x & \multicolumn{1}{c}{y} & i & 0 \\ \hline             x & 0 & \multicolumn{1}{c}{} & 0 & 0 \\             y & & \multicolumn{1}{c}{0} &  &  \\ \cline{4-5}             i & 0 & & 0 &0\\              0 & 0 &  & 0 & 0           \end{array}\quad ,\text{int}\right)$       \end{tabular}     \end{center}     \end{document}


title: How do you make a grid of vertices with design based on their degree?

text: I'm working on a graph theory problem, and need to map out a grid of nodes/vertices that denote their degree, and illustrates their paths. The graph I need is basically a 7 x 7 grid, that shows the amount of moves a knight on a chessboard would have if they occupied a location. I would like the color to darken as the degree increases. The grid I need is identical to the blue 7 by 7 image in the third answer on this page, or shown below. ![7x7 map](http://i.stack.imgur.com/V6qHc.png) I've tried modifying a bunch of examples I've found online, but I cannot create something quite like this.


title: Recursive drawing, command flow

text: I am trying to recursively draw Ck x Ck, where Ck is the k-th iteration of a Cantor set. I have a command which recursively calls itself four times. If I pass `N` as parameter `#6`, the output should be 4`N` little squares. But it only works for `N` = 1, 2. If I do anything higher, I only get 4 squares, spaced out in the four corners. They are the right size, but there aren't enough of them. Apparently, the problem has something do with `\pgfmathtruncatemacro\C{#6 - 1}`. As a test I inserted `\draw (0,0) circle (#6);` right before this line, and then right after this line, and the output was NOT always the same. It seems that `\pgfmathtruncatemacro\C{#6 - 1}` somehow changes the value of `#6` (in the SAME level of recursion), but I don't see why.               \usepackage{tikz, pgf, ifthen}          \newcommand\cantorsquare[6]{ %x y x y coordinates, dissection coordinates, nesting     %the coordinates are listed in the same order as coordinates for a rectangle         \ifthenelse{#6 = 0} %base case         {             \fill (#1, #2) rectangle (#3, #4);         }         {             {                 %find the coordinates for the first smaller square                 \pgfmathsetmacro\A{#1 + (1 - #5) * (#3 - #1) / 2}                 \pgfmathsetmacro\B{#2 + (1 - #5) * (#4 - #2) / 2}                 \pgfmathtruncatemacro\C{#6 - 1}                 \cantorsquare{#1}{#2}{\A}{\B}{#5}{\C}             }             {                 \pgfmathsetmacro\A{#1 + (1 - #5) * (#3 - #1) / 2}                 \pgfmathsetmacro\B{#4 - (1 - #5) * (#4 - #2) / 2}                 \pgfmathtruncatemacro\C{#6 - 1}                 \cantorsquare{#1}{\B}{\A}{#4}{#5}{\C}             }             {                 \pgfmathsetmacro\A{#3 - (1 - #5) * (#3 - #1) / 2}                 \pgfmathsetmacro\B{#2 + (1 - #5) * (#4 - #2) / 2}                 \pgfmathtruncatemacro\C{#6 - 1}                 \cantorsquare{\A}{#2}{#3}{\B}{#5}{\C}             }             {                 \pgfmathsetmacro\A{#3 - (1 - #5) * (#3 - #1) / 2}                 \pgfmathsetmacro\B{#4 - (1 - #5) * (#4 - #2) / 2}                 \pgfmathtruncatemacro\C{#6 - 1}                 \cantorsquare{\A}{\B}{#3}{#4}{#5}{\C}             }         }     }          \begin{document}         \begin{tikzpicture} \cantorsquare{0}{0}{5}{5}{0.3}{3} \end{tikzpicture}     \end{document}


title: Insert a full page image

text: How can I insert a full page image? No blanck space left in the page. Extra bonus: how to add some text over the image.


title: apacite: how to suppress url if doi is avalable?

text: I am using apacite package for my BibTex file, but according to my writing style, it's not required for `url` to be listed in the bibliography if `doi` is available. Is there any way I can forced apacite to suppress `url` in bibliography and display only the `doi`?


title: Finding unresolved references

text: How do I find unresolved references? Does LaTeX tell me this somewhere? Is it in a log file? The LaTeX output just says I have unresolved references, but it doesn't tell me what they are, or does it? thanks


title: Trouble placing images side by side in beamer

text: I need to place a couple of images side by side (horizontally) in a presentation I'm doing with `beamer`, so I looked around and inserted the following code (sugested by this post):               \documentclass{beamer}     \usepackage[demo]{graphicx}     \usepackage{caption}     \usepackage{subcaption}          \begin{document}          \begin{frame}          \begin{figure}     \centering          \begin{minipage}{.5\textwidth}     \centering     \includegraphics[width=.4\linewidth]{image1}     \caption{A subfigure}     \end{minipage}     \begin{minipage}{.5\textwidth}     \centering     \includegraphics[width=.4\linewidth]{image2}     \caption{A subfigure}     \end{minipage}          \caption{A figure with two subfigures}     \end{figure}          \end{frame}          \end{document}      But the images appear one over the other (vertically). I tried both approaches suggested in the aforementioned post but I get the same result. What can I be doing wrong and how can I fix it?


title: Trouble with Japanese characters

text: > **Possible Duplicate:**   >  miktex can't find udmj.cfg I've tried to write japanese characters in LaTeX, but it generates errors, this is what I've done (realy, this is from this from this link How to write Japanese with LaTeX?)               \documentclass{memoir}          \usepackage{CJKutf8}          \begin{document}          \begin{CJK}{UTF8}{min}未練なく散も桜はさくら哉\end{CJK} \\     without regret \\     they fall and scatter\ldots \\     cherry blossoms          \end{document}      this is the output:               ! Font C70/min/m/n/10/67=udmj67 at 10.0pt not loadable: Metric (TFM) file not f     ound.     <to be read again>     relax     l.7 \begin{CJK}{UTF8}{min}æœª     ç·´ãªãæ•£ã‚‚æ¡œã¯ã•ãã‚‰å“‰\end{CJK} \\     I wasn't able to read the size data for this font,     so I will ignore the font specification.     [Wizards can fix TFM files using TFtoPL/PLtoTF.]     You might try inserting a different font spec;     e.g., type `I\font<same font id>=<substitute font name>'.     ! pdfTeX error (font): invalid font identifier.     \font@name ->\C70/min/m/n/10/67     l.7 \begin{CJK}{UTF8}{min}æœª     ç·´ãªãæ•£ã‚‚æ¡œã¯ã•ãã‚‰å“‰\end{CJK} \\     Here is how much of TeX's memory you used:     5126 strings out of 494053     64712 string characters out of 3146185     143067 words of memory out of 3000000     8399 multiletter control sequences out of 15000+200000     4238 words of font info for 16 fonts, out of 3000000 for 9000     715 hyphenation exceptions out of 8191     34i,1n,21p,189b,859s stack positions out of 5000i,500n,10000p,200000b,50000s     ! ==> Fatal error occurred, no output PDF file produced!


title: Beamer: Synchronize overlays for itemized list items in presentation slide and notes slide

text: I am making a presentation using `Beamer` and I would like for most of my slides to have an `itemize` list on the presentation slide that is uncovered using the `<+->` style. On the associated notes slide, I would like pretty much the same list, just more wordy, and uncovered in a synchronized fashion. I tried to do this using the code below, but for some reason the first two notes appear at the same time (i.e. with the first presentation item), then when I get to the last presentation item, all items on the notes slide disappear.               \documentclass[]{beamer}     \usepackage{pgfpages}     \setbeameroption{show notes on second screen=left}     \beamerdefaultoverlayspecification{<+->}          \begin{document}          \begin{frame}{Naive HDR Combination}          \begin{itemize}             \item My first point                     \note[item]{A note about my first point}             \item My second point                     \note[item]{A note about my second point}             \item My third point                     \note[item]{A note about my third point}     \end{itemize}          \end{frame}          \end{document}      Is there a way to get this working? I realize I can manually set slide numbers for each `\note`, e.g. `\note[item]<2->`, but a) that's irritating and b) if I later decide to add a new item mid-list, I have to renumber all following notes. Thanks.


title: one-column figure in a two-column document goes to a next page

text: In a two-column document, I use the `figure*` environment to place a wide equation in a one-column format. It works fine, but the equation floats to the next page. What can I do to avoid this?


title: LaTeX Error: \begin{eqnarray} on input line 186 ended by \end{document}?

text: With this set up (let me know if I've missed something out)                   \documentclass[11pt, a4paper, oneside]{Thesis}          \graphicspath{{Pictures/}}          \usepackage{amsmath}         \usepackage[square, numbers, comma, sort&compress]{natbib}          \hypersetup{urlcolor=black, colorlinks=true}         \title{\ttitle}      I get the following error               LaTeX Error: \begin{eqnarray} on input line 186 ended by \end{document}.      This is the equation beginning at line 186                   \begin{eqnarray}              &\frac{\partial}{\partial t} G ~=~              \frac{(2\pi\hbar)^6}{\hbar}             \displaystyle\sum_{c}              \int\limits\nolimits_{ }              \frac{d\textbf{p}}{(2\pi\hbar)^3}             \frac{d\textbf{P}}{(2\pi\hbar)^3}             \frac{d\bar{\textbf{p}}}{(2\pi\hbar)^3}             \frac{d\bar{\textbf{P}}}{(2\pi\hbar)^3}             G\left(\frac{m_{bc}}{m_c}\textbf{P}+\textbf{p}\right)\nonumber \\             & |\langle\textbf{p}|T_{bc}^{R}|             \bar{\textbf{p}}\rangle|^2             \delta\left(\textbf{P}-\bar{\textbf{P}}\right)             \times2\pi\delta\left(E_{bc} - \bar{E}_{bc}\right)\nonumber \\             & \times\bigg\{\delta\left(\frac{m_{bc}}{m_c}\bar{\textbf{P}}+             \bar{\textbf{p}} -              \textbf{p}_b\right)             f_c\left(\frac{m_{bc}}{m_b}\bar{\textbf{P}}\bar{\textbf{p}}\right)\nonumber \\             &-\delta\left( \frac{m_{bc} {m_c}\textbf{P}+\textbf{p}-\textbf{p}_b\right)             f_c\left(\frac{m_{bc}}{m_b}\textbf{P}+\textbf{p}\right)\bigg\}            \end{eqnarray}      Can anyone tell me what's going on? This section of code is in a separate `.tex` file labelled 'Chapter2', which is then inputted into the main `.tex` file, if that bears any relation to the problem.


title: How to use \left and \right inside text environment

text: I would like to know how to use the `\left` and `\right` options in the text environment. This is what I am trying to do: `\left( when factorizing $e^{-2000t}$\right)` As you can see, I am trying to make the parenthesis to be as big as what is inside (That was just an example, it could be something bigger). Thanks in advantage for helping.


title: Lower-case roman numerals in enumerate with Spanish babel

text: I want to use lower-case roman numerals in a list, and I used:               %Redefine the first level     \renewcommand{\theenumi}{\Roman{enumi})}     \renewcommand{\labelenumi}{\theenumi}          %Redefine the second level     \renewcommand{\theenumii}{\roman{enumii})}     \renewcommand{\labelenumii}{\theenumii}      But I get upper-case roman numerals for both the first and the second level (I actually get smaller roman numerals for the second level). Is there a way to use lower-case roman numerals? Here is an example of the code I used:               \documentclass[letterpaper]{article}          \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}     \usepackage{parskip}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{mathtools}     \usepackage{amssymb}     \usepackage{fullpage}     \usepackage{graphicx}     \DeclareMathOperator{\lcm}{lcm}          \newtheorem{mydef}{Definición}     \newtheorem{theorem}{Teorema}     \newtheorem{lemma}{Lema}     \newtheorem{proposition}[theorem]{Proposición}     \newtheorem{corollary}[theorem]{Corolario}     \newtheorem{remark}{Nota}          %opening     \title{Tarea I}     \author{Pedro         \and Mateo}     \date{11 de Diciembre de 2013}          \begin{document}          \maketitle          %Redefine the first level     \renewcommand{\theenumi}{\Roman{enumi})}     \renewcommand{\labelenumi}{\theenumi}          %Redefine the second level     \renewcommand{\theenumii}{\roman{enumii})}     \renewcommand{\labelenumii}{\theenumii}          \begin{enumerate}         \item \         \begin{enumerate}             \item Muestre que $\mathbb{Q}(\sqrt[3]{2})$ no tiene automorfismos no triviales.             \begin{proof}                 Dada la extensión de campos $\mathbb{Q} \subset \mathbb{Q}(\sqrt[3]{2}$             \end{proof}              \end{enumerate}     \end{enumerate}               \end{document}


title: ragged right justification in cls template

text: I'm using a latex template to format my dissertation. The template has been provided as a .cls file and accompanying tex file. One of the requirements is that the table of contents, list of figures and list of tables not be full- left justified, but rather just left justified (ragged right). I'm still relatively new to latex, but I can usually figure out how to troubleshoot issues. But I really don't know how to work with a .cls file. I would really appreciate it if someone could take a look at the .cls file, and give me advice on how to modify it to remove the full-left justification found in the table of contents, list of tables and list of figures. You can download here a simplified version of my dissertation that shows the issue. You have to execute the "PTitle_thesis.tex" file more than once to get the content to fully appear. Thanks! I really appreciate any help anyone can provide!


title: Centering and \MakeUppercase with linebreaks

text: I wish to make the list of authors show up as centered, uppercase and listed vertically on my titlepage. My documentclass contains a section like this               \begin{center}     ...     \renewcommand{\and}{\\}\MakeUppercase{\@author}     ...     \end{center}      but this particular combination or linebreaks, MakeUppercase and centering causes an error; `\@icentercr doesn't match its definition` A minimal example would be               \documentclass{article}     \newcommand{\mytext}{Foo \\ Bar}     \begin{document}     \begin{center}      \MakeUppercase{\mytext}     \end{center}     \end{document}


title: Text crossing the page margin in math environment

text: I have some long text (a single sentence) which I want to put inside a math environment. But my text just goes accros the page margin and ignores the textwidth specification given in the preamble. Here is a toy example:               \documentclass[12pt]{article}          \setlength{\textwidth}{500pt}     \setlength{\parindent}{0pt}     \setlength{\textheight}{8in}     \usepackage{latexsym,amssymb}     \usepackage{amsmath,array}     \usepackage[margin=1in,headsep=2.5cm]{geometry}          \begin{document}          \begin{math}     2+1=3\\     2+2=4\\      {\text{This is some very very very very very very very very very very very      very very very very very very very very long text in math environment.}}      \end{math}          \end{document}      Obviously I could just break the line manually but there should be some better way of Latex doing that automatically?


title: Two tables vertically align

text: i have two tables, each of them has 4 columns. one is just below the other. i want to know how to make every column of the below table have same width of the column of the above table. it looks like this:               |-------|-------|-------|-------|     |       |       |       |       |     |-------|-------|-------|-------|     |       |       |       |       |     |-------|-------|-------|-------|     |       |       |       |       |     |-------|-------|-------|-------|      some space lines are here.               |-------|-------|-------|-------|     |       |       |       |       |     |-------|-------|-------|-------|     |       |       |       |       |     |-------|-------|-------|-------|      adding one more `hline` will make one table `septable`, which it looks like two tables with good vertical alignment.               \documentclass{article}          \begin{document}     \begin{tabular}[b]{|c|c|c|c|}     \hline     \textbf{Item-No.} & \textbf{name} & \textbf{cross section} & \textbf{grade}\\     \hline     \textbf{W1} & Z-column & HN350x175 -- 346x174 & Q235\\     \hline     \textbf{W17} & Horiz. support transversal hoist beam & HW100x100 & Q235\\     \hline     \hline     \textbf{P11} & longitudinal hoist beam & HN300x150 -- 300x150 & Q235\\     \hline     \end{tabular}          \end{document}      but one more thing, how to add `vertical spacing` between the tables?


title: How to control spaces between objects?

text: I have a problem with controlling spaces between different object and environment. In my MWE you can see I use `quote` and `\footnote` on the one page. Unfortunatelly when I use them lines on adjoining pages (on even and odd pages) don't harmonize (as you can see). I try to set spaces between text and quotations by using `\vspace`s but it doesn't want to work always. Sometimes it's ok, but sometimes last line goes to the next page. I try to make (I think I try) the space between text and footer more flexible, but it doesn't work as I want. Do you know what is the best way to control it? I don't want to use `\raggedbottom`, because I want my columns to be equal. Thank you for any help. PS. Do you know if there is any package to show a grid in my document?               \documentclass{book}          \usepackage[       centering,       top=12mm,       headheight=14pt,       headsep=11pt,       includeheadfoot,       papersize={160mm,235mm},       text={125mm,190.7mm},     ]{geometry}          \setlength{\parskip}{0pt}     \setlength{\parindent}{14pt}      \setlength\floatsep{12pt plus 12pt minus 2pt}           \clubpenalty10000      \widowpenalty10000          \sloppy           \setlength{\skip\footins}{11pt plus 11pt minus 4pt}          \usepackage{footmisc}      \setlength{\footnotesep}{0pt}           \frenchspacing          \usepackage{lipsum}          %-----------------------------------------------------------------------------          \begin{document}          \fontsize{11}{14}\selectfont          \lipsum          \begin{quote}     \small Some text Some text Some text Some text Some text Some text Some text Some text Some text      \end{quote}          \lipsum[1]\footnote{Some text Some text Some text Some text Some text Some  text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text }          \begin{quote}     \small Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text      \end{quote}          \lipsum[1-3]          \end{document}


title: Inserting blog like tags in latex

text: I want to do tags like the ones used in blogs (like the tags in the picture shown below). Any ideas how I can do them ? ![enter image description here](http://i.stack.imgur.com/AOFxG.jpg)


title: Need help to use "exceltex" to import data from Excel to LaTeX

text: I use LaTeX to create a book which will automatically add a data from Excel to LaTeX when I "quickbuild" it; I tried with package `exceltex` to do it. I already install `Spreadsheet-ParseExcel-0.59` with Cpan and perl, but I don't know how to run `exceltex`. I open file `install` from `exceltex` and it said I need to copy `exceltex` to "somewhere in your PATH for example `$HOME/bin` or `/usr/local/bin`". I'm using window 7 and I don't know where is `$home` or `usr`. So when I type in Command Prompt `perl exceltex`, it shows: > Usage: exceltex [options] file[.tex]' I don't know how to use with these command. Please help me, I need to know how to use `exceltex` package to finish my book.


title: When should I use \input vs. \include?

text: There are two different commands to incorporate another file into the source of some document, `\input` and `\include`. When should I use one or the other? What are the differences between them? Are there more things like them to be aware of?


title: Package acronym: unwanted pagebreak in front of the list of acronyms

text: When useing the `acronym` package to create a list of the used acronyms like this:               \renewcommand{\listofacronymsname}{List of acronyms and abbreviations}      \listofacronyms          \begin{acronym}     \include{acronym_sorted}     \end{acronym}      With the following code in the style file:               \@ifundefined{listofacronymsname}{\newcommand{\listofacronymsname}{Acronyms}}{}     \@ifundefined{chapter}{%     \newcommand{\listofacronyms}{%     \section*{\listofacronymsname}%     \addcontentsline{toc}{section}{\listofacronymsname}%     \label{sec:acronyms}%     \markboth{\listofacronymsname}{\listofacronymsname}%     }}{%     \newcommand{\listofacronyms}{%     \chapter*{\listofacronymsname}%     \addcontentsline{toc}{chapter}{\listofacronymsname}%     \label{sec:acronyms}%     \markboth{\listofacronymsname}{\listofacronymsname}%     }}      It produces a pagebreak right after the chapter title "List of acronyms and abbreviations" and then produces the list of acronyms (a bit longer than one page and growing) starting on a new page. So there is a page just containing the chapter title and nothing else. How can I force `acronym` to start with the list of acronyms right after the chapter title?


title: include tex tables on the same page

text: I want to include a table from another tex file before another table but this pushes the to another page. Do you have any solution to sidestep the problem? Here is the code               \documentclass[english]{article}     \usepackage{babel}     \usepackage{graphicx}     \usepackage{margin= 1.5 cm}[geometry]          \begin{document}     \include{DS}          \begin{table}[!htpb]     \centering     \begin{tabular}{ccc}     % ...     \end{tabular}     \end{table}          \end{document}      I tried scalebox to resize the second table but it didn't solve the problem.


title: Why does amsrefs do a pagebreak after the header?

text: I am using the document class amsbook and generate the amsrefs bibliography by               \begin{bibdiv}       \begin{biblist}         \include{bibcode}       \end{biblist}     \end{bibdiv}         Now, there is a page that _only_ says **Bibliography** , and the first actual reference appears on the next page. I have no idea how this problem occurs. Can anyone help out?


title: Divide PSTricks script into external files

text: I have a PSTricks picture shown here, where I have tried to move a part of it into a different ´TeX´-file for clarity (not, this is **not** a MWE)               \documentclass[pstricks,border=12pt]{standalone}% set border=0pt at the final stage     \usepackage{pst-node}     \psset     {         dimen=middle,         offset=.2,         arrows=|*-|*,         unit=2cm,% set it to 100cm if you want 1 scale = 100cm = 1m     }          \begin{document}     \begin{pspicture}[showgrid=false](5,1.25)% set showgrid=false at the final stage          \include{ext}     \end{pspicture}     \end{document}      with `ext.tex`               \psframe(1,1)     \psframe(1,.25)(4,.75)     \pscircle(4.5,.5){.5}      Why am I not allowed to do this?


title: How to split a page in six equally sized sectors?

text: I'd like to split an A4 page into six equally sized sectors. I want that page to be in landscape. Each sector has a body of text and a caption. I don't really have an idea where to start. I know I can split a page in to columns, but I need like six minipages, all equally arranged on one paper. The only idea I could come up with, is to use `a0poster` and then size it down for print. I think however, this is overkill; isn't there a better way to do that? I'm preferably using XeLaTeX, if that is of any importance.


title: \bottomrule not working in tabular environment with minipage inside

text: When I use this code: \toprule works well. \bottomrule appear on the bottom but this error occurs: misplaced \noalign \bottomrule. You know why? Thank you!               \begin{quadro}     \caption{Experiência com ensino de italiano - grupos 1 e 2}     \label{quad:experiencia_com_ensino_de_italiano_grupos1_e2}      \begin{tabular}{c}      \toprule      \begin{minipage}{.5\textwidth}       \renewcommand{\bcfontstyle}{} %muda a fonte do gráfico - bchart - para o padrão do documento.           \begin{bchart}[step=50, max=100, unit=\%, scale=0.4]               \bcxlabel{Grupo 1}               \bcbar[label=Sim]{76}                   \medskip               \bcbar[label=Não]{24}         \end{bchart}     \end{minipage}      \begin{minipage}{.5\textwidth}        \renewcommand{\bcfontstyle}{} %muda a fonte do gráfico - bchart - para o padrão do documento.         \begin{bchart}[step=50,max=100, unit=\%, scale=0.4]        \bcxlabel{Grupo2}               \bcbar[label=Sim]{91}                   \medskip               \bcbar[label=Não]{9}      \end{bchart}      \end{minipage}      \bottomrule      \end{tabular}      \end{quadro}


title: Is the Windows logo available?

text: I'm surprised I don't see this addressed quickly with a Google search, but I don't see it there or on this site. Does anyone know of a Windows logo symbol in LaTeX? I used Dextify, but couldn't find it there. I would think this has been asked many times, alas. I might as well let you know the reason, too. I'm writing instructions for a procedure for Windows, and it includes help with a shortcut (Windows Key + Escape key) that I would like to illustrate to make it foolproof. Thanks in advance for your help!


title: Good way to make \textcircled numbers?

text: I'm trying to make some good-looking numbers in a circle, using the simple command:               \textcircled{1}      However, the circle is misaligned vertically with the number, and look a bit sloppy: ![alt text](http://i.stack.imgur.com/V5KtM.png) Any suggestions how can I adjust the vertical alignment so that the numbers look more centered w.r.t to the circles? Or, if that's not an option, what other ways to achieve the same results are possible? I will use those only for numbers, and in very few places, so manual adjustment per glyph is an option. I'm using `pdfLaTeX` with Computer Modern, if that matters.


title: I would like to do this (1) in big size ? is it possible?

text: I would like to do this `(1)` in big size using latex (a one surrounded by a circle) ![enter image description here](http://i.stack.imgur.com/4Tv6H.jpg) is it possible without including the picture ?


title: How to use a tikz image as label in enumerate?

text: Is there a way to use a TikZ image as a label of enumerate? Can I use something like the snippet below as a "styled enumeration"?               \newcommand\custlabel[1]{     \begin{tikzpicture}         \node[circle, fill=blue] (A) {#1};     \end{tikzpicture}     }


title: Tex codes for putting a character inside a circle

text: > **Possible Duplicate:**   >  Good way to make \textcircled numbers? Like that of copyright or registered symbols, how can I put a number/letter inside a circle? I would like to use that in some inline formula.


title: How to continue table on multiple pages?

text: I am writing one table which is very long may occupy 2-3 pages. I need to split this table on multiple pages but with same table header at the beginning of table. I am using long-table which allow table to continue on multiple pages. But How can i keep same header on multiple pages. Regards


title: Continue header of a long table in next page

text: > **Possible Duplicate:**   >  How to repeat top rows (column headings) on every page I have a long table that spans multiple pages. I would like the header of the table to repeat at the top of every new page that is spanned by the table. How can I achieve that?


title: How should a salary negotiation letter look like?

text: Does anyone know if there exists a template for salary negotiation? Or perhaps how one should look like?


title: Fixing JAIR style

text: According to the Eigenfactor ranking of journals, the Journal of Artificial Intelligence Research (JAIR) is a leading open-access journal in AI. Unfortunately, the JAIR style files appear to be nearly twenty years old, and breaks horribly, for instance when trying to use `hyperref`, possibly due to problems with the shipped `theapa` styles on which it appears to rely. I have spent several hours trying to understand and fix the errors, but this seems to require a higher skill level of LaTeX hacking than I have attained. To replicate the problem, add `\usepackage{hyperref}` to the preamble of the provided `sample.tex` input file, then run LaTeX, BibTeX, LaTeX; the next and final run of LaTeX (to resolve the dangling references) then fails with               ! Undefined control sequence.       \hyper@@link ->\let \Hy@reserved@a                                           \relax \@ifnextchar [{\hyper@link@ }{\hyp...       l.65 ...d graph partitioning problems \cite{papad}                                                         .        at the very first place in the file where `\cite{}` is used. Note that if `hyperref` is _not_ used, then these errors go away; packages like `url` or `tikz` work fine. If the bibliography commands are removed, then the error also goes away. A similar error occurs when changing `\bibliographystyle{theapa}` to standard bibliography styles, such as `short`:               ! Use of \@year@ doesn't match its definition.     \Y@papad ->\@year@ J                         PY     l.65 ...d graph partitioning problems \cite{papad}                                                       .      Finally, if one removes the `\usepackage{theapa}` from the document preamble, then the problem goes away (except that `\shortcite{}` and other `theapa` macros are now undefined). I have even tried to use a different version of `theapa.sty` from the custom one that is shipped with `jair.sty` but this seems to give the same problems. Does anyone have ideas about what to change in the `jair.sty` style file to avoid this problem? If we can track down the issue then I would be happy to work on a patch to submit to JAIR. It would be nice to help this volunteer-run journal to support bibliographies with internal links and hyperlinks to articles in the bibliography, as publishers like Elsevier already do.


title: Are \count1, ..., \count9 useful?

text: To quote _TeX by Topic_ , "whenever a `\shipout` occurs, TeX also writes the values of counters 0-9 to the dvi file and the terminal." Do any dvi viewers or converters (e.g., dvips) make use of `\count1`, `\count2`, …, `\count9`? Do any TeX formats or LaTeX packages set them? Does pdfTeX (when outputting pdfs) use them?


title: bibentry does not work with apacite

text: Have you managed to use `bibentry` with `apacite`? `bibentry` should work with `apacite` according to the manual of `apacite`, though I can not make it work. And I can not find `bibentry` manual on CTAN. I have found only this file. `bibentry` is a part of `natbib`, but there is nothing mentioned about `bibentry` in the manual of `natbib`. `bibentry` works with `natbib` nicely, but I would prefer to use `apacite` rather `natbib`, because `apacite` makes better formatting of bibliography according to the APA style. I am adding example at the end of the question. The error I am getting is:               ! Paragraph ended before \citeauthoryear was complete.      P.S. I would like to use `biblatex` with `fulecite` command, but unfortunately `biblatex` does not support `polyglossia` which I have to use instead of `babel`.               \begin{filecontents}{mytestbib.bib}     @BOOK{Cochran1977,       author = {William Gemmell Cochran},       title = {Sampling Techniques},       year = {1977},       publisher = {John Wiley \& Sons},       address = {New-York},     }     \end{filecontents}          \documentclass{article}     \usepackage{filecontents}          \usepackage[natbibapa]{apacite}     \bibliographystyle{apacite}          % \usepackage{natbib}     % \bibliographystyle{apalike}          \usepackage{bibentry}     \nobibliography*          \begin{document}          This is full citation of \bibentry{Cochran1977}          A regular citation of \citet{Cochran1977}.          \bibliography{mytestbib}          \end{document}


title: Let the width of a cell be set by a picture

text: I wish to have a table with two rows - first one with a picture, and the second is some text (I know I can probably do it within the `figure` environment, but I want to do it on my own). I want the text to be split whenever necessary, so I use `\begin{tabular}{p{width}}`. However, I decided that I want to firstly set the height of the picture, and then let the width of the scaled picture determine the width of the text cell. How can I do it?


title: Subsection numbering lost

text: I'm using the memoir class and I have put the following lines of code in the preamble:               \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}      So far, everything's worked just fine. But for unknown reasons, LaTeX has suddenly stopped numbering subsections in both the table of contents and the text. Has anyone had the same or a similar problem before and might be able to help me out?


title: Determining which references have not been cited

text: > **Possible Duplicate:**   >  Unused bibliography entries - how to check which entries where not used? I have a very large `references.bib`. Throughout my document, I have used `\cite{}` to cite many of them. Now I would like to know if I missed any - that is, if there is a references in the `.bib` file that has not been called using `\cite{}`. Is this possible?


title: Does there exist a quick hack to see which bibtex sources I've used?

text: I have 42 sources in my bibtex (.bib file) but only 31 in my bibiliography. Is there a quick hack to find which ones I still need to write about? Thanks


title: side by side figures wider than margins

text: I'm trying to do exactly what's explained here: Figure with two side-by-side subfigures that is wider than textwidth However, I'm working with a large document and already have many subfigures using `\usepackage[hang]{subfigure}`. If I change to the `subcaption` package, I would have to change all my other figures and that's too much work. How do I use the `lipsum` package and `\makebox` command in conjunction with the `subfigure` package?


title: Fix tables at a given PAGE so that Table is not moving down when adding texts above it?

text: I have looked over all the possible duplicate questions this whole day, and I still can not find an explicit solution to my problem. I'm thinking to fix my table, wrote in `tabular`, at a given PAGE. I looked through all the instructions finding nothing about this. All I got from them is to float the table or figure by using either `float` or `placeins` pakages. I did that, and I can put my table separate from the texts, but I got a problem: I want to type some texts just before my table, as I'm typing, say over one page, the table just underneath the texts is moving down to a new page, for instance, before typing in the texts, page number of this table is page 3, after texts, it might go to page 5. I don't want to see this. What I want is keep this table at a particular page, say page 3, and no matter how many texts i would add before this table it always stays at page 3, which means that if the volume of my texts is bigger than two pages, the text will automatically jump to page 4 instead of starting occupy page 3 and pushing down the table to the next page. The reason I want to do this is that sometimes I have to go back to my text and adding or deleting some words. I would end up the page just above the table or figure is filled with only a few sentences, leaving the entire space empty, and because at the same time the table is already rotated to `sidewaytable` due to its size, the table has to take a separate page and can not fill in the page even only with a few sentences. To summarize, I'd like to fix my table at a given page, not simply floating it on a random page changing according to the text above it.


title: How to make an inline pgfplot

text: I have the following code to graph a function with a height of 2em, and in line with some text, but it gives an error.               \documentclass{article}     \usepackage{pgfplots}          \newcommand\quadratic{       \begin{tikzpicture}         \begin{axis}[axis lines=none,height=2em]           \addplot[mark=none]{x^2};         \end{axis}       \end{tikzpicture}}          \begin{document}     This image \quadratic is a quadratic.     \end{document}      * * *               Package pgfplots Error: Error: Plot width `23.1882pt' is too small.     This cannot be implemented while maintaining constant size for labels.     Sorry, label sizes are only approximate. You will need to adjust your width.      Which is kinda silly considering I've removed the labels. I want an output like so: ![expected result](http://i.stack.imgur.com/UQyQ4.png)


title: rotate table (90 degrees) and stretch to fill whole page

text: i'd like to rotate a table (90 degrees) and stretch it to fill whole page. That's what i've got so far:               \documentclass{book}          \usepackage{tabularx}     \usepackage{adjustbox}          \begin{document}          \pagestyle{empty}          \begin{adjustbox}{angle=90}       \begin{tabularx}{\textheight}{|X|X|X|X|X|X|X|X|X|X|X|X|}           1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\             \hline             1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12        \end{tabularx}     \end{adjustbox}          \end{document}      I don't know how to stretch the height of the table therewith it fills the page (horizontally). Is there any possibility to reduce the size of the font automatically if one text is wider than its cell? edit: I probably didn't express myself very well. The table should look like this: http://i62.tinypic.com/mjy6w6.jpg


title: Transitions in Petri nets

text: I have to crate a petri net for an homework assignment in university. In Tikz manual, I found a very useful tutorial on creating petri nets using Tikz/PGF. However, the example uses a different style for transitions, different from the one my professor prefers. He uses a style similar to the one on Wikipedia: ![http://upload.wikimedia.org/wikipedia/commons/6/6a/Petri_Net_A.jpg](http://i.stack.imgur.com/VQvuA.jpg) Notice that the transition (t) is represented by a small black bar. However, the example in the Tikz tutorial looks like this: ![http://i.stack.imgur.com/tA81g.png](http://i.stack.imgur.com/tA81g.png) Here, transitions are represented by rectangualar boxes. Does anybody know how I can change the style of the transitions? I reckon that this can be done quite easily but please note that I'm a novice when it comes to Tikz and that I barely understood the source code for the petri net above. Here is the source code from the Tikz guide: (I narrowed it down somewhat so it only includes the left petri net)               \documentclass{article}     \usepackage[version=0.96]{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,automata,petri}          \begin{document}          \begin{tikzpicture}[node distance=1.3cm,>=stealth',bend angle=45,auto]            \tikzstyle{place}=[circle,thick,draw=blue!75,fill=blue!20,minimum size=6mm]       \tikzstyle{transition}=[rectangle,thick,draw=black!75,                   fill=black!20,minimum size=4mm]              \node [place,tokens=1] (w1)                                    {};         \node [place] (c1) [below of=w1]                      {};         \node [place] (s)  [below of=c1,label=above:$s\le 3$] {};         \node [place] (c2) [below of=s]                       {};         \node [place,tokens=1] (w2) [below of=c2]                      {};              \node [transition] (e1) [left of=c1] {}           edge [pre,bend left]                  (w1)           edge [post,bend right]                (s)           edge [post]                           (c1);              \node [transition] (e2) [left of=c2] {}           edge [pre,bend right]                 (w2)           edge [post,bend left]                 (s)           edge [post]                           (c2);              \node [transition] (l1) [right of=c1] {}           edge [pre]                            (c1)           edge [pre,bend left]                  (s)           edge [post,bend right] node[swap] {2} (w1);              \node [transition] (l2) [right of=c2] {}           edge [pre]                            (c2)           edge [pre,bend right]                 (s)           edge [post,bend left]  node {2}       (w2);     \end{tikzpicture}          \end{document}      Thank you very much for your help!


title: How to get the number of elements in a \foreach loop?

text: Does the PGF command `\foreach` provide a simple possibility to get the number of elements iterated? It has a parameter `count` to hold the current element number, so a workaround is to iterate the list once. After execution, the last count is the number of elements in `#1`.               \foreach \letter [count=\n] in {#1} {}     % \n now keeps the number of elements.      Can this be achieved without iterating the whole list once?


title: Multiple arrays side-by-side?

text: what I've been trying to do is to pack multiple arrays on a single 'row', similar to what subfig module does with images (and tables, I guess); mostly to conserve space. Something like this: ![arrays](http://i.stack.imgur.com/2Uxjb.png) I would use tables and subfig instead of arrays, but I'm not sure how the parentheses would work.


title: Latex plotting (jagged function)

text: Hey, I have a function which I would like to plot with latex/tikz. Since I'm just a beginner I really don't know how to do it. Don't get me wrong I don't have any problems with most functions but this one is a killer and the documentation is a little bit overwhelming. ![jagged function](http://i.stack.imgur.com/DX6z0.png) It would be great if someone could help me to plot this one.


title: Undefined reference: autoref points to section instead of figure or table

text: Here is a minimum working example (an image 'test.png' needs to be in the working directory. I used this one.)               % Created 2011-05-23 Mon 15:21     \documentclass[11pt]{article}     \usepackage{graphicx}     \usepackage{hyperref}     \begin{document}          \section{figure test}     autoref test \autoref{fig:fig1}.           ref test \ref{fig:fig1}          \begin{figure}[hb]     \caption{test figure}       \label{fig:fig1}       \includegraphics[width=1in]{test.png}     \end{figure}                    \section{table test}          autoref test \autoref{tab:tab1}.           ref test \ref{tab:tab1}          \begin{table}[hb]     \caption{test table}     \label{tab:tab1}     \begin{tabular}{ l c r }       1 & 2 & 3 \\       4 & 5 & 6 \\       7 & 8 & 9 \\     \end{tabular}     \end{table}          \end{document}      This is a snapshot of the output that I get: ![enter image description here](http://i.stack.imgur.com/9Y9yX.png) ## Questions: How can I get the references to work? _Note:_ In my document, I am finding that the `\autoref{fig:figurename}` gives output as "item 1" instead of "figure 1". When making the MWE, the problems have changed, but I am still confused.


title: Watermark with LstListing

text: I'm trying to add a draftwatermark to my document, but I'm having some problems with lstlisting. Whenever I've used lstlisting (for C++ code), the background of the code section is white and overwrites (draws?) the Draft in the background. I've seen you can change the background colour of the lstlisting, but I haven't been able to find a way to set it to transparent. What would be the best way of dealing with this?


title: How can I draw a very thin row?

text: I want to draw a table like the attached with LaTeX. I'm using the `table` and `tabular` environmnet. My problem is how I can represent the line which goes from the begining to the end of the table at the bottom of the figure. My idea is draw a line with `\multicolumn{6}{|c|}{...}` but I can't obtain it, because the height is too long. Any idea? I hope I explain my problem plainly. ![enter image description here](http://i.stack.imgur.com/bPpDZ.png) If I use the solution that @egreg says I have another problem. I need colour some cells of another tables, so I use the code `\usepackage[table]{xcolor}` but it does the line shorter. The is somethin like this:               \documentclass{article}     \usepackage{amsmath,array}     \usepackage[table][hiperref]{xcolor} % Need for colour cells     \providecommand{\textsubscript}[1]{$_\textnormal{#1}$}          \begin{document}     \setlength{\extrarowheight}{2pt}     \begin{tabular}{|*6{c|}}     \multicolumn{1}{c}{1 bit}  &     \multicolumn{1}{c}{2 bits} &     \multicolumn{1}{c}{1 bit}  &     \multicolumn{1}{c}{4 bits} &     \multicolumn{1}{c}{4 bits} &     \multicolumn{1}{c}{4 bits} \\     \hline     VALIDEZ & DIVERSIFICACI\'ON &     TAMA\~NO & KDC\textsubscript{AUTH/ENC} &     KDC\textsubscript{KEK} & KDC\textsubscript{MAC} \\     \hline     \multicolumn{6}{@{}c@{}}{\vrule height 2pt depth 2pt \hrulefill \vrule     height 2pt depth 2pt} \\     \multicolumn{6}{c}{2 bytes}     \end{tabular}     \end{document}


title: \neq (not equal) command does not work anymore

text: I experience the following LaTeX-Preamble, which causes the "\neq" command to cause an error. Has anyone experienced similar things before or an idea why this might happen? Some Info:   - TeX: MikTex 2.9, 64 bit   - System: Windows 7, 64  I suppose it is some of the maths packages I load, but was not able to figure it out. I tried:   - Putting amsmath, amssymb, mathabx at the end   - not loading maths packages   - Re-Installing MikTex   - using "\ne", "\nequal" , "\not=" No luck.  This the (sorry, quite long) preamble (edited after the answer to make it shorter and more relevant):                   \documentclass[10pt,letterpaper]{article}         \usepackage{cogsci} %                   %_______________________________________________________________________________         %__MATH         %__MATH_GENERAL         \usepackage{amsmath, amssymb} %         % mathematical extensions         \usepackage[mathb]{mathabx} %           % font for maths symbols e.g. \corresponds         \usepackage{bm}             % for boldface greek letters in math


title: Speeding up LaTeX compilation

text: Usually I don't mind about LaTeX's compilation speed, because a paper of less than 20 pages is compiled rather fast. However, I am working on a large document - A report with more than 80 pages. Compilation times are starting to slow me down. I saw the couple of answers here on this topic, but most of my graphics are external and I don't use Tikz. In a matter of fact, I'm not sure what's slowing the compilation down, other than the amount of text and required layout.   1. What's your best speeding-tex-up trick, other than externalizing graphics and pre-compiling the preamble?   2. How can I know what's slowing TeX down?


title: How do I speed-up latex compile time?

text: > **Possible Duplicate:**   >  Speeding up LaTeX compilation Currently am using Miktex and TexNicCenter to create pdf files including vector(.eps) and raster(.png) images. Compile time is about 6 seconds for 10 pages of text and 10 images, which is much slower than others have reported. I can compile to dvi instead of pdf (minus the raster images) in 1 second, but need to see the layout with the raster images. Is there something that would slow down the pdf compile this much? epstopdf is used when compiling to pdf so that the .eps files can be included, but the total time for these conversions appears to be only ~0.5 seconds. Should I instead be pursuing a method of including raster images in dvi compiles? Compile times for pdf:   no text, no figures: 1 second   text, no figures: 1 second   text, figures: 6 seconds Compile times for dvi:   no text, no figures: 1 second   text, no figures: 1 second   text, vector figures: 1 second Raster images are small ~200KB.


title: How to add publisher to biblatex style (fiwi)?

text: I am using `biblatex` with `biblatex-fiwi` and the `fiwi2` option:               \usepackage[     backend=biber,     style=fiwi2,     ]{biblatex}      I am super content with the style, just publishers are omitted in the bibliography. I would love to see the publisher added at the end (Sage manually entered, bold)               Hofstede, Geert (2003): Culture’s Consequences: Comparing Values, Behaviors, Institutions     and Organizations Across Nations. 2. Aufl. Sage      How to get the publisher, which is in the `*.bib` file, into this bibliography?


title: Using the res.cls LaTeX file, how do I centre the address?

text: Right now, it would look something like this for the address area: ![enter image description here](http://i.stack.imgur.com/6oJty.png) Obviously the last line is not centred, but I'd like it to be. Here's the code so far:               % LaTeX resume using res.cls     \documentclass[11pt]{res} % default is 10 pt     %\usepackage{helvetica} % uses helvetica postscript font (download helvetica.sty)     %\usepackage{newcent}   % uses new century schoolbook postscript font      \usepackage{latexsym}   % to get the \Box symbol     \setlength{\textheight}{10in} % increase text height to fit resume on 1 page     \topmargin=-0.5in % start text higher on the page          \begin{document}           \name{ANDREW J. MALONE}      \address{739 Mill Grove Drive \\  Audubon, PA 19403 \\  (215) 555-2216}      It uses the `res.cls` file that is used for resume development. What would I modify to centre that?


title: Translator doesn't work in external pgfplot legend

text: I would like to have my pgfplot legend automatically translated wrt the language used in my article. Thus, I use to use the translator package, which a very easy and pleasant solution. It works like a charm until I externalize the legend into a reference. In the follow MWE, one can observe that the `translate` command works in `nameref`, in `legend entries` but not with `legend to name`.                   \documentclass{article}         \usepackage[english,french]{babel}         \usepackage{translator}         \languagepath{French}         \usepackage[T1]{fontenc}         \usepackage[utf8]{inputenc}         \usepackage{tikz,pgfplots}         \usepackage{nameref}              \begin{document}         \providetranslation[to=French]{My section}{Ma section}%         \section{\translate{My section}\label{marker}}         In section \nameref{marker} we defined...              \begin{figure}[!h]         \centering         \begin{tikzpicture}         \providetranslation[to=French]{Zero line}{Ligne zéro}%         \providetranslation[to=French]{Quadratic line}{Ligne quadratique}%         \begin{axis}[ymin=0, ymax=80,legend entries={\translate{Zero line},\translate{Quadratic line}}]         \addplot {x*0};          \addplot {x^2+50};         \end{axis}         \end{tikzpicture}         \caption{Figure with internal legend}         \end{figure}         \begin{figure}[!h]         \centering         \begin{tikzpicture}         \providetranslation[to=French]{Zero line}{Ligne zéro}%         \providetranslation[to=French]{Quadratic line}{Ligne quadratique}%         \begin{axis}[ymin=0, ymax=80,legend entries={\translate{Zero line},\translate{Quadratic line}},legend to name=legend]         \addplot {x*0};          \addplot {x^2+50};         \end{axis}         \end{tikzpicture}         \caption{Figure with external legend}         \ref{legend}\newline         \end{figure}         \end{document}      producing: ![Example output](http://i.imgur.com/LX6C7.png?1) Is there a way to solve that issue ?


title: Fancyhdr footer not working on pages where a chapter does not begin

text: I'm using `fancyhdr` to put a text and page number on every page:               \usepackage{fancyheadings}          \fancypagestyle{plain}{     \fancyhf{}     \lhead{section \bfseries \thesection}     \chead{CS04-708 Main Project, 2011}     \cfoot[{\vspace*{0.2cm}Department of Production Engineering, GEC - Thrissur \\ \thepage }]{\vspace*{0.2cm}Department of     Production Engineering, GEC - Thrissur \\ \thepage }     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0.5pt}     }      I'm getting the required footer only on pages where a chapter has begun (remember the default page style of a page where chapter begins is plain) rest of the pages have just the number (I'm guessing its the default style). I've been hunting Google a fix, but no avail. **EDIT** The CLS File               \ProvidesClass{mainreport}[]          \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}     \ProcessOptions          \LoadClass[12pt,oneside]{report}          \RequirePackage{graphicx}     \RequirePackage{amsfonts}     \RequirePackage{multicol}               % The list of packages needed for creating an advanced report class.          \RequirePackage{amsmath}     \RequirePackage{setspace}     \RequirePackage{textcase}     \RequirePackage[  bottom = 2.50cm]{geometry}     \usepackage{fancyhdr}     \pagestyle{plain}     \fancypagestyle{plain}{         \fancyhf{}         \lfoot{Department of Production Engineering, GEC - Thrissur }         \rfoot{\thepage}         \renewcommand{\headrulewidth}{0pt}         \renewcommand{\footrulewidth}{0pt}     }                         % Macro for List of Symbols     \def\listofsymbols{\input{symbols} \clearpage}     \def\addsymbol #1: #2#3{$#1$ \> \parbox{5in}{#2 \dotfill \pageref{#3}}\\}     \def\newsymbol#1{\label{#1}}           \pagenumbering{roman}          \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}               % for setting up alternative directory paths to graphics files,     % remember to comment in "graphics" package     %     \graphicspath{{./eps/}{./tiff/}{./jpg/}{./fig/}{./dia/}{./gnuplot/}{./png/}}               %------------     \usepackage{geometry}     \geometry{verbose,a4paper,tmargin=25.4mm,bmargin=31.75mm,lmargin=38.1mm,rmargin=31.75mm}          %To generate list of abbreviations     \usepackage{nomencl}     \makenomenclature               \renewcommand{\section}{\@startsection     {section}%                   % the name     {1}%                         % the level     {0mm}%                       % the indent     {-\baselineskip}%            % the before skip     {0.5\baselineskip}%          % the after skip     {\fontsize{12pt}{14.4pt}\selectfont \bf  \MakeTextUppercase}} % the style          \renewcommand\contentsname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{ Table of Contents}}     \renewcommand\listfigurename{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{ List of Figures}}     \renewcommand\listtablename{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{List of Tables }}     \renewcommand\nomname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{List of Abbreviations }}     \renewcommand\abstractname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{Abstract }}     \renewcommand\bibname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{Abstract }}          %\renewcommand\listsymbolsname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{Bibliography }}          \newcommand{\chhead}{\fontsize{14pt}{16.8pt}\selectfont \centerline}     \makeatletter     \def\@makechapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright \normalfont         %\ifnum \c@secnumdepth >\m@ne         %    \huge\bfseries \@chapapp\space \thechapter         %    \par\nobreak         %    \vskip 20\p@         %\fi         \interlinepenalty\@M         {\centering  \fontsize{14}{16.82} \selectfont  \bf \bfseries \thechapter .  \MakeTextUppercase{#1}\par\nobreak }         \vskip 40\p@       }}            \makeatother      And the TEX File               \newcommand{\projecttitle}{fImpact of Valve timing in Engine Performance}     \newcommand{\projectauthors}{{\normalsize \bf {Arvind.S.A}}}          \documentclass{mainreport}     \usepackage{lipsum}     \linespread{1.5}     \begin{document}     \addcontentsline{toc}{chapter}{Abstract}     \chapter*{Abstract}     \lipsum[1]     \tableofcontents     \newpage     \addcontentsline{toc}{chapter}{List of abbreviations}     \input{abbreviation}     \pagenumbering{arabic}     \chapter{First}     \lipsum[1-3]     \chapter{seond}     \lipsum[1-3]          %\bibliographystyle{amsplain}     %\bibliography{master}          \end{document}      I thank you for your trouble.


title: Custom \bonusqformat in exam class not level with question text

text: I am creating a set of problems, with the bonus problems starred with an *, but when I use `\bonusqformat` to customize the mark, it pushes the text onto a new line. Is there any way to prevent this from happening? MWE               \documentclass{exam}          \bonusqformat{\thequestion *.}     \begin{document}     \begin{questions}     \bonusquestion This is a question.          \end{questions}     \end{document}      ![MWE](http://i.stack.imgur.com/ENEQs.png)


title: How to put environment text inside node?

text: Consider a simple environment in the documentclass as                 \newenvironment{abstract}{         \node (tbl) {                          };       }      The content of               \begin{abstract}     Content     \end{abstract}      will goes after the `node`. How to put the content inside the `node`? The node has been used by `tikzpicture` to draw picture backgrounds. This can also apply to Section: how we can put the section header and text inside a node? a simple section header is as               \newcommand\section{\@startsection {section}{1}{\z@}%                                        {-3.5ex \@plus -1ex \@minus -.2ex}%                                        {2.3ex \@plus.2ex}%                                        {\normalfont\Large\bfseries}}      This only defines the section header text. How we can play with the section header and text within node? **UPDATE:** an example in reference to discussion with @MartinScharrer                 \newenvironment{abstract}{         \begin{center}         \begin{tikzpicture}         \node (x) {         This is inside node         };         \begin{pgfonlayer}{background}         \draw[rounded corners, top color=red, bottom color=black, draw=white]         ($(x.north west)+(0.14,0)$) rectangle ($(x.north east)-(0.13,0.9)$);         \end{pgfonlayer}         \end{tikzpicture}         \end{center}       }


title: Why does dgroup not create equation numbers?

text: I have a tex file:               \documentclass{minimal}     \usepackage{breqn}     \begin{document}      \begin{dgroup}       \begin{dmath*}        0 = x + y       \end{dmath*}       \begin{dmath*}        3 = 2x + 4y       \end{dmath*}      \end{dgroup}     \end{document}      I think, that `pdflatex` should produce two lines of equations with one common number on the right. But I do not get this number. In http://www.tug.org/TUGboat/tb18-3/tb56down.pdf on page 9/10 there is some example about that (the example code is from there). The official doc of `breqn` does not say it clearly, but I think it should work. Can you tell me what's going wrong here? How to get the equation number correctly? Besides: Are there "better packages" than `breqn`? I am used to use it as it breaks equations automatically which is very useful in case of narrow pages.