title: endnote indentation equal to bibliography

text: I am using `endnote` to place my footnotes as endnotes at the end of my book and `natbib` for my bibliography. As such, i want both list to have the same indentation. I know I can set the indentation of endnotes as such:               \def\enoteformat{\rightskip=0pt \leftskip=0pt \parindent=1.8em     \leavevmode\llap{\makeenmark}}      but wonder how to get the settings used in `natbib`. MWE:               % endnotes     \usepackage{endnotes}     \let\footnote=\endnote     % bibliography     \usepackage[super, longnamesfirst, sort&compress]{natbib}     \setlength{\bibsep}{0.0pt}          \begin{document}          \endnote{testendnote} and \citep{testcite}          % the endnotes     \theendnotes     % the bibliography     \bibliographystyle{ieeetr}     \begin{thebibliography}{99}      \bibitem{testcite} Bloggs, J., The Journal of Stuff, 2012      \end{thebibliography}           \end{document}


title: When converting PDF to EPS, how to prevent pdftops from rasterizing fonts and transparent regions?

text: Compiling the following code               % Circle.tex     \documentclass[cmyk]{minimal}     \usepackage{pstricks}     \pagestyle{empty}          \topmargin=-72.27pt     \oddsidemargin=-72.27pt     \topskip=0pt     \parindent=0pt          \def\Constant{1}     \paperwidth=2\dimexpr\Constant cm\relax     \paperheight=2\dimexpr\Constant cm\relax          \special{papersize=\the\paperwidth,\the\paperheight}          \begin{document}     \pspicture(-\Constant,-\Constant)(\Constant,\Constant)     \rput(0,0){$E\not=mc^2$}     \pscircle*[linecolor=blue,opacity=0.5](0,0){1}     \endpspicture     \end{document}      with               rem batch.bat takes a file name without extension.     latex %1     dvips -D10000 -t unknown %1     gswin32c -dCompatibilityLevel=1.5 -r10000 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%1.pdf %1.ps     pdftops -eps %1.pdf      will yield a diagram as follows. ![enter image description here](http://i.stack.imgur.com/HKkL2.png) When I import the diagram from within the following main TeX input file,               % Main.tex     \documentclass[cmyk]{minimal}     \usepackage{graphicx}          \begin{document}     \includegraphics{Circle.eps}     \end{document}      and compiling it with the same batch file, I got a result as follows. ![enter image description here](http://i.stack.imgur.com/mNsq1.png) ## Question Using one of the following batches to compile `Circle.tex`               rem MethodA.bat takes a file name without extension.     latex %1     dvips -D10000 -E %1 -o %1-temp.eps     epstool --copy --bbox %1-temp.eps %1.eps     gswin32c -dCompatibilityLevel=1.5 -dEPSCrop -r10000 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%1.pdf %1.eps                    rem MethodB.bat takes a file name without extension.     latex %1     dvips -D10000 %1 -o %1-temp.ps     ps2eps %1-temp.ps     epstool --copy --bbox %1-temp.eps %1.eps     gswin32c -dCompatibilityLevel=1.5 -r10000 -dEPSCrop -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=%1.pdf %1.eps      and compiling `Main.tex` with `batch.bat` can fix the issue. Because the conversion is done in reversed order, i.e., EPS first then converted to PDF. Thus the source of problem is `pdftops` as it rasterizes the EPS whenever the PDF contains transparent regions. So, the question is: Is there an option or switch to avoid getting jagged outlines when using `pdftops`? ## Note: I insist on using `batch.bat` because it is usually very efficient in consuming time and media storage. Jagged EPS produced by `batch.bat` apparently becomes larger than ones produced by both `MethodA.bat` and `MethodB.bat`. A sad day!


title: Table of content and header

text: I have table of content in my document and header/footer with section, subsection marks. When I include tocloft package I don't have header/footer anymore, that is not I want. On the other hand, I want to control spacing in the toc. Another problem is that the toc leave a subsection mark in a header/footer. MWE               \documentclass[12pt]{article}          \usepackage{lipsum}     \usepackage{fancyhdr}     %\usepackage{tocloft} % Uncomment this line          % -----------------------------------------------------------------------------     \pagestyle{fancy}     \fancyhf{} % clear all header and footers     \renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}}     \renewcommand{\subsectionmark}[1]{\markright{\thesubsection\ #1}}     \fancyhead[L]{\rule[-0.25in]{0pt}{0.25in}\parbox{0.9\textwidth}{%       \textbf{\leftmark\\\rightmark}}}     \fancyhead[R]{\thepage}     \fancyfoot[L]{\rule[-0.25in]{0pt}{0.25in}\parbox{0.9\textwidth}{%       \textbf{\leftmark\\\rightmark}}}     \fancyfoot[R]{ \thepage}     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0.4pt}          \begin{document}     \tableofcontents     \section{Section1}     \lipsum[4-8]     \newpage     \section*{Section2}     \lipsum[4-8]     \newpage     \section{Section3}     \lipsum[4-8]     \section*{Section4}     \lipsum[4-8]     \end{document}


title: pstricks multido variable not accepted

text: the following Example does not work:               \documentclass{article}     \usepackage{pst-all}          \begin{document}          \def\FF{x 3 exp 4 mul 3 div x sub 1 add}     \def\AbFF{x 2 exp 4 mul 1 sub}     \begin{pspicture}(-2.5,-2)(2.5,4)     \psaxes[Dx=1,Dy=1]{->}(0,0)(-2,-1.5)(2.2,3.7)[$x$,0][$y$,90]     \psplot[plotstyle=curve,linewidth=1.5pt]{-1.3}{1.2}{\FF}% postscript function     \def\xs{-1}     \multido{\r=-1+0.5}{5}{     \psplotTangent{\r}{1.3}{\FF}     \psdot[dotscale=1.2](! \r /x \r def \AbFF)     }     \end{pspicture}     \end{document}      The problem ist the second \r in the line:               \psdot[dotscale=1.2](! \r /x \r def \AbFF)      If I replace it with a number, then everything works fine.


title: Problem with macro definition spaces of index and superscript

text: I have defined a command `FZ` for defining mathematical symbols:               \newcommand{\FZ}[1]{\textcolor{blue}{\ensuremath{#1}}\xspace}      I want to define a Symbol `CV` first and then create some variants with different indices like `CV_D`, `CV_{D,\,\mathrm{Gr}}`... To make that consistently, I tried to define it "stepwise", but then I get problems with the spacing. See minimal example:   * how can I get the `D` closer to the `CV` like in the black version which is "directly" typeset?   * how can I get the "Gr" on the same height as the index "D"? ![screenshot of ME](http://i.stack.imgur.com/1exUn.png) Minimal example:               \documentclass{scrbook}     \usepackage{color, xspace}          \newcommand{\FZ}[1]{\textcolor{blue}{\ensuremath{#1}}\xspace}          \newcommand{\CV}{\FZ{CV}}     \newcommand{\CvD}{\FZ{\CV{}^{*}_{D}}}        \newcommand{\CvDGr}{\FZ{\CvD_{,\,\mathrm{Gr}}}}          \begin{document}          \CV          \CvD          wish: $CV_D$          \CvDGr          wish: $CV^{*}_{D,\,\mathrm{Gr}}$          \end{document}


title: Where can I find good ConTeXt documentation

text: Where would be a good place to start learning ConTeXt if you haven't got a lot of experience under your belt yet? Any place online or in a bookstore is welcome, provided that the reading is well-structured, well-written and beginner-friendly. I know there is quite a heap of "official documentation", including "ConTeXt, an excursion", the official handbook and the contextgarden.net Wiki. Still, often ConTeXt novices find it very difficult to get a good start with the documentation provided -- the command syntax seems to work sometimes, sometimes not; some commands work well with each other, others only in a specific order (which isn't documented anywhere) and some don't work with each other at all etc. The consequence is that there is a lot of experimenting with the code while the focus should be on the topic to be published itself. This question would love to get **RTFM** answers, so please point out any **M** s which should **TF** be **R**.


title: Bibliography resources not printed

text: I am using biblatex to display the bibliography. I added this code after `\documentclass`:               \usepackage[style=numeric]{biblatex}     \addbibresource{Bibliografia/bibliografia.bib}      Before the end of the document I print the bibliography and the heading:               \printbibheading     \printbibliography      I also use the `\cite` command to cite the only element that I have inside my bib file:               @article{A survey of shading models,         author={Karsten Schwenk},         title={A survey of shading models},         year={2011},     }      But the bibliography is not shown, just the heading: ![enter image description here](http://i.stack.imgur.com/Y02qr.png)


title: How to globally adjust horizontal spacing in table? @{length}

text: I want to adjust the horizontal spacing between vertical lines and the cell content in a `tabular` table. I could do it for each column with `@{length}l@{length}` (e. g. with \,), but there must be a more elegant way to do it globally for the whole table on the left and right side of each cell. Example:               \documentclass[11pt, a4paper]{scrartcl}     \usepackage[margin=2.5cm]{geometry}     \usepackage{tabularx}     \begin{document}          \begin{tabular}{|p{2cm}*{4}{|@{\,}p{1.5cm}@{\,}}|@{}l@{}|}     \hline     1 & 2 & 3 & 4 & 5 & 6\\     \hline     word & word & more words & more and more words & longtext longtext longtext & verylongword \\     \hline     \end{tabular}     \end{document}


title: Inserting a small vertical space in a table

text: Is there a way that I can insert a small space in a table? When I use a superscript, the number touches the `\hline`.               \documentclass[9pt,letterpaper]{article}     \usepackage{helvet}     \renewcommand{\familydefault}{\sfdefault}          \begin{document}     \begin{picture}(0,0)          \put(20,-136){\mbox{                 \footnotesize                \begin{tabular}{ p{8em}  r  r  l }               \hline                                   & Total     & Average   & Unit   \\             \hline                   Area1           & 419773    &   9.15        &  \emph{m$^2$}      \\                   Area2           & 0     &   0       &  \emph{m$^3$}      \\             \hline               \end{tabular}         }}            \end{picture}          \end{document}      I tried inserting `\vspace` but this does not move everything, just one cell.               \vspace{0.001 in} Area1 & \vspace{0.001 in} 419773  &   \vspace{0.001 in} 9.15      & \vspace{0.001 in} \emph{m$^2$} \\      My preference would be to adjust this without an external package, as I am using an old version of LaTeX on a server that I cannot replace.


title: Vertical alignment of text around a symbol in table

text: Is there a way to organize the vertical alignment in table around a particular symbol. For example in the below code               \begin{table}     \begin{center}       \begin{tabular}{ *{1}{c}}         a = b + c \\         a + b = c + d \\       \end{tabular}       \caption{16 constants used for BLAKE-256}     \end{center}     \end{table}      A sample table would look like                 a = b + c     a + b = c + d      However, I would like the output to center align around equals sign. Something like below.                   a = b + c     a + b = c + d      Is something like this possible in latex?


title: Place side by side two tables

text: > **Possible Duplicate:**   >  How can I have two tables side by side? I would place two tables side by side in the same row. How can I do? what packages I should use? does is exist a simple way to make it? May you help me?


title: Migrating from MiKTeX on Windows to OS X. Toolchain options?

text: I've got a 'living' document that I re-visit every couple of months which I originally developed using MiKTeX and WinEdt on Windows. I'm quite comfortable with this, and quite like the functionality in MiKTeX to download needed packages on the fly as the document is being rendered. I'm looking to add an OS X workstation into the mix of machines which can access and edit this, but I'm a bit lost amongst the range of different possible toolchains I could use to edit. I'm trying to achieve roughly the same amount of functionality that I have with WinEdt, specifically:   * A decent text editor with syntax highlighting and the ability to render an output and then open it directly from the editor   * Ability for the Tex installation to download needed packages and components on the fly - I don't want to have to install gigabytes worth of unneeded TeX packages just for a couple of documents who will never use them. From what I can see, TeXShop and TeX Live require the full MacTeX installation to be downloaded and installed, which seems to be a bit excessive. There is a smaller MacTeX download, but it's not clear how it handles the case where a package is required which isn't included in the smaller distribution. What can people recommend? Is TeXShop/MacTeX what most people use on OS X? Or is there a much more obvious 1-stop solution that I've missed?


title: Where can I find documentation about TikZ/TikZPicture?

text: When looking for different packages of creating timelines, I came across the following one:               \documentclass[12pt]{article}          \usepackage[a4paper]{geometry}     \usepackage{tikz}     \usetikzlibrary{snakes}          \begin{document}          \begin{tikzpicture}[snake=zigzag, line before snake = 5mm, line after snake = 5mm]     %draw horizontal line        \draw (0,0) -- (2,0);     \draw[snake] (2,0) -- (4,0);     \draw (4,0) -- (5,0);     \draw[snake] (5,0) -- (7,0);          %draw vertical lines     \foreach \x in {0,1,2,4,5,7}        \draw (\x cm,3pt) -- (\x cm,-3pt);          %draw nodes     \draw (0,0) node[below=3pt] {$ 0 $} node[above=3pt] {$   $};     \draw (1,0) node[below=3pt] {$ 1 $} node[above=3pt] {$ 10 $};     \draw (2,0) node[below=3pt] {$ 2 $} node[above=3pt] {$ 20 $};     \draw (3,0) node[below=3pt] {$  $} node[above=3pt] {$  $};     \draw (4,0) node[below=3pt] {$ 5 $} node[above=3pt] {$ 50 $};     \draw (5,0) node[below=3pt] {$ 6 $} node[above=3pt] {$ 60 $};     \draw (6,0) node[below=3pt] {$  $} node[above=3pt] {$  $};     \draw (7,0) node[below=3pt] {$ n $} node[above=3pt] {$ 10n $};     \end{tikzpicture}          \end{document}      When typesetting, we get this: ![enter image description here](http://i.stack.imgur.com/5tNla.png) But although the code says `\usepackage{tikz}`, there is not a package with this name. According to the CTAN site, there is a macro package called pgf that _«comes with a user-friendly syntax layer called TikZ.»_ I have checked the pgf documentation, of course, but there doesn't seem to be a section related to the code I posted above. There are many options (some are very nice too), but nothing like what I'm searching. Am I missing something? I'd like to know what can I do beyond what that code offers ( _if_ there is something, of course). Also: what is TikZPicture? Is this what I should be looking for? I'm quite confused at the moment.


title: Distance between text and \lstlisting

text: > **Possible Duplicate:**   >  Increase space between listings env. and surrounding text Is it possible to increase the distance between text and an \lstlisting? In my resulting PDF the listing follows very short after the text: ![enter image description here](http://i.stack.imgur.com/ehJ5q.png) Would that be possible?


title: A \(re)newcommand that does not care if a command is already defined

text: Does there exists a version of `\newcommand`, something like `\extranewcommand{\foo}{bar}` which does defines `\foo` to stand for `bar` regardless of whether `\foo` has been previously defined? Of course, if `\foo` is undefined, one can use `\newcommand{\foo}{bar}`, and if it is defined, one can use `\renewcommand{\foo}{bar}`. However, in either case, one has to know which version to use: if one chooses wrong, the document won't compile. What I am interested in is if there exists a similar command (or perhaps a combination of commands, etc.) which will work in either situation. As a rationalisation for the question, below are two situations in which I would find this command useful. Of course, the change is very minor, but it adds up over time, I think.   1. One doesn't always know what commands are already defined. Sometimes, it happens that a newly defined command happens to also be something defined in some standard package. For instance, one wants to use `\operatorname{Im}` for the image of a linear operator, so it is convenient to declare `\newcommand{\Im}{\operatorname{Im}}`. However, `\Im` is already a fancy symbol for the imaginary part, so a `renewcommand` is needed instead. I never use the mentioned imaginary part symbol, so it would be nice if I could just forget that it exists (but I can't). (Of course, this issue can be solved by compiling, noticing the error and adding "re" in front of "newcommand"; but, there are a lot of other such clashes that happen.)   2. I use a lot of commands used only "locally" (I'm not sure if it's a good coding practice, but I find it useful). For example, if I have a set S which occurs in many places in the text, I would often declare `\newcommand{\Set}{S}` or even `\newcommand{\S}{S}`, so that I can easily change the symbol S to another one if I feel like it. This potentially leads to renewing commands quite frequently, which is not that much of a problem. However, if a block of text with a `\newcommand` moves, then also a prefix `re` has to move. (Again, it is not much of a problem, but I find it a nuisance).


title: What is a good way to stack things in an equation?

text: I have a string of inequalities, and somewhere in the middle I have two things which are equal. To fit this nicely on a single line, I would like to stack the equal things. So I wanted to do something like this (using the stackrel package): > \[ A \leq \stackrel[B]{C}{\parallel} \leq D \] However this makes B and C smaller. I can fix this with an even kludgier hack: > \[ A \leq \stackrel[\text{\normalsize $B$}]{\text{\normalsize > $C$}}{\parallel} \leq D \] My question is: What the right way to do something like this? Edit: I would like something without a begin and end if possible.


title: Sort database with datatool

text: I use the `datatool` package to read CSV files and print them as tables. Before printing I want to sort the rows. The problem is that the file was written with `R` and some rows contain normal numbers (like 0.124) and some contain numbers in scientific format (e.g. 1.23e-4). How can I tell `datatool` to interpret both values as numerical and sort accordingly?


title: How can I draw snake arrow in automata using tikz?

text: I find:               \begin{tikzpicture}     \draw [->,decorate,decoration=snake] (0,0) -- (2,0);     \end{tikzpicture}      in TikZ manual, but dose not work! How can i draw snake edges in automata using tikz?


title: Configuring vim to only check spelling in text regions

text: Is there a way to configure vim so that it only checks spelling in the text regions of tex files?


title: Is there a way to enable syntax highlighting coloring in Lyx for program listings?

text: I want to embed a small program listing and have used `Insert -> Program Listing` in LyX's menu for that. The settings dialog supports selecting a language (Java), but I can't actually see any difference. Is there a way to get real syntax highlighting/coloring?


title: How does one use \node[inner node]{}?

text: I'm trying to reproduce a TikZ tree from a Till Tantau presentation (see pg.33 of this .pdf) My code is as follows:                   \documentclass{article}              \usepackage[latin1]{inputenc}         \usepackage{tikz}         \usetikzlibrary{trees}         \begin{document}              \begin{tikzpicture}[edge from parent fork down, edge from parent/.style={black,thick,draw}]              \node[inner node]{}             child { node {bacteria} }             child {  node[inner node] {}                 child { node {plants} }                 child   { node[inner node] {}                     child { node[inner node] {}                         child { node {fish} }                         child { node[inner node] {}                             child { node {mammals} }                             child { node {birds} }                         }                     }                     child { node[inner node] {}                         child { node {dragonflies} }                         child { node {beetles} }                     }                 }                            };              \end{tikzpicture}              \end{document}      I get six errors of the type below for each of the six `node[inner node] {}` calls in the code above:                   ! Package pgfkeys Error: I do not know the key '/tikz/inner node' and I am goin         g to ignore it. Perhaps you misspelled it.         See the pgfkeys package documentation for explanation.         Type H <return> for immediate help.         ...         l.11 \node[inner node]         {}         This error message was generated by an \errmessage         command, so I can't give any explicit help.         Pretend that you're Hercule Poirot: Examine all clues,         and deduce the truth by order and method.      I couldn't find anyting pertinent on this type of usage in the PGF manual. Any help is welcome!


title: Include thebibliography on the same page

text: My paper has a page limit and the spec says to include the bibliography on the same page right after the text. I'm using the thebibliography environment (its a very simple bibliography). How can I accomplish this?


title: dtx: add code to sty file without printing it to pdf

text: I want to add comments to the sty file that should not be printed to the pdf, because the description is almost identical. Is it possible to configure the dtx file, such that not every code added to the sty file is also printed in the pdf?


title: Using fonts - latex

text: Can anyone explain me why I can't have an output like this using this code? ![enter image description here](http://i.stack.imgur.com/1r62P.png) Code, thanks @Bernard :                   \documentclass[12pt,french]{report}         \usepackage[utf8]{inputenc}         \usepackage[T1]{fontenc}         \usepackage{lmodern}              \usepackage{abstract}         \renewcommand{\abstractnamefont}{\usefont{T1}{LobsterTwo-LF}{bx}{it}\LARGE}         \renewcommand{\abstracttextfont}{\normalsize}         \setlength{\abstitleskip}{4\baselineskip}              \usepackage{babel}         \begin{document}              \begin{abstract}          Ce stage résume notre expérience de deux mois dans l'été de 2012..Au cours de cette période, nous avons intégré à distance une équipe         sur le projet « Barboteau ». Notre rôle a été de concevoir et développer un site web d'un groupe de musique. Nous avons utilisé le langage         \end{abstract}              \end{document}       What I'm having : ![enter image description here](http://i.stack.imgur.com/CONXG.png) Please, explain in detail.


title: How to make a table with centered images?

text: On page 6 in this PDF is there a table with centred pictures in the right column. ![enter image description here](http://i.stack.imgur.com/jvPGa.png) Does anyone know how to make such a table? I am using pdflatex.


title: How can I work around this TikZ bug: (\x)^2 and \x^2 produce different results in TikZ plot?

text: I have some files with TikZ graphics that have suddenly changed appearance since I upgraded to PGF-2.10. Here is a minimal example:               \documentclass{minimal}     \usepackage{tikz}     \begin{document}     \pgfversion\par     \begin{tikzpicture}     \draw[blue] plot[domain=-1:1] (\x,{\x^2 + \x^3});     \draw[xshift=4cm,blue] plot[domain=-1:1] (\x,{(\x)^2 + (\x)^3});     \end{tikzpicture}     \end{document}      In PGF 2.00 I had this: ![minimal example](http://i.stack.imgur.com/pHbD2.png) while in 2.10 I have this: ![minimal example](http://i.stack.imgur.com/TBM1y.png) The one on the left in PGF 2.10 looks like the graph of y=x^3 but could also be y=x^3 + x|x|. This has been reported on sourceforge and discussed on the pgf-users mailing list. Although I haven't checked myself yet, the bug remains open and some of the commenters below report that problems still exist in the CVS version. Geoffrey Jones notes the bug is in the 2.00 CVS version: > Hi Matthew, not an answer, just an FYI that's too large for the comment box. > My compile of your code through pgf v2.00 produces the result you see with > v2.10, above: ![alt text](http://i.stack.imgur.com/cBYbG.png) > > I.e., the difference you observe seems to pre-date v2.10. There is a workaround by inserting parentheses. But since I have so many old lecture files I'd rather find a solution that doesn't involve rewriting my TikZ code. And I'm squeamish about using the CVS bleeding edge code even if it were fixed, since I don't want to introduce other problems. Ideally I'd like a simple patch that I can stick at the preamble, or just fix one file in the PGF distro.


title: Why does tikz not plot this even function correctly?

text: Can someone provide an explanation and a fix for the fact that my plot is not what is expected? The function is symmetric with respect to the y-axis. The plot correctly shows the function for positive values of x, but not so for negative values. Here is my code:               \documentclass[10pt]{article}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}     \usepackage{fouriernc}     \begin{document}     \begin{tikzpicture}[>=latex,x=1.3cm]     \fill[fill=lightgray] (0,0) -- plot[domain=0:1,samples=100] (\x,{sqrt(abs(\x))-\x^2});     \fill[fill=lightgray] plot[domain=1:2,samples=100] (\x,{sqrt(abs(\x))-\x^2}) -- (2,0);     \draw[thick,domain=-1:2.2,samples=100] plot (\x,{sqrt(abs(\x))-\x^2}) node[right] {\footnotesize $f(x)=\sqrt{|x|}-x^2$};     \foreach \x in {-1,1,2,3}     \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};     \foreach \y in {-3,-2,-1,1}     \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};     \draw[->,thick] (-2,0) -- (4,0) node[above left]{\footnotesize $x$};     \draw[->,thick] (0,-4) -- (0,2) node[below right]{\footnotesize $f(x)$};     \end{tikzpicture}     \end{document}      Here is what I get with this code: ![enter image description here](http://i.stack.imgur.com/PgJrV.png)


title: half of a hyperbola

text: Only top portion of half my hyperbola is coming in correctly. The other half is doing something strange: ![enter image description here](http://i.stack.imgur.com/7WNHq.png)               \documentclass{article}     \usepackage{tikz, pgf}     \begin{document}     \begin{center}       \begin{tikzpicture}         \begin{scope}           \clip (0,-3) rectangle (4,3);           \draw [samples = 50, domain = -0.99:0.99,           rotate around = {0:(0,0)}, xshift = 0cm, yshift = 0cm]           plot ({0.69*(1+\x^2)/(1-\x^2)}, {0.72*2*\x/(1-\x^2)});         \end{scope}       \end{tikzpicture}     \end{center}     \end{document}


title: Why (\x)^2 and \x^2 produce different results in Tikz plot?

text: `(\x)^2` will plot correct parabola, while `\x^2` will have negative x branch upside down. Why () are required for this formula to work?               \documentclass[10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric}     \usetikzlibrary{shapes.misc}          \begin{document}     \begin{figure}[!htb]         \begin{tikzpicture}             \draw[very thin,color=gray] (-4.1,-4.1) grid (4.1,4.1);             \draw[->] (-4.2,0) -- (4.2,0) node[right] {$x$};             \draw[->] (0,-4.2) -- (0,4.2) node[above] {$f(x)$};                  \draw[thick,purple,domain=-3:3,smooth] plot (\x,{0.5*\x^2});             \draw[thick,brown,domain=-3:3,smooth] plot (\x,{0.2*\x^3});         \end{tikzpicture}          \caption{$y=1/2 x^2, y=1/5 x^3$}     \end{figure}          \end{document}


title: Check if in an align* environment

text: I want to use different styles of matrices if TeX is in an `align*` environment or in a normal math environment. I already found a solution for checking if it is in math mode (`\ifmmode`) but not something to check if it is in an `align`. So far my code would look like this:               \newcommand\cvec[1]{         \relax\ifmmode\begin{smallmatrix}#1\end{smallmatrix}\else\begin{pmatrix}#1\end{pmatrix}\fi}      Or is there another simple command to do this?


title: too little space between the bar on the denominator and the horizontal line

text: Please see below: ![enter image description here](http://i.stack.imgur.com/c1401.png) There is too little space between the horizontal line from `\frac` and the bar from `\bar{h_1}`. So, it is a little hard to read. Any alternative way to represent the upper bar? And, it is short too. ADDED: This is inline mode. In the display math mode, it is quite better. But in the inline math mode, it looks pretty bad, even with `\bar{h}_1`.


title: How can you change the width of a fraction bar?

text: I have an equation using fractions of fractions - much like `\frac{\frac{a}{b}}{\frac{c}{d}}` However, all of the fraction bars are the same width. I'd like to make the central bar wider than the others for improved readability. Is this possible? I've played around with shrinking the fond sizes of the numerator and denominator a bit, but that still doesn't improve readability.


title: Latex text on both sides

text: I don't wanna use 64x \space to achieve my goal. I was tryin to \begin{flushleft} and \begin{flushright} bo it attempts with new line. I wanna make something like this, where arrows shows distance between two words. till now i had this, but it doesn't look good.               \begin{flushleft}     Date      \space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space\space Signiture     \end{flushleft}      ![enter image description here](http://i.stack.imgur.com/sc6o7.jpg)


title: Error: Counter too large! with \alph{cntr} and cntr>26

text: I would like to have `\alph{counter}` for values larger than 26. The following MnWE gives me the error `! LaTeX Error: Counter too large.`               \documentclass{article}     \begin{document}          \begin{enumerate}     \def\theenumi{\alph{enumi}}     \setcounter{enumi}{24}     \item twenty-five     \item twenty-six     \item twenty-seven     \end{enumerate}          \end{document}      I would like it to behave like one of these:               ..., x, y, z, aa, bb, cc, ..., xx, yy, zz, aaa, bbb, ccc, ... (preferred)     ..., x, y, z, aa, ab, ac, ..., ax, ay, az, ba,  bb,  bc,  ... (can be if nothing else works)      A solution _without_ LaTeX3 extensions would be awesome as I cannot run LaTeX3 extensions.


title: Too many footnotes

text: I have a text with about 31000 lines, so it is quite long. There are many footnotes in the text (1 every second line or so). I am using `footmisc` with the option `perpage`. Halfway through compiling I get a message that the counter is too large and the compile fails. If I use a subsection of the text it will compile just fine, so it is solely a matter of my text being ginormous. What can I do? Sorry, I am a total LaTeX newbie.


title: what is the difference between pctex and miktex?

text: I've installed basic miktex and it runs nice, but there is another on the website that say pctex available for download, one thing that I know is pctex is trial version or purchase it.


title: Minipage in Header?

text: Using LaTeX, I'm trying to fit into the header a minipage containing the page number above a logo. However,   1. The minipage is pushed out of the header into the head separation space;   2. The distance between the page number and the logo varies from page to page. How do I get it right without using fancyhdr? Here is the code:               \NeedsTeXFormat{LaTeX2e}[2001/06/01]     \ProvidesClass{blabla}[2012/01/22 v2.0.2 blabla class]     \RequirePackage{geometry}     \RequirePackage{graphicx}     \RequirePackage{float}     \LoadClass[12pt, legalpaper, oneside, final]{article}     \geometry{top=6mm, headheight=40mm, headsep=40mm, total={165mm,243mm}, includeheadfoot}     \AtEndOfClass{\pagestyle{blabla}}          \def\ps@blabla{     \def\@oddhead{     \begin{minipage}{\textwidth}     \vspace{8mm}     \begin{center}     Page \arabic{page}     \end{center}     \vspace{-6mm}     \begin{figure}[H]     \centering     \includegraphics[width=17mm]{logo.png}     \end{figure}     \end{minipage}}          \def\@oddfoot{     \begin{minipage}{\textwidth}     blabla     \end{minipage}}          \def\@evenhead{\@oddhead} \def\@evenfoot{\@oddfoot}}          \endinput


title: How to change the font of a URL from \ttfamily to Euclid?

text: I would like to include a clickable URL in a text written in LaTeX. For that I included the package `hyperref`. The result obtained by `\url` gives a clickable link written in `\ttfamily` (the default font). My question is how to set the font for `\url` so that I can obtain a clickable link written in the font "Euclid" rather than `\ttfamily`.               \usepackage{hyperref}     \url{http://stackoverflow.com/}


title: Conflict between amsmath and ntheorem, or, how I fell into an infinite troubleshooting loop

text: There are similar questions on this site, but nothing quite fixed this problem for me. When using `amsmath` with `ntheorem` I get either a missing end of theorem symbol (when my theorem ends with an equation) or my cross-referencing gets screwed up. Here is a minimal example of the missing end of theorem mark:               \documentclass{article}          \usepackage{amsmath}     \usepackage[thmmarks,amsmath]{ntheorem}     \theoremsymbol{*}     \newtheorem{myDefinition}{Definition}          \begin{document}          \begin{myDefinition}         I don't get my end of definition mark \ldots         \begin{equation}             x=y             \label{test}         \end{equation}     \end{myDefinition}          \ldots but the equation cross-reference works: \eqref{test}.          \end{document}      Here is a minimal example of the screwed-up cross-referencing (the argument `amsmath` has been omitted from the `ntheorem` package call):               \documentclass{article}          \usepackage{amsmath}     \usepackage[thmmarks]{ntheorem}     \theoremsymbol{*}     \newtheorem{myDefinition}{Definition}          \begin{document}          \begin{myDefinition}         Now I get my end of definition mark \ldots         \begin{equation}             x=y             \label{test}         \end{equation}     \end{myDefinition}          \ldots but the equation cross-reference fails: \eqref{test}.          \end{document}      I'm probably missing something obvious.


title: LaTex i18n (integrate a new package's strings with babel)

text: Suppose I'm preparing LaTeX package to give the abstraction of admonition boxes (warning, error, tip, note, fyi, ...). I'd like to have theses strings internationalized. I wouldn't appreciate the following solutions:   * "generic" box, let the user give the title and icon.   * add an option to your sty file so that the user can configure the language   * make many sty files suffixed by the language code The "babel" package is capable of defining some i18n strings (Table of Contents, Table des matières, ...). Is it possible to integrate the strings used in my package with a i18n system? Sorry but searching for latex, i18n, babel, interface, integration or whatever don't give me useful results (most people have doubts on how to get babel to work in their documents). Thanks in advance.


title: Prevent LaTeX from Preventing Hyphenation

text: So I know that a common technique in typography to avoid hyphens at a line break is to adjust the spacing of words and letters slightly. I was not aware of LaTeX doing this until today, but now it is causing me a problem. EDIT: After adding tags, I see that this phenomenon of letter spacing is called "tracking". I am writing up a homework, where the parts look like this:               \textbf{a.} \hspace{5 pt} {\color{NavyBlue} Does the above tweak work? If yes, then      prove it, if not, then provide a counter example.}          \textbf{b.} \hspace{5 pt} {\color{NavyBlue} Implement the above version of the Bakery     algorithm in Java, and dependent on your answer to part (a) either show a set of      (say 4) threads reciting the declaration of independence cohesively, or else not.}      The problem is that the "Does" and the "Implement" are not aligned with each other, because it appears that the spacing thing I mentioned above is pushing the position of "Implement" farther forward. Here's a screenshot: ![enter image description here](http://i.stack.imgur.com/N1kLK.png) Is there a command I can use to allow hyphenation instead of the adjusted spacing, so that the beginnings line up properly? **Here's a MWE:**               \documentclass[a4 paper,11pt]{article}     \usepackage{amsmath, amsfonts, amssymb, parskip, dsfont, amsthm, wasysym, mathrsfs}     \usepackage{graphicx}     \usepackage[usenames, dvipsnames]{xcolor}     \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}     \usepackage{mathrsfs}     \usepackage[normalem]{ulem}     \usepackage[breaklinks=true]{hyperref}     \usepackage{soul, color} % for highlighting     \usepackage{pifont} % for cool symbols in text mode     \usepackage{changepage} % for block quotes -- \begin{addmargin}[left][right]          \begin{document}          \textbf{a.} \hspace{5 pt} {\color{NavyBlue} Does the above tweak work? If yes, then      prove it, if not, then provide a counter example.}          \textbf{b.} \hspace{5 pt} {\color{NavyBlue} Implement the above version of the Bakery     algorithm in Java, and dependent on your answer to part (a) either show a set of      (say 4) threads reciting the declaration of independence cohesively, or else not.}          \end{document}


title: Change the way shorthands are used in the biblatex verbose style

text: I'm using `biblatex` with the `verbose` style. I'd like to change the way that it uses shorthands. At the moment, for all first entries it gives the full citation followed by (henceforth cited as [shorthand]). I want to change this in two ways: (1) I want, in the first entry, the shorthand to appear in square brackets immediately after the long title. I also want the shorthand to reflect the style of the original entry: i.e. if it is an article it would be enclosed in quotes ('Line & Cave') and if it is a book it would be in italics ( _Ethics_ ). So at the moment the working example I give below produces: > John Malcolm. ‘The Line and the Cave’. In: _Phronesis_ 7 (1962), pp. 38-45 > (henceforth cited as Line & Cave) > > Terence Irwin. _Plato's Ethics_. Oxford: Oxford University Press, 1995 > (henceforth cited as Ethics) What I want to achieve would look like this: > John Malcolm. ‘The Line and the Cave’ [‘Line & Cave’]. In: _Phronesis_ 7 > (1962), pp. 38-45 > > Terence Irwin. _Plato's Ethics_ [ _Ethics_ ]. Oxford: Oxford University > Press, 1995 (2) I want the shorthand to be introduced only if there exists a second citation that uses the shorthand. That is, if a work is cited only once in the text, then no shorthand is introduced.               \documentclass{article}          \begin{filecontents}{\jobname.bib}     @ARTICLE{Malcolm1962,       author = {John Malcolm},       title = {The Line and the Cave},       year = {1962},       volume = {7},       pages = {38-45},       shorthand = {Line \& Cave},       journal = {Phronesis}     }     @BOOK{Irwin1995,       author = {Terence Irwin},       title = {Plato's Ethics},       year = {1995},       publisher = {Oxford University Press},       address = {Oxford},       shorthand= {Ethics}     }          \end{filecontents}         \usepackage[british]{babel}     \usepackage{csquotes}     \usepackage[style=verbose, backend=biber]{biblatex}          \addbibresource{\jobname.bib}               \begin{document}      \cite{Malcolm1962}          \cite{Irwin1995}          \cite{Irwin1995}     \end{document}


title: Exporting database with Zotero so urls will be exported to bibtex with \url command

text: When exporting a database or collection within Zotero to BibTeX, a URL will not be enclosed with the `\url` command, thus rendering links not clickable in Lyx when `hyperref` enabled. Is it possible to make Zotero exporting url's with the `\url` command automatically?


title: Drawing different tikz shapes parameterized by data from a file

text: I have a file with three columns of data, x, y, r.               # x y r     1 1 0.1     2 2 0.5     3 3 1.2      and so on. I'd like to loop over the rows, and draw a circle at x,y with radius r for each row. I first thought I'd use pgfplots with customized marks, but I couldn't figure out how to pass the radius parameter into the pgfplot mark handler. Then I thought I'd use tikz and pgf directly, but I couldn't figure out how to reference the values for r inside a draw command sequence. Any thoughts ? I'd be very grateful for some help.


title: Points/Circles in graph with TikZ based on table within .tex-file?

text: Suppose I have a table such as               \documentclass[     a4paper     ]{scrartcl}          \usepackage{     tgheros,     booktabs     }     \usepackage[T1]{fontenc}          \begin{document}     \begin{center}     \begin{tabular}{lrrrrr}     \toprule     Unit & Thing & Word & More & Things & Letter\\     \toprule     A & 4 & 15 & 10 & 0.4 & 1.5 \\     \midrule     B & 2 & 12 & 7 & 0.29 & 1.71 \\     \midrule     C & 6 & 3\\     \bottomrule     \end{tabular}     \end{center}         \begin{center}         \begin{tikzpicture}             stuff.         \end{tikzpicture}     \end{center}     \end{document}      Is it possible to feed the last 2 columns as x- and y-values as (data) points to a TikZ figure in the same document? Or maybe even another .tex-file? In the end, what I would like to do within the `tikzpicture`-environment would be something like               \node (A) at (x-value-from-above,y-value-from-above) {};     \filldraw (A) circle (0.1cm) node[stylething] {Something};      And all in all, is it maybe automate the procedure? I think what it could lead to would be a giant macro which I could not program anyway. How does anyone else do it? Is it always the pgfplots-table method?


title: Separation between paragraphs on formal Letters

text: I want to create a formal letter in which I have to add a separator between paragraphs, just as the ones in the picture ![Example](http://i.stack.imgur.com/4KuJX.png) Is there a way to create a this but not by typing each asterisk below the paragraph? Here is a MWE:               \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}     \usepackage{hyperref}     \usepackage{xhfill}          \begin{document}          \typein[\secretarioacademico]{Ingrese el nombre del secretario academico.}          QUIEN SUSCRIBE, \textbf{\MakeUppercase{\secretarioacademico}}\\     SECRETARIO ACADEMICO DE LA DIVISION DE INGENIERIAS CAMPUS IRAPUATO-SALAMANCA DE LA UNIVERSIDAD DE GUANAJAUTO, \textbf{HACE CONSTAR} QUE:\xdotfill{1pt}     \vspace{2cm}          \end{document}      Thanks.


title: Desktop wallpaper with black background templates

text: I want to prepare some cheat sheets to be used as desktop wallpapers. I would like to go for something like this: ![enter image description here](http://i.stack.imgur.com/8uHNO.png) It has, I think, context highlighting (or maybe just environmental highlighting) a black background, it's png format, it's got 4 columns and tabular alignment (or so it appears) for each item. Can I adapt the templates here?: Template for cheat sheet and http://www.stdout.org/~winston/latex/latexsheet.tex I would want fine-grained control of the pixel size, spacing, column beginnings and endings, colors, fonts, etc... If I used those templates, what would I need to change? Looks like I can output to png and control pixel size for one: Compile a LaTeX document into a PNG image that's as short as possible I think colors are doable: http://en.wikibooks.org/wiki/LaTeX/Colors Based on my experience and these references, I think it's really doable, but am I missing anything? Tips? Want to create a best-practice template for me? Thanks!


title: LaTeX templates for Computational Linguistics / Linguistics / Computer Science Theses

text: I'm sure the answer would be to just 'Google' it but LaTeX is not as simple as chewing gummi. **Is there a pool of LaTeX templates for PhD or Master theses that had been used for Computer Science / Linguistics and if possible computational linguistics?** I do understand some LaTeX but if we have some templates to start off and work with, we could surely spend more time in doing "science" (i.e. research) than messing with syntax errors in the LaTeX.


title: Aligning variables vertically in a cases environment

text: I'm creating a system of equations in LaTeX, using a `cases` environment, with variables $x_1$, $x_2$, $x_3$ and $x_4$. Here's my MWE:               \documentclass[a4paper,12pt,onecolumn]{article}          \usepackage{amsmath}          \begin{document}         \begin{math}             \begin{cases}                  x_1 +  x_2 + x_3 +  x_4 =  3\\                      - 3x_2 + x_3 - 2x_4 = -3\\                              2x_3 + 5x_4 = -3\\                                   - 7x_4 = -7             \end{cases}         \end{math}     \end{document}      I would like to keep the variables vertically aligned in the output, as they appear in the source code above. How can I do that?


title: What should I write in the "Short description for announcement" field on the CTAN upload page?

text: I want to upload my simple package on CTAN, but I don't know what I should enter in the "Short description for announcement" field on the CTAN upload page?


title: Can someone pgfplots the following picture concerning confidence intervals?

text: ![Confidence Interval picture](http://i.stack.imgur.com/QgJeI.png) I've been trying to use the following code to produce it, but have no idea how to shade in the tails I am interested in. By the way, the line pointing the (100-C/2)% can be an arrow, does not have to be squiggly as depicted in the picture.               \begin{tikzpicture}[     every pin edge/.style={<-},     every pin/.style={fill=yellow!50,rectangle,rounded corners=3pt,font=\small}]     \begin{axis}[every axis plot post/.append style={       mark=none,domain=-3:3,samples=50,smooth},     clip=false,     axis y line=none,     axis x line*=bottom,     ymin=0,     xtick=\empty,     ]     \addplot {\gauss{0}{0.5}};     \addplot {\gauss{0}{1}};     \node[pin=70:{$\hat{\theta}_1$}] at (axis cs:0.57,0.5) {};     \node[pin=270:{$E(\hat{\theta} = 0$}] at (axis cs:0,0) {};     \draw[dashed] (axis description cs:0.5,0) -- (axis description cs:0.5,0.92);     \end{axis}     \end{tikzpicture}


title: \foreach has a problem with ‘initially’ argument in remember part

text: Is there an error in my code or did I find a bug? It seems like the `\foreach` statement doesn’t increase `\lastn` if there is an `initally (value)` but it works with a manually given initially value (`\def\lastn`). This is what I expect … ![right](http://i.stack.imgur.com/OvJbk.png) … and that is what I get … ![wrong](http://i.stack.imgur.com/vsY0z.png) Here is my MWE:               \documentclass[border=1cm]{standalone}          \usepackage{tikz}          \begin{document}     \begin{tikzpicture}[every node/.style={draw}]         \node (A) at (0,0) {A};         \node (B) at (2,0) {B};         \node (C) at (4,0) {C};         \node (D) at (6,0) {D};     %   DOESN'T WORK     %   \foreach \n [remember=\n as \lastn (initially A)] in {B,C,D} {     %       \draw [->] (\lastn) -- (\n);     %   }     %   WORKS         \def\lastn{A}         \foreach \n [remember=\n as \lastn] in {B,C,D} {             \draw [->] (\lastn) -- (\n);         }     \end{tikzpicture}     \end{document}


title: Change the installation of TeX

text: I have updated my OS X to Mountain Lion, and am experiencing a problem. I have on my system two installations of `TeX`, namely `MacTeX` and `TeXLive` from macports. I am using only the first one, and the second one was installed as some dependency and I never bother to remove it. Anyway, after the update, my system tries to use the `macport`'s installation. **How can I change it?** How can one change the default installation of `TeX`, assuming that there is more then one?


title: Appendix problem in ToC

text: MWE is here:               \documentclass[12pt,letter]{report}     \usepackage[titletoc]{appendix}          \begin{document}     \tableofcontents     \appendix     \chapter{T.F}     some text          \chapter{C.L}     some more text     \end{document}      In this, the ToC shows A. T.F B. C.L But I want,   Appendix A. T.F Appendix B. C.L I went through some questions similar to this on stackexchange, but I couldn't set it right. Please help me.


title: Getting duplicate call to my define that writes to a aux file

text: I have the following:               \newif\ifabrvused     \abrvusedfalse          \def\abrv#1#2{%       \ifabrvused\else%         \newwrite\@loa%         \immediate\openout\@loa=\jobname.loa%         \write0{    Test}         \abrvusedtrue%       \fi%            \@ifundefined{abrv@#1}{%         \expandafter\def\csname abrv@#1\endcsname{#2}%         \immediate\write\@loa{\unexpanded{\item[\textbf{#1}]#2}}%         {#2 (\textbf{#1})}%       }{%       {\textbf{#1}}%       }%     }      The intention is that the first time its called it opens the aux file for writing. My problem is, that the open part (`ifabrvused\else`) is getting called twice. I was able to find out that its getting called for the first use within my `begin{abstract}` and the rest of the document? What am I missing. If its intended to do so, how can i code around it?


title: Can I put a logo in the header of a twoside document?

text: I would like to include a graphics file with a logo in the header of all pages of a twoside document (left and right side). The logo should be left-justified on the left side and right-justified on the right side. The header line and the document title should begin beside the logo. There are two 2 Problems:   * Moving the beginning of header line and document title a litte to the right (left side) and left (right side) to create space for the logo   * Include the logo Do you have any suggestions? Here is my code:               \documentclass[        12pt,                       a4paper,                     twoside,                                 headinclude,                 headsepline,                         BCOR12mm,                                DIV12,                       openright,                     bibliography=totoc,                    listof=totoc,                        numbers=noenddot,        fleqn,                            ]{scrbook}          \usepackage[latin1]{inputenc}         \usepackage[T1]{fontenc}              \usepackage[ngerman, english]{babel}             \usepackage{lipsum}          \usepackage{xcolor}                          \definecolor{grey} {RGB} {132,130,132}          \usepackage{scrpage2}                       \setkomafont{pageheadfoot}{\color{grey}{\normalfont\sffamily}}     \setkomafont{pagenumber}{\color{grey}{\normalfont\sffamily}}     \setheadsepline{1pt}[\color{grey}]          \clearscrheadfoot                                                            \pagestyle{scrheadings}     \rehead[ ]{Document title}                   \lohead[ ]{Document title}                   \lehead[ ]{\headmark}                        \rohead[ ]{\headmark}                             \refoot[\pagemark]{\pagemark}          \lofoot[\pagemark]{\pagemark}               \begin{document}          \section{section title}          \lipsum[1-9]          \end{document}      Thank your for your comments and answers. I have already tried the above solution (just including the graphics), but was not happy with the result because:   * the line is also unter the logo   * document title and section title have different heights This time I include a layout draft (the picture in the layout is a substitute for the logo). The measurements of the final logo will be: height=15 mm, width=20 mm (or 79x61 pixel). ![enter image description here](http://i.stack.imgur.com/xChTm.jpg) The Document title is "Yaacomo". In the header there should be no text and no line under the logo.


title: Error: Argument of \\cventry has an extra }

text: I've just begun to learn LaTeX and I want to write my CV with it. But there are always some errors and I have no idea how to correct them. Here's my code: ![enter image description here](http://i.stack.imgur.com/vgwe4.jpg) and here's the error: ![enter image description here](http://i.stack.imgur.com/vgwe4.jpg) Actually I downloaded a model of cv using LaTeX. The following part is the original one: ![enter image description here](http://i.stack.imgur.com/2kKpx.jpg) I tried to write like this: ![enter image description here](http://i.stack.imgur.com/vgwe4.jpg) and here's the new error: ![enter image description here](http://i.stack.imgur.com/2kKpx.jpg)


title: Remove section numbering but retain the short-title optional argument

text: I have a section like that:               \section[ABC]{ABC\footnote{FN1}\footnote{FN2}}      I want to remove section numbering, but I must use `\section[]{}`. So when I try               \section*[A]{B}      I get only                [      Here is my example code:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{enumerate}     \usepackage[hidelinks]{hyperref}     \usepackage[stable]{footmisc}               \title{}     \date{}     \begin{document}               \section[TST 2012]{TST 2012\footnote{30 March-31 March-1 April 2013}}          \begin{enumerate}     \item           \end{enumerate}               \section[TST 2013]{TST 2013\footnote{30 March-31 March-1 April 2013}}          \end{document}


title: How to make "for all xxx do" appear on one line?

text: This is an example               \documentclass[12pt,oneside,a4paper,onecolumn]{article}     \usepackage{graphicx,color,setspace,hyperref}     \usepackage[left=1.5in,top=1.25in,bottom=1.25in,right=1.25in]{geometry}     \usepackage{latexsym,amssymb,amsmath}     \usepackage{algorithm}     \usepackage{algorithmic}     \usepackage{caption}          \begin{document}          \begin{algorithm*}[t]                                                                    \begin{algorithmic}[1]             \FORALL{$i \in S$}                 \STATE{Do something}             \ENDFOR         \end{algorithmic}     \end{algorithm*}          \end{document}      Result is: ![enter image description here](http://i.stack.imgur.com/uQ0je.png) However I want to have only one line "for all i \in S do Do something". How to make it?


title: Different column number in rows

text: I would like to create a table like this:               | H1   |           h2           | <--- is centered vertically     | T1   |                        |     | T1   |   text  | text  | text |     | T1   |   text     |      text |     | T1   | text |text | text|text |      How can I do so? mainly the problem is with row 2. Working example but not centering correctly the row with 5 columns               \begin{table}[!hbt]        \centering        \caption{caption} \label{tab:table}         \begin{tabular}{c c c c c c c c c c c c c}           \toprule           xxxxxxx & \multicolumn{12}{c}{yyyyyyyyyyyyyy} \\           \midrule           aaaaaaa & \multicolumn{12}{c}{\multirow{2}{*}{bbbbbbbbbbbbbb}} \\           $E=\lambda \cdot x$ & \multicolumn{12}{c}{} \\           \midrule           cccccccc & \multicolumn{4}{c}{ddddddddddddddddddd} & \multicolumn{4}{c}{eeeeeeeeeeeeeeeee} & \multicolumn{4}{c}{fffffffffffffff} \\           $P=\beta \cdot x$ & \multicolumn{4}{c}{(4)} & \multicolumn{4}{c}{(3)} & \multicolumn{4}{c}{(1)}\\           gggggggggg & \multicolumn{3}{c}{gggggggg} & \multicolumn{3}{c}{ddddddddd} & \multicolumn{3}{c}{ggggggggg} & \multicolumn{3}{c}{dsdsdsds}  \\           $I=\gamma \cdot x$ & \multicolumn{3}{c}{(6)} & \multicolumn{3}{c}{(5)} & \multicolumn{3}{c}{(3)} & \multicolumn{3}{c}{(1)} \\           Calidad canal & \multicolumn{4}{c}{aaaaaaaaaaaa} & \multicolumn{4}{c}{hhhhhhhhhhhhhhhhhhhhhh} & \multicolumn{4}{c}{rrrrrrrrrrrrrrrr} \\           $\Delta = \delta \cdot x$ & \multicolumn{4}{c}{(5)} & \multicolumn{4}{c}{(3)} & \multicolumn{4}{c}{(1)} \\           \bottomrule        \end{tabular}     \end{table}


title: Biblatex: Changing space settings for page numbers in footnotes

text: For some unknown reason I prefer to write the page numbers in `\autocite[34,79]{dR80}` without a space behind the comma. Unfortunately, in the output it doesnt compile a space automatically. Is there a way to change the command in order to set one space behind a comma? Edit1 (adding a MWE):               \documentclass{article}          \usepackage[ngerman]{babel}%dt.Silbentrennung          \usepackage[style=authortitle-icomp,autocite=footnote]{biblatex}     \bibliography{TestLit}          \begin{document}          \autocite[34,39]{dR80a}          \end{document}      Where dR80a is the following bib entry.               @article{dR80a,        author = {David~E. Rumelhart},        title = {On Evaluating Story Grammars},        journal = {Cognitive Science},        pages = {313-316},        year = {1980},        volume = {4},        }      The output you find here. ![enter image description here](http://i.stack.imgur.com/5Matm.png) Preferably the page numbers would look like this: _34, 39_ e.g. with a space behind the comma.


title: labeling points in metafont's proofs?

text: I am following the http://metafont.tutorial.free.fr/ tutorial, where `labels` is used to show given points in the proofs. I am not able to get them in my case. Can someone help?               mg:=1.5;     mode_setup;     tracingtitles:=1;     height#:=mg*9.6pt#;     midheight#:=mg*4pt#;     depth#:=mg*5pt#;     fullwidth#:=mg*3pt#;     pensize#:=mg*.3pt;     define_pixels(height,midheight,depth,fullwidth)          % points used for curves, and I also will have them labeled      pair pAA,pBB,pCC;     pAA:=(0,midheight);     pBB:=(0,0);     pCC:=(fullwidth,0);          beginchar("a",fullwidth#,midheight#,0); "a";         pickup pencircle scaled pensize#;         draw pAA .. pBB .. pCC;         draw pCC -- pAA;         %% label points here -- does not work :-(         labels(pAA,pBB,pCC);     endchar          end;      after running `mf foo.mf`, `gftodvi foo.2602gf`, the foo.dvi looks like this (no points shown): ![rendering of the dvi, no points labeled](http://i.stack.imgur.com/an0Gh.png) **EDIT:** Besides the answers by egreg below, labeled points can be shown with `makelabel("label",point)`:                   makelabel("AA",pAA);         makelabel("BB",pBB);         makelabel("CC",pCC);      produces ![dvi with points](http://i.stack.imgur.com/BI5BN.png)


title: How to repeat centered text in a sideway environment?

text: Some text can be repeated, for example, by using `\multido` of the package "multido" and text can be rotated by using the `sideways` environment of the package "rotating". Combining both works. But when trying to center the text additionally there is the revealing error message:               Somethings's wrong--perhaps a missing \item.      I didn't know that lists come into play... Here is a MWE:               \documentclass{article}     \usepackage{rotating,multido}     \begin{document}          %using center environment     \begin{sideways}     \multido{\i=0+1}{3}{%     \begin{center}This is some centered text...\end{center}     }     \end{sideways}          %using \centering     \begin{sideways}     \centering      \multido{\i=0+1}{3}{%     This is some centered text...\\ \bigskip     }     \end{sideways}          \end{document}      What is the problem?


title: Big data surface plots: Call gnuplot from tikz to generate bitmap and include automatically?

text: **Motivation** I have large numerical data files, that I would like to create density (surface) plots of. Since they are very big, we can rule out a few possibilities such as to   * plot them directly with `pgfplots`' `\addplot3[surf] file{test.dat};` I know that there are ways to get `pdflatex` to work, i.e. get rid of that memory restriction or circumvent it by using `lualatex`. But in the end the resulting picture/pdf would still be very big.   * plot them with `gnuplot` and use a vector terminal such as `eps` or even `tikz` works fine, but again, this creates quite large (graphic) files.   * create a bitmap with `gnuplot`              set term pngcairo size 800,600     set out "test.png"     set pm3d map          set lmargin at screen 0     set rmargin at screen 1.0     set bmargin at screen 0     set tmargin at screen 1.0          unset tics     unset border          splot "test.dat" u 1:2:3      and include it in `tikz/pgfplots` with              \begin{axis}[enlargelimits=false,axis on top]           \addplot graphics [xmin=-3,xmax=3,ymin=-3,ymax=3] {test.png};                                                                          \end{axis}       which works fine, but does not include a colormap in the final picture! What I would like to have is something like posted here: http://michaelgoerz.net/blog/2010/01/creating-combined-tikzpng-plots/ , i.e. take a bitmap from `gnuplot` and create all the axes/labels etc with tex/tikz. However, I don't like the structure of the `tikz` file generated by the `gnuplot tikz-terminal`. Makes it very hard/difficult to change anything in afterwards. And there are many manual steps involved. **Question/Request:** I was wondering, since we can already call `gnuplot` from within `tikz/pgfplots`, is there a way to automate this? I mean to tell `pgfplots` to generate a bitmapped `splot` (surface or not) with `gnuplot`, safe the bare bitmap and then include it in the `tex` file while adding appropriate `axis` and `colormap`. Something along the lines of               \begin{axis}[view={0}{90},colormap]      \addplot3       [         raw gnuplot,          surf,          bitmap/png      %<- I made up this bit!       ]             gnuplot[surf]        {         set pm3d map;         splot 'test.dat';       };     \end{axis}      I'm not sure if I can achieve this with another method that I don't know of. If so, please direct me! Also, if what I ask for is not possible yet, maybe this can be seen more like a feature request.


title: Automatic binning of histogram using raw gnuplot in pgfplot

text: I have a problem in plotting a histogram using the raw gnuplot in pgfplot. A minimal example is below.               \documentclass{article}          \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{tikzscale}          \usetikzlibrary{external}     \tikzexternalize     \tikzset{external/force remake}          \pgfplotsset{compat=1.8}          \usepackage{filecontents}               \begin{document}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \vspace{0.5cm}          \begin{filecontents*}{datafile}     -0.000632     0.004692     0.001407     0.005768     0.003117     0.001605     0.001742     -0.000874     -0.000973     -0.000436     -0.001578     -0.001953     -0.004275     -0.001585     -0.000957     -0.000819     -0.000924     -0.003559     0.001949     -0.000300     -0.003085     -0.002050     -0.000493     -0.001378     -0.000970     0.000912     0.001667     -0.000974     -0.000592     -0.000865     -0.000933     0.000435     -0.001278     0.001508     -0.000566     -0.003608     0.002768     0.005676     0.000331     -0.000527     -0.000589     -0.000751     -0.000503     -0.000718     -0.000950     -0.005616     -0.004347     -0.001818     -0.000503     0.001063     0.002109     -0.004156     -0.002612     -0.000773     -0.000635     -0.000218     -0.001041     -0.001247     -0.000283     -0.004434     -0.000370     0.002669     0.001302     0.001351     0.001618     0.002028     0.001291     0.004341     0.001141     0.001058     -0.004537     -0.000123     -0.000052     0.000010     -0.000643     0.001403     -0.000751     -0.000201     -0.001639     -0.000316     -0.000757     -0.000872     0.000530     -0.000969     -0.000826     -0.001076     -0.000808     0.001687     0.001356     0.001870     0.001016     0.002165     0.005372     0.001128     0.002269     0.001878     0.000839     -0.000798     -0.000846     0.000146     \end{filecontents*}          \begin{filecontents*}{histogram.tikz}     \tikzsetnextfilename{Fig-Histogram}     \begin{tikzpicture}         \begin{axis}[             xmode=linear,             ymode=linear,             axis x line*=bottom,             axis y line*=left,             tick label style={font=\small},             grid=both,             tick align=outside,              tickpos=left,             xlabel=Bins,             ylabel=Count,             width=0.45\textwidth,             height=0.4\textwidth,         ]         \addplot+[raw gnuplot, color=red] gnuplot {             binwidth=0.001;             bin(x,bw)=bw*floor(x/bw);             plot "datafile" using (bin($1,binwidth)):(1.0) smooth freq with boxes;         };         \end{axis}     \end{tikzpicture}     \end{filecontents*}          \begin{figure}[bth]         \begin{tabular}{p{3in}}             \includegraphics[]{histogram}         \end{tabular}         \caption{\small{Histogram.}}     \end{figure}          \end{document}      Compile with               pdflatex -shell-escape main.tex      No correct histogram is resulted. The generated plot is ![enter image description here](http://i.stack.imgur.com/45WP0.jpg) I have verified the correctness of the body of the raw plot using a try.plot as below.               set terminal postscript enhanced color "Times-Roman" 20          set xlabel "bins"     set ylabel "count"     set yrange [0:]          binwidth=0.0005     bin(x,width)=width*floor(x/width)          set output "./try.eps"          plot "datafile.tex" using (bin($1,binwidth)):(1.0) smooth freq with boxes      The resulted plot is ![enter image description here](http://i.stack.imgur.com/Pcslo.jpg) How can I do the following three things?   1. How to make the binning to be the same as it is in gnu plot?   2. How to make the automatic binned data to be sorted?   3. How to specify plotting in boxes in raw gnuplot?


title: Using nan values in pgfplots

text: I use addplot to plot a data set which has nan values. The data file contains 5 columns. First column is the x-axis (time), the second and fourth is the wavelenght (same element, but 2 measurements) with its corresponding errors in the third and fifth column. I can plot it with errorbars, but the last addplot does not work. I want to make different y expr for different cases (value is NaN or not), because otherwise pgfplots just skips the "fit" if there's a "NaN". Here is a minimal example:               \documentclass[11pt]{article}     \usepackage{pgfplots}     \usepackage{filecontents}     \usepackage{verbatim}          \begin{filecontents*}{data.dat}     time    w1  e1  w2  e2     1   3019    40  nan nan     2   3045    34  nan nan     3   3100    50  3104    24     4   3500    13  3498    90     5   3800    90  3803    12     6   nan nan 3980    43     7   nan nan 3985    80     \end{filecontents*}          \begin{document}          \begin{tikzpicture}     \begin{axis} [     compat=newest,     y tick label style={/pgf/number format/1000 sep=},     ymin=2900,     ymax=4400]              \addplot [only marks, mark=+, color=red, thick,         error bars/.cd,         y explicit,         y dir=both         ] table [x index=0, y index=1, y error index=2] {data.dat};         \addlegendentry{measurement 1}              \addplot [only marks, mark=+, color=green, thick,         error bars/.cd,         y explicit,         y dir=both         ] table [x index=0, y index=3,y error index=4] {data.dat};         \addlegendentry{measurement 2}          \begin{comment}     \addplot [color=blue, thick         ] table [x index=0,                          %this is the part I have no idea how to make it work:                          if (index 1 and index 3 are not NaN):                       y expr= (index 1 + index 3)/2                       y error expr= max{index 2, index 4}                     else if (index 3 = NaN):                       y index =1                       y error index=2                     else if (index 1 = NaN):                       y index =3                       y error index=4                      ] {data.dat};         \addlegendentry{fit}     \end{comment}          \end{axis}     \end{tikzpicture}          \end{document}      I hope it's obvious what I am trying to do. I am looking forward for your comments and thanking you in anticipation!


title: How can I make random placed edges between two graph partitions?

text: I have to nodes (V1) and (V2) (representing sets of graph vertices) and I want to draw, say, 10 edges(lines) between them. I don't want to hardcode random locations so I did:               \begin{pgfonlayer}{bg} % so they don't overlap the graphic representation of V1 and V2         \draw (V1)+(rand*.3,rand*.3) -- (V2)+(rand*.3,rand*.3);         \draw (V1)+(rand*.3,rand*.3) -- (V2)+(rand*.3,rand*.3);         \draw (V1)+(rand*.3,rand*.3) -- (V2)+(rand*.3,rand*.3);         %   ... repeat more 7 times ... (PS:I know tikz has a repeat/foreach/... command -      \end{pgfonlayer}      copying and pasting was just for being lazy) There are two problems with this approach:   1. _(Main one)_ Lines are starting at random locations within V1 but they always end on the center if V2 --- as if rnd was **returning 0** in those cases.   2. _(Not that important)_ When using \pause, the value are randomized again on the next slide which is not desired in my case. I realize I should store somehow those random values so that does not happen. But personally, if doing this makes the solution much harder I prefer not to solve it.   3. _(OK, bonus one)_ Is there a way to change the style of those edges (ie, turn them to dashed) on the next slide (ie, after a pause). (Apparently, `\draw[\alt{2}{...}{...}]` doesn't work..


title: how to centerlize a box in the very center of the paper?

text: I am trying to draw a box in the center of the current page (A4 size). I try the following code               \documentclass{article}     \usepackage{graphicx}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes,trees,shapes.misc}             \begin{document}       \pagestyle{empty}       \begin{tikzpicture}         \begin{scope}[color=gray,line width=1pt]           \draw (-15cm,0) -- (1cm,0) -- (1cm,16cm) -- (-15cm,16cm) -- cycle;         \end{scope}       \end{tikzpicture}     \end{document}      Now, I am manually change the coordinates of the corners of the box, but it doesn't help. It doesn't really locate in the center of the page.


title: How to typeset manuscript insertion marks?

text: In editing old manuscripts (often medieval), a convention is to mark text which the original scribe has inserted afterwards as a correction (usually above the line) with insertion marks. These look like something in-between a backtick and a backslash, and a single forward quote and a forward slash; something like tum etiam Brita\n/niae imperium obtinuerit I can't see anywhere in the LaTeX symbol lists the right pair of characters for this, which are supposed to match as a pair. Has anyone done it?


title: \renewcommand for commands defined with \def

text: In the following MWE I've used `\renewcommand` to redefine a command defined through `\def`:               \documentclass{article}          \def\mymacro{Hello}     \renewcommand{\mymacro}{Hello world}          \begin{document}     \mymacro     \end{document}       and it works fine, as far as I can see. What I would like to know is:   1. Are there cases in which it doesn't work?   2. Is it a good practice or I should I use `\def` to redefine commands defined through `\def`? EDIT I've already taken a look at What is the difference between \def and \newcommand?. What I mean is that sometimes I need to hack some commands defined through `\def` and I would like to know whether I'm allowed to do that with `\renewcommand` or not.


title: Figbib not working?

text: I'm new to TeX and didn't find my answer anywhere else. I use TeXmaker and I want to use `figbib` for managing my figures. Unfortunately, I don't even get the sample file working. I followed the steps provided in the documentation, i.e. use `latex, then`bibtex`, then`latex` at most 3 times until all cross- references has been updated. Unfortunately, it still says "Fig. ???". There are no figures visible. What did I do wrong? When using `BibTex` it reads this: > This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: > figbib_sample.aux I found no \citation commands---while reading file > figbib_sample.aux I found no \bibdata command---while reading file > figbib_sample.aux I found no \bibstyle command---while reading file > figbib_sample.aux (There were 3 error messages) I didn't change anything, just extracted it from the .zip. Therefore I think that I can ignore this, but maybe I'm wrong...


title: csquotes and invalid nesting with two nested \mkbibquotes

text: I was surprised when today I got the error message `Package csquotes Error: Unbalanced groups or invalid nesting`. After a while I found the culprit in my bibliography-file. It is a bib-item whose title contains two nested `\mkbibquote`-commands like               Title = {aaa aaa \mkbibquote{bbb bbb \mkbibquote{ccc ccc} bbb bbb} aaa aaa}      I have to say, I was rather surprised that this caused any problem at all, in particulalr since David has demonstrated to me elsewhere that the biblatex commands "are defined to expand to the normal ones by default". By "normal ones" he meant commands such as `\enquote` and it surely is alright to write `aaa aaa \enquote{bbb bbb \enquote{ccc ccc} bbb bbb} aaa aaa`, or isn't it? So what's wrong with my bib-item? MWE:               % !TEX TS-program = lualatexmk     \documentclass{scrartcl}          \usepackage{fontspec}         \setmainfont[Ligatures=TeX]{Times New Roman}          \usepackage{csquotes}     \usepackage[style=verbose,abbreviate=false,backend=biber]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @article{example,         Author = {Author},         Journaltitle = {Journaltitle},         Title = {aaa aaa \mkbibquote{bbb bbb \mkbibquote{ccc ccc} bbb bbb} aaa aaa},         Year = {2014}}     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \fullcite{example}.          \end{document}


title: How to remove extra letters added to section name using \verb with htlatex?

text:
MWE:               \documentclass{article}     \usepackage{cprotect}     \begin{document}     \cprotect\section{\verb|invlaplace(exp((a*s)^(1/2)), s, t)|}     test     \end{document}      pdflatex output: ![Mathematica graphics](http://i.stack.imgur.com/Q3cxe.png) but `htlatex foo.tex` generated this HTML output: ![Mathematica graphics](http://i.stack.imgur.com/vN7pq.png) The HTML is:               <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"         "http://www.w3.org/TR/html4/loose.dtd">             <title></title>      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">      <meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)">      <meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)">            <meta name="src" content="foo.tex">      <meta name="date" content="2013-11-16 02:34:00">      <link rel="stylesheet" type="text/css" href="foo.css">
1    invlaplace(exp((a*s)^(1/2)), s, t)ˆˆEˆˆL

test                 How can one remove the extra `^^E^^L` noise added? Using `This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)`


title: "<" symbol gets wrongly typed as \langle

text: For a reason that I cannot figure out, in an equation I am getting `<` typed as a `\langle`. Can someone give me a hint as to what is happening and how can I solve it? The document is rather minimal, I am only using the packages `babel` and `inputenc`.


title: apacite error - The style file: apacite.bst Database file #1: ... is a string literal, not a function

text: I am trying to use the `apacite` package for referencing however I am having some problems getting it to work. I am using Ubuntu and the Tex Live distribution so I installed the `texlive- bibtex-extra` Ubuntu package which contains `apacite`. I am using a bibtex file that works fine with `natbib` but for some reason does not work here. `Jung2009` is one of my references. Here is an example:               \documentclass[11pt,a4paper,oldfontcommands]{memoir}          \usepackage{apacite}          \begin{document}          example example example \cite{Jung2009}.           \bibliographystyle{apacite}%{unsrt}     \bibliography{library}          \end{document}      I initially had problems with citing in captions but solved that by placing `\protect` in front of the `\cite` commands. However I still get the following error when I try to compile               This is BibTeX, Version 0.99d (TeX Live 2013/Debian)     The top-level auxiliary file: apa_practice.aux     The style file: apacite.bst     Database file #1: library.bib     apacite.bst [2013/07/04 v6.02 APA bibliography style]     "" is a string literal, not a function, for entry Jung2009 while executing---line 5144 of file apacite.bst     (There was 1 error message)      EDIT: My .bib file is automatically generated from my reference manager Mendeley. Here is the input for `Jung2009`.               @article{Jung2009,     abstract = {...},     author = {Jung, Christian and M\"{u}ller, Andreas E},     doi = {10.1016/j.tplants.2009.07.005},     file = {:home/geff/Documents/Mendeley Files/Jung and Muller.pdf:pdf},     issn = {1878-4372},     journal = {Trends Plant Sci.},     keywords = {...},     month = oct,     number = {10},     pages = {563--73},     pmid = {19716745},     title = {{Flowering time control and applications in plant breeding.}},     url = {http://www.ncbi.nlm.nih.gov/pubmed/19716745},     volume = {14},     year = {2009}     }      EDIT2: by running apacite.ins in the folder with my .tex file I can get apacite to run and the above example works great. However now every citation in my real document causes an !Undefined Control Sequence Error. Even when I delete all other related files in the folder. Could it be other packages interfering? Here is my preamble, based off a template:               \documentclass[11pt,a4paper,oldfontcommands]{memoir}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{microtype}     \usepackage[dvips]{graphicx}     \usepackage{xcolor}     \usepackage{times}     \usepackage{parskip}     \usepackage{wrapfig}     \usepackage{tcolorbox}     \usepackage{lipsum}     \usepackage{subfig}     \usepackage[format=hang]{caption}     %\usepackage{cite}     \usepackage{apacite}               \usepackage[     breaklinks=true,colorlinks=true,     linkcolor=black,urlcolor=black,citecolor=blue,     bookmarks=true,bookmarksopenlevel=2]{hyperref}          \usepackage{geometry}          \geometry{total={210mm,297mm},     left=20mm,right=20mm,     bindingoffset=10mm, top=25mm,bottom=25mm}          \OnehalfSpacing     %\linespread{1.3}          %%% CHAPTER'S STYLE     \chapterstyle{brotherton}     %%% STYLE OF SECTIONS, SUBSECTIONS, AND SUBSUBSECTIONS     \setsecheadstyle{\Large\bfseries\sffamily\raggedright}     \setsubsecheadstyle{\large\bfseries\sffamily\raggedright}     \setsubsubsecheadstyle{\bfseries\sffamily\raggedright}               %%% STYLE OF PAGES NUMBERING     \pagestyle{plain}     \makepagestyle{plain}     \makeevenfoot{plain}{\thepage}{}{}     \makeoddfoot{plain}{}{}{\thepage}     \makeevenhead{plain}{}{}{}     \makeoddhead{plain}{}{}{}               \maxsecnumdepth{subsection}      \maxtocdepth{subsection}      Any help is greatly appreciated.


title: Conditionally Hiding Parts of Bibtex Fields Depending on Language Field Value

text: I would like to create a document with a bibliography using XeLaTeX with Biber. In the bibliography, there are Chinese books and articles, as well as English or German ones. Some of the authors have written articles (or books, what doesn’t really matter here) both in Chinese and English. In the Chinese articles, I would like to also give the authors Chinese name using Characters, whereas in his English articles there is no such need for it. Below is an example taken of my bib file. The `\zh{}` function is used to prevent latex to print the characters in footnotes as well:               @article{Liu2008,       author    = {Liu, {Guofu \zh{(刘国福)}}},       title     = {The Latest Development of Immigration Law: On the Transformation of China's Emmigration and Immigration Administration Law (移民法的最新发展——兼论中国出入境管理法的改造和重塑)},       journal   = {Journal of Henan Administrative Institute of Politics and Law (河南省政法管理干部学院学报)},       year      = {2008},       volume    = {5},       pages     = {46--58},       language  = {chinese},       keywords  = {article,hani}     }          @book{Liu2011,       author    = {Liu, {Guofu \zh{(刘国福)}}},       title     = {Chinese Immigration Law},       year      = {2011},       publisher = {Ashgate},       address   = {Farnham},       language  = {english},       keywords  = {monography,latn}     }      Now the point is: Biber of course only recognizes the author as being the same if the contents of the author fields are the same in both records. If I don’t use the Chinese characters in the English article as well, Biber will write the full name so as to make the “two” authors distinguishable, ignoring the fact that they are actually the same. Now, I got everything as I wanted: In the Bibliography, the authors’ names have the pattern “LIU, Guofu (刘国福) (2008)”, and in the footnotes there is just “LIU 2008” (as long as there is no other author named Liu). I did this with the following code-snippet in the preamble part of my tex file:               \providecommand{\zh}[1]{}     \AtBeginBibliography{%      \renewcommand*{\zh}[1]{#1}     }      But: How do I tell LaTeX not to print the `\zh{}` part in the author field if the entry has not chinese set as language. Is there any such way to set this conditionally? Also, in the footnotes the Chinese characters should never appear. It would be nice if I could tell LaTeX how to do in the tex file directly. There are also articles with multiple authors which should then have the pattern of “WANG, Liping (王丽萍); ZHANG, Ailing (张爱玲) (2008)” what makes the use of just another entry field for the Chinese characters somewhat complicated, I guess. * * * **Edit (2014-03-22):** It seems that my problem has already been considered elsewhere: How to create multilingual (English, Japanese) bibliographies with biblatex, biber and polyglossia So, as of biblatex 3.0 and biber 2.0 (both versions are in experimental stage at the moment) there is a possibility to save transcriptions or translations for most fields and, even more amazing, there is a way to set the display mode (show original language, show translation, etc.) for each bib entry separately. **Edit (2014-03-23):** Another approach, using the name affix: http://tex.stackexchange.com/a/66825/47927 This seems to be a working example of ienissei’s proposal.


title: Adding alignment marker & gives: Error: Extra }, or forgotten \right \end{align}

text: I have a weird problem with the Align environment in combination with brackets spanning more than 1 line. When I add alignment markers (&) to my equation in the Align environment I suddenly get an error saying that I have an extra }. The minimal example that reproduces the error looks like this:               \documentclass[a4paper,10pt]{article}     \usepackage{amsmath}          \begin{document}         \begin{align}         J      =& 2  \left[3x \right.  \nonumber  \\         \left. +& 4  \right]         \end{align}     \end{document}      If i take out the & it works. If I take out the brackets it also works. Can anyone explain what is going on and how I can overcome this issue? For completeness, the actual equation looks like this:               \begin{align}      J=E-\Delta P V =& \gamma\int_{-\pi}^{\pi}\int_0^{r_0}\left[\sqrt{r^2+r^2 \partial_r z^2 + \partial_\phi z^2}-r \cos\theta_Y \right. \nonumber  \\     \left. + & \,\frac{\rho g}{\gamma} z r \left(\frac{z}{2}\cos\alpha-r \sin \alpha \cos\phi\right)-\Delta P r z  \right] dr d\phi     \end{align}


title: Natbib and an organisation as an author

text: Using the APA style in natbib, and one of the authors is the "Department of Education". I use { } to keep the citation as a single author. However, because there is no "second part" to the citation, there is no full stop in the References section after the author. For example, the references would read "Department of Education (2004). Title here...". What I would like is "Department of Education. (2004). Title here..." MWE               @Misc{DHET2004,     Author = "DHET",     Title = "\emph{A new funding framework: {H}ow government grants are allocated to public      higher education institutions}",     Note = "Available: \url{http://www.dhet.gov.za/LinkClick.aspx?  fileticket=ZIpvOJ7GheM=&tabid=411&mid=1369}      [Accessed: 23 February 2014]",     year = 2004     }      Output: ![Referencing Output](http://i.stack.imgur.com/ROeO7.png) Is there a way to fix this?


title: An application of \foreach command in TikZ to generate labels

text: I would like ask you to help me solve the following application of `foreach` of `TikZ` package. By means of the following code:                    \documentclass{article}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}\small     \foreach \x in {0,...,3}     \fill (\x,0) circle (2pt);          \foreach \x in {0,...,3}     \node[above=2pt] at (\x,0) {\x};          \foreach \x in {3.25,3.5,...,4.75}     \fill (\x,0) circle (0.5pt);          \foreach \x in {5,...,8}     \foreach \y in {1,...,4}     {     \fill (\x,0) circle (2pt);     \node[above=2pt] at (\x,0) {$n+\y$};     }          \foreach \x in {8.25,8.5,...,9.75}     \fill (\x,0) circle (0.5pt);     \end{tikzpicture}          \end{document}                I obtain the picture below: ![enter image description here](http://i.stack.imgur.com/9eYUM.jpg) where arguments of `\y` are stacked one upon another. What I aim at are `n+1, ..., n+4` labels above the right- hand dots. But I do not know how to tell TikZ to make `\y` argument dependent on `\x` in this way. I will be grateful for any hints.


title: Align environment with blank left side in the first line

text: Is it possible to use the `align` environment (or something similar) to typeset something like the following (nonesense) example with _correct_ spacing?                 |a - c|     < |a - b| + |b - c|      What I want: The first line should be aligned to everything in the second (and consecutive lines) right from the `<`. I tried things like               \begin{align*}         &  |a - c|\\         & < |a - b| + |b - c|      \end{align*}      or               \begin{align*}         &  |a - c|\\         < & |a - b| + |b - c|      \end{align*}      but in the first example, the first line isn't aligned, and in the second example, the `<` is too close to the first `|` in the second line. Using something like `\phantom{<}` in the first line, i.e.               \begin{align*}         & \phantom{<} |a - c|\\         & < |a - b| + |b - c|      \end{align*}      didn't align the first line correctly, either. I'm probably overlooking a really obvious solution here, but I can't think of one myself and don't really know what to search for. EDIT: MWE:               \documentclass{minimal}     \usepackage{amsmath}          \begin{document}     \begin{align*}       & |a-c| \\       & < |a-b| + |b-c|     \end{align*}          \begin{align*}       & |a-c| \\       < & |a-b| + |b-c|     \end{align*}          \begin{align*}         & \phantom{<} |a - c|\\         & < |a - b| + |b - c|      \end{align*}          What I want:           \begin{align*}         & \phantom{ {}<{}} |a - c|\\         & < |a - b| + |b - c|      \end{align*}     \end{document}      The indicated `align*` is what I want (i.e. the last one), which is cmhughes' solution. Is there a way to do this without the `\phantom` (meaning a more flexible solution), or do you _have_ to do it like this?


title: Biblatex: footcite of inbook items uses book title instead of chapter name

text: I'm using **biblatex** 's `verbose-trad2` as a basis for defining a citation style. Toying with biblatex is still mainly black magic for me, I've no idea if my code is optimally written, and I've no idea what is supposed to be difficult and what is easy to modify. So, here's the problem: when I cite a work (book, article, etc.) for the first time using `\footcite`, the whole bibliographic data is printed. I call this the long form. If I cite the same work again later, only the author's last name, the title and the mention _op cit_ are printed (plus any postnote of course). I call this the short form. That's nice and it works well for all entries... except for `@inbook`, where in the short form, it's the _book_ 's title that gets printed and I would like to have the _chapter_. I at least managed part of it, since the book's title is formatted, in the short form only, like the chapter... my problem is that I don't even really understand what command from what file actually takes care of printing the citation. Here are links to files:   * biblatex code   * example .tex   * example .bbl   * and the resulting pdf The pdf is what you need to see an illustration of my complaint (between the first and the second footnote). Thanks for your time and any help!


title: Why are node names inside \begin{scope} still visible outside?

text: The following example draws three rectangles, each divided in two parts (they're Lisp cons cells). It works fine, but something doesn't seem right: I have used `\begin{scope}` inside the `\cons` macro, and inside that macro I have two nodes named `a` and `b`. However, if I use the names `a` and `b` outside the macro, things become confusing. Aren't the two names `a` and `b` inside `\begin{scope}` there supposed to be invisible to the rest of the document? The example works fine, but changing `aa` to `a`, and so on exposes the problem. Is there a better or easier way to do what I'm trying to do? **update:** So, names are defined globally anyway... I'd like to use the `\cons` macro several times in the same picture -- which doesn't seem to work if node names are global. What can I do then? Should I use only relative positioning and not give the nodes any names? Is this the only way?               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{shapes,positioning}          \begin{document}          \newcommand{\cons}{%     \begin{tikzpicture}[cell/.style={draw,shape=rectangle,minimum size=0.4cm}]     \begin{scope}     \node[cell](a)[anchor=west]{};     \node[cell](b)[right=0mm of a.east,anchor=west]{};     \end{scope}     \end{tikzpicture}     }          \begin{tikzpicture}     \node(aa){\cons};     \node(bb)[below left=of aa]{\cons};     \node(cc)[below right=of aa]{\cons};     \draw[->,red]  (aa.west) -| (bb.north);     \draw[->,blue] (aa.east) -| (cc.north);     \end{tikzpicture}          \end{document}