title: How can I add my tcolorbox to my table of contents?

text: I've got many tcolorboxes in my document and I want to add one to my table of contents. A test code:               \documentclass[10pt,a4paper,twoside,spanish]{scrbook}     \setlength{\parskip}{\medskipamount}     \setlength{\parindent}{0pt}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{fancyhdr}     \pagestyle{fancy}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{4}     \usepackage{units}     \usepackage{endnotes}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}          \usepackage{scrhack}     \usepackage{graphicx}     \usepackage{color,xcolor}          \usepackage[most]{tcolorbox}     \tcbuselibrary{theorems}          \usepackage{tikz, pgf, pgfplots}     \usetikzlibrary{arrows,backgrounds,plotmarks,shapes.geometric,calc}          \pgfplotsset{width=7cm,compat=newest}     \pgfplotsset{plot coordinates/math parser=false}                    \tcbset {       teoestilo/.style={         shadow={2mm}{-1mm}{0mm}{black!50!white},             colback=gray!20!white,           coltext=black,           coltitle=white,           enlarge top by=\baselineskip/2+1mm,           enlarge top at break by=0mm,            pad at break=2mm,           fonttitle=\bfseries\large,            fontupper=\normalsize,           enhanced,           colframe=black,           boxrule=1pt,           arc=2mm,           breakable,           top=2mm,           toptitle=1mm,           bottomtitle=1mm,           before=\vskip18pt,           separator sign ={\ $\blacktriangleright$}       },     }     \newtcbtheorem[auto counter, number within=section]{teorema}%     {Teorema}{teoestilo}{th}     \newtcbtheorem[auto counter, number within=section]{definicion}%     {Definicion}{teoestilo}{def}     \newtcbtheorem[auto counter, number within=section]{ejercicio}%     {Ejercicio}{teoestilo}{ejer}     \newtcbtheorem[auto counter, number within=section]{corolario}%     {Corolario}{teoestilo}{coro}     \newtcbtheorem[auto counter, number within=section]{ejemplo}%     {Ejemplo}{teoestilo}{ejem}     \newtcbtheorem[auto counter, number within=section]{nota}%     {Nota}{teoestilo}{not}     \newtcbtheorem[auto counter, number within=section]{propo}%     {Proposición}{teoestilo}{prop}          \begin{document}          \maketitle     \tableofcontents{}          \chapter{MÉTODOS ITERATIVOS PARA RAÍCES REALES}               \section{Método De la Bisección}               \subsection{Introducción}          text test          \begin{teorema}{Bolzano}{}     Sea una función cualquiera $f\: :[a,\: b]\longrightarrow\mathbb{R}$, tal que $f\in C([a,\: b])$. Entonces:\\     Si $f(a)\cdot f(b)<0\Rightarrow \exists c\in ]a,\: b[\:/\: f(c)=0$     \end{teorema}     \begin{definicion}{Definicion}{}     xdkdkdkdkd     \end{definicion}     \end{document}      Thanks


title: \endcsname error with nag and newest babel/greek update

text: Did I miss something with `babel` and `polutonikogreek`? I just updated my TeX distribution on my mac through TeX Live Utility, and now I get the error:               ./document.tex:5: Missing \endcsname inserted.      <to be read again>       \protect       l.5 \begin{document}      This is the file:               % !TEX TS-program = lualatexmk     \RequirePackage[l2tabu, orthodox]{nag}     \documentclass{minimal}     \usepackage[polutonikogreek,british]{babel}     \begin{document}         test     \end{document}      * * * **Update** : The result is that even without `nag` (as egreg pointed out in his answer) the `polutonikogreek`-option of `babel` (which I need for hyphenation of Ancient Greek) does no longer work.


title: soul package does not work with user-defined language shorthands

text: Using `\caps` from the `soul` package with user-defined language shorthands generates an error. However, it works fine with language shorthands defined by `babel` itself, e.g. by using `\usepackage[ngerman]{babel}`. Example:               \documentclass{article}     \usepackage[english]{babel}      \useshorthands{"}     \defineshorthand{"~}{\textormath{\leavevmode\hbox{-}}{-}}     \usepackage{soul}           \begin{document}         \caps{LS"~2}     \end{document}


title: Issue with TeXMaker on win7 and beamer

text: Not sure if this question is appropriate for this forum... Just wondering if others can confirm this before sending it to the developers. Setup: TeXMaker   TeXLive 2012   pdflatex with synctex enabled   embedded internal pdf viewer Then running pdflatex + view pdf crashes on the following MWE               \documentclass{beamer}     \usetheme{Frankfurt}     \begin{document}     \begin{frame}     \frametitle{test}     test     \end{frame}     \end{document}      It does not seem to occur if   * synctex is disabled    * internal pdf viewer is _not_ embedded Tested with both Texmaker 4.0 and the previous version. TeXStudio does not seem to have this problem. Can anyone confirm?


title: Redefining \hrule to do nothing

text: Discl.: I have been using LaTeX for many years, but I am a beginner on the more advanced macro stuff. For a specific hack of a latex document of mine, I want to override the use of `\hrule` within a command provided by a package I am using. Specifically I want to redefine `\hrule` to do nothing, perform the command of the package, and then restore `\hrule` to its previous definition. Hence I want to do something along the lines of this:               \let\hruleold\hrule     \def\hrule(#1)(#2)(#3){}     \packagespecficcommand     \let\hrule\hruleold       Which gives me the error:               ! Use of \hrule doesn't match its definition.      What is the correct approach to achieve this? -- Edit 1 (more specific error) -- I tried the following, as suggested by Herbert:               \let\hruleold\hrule     \def\hrule(#1)(#2)(#3){#1,#2,#3}     \maketitle     \let\hrule\hruleold      which gives me this error               ! Use of \hrule doesn't match its definition.     \@packagespecficcommand...skip -\topskip \fi \hrule \@height                                                         0.35mm\noindent \advance \...


title: 3D surface plot with axis inside plot

text: I try to draw the energy surface of a magnetic particle. For this i want the axis system to come from the inside of the particles pointing to the ouside. Ist ist basically the example below, but with the z axis inside of the cone.                   \documentclass[border=10pt]{standalone}         \usepackage{pgfplots}         \pgfplotsset{width=7cm,compat=1.8}         \begin{document}         \begin{tikzpicture}         \begin{axis}[           axis lines=center,           axis on top,           xlabel={$x$}, ylabel={$y$}, zlabel={$z$},           domain=0:1,           y domain=0:2*pi,           xmin=-1.5, xmax=1.5,           ymin=-1.5, ymax=1.5, zmin=0.0,           mesh/interior colormap=             {blueblack}{color=(black) color=(blue)},           colormap/blackwhite,            samples=10,           samples y=40,           z buffer=sort,          ]           \addplot3[surf]              ({x*cos(deg(y))},{x*sin(deg(y))},{x});         \end{axis}         \end{tikzpicture}         \end{document}      ![enter image description here](http://i.stack.imgur.com/BpOMd.png) To clearify: The second image shows a plot of the crystal energy of a magnetic nanoparticle. The crystalaxis should now come from the center of the particle to the outside, leaving the surface at the red area. But because PGFplots draws the axis lines in the background the optic result is not so nice. ![enter image description here](http://i.stack.imgur.com/nzidR.png)


title: How can one set full justification within left-justified (\raggedright) text?

text: How can one set full justification within left-justified (`{\raggedright [...]}`) text? An example of where I need full justification is here:               \documentclass{memoir}          \begin{document}          Document body.          \begin{thebibliography}{9}       \SingleSpacing     \bibitem{ABC}       {\raggedright \hyphenpenalty=10000 \exhyphenpenalty=10000       Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text.       \begin{list}{\(\bullet\)}       \item Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. Plenty of left-aligned text. \par           \emph{Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified. Text I would like to be justified.}       \end{list}       }     \end{thebibliography}          \end{document}      It is self-explanatory. _Note: There are probably more minimal examples, but (aside from me needing full justification in this particular context) this one will do for a context where something obvious such as "set a smaller scope for`\raggedright` doesn't work._


title: pgfplot tikz single plot with 2 y axis

text: I have 5 columns of data in a txt. file as nxI Bfield1 magmoment1 Bfield2 magmoment2. I am attempting to implement nXI - x axis, Bfield1 and Bfield 2 as my y axis and magmoment1 and magmoment 2 as second y axis on RHS. What I need to do is scale the 2nd y axis w.r.t magmoment 1. I don't want the plot for magmoment to show just scale RHS y axis for their respective magnetic moments. Thanks. I changed the .txt file name the code below is unchanged. ellipbmoment ![enter image description here](http://i.stack.imgur.com/whTqw.png)                   \documentclass{standalone}         \usepackage{tikz}         \usepackage{pgfplots}         \pgfplotsset{compat=newest}         \begin{document}         \providecommand{\plotdataDir}{plotdata}         \begin{tikzpicture}         \begin{semilogxaxis}[         xlabel={$n \times I$},         ylabel={$B_z \left(T\right)$},xmin=1,ymin=0,xmax=100000,         xtick pos=left,         ytick pos=left,grid=major,legend entries={$Supermendur                \:2V$,$Metallic\:Glass$},legend pos=north west]              \addplot[blue,ultra thick] table[x=nxI,y=Bfield1] {\plotdataDir/moment.txt}  node[fill=white, fill opacity=0.5, text opacity=1,anchor=south east,font=\tiny]{$\mu_r=80,000$};              \addplot[red,ultra thick] table[x=nxI,y=Bfield2] {\plotdataDir/moment.txt} node[fill=white, fill opacity=0.5, text opacity=1,anchor=south east,font=\tiny]{$\mu_r=1,250,000$};               \end{semilogxaxis}          %%               \begin{axis}[          axis y line*=right,          ylabel={$M$},xmin=0,          axis x line=none,          ]                    \addplot[green,ultra thick] table[x=nxI,y=magmoment1] {\plotdataDir/moment.txt};          \end{axis}               \end{tikzpicture}          \end{document}


title: how to make the choices be near to the title?

text: I'm making a latex slideshow. I want to let the four choices be near to the title. It means that I don't want any gap between the question and the choices. How can I achieve that? Be grateful with any hints!               \begin{frame}{1.Suppose set$M=\{x|x^2+2x=0,x\in R\}$, $N=\{x|x^2-2x=0,x\in R\}$,then$M\cup N=(~)$}       \begin{columns}[t]%         \begin{column}[t]{0.45\textwidth}%               \begin{itemize}             \item A.~~$\{0\}$             \item B.~~$\{0,2\}$           \end{itemize}             \end{column}          \begin{column}[t]{0.45\textwidth}%              \begin{itemize}             \item C.~~$\{-2,0\}$             \item D.~~$\{-2,0,2\}$           \end{itemize}         \end{column}       \end{columns}     \end{frame}      ![enter image description here](http://i.stack.imgur.com/ioxP6.png)


title: Automatic non-breakable spaces?

text: Very often I have to manually add non-breakable spaces to make things look better. For instance:   * see~\cite{Bla98}   * for all~$x$   * see Section~\ref{sect:bla} It looks specific enough so that it could be automated: avoid line breaking before a citation/ref/small-math-thingy. Is there any package doing this?


title: Roman and arabic page numbering

text: I am writing my thesis. I want page numbering in roman for abstract, knowledge and arabic for the rest.               \pagenumbering{roman}     \input{Agradecimentos}     \input{Resumo}     \input{Abstract}          \tableofcontents     \listoffigures     \listoftables          \pagenumbering{arabic}      But the number 1 , begin in "list of tables". List of tables should be in roman number. How i can change it ? Thanks


title: \endnote doesn't work

text: The following sample LaTeX document is supposed to create an end note. In practice, it creates the superscript for the end note (i.e. Normal text^1), but the end note itself is nowhere to be seen. What might the problem be? I use emacs 24.3.1 on Ubuntu.               \documentclass{article}     \title{Package endnotes test}     \usepackage{endnotes}     \begin{document}     \make title      Normal text\endnote{A supposed end note}     \end{document}


title: How do you make a square element symbol (\in), to show that an element belongs to a collection of set?

text: I was reading a book the other day and they distinguished between the usual element symbol (\in) and an element symbol to show that a set is a member of a collection of sets. For the latter they used a square element symbol that looked similar to a wide E. Does anyone know what the code for this might be? The book,says it was prepared with regular LaTeX. Thanks. The Symbol is ![enter image description here](http://i.stack.imgur.com/vMkNt.png)


title: Multi-line curved text along vertical

text: I found this rendering from here on this site but with no explanation or working example to go with it. How do I do this? I'm pretty familiar with TikZ but I'm having trouble finding text that is curved along the vertical as most examples of curved text are along the horizontal. ![](http://i.stack.imgur.com/59ehJ.png)


title: biblatex: Cite commands with the same author prints authors name twice

text: I'm using `biblatex 1.4b`, and Biber 0.9. However, I think the problem is with my settings, not with the versions of those programs. I'm trying to cite a single author, and produce their name, followed by the dates of two papers, using the `authoryear-ibid` style, and `natbib` compatability. Here's my `biblatex` preamble:               \usepackage[style=authoryear-ibid,natbib=true,backend=biber]{biblatex}      What I want is for the following command: `The works by \citet{Blau81, Blau88} ...` to produce: `The works by Blau (1981; 1988) ...` however, what I'm getting is: `The works by Blau (1981); Blau (1988)...` I know that `biblatex` knows they're the same author, since in the bibliography they fall under the same name (i.e. after the first instance of the name, there's just a dash instead of the name) What am I doing wrong here? I've also tried it with the commands `\cite` and `\cites`, and neither produces what I want. (crossposted with comp.text.tex)


title: Problem with defining new unicode character

text: I have a document that takes text from source file via pandoc (that doesn't matter anyway) and inserts it instead of $body$. The source document contains the only one symbol that's shown in hex-editor as "C2 AD". As I discovered, it is a UTF-8 character "U+00AD" — soft hyphen. I have tried to handle it with \DeclareUnicodeCharacter command, just this way:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[T2A]{fontenc}     \DeclareUnicodeCharacter{00AD}{\-}          \begin{document}     $body$     \end{document}      but Xelatex still returned an error: "! Package inputenc Error: Keyboard character used is undefined (inputenc) in inputencoding `utf8'". When I tried to use utf8x instead of utf8:               \documentclass[a4paper,10pt]{article}     \usepackage[utf8x]{inputenc}     \usepackage[T2A]{fontenc}     \DeclareUnicodeCharacter{00AD}{\-}          \begin{document}     $body$     \end{document}      it returned: "! LaTeX Error: Missing \begin{document}". What I am doing wrong?


title: Underbraces in Matrix Divided in Blocks

text: How to put underbraces, inside the parenthesis of a matrix, to name both sides of the blocks?               \documentclass[a4paper,12pt]{article}     \usepackage{amsmath}     \usepackage{array}     \begin{document}     .     .     .     \[     \left (     \begin{array}{rrr|rrr}     0 & 0 & 0 & 0 & 0 & 0 \\     0 & 0 & 0 & 0 & 0 & 0 \\     0 & 0 & 0 & 0 & 0 & 0 \\     \end{array}     \right )     \]     \end{document}      I'm compiling the code in my university server, where I can't install new packages.


title: How do you organize bibtex citations?

text: I use JabRef sofar on multiple files, each for a specific topic and then include all the needed (mostly all of them) at the end of file with a single line:               \bibliography{bib/foo,bib/bar,..}      Drawbacks so far: having multiple files to include (solution: topic separation via tagging)


title: Barcode with text wrapping and on every page

text: I am trying to get a dynamic `\psbarcode` barcode (it changes based on the page) to display in the top right corner of every single page and I would also like the text of the page to wrap around this. I am working with some nasty code and wondering what the best way of doing this is. First I decided to put the barcode inside a header. This worked but `fancyhdr` complained about `\headheight` and ended up changing the next pages automatically and screwed up the formatting. Even though I am aware of the dangers of this incorrect `\headheight`, I actually wished `fancyhdr` wouldn't give me that warning. In the end though, I thought the header wouldn't be the best option because I want the text to wrap around it. Being in a header removes this possibility. The code I had for the barcode and word wrapping was:               \begin{pspicture}(0,0)\psbarcode{sample text \thepage}{width=1.5 height=1.5}{qrcode}\end{pspicture}      and               \begin{wrapfigure}{r}{1.5in}\vspace{1.4in}\end{wrapfigure}      Then I decided to use `\put` and `\parbox` to put an image on every page, as if it were some overlay. This worked great but then I realized the `wrapfigure` code only works on the first page. I tried using the `everyshi` package to execute the `wrapfigure` code on every page but it has not worked. I saw some posts already on here about just word wrapping around one figure but it didn't seem to help me. I did see about using the `tikzpicture` package but I am not sure if that's what I need. My ideal solution (for every page): ![ideal solution](http://i.imgur.com/0SFyT.png) Any ideas?


title: Pattern color differs from normal color?

text: I have the following code:               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{scopes,patterns,intersections,calc}     \begin{document}     \begin{tikzpicture}[thick]             \path (-2,0) coordinate (t1) (2,0) coordinate (t2);             \path (0,-2) coordinate (s1) (0,2) coordinate (s2);             { [color=blue!50!red!50,pattern color=blue!50!red!50]                 \draw (s1) -- (s2);                 \path [pattern=north west lines] (s1) +(-0.2,0) rectangle (s2);             }             { [color=magenta,pattern color=magenta]                 \draw (t1) -- (t2);                 \path [pattern=north east lines] (t1) +(0,-0.2) rectangle (t2);             }     \end{tikzpicture}     \end{document}      As in the first (vertical) scope I would expect that the pattern has the same color as the line in both scopes. For me, I get three different colors; the pattern and the main line of the horizontal scope differ quite much (looks nearly midway between colors of hor. and vert. scope). ![screenshot](http://i.stack.imgur.com/7MPpY.png) I am using pdfLaTeX to compile the file. Different viewers don't change anything. Can you explain me this behavior?


title: Wrap text round brackets

text: I want to accomplish this effect with LaTeX: ![enter image description here](http://i.stack.imgur.com/RfBYF.png) I have a slight idea of how to do that using \left{ and \right} on math mode but I’m not sure. If there’s a package that helps to do that, coding would be much easier and code would be much more beautiful.


title: Putting the \title of a BeamerClass presentation in a \block

text: I'm using a hand made `beamer` theme that uses the corporate identity standards of my university. However, the `\title` text on the `\titlepage` is not set in a `\block` environment as it is, e.g., in the Darmstadt theme. ![enter image description here](http://i.stack.imgur.com/1rz46.png) Is there a LaTeX command that actually toggles this feature on or off? If yes, is there a way to change the look of the `\block` environment of the `\title` without affecting the remaining `\block` environments on non-title-page slides?               \documentclass[handout]{beamer} % handout      \usepackage[utf8]{inputenc}     \usetheme{upb}     \setbeamercovered{transparent}     \usepackage{ragged2e} % besseren Umbruch     \usepackage{booktabs} % spezielle Tabellen zulassen     \usepackage{textpos}     \setbeamertemplate{blocks}[rounded][shadow=true]     \setbeamertemplate{title page}[rounded=true,shadow=true]     \title{Title}     \subtitle{Subtitle}     \author{phx}     \institute{University of Paderborn}     \begin{document}      \frame{\titlepage}     \end{document}      The theme `upd` is available here (zip-file)


title: Drop shadow for text in PGF/Beamer

text: I want to _really_ put an emphasis on some central piece of text I'm using in a Beamer slide. I'm using tikz and overlay to put it, enlarged, on the center of the page, using the following code:               \begin{tikzpicture}[remember picture,overlay]       \node[at=(current page.center)] {         \scalebox{2}{\Huge\texttt{{This is important!}}}       };     \end{tikzpicture}      Can I add a drop shadow to the letter themselves, so they would look even more emphasized? Is there some other decoration that can be added to the text itself, like a glow, etc.? Or does PGF ignores node text altogether? The text should be in typewriter style, so using special fancy fonts is probably not the solution.


title: latexmk: generated tex file (via custom add_cus_dep) not found in first pass

text: I have a latexmk-based project that uses some generated tex files included via `\input`. I'm generating these files using a latexmkrc file.               # latexmkrc     $cleanup_includes_cusdep_generated=1;           # clean generated .tex files                                                                                add_cus_dep('bar', 'tex', 0, 'touchtex');     sub touchtex {         return system("cp $_[0].bar $_[0].tex");     }      A minimal working example tex project is.               % main.tex     \documentclass{report}          \begin{document}     hello \input{foo}     \end{document}          % foo.bar     world      When I build the project with `latexmk -pdf` the first pass chokes because `foo.tex` doesn't exist yet. Ultimately, the pdf is built correctly, but I have to `return` through each missing file. Can anyone explain how to suppress this prompt for tex files that are going to be generated via a `add_cus_dep` custom build command.


title: Need vertically centered text in latex table

text: I want the text in each cell vertically centered.               \documentclass[12pt,a4paper,onesided]{report}     \usepackage{array}     \usepackage{booktabs}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \begin{document}          \begin{table}[htbp]     \centering     \caption{Recognition with Haar Wavelet based image compression for $N=5$ features}     \label{tab: Recognition with Haar Wavelet based image compression for $N=5$ features}     \begin{tabular}{|C{1.8cm}||C{1.8cm}||C{2cm}||C{1.8cm}|C{1.8cm}||C{1.8cm}||C{2.5cm}|}          \toprule \bfseries Training folder      &\bfseries Training Time      &\bfseries Training Accuracy      & \multicolumn{2}{c|}{\bfseries Number of images}      &\bfseries Testing folder      & \bfseries Recognition accuracy\\      & & & \bfseries Training &\bfseries Testing & &\\ \midrule         1     & 0.52  & 70.00 & 10    & 90    & 9     & 14.44 \\         2     & 0.66  & 85.00 & 20    & 80    & 8     & 38.75 \\         3     & 0.74  & 86.66 & 30    & 70    & 7     & 40.00 \\         4     & 0.68  & 85.00 & 40    & 60    & 6     & 48.33 \\         5     & 0.88  & 88.00 & 50    & 50    & 5     & 62.00 \\     \bottomrule          \end{tabular}     \end{table}          \end{document}


title: Is there a LaTeX symbol for 'order'?

text: Is there a symbol for order? > ...the exponent, _e i_ , is called the _order_ of _p i_ in _a_ , denoted > _ord pi (a) = ei_ .


title: How can I temporarily change title of contents of subsection formatting using titletoc

text: I have a common document type (grant application) which expects listed aims, usually enumerated as Aim 1, Aim 2, etc. In the MWE below, an `article` class works fine to format the subsection headings appropriately within the document, but I'm having trouble with the TOC. I'm changing `\thesubsection` and using `\titleformat` from the `titlesec` package in anticipation of using the `titletoc` package to change the toc formatting of entries from within a defined `aims` environment. I want the aims to be listed in the TOC as Aim 1, Aim 2, etc. What I'm running into:   1. The `\titlecontents` settings I set as part of the `aims` environment appears to persist _after_ the end of the environment. This is different from the `\titleformat` settings, which are local.   2. Unlike the `\titleformat` settings in the `titlesec` package, the default `\titlecontents` in `titletoc` are not listed in the documentation, so my attempt to alter the default settings is trial and error (at this point, all error, since I can't get it working). The `titlesec` examples are invaluable; are there similar examples for `titletoc`? MWE follows               \documentclass[11pt]{article}     \usepackage {blindtext}     \usepackage {titlesec}     \usepackage {titletoc}          \newenvironment {aims} {       \renewcommand{\thesubsection}{{\arabic{subsection}}}       \titleformat{\subsection}{\normalfont\large\bfseries}{Aim         \thesubsection}{1em}{}       % example from titletoc docs to show that \titlecontents       % changes persist outside the group       \titlecontents{subsection} [3.8em]       {}{\contentslabel{5em}}{\hspace*{-5em} Aim }       {\titlerule*[1pc]{.}\contentspage}     }{}     \title {A document}     \author{me}     \begin{document}     \maketitle     \tableofcontents          \section {Introduction}     \blindtext     \begin {aims}       \section {Aims}       \subsection {This is an aim}       \blindtext       \subsection {This is another aim}       \blindtext     \end {aims}     \section {Details}     \blindtext     \subsection {Some more details}     \blindtext     \end{document}


title: How to work with two encodings?

text: I'll try to explain my problem here. I know that there are many posts dealing with this but I'm still confused. We have many files from different machines with different systems. The important is:   1. the `tex` file will be compiled on a Linux machine with utf-8.   2. the `tex` files comes from many Windows machines with iso. Without converting, is there some good preamble to solve my problem? For example, on Windows Vista, using Winedt to produce a `tex` file encoded in iso, is there some package which allows me to run `pdflatex` on a Linux machine with Kile and utf-8? This will be a big project with a lot of people sending many `tex` files to me and I'd like to create a good template with necessary packages to avoid confusions.


title: How to make Latexmk use makeglossaries?

text: Is there a way to make Latexmk invoke `makeglossaries` (part of the glossaries package)? Specifically I want to use latexmk to compile a LaTeX document that uses the `glossaries` package to produce a glossary. Currently I'm using this rather clumsy sequence of commands:               makeglossaries document     latexmk -pdf document.tex     makeglossaries document     latexmk -pdf document.tex      The first run of makeglossaries is required to produce files that the `glossaries` package needs, or otherwise causes latexmk to fail, but there's still no data in the (non-existant) .aux file, so that first makeglossaries invocation produces nothing (except for an empty file). So, how to do this using latexmk alone (and let that deal with invoking makeglossaries at the right time)?


title: How to use \ifinner to differentiate between text math and display math mode?

text: > **Possible Duplicate:**   >  Is there a test for the different styles inside maths mode? This is my first post here, so I can't promise to get all formatting right, but I'll try. Consider the following macro:               \def\modes{{\bf \ifmmode\ifinner IM\else MM\fi\else TM\fi}}      According to both the 'TeXbook' and 'TeX for the Impatient' the `\ifinner` macro should 'True if TeX is in [...] (nondisplay) math mode [...]' (page 209 in the TeXbook). The 'TeX for the Impatient' does not print the braces surrounding 'nondisplay', so when writing in a document:               \modes - $\modes$     \[        \modes     \]      I'm kind of expecting to get:               **TM** - **IM**                      **MM**      However, the result is:               **TM** - **IM**                      **IM**      I guess the TeXbook has slightly more authority, yet to me it sounds reasonable that indeed I should get the expected result. So I guess my question boils down to the following:   Am I misunderstanding the explanation of `\ifinner` in the TexBook   * if yes, then how to achieve the result I'm looking for?   * if no, what could be wrong then? Both pdfTeX and LaTeX produce this result, I'm running pdfTeX/LaTeX using libpoppler 3.141592-1.40.3-2.2 on Linux. Thanks in advance.


title: Generating graphics for LaTeX with PyX

text: I have a script from others that uses PyX - Python graphics package to generate graphics for LaTex. Quoted from http://pyx.sourceforge.net/ > PyX is a Python package for the creation of PostScript and PDF files. It > combines an abstraction of the PostScript drawing model with a TeX/LaTeX > interface. Complex tasks like 2d and 3d plots in publication-ready quality > are built out of these primitives.   1. However its latest news is back at 2007. I was wondering if PyX is still active?   2. If it is one of the best ways to generate graphics for LaTex? Thanks and regards!


title: Beamer framezoom image centered.

text: I'm using framezoom to show details from a big image, I wish the detail, zoomed portion, centered in a frame, how can I do this?. Thanks,


How to add author an affiliation and their email address and all left aligned? title author 1, author 2, author 3 Authors affiliation author1 's email address abstract I'm using a single column article document. Title is in center of the page. Regards


title: How to frame headings in \texwidth-long colored bounding box?

text: I am trying to add a background frame around my sections and subsections. The frame should be colored (in an 80% gray) and span the \textwidth. I have tried a few (uninformed) approaches and succeeded in coloring either the section number, the period after the number, the title or a little part of the title. I tried to make sense of the 'titlesec' package, to no avail. How do I do this?


title: How to vertical align a text and an tikzpicture?

text: I am using a TikZ picture followed by a text. How do I create a picture that aligns with the top of the text?               \begin{minipage}[t]{0.45\textwidth}     \tikz[baseline=(current bounding box.north)] {         \draw (0,0) rectangle (2,-3);     } text     \end{minipage}      ![enter image description here](http://i.stack.imgur.com/YPLnU.png)


title: How to make biblatex behave like apacite?

text: The title is probably too broad. The problem I face is that I am working on a beamer presentation, and because beamer conflicts with apacite, it has been suggested that biblatex be used instead. I have tried it but there are a few issues. 1) Full list of authors the first time, but uses "et al." in all subsequent cites, e.g. first time: (Doe, Smith, & Johnson, 2009); 2nd time and on: (Doe et al., 2009) 2) No comma between the authors and the year. How do I make it output something like (Smith and Johnson, 2009) instead of (Smith and Johnson 2009)?


title: Collaboration among members of the LaTeX3 team: "this is my code and no one touches it" vs. "the team owns the code"?

text: The book _Coders at work_ by Peter Seibel contains interviews of several high- profile programmers, including Donald Knuth (whose interview I warmly recommend to anyone interested in TeX's history). One recurring question Seibel asked the interviewees had to do with collaboration between coders on a team: > When folks are working in a group, is it better for coders to each own a > piece of a system? Where "this is my code and no one touches it" vs. the > team owns the code and anybody can touch anything. (The question can be found in this very form on p404 of the book.) This made me wonder about how collaboration among members of the LaTeX3 team works...   * **Where, between the two extreme approaches described by Seibel, does the LaTeX3 team's approach lie?**   * Has the approach evolved over time or has it remained the same since work started on LaTeX3?


title: Misplaced label mixing list environments

text: I am hacking the `dramatist` package. My aim is to get speech-prefixes to align with speeches for the verse environment, as they do for the prose environment. I've got it working except for a problem with the first speech prefix being misaligned. Manually expanding all the macros for the MWE with what I currently have gives this:               \documentclass{memoir}     \begin{document}     \begin{verse}     \begin{list}{}{}          Enter Bob and Mike          \item[Mike] Hello     \item[Bob] Hello     \item[Mike] Bye!     \item[Bob] Bye!          \end{list}     \end{verse}     \end{document}      This causes the first "Mike" prefix to be positioned over the first "Bob" prefix. The result is ![here](http://i.stack.imgur.com/bhyPf.png). I know that the verse environment from memoir is implemented as a list, so I assume that the problem is to do with interactions between their list customizations. The reason for wanting to have the plain text (a stage direction) inside the `list` is so that the `list` can be defined once for the whole document. (This is how `dramatist` works for prose.) The same problem occurs with the standard `verse` environment instead of that defined by `memoir`. I'd be very grateful for any advice on how to avoid this. I am new to LaTeX, so general advice on how I might diagnose the problem myself would be useful as well.


title: Equation: placing subscript explanation at the very end

text: Most of the times I use equations that have subscripts and sometimes I want to give a short explanation of the subscripts, e.g., what are the limits, or which are the categories, should they be small enough. In this minimal example I do not like the placement of the subscript explanation (I have used `\qquad`) but it is still quite close to the main part. I would like it to be at the very end of the line.               \documentclass[12pt,a4paper]{article}     \usepackage[utf8x]{inputenc}     \usepackage{ucs}     \usepackage[leqno]{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{makeidx}     \usepackage{graphicx}     \author{PSK}          \begin{document}     Some stuff ...          \begin{equation}     V_i = a_i + B_i \qquad (i = 1, \dots, N)     \end{equation}          \end{document}


title: Why is hyperref inverting URL /'s to a backslash

text: This code:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{hyperref}          \begin{document}     \begin{center}     \url{http://demonstrations.wolfram.com/preview.html?draft/93173/000001/BallisticHookePendulum}     \end{center}     \end{document}      prints the URL properly. But if you click on it in the PDF the URL it tries to open have some of the `/`s changed by `\`s. Any idea why this is happening?


title: Multiple instances of xelatex in parallel without overwriting generated PDF's

text: I've one TeX file `abc.tex` which is executed using `xelatex abc.tex` to generate the PDF file `abc.pdf` Inside `abc.tex` I'm using the `datatool` package to read data from an external CSV file (say `pqr.csv`). Now, I've to execute multiple CSV files for which I need to generate a PDF using `abc.tex`. Currently, I'm manually changing the name of the CSV file inside `abc.tex` and executing `xelatex` to generate the PDF. Is there any smart option to perform same operation multiple times? Is there any way I can run four instances of `xelatex abc.tex` and generate four separate PDF files in parallel?


title: How to put URL in bibtex bibliography

text: I'm having trouble to correctly finish my bibliography. In the website's region, I cannot place the url correctly. Can anyone help me out? I've search some questions, but I wasn't able to get the answer...               \documentclass[a4paper,twoside,11pt,openright]{report}     \begin{document}     \bookmarksetup{startatroot}     \addtocontents{toc}{\bigskip}     \phantomsection         \addcontentsline{toc}{chapter}{Bibliography}         \begin{singlespace}             \bstctlcite{IEEEexample:BSTcontrol}     \bibliographystyle{ieeetr}             \bibliography{References}                                    \end{singlespace}     \end{document      Reference example:               @ONLINE{Asus:Online,     title = {ASUS “Xtion PRO LIVE”. },     month = April,     year = {2014},     url = {http://www.asus.com/Multimedia/Xtion_PRO_LIVE/#specifications;}     }      and the result is..![enter image description here](http://i.stack.imgur.com/K2nch.png)


title: How can I parse the first word in a token stream, token by token?

text: Some programming editors and IDEs highlight legal and illegal variable names in different ways. I wish `listings` easily allowed for such syntax checking and highlighting, but it doesn't, at least at the moment. My longer-term objective is to implement a solution compatible with `listings` but, for now, I'm looking at a very simplified version of the problem. I want to parse the first word in a token stream composed only of character and space tokens. This has to be done **token by token** , though, because I have to perform some checks on each token. For that, I use a recursive macro that parses the stream, saving it in a `\Word` macro, until a `.` token is encountered. At that stage, I process `\Word` in a certain way, such as printing it in red. I define a _word_ as a sequence of character tokens uninterrupted by any space token. **Problem** : I only use a `.` token here because I can't figure out what I should change in my code in order to stop the recursion when the next space token, not a `.` token, is encountered in the stream. Substituting a control space (`\`) for `.` doesn't seem to do the trick. What should I change in my code? I favour a solution using low-level TeX commands for the parsing, but LaTeX2e and LaTeX3 alternatives are also of interest to me. **Edit** : I apologise if I seem to be moving the goalpost, but I had to clarify my question quite a bit by adding the "token by token" requirement, which may invalidate some of the answers already posted. ![enter image description here](http://i.stack.imgur.com/U9mux.png)               \documentclass{article}          \usepackage{xcolor}          \def\ParseWordandPrint#1{%         \if #1.%             \textcolor{red}{\Word}\ %         \else             \edef\Word{\Word#1}             \expandafter\ParseWordandPrint         \fi%     }          \def\InitParseWordandPrint#1{%         \def\Word{}         \ParseWordandPrint#1%     }          \begin{document}          \InitParseWordandPrint Hello.World          \end{document}


title: multicolumn list of acronyms

text: Is it possible with the `acronym` package to produce two columns of acronyms? I checked the package guide, but didn't find any help, should I use a table? Not really sure on how to proceed. I am using `classicthesis` and have a too long list of acronyms.               \documentclass[10pt,a4paper,oneside,titlepage,%     headinclude,footinclude,BCOR5mm,bibtotocnumbered,%     numbers=noenddot,cleardoublepage=empty%tablecaptionabove     ]{scrbook}          \usepackage{stackrel}      \usepackage{float}     \usepackage{subfig}     \usepackage{wrapfig}     \usepackage[eulerchapternumbers,subfig,beramono,pdfspacing]{classicthesis}     \usepackage{arsclassica}     \areaset[5mm]{400pt}{699pt}     \setlength{\marginparwidth}{7em}%     \setlength{\marginparsep}{2em}%     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[italian,english]{babel}     \usepackage{graphicx, epstopdf}     \usepackage[printonlyused]{acronym}     \usepackage{amsmath, amstext, amsfonts,amssymb}     \usepackage{tikz}     \usepackage{commath}     \graphicspath{{./img/}}          \begin{document}          dum de dum \ac{LS} technique     \section{Acronyms}     \acro{LS}{least squares}     \end{document}


title: Error using lualatex and tikzexternalize to compile document with PGFPlots

text: I have a fairly large document with a number of `pgfplots` diagrams and due to memory capacity limits in `PDFLaTeX` I am now using `LuaLaTeX` to compile. While this works well, it `takes forever to produce the document`, so I would like to externalise the compilation of the plots. I have tried different approaches, but none seem to work. When I try to compile a minimal example such as               %compiled using "../MiKTeX/miktex/bin/lualatex.exe" -enable-write18  %.tex     %using MiKTeX Portable, hence the ".../lualatex"          \documentclass[11pt]{minimal}          \usepackage{pgfplots}     \usepgfplotslibrary{external}     \tikzset{external/system call={"../MiKTeX/miktex/bin/lualatex.exe" -enable-write18 -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}     \tikzexternalize          \pgfplotsset{compat=1.10}          \begin{document}          \begin{tikzpicture}          \begin{axis}[%             xlabel=x,              ylabel=y]          \addplot[mark=x] coordinates {             (2,-2)             (3,-3)             (4,-4)             (5,-5)         };         \end{axis}     \end{tikzpicture}          \end{document}      I get the following error:               ===== 'mode=convert with system call': Invoking '"../MiKTeX/miktex/bin/lualatex.     exe" -enable-write18 -halt-on-error -interaction=batchmode -jobname "MWE-figure0     " "\def\tikzexternalrealjob{MWE}\input{MWE}"' ========     runsystem("../MiKTeX/miktex/bin/lualatex.exe" -enable-write18 -halt-on-error -in     teraction=batchmode -jobname "MWE-figure0" "\def\tikzexternalrealjob{MWE}\input{     MWE}")...disabled.          ! Package tikz Error: Sorry, the system call '"../MiKTeX/miktex/bin/lualatex.ex     e" -enable-write18 -halt-on-error -interaction=batchmode -jobname "MWE-figure0"     "\def\tikzexternalrealjob{MWE}\input{MWE}"' did NOT result in a usable output     file 'MWE-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that     you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'.     Sometimes it is also named 'write 18' or something like that. Or maybe the comm     and simply failed? Error messages can be found in 'MWE-figure0.log'. If you con     tinue now, I'll try to typeset the picture.      And nothing but an *.md5 file is produced. Can anybody tell me where I am mistaken? Thanks.


title: Double stroke math

text: I recently started using ConTeXt and am trying to figure out how to place number sets. Namely, how do I get the natural number and real number sets to look like they do in LaTeX, (i.e. `\mathbb{N}` and `\mathbb{R}`)? I found doublestroke, but the font isn't quite the same. Any suggestions?


title: Versions of TeXLive under Ubuntu

text: Since installing Ubuntu, I noticed that it has an old version of TeXLive, namely, TeXLive 2009. To get the latest version, I downloaded and installed TeXLive 2011 from CTAN. As this installs itself in a separate directory, I noticed that I now have two versions of TeXLive installed on my system. My first question is, can I safely remove the old version using the Synaptic Package Manager, for example, without affecting the newer version, or do I need to uninstall both, and reinstall TeXLive 2011 by itself? My second question is, does it really matter since I have done the proper thing, and set PATH to include the new version of TeXLive? Note that all works fine if I, for example, run pdflatex at the system prompt (that is, it uses the latest version). My third question is, which version is KILE using? Is it using the first one it finds in the PATH, or is it still pointing to the old version? Any help/advice would be appreciated.


title: Place header outside set margins of the page

text: I have to implement some strict guidelines regarding a scholarship application and plan to use the geometry package to achieve this. There is, however, one point I don't understand. The relevant points are:   * Margins must be set at a minimum of 3/4" (1.87 cm)   * Your name and student number must appear outside the set margins of the page (not in header or footer), at the top right corner of every page. What do they mean by _"outside the set margins"_ and their emphasis on _"not in header or footer"_? Isn't the header always outside the set margins of the text body?


title: How to use only mathematical input in the first column with pgfplotstable

text: I can use a mix of text and mathematical input in the first column of a table generated with pgfplots with no problem, and also mathematical input in, e.g. the last column, as this mwe shows:               \documentclass{article}     \usepackage{pgfplotstable}     \usepackage{booktabs}     \begin{document}     \pgfplotstabletypeset[     col sep=&,     row sep=\\,     columns/cero/.style={         string type,    % Change for first column (column index 0)         column name=$k$     },     columns/1/.style={column name=$X$},     columns/dos/.style={column name=$Y$,dec sep align},     columns/3/.style={column name=$Y$,dec sep align},     columns/4/.style={string type,column name=$Y$},     every head row/.style={before row=\toprule, after row=\midrule},     every last row/.style={after row=\bottomrule},     ] {cero & 1& 3& dos & 4 \\     a$\Sigma$             &0.15770748944587207&1.2326557180455233e31&69.1973640&   a$\sigma$\\     8       &0.15770748944587207&1.2326557180455233e31&6.1973640&  $\lambda$\\     8       &0.3532132208423006&20496.519149382926&20.496519149&  a\\     8          &0.021744461199488557&1.5274940707993938e47&0.8544828&a\\       }      \end{document}      and then get this ![enter image description here](http://i.stack.imgur.com/kcI4m.png) Nevertheless, when I replace the first cell `a$\Sigma$` with e.g. `$\Sigma$` , the document takes forever to compile. It can be remedied using `\vphantom{a}$\Sigma$`, but I hope there is other way around...


title: unexpected interaction between \raggedright and \parshape

text: While answering Random start of line, I came upon a strange interaction between `\raggedright` and `\parshape`. If a ragged-right paragraph ends in a short line, this line will be "the most ragged".               \documentclass{article}     \begin{document}     \raggedright     i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      \end{document}      ![The effect of \\raggedright in LaTeX](http://i.stack.imgur.com/ADIM2.png) Now watch this: I add a dummy `\parshape` (it does nothing, really) and all of a sudden, it's the _first_ line that is short!               \documentclass{article}     \begin{document}     \raggedright     \parshape 4     0cm \textwidth     0cm \textwidth     0cm \textwidth     0cm \textwidth     i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      \end{document}      ![The joint effect of \\raggedright and \\parshape](http://i.stack.imgur.com/cXQHa.png) Let's explore further. The resulting paragraph is three lines long. What happens if the `\parshape` specification consists of three items? We're back to normal!               \documentclass{article}     \begin{document}     \raggedright     \parshape 3     0cm \textwidth     0cm \textwidth     0cm \textwidth     i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      \end{document}      ![With shorter \\parshape, normality](http://i.stack.imgur.com/zmXBf.png) In general, we get the unexpected result if and only if the `\parshape` specification has at least one item more than the resulting paragraph. I guess that's why all this is hard to notice: usually, the `\parshape` is of a zero length. Exploring even further, I have discovered that plain TeX behaves ok. (To facilitate comparison, I have set plain TeX's text width to equal the LaTeX default.)               \def\is{%     i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i}     \hsize 345pt          \parskip 2ex     \raggedright     \is          \parshape 3     0cm \hsize     0cm \hsize     0cm \hsize     \is          \parshape 4     0cm \hsize     0cm \hsize     0cm \hsize     0cm \hsize     \is     \bye      ![The plain TeX's result](http://i.stack.imgur.com/9xLOR.png) The difference between plain TeX and LaTeX suggests that LaTeX's definition of `\raggedright` is to blame. TeX:               > \raggedright=macro:     ->\rightskip \z@ plus2em \spaceskip .3333em \xspaceskip .5em\relax .      LaTeX:               > \raggedright=macro:     ->\let \\\@centercr \@rightskip \@flushglue \rightskip \@rightskip \leftskip \z@skip \parindent \z@ .      Indeed, LaTeX's definition sets `\rightskip` to `\@flushglue`, which is `0.0pt plus 1.0fil`, and thus probably responsable the described problem. Defining (in plain TeX)               \def\raggedright{\rightskip 0pt plus1.0fil \spaceskip .3333em \xspaceskip .5em\relax}      makes plain TeX behave like LaTeX. (Almost: for a perfect match (in this case) write `\def\raggedright{\parindent 0pt\rightskip 0pt plus1.0fil\relax}`.) I have also checked this with the original (non-pdf, non-e) TeX. The behaviour is the same. Btw, I use TeX version 3.1415926-2.4-1.40.13 (TeX Live 2012/Arch Linux). My question (finally) is actually manifold:   1. **How does this happen?** I.e. I'd like to have the details of how TeX computes the paragraph shape resulting in a short first line.   2. **How is this even possible?** I have read all I could find on `\parshape` in TeXbook and TeX by Topic, and searched the net, but nowhere does it say that `\parshape` could have a different effect if the last item is repeated (one time too many). _Is this a bug in TeX??!?_ ... ... I guess not: I just don't believe I'm lucky enough to stumble upon one and gain both fortune and eternal glory in a single strike :-)))   3. What, precisely, were the desired effects of plain TeX's and LaTeX's `\raggedright`? Obviously to have a ragged right edge :-) Anything else?  3a. How do the various components of the definition contribute to achieving the goal? (A separate question for plain TeX and LaTeX.) By the way, the problem that this issue had caused to the OP of Random start of line was resolved by redefining his `\raggedright` to a plain TeX-like version. (So my question here was an academic one.) **EDIT** : At first I thought that LaTeX's ragged right edge looked nicer than plain TeX's one. But then Stephan's comment made me see that I just haven't looked at the right examples. So I withdraw that opinion, and I have deleted all the references to it from the question. **UPDATE** Looking at the TeX source, I've figured out two more ways to trigger the phenomenon: a combination of `\raggedright` and   * hanging indents if abs(`\hangafter`) >= number of lines in the paragraph (given the `\parshape` problem, this is not really unexpected)   * non-zero `\looseness`, as illustrated below. In fact, the greater the (positive) looseness, the more horrible the result. :-)              \documentclass{article}     \begin{document}     \parindent 0pt     \looseness=1     \raggedright     i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i      i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i     \end{document}      ![\\raggedright and non-zero \\looseness](http://i.stack.imgur.com/tNlgH.png) If I'm not much mistaken, `\parshape`, `\looseness` and hanging indents should be a complete list.


title: Aligning the tops of two tabularx environments

text: I have used the following to place two tabularx environments next to each other               \begin{table}     \begin{center}     \begin{tabularx}{190pt}{l}     \toprule     ... Content ...     \bottomrule     \end{tabularx}     \quad     \begin{tabularx}{190pt}{l}     \toprule     ... Content ...     \bottomrule     \end{tabularx}     \end{center}     \end{table}      How would I further align the tops of the two tabularx environments?


title: Fancyhdr header goes on top of main text

text: I have a problem with headers and footers. When im making header, it goes on the top of my text. Maybe someone can help to fix it.               \documentclass[11pt,a4paper,oneside]{article}     \usepackage{fancyhdr}     \titleformat{\section}[block]{\Large\bfseries\filcenter}{\thesection}{1em}{}     \titleformat{\subsection}[hang]{\bfseries\filcenter}{\thesubsection}{1em}{}     \titleformat{\subsubsection}[hang]{\bfseries\filcenter}{\thesubsubsection}{1em}{}     \renewcommand{\thesection}{\arabic{section}}\pagestyle{fancy}      \fancyfoot{}     \fancyfoot[LE,LO]{MY TEXT}     \renewcommand{\footrulewidth}{0.4pt}     \begin{document}      and this is result, which i get: ![enter image description here](http://i.stack.imgur.com/uTjNg.jpg) I hope it is enough info to fix it. Thanks!


title: Trying to put a box around a collection of subfigures

text: I'm trying to have a bounding box around the following figure:               \begin{figure}[htp]     \begin{center}      \subfigure[Process with no error]{\label{noerror}\includegraphics[width=1.5in]{noerror-process}}     \subfigure[Process with syntactic  errors (connector having multiple incoming edges and presence of hanging node)]{\label{synerror}\includegraphics[width=1.5in]{synerror-process}} \\     \subfigure[Process with deadlock]{\label{deadlock}\includegraphics[width=1.5in]{deadlock-process}}     \subfigure[Process with lack of synchronization]{\label{lacksync}\includegraphics[width=1.5in]{lacksync-process}}     \end{center}      \caption{Different kinds of errors occuring in InFlux Processes}     \label{processes}     \vspace*{-0.65cm}     \end{figure}      Can you please help?


title: makeidx and pdfcomment packages are not working together

text: I noticed recently that if I'm using **pdfcomment** package together with **makeidx** in one document, highlighted comments are not added to the PDF output. for example, you may run the following with LaTeX:               \documentclass[a4paper,12pt,oneside,titlepage]{report}     \usepackage[x11names,table]{xcolor}     \usepackage{makeidx}     \usepackage{pdfcomment}          \makeindex          \begin{document}              \pdfmarkupcomment[author={Oleksandr},subject={test},color=green!25]{I will}{or, maybe not} put here some text, formulas, tables, comments, and some other things.         Here comes a \index{formula} formula.              \clearpage         \phantomsection         \addcontentsline{toc}{chapter}{Index}         \printindex          \end{document}      and see that in the output no comments are added. However, if you comment out lines               \usepackage{makeidx}      and               \clearpage     \phantomsection     \addcontentsline{toc}{chapter}{Index}     \printindex      and re-run the typeset, you will see that comment is now added. Workaround is obvious - first, run the document without **makeidx** package, and then add it in the end, but it is not very good. Why is there such behavior of the **pdfcomment** package and how to fix it? **Edited:** I accept answer of **egreg** , however, I see some strange behavior of **imakeidx** in my computer. To illustrate it, I put a picture there, so you can see that sub-entry of the index is not formatted properly. ![imakeidx not working properly](http://i.stack.imgur.com/r5FjY.jpg)


title: Render (export) entire document as image

text: ## Background Using LyX to create a document and xetex to leverage a TrueType font. The entire text is within a minipage. Ultimately, I'm trying to produce the following output (no white page background, single image, captured from OpenOffice): ![](http://i.imgur.com/ZivhF.png) ## Problem - Update #1 Adding `tolerance` and `emergencystretch` produces: ![](http://i.imgur.com/85Wvg.png) ## Preamble The document preamble:               \usepackage{fontspec}% provides font selecting commands     \usepackage{xunicode}% provides unicode character macros     \usepackage{xltxtra} % provides some fixes/extras     \setmainfont{Franklin Gothic Book}     \usepackage[parfill]{parskip}     \usepackage[none]{hyphenat}     \usepackage{microtype}     \usepackage[margin=0.2in]{geometry}          \setlength{\textwidth}{6cm}     \tolerance=1     \emergencystretch=\maxdimen      ## Idea - Update #2 The program `pdfcrop` can be used to remove all the extra whitespace in the margins. ## Related Links - Update #3   * http://rene.bz/convert-multi-page-pdf-single-image/   * http://linuxers.org/quick-tips/convert-pdf-file-single-image-using-imagemagick ## Question How can you render a document as a single image (or as one very, very long page), ignoring any pagination, in a justified (newspaper-style) column format? Thank you!


title: allowable filenames for source files

text: Which characters may appear in filenames that are included (`\include`)? Are hyphens and underscores okay? Is there a dependence on the underlying filesystem or encoding of the LaTeX source that does the including? Are only ASCII characters allowed?


title: How can I set up my custom class to load a different class depending on the class option(s) passed?

text: I have written class files in the past. One of them is even up on CTAN. But that was ages ago, and I am rusty today. I am trying to roll a new class file for my University. I am being a little ambitious, and want to use the same class file for University letters, forms, reports, etc (and use class options to select each type). The reason is that this is a LaTeX-resistant place and being able to provide just one file would help in selling the power of LaTeX to them. Plus, there is a coolness factor involved which I wish to explore. Logically, each of those documents would correspond to inheriting from standard LaTeX classes and then adding local customizations. Is it possible to have an option-dependent inheritance (`\LoadClass`) for a new class file? Or is that a fundamental impossibility?


title: How can I make Tikz tree node arcs not cross over each other?

text: I am trying to build a tree (the theme is argumentation theory, where arguments attack and defend each other) in Tikz but after a few levels down the tree, nodes are placed on top of each other or in a way that the arcs to their parents cross over each other.               \documentclass{article}     \usepackage{tikz}          \usetikzlibrary{arrows}     \tikzset{       every node/.style={minimum size=4mm, inner sep=0.5mm, font=\sffamily},       level 1/.style={every child/.style={edge from parent/.style={draw,red}}},       level 2/.style={every child/.style={edge from parent/.style={draw,green}}},       level 3/.style={every child/.style={edge from parent/.style={draw,red}}},       level 4/.style={every child/.style={edge from parent/.style={draw,green}}},       level 5/.style={every child/.style={edge from parent/.style={draw,red}}},       level 6/.style={every child/.style={edge from parent/.style={draw,green}}},       def/.style={circle,thick,solid,draw=green!50,fill=green!20},       att/.style={circle,thick,solid,draw=red!50,fill=red!20}     }     \begin{document}          \begin{tikzpicture}[<-,>=stealth', semithick]            \node[def, label=east:defense] {}         child[level distance=11mm] { node[att, label=east:attack] {}           child {node[def, label=east:defense] {}             child { node[att, label=east:attack] {} }             child { node[att, label=east:attack] {} }           }           child {node[def, label=east:defense] {}              child {node[att, label=east:attack] {}}             child {node[att, label=east:attack] {}}           }           child {node[def, label=east:defense] {}             child {node[att, label=east:attack] {} }             child {node[att, label=east:attack] {} }             child {node[att, label=east:attack] {} }           }       };      \end{tikzpicture}          \end{document}      The result is the following: ![arcs crossing over each other](http://i.stack.imgur.com/xJk2Y.png) As you can see, in the bottom layer, the arcs of the two nodes in the middle inevitably cross over each other. In addition, the two nodes after the first one in the bottom layer are placed on top of each other. Is there a "adjust the distance between the nodes however you want so that the arcs between them don't cross and the nodes don't appear on top of each other"-command that I can use? Thank you very much for all the help and I hope this isn't a duplicate question as I couldn't find a similar one!


title: How can I fade out the margins of a Beamer frame?

text: I'm making a poster with `beamer`. The department's printer has a specific printable area that I must stay within, but I'd like to have a gradual fade- out of my background pattern. How can I fade out to pure white by the time I hit this printable area? (Let's assume a `.5in` long-edge margin and a `1in` short-edge margin, portrait orientation.) Related: How to add a gradient fade-out effect to an image? ### MWE               \documentclass{beamer}     \usetheme{Rochester}          \beamertemplategridbackground[.05in]          \begin{document}     \begin{frame}       \frametitle{MWE}       \begin{block}{Title}         Test       \end{block}     \end{frame}     \end{document}      ### Doodle ![doodle](http://i.stack.imgur.com/F3ToF.jpg)


title: truncate text from right to left

text: I would like to have a command that truncates text like **'An example sentence.'** to **'...ple sentence.'**. When called like this               \truncateToLeft{4cm}{An example sentence.}      I have no idea how to implement that (I do not understand `/usr/share/texmf- dist/tex/latex/truncate/truncate.sty`). Edit: A (VERY MINOR) thing I noticed with the answers below, is that the text is not cut at 'letter-borders'. Just to ask (I'm no (La)TeX-Expert): Is it possible to cut the text at 'letter-borders'? --> This is solved by Steven B. Segletes second answer!


title: Specifying proportional numbers when using Libertine with pdfLaTeX

text: If I use the Libertine fonts from within XeLaTeX I can specify the use of proportional numbers/figures by including it as an option when I set the main font like so:               \setmainfont[Numbers={Lining,Proportional}]{Linux Libertine O}       However, I'm also interested in being able to using proportional numbers when using pdfLaTeX. Below is a MWE that shows one way to do this. My "solution" seems awfully ugly though. Is there a better way to accomplish this?               \documentclass[12pt]{article}     \usepackage[T1]{fontenc}     \usepackage{libertine}          \begin{document}     % this seems necessary to get proportional numbers in Libertine     % when using pdflatex. Comment / uncomment to see the difference         \usefont{T1}{fxlf}{m}{n}\selectfont              I would like the following numbers to be proportional so that 11,      doesn't take up as much space as 17. See what I mean?              \end{document}


title: Align text in multiple rotated multicolumns

text: I have a table with figures and rotated text in the first two columns. I don't understand 2 issues:   1. How I can align and especially center the text? With the images I included (all same size and quadratic, scaled such that they fit the page) the text is not centered but bound left (2nd column) and aligned seemingly random (1st column).   2. How are the gaps between the rows determined? Right now not all are equally wide. If I use a smaller fontsize in the first line's option, the gaps are equal?! I've tried playing with the options but I'm stuck now, help would be greatly appreciated!               \documentclass[12pt]{article}      \usepackage{array,multirow}     \usepackage{rotating}          \begin{document}          \begin{table}[H]             \centering             \begin{tabular}{ccccc}                   & & \multicolumn{1}{c}{$\nu=-2\%$} & \multicolumn{1}{c}{$\nu=0\%$} & \multicolumn{1}{c}{$\nu=10\%$}\\                     \hline         \parbox[t]{\multirow{2}{*}{\rotatebox[origin=c]{90}{Case A}}} & \rotatebox[origin=left]{90}{Value} &                 \includegraphics{Tux.png} & \includegraphics{test.png} & \includegraphics{test.png} \\     & \rotatebox[origin=left]{90}{Value change}  & \includegraphics{test.png} & \includegraphics{test.png} & \includegraphics{test.png} \\         \parbox[t]{\multirow{2}{*}{\rotatebox[origin=c]{90}{Case B XYZ}}} & \rotatebox[origin=left]{90}{Value} & \includegraphics{test.png} & \includegraphics{test.png} & \includegraphics{test.png} \\     & \rotatebox[origin=left]{90}{Value change}  & \includegraphics{test.png} & \includegraphics{test.png} & \includegraphics{test.png}                 \end{tabular}                 \caption{Value }             \label{tab:num12}     \end{table}     \end{document}


title: Making mixed trees with and without text-containing nodes

text: I’m using TikZ to draw linguistic syntax trees where some nodes have textual labels and some nodes don’t. I’d like the branch from a labelless node to continue at the same angle into the right hand daughter (or alternatively into the left hand daughter) as the branch that went to the node, so that the two branches form a visually continuous line at the same angle. I worked out how to do so for one labelless node using a kluge of lots of anchor specifications for each child. This fails to work for more than one labelless node and it’s a really messy method anyway. There must be a better way to do this but I haven’t figured it out. Any suggestions? (I’m using XeTeX but this shouldn’t matter I think.)               \begin{tikzpicture}[level distance=2em,                 sibling distance=4em,                 parent anchor=south,                 child anchor=north,                 anchor=north,                 align=center,     %           every node/.style={draw}                 ]     \node{DP}         child {node {Qfr}}         child {node (dbar) {}             child[parent anchor=north, anchor=base] {node {D}}             child[parent anchor=north, anchor=base] {node {ΦP}                 child[parent anchor=south, anchor=north] {node {CP}}                 child[parent anchor=south, anchor=north] {node (phibar) {}                     child[parent anchor=north, anchor=base] {node {Nml}}                     child[parent anchor=north, anchor=south] {node (phibar2) {}                         child[parent anchor=north, anchor=base] {node {Φ}}                         child[parent anchor=north, anchor=base] {node {NP}}}}}};     \end{tikzpicture}      ![Output of code above.](http://i.stack.imgur.com/RyvEW.png)


title: Fixed marginpars with gray background in KOMA-Script

text: I am an newbie looking to achieve a sort of two column effect with my LaTeX report - I am using LaTeX `KOMA-script` as a base. I want my margin to appear in a different background color, (say) gray, and main text background is (say) blue and I want to put images, text, graphs and equations in this margin. These contents are synched with particular paragraphs, i.e. I don't want them floating around, just fixed with respect to particular paragraphs in the main text. So, how can I solve these two conditions? Again,   1. Different background color for main text and the margin contents. (See Similar questions panel in tex.stackexchange.com website)   2. Make the contents of the margin par stay fixed with respect to the paragraphs of main text. I have tried using a background image of two colors and stretching it across the entire page, but the effect is horrific... it does not align well with the main text and margins. Any suggestions are really welcome.


title: How to stack boxes like a vertical version of \mbox?

text: I would like a vertical equivalent to `\mbox{}` that somehow takes a sequence of boxes and stacks them on top of each other. I'd like the resulting width to be the width of the widest box, and I'd like it to have the following options:   * either no vertical space between the boxes or standard inter-line spacing   * left, right, or center alignment   * the baseline of the resulting box goes through one of the following:     * top: the baseline of the first box (like `\vtop`)     * middle: in the middle of the box     * bottom: the baseline of the last box (like `\vbox`) For example:               surrounding text     \fbox{\stack[align=rt]{something}{something else}{foo}}     surrounding text      would produce:                                +----------------+     surrounding text |      something | surrounding text                      | something else |                      |            foo |                      +----------------+      Does something like this already exist? If not, does anyone have any pointers about how to make it? **Edit:** I'm using LaTeX


title: Formatting – title with underline and box around paragraph

text: Can you help me please with formatting? I like this format: ![example formating](http://i.stack.imgur.com/alxsq.png) How can I define this title with grey underline (width of all page)? Font is sans serif (Arial). And how can I make grey box around some paragraph?


title: unicode-math breaks \DeclareMathOperator

text: # Problem Statement I'd like to introduce a new math operator (the divergence operator). Unfortunately the macro I'd like to use is already defined, so I "free" it using               \let\div\undefined      and declare the new operator               \DeclareMathOperator{\div}{div}      If I am using only `amsmath` everything works fine, but as soon as I add `unicode-math` everything breaks. # Implementation Consider the following MWE               \documentclass{scrartcl}\pagestyle{empty}     \usepackage{amsmath}     \usepackage{unicode-math}     \setmathfont{TeX Gyre Pagella Math}     \let\div\undefined     \DeclareMathOperator{\div}{div}     \begin{document}     \[ \int_V \div \vec{F} \, \mathrm{d}V = \oint_A \vec{F} \cdot \vec{n} \, \mathrm{d}A \]     \end{document}      # Output The output I get contains the output of the original `\div` macro. > ![real](http://i.stack.imgur.com/KY4gz.png) # Expected Output > ![expected](http://i.stack.imgur.com/YOe1X.png)


title: Make the boundary of markers more apparent in pgfplots?

text: I use pgfplots to draw a black-white array resembling `imshow()` in MATLAB. I use the following code (from Plot a matrix of real values with TikZ/PGF like imshow in matlab ) to do it               \begin{tikzpicture}[scale=0.3]         \begin{axis}[x=4mm,y=4mm,xtick=\empty,ytick=\empty,colormap={bw}{gray(0cm)=(0); gray(1cm)=(1)}]         \addplot[scatter,scatter src=explicit,                  only marks, mark=square*,mark size=2mm]                  table[x=x,y=y,meta=l] {datafile.txt};         \end{axis}     \end{tikzpicture}      But if the blocks are all black, the boundary line between them disappears. I want the boundary line to be more apparent. How can I do that? I have problem posing image, see ![enter image description here](http://i.stack.imgur.com/Y3WkQ.png) for an example.


title: What does the .def file do?

text: When downloading a new package and running               tex packagename.ins      you always get a bunch of files, including the `.def` file. It's also mentioned in the `.sty` file. Apparently it's a definition being used for something. What exactly is it for though? And can it be omitted when sharing the LaTeX project?


title: Off page connector using Tikz

text: I'm creating a flowchart using TikZ. You can see my code so far below. But now I want to create an off page connector: ![enter image description here](http://i.stack.imgur.com/47pkI.gif) I don't have a clue how to implement this in my `\tikzset`. Furthermore I want to create two flowcharts on one page, is this possible?   Lets say this flowchart below once on the right side of the page and once on the left side of the page. ## Code               \documentclass[border=2pt]{standalone}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows,shapes.multipart}     \usetikzlibrary{calc}          \tikzset{     %   offpageconnector/.style = {draw (1,0) -- (0,1) -- (-1,0) -- (0,-1) --     cycle, fill=orange!20},         decision/.style   = {diamond, draw, fill=orange!20, text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt},         block/.style      = {rectangle, draw, fill=blue!20, text width=5em, text centered, minimum height=1cm},         terminator/.style = {rectangle, rounded corners, draw, fill=blue!20, text width=5em, text centered, minimum height=1cm, node distance=3cm},         line/.style       = {draw, -latex'},         cloud/.style      = {draw, ellipse,fill=red!20, node distance=1.5cm, minimum height=2em},         subroutine/.style = {draw,rectangle split, rectangle split horizontal, rectangle split parts=3,minimum height=1cm, rectangle split part fill={green!50}},         connector/.style  = {draw,circle,node distance=3cm,fill=purple!20},         data/.style       = {draw, trapezium,trapezium left angle=70,trapezium right angle=-70,minimum height=1cm,node distance=3cm,fill=olive!20},         cloud/.style      = {draw, ellipse,fill=red!20, node distance=3cm, minimum height=2em}     }     \begin{document}     \begin{tikzpicture}[node distance = 2cm, auto]     \node [cloud] (start) {Start};     \node [block, below of=start,node distance=2cm] (init) {Init};     \node [block, below of=init,node distance=2cm] (1ebyteop) {$1^{e}$ byte ophalen};     \node [decision,below of=1ebyteop,node distance=2cm] (contreof) {EOF?};     \node [terminator, right of=contreof] (end1) {END};     \node [block, below of=contreof] (2ebyteop) {$2^{e}$ byte ophalen};     \node [decision,below of=2ebyteop,node distance=2cm] (contreof2) {EOF?};     \node [terminator, right of=contreof2] (end2) {END};     \node [subroutine, below of=contreof2, node distance=2cm] (sub1) {\nodepart{two} SUB1};     \node [subroutine, below of=sub1, node distance=2cm] (sub2) {\nodepart{two} SUB2};          % Draw edges     \path [line] (start) -- (init);     \path [line] (init) -- (1ebyteop);     \path [line] (1ebyteop) -- (contreof);     \path [line] (contreof) -- node {yes} (end1);     \path [line] (contreof) -- node {no}(2ebyteop);     \path [line] (2ebyteop) -- (contreof2);     \path [line] (contreof2) -- node {yes} (end2);     \path [line] (contreof2) -- node {no}(sub1);     \path [line] (sub1) -- (sub2);     \path [line] (sub2) |- ($(sub2.south west) - (0.7,0.7)$) |- (1ebyteop);     \end{tikzpicture}     \end{document}      ## Output ![enter image description here](http://i.stack.imgur.com/pQ2wk.png)


title: Vector fonts with UTF-8 support?

text: In fact the situation I find myself in is a bit more complicated than the question might suggest. I need to typeset a document with various accented characters and would like some hyphenation support for that. I know I need `T1` font encoding for that. Unfortunately, then I have to use a bitmap font by default, which is quite ugly... Can I force Computer Modern with `T1` or is there no way around? In the latter case, which vector fonts would you suggest? I am only marginally interested in `XeTeX` or `LuaTeX` solutions.


title: Remove dots & Page numbers from TOC

text: I am using example given here by @stephan TOC Section & Subsection coloring. Works great however I want to get rid of dots and page numbers. I added this to the preamble               \let\Contentsline\contentsline      \renewcommand\contentsline[3]{\Contentsline{#1}{#2}{}}      that removed the page numbers, but do not know how to remove the dots. I would appreciate your help. Its hard to get result without understanding the basics.


title: How to center align entries in the table of contents in ConTeXt?

text: In my table of contents, `part` is defined like this:               \setuplist[part][pagenumber=no]      I would like to center align the title of the part, so it appears like this in the table of contents:                __________     | Contents |     |          |     |  Part 1  |     | Ch. 1..1 |     | Ch. 2..5 |     | Ch. 3.10 |     |__________|      I have consulted the article about setuplist at the ConTeXt wiki, but I can see no options for horizontally aligning the entries.   * How can I center align the part entries in the table of contents?


title: Center Contents heading in tocloft v2.3f

text: In the past, I believe this technique was used to center the Contents heading in the table of contents via `tocloft`:               \documentclass{report}     \usepackage{tocloft}          \renewcommand{\cfttoctitlefont}{\hfill \Huge}     \renewcommand{\cftaftertoctitle}{\hfill}          \begin{document}          \tableofcontents          \chapter{Chap 1}     \chapter{Chap 2}     \chapter{Chap 3}          \end{document}      However I recently updated the package to version v2.3f (2013-05-02) and this no longer centers the heading. ![contents](http://i.stack.imgur.com/SvHex.png) How do I fix this? The answers for a related question do not work.


title: Creating a Matrixlist package

text: I haven't been able to find a suitable package that does what I want. The closest is `parcolumns` and I've spent several hours trying to understand TeX programming and the `parcolumns` style. While I got the most of it I've tried to tweak it and just can't get it to do what I want. I'm curious if anyone either knows of a package or can write one up quickly that does the following:   1. You give it a `\\\` terminated list just like enumerate and the number of columns;   2. It internally groups the list by number of columns. (a,b,c,d,e) with `columns=2` will be grouped as ((a,b,c),(d,e));   3. It then creates m rows (`\hbox`es, depending on the number of elements and column size). The nth row contains an `\hbox` of the nth element in each group. This creates a matrix > a d   >  b e   >  c   4. Each element in the row tries to distribute itself evenly along the horizontal BUT if on element overlaps the next it will "push" it INSTEAD of overlapping it (and this will continue until there is no need to push);   5. No gaps between rows AND no end gap on last column (so one has to get the width of the largest element in the last column and set the column size to that). The point here is we have a matrix of boxes BUT if the horizontal content of one box is larger than the space it is given it will simply shift the adjacent box over to make room for it BUT if not it will align in a distributed manner. Hopefully that makes sense and there is already a package that does this. With `parcolumns` I have two issues: When my elements are horizontally too large (even if just a little) they overlap the next column and I have to manually push that next element over (which may cause a chain reaction). * * *               \documentclass{article}     \usepackage{tikz}     \scrollmode               \begin{document}          \newcommand{\drawrect}[1]{\fbox{\begin{tikzpicture} \fill (-#1,-1) rectangle (#1,1);\end{tikzpicture}}}          \noindent\fbox{\hbox to \linewidth{%     \drawrect{1.5}\hspace*{\fill}\drawrect{1.5}\hspace*{\fill}\drawrect{1.5}\\}}     \fbox{\hbox to \linewidth{\drawrect{2}\hspace{0.2cm}\drawrect{1.5}\hspace{1.2cm}\drawrect{1.5}\\}}     \fbox{\hbox to \linewidth{\drawrect{2.5}\hspace{0.2cm}\drawrect{1.5}\hspace{0.2cm}\drawrect{1.5}\\}}     \fbox{\hbox to \linewidth{\drawrect{2.4}\hspace{0.4cm}\drawrect{1.5}\hspace{0.2cm}\drawrect{1.5}\\}}          \end{document}      ![enter image description here](http://i.stack.imgur.com/WiCqD.png) Here is an example situation   1. Note that the first element of row 3 "pushes" or overlaps into the 2nd element of row.    2. This causes the 2nd element to be offset by some amount (user specified). The 3rd element does not change positions though.   3. In row 4, the first element is slightly smaller BUT note that the 2nd element is aligned with the one right above it BECAUSE it snaps to that position to for visual reasons.   4. Also, if you were to add a fixed amount of whitespace to each element in the last column then you would end up causing problems (depends on how you set it up though). I want to remove this issue. To fix it we basically have to remove the whitespace so that at least one element in the last column has no whitespace. Hence we just "substract" the appropriate amount of whitespace from all columns and then at least one will have no whitespace. Note that this is only for calculating the column spacing. Essentially we just compute (`\linewidth` + x)/#columns where x is the smallest amount of whitespace from the set of cells in the last column. This effectively increases the `\linewidth` by the unused whitespace in the last column.


title: How to magnify pre-selected text?

text: I want to be able to magnify (by say 2X) a group of equations in the output of PDFLaTeX by a single click on the box containing them. A second click is to revert to the previous state. The viewer is Adobe Reader.


title: Authors in amsart

text: Is there any way of having a nicely formatted authors section in `amsart`? By nicely formated I mean something like here: ![](http://i.stack.imgur.com/cC3bx.png)


title: TikZ editor for Mac OS

text: I'm looking for an editor like tikzedt for Mac OS X. Or something similar in order to write and see quickly the result. Any suggestion ?


title: How can I fix overflowing tables?

text: I'm writing in markdown, and converting to PDF (via latex) using pandoc. It handles the conversion excellently, with the exception of tables, which overflow to the right of the page. ![enter image description here](http://i.stack.imgur.com/wN9us.png) Is there an easy way of fixing this, whether in the mardown or in latex?


title: Adding words to lstlisting for Python langaue

text: I wish to add a few keywords to some python code inserted into a latex document. I want to make 'True' & 'False' appear yellow and also some module calls such as 'ttk' appear red. I have tried using the morekeywords call, however, it is not working for me. Below is my LaTeX code:               \newcommand\pythonstyle{\lstset{     language=Python,     basicstyle=\ttm,     otherkeywords={self},                  keywordstyle=\ttb\color{deepblue},     morekeywords={ttk}     emph={MyClass,__init__},               emphstyle=\ttb\color{deepred},         stringstyle=\color{deepgreen},          showstringspaces=false                 }}


title: \fullcite not working as it should

text: I'm trying to make the code of the following post work: How to make a bib entry appear also in the main document but I get some thing that I don't expect: ![enter image description here](http://i.stack.imgur.com/YxWds.png) I'm using the default TeXShop command: `pdflatex --file-line-error --synctex=1`. I also tried to run `bibtex`, but I get the following message:               This is BibTeX, Version 0.99d (TeX Live 2012)     The top-level auxiliary file: test.aux     I found no \citation commands---while reading file test.aux     I found no \bibdata command---while reading file test.aux     I found no \bibstyle command---while reading file test.aux     (There were 3 error messages)      **EDIT** This is the code:               \documentclass[12pt]{article}     \usepackage[utf8]{inputenc}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @book{auth1:2000,     title = {A book},     author = {A. Thor},     date = {2000},     publisher = {Some Company},     location = {A City}     }     \end{filecontents}          \usepackage[backend=biber,]{biblatex}     \bibliography{\jobname.bib}          \begin{document}          \fullcite{auth1:2000}     \cite{auth1:2000}          \printbibliography     \end{document}       which is clearly wrong as I'm citing in the test. What's wrong?


title: How can I create a rectangle that is split vertically in tikz?

text: In tikz, a `rectangle split` node is split horizontally. According to a comment by Mark Wibrow on 2008-04-21, it is possible to create rectangle nodes that are split vertically. However, I can't find how to do that in the tikz manual or in the online examples. Does sm here know how to do this?


title: error with LuaLaTeX, lstinputlisting and an extension-less file

text: I'm having troubles with LuaLaTeX and the `listings` package: the former doesn't seem to accept me performing `\lstinputlisting` on a filename that doesn't have an extension. Minimal example: `Makefile`:               hello: hello.c         cc -o hello hello.c      `test.tex`:               \documentclass[a4paper]{article}     \usepackage{listings}     \begin{document}     \lstinputlisting{Makefile}     \end{document}      pdfLaTeX is successful, LuaLaTeX displays the following error:               ! Package Listings Error: File `Makefile(.tex)' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: tex)          Enter file name:      I'm using the freshest versions from TeXLive 2012 (pdfTeX 3.1415926-2.4-1.40.13, LuaTeX beta-0.70.2-2012052410). What's the trouble?


title: Getting divided bibliography with Biblatex

text: I'm writing my thesis in LyX using Biblatex. Would it be possibly to get an output bibliography that is subdivided into one section with the work of my main subject (Wittgenstein) referred to with abbreviations of his works and another section with other authors referred to authoryear-style? **EDIT:** I've managed to get my bibliography subdivided with this:               \printbibheading     \printbibliography[heading=subbibliography,title={Works by Wittgenstein},keyword=witt]     \printbibliography[heading=subbibliography,title={Works by others},notkeyword=witt]      Two questions remain: **1.** Would it be possible to have abbreviated titles listed in the first division of the bibliography (as it is convention in my field) - like this: ![enter image description here](http://i.stack.imgur.com/j2Mrj.png) **2.** If thats not possible, is there a way to add the abbreviated title as some of the data displayed in the bibliography in away akin to the "Referenced in the text as xxx" in this: ![enter image description here](http://i.stack.imgur.com/VRc5f.png)


title: How to change font size of all text in a table?

text: Hi I am trying the following code but only the first row (the headings) is being changed to the specified font size. How can I make the whole table's font size change?               \begin{table}[!htbp]     \fontsize{11}{9}     \centering     \begin{tabular}{p{2cm} | p{2cm} | p{2cm}}     \hline     \hline     \Result 1 & Result 2 & Result 3 \\ [0.2ex]      \hline     22 & 34 & 12\\      \hline     65 & 43 & 55\\      \hline     42 & 76 & 23\\ [1ex]      \hline     \end{tabular}     \end{table}


title: How can I do numbering with a hanging indent to the left into the page margin?

text: I am compiling some solutions to textbook exercises, and I am trying to do so in the style of the book. The way the book does it is that the body of each exercise appears unindented, left-aligned, where one would expect it to be, at the left margin, but the number for the problem is right-aligned to the left of that. An impression of the result is this:                    This is the left margin.            1. This is the first problem.                 This is the first paragraph of the first solution, which has a normal first-line          indent.            This is the second paragraph of the first solution...                 This is a new paragraph following a line break, still in the first solution.                 This is the second page of the first solution.            2. This problem follows.          ...      10. This is the tenth problem.      I would be equally happy with the following:               This is the left margin.           1. This is the first problem.           2. This problem follows.          ...     10. This is the tenth problem.      The numbers are in boldface and wrap around every chapter (so there are multiple 1's, 2's, etc.), and solutions are (to be) typed in between.


title: 3d plot of a surface with nonrectangular domain

text: I need to make a 3D plot of a step function For example, suppose that I want to plot the function f:[0,1]x[0,1]->[0,1] given by: f(x,y) = 1 if x < y^2 and f(x,y) = 0 otherwise I would like to use a LaTeX solution (preferably pstricks, but tikz is fine) instead of importing a figure from Asymptote I couldn't find a solution using pst-3dplot, is there a package with a pre- build solution to plot his kind of functions?


title: How to use a counter inside \titleformat in LaTeX?

text: I am writing a text in LaTeX and I want my `\paragraphs` to be numerated. I am using package `titlesec` and the following sentences:               \newcounter{artNumber}     \setcounter{artNumber}{1}          \titleformat{\paragraph}[runin]         {\normalfont}         {}{1em}{\textbf{Article\value{artNumber}} }      So that when I type something like this:               \paragraph{A long time ago, in a galaxy far, far away...}      I want it to become this:               Article 1 A long time ago, in a galaxy far, far away...      I see the word **Article** showing in the PDF, but the number is missing. How can I get it working?


title: biblatex: "Apalike" LaTeX usin & instead of and

text: **Intro** I am currently writing a report on my local language. The usage of "and" in my reference list is not preferable and I would like to use "&" instead of "and" such that the reference list and cite will display with "&" not "and". I tried manually changeing all "and"s to "\&" in my .bib file. However, this did not solve the problem as the authors suddenly showed up wrong. I am not sure why this happened but I know that it was interpreted wrong. I have following in my master file:               \usepackage{hyperref}     \usepackage{natbib}     ...     \bibliographystyle{apalike}      **Question:** Is it possible to change the reference list such that all "and"'s are interpreted as "&" and displayed as such while maintaining "and" in the .bib file?


title: How to add a regression line to randomly generated points using pgfplots in Tikz?

text: \documentclass{article}     \usepackage{tikz}     \usepackage{color}     \usepackage[active,pdftex,tightpage]{preview}     \usepackage{pgfplots}     \usepackage{pgfplotstable}          \begin{document}          \begin{tikzpicture}     \begin{axis}[     xlabel=Weight (kg), % label x axis     ylabel=Height (cm), % label y axis     axis lines=left, %set the position of the axes     xmin=40, xmax=105, % set the min and max values of the x-axis     ymin=150, ymax=200, % set the min and max values of the y-axis     ]     % add main points     \pgfmathsetseed{1138} % set the random seed     \addplot[only marks, samples=30, domain=42:100] % show marks, set no. of samples and set the domain of the points     {(0.6*x+130)+5*rand}; % equation of the points          \end{axis}          \end{tikzpicture}     \end{document}


title: package textpos gives Runaway argument error

text: I am trying to position images in order to make a "stamp" pdf for use with pdftk. textpos looks like the perfect solution, but this code gives errors and no output:               \documentclass[a4paper]{article}     \usepackage[absolute,verbose]{textpos}     \usepackage[pdftex]{graphicx}     \setlength{\TPHorizModule}{1mm}     \setlength{\TPVertModule}{1mm}     \pagestyle{empty}     \begin{document}     \begin{textblock}{210}{20,55}      Pictures should have been here     \includegraphics[scale=0.5]{EAmerke_sort.pdf}     \includegraphics[scale=0.5]{code.pdf}     \end{textblock}     \end{document}      pdflate says: Runaway argument? 0]{20,55} Pictures should have been here \includegraphics [scale=0.5]\ETC. ! File ended while scanning use of \TP@textblock. \par


title: Fonts: achieving a clean look of the math

text: With `dsfonts`, the square roots don't have the thick bold top bar on some of the symbols as with `pxfonts`, but with `pxfonts`, the `\int` and the other forms `\iint` all appear vertical whereas with only `dsfonts` `\int` in angled. Is there a way to achieve the square root look of `dsfonts` and the treatment of `\int` of `pxfonts`? `dsfonts` alone: (notice the integrals but the square roots is cleaner) ![enter image description here](http://i.stack.imgur.com/6bz68.png) `pxfonts` alone which also causes errors: (notice the square root but the integrals match) ![enter image description here](http://i.stack.imgur.com/yO6MK.png) **both fonts:** ![enter image description here](http://i.stack.imgur.com/1mZEH.png)


title: How to change kerning around ( glyph with lualatex?

text: Inspired by An example of changing kerning of a font in LuaLaTeX I decided to try to change the kerning for some letter combinations together with parentheses which have been bothering me in my favorite font. However, what to me seemed like the obvious approach did not work. Further testing made me realize that the font did not matter my approach did not work no matter what font. So, my guess is that the `\\(` is not the right way but what is? ## bonum.fea               languagesystem DFLT dflt;     languagesystem latn dflt;     feature kern {     pos \( \j 1000;     } kern;      ## example.tex               \documentclass[11pt,article,oneside]{article}          \usepackage{fontspec}     \begin{document}     \setmainfont[FeatureFile=bonum.fea]{TeX Gyre Bonum}     (j)     \end{document}      Result: ![enter image description here](http://i.stack.imgur.com/rnhsI.png)


title: Problem with references! Need to line-break urls

text: I am writing a paper and I have already added the references through bibtex. There is something I don't like about the online references, they get to stretched out, from one side of the page to the other. And the online link gets out of the borders of the page. Check the attached picture to understand what I mean. [3] is the problem ![enter image description here](http://i.stack.imgur.com/RGjed.png) this is the bibtex code I use for that reference. Any solution? Suggestions?               @misc{domination,     Title = {Heterogeneous Systems Dominate the Green500},     Author = { },     Howpublished = {\url{http://www.hpcwire.com/off-the-wire/two-brains-better-one-heterogeneous-systems-dominate-green500/}},     Month = nov,     Year = {2013},     Url = {http://www.hpcwire.com/off-the-wire/two-brains-better-one-heterogeneous-systems-dominate-green500/}}


title: glossaries and phantom

text: I am trying to align my symbols in a glossary with `\phantom`. However when I try to do so, I get the following error (`line 10` is the line where the definition of `nc:line:num` ends(closing brace)):               ! Incomplete \iffalse; all text was ignored after line 10.      near MWE:               \documentclass{report}          \usepackage[sanitize=none]{glossaries}          \makeglossaries%          \newglossaryentry{nc:line:num}{         name=thing,         symbol=\ensuremath{\phantom{\#}l},         description=other thing}     \newglossaryentry{nc}{         name=thingy,         symbol=\ensuremath{\#l},         description=something}               \usepackage{glossary-mcols}                \begin{document}         \printglossary[style=altlong4col]         asd         \clearpage%         nc:line:num glossary entry '\gls{nc:line:num}` \gls{nc}     \end{document}      **Background:** I have symbols that usually exist in two versions as `symbol` and as `#symbol`, therefore i would like to align in the following way:                symbol     #symbol      other     #other      rather than               symbol     #symbol     other     #other      **Note:** `sanitize=none` is used because I reference entries from another glossary, see this awnser