title: Is there a tool for cleaning BibTeX source from LaTeX style escapes?

text: I have a BibTeX file which uses the old style LaTeX escapes, for example > author = {Fjeld, Morten and Sch\"{a}r, Sissel Guttormsen} I want to read the file with a Scala script using jbibtex and do some stuff with the information from it. But the escapes are getting in the way, and I don't want to implement my own replacement for all possible LaTeX escapes, if I can avoid it. Is there a tool which can be fed LaTeX or BibTeX source, will replace all escaped umlauts and other such with the correct UTF-8 characters, and spit it out without any other changes? I can imagine that my use case is somewhat exotic, but maybe such a tool exists for people who want to convert their old manuscripts to modern technology.


title: Ploblems with vertical lines in algorithmicx

text: I use algorithmicx with verical lines. And code is working good:               \documentclass{article}          \usepackage{algorithm}      \usepackage{algpseudocode}          % Vertical line     \makeatletter     \def\therule{\makebox[\algorithmicindent][l]{\hspace*{.5em}\vrule height .75\baselineskip depth .25\baselineskip}}%          \newtoks\therules% Contains rules     \therules={}% Start with empty token list     \def\appendto#1#2{\expandafter#1\expandafter{\the#1#2}}% Append to token list     \def\gobblefirst#1{% Remove (first) from token list       #1\expandafter\expandafter\expandafter{\expandafter\@gobble\the#1}}%     \def\LState{\State\unskip\the\therules}% New line-state     \def\pushindent{\appendto\therules\therule}%     \def\popindent{\gobblefirst\therules}%     \def\printindent{\unskip\the\therules}%     \def\printandpush{\printindent\pushindent}%     \def\popandprint{\popindent\printindent}%          %      ***      DECLARED LOOPS      ***     % (from algpseudocode.sty)     \algdef{SE}[WHILE]{While}{EndWhile}[1]       {\printandpush\algorithmicwhile\ #1\ \algorithmicdo}       {\popandprint\algorithmicend\ \algorithmicwhile}%     \algdef{SE}[FOR]{For}{EndFor}[1]       {\printandpush\algorithmicfor\ #1\ \algorithmicdo}       {\popandprint\algorithmicend\ \algorithmicfor}%     \algdef{S}[FOR]{ForAll}[1]       {\printindent\algorithmicforall\ #1\ \algorithmicdo}%     \algdef{SE}[LOOP]{Loop}{EndLoop}       {\printandpush\algorithmicloop}       {\popandprint\algorithmicend\ \algorithmicloop}%     \algdef{SE}[REPEAT]{Repeat}{Until}       {\printandpush\algorithmicrepeat}[1]       {\popandprint\algorithmicuntil\ #1}%     \algdef{SE}[IF]{If}{EndIf}[1]       {\printandpush\algorithmicif\ #1\ \algorithmicthen}       {\popandprint\algorithmicend\ \algorithmicif}%     \algdef{C}[IF]{IF}{ElsIf}[1]       {\popandprint\pushindent\algorithmicelse\ \algorithmicif\ #1\ \algorithmicthen}%     \algdef{Ce}[ELSE]{IF}{Else}{EndIf}       {\popandprint\pushindent\algorithmicelse}%     \algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}[2]        {\printandpush\algorithmicprocedure\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%        {\popandprint\algorithmicend\ \algorithmicprocedure}%     \algdef{SE}[FUNCTION]{Function}{EndFunction}[2]        {\printandpush\algorithmicfunction\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%        {\popandprint\algorithmicend\ \algorithmicfunction}%          \makeatother          \begin{document}          \begin{algorithm}       \caption{Examples}\label{alg:Examples}       \begin{algorithmic}[1]       \LState $X=45$       \For{\textbf{от} $i=0$ \textbf{до} 5}       \LState $X=X-2$       \LState \Call {Find}{$X$}       \While{$Y_2<5$}            \If{$quality\ge 9$}       \LState $a\gets perfect$       \ElsIf{$quality\ge 7$}       \LState $a\gets good$       \ElsIf{$quality\ge 5$}       \LState $a\gets medium$       \ElsIf{$quality\ge 3$}       \LState $a\gets bad$       \Else       \LState $a\gets unusable$       \EndIf            \EndWhile       \LState \Return $X$       \EndFor       \end{algorithmic}     \end{algorithm}               \end{document}      ![a busy cat](http://harrix.org/2013-04-24_151430.png)   1. I want translate commands on my language. For common commands translation does not break the vertical line.               \algrenewcommand\algorithmicwhile{\textbf{BlaBlaWhile}}      \algrenewcommand\algorithmicif{\textbf{BlaBlaIf}}      But when I translate the end of the team structures, broken vertical line.                    \algrenewtext{EndWhile}{\textbf{BlaBlaEndWhile}}          \algrenewtext{ElsIf}{\textbf{BlaBlaElsIf }}      Code:                   \documentclass{article}              \usepackage{algorithm}          \usepackage{algpseudocode}              % Vertical line         \makeatletter         \def\therule{\makebox[\algorithmicindent][l]{\hspace*{.5em}\vrule height .75\baselineskip depth .25\baselineskip}}%              \newtoks\therules% Contains rules         \therules={}% Start with empty token list         \def\appendto#1#2{\expandafter#1\expandafter{\the#1#2}}% Append to token list         \def\gobblefirst#1{% Remove (first) from token list           #1\expandafter\expandafter\expandafter{\expandafter\@gobble\the#1}}%         \def\LState{\State\unskip\the\therules}% New line-state         \def\pushindent{\appendto\therules\therule}%         \def\popindent{\gobblefirst\therules}%         \def\printindent{\unskip\the\therules}%         \def\printandpush{\printindent\pushindent}%         \def\popandprint{\popindent\printindent}%              %      ***      DECLARED LOOPS      ***         % (from algpseudocode.sty)         \algdef{SE}[WHILE]{While}{EndWhile}[1]           {\printandpush\algorithmicwhile\ #1\ \algorithmicdo}           {\popandprint\algorithmicend\ \algorithmicwhile}%         \algdef{SE}[FOR]{For}{EndFor}[1]           {\printandpush\algorithmicfor\ #1\ \algorithmicdo}           {\popandprint\algorithmicend\ \algorithmicfor}%         \algdef{S}[FOR]{ForAll}[1]           {\printindent\algorithmicforall\ #1\ \algorithmicdo}%         \algdef{SE}[LOOP]{Loop}{EndLoop}           {\printandpush\algorithmicloop}           {\popandprint\algorithmicend\ \algorithmicloop}%         \algdef{SE}[REPEAT]{Repeat}{Until}           {\printandpush\algorithmicrepeat}[1]           {\popandprint\algorithmicuntil\ #1}%         \algdef{SE}[IF]{If}{EndIf}[1]           {\printandpush\algorithmicif\ #1\ \algorithmicthen}           {\popandprint\algorithmicend\ \algorithmicif}%         \algdef{C}[IF]{IF}{ElsIf}[1]           {\popandprint\pushindent\algorithmicelse\ \algorithmicif\ #1\ \algorithmicthen}%         \algdef{Ce}[ELSE]{IF}{Else}{EndIf}           {\popandprint\pushindent\algorithmicelse}%         \algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}[2]            {\printandpush\algorithmicprocedure\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%            {\popandprint\algorithmicend\ \algorithmicprocedure}%         \algdef{SE}[FUNCTION]{Function}{EndFunction}[2]            {\printandpush\algorithmicfunction\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%            {\popandprint\algorithmicend\ \algorithmicfunction}%              \makeatother              \begin{document}              \algrenewcommand\algorithmicwhile{\textbf{BlaBlaWhile}}         \algrenewcommand\algorithmicif{\textbf{BlaBlaIf}}              \algrenewtext{EndWhile}{\textbf{BlaBlaEndWhile}}         \algrenewtext{ElsIf}{\textbf{BlaBlaElsIf }}              \begin{algorithm}           \caption{Examples}\label{alg:Examples}           \begin{algorithmic}[1]           \LState $X=45$           \For{\textbf{от} $i=0$ \textbf{до} 5}           \LState $X=X-2$           \LState \Call {Find}{$X$}           \While{$Y_2<5$}                \If{$quality\ge 9$}           \LState $a\gets perfect$           \ElsIf{$quality\ge 7$}           \LState $a\gets good$           \ElsIf{$quality\ge 5$}           \LState $a\gets medium$           \ElsIf{$quality\ge 3$}           \LState $a\gets bad$           \Else           \LState $a\gets unusable$           \EndIf                \EndWhile           \LState \Return $X$           \EndFor           \end{algorithmic}         \end{algorithm}                   \end{document}      ![a busy cat](http://harrix.org/2013-04-24_153318.png) How to fix it?   1. When I use a big formula with a height greater than the height line, vertical line breaks.              \documentclass{article}          \usepackage{algorithm}      \usepackage{algpseudocode}          \usepackage{amsthm,amsfonts,amsmath,amssymb,amscd}           % Vertical line     \makeatletter     \def\therule{\makebox[\algorithmicindent][l]{\hspace*{.5em}\vrule height .75\baselineskip depth .25\baselineskip}}%          \newtoks\therules% Contains rules     \therules={}% Start with empty token list     \def\appendto#1#2{\expandafter#1\expandafter{\the#1#2}}% Append to token list     \def\gobblefirst#1{% Remove (first) from token list       #1\expandafter\expandafter\expandafter{\expandafter\@gobble\the#1}}%     \def\LState{\State\unskip\the\therules}% New line-state     \def\pushindent{\appendto\therules\therule}%     \def\popindent{\gobblefirst\therules}%     \def\printindent{\unskip\the\therules}%     \def\printandpush{\printindent\pushindent}%     \def\popandprint{\popindent\printindent}%          %      ***      DECLARED LOOPS      ***     % (from algpseudocode.sty)     \algdef{SE}[WHILE]{While}{EndWhile}[1]       {\printandpush\algorithmicwhile\ #1\ \algorithmicdo}       {\popandprint\algorithmicend\ \algorithmicwhile}%     \algdef{SE}[FOR]{For}{EndFor}[1]       {\printandpush\algorithmicfor\ #1\ \algorithmicdo}       {\popandprint\algorithmicend\ \algorithmicfor}%     \algdef{S}[FOR]{ForAll}[1]       {\printindent\algorithmicforall\ #1\ \algorithmicdo}%     \algdef{SE}[LOOP]{Loop}{EndLoop}       {\printandpush\algorithmicloop}       {\popandprint\algorithmicend\ \algorithmicloop}%     \algdef{SE}[REPEAT]{Repeat}{Until}       {\printandpush\algorithmicrepeat}[1]       {\popandprint\algorithmicuntil\ #1}%     \algdef{SE}[IF]{If}{EndIf}[1]       {\printandpush\algorithmicif\ #1\ \algorithmicthen}       {\popandprint\algorithmicend\ \algorithmicif}%     \algdef{C}[IF]{IF}{ElsIf}[1]       {\popandprint\pushindent\algorithmicelse\ \algorithmicif\ #1\ \algorithmicthen}%     \algdef{Ce}[ELSE]{IF}{Else}{EndIf}       {\popandprint\pushindent\algorithmicelse}%     \algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}[2]        {\printandpush\algorithmicprocedure\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%        {\popandprint\algorithmicend\ \algorithmicprocedure}%     \algdef{SE}[FUNCTION]{Function}{EndFunction}[2]        {\printandpush\algorithmicfunction\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}%        {\popandprint\algorithmicend\ \algorithmicfunction}%     \makeatother          \begin{document}          \begin{algorithm}       \caption{Examples}\label{alg:Examples}       \begin{algorithmic}[1]       \LState $X=45$       \For{\textbf{от} $i=0$ \textbf{до} 5}       \LState $X=X-2$       \LState \Call {Find}{$X$}       \While{$Y_2<5$}            \If{$quality\ge 9$}       \LState $a\gets perfect$       \ElsIf{$quality\ge 7$}       \LState Try       \begin{flalign*}         &\left( \begin{array}{c} X_{B} \\ f_B\left( \bar{x}_{B}\right)  \\ {g_i}_B\left( \bar{x}_B\right) \\ {h_j}_B\left( \bar{x}_B\right) \\ ParametersOfBinaryGA\end{array}\right)\\         &=ConvertingIntoBinaryGA\left( \begin{array}{c} X \\ f\left( \bar{x}\right) \\ g_i\left( \bar{x}\right) \\ h_j\left( \bar{x}\right) \\ ParametersOfBinaryGA \\ ParametersOfConvertingIntoBinaryGA \end{array}\right)         \end{flalign*}       \ElsIf{$quality\ge 5$}       \LState $a\gets medium$       \ElsIf{$quality\ge 3$}       \LState $a\gets bad$       \Else       \LState $\left( \begin{array}{c} X_{B} \\ f_B\left( \bar{x}_{B}\right)  \\ {g_i}_B\left( \bar{x}_B\right) \\ {h_j}_B\left( \bar{x}_B\right) \\ ParametersOfBinaryGA\end{array}\right)$       \EndIf            \EndWhile       \LState \Return $X$       \EndFor       \end{algorithmic}     \end{algorithm}               \end{document}      ![a busy cat](http://harrix.org/2013-04-24_155014.png) How to fix it?


title: Changing textwidth with adjustwidth* in memoir

text: I'm using `memoir` with non-equal left and right margins and encounter a problem when I use the `adjustwidth*` environment to get three equally spaced columns with equal margins in the index. According to the `memoir` manual (bottom of p. 144 of latest version dated 2011/03/06), the changes do not get changed properly across page breaks. That is, if the right (outer) margin is shifted outward on an odd (recto) page, the same will be true on the next (even/verso) page. But this is not what I need. Furthermore, I'm a little confused by the fact that the `memoir` manual states (p. 340) that `changepage` contains code identical to memoir, but the `\changetext` command provided by `changepage` is not available in memoir. At the moment, it appears to me that the `\changetext` command provided by `changepage` is what I need to use, but I'm wondering whether there's a way to do all this inside `memoir` without an additional package.


title: Include Sweave input as verbatim

text: How do I keep Sweave from compiling things in a verbatim environment? For example:               \documentclass{article}     \begin{document}     \begin{verbatim}     <<>>=     1+1     @      \end{verbatim}     \end{document}      Results for me in a pdf with:               \begin{Schunk}     \begin{Sinput}     > 1+1     \end{Sinput}     \begin{Soutput}     [1] 2     \end{Soutput}     \end{Schunk}      But I just wanted the input commands. * * * To be more clear, I want the output in this pdf file to be exactly:               <<>>=      1+1      @


title: If two columns LaTeX

text: I am writing a paper in LaTeX. I will need both the one-column and two-column versions of the paper. For this, the figure sizes/configurations need to be different in the two documents. I am looking for a command like `\iftwocolumn`! Do you know if it exists and if not how can I define and use it? I would need something like:               \begin{figure}[tb]     \iftwocolumn\includegraphics[width=0.7\linewidth]{FiguresDouble/figure.eps}     \else\includegraphics[width=0.5\linewidth]{FiguresSingle/figure.eps}     \fi


title: How to use getnodelist?

text: Taken from `pst-node`'s documentation on page 39: This very short description about `\getnodelist` does not help me (maybe others as well) understand how to use it. ![enter image description here](http://i.stack.imgur.com/X4pft.png) Could you give me an example how to use `\getnodelist` with non-empty `<next command>`?


title: How to create internet link in PDF?

text: Let us consider the following example :               \documentclass[11pt,twoside,a4paper]{book}     \usepackage{hyperref}     \begin{document}     For more information about 'TikZ' click on the following link :     \href{url}{http://www.texample.net/tikz/resources/}     \end{document}      This gives :   ![enter image description here](http://i.stack.imgur.com/HdjBp.png) When I click on the link on the PDF file it is not working. What is the way to go webpage clicking on the link ?


title: Description list - How to put the definition on a new line?

text: I have the following LaTeX code:               \documentclass{article}     \begin{document}     \begin{description}          \item[foo]     bar          \item[baz]          bang          \end{description}          \end{document}      and it produces the following PDF: ![enter image description here](http://i.stack.imgur.com/DmQVv.png) I want the definition of the item (in this case the "bar" and the "bang") to be on a separate line from the item (eg the "foo" and the "baz"). However this is part of a system that autogenerates documention, so I can't change the source code. I can put style things in the header of each documention, so I need some sort of LaTeX command that will make all definition list (in LaTeX speak, a "descripition list") go onto a new line.


title: Text within ExplSyntaxOn/Off

text: As below, I would like to test whether a user has input some custom text, and if not, then to display default text.               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn     \tl_new:N \l_empty_tl          \NewDocumentCommand{\dostuff}{}{         \tl_if_empty:NTF \l_empty_tl             {Here is a large block of default text that I would like use.}             {\tl_use:N \l_empty_tl}     }          \ExplSyntaxOff     \begin{document}          \dostuff          \end{document}      I would prefer not to type `Here~is~a~large...` and wonder whether there is a simple way to have the spaces recognized. I have tried               {\cctab_begin:N \c_document_cctab Here is a large..\cctab_end:}      to no avail. I feel like this might be a dupe, but can't seem to find a relevant question.


title: How to fix this fancy heading in ConTeXT

text: I don't know if this is a duplicate or not but we can close it if it is. I have been trying to learn `ConTeXt`. I specially love the heading and page number formattings that I see in the documentations that I have downloaded, achieved through the use of `Metapost`/`Metafun`. I have been trying to achieve this effect in `\chapter` (produced in LaTeX through `egreg`'s `gmp` package. ![enter image description here](http://i.stack.imgur.com/xH5u8.png) To this end I have copied and pasted codes from several files found from here. This is the output I am getting for now. ![enter image description here](http://i.stack.imgur.com/0ztq8.png) with this code.               \setuppapersize[A4][A4]     \setuplayout[topspace=0.5in, backspace=1in, header=24pt, footer=36pt,       height=middle, width=middle]          \def\MPclipOne#1#2#3#4#5%       {\startuseMPgraphic{clip:one}          w := #1;  width  := 100;  wfactor := w/width;          h := #2;  height := 100;  hfactor := h/height;          %          color lightred;  lightred  := (.90,.50,.50);          color lightgray; lightgray := (.95,.95,.95);          color gray;      gray      := (.50,.50,.50);          %          def random_delta (expr d) =            d-(uniformdeviate 2d)          enddef;          %          z1 = (0,height);          z2 = (0,0);          z3 = (width,0);          z4 = (width,height);          %          z5 = (width+random_delta(.2width),height+random_delta(.2height));          z6 = (.5width+random_delta(.1width),height+random_delta(.1height));          %          pickup pencircle            xscaled (#3/wfactor)            yscaled (#3/(2*hfactor))            rotated 30;          %          draw z5..z1..z2..z3..z4..z6 withcolor #4;          %          pickup pencircle            xscaled (#3/wfactor)            yscaled (#3/hfactor);          %          draw z1 withcolor #5;          draw z2 withcolor #5;          draw z3 withcolor #5;          draw z4 withcolor #5;          draw z5 withcolor #5;          draw z6 withcolor #5;          %          newwidth  := (xpart (urcorner currentpicture)) -                       (xpart (llcorner currentpicture));          newheight := (ypart (urcorner currentpicture)) -                       (ypart (llcorner currentpicture));          %          currentpicture := currentpicture           xscaled (w/newwidth) yscaled (h/newheight);        \stopuseMPgraphic        \useMPgraphic{clip:one}{}}          \defineoverlay       [KopAchtergrond]       [\MPclipOne{\overlaywidth}{\overlayheight}{10pt}{gray}{red}]          \def\HeadCommand#1#2%       {\alignedline{\v!outer}{\v!left}          {\framed             [\c!background=KopAchtergrond,              \c!width=\v!fit,              \c!height=\v!fit,              \c!frame=\v!off,              \c!strut=\v!no,              \c!offset=24pt,              \c!align=\v!middle]             {\doifmode{*sectionnumber}                {#1\kern.5em% strut niet geset, zou wel moeten                 \hbox{\color[headrule]{\vrule\!!width1pt\!!height1.5\ht\strutbox\!!depth1.25\dp\strutbox}}%                 \kern.5em}%              #2}}}          \setuphead       [\v!chapter]       [\c!command=\HeadCommand,        \v!appendix\c!label=none,        \c!page=,        \c!before=\vskip36pt plus 6pt minus 6pt,        \c!after=\vskip24pt]          \starttext          \chapter{Sample chapter}          \stoptext      Please make me understand what is happening here and how to achieve my desired effect?


title: Tilde in math mode using helvetica

text: I am forced to use Arial for my thesis. My configuration as shown in the minimal working example below works fine for me exept for the tilde. It does not blend in well and has too much space above and below it (compare it to the tilde in text-mode). Does anybody have a hint?               \documentclass{scrbook}          \usepackage[scaled=0.92]{helvet}     \usepackage[ngerman]{babel}      \usepackage{mathtools}     \usepackage[helvet]{sfmath}            \renewcommand{\familydefault}{\sfdefault}                \begin{document}          \~{l} = \~{a}         \begin{align*}             \overset{\sim}{l}= \sqrt{\overset{\sim}{[a]}}\\         \end{align*}     \end{document}


title: Changing view angle distorts sphere with pgfplots

text: I am trying to learn how to use `pgfplots` by plotting simple things, like a two-dimensional sphere. However, I find it quite surprising that depending on the view angle, the result sometimes does not look like a sphere at all. Unless I am missing something, a sphere should like the same no matter which direction we are looking from. Here is my example code:               \documentclass[a4paper,landscape]{article}          \usepackage{tikz}     \usepackage{pgfplots}          \pgfplotsset{width=6cm}          \newcommand{\degree}{\ensuremath{^\circ}}     \newcommand{\plotsphere}[2]{     \begin{axis}[view={#2}{#1},axis equal,title={$\theta=#1\degree,\quad \phi=#2\degree$}]     \addplot3[surf,shader=flat,z buffer=sort,     samples=20,domain=-1:1,y domain=0:2*pi]     ({sqrt(1-x^2) * cos(deg(y))},     {sqrt( 1-x^2 ) * sin(deg(y))},     x);     \end{axis}     }          \begin{document}     \pagestyle{empty}     \begin{figure}     \begin{tikzpicture}[scale = 0.75]     \foreach \x/\polangle in {-8/20,0/45,8/70}         \foreach \y / \azangle in {-8/20,0/45,8/70}             \node at (\x,\y) {\plotsphere{\polangle}{\azangle}};     \end{tikzpicture}     \end{figure}     \end{document}      and the result: ![enter image description here](http://i.stack.imgur.com/NkGfh.png) The only version I am satisfied with is `view={45}{45}`. All the other ones appear distorted. It seems that this distortion does not come from different length units on the axis because I am using the `axis equal` option. Am I forgetting some important parameter?


title: Bad width of head of longtable

text: Here is an MWE:               \documentclass[a4paper,11pt]{article}     \usepackage{soul}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{longtable}     \usepackage{booktabs}     \usepackage{multirow}     \usepackage{fontspec}     \setmainfont{Arial}     \usepackage{hyperref}     \begin{document}          \begin{longtable}{@{}rrrrrrr@{}} \toprule         \multicolumn{7}{c}{Vertical} \\             $i$           & \multicolumn{2}{c}{$\langle x^1_{i}, y^1_{i} \rangle$}           & \multicolumn{2}{c}{$\langle x^2_{i}, y^2_{i} \rangle$}           & $\measuredangle_{i}$ & $m_{i}$ \endhead \midrule                       $1$         &   $\langle 17.90,$ & $27.19 \rangle$         &   $\langle -192.10,$ & $69.53 \rangle$         &   $-90.0°$         &   $29$ \\                  $2$         &   $\langle 47.65,$ & $31.32 \rangle$         &   $\langle -162.35,$ & $73.66 \rangle$         &   $-90.0°$         &   $21$ \\                  $3$         &   $\langle 85.94,$ & $32.43 \rangle$         &   $\langle -124.06,$ & $74.77 \rangle$         &   $-90.0°$         &   $27$ \\                  $4$         &   $\langle 117.53,$ & $34.29 \rangle$         &   $\langle -92.47,$ & $76.63 \rangle$         &   $-90.0°$         &   $23$ \\                  $5$         &   $\langle 154.71,$ & $29.83 \rangle$         &   $\langle -55.29,$ & $72.17 \rangle$         &   $-90.0°$         &   $21$ \\       \addlinespace                  \multicolumn{3}{l}{Average}         &   \multicolumn{4}{r}{$\tilde{m} = \frac{1}{n}\sum_{i=1}^{n}m_{i}$} = $24.0$ \\ \bottomrule          \end{longtable}               \end{document}      Result: ![Bad width of head of longtable](http://i.stack.imgur.com/gN7nT.png) The obvious problem is that header columns are misaligned. `$i$` should be above the numbers (first column) and `$m_i$` should be above the last column.


title: Putting two images next to each other that are 0.5\textwidth wide

text: I need to put 4 images in one group and put it on the page. All images have the same length and width, however I have problem with placing them by two in a row. I used this code               \begin{figure}[h]     \centering     \includegraphics[width=0.5\textwidth]{CircleTemplate.eps}     \includegraphics[width=0.5\textwidth]{CircleOlimpicStarting.eps}     \includegraphics[width=0.5\textwidth] {CircleOlimpicFinishing.eps}     \includegraphics[width=0.5\textwidth] {CircleOlimpicFinishingWithNoise.eps}     \caption{Some long long caption  }     \label{fig:OlimpicCircleTT1}     \end{figure}      however it doesn't work - images were added one below the other. I also would like to put two (4 images) group in one page. Is it possible to adjust dimensions of these images somehow to fit all these images in one page Please take a look at the pictures which show what I want to achieve This is what I want to acomplish: ![](http://i.stack.imgur.com/pCkZ9.png) And this is what I get using the code presented at the beginning: ![](http://i.stack.imgur.com/IBCsc.png)


title: TikZ Externalize & Linegoal conflict?

text: I'm new to stackexchange, and did not find any information about this issue. I encounter an error whenever I try to use the TikZ's externalize along with (unrelated to TikZ pictures-) `\linegoal`. My engine is MikTeX on Win7 with TeXstudio. As soon as the `linegoal` package is used along with `externalize`, `linegoal` throws an error:               ! Package linegoal Error: \linegoal does not work if output file are disabled      (linegoal) please check the value of \if@filesw!.      A MWE is:               \documentclass[11pt]{article}     \usepackage{linegoal}     \usepackage{tikz}     \usetikzlibrary{external}     \tikzexternalize     \begin{document}       \begin{tikzpicture}         \draw (0,0) -- (1,1);       \end{tikzpicture}            \parbox[t]{\linegoal}{test}     \end{document}      Does anyone have an idea on how to solve that?


title: How can I get TeXstudio's syntax highlighting to recognize an unknown command?

text: TeXstudio does not recognize the LaTeX command `\rm` (red highlighting in the document, with the message: `unrecognized command`), even after I activate all possible completion files (`.cwl`). In such a case, what can I do so that TeXstudio recognizes a certain command for highlighting?


title: Autofit for inline equations

text: I am trying to use an inline equation to list bunch o tuples. However, I it does not automatically go to next line. I am doing it manually, but this time it looks ugly. By the way I am writing in a two column template, so I have limited space at each line. Here is what I do: > ${x_i,\;y_i }$= $ {{60,45},\; {60,90},\;{60,135},\;{60,180},\;{60,225},\; \ > {100,90},\; {100,160},\;{100,225}} $ Is there a way to automatically do this?


title: Looking for a symbol (arrow with dot)

text: I am looking for this symbol: ![image](http://i.stack.imgur.com/z8SUm.png) I recently discovered it in a paper. However, I was not able to find it in the "Comprehensive List" (`symbols-a4.pdf`) or anywhere else.


title: Amsbook \part error

text: In my tex file I have               \documentclass[11pt]{amsbook}          \usepackage{amsmath,caption,fancyhdr,multirow,booktabs,lscape,pbox}     \usepackage{amssymb,nomencl,todonotes,framed,booktabs,graphicx}     \usepackage{amsthm,amsfonts,graphicx,graphics,epstopdf,amsxtra,amscd,color,latexsym,mathrsfs,bbding,rotating,mathdots,mathrsfs,hyperref}     \usepackage{enumitem}     \usepackage{pdfsync}          \usepackage{vmargin}     \setmarginsrb   {1.47in}  % left margin             {0.7in}  % top margin             {1.1in}  % right margin it was {1.1in}             {0.6in}  % bottom margin             {5pt}  % head height -- it was {15pt}             {0.2in}  % head sep             {13pt}  % foot height %WAS 9pt             {0.4in}  % foot sep          \usepackage{fancyhdr}     \lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}     \rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}     \chead{}\lfoot{}\rfoot{}\cfoot{}     \pagestyle{fancy}     \usepackage{chngcntr}     \counterwithin{table}{section}%number the table as Table.c.s.t//  c=chapter, s=section,t=table     \usepackage[font=bf]{caption}          \begin{document}           \author{My name}      \title{PhD. Thesis}      \date{\today}           \include{titlepage}          \frontmatter     \include{abstract}               \newpage ~     \thispagestyle{empty}\newpage               \tableofcontents           \mainmatter                    \part{Background}     \chapter{First Chapter}     Hello     \end{document}      I work on MacOS. There were no problems or errors with my set up till February (last time I compiled my tex file). In this week I upgraded my OS to Maverick and I had to install again MacTeX + TeXShop. Now I have TeXShop Version 3.18 (3.18). I don't remember which version I had few months ago. Compiling for the first time my file, called "Thesis.tex" today I get the following error:               ) [10]     ./Thesis.tex:304: Missing { inserted.     <to be read again>                        #     l.304 \part{Background}          ?      I have figured out why \part{..} is not liked. If you want you can delete this thread or keep it here for future references. I have done several attempts:   1. As it is --> the error as above is detected   2. Deleting \part{..} --> It works with no errors   3. Avoid to use \usepackage{pdfsync} --> Everything works fine!!! So apparently the package _pdfsync_ is clashing with the amsbook command \part.


title: Can a file know if it has been \include'ed or \input'ed?

text: I have a somewhat large User's Guide for a code I've been working on with collaborators. Each chapter is in a subdirectory of the top directory, which includes the .tex file that grabs and stitches together all the individual chapter .tex files into the complete document. Sometimes it is useful to compile and look at just one chapter individually. This got me curious to see if (La)TeX can handle the following: **Can (La)TeX determine during compilation if a .tex file was`\input`'ed or `\include`'ed from another file?** An example use case would be to only include a `\documentclass`, `\begin{document}`, etc. if the file were _not_ `\include`'ed or `\input`'ed from another file. _Yes, I understand this can be worked around in other ways, i.e. smart use of`\includeonly`, but I'm curious if this can be done in a more automatic fashion._ For those familiar with `Python`, what I'm really looking for is something equivalent to the usual               if __name__ == "__main__":      check to see if the current file is the main module, or if it has been `import`'ed by another file.


title: Tikz - help me clean up this figure?

text: I would like the w_{n-1} label to show up below the line, and to have the $\vodts$ be spaced more clearly. How can I do this?               \documentclass{report}     \usepackage{graphicx}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes, automata}     \begin{document}     \begin{tikzpicture}[shorten >=1pt,node distance=2cm,>=stealth',thick, thresh/.style={circle,fill=blue!20,draw,font=\sffamily\Large\bfseries}]         \node[thresh] (1) {$\theta$};         \coordinate[left of=1] (d2);         \coordinate[below of=d2] (invis);         \coordinate[above of=d2] (d1);         \coordinate[below of=d2] (d3);         \coordinate[right of=1] (outer);         \draw [->] (1) to[in=60,out=90,loop] node[auto] {$w_n$} (1);         \draw [->] (invis) to node[auto] {$\vdots$} (1);         \draw [->] (d1) to[] node[auto] {$w_1$} (1);         \draw [->] (d2) to node[auto] {$w_2$} (1);         \draw [->] (d3) to node[in=260] {$w_{n-1}$} (1);         \draw [->] (1) to node[auto] {$f(x_1, \ldots, x_n)$} ++ (3,0);     \end{tikzpicture}          \end{document}


title: metapost, metaobj and labels

text: I found this trick posted by Aditya some time ago that allowed to use metaobj in context. Currently this code no longer works. Currently, are there any way to use metaobj in context? The main problem are the labels. There's a wiki article about this (http://wiki.contextgarden.net/MetaObj_and_Labels), but this solution don't work anymore. From Aditya:               \startMPinclusions[+]        input metaobj;        boolean flag; flag := false;     \stopMPinclusions          \startMPdefinitions        vardef newSegment@\#=          if not flag :            assignObj(@\#,"Segment");            ObjPoint a,b;            ObjCode "@\#b-@\#a=(1cm,2cm)";          fi ;        enddef;             def drawSegment(suffix n)=          draw n.a--n.b;          draw btex \tt \overbar{E} etex shifted n.a; % 1        enddef;     \stopMPdefinitions          \starttext     \startMPpage        newSegment.s;        ObjLabel.s(btex hello! etex) "labpoint(a)"; % 2        s.a=origin;        drawObj(s);        flag := true ;     \stopMPpage     \stoptext


title: Removing fields from BibDesk

text: Apologies if this question has been posted somewhere else, but I have not managed to find an answer that works for me. I am trying to create a bibliography using Harvard style, using BibDesk to create the .bib file, and Biber and BibLatex. However, the bibliography contains the DOI, the URL, the ISSN, a further e-print URL - all things I do not want. My question is: is there a way to delete these fields in BibDesk, so that they are absent in the .bib file?


title: Endfloat: How to hide figures but show the list of figures

text: I'm preparing a manuscript for a journal paper, and the journal is requiring to include only the table of figures (ToF) at the end of the manuscript and not the figures (which will be uploaded separately). Is there any way to achieve this using `endfloat` package (or any other way without tearing it apart)?


title: pgfplotstable multiple columns same heading name

text: I have some x y data that I wish to typeset using `pgfplotstable`, rather than having say 9 rows of 2 columns, I would like to have 3 rows, with 3 sets of xy pairs. Consider the following:               \documentclass{article}     \usepackage{pgfplotstable,filecontents}          \begin{filecontents}{mydata.dat}         x y x y x y         0 0 3 3 6 6         1 1 4 4 7 7         2 2 5 5 8 8     \end{filecontents}          \begin{document}         \pgfplotstableset{             columns/x/.style={                  column name={$X$},             },             columns/y/.style={                   column name={$Y$},                   column type/.add={}{|}             },         }         \pgfplotstableread{mydata.dat}\loadedtable         \pgfplotstabletypeset{\loadedtable}     \end{document}      Which produces the following output: ![Output](http://i.stack.imgur.com/Y8PZJ.png) Clearly columns 2 to 6, in this MWE are not being typeset as desired. I am aware that this can be resolved by declaring unique column style for each column as follows:               \pgfplotstableset{       columns/A/.style={         column name={$X$},       },       columns/B/.style={         column name={$Y$},         column type/.add={}{|}       },       columns/C/.style={        column name={$X$},       },       columns/D/.style={         column name={$Y$},         column type/.add={}{|}       },       columns/E/.style={         column name={$X$},       },       columns/F/.style={         column name={$Y$},         column type/.add={}{|}       },     }      Also slightly modifying the input data structure:               \begin{filecontents}{mydata.dat}         A B C D E F         0 0 3 3 6 6         1 1 4 4 7 7         2 2 5 5 8 8     \end{filecontents}      Producing the desired format, with column names [X Y X Y X Y]: ![Desired](http://i.stack.imgur.com/0Qip8.png) But I am trying to avoid having to effectively re-type the same code over and over. How can I use the same `pgfplotstableset` column style, for multiple columns in the same table.


title: KOMA classes and \LoadClass

text: I want to create a document class based on a KOMA-Script class. If `myclass.cls` contains the following               \ProvidesClass{myclass}[2011/08/31]     \LoadClass[paper=a5]{scrartcl}      then compiling a document whose first line is `\documentclass{myclass}` generates the warning               LaTeX Warning: Unused global option(s):         [paper=a5].      The same problem occurs with `scrbook` and `scrreprt`. What am I doing wrong?


title: Handwriting drill sheets

text: I am looking to create some handwriting drill sheets. Similar to what can be found here http://www.handwritingworksheets.com/flash/cursive/paragraph/index.html I also found this question: Writing practice sheets - dotted letters But I'd like to be able to simply write a paragraph of text with a known font and have the lines placed behind, perhaps like a watermark. I have found a git repo with some nice lines in both portrait and landscape here https://github.com/gkthiruvathukal/kindergarten From the kindergarten example, I would like to overlay "phantom" text (probably a dotted cursive font) over the lines that are generated. Any thoughts?               \documentclass[10pt,letterpaper]{article}          \usepackage[latin9]{inputenc}     \usepackage{geometry}     \geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}     \pagestyle{empty}     \usepackage{dashrule}     \usepackage{forloop}     \makeatother          \setlength{\parindent}{0pt}          \begin{document}          \newcounter{ct}     \forloop{ct}{1}{\value{ct} < 13}     {     \vskip 10pt     \rule[1.75ex]{7.5in}{1pt}     \\     \hdashrule{7.75in}{1pt}{4mm}     \\     \rule[-1.75ex]{7.5in}{1pt}     \\     }          \vskip 1cm          \end{document}      *Edit: I also just found this source: http://failuresandfixes.blogspot.com/2011/12/faking-baseline-grid-in-latex.html So some combination of these makes sense to me, I'm just not clear on how... *Edit: Okay, So I've gotten pretty far here. But it seems like several parameters need to be functions of each other some how. The line spacing, the font size, etc. Here is where I am:               \documentclass[10pt,letterpaper,english]{article}          \usepackage{babel}      \usepackage{blindtext}           \usepackage{setspace}          \usepackage[latin9]{inputenc}     \usepackage{geometry}     \geometry{verbose,tmargin=1cm,bmargin=1cm,lmargin=1cm,rmargin=1cm}     \pagestyle{empty}     \usepackage{dashrule}     \usepackage{forloop}     \makeatother          \usepackage{xcolor}          \newcommand{\baselinegrid}{%       \raisebox{0pt}[\height][0pt]{\makebox[0pt][l]{%       \begin{minipage}[t]{\textwidth}%         \begin{color}{red}%         \newcounter{ct}         \forloop{ct}{1}{\value{ct} < 11}         {         %\vskip 15pt         \rule[0.5ex]{7.5in}{1pt}         \\         \hdashrule[0.75ex]{7.75in}{1pt}{4mm}         \\         \rule[1.2ex]{7.5in}{1pt}         \\         }         \end{color}       \end{minipage}%     }}}          \begin{document}            \baselinegrid%          \begin{spacing}{2.5}            \usefont{T1}{wela}{m}{n}       \fontsize{30}{15}\selectfont       \setlength{\parskip}{0pt}       \setlength{\parindent}{0pt}            DURING the whole of a dull, dark, and soundless day in the autumn of the year, when the clouds hung oppressively low in the heavens, I had been passing alone, on horseback, through a singularly dreary tract of country; and at length found myself, as the shades of the evening drew on, within view of the melancholy House of Usher.          \end{spacing}          \end{document}


title: How to call figures automatically for print and web with different file namings but in the same Art folder

text: I'm using 2 types of figures; colour figures for web and black & white for print. But, both these files are in the same folder with the namings mentioned below. `abcdef.eps` for Print figures   `abcdef_online.eps` for Web figures During, web PDF I need to call `abcdef_online.eps` and for printer `abcdef.eps`. Is there any automation script to pick the figures automatically for different stages from the same folder? Please note that for web PDF, not all the figures will be in colour, for example out of 6 figures only 3 figures (1,3, and 5) are in colour.               one_online.eps     two.eps     three_online.eps     four.eps     five_online.eps     six.eps      Could any one guide me on this?


title: Suppressed figure numbers in \subcaptionbox still increase figure counter

text: I want to suppress numbering in some figures. In single figures, the use of `\caption*` works fine - see first two pictures in MWE below. However, when I have two subfigures in a figure-environment (set with `\subcaptionbox`), the use of `\caption*` and `\subcaptionbox*` does suppress the figure numbering, yet the figure counter is updated, resulting in a 'missing' figure number. In the MWE below I would expect the last figure to be number two - as it is the second numbered figure, but it is numbered as three. Can anyone help me solve this issue?               \documentclass{article}     \usepackage[demo]{graphicx}     \usepackage{caption}     \usepackage{subcaption}     \begin{document}          \begin{figure}[h] %first figure - nonnumbered     \centering     \includegraphics[width=4cm]{chick}     \caption*{Non-numbered single chick}     \end{figure}          \begin{figure}[h] %second figure, but first numbered figure - counter should be 1     \centering     \includegraphics[width=4cm]{chick}     \caption{Numbered single chick}     \end{figure}          \begin{figure}[h] %third figure, nonnumbered     \centering     \subcaptionbox*{chick}[4cm]{\includegraphics{chick}}\hspace{1cm}     \subcaptionbox*{chick}[4cm]{\includegraphics{chick}}     \caption*{Two non-numbered chicks}     \end{figure}          \begin{figure}[h] %fourth figure, numbered, counter should be 2, but is 3     \centering     \subcaptionbox{chick}[4cm]{\includegraphics{chick}}\hspace{1cm}     \subcaptionbox{chick}[4cm]{\includegraphics{chick}}     \caption{Two numbered chicks}     \end{figure}     \end{document}


title: Proper way to include unnumbered chapters in a per-chapter bibliography using biblatex

text: I've been using example `3.11.4` of the `biblatex` documentation to generate a per-chapter bibliography at the end of my thesis. It works great, until I try to make my introduction into an unnumbered chapter. Then, the introduction does not appear in the bibliography. Here's a MWE:               \documentclass{book}          \usepackage[sorting = none, style = numeric, refsegment = chapter, cite reset = chapter]{bib latex}     \usepackage{nameref}          \defbibheading{bibintoc}{%       \addcontentsline{toc}{chapter}{\bibname}%       \section*{References for Chapter \ref{refsegment:\therefsection\therefsegment} - \nameref{refsegment:\therefsection\therefsegment}}}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{B02,       author = {Buthor, B.},       year = {2002},       title = {Bravo},     }     @misc{C03,       author = {Cuthor, C.},       year = {2003},       title = {Charlie},     }     \end{filecontents}     \addbibresource{\jobname.bib}          \begin{document}          \chapter*{Introduction}          \cite{A01}          \chapter{Chapter 1}          \cite{A01,B02}          \backmatter          \printbibheading     \bibbysegment[heading = bibintoc]          \end{document}      I found a work-around, using a refsection for the unnumbered Introduction. Here's a MWE of the workaround:               \documentclass{book}          \usepackage[sorting = none, style = numeric, refsegment = chapter, cite reset = chapter]{bib latex}     \usepackage{nameref}          \defbibheading{bibintoc}{%       \addcontentsline{toc}{chapter}{\bibname}%       \section*{References for Chapter \ref{refsegment:\therefsection\therefsegment} - \nameref{refsegment:\therefsection\therefsegment}}}          \defbibheading{bibintoc2}{%       \addcontentsline{toc}{chapter}{\bibname}%       \section*{References for the \nameref{refsection:\therefsection}}}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{B02,       author = {Buthor, B.},       year = {2002},       title = {Bravo},     }     @misc{C03,       author = {Cuthor, C.},       year = {2003},       title = {Charlie},     }     \end{filecontents}     \addbibresource{\jobname.bib}          \begin{document}          \chapter*{Introduction}     \begin{refsection}     \cite{A01}     \end{refsection}     \chapter{Chapter 1}          \cite{A01,B02}          \backmatter          \printbibheading     \printbibliography[section=1,heading=bibintoc2]     \bibbysegment[heading = bibintoc]          \end{document}      I was content with this until I added an unnumbered Conclusion with citations. Then the code breaks down and `biblatex` returns a `nested refsections` error. Here's the MWE for that:               \documentclass{book}          \usepackage[sorting = none, style = numeric, refsegment = chapter, cite reset = chapter]{bib latex}     \usepackage{nameref}          \defbibheading{bibintoc}{%       \addcontentsline{toc}{chapter}{\bibname}%       \section*{References for Chapter \ref{refsegment:\therefsection\therefsegment} - \nameref{refsegment:\therefsection\therefsegment}}}          \defbibheading{bibintoc2}{%       \addcontentsline{toc}{chapter}{\bibname}%       \section*{References for the \nameref{refsection:\therefsection}}}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{B02,       author = {Buthor, B.},       year = {2002},       title = {Bravo},     }     @misc{C03,       author = {Cuthor, C.},       year = {2003},       title = {Charlie},     }     \end{filecontents}     \addbibresource{\jobname.bib}          \begin{document}          \chapter*{Introduction}     \begin{refsection}     \cite{A01}     \end{refsection}     \chapter{Chapter 1}          \cite{A01,B02}          \chapter*{Conclusion}     \begin{refsection}     \cite{C03}     \end{refsection}          \backmatter          \printbibheading     \printbibliography[section=1,heading=bibintoc2]     \bibbysegment[heading = bibintoc]          \end{document}      Any ideas how to solve this? Or, even better, how to properly implement `\chapter*` with example `3.11.4` of the `biblatex` doc? Thanks in advance for the help!


title: How do I use glyphtounicode to make Caslon Pro ligatures searchable?

text: I am using Adobe Caslon Pro with a caslon.sty file which activates uncommon ligatures such as st, ct, longsl, longst &c. I use it in the following example (updated to match the answer in the comment below):               \documentclass[english]{book}     \usepackage[T1]{fontenc}     \input{glyphtounicode}     \pdfglyphtounicode{germandbls}{0073 0073} % Override: normally eszet does not match “ss”     % Extra Unicode characters     \pdfglyphtounicode{longst}{FB05}     \pdfglyphtounicode{st}{FB06} % This is not produced by caslon.sty     % Ligatures with no Unicode characters     \pdfglyphtounicode{longdbls}{0073 0073}     \pdfglyphtounicode{ct}{0063 0074}     \pdfglyphtounicode{longsh}{0068 0074}     \pdfglyphtounicode{longsi}{0069 0074}     \pdfglyphtounicode{longsl}{006c 0074}     \pdfgentounicode=1     \usepackage[longs]{caslon}     \begin{document}     Goose taste has hash sin slim fact passing pass past.     \end{document}      Unfortunately, I can no longer find the caslon.sty that I use online, nor do the files give any clue as to their authorship. (There are a few different Adobe Caslon Pro support files for LaTeX, in CTAN and other places, but none seems to support the extra ligatures.) Hence, I've put a Zip bundle online at: http://rrt.adsensus.net/acaslon.zip of the files exactly as I downloaded them.


title: \wideparen in AMS class

text: I need a `\wideparen` symbol in a book prepared with `amsbook` class. I know about a few packages providing this command but...   * `ymath` does not work with current version of AMS classes   * `MnSymbol, mathabx, fourier` \- all substitute the default math font and this is not what I need (and what the publisher would allow). I need to keep the standard fonts for everything else, but only add this single symbol. Any ideas how to do that ?


title: subfloat text overflow onto the second line and remove gap between the image identifier and beginning of text

text: I have three images that i need to show on the same horizontal level. THe problem that iam having is that the image description that i place below is overflowing on to the second line. Moreover there is a huge space between the image identifier character and the beginning of the word.(between a) and EN-) Here is my code               \begin{figure}[!h]         \centering         \subfloat[ENGINE1]{\label{fig:gull}\includegraphics[width=0.1\textwidth]{textures_data_types/lzw.eps}}             \hspace{2px}      \subfloat[ENGINE12]{\label{fig:gull}\includegraphics[width=0.1\textwidth]{textures_data_types/wav.eps}}              \hspace{2px}      \subfloat[BITMAP]{\label{fig:gull}\includegraphics[width=0.1\textwidth]{textures_data_types/bit.eps}}        \caption{Systems}           \label{fig:bitmapVisualize}     \end{figure}      ![enter image description here](http://i.stack.imgur.com/kiuYA.png)


title: add marginefigure in Recipe book

text: i used "Recipe book" class in lyx 2.1 , i want to add marginfigure from menu (gui) without tex code? (like tufte book). regards


title: How to split a long formula and make it beautiful?

text: My method:               \documentclass[UTF8]{ctexart}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{inputenc}          \begin{document}     \begin{equation}     \begin{split}      \hat{c}_x(t,\gamma)=\int_0^t [K(\sigma,\gamma) K_L(e_\sigma)+e_f(\sigma)] d\sigma \\      & +K(t,\gamma) K_L e(t)-K(0,\gamma) K_L e(0) \\      & -\int_0^t [\frac{\partial{K(\sigma,\gamma)}}{\partial \sigma}K_L e(\sigma)d\sigma     \end{split}     \end{equation}          \end{document}      However, the formula becomes symmetrical. I want to know how to revise it.


title: Pgfplots: Assemble dates from different columns

text: I am trying to plot a datafile of a time series in pgfplots. The date is not in the `YYYY-MM-DD hh:mm` format required by the PGF calendar library (see p. 210 in the pgfplots manual), but in different columns called `year`, `month`, `day` etc. Is there a way of joining different columns into a new string in the required format on the fly when calling `\addplot table` (maybe with something like `x expr=...`)? I'm trying to avoid using `\pgfplotstableread` with a `create on use` command because I have found that to take surprisingly long to run. Here's an example of the datafile format I'm talking about:               year, month, day, hour, minute, value       2006, 5, 21, 1, 0, 10.5       2006, 5, 22, 2, 0, 23.4       2006, 5, 22, 4, 5, 30.1       2006, 5, 27, 3, 0, 35.2


title: Problems with going to the end or beginning of the line in Texmaker on Mac OS X

text: I am using Texmaker in my MacBook. Generally for text writing places, `Command`+`←` or `Command`+`→` takes the cursor to the right or left most position of that line. But I see that when I have already compiled my `.tex` file (I always quickbuild to create the PDF and see it side by side by turning on the PDF viewer from below) and can see the PDF output on the right, this command is just rotating the output file. Any help? Please let me know if the question is unclear.


title: Referencing the section of an equation

text: I'm wondering if there's a way to reference the section that an equation is in.               \documentclass{article}     \begin{document}     \section{section 1}\label{sec:first}     \begin{equation}\label{eq:eq1}         1+1=2 \\     \end{equation}          \section{section2}\label{sec:second}     From equation \eqref{eq:eq1} in section \ref{sec:first}...     \end{document}      Basically, I'd like to replace `\ref{sec:first}` with a reference to the equation and get the section that it's in. Thank you in advance!


title: how to execute external commands from (Xe)(La)TeX?

text: i'm trying to capture output from an external command in a XeLaTeX document. as per http://tex.stackexchange.com/a/20566/28067 and http://stackoverflow.com/a/8929976/256361, i'm specifically doing               \documentclass[a5paper]{article}     \usepackage{polyglossia}     \setdefaultlanguage{english}          \begin{document}          A A A          \immediate\input{|"node -v"}          B B B          \end{document}      i'm running TeX with `xelatex --enable-write18 --enable-pipes write18.tex` to enable features normally blocked (because security). however, this does not appear to work. i've tried the `\input` command with and without the braces, and with and without `\immediate`, but as long as that line is in the source, XeLaTeX concludes output with               (./write18.aux     )      rather than               (./write18.aux) )     Output written on write18.pdf (1 page).     Transcript written on write18.log.      (ie there is an additional newline, and output just stops dead without the remaining lines). observe that on my system, the output of `node -v` is the completely un-dangerous string `v0.11.7`. i understand that in order to capture more arbitrary output i'd have to fiddle with catcodes, but that's food for another question. so what am i doing wrong here? **Update** @egreg you might be right! i tried               \immediate\write18{node -v > /tmp/temp.dat}     \input{/tmp/temp.dat}      and that did work. funny though it would appear you told readers in a comment to http://tex.stackexchange.com/a/20566/28067 that "in TeX Live 2013 the syntax `\input|"command"` is supported also by XeTeX"–were you in error here? btw the fact that (in TeXLive) using non-supported command line options do not seem to trigger error messages does not exactly help make testing easier. also funny that http://docs.miktex.org/manual/xetex.html has all the long options prefixed with two dashes where `xelatex --help` gives them with a single dash (and fails to even mention that many more options are available).


title: \eqalignno compiling question in MiKTeX

text: I'm a `TeX`/`LaTeX` newbie. I would like to generate a .png using `dvipng` for the below equation.               $$\eqalignno{\overline {Z_{w,h}^{(LDGM)}} =&\sum\limits _{e=0}^{t} \left [{{ 1}\over { t\choose e}} {\rm coef}\left (\prod _{u=1}^{\infty} (1 + x^{u}y)^{m {\mathtilde {\lambda }}_{u}}, x^{e}y^{w}\right)\right. \cr & \left . \times {\rm coef} \!\left (\prod _{v=1}^{\infty} [f_{-}(x,v)y \!+\! f_{+}(x,v)]^{n {\mathtilde {\rho }}_{v}}, x^{e}y^{h} \!\right)\!\right]\!. \cr &&{\hbox{(3)}}}$$      Please suggest what is wrong with the equation and how to generate a dvi for this.


title: Change line spacing for footnote text only

text: I have to format a document to this finicky standard: "The entire document cannot exceed 25 double-spaced pages, including all supplementary material, and must be in Times New Roman, 11 point, font. Endnotes or footnotes are not required for the writing sample, however, if included they should be in 10 point font and single-spaced, with double-spacing between entries." Some investigation reveals that with an 11pt `article` document class, the "small" text size is about 10 points. Ok. So I did: `\renewcommand{\footnotesize}{\small}`. I'm also using `setspace` for doublespacing, so I thought I could wrap all the footnotes in a `singlespace` environment (or begin them with `\singlespacing` or something like that. That does cause the footnotes to be single-spaced, but it also causes (a) the footnote _text_ to begin on a separate line from the footnote _number_ , and (b) large spaces between footnotes, which is both aesthetically and practically undesirable (gotta keep the page count down, y'know). How can I get the footnote style right?


title: Header and footer for every page

text: I am writing my thesis and I have some problems to create headers and footers. I want to add a header for left side of the each page and page number in the middle of the page as a footer. I tried to use `\pagestyle{headings}` but I don't want page numbers right side of the page. Also instead of chapter name, I want to section name as a header. I tried `\usepackage{fancyhdr}`               \usepackage{fancyhdr}     \pagestyle{fancyplain}     \fancyhf{}      \fancyhead[l]{Headings}     \fancyfoot[c]{\thepage}     \pagestyle{fancyplain}      However this only add header and footer on the chapter page. I try to add `\section{title}` at the left top of the each page's header and page numbers to center of the each pages footer.


title: Beamer error with columns

text: I want to put a picture in one column, some text in the other, and beneath all that some more text in a beamer style presentation. My frame looks like this:               \begin{frame}     \frametitle{Svemir dominiran tvari}     \begin{columns}         \begin{column}{0.5\textwidth}             \begin{itemize}             \flushleft{\includegraphics[width=0.5\textwidth]{btph.eps}}             \end{itemize}         \end{column}         \begin{column}{0.5\textwidth}             \begin{itemize}             \item Barionska asimetrija se izražava omjerom broja bariona i fotona                 \begin{equation}                 \eta=\frac{n_b-n_{\bar{b}}}{n_\gamma}=6.1\pm 0.3\times 10^{-10}.                 \end{equation}             \end{itemize}         \end{column}     \end{columns}     \begin{itemize}         \item $n_b\Rightarrow$ \quad gustoća broja (stanja) bariona\\         \item $n_{\bar{b}}\Rightarrow$ \quad gustoća broja antibariona\\         \item $n_\gamma\Rightarrow$ \quad gustoća broja fotona         $\frac{\zeta(3)}{\pi^2}g_\star T^3$     \end{itemize}     \end{frame}      When I compile it I get this error:               Something's wrong--perhaps a missing \item. \end{frame}      I looked at the code (which I c/p from another presentation that worked) and it looks the same. So why won't it compile? I have 11pt font in presentation, so that more text could fit. Is the amount of text the issue? :\ EDIT: I have removed the itemize stuff, but now nothing shows on the slide :\ I don't see a thing on a slide now :\


title: Weird error when using datatool's `\DTLaddall` in a `\DTLforeach`

text: Given `test.csv` containing:               donor,core,non-core     Norway,137.6,111.4     The Netherlands,116.6,85.8 and `data-problem.tex` containing:               \documentclass{article}     \usepackage{datatool}     \begin{document}          \DTLloaddb{contrib}{test.csv}          % add "total" column     %\tracingmacros=1     \DTLforeach{contrib}{\contribC=core,\contribNC=non-core}{%     \DTLaddall{\contribT}{\contribC,\contribNC}}          \end{document} I get the error:               (e:\Documents\Anthropology\Paper\data-problem.aux) ( FP-EQ? ) ( FP-ADD )     Runaway argument?     \relax \fi \ifnum \@dtl@tmpcount                          \par      l.11           [1] (e:\Documents\Anthropology\Paper\data-problem.aux) )     (\end occurred when \ifx on line 10 was incomplete)     (\end occurred when \iftrue on line 10 was incomplete)     (\end occurred when \ifnum on line 10 was incomplete)     (\end occurred when \ifnum on line 10 was incomplete)     (\end occurred when \ifnum on line 10 was incomplete)     (see the transcript file for additional information)     Output written on data-problem.dvi (1 page, 216 bytes).     SyncTeX written on data-problem.synctex.gz     Transcript written on data-problem.log.          LaTeX exited abnormally with code 1 at Thu Dec 16 15:33:33 This doesn't happen with `\DTLadd{\contribT}{\contribC}{\contribNC}`, though, nor does it happen with:               \def\foo{1.2}     \def\bar{3.4}     \DTLaddall{\baz}{\foo,\bar} So I'm at a bit of a loss as to what is going wrong here...


title: Getting rid of tilde in "Fig.~1"

text: When I use IEEEtran package like below script, figure names contain a tilde. Is there a way to remove them or IEEE conventions dictate something like that?               \documentclass[conference]{IEEEtran}     \begin{document}     \begin{figure}     \caption{abc}     \end{figure}     \end{document}      Output: ![Tilde in figure](http://i.stack.imgur.com/vf3Ed.png)


title: Execute command stored in aux file

text: My script needs to read a command from one aux file (testFileWriteReadExecute.yposIN.txt), then execute that same command which is a actually a call to a write macro which writes another command to a second file (testFileWriteReadExecute.yposOUT.txt). Currently it produces the command in the PDF output instead of executing it. At some stage I had something similar working halfway, but have messed it up since, unfortunately. testFileWriteReadExecute.yposin.txt looks like this:               \writeVerse{A}{1}{F}\comment{30580738}\endcomment     \writeVerse{A}{1}{L}\comment{29138946}\endcomment     \writeVerse{A}{2}{F}\comment{29138946}\endcomment     \writeVerse{A}{2}{L}\comment{27566082}\endcomment     \writeVerse{A}{3}{F}\comment{27566082}\endcomment     \writeVerse{A}{3}{L}\comment{25993218}\endcomment      MWE:               \documentclass[pagesize=pdftex, fontsize=10]{scrbook}     \usepackage[paperwidth=11.2cm, paperheight=17.4cm, top=1cm,bottom=1cm, left=1cm, right=1cm]{geometry}     \usepackage{fontspec}          \AtBeginDocument{%         \newwrite\yposoutputfile%         \openout\yposoutputfile=\jobname.yposout.txt%     }     \AtEndDocument{%         \closeout\yposoutputfile%     }          \newcommand\writeVerse[3][]{%       \writelines{#1}{#2}{#3}%     }          % Write the position to file.     \def\writelines#1#2#3{%       \pdfsavepos%         \write\yposoutputfile{%         \string\writeVerse%         \string{#1\string}%         \string{#2\string}%             \string{#3\string}%             \string\comment\string{\the\pdflastypos\string}\string\endcomment%         }%     }          % Open the file to read the commands.     \def\fromFile{       \newread\yposinputfile%       \openin\yposinputfile=\jobname.yposin.txt%         \readline\yposinputfile to \fromFileLine%       \closein\yposinputfile%       \fromFileLine     }          \begin{document}     \fromFile %\writeVerse{A}{1}{F}      LIBRO de la generación de Jesucristo, hijo de David, hijo de Abraham. \fromFile %\writeVerse{A}{1}{L}     \writeVerse{A}{2}{F} \textbf{2}~Abraham engendró á Isaac: é Isaac engendró á Jacob: y Jacob engendró á Judas y á sus hermanos:\writeVerse{A}{2}{L}     \writeVerse{A}{3}{F} \textbf{3}~Y Judas engendró de Thamar á Phares y á Zara: y Phares engendró á Esrom: y Esrom engendró á Aram:\writeVerse{A}{3}{L}     \end{document}      # EDIT The basic concept of what I want is simple.   1. The `XeLaTeX` script grabs a line from the one text file which happens to be a `TeX` command, i.e. `\writeVerse{A}{1}{F}`   2. It places in a particular place of the document this command, where this command gets executed/expanded instead of printed.   3. The command is a call to a macro which in turn writes to another file. # EDIT 2: Since the closest answer is this one by egreg I'll accept it, although it does not answer the fundamentals of my question. It does seem that this is a limitation in TeX.


title: Discrete and continuous Centroid equations in LaTeX

text: I would like to write the following equations in LaTeX: ![enter image description here](http://i.stack.imgur.com/FudgF.png) and ![enter image description here](http://i.stack.imgur.com/kExWi.png) The first one (with the integrals) I managed to make similarly using the following code:               \begin{equation}     COG = \frac{\int_a^b\!ua(x)x\, \mathrm{d}x}{\int_a^b\!ua(x)\, \mathrm{d}x}     \label{eq:cogCont}     \end{equation}      However, I am using a u instead of a μ and have no idea how to do it another way, as well, I do not know how to make the "A" next to it. For the second equation, I have no idea where to start. Any ideas? Thanks!


title: MikTeX for MS Windows seems to use Type3 (raster) fonts when instructed to use Type1 (vector)

text: I use MikTeX as my compiler for Windows. The problem is that it uses Type3 (raster) fonts even though I've stated:               \usepackage[T1]{fontenc}      in the preamble. As far as I've understood, this will force the compiler to use vector fonts instead. Have I misunderstood something? Can I reconfigure my installation to always use vector fonts?


title: Framebox and subfigure with dirtree package

text: I've integrated `dirtree` package in my manuscript but having issues with the following.   1. Framebox: I consistently frame all figures in my manuscript using `\framebox`, however, applying this to dirtree output messes things up. How do I get past this?   2. Subfigure: I cannot seem to align 3 figures (Figure 2a, 2b & 2c) on the same horizontal line; I am basically trying to replicate this example. What am I doing wrong here? **Minimal Example**               \documentclass[a4paper,10pt]{report}          \usepackage{dirtree}     \usepackage{caption}     \usepackage{subcaption}          \begin{document}          \begin{figure}     \centering     \framebox[\textwidth]{%     \dirtree{%     .1 \textbf{NDLTD}.     .2 \textbf{OCLC}.     .3 \vdots.     .3 x.xml.     .3 \vdots.     }     }     \caption{How do I frame dirtree-generated figures}     \label{fig:minimal-example:frame-dirtree}     \end{figure}               \begin{figure}     \centering     \begin{subfigure}[b]{0.1\textwidth}     \dirtree{%     .1 \textbf{NDLTD}.     .2 \textbf{OCLC}.     .3 \vdots.     .3 x.xml.     .3 \vdots.     }     \caption{dirtree1}     \label{fig:dirtree1}     \end{subfigure}          \begin{subfigure}[b]{0.1\textwidth}     \dirtree{%     .1 \textbf{NDLTD}.      .2 \textbf{OCLC}.      .3 \textbf{2010}.      .4 \vdots.      .4 x.xml.      .4 \vdots.      .3 \vdots.      }     \caption{dirtree2}     \label{fig:dirtree2}     \end{subfigure}          \begin{subfigure}[b]{0.1\textwidth}     \dirtree{%     .1 \textbf{NDLTD}.      .2 \textbf{OCLC}.      .3 \textbf{2010}.      .4 \textbf{z}.      .5 \vdots.      .5 x.xml.      .5 \vdots.      .3 \vdots.      }     \caption{dirtree3}     \label{fig:dirtree3}     \end{subfigure}     \caption{Combined dirtree structures}\label{fig:dirtrees}     \end{figure}          \end{document}


title: Problems with theoremref

text: I'm having some problems with the `theoremref` package. Basically, instead of giving me as output something like "Lemma 1.1.1", where "Lemma" is the name of the theorem, it gives me something like "lem 1.1.1", where "lem" is the theorem identifier. Here's my code:               \documentclass{article}          \usepackage[amsthm, thmmarks]{ntheorem}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{array}     \usepackage{makeidx}     \usepackage{mathrsfs}     \usepackage{theoremref}          \newtheorem{lem}{Lemma}[subsection]          \begin{document}          \section{Section}          \subsection{Subsection}          \begin{lem}\thlabel{test}     Test     \end{lem}          As we can see from \thref{test}          \end{document}      And here's the output: ![Output](http://i.stack.imgur.com/OlvVx.jpg) What am I doing wrong?


title: How to combine package acronym and hyphenation?

text: It seems that words part of an acronym defined using the Acronym package have trouble being hyphenated. How can I make sure that the long version of the acronym will be hyphenated correctly?               \documentclass{minimal}     \usepackage{acronym}          \hyphenation{Acro-nym}     \acrodef{OA}{Overlengthy Acronym}          \begin{document}     This very very very very lengthy useless sentence contains many words including an \ac{OA} and it should be split.          This very very very very lengthy useless sentence contains many words including an Overlengthy Acronym (OA) and it should be split.     \end{document}      On my computer, the preceding MWE results in "Acronym" being split in the second sentence but not in the first one although the produced text is identical.


title: Bad math environment delimiter: ntheorem with thmmarks, Display math and split

text: Using a combination of `\usepackage[amsmath,thmmarks]{ntheorem}`, display math enclosed in `\[ \]` and a `\begin{split}` environment inside it, `pdflatex` freaks out completely: `! LaTeX Error: Bad math environment delimiter.` This is the minimum (non)working example (obviously without theorem definitions, nor with the need to have a `split` environment there; those are not of the essence in showing the error):               \documentclass{article}     \usepackage{amsmath}     \usepackage[amsmath,thmmarks]{ntheorem}     \begin{document}          \[     \begin{split}         a = b     \end{split}     \]          \end{document}      Also, a workaround is to use `\begin{equation*}` instead. **EDIT:** I guess a question was missing: any ideas what the problem is up there?


title: positioning table inline with text

text: I have following piece of code:               \section{Skills}     \begin{CV}     \item[Computing:] C/C++, Python and Matlab     \item[CAD Tools:] GNU Radio, Xilinx ISE, Active HDL, MikroC, Keil uVision, Altium Designer, Cadence VIRTUOSO     \item[Languages:] AAA     \begin{table}[h] %\centering     \begin{tabular}{p{2cm}>{\bfseries}p{2.5cm}p{3cm}}     & German  & native \\     & French  & near native \\     & Dutch & near native\\     & Italian & fair \\     \end{tabular}     \end{table}     \end{CV}     \pagebreak      The problem is that table with the languages is placed in the way that top and bottom of the table is equally distanted from the line of the item title. i want top left corner of the table to be in the place where would be the first letter of the normaln item text. Thanks


title: Change itemize symbol in a Beamer note

text: I'd like to change the symbols used for itemize lists inside `beamer` notes. Setting for example `\setbeamertemplate{itemize item}[triangle]` affects only my itemize lists outside of notes (besides the styles for those outside are different than for those in notes). How can I change the symbols used for itemize lists inside notes?


title: Sorting of author names like "von Beethoven" with biblatex

text: I wonder how I can get a proper sorting of names in the bibliography. In the following example, "von Beethoven" is at the position "v", but it should be sorted as "Beethoven" under "B".               \documentclass{scrbook}          \begin{filecontents*}{mybib4.bib}          @MISC{Volkmann,       author = {Volkmann, Albert},       title = {title},       year = {2005},     }          @MISC{vonBeethoven2005,       author = {von Beethoven, Ludwig},       title = {title},       year = {2005},     }          @MISC{Caesar,       author = {Caesar, Gaius J.},       title = {title},       year = {2005},     }          \end{filecontents*}          \usepackage[color, draft]{showkeys} %Einblenden der Referenznamen in den Arbeitsversionen     \renewcommand*\showkeyslabelformat[1]{\fbox{\normalfont\tiny\ttfamily#1}}      \definecolor{refkey}{cmyk}{0.26,0,0.76,0}%{gray}{0.5}      \definecolor{labelkey}{cmyk}{0.26,0,0.76,0}%{gray}{0.5}     \definecolor{grau}{gray}{0.5}          \usepackage[natbib=true, style=numeric-comp, backend=bibtex8, defernumbers, useprefix, maxnames=99, maxcitenames=3]{biblatex}  % fÂ¸r bessere Literaturverzeichnisse     \renewcommand{\bibfont}{\normalfont\small}     \renewcommand\multicitedelim{\addsemicolon\space}               \usepackage{csquotes}           \bibliography{mybib4}          \begin{document}          citeauthor: \citeauthor{vonBeethoven2005}           Citeauthor: \Citeauthor{vonBeethoven2005}          \cite{vonBeethoven2005}          \nocite{*}     \printbibliography          \end{document}


title: biblatex conflict with showkeys package?

text: For a long time I wondered why `biblatex` did not typeset author names with `\Citeauthor` in upper case, until I finally could isolate the problem: When the `showkeys` package is loaded, the name "von Beethoven" will be printed in lower case, even when using `\Citeauthor`, which should print it upper case. As soon as `showkeys` is disabled, it works perfectly well (the order of loading of both packages does not seem to matter), see example:               \documentclass{scrbook}          \begin{filecontents*}{mybib4.bib}          @MISC{Volkmann,       author = {Volkmann, Albert},       title = {title},       year = {2005},     }          @MISC{vonBeethoven2005,       author = {von Beethoven, Ludwig},       title = {title},       year = {2005},     }          @MISC{Caesar,       author = {Caesar, Gaius J.},       title = {title},       year = {2005},     }          \end{filecontents*}          \usepackage[color, draft]{showkeys} %Einblenden der Referenznamen in den Arbeitsversionen     \renewcommand*\showkeyslabelformat[1]{\fbox{\normalfont\tiny\ttfamily#1}}      \definecolor{refkey}{cmyk}{0.26,0,0.76,0}%{gray}{0.5}      \definecolor{labelkey}{cmyk}{0.26,0,0.76,0}%{gray}{0.5}     \definecolor{grau}{gray}{0.5}          \usepackage[natbib=true, style=numeric-comp, backend=bibtex8, defernumbers, useprefix, maxnames=99, maxcitenames=3]{biblatex}  % fÂ¸r bessere Literaturverzeichnisse     \renewcommand{\bibfont}{\normalfont\small}     \renewcommand\multicitedelim{\addsemicolon\space}               \usepackage{csquotes}           \bibliography{mybib4}          \begin{document}          citeauthor: \citeauthor{vonBeethoven2005}           Citeauthor: \Citeauthor{vonBeethoven2005}          \cite{vonBeethoven2005}          \nocite{*}     \printbibliography          \end{document}


title: Change \the\year

text: Is it possible to make LaTeX believe that the current year is 2012, so that `\the\year` prints 2012?               \documentclass{article}     \begin{document}       % What to do so that the following prints 2012?       \the\year     \end{document}      I haven't found advice in The \the command; trying to set `\year` using `\setcounter{year}{2012}` didn't work either.


title: Compactitem in tabular produces extra vertical space after environment

text: If I use compactitem in a tabular(x), there is a vertical space before and after the listing environment. How can I remove that space?               \documentclass[11pt, a4paper]{scrartcl}          \usepackage[ngerman]{babel}     \usepackage{paralist, tabularx}          \begin{document}          \begin{compactitem}     \item Item 1     \item Item 2     \end{compactitem}         There is no verstical space after the compactitem-environment.                    \bigskip     \begin{tabularx}{\textwidth}{l X}     \hline     a & b\\     a &     \begin{compactitem}     \item Item 1     \item Item 2     \end{compactitem}\\     a& \dots but in the tabular, there \emph{is} vertical space after and before the einvironment!\\     \hline     \end{tabularx}          \end{document}


title: How do I access the width of text from the preamble?

text: I've got some macros that I want to set up in my preamble. The problem is that they need to know what the width of a _typical_ line of text will be in the document. If I do something like,               %% Everything set up correctly     \documentclass{article}     \usepackage[margin=1in,showframe]{geometry}     \setlength{\parindent}{0pt}          \newlength{\testlength}     \setlength{\testlength}{\textwidth}     \newcommand{\myrule}{\rule{\testlength}{4pt}}          \usepackage{lipsum}     \begin{document}          \myrule          \lipsum[1-10]          \end{document}      Then `\myrule` has the correct width. But if I do something like               %% FAIL     \documentclass{article}     \usepackage[margin=1in,showframe,twocolumn]{geometry}     \setlength{\parindent}{0pt}          \newlength{\testlength}     \setlength{\testlength}{\textwidth}     \newcommand{\myrule}{\rule{\testlength}{4pt}}          \usepackage{lipsum}     \begin{document}          \myrule          \lipsum[1-10]          \end{document}      I don't get the desired result. I might be inclined to set the width of my macro as               \setlength{\testlength}{\linewidth}      or               \setlength{\testlength}{\columnwidth}      But both of these fail to get the correct length (apart from the fact that `\linewidth`, as I understand it, shouldn't really make too much sense in the preamble). How can my macro know from within the preamble what the proper textwidth should be? I should note that I'm not particularly concerned about what happens if, let's say, the macro is called from within a `multicols` environment from the `multicol` package. In other words, the macro should have an _absolute_ length, not a length relative to a particular environment.


title: Chapter and TOC in Turkish

text: When I create a chapter like below, I get **Chapter 1** for example.               \chapter{My Chapter Title}      But my document is in Turkish so I need to display **Bölüm 1** instead. This is also happening for Table of Contents. How can I override this?


title: Turn off transitions \uncover \pause while keeping the TOC within the doc

text: I want to hand my students the slides without transitions while keeping the table of contents within the document. `\documentclass[handout]{beamer}` turns off transitions but it removes the TOC along the document.


title: Align Quote to right

text: I want to align               \begin{quote}       Text       Author (\cite{Source})     \end{quote}      to the right side of the paper. How can I do this?


title: Incorrect spacing for > and < when using newtxmath and bigdelims option

text: I am using the `newtxmath` package with the `bigdelims` option recommended by the package documentation. Curiously, this combination appears to produce no spacing around `<` and `>` (but correct spacing for `\leq` and `\geq`). When I remove the `bigdelims` option, the spacing is corrected. Is this a bug in `newtxmath`, or is there another option that I must provide? Here is a minimal example:               % arara: pdflatex     \documentclass{article}     \usepackage[bigdelims]{newtxmath}          \begin{document}     $j > i$ and $j \geq i$ and $i < j$ and $i \leq j$     \end{document}      ![enter image description here](http://i.stack.imgur.com/3AiPn.png)


title: Align to TikZ additional separation space

text: In TikZ I have a styled node, in this case a matrix with an addition separation space and a dashed border. Left and right of this matrix I want to align additional nodes with the north dashed border. Currently I place the node left of a certain node inside the matrix and use a `yshift` to align the box manually. This works, however I am curious if there is a way to align with the style information. ![enter image description here](http://i.stack.imgur.com/jxKWc.png) My MWE:               \begin{tikzpicture}         % Tikz Styles     \tikzset{       item/.style={         draw,          rectangle,          font=\sffamily\scriptsize, align=center,         inner sep=3pt       },       board/.style={         draw,          dashed,          inner sep=3mm,          matrix of nodes       },       inBoard/.style={         item,          solid,          sharp corners,          minimum height=0.8cm,          font=\sffamily\scriptsize\bfseries,         fill=hgrau,          thick       },       outerBox/.style={         item,         solid,         font=\sffamily\scriptsize\bfseries       }     }          % Elements     \matrix(Board)[board] {     \node[label](dashedBoxLabel)[]{Dashed Styled Box};     \node[inBoard] (InBox)       [draw=none,       below of=dashedBoxLabel,        node distance=1.8cm,        minimum height=12mm,        minimum width=4cm]{In box};\\     };     \node[outerBox] (OtherBox)        [left of=dashedBoxLabel,       yshift=-1.6cm,       node distance=4cm,       draw=none,       fill=hgrau,       minimum width = 3cm,        minimum height=6cm]{Other Box};      \end{tikzpicture}


title: Natbib: Multiple citations with page numbers in one bracket

text: I'm using natbib with bibliography style "apalike". I can cite two different papers in one bracket; for instance `\citep{adams03,collier09}` gives me `(Adams and Fournier, 2003; Collier et al., 1990)`. I can also give page numbers for one source at a time; for instance `\citep[p.3]{adams03}` gives me `(Adams and Fournier, 2003, p.3)`. **My Question:** What if I have page numbers for both sources? Is there a standard way to produce an output like `(Adams and Fournier, 2003, p.3; Collier et al., 1990, p.5)`? I'm not very keen on editing the bibstyle files myself if there is an easier way. Any help is much appreciated! * * * A minimal example:               \documentclass{article}          \usepackage[american]{babel}     \usepackage[utf8]{inputenc}     \usepackage{natbib}          \begin{document}          \citep{adams03,collier09}          \citep[p.3]{adams03}          I would like to have something like (Adams and Fournier, 2003, p.3; Collier et al., 1990, p.5).          \bibliography{bibliography}{}     \bibliographystyle{apalike}          \end{document}


title: Changing paragraph begin/end commands

text: Is it possible to modify TeX/LaTeX commands so that certain commands are executed before/after a paragraph? For instance, we know that when the LaTeX compiler sees the \par command or a whitespace line, it ends the current paragraph and enters vertical mode (?). So, I'm looking for a command that I could modify such that I could type               %redefine some commands up here          \begin{document}     Paragraph 1          Paragraph 2     \end{document}      and have it produce the same output as               \begin{document}     $\triangle$Paragraph 1          $\triangle$Paragraph 2     \end{document}      Another related question would be also producing output like               \begin{document}     Paragraph 1$\square$          Paragraph 2$\square$     \end{document}


title: How to format this formula, in particular, the parentheses better?

text: $$\mathrm{err} \left( h(\vec{\theta}, \vec{x}), y \right)     = \delta_{0y} ~ H \left( h(\vec{x}; \vec{\theta}) - \frac{1}{2} \right)     + \delta_{1y} ~ H \left( \frac{1}{2} - h(\vec{x}; \vec{\theta}) \right)$$


title: PGFPlots: Plot regression line and 45 line for a range of values

text: I have a regression that has the following simple format: `ln(Y) = C + lf(X)`. It's estimated as `ln(Y) = 0.62 + 0.81`. I want to plot it for a range of values for X (0 to 50) and compare it with a 45 degree line to see where it turns. How can I create a plot (or a scatterplot) that shows something like this? A scatterplot with two series might do it: one for (x,x) with X going from 0 to 50 and a second with (x,y) with X going from 0 to 50 and y as calculated with the line above ln(y) = 0.62+0.81. How can I do something like this?               \documentclass[border=2pt]{standalone}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}     %For x = 0 to 50, plot Y = exp(0.81 + 0.62X)         %From x = 0 to 50, plot a 45 degree line straight from the origin for comparison         \addplot      \end{axis}     \end{tikzpicture}     \end{document}


title: Fontspec SizeFeatures and recursive font definition

text: I suspect this isn't valid code, but the docs are ambiguous. fontspec is loaded with `\fontspec[<font features>]{fontname}`. BoldFont is included in "font features". Then I should be able to recursively define:               \setmainfont[SizeFeatures={     {Size={-8},BoldFont=Arial},     {Size=8-}}]{Hoefler Text}      But this gives               (fontspec) The following font options are not recognised:     (fontspec)     BoldFont=Arial      Not allowed or there's a way around it? My hopes were to make the **whole** font definitions in this way (with `BoldFeatures={SizeFeatures=...}` again and so on). A minimal working file:               \documentclass{article}     \usepackage{fontspec}          \setmainfont[SizeFeatures={     {Size={-8},BoldFont=Arial},     {Size=8-}}]{Hoefler Text}          \begin{document}     Normal text\\          {\small \textbf{Small bold}}\\     \end{document}      Edit: Using Gentoo/Linux, Texlive-2010


title: Three column layout with three column footnotes

text: I was able to find how to do three column layout of main text, for example using.               \documentclass[12pt]{book}     \usepackage[paperwidth=12.9in, paperheight=9.9in]{geometry}     \usepackage{multicol}     \usepackage{blindtext}     \begin{document}     \begin{multicols}{3}     \blindtext     \footnote{\blindtext}     \blindtext     \footnote{\blindtext}     \end{multicols}     \end{document}      Following the advice in Is a three-column footnote layout possible? I can also make 3 column footnotes.               \documentclass[12pt]{book}     \usepackage[paperwidth=12.9in, paperheight=9.9in]{geometry}     \usepackage{blindtext}     \usepackage{ledmac}     \footthreecolX{A}     \let\footnote\footnoteA     \begin{document}     \blindtext     \footnote{\blindtext}     \blindtext     \footnote{\blindtext}     \end{document}      But combining those never worked for me. How should I do it? In this example, it seems to try to fit the footnotes into the first third of each coumn. Result=crap.               \documentclass[12pt]{book}     \usepackage[paperwidth=12.9in, paperheight=9.9in]{geometry}     \usepackage{blindtext}     \usepackage{ledmac}     \usepackage{multicol}     \footthreecolX{A}     \let\footnote\footnoteA     \begin{document}     \begin{multicols}{3}     \blindtext     \footnote{\blindtext}     \blindtext     \footnote{\blindtext}     \end{multicols}     \end{document}      In the end, I'd like to be able to typeset a text like this: ![Image](http://i.imgur.com/EIGFRt2.png)


title: Chapters and verses of current page in header

text: This question is linked to my other titlesec question Does any one know how to add the current segment location at the top of any particular page. What I need is the reference at the top of a typical Bible page showing which text is on the current page. For example: If the current page contains part or all of Exodus chapter 15 verse 4 to part or all of Exodus chapter 18 verse 9, the text in the page header alongside the page number needs to show "15:4 - 18:9". In my search so far I've found references to using the `ledmac` package. For example, I think problem at the following url is of a similar kind of problem, but I can't see where the solution to my particular problem is given. http://markmail.org/message/rmylweubecvy4nyp#query:+page:1+mid:3fhvswygyu2tnpo6+state:results He referenced the following url, but that also does not solve the problem, even though in my limited knowledge, I think it's heading in the right direction. http://www.djdekker.net/ledmac/#bible =============================================== # Additional questions based on Gonzalo's answer: I am able to get the references in the header with the `titlesec` package. The remaining problems are evident from my output. ![Example page](http://i.stack.imgur.com/cWDdC.png) The `\section{}` appears as a number representing the chapter. The `\subsection{}` appears as another number representing the verse. The ideal would be to format it in the body to show only the chapter number at the first verse and then the numbers 2 and greater for the rest of the verses. In the past when not using `titlesec`, I was able to get something looking this way by using the `lettrine` package/command. Please see below: ![Example using lettrine](http://i.stack.imgur.com/NgxHe.png) Is it possible to produce the same output using this `titlesec` package? If not, is it possible to modify the following code to move the chapter number appearing in the left margin down a bit to align it with the first verse? Furthermore the spacing in between the subsection lines (verses) is a little bit too much. How do I make them a little smaller? Here is my current code:               \documentclass[a5paper]{article}     \usepackage[pagestyles, compact]{titlesec}     \usepackage{lettrine}          \renewcommand\thesubsection{\arabic{subsection}}          % quick redefinition of \section and \subsection to imitate Bible chapters and verses     %\titleformat{\section}[runin]     %  {\normalfont\normalsize\bfseries}{\Large\thesection}{1em}{}          \titleformat{\section}[leftmargin]       {\normalfont\Large         \bfseries\filleft}        {\thesection}{0em}{}     \titlespacing{\section}        {-2pc}{-1pc}{1pc}          \titleformat{\subsection}[runin]       {\normalfont\normalsize\bfseries}{\textsuperscript{\thesubsection}}{1em}{}          % definition of the page style with required headers     \newpagestyle{Biblestyle}{       \sethead[\toptitlemarks\thesection:\toptitlemarks\thesubsection---\bottitlemarks\thesection:\bottitlemarks\thesubsection]       []       [\thepage]       {\thepage}       {}       {\toptitlemarks\thesection:\toptitlemarks\thesubsection---\bottitlemarks\thesection:\bottitlemarks\thesubsection}}     \pagestyle{Biblestyle}          \begin{document}     \section{}         \subsection{} In the beginning God created the heaven and the earth.         \subsection{} And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.         \subsection{} And God said, Let there be light: and there was light.         \subsection{} And God saw the light, that it was good: and God divided the light from the darkness.         \subsection{} And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.         \subsection{} And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters.         \subsection{} And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so.         \subsection{} And God called the firmament Heaven. And the evening and the morning were the second day.         \subsection{} And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so.         \subsection{} And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good.         \subsection{} And God said, Let the earth bring forth grass, the herb yielding seed, and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth: and it was so.         \subsection{} And the earth brought forth grass, and herb yielding seed after his kind, and the tree yielding fruit, whose seed was in itself, after his kind: and God saw that it was good.         \subsection{} And the evening and the morning were the third day.     \section{}         \subsection{} Thus the heavens and the earth were finished, and all the host of them.         \subsection{} And on the seventh day God ended his work which he had made; and he rested on the seventh day from all his work which he had made.         \subsection{} And God blessed the seventh day, and sanctified it: because that in it he had rested from all his work which God created and made.         \subsection{} These are the generations of the heavens and of the earth when they were created, in the day that the LORD God made the earth and the heavens,         \subsection{} And every plant of the field before it was in the earth, and every herb of the field before it grew: for the LORD God had not caused it to rain upon the earth, and there was not a man to till the ground.         \subsection{} But there went up a mist from the earth, and watered the whole face of the ground.         \subsection{} And the LORD God formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul.         \subsection{} And the LORD God planted a garden eastward in Eden; and there he put the man whom he had formed.         \subsection{} And out of the ground made the LORD God to grow every tree that is pleasant to the sight, and good for food; the tree of life also in the midst of the garden, and the tree of knowledge of good and evil.         \subsection{} And a river went out of Eden to water the garden; and from thence it was parted, and became into four heads.         \subsection{} The name of the first is Pison: that is it which compasseth the whole land of Havilah, where there is gold;         \subsection{} And the gold of that land is good: there is bdellium and the onyx stone.         \subsection{} And the name of the second river is Gihon: the same is it that compasseth the whole land of Ethiopia.         \subsection{} And the name of the third river is Hiddekel: that is it which goeth toward the east of Assyria. And the fourth river is Euphrates.         \subsection{} And the LORD God took the man, and put him into the garden of Eden to dress it and to keep it.     \section{}         \subsection{} Now the serpent was more subtil than any beast of the field which the LORD God had made. And he said unto the woman, Yea, hath God said, Ye shall not eat of every tree of the garden?         \subsection{} And the woman said unto the serpent, We may eat of the fruit of the trees of the garden:         \subsection{} But of the fruit of the tree which is in the midst of the garden, God hath said, Ye shall not eat of it, neither shall ye touch it, lest ye die.         \subsection{} And the serpent said unto the woman, Ye shall not surely die:         \subsection{} For God doth know that in the day ye eat thereof, then your eyes shall be opened, and ye shall be as gods, knowing good and evil.         \subsection{} And when the woman saw that the tree was good for food, and that it was pleasant to the eyes, and a tree to be desired to make one wise, she took of the fruit thereof, and did eat, and gave also unto her husband with her; and he did eat.         \subsection{} And the eyes of them both were opened, and they knew that they were naked; and they sewed fig leaves together, and made themselves aprons.         \subsection{} And they heard the voice of the LORD God walking in the garden in the cool of the day: and Adam and his wife hid themselves from the presence of the LORD God amongst the trees of the garden.         \subsection{} And the LORD God called unto Adam, and said unto him, Where art thou?         \subsection{} And he said, I heard thy voice in the garden, and I was afraid, because I was naked; and I hid myself.         \subsection{} And he said, Who told thee that thou wast naked? Hast thou eaten of the tree, whereof I commanded thee that thou shouldest not eat?         \subsection{} And the man said, The woman whom thou gavest to be with me, she gave me of the tree, and I did eat.         \subsection{} And the LORD God said unto the woman, What is this that thou hast done? And the woman said, The serpent beguiled me, and I did eat.         \subsection{} And the LORD God said unto the serpent, Because thou hast done this, thou art cursed above all cattle, and above every beast of the field; upon thy belly shalt thou go, and dust shalt thou eat all the days of thy life:         \subsection{} And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel.         \subsection{} Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children; and thy desire shall be to thy husband, and he shall rule over thee.     \section{}         \subsection{} And Adam knew Eve his wife; and she conceived, and bare Cain, and said, I have gotten a man from the LORD.         \subsection{} And she again bare his brother Abel. And Abel was a keeper of sheep, but Cain was a tiller of the ground.         \subsection{} And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD.         \subsection{} And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering:         \subsection{} But unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell.         \subsection{} And the LORD said unto Cain, Why art thou wroth? and why is thy countenance fallen?         \subsection{} If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him.         \subsection{} And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him.         \subsection{} And the LORD said unto Cain, Where is Abel thy brother? And he said, I know not: Am I my brother's keeper?         \subsection{} And he said, What hast thou done? the voice of thy brother's blood crieth unto me from the ground.         \subsection{} And now art thou cursed from the earth, which hath opened her mouth to receive thy brother's blood from thy hand;         \subsection{} When thou tillest the ground, it shall not henceforth yield unto thee her strength; a fugitive and a vagabond shalt thou be in the earth.          \end{document}