title: Problems with axis label and colorbar for pgfplots

text: I used matlab2tikz to convert a figure from matlab to tikz. When I run this code, I get this addition $.10^-2$ in both X and Y axis. (see figure below ). In addition ytick of the colorbar is also not showing. Can anyone identify cause of the problems, and suggest me the solution. ![enter image description here](http://i.stack.imgur.com/PAs2V.jpg) Here is the code:                 \documentclass{article}       \usepackage {tikz,pgfplots}       \usepgfplotslibrary{colormaps}            \begin{document}       \newlength\figureheight       \newlength\figurewidth          \setlength\figureheight{0.4 \columnwidth}        \setlength\figurewidth{0.4 \columnwidth}             \begin{tikzpicture}            \begin{axis}[%        width=\figurewidth,        height=\figureheight,        view={0}{90},        colormap/bone,        colorbar,        colorbar/width =0.4cm,        colorbar style ={at={(1.1,1)},          font = \scriptsize,       ytick={0,0.4,0.8},       yticklabels={$0$,$0.4$,$0.8$}       },        scale only axis,        ticklabel style ={font =\scriptsize},        xmin=-0.02, xmax=0.02,        xtick = {-0.02,0,0.02},        xticklabels ={-$0.02$,$0$,$0.02$},        xlabel={$v_x$ (m/s)},        xlabel near ticks,        font = \scriptsize,        ymin=-0.02, ymax=0.02,        ytick = {-0.02,0,0.02},        yticklabels ={-$0.02$,$0$,$0.02$},        ylabel={$v_y$ (m/s)},        ylabel near ticks,        font = \scriptsize,        zmin=-1, zmax=1,        zticklabels={\empty},        ]             \addplot3[%        surf,        shader=faceted,        draw=black,        point meta=explicit,        mesh/rows=11]        table[meta index=3,header=false] {        -0.02 -0.02 0 0.08        -0.02 -0.016 0 0.0724430811050993        -0.02 -0.012 0 0.0659696900098826        -0.02 -0.008 0 0.0609261848469113        -0.02 -0.004 0 0.0576888204074238        -0.02 0 0 0.0565685424949238        -0.02 0.004 0 0.0576888204074238        -0.02 0.008 0 0.0609261848469113        -0.02 0.012 0 0.0659696900098826        -0.02 0.016 0 0.0724430811050993        -0.02 0.02 0 0.08        -0.016 -0.02 0 0.0724430811050993        -0.016 -0.016 0 0.064        -0.016 -0.012 0 0.0565685424949238        -0.016 -0.008 0 0.0505964425626941        -0.016 -0.004 0 0.0466476151587624        -0.016 0 0 0.045254833995939        -0.016 0.004 0 0.0466476151587624        -0.016 0.008 0 0.0505964425626941        -0.016 0.012 0 0.0565685424949238        -0.016 0.016 0 0.064        -0.016 0.02 0 0.0724430811050993        -0.012 -0.02 0 0.0659696900098826        -0.012 -0.016 0 0.0565685424949238        -0.012 -0.012 0 0.048        -0.012 -0.008 0 0.0407921561087423        -0.012 -0.004 0 0.0357770876399966        -0.012 0 0 0.0339411254969543        -0.012 0.004 0 0.0357770876399966        -0.012 0.008 0 0.0407921561087423        -0.012 0.012 0 0.048        -0.012 0.016 0 0.0565685424949238        -0.012 0.02 0 0.0659696900098826        -0.008 -0.02 0 0.0609261848469113        -0.008 -0.016 0 0.0505964425626941        -0.008 -0.012 0 0.0407921561087423        -0.008 -0.008 0 0.032        -0.008 -0.004 0 0.025298221281347        -0.008 0 0 0.0226274169979695         -0.008 0.004 0 0.025298221281347        -0.008 0.008 0 0.032        -0.008 0.012 0 0.0407921561087423        -0.008 0.016 0 0.0505964425626941        -0.008 0.02 0 0.0609261848469113        -0.004 -0.02 0 0.0576888204074238        -0.004 -0.016 0 0.0466476151587624        -0.004 -0.012 0 0.0357770876399966        -0.004 -0.008 0 0.025298221281347        -0.004 -0.004 0 0.016        -0.004 0 0 0.0113137084989848        -0.004 0.004 0 0.016        -0.004 0.008 0 0.025298221281347        -0.004 0.012 0 0.0357770876399966        -0.004 0.016 0 0.0466476151587624        -0.004 0.02 0 0.0576888204074238         0 -0.02 0 0.0565685424949238         0 -0.016 0 0.045254833995939         0 -0.012 0 0.0339411254969543         0 -0.008 0 0.0226274169979695         0 -0.004 0 0.0113137084989848         0 0 0 0         0 0.004 0 0.0113137084989848         0 0.008 0 0.0226274169979695         0 0.012 0 0.0339411254969543         0 0.016 0 0.045254833995939         0 0.02 0 0.0565685424949238         0.004 -0.02 0 0.0576888204074238         0.004 -0.016 0 0.0466476151587624         0.004 -0.012 0 0.0357770876399966         0.004 -0.008 0 0.025298221281347         0.004 -0.004 0 0.016         0.004 0 0 0.0113137084989848         0.004 0.004 0 0.016         0.004 0.008 0 0.025298221281347         0.004 0.012 0 0.0357770876399966         0.004 0.016 0 0.0466476151587624         0.004 0.02 0 0.0576888204074238         0.008 -0.02 0 0.0609261848469113         0.008 -0.016 0 0.0505964425626941         0.008 -0.012 0 0.0407921561087423         0.008 -0.008 0 0.032         0.008 -0.004 0 0.025298221281347         0.008 0 0 0.0226274169979695         0.008 0.004 0 0.025298221281347         0.008 0.008 0 0.032         0.008 0.012 0 0.0407921561087423         0.008 0.016 0 0.0505964425626941         0.008 0.02 0 0.0609261848469113         0.012 -0.02 0 0.0659696900098826         0.012 -0.016 0 0.0565685424949238         0.012 -0.012 0 0.048         0.012 -0.008 0 0.0407921561087423         0.012 -0.004 0 0.0357770876399966         0.012 0 0 0.0339411254969543         0.012 0.004 0 0.0357770876399966         0.012 0.008 0 0.0407921561087423         0.012 0.012 0 0.048         0.012 0.016 0 0.0565685424949238         0.012 0.02 0 0.0659696900098826         0.016 -0.02 0 0.0724430811050993         0.016 -0.016 0 0.064         0.016 -0.012 0 0.0565685424949238         0.016 -0.008 0 0.0505964425626941         0.016 -0.004 0 0.0466476151587624         0.016 0 0 0.045254833995939         0.016 0.004 0 0.0466476151587624         0.016 0.008 0 0.0505964425626941         0.016 0.012 0 0.0565685424949238         0.016 0.016 0 0.064         0.016 0.02 0 0.0724430811050993         0.02 -0.02 0 0.08         0.02 -0.016 0 0.0724430811050993         0.02 -0.012 0 0.0659696900098826         0.02 -0.008 0 0.0609261848469113         0.02 -0.004 0 0.0576888204074238         0.02 0 0 0.0565685424949238         0.02 0.004 0 0.0576888204074238         0.02 0.008 0 0.0609261848469113         0.02 0.012 0 0.0659696900098826         0.02 0.016 0 0.0724430811050993         0.02 0.02 0 0.08         };         \end{axis}         \end{tikzpicture}              \end{document}


title: inline listing (lstinline) behaves bad at line end

text: I have defined some small macro to markup function names:               \lstdefinestyle{inline-funcname}{         columns=fullflexible,         breaklines=false,         %Note: \usefont{OML}{cmm}{m}{it} is exactly like \mathnormal         basicstyle=\usefont{OML}{cmm}{m}{it} %\itshape\ttfamily     }     \newcommand{\ifuncname}[1]{\lstinline[style=inline-funcname]{#1}}      It works great. The only case where it is sometimes a bit messed up is at the end of lines: ![screenshot](http://i.stack.imgur.com/qGE6p.png) Is there a way to make that better or avoid that fully?


title: Change from MiKTeX to TeX Live

text: I'm basically a noob when it comes to dealing with packages and TeX distributions. I currently have both MiKTeX and TeX Live installed with MiKTeX as the default distribution (I think), but I would like to change to TeX Live. The problem is: How exactly do I change this? I am using Windows, and the editors I use are Texmaker and TeXstudio.


title: choosing macro names so as to avoid namespace conflicts

text: I wish to choose names for macros in a manner that is least likely to conflict with names of other macros (including macros in packages that are not included in a document). Therefore, simply compiling the document with an invocation of a command and determining whether errors are thrown is not a desirable solution because the macro name may, in fact, be used in a very common package that has not been included in the compiled document. I suppose an ideal solution would be a LaTeX macro search engine that searches all packages in some database or archive (e.g., CTAN). I could then check a desired name for potential conflicts. Another useful solution would be a compiled table of all macros from packages in some archive or archive subset. Such a list would probably require some form of curation, though it could also be automatically generated. A final thought is that one could restrict the search to installed packages on one's machine.


title: How to increase the horizontal distance between nodes?

text: I've got this Tikz picture and I'd like to increase the horizontal distance between the nodes while keeping the vertical distance unchanged. I know how to do it by placing the nodes manually using coordinates, but I'd rather not do it if it can be avoided. ![picture showing the nodes](http://i.stack.imgur.com/1pyXN.png) Here's the code:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}       [align=center,node distance=2cm]       \node[label=above:A] (A)                                  {(1)};       \node[label=above:B1] (B1) [above right of=A]            {($m+1$)};       \node[label=above:B2] (B2) [below right of=A]            {($m+1$)};       \node[label=above:C] (C)  [below right of=B1]            {($2m-1$)};     \end{tikzpicture}     \end{document}      Any help appreciated.


title: Softsign derivative 1/(1+abs(x))^2 not drawn correctly at the 2009 latexlive version tikz, pgfplots

text: I want to draw 1/(1+abs(x))^2 in tikz. At home I have the new latexlive version installed and everything looks fine. At work I do not have the new latex version because Ubuntu 12.04 still includes the old version from 2009 in the repository. With the old version the graph has a "bump" around the y-axis. Does anyone know a workaround?               \documentclass{paper}     \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}         \begin{tikzpicture}             \begin{axis}                 \addplot[black, smooth] {1/(1+abs(x))^2};              \end{axis}         \end{tikzpicture}      \end{document}      ![Picture of the Bug](http://i.stack.imgur.com/cnYEd.jpg)


title: Numeration of formulas in Lyx

text: How to numerate formulas in Lyx? Is there exist LaTeX command like "\tag "? I haven't found corresponding info before.


title: How can I make the dots in a ToC end at the same place?

text: In my table of contents, some of the dot fills do not end at the same place as the other lines. What is causing this and how can I make the dot fills uniform? A red oval highlights the problem in the following screenshot: ![Extra dot in ToC](http://i.stack.imgur.com/tOmL5.png) _Edit:_ It looks as if the page number "101" is slightly less wide than the other page numbers, allowing just enough room for an extra dot. This is probably the cause, but I still don't know how to fix the problem. _Edit 2:_ Minimal working example below. The document class is located at https://github.com/wannesm/adsphd/blob/master/adsphd.cls, and is quite long -- apologies for the inconvenience.               \documentclass{adsphd}          \begin{document}          \mainmatter % Arabic page numbering          \tableofcontents          \setcounter{page}{98}     \chapter{Numerical solution of bivariate and polyanalytic polynomial systems}     \section{Introduction}\clearpage     \section{Notation and preliminaries}\clearpage     \section{Solving systems of bivariate and polyanalytic polynomials}\clearpage     \subsection{The polynomial eigenvalue problem}\clearpage     \subsection{Balancing the system and its associated pencil}\clearpage     \subsubsection{Balancing the bivariate system}\clearpage     \subsubsection{Balancing the polyanalytic system}\clearpage     \subsubsection{Balancing the pencil}\clearpage     \section{Numerical experiments}\clearpage     \section{Conclusion}\cleardoublepage          \end{document}


title: Side notes marking multiple lines of text

text: I am looking for a method to put small side notes next to the text, by simultanously marking the amount of lines to which the note refers. So, something like this: ![enter image description here](http://i.stack.imgur.com/tGGmC.jpg) I was trying many methods like `todonotes`, `sidenotes`, `marginpar` with `mdframed`, etc. But all packages seem to limit the height depending on the amount of text in the note. And I can only point the note to a specific place in the main text. But I want something that I can point to a specific amount of text or paragraph which also determines the note height.


title: Why is \linebreak failing?

text: Consider the following minimal, using `\linebreak`:               \documentclass{article}     \begin{document}     It is impossible to say how first the idea entered     my brain, but, once conceived, it haunted me day     and night. \linebreak          Object there was none.           \tt\meaning\linebreak     \end{document}       This produces the output, ![enter image description here](http://i.stack.imgur.com/ttqHE.png) I am interested to find out how the explanation of this behaviour. Is LaTeX2e buggy in this respect? **Edit** Based on the suggestions in the answers, I had another look at the TeXBook and it appears the behaviour is embedded in TeX's algorithm, quoting: > **Question** In one of the paragraphs earlier in this chapter, the author > used `\break` to force a line break in a specific place; as a result, the > third line of that particular paragraph was really spaced out. Explain why > all the extra space went into the third line, instead of being distributed > impartially among the first three lines. > > **answer** Distributing the extra space evenly would lead to three lines of > the maximum badness (10000). It's better to have just one bad line instead > of three, since TeX doesn't distinguish degrees of badness when lines are > really awful. In this particular case the `\tolerance` was 200, so TeX > didn't try any line breaks that would stretch the first two lines; but even > if the tolerance had been raised to 10000, the optimum setting would have > had only one underfull line. If you really want to spread the space evenly > you can do so by using `\spaceskip` to increase the amount of stretchability > between words. Of course I was wrong in titling the question a `failing` and apologies to the LaTeX Team and Knuth. However, I still have a feeling that the algorithm has room for improvement in this edge cases or at least `\linebreak` could be given a better semantic name `\maybebreak` can be one of them.


title: Boxplot in LaTeX

text: I am new to LaTeX. How can I draw a boxplot in LaTeX. My data set is as below               index median box_top box_bottom whisker_top whisker_bottom     0 1 1.2 0.4 1.5 0.2     1 2 2.3 1.5 2.7 1     2 0.7 1.4 0.5 1.9 0.1      I am using Kile on Ubuntu 12.04 LTS. EDIT: Code is added with output.                   \documentclass{minimal}         \usepackage{pgfplots}         \usepackage{filecontents}              \begin{filecontents}{testdata.dat}          0 1 1.2 0.4 1.5 0.2          1 2 2.3 1.5 2.7 1          2 0.7 1.4 0.5 1.9 0.1          3 1 1.2 0.4 1.5 0.2          4 2 2.3 1.5 2.7 1          5 0.7 1.4 0.5 1.9 0.1         \end{filecontents}              \pgfplotsset{          box plot width/.initial=1em,          box plot/.style={             /pgfplots/.cd,             black,             only marks,             mark=-,             mark size=\pgfkeysvalueof{/pgfplots/box plot width},             /pgfplots/error bars/.cd,             y dir=plus,             y explicit,          },          box plot box/.style={             /pgfplots/error bars/draw error bar/.code 2 args={%                 \draw  ##1 -- ++(\pgfkeysvalueof{/pgfplots/box plot width},0pt) |- ##2 -- ++(-\pgfkeysvalueof{/pgfplots/box plot width},0pt) |- ##1 -- cycle;             },             /pgfplots/table/.cd,             y index=2,             y error expr={\thisrowno{3}-\thisrowno{2}},             /pgfplots/box plot          },          box plot top whisker/.style={             /pgfplots/error bars/draw error bar/.code 2 args={%                 \pgfkeysgetvalue{/pgfplots/error bars/error mark}%                 {\pgfplotserrorbarsmark}%                 \pgfkeysgetvalue{/pgfplots/error bars/error mark options}%                 {\pgfplotserrorbarsmarkopts}%                 \path ##1 -- ##2;             },             /pgfplots/table/.cd,             y index=4,             y error expr={\thisrowno{2}-\thisrowno{4}},             /pgfplots/box plot          },          box plot bottom whisker/.style={             /pgfplots/error bars/draw error bar/.code 2 args={%                 \pgfkeysgetvalue{/pgfplots/error bars/error mark}%                 {\pgfplotserrorbarsmark}%                 \pgfkeysgetvalue{/pgfplots/error bars/error mark options}%                 {\pgfplotserrorbarsmarkopts}%                 \path ##1 -- ##2;             },             /pgfplots/table/.cd,             y index=5,             y error expr={\thisrowno{3}-\thisrowno{5}},             /pgfplots/box plot          },          box plot median/.style={             /pgfplots/box plot          }         }              \begin{document}         \begin{tikzpicture}         \begin{axis} [enlarge x limits=0.5,xtick=data, box plot width=0.5em]          \addplot [box plot median] table {testdata.dat};          \addplot [box plot box] table {testdata.dat};          \addplot [box plot top whisker] table {testdata.dat};          \addplot [box plot bottom whisker] table {testdata.dat};         \end{axis}         \end{tikzpicture}         \end{document}      ![enter image description here](http://i.stack.imgur.com/cr5yi.png) EDIT 2: here is the actual data I am trying to plot               %index median box_top box_bottom whisker_top whisker_bottom     0.52 21.5 191.5 4 150842.5 3     0.53 17 71.5 3 30840.5 2     0.54 5 1 2 2799 1     0.55 9 54 3 2425 2     0.56 4 11.5 2 643.5 1     0.57 3 10 2 124 1


title: Option clash with hyperref

text: If anyone has come across this issue when dealing with uploading tex files on arxiv, their experience would be of immense help: I am trying to upload a `.tex` document to arxiv. I upload my .tex file and my .eps figures and .bbl as requested. When I process my files **no pages of output** are produced because of an `! LaTeX Error: Option clash for package hyperref.` Now, how do I deal with this? How exactly/with what package must I use `\PassOptionsToPackage{...}` or `\RequirePackage{...}` as done here? **My preamble is:**               \documentclass[a4paper,12pt]{article}     \usepackage[margin=2.5cm,letterpaper]{geometry}     \usepackage{authblk}     \usepackage{setspace}     \usepackage{subfig}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{caption}     \usepackage{graphicx}     \usepackage{hyperref}     \usepackage[super,comma,sort&compress]{natbib} % enhances bibtex citations     \usepackage{hypernat}     \usepackage[english]{babel}     \usepackage[T1]{fontenc} %Useful for file names with underscores in them     \usepackage{float}     \usepackage{grffile}     \newcommand{\hilight}[1]{\colorbox{yellow}{#1}} %To highlight text     \renewcommand{\thefootnote}{\alph{footnote}} %For footnotes      **Log file generated by arxiv** is available here on pastebin # EDIT: I edited my latex file and **removed** `\usepackage{hyperref}`. This definitely got rid of the `! LaTeX Error: Option clash for package hyperref.` message _but_ now the **arXiv** TeX compiler gives me a fatal error **after** several `package natbib warning`s for all the references. Do I have a problem with `natbib` only?


title: Triangle as constraints in structural engineering

text: I guess this must be quite simple, but all I've tried didn't work so far. All I want is to get some triangles on the edge of a framework. Something like this: ![enter image description here](http://i.stack.imgur.com/FriAT.jpg) My code looks like this:               \documentclass[tikz]{standalone}     \usetikzlibrary{calc,decorations.markings}     \usepackage{tikz}     \begin{document}          \begin{tikzpicture}[scale=1,inner sep=0pt,thick,dot/.style={draw,circle,minimum size=4pt},     put coord sys/.style={     decoration={markings,     mark= at position 0.5     with     {     \draw[-latex,ultra thin,blue!80!black] (2pt,2pt) -- ++(5mm,0) node[above right,rotate=\pgfdecoratedangle] {$\scriptstyle x$};     \draw[-latex,ultra thin,green!80!black] (2pt,2pt) -- ++(0,5mm) node[above right,rotate=\pgfdecoratedangle] {$\scriptstyle y$};     }     },     postaction=decorate}]          %\draw [help lines] (0,0) grid (3,4);     \node[dot] (2) at (0,0) [label={[label distance=1mm]270:2}] {};     \node[dot] (3) at (0,2) [label={[label distance=1mm]180:3}] {};     \node[dot] (1) at (0,4) [label={[label distance=1mm]90:1}] {};     \node[dot] (4) at (3,2) [label={[label distance=1mm]0:4}] {};     \node[dot] (5) at (2.5,4) [label={[label distance=1mm]45:5}] {};          %\draw[gray] ++(150:0.3) -- (0,0);      %\draw[gray] ++(-150:0.3) -- (0,0);      %\draw[gray] ++(180:0.3) -- (-.3,0);           %\draw[gray] ++(0,4) -- (150:1);      %\draw[gray] ++(-150:0.3) -- (0,4);      %\draw[gray] ++(180:0.3) -- (-.3,4);           %\draw  (2) -- (3) node [midway,sloped,above] {3};     %\draw  (3) -- (4) node [midway,above,sloped] {4};           %\draw  (2) -- (4) node [midway,above,sloped] {6};           %\draw  (3) -- (1) node [midway,above,sloped] {2};       %\draw  (1) -- (5) node [midway,above,sloped] {1};       %\draw  (3) -- (5) node [midway,above,sloped] {5};       %\draw  (4) -- (5) node [midway,above,sloped] {7};                \draw[put coord sys]   (2) -- (3);     \draw[put coord sys]   (3) -- (4);           \draw[put coord sys]   (2) -- (4);       \draw[put coord sys]   (1) -- (3);     \draw[put coord sys]   (1) -- (5);     \draw[put coord sys]   (4) -- (5);     \draw[put coord sys]   (3) -- (5);          \end{tikzpicture}          \end{document}      The "trick" with the `\draw[gray] ++(150:0.3) -- (0,0);` command doesn't work very well. In fact it doesn't work at all in this way :) Does anyone have any ideas how to get these triangles?


title: Multibib compiling multiple .aux files

text: I'm trying to run quite literally this exact example: specific citation style using multibib               \documentclass{scrartcl}          \usepackage[resetlabels,labeled]{multibib}          \newcites{A}{References2}          \begin{document}     Reference without prefix \cite{bb} and a reference with prefix \citeA{aa}.          \bibliographystyle{plain}     \bibliography{lit}                           \bibliographystyleA{plain}     \bibliographyA{lit}                             \end{document}      with lit.bib containing               @Article{aa,       author =   {Author, A.},       title =    {Title},       journal =  {Journal},       year =     2000     }          @Article{bb,       author =   {Brother, B.},       title =    {Titling},       journal =  {Ann. J.},       year =     2002     }      And it is giving me a [?] instead of the A1 reference. Any ideas? I have compiled using the sequence:               PDFLaTeX     BibTeX     PDFLaTeX     PDFLaTeX


title: Network/Message Sequence Diagram

text: I am looking to produce something similar (but more complex) to this diagram: ![enter image description here](http://i.stack.imgur.com/tWL4r.png) This depicts network packets between two sides of communication. I don't know if there is any specific name for it (edit: Message Sequence Diagram). It looks similar to a sequence diagram from pgf-umlsd, but there are some fundamental differences:   * the arrows are at an angle to depict the time the packet travels from sender to receiver   * there is no control passing as in the sequence diagram Do you know what the name for this kind of diagram is? Are there any macros to accomplish this easily or is it something that can be created quickly? Basically what I need are arrows at an angle, labels for the arrows themselves and the anchor points of the arrows, nothing else really.


title: Contextual mix of lining and old-style numbers

text: I am developing a class that fits the needs of both academics and non- academics; the latter often need to write highly legible numbers that are not math (they will be prices, reference numbers, dates, etc.). For this purpose, the choice of fonts is very limited – we need a free, old- style font with as many alphabets as we can get, including at least all of Latin Extended and Greek (some medieval alphabets are a good point). It also needs to be reasonably XeLaTeX and copy-paste friendly. I settled for Junicode (though I am open to suggestions). The problem is that Junicode has an old-style `1` that looks just like a lowercase `I`, hence it is suitable for academics and general page designs, but not for the contents of non-academic documents. The developer does not seem to have been active lately – we asked for an alternate old-style `1`. My current solution is to create an option (academic vs. others) that affects the old-style numbers feature for the entire document. What are other solutions that would allow me to switch numbers in a clean and subtle (contextual) way?   * By using a different set of numbers throughout the documents (I have tried several solutions that change the `catcodes`, but then footnotes failed to superscript). _See the code below._   * By switching to lining numbers on non-academic documents but only for text that is directly inputed by the user after `\begin{document}` (not class-defined macros, unless specified).   * By using a specific command that changes the font (this one is easy to implement, so the question is: what would be a wise, ergonomic and user-friendly way to do it, otherwise the extra hassle for the end-user is not worth it).   * I am not into tweaking the font itself, since the idea is to release the class (but another compatible font would be ok).   * Or anything else you can think of. * * * My first attempt was as follows. It works just fine, except `\textsuperscript` numbers are set at normal size on the baseline ( _e.g._ `\footnotemark`) — and I suspect this hack would cause other problems when used in a long or complex document that includes bibliographies, indexes, etc.               \RequirePackage{fontspec}     \setmainfont[Numbers=OldStyle]{Junicode}          \newfontfamily\numbersfont[Scale=MatchLowercase]{Georgia}          \XeTeXinterchartokenstate = 1     \newXeTeXintercharclass\charnumbers     \XeTeXcharclass`0=\charnumbers     \XeTeXcharclass`1=\charnumbers     \XeTeXcharclass`2=\charnumbers     \XeTeXcharclass`3=\charnumbers     \XeTeXcharclass`4=\charnumbers     \XeTeXcharclass`5=\charnumbers     \XeTeXcharclass`6=\charnumbers     \XeTeXcharclass`7=\charnumbers     \XeTeXcharclass`8=\charnumbers     \XeTeXcharclass`9=\charnumbers          \XeTeXinterchartoks 0 \charnumbers = {\begingroup\numbersfont}     \XeTeXinterchartoks 255 \charnumbers = {\begingroup\numbersfont}     \XeTeXinterchartoks \charnumbers 0 = {\endgroup}     \XeTeXinterchartoks \charnumbers 255 = {\endgroup}      Does anyone have an idea to solve this issue or provide an alternative solution that does not require too much from the end-user? (As explained above.)


title: How can I save the bounding box of a TikZpicture and use in other TikZpicture

text: I need 2 different TikZpictures with the same bounding box (the one of the first TikZpicture) because I need a perfect vertical alignment of the subfigures side by side. Please, how can I handle this?


title: Indenting multi-line sentences

text: For example, in the actual .tex file, I'd like sentences like this:               Due to this,     some reasonable conclusion.     Next sentence.      To be formatted like this:               Due to this,        some reasonable conclusion.     Next sentence.      Ideally this formatting would happen while typing (e.g., after pressing ',\n', or '\ns'). I use line breaks for each sentence in Latex. This works great most of the time. However there are times where I have a long sentence that hits the line break for my editor that I do not want to shorten. So currently I am breaking these longer sentences at some semantic break point (e.g., a comma). But I would like to visually be able to quickly see where these multi-line sentences occur in my document. So I'd like all lines but the first line in a multi-line sentence to be indented. Is this possible in Latex? I'm using the vim `latex-suite` plugin currently.


title: Elements of TOC styling using memoir class

text: I have yet another (baffling) question. Suppose I have the figure attached ![enter image description here](http://i.stack.imgur.com/ngh2i.png) The question is how can I move the chapter numbers to align with the first line of the chapter title ? i.e using the figure, I'd like to move 11 to align with chapter 3 and 9 to align with chapter 2. I appreciate all the help I get from here. Makes me understand faster this business of typesetting with LaTeX. By the way, I use Memoir class.


title: textbf+UpperCase title

text: I would like to make a section title UpperCase+textbf, however, while trying to define it like this               \makeatletter     \renewcommand{\section}{         \@startsection             {section}{1}{0mm}         {\baselineskip}%         {\baselineskip}          {\fontsize{14}{14}\centering\textbf\MakeUppercase}              }%        \makeatother       an error is produced. If I use only one of these two properties (`\textbf` or `\MakeUppercase`), everything works fine, so what's the problem?


title: How to eliminate excessive vertical spacing

text: How would someone go about eliminating excessive spacing (leading) in a document? I don't see any reason why these gaps are there. Below is part of the code that I'm working with, the gaps are after the example subtitle and after of `$\theta$` before solution.               \example      Use the triangle in \rfig{mckeague_cat_img3} to find the values of the     six trigonometric functions of $\theta$.     \solution \rfig{mckeague_cat_img3} gives the lengths of the hypotenuse and the side adjacent to     $\theta$. Use the Pythagorean Theorem to find     the length of the other side:     \begin{alignat*}{2}     12^2 + b^2 &= 13^2 &\\     144 + b^2 &= 169 &\\     b^2 &= 25 &\\     b &= 5 &\\      \end{alignat*}      These large paragraph breaks (?) are everywhere in my document, this is just a single example.


title: Evaluating a string to a command

text: How do I construct a string in LaTeX (perhaps with variables) that calls the LaTeX macro with the corresponding name? For example, say I have defined a comment as `\def\Comment1{Example text.}` and `\def\CommentText[#1]{\comment#1}` and I want `\CommentText[1]` to produce "Example text". I am pretty sure the above does not work. Is there any way to make it work? Is there some good way to achieve the same result with another method (assuming I have about 50 comments that I want to name with names that make them easy for others to understand).


title: How can I have this specific line in one line and not two!

text: I would like to have the element surrounded by a red rectangle in one line and not to: Maybe there is something to force him to be shown in one line or maybe I can reduce the the margin left for this specific element but I don't know how to do it ![enter image description here](http://i.stack.imgur.com/DfkMK.jpg)               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %     % License:     % CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)     % This template requires the moderncv.cls and .sty files to be in the same      % directory as this .tex file. These files provide the resume style and themes      % used for structuring the document.     %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %----------------------------------------------------------------------------------------     %   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS     %----------------------------------------------------------------------------------------          \documentclass[11pt,a4paper,sans]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper, legalpaper, executivepaper or landscape; font families: sans or roman          \moderncvstyle{casual} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'     \moderncvcolor{blue} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'          \usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template     \usepackage[top=1.1cm, bottom=1.5cm, left=2cm, right=2cm]{geometry}     %\usepackage[scale=0.75]{geometry} % Reduce document margins     %\setlength{\hintscolumnwidth}{3cm} % Uncomment to change the width of the dates column     %\setlength{\makecvtitlenamewidth}{10cm} % For the 'classic' style, uncomment to adjust the width of the space allocated to your name                         %----------------------------------------------------------------------------------------     %   NAME AND CONTACT INFORMATION SECTION     %----------------------------------------------------------------------------------------          \firstname{Mehmet} % Your first name     \familyname{DEMIR} % Your last name          % All information in this block is optional, comment out any lines you don't need     %\title{Étudiant en réseaux et télécommunications}     \address{50, rue de la Paix}{77270 Villeparisis}     \phone{06 52 42 28 65}     \email{demir.mehmet90@gmail.com}     \extrainfo{23 ans}     %\homepage{staff.org.edu/~jsmith}{staff.org.edu/$\sim$jsmith} % The first argument is the url for the clickable link, the second argument is the url displayed in the template - this allows special characters to be displayed such as the tilde in this example     \extrainfo{Permis B / Véhiculé}     \photo[100pt][0.4pt]{pictures/picture} % The first bracket is the picture height, the second is the thickness of the frame around the picture (0pt for no frame)     \quote{Obtenir un contrat d'apprentissage d'une durée de trois ans en cycle ingénieur}               %----------------------------------------------------------------------------------------          \begin{document}          \makecvtitle % Print the CV title     \vspace*{-1.5cm}          \section{Formations}     \cventry{2013 -- 2014}{Formation d'Ingénieurs}{Institut Galilée}{}{}{Spécialité Télécommunications et Réseaux}     \cventry{2010 -- 2013}{Diplôme Universitaire de Technologie}{I.U.T de Villetaneuse (Paris XIII)}{}{}{Spécialité Télécommunications et Réseaux}     \cventry{2010}{Baccalauréat Scientifique}{Lycée Gérard de Nerval (Noisiel, 77186)}{}{}{Spécialité Physique-Chimie}          \section{Compétences}     \cvitem{Langages}{Java, HTML5/CSS3, Javascript, C/C++, PHP, SQL, Script Shell, XML}     \cvitem{Environnements}{Windows, Linux, Android}     \cvitem{Réseaux}{Mise en places des architectures LAN / WLAN}     \cvitem{}{Principe d'interconnexion de réseaux TCP/ IP}     \cvitem{}{Paramétrage de routeurs CISCO}     \cvitem{}{Mise en place d'outils réseaux sur un serveur Linux : DHCP, VPN, firewall et proxy}     \cvitem{}{Réseaux locaux, Ethernet}     \cvitem{Télécoms}{Configuration PABX, VoIP}     \cvitem{}{Fibre optique}     \cvitemwithcomment{Langues}{Anglais}{Bon niveau (\textbf{950} au dernier \textbf{TOEIC})}     \cvitemwithcomment{}{Espagnol}{Débutant}     \cvitemwithcomment{}{Turc}{Bilingue}     \cvitem{Logiciels}{Microsoft Office, Open Office}          \section{Expériences professionnelles}          \cventry{Mars 2012\\\`a  Aujourd'hui}{Auto-entrepreneur}{}{}{}{Gestion de Oues Peinture, entreprise spécialisée dans la peinture et travaux de rénovation.\newline{}}          \cventry{Avril 2013\\\`a Juin 2013}{Stage de fin d'études}{University of Bergen}{Norv\`ege}{}{Développement d'une application mobile Android pour contr\^oler une prise de courant GSM.\newline{}}          \cventry{2006 - 2012}{Travailleur saisonnier}{SBR Décoration}{entreprise de B.T.P}{}{     \begin{itemize}%     \item Préparation de commandes, factures et devis,     \item Elaboration de l'emploi du temps des salariés,     \item Gestion des courriers de l'Assurance Retraite et de l'URSSAF.\newline{}     \end{itemize}}          \section{Centres d'intérêt}     \cvitem{Intérêts}{Association << Entraide Scolaire Amicale >>}     \cvitem{Sport}{Football en salle, musculation}     \cvitem{Cinéma}{Films et séries anglophones en version originale}          \end{document}


title: Conditionals within captions

text: I have defined a conditional using the `ifthen` package as:               \newcommand{\Switch}[1] { \ifthenelse{\equal{#1}{1}}{Test1}{Test2} }      Running this command works without problem. However, if I try to place it within a Figure Caption, it produces an error (i.e., `\Switch{1}` and `\caption{Example text}` work fine, but `\caption{\Switch{1}}` does not). Is this expected behavior? How do I work around it to produce a conditional caption?


title: Create a "List of Effective Pages"

text: I am considering learning Latex in order to more easily maintain a bunch of manuals for my company. One of the requirements is to have a "List of Effective Pages" towards the beginning of the document which is a list of every page in the document and the revision level and date for that page. (Note that this is a requirement of our regulatory oversight so is not optional.) Optionally, I would (really) like to combine pages with the same revision level into one line like in the example below. For instance:               PAGE NUMBER      REVISION NUMBER     REVISION DATE       i - ix              2                03/23/10        1-1                2                03/23/10     1-2 - 1-10            1                06/15/09     2-1 - 2-19            0                01/31/09       While I have searched this site and Google, I have not found a solution to this particular aspect of our manuals. Can anyone point towards a way to accomplish a List of Effective Pages? **EDIT**   For a little more background and to respond to some of the comments, this is indeed for required manuals in the aviation industry. Also, we do typically use chapter specific page numbers to help minimize the impact of adding a new page. (I have updated the example above to reflect this.) Also, the table of contents, list of effective pages, etc are all in the introduction section of the document, and start with roman numeral page numbers so that adding an additional page does not impact the rest of the document. I am a programmer (very active on SO) so when I say that I am considering learning Latex, I don't have an issue with learning the macro programming aspects as well, and would happily give my code back to the community. I'm just trying to determine if it is even feasible with the limitations of the system and, if it is, I would like some guidance from more experienced individuals to get headed down the right path.


title: How to improve table code?

text: I am trying to write a tex code that output a table like below: ![enter image description here](http://i.stack.imgur.com/1HEvs.png) I wrote the following code:                   \newcounter{NumberReqF}         \newcommand{\ReqF}{\stepcounter{NumberReqF}\theNumberReqF ~- }         \newcounter{NumberReqNF}[NumberReqF]         \newcommand{\ReqNF}{\stepcounter{NumberReqNF}\theNumberReqF .\theNumberReqNF ~- }                  \setcounter{NumberReqF}{0}             \setcounter{NumberReqNF}{0}             \noindent \begin{table}[h!]                 \begin{tabular}{|p{0.40\columnwidth}|p{0.15\columnwidth}|p{0.15\columnwidth}|c|c|}                     \hline                      \multicolumn{3}{|p{0.70\columnwidth}|}{\ReqF Requisito Funcional} & \multicolumn{2}{p{0.30\columnwidth}|}{Oculto ()}\tabularnewline                     \hline                      \multicolumn{5}{|p{\columnwidth}|}{Aqui vai a descrição do requisito funcional, falando como ele funciona e tal mais algo. Pra testa o espaço vo coloca mais esse text pra que veja como a tabela se comporta}\tabularnewline                     \hline                      \multicolumn{5}{|p{\columnwidth}|}{\centering Requisitos Não-Funcionais}\tabularnewline                     \hline                      Nome & Restrição & Categoria & Desejável & \multicolumn{1}{c|}{Permanente}\tabularnewline                     \hline                      \ReqNF nome do resquisito não-funcional &  &  &  & \multicolumn{1}{c|}{}\tabularnewline                     \hline                      \ReqNF nome do resquisito não-funcional &  &  &  & \multicolumn{1}{c|}{}\tabularnewline                     \hline                 \end{tabular}             \end{table}      it outputs: ![enter image description here](http://i.stack.imgur.com/YkiJ6.png) But the code is so complex How could I improve it? Making it easy to read, write new rows. I intend to add many table like it. I was thinking about create a new command also but I have no idea how.


title: Managing a project: separate .tex-files, externalized TikZ, folders

text: I am currently cleaning up my project to manage it better as it expands in the future. I am wondering if there is a way to manage the following in a smarter and more efficient way. Currently, this is my LaTeX structure:               main.tex       \include{chapter_1.tex}         \input{fig_1.tikz}         \input{fig_2.tikz}       \include{chapter_2.tex}         \input{fig_1.tikz}       \include{chapter_3.tikz}      Into `main.tex` I include chapters like `\include{chapter_1.tex}`. Inside each chapter, there might be figures generated from TikZ, which I include like `\input{fig_1.tikz}`. Now, since I would like to keep my project's directory clean, I wanted to have a folder structure, where I have a folder for images, within which images are separated according to the chapters they belong to, like the following:               main_folder/       |-- main.tex       |-- chapter_1.tex       |-- chapter_2.tex       |-- chapter_3.tex       |-- figures/         |-- chapter_1/           |-- generated_fig_0.pdf           |-- generated_fig_1.pdf           |-- tikz/             |-- fig_1.tikz             |-- fig_2.tikz      and so on. Each tikz would then be input like `\input{figures/chapter_1/tikz/fig_1.tikz` Now, the problem arises, when I externalize my figure generation from TikZ to speed up my document compilation. In my document header I have `\tikzexternalize[prefix=figures/]` to sort all TikZ images into the `figures/` folder. In each included chapter, at the start of the file there is `{ \tikzset{external/figure name/.add={chapter_1/}{}}` with a closing brace `}` after the chapter's body to add a prefix for putting all generated content into `figures/chapter_#/` and keep that limited to the scope of the chapter's body. However, if I want each generated image to have a meaningful name, I need to add `\tikzsetnextfilename{image_name}` before each inputted TikZ, such that I would always have blocks like this:               \tikszetnextfilename{foo}     \input{figures/chapter/tikz/foo.tikz}      Is there maybe a straightforward way that if I have a chapter `foo.tex`, into which I want to input `bar.tikz`, that some `\input{bar.tikz}` will automatically look for `bar.tikz` in `figures/foo/tikz/` and create the resulting externalized PDF as `figures/foo/bar.pdf`? Would the use of LatexMk do anything to this (I want to use it, but I am not sure what role it could play in the above)? **EDIT:** It turns out, that `\tikzsetnextfilename` actually overwrites all naming definitions except for the initial prefix set with `\tikzexternalprefix`. Hence, I can't give my figures filenames directly. Therefore another question: Is there a way to a) save the generated images into a subfolder `figures/chapter_name/`, and b) give the images invidual names?


title: Change size of whole set of elements

text: I am trying to include some gnuplot-generated figures using the epslatex terminal, which creates an .eps file and a .tex file. The way to include these figures in the document is writing               \include{./figure}      These files include all the commands that set the tics, the legend and so on. My question is: is it possible to **change the size** of **the whole set** of elements included in `figure.tex` _without modifying_ that file? Something like this:               \resizebox{\linewidth}{!}{     \begin{figure}         \include{./presion_posicion2}         \caption{Diagrama presión-posición para el ensayo 2}         \label{fig:ensayo2}     \end{figure}     }


title: How to redefine the color of table rules without interfering the content of its cell?

text: I attempted to change the rule color of my table to red. Unfortunately, the content in the table cell also got interfered as shown in the following figure. The margin frame rules also became red which is not what it should be. I have no idea what parameters should I redefine to change the table rule color. ![alt text](http://i.stack.imgur.com/umWlM.png) * * *               \documentclass[dvips,dvipsnames,rgb]{book}          \usepackage[a4paper,hmargin=10mm,vmargin=40mm,showframe]{geometry}     \usepackage{longtable}     \usepackage{array}     \usepackage{calc}     \usepackage{lscape}     \setlength{\tabcolsep}{2mm}     \setlength{\arrayrulewidth}{2mm}     \newcounter{No}     \renewcommand{\theNo}{\arabic{No}}     \newenvironment{MyTable}[4]%     {%         \newcolumntype{O}[1]%         {%             >{%                 \begin{minipage}%                 {%                         ##1\linewidth-2\tabcolsep-1.5\arrayrulewidth%                 }%                 \vspace{\tabcolsep}%              }%             c%             <{%                     \vspace{\tabcolsep}%                     \end{minipage}%              }%         }%         \newcolumntype{I}[1]%         {%             >{%                 \begin{minipage}%                 {%                         ##1\linewidth-2\tabcolsep-\arrayrulewidth%                 }%                 \vspace{\tabcolsep}%              }%             c%             <{%                     \vspace{\tabcolsep}%                     \end{minipage}%              }%         }%         \setcounter{No}{0}%comment out this if you want to continuous numbering for all tables.         \begin{longtable}%         {%                 |>{\stepcounter{No}\centering\scriptsize\theNo}O{#1}<{}%                 |>{\centering}I{#2}<{\input{\jobname.tmp}}%                 |>{\centering\lstinputlisting{\jobname.tmp}}I{#3}<{}%                 |>{\scriptsize}O{#4}<{}%                 |%         }%         \hline\ignorespaces%     }%     {%         \end{longtable}%     }          \newcommand{\Comment}[1]{&&&#1\tabularnewline\hline}               \usepackage{listings}     \lstset{%     language={PSTricks},     breaklines=true,     basicstyle=\ttfamily\scriptsize,%     keywordstyle=\color{blue},     backgroundcolor=\color{yellow!30}%     }     \usepackage{fancyvrb}               \def\MyRow{%                     \VerbatimEnvironment%             \begin{VerbatimOut}{\jobname.tmp}%     }          \def\endMyRow{%             \end{VerbatimOut}%           }                    \usepackage{pstricks,pst-node}     \newpsstyle{gridstyle}{%     gridwidth=0.4pt,%default: 0.8pt     gridcolor=Red!20,%default: black     griddots=0,%default: 0      %     gridlabels=3pt,%default: 10pt     gridlabelcolor=Blue,%default: black     %     subgriddiv=5,%default: 5     subgridwidth=0.2pt,%default: 0.4pt     subgridcolor=Green!20,%default: gray     subgriddots=0%default: 0     }          \usepackage{lipsum}          \begin{document}     {\color{Red}%     %\clearpage     %\pagestyle{empty}     %Landscape starts here.     %\begin{landscape}     \begin{MyTable}{0.05}{0.3}{0.3}{0.35}%     %=============     \begin{MyRow}     \pspicture*[showgrid](3,3)     \pnode(1,1){A}     \pnode(3,3){B}     \ncline{A}{B}     \endpspicture     \end{MyRow}     \Comment{\lipsum[1]}     %=============     \begin{MyRow}     \begin{pspicture}[showgrid](3,3)     \psframe*[linecolor=red!30](3,2)     \end{pspicture}     \end{MyRow}     \Comment{\lipsum[2]}     %=============     \begin{MyRow}     \pspicture[showgrid](3,3)     \psframe*[linecolor=green!30](3,2)     \endpspicture     \end{MyRow}     \Comment{\lipsum[3]}     %=============     \begin{MyRow}     \pspicture[showgrid](3,3)     \psframe*[linecolor=yellow!30](3,2)     \endpspicture     \end{MyRow}     \Comment{\lipsum[4]}     %=============     \begin{MyRow}     \pspicture[showgrid](3,3)     \psframe*[linecolor=Maroon!30](3,2)     \endpspicture     \end{MyRow}     \Comment{\lipsum[5]}     %=============     \end{MyTable}     %\end{landscape}     %Landscape stops here.     %\pagestyle{plain}     }%     \end{document}      * * * **EDIT 1:** The vertical rule shared by cell (1,2) and cell (1,3) behaves abnormally. It should not be black. :-)


title: Biblatex: suppress colon after "In" for edited volumes

text: I'm using Biblatex with biber backend, authoryear-comp style. Is there a quick way to remove the colon after the "In" introducing the title of an edited book (@inbook bibliography items)? I've found the following command for suppressing the colon:               \renewcommand*{\intitlepunct}{\space}      But, while this works fine with journal articles, for items in edited books a period shows up replacing the colon after the "In". I would like no punctuation at all, just "In" followed by the title of the edited work. Here's a MWE:               \documentclass{article}     \usepackage[style=authoryear-comp,backend=biber]{biblatex}          \renewcommand*{\intitlepunct}{\space}          \begin{filecontents}{testbibliography.bib}     @inbook{Adams1981,     author = {Adams, R. E. W.},     title = {Settlement Patterns of the Central Yucatan and Southern Campeche Regions},     booktitle = {Lowland Maya Settlement Patterns},     date = {1981},     editor = {Ashmore, Wendy},     publisher = {School of American Research and University of New Mexico Press},     location = {Albuquerque},     pages = {211--257},     }          @article{Blanton1976,     author = {Blanton, Richard E.},     journal = {Annual Review of Anthropology},     number = {1},     pages = {249--264},     title = {{Anthropological Studies of Cities}},     volume = {5},     year = {1976}     }     \end{filecontents}     \addbibresource{testbibliography.bib}          \begin{document}     \nocite{*}     \printbibliography     \end{document}      Here's the output. In the first item, a chapter in an edited book, there's a period after "In". This is what I would like to get rid of. The second item, a journal article, is fine. ![references](http://i.stack.imgur.com/oRPjP.png)


title: Why did my exact calculation still produce small gaps on the most left and right table rules?

text: I have specified each tabular cell width exactly using formula `##1\linewidth-2\tabcolsep-1.5\arrayrulewidth` as shown in the following code snippet: * * *               \documentclass[dvips,dvipsnames,rgb]{book}          \usepackage[a4paper,margin=10mm,showframe]{geometry}     \usepackage{longtable}     \usepackage{array}     \usepackage{calc}     \usepackage{lscape}          \newcounter{No}     \renewcommand{\theNo}{\stepcounter{No}\arabic{No}}     \newenvironment{MyTable}[4]%     {%         \newcolumntype{A}[1]%         {%             >{%                 \begin{minipage}%                 {%                         ##1\linewidth-2\tabcolsep-1.5\arrayrulewidth%                 }%                 \vspace{\tabcolsep}%              }%             c%             <{%                     \vspace{\tabcolsep}%                     \end{minipage}%              }%         }%         \setcounter{No}{0}%comment out this if you want to continuous numbering for all tables.         \begin{longtable}%         {%                 |>{\scriptsize\centering\theNo}A{#1}<{}%                 |>{}A{#2}<{\centering\input{\jobname.tmp}}%                 |>{\centering\lstinputlisting{\jobname.tmp}}A{#3}<{}%                 |>{\scriptsize}A{#4}<{}%                 |%         }%         \hline\ignorespaces%     }%     {%         \end{longtable}%     }          \newcommand{\Comment}[1]{& & & #1\tabularnewline\hline}               \usepackage{listings}     \lstset{%     language={PSTricks},     basicstyle=\ttfamily\scriptsize,%     keywordstyle=\color{blue}%,     %backgroundcolor=\color{yellow!30}%     }     \usepackage{fancyvrb}               \def\MyRow{%                     \VerbatimEnvironment%             \begin{VerbatimOut}{\jobname.tmp}%     }          \def\endMyRow{%             \end{VerbatimOut}%           }                    \usepackage{pstricks,pst-node}     \newpsstyle{gridstyle}{%     gridwidth=0.4pt,%default: 0.8pt     gridcolor=Red!20,%default: black     griddots=0,%default: 0      %     gridlabels=3pt,%default: 10pt     gridlabelcolor=Blue,%default: black     %     subgriddiv=5,%default: 5     subgridwidth=0.2pt,%default: 0.4pt     subgridcolor=Green!20,%default: gray     subgriddots=0%default: 0     }          \usepackage{lipsum}          \begin{document}     %\clearpage     %\pagestyle{empty}     %Landscape starts here.     %\begin{landscape}     \begin{MyTable}{0.05}{.25}{0.4}{0.3}%     %=============     \begin{MyRow}     \pspicture*[showgrid](4,4)     \pnode(1,1){A}     \pnode(3,3){B}     \ncline{A}{B}     \endpspicture     \end{MyRow}     \Comment{\lipsum[1]}     %=============     \begin{MyRow}     \begin{pspicture}[showgrid](4,3)     \psframe*[linecolor=red!30](3,2)     \end{pspicture}     \end{MyRow}     \Comment{\lipsum[2]}     %=============     \begin{MyRow}     \pspicture[showgrid](4,3)     \psframe*[linecolor=green!30](3,2)     \endpspicture     \end{MyRow}     \Comment{\lipsum[3]}     %=============     \begin{MyRow}     \pspicture[showgrid](4,3)     \psframe*[linecolor=yellow!30](3,2)     \endpspicture     \end{MyRow}     \Comment{\lipsum[4]}     %=============     \begin{MyRow}     \pspicture[showgrid](4,3)     \psframe*[linecolor=Maroon!30](3,2)     \endpspicture     \end{MyRow}     \Comment{\lipsum[5]}     %=============     \end{MyTable}     %\end{landscape}     %Landscape stops here.     %\pagestyle{plain}     \end{document}      * * * If I zoomed in the output, I will get the following result: **There is a gap on the most left table edge:** ![alt text](http://i.stack.imgur.com/H2OTj.png) * * * **There is also a gap on the most right table edge:** ![alt text](http://i.stack.imgur.com/ekn4z.png) * * * I think it is caused by the rounding off done by LaTeX engine. Is there a way to solve this problem? * * * **EDIT 1:** You might think of why I insist on getting the most perfect output. Because I want to create a "bubble" answer sheet using this table layout. Thus, high precision layout is a must. :-)


title: Is there a quick way to split a (very) long equation?

text: I'm generating LaTeX code from Mathematica, which I must insert into my input .tex file. The problem is that equations are too long to fit on the page, and it takes a long time to split them up. Is there any way to split such long equations quickly? Here is the input:               \left(       \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5     \right)     +g_2 \left(       \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5     \right){}^{\wedge}2     +g_3 \left(       \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5     \right){}^{\wedge}3     + g_4 \left(       \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5\right){}^{\wedge}4     +g_5 \left(       \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5\right){}^{\wedge}5     +g_6 \left(        \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5\right){}^{\wedge}6     +g_7 \left(       \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5\right){}^{\wedge}7     +g_8 \left(       \epsilon ^1 \phi _1+ \epsilon ^2 \phi _2 + \epsilon ^3 \phi _3 +\epsilon ^4 \phi _4+       \epsilon ^5 \phi _5+\epsilon ^6 \phi _5+\epsilon ^7 \phi _5+\epsilon ^8 \phi _5     \right){}^{\wedge}8


title: Remove whitespace after item in description

text: how can I remove the whitespace after the item in the description? Example: this code:               \begin{description}          \item[First]\footnote{Here goes the footnote} lorem ipsum ...          \item[Second], which is my second item, lorem ipsum ...          \end{description}      produces sth like that: **First** [1] lorem ipsum ... **Second** , which is my second item, lorem ipsum ... I would like to have the whitespace between First and the footnote, and between Second and the comma removed. Thanks a lot for your help!


title: Can this command be converted to environment?

text: I have a command as follows:               \newcommand{\Comment}[1]{&&&#1\tabularnewline\hline}      And now I want to convert it to be an environment as follows:               \newsavebox{\tempDescription}     \newenvironment{Description}     {%     \begin{lrbox}{\tempDescription}%     \ignorespaces%     }     {%     \end{tempDescription}%     &&&\usebox{\tempDescription}\tabularnewline\hline%     }      * * * The complete code is given below:               \documentclass[dvips,dvipsnames,rgb,table]{book}          \usepackage[a4paper,hmargin=10mm,vmargin=40mm,showframe]{geometry}     \usepackage{longtable}     \usepackage{array}     \usepackage{calc}     \usepackage{lscape}     \setlength{\tabcolsep}{10pt}     \setlength{\arrayrulewidth}{1pt}     \newcounter{No}     \renewcommand{\theNo}{\arabic{No}}     \newenvironment{MyTable}[4]%     {%         \newcolumntype{O}[1]%         {%             >{%                 \begin{minipage}%                 {%                         ##1\linewidth-2\tabcolsep-1.5\arrayrulewidth%                 }%                 \vspace{\tabcolsep}%              }%             c%             <{%                     \vspace{\tabcolsep}%                     \end{minipage}%              }%         }%         \newcolumntype{I}[1]%         {%             >{%                 \begin{minipage}%                 {%                         ##1\linewidth-2\tabcolsep-\arrayrulewidth%                 }%                 \vspace{\tabcolsep}%              }%             c%             <{%                     \vspace{\tabcolsep}%                     \end{minipage}%              }%         }%         \setcounter{No}{0}%comment out this if you want to continuous numbering for all tables.         \begin{longtable}%         {%                 |>{\stepcounter{No}\centering\scriptsize\theNo}O{#1}<{}%                 |>{\centering}I{#2}<{\input{\jobname.tmp}}%                 |>{\centering\lstinputlisting{\jobname.tmp}}I{#3}<{}%                 |>{\scriptsize}O{#4}<{}%                 |%         }%         \hline\ignorespaces%     }%     {%         \end{longtable}%     }          \newcommand{\Comment}[1]{&&&#1\tabularnewline\hline}          \newsavebox{\tempDescription}     \newenvironment{Description}     {%     \begin{lrbox}{\tempDescription}%     \ignorespaces%     }     {%     \end{tempDescription}%     &&&\usebox{\tempDescription}\tabularnewline\hline%     }          \usepackage{listings}     \lstset{%     language={PSTricks},     breaklines=true,     basicstyle=\ttfamily\scriptsize,%     keywordstyle=\color{blue},     backgroundcolor=\color{yellow!30}%     }     \usepackage{fancyvrb}               \def\MyRow{%                     \VerbatimEnvironment%             \begin{VerbatimOut}{\jobname.tmp}%     }          \def\endMyRow{%             \end{VerbatimOut}%           }                    \usepackage{pstricks,pst-node}     \newpsstyle{gridstyle}{%     gridwidth=0.4pt,%default: 0.8pt     gridcolor=Red!20,%default: black     griddots=0,%default: 0      %     gridlabels=3pt,%default: 10pt     gridlabelcolor=Blue,%default: black     %     subgriddiv=5,%default: 5     subgridwidth=0.2pt,%default: 0.4pt     subgridcolor=Green!20,%default: gray     subgriddots=0%default: 0     }          \usepackage{lipsum}               \begin{document}     %\clearpage     %\pagestyle{empty}     %Landscape starts here.     %\begin{landscape}     \arrayrulecolor{Red}     \begin{MyTable}{0.05}{0.3}{0.3}{0.35}%     %=============     \begin{MyRow}     \pspicture*[showgrid](3,3)     \pnode(1,1){A}     \pnode(3,3){B}     \ncline{A}{B}     \endpspicture     \end{MyRow}     \Comment{\lipsum[1]}     %=============     \begin{MyRow}     \begin{pspicture}[showgrid](3,3)     \psframe*[linecolor=red!30](3,2)     \end{pspicture}     \end{MyRow}     \Comment{\lipsum[2]}     %=============     \begin{MyRow}     \pspicture[showgrid](3,3)     \psframe*[linecolor=green!30](3,2)     \endpspicture     \end{MyRow}     \Comment{\lipsum[3]}     %=============     \begin{MyRow}     \pspicture[showgrid](3,3)     \psframe*[linecolor=Yellow](3,2)     \endpspicture     \end{MyRow}     \Comment{%     \begin{equation}     \int_a^b f(x)\, \textrm{d}x=F(b)-F(a)     \end{equation}     is the fundamental theorem of calculus.     }     %=============     \begin{MyRow}     \pspicture[showgrid](3,3)     \psframe*[linecolor=Maroon!30](3,2)     \endpspicture     \end{MyRow}     \begin{Description}%{%     Today I ate burnt bread. It was so delicious.     \begin{equation}     \int_a^b f(x)\, \textrm{d}x=F(b)-F(a)     \end{equation}     is the fundamental theorem of calculus.     %}     \end{Description}     %=============     \end{MyTable}     %\end{landscape}     %Landscape stops here.     %\pagestyle{plain}     \end{document}      Why cannot it be converted?


title: Appendix package ToC control

text: I want to change the alignment of the appendices. I'm using               \documentclass[12pt]{report}     ...     \usepackage{titletoc}     \usepackage[toc,titletoc]{appendix}          \usepackage{tocloft}     \renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters     \renewcommand{\cftchapfont}{\uppercase}     \renewcommand{\cftchappagefont}{}          \renewcommand{\cfttoctitlefont}{\hfill\uppercase}     \renewcommand{\cftaftertoctitle}{\hfill}     \setlength{\cftbeforetoctitleskip}{-3em}          \renewcommand{\cftloftitlefont}{\hfill\uppercase}     \renewcommand{\cftafterloftitle}{\hfill}     \setlength{\cftbeforeloftitleskip}{-3em}          \renewcommand{\cftlottitlefont}{\hfill\uppercase}     \renewcommand{\cftafterlottitle}{\hfill}     \setlength{\cftbeforelottitleskip}{-3em}      I'm having to modify a couple other things. This is what I have.               APPENDICES................. 10     APPENDIX A ................ 13     APPENDIX B ................ 15      This is what I need.               APPENDICES................. 10        APPENDIX A ............. 13        APPENDIX B ............. 15


title: ! No room for a new \count . with showidx package

text: I'm getting an error when I try to `\usepackage{showidx}`:               ! No room for a new \count .     \ch@ck ...\else \errmessage {No room for a new #3}                                                       \fi     l.41 \newinsert\indexbox      The line number is from `/usr/share/texmf-texlive/tex/latex/base/showidx.sty`. This is a plain debian lenny install, with texlive 2007 :( A minimal working example is:               \documentclass[11pt,a4paper,twoside,openright]{book}          \usepackage[natbib=true,style=authoryear,backend=bibtex,doi=false,isbn=false,url=false]{biblatex}          \usepackage[backgroundcolor=yellow,textsize=scriptsize,textwidth=3.5cm]{todonotes}          \usepackage[acronym]{glossaries}          \usepackage{hyperref}          \usepackage{makeidx}     \usepackage{showidx}     \makeindex          \begin{document}          Some text here \index{Blah}.          \printindex          \end{document}      If I remove any of the other packages, the error goes away. Any idea what's causing this, and how I can get around it?


title: Create x and y label which overlaps for multiple plots

text: I have a groupplot of 5x3. Now I want to be able to 'overlap', so to speak, the `ylabel` over all the plots vica versa for the `xlabel`. This enables me namely to make the groupplot smaller. Currently I have the following code: http://pastebin.com/0s6CB9HT. Which gives me the output given below. Thus what I want is to be able to stretch the labels "Phase [*] Magnitude [dB]' over all the plots, as a 'general' `ylabel`. And 'Frequency [Hz]' for the `xlabel`. How can I achieve this? Currently I just setted the `ylabel` as `{Phase [*] Magnitude [dB]\\\Out2}` and `xlabel` as `{Frequency [Hz]}`. And did some `xshift` on the `ylabel` such that the 'Out i' would align with each other. This looks nice now for a 5x3 but what if I have a 2x2 groupplot, I don't have a plot in the middle then. ![enter image description here](http://i.stack.imgur.com/Xk1UE.png)


title: LaTeX distributions features list?

text: I'm searching for a comprehensive list of features for the various LaTeX distributions like TeXLive, MiKTeX, etc. I already read What are the advantages of TeX Live over MiKTeX? but so far I've counted at least five different LaTeX distros (TeXLive, MiKTeX, MacTex, TeX Writer, TeX Portal) and I think it could be useful to have something like LaTeX Editors/IDEs where the differences between the various distros are highlighted in the same place. What I'd like to know for every distro is:   1. In what OSes does it run;   2. If it has on demand download of new packages;   3. If it needs administrator privileges to be installed;   4. How do you update it;   5. How often a new version is released;   6. What are its exclusive features with respect to other distros;   7. anything else worth mentioning;


title: Line under one column

text: Simple question that I couldn't find an answer to anywhere: I am using `\cline` to create discontinued lines in my tables. Sometimes I want to have a line just spanning over one column rather than multiple columns. `\cline` only works for more than one column. What is the alternative?


title: How to use nag?

text: I've just added `\RequirePackage[l2tabu, orthodox]{nag}` to a big document (200+ pages, 100+ images) about computer science. My `.log`-file was 3119 lines long before, now it is 4349 lines long. **How can I use nag?** Should I really go through 4000+ lines and check everything? There is a lot of noise (info messages by other packages) and I miss relevant information (file where the error happened). **Can I assume that the following transformations are safe?** Or will quite probably something go wrong if I automatically make these transformations:   * `eqnarray` -> `align` (12 times, seems to be safe)   * old LaTeX 2.09 commands      * `\bf` -> `\textbf` (27 times)     * `\rm` -> `\textrm` (3 times)     * `\it` -> `\textit` (2 times)   * `center`-environment in figure -> `\centering` (seems to be safe, 164 times)   * `center`-environment in table -> `\centering` (seems to be safe, 13 times)   * `h` float specifier -> `ht` (Latex seems to do this automatically, so I guess it is safe, 42 times)   * `\label` in float, but not after `\caption` -> change order (5 times)   * `\usepackage{a4wide}` -> `\documentclass[12pt,a4paper,twoside]{diss-report}` (this is my current document class. So do I have to change anything?) **Is there a tool that automatically does those transformations?**


title: How to align bars with the legend?

text: I'm able to draw bar chart using tex file mentioned below               \documentclass[landscape,a3paper,11pt]{article}     \usepackage{pstricks-add}     \usepackage{pgfplots, pgfplotstable}     \begin{document}     \begin{center}     \begin{tikzpicture}     \begin{axis}[     compat=newest,     ybar = 0.6,     ymajorgrids = true,     width=0.45\textwidth,     height=0.4\textheight,     enlarge y limits={upper, value=0.2},     ymin=0,     enlarge x limits = 0.2,     bar width=32pt,     title={ SCORE},     legend style={at={(0.5,-0.15)},     anchor=north,legend columns=0},     ylabel={Marks},     symbolic x coords={Topic},     xtick=data,     nodes near coords,     axis lines*=left,     y axis line style={opacity=0},     yticklabels={\empty},     ytick style={draw=none},     cycle list={         {fill=black!90,draw=black!90},         {fill=black!70,draw=black!70},         {fill=black!50,draw=black!50},         {fill=black!30,draw=black!30}     },     axis on top,     major grid style=white,     ymajorgrids,     legend style={draw=none,/tikz/every even column/.append style={column sep=0.5cm}}     %nodes near coords align={horizontal},     ]     \addplot coordinates {(Topic,40)};     \addplot coordinates {(Topic,50)};     \addplot coordinates {(Topic,60)};     \addplot coordinates {(Topic,70)};     \legend{My Marks,Avg Marks,Topper Marks,Total Marks}     \end{axis}     \end{tikzpicture}     \end{center}     \end{document}      I want to align legend with the Bar as highlighted in RED color mentioned in the diagram below: ![enter image description here](http://i.stack.imgur.com/7PLkS.png) Can you please suggest how to add spaces between bars, to ensure it's aligned with the legend.


title: FancyVerb Error when using minted in a \ifthenelse

text: I'm new to LaTeX and wand to add some code with minted, which will only be rendered, when a \boolean variable is true. Here's my code:               \documentclass{article}          \usepackage {minted}     \usepackage {ifthen}          \newboolean{printCode}     \setboolean{printCode}{true}          \begin{document}     \ifthenelse{\boolean{printCode}}{     \begin{minted}{c}     // comment     int i = 1;     \end{minted}     }{}     \end{document}      This causes an error:               ! FancyVerb Error:       Extraneous input ` // comment int i = 1; \end {minted} ' between \begin{minte     d}[<key=value>] and line end     .     \FV@Error ... {FancyVerb Error:     \space \space #1     }          l.15 }{}      When I remove the \ifthenelse part, it works fine. Also if printCode is false, it works (code is not printed). So the question is: What am I doing wrong here? Thanks! Ingo.


title: Should packages on CTAN be widely applicable?

text: I have a couple 'packages' (more appropriately called _styles_ ) that I'd like to painlessly distribute to my classmates. The most straightforward way to do this is via CTAN, but I'm not sure if it is appropriate to upload the style since it is only applicable to a very small group of people, and possibly only for a few years. Has this sort of thing been done before? If I put these styles on CTAN, would angry TeXers show up at my door bearing pitchforks full of burning hay, chanting curses upon my family and descendants, for cluttering their filesystem with useless-to-them styles?


title: Lost when trying to use bibtex in Mactex

text: i think my probelm is probably pretty easy to solve. I have done research on the web on how to do it but never really been able to follow through. I have mactex and endnote running on MacOS 10.9.4 I have generated a BibTex (text only) Export .txt out of Endnote and put it in the same folder as the document I am writing in Mactex (I have named them both the same. So now I have a folder with two files Expose.tex and Expose.txt (the file with all my references out of endnote). What do I do now? Any hints or to do list greatly appreciated. Sorry for the idiocy... ## Phil Ok I'm using MacTeX - but I have no gotten so far to knowing that what's missing is that I don't have any labels created for the single references when I export from Endnote. Is there a way to let endnote make labels with 'authoryear' or something like that so I don#t have to manually fill in a label for every reference - and I yes, I do understand this is probably mor e aendnote than a latex question... nevertheless - maybe there is someone here who experienced the same and has found a solution so far.


title: Is there a LaTeX3 approach to \ignorespaces?

text: The following code works as I would like it to: Given the state of the boolean, certain content is to be printed or not. If it's not printed, then I run the risk of creating extraneous whitespace. So, I use `\ignorespaces` to avoid this.               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn     \bool_new:N \g__ace_show_content_bool     \bool_gset_true:N \g__ace_show_content_bool     \NewDocumentCommand{\mycommand}{ m }         {             \bool_if:NTF \g__ace_show_content_bool                 {                     #1                 }                 {                     \ignorespaces                 }                 }     \NewDocumentCommand{\togglestate}{  }         {             \bool_if:NTF \g__ace_show_content_bool                 { \bool_gset_false:N \g__ace_show_content_bool }                 { \bool_gset_true:N \g__ace_show_content_bool }         }          \ExplSyntaxOff     \pagestyle{empty}     \begin{document}              \textbf{Line 1:} Testing \mycommand{This}   \mycommand{is}  \mycommand{my} \mycommand{trial} \mycommand{run.} Testing              \togglestate              \textbf{Line 2:} Testing \mycommand{This}   \mycommand{is}  \mycommand{my} \mycommand{trial} \mycommand{run.} Testing              \togglestate              \textbf{Line 3:} Testing \mycommand{This}   \mycommand{is}  \mycommand{my} \mycommand{trial} \mycommand{run.} Testing          \end{document}      It seems that LaTeX3 already implements a large portion of what plain TeX does. So, it seems to me that plain TeX code like `\ignorespaces` doesn't really belong in a LaTeX3 context. But I can't find equivalents of `\unskip` and `\ignorespaces` in the LaTeX3 documentation. Am I missing something? Is there another work-around? Or has this not been implemented yet?


title: Vertical space between section and top of the page?

text: I'm writing my thesis in Lyx and I'm using the Article layout and I would like my section heading to be centred, always starting on a new page and to have some padding from the top of the page. I have managed to get the section to be centred and to always start on a new page using this code in the Latex Preamble:               \usepackage{sectsty}      \sectionfont{\centering}      \let\stdsection\section     \renewcommand*{\section}{\clearpage\stdsection}      However whats left is that I need to have a vertical space between the section heading and the top of the page and to increase the section heading font size slightly; so to make it easier to understand I want my sections to behave exactly like chapters in the example below: ![enter image description here](http://i.stack.imgur.com/V0sja.png) Also if its possible I would like to increase the size of the section heading. Anyone can help me out with how to do this? keeping in mind I have just started using Lyx a couple of days ago and I am very inexperienced with it so go easy on me! Thanks


title: AucTeX turn off line breaks

text: In AucTeX I do not want line breaks to appear when I open the .tex with a different editor e.g. on writeLaTeX. I want lines to appear as if they are broken, so I can see everything in the default 80 column width. To do this I use `M-q`. I.e. the only time I want there to actually be a break is when I finish a paragraph, and hit `return`.


title: Is there a package manager that works directly with CTAN (or local TDS structures)?

text: Almost out of sheer frustration, I'm on the verge of writing a Python script that will automate the install of both local TDS packages and those retrieved automatically from CTAN, without regard to the differing repositories compiled by TeXLive/MikTeX, and regardless of the TeX distribution used (among the popular choices). Has already been done before? I'd rather not reinvent the wheel.


title: Latex: "I can't find file *.aux

text: I recently installed Ubuntu 12.04 and TexLive (latest, 2012/Debian). When I want to compile a tex file into a PDF, I always receive the following error:               >latex FILENAME.tex     >     >... some irrelevant messages     >     >[1]     >! I can't find file `FILENAME.aux'.      This is very odd, as this file exists (in the same directory as the tex file). I tried a minimal example of a tex file:               >\begin{document}     >     >Test123     >        >\end{document}       And even this gives me out the same error. Changing bibinput path won't help either. Does anyone has a suggestion?


title: The - (dash) disappears in document url

text: I have the following problem. I am writing a paper in LaTeX and at some point I am adding a URL as a footnote. It looks like this:               \footnote{\url{https://lists.inf.ethz.ch/pipermail/barrelfish-users/2011-July/000204.html}}      It renders the URL as expected. But when I click on the URL in the PDF-file, my browser opens the URL up to the first -, i.e. it opens                https://lists.inf.ethz.ch/pipermail/barrelfish-      Anyone an idea why this does happen and how I can fix the problem? * * * MWE               \documentclass{article}     \usepackage{url}     \begin{document}     \title{random title}     \maketitle     \begin{abstract}          MWE\footnote{\url{https://lists.inf.ethz.ch/pipermail/barrelfish-users/2011-July/000204.html}}     \end{abstract}          \end{document}


title: Excluding items cited in another .tex file from biblatex bibliography?

text: Suppose I have two .tex files, each of which must have a bibliography. However, I want the bibliography in the second file to contain _only_ citations that are not in the first. As an example:               \documentclass[11pt, a4paper]{article}          \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=apa,natbib=true,backend=biber,maxbibnames=99,url=false]{biblatex}     \DeclareLanguageMapping{american}{american-apa}          \bibliography{test}          \begin{document}          This is test file 1 \citep{Tversky:Kahneman:1990,Tversky:Kahneman:1974}          \printbibliography          \end{document}      This first file cites two sources. Here is the second file:               \documentclass[11pt, a4paper]{article}          \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=apa,natbib=true,backend=biber,maxbibnames=99,url=false]{biblatex}     \DeclareLanguageMapping{american}{american-apa}          \bibliography{test}          \begin{document}          This is test file 2 \citep{Tversky:Kahneman:1990,Kahneman:1973}          \printbibliography          \end{document}      Notice that this tex document cites two sources: one that was cited in the first, and one that wasn't. I'd like the reference section here to include _only_ `Kahneman:1973`, because `Tversky:Kahneman:1990` is included in the first. Here's my `test.bib` in case you want to compile the files above...               @book{Kahneman:1973,     author = {Kahneman, D.},     title = {Attention and effort},     publisher = {Prentice-Hall},     year = {1973},     address = {Englewood Cliffs, NJ},     confidential = {n}     }          @article{Tversky:Kahneman:1974,     author = {Tversky, A. and Kahneman, D.},     title = {Judgment under Uncertainty: {H}euristics and Biases},     journal = {Science},     year = {1974},     volume = {185},     number = {4157},     pages = {1124-1131},     note = {10.1126/science.185.4157.1124},     confidential = {n}     }          @incollection{Tversky:Kahneman:1990,     author = {Tversky, A. and Kahneman, D.},     title = {Judgements under uncertainty: {H}euristics and Biases},     booktitle = {Rationality in action: {C}ontemporary approaches.},     publisher = {Cambridge University Press},     year = {1990},     pages = {171-188},     editor = {Moser, Paul K.},     address = {New York},     confidential = {n}     }      Is there a way to accomplish this? I am using `latexmk` to compile my document. I'm also open to ways of using extra scripting to do it. Thanks!


title: Remove header on one page

text: I use moderncv to create my cv. There I include a pdf document with the includepdf command. The problem is that I defined a fancyheader and that this header is also on the included pdf, but I do not want this. I called my pagestyle myfancy and I use it with the command:               \pagestyle{myfancy}      Then my pages follow where I want to have my documents with the header. Then I include the pdf via:               \includepdf{Test.pdf}      Then I have the header, but I don't want to have this header. According to different posts I tried               \pagestyle{plain}      \fancyhf{}     \thispagestyle{empty}      But the all do not work, the header is still there. Where is my mistake?


title: Setup Asymptote in Texmaker

text: Here it says that to setup Asymptote in TeXnicCenter, one should put               -batchView -tex "pdflatex" %tc-*.asy      into the Arguments line. But there is no Arguments line in Texmaker. Instead, there is only one line corresponding to Asymptote in "Configure Texmaker". Entering               "C:/Program Files (x86)/Asymptote/asy.exe"  -batchView -tex "pdflatex" %tc-*.asy      leads to > error: could not load module 'C:/Users/Dominik/Documents/Latex/test5tc-*.asy I suspect the reason is that in Texmaker the symbol `%` actually stands for the filename. By the way, using               "C:/Program Files (x86)/Asymptote/asy.exe" %.asy      on a simple code               draw((0,0)--(100,100));     draw((0,100)--(100,0));     dot((50,50));`      does give the result in GSView. But I want to use Asymptote in my LaTeX files and also output it in PDF, so I need to configure that somehow.


title: Adjust vertical space of headings carried out by different line spacing

text: A question related to the koma script guide. As recommended on page 57, I set the table of contents, glossary, list of tables and list of figures with the standard line spacing. The text should have a line spacing of 1.5. When I do this, the title of the chapter is under the caption of the bibliography. Is there an easy way to remove this problem?               \documentclass[     a4paper,                              fontsize=11,                         BCOR=10mm,     DIV=11     ]{scrreprt}          \usepackage[ngerman]{babel}                         \usepackage[latin1]{inputenc}                     \usepackage[T1]{fontenc}     \usepackage{lmodern}                             \usepackage{microtype}         \usepackage[         style=numeric,          maxnames=1,         bibencoding=latin1,         backend=bibtex8,         defernumbers=true,         hyperref=true,         alldates=long     ]{biblatex}     \usepackage{hyperref}     \usepackage[hyphenbreaks]{breakurl}     \usepackage{setspace}          \begin{filecontents}{bachelorarbeit_lit.bib}     @ONLINE{java96,         author = {{Sun Microsystems}},         title = {JavaSoft ships Java 1.0},         year = {1996},         month = {1},         url = {http://findarticles.com/p/articles/mi_m0EIN/is_1996_Jan_23/ai_17853565/?tag=content;col1},         urldate = {2011-03-02},         sortname = {Sun},         keywords = {www}     }     \end{filecontents}          \bibliography{bachelorarbeit_lit}          \begin{document}     \onehalfspacing     \chapter{Test}     Test \cite{java96}          \singlespacing     \DIV=current     \printbibliography     \end{document}


title: TeXlipse build project problem in Windows 7

text: After I installed Windows 7 (and reinstalled MikTeX, eclipse and TeXlipse) I couldn't build my LaTeX projects. I'm trying to compile TeXlipse project however following error message appears in the console               pdflatex.exe> pdflatex.exe: A required file system path could not be retrieved.     pdflatex.exe> pdflatex.exe: Data: 28      All tex paths are set properly, I'm still able to launch `pdflatex` in windows command line utility, but Eclipse's magic `ctrl+B` is broken. Did anybody face such problem?


title: Using \DeclareMathVersion

text: It is my understanding that `\DeclareMathVersion` can be used to switch between math font variants. I am wondering how this can be used in a document that leverages two fonts: Times Roman for body text and Garamond for captions and headings. (The style is certainly unconventional, but works quite nicely.) Times, through `\usepackage{txfonts}` and Garamond through `\usepackage[urw- garamond]{mathdesign}` both provide math fonts. What is required for the following example to typeset? While I believe `\DeclareMathVersion` is the solution, documentation is on it is sparse. However, I have seen several LaTeX typeset books which pull this switching off. May be related to Change math font only in some parts of a document?               \documentclass{article}          \usepackage[urw-garamond]{mathdesign}     \usepackage{txfonts}          % ...          \begin{document}      % This will be in times      \[ \int e^{ax}\sin(bx+c)dx \]      % We want this in Garamond      % ...      \[ \int e^{ax}\sin(bx+c)dx \]     \end{document}


title: Calculations and undefined control sequence with TikZ

text: I already produced several figures with TikZ, but I can't see what's wrong with this snippet:               \documentclass[a4paper,10pt,twoside]{scrbook}     \usepackage[utf8x]{inputenc}     \usepackage{tikz}     \begin{document}         \begin{tikzpicture}             \def\groundwidth{8.0cm}             \def\streetwidth{2.0cm}                  \def\gw{0.5*(\groundwidth-\streetwidth)}                  \fill[color=green!75!black] (0, 0) -- (\gw,0) -- (\gw,\gw) -- (0,\gw) -- cycle;         \end{tikzpicture}     \end{document}      Compiling it with pdftex, it produces the following error message:               ! Package pgf Error: No shape named 0 is known.          See the pgf package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.11 ...ll[color=green!75!black] (0, 0) -- (\gw,0)                                                    -- (\gw,\gw) -- (0,\gw) -...      I guess there's something wrong with `\gw`, but I have no idea how to fix I. Do you have any suggestions or a link to the documentation explaining the problem?


title: Can I get the page number of included PDF page?

text: I have to put some academic papers at the end of a document, but only include a subset of their pages (due to the page limitations in our project). Now, I would like to mark each included page with the original page number of the PDF paper I'm including. Here is my MWE to illustrate the question.               \documentclass{article}     \usepackage{pdfpages}          \begin{document}          \includepdf[pages={1-2,4},picturecommand={\put(30,30){\makebox{Lorem Ipsum p. XX}}}]{lorem.pdf}          \end{document}      I created a second PDF called lorem.pdf by just typesetting:               \documentclass{article}     \usepackage{lipsum}          \begin{document}     \lipsum[1-25]     \end{document}      which creates a 4-page document lorem.pdf. Now, when I include only parts of the paper, namely pages 1, 2, and 4, I would like to fill in these numbers in the 'picturecommand' text instead of XX. Is there a way to reference that number there?


title: space around figures and how to remove it

text: I'm inputting several figures in my thesis and I'd like to know why there is always so much white space above and to the side of the figure and below the caption. Below the caption is particularly annoying but the 'offset' figure looks ugly too. Please see the picture. I've played with both the bounding box, the float dimensions, and figure dimensions. Other than making it really small to fit, I haven't found a good solution (using LyX). Suggestions? Thanks Dominik EDIT: More info. SInce setspace was returning an error saying spacing was already defined, I pulled this out of the custom .cls file. ANy change this will garner an answer?               %%%%%%% DEFINE DOUBLE-SPACING (THE DEFAULT) AND OTHER SPACING:     \def\setspace@size{\ifx\@currsize\normalsize\@normalsize\else\@currsize\fi}     \def\doublespacing{ \ifcase \@ptsize \relax            \def \baselinestretch {1.703}% 10pt -- EDIT (thesis=2.004; see line 251)     \or \def \baselinestretch {1.505}% 11pt -- EDIT (thesis=1.771; see line 252)     \or \def \baselinestretch {1.441}% 12pt -- EDIT (thesis=1.660; see line 253)       \fi \setspace@size}     \def\singlespacing{\def \baselinestretch {1} \setspace@size \vskip \baselineskip}     \def\setstretch#1{\renewcommand{\baselinestretch}{#1}}     \def\@setsize#1#2#3#4{\@nomath#1       \let\@currsize#1 \baselineskip #2       \baselineskip \baselinestretch\baselineskip       \parskip \baselinestretch\parskip       \setbox\strutbox \hbox{ \vrule height.7\baselineskip depth.3\baselineskip       width\z@} \skip\footins \baselinestretch\skip\footins       \normalbaselineskip\baselineskip#3#4}     %%%%%%%%% floats & footnotes singlespaced %%%%%%%%%     \let\latexx@xfloat=\@xfloat     \def\@xfloat #1[#2]{\latexx@xfloat #1[#2]     \def\baselinestretch{1}\@normalsize \normalsize}     \long\def\@footnotetext#1{       \insert\footins{         \def\baselinestretch {1}         \reset@font\footnotesize         \interlinepenalty\interfootnotelinepenalty         \splittopskip\footnotesep         \splitmaxdepth \dp\strutbox \floatingpenalty \@MM         \hsize\columnwidth \@parboxrestore         \protected@edef\@currentlabel{           \csname p@footnote\endcsname\@thefnmark}         \color@begingroup \@makefntext{             \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}         \color@endgroup}}     \long\def\@mpfootnotetext#1{       \global\setbox\@mpfootins\vbox{         \unvbox \@mpfootins         \def\baselinestretch {1}         \reset@font\footnotesize         \hsize\columnwidth \@parboxrestore         \protected@edef\@currentlabel{           \csname p@mpfootnote\endcsname\@thefnmark}         \color@begingroup \@makefntext{            \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}        \color@endgroup}}     %%%%%%%% single / double spacing %%%%%%%%%     \def\singlespace{ \vskip \baselineskip \def\baselinestretch {1}       \setspace@size \vskip -\baselineskip }     \def\endsinglespace{\par}     \def\spacing#1{ \par \begingroup \def\baselinestretch {#1} \setspace@size }     \def\endspacing{ \par \vskip \parskip \vskip \baselineskip       \endgroup \vskip -\parskip \vskip -\baselineskip }     \def\doublespace{ \ifcase \@ptsize \relax           \spacing{1.6}%1.703   10pt -- EDIT (thesis=2.004; see line 199)       \or \spacing{1.4}%1.505   11pt -- EDIT (thesis=1.771; see line 200)       \or \spacing{1.3  }%1.441 12pt -- EDIT (thesis=1.660; see line 201)       \fi }        \let\enddoublespace=\endspacing


title: Image from \includegraphics showing up in wrong location?

text: I have the following situation:               \subsection{Some subsection}     Some text here...     \\     \begin{figure}         \caption{Raw}     \includegraphics[scale=0.25]{raw.png}     \end{figure}     \begin{figure}         \caption{Median}     \includegraphics[scale=0.25]{median.png}     \end{figure}     \begin{figure}         \caption{Data}     \includegraphics[scale=0.25]{data.png}     \end{figure}     \\          \section{New section}     New section starts here...      For some reason, the first 2 images are showing up before that subsection starts (above the title of it), and the 3rd image is showing up mid sentence on the next completely new section, on a brand new page! What gives? Why is this happening and how can I resolve it?


title: Nesting command definitions more than two levels

text: How do you access macro arguments if the macros are nested by more than two levels? To explain it in more detail: Creating a new command in another command (nesting command definitions), it is possible to implement something like partial application of a command. This is useful for example if a command, which is often called, has two arguments and one changes less frequently than the other:               \documentclass{minimal}     \begin{document}         \newcommand{\one}[1]{%             \newcommand{\two}[1]{#1, ##1}%         }         \one{a} % Partial application, nothing gets printed         \two{b} \quad \two{c}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Pjp0o.png) Unfortunately this does not work, if there is another level of nesting involved:               \documentclass{minimal}     \begin{document}         \newcommand{\one}[1]{%             \newcommand{\two}[1]{%                 \newcommand{\three}[1]{#1, ##1, ###1}%             }         }         \one{a} % First partial application -> Error         \two{b} % Second partial application         \three{c}     \end{document}      The error occurs in the marked line with the following message:               [LaTeX] Line 8: Illegal parameter number in definition of \two.<to be read again>                    a     l.0 \one{c}              % First partial application -> Error       As substituting `\one{a}` by `\one{1}` in the above code leads to the output `1, b, b`, I think that `###1` is interpreted as `##{#1}`. So `###1` is expanded to `##a` or `##1`, respectively. The first one obviously fails, where the second one compiles but leads to an unexpected result. I tested the commands from `xparse`, too, and the problem seems to be identical. To rephrase the question above: How do you have `###1` interpreted as `{###1}` instead of `##{#1}` when using the nested command definitions? Why is `##1` in the first example interpreted as `{##1}` instead of `#{#1}`? I know that it is possible to avoid the third level of nesting by some sort of currying as in the following example.               \documentclass{minimal}     \begin{document}         \newcommand{\one}[1]{%             \newcommand{\two}[1]{\helper{#1, ##1}}%         }         \newcommand{\helper}[1]{%             \newcommand{\three}[1]{%#1, ##1}%         }         \one{1} % First partial application         \two{b} % Second partial application by currying         \three{c}     \end{document}      ![enter image description here](http://i.stack.imgur.com/6Q0tn.png) It seems less intuitive and more complicated to me to use two levels of nesting twice instead of three levels of nesting once and I would like to understand how the third level of nesting is used.


title: alphabetical ordering of authors within a single citation

text: I'm struggling to get an output for my `bibliography` the way I want it. I'm currently using               \bibliographystyle{unsrt}       however if a single citation has a list of author it places those names in alphabetical order. So this is an example, my code is this               @ARTICLE{oscillation,     author = {S. Goswami ,\textit{et al.}},     title = {"{Global Analysis of Neutrino Oscillation"}},      then my output is > [8] et al. S. Goswami. "Global Analysis of Neutrino Oscillation". not what i want which would be > [8] S. Goswami, et al. "Global Analysis of Neutrino Oscillation".