title: Aligned equations in LaTeX

text: I have a long equation in LaTeX, which I need to break up into more lines. I've done this, although its not quite what I was looking for. Here is a MWE showing my problem:               \documentclass[10pt]{article}          \usepackage[T1]{fontenc}     \usepackage{amsmath, amsthm, amssymb}     \usepackage[ansinew]{inputenc}          \begin{document}     \begin{equation}       \begin{aligned}             \alpha &= 1 &&+ 2     \\                    &    &&- 3 + 4 \\                    &= 4 \\                    &=5-1,       \end{aligned}     \end{equation}     \end{document}      So there is a long equation broken into 2 lines, followed by 2 short lines. Here is what I desire:   1. There should be an equation label for each equality sign, so 3 in total. At the moment there is only one   2. The "+2" and "-3+4"-parts are aligned right, which distorts the whole equation. I'm not quite sure why it is doing that, I haven't told it explicitly to do so. Is there a way to correct these errors? * * * EDIT: Original output looks like ![Original output](http://i.stack.imgur.com/kmLUn.png)


title: How to shade a line and how to offset a line?

text: Newbie here. Could anyone tell me how to (1) shade a line and (2) how to offset a line? I have a very simple graph,![enter image description here](http://i.stack.imgur.com/0IptG.png) This is a mesh used in finite element analysis, I have already used tikz to build a mesh and I am satisfied with it. But now I want to improve it! The shade effect represents it is a "fixed wall", and the second layer grid line should be offset of the first wall layer line. Here is my scripts of generating the grids. (You dont need to follow this scripts. You can disregard this scripts, a two layer grid lines is enough for me.)               \begin{tikzpicture}     [         scale=1,         every node/.style={scale=0.5},         x=0.1cm,y=0.1cm     ]     \usetikzlibrary{calc}          \usetikzlibrary{arrows,patterns}               \draw ( 0.0, 0.0)--( 8.0, 0.0)--(16.0, 0.0)--(22.0, 3.0)--(26.5, 6.5)--(30.0,14.5)--(33.0,16.2)--(36.0,14.5)--(39.5, 6.5)--(44.0, 3.0)--(50.0, 0.0)--(58.0, 0.0)--(66.0, 0.0);     \draw (0.0,8.5)--(8.0,8.8)--(14.2,9.1)--(17.9,10.0)--(22.5,12.0)--(27.6,17.6)--(32.2,19.7)--(38.4,17.6)--(43.5,12.0)--(48.1,10.0)--(51.8, 9.1)--(58.0, 8.8)--(66.0,8.5);     \draw (0.0,17.3)--(6.2,18.5)--(11.2,18.8)--(14.6,19.0)--(21.9,19.9)--(28.4,22.5)--(35.0,25.0)--(37.6,22.5)--(44.1,19.9)--(51.4,19.0)--(54.8,18.8)--(59.8,18.5)--(66.0,17.3);     \draw (0.0,30.0)--(6.2,30.0)--(11.2,30.0)--(14.6,30.0)--(21.9,30.0)--(28.4,30.0)--(35.0,30.0)--(37.6,30.0)--(44.1,30.0)--(51.4,30.0)--(54.8,30.0)--(59.8,30.0)--(66.0,30.0);     \draw ( 0.0, 0.0)--( 0.0, 8.5)--( 0.0,17.3)--( 0.0,30.0);     \draw ( 8.0, 0.0)--( 8.0, 8.8)--( 6.2,18.5)--( 6.2,30.0);     \draw (16.0, 0.0)--(14.2, 9.1)--(11.2,18.8)--(11.2,30.0);     \draw (22.0, 3.0)--(17.9,10.0)--(14.6,19.0)--(14.6,30.0);     \draw (26.5, 6.5)--(22.5,12.0)--(21.9,19.9)--(21.9,30.0);     \draw (30.0,14.5)--(27.6,17.6)--(28.4,22.5)--(28.4,30.0);     \draw (33.0,16.2)--(32.2,19.7)--(35.0,25.0)--(35.0,30.0);     \draw (36.0,14.5)--(38.4,17.6)--(37.6,22.5)--(37.6,30.0);     \draw (39.5, 6.5)--(43.5,12.0)--(44.1,19.9)--(44.1,30.0);     \draw (44.0, 3.0)--(48.1,10.0)--(51.4,19.0)--(51.4,30.0);     \draw (50.0, 0.0)--(51.8, 9.1)--(54.8,18.8)--(54.8,30.0);     \draw (58.0, 0.0)--(58.0, 8.8)--(59.8,18.5)--(59.8,30.0);     \draw (66.0, 0.0)--(66.0, 8.5)--(66.0,17.3)--(66.0,30.0);                    \end{tikzpicture}


title: Change the shape of a fraction

text: Is it possible to change the bar in a fraction to a different symbol? ie.               \frac{x}{y}      But instead of a straight line, I'd like to choose the delimiter to say `\overbrace`. I know I can get rid of the delimiter completely using `\genfrac`               \genfrac{}{}{0pt}{}{x}{y}      And the closest I've come is:               \genfrac{}{}{0pt}{}{x}{\overbrace{y}}      While this extends if `y` is a large expression, it does not extend the delimiter if `x` is a large expression. Any thoughts? **EDIT** : Changed to `\overbrace` from `\hat` as the hat does not compile. Question remains the same.


title: Proper command for Math equation

text: Everyone, I am new to LaTeX, and I tried to learn to write Math equations. I use "\usepackage(mathtools}". I got some problem with "exponentiation", "sum", "integral", ... I want it to display like n=0 under the sum and so on. This is my command:               \documentclass{article}     \usepackage{braket}     \usepackage{mathtools}     \begin{document}     [...]         $\left(A+B\right)\ket{\psi} = A\ket{\psi} + B\ket{\psi}$\\         $AB\ket{\psi} = A\left(B\ket{\psi}\right)$\\         $\exp{A} = \sum_{n=0}^{\infty}\frac{A^n}{n!}$     [...]     \end{document}      Could you help me? ![PDF output](http://i.stack.imgur.com/XcJmj.jpg)


title: htlatex in silent mode

text: It's possible to run `htlatex in silencemode` like `pdflatex`. **pdflatex --draftmode --interaction=nonstopmode foo.tex > tmp.txt** I have found only `nonstopmode/batchmode in htlatex`. **htlatex source.tex "3" "" "" "--interaction==nonstopmode"**. Any ideas?


title: Why do the braces in f{\left(x\right)} affect the output?

text: Why does `f\left(x\right)` result in more space before the `(` than `f{\left(x\right)}`? i.e. Why does putting extra braces suppress the space?


title: Equation: Using \left brackets inserts unwanted space

text: > **Possible Duplicate:**   >  Spacing around \left and \right I'm having some problems with writing down an equation in LaTeX. It's only a minor issue regarding appearance, but I'm kind of a perfectionist. And isn't that why we use LaTeX anyway? Consider the following equation:               \begin{equation}     f(x)=\exp[-\frac{x}{2}]     \end{equation}      The brackets following the exponential indicator `\exp` are closely placed next to "exp", clearly indicating that it's the variables for the exponential function. However, since the argument of the exponential function contains a fraction, it's appropriate to resize the brackets. So I let the brackets be resized automatically according to:               \begin{equation}     f(x)=\exp\left[-\frac{x}{2}\right]     \end{equation}      Indeed, the brackets are now automatically appropriately sized. However, for some reason, extra white space appears between "exp" and the first "[" bracket. It now looks like the function "exp" and the term in brackets are two independent components. I haven't found a way to solve this issue. I'm quite surprised that a system like LaTeX, known for its excellent equation capabilities, exhibits this behavior.


title: True `macros' in (La)TeX

text: When using `\newcommand` and the like, LaTeX seems to create a new box for the content (I'm probably observing things wrong). For example, I have `\newcommand{\p}[1]{\ensuremath{\left(#1\right)}}` in my preamble. When I use the command, it outputs as it might if I had accidentally inserted a \thinspace in there. Upon close observation, the paren begins where the italicized _d_ ends (at the top of the line), thus my suspicion about the whole 'box' thing. Obviously, the functionality I'm trying to implement is a C-preprocessor-type macro. An automatic search-and-replace. In the example, if I were to instead just type `$d(x, y)$` instead of `d\p{x, y}`. I've been searching for a good resource on how LaTeX macros actually work (the TeXbook comes to mind, but I've yet to come across it in my reading), but the box thing makes programmatic sense if the meaning of a macro were truly based upon its use. How would somebody implement a C-preprocessor-like macro using only (La)Tex, as opposed to `\newcommand`'s smarty-pants-ness? The dumber, the better.


title: Swap even and odd page margin in document class book

text: I am writing a book and I would like to swap the even and odd page margins without changing the page numbers. I am using document class book. I know that by default the book class sets the margin of the odd pages on the right side but I want to reverse this. This is my code               \documentclass[11pt]{book}           \begin{document}     \setcounter{chapter}{0}     \chapter{Auxiliary Results}     \section{Introduction}     Much of the special necessary mathe......     \end{document}      And this is what i get as the first page. ![Page 1](http://i.stack.imgur.com/rVlBm.jpg) I want to open every chapter on the right-side page. And with the margin like the one shown in the image, I would end up having a large margin on the right side and no margin on the left after binding the book. I know that some similar questions might be out there but I didn't find anything appropriate to my situation.


title: Biblatex Incollection entry with no author

text: Using biblatex authortitle I have an entry from a dictionary which has no author. In the citations is appearing using the title first for full citations (which is required by my style guide), and the editor's name for abbreviated ones (which is incorrect): First citation: “Emotional Intelligence”. In: Encyclopaedic Dictionary of Psychology. Ed. by Graham Davey. Oxford: Routledge, 2005, pp. 306–307. Subsequent citations: Davey, “Emotional Intelligence”. In the bibliography, it is appearing as in the first citation, but sorted by the editor's name. So: “Emotional Intelligence”. In: Encyclopaedic Dictionary of Psychology. Ed. by Graham Davey. Oxford: Routledge, 2005, pp. 306–307. Davis, K. et al. “The Theory of Multiple Intelligences”. In: Cambridge Hand- book of Intelligence. Ed. by R. J. Sternberg and S. B. Kaufman. New York: Cambridge University Press, 2011, pp. 485–503. The style needed is according to the first (full) citation, listed by the entry title. See, for example, http://utas.libguides.com/content.php?pid=27520&sid=202467 I can specify sorting in the bibtex entry so that article appears among the E entries, but then the abbreviated citations will be unhelpful (the reader will look among the Ds for it). If specifying the sorting under "e" a solution is to manually use \fullcite for that title each time. That introduces a large chance for operator error. Is there a way to make the full citation required at every occurrence for this entry? The only other solution I can think of is to refashion the incollection entry so that the editor is first, if there is no author, that would make the first listing and bibliography it fit the abbreviated entry. (Not really the required style, but closer to it than listing the encyclopaedia only, rather than the article.) Are there other solutions which keep with the style required? TIA MWE               \documentclass[a4paper]{article}          \usepackage[english]{babel}     \usepackage[style=authortitle,natbib=true,citestyle=verbose,backend=biber]{biblatex}     \addbibresource{\jobname.bib}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @Incollection{Davis2011TToMI,       Title                    = {The Theory of Multiple Intelligences},       Address                  = {New York},       Author                   = {K. Davis and Christodoulou, J. A. and S. Seider and Gardner, H.},       Booktitle                = {Cambridge Handbook of Intelligence},       Pages                    = {485--503},       Publisher                = {Cambridge University Press},       Year                     = {2011},       Editor                   = {R. J. Sternberg and S. B. Kaufman},     }          @Incollection{Davey2005EI,       Title                    = {Emotional Intelligence},       Address                  = {Oxford},       Booktitle                = {Encyclopaedic Dictionary of Psychology},       Pages                    = {306--307},       Publisher                = {Routledge},       Year                     = {2005},       Editor                   = {Davey, Graham},     }          \end{filecontents}          \begin{document}          First cite\autocite{Davey2005EI}          Other cite\autocite{Davis2011TToMI}          Second cite\autocite{Davey2005EI}          \printbibliography          \end{document}


title: tikz problem (non-continuous function)

text: I want to plot a function x^3/(x^2-1) but it doesn't work.               \documentclass{article}         \usepackage{tikz}          \begin{document}            \begin{tikzpicture}[domain=-5:5,smooth]         \draw[->] (-5,0) -- (5,0) node[right] {$x$};          \draw[->] (0,-5) -- (0,5) node[above] {$y$};         \draw [color=blue, thick] plot ({\x},{pow(\x,3)/(pow(\x,2)-1)});       \end{tikzpicture}          \end{document}      It does something like this. It should be non-continuous function, not this. ![function](http://i.stack.imgur.com/JmUwM.jpg) How to fix it? Thanks.


title: Multiple bibliographies with local links, global labels. Also global bibliography

text: How can I have a bibliography per section which shows only the references cited within the section? At the end, I also want a global bibliography which includes all cited references in any section. As far as labels go, I want them global. So if labels are numeric, then [1] can appear in multiple sections but it always corresponds to the [1] that is in the global bibliography. If the labels are [Author00] then that same label would appear in multiple locations, consistently referring to the same bibitem. Finally, there is the question of the hyperlink attached to the label. Should it go to the local bibliography or to the global bibliography? For now, I prefer local, but it would be nice to have this configurable. If it matters, I want to do this with a single bibtex file. I've seen piecemeal answers here and there, but not much on what happens when you click the hyperlink.


title: tikz legend in caption

text: I have adapted a piece of code that I found on the Q&A forum multiple legends in pgfplots as follows in order to include the legend of a drawing directly into the caption: **EDIT 1**               \documentclass[a4paper]{book}     \usepackage{lipsum}     \usepackage{pgfplots}     \usepackage[left=3.8cm,right=3.8cm,a4paper]{geometry}     \pgfplotsset{compat=1.3}     \begin{document}     \lipsum[1-2]     \begin{figure}[!ht]     \centering     \begin{tikzpicture}     \begin{axis}[height=6cm,width=8.5cm,grid=major,xlabel=$x$,ylabel=$f(x)$,tick label style={font=\small},label style={font=\small},title style={font=\small},every axis title shift=0pt,max space between ticks=30,major tick length=0cm,minor tick length=0cm,enlargelimits=false,]     \addplot expression[domain=-6:6] {0.4*x};\label{p4}     \addplot{0.5*x};\label{p5}     \addplot{0.6*x};\label{p6}     \end{axis}     \end{tikzpicture}\par     % boxes for caption 1     \newbox{\captionA}%     \savebox{\captionA}{(\small\tikz[baseline]\node at (0,2.5pt){\ref{p4}};)}%     \newbox{\captionB}%     \savebox{\captionB}{(\small\tikz[baseline]\node at (0,2.5pt){\ref{p5}};)}%     \newbox{\captionC}%     \savebox{\captionC}{(\small\tikz[baseline]\node at (0,2.5pt){\ref{p6}};)}%     \caption{This is a plot about curves in color such as $f(x)=0.4 x$\usebox{\captionA},  $f(x)=0.5 x$\usebox{\captionB} and $f(x)=0.6 x$\usebox{\captionC}}     \end{figure}     \lipsum[1-2]     \end{document}      but as may you may notice, the brackets around the colored ref are a bit too far: is it possible to control this? **EDIT 2** : final answer               \documentclass{book}     \usepackage{lipsum}     \usepackage{caption}     \usepackage{pgfplots}     \pgfplotsset{compat=1.3}     \tikzset{pointille/.style={dash pattern = on 2pt off 2pt on 6pt off 2pt}}     \tikzset{points/.style={dash pattern = on 1pt off 1pt}}     \tikzset{tirets/.style={dash pattern = on 5pt off 5pt}}          \begin{document}     \lipsum[1]     \begin{figure}[!ht]     \centering     \captionsetup{width=9.5cm}     \pgfplotsset{every axis plot post/.append style={mark=none,line width=1.5pt}}     \begin{tikzpicture}     \begin{axis}[height=7cm,width=9cm,grid=major,xlabel=$x$,ylabel=$f(x)$,     tick label style={font=\footnotesize},label style={font=\small},max space between ticks=45, major tick length=0cm,minor tick length=0cm,enlargelimits=false,]     \addplot[tirets,color=blue]{2*x};\label{p4}     \addplot[pointille,color=green]{0.5*x*x};\label{p5}     \addplot[points,color=red]{-0.125*x*x*x};\label{p6}     \end{axis}     \end{tikzpicture}     \caption[Caption in ToC]{This is a plot about colored curves: $f(x)=2 x$ (\ref{p4}),  $f(x)=0.5 x^2$ (\ref{p5}), and $f(x)=-0.125 x^3$ (\ref{p6})}     \end{figure}     \lipsum[1]     \end{document}      ![enter image description here](http://i.stack.imgur.com/5IEEF.png)


title: algorithmic, referring using the name and inputs

text: I'm using the `algorithmicx` package, but I would like my algorithm to look like: Algorithm My Algo `$(\lambda,\beta)$` i.e., the algorithm should accept inputs as shown. I then want refer to this algorithm from the main text as follows: We run algorithm My Algo `$(\lambda_1,\beta_1)$` and also My Algo `$(\lambda_1,\beta_2)$` ... Please suggest!


title: Beamer: problematic use of \visible and \only in combination with TikZ to draw a graph

text: I have a problem with my graph and my background environment to highlight the edges in the "last" of my slides. First I tried this:               \begin{frame}     \frametitle{Graphmodell Beispiel}          \tikzstyle{vertex}=[circle,fill=white!25,minimum size=20pt,inner sep=0pt]     \tikzstyle{selected vertex} = [vertex, fill=red!24]     \tikzstyle{edge} = [draw,thick,-]     \tikzstyle{weight} = [font=\small]     \tikzstyle{selected edge} = [draw,line width=5pt,-,red!50]     \tikzstyle{ignored edge} = [draw,line width=5pt,-,black!20]          \begin{figure}     \begin{tikzpicture}[every node/.style={circle,draw},level 1/.style={sibling distance=30mm},level 2/.style={sibling distance=20mm}     ]         %\tikzstyle{every node}=[circle,draw]         \only<1,2>{\node[vertex] (1) {1}             child {node[vertex] (2) {2}                 child{node[vertex] (3){3}}                 child{node[vertex] (4){4}}             }             child { node[vertex] (5) {5}                 child {node[vertex](6) {6}}                 child {node[vertex] (7){7}                     child{node[vertex] (8){8}}                     child{node[vertex] (9){9}}                 }             }};         \only<3>{\node[vertex, label=right:$T_{k}$] (1) {1}             child {node[vertex, label=left:$T_{k-in}$] (2) {2}                 child{node[vertex] (3){3}}                 child{node[vertex] (4){4}}             }             child { node[vertex, label=right:$T_{k-out}$] (5) {5}                 child {node[vertex](6) {6}}                 child {node[vertex] (7){7}                     child{node[vertex] (8){8}}                     child{node[vertex] (9){9}}                 }             }};                  \begin{pgfonlayer}{background}             \pause             \foreach \source / \dest in {1/2,2/4,1/5,5/7,7/8}                 \path[selected edge] (\source.center) -- (\dest.center);         \end{pgfonlayer}     \end{tikzpicture}     \end{figure}     \visible<3->{\begin{center}Fahrzeug $k \in k^{+}$ mit Start-Endpunktvektor $(4,8)$\end{center}}     \end{frame}      It worked just fine besides the fact that the graph was switching the positions slightly because of using `\only` instead of `\visible`. But when I replace `\only` with `\visible` I don't know how to "background" my edges any more, because it gives me the error that the vertices aren't found.               \begin{frame}     \frametitle{Graphmodell Beispiel}          \tikzstyle{vertex}=[circle,fill=white!25,minimum size=20pt,inner sep=0pt]     \tikzstyle{selected vertex} = [vertex, fill=red!24]     \tikzstyle{edge} = [draw,thick,-]     \tikzstyle{weight} = [font=\small]     \tikzstyle{selected edge} = [draw,line width=5pt,-,red!50]     \tikzstyle{ignored edge} = [draw,line width=5pt,-,black!20]          \begin{figure}     \begin{tikzpicture}[every node/.style={circle,draw},level 1/.style={sibling distance=30mm},level 2/.style={sibling distance=20mm}     ]         %\tikzstyle{every node}=[circle,draw]         \node{{\visible<1>{[vertex] (1) {1}             child {node[vertex] (2) {2}                 child{node[vertex] (3){3}}                 child{node[vertex] (4){4}}             }             child { node[vertex] (5) {5}                 child {node[vertex](6) {6}}                 child {node[vertex] (7){7}                     child{node[vertex] (8){8}}                     child{node[vertex] (9){9}}             }             }}}};         \only<3>{\node[vertex, label=right:$T_{k}$] (1) {1}             child {node[vertex, label=left:$T_{k-in}$] (2) {2}                 child{node[vertex] (3){3}}                 child{node[vertex] (4){4}}             }             child { node[vertex, label=right:$T_{k-out}$] (5) {5}                 child {node[vertex](6) {6}}                 child {node[vertex] (7){7}                     child{node[vertex] (8){8}}                     child{node[vertex] (9){9}}                 }             }};              \begin{pgfonlayer}{background}             \pause             \foreach \source / \dest in {1/2,2/4,1/5,5/7,7/8}                 \path[selected edge] (\source.center) -- (\dest.center);         \end{pgfonlayer}     \end{tikzpicture}     \end{figure}     \visible<3->{\begin{center}Fahrzeug $k \in k^{+}$ mit Start-Endpunktvektor $(4,8)$\end{center}}     \end{frame}      Does anybody know how to get out of this trouble? P.S: Thanks Claudio for the format. I understood that you just have to indent inside the code


title: Problem with vertical alignment in tabular environment

text: I'm having a few issues with vertically aligning table elements. There seems to be too much space either above or below the text or image. Is this to do with the `fbox` environment? I want both the image and text to be centered vertically in each table cell.               \documentclass[a4paper,11pt]{article}     \usepackage[english]{babel}     \usepackage{graphicx}        \usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}     \usepackage{array}          \newcommand{\mybox}[1]{         \begin{center}         \fbox{         \parbox{0.8\linewidth}{             \begin{center}                 \begin{tabular}{ c m{4.5in} }                 \includegraphics[height=0.3in]{./myfig} & {#1}                 \end{tabular}              \end{center}             }          }         \end{center}     }               \begin{document}          \mybox{hello}          \mybox{hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello}               \end{document}      ![enter image description here](http://i.stack.imgur.com/nMrg3.png) **Edit:** Following Gonzalo Medina's suggestion, I get: ![enter image description here](http://i.stack.imgur.com/BeArG.png) and there is no difference between `center` and `centering`.


title: Command to gray words

text: I would like to create a macro in LaTeX to have the following effect (gray parts) on some text: ![enter image description here](http://i.stack.imgur.com/w66Wk.png) I would like to have something like `\gray{Hello}` which puts brackets and grays the text. Can someone help me?


title: Can I use xymatrix to make a spectral sequence ? meaning how to make the boxes?

text: Is it possible to use the xymatrix command to make a spectral sequence ? Since xymatrix has all the arrows, what I am really asking is are there commands that will enclose the entries in a lattice of boxes. A simple sample would be ideal. Edit: An example of what I am trying to achieve can be seen on the first page of this paper: http://www.shef.ac.uk/nps/courses/bestiary/ss.pdf


title: Is it better to let tables to be on top with tpb, or use "H"/"h"?

text: I am writing a thesis that has some occasional tables. I cannot decide if it's "better" (both aesthetically and maybe in other regards) to just use the default "tpb" floating placement, which makes the tables to be "stacked" on top, or modify the placement using `\begin{table}[H]`. Most scientific papers I have seen actually lets the table be on top and I am not entirely sure why. Are the tables easier to read, when they are stacked on top, usually far from the text that is referring to them? (I am not asking about the technical issues of either approach, but more about aesthetics / practicality. I am aware this might be off topic for this site, but I have no idea where else on SE to ask this.)


title: TikZ dash pattern generates an offending PDF

text: Consider the following MWE:               \documentclass{standalone}     \usepackage{tikz}     \begin{document}     \def\dotsize{1}     \def\spacesize{2}     \def\linesize{4}     \begin{tikzpicture}[%       dash pattern=%       on \dotsize  pt off \spacesize pt on \dotsize  pt off \spacesize pt on \dotsize  pt %       off \spacesize %       on \linesize pt off \spacesize pt on \linesize pt off \spacesize pt on \linesize pt %       off \spacesize pt,%       orange]       \draw (0,0) -- (4cm,4cm);     \end{tikzpicture}     \end{document}      The code compiles just fine and I can open it using both `skim` and `acrobat reader`. However, when trying to print the PDF using `skim` I get the following error:                ERROR: limitcheck      OFFENDING COMMAND: setdash           STACK:           0      [0.99628 1.99255 0.99628 1.99255 0.99628 1.99255 3.9851 1.99255 3.9851 1.99255 3.9851 1.99255]      **printed** on the page. When printing from `acrobat` I get the expected printout. I'm using `MacTeX` and `TikZ` 2.10-CVS. Two questions:   1. Can someone reproduce the issue?   2. How can I debug this problem?


title: Exam document class not leaving space for solutions when used with [noanswers]

text: I'm attempting to use the exam document class to write an exam for my class, and for some reason this particular exam is not leaving space for their answers when I use the `[noanswers]` argument to the document class. Here is the markup:               \documentclass[noanswers]{exam}          % Additional LaTeX Packages          \usepackage{graphicx}          % Font and Typography Settings          \usepackage{beton}     \renewcommand{\bfdefault}{sbc}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{euler}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[babel=true]{microtype}          \pagestyle{headandfoot}     \headrule     \firstpageheader{CS 1411 -- Principles of Programming I}         {Exam II}         {Spring 2013}     \runningheader{CS 1411 -- Principles of Programming I}         {Exam II, Page \thepage\ of \numpages}         {Spring 2013}          \begin{document}          \begin{questions}          \question PROBLEM TEXT     \begin{parts}     \part function     \begin{solution}[\stretch{1}]         PART A SOLUTION     \end{solution}          \part PART B     \begin{solution}[\stretch{1}]         PART B SOLUTION     \end{solution}     \end{parts}          \question PROBLEM TEXT     \begin{parts}     \part PART A     \begin{solution}[\stretch{1}]         PART A SOLUTION         \begin{center}             \includegraphics[scale=0.60]{Images/exam-2-problem-2.pdf}         \end{center}     \end{solution}     \part PART B     \begin{solution}[\stretch{1}]         PART B SOLUTION     \end{solution}     \end{parts}          \question PROBLEM TEXT     \begin{solution}[\stretch{1}]     \begin{verbatim}     PYTHON CODE IN VERBATIM MODE     \end{verbatim}     \end{solution}          \end{questions}          \end{document}      Via `pdflatex` the generated PDF contains the solutions as I would expect when using the `[answers]` argument to the document class. Switching to `[noanswers]` simply prints the questions leaving no space for the solutions. Any suggestions would be much appreciated.


title: psfragify? Aka problem with EPS and pdfLaTeX

text: If I want to include a `.eps` image and yet use pdfLaTeX, I can do so using `epstopdf` (manually called, automated in TL2010+, using the package). However, as far as I know, all these options are incompatible with `psfrag`. I would be interested in a utility, let's say `psfragify`, that would take a LaTeX source code, extract all `.eps` graphics that use `\psfrag` directives, and run `latex+dvips`(`+ps2pdf`) on them, to obtain corrected graphics that can be used in pdfLaTeX. Of course, this should solve the problem of using the correct fonts, too. (If no such utility exists, I'm probably going to make one, but I would like to know whether the work has not been done before.)


title: How to use a counter to set section or chapter or subsection based on counter value?

text: Suppose I have my own counter as in               \newcounter{x}     \setcounter{x}{0}      and now I want to start a new "section" based on the value of `x`. For example, if `x==-1` I want `\part`, and if `x==0` then it will be `\chapter` and if `x==1` it will be `\section` and so on. I do not want to write each time something like this (do not even know it is valid syntax)                  \ifnum \value{x} \eq  -1              \part                     \else             \ifnum \value{x} \eq 0                \chapter             ...             \fi       \fi       ...      I'd like to just write                 \makeSectionTypeBasedOnThisValue{x}{title of the section of chapter is here}      and this command will map to the correct command based on the value of `x`. I will make sure `x` is always between -1 and 5 since these are the valid values. I am using book style. I have a reason to want to do it this way. (briefly, I am building my large tree of latex documents, combining them to one document, and I want to be able to build it starting from any level going down. Hence depending on where in the tree I start the build, section numbering will be different. One time the same level can be a `\section` while some other time that level can become a `\subsection`. So I do not want to hardcode the `\section` or `\chapter` commands in Latex files, but I want these to depend on the level the file is in the tree. The counter will represent the level in the tree I am starting the build from) Is there is an easy way to do this? I am a newbie in Latex.


title: How to add rule in color box?

text: I am new to latex i want to add rule in top and bottom of the color box, My sample code is,               \documentclass{article}     \usepackage{graphicx,xcolor,lipsum}     \begin{document}     \colorbox{pink}{\parbox{\textwidth}{%      \vskip10pt      \leftskip10pt\rightskip10pt      \lipsum[1]     \vskip10pt     }     }     \end{document}        1. My Expected output is, ![enter image description here](http://i.stack.imgur.com/BaYtO.png) Any one help me to achieve this task.


title: Supertabular across pages

text: I am using the `supertabular`environment to split tables over pages. Does anybody know, how I can give LaTeX a hint, where to break the table and turn to the next page? There are some rows, which should be displayed together. I Googled around, but could not find an appropriate answer, in Google or the document. `longtable` renders my table unusable. At least as all other tables are displayed with               \hline     \hline      as the first head and the `longtable` environment seems not to like this sort of tables. Can anyone help on this issue?


title: two horizontal lines in header

text: I need to reproduce the following header format: ![enter image description here](http://i.stack.imgur.com/dO3UW.jpg)               \documentclass{book}     \usepackage{fancyhdr}         \pagestyle{fancy}     \cfoot{}     \lhead{\thepage}


title: LaTeX: Balanced twocolumn Text with Footnotes only in the right column (ftnright)

text: Do the packages `ftnright` and `balance` work together? I'm looking for a solution to generate a twocolumn text in LaTeX. My footnotes should appear at the bottom of the right column. However, my main problem is the last page: Both columns should be balanced and the footnotes should be placed right under the text. As a result the last line of the left column should be next to the last footnote. I tried to archive this with the following code. Unfortunately, if the last page is less than half filled, the last footnotes will appear on another empty page. Does anyone has an idea how to fix this? My code that generates this pdf-file.               \documentclass[twocolumn,a4paper,10pt]{book}     \usepackage{ftnright}     \usepackage{balance}     \usepackage{blindtext}          \begin{document}     \balance          \blindtext \footnote {First Footnote}          \blindtext \blindtext \footnote {Another Footnote}          \blindtext \footnote {Third Text}          \blindtext  \blindtext          \blindtext \blindtext \footnote {Problematic Footnote appears on page 3}     \end{document}


title: Replacing a character with a different one of a different point size

text: The following image shows two ways of writing "2009" in Adobe Garamond Pro: ![2009](http://i.stack.imgur.com/yfDGd.png) The first one is standard 12pt. In the second "2009," the zeros are written with this command:               \newcommand{\zero}{{\fontsize{12.8}{\baselineskip}\selectfont o}}      i.e., using a slightly larger "o" instead of "0." Obviously doing this manually is of the question. Is there a way to automatically use this "o" instead of a "0" everywhere? A way which works for all sizes would be preferred.


title: A simple line from start of the page to the end

text: I need on one specific page a line from the very top to the end of the page (it is for folding). Everything I tried so far stopped at the head/foot room. Someone got an idea?


title: Ignore whitespaces inside of a table

text: I would like to eliminate blank parts of a table. Here is my LaTeX snippet:               \documentclass[english,a4paper,12pt]{report}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{listings}     \usepackage{changepage}          \begin{document}          \clearpage     \begin{table}[ht]     \begin{adjustwidth}{-3.7cm}{}     \begin{tabular}{|p{.6\textwidth}|p{.75\textwidth}|}     \hline     {\begin{lstlisting}[basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,language={Java},     numbersep=8pt,numbers=left,xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords={class,run}]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }     class X ext ProxifiedObject {         PrintHelloThread thread         void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}}     &     {\begin{lstlisting}[     basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,     language={Java},     numbersep=8pt,     numbers=left,     xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords ={class,run}     ]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }     class X ext ProxifiedObject {         PrintHelloThread thread         void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}}     \\     \hline     \end{tabular}     \end{adjustwidth}     \caption{\label{fig:text}text experiment ent experiment experiment}     \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/7yTWg.gif)


title: How do I make trees with straight skeletons or spines?

text: I'm a new/beginner LaTeX user, and I would like to make syntactic trees with straight spines, somewhat like the ones here: http://tanvirdhaka.blogspot.com/2010/01/phrase-structure-grammar.html Or here: http://www.myoops.org/twocw/mit/NR/rdonlyres/Global/C/CADA8FE3-E25D-4758-9BDA-C061C67CE678/0/chp_syntactic_word_struct_tw.gif Can this be done with tikz-qtree? That is what I've been using til now. Edit: Thanks for some of the responses here. I guess I had two questions. The first "problem" is that when I've created a tree, some branches (which have empty nodes or leaves) are uneven (angled) and thus it looks somewhat unsightly. I've included some of my original code to show what I mean. But I think the responses below might help me fix this problem.               \documentclass[10pt]{article}          \usepackage{tikz}     \usepackage{tikz-qtree}          \begin{document}          \begin{tikzpicture}     \Tree % Ugly tree with uneven branches and different lengths     [.CP      [.{} ]     [.C$'$          [.C ]         [.(?)      [.Neg ]              [.TP         [.{} ]         [.T$'$              [.T ]              [.\textit{v}P              [.AGENT ]             [.\textit{v}$'$                 [.\textit{v} ]                      [.VP                      [.V ]                      [.THEME ] ] ] ] ] ] ] ] ] ] ] ] ]     \end{tikzpicture}       The second question I had was how to make a tree with a continuous, straight spine from top to bottom (see second link in my original post above). Does anyone know how to do this?


title: Break in square root line

text: I'm having a problem where the line that runs the top length of my square root sign is discontinuous.               \begin{equation}         N_t(\text{V})=\sqrt{\sum_{i=0}^{n}N_i^2}     \end{equation}      Yields this...![Sad broken line](http://i.stack.imgur.com/FVmX3.png) Any ideas what's causing that broken line on the top of my root symbol??


title: Include a file (chapter)

text: Is it fair to assume that if an `\include` command does not add a blank page both before and after, it is because the chapter starts on a page with an odd page number ? EDIT: I thought I was having trouble with `\include`. I had the impression from for example http://www.tex.ac.uk/cgi-bin/texfaq2html?label=include that `\include` would add a page both before and after. I had one `\include` statement in my document and there was indeed a blank page both before and after the chapter. When I added more `\include` statements I didn't see the same behavior and thought something was wrong until I noticed chapters start on odd page numbers which lead to my assumption above.


title: Drawing a peer-to-peer communications model in Tikz

text: I would like to draw an image illustriting peer-to-peer communications in Tikz. I have previously drawn flowcharts with relative ease based on the Simple Flowchart Example. Here is the image that I would like to recreate in Tikz: ![enter image description here](http://i.stack.imgur.com/1Oeaz.png) My difficulties are: **1.** I had to replace the Stickmans with clouds from flowcharts. (Not a big issue, I can live with this) **2.** If I want to draw 2 arrow (edge) between client A and B, the result will be a two-way path (one line, with arrowheads on both ends) instead of two seperate arrows. I really want to keep two seperate arrows. Any help is appreciated.


title: Error compiling empheq with texlive 2013 tex4ht. Missing } inserted

text: MWE               \documentclass{article}     \usepackage{empheq}     \begin{document}     \begin{empheq}[box=\fbox]{align*}     \lambda_{dutch}  &  =-0.40293\pm1.9803i\\     \lambda_{spiral}  &  =-0.069088\\     \lambda_{rolling}  &  =-56.511     \end{empheq}     \end{document}      `pdflatex foo.tex` works fine and generates correct output. But `htlatex foo.tex` gives this error               (/usr/local/texlive/2013/texmf-dist/tex/latex/latexconfig/graphics.cfg)     (/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/dvips.def)))     Overfull \hbox (8063.39311pt too wide) detected at line 8     [][][][][][][][][][]     ! Missing } inserted.     <inserted text>                      }     l.8 \end{empheq}          ?       Using               tex4ht.c (2012-07-25-19:36 kpathsea)          >pdflatex --version     pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013)     kpathsea version 6.1.1      Is this a bug, or is it not supposed to be supported in tex4ht?


title: TikZ/PGF 3.0 datavisualization vs pgfplots

text: To follow-up on a previous question TikZ datavisualization or pgfplots?, the current release of TikZ 3.0 has a flexible datavisualization engine that creates the same kind of plots as the more mature plotting package pgfplots. What is the current recommendation for producing complete plots in LaTeX?


title: Can I modify equations created by LaTeXiT in Mac Word?

text: Using LaTeXiT to create an equation and insert in Mac Word is very easy and convenient. However, can I modify the equation I already inserted?


title: Captions in sub floats using subfloatrow are too narrow

text: I have a figure that has several subfigures, each with its own caption. I am aligning the subfloats using subfloatrow. How do I make the captions expand at least to the width of the graphic? Currently they are extremely narrow.               \documentclass[11pt]{amsart}     \usepackage{amsmath,amssymb,amsthm,latexsym,graphicx}     \usepackage{subfig,keyval,caption}     \usepackage[]{floatrow}     \floatsetup[table]{style=plaintop}     \floatsetup[figure]{floatrowsep=qquad,   valign=c}     \floatsetup[subfigure]{subfloatrowsep=qquad, heightadjust=object, valign=c}     \usepackage{tikz}          \begin{document}     \begin{figure}[htbp]     \begin{center}     \ffigbox{     \begin{subfloatrow*}[3]     \subfloat[A very very very very very veryvery very veryvery very very long subcaption]     {\begin{tikzpicture}     \draw (0,0) rectangle(5,5);     \end{tikzpicture}}     \subfloat[A very very very very very veryvery very veryvery very very long     subcaption that is even longer than the first]     {\begin{tikzpicture}     \draw (0,0) rectangle(4,6);     \end{tikzpicture}}     \subfloat[And we're now talking about the third subfigure blah blah]     {\begin{tikzpicture}     \draw (0,0) rectangle(2,1);     \end{tikzpicture}}     \end{subfloatrow*}}{     \caption{And here's the caption to the main figure that seems to be working ok}     \label{tournaments}}     \end{center}     \end{figure}     \end{document}


When I used color in a cell of a take, then this cell become wider. How to solve it? ![enter image description here](http://i.stack.imgur.com/pWVak.png) The code is here:               \documentclass{beamer}          \usepackage[utf8x]{inputenc}     \usepackage{default}          \mode<presentation> {       \usetheme{Warsaw}       \usecolortheme{crane}     }          \newcommand{\green}[1]{\begingroup\color{green}#1\endgroup}     \begin{document}      \begin{frame}           \begin{table}        \begin{tabular}{|p{2.5cm}|p{2.5cm}|p{3.5cm}|}           \hline                           & CCCC &  UUUUU\\           \hline                \hline             AAAAAAAA &   itself &  \green{BBBBBBBBBBBBB}\\            \hline            AAAAAAAA &   itself &  BBBBBBBB\\           \hline        \end{tabular}         \end{table}      \end{frame}      \end{document}


title: Modifications on PDF file do not show up

text: I usually prefer PDF images for my LaTeX documents because they are easy to crop/resize using Adobe professional. I am facing a weird problem. I modified one of the PDF images using Adobe professional by writing come comments using the pencil tool and added a rectangular box on the image and saved it. The LaTeX output is not showing the modification that I made to the image file but when i open the image file the modifications are still there. Did anyone face similar problems?


title: Bibtex: I didn't find a database entry for

text: I have a very large tex file and a very large bib file. When I run (xelatex, bibtex) I get several warnings like this:               Database file #1: Thesis.bib     Warning--I didn't find a database entry for "Jag08"     Warning--I didn't find a database entry for "Jag08"     Warning--I didn't find a database entry for "Aharonian2005c"     Warning--I didn't find a database entry for "Marandon2008f"      The problem is that those entries are there in the bib file. EDIT: Jag08 is actually the first entry. And some later entries in the bib file work without a problem. And in the tex file, most earlier and later citations work as well. I have therefore created a minimal example (all files are always in the same directory): tex:               \documentclass{book}     \usepackage{natbib}     \begin{document}     Test citation: \citep{Jag08}     \bibliographystyle{plainnat}     \bibliography{mytestbiblio}     \end{document}      and bib:               @article{Jag08,        author = {{de Jager}, O.~C. and {Djannati-Ata{\"i}}, A.},         title = "{Implications of H.E.S.S. observations of pulsar wind nebulae}",       journal = {ArXiv e-prints},     archivePrefix = "arXiv",        eprint = {0803.0116},      keywords = {Astrophysics},          year = 2008,         month = mar,        adsurl = {http://adsabs.harvard.edu/abs/2008arXiv0803.0116D},       adsnote = {Provided by the SAO/NASA Astrophysics Data System}     }      But when I run this example, everything works as expected (note that Jag08 is exactly the entry that makes the first problems in the large file). So my question would be: What _in your experience_ could cause these problems? I can neither post the whole files nor expect you to solve this, therefore I'm merely looking for directions of likely causes of this error.


title: Adjust font size on-the-fly

text: In my document I want to emphasize some key points by placing them in a box with rounded corners. This I do using the following code:               \documentclass{report}     \usepackage{fancybox}          \begin{document}          \ovalbox{     \begin{minipage}[c][.35\textwidth]{.5\textwidth} % [text in box][height][width]     \begin{center}     \begin{minipage}[c]{.9\textwidth}     This text might be too large to fit into the (.35x.50)$\cdot$textwidth box,     in which case the font size should be decreased to make it fit.     \end{minipage}     \end{center}     \end{minipage}     }          \end{document}      The dimensions of the box I would like to have fixed. When the text now becomes too big for the box, can I let LateX notice that and have it **adjust the font size** such that it does fit? I was made aware of this fit-text-into-given-box-by-adjusting-the-fontsize question, but have not been able to transform the answer it into a workable solution for me (i.e. getting an `\ovalbox` around it). Further have I noticed that paragraphs in the proposed solutions are not indented anymore, how can that be avoided?


title: How does \\ suppress spurious spaces while \par\noindent doesn't

text: I'm trying to build a description-list-with-header-line by using a macro. In the non-MWE, the macro adds additional value like index entries and margin notes, but here I have the simplest case possible.               \documentclass{article}     \newcommand{\pni}[1]{\item{#1} The name of the rose\par\noindent}     \newcommand{\dbs}[1]{\item{#1} The name of the rose\\}     \begin{document}     \begin{description}     \dbs{abc def}     A book that isn't about roses.          Another paragraph     \pni{abc def}     A book that isn't about roses, either.          Another paragraph     \pni{abc def}%     A book that isn't about roses, either.          Another paragraph\end{description}     \end{document}      The first line of the description item consists of a key and title; the rest is descriptive text in paragraphs. Now, it seems to me to be semantically better to use `\par\noindent` to get ready for the first paragraph of text, because this will obey 'other definitions' of paragraph-ness, as opposed to `\\\`, which is simply a line break. But as you can see, `\par\noindent` introduces a spurious space at the start of the new paragraph. ![enter image description here](http://i.stack.imgur.com/ZZBVG.png) I know I can suppress this by adding a `%` to my call, but I'd prefer to do this inside the macro. How? * * * In the light of the answers so far (with thanks and apologies to @DavidCarlisle and @egreg), here's a second MWE that more accurately reflects my case. I'm using `enumitem` with `memoir`, which I now see makes my original MWE a bit oversimplified. Here goes:               \documentclass{memoir}     \usepackage{tgpagella}     \usepackage{xparse}     \usepackage{enumitem}     \newlist{mfields}{description}{1}     \setlist[mfields]{%         font=\bfseries\scshape,leftmargin=!,labelwidth=3.5em,         labelsep=0.5em,itemindent=0pt,listparindent=\parindent}     \DeclareDocumentCommand{\mfield}{m m}{%         \item[#1]#2\par}     \DeclareDocumentCommand{\xfield}{m m}{%         \item[#1]#2\par\noindent\ignorespaces}     \begin{document}     \begin{mfields}     \mfield{abcdef}{The Name of The Rose}     A book that isn't about roses.          Another paragraph goes here etc.          \xfield{ghijkl}{The Island of the Day Before}     A book that isn't about roses, either.          Another paragraph goes here etc.          \xfield{mnopqr}{The Island of the Day Before}          A book that isn't about roses, either.          Another paragraph goes here etc.     \end{mfields}     \end{document}


title: \xspace and hyphenation

text: I was considering to use xspace for some common standard terms in my document, like:               \newcommand{\ring}{my secret ring\xspace}      I am now wondering, if hyphenation gets it right, when I do this?               \ring{}s      ### Notes That asked, I realize the existance of http://tex.stackexchange.com/a/86620/24158 and I probably should not use xspace at all and just use the normal definition, in which case I hope the hyphenation gets it right always. I also possibly should really define more terms instead of trickyly appending to them. But german has a bunch of postfixes, so that's not funny either. Not using a macro IS an option. I am trying to explore my viable options.


title: biblatex and tabular patching: error message

text: (/localhost/texlive/2011/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))     (/localhost/texlive/2011/texmf-dist/tex/generic/oberdiek/se-ascii-print.def)     (./TikZ-commands.tex)     (/localhost/texlive/2011/texmf-dist/tex/latex/biblatex/lbx/australian.lbx     (/localhost/texlive/2011/texmf-dist/tex/latex/biblatex/lbx/british.lbx     (/localhost/texlive/2011/texmf-dist/tex/latex/biblatex/lbx/english.lbx)))          ! Package biblatex Error: Patching 'tabularx' failed.          See the biblatex package documentation for explanation. Type  H <return>  for immediate help.  ...                                                                                l.251 \begin{document}                            ? H This is an internal issue typically caused by a conflict between biblatex and some other package. Modifying the package loading order may fix the problem. ?      I get the above error message when I compile a book manuscript using the `memoir` class and many packages under XeLaTeX. If I press on, I am able to compile the document but wish to remove the cause of this error. I do not explicitly use the `tabularx` package but do use `longtable`. I am able to supply more details but cannot make a minimal example just yet. I ma using TeXLive 2011 updated today and the vintage of `biblatex.sty` is               $Id: biblatex.sty,v 1.6 2011/07/29 19:21:28 lehman stable $  programmable bibliographies      EDIT: Sorry for not originally including the MWE; here it is:               \documentclass{memoir}     \usepackage{fontspec}     \usepackage[backend=biber,babel=none,language=australian,sorting=none,style=numeric-comp,hyperref=auto]{biblatex}     \usepackage{hyperref}     \begin{document}     This is a minimal working example for the bug reported at \url{http://tex.stackexchange.com/questions/30148/biblatex-and-tabular-patching-error-message}.     \end{document}      I get the same error message as reported above.


title: How to add two pictures in a single column? How to add four pictures in a single row?

text: I am doing a paper for an ACM conference and I want to add some graphics pictures. I want to add two pictures in a single column and four pictures in single row. How is it possible?


title: Overlapping columns in xymatrix

text: I have the following diagram: ![enter image description here](http://i.stack.imgur.com/WStvy.png)               \documentclass{article}     \usepackage{xypic,amsmath}     \DeclareMathOperator{\coker}{coker}     \DeclareMathOperator{\im}{im}     \newcommand{\subU}[1]{\left.#1\right|_U}     \begin{document}     \[     \xymatrix@C=7pt {     \subU{\ker\Theta_M^j} \ar@{^(->}[rr] &&      \subU{\widetilde M} \ar[rr]^-{\subU{\Theta_M^j}} \ar@{->>}[rd] &&      \subU{\widetilde M(jp^{r-1})} \ar@{->>}[rr] &&      \subU{\coker\Theta_M^j(jp^{r-1})} \\ &&&      \subU{\im\Theta_M^j(jp^{r-1})} \ar@{^(->}[ru]     } \]     \end{document}      which is spaced very awkwardly on the page. The image term in the bottom row should be in the center but the cokernel term at the end of the first row is big and the image term makes the column it's in bigger than it needs to be. So it ends up looking a little ugly. I think this would look a lot better if I could move the two `\widetilde M` terms closer together. The large space between them is there because the image term makes that column big. Is there any way to tell `xypic` to not worry about the overlap? Or if you have any other suggestions I'd love to hear them.


title: Can include text which conditionally appears depending on PDF viewer?

text: Can you have a message in a document which only appears when particular PDF viewers are used? I am using pdflatex to create a PDF document. I am including pdf image which, unfortunately, does not render correctly either in OSX Preview or Gnome Linux evince, but does render correctly on other viewers I have tried. When one of the offending viewers is used, I would like a warning message to appear in the caption of the figure.


title: Future of TeX and LaTeX

text: _Disclaimer:_ typically soft question. I was reading about `expl3` and `LaTeX3` development and try to stumble something about overall future of `LaTeX`. All I can find is one article. The article mostly covers the _output_ : fonts, encoding, hyphens, positioning; but I found no information of future of `LaTeX` internals: interaction with other languages (`luatex`, different `python` packages, `knitr` as a preprocessor), namespaces, more robust syntax, making `TeX` more functional with lazy evaluation and purity (I found `TeX` very similar to `Haskell` ideologically). Is there are any overview of this?


title: Error in built output

text: This is difficult for me with all these $ signs. Now, where is the problem in the following MWE?               \documentclass{article}%          \usepackage{amsmath}%     \usepackage{amsfonts}%     \usepackage{amssymb}%     \usepackage{graphicx}     \usepackage{comment}          \begin{document}          \varphi_{nk}(x,y) = \left\{     \begin{array}{c l}     1 & $x_{k}\succ_{n} y_{k}$\\     1/2 & $x_{k} \sim_{n} y_{k}$\\     0 & $x_{k}\prec_{n} y_{k}$     \end{array}     \right.          So \textit{n} is \varphi_{n}(x,y)= \sum_{k}\varphi_{nk}               \end{document}      Also a more general question related to Tex.sx. How can I copy the code to the question box, without having to press space bar 4 times for each line to indent it? As a follow up, in case I would like to insert the word 'if' in every case (piece) of the function above, how can I do so? Eg               ...1/2 & if $x_{k}\succ_{n} y_{k}$      doesn't seem to work as the 'if' is conjoined.


title: How do I change font in pgfplots with plain XeTeX?

text: I have tried:               \font\figfn="Myriad Pro:mapping=tex-text" at 8pt     \input tikz     \tikzset{font=\figfn}     \input pgfplots     \pgfplotsset{       width=\hsize,       compat=1.3,       every axis label={font=\figfn},       tick label style={font=\figfn},       label style={font=\figfn},       legend style={font=\figfn}     }     \tikzpicture[font=\figfn]     \axis[ybar,bar width=2pt,x tick label style={/pgf/number format/1000 sep=}]       \addplot coordinates {(2009,18) (2008,28) (2007,12) (2006,9) (2005,11)         (2004,12) (2003,4) (2002,4) (2001,5) (2000,10) (1999,5) (1998,2) (1997,4)         (1996,5) (1995,11) (1994,11) (1993,14) (1992,10) (1991,10) (1990,4)};       \addplot coordinates {(2009,13) (2008,15) (2007,13) (2006,16) (2005,11)         (2004,7) (2003,4) (2002,4) (2001,2) (2000,6) (1999,11) (1998,5) (1997,13)         (1996,10) (1995,3) (1994,6) (1993,16) (1992,15) (1991,15) (1990,7)};     \endaxis     \endtikzpicture     \bye      No font changes (you can see my growing frustration from the above code, where I try to apply the font in every place I can imagine).


title: Inserting citation to a http link in bibliography

text: I am a little confused, as to what is best way to cite a reference in the internet? I was trying to find if I could find any additional information about the reference. Here is the reference, I intend to put:               URL : http://www.ross.net/crc/download/crc_v3.txt      Author : Ross Williams      Title : A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS


title: verbatim with black background and white text

text: How could I set up a verbatim-environment which has   * black background   * white text in scriptsize ?


title: Aligning an equation

text: I have an equation like this:               \begin{equation}     \begin{split}     |a+bi|=\sqrt{a^2+b^2}\\      |a+bi|^2=a^2+b^2\\     |a+bi|^2=(a+bi)(a+bi)\\             =(a+bi)(a-bi)\\             =a^2+b^2i^2\\             =a^2+b^2     \end{split}     \end{equation}      the resualt looks like this: ![enter image description here](http://i.stack.imgur.com/JUO7T.png) How can I align this equation, that all of `=` symbols to be under each other


title: Curly Brackets - How to change the space between text and brackets

text: \documentclass[fleqn,12pt,a4paper]{article}     \usepackage{amstext, amsmath}     \newcommand{\lcurly}[1]{$\left\{\begin{array}{l}  #1   \end{array} \right.$}     \newcommand{\rcurly}[1]{$\left. \begin{array}{l}  #1   \end{array} \right  \}$}     \newcommand{\slcurly}[1]{$\left\{   \shortstack{#1} \right.$}     \newcommand{\srcurly}[1]{$\left. \shortstack{#1} \right  \}$}             \begin{document}        \lcurly{1 \\ 2} \rcurly{Line 1 \\ Line 2} \vspace{1cm} \\             \slcurly{1 \\ 2}  \srcurly{Line 1\\ Line 2} \\        \end{document}      I have a need to create curly brackets, I managed to do that with above shown code. I am attaching a screenshot. When I use array the text is evenly distributed vertically but the bracket appears little bit farther. When I change array to stack the bracket appears closer but the text is not nicely aligned. I was wondering if there is way to align the text as shown in the top image and make the bracket appear close like shown in the second part of the image. Thanks for your help![alt text](http://i.stack.imgur.com/YubEb.png)


title: How to pass an optional argument to an environment with verbatim content?

text: This is an attempt to make clear what happened in this question of xport (now deleted, sorry). The now deleted question included code that tried to make my answer to this question of xport work for _optional_ arguments, but the code failed. A shorter illustration: The following code doesn't compile if one removes the `[optional argument]`.               \documentclass{minimal}     \usepackage{listings,fancyvrb}          \newenvironment{Row}[1][]         {\VerbatimEnvironment          \begin{VerbatimOut}{\jobname.tmp}}         {\end{VerbatimOut}\lstinputlisting{\jobname.tmp}}          \begin{document}     \begin{Row}[optional argument]     \relax     \end{Row}     \end{document}      The error message says               ! FancyVerb Error:       Extraneous input `\relax ' between \begin{Row}[<key=value>] and line end      Of course, the optional argument (and in fact the whole construction) is utterly pointless here, but hey, it's a minimal example. To make the example in xport's question also work for optional arguments is quite interesting, I think. The question: What exactly is happening here, and how can one fix the code? (What I found out so far: `\begin{VerbatimOut}{\jobname.tmp}}` wants to see a linebreak immediately after it (try putting a `%`), and this somehow gets messed up by `\begin{Row}` looking for the optional argument.)


title: KOMA-Script: Use scrheadings on chapterpage, but only the footer (not the header)

text: I'm using the KOMA-Script and have page-numbers at the bottom of my document. The headline contains the chapter/section-name. By default, the chapterpagestyle is plain (or empty). So I set it to "scrheadings", because I want the page numbers at the bottom of a chapter-page. But now I also get the headsepline on the chapter-page, which is not very beautiful. This is my code so far:               \documentclass[a4paper]{scrbook}          \usepackage{scrpage2}     \clearscrheadfoot     \pagestyle{scrheadings}     % Head     \rohead{\raisebox{0.15em}{\textnormal \headmark}}     \rehead{\raisebox{0.15em}{\textnormal \headmark}}     \setheadsepline{.1pt}     % Foot     \cfoot{\raisebox{-0.5em}{ -- \, \textnormal{Page \thepage} \, --}}          % This is the line I want to modify:     \renewcommand*{\chapterpagestyle}{scrheadings}          % just for MWE     \usepackage{blindtext}          \begin{document}         \chapter{Something}             \Blindtext             \Blindtext         \chapter{Something else}             \Blindtext             \Blindtext     \end{document}      I commented the line which I assume has to be changed, but I did not figure out how…


title: Line spacing in report

text: I need your help. I'm using this command:               \renewcommand{\baselinestretch}{1.5}     \normalsize       to create a spacing between the lines. But I'm still not sure where to insert it, wether before the `begin{document}` or after or before each text? Because there is one paragraph in the four pages I wrote till now, where there is no line spacing and I don't know why. Or do you know another command which would apply for the whole text? A package probably? My code:               \documentclass[10pt]{report}     \usepackage[utf8]{inputenc}     \usepackage{titlesec}     \usepackage[left=35mm,right=35mm,top=35mm,bottom=35mm]{geometry}     \titleformat{\section}{\Huge\bfseries}{\thesection}{1em}{}     \titleformat{\chapter}{\huge\bfseries}{\thesection}{1em}{}     \titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{8.3ex plus .2ex}     \titlespacing*{\chapter}{0pt}{3.5cm}{2cm}     \linespread{1.5}     \begin{document}          \chapter*{Kapitel1}          \section*{Einleitung}          \subsection*{1.1 Motivation}          \begin{large}


title: Problem with margins and tables

text: Here is a picture of my problem : ![enter image description here](http://i.stack.imgur.com/A3sLo.png) As you can see, the table isn't well centered at all. I'd like the distance from the left margin to be equal to the distance from the right margin. Here is my latex code:               \begin{table*}[h!] \centering     \caption{Cette table indique pour chaque méthode si elles sont statistiquement meilleures qu'un classeur ne prédisant que la classe dominante pour la base de données "Nombre d'enfants".}     \begin{tabular}{|c|c|c|c|c|c|c|} % 7 colonnes     \hline     \textbf{Méthodes} & LapRLS & LapRKLS & LRreglog & Autolog & BagOfPath & RCTK % premiere    colonne     \\ \hline     \textbf{>=0.5501} & 5 & 0 & 5 & 5 & 0 & 5     \\ \hline\hline     SVM & SVMmoran & SVMgeary & LogisticReg & Logmoran & Loggeary & MultiVarLog     \\ \hline     5 & 5 & 5 & 0 & 0 & 4 & 1     \\ \hline     \end{tabular}     \end{table*}      Does anyone know how could I solve this problem ?


title: Turning off font subsetting in pdftex?

text: I give pdf files to a print-on-demand house (lulu.com) that is very picky about fonts. They want all fonts embedded, no multiply embedded fonts, and no subsetting. Recent versions of pdftex seem to automatically do all of this except that the pdfs produced do have subsetting. Currently what I'm doing is pdf->pdf filtering through ghostscript like this:               gs -q  -dCompatibilityLevel=1.4 -dSubsetFonts=false -dPDFSETTINGS=/printer -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=b.pdf a.pdf -c '.setpdfwrite'      This is slow, and it's also kludgy. Is there a better way to accomplish this? If this problem can be solved more easily by switching to luatex or xetex, I'm open to that, but I haven't been sure which one to hitch my wagon to, and these are large book projects that may be nontrivial to get working with something other the pdftex.


title: Can't get ledpar to work with section headings

text: I'm trying to create a bilingual critical edition with Latin on the left page and English on the right. I'm trying to figure out `ledpar` and I can't get the following example to compile. It compiles just fine if I comment out the two section headings, but with the section headings LaTeX throws the error on line 19 (which calls the `\Pages` macro) that says               You can't use \lastbox in vertical mode.       Here is the code I'm using:               \documentclass[10pt]{article}     \usepackage{ledmac, ledpar}     \begin{document}     \begin{pages}     \begin{Leftside}     \beginnumbering     \pstart     \section{blah}       lorem ipsum\pend     \end{Leftside}     \begin{Rightside}     \beginnumbering     \pstart     \section{blerg}     asdf.     \pend     \end{Rightside}     \Pages     \end{pages}     \end{document}


title: How to add caption for a TikZ picture?

text: I'm drawing a automaton figure, and I want to name it says 'M1' below the figure? A minimal example would be greatly appreciated. Thank you.               \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]          \node[state,initial]    (q_0)                   {$q_0$};          \node[state,accepting]  (q_1)   [right=of q_0]  {$q_1$};          \node[state]            (q_2)   [right=of q_1]  {$q_2$};               \path[->]         (q_0) edge                  node {a}            (q_1)         (q_1) edge                  node {$\lambda$}    (q_2)         (q_2) edge  [bend right]    node {$\lambda$}    (q_0)         ; %end path      \end{tikzpicture}


title: Environments for visually setting text apart

text: I have a document consisting of alternating paragraphs from different voices. Because the paragraph blocks look too much alike, I need some way to give the different parts a different look. I have already tried options such as changing to italics or bold face, but I do not want to hinder readability. I wonder if there other environments in which I can place the around some paragraphs or other visual elements which I can use to let readers easily know which part is which?


title: Overfull \hbox when using the mdframed package

text: **UPDATE: 2011-12-12** As of 2011-12-12, I can confirm this issue has been resolved on TeXLive-2011. * * * When using the `mdframed` package to generate nice frames for my chemical reactions, I encounter the ever-so-popular warning:               Overfull \hbox (20.79999pt too wide) in paragraph at lines 12--12      I'm assuming that it has something to do with the border generated by `mdframed`, but I'm unsure. My MWE is thus:               \documentclass[12pt]{article}          \usepackage[xcolor,linecolor=red]{mdframed}     \usepackage{showframe}          \begin{document}          \section*{Testing the \textsf{mdframed} Package}          \begin{mdframed}     Lorem ipsum dolor sit amet, consectetur adipiscing elit.     Duis et sem et tortor volutpat placerat id in mauris.     Suspendisse eget tellus sed sem aliquet pellentesque.     \end{mdframed}          \end{document}      My MWE renders: ![MWE for overfull hbox issue with mdframed](http://i.stack.imgur.com/aNFMh.png) Is there anyway to remedy this warning, or should I simply ignore it?


title: sidewaystable from rotating package cuts off table, even after changing margins

text: I'm using this code for my table:               \begin{sidewaystable}     {\small     \begin{tabular}{cccccccccccccccccc}     \toprule     \multicolumn{3}{l}{\texttt{Table 2}} \\     &&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16 \\     1&Data&1.0000 \\     2&Data&0.7685&1.0000 \\     3&Data&0.9929&0.6870&1.0000 \\     4&Data&-0.0216&0.0756&-0.0386&1.0000 \\     5&Data&0.1682&0.1553&0.1622&0.0823&1.0000 \\     6&Data&0.1066&0.1323&0.0965&0.7434&0.6545&1.0000 \\     7&Data&-0.1570&-0.0477&-0.1694&0.3213&0.2427&0.2640&1.0000 \\     8&Data&0.0039&0.1275&-0.0192&0.1459&0.2015&0.0787&0.8274&1.0000 \\     9&Data&-0.1124&-0.1614&-0.0977&0.0818&0.1552&0.2830&-0.5384&-0.6937&1.0000 \\     10&Data&0.1127&0.1826&0.0941&0.1503&0.1684&0.0683&0.8447&0.9113&-0.8103&1.0000 \\     11&Data&0.1331&0.2704&0.1009&0.1211&0.2973&0.0971&0.5977&0.6733&-0.6123&0.6838&1.0000 \\     12&Data&-0.2886&-0.1881&-0.2928&0.0119&-0.4912&-0.3414&-0.3289&-0.2965&0.0121&-0.3776&0.0198&1.0000 \\     13&Data&0.2114&0.1480&0.2126&-0.3154&-0.0074&-0.1077&-0.4319&-0.3966&0.3685&-0.4816&-0.4054&-0.0652&1.0000 \\     14&Data&0.5222&0.5811&0.4851&0.1099&-0.2678&-0.1150&-0.1544&0.0488&-0.1829&0.1368&0.1757&0.0065&-0.0244&1.0000 \\     15&Data&0.0968&0.1313&0.0855&0.1132&0.6050&0.3705&0.7226&0.5990&-0.3787&0.6492&0.6104&-0.4678&-0.2440&-0.2391&1.0000 \\     16&Data&-0.1973&-0.2324&-0.1809&-0.2069&0.2431&0.09601&-0.0418&-0.1090&0.2863&-0.1926&-0.2749&-0.2090&0.2203&-0.3292&0.0386&1.0000 \\     \bottomrule     \end{tabular}     }     \end{sidewaystable}      But the table is cut off from about column 11 onwards. I'm also using `\usepackage{fullpage}` because I need 1" inch margins. I've also tried using the `pdflscape` package, but as per this question that strategy is not successful either.


title: Question regarding add node with text within TkiZ package?

text: I followed an example from TikZ manual, and modify mine to add an extra node with text below a given node. This is the example from TiKZ manual, ![enter image description here](http://i.stack.imgur.com/zDUtF.png) And here is the code, ![enter image description here](http://i.stack.imgur.com/4Cdv5.png) So I modified my code to fit the example above,               \documentclass[10pt,letterpaper]{article}     \usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}      \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \def\xcolorversion{2.00}     \def\xkeyvalversion{1.8}          \usepackage{enumerate}     \usepackage[version=0.96]{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,automata,backgrounds,petri,positioning}     \title{\textbf{Solution for Chapter 1}}          \begin{document}     \setlength{\parindent}{0pt}     \setlength{\parskip}{1ex}     \maketitle          \begin{description}         \item[1.1] The following are the state diagrams for two DFAs, $M_1$, and $M_2$. Answer the following question          about each of these machines.\\              \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]         \node[state,initial]    (q_1)                           {$q_1$};          \node[state,accepting]  (q_2)   [right=of q_1]          {$q_2$};          \node[state]            (q_3)   [below right=of q_1]    {$q_3$};               \path[->]         (q_1) edge  [bend left]     node {a}            (q_2)         (q_1) edge  [loop above]    node {b}            (q_1)         (q_2) edge  [bend left]     node {a,b}          (q_3)         (q_3) edge  [bend left]     node {a}            (q_2)         (q_3) edge  [bend left]     node {b}            (q_1)              \node [below=4cm, text width=4cm] at (q_3)         {             something         }            ;         \end{tikzpicture}\\\          \end{description}     \end{document}      But the `pdflatex` compiler run forever, it's just freezed completely. I don't know where did I miss? It seemed logically correct. Any idea or suggestion? Thank you.


title: Formats for writing a thesis in Mathematics

text: What are the usual formats for writing a thesis in Mathematics in Latex ?


title: How do I refer Appendix in latex so as to display 'A' or 'B' in my paper

text: I want to refer appendix in my paper. Here is my sample latex code:               \section{hello1}     \label{h1}     bala.......          \section{hello2}     \label{h2}     bala.....          \appendix     \label{appendix}     \section{}     bala....      Here is what the appendix displays: ![enter image description here](http://i.stack.imgur.com/9mlKE.png) I use \ref to link sections and \eqref to refer equations, and \autoref to refer figs and tables. How do I refer appendix to display 'A' in papers? Thanks so much.


title: Using PSTricks with TeXmaker

text: I want to do some drawings using LaTeX. I use TeXmaker. What the commands that I need to set up to start using the PSTricks?


title: Figure refs stop working after I added a new counter

text: I was using the `amspset` document class for generating exam practice problems. I had wanted to add some referencing to the problems so I started a new counter like this (adapted from some Tex Exchange post)               \newcounter{P}     \newcommand{\plb}[1]{\refstepcounter{P}\label{#1} \textbf{P-\ref{#1}.}}          \begin{problem}     \plb{p1}     A parallel-wire transmission line is constructed of \#6 AWG copper wire     (diameter $d=0.162$ in., conductivity $\sigma_c=5.8\times 10^7$ S/m) with a     12-inch separation in air. Assuming no leakage between the two wires, find     $R'$, $L'$, $G'$, and $C'$. Assume a working frequency of 1 MHz.     \end{problem}          \begin{solution}     Using Table.~\ref{tab:tlparam} and Fig.~\ref{fig:tlempl},      \[ Rs = \sqrt{\pi f \mu_c/\sigma_c} = 2.61\times10^{-4}~ \Omega\]     \[ R' = \frac{2R_s}{\pi d} = 4.04\times10^{-2} ~\Omega\text{/m} \]     \[ L' = \frac{\mu_0}{\pi} \ln{\frac{2D}{d}}=2.0~\mu \text{H/m} \]     \[ C' = \frac{\pi \epsilon}{\displaystyle\ln{\frac{2D}{d}}}=5.56 ~\text{pF/m}     \] $G'=0$ because the problem states that there is no leakage between the two     wires.     \end{solution}          \begin{figure}[ht]     \begin{centering}         \includegraphics{fig24}         \caption{(Fig.2-4 from FAE) A few examples of transmission lines.}     \end{centering}     \label{fig:tlempl}     \end{figure}          \begin{table}[ht]     \caption{(Table 2-1 from FAE)Transmission-line parameters $R'$, $L'$, $G'$,     and $C'$ for three types of lines.}         \begin{tabular}{c}             \hspace{3cm}\includegraphics{tb21}         \end{tabular}     \label{tab:tlparam}     \end{table}     ... and more      Now all the figure references stop working, I get "Fig. " instead of "Fig. 1". The table references are alright though. Any idea what the problem could be?


title: How to add sentence before list of tables, figures, and appendices?

text: Somebody help me to fix this problem. How to add sentence or text before list of table, figure, and appendices. The format should be like this.                                               LIST OF FIGURES             FIGURE                          TITLE                                      PAGE      Anyone please help me to solve this problem


title: Setting default paper size

text: I work in a company that produces its product manual using Latex and have developed standard ways of generating a `.pdf` document from a `.tex` file. One or two of us have installed the CTAN build 2013 package over the CentOS default rpms. The rest of users are using the default CentOS LaTeX RPMS which are quite out of date as they're from the CTAN 2007 build. I had come across a problem where documents were defaulting to US paper size format even though I was using the following `\documentclass` in the TeX file header:               \documentclass[DIV=12,paper=A4,twoside]{scrartcl}      I thought that the statement               paper=A4      ensured that the formatting of the document output was A4. This was not the case! I found that the page size was still shown as 'US Letter' in the document properties in the pdf viewer. On the machines that had CTAN build 2013 package installed (and where the directory path was correctly set to ensure that the 2013 CTAN build was used) it was relatively simple thing to change the default paper size for the LaTeX environment using the command               tlmgr paper a4      However this command is not available where the LaTeX has been installed from the CentOS RPMS. Apparently it's not possible to install this utility on its own. Is there a command to specify the A4 page size as a global default when you don't have the `tlmgr` command available. One solution might be to use a command like               \usepackage[a4paper]{geometry}      In the `.tex` header file that would ensure that A4 paper size is always used however I need to be sure that it won't interfere (or override) with the Koma `scrartcl` document class? I'd be very interested to get advice and thoughts from other users who've had this issue.


title: tikz separate elements instead of drawn into each other

text: I am using tikz to draw graphs like this : The result is fine if I use only one(!) of them :                     \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm,thick,main node/.style={circle,fill=white!20,draw,font=\sffamily\Large\bfseries}]            \node[main node] (1) {v1};       \node[main node] (2) [below left of=1] {v2};       \node[main node] (3) [below right of=2] {v3};       \node[main node] (4) [below right of=1] {v4};            \path[every node/.style={font=\sffamily\small}]         (1) edge node [left] {} (2)         (2) edge node [right] {} (3)         (3) edge node [right] {} (4)         (4) edge node [left] {}(1);          \end{tikzpicture}      Result: Bild 1 ![enter image description here](http://i.stack.imgur.com/0xsq1.png) And the other one:                    \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm,thick,main node/.style={circle,fill=white!20,draw,font=\sffamily\Large\bfseries}]            \node[main node] (1) {v1};       \node[main node] (2) [right of=1] {v2};       \node[main node] (3) [right of=2] {v3};            \path[every node/.style={font=\sffamily\small}]         (1) edge node [left] {} (2)         (2) edge node [right] {} (3);               \end{tikzpicture}      result: ![enter image description here](http://i.stack.imgur.com/pkL8E.jpg) But if the code above is used together in the same code I get this weird result : Bild 3 ![enter image description here](http://i.stack.imgur.com/Knhn7.png) So the drawing are mixed into each other. How can I separate the drawing? Thanks!!!


title: Sorting bibliography references using the Vancouver style

text: I am new to LaTeX and I would like to be able to sort my references with the Vancouver style but I don´t know if I need to include some libraries or do something else? I have searched around the web but I am very confused, I have found something like this                \cite{key} ==>>          [#]      but it does not work, I hope you can help


title: How to expand a macro used in the range of a foreach loop?

text: # Motivating Example: Suppose that I want to draw the following tree:                   root       /      \      / \     / \     A   B   C   D      This is easy enough to do by explicitly drawing the two subtrees as `child`ren of the root `node` and using a `child foreach` in _each_ subtree to draw the leaves. For instance:               \documentclass{standalone}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}       \node {root} [level/.append style={sibling distance=2cm/#1}]         child {           coordinate           child foreach \x in {A,B} {             node {\x}}}         child {           coordinate           child foreach \x in {C,D} {             node {\x}}};     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/7NmXM.png) However, even in this simple example, a fair amount of code is duplicated across the two subtrees. If the leaves were more complex, code duplication would be an even bigger disadvantage. An alternate idea for drawing this tree attempts to use nested `child foreach` constructs to reduce the code duplication:               \documentclass{standalone}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}       \node at (5cm,0) {root} [level/.append style={sibling distance=2cm/#1}]         child foreach \xs in {{A,B}, {C,D}} {           coordinate           child foreach \x in \xs {             node {\x}}};     \end{tikzpicture}     \end{document}      Unfortunately, this code produces the wrong tree structure: ![enter image description here](http://i.stack.imgur.com/G1258.png) Interestingly, Martin Scharrer's answer to TikZ \foreach loop with macro- defined list suggests that the code should work as is. The only difference that I can see is that that question uses `\foreach` rather than `child foreach`. # Problem: The underlying problem seems to be that `\xs` is not expanded before the inner loop is executed. As a result, TikZ is treating the inner loop as having a range that is a singleton set, namely `\xs` (unexpanded). If `\xs` could be expanded before the inner loop is executed, then TikZ should treat the inner loop as having a range that is `{A,B}` in one case and `{C,D}` in the other case. # Question: How can I expand a macro, such as `\xs` above, used inside the range of a `foreach` loop?


title: renderize yfonts without the pixels signs

text: how can i renderize this initials without the pixels signs but like the normal font? http://www.tug.dk/FontCatalogue/baroqueinitials/


title: Accent problem using texstudio latex

text: What is the problem with this code? I am working on Mac OS X.               \documentclass[a4paper,16pts,notitlepage]{report}     \usepackage{amsfonts}      \usepackage{amsfonts}     \usepackage{graphicx}     \usepackage[utf8]{inputenc}     \usepackage{amssymb}     \usepackage[applemac]{inputenc} % pour les accents     \title{Rapport d'avancement}      \author{XYZ}      \begin{document}     \maketitle     \begin{center}       blalalal     \end{center}     \thispagestyle{empty}          \newpage     \section{État de l'art}     \section{Description du système}     \section{Algorithme}     \section{Résultats}     \section{Analyses et discussions}     \section{Conclusions et perspectives}     \end{document}


title: Add separate list of appendices

text: How to add separate list of appendices? Urgent, I need somebody help me to solve this problem. I try to write the program as shown below, but it doesn't work.. Program:               \renewcommand\listofappendix{     \btypeout{Listofappendices}     \addtotoc{LIST OF APPENDICES}     \begin{spacing}{1}{      \setlength{\parskip}{0pt}      \if@twocolumn        \@restonecoltrue\onecolumn      \else        \@restonecolfalse      \fi      \chapter*{\listappendixname        \@mkboth{            \MakeUppercase\listappendixname}{\MakeUppercase\listappendixname}}      \@starttoc{loa}      \if@restonecol\twocolumn\fi      \cleardoublepage      }\end{spacing}      Main program file to compile the latex.               \lhead{\emph{Listofappendices}}       \listofappendix


title: Temp file fails verification every time I try to update MiKTeX

text: I have been using TeX for two years now, mostly as a replacement for Word. I'm an academic and I like the typesetting capability, especially when I need to use math, but am not an advanced user. I attempted to update my distribution recently because I was able to glean from other questions on this site that doing this would likely solve another problem I had. When the update failed, I looked for solutions here and found none, so I uninstalled and reinstalled MiKTeX (using Protext). Then I ran into the same problem again when trying to update the distribution. I tried several different mirrors (med.harvard, bay.chicago, and most recently mackichan) and got a similar error each time. My system is a Vista 64-bit. The log file is pasted below:               MiKTeX Update Wizard Report          Version: 2.9.4497     Date: Tuesday, May 21, 2013     Time: 13:01:19     starting package maintenance...          installation directory: "C:\Program Files\MiKTeX 2.9"          package repository: http://ctan.mackichan.com/systems/win32/miktex/tm/packages/          lightweight database digest: c037a7e4ea61280289db1153192ca40a          going to download 10661531 bytes          going to install 10 file(s) (1 package(s))          going to remove 44 file(s) (2 package(s))          downloading h ttp://ctan.mackichan.com/systems/win32/miktex/tm/packages/miktex-bin-x64-2.9.tar.lzma...          10661531 bytes, 483.70 KB/Sec          visiting repository h ttp://ctan.mackichan.com/systems/win32/miktex/tm/packages/...          repository type: remote package repository          loading lightweight database...          downloading h ttp://ctan.mackichan.com/systems/win32/miktex/tm/packages/miktex-zzdb1-2.9.tar.lzma...          132563 bytes, 322.83 KB/Sec          lightweight database digest: c037a7e4ea61280289db1153192ca40a               Error: The operation could not be completed because the following file failed verification:                    C:\Users\Sam\AppData\Local\Temp\mik8748.tmp


title: Beamer figure grows larger when pointing on it

text: I am working on a beamer presentation where I would like to place a couple of graphs on one slide. The resolution is however not sufficient and I was wondering if it would be possible to enlarge the graphs to the full screen size if pointing with the cursor?


title: Access loop variable outside loop

text: Here's what I have created, but how could I access the loop variable `\n` outside the foreach loop so that I could write sth like this:               \n = \n + 1 % this is definitely not right, and it seems I couldn't reference \n outside foreach loop     \node[element,fill=white,xshift=\n*1cm](l_N\n){...};      instead of hardcoding the value. This is the complete code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning,calc}          \begin{document}          \begin{tikzpicture}[remember picture,       element/.style={rectangle,draw,fill=red!20,minimum width=1cm,minimum height=1cm},       outer/.style={circle,draw=green,fill=green!20,thick,inner sep=10pt,minimum size=7cm}       ]       \node[outer,draw=green] (A) {         \begin{tikzpicture}           \foreach \i [count=\n] in {0, 1, ..., 3}              \node[element,xshift=\n*1cm](l_N\n){\i};                     \node[element,fill=white,xshift=5*1cm](l_N5){...};           \node[element,xshift=6cm](l_N9){9};         \end{tikzpicture}       };       \node[outer,draw=green,right=of A] (B) {         \begin{tikzpicture}           \foreach \i [count=\n] in {0, 1, ..., 3}              \node[element,xshift=\n*1cm](r_N\n){\i};                \node[element,fill=white,xshift=5*1cm](r_N5){...};           \node[element,xshift=6cm](r_N9){9};         \end{tikzpicture}       };     \draw[thick,dashed] (l_N9) -- (r_N1);     \end{tikzpicture}          \end{document}      The result: ![enter image description here](http://i.stack.imgur.com/nRkmf.png)


title: jurabib: every field in a new line

text: I'm trying to make use of some of the features of jurabib-package which are quite essential for me now. But I'm still facing one problem: I use the package with the `bibformat=tabular`, which nearly gives me the result I'm looking for; the one thing I'm still missing is to be able to output every single field from the bib-file in a _separate_ , so in a new line (which would make it even more "tabular"). Unfortunately, I couldn't find no native option (here) to realize this. So instead, there might be a way to do this by editing some of the jurabib style / bst files i recon, but I've got no clue where and what to do. So again, this is the bibliography-look I want to achieve:               **Bibliography**          Lastname, Firstname      Title                              Edition                              Adress                              etc.      (of course, this should apply to all the different entry types which do exist) In case it's helpful, here is a MWE which I tried to create from my (huge) tex file:               \documentclass[       widefront,       tightfn     ]{jura}          \usepackage[utf8]{inputenc}     \usepackage[ngerman]{babel}          \usepackage[see]{jurabib}          \jurabibsetup{       titleformat={commasep,all},       commabeforerest,       crossref={long,dynamic},       howcited=compare,        pages={always,test},        bibformat={tabular,ibidem},       lookforgender,       dotafter=bibentry,     }     \citetitlefortype{article,periodical,incollection}     \formatpages[~]{article}{(}{)}      \formatpages[~]{incollection}{(}{)}     \renewcommand{\bibjtsep}{In: }      \renewcommand{\bibbtsep}{In: }      \renewcommand*{\bibpldelim}{(}     \renewcommand*{\bibprdelim}{)}     \renewcommand*{\bibleftcolumn}{\textwidth/3}     \DeclareRobustCommand{\jbaensep}{,}     \DeclareRobustCommand{\artnumberformat}[1]{(#1)}     \AddTo\bibsgerman{\def\ajtsep{}}               \begin{document}          \frontmatter          \bibliography{bibliography}     \bibliographystyle[{jurabib}          \newpage          \mainmatter          \cite{testbibkey}          \end{document}


title: Purpose of \do@noligs in LaTeX verbatim environment

text: I'm trying to figure out how the verbatim environment works. In the basic LaTeX file `latex.ltx` I find the following definition (line 4037):               \def\verbatim@nolig@list{\do\`\do\<\do\>\do\,\do\'\do\-}     \def\do@noligs#1{%       \catcode`#1\active       \begingroup          \lccode`\~`#1\relax          \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1}}}     \def\@noligs{\let\do\do@noligs \verbatim@nolig@list}      What is the purpose of the macro `\do@noligs`? Further, how does it work? In the above code, I have problem understanding:   * `\lccode`\~`#1`   * why use the `\lowercase` control word?   * why `\endgroup` after the opening brace `{`?   * why `\leavevmode`?   * why `\kern\z@`?


title: McKinsey curve in pgfplots (creating continuous cost curves)

text: I'm trying to recreate the Mckinsey curve in `pgfplots`: ![mckinsey curve](http://i.stack.imgur.com/jSlQh.jpg) I'm not sure I understand how to control the `\addplot` with bar graphs completely (how to make each bar graph stand next to each other using `bar width`, `bar shift`, and plot coordinates. I've included my attempt to start it: I plan to create a continuous bar graph to create a cost curve. So I would define a bar graph closely to each other. In addition, I'm trying to figure out how to add labels with lines for each bar graph.               \documentclass{article}          \usepackage{pgfplots}     \usepackage{pgfplotstable}          \begin{document}               \begin{tikzpicture}          \begin{axis}[ybar,axis lines=left,     width=6in,     ymin=-190, ymax=40,     xmin=0, xmax=4200]               \addplot+[ybar interval, range=-190:40l] plot coordinates     {(0,-189.6580431) (100,20) (220,10) (330  ,0 )}     ;                    \end{axis}     \end{tikzpicture}          \end{document}      UPDATED: I have updated the code above to include one of the comment's suggestions of using `ybar interval`. The last additional piece would be to add bar labels with lines for say x>1.


title: How to bend more than 90 degree?

text: \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning}     \begin{document}     \begin{tikzpicture}     \node(a){test};     \node(b)[below=5cm of a]{test2};     \draw[red,bend right=90](b.east)to(a.east);     \end{tikzpicture}     \end{document}      This is a simple question, I'm searching for a way to bend the line more than 90, ideally the line should make a bigger detour. How should I do it? Here is what I mean: ![Image of bending](http://i.stack.imgur.com/Of2lY.png)


title: How to change the font style in right header

text: I want to change the font style in the right header. Currently it is in capital letters and also shows the chapter number in addition to the name as in the image below. I want to show only the name of the chapter in heading style i.e. the first letter of a word is capital and all others small. My MWE is attached. ![enter image description here](http://i.stack.imgur.com/dgzdp.png)               \documentclass[12pt]{scrreprt}     \usepackage{booktabs}     \usepackage[explicit]{titlesec}     \usepackage{tikz}     \usetikzlibrary{calc}          \DeclareFixedFont{\chapternumberfont}{T1}{ppl}{m}{n}{1.5in}          \newcommand\brectangles{%     \begin{tikzpicture}[overlay, remember picture]     \fill[red!60!blue!50!green!120]%[red!60!blue!50!green!150]%        (current page.north west) rectangle ( $ (current page.north east) + (0,-7cm) $);     \fill[red!60!blue!50!green!120]%[red!60!blue!50!green!150]%        (current page.south west) rectangle ( $ (current page.south east) + (0,3cm) $);     \end{tikzpicture}%     }          \titleformat{\chapter}[display]       {\Large\bfseries\ssfamily\color{white}}%\scshape       {\thispagestyle{empty}\brectangles}       {-2in}       {%       \vskip-4ex\filcenter {\small\MakeUppercase{Project on Compilation of...}}\\[2ex]       \parbox[b]{.65\linewidth}{#1}%       \raisebox{0.8in}{\parbox{.15\linewidth}{\large\chaptertitlename}}%       \parbox[b]{.2\linewidth}{\chapternumberfont\thechapter}%       }       [\vspace*{1in}]          \titleformat{name=\chapter,numberless}[display]       {\Huge\bfseries\color{white}} %sffamily\       {\thispagestyle{empty}\brectangles}        {-2in}       {\parbox[b]{.65\linewidth}{#1}}       [\vspace*{1in}]               % for fancy header & footer                 \usepackage{xcolor}%                 \usepackage{fancyhdr}                         \pagestyle{fancy}                         \lhead{Statistics}                         \lfoot{ LHS }                         \rfoot{\includegraphics[width=20pt]{logo}}                         \renewcommand{\headrulewidth}{1pt}                         \renewcommand{\footrulewidth}{1pt}               %for quotes                 \usepackage{csquotes}          % for hyperrefrences     \usepackage{url}                 \usepackage[linktoc=all]{hyperref}                         \hypersetup{                                 colorlinks,                                 citecolor=black,                                 filecolor=black,                                 linkcolor=black,                                 urlcolor=blue                                                     }          % for line spacing                         \renewcommand{\baselinestretch}{1.15}          %for indenting paragraphs     \setlength{\parskip}{1em}          %for drop caps                 % works with pdfLaTeX                 \usepackage{type1cm} % scalable fonts                 \usepackage{lettrine}               % FOR CALLIGRAPHIC FONTS                 \usepackage{calligra}                 \usepackage[T1]{fontenc}          \renewcommand{\arraystretch}{2}               \begin{document}                    \tableofcontents     \pagenumbering{roman}          \pagestyle{empty}% no page numbers     \pagestyle{plain}          \pagestyle{fancy}     \pagenumbering{arabic}          \chapter {Introduction}     \chapter {Introduction}          \clearpage          \section{Right header is in capitals, how to change in normal font}          \section {Background}          \appendix          \chapter{Appendix-Workers' Remitances}          \section{Ahmad}          \section{Ahmad again}          \chapter{Ahmad yet again}          \section{Ahmad once more}     \end{document}


title: how to change the footnote text color in ConTeXt?

text: The default color of footnote texts is black, if I want to change it into red, how can I achieve this? I have used the               \setupfootnotes       [textcolor=red]      or               \setupfootnotes       [foregroundcolor=red]      or               \def\myfootnotetextcolor#1{%       \startcolor[red]#1\stopcolor}     \setupfootnotes       [textcommand={\myfootnotetextcolor}]      either method has no effect.


title: How do I write a solid plus sign?

text: How do I write a solid plus sign, like the American Red Cross symbol/logo? I'm a novice, so I'm not very good at going to CTAN archive and downloading and installing business -- it doesn't work half the time. So it would be nice if it doesn't involve too exotic packages. **Edit** : I would like to use it in math mode.


title: Problems with multiple \starthanging \stophanging in ConTeXT

text: I'm trying to place multiple figures with additional side text using ConTeXT one after the other. When there are two figures in a row they overlap. How should they be separated? The following code creates overlapping figures when I run ConTeXT.               \starthanging{     \placefigure[force][fig:first]{Caption 1} {\externalfigure[first-figure][width=\textwidth]}}     \inother[width=5cm]{Some text for the other bit}     \stophanging          \starthanging{     \placefigure[force][fig:second]{Caption 2} {\externalfigure[second-figure][width=\textwidth]}}      \inother[width=5cm]{Some text for the other bit 2}     \stophanging      What I'm trying to do is this: ![enter image description here](http://i.stack.imgur.com/OyQHy.png)


title: Have something like figure but with its own counter and listof

text: Given the following MWE:               \documentclass[english]{scrartcl}          \usepackage{syntax}          \begin{document}          \begin{figure}       \begin{grammar}         <example> ::= \[[ \lit{def} <identifier> \lit{=} <expr> \]]       \end{grammar}       \caption{an example grammar}       \label{grm:example}     \end{figure}          \listoffigures          \end{document}      This draws me a nice (partial) definition of the non-terminal “example” in a fictive language and I can see it in the list of figures at the end. But in the real document there are also other figures, which should be in another listofwhatever. So how can I define such environments by myself with the corresponding counters and lists? **edit** If it matters: I am using xelatex 3.1415926-2.5-0.9999.3-2013060708 (TeX Live 2013).


title: Kile installation not working properly

text: I spent the last two weeks downloading and installing the Kile editor for Windows 7 (64 bit). I did everything I could imagine, but still I can't get Kile to work. I downloaded the installer, and many packages I didn't find either `Qt.exe` among them nor a Configuration program. What should I do now to fix this?


Currently I am using LaTeX to typeset all my math reports. Recently I found out that LyX also uses LaTeX, which can also generate PDF, accept commands from LaTeX, but is easier to use as it does not flood all the commands in one page. Question: What is the difference between LyX and LaTeX?