title: How to find the ratio of a length command (e.g., \textwidth) to a reference value (e.g., 6cm) ?

text: How to find the ratio of a length command (e.g., `\textwidth`) to a reference value (e.g., `6cm`) ? Actually I want to use the ratio for the `\scalebox` argument, e.g., `\scalebox{<ratio>}`.               \documentclass{article}     \usepackage[showframe=true]{geometry}     \usepackage{pst-node}     \usepackage{graphicx}          \usepackage{fp}     \usepackage{pgf}     \pgfmathsetmacro{\ratio}{\the\textwidth/(6cm)}          \makeatletter       \FPdiv\thecm{6}{2.54} %72.27       \FPmul\thecminpoints{\thecm}{72.27}       \FPdiv\thescale{\strip@pt\textwidth}{\thecminpoints}%     \makeatother          \begin{document}     \noindent%     %\scalebox{\thescale}{%     \scalebox{\ratio}{%     \begin{pspicture}(6,4)     \pnode(2,2){A}\psframe(A)     \pnode(4,2){B}\pscircle(B){2}     \end{pspicture}}     \uput[-135](A){$A$}     \rput(B){$B$}     \end{document}      ![alt text](http://i.stack.imgur.com/nTCZt.png)


title: Extra line after the paragraph ended by dash with overfull

text: Consider the following example (Plain TeX):               %%%%%          Tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt-          Test.          \end          %%%%%      The first line produces a paragraph ended by dash with (small) overfull. For some strange reason TeX leaves an extra (empty) line after this paragraph (with corresponding "Underfull \hbox (badness 10000)" message in log file). Any explanations of such behaviour? TIA


title: Footnote on graph title

text: I'd like to add a footnote to the graph title. After adding the footnote, it disappears! Here is my `MWE`:               \documentclass{article}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}          \pagestyle{empty}     \usetikzlibrary{patterns}          \begin{document}     \begin{tikzpicture}     \begin{axis}     [         axis lines*=left,         title=Histogram of S\&P 500 CEOs Past Experience \footnote{Hey, where are you?},         xbar,         width=8cm,         height=5cm,         xlabel={},         symbolic y coords={Sales, Marketing, Finance, Operations},         ytick=data,         xmin=0,         xmax=0.5,          nodes near coords,         nodes near coords align={horizontal}         ]            \addplot     [draw=blue,pattern=horizontal lines light blue]      coordinates          {(0.17,Sales)  (0.24,Marketing) (0.31,Finance) (0.42,Operations)};     \end{axis}     \end{tikzpicture}     \end{document}      Any help?


title: Building labels out of counters

text: There is a simple version to my question, and a complex version. First, the simple version: I want to generate label names by combining a constant string with a counter's value, something like what is done here: http://tug.org/pipermail/texhax/2006-July/006599.html               \newcommand{\addnextlabel}{\stepcounter{foo}\label{bar:\arabic{foo}}}      But when I use this, I get a bunch of warnings about multiply-defined labels. It appears they are all getting named the same thing, using the highest value of counter foo. I guess this has to do with the order TeX evaluates things, as suggested by the answer in the link above. Can anyone do a better job explaining this than the response there? Now the more complex problem, and what I'm really trying to solve: I'm using the lineno package, which has a `\linelabel` command that works much like `\label`. You can get the label's line number using `\ref{labelname}`. It's these labels I really want to number with a counter. I tried applying the linked solution to `\linelabel`, but I couldn't get it to work. Any ideas how I might do this?


title: Change bibliography style to show up at the end of each chapter in book

text: I would like to have a bibliography at the end of each chapter in my book report, but I keep getting errors. I would like to change the bibliography style that I currently have:               \usepackage[style=alphabetic,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}     \addbibresource{bibliography.bib}      \defbibheading{bibempty}{}"      to the normal one that resembles:               \begin{thebibliography}{1}          \bibitem{notes} John W. Dower {\em Readings compiled for History     21.479.}  1991.     \end{thebibliography}       ![enter image description here](http://i.stack.imgur.com/HkihV.png) Here is the code that I am trying to get the bibliography at the end of each chapter:               \documentclass[11pt,fleqn]{book}           \usepackage[top=3cm,bottom=3cm,left=3.2cm,right=3.2cm,headsep=10pt,a4paper]{geometry}           \usepackage{xcolor}      \definecolor{ocre}{RGB}{243,102,25}           \usepackage{avant}      \usepackage{times}     \usepackage{mathptmx}           \usepackage{microtype} % Slightly tweak font spacing for aesthetics     \usepackage[utf8]{inputenc} % Required for including letters with accents     \usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs     \usepackage{calc} % For simpler calculation - used for spacing the index letter headings correctly          \usepackage[style=alphabetic,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}     \addbibresource{bibliography.bib}      \defbibheading{bibempty}{}     \usepackage{calc}      \usepackage{makeidx}      \makeindex          \begin{document}               \chapter{Text Chapter}          \section{Paragraphs of Text}\index{Paragraphs of Text}          Test               \section{Citation}\index{Citation}          This statement requires citation \cite{book_key}; this one is more specific \cite[122]  {article_key}.               \section{Lists}\index{Lists}          Lists are useful to present information in a concise and/or ordered way\footnote{Footnote example...}.          \subsection{Numbered List}\index{Lists!Numbered List}          \begin{enumerate}     \item The first item     \item The second item     \item The third item     \end{enumerate}          \subsection{Bullet Points}\index{Lists!Bullet Points}          \begin{itemize}     \item The first item     \item The second item     \item The third item     \end{itemize}          \chapter*{Bibliography}     \addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}}     \section*{Books}     \addcontentsline{toc}{section}{Books}     \printbibliography[heading=bibempty,type=book]     \section*{Articles}     \addcontentsline{toc}{section}{Articles}     \printbibliography[heading=bibempty,type=article]      %---------------------------------------------------------------------------------------- % CHAPTER 2 %----------------------------------------------------------------------------------------               \chapter{Text Chapter}     Test 2     \section{Paragraphs of Text}\index{Paragraphs of Text}          Test          \chapter*{Bibliography}     \addcontentsline{toc}{chapter}{\textcolor{ocre}{Bibliography}}     \section*{Books}     \addcontentsline{toc}{section}{Books}     \printbibliography[heading=bibempty,type=book]     \section*{Articles}     \addcontentsline{toc}{section}{Articles}     \printbibliography[heading=bibempty,type=article]          \end{document}      I would like to move away from this bibliography format to the the simple method one. Any help will be greatly appreciated. Thanks.


title: How to use texmaker with Sweave?

text: I've tried to use Sweave with texmaker but it doesn't work. I go to the menu "R Sweave", I push the button "->" and texmaker creates a wrong latex file with a lot of "NA". When I try to do pdflatex with this latex file, I have a lot of errors. If I do the same in the terminal; that is, if I do: R CMD Sweave file.Rnw pdflatex file.tex all works fine. So my question is: how can I do it using the menus of the texmaker?


title: Golden spiral in TiKZ: how do I get the right shape and background?

text: I want to use `tikz` to draw a golden spiral, growing clockwise, ideally (but not necessarily) superimposed over a set of golden rectangles (you all know the image I'm talking about). A little bit of searching led me to this code, which yields a counterclockwise spiral:               \documentclass[tikz]{standalone}     \usetikzlibrary{decorations.markings,calc}     \tikzset{nctopath/.style={          to path=(\tikztostart) ..controls ($(\tikztostart)!1cm*#1!-90:(\tikztotarget)$) and              ($(\tikztotarget)!($(\tikztostart)!1cm*#1!-50:(\tikztotarget)$)!70:    (\tikztostart)$)..          (\tikztotarget)         },     }     \begin{document}         \begin{tikzpicture}     \def\totx{1}     \coordinate (n-1-1) at (0,0) {};     \foreach \x[count=\xi from 2, evaluate=\x as \temptotx using int(\x+\totx)] in {1,...,9}{     \draw[decoration={         markings,mark=between positions 0 and 1 step 0.249 with {                 \coordinate (n-\x-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number})     ;             }        },postaction=decorate     ]      (n-\x-1) arc (\x*90+180:(\x+1)*90+180:{(\temptotx)*3mm})      coordinate (n-\xi-1)      \pgfextra{\xdef\totx{\temptotx}};     }          \end{tikzpicture}     \end{document}      The thing is that I'm still new to `tikz` and thus not sure what code here does what. My questions are:   1. How do I reverse the growth direction?   2. How do I set phi as the growth factor (which I don't think it is currently, just from looking at the resulting spiral)?   3. How cumbersome would it be to add in the golden rectangles (i.e., would I have to draw each one individually, or is there some way to define a pattern)?


title: How to plot data from a CSV file using tikz and csvsimple?

text: Here is a minimal example :               \begin{filecontents*}{data.csv}     a,b,c,d     1,4,5,1     2,3,1,5     3,5,6,1     4,1,4,9     5,3,4,7     \end{filecontents*}          \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{csvsimple}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}     \draw plot coordinates {%     \csvreader[head to column names]{data.csv}{}{(\a,\b) }     };     \end{tikzpicture}     \end{document}      The command `\csvreader[head to column names]{data.csv}{}{(\a,\b) }` extracts coordinates (columns a and c) from the CSV file `data.csv` :               (1,4) (2,3) (3,5) (4,1) (5,3)      And yet, it seems that I can't plot the points above using `tikz` :               Package tikz Error: Cannot parse this coordinate      Any idea ?


title: Calculate numerical value for node text in TikZ

text: I am using a `tikzpicture` environment to draw a Temperature v composition plot. I do not have exact data so am only mimicking it. I am aware that I could/should use `pgfplots` but the issue could be instructive... I draw two axes of length 10 units each (from 0-10) and I want to synthesize axes ticks at certain points on these axes. I want to automatically calculate a numerical value and put it in the `node` text. The actual calculation for the temperature is `T=272.5+2.5*\y` For the composition, it is `\upchi=0.1*\x` I understand how to do a `node` `position` calculation but not how to calculate a numerical value to put into the `node` `text`. I can do it manually as in the code following:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{upgreek}     \usepackage{siunitx}     \begin{document}      \begin{tikzpicture}     \draw[step=0.1cm,black!10,very thin] (-0.1,-0.1) grid (10.2,10.2);%setting up grid and axes     \draw[step=1cm,black!50,help lines] (-0.1,-0.1) grid (10.2,10.2);     \draw[thick,->] (0,0) -- (10.2,0);     \draw[thick, ->] (0,0) -- (0,10.2);     \foreach \x in  {0,1,...,10}     \draw[thick] (\x,-2pt) -- (\x,2pt);%drawing tick marks     \foreach \x in  {0,2,...,8}     \draw node at (\x,-10pt) {$0.\x$};% attempt to write node of 0.2, 0.4 etc     %\foreach \x in {0,2,...,10}     %\draw node at (\x, -10pt) {$(0.1*\x)$}; % what I thought I could do...     %\foreach \y in {1,3,...,9}     %\draw node at (-15pt,\y) {$(2.5*\y+272.5)$}; % what I thought I could do...     \draw node at (10,-10pt){$1.0$};     \draw node at (9,-25pt) {Mole Fraction $\upchi_{NB}$};     \draw node at (-15pt, 1) {275};     \draw node at (-15pt, 3) {280};     \draw node at (-15pt, 5) {285};     \draw node at (-15pt, 7) {290};     \draw node at (-15pt, 9) {295};     \draw node at (-40pt, 5)[rotate=90]{Temperature[$\si{\celsius}$]};     \draw node at (5,3.2){2 Phases};     \draw node at (1,6.2)[rotate=0]{1 Phase};     \draw node at (9,7.2)[]{1 Phase};     \foreach \y in {0,1,...,10}     \draw[thick](-2pt,\y) -- (2pt,\y);     \draw[very thick] plot[smooth] coordinates{(0.5,0) (2,5)(4,8) (6,9)(7,8.5)(8.5,5)(9,0) };     \end{tikzpicture}     \end{document}


title: How to get a big table on a page with pagestyle empty?

text: In my document I have a table that is quite big. I would like to have this table on a page with no header and no page number. How can I get this table on a `\thispagestyle{empty}`? Using it withing the table or tabular environment makes the page were the float is defined go empty and leaves the headers on the table. For if it matters, I am using `fancyhdr`.


title: How to end an unnumbered subsection?

text: I cannot find a way to end an unnumbered subsection. I either have an unnumbered subsection `\subsection*{}` with no end or an environment               \begin{subsection}       This is some arbitrary content.     \end{subsection}      that is numbered. Here is a MWE:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{amsthm}     \newtheorem{theoreme}{Théorème}     \begin{document}       \section{First section}          \subsection*{Unnumbered subsection}       Here comes some content that should be in First section but not in the Unnumbered subsection       \begin{theoreme}       This is some arbitrary content. the theoremes number should correspond with the First section but not with the "Unnumbered subsection".       \end{theoreme}       \section{Second section}     \end{document}      The question is how to make everything comming before the Second section but after the Unnumbered subsection not part of the Unnumbered subsection.


title: Why use the control sequences \bigl, \biggl, \bigr or \biggr, as I can always use \big or \bigg?

text: If my manuscript file has               $$\biggl({\partial^2\over \partial x^2}+        {\partial^2 \over \partial y^2}\biggr)\bigl|\varphi(x+iy)\bigr|^2 = 0$$      **or**               $$\bigg({\partial^2\over \partial x^2}+       {\partial^2 \over \partial y^2}\bigg)\big|\varphi(x+iy)\big|^2 = 0$$      the result will be the same : ![enter image description here](http://i.stack.imgur.com/bxohK.png)


title: Paralist with alwaysadjust

text: I want to align elements in an itemization list such that no item label uses part of the page margin. I am using the paralist package for this. However, the item indentation is not right in all cases:               \documentclass{article}          \usepackage{pxfonts}     \usepackage{paralist}     %\usepackage[alwaysadjust]{paralist}          \begin{document}     \noindent          \section{Complexity classes}          Please note that the following list of complexity classes is not      only important, but also contains no information about them.          \begin{itemize}     \item[\textbf{PTIME}:] A complexity class     \item[\textbf{NP}:] Yet another complexity class     \item[\textbf{PSPACE}:] Guess what...     \end{itemize}          \section{Questions}          \begin{enumerate}       \item Where are the other complexity classes?       \item Perhaps this document does not need them?     \end{enumerate}          \end{document}      ![How things look like now but should not](http://i.stack.imgur.com/0O5U3.png) The problem seems to be that there is a minimum label width for which the _NP_ label is smaller. Without the _pxfonts_ package, the problem would not occur. Now one could use the " _alwaysadjust_ " option to paralist, but then the file does not compile anymore. Using the " _olditem_ " option to paralist would make the list labels extend into the page margin. So how to I align the _NP_ element properly?


title: How to make e in e^x written upright and why \me^x does not work?

text: I'd like to write `e^x` in LaTeX math mode where the `e` is written upright, rather than slanted, to indicate that it is not a variable. Kopka and Daly (4ed) pg. 285 do this with `\me^x`. When I try this I get the "undefined control sequence" error. Q: Is `\me` a deprecated command? Q: How can I do now what `\me` used to do?


title: Tikz: define label font size under the node

text: I create a picture of array which consists of nodes. I wonder how I can set the font size for the label which is below every cell (for example make it as `scriptsize`). This are my definitions:               \def\cells#1#2#3#4#5#6#7{       \foreach [count=\i from 0] \j  in {1,...,#1} {         \node[cell,label=below:\i] (cell\i) at (\i*0.5,0) {};       }     }          \tikzset{       cell/.style = {draw, minimum width=0.5cm, minimum height=0.5cm, minium size = 0.5cm}     }      ![enter image description here](http://i.stack.imgur.com/hClY6.png)


title: Distances between nodes, nodes and arrows

text: I started using Tikz, took a sample of a code and tried to do my own. I'm almost there but I'm struggling on a couple of things.   First, here is my code:               \documentclass{article}       \usepackage{tikz}       \usepackage{amssymb}     \usetikzlibrary{arrows}       \begin{document}            \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.5cm,                       thick,main node/.style={rectangle,draw,font=\sffamily\Large\bfseries}]            \node[main node] (1) {1};       \node[main node] (2) [below of=1] {2};        \node[main node] (3) [below of=2] {3};        \node[main node] (4) [right of=1] {$\varnothing$};       \node[main node] (5) [right of=2] {$\varnothing$};       \node[main node] (6) [right of=3] {$\varnothing$};            \path[every node/.style={font=\sffamily\small}]       (1) edge node [left] {$p_1$} (2)           edge node [above] {$1-p_1$} (4)       (2) edge node [left] {$p_2$} (3)           edge node [above] {$1-p_2$} (5)       (3) edge [bend left] node [left] {$p_3$} (1)           edge node [above] {$1-p_3$} (6);     \end{tikzpicture}       \end{document}      ![enter image description here](http://i.stack.imgur.com/Qdj56.jpg) What I would like to change is:   1/ get rid of the rectangle on the empty set nodes   2/ the arrow with p3 on, make it rectangular. Is it possible to adjust how far away it goes on the left to ensure it doesn't clash with something else?   3/ change the distance between the number 1, 2, 3 with the empty set nodes. So basically, expand it to the right. If anyone could explain me how to change any/all of them, that'll be great!   Cheers


How to save a figure with multiple sub floats to a single pdf file. Here is the code:               \documentclass[12pt]{article}     \usepackage[percent]{overpic}          \begin{document}          \begin{figure}\centering     \begin{overpic}[width=0.49\textwidth]{pic.png}     \put(50,26){\textbf{A}}     \end{overpic}     \begin{overpic}[width=0.49\textwidth]{pic.png}     \put(50,26){\textbf{B}}     \end{overpic}     \begin{overpic}[width=0.49\textwidth]{pic.png}     \put(50,26){\textbf{C}}     \end{overpic}     \begin{overpic}[width=0.49\textwidth]{pic.png}     \put(50,26){\textbf{D}}     \end{overpic}     \begin{tabular}{|c|c|}     \hline test & test \\      \hline  &  \\      \hline      \end{tabular}      \caption{\label{fig-p1} caption.}     \end{figure}          \end{document}      This is what it produces: ![enter image description here](http://i.stack.imgur.com/E3IJf.png) I want to save the figure in the red square into a single pdf file (without white margins) e.g. fig1.pdf. Then next time, I can only include fig1.pdf instead of so many sub floats:               \begin{figure}\centering     \includegraphics{fig1.pdf}     \caption{\label{fig-p1} caption.}     \end{figure}      I ask this because many journals ask you to submit figures separately from the main text. Any help would be much appreciated. Here to download the text files: https://dl.dropboxusercontent.com/u/45318932/test.zip


title: Changing to a custom font in LaTeX?

text: I'm using the following template from ShareLaTeX. I would like to improve the template by adding another custom font and a different chapter heading like in this other template. How can I do that?


title: Equal horizontal margins in memoir and article class - not equal if you get out the ruler

text: I am trying to get equal horizontal margins in a memoir class document. But I can't get the margins to be exactly equal, and this problem doesn't seem to be limited to the memoir class. All of the following MWEs have the same problem (described in more detail below). [1] `memoir` class using `memoir`'s layout macros               \documentclass[letterpaper,oneside,openany]{memoir}     \setlrmarginsandblock{1.25in}{1.25in}{*}      \setulmarginsandblock{1in}{1in}{*}     \checkandfixthelayout          \usepackage{lipsum}     \usepackage{showframe}     \begin{document}     \lipsum[1-20]     \end{document}      [2] `memoir` class using `geometry`'s layout macros               \documentclass{memoir}     \usepackage[paper=letterpaper,%       hmargin=1.25in,%       vmargin=1.0in,       showframe]{geometry}     \usepackage{lipsum}          \begin{document}     \lipsum[1-20]     \end{document}      [3] `article` class using `geometry`'s layout macros               \documentclass{article}     \usepackage[paper=letterpaper,%       hmargin=1.25in,%       vmargin=1.0in,       showframe]{geometry}     \usepackage{lipsum}          \begin{document}     \lipsum[1-20]     \end{document}      When I print the pages (on US Letter size paper) and check margins with a ruler, they are not exactly 1.25 inches. On one page, the left margin is a little more than 1.25 inches (~1/16 - 1/32 of an inch) and the right margin is a little less than 1.25 inches. On the next page, the reverse is true (left margin is a little less, right margin a little more). And this alternating pattern continues throughout the document. These unequal margins also cause another problem: Page numbers in the footer which should be horizontally centered on the page are not actually centered. They move a little bit to the left or right on alternating pages. In the `memoir` class, I generate page numbers with a `pagestyle`:               \makepagestyle{haspagenum}       \makeevenfoot{haspagenum}{}{\thepage}{}       \makeoddfoot{haspagenum}{}{\thepage}{}      This behavior is not caused by the printer. It's in the actual pdf. (Someone else with a copy of the pdf was the first to notice it.) I am using `latexmk` and the following command to make the pdfs:               latexmk -xelatex -pdf filename.tex      But the problem remains when I use `pdftex` instead of `xetex` to make the pdf:               latexmk -pdf filename.tex      And I am (still) using TeXLive 2013 as the TeX distribution.


title: legend transparency in pgfplots

text: I want to have a legend in `pgfplpot`s such that it overwrites grid lines (i.e. grid lines are erased where the legend is placed) but not the axis (i.e. axis are drawn on top of legend, in case legend box is extended that far). Right now, I set `fill=none`in legend style; it does not interfere with axis but grid lines and legend are both shown on top of each other. Thanks!


title: Beamer block title background image?

text: With the following command I can change block title background color:               \setbeamercolor{block title}{bg=blue!20,fg=black}      How can I instead have a background image for the block title? (I'm thinking of tiling an image to create a nicer look)


title: TeXworks doesn't recognize environment variables (Linux Mint 17 KDE)

text: The bottom line is that TeXworks doesn't recognize my environment variables, but the command line compile commands (pdflatex and bibtex) do just fine. I'm running Linux Mint 17 KDE, and I installed texlive-full and texworks through the package manager. I use Dropbox, and share files with others, so it's crucial to collect files in other, central locations (e.g. a .bib file that is used by many projects). On a previous machine, running Mint 13, the solution was to set the environment variables TEXINPUTS, LATEXINPUTS, BIBINPUTS, and BSTINPUTS by putting these four lines into my .bashrc file:               export TEXINPUTS=".//:/home/my_user_name/Desktop/Dropbox/latex_files/tex//:$TEXINPUTS"     export LATEXINPUTS=".//:/home/my_user_name/Desktop/Dropbox/latex_files/tex/latex//:=:$LATEXINPUTS"     export BSTINPUTS=".//:/home/my_user_name/Desktop/Dropbox/latex_files/bibtex/bib//:$BIBINPUTS"     export BIBINPUTS=".//:/home/my_user_name/Desktop/Dropbox/latex_files/bibtex/bst//:$BSTINPUTS"      This worked perfectly on my old system. But now, TeXworks doesn't seem to find these paths. However, I know the environment variables are being set properly, because if I use the command line tools (pdflatex and bibtex) everything works perfectly. I searched around, and couldn't find this exact issue. The closest was this question: TeXworks doesn't see packages installed by tlmgr. But that wasn't helpful. As suggested in that thread, I tried compiling from TeXworks a one line file containing \RequirePackage{array}\stop and the results from TeXworks and the command line versions are identical. Both report               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2014.9.12)      and also have the line `/usr/share/texlive/texmf- dist/tex/latex/tools/array.sty` in them, so that shouldn't be an issue. Futhermore, the path indicated in that thread `/usr/local/texlive/2013/bin/x86_64-linux` is empty on my computer. Please help. What can I do to get TeXworks to find these paths? For what it's worth, I tried installing Kile, which I am not familiar with, and it had the same problem. Thanks. Edit: I tried running kpsewhich on a .sty file that TeXworks couldn't find, and of course kpsewhich reported the correct location. I guess this isn't surprising since the command line latex versions work.


title: Color background of chapter headings

text: I'm trying to change the background color of the chapter headings. I'd like the full top part of the page, including top and right margins to turn gray until the titlerule. Currently they look like this:               \documentclass[10pt,twoside,openright]{book}     \usepackage{titlesec}     \titleformat{\chapter}[display]{\LARGE\sffamily\bfseries\raggedright}       {\leftskip2cm {\Large\textmd{\chaptertitlename~\thechapter}}}     {0cm}{\leftskip2cm}[\vspace{4mm} {\color{dgray}\titlerule[.6mm]} \enlargethispage{-\parskip}]      The `\enlargethispage` is used to make some extra space for the title number, which appears at the bottom of the page only at the first page of the chapter. My attempts with using the `framed` environment or `colorbox` have so far not been successful.


title: titleps multiple headers does not accept rule changes

text: I want to use several different headers and footers in a document. After a lot of trying I have decided to use `titleps` as the way to go, as I in any case redefine the sections, subsections, etc. The problem is that I have to move the footrule up, because I have the requirement to add bits that are spread over two lines. I found that if I use only one page style the redefinition of head- or footrule works, but one must apparently place it after one have selected a pagestyle else its not defined. Here is an MWE:               \documentclass{article}     \usepackage{xcolor}     \usepackage{titleps}          \newpagestyle{a}     {\sethead{}{Header-a}{}\headrule       \setfoot{}{Footer-a}{}\footrule}     \pagestyle{a}          \newpagestyle{b}     {\sethead{}{\parbox{0.4\textwidth}{\centering     Header-b\\Second line}}     {}\headrule       \setfoot{}{\parbox{0.4\textwidth}{\centering       Footer-b\\Second line}}       {}\footrule}          %\pagestyle{b}          \renewcommand\makeheadrule{\color{red}\rule[-1\baselineskip]{\linewidth}{0.4pt}}     \renewcommand\makefootrule{\color{green}\rule[1.2\baselineskip]{\linewidth}{0.8pt}}     \begin{document}     \pagestyle{a}     Page 1     \clearpage     \pagestyle{b}     Page 2     \end{document}      With this I get different headers/footers, but the redefinition of the head/footrule has no effect. How could one achieve that? I would only need one definition of it as it would be common to my whole document, but in general there could also be the requirement to change it per pagestyle.


title: Redefining Infinity in LaTeX

text: Infinity is defined as something that is uncountable. But every where I see the symbol of Infinity as a closed loop. My professor said, that it symbolizes that the boundary of Infinity is determined but it isn't so. I too agree with him. The Infinity symbol must be open curve rather than closed, something like this:   ![enter image description here](http://i.stack.imgur.com/MAKeD.png)   I would like to define and use this symbol for Infinity. How do I achieve it?


title: How to caption/subcaption a tabular? easily

text: I few week ago, I learned subcaption figuras, with subcaption packages, and I like it very much. Now I would like to caption/subcaption tabulars. I was vieweing any issues and all have a table enviroment OVER the \begin{tabular} \end{tabular} What´s the best and easy way to caption/subcaption a tabular?? like this....               \documentclass[12pt,a4paper,x11names]{article}     \usepackage[top=2.5cm, left=3.5cm, bottom=2.5cm, right=2.5cm]{geometry}          \usepackage{lipsum,mwe}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[spanish]{babel}          \begin{document}     Hello,\\          \begin{tabular}{|c|c|r|}       \hline       % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...       a & e & 12 \\       \hline       f & g & 3 \\       \hline     \end{tabular}          \end{document}


title: fancy header on bibliography first page

text: ![enter image description here](http://i.stack.imgur.com/Yju3F.png)I have used a different first page for all my chapters in my thesis which are defined using:                   \titlespacing*{\chapter}{0cm}{3cm}{0.5cm}         \titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\scalebox{5}{\color{gray}\Huge\thechapter}}{2cm}{\Huge}      I want my bibliography section to be no different, but I cannot get my fancy header to show up properly on the first page of this section. I think this is a complete MWE for this problem                   \documentclass[12pt,a4paper,numbers=noenddot]{scrreprt}         \usepackage{cite}         \usepackage{graphicx}         \usepackage{xcolor}         \usepackage{titlesec}         \titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\huge\thechapter}{15pt}{\huge}         \usepackage{fancyhdr}             \pagestyle{fancy}         \fancyhead[L]{Text here}         \fancyhead[R]{\slshape \leftmark}         \fancyfoot[C]{}         \fancyfoot[R]{\thepage}              \titlespacing*{\chapter}{0cm}{3cm}{0.5cm}         \titleformat{\chapter}[display]{\normalfont\large\bfseries\filleft}{\scalebox{5}{\color{gray}\Huge\thechapter}}{2cm}{\Huge}              \begin{document}         \chapter{1}         some text \cite{reference1}         \chapter{References}\thispagestyle{empty}         \hrulefill\\         \clearpage              \renewcommand{\bibname}{}         \titlespacing*{\chapter}{0cm}{-3cm}{0.5cm}         \small         \bibliographystyle{IEEEtran}         \bibliography{IEEEfull,library}               \end{document}      I hope someone can help Cheers


title: Using tabu/tabularx inside xparse NewDocumentEnvironment

text: My question seems very similar to this, but with `tabu` instead of `tabular*`. In fact, switching the options in that example causes the failure I see here.               \NewDocumentEnvironment {trace} {} {%     \begin{table}         \begin{tabu} to \textwidth {|@{ }r@{::}l|l|X|}         A & B & C & D \\     }{%         \end{tabu}     \end{table}     }          \begin{trace}      a & b & c & d \\     \end{trace}      This fails with `! Missing number, treated as zero. <to be read again> \tabu@0.H4 l.51 \end{trace}`. Similarly for the tabularx environment, which also allows X. The below works just fine, but doesn't allow the X parameter I would like to use               \NewDocumentEnvironment {trace} {} {%     \begin{table}         \begin{tabular*}{\textwidth}{|@{ }r@{::}l|l|p{0.5\textwidth}|}         A & B & C & D \\     }{%         \end{tabular*}     \end{table}     }


title: How much pt is headings=small?

text: I am using this code for my seminar paper: `\documentclass[headings=small,fontsize=12pt,a4paper,oneside,]{scrreprt}` but I was wondering: how many pt are `headings=small`? It looks like 14pt but I am not sure. My `\chapter` has to be 14pt and the written text 12pt. Is there a overview for this like huge, large, normal, tiny,...?


title: \newcommands in the \standalone file not recognized in the main file

text: Few `\newcommands` defined in my standalone `.tex` file containing tikz figure is not recognized in the main `beamer` `.tex` file. Please point out what extra lines should I write to make it work. Here is the standalone file:               % H-atom energy diagram: 1-photon excited 1-photon ionization          \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{arrows, decorations.pathmorphing, patterns}          % New commands     \newcommand{\ket}[1]{$\left|#1\right\rangle$}     \newcommand{\Om}[1]{\small $\omega_{#1}$}     \newcommand{\De}[1]{$\Delta_{#1}$}     \newcommand{\ta}[1]{$\tau_{#1}$}          \begin{document}         \begin{tikzpicture}[             scale=0.5,             level/.style={thick},             virtual/.style={thick,densely dashed},             trans/.style={thick,<->,shorten >=0pt,shorten <=0pt,>=stealth},             ionize/.style={thick,->,shorten >=0pt,shorten <=0pt,>=stealth},             decay/.style={thin,->,decorate,decoration=snake,shorten >=0pt,shorten <=0pt,>=stealth}             ]             % Draw the energy levels             \draw[level] (1cm,4em) node[left]{\scriptsize{13.6eV}} -- (6cm,4em) node[right]{\ket{c}};             \draw[level] (1cm,0em) node[left]{\scriptsize{10.2eV}} -- (6cm,0em) node[right]{\ket{2p}};             \draw[level] (1cm,-10em) node[left]{\scriptsize{0eV}} -- (6cm,-10em) node[right]{\ket{1s}};                  % Draw the transitions             \draw[trans] (3cm,-10em) -- (3cm,0em) node[midway,left] {\scriptsize{122nm}};             \draw[ionize] (3cm,0em) -- (3cm,10em) node[left] {\scriptsize{122nm}};             \draw[ionize] (5cm,0em) -- (5cm,8em) node[right] {\scriptsize{355nm}};             \draw[decay] (3cm,0em) -- (5cm,-3em) node[below] {\scriptsize{\ta{sp}=1.6ns}};         \end{tikzpicture}     \end{document}       Here is the excerpt from the main file:               \documentclass{beamer}     \usetheme{Boadilla}      \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{lmodern}     \usepackage{graphicx}     \usepackage{wrapfig}     \usepackage{subfigure}     \usepackage{epstopdf}     \usepackage{tikz}     \usepackage{standalone}     \usetikzlibrary{external}     %\tikzexternalize[prefix=i/]     \setbeamertemplate{caption}[numbered]     \epstopdfsetup{outdir=./}          \begin{document}     \title{Main title}     \institute{KU-IAE}     \date{\today}          \frame{\titlepage}          \frame{\frametitle{Table of Contents}\tableofcontents}          \section{This section}     \frame{\frametitle{This section}              \begin{wrapfigure}{R}{0.4\textwidth}             \begin{center}             \includestandalone[width=0.4\textwidth]{figs/2_level_1ph_excite_1ph_ion}     %       \includegraphics[width=0.3\textwidth]{figs/H_energy_diagram_1_ph}             \end{center}             \caption{this caption}         \end{wrapfigure}         Text text text text,         \begin{itemize}             \item Text text text text             \item Text text text text             \item Text text text text         \end{itemize}     }     \end{document}      The error message excerpt: > ! Undefined control sequence. l.23 ...ize{13.6eV}} -- (6cm,4em) > node[right]{\ket {c}}; ?


title: Which package should I load first: hyperref or bookmark?

text: I came to this question after looking for a way to explicitly end a `\part` (as described in this question: http://stackoverflow.com/questions/1483396/how-to-explicitly-end-a-part-in- latex-with-hyperref) Using `\bookmarksetup{startatroot}` worked perfectly, but now I'm not sure if there is a reason for loading `hyperref` or `bookmark` first. According to this post: Which packages should be loaded after hyperref instead of before? `bookmark` should be loaded **after** `hyperref`. However, is this **always** the case? Any ideas how it should really be?


title: Why doesn't this this line appear between tables?

text: I'm trying to learn how to typeset caption tables but... why doesn't this text appear between tables? ![enter image description here](http://i.stack.imgur.com/Vv69r.png)               \documentclass{article}     \usepackage{subcaption}     \begin{document}          \begin{table}     \begin{subtable}{.5\linewidth}\centering     {\begin{tabular}{ccc}     \ $a$ & $b$ & $c$ \\     \hline 0 & 0 & 0 \\     \ 1 & 1 & 1 \\     \end{tabular}}     \caption{A subtable}\label{tab:1a}     \end{subtable}%     %     \begin{subtable}{.5\linewidth}\centering     {\begin{tabular}{c c c}     \ $a$ & $b$ & $c$ \\     \hline 0 & 0 & 0 \\     \ 1 & 1 & 1 \\     \end{tabular}}     \caption{Another subtable}\label{tab:1b}     \end{subtable}     \caption{A table}\label{tab:1}     \end{table}           Why is not this text between the tables?               \begin{table}     \begin{subtable}{.5\linewidth}\centering     {\begin{tabular}{ccc}     \ $a$ & $b$ & $c$ \\     \hline 0 & 0 & 0 \\     \ 1 & 1 & 1 \\     \end{tabular}}     \caption{A subtable}\label{tab:1a}     \end{subtable}%     %     \begin{subtable}{.5\linewidth}\centering     {\begin{tabular}{c c c}     \ $a$ & $b$ & $c$ \\     \hline 0 & 0 & 0 \\     \ 1 & 1 & 1 \\     \end{tabular}}     \caption{Another subtable}\label{tab:1b}     \end{subtable}     \caption{A table}\label{tab:1}     \end{table}                    \end{document}


title: How put figure on the inclined plane?

text: \begin{tikzpicture}       \def\nuPi{3.1459265}     \foreach \a in {0,6,12,18,24}{     \foreach \x in {0,3}{     \foreach \y in {0,2*sqrt(3),4*sqrt(3),6*sqrt(3)}{       \foreach \i in {0,...,5}{     \draw [ultra thick,blue]({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) -- ({\x + \a+2*cos(360*(\i+1)/6)},{\y+sqrt(\x)+2*sin(360*(\i+1)/6)});           \shade[ball color=red] ({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) circle(0.45);         }       }      }     }     \end{tikzpicture}      How can I put this picture of graphene on an inclined plane? All hexagons should be deformed, how can I make this deformations in TikZ?


title: Using the same counter as defined in an amsthm environment

text: I use the amsthm package to define enviroments for lemmas, theorems, etc. They all share the same counter. Using `\newcommand` I defined a macro for computational problems (name, input, output). I want the problems to share the same counter as the one used for lemmas, theorems and so on. How do I refer to it? At the moment I have this:               \usepackage{amsthm}     \newtheorem{defn}{Definition}[chapter]     \newtheorem{lem}[defn]{Lemma}          \newcounter{problemdef}     \def\problemdefcnt{\thechapter.\arabic{problemdef}}     \newcommand{\problemdef}[3]{     \vspace{10pt} \noindent \textbf{Problem \problemdefcnt} #1 \\     \begin{tabular}{l | l}     \textbf{Input} & #2 \\     \textbf{Output} & #3     \end{tabular}     }      So, how do I appropriately define problemdefcnt to get smth like > Definition 1.1 > > Lemma 1.2 > > Problem 1.3


title: Typesetting of digits in groups of two

text: Consider the following example:               \documentclass{article}          \usepackage{oldstyle}          \begin{document}     \textos{12345678}     \end{document}      ![output](http://i.stack.imgur.com/LPDke.jpg) I would like a command that group the digits in two and puts a `\,` space between each group, e.g.,               12\,34\,56\,78      ![output2](http://i.stack.imgur.com/IaeV0.jpg)


title: Center block on frame with Beamer

text: I wanted to change the block width in my presentations so, after a quick search on the website, I found the _varblock_ solution : Changing default width of blocks in beamer It consists in adding :               \newenvironment<>{varblock}[2][.9\textwidth]{%       \setlength{\textwidth}{#1}       \begin{actionenv}#3%         \def\insertblocktitle{#2}%         \par%         \usebeamertemplate{block begin}}       {\par%         \usebeamertemplate{block end}%       \end{actionenv}}      to the preamble. Now, in my `.tex` document, I have blocks like this :               \begin{varblock}[8cm]{Title}     Some content...     \end{varblock}      But I cannot center the block horizontally on the frame. I tried to put these three lines between `\begin{center}...\end{center}` and `\begin{centering}...\end{centering}` but the block still remains on the left side of the frame. Thanks for your help.


title: Drawing Subgroup Lattices in TikZ

text: I'm a beginner in tikz and need to draw Subgroup lattices. I did figure this "easy" way out, but it doesn't look that good:               \documentclass[12pt]{article}     \usepackage{tikz}     \usepackage{amsfonts}     \begin{document}     \begin{figure}          \begin{tikzpicture}[node distance=2cm]     \title{Untergruppenverband der $A_4$}     \node(A4)                           {$A_4$};     \node(V4)       [below right of=A4] {$V_4$};     \node(C31)      [below left of=A4]  {$C_3$};     \node(C32)      [left of=C31]       {$C_3$};     \node(C33)      [left of=C32]       {$C_3$};     \node(C34)      [left of=C33]       {$C_3$};     \node(C22)      [below of=V4]       {$C_2$};     \node(C21)      [left of=C22]       {$C_2$};     \node(C23)      [right of=C22]      {$C_2$};          \node(1)            [below left of=C21]     {$\left\{1\right\}$};     \draw(A4)       -- (V4);     \draw(A4)       -- (C31);     \draw(A4)       -- (C32);     \draw(A4)       -- (C33);     \draw(A4)       -- (C34);     \draw(C31)      -- (C32);     \draw(C32)      --  (C33);     \draw(C33)      --  (C34);     \draw(C31)      --  (1);     \draw(C32)      --  (1);     \draw(C33)      --  (1);     \draw(C34)      --  (1);     \draw(V4)       -- (C21);     \draw(V4)       -- (C22);     \draw(V4)       -- (C23);     \draw(C21)      -- (C22);     \draw(C22)      -- (C23);     \draw(C21)      --  (1);     \draw(C22)      --  (1);     \draw(C23)      --  (1);     \end{tikzpicture}     \caption{Untergruppenverband}     \end{figure}     \end{document}      ![output](http://i.stack.imgur.com/uvtGu.jpg) I want `A_4` to be on the top center of the picture and the lines between `V_4` and the `C_2`'s and between the `C_3`'s should be shorter. In addition to that, I'd like to put the index of the subgroup (a natural number) on some lines, like a 2 on the lines connecting `V_4` and `C_2`. I would appreciate any help.


title: How can I use accents (like \"{o}) in \footnote?

text: I get following error when I use in my tex file `\footnote{Shr\"{o}dinger}`. When I change to `\footnote{Shrodinger}` there is no error. Can you give me an advice what should I do? I use BiBTeX for bibliographies.               Runaway argument?     {Shr\}\BibitemShut {NoStop}\bibitem [{Note2()}]{Note2}\BibitemOpen \bibinfo \ET     C.     ! File ended while scanning use of \@firstofone.     <inserted text>                      \par      l.665 \bibliography{mybib}                              {}     ?


title: Problem with "endfloat" in manuscript option of APA6.cls

text: Several years ago I commonly wrote papers in MiKTeX using the `apa.cls`, which allowed you to switch between a two-column formatted "jou" mode and a single- column, double spaced "man" mode. I have recently tried running these old `.tex` files in MiKTeX 2.9, and I have found that the `endfloat` package no longer works properly, either in `apa.cls` or the new `apa6.cls`. I have tried renaming the `apaendfloat.cfg` file `endfloat.cfg` and placing it in the working directory. Here are the errors I get with the `shortsample.tex` file that comes with `apa6.cls`. Basically, it completely chokes on the tables, and nothing comes out but gibberish in the table and figure portions of the paper. Is there a solution for this?               AED endfloat: Processing end Figures and Tables [5]     ! Missing number, treated as zero.     <to be read again>                         \@ef@tttopen      l.83 \end{document}          ?      ! Missing = inserted for \ifnum.     <to be read again>                         \@ef@tttopen      l.83 \end{document}          ?      ! Missing number, treated as zero.     <to be read again>                         \@ef@tttopen      l.83 \end{document}          ?      ! Undefined control sequence.     \processtables ...seout \efloat@postttt \ef@setct                                                        {ttt}{0} \clearpage \if@ta...     l.83 \end{document}          ?      [6]     ! Undefined control sequence.     \processtables ...{ttt}{0} \clearpage \if@tabhead                                                        \section *{\tablesection }...     l.83 \end{document}          ?      ! Undefined control sequence.     \processtables ...@@spacing } \processtables@hook                                                        \@ifundefined {hrm}{}{\sf ...     l.83 \end{document}          ?      (R:\jointtex\SPRINT\apaexample.ttt     \begin{table*}[hbt]     \ifnextchar[{\eatarg}{}     ! Undefined control sequence.     \table ...linechar `\      \catcode `\     =12 \ef@xtable                                                        \fi      l.1 \begin{table}                      [tbp]     ?      )     ! Extra \fi.     \processtables ...ttt}\let \BBAB \normal@BBAB \fi           l.83 \end{document}          ?      ! Missing number, treated as zero.     <to be read again>                         \@ef@fffopen      l.83 \end{document}          ?      ! Missing = inserted for \ifnum.     <to be read again>                         \@ef@fffopen      l.83 \end{document}          ?      ! Missing number, treated as zero.     <to be read again>                         \@ef@fffopen      l.83 \end{document}          ?      ! Undefined control sequence.     \processfigures ...eout \efloat@postfff \ef@setct                                                        {fff}{0} \clearpage \if@fi...     l.83 \end{document}          ?          /b/c4/cOverfull/b/c0/c \hbox (441.54912pt too wide) in paragraph at lines 1--83     [][]\T1//lmr//m//n//12 [tbp]     \caption{Some numbers that could be experimental data.     }     \label{tab:tab1}     \begin{tabular}{lcc}\hline               & \multicolumn{2}{c}{Fa     ctor 2} \\ \cline{2-      /b/c4/cOverfull/b/c0/c \hbox (1151.26506pt too wide) in paragraph at lines 1--83     \T1//lmr//m//n//12 3}     Factor 1  & Condition A  & Condition B   \\ \hline     First          & 586 (231)    & 649 (255)     \\               &    2.2       &    7.5        \\     S     econd    & 590 (195)    & 623 (231)     \\               &    2.8       &    2.5             \\ \hline     \end{tabular}     \end{table}     \efloatseparator     >0      [7]     ! Undefined control sequence.     \processfigures ...}{}{\sf } \processfigures@hook                                                        \@input {\jobname .fff} \fi      l.83 \end{document}          ?      (R:\jointtex\SPRINT\apaexample.fff)     ! Extra }, or forgotten \endgroup.     \processdelayedfloats ...ocessotherdelayedfloats }          l.83 \end{document}          ?          ! LaTeX /b/c9/cError:/b/c0/c \begin{efloat@float} on input line 1 ended by \end{document}.     See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.83 \end{document}          ?


title: Typesetting a Row Vector

text: In the question typesetting a column vector, a very nice solution was given for typesetting a column vector with an arbitrary number of rows. I am attempting to modify the code to produce row vectors instead of column vectors. I made the "obvious" change, i.e., substituting the `&` for the `\\` as indicated by the snippet below:               \newcount\colveccount     \newcommand*\colvec[1]{             \global\colveccount#1             \begin{pmatrix}             \colvecnext     }     \def\colvecnext#1{             #1             \global\advance\colveccount-1             \ifnum\colveccount>0                     &                     \expandafter\colvecnext             \else                     \end{pmatrix}             \fi     } ` My modification however fails to compile and the errors, of course, are not very helpful. So my question is, How can I modify the `\colvec` and `\colvecnext` macros to produce row vectors?


title: \vspace inside a command to add space between paragraphs but not before sections

text: I'm using a custom command to typeset some phrases and I need to put some vertical space between them. Unfortunately, this adds vertical space also before `section` and `subsection` headings. As I have to type a lot of quotes, it would be nice to have `\vspace` automatically removed before sectioning commands. Is there anyway to prevent `\vspace` to behave like this?               \documentclass[]{article}          \usepackage{lipsum}          \newcommand{\philquote}[1]{\noindent ``#1'' \vspace{12pt}}          \begin{document}          \section{Section 1}          \philquote{Socrates asked questions but gave no replies: for he confessed he had no knowledge}          \philquote{Socrates asked questions but gave no replies: for he confessed he had no knowledge}          \section{Section 2} % Wrong vertical spacing          \lipsum[1]          \section{Section 3} % Correct vertical spacing          \end{document}


title: How to place two code snippets next to each other with minted?

text: The `minted` package for code highlighting comes with a float environment called `listing`. Now I would like to place two of this code listings next to each other, but I have no idea how to do this. I tried using the `multicol` package, but code of the two listings overlapped. Any suggestions on how to do this? EDIT: Here is some little macro I created for convenience and an example on its usage.               \newcommand{\insertminted}[2]{\inputminted[linenos=true,                                            frame=lines,                                            framesep=2mm,                                            xleftmargin=2cm,                                            xrightmargin=2cm]{#1}{#2}}               \begin{listing}[H]       \insertminted{xml}{code_examples/user.xml}       \insertminted{js}{code_examples/user.js}       \caption{SomeCaption}       \label{lst:representation_examples}     \end{listing}      This way the code of `user.xml` is above the code of `user.js`. What I would like to have is the code next to each other in two cols, so that it can be compared. I also would like to have a seperate caption for each of them. The listing as a whole should appear in the output of `\listoflistings`.


title: Automagically externalising pdftricks and TikZ pictures

text: My thesis currently has a few pdftricks pictures and tikz pictures. It takes a while to compile over here Scott says he has some scripts to automate externalising TikZ pictures. I'm looking ideally for something that will automatically name sequentially all of my figures, generate the graphics for them and automagically include them. I don't mind if I have to delete them by hand to recompile them if I change the code. For pdftricks & TikZ please =) cause currently latex is spanned for each pdftricks picture to generate a pdf graphic, and tikz compilations starts to take up time. ps. half way through thesis I found out tikz but don't have time to redo pdftricks graphics.


title: Using biblatex+memoir+refsection: Why are the references included in the ToC?

text: Consider this example taken and modified from a previous question:               \begin{filecontents*}{references.bib}     @BOOK{childs_temperature,       title = {Practical Temperature Measurement},       publisher = {Butterworth - Heinemann},       year = {2001},       author = {Childs, Peter R N},       address = {Great Britain},       edition = {1},       isbn = {0 7506 5080 X}       }            @PHDTHESIS{hashemian,       author = {Hashemian, Hashem Mehrdad},       title = {Measurements of dynamic temperatures and pressures in nuclear power plants},       school = {{The University of Western Ontario}},       year = {2011},       type = {PhD {T}hesis}       }     \end{filecontents*}          \documentclass{memoir}      \usepackage[style=alphabetic,refsection=chapter]{biblatex}      \addbibresource{references.bib}           \begin{document}           \tableofcontents      % \begin{refsection}      \chapter{First chapter}      \section{Foo}      Some text \cite{childs_temperature}.     \printbibliography[heading=subbibliography]      % \end{refsection}           % \begin{refsection}      \chapter{Second chapter}      \section{Bar}      Some text \cite{hashemian}.      \printbibliography[heading=subbibliography]      % \end{refsection}           \end{document}      According to the documentation of biblatex, the `printbibliography` command generates a section with the references of each chapter, since the `refsection=chapter` option was used, but it should not be included in the ToC, because the `subbibliography` heading does not add it to the ToC (see the following biblatex.def extract):                 \defbibheading{subbibliography}[\refname]{%         \subsection*{#1}}       \defbibheading{subbibintoc}[\refname]{%         \subsection*{#1}%         \addcontentsline{toc}{subsection}{#1}}      However, in this example, **it is included in the ToC**. ![enter image description here](http://i.stack.imgur.com/BzwgZ.png) Moreover, if the `refsection=chapter` is not used and the `\begin{refsection} \end{refsection}` parts are uncommented, the reference section is not included in the ToC, as advertised by the docs. Another interesting clue, and maybe the **key clue** for this enigma, is that when I use the book document class instead of memoir, the references and ToC work as expected. Can anyone explain this behavior? I'm sure that I misunderstood or did not find my way in the vast biblatex and memoir documentation.


title: What table tools/packages do you use?

text: Making tables in LaTeX can be painful. All you need is a semi complex table with cells that have to span multiple rows/columns. What tools do you use to get around this complexity? Tabular? Tabularx? Are there others?


title: How to add copyright box in acm alternative style?

text: I don't know why this information is not easier to find. How do I produce the copyright box in the ACM tighter alternative style? The `rights management and bibstrip text blocks`. It starts with `Permission to make digital or hard copies of all or part of this work` and so forth. I guess this has been asked before and is a duplicate? I received a paragraph from ACM. I guess I am required to paste this as is? The last line includes a DOI that was not shown in the papers of the last year conference. Is the DOI line new?


title: How can I get two sequences of "footnotes" in one LaTeX document, one as footnotes, the other as endnotes?

text: I want to have two distinct sequences of "footnotes" in a single text, one as footnotes, the other as endnotes. Can this be accomplished in LaTeX? If so, how? In case it isn't clear what I mean, here's the use-case. Sometimes one has two distinct classes of material for notes:   1. Notes that extend or amplify the discussion of the text and that most readers would want to (or ought to) read, and   2. Notes containing only scholarly apparatus or points of relevance to only the most specialized of specialists. It is especially helpful if these two classes of notes can have a different sequence of references and if those of type (1) are footnotes while those of type (2) are endnotes. (This use can be seen in, for instance, Martha Nusbaum's The fragility of Goodness.) I would love to be able to achieve this in LaTeX, but I have no idea how to go about it.


title: How to convert number to length?

text: I'm trying to generate a "word cloud" by using `\mbox`es with random spaces around words. In the code below I've removed stuff that change the font size, and I've replaced `\mbox`es by `\framebox`es for debug purpose.               \documentclass{article}          \usepackage[first=1, last=10]{lcg}          \newcommand*{\wordtag}[1]{%         \framebox{\vspace{3pt}\hspace{5pt}#1\vspace{1pt}\hspace{6pt}}%     }               \begin{document}     \rand               \wordtag{color}     \wordtag{animals}               \end{document}      When I replace length with `\rand` (i.e. `\vspace{\rand pt}`), I get the following error:               ! Illegal unit of measure (pt inserted).      Does anyone know how to fix this error? And why the `\rand` at the beginning of the document doesn't print anything? Is there a better way to produce a word cloud?


title: How can i set the width of a table?

text: How can i set the minimum width of a table? I want to have a series of tables that are all the same width?


title: Redefine \cite for brackets

text: **EDIT:** I finally found out how to do it:               \newrobustcmd*{\parentexttrack}[1]{%       \begingroup       \blx@blxinit       \blx@setsfcodes       \blx@bibopenparen#1\blx@bibcloseparen       \endgroup}     \AtEveryCite{%       \let\parentext=\parentexttrack%       \let\bibopenparen=\bibopenbracket%       \let\bibcloseparen=\bibclosebracket}     \makeatother     \renewcommand{\cite}{\parencite}      * * * The code for square brackets is from this thread: Biblatex, author-year, square brackets And the renewcommand changes \cite to have the same properties as \parencite How do I redefine \cite so that there are brackets [] around it? `\let\\[\cite\\]=\cite` did not work. It should look like this: `text bla bla[John Doe, 1990] bla bla bla text more text` Every functionality in \cite should still be there. I am using Biblatex `\usepackage[citestyle=authoryear]{biblatex}` EDIT: In my opinion this is not a duplicate. The mentioned question is similiar but I want to use `\cite` and NOT `\parencite` or other types of cite to achieve the following: Square brackets around the citation and NOT! round brackets as this is the case for `\parencite`. It has to be the `\cite` command because I am working with another program which requires the `\cite` command.


title: ConTeXt: Ignore stem height

text: # Background Looking to create a stylized chapter heading using the first character of the heading title. # Problem The stem (descender) distance of text causes the containing frame's offset to alter the location of the emphasized first letter, which is obvious from the following picture: ![Influential Stem](http://i.stack.imgur.com/DnwFK.png) The problematic line in the code below is this line, which was added to ensure the title text does not incur a line-break, as suggested from an answer to a previous question:               \scale[maxwidth=\textwidth-(\marginwidth)]{#1}      When the line above is simply:               #1      Then the alignment is perfect, but when the text is too long an undesired line-break ensues. # Code A minimal working example:               \definecolor[BookColourPrimary][h=A45F62]     \definecolor[BookColourSecondary][h=9A957A]     \definespotcolor[BookColourSecondaryLightest]       [BookColourSecondary][a=1,t=.2]     \definefont[BookFontChapterHeader][SansBoldItalic scaled 5000]     \definefont[BookStyleFontChapterCharacter][SerifItalic scaled 20000]          \defineframed[BookStyleChapterFramed][       frame=on,       align={left,low,nothyphenated,verytolerant},       width=\dimexpr\textwidth-(.2\marginwidth),       height=\dimexpr\textheight+0.25\footerheight,     ]          % Extract first character     \define[1]\BookStyleChapterChar{\cldcontext{string.sub("#1",1,1)}}          % Use a nested frame to keep the overlain large letter together with     % the chapter title.     \define[1]\BookStyleChapter{%       \BookStyleChapterFramed{%         \inframed[align=right, frame=on]{%           \startoverlay             % Calculate the large letter's offset using the first character's             % width. This allows font changes without significantly affecting             % the distance between the emphasized first character of the             % chapter title and the complete chapter title.             \setbox\scratchbox\hbox{%               \BookStyleFontChapterCharacter\BookStyleChapterChar{#1}}%             % Shift the first character back relative to the chapter title.             \hskip-.55\wd\scratchbox%             \color[BookColourSecondaryLightest]{%               \BookStyleFontChapterCharacter%               \BookStyleChapterChar{#1}%             }             \vskip-1.9em             % Ensure the text fits on the page.             \scale[maxwidth=\textwidth-(\marginwidth)]{#1}           \stopoverlay         }       }     }          % Avoid duplication...     \define[1]\BookChapterText{       \BookColourPrimary{\BookFontChapterHeader{\BookStyleChapter{#1}}}     }          \starttext       \BookChapterText{Test-a}       \page       \BookChapterText{Test-g}     \stoptext      # Question How do you make ConTeXt ignore the stem height while still scaling the text to fit within the `\textwidth` margins?


title: Will the \phantom{...} command break left justification if placed at the end of a line?

text: If I have some text and then \phantom{more text}, will LaTeX just allow an overfull (invisible) box at the end of the line, or could it potentially put in a line break and then have the invisible box at the start of the next line?


title: How can I use the tikz external library in tikzposter?

text: I am using tikzposter to make a poster (obviously). I would like to insert a few rather large tikz figures in that poster. This really lengthens the compilation time. Usually (when writing articles) I get away with this by using the excellent tikz external class. But, if I activate it in my poster I get this error:               Runaway argument?      \par \endinput      ! File ended while scanning use of \tikzexternal@laTeX@collect@until@end@tikzpic     ture      I suspect this is because the whole poster is one giant tikzpicture. Is there a way to activate the tikz external library selectively?


title: Image displays untill its wrapped by {figure}

text: i have the following code which works and adds an image to my document                \includegraphics[scale=0.71]{ed.jpg}      However when I try to turn it into a figure                \begin{figure}[t]      \caption{A nice picture.}      \centering      \includegraphics[scale=0.71]{ed.jpg}      \end{figure}      The image disappears.. Im using the following packages                \usepackage[pdftex]{graphicx}      \usepackage{float}      Can anyone point out my mistake? Im sure its fairly obvious but its been winding me up for days. the Latex compiler isnt producing any error messages.


title: How to disable initial view of PDF bookmarks panel?

text: The `hyperref` package automatically creates a list of PDF bookmarks, and it configures the PDF to have the initial view display the bookmarks panel, at least in ~~Foxit Reader and~~ Acrobat. To see the relevant setting in Acrobat, see _File > Properties > Initial View > Navigation Tab >`Bookmarks Panel and Page`_. ![enter image description here](http://i.stack.imgur.com/OB8im.png) How can I (temporarily) turn off the intial Bookmarks Panel display upon compilation?   I want it to be the `Page Only` setting. _Note_ : I know I can change the setting using Acrobat (Professional) once the PDF is created, but I want to control the setting upon compilation. The underlying driver for me is that when I view my PDF (after making changes in LaTeX, and compiling it), the bookmark panel makes the actual page shrink, making it too small to be readable.


title: Abbreviations and full stop--how to avoid double dots?

text: I have trouble with macros expanding to an abbreviated expression. Say I have `\WHP` which expands to "`with high prob.`" (artificial example). I want to avoid the dot after the abbreviation colliding with full stops later on, like > "We concluded that hypothesis holds \WHP." which should _not_ expand to > "We concluded that hypothesis holds with high prob.." but simply end with one full stop.


title: Breaking equation in align enviroment to put textwidth matrix in separate line

text: I have to put a textwidth `pmatrix` into an `align` environment. When using split, it destroys the centered alignment of the other equation. Pseudocode:               \begin{align}      \vec{a} &= \vec{b} + \vec{c} \\      \vec{c} &= \operatorname{Matrix}(Variable) \cdot \vec{d} \\      \begin{split}      \operatorname{Matrix}(Variable) &= \\      \begin{pmatrix}       textwidth matrix      \end{pmatrix}      \vec{e} &= 2 \cdot \vec{a}     \end{align}      Without the `split` the equations would leave the page. With `split` the equations are aligned left except the right aligned split part. The result should look like:                     XX=XX            X=X           XX=XXXXX           XX=     XXXXXXXXXXXXXXXXXX     XXXXXXXXXXXXXXXXXX           XX=XXXX


title: Making mathmode obey spaces

text: I know this is kind of blasphemic thing to ask, but is there a way to make mathmode obey spaces? Preferably in Plain with XeTeX.


title: How to change Bibliography heading?

text: Let's take `article` document class with bibliography:               \documentclass{article}     \begin{document}     Some text \cite{key01}.     \begin{thebibliography}{9}% 2nd arg is the width of the widest label.     \bibitem{key01}     Beeblebrox, Zaphod, Galactic University Press     etc. etc.`     \end{thebibliography}     \end{document}      Above list of bibliography entries there is `References` which looks like generates with: `\section*{References}` . I would like it to look like default text. How to change it ? Should I `\renewcommand` to overwrite default `\section` ? If yes, how to revert default `\section` later ? If other more elegant option exists, could you provide ? (pdflatex)


title: Removing a page numeration from Table of Contents

text: In LyX, how can I make the pages numbers start from the second page? (i.e., making the first page, which is the table of contents in my case, not having a page number on it)


title: Tikz: Emphasizing part of a drawn path

text: How can I emphasize the counter clockwise trajectory on ellipse ecc2768 and the clockwise trajectory on ellipse ecc6789? Is there a command that will follow the ellipses from `P1` to `P2`?                 \documentclass{article}       \usepackage{tikz}       \usetikzlibrary{intersections, calc, arrows, decorations.markings, backgrounds}       \tikzset{       invclip/.style={         clip,         insert path={             (-16383.99999pt,-16383.99999pt) rectangle               (16383.99999pt,16383.99999pt)           }         }       }       \begin{document}       \begin{tikzpicture}[scale = 1.75,         every label/.append style = {font = \small},         dot/.style = {outer sep = +0pt, inner sep = +0pt,           shape = circle, draw = black, label = {#1}},         dot/.default =,         small dot/.style = {minimum size = 2.5pt, dot = {#1}},         small dot/.default =,         big dot/.style = {minimum size = 5pt, dot = {#1}},         big dot/.default =,         line join = round, line cap = round, >=triangle 45         ]         \pgfmathsetmacro{\e}{0.2768}         \pgfmathsetmacro{\etilde}{0.6789}         \pgfmathsetmacro{\a}{1.36}         \pgfmathsetmacro{\b}{\a * sqrt(1 - \e^2)}         \pgfmathsetmacro{\btilde}{\a * sqrt(1 - (\etilde)^2)}         \pgfmathsetmacro{\c}{sqrt(\a^2 - \b^2)}         \pgfmathsetmacro{\ctilde}{sqrt(\a^2 - (\btilde)^2)}         \pgfmathsetmacro{\angle}{88.23}              \node[scale = .75, fill = orange, big dot = {below: \(F\)}] (F)         at (0, 0) {};              \draw[red, name path = r2] (0, 0) circle (1.523679cm);         \draw[blue, name path = r1] (0, 0) circle (1cm);              \begin{pgfinterruptboundingbox}         \begin{pgfonlayer}{background}         \begin{scope}[decoration = {markings,                                          mark = at position 0.7 with {\arrow{<}}           }]           \path[invclip] (0, 0) -- ($(0,0)!100cm!(P1)$) -- (0cm, 100cm) --           ($(0,0)!100cm!(P2)$) -- (0, 0);           \draw[name path global = ecc2768, postaction = decorate] (-\c, 0)           ellipse [x radius = \a cm, y radius = \b cm];         \end{scope}         \end{pgfonlayer}         \end{pgfinterruptboundingbox}                   \draw[name intersections = {of = ecc2768 and r1}] (F) -- (intersection-1)         coordinate (P1) node[fill, big dot = {right: \(P_1\)}, minimum size = 3pt]         {};              \draw[name intersections = {of = ecc2768 and r2}] (F) -- (intersection-1)         coordinate (P2) node[fill, big dot = {left, above = 2pt: \(P_2\)},         minimum size = 3pt] {};                \path [name path global = ecc6789unrotated] (\ctilde, 0) ellipse           (\a cm and \btilde cm);           \draw [name intersections = {of = r1 and ecc6789unrotated}]           (intersection-2)           let             \p0 = (F),             \p1 = (P1),             \p2 = (intersection-2),             \n1 = {atan2(\x1 - \x0, \y1 - \y0)},             \n2 = {atan2(\x2 - \x0, \y2 - \y0)},             \n3 = {\n1 - \n2}           in           \pgfextra{\xdef\myangle{\n3}}             [rotate = \n3, name path global = ecc6789rotated] (\ctilde, 0) ellipse             (\a cm and \btilde cm);                \begin{pgfinterruptboundingbox}                              \begin{pgfonlayer}{background}           \path[clip] (0, 0) -- ($(0,0)!100cm!(P1)$) -- (0cm, 100cm) --           ($(0,0)!100cm!(P2)$) -- (0, 0);           \draw [dashed, cyan] (-\c, 0) ellipse [x radius = \a cm,           y radius = \b cm];           \end{pgfonlayer}           \end{pgfinterruptboundingbox}            \end{tikzpicture}       \end{document}      This code with the `invclip` is causing the following errors and no `pdf` output.               ERROR: Dimension too large.           --- TeX said --- <recently read>           \pgf@x l.2729 \path[invclip] ( 0, 0) -- ($(0,0)!100cm!(P1)$) -- (0cm, 100c...           --- HELP --- From the .log file...           I can't work with sizes bigger than about 19 feet. Continue and I'll use the largest value I can.      ![enter image description here](http://i.stack.imgur.com/uimvm.png)


title: Is there any TeX (or LaTeX) package capable of rot13-encoding an ASCII text?

text: This might be a nice thing to obfuscate answers to quizzes (better than `\rotatebox[c]{180}{...}`). (I understand that this is trivial using LuaTeX, but I'd be interested in a generic TeX solution. Most probably I could write one myself - it's not _that_ difficult - but being a bit lazy, I don't want to reinvent the wheel.)


title: Micro bibliography inside LaTeX file without filecontents

text: How to make nice "micro" (with just a few entires) bibliography inside LaTeX file ? Requirement:   * not using `filecontents`   * only running `pdflatex file.tex` (might be multiple of times) I know it's quite limiting (that's why I have problem...), but on the other hand, curious, how to add just a few entries "manually". I can handle even manually with numbering of references and their layout, so question could be : how to layout manually to achieve same effect as with BibTex or BibLatex ? But maybe there is some middle ground between doing whole stuff totally manually, and using additional external tools with additional runs.


title: Tikz: How to move a footnote in a node out of that group?

text: Apologies for the slightly strange title, I struggled to come up with something else. I have defined my own quote environment with brackets around the quote. In order to do that I use tikz and the quote content is put in a node. If I now use a \footnote in this node it is but directly under the quote. I'd rather have the footnote at the end of the page, so how can I "break out" of the local group the tikz node seems to create?               \documentclass[parskip=half]{scrartcl}          \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{environ,xcolor}     \usepackage{lipsum}          \NewEnviron{bquote}{%     \noindent%     \par%     \addmargin{30pt}     \begin{tikzpicture}%     \node[text width=0.97\linewidth](q){\BODY};%     \draw[ultra thick,line width=7pt,overlay,gray!30] (q.north west) -- ($(q.north     west) - (15pt,0)$) -- ($(q.south west) - (15pt,0)$) -- (q.south west);%     \draw[ultra thick, line width=7pt,overlay,gray!30] (q.north east) -- ($(q.north     east) + (15pt,0)$) -- ($(q.south east) + (15pt,0)$) -- (q.south east);%      \end{tikzpicture}%     \footnote{Outside the group}%just a test     \par%     }%          \begin{document}      \lipsum[1]     \begin{bquote}     \lipsum[3]\footnote{Inside the node and sadly local}     \end{bquote}     \lipsum[1]     \end{document}      ![enter image description here](http://i.stack.imgur.com/lMX2g.png)


title: Long title runs off page

text: I'm making a graph in using `gnuplot` and have converted the `eps` to `pdf`, so I have `.tex` file and `pdf` file. Usual they are great except this time the title in the title runs off the page, the title is a line of the `.tex` file.                 \put(3940,4709){\makebox(0,0){\strut{}REALLY LONG TITLE, REALLY LONG TITLE, REALLY LONG TITLE, REALLY LONG TITLE, REALLY LONG TITLE, REALLY LONG TITLE}}%      I've tried using "\n" but pdflatex compiler doesn't like this argument.                 \put(3940,4709){\makebox(0,0){\strut{}REALLY LONG TITLE, REALLY LONG TITLE, REALLY LONG TITLE,\n REALLY LONG TITLE, REALLY LONG TITLE, REALLY LONG TITLE}}%      Does anyone have any ideas?


title: How to center text in a schemabox?

text: I would like the text in the nodes between the arrows to be centered rather than left aligned. Using `\centering` or `\begin{center} ... \end{center}` around the minipage or setting `text align=center` in the tikzpicture options doesn't help. I can't find further guidance in the schemata package. (I'm open to solutions that don't involve this package.)               \documentclass{article}     \usepackage{tikz,xcolor, fontspec, schemata}     \usetikzlibrary{shapes,arrows,positioning, decorations.pathreplacing}     \setmainfont{Arial}     \begin{document}     \tikzstyle{block}=[align=center]     \tikzstyle{line} = [draw,-latex',ultra thick]     \begin{tikzpicture}[node distance = 5em,auto,block]              \node (prior-lit) {Prior literature};         \node [below of=prior-lit] (aims-12)          {             \begin{minipage}{\columnwidth}                 \let\SB\schemabox                 \schema{\SB{Aims 1 \& 2}}{\SB{\textbf{Identify} Risk and protective factors for \\ nonmedical poly- and monosubstance use\\  location, position in social network, age, gender}}             \end{minipage}            };         \node [below of=aims-12, below=0em] (mock-intervention)          {             \begin{minipage}{\columnwidth}                 \let\SB\schemabox                 \schema{\SB{Aim 3}}{\SB{\textbf{Simulate} responses of users with various \\ combinations  of risk and protective factors\\ to interventions on social networking sites}}             \end{minipage}            };                   \node [below of=mock-intervention] (real-intervention) {Real intervention};         \node [below of=real-intervention] (outcomes) {Asses outcomes};              \path[line] (prior-lit) -- (aims-12);         \path[line] (aims-12) -- (mock-intervention);          \path[line, dashed] (mock-intervention) -- (real-intervention);         \path[line, dashed] (real-intervention) -- (outcomes);              \draw [decorate,decoration={brace,amplitude=1em,mirror,raise=4pt},yshift=-10] (5.5,-5) -- (5.5,0) node [right,black,midway,xshift=2em] {\textbf{Current grant}};              \draw [decorate,decoration={brace,amplitude=1em,mirror,raise=4pt},yshift=-10] (5.5,-8) -- (5.5,-5.1) node [right,black,midway,xshift=2em] {\textbf{Future grants}};     \end{tikzpicture}          \end{document}


title: Tips on large tex files

text: I want to write a solution manual for a maths book which is about 900 pages. I want it to include detailed solutions to all exercises as as well summaries for every chapter. The file will obviously be quite large. I'd love to hear any tips on handling such large files, such as breaking it into several files etc...


title: Centering images and overprint in Beamer

text: I'm trying to create a `beamer` presentation with several images replacing each other on consecutive slides. I've gotten it to work with `overprint` and `\onslide`, but cannot get the images centered on the slide.               \begin{center}       \begin{overprint}         \onslide<2>\includegraphics[scale=0.3]{images/stack1.pdf}             \onslide<3>\includegraphics[scale=0.3]{images/stack2.pdf}         \onslide<4>\includegraphics[scale=0.3]{images/stack3.pdf}         \onslide<5>\includegraphics[scale=0.3]{images/stack4.pdf}         \onslide<6>\includegraphics[scale=0.3]{images/stack5.pdf}         \onslide<7>\includegraphics[scale=0.3]{images/stack6.pdf}         \onslide<8>\includegraphics[scale=0.3]{images/stack7.pdf}       \end{overprint}     \end{center}      Anything outside of the `overprint` environment gets properly centered, but not the images themselves.


title: Color box issue

text: Here is my MWE (minimal working example):               \documentclass[]{article}     \usepackage{fancyhdr}     \usepackage{graphicx}     \usepackage[usenames,dvipsnames]{color}          \begin{document}         \begin{center}          {\setlength{\fboxsep}{2.5pt}\colorbox{Orange}{ 9}}               {\setlength{\fboxsep}{2.5pt}\colorbox{Orange}{ 10}}          \end{center}     \end{document}      ## Question How can I make the orange box around 10 as wide as the one around 9 so they line up?


title: What is the LaTeX symbol for "forking independent" (model theory)?

text: I am looking for a way to set the symbol for "forking independent" (for example, see "Essential Stability Theory", Steven Buechler, p.217). It looks a bit like an anchor or an upside-down 'T' with a curved bar. ![](http://i.stack.imgur.com/nQiOg.png)


title: Adjust environments's behaviour when nested

text: I would like to define an environment which behaves differently when it is nested. This environment should ignore spaces at the begin and end of the environment. I have this working as I desire when it is not nested. But, when it is nested I can't seem to get the desired behavior. The first box here is the desired behavior using a non nested version. I would like the second nested version of this environment to behave as if it were not nested. However, there are two issues with the current implementation:   1. I am required to add a trailing `%` to `\begin{MyBoxedEnvironment}%` when nested. Otherwise I end up with an extra line in between. (See **`1`** in the MWE).   2. I can not have a blank line following the start of this environment when nested. This can be fixed by manually adding a `\par\noindent` but would prefer not to have to do that. (See **`2`** in the MWE). ![enter image description here](http://i.stack.imgur.com/3QIX2.png) As you can see below, I use a counter to count the depth of the nesting, and only `\begin`,`\end` the `mdframed` environment when the counter is zero. If there is a better way to detect that an environment is nested that would be useful as well. ## Code:               \documentclass{article}     \usepackage{xcolor}     \usepackage{mdframed}          \newcommand*{\Text}{%         Lorem ipsum dolor sit amet, consectetur adipiscing elit.          Sed accumsan nulla ac ipsum elementum interdum.          Praesent ultricies faucibus turpis, non scelerisque nisi bibendum et.     }%          \newmdenv[%         backgroundcolor=yellow!10,%         linewidth=2pt,%         skipabove=0pt,%         skipbelow=0pt,%         ]{MyBoxedEnvironmentMdframed}%          \newcounter{MyBoxEnvironmentDepth}%     \setcounter{MyBoxEnvironmentDepth}{0}% just to be clear we start at 0          \newenvironment{MyBoxedEnvironment}{%         \ignorespaces%         \par\noindent%         \ifnum\value{MyBoxEnvironmentDepth}>0%             % Ignore begin environment since it is nested.         \else%             \begin{MyBoxedEnvironmentMdframed}%         \fi%         \addtocounter{MyBoxEnvironmentDepth}{1}% increment depth     }{%         \addtocounter{MyBoxEnvironmentDepth}{-1}% decrement depth         \ifnum\value{MyBoxEnvironmentDepth}>0%             % Ignore end environment since it is nested.         \else%             \end{MyBoxedEnvironmentMdframed}%         \fi%         \ignorespacesafterend%     }%          \begin{document}     \begin{MyBoxedEnvironment}              \Text              \par\noindent         \textcolor{red}{\Text}          \end{MyBoxedEnvironment}          \begin{MyBoxedEnvironment}              \Text              \begin{MyBoxedEnvironment} % 1. Why space here matter?                  % 2. Why does blank line above yield extra line             %\par\noindent% Don't want to have to add this             \textcolor{red}{\Text}         \end{MyBoxedEnvironment}     \end{MyBoxedEnvironment}     \end{document}


title: Footnote in math mode

text: How can I insert a footnote into math mode? I tried this (with required packages)               \usepackage{amsmath}     \usepackage{hyperref}     \usepackage{ccaption}      And i.e if I try               \begin{eqnarray}     foo && foo \text{\footnote{something}}\    foo && foo \mbox{\footnote{something else}}     \end{eqnarray}      the link to the footnote appears, but not in the footnote position and if I click it I'm redirected to the first page. If I am in text mode I don't have this problem. How can I do this? Thanks in advance!


title: pgf/tikz: Making the filling / gap between double border lines transparent

text: I have a rectangular box with double border lines. The pgf manual (chapter 15.3.5 Graphic Parameters: Double Lines and Bordered Lines) says that the default filling is white. I want the gap to be transparent so that you can see the background color.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{backgrounds,fit}     \begin{document}          \begin{tikzpicture}     \node (myNode1) at (0,0) [                               rectangle,                               draw,                               double,                               double distance=1mm                             ] {Double};     %                           \node (myNode2) at (0,-10mm) [                               rectangle,                               draw,                               double=red,                               double distance=1mm                             ] {Double};     %                      \begin{pgfonlayer}{background}        \node [fill=black!30,fit=(myNode1) (myNode2)] {};     \end{pgfonlayer}     \end{tikzpicture}          \end{document}       ![enter image description here](http://i.stack.imgur.com/Z3lt8.png) Any ideas? **EDIT:** I do not want to give the gap manually the same color as the background since I want to be the background "anything" like a picture or something that is not of control of tikz.


title: Infinite loop on a non-macro token

text: The following document infinite-loops:               \documentclass{article}     \usepackage{breqn}     \begin{document}          \newcommand{\allowbreaks}[2][,]{\begingroup       \catcode`#1=\active       \scantokens{%         \edef#1{%           \show\detokenize{#1}%           \detokenize{#1}%           \noexpand\allowbreak         \show0%         }%         #2%       }     \endgroup}          \allowbreaks{$,$}          \end{document}      LaTeX displays               > the character ,.     ,->\show ,               ,\allowbreak \show 0     l.113 \allowbreaks{$,$}          ?      repeatedly. If I type `I\show` into it's prompt, it gives me               > the character ,.     ,->\show ,,                \allowbreak \show 0     l.113 \allowbreaks{$,$}      That is, the token that it's expanding it a character, not a macro. How is this possible? If I comment out the `breqn` line, it works fine. I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).


title: Looking for style files for writing a programming language book

text: I am looking for LaTeX style files for writing a programming language book (OO programming with Java examples). I'd appreciate if anyone can point me to style files that I can use.


title: Space between items in List of Figures/Tables within a chapter

text: I would like to add some tiny space between items within a chapter in the List of Figures/Tables. It should be compatible with `\setlength{\cftbeforechapskip}{Xpt}` I'm using for ToC. My code is:               \documentclass[oneside,12pt]{book}     \usepackage[titles]{tocloft}               \begin{document}          \listoftables     \listoffigures          \setlength{\cftbeforechapskip}{100pt}     \tableofcontents               \chapter{a}     \section{1}     \begin{table}[h] \caption{Performance at peak F-measure1} \end{table}     \begin{table}[h] \caption{Performance at peak F-measure2} \end{table}     \begin{table}[h] \caption{Performance at peak F-measure3} \end{table}     \begin{figure} \caption{Performance at peak G-measure1} \end{figure}     \begin{figure} \caption{Performance at peak G-measure2} \end{figure}     \begin{figure} \caption{Performance at peak G-measure3} \end{figure}          \chapter{b}     \section{1}     \begin{table}[h] \caption{Performance at peak F-measure4} \end{table}     \begin{table}[h] \caption{Performance at peak F-measure5} \end{table}     \begin{table}[h] \caption{Performance at peak F-measure6} \end{table}     \begin{figure} \caption{Performance at peak G-measure4} \end{figure}     \begin{figure} \caption{Performance at peak G-measure5} \end{figure}     \begin{figure} \caption{Performance at peak G-measure6} \end{figure}          \end{document}      Thanks.


title: How to draw parallel capacitor plates

text: I am trying to create a drawing of part of a circuit with 3D perspective like so: ![enter image description here](http://i.stack.imgur.com/3Smx7.jpg) How can this be done? The main body of the capacitors has now been created in latex, all that remains is to create the line from either side of the shaded circle.


title: Beamer: remove brackets in author's institution

text: In a beamer template I caught from the internet, next to the author's name there are brackets. I suppose they were meant for the author's institution. Anyway how can I remove them? Here is the code:               \documentclass{beamer}     \setbeamertemplate{navigation symbols}{}     \usepackage[portuges]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{color}     \newcommand{\hilight}[1]{\colorbox{yellow}{#1}}     \usepackage{soul}          \setbeamercolor{frametitle}{fg=black,bg=white}     \setbeamercolor{title}{fg=black,bg=yellow!85!orange}     \usetheme{AnnArbor}          \beamersetuncovermixins{\opaqueness<1>{25}}{\opaqueness<2->{15}}     \begin{document}     \title{Regras de acentuação}     \author{A. Martins}     \date{\today}       Thanks.


title: How to use a different font for a specific language with XeTeX?

text: I am trying to set a specific font for polutonikogreek. To make it easy to switch to that language, I defined the following command:               \newfontfamily{\Vusillus}[]{Vusillus Old Face}     \newcommand{\greek}[1]{{%     \Vusillus\selectlanguage{polutonikogreek}#1%     }}        But when I try something like this:               \greek{>erot'aw}      the font Vusillus Old Face isn't used, while this:               \Vusillus Something without a meaning      works well. Am I missing something? Here an working example:               \documentclass[10pt,twoside]{memoir}     \usepackage[english,greek,polutonikogreek,ngerman,german]{babel}     \usepackage{blindtext}     \usepackage[utf8]{inputenc}      \usepackage{scrpage2}          % rubber: set program xelatex          \usepackage{fontspec}     \usepackage{xltxtra}     \setmainfont[Numbers={OldStyle},Ligatures={Common, Historic}]{Adobe Garamond Pro}          \newfontfamily{\Vusillus}[]{Vusillus Old Face}     \newcommand{\greek}[1]{{%     \Vusillus\selectlanguage{polutonikogreek}#1%     }}          \begin{document}     Das ist nur ein Flie{\ss}text, sonst nichts: {\greek{>erot'aw}} und {\greek{>'erowc}}.     As you may have noticed the greek words are not in Vusillus, but \Vusillus this text actually is.     \end{document}


title: How to run Metafont in TeXnicCenter

text: I want to create a Feynman diagram, with the `feynmf` package. While compiling, no error occurs, but no diagram is produced. I have searched through the net, and I found that I have to create an mf file. The code I am using is                   \documentclass{article}         \usepackage{feynmf}         \begin{document}         \unitlength = 1mm         % determine the unit for the size of diagram.         ... here comes an example with feynmf          \begin{fmffile}{one}   %one.mf will be created for this feynman diagram              \fmfframe(1,7)(1,7){     %Sets dimension of Diagram            \begin{fmfgraph*}(110,62) %Sets size of Diagram             \fmfleft{i1,i2} %Sets there to be 2 sources              \fmfright{o1,o2}    %Sets there to be 2  outputs             \fmflabel{$e^-$}{i1} %Labels one of the left sources             \fmflabel{$e^+$}{i2} %Labels one of the left sources             \fmflabel{${\ensuremath{\erlpm}}$}{o1} %Labels one of the right outputs             \fmflabel{${\ensuremath{\erlpm}}$}{o2} %Labels one of the right outputs             \fmf{fermion}{i1,v1,i2} %Connects the sources with a vertex.             \fmf{fermion}{o1,v2,o2} %Connects the outputs with a vertex.             \fmf{photon,label=$\gamma/Z^0$}{v1,v2} %Labels the conneting line.            \end{fmfgraph*}           }         \end{fmffile}      The thing is that I have to create one.mf file, run LaTeX, run one.mf and run LaTeX again. How am I supposed to run and create run.mf?


title: Separate chapters, each with individual preface, included in same document

text: I have a document I want to split up into individual sections. I'd like each individual section to be independently compilable, but of course I also need the whole document to compile. The trouble is, each of my individual sections requires a large preface (`\usepackage` calls, command definitions, etc.) that I am including with either `\input` or `\include`. The preface includes the `\documentclass` command, so I end up getting `! LaTeX Error: Can be used only in preamble.` if I try to compile the whole document. I'm already using `\usepackage{subfiles}`, but it doesn't seem to solve the problem.


title: In book class, make the titlepage environment successively displayed

text: I use several `titlepage` environments on book document class as               \documentclass[openany]{book}     \begin{document}     \begin{titlepage}     This page is title page     \end{titlepage}     \begin{titlepage}     This page is title page too     \end{titlepage}     \end{document}      but I want the title page successively displayed (just clear single page) instead of clear double page.


title: An equation skip problem --- amsmath package and \above/belowdisplayskip

text: I have been puzzled by a problem about math equation skip for days. I set the `\lineskiplimit`, `\lineskip`, `\abovedisplayskip` and others length macros before and after equations all to zero, but there has still some skip (see pic). I wanted to know how to get rid of these skip. There is the code               \documentclass{article}     \usepackage{amsmath}     \usepackage[margin=2in]{geometry}     \begin{document}     \setlength{\lineskiplimit}{0pt}     \setlength{\lineskip}{0pt}     \setlength{\abovedisplayskip}{0pt}     \setlength{\belowdisplayskip}{0pt}     \setlength{\abovedisplayshortskip}{0pt}     \setlength{\belowdisplayshortskip}{0pt}\noindent     Some text some text some text some text some text      some text     \begin{equation*}     a+b=c     \end{equation*}     Some text some text some text some text some text some text     \begin{equation*}     1^2+2^2+\dotsb+n^2=\frac{n(n+1)(2n+1)}{6}     \end{equation*}     Some text some text some text some text some text some text     \end{document}      ![](http://i.stack.imgur.com/cZVvn.png)


title: Is it possible to prevent some part of text (headers, footers) from selection?

text: I'm looking for a solution that will allow me to prevent some parts of the final pdf file (header, footer) from being selected and copied. It is to allow easier quoting of longer parts of texts from documents that will be published.


title: Greek character in Beamer document title

text: I need to include the Greek letter sigma in the title of my Beamer presentation. When I use `$\sigma$` to obtain the symbol (which works fine in other LaTeX document titles), I receive the warning messages:               Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):     (hyperref)                removing `math shift' on input line 28.          Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):     (hyperref)                removing `\sigma' on input line 28.          Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):     (hyperref)                removing `math shift' on input line 28.      This appears to be happening whenever I use the math environment within the title, regardless of what text is within the `$ ... $` symbols. Note: the sigma symbol still appears in the PDF, but it worries me that it might cause a problem later on. Is there any way to resolve these warning messages? Alternatively, is there another way to include the letter sigma without using the math environment?


title: blocks attached to each other

text: For my thesis, I often need to write blocks attached to each other. More explicitely, I want to have blocks as in page 13 of http://eprint.iacr.org/2006/392.pdf. **EDIT** : @morbusg. Is it possible to (easily?) fix the following (in order to get what we want)                \begin{figure}      \centerline{\vbox{%        \offinterlineskip % no lead between lines        \dimen0=4.5em % size of a square cell        \mathsurround0pt % precaution; although I've newer seen it used        \def\cr{\crcr\noalign{\hrule}} % put a rule between every row with \cr        \halign{&\vrule\hbox to\dimen0{$\vcenter to\dimen0{}\hfil\scriptstyle#\hfil$}\crcr          \omit& \omit& \multispan3\hrulefill\crcr\noalign{\kern-.4pt}          % ^omit drawing a box for the first two columns, then, span the next          % three columns drawing the "hat", and finally, back up the amount of          % the width of the rule so that the vertical and horizontal rules          % fit together.          \omit& \omit&\omit & W(-k-1,1) & W(-k,1) & W(-k+1,1) &\omit\vrule \cr          W(-k-4,0) & W(-k-3,0) & W(-k-2,0) & W(-k-1,0) & W(-k,0) & W(-k+1,0) & W(-k+2,0) & W(-k+3,0)&\omit\vrule \cr          }      }}      \caption{}      \end{figure}      And also               \begin{figure}[H]          \centerline{\vbox{%       \offinterlineskip % no lead between lines       \dimen0=5em % size of a square cell       \mathsurround0pt % precaution; although I've newer seen it used       \def\cr{\crcr\noalign{\hrule}} % put a rule between every row with \cr       \halign{&\vrule\hbox to\dimen0{$\vcenter to\dimen0{}\hfil\scriptstyle#\hfil$}\crcr         \omit& \omit& \multispan3\hrulefill\crcr\noalign{\kern-.4pt}         % ^omit drawing a box for the first two columns, then, span the next         % three columns drawing the "hat", and finally, back up the amount of         % the width of the rule so that the vertical and horizontal rules         % fit together.         \omit        & W(k-1,2n+2)   & W(k,2n+2) & W(k+1,2n+2) & ? &\omit\vrule \cr         ? & W(k-1,2n+1) & W(k,2n+1) & W(k+1,2n+1)   & ? &\omit\vrule \cr         ? & W(k-1,2n)   & W(k,2n)   & W(k+1,2n)   & ?  &\omit\vrule \cr         ? & W(k-1,2n-1) & W(k,2n-1) & W(k+1,2n-1)   & ? &\omit\vrule \cr         }     }}     \label{Sdouble}     \end{figure}


title: Is there any way to change the design of a line?

text: I'm using `\line(){}` to generate a line for sort of decoration purposes, like having the title, such as Problem Set 1, and then separating it from the rest of the document by a line. I'm wondering if there's a way to change the design of the line (TikZ maybe?) instead of just line thickness.


title: Beamer: Line spacing in title

text: I have a long title for my beamer presentation and ue the `\titlepage{}` command. The title is automatically split over 4 lines. As I am using a tall font (arev), these lines are squashed together. I can use something like `\newline \vskipt6pt` where the line breaks occur to get roughly what I want (using `\\\` seems to insert a spurious comma). I am using the contributed Torino theme. This there a way to `automatically' increase this spacing for the title only?