title: Remove key from style

text: Is it possible to create a key handler with the `pgfkeys` package that removes a key from a style? Here's a minimal working example:               \documentclass[preview,margin=10pt,convert]{standalone}     \usepackage{pgfkeys}     \pgfkeys{/a/.code={a#1},         /b/.code={b#1},         /c/.code={c#1}}     \pgfkeys{/my style/.style = {/a=1, /b=2, /c=3}}     \begin{document}     \pgfkeys{/my style}\par     %\pgfkeys{/my style/.remove from style = {b}}     \pgfkeys{/my style}     \end{document}      The output is ![a1b2c3a1b2c3](http://i.stack.imgur.com/vb7ta.png) The desired output, if the commented line were to be uncommented, would be               a1b2c3     a1c3      Here are a couple of closely related questions. They are not duplicates of this one, but the answers to the second one might be useful in devising an answer to this question. Unsetting a PGF/TikZ key How to extract the value from a pgfkeys style element


title: define environment in tcolorbox with math mode in lower

text: I want define an environment in tcolorbox. 6 questions:   1. Why when i want use **math lower** and **ams align* lower** for set the lower part to mathematical mode with font \displaystyle, i have error?   2. Why declaration \bfseries in **fontupper=\bfseries** is not work?   3. How can define Maple code in listings package? I want put maple code in upper part and i have to define that style myself.   4. I want put **>** character before any line in upper part, how can do that?   5. Why when use before **upper={\texttt{>}}** , code appear in a newline after **>** char?   6. I use **center lower** , but lower part doesn't shift in center. see this code:               \documentclass{article}          \usepackage[svgnames]{xcolor}     \usepackage{tcolorbox}     \usepackage{amsmath,amsfonts,amssymb,amsthm}     \usepackage{lipsum}     %\usepackage{maplestd2e}          \tcbuselibrary{listings}     \tcbuselibrary{skins}     \tcbuselibrary{theorems}          \definecolor{ocre}{RGB}{243,102,25}          %\lst@definelanguage{Maple}%     %{morekeywords={and,assuming,break,by,catch,description,do,done,%     %elif,else,end,error,export,fi,finally,for,from,global,if,%     %implies,in,intersect,local,minus,mod,module,next,not,od,%     %option,options,or,proc,quit,read,return,save,stop,subset,then,%     %to,try,union,use,uses,while,xor},%     %sensitive=true,%     %morecomment=[l]\#,%     %morestring=[b]",%     %morestring=[d]"%     %}[keywords,comments,strings]%           \newtcblisting{code}[1]{                lowerbox=visible, % visible,invisible,ignored,     %          colback=black,                skin=bicolor,     %          colbacklower=white,     %          colupper=white,     %          collower=black,                overlay={\draw[dashed,black] (segmentation.west)--(segmentation.east);},     %          listing options={language={Maple}},     %          frame style={draw=black,left color=Gold,right color=Goldenrod!50!Gold},                fontupper=\bfseries,                fontlower=\sffamily\bfseries,                width=\linewidth,     %          toprule=1mm,bottomrule=.3mm,rightrule=.3mm,leftrule=3mm,                boxrule=0.5mm,                outer arc=1mm,arc=1mm,     %          leftupper=3cm,leftlower=3cm,rightupper=4cm,rightlower=3cm,                top=1mm,bottom=1mm,middle=1mm,     %          height=,                valign=center,                valign lower=center,                before=\begin{center},after=\end{center},                before upper={\texttt{>}},                before lower={\begin{center}},                after lower={\end{center}},                center lower, % center upper,     %          flushright upper,                nobeforeafter,                 math lower,     %          ams align* lower,                listing and comment,                comment={#1}                }          \begin{document}               \begin{code}{\frac{n}{n+1}}     2+3;     \end{code}          \end{document}      output: ![enter image description here](http://i.stack.imgur.com/S6NnC.png)


title: Math mode commands with more semantics?

text: I accustomed myself to define my own little macros for any mathematical expression I use frequently. For example, I have a macro for the expected value of a random variable:               \providecommand{\ev}[1]{\mathbb{E} \left[#1 \right]}      This has proven to be incredibly useful for several reasons:   1. I have less to write.   2. My document source is uncluttered.   3. I can focus on the semantics instead of the typesetting. In non-math mode, this is the default: I specify what I want (e.g. a subsection), not how it should look like (e.g. large and bold, with letters capitalized). Even in math mode, there are certain commands (e.g. `\frac`) which come with semantics attached to them. Another advantage I can think of is that it is easier to adjust documents to different tastes: Some people may be used to the `\mathbb{E}`, others to a bold or even a normal `E` for denoting an expected value. Having macros that carry semantics would allow to quickly change the notation. With all this in mind, it seems quite surprising that I wasn't able to find a package which provides me with such commands. Am I just looking in the wrong places or is there a good reason for not doing what I try to?


title: In forest (tikz) for syntax trees, how do I create an arc above one node separating it off from the rest of the tree?

text: Here's a picture example of what I want: ![enter image description here](http://i.stack.imgur.com/EbrDc.png) I'm able to make the type of arc that I want with this command:               \draw (-2,-2) [black,thick,dashed,domain=45:180] plot ({cos(\x)}, {sin(\x)}) ;      But it always creates the arc at the very top of the tree, even when I put the command inside the tree in the node where I want the arc. Here's the code I'm using:               begin{forest}     [TP [T\textsuperscript{0}]     [vP [DP\textsubscript{???},circle,draw]     [v' [v\textsuperscript{0}]     [VP,tikz={\draw[black,thick,dashed,domain=45:180] (2,2) plot ({cos(\x)}, {sin(\x)}) ;}     [V\textsuperscript{0}] [DP\textsubscript{???},circle,draw]     ]]]]     \end{forest}


title: Maths without paper sheet

text: I would like to know if it is possible to write Maths on latex without having to write a first draft on paper? As far as I'm concerned latex writing seems to demand a separation between the thinking and the presentations. In other words, latex format seem to require doing the thinking on paper then writing on latex. I'm using the Auctex package with emacs, along with the predictive and auto- completion package but still I'm wondering if there is any possibility to facilitating further the maths writing on latex. (through macros, functions etc..) Those who attempted to bypass the paper phase would you mind to share your techniques? **update** Thanks all for your suggestions. I was thinking of something that reduce the effor that one need to put in the presentation so that he can focus more on the maths. But am sure the latex syntax become natural once someone spend enough time on it. Yet, I recenly came across Yasnippet and it seem that it is exactly what I was looking for. With it one can build tools that fits his need. for example . Instead of typing \frac{}{} and move the cursor through (even more painful on a French keyboard), one can type frac .Then he can type his numebers easily. Of course the one can modify the code to best fit his needs. Can anyone share his most efficient snippets?


title: Redefinition of pgfplotstableread and inline tables

text: I had to redefine `pgfplotstableread` because I use it in `standalone` files in an extra `img/` folder that loads data from a different `data/` folder as follows.               \begin{filecontents}{plot.tikz}     \documentclass{standalone}     \usepackage{pgfplots,pgfplotstable}     \usetikzlibrary{external}          \begin{document}     \tikzsetnextfilename{myplot}     \begin{tikzpicture}     \begin{axis}     \addplot table[row sep=\\] {     n err\\     1E3 1E-5\\     1E5 1E-9\\     };     \end{axis}     \end{tikzpicture}     \end{document}     \end{filecontents}          \documentclass{article}     \usepackage{pgfplots,pgfplotstable}     \usetikzlibrary{external}     \tikzsetexternalprefix{img/}     \tikzexternalize     % define table read from image folder     \let\OLDpgfplotstableread\pgfplotstableread     \renewcommand{\pgfplotstableread}[1]{\OLDpgfplotstableread{img/#1}}     \usepackage{standalone}     \begin{document}     \input{plot.tikz}     \end{document}      This apparently screws up my ability to use inline tables in `pgfplots` as this mwe does not compile. The whole external stuff is not necessary to reproduce the problem but is justification for the redefinition. A real MWE would be               \documentclass{article}     \usepackage{pgfplots,pgfplotstable}     \let\OLDpgfplotstableread\pgfplotstableread     \renewcommand{\pgfplotstableread}[1]{\OLDpgfplotstableread{img/#1}}     \begin{document}     \begin{tikzpicture}     \begin{axis}     \addplot table{     n err     1E3 1E-5     1E5 1E-9     };     \end{axis}     \end{tikzpicture}     \end{document}      Is there any way to have both features enabled at the same time (relative paths and inline tables)?


title: Beamer missing section causing Undefined control sequence error

text: I ran onto this error today, here is a minimum example:               \documentclass[]{beamer}          \begin{document}     % \section{A section}     \subsection{A subsection}          \begin{frame}       \frametitle{Cursed frame}     This is awkward.     \end{frame}          \end{document}      The compilation gives: `Undefined control sequence. [\end{frame}]` Apparently declaring a subsection without a section causes the error to appear as removing the comment, makes the error go way. What also is weird is that despite the error, the `.pdf` is produced fine in both cases. I'd like to know why this happens, as in other documents having subsections without section never was a problem. Is it a bug or a feature?


title: Automatic pin position on pgfplot when using custom axis

text: I'm trying to put automatically label several plots. For this purpose, I just discover the `pin` option to add it to the plots. This solution works rather well, and semi-automatically. However, when you redefine the axis (by setting `xmin`, `xmax`, `ymin`, and `ymax`) the position stops working, as the labels appear in the original position not the clipped one. So, how can I make the `pin` and `pos` keywords work within the defined axis instead of the original domain?               \documentclass{article}          \usepackage{pgfplots}     \pgfplotsset{compat=newest}          \pagestyle{empty}          \begin{document}     \begin{tikzpicture}     \pgfplotsset{         every axis plot post/.append style=             {mark=none}}          \begin{axis}[       xmin=-10, xmax=10,       ymin=-10, ymax=10,       domain=-10:10,         ]     \addplot {1.690476*x+0.238095} node [pos=1,pin={above left:{$1$}},inner sep=0pt] {};     \addplot {-57.000000*x+-20.000000} node [pos=1,pin={above left:{$2$}},inner sep=0pt] {};     \addplot {-0.590909*x+-0.113636} node [pos=1,pin={above left:{$3$}},inner sep=0pt] {};     \end{axis}     \end{tikzpicture}     \end{document}      Custom axis ![enter image description here](http://i.stack.imgur.com/XJlQj.jpg) No axis defined ![enter image description here](http://i.stack.imgur.com/Rgoiw.jpg)


title: Convert figures to old style with Kurier font

text: I am trying to convert the figures of a mixed string over which I have no control, say > +1 (234) 567 890 abcd to old style when using the kurier font.   I know of `\oldstylenums`, but it switches to the OML encoding which does not support symbols such as "+", "(", etc After trying out several things (like parsing the string with xstring and substituting the numbers for \oldstylenums{number} -- I got stuck with annoying TeX expansion issues), I finally found a way to do it by redefining the normal math font version and declaring the numbers as a special category of symbols, i.e.               \SetSymbolFont{operators}{normal}{T1}{kurier}{l}{n}     \SetSymbolFont{letters}{normal}{T1}{kurier}{l}{n}     \SetSymbolFont{symbols}{normal}{T1}{kurier}{l}{n}     \SetSymbolFont{largesymbols}{normal}{T1}{kurier}{l}{n}     \DeclareSymbolFont{numbers}{OML}{kurier}{l}{n}     \DeclareMathSymbol{0}\mathalpha{numbers}{"30}     \DeclareMathSymbol{1}\mathalpha{numbers}{"31}     \DeclareMathSymbol{2}\mathalpha{numbers}{"32}     \DeclareMathSymbol{3}\mathalpha{numbers}{"33}     \DeclareMathSymbol{4}\mathalpha{numbers}{"34}     \DeclareMathSymbol{5}\mathalpha{numbers}{"35}     \DeclareMathSymbol{6}\mathalpha{numbers}{"36}     \DeclareMathSymbol{7}\mathalpha{numbers}{"37}     \DeclareMathSymbol{8}\mathalpha{numbers}{"38}     \DeclareMathSymbol{9}\mathalpha{numbers}{"39}      I can then simply use `$+1 (234) 567 890 abcde$`. To solve the math spacing issue, I actually do               $\StrSubstitute{+1 (234) 567 890 abcde}{ }{$ $}$      But it's probably the ugliest hack I've writtent since a long long time... Any idea on how to do this in an elegant way?


title: Customize headers and footers

text: I am writing my bachelor's thesis and the requirements for the first page are:   * in the header - name of the intitution   * in the center - the title of the paper   * in the footer - the town and the year How can I do this? I have tried to use the `fancyhdr` package and have managed to change the header, but that applies only on the pages in my paper, and not to the first page. The header does not have to be underlined. Also, on the next pages, I don't want any header to appear. This is what I have so far:               \documentclass[a4paper,10pt]{report}     \usepackage{fancyhdr}          \pagestyle{fancy}     \lhead{}     \chead{Institution}     \rhead{}     \title{Title}     \author{Author}          \begin{document}     \end{document}


title: How can I insert simple Table Notes?

text: I've tried to get some table notes to work in a paper I'm working on. Here is what my table looks like (minus the details for clarity):               \documentclass[progress]{cmpreport}     \usepackage{enumitem}     \usepackage{wasysym}     \usepackage{framed}     \usepackage{pgfgantt,rotating}     \usepackage{subfloat}     \usepackage{multirow}     \usepackage{blindtext}          ...          \begin{document}     \begin{table*}[ht]     \caption{Revisions}     \centering         \begin{tabular}{p{0.10\linewidth}                         p{0.15\linewidth}                         p{0.45\linewidth}                         p{0.20\linewidth}}         \hline             Title 1 & Title 2 & Title 3 & Title 4          \\         \hline             Cell 1  & Cell 1  & Cell 3  & Cell 4 \tnote{a} \\             Cell 1  & Cell 1  & Cell 3  & Cell 4 \tnote{b} \\         \hline         \end{tabular}         \begin{tablenotes}             \item[a] My Note.             \item[b] My Other Note.         \end{tablenotes}     \end{table*}          ...          \end{document}      Although they appear below the table, I can not seem to get the superscript reference letter to appear... I've looked at other examples on here and they seem a lot more complicated tables that this one... Is there something I'm missing?


title: too tricky for pstricks?

text: I'm trying to copy the graph of a piecewise function created in GeoGebra into a LaTeX document but all I see are the axes -- no curves. I'm running TexShop and compiling with XeLaTex. In the log file I get the following ominous messages:               ** WARNING ** Image format conversion for PSTricks failed.     ** WARNING ** Interpreting special command pst: (ps:) failed.      The thing is that simpler graphs, like parabolae and lines seem to be ok --- is this one just way too complicated?               \documentclass[10pt]{article}     \usepackage{pstricks-add}     %\usepackage{pst-plot}     \pagestyle{empty}     \begin{document}     \newrgbcolor{xdxdff}{0.49 0.49 1}     \psset{algebraic=true}      \psset{xunit=2.0cm,yunit=2.0cm}     \begin{pspicture*}(-3.94,-5.35)(7.93,3.35)     \psgrid[subgriddiv=0,gridlabels=0,gridcolor=lightgray](0,0)(-3.94,-5.35)(7.93,3.35)     \psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dotstyle=o,dotsize=3pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}     \psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=2,Dy=2,ticksize=-2pt 0,subticks=2]{->}(0,0)(-7.88,-10.7)(15.86,6.69)     \psplot[plotpoints=200]{-7.883107654532565}{0.95999979546005}{(x*<*0.96)*(x^2+1)}     \psplot[plotpoints=200]{1.0800001247036413}{6.999999907292117}{((1.08*<*x)*∧*(x*<*7))*(x-1)*(x-2)*(x-5)/(x-4)}     \begin{scriptsize}     \psdots[dotstyle=*,linecolor=blue](1,4)     \psdots[dotsize=4pt 0,linecolor=xdxdff](1,2)     \psdots[linecolor=xdxdff](1,0)     \end{scriptsize}     \end{pspicture*}     \end{document}


title: tables in lyx that flow with the text

text: I have been using `float:table` as my default for tables. I insert a `float:table`, then in that float I insert a child document (as input) that contains all my latex code for the table. This works fine but puts each table on its own page. I would like tables to flow with the text. That is have tables take up as much or little space as it needs and for text to continue. I currently use the `endfloat` package to put all my tables at the end of the document so one table per page is fine but I would like to convert it now to be part of the text. Here is an example of a document that does this: https://www.princeton.edu/~markus/research/papers/carry_trades_currency_crashes_old.pdf


title: siunitx S column does not align numbers without dot

text: I have a table that uses the S column type provided by `siunitx`. Unfortunately, if a number does not have a `.` it is not aligned properly. Yes, i could write `number.` but then the table will list the entry as `number.0` instead of just `number`.               \documentclass{article}     \usepackage{booktabs}     \usepackage{siunitx}     \begin{document}          \begin{table} \centering     {\small     \begin{tabular}{SS}     \toprule     {x}   &{x}   \\     \midrule     123 & 23.0e-5  \\     123.0 & 23\\     0.23 & 1.423  \\     0.23 & 1  \\     \bottomrule     \end{tabular}}     \end{table}          \end{document}      ![Table with S column type](http://i.stack.imgur.com/F6rBK.png)


title: Why does indenting a paragraph compound on subsequent paragraphs?

text: I'm attempting to indent cases and subcases of a proof by 1.3cm. However, when I apply `adjustwidth` to a subcase, it seems to affect the subcase following it. Here is how it looks with my current code: ![Case 2.2 indented too far](http://i.stack.imgur.com/2S0pG.png) And here's how I'd like it to look: ![Case 2.2 indented correctly](http://i.stack.imgur.com/mx02m.png) Code I'm using (excuse the sloppy reuse of code):               \documentclass{article}     \usepackage{amsthm}     \usepackage{changepage}     \begin{document}         \begin{proof}             {\it Case 1.} First case.                  \begin{adjustwidth}{1.3cm}{}                 Case explanation.             \end{adjustwidth}                  {\it Case 2.} Second case.                  \begin{adjustwidth}{1.3cm}{}                 {\it Case 2.1.} First part.                      {\it Case 2.2.} Second part.                      \begin{adjustwidth}{1.3cm}{}                     Second part explanation.                 \end{adjustwidth}             \end{adjustwidth}         \end{proof}     \end{document}      How can I adjust my code to allow uniform indenting of sections? If it's not possible with `adjustwidth`, what can I use?


title: TikZ - use non-Tikz command to layout part of picture

text: I'm using a package (`semantic.sty`) that draws something semi-complicated using LaTeX (not TikZ). I would like to draw part of a TikZ picture using the same command, with parts of the TikZ picture embedded inside. MWE:               \documentclass{article}          \usepackage{amsmath,semantic,tikz}          % \newcommand\tnode[2]{\tikz\node[anchor=text,inner sep=0](#1){$#2$};}          \begin{document}          \begin{center}     \begin{tikzpicture}     \node(C){$     \inference{         \inference{             A & B     %         A & \tnode{B}{B}         }{A \wedge B} &         \inference{             C & D         }{C \wedge D}     %     }{\tnode{CandD}{C \wedge D}}     }{(A \wedge B) \wedge (C \wedge D)}     $};     \node(N)[draw,above=.5in] at (C.north) {N};     \node(E)[draw,right=.5in] at (C.east) {E};     \node(S)[draw,below=.5in] at (C.south) {S};     \node(W)[draw,left=.5in] at (C.west) {W};     % \tikzset{every path/.style={draw,very thick}}     % \path[red] (N) to[out=-90,in=90] (B);     % \path[green] (E) to[out=180,in=0] (CandD);     \end{tikzpicture}     \end{center}          \end{document}      produces everything but the colored lines in ![latex output with mocked up lines](http://i.stack.imgur.com/TVqmG.png) I would like to draw the mocked-up colored lines connecting nodes to parts of the tree, and possibly also turn some things in the tree into TikZ nodes (so I can add background colors, borders, etc.). The most tempting way I can think of is to embed `\tikz\node`s inside the tree (commented code above), but this doesn't work: ![latex output with incorrect lines](http://i.stack.imgur.com/QBQUx.png) Some other answers I've read suggest replacing nested `\tikz`/`tikzpicture`s with `fit`, but this doesn't seem to work in my case because the `\tikz`s need to be embedded deep inside a LaTeX command. Less importantly, I think the code for embedded `\tikz`s is more user-friendly. A more drastic solution would be to reimplement the LaTeX drawing command in TikZ, but this would be the least desirable option for me. Question: what would be the cleanest way to achieve this, preferably using syntax resembling the above (commented-out) code?


title: Incorrect alignment when using aligned

text: I'm trying to TeX some nice equations but there is a strange behaviour when I use an `aligned`-environment in an `align*`-environment. I think one little example makes my problem clear:               \begin{align*}     & A \land \\     & \begin{aligned}     B = & B1 \land \\         & B2     \end{aligned} \\     \Longrightarrow \;& what follows from A \land B     \end{align*}      When I compile this A and B are not equal aligned. It seems like the beginning of the `aligned`-environment produces a little space. Any idea?


title: Error in PS generated by MetaUML

text: If I use following example (or any other):               input metauml;          beginfig(1);     Class.A("Point")            ("+x: int",             "+y: int") ();          Class.B("Circle")            ("radius: int")            ("+getRadius(): int",             "+setRadius(r: int):void");          topToBottom(45)(A, B);          drawObjects(A, B);          clink(aggregationUni)(A, B)     endfig;          end;      It generates PS that I cannot view in evince and gs:               GPL Ghostscript  9.00 (2010-09-14)     Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.     This software comes with NO WARRANTY: see the file PUBLIC for details.     Error: /undefined in ptmr8r     Operand stack:        (Point)     Execution stack:        %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   1877   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--     Dictionary stack:        --dict:1157/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--     Current allocation mode is local     Current file position is 895     GPL Ghostscript  9.00: Unrecoverable error, exit code 1      Generated code:               %!PS     %%BoundingBox: -33 -141 71 1      %%HiResBoundingBox: -32.34918 -140.52289 70.86105 0.25      %%Creator: MetaPost 1.211     %%CreationDate: 2010.11.13:2050     %%Pages: 1     %*Font: ptmr8r 9.96265 9.96265 20:80c000201000a0005d4b3ec     %%BeginProlog     %%EndProlog     %%Page: 1 1      0.7 0.7 0.7 setrgbcolor     newpath 1 -1 moveto     38.76186 -1 lineto     38.76186 -43.25916 lineto     1 -43.25916 lineto      closepath fill      0.9 0.9 0.9 setrgbcolor     newpath 0 0 moveto     37.76186 0 lineto     37.76186 -42.25916 lineto     0 -42.25916 lineto      closepath fill      0 0 0 setrgbcolor 0 0.5 dtransform truncate idtransform setlinewidth pop      [] 0 setdash 1 setlinejoin 10 setmiterlimit     newpath 0 0 moveto     37.76186 0 lineto     37.76186 -42.25916 lineto     0 -42.25916 lineto      closepath stroke      1 setlinecap     newpath 0 -12.75458 moveto     37.76186 -12.75458 lineto stroke     newpath 0 -37.75916 moveto     37.76186 -37.75916 lineto stroke     8.3605 -9.75458 moveto     (Point) ptmr8r 9.96265 fshow     13 -23.25916 moveto     (x:\040int) ptmr8r 9.96265 fshow     13 -33.75916 moveto     (y:\040int) ptmr8r 9.96265 fshow      0.4 0.4 0.4 setrgbcolor     newpath 2 -20.5592 moveto     7.95004 -20.5592 lineto     7.95004 -23.25916 lineto     2 -23.25916 lineto      closepath fill      0.7 0.7 0.7 setrgbcolor     newpath 7.95004 -23.25916 moveto     9 -22.2092 lineto     9 -19.50925 lineto     7.95004 -20.5592 lineto      closepath fill      0.6 0.6 0.6 setrgbcolor     newpath 7.95004 -20.5592 moveto     9 -19.50925 lineto     3.04996 -19.50925 lineto     2 -20.5592 lineto      closepath fill      0.4 0.4 0.4 setrgbcolor     newpath 2 -31.0592 moveto     7.95004 -31.0592 lineto     7.95004 -33.75916 lineto     2 -33.75916 lineto      closepath fill      0.7 0.7 0.7 setrgbcolor     newpath 7.95004 -33.75916 moveto     9 -32.7092 lineto     9 -30.00925 lineto     7.95004 -31.0592 lineto      closepath fill      0.6 0.6 0.6 setrgbcolor     newpath 7.95004 -31.0592 moveto     9 -30.00925 lineto     3.04996 -30.00925 lineto     2 -31.0592 lineto      closepath fill      0.7 0.7 0.7 setrgbcolor     newpath -31.09918 -88.25916 moveto     70.86105 -88.25916 lineto     70.86105 -140.52289 lineto     -31.09918 -140.52289 lineto      closepath fill      0.9 0.9 0.9 setrgbcolor     newpath -32.09918 -87.25916 moveto     69.86105 -87.25916 lineto     69.86105 -139.52289 lineto     -32.09918 -139.52289 lineto      closepath fill      0 0 0 setrgbcolor     newpath -32.09918 -87.25916 moveto     69.86105 -87.25916 lineto     69.86105 -139.52289 lineto     -32.09918 -139.52289 lineto      closepath stroke     newpath -32.09918 -100.01373 moveto     69.86105 -100.01373 lineto stroke     newpath -32.09918 -114.51831 moveto     69.86105 -114.51831 lineto stroke     6.7068 -97.01373 moveto     (Circle) ptmr8r 9.96265 fshow     -19.09918 -110.51831 moveto     (radius:\040int) ptmr8r 9.96265 fshow     -19.09918 -125.02289 moveto     (getRadius\(\):\040int) ptmr8r 9.96265 fshow     -19.09918 -135.52289 moveto     (setRadius\(r:\040int\):void) ptmr8r 9.96265 fshow      0.4 0.4 0.4 setrgbcolor     newpath -30.09918 -107.81836 moveto     -24.14914 -107.81836 lineto     -24.14914 -110.51831 lineto     -30.09918 -110.51831 lineto      closepath fill      0.7 0.7 0.7 setrgbcolor     newpath -24.14914 -110.51831 moveto     -23.09918 -109.46835 lineto     -23.09918 -106.7684 lineto     -24.14914 -107.81836 lineto      closepath fill      0.6 0.6 0.6 setrgbcolor     newpath -24.14914 -107.81836 moveto     -23.09918 -106.7684 lineto     -29.04922 -106.7684 lineto     -30.09918 -107.81836 lineto      closepath fill      0.3 0.3 0.3 setrgbcolor 0 0.79701      dtransform truncate idtransform setlinewidth pop 0 setlinecap     newpath -28.5242 -105.04338 moveto     -28.00685 -104.4082 -27.40976 -103.75253 -26.59918 -103.76831 curveto     -25.12357 -103.79704 -24.63 -105.58928 -24.67416 -107.29338 curveto stroke      0.4 0.4 0.4 setrgbcolor     newpath -30.09918 -122.32294 moveto     -24.14914 -122.32294 lineto     -24.14914 -125.02289 lineto     -30.09918 -125.02289 lineto      closepath fill      0.7 0.7 0.7 setrgbcolor     newpath -24.14914 -125.02289 moveto     -23.09918 -123.97293 lineto     -23.09918 -121.27298 lineto     -24.14914 -122.32294 lineto      closepath fill      0.6 0.6 0.6 setrgbcolor     newpath -24.14914 -122.32294 moveto     -23.09918 -121.27298 lineto     -29.04922 -121.27298 lineto     -30.09918 -122.32294 lineto      closepath fill      0.4 0.4 0.4 setrgbcolor     newpath -30.09918 -132.82294 moveto     -24.14914 -132.82294 lineto     -24.14914 -135.52289 lineto     -30.09918 -135.52289 lineto      closepath fill      0.7 0.7 0.7 setrgbcolor     newpath -24.14914 -135.52289 moveto     -23.09918 -134.47293 lineto     -23.09918 -131.77298 lineto     -24.14914 -132.82294 lineto      closepath fill      0.6 0.6 0.6 setrgbcolor     newpath -24.14914 -132.82294 moveto     -23.09918 -131.77298 lineto     -29.04922 -131.77298 lineto     -30.09918 -132.82294 lineto      closepath fill      0 0 0 setrgbcolor 0.5      0 dtransform exch truncate exch idtransform pop setlinewidth     newpath 18.88094 -54.75896 moveto     18.88094 -74.75975 lineto stroke     newpath 18.88094 -54.75896 moveto     18.88094 -42.25922 lineto stroke      0 0.5 dtransform truncate idtransform setlinewidth pop     newpath 18.88094 -42.25922 moveto     13.88094 -54.75896 lineto stroke     newpath 18.88094 -42.25922 moveto     23.88094 -54.75896 lineto stroke      1 1 1 setrgbcolor     newpath 18.88094 -74.75957 moveto     23.88094 -81.00945 lineto     18.88094 -87.25931 lineto     13.88094 -81.00945 lineto      closepath fill      0 0 0 setrgbcolor     newpath 18.88094 -74.75957 moveto     23.88094 -81.00945 lineto     18.88094 -87.25931 lineto     13.88094 -81.00945 lineto      closepath stroke     showpage     %%EOF      What am I doing wrong? **Edit** : When I use pdflatex it generates a proper pdf (at least with /usr/share/ghostscript/GS_Version/Resource/Init/Fontmap.GS modified)


title: Embedding MetaPost in LaTeX document

text: I have problem using the emp package in TeXlive 2010. When I try to use it with `empcmds` it prints contents to output. If I use `emp` it parser fails after first character. Also - how should I import libraries such as MetaUML. **Edit** : Code               \documentclass[a4paper,11pt]{article}     \usepackage{enumerate}     \usepackage{amsmath}     \usepackage{emp}     \author{Maciej~M.~Piechotka}     \title{MetaUML}     \begin{document}          \begin{emp}     input metauml;          beginfig(1);     Class.A("Point")            ("+x: int",             "+y: int") ();          Class.B("Circle")            ("radius: int")            ("+getRadius(): int",             "+setRadius(r: int):void");          topToBottom(45)(A, B);          drawObjects(A, B);          clink(aggregationUni)(A, B)     endfig;          end;          \end{emp}          \end{document}      and error:               ! Use of \emp@ doesn't match its definition.     <recently read> i          l.10 i           nput metauml;      **Final result:**               \documentclass[a4paper,11pt]{article}     \usepackage{emp}     \usepackage[pdftex]{graphicx}     \author{Maciej~M.~Piechotka}     \title{MetaUML}     \begin{document}     \DeclareGraphicsRule{*}{mps}{*}{}          \begin{empfile}     \begin{empcmds}     input metauml;     \end{empcmds}          Hi there:     \begin{emp}[uml1](20,20)     Class.A("Point")            ("+x: int",             "+y: int") ();          Class.B("Circle")            ("radius: int")            ("+getRadius(): int",             "+setRadius(r: int):void");          topToBottom(45)(A, B);          drawObjects(A, B);          link(aggregationUni)(A, B);     \end{emp}     \end{empfile}     \immediate\write18{mpost -tex=latex \jobname}     \end{document}


title: strut and strutbox

text: The definition of a `\strut` in LaTeX is given in the source as:               211 \newbox\strutbox     212 \def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}      Shoudn't a `\strutbox`, give an empty box? AS you can see from the example below, it prints the ligature `ae`, if I include `fixltx2e` and the ligature `ff` if I don't. `\strut` works as expected.               \documentclass[11pt]{article}      \usepackage{fixltx2e}     \begin{document}         \strutbox         \texttt{\strutbox}          \textit{\strutbox}     \end{document}


title: Talking Balloon in TikZ

text: I have the following code                \documentclass[12pt]{article}      \usepackage{tikz}      \usetikzlibrary{calc,shapes.callouts,shapes.arrows}      \newcommand{\bubblethis}[2]{         \tikz[remember picture,baseline]{\node[anchor=base,inner sep=0,outer sep=0]%         (#1) {\underline{#1}};\node[overlay,cloud callout,callout relative pointer={(0.2cm,-0.7cm)},%         aspect=2.5,fill=yellow!90] at ($(#1.north)+(-0.5cm,1.6cm)$) {#2};}%     }%           \begin{document}      \bubblethis{B}{I know X}      \end{document}      This creates a talking bubble but I want to create bubble over bubbles. I tried using `\bubblethis` function twice but it makes second balloon twice. To see what I mean by typing `\bubblethis{B}{\bubblethis{I know X}{I know a}}`. If someone makes a good tweak the code that would be great. Thanks for any help This picture is sort of what I want. ![enter image description here](http://i.stack.imgur.com/SvrNf.jpg)


title: Combining vectors, accents and subscripts produces bad result

text: Combining vectors, accents and subscripts produces really bad results. First row below shows combining vector and accent. In second example accent and vector symbol clash. In third example vector symbol is too far from 'r'. Fourth example is patch by adding some space to the second example and this is what I usually use. Second row shows combining vector and subscript by including subscript under \vect command. I don't like result because vector symbol is moved to the right and no longer above 'r'. Third row combining vector and subscript by putting subscript outside \vect command. None of the results are acceptable. **So how would you typeset those combinations? Is it possible to do that centrally, not by patching every single instance of the combination?** MWE:               \documentclass[12pt]{scrbook}     \usepackage{amsmath}          \begin{document}          \thispagestyle{empty}     \begin{align*}     \vec{r} \; \vec{r}' \; \vec{r'} \; \vec{r}\,'\\     \vec{r_\text{g}} \; \vec{r_\text{g}}' \; \vec{r_\text{g}'} \; \vec{r_\text{g}}\,'\\     \vec{r}_\text{g} \; \vec{r}_\text{g}' \; \vec{r'}_\text{g} \; \vec{r}_\text{g}\,'     \end{align*}          \end{document}      ![enter image description here](http://i.stack.imgur.com/9AluU.png)


title: LaTeX equivalent of ConTeXt buffers

text: While creating a series of graphics (using TikZ) in ConTeXt, I frequently use ConTeXt's buffer to "copy-paste" code. Is there a LaTeX package that implements this feature? Since most LaTeX users may not know what buffers do, let me explain that. Suppose I want to draw a graph in steps: in the first step, only draw the nodes, in the second step draw the edges, in the third step highlight a part of the graph. In ConTeXt, I would do this as follows:               \startbuffer[nodes]     % tikz code for drawing nodes     \stopbuffer          \startbuffer[edges]     % tikz code for drawing edges     \stopbuffer          \startbuffer[highlight]     % tikz code for highlight a part     \stopbuffer          \starttext     \startTEXpage \getbuffer[nodes] \stopTEXpage     \startTEXpage \getbuffer[nodes,edges] \stopTEXpage     \startTEXpage \getbuffer[nodes,edges,highlight] \stopTEXpage     \stoptext      This will give me a pdf file with three pages, that build up the graph in steps. How do I do the same in LaTeX? I can use the preview package to extract TikZ pictures on individual pages, but don't know how to build the graph in steps. One option is to use beamer overlays to create the graph in steps, but creating a presentation for each figure appears to be an overkill. I can just copy paste code, but that is difficult to maintain in the long run. Any suggestions? ### Edit The proposed solution of storing the contents in a macro does not always work. For example               \documentclass{minimal}     \usepackage{tikz}          \def\NODES       {\matrix         {         \node (a) {$a$} ; & \node (b) {$b$} ; \\         } ;       }          \begin{document}     \begin{tikzpicture}       \NODES     \end{tikzpicture}     \end{document}      gives               ! Package pgfbasematrix Error: Single ampersand used with wrong catcode.      Any other suggestions?


title: TikZ - set of 1-d point charges

text: Trying to create a set of alternating (+q,-q etc.) Point charges on a line? Completely new to Tikz. Thanks in advance.


title: How to put the formula in line with the text in the example below

text: Be the $     \begin{array}{cccl}     \gamma\ : & \! \mathrm{I} & \! \longrightarrow & \! \mathbb{R}^2 \\     & \! s & \! \longmapsto & \! \gamma(s)     \end{array}     $ differentiable and parameterized


title: Border/frame for special text in latex

text: I'm writing about hash strings like this: "1DGooBsCL8eBHRq4UHPwiYbvu2Weiuw837" etc. I would like to do some border box or decorations for hash strings. Is it possible in latex?


title: newline in description of `newglossaryentry`

text: How is it possible to get a newline at the beginning of the description? So the description starts at second line? MWE:               \documentclass[11pt,english,ngerman,numbers=noenddot, headsepline]{scrreprt}     \usepackage[colorlinks]{hyperref}     \usepackage{glossaries}          \makeglossaries          \newglossaryentry{NIS}{         name={NIS},          description={Name Information Service \\* see \ref{subsec:nis} \nameref{subsec:nis}}     }          \newglossaryentry{Test}{         name={Test},          description={\\* This is a Test}     }               \begin{document}          \subsection{Name Information Service}     \label{subsec:nis}     A long big text about \gls{NIS}     A short text about \gls{Test}               \printglossaries          \end{document}      MWE Error:               ! LaTeX Error: There's no line here to end.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...          l.8 ...etentrycounter[]{page}\glsnumberformat{1}}}                                                       %


title: Two questions on the `monthly` package

text: I have this code:               \documentclass{tufte-handout}     \usepackage{monthly}          \begin{document}          \begin{fullwidth}         \begin{monthly}             {}{}             1 May 2014 to 31 May 2014         \end{monthly}     \end{fullwidth}               \end{document}        1. As you will see if you compile it, the calendar occupies only the regular width of the `tufte-handout` text block, despite the `fullwidth` environment. Is there a way to make it recognize the `fullwidth` environment?   2. Is there a way to change the color of the calendar cells (as opposed to the type)? Say, e.g., I wanted all the Mondays to be colored gray (i.e., 20% black or so). Is there a way to do that?


title: csuse with foreach

text: Am having difficulty determining the correct syntax for using `\csuse` from the `etoolbox` package with a `\foreach`. I have a list, and for _each_ element in this list I need to create a new list. To simplify the MWE, I used `\IfStrEq` to define the new list using `\csgdef`. The problem in in the second `\foreach` where I have an additional curly brace:               {\csuse{ContentFor\x}}      which should _not_ be needed as per TikZ \foreach loop with macro-defined list. * * * If I leave out the `{}` in the second `\foreach` I get: > Argument of \csuse has an extra } With the `{}` it compiles and I get: ![enter image description here](http://i.stack.imgur.com/EJrOv.png) However, the desired output is: ![enter image description here](http://i.stack.imgur.com/s0o1V.png) ## Code:               \documentclass{article}     \usepackage{xstring}     \usepackage{etoolbox}     \usepackage{pgffor}          \newcommand*{\MyList}{ABC,XYZ}%          \begin{document}          %% For each element of \MyList I need to create a new list.     \foreach \x in \MyList {%         % In my actual use case the list that gets defined for each element of \MyList         % is based on timestamps of files, but as that is not relevant to this          % particular issue I left out that complexity, to make this test case easier to read.         \IfStrEq{\x}{ABC}{%             \csgdef{ContentFor\x}{FileA,FileB,FileC}%         }{%             \csgdef{ContentFor\x}{FileX,FileY,FileZ}%         }%     }%          % Now, only after I have ALL the lists created, I want to print EACH list     % for each element of \MyList.     \foreach \x in \MyList {%         \par\x=         \foreach \y in {\csuse{ContentFor\x}} {% <--- The {} around \csuse{} should NOT be necessary.             \par\hspace*{1.0cm}\y         }%     }%          %%% This is the expected output:     %   \par ABC=     %   \foreach \y in {FileA,FileB,FileC} {%     %       \par\hspace*{1.0cm}\y     %   }%     %   \par XYZ=     %   \foreach \y in {FileX,FileY,FileZ} {%     %       \par\hspace*{1.0cm}\y     %   }%          \end{document}


title: No 'References' title using Elsevier document class

text: I'm trying to compile an article using the `elsarticle` document class. The references work ok, but I can't get the article to show the _References_ section title and I don't know why. Here's a very small working example of my files. Main `.tex` file:               \documentclass[final,5p,times,twocolumn]{elsarticle}     \journal{Elsevier Journal}          \begin{document}     \begin{frontmatter}          \title{The title}     \author[first]{Author}     \address[first]{}          \begin{abstract}     The abstract.     \end{abstract}          \end{frontmatter}          \bibliographystyle{elsarticle-num}          \section{Introduction}      The intro \citep{areference}.          \section{One section}      Some text in this section.          \section{Last section}      Some more text in this other section.          \bibliography{biblio}          \end{document}      the `biblio.bib` file looks like this:               @article{areference,       title = {{Ref title}},       volume = {3},       journal = {Some journal},       author = {Last, A. B.},       year = {1999},       pages = {1-2},     }      And this is the output: ![enter image description here](http://i.stack.imgur.com/QQF6y.png) My compilation command is this:               pdflatex "%f" && bibtex "%e" && pdflatex "%f" && pdflatex "%f"      What am I doing wrong?


title: Align a rectangle above a node in tikz

text: I am just beginning with tikz, and I am trying to put headers and footers in each page. I have this code, but here is my (very little) problem:               \newcommand\Footer{%     \begin{tikzpicture}[remember picture, overlay]     \node[above, yshift=-3] (footer) at (current page.south) {\includegraphics[width=\paperwidth]{footer.png}};     \draw [fill=otherdarkblue, draw=none] (0.1,0.1) rectangle (\paperwidth,0.2); % I want this to be just above the footer and centered horizontally     \end{tikzpicture}%     }      I want the rectangle to be drawn just above the footer node (the bottom of the rectangle should corresponds to the top of the footer) and horizontally centered regarding the footer.


title: Transform big number into scientific format

text: I want to convert my big integer number into a shorter form; for example               \convert{123456789} = 1.23 x 10^9      Is there any package which allows me to do so?


title: Date, place and name in CV

text: I am a beginner in LaTeX and I use THIS for creating my CV. I need to add _date_ , _place_ and my _name_ (signature) to the bottom of this CV document but of course when I add it to the last section, it has a formatting which I don't want to. I would like to align it to the left edge. Shortly I would like to have it and format it like a **normal** text under these section. How can I do it?


title: Margin in output document generated by asymptote

text: In the following figure, generated using `asymptote`, I am getting a PDF file while compiling in a LaTeX document. Labels and angles in crystal structure using Asymptote The problem is, there is huge whitespace around the figure which I cannot crop using `pdfcrop`. I have tried to convert it using `ImageMagick` to JPG or PNG but it is completely destroying the resolution of the image. How can I get a PDF or image file with no excess white space around ?


title: How do I get the gnuplottex/epstopdf package to work with "-output-dir" and "-aux-dir" option?

text: I can't seem to get the `gnuplottex` package to work with my preferred compile options. This is a (not too) minimal example of what I mean:               \documentclass[a4paper,10pt]{scrreprt}          %     \usepackage{etoolbox}    % proposed fix (not working)     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{gnuplottex}          \graphicspath{{./tmp/}}     \epstopdfsetup{outdir=./tmp/}          % proposed fix (not working)     %     \let\nodirfigname\figname     %     \def\figname{./tmp/\nodirfigname}     %      %     \expandafter\patchcmd\csname\string\gnuplot\endcsname     %     {\figname}{\nodirfigname}{}{}          \begin{document}          \begin{figure}[htbp]         \begin{gnuplot}[terminal=epslatex,terminaloptions=color]             reset             plot sin(x)         \end{gnuplot}         \caption[Gnuplot]{Gnuplot direkt in \LaTeX}         \label{fig:gnu}     \end{figure}          \end{document}      If I compile the above file via:               pdflatex -shell-escape -output-directory=./tmp -aux-directory=./tmp bla.tex      I get the following error messages: > [Loading MPS to PDF converter (version 2006.09.02).] ) Opening gnuplot > stream bla-gnuplottex-fig1.gnuplotCannot open load file 'bla-gnuplottex- > fig1.gnuplot' line 0: util.c: No such file or directory > > (./tmp/bla-gnuplottex-fig1.texepstopdf ($Id: epstopdf.pl 17496 2010-03-18 > 17:57:31Z karl $) 2.15 !!! Error: Cannot open bla-gnuplottex-fig1.eps: No > such file or directory > > ! Package pdftex.def Error: File `./tmp/bla-gnuplottex-fig1-eps-converted- > to.pd f' not found. So obviously `epstopdf` doesn't like my `tmp`-dir too much. How do I get the damn thing to convert the `.eps` files to pdf so that `gnuplottex` can include it? Any ideas?


title: Create one presentation out of several presentations?

text: Is there a way to combine several Beamer presentations into one big presentation? E.G.: If I have two files a.tex and b.tex which are both presentations, can I compile them into one big presentation?


title: Table and \hlines too short or wide

text: Here is a MWE of what I am trying to do.               \documentclass[a4paper]{article}     \usepackage{tabularx,booktabs}     \usepackage{color,colortbl}     \begin{document}     \begin{table}[htb]     \centering     \begin{tabularx}{\textwidth}{l r r r r r r r r r r r}     \toprule     A1 & A2 & A3 & A4 & A5 & A6 & A7 & A8 & A9 & A10 & A11 & A12 \\     \midrule     \rowcolor{blue} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\[0pt]     1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 \\     \bottomrule     \end{tabularx}     \begin{tabularx}{\textwidth}{l r r r r r r r r r r r r r r}     \toprule     A1 & A2 & A3 & A4 & A5 & A6 & A7 & A8 & A9 & A10 & A11 & A12 & A13 & A14 & A15 \\     \midrule     \rowcolor{blue} 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\[0pt]     1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\     \bottomrule     \end{tabularx}     \end{table}     \end{document}      The first table has too long `\toprule` and `\bottomrule` and looks weird. I have a few questions about this. How can I set the size of `tabularx` to be the content width? How can I set the last column to be aligned to the right (so all columns span over the table)? How can I set the `\rowcolor` to span over the whole table? The second table in the example is too wide. Do you know any tricks to make it look better?


title: Remove abstract from elsevier class

text: I am using the `elsevier` class to prepare a document. I would like to remove the abstract environment but I can not find the way to do that. I commented out `\begin{abstract} .... \end{abstract}` but I still get the two horizontal lines which enclose the abstract.


title: Axis limits in user-defined style

text: (related but unequal question: Using Macro Defined Lists in TikZ/PGFplots) I'm having several `axis`-environments inside the same `tikzpicture`. I would like to have some (but not all) share the same `xmin` and `xmax`, and some (but not all) share the same `ymin` and `ymax`. I tried to do that by defining it in my own style, in the same way that I set `xlabel`, `ylabel`, and other axis-specific styles. Below is a minimal, not-working example. When I run it with `pgfplots 2011/07/29 v1.5 (git show 1.5-1-gcc2f2d2 )`, it fails with the error message:               ! Package pgfplots Error: Sorry, you can't change `/pgfplots/xmax' in this context. Maybe you need to provide it as \begin{axis}[/pgfplots/xmax=...] ?.      I have two closely related questions:   1. Why can I set `xlabel`, `ylabel`, `ytick`, but not `ymin`? Is there a fundamental reason for this, or is it just a lack of implementation?   2. How can I achieve the effect of applying a particular set of xmin, xmax, ymin, ymax, to more than one `axis`? This related question ( Using Macro Defined Lists in TikZ/PGFplots) might provide a working solution (q. 2), but does not answer my understanding- related question (q. 1). **Minimal (not) Working Example**               \documentclass{standalone}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.5}     \begin{document}     \begin{tikzpicture}[         spam/.style={%             /pgfplots/ylabel={Spam (kg)},%             /pgfplots/xlabel={Eggs (no.)},             /pgfplots/ytick={0,10,...,200}, % this works     %        /pgfplots/xmax=3, this fails!             }]     \begin{axis}[spam]     \addplot coordinates {(0, 0) (1, 1) (2, 2)};     \end{axis}          \begin{axis}[spam, at={(5cm, 3cm)}]     \addplot coordinates {(-1, 0) (-1, 1) (1, 0)};     \end{axis}     \end{tikzpicture}     \end{document}


title: “! Argument of \xpg@nospace has an extra }” error message with polyglossia

text: I use a code – to be found at the end – for long citations in the french tradition. When I use french quotation marks inside such a long citation, I have no problem on compiling with `xetex` if I load `babel` with the french option, and the error message > Argument of \xpg@nospace has an extra }. when loading `polyglossia`. The same happens on compiling with `lualatex,` though with a different error message, beginning with > Package soul Error: Reconstruction failed. The problem disappears if I define in the preamble of the document :               \newcommand*{\og}{«{}} \newcommand*{\fg}{{}»}      and if the french quotation marks inside the long citation are replaced by `\og` … `\fg`. So I suspect there is some conflict between `polyglossia` and `soul` – or my way of using `soul`. I first posted on fr.comp.text.tex, but obtained no solution. Best regards, B. Alfonsi Code (and minimal example):               \documentclass[a4paper,11pt, twoside]{article}           \usepackage{fontspec}% f       \setmainfont{Minion Pro}%       %\usepackage[french]{babel}       \usepackage{polyglossia}       \setmainlanguage{french}           \usepackage{soulutf8}       \usepackage {kvsetkeys}       \makeatletter       \newsavebox \citeguill@box       \define@key {citeguill}{left}[\guillemotleft]{\def\citeguill@left {#1}}       \define@key {citeguill}{right}[\guillemotright]{\def\citeguill@right {#1}}       \define@key {citeguill}{middle}[\hskip -\fontdimen2\font\mbox \guillemotright\hskip\fontdimen2\font]{\def\citeguill@middle       {\setbox\citeguill@box =\hbox {#1}\def\citeguill@middle {\copy       \citeguill@box }}%       }% \KV@citeguill@middle       \newcommand*\citeguillsetup [1]{\def\citeguill@setup {\kvsetkeys       {citeguill}{#1}}}       \let\citeguill@setup =\relax %           \newcommand*\citeguill [1][]{%       \kvsetkeys{citeguill}{left,right,middle}\citeguill@setup%       \kvsetkeys{citeguill}{#1}%       \SOUL@setup%       \def\SOUL@preamble {\citeguill@middle \citeguill@left }%       \def\SOUL@postamble {\citeguill@right }%       \def\SOUL@everysyllable {\the\SOUL@syllable }%       \def\SOUL@everyspace ##1{##1\nobreak \       \discretionary {\kern-\fontdimen 2\font }       {\citeguill@middle }       {}}%       \def\SOUL@everyhyphen {\discretionary%       {\SOUL@setkern \SOUL@hyphkern \SOUL@sethyphenchar }       {\citeguill@middle }       {}}%       \def\SOUL@everyexhyphen ##1{\SOUL@setkern \SOUL@hyphkern       \hbox{##1}\discretionary {}       {\citeguill@middle }       {\SOUL@setkern \SOUL@charkern }}%       \SOUL@%       }% \citeguill       \makeatother           \begin{document}           Pour conclure, les rédacteurs de \emph{L’Anti-Mythes} résument bien la question BHL      telle qu’elle se pose à l’automne 1977 : \citeguill{Que le cynisme séduise, que la      bêtise paie et que la mode soit au renouveau des idées les plus réactionnaires, cela      ne suffit pas à expliquer l’extraordinaire exploitation par les médias du phénomène      «nouveaux philosophes», ni leur impressionnant succès commercial.}           \end{document}


title: How to find out if a math list consists of a single character?

text: When accents are placed, the TeX engine gives single characters a special treatment; see the TeXbook, Rule 12 on page 443\. See also this question and its accepted answer for details. Thus, for fake accents like those provided by the `accents` package, it would be useful to find out whether a given math list consists of a single character. Examples of single characters: `a`, `\alpha`, `\mathcal{A}`. In contrast, `ab`, `a{}` and `a\hspace{0pt}` are not single characters. Thus my question: How do I find out if a given math list consist of a single character?


title: use cyrillic non-russian language

text: I have a tex file:               \documentclass[a4paper,11pt]{article}          \usepackage[cp1251]{inputenc}     \usepackage[ukrainian,russian]{babel}     \begin{document}     \title{ Українська }     \maketitle     \tableofcontents     \end{document}      It works, but in resulting document (pdf) tableofcontent is called rather by russian word "Содержание" then ukrainian "Зміст". I want ukrainian. But, when I delete ",russian" from babel package option strange error appears:               ! Package babel Error: You haven't loaded the option russian yet.          See the babel package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.3 \select@language{russian}      How to fix this? Is there other ways to use ukrainian language as default?


title: Is it possible to open a video file via a link in beamer？

text: I have searched through posts like "embedded video in PDF", it seems that this feature is only available in Adobe Acrobat. So I just thought the alternative solution: open a video file (using system default video player, e.g VLC video player) via the links of photo or text in the beamer slides, in this way one doesn't have to exit the beamer presentation to open a video file and do a lot switching things. If this is possible, how to make it? [OS: Linux Ubuntu, PDF viewer: evince] **Edit1:**                \usepackage{multimedia}      ...      \movie{\includegraphics[width=0.8\textwidth]{pic.png}}{movieSample.avi}      Compile without error, but seems there is no link (envice in linux) for the photo to open movie.


title: Wish to design new integral symbol with infinity symbol through it

text: Would you guys help me design an integral symbol with the `\infty` symbol inscribed through it and aligned correctly with the slant of the integral symbol? I tried using               \DeclareMathOperator*{\loopint}{\begingroup \displaystyle \unitlength 1pt      \int\mkern-8.9mu\begin{picture}(0,3)\put(-4.7,3){$\circ$}\end{picture}      \hspace{-5.3pt}\raisebox{-1pt}{\displaystyle$\circ$}\mkern2mu\endgroup}      as you can see, rather than the infinity symbol, it just uses two circles which don't look professional in my opinion and also my latex editor give me an error that I have a missing `$` in it which I cannot determine where.


title: How to add "Continued" to the title of references?

text: I am writing my thesis and have some difficulty in modifying the title of the references. I am using a special class (PhDthesisPSnPDF) but it uses the class "book". I use natbib and have a bibliography which spans over 4 pages. I want to have a title over the last three pages saying "References (Continued)". Is there a way to do that?


title: Setting table placement as "here" in a multicol environment, spanning 2 columns

text: I have a problem with table placement. I want the table to be anchored to the position where it occurs in the text (i.e. "here", "h") and the columns should simply wrap around it. The table should span two columns. In the below code, this is not happening. The table gets tacked on at the end of the all the text - not what I want. Thanks.               \documentclass[a4,12pt]{article}     \usepackage{booktabs}     \usepackage{multicol}     \usepackage{blindtext}               \begin{document}          \begin{multicols}{2}          \blindtext          \begin{table*}[h!]       \small       \centering       \begin{tabular}{@{} l c c @{}}         \toprule         Characteristic & \multicolumn{2}{c}{Result}\\         \cmidrule{2-3}         & Seaweed isolate & Coral isolate \\         \midrule         Cell shape & Rod & Rod\\         Gram stain & $-$ & $-$\\         Oxidase & $+$ & $-$\\         Catalase & $+$ & $-$\\         Anaerobic & Growth (weak) & No growth\\         Motility & $+$ & $-$ or ? \\         Indole production & $+$ & $-$ or ? \\         Hugh \& Leifsons & ? & ? \\         MSA \\         \hspace*{0.5cm}Growth & $+$ & $-$ \\         \hspace*{0.5cm}Mannitol utilisation & $+$ & ? \\         %Growth in absence of salt & & \\ (Didn't get time to do this one.)         Colony pigmentation & White & White \\         Colony texture & Smooth, creamy & Waxy, pellet-like \\         Colony edges & Entire & Entire \\         Colony shape & Round & Round \\         Colony elevation & Flat & Buldge\\         Medium modifications & Cracked patterns & Clear halo, pits, liquification\\         \bottomrule       \end{tabular}     \end{table*}           \blindtext     \blindtext          \end{multicols}     \end{document}


title: How to make the author's name appear in my citations

text: Can someone please help me out of this problem? My references now suddenly appear as (21) instead of the usual (Ferrero, 1997). I don't know what I did wrong. I would really appreciate a quick response. Thank you


title: How to change page number location for first page only

text: I'm writing a style file for a document that requires the page number on the first page to be at the bottom center. On the rest of the pages it needs to be in the upper right hand corner. Can anyone tell me how to do this?


title: scaled y ticks=false don´t work together with loglogaxis?

text: I´ll like to remove the multiplier on the y axis. My wish is to get somethings like, 0.001, not 1.10^-3. Can somebody help me please               %-----------------------------------------------------------------------------------     %   Die Präambel     %     \documentclass[ english,                                %   Verwendete Sprachen, englische Rechtschreibung, Daten, etc.                     ngerman,                                %   Verwendete Sprachen, neue deutsche Rechtschreibung, Daten, etc.                     11pt,                                   %   Standardschriftgröße des Dokumentes                     twoside=false,                          %   twoside false = einseitiger Druck; true = zweiseitiger Druck                      open=any,                           %   Gibt an auf welcher Seite das nächste Kapitel beginnen soll. Möglichkeiten sind: any, left, right                     DIV=14,                             %   DIV=calc                     BCOR=12mm,                          %   Bindekorrektur in mm                     toc=listof,                             %   Nimmt das Abbildungs- sowie Tabellenverzeichnis in das Inhaltsverzeichnis auf                     toc=index,                              %   Nimmt den Index in das Inhaltsverzeichnis auf                     bibliography=totoc,                     headsepline,                            %   Linie unter Kopfzeile                     plainheadsepline                        %   Linie unter Kopfzeile                     ]                     {scrartcl}                              %   KOMA-Script Klasse Report     %---------------------------------------------------------------------------------------     \usepackage{pgfplots, pgfplotstable}     \pgfplotsset{width=15cm,compat=1.3}          \usetikzlibrary{shapes,arrows}     %---------------neue package-------------------------------     \usepackage{amsmath, amsthm, amssymb}     \usepackage{mathtools}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}     \begin{loglogaxis}[     log ticks with fixed point,     grid=both,     xlabel=Cost,ylabel=Error,     scale ticks above=2,         ]     \addplot coordinates {     (5, 8.31160034e-02)     (17, 2.54685628e-02)     (49, 7.40715288e-03)     (129, 2.10192154e-03)     (321, 5.87352989e-04)     (769, 1.62269942e-04)     (1793, 4.44248889e-05)     (4097, 1.20714122e-05)     (9217, 3.26101452e-06)     };     \addplot coordinates {     (7, 8.47178381e-02)     (31, 3.04409349e-02)     (111, 1.02214539e-02)     (351, 3.30346265e-03)     (1023, 1.03886535e-03)     (2815, 3.19646457e-04)     (7423, 9.65789766e-05)     (18943, 2.87339125e-05)     (47103, 8.43749881e-06)     };     \legend{Case 1,Case 2}     \end{loglogaxis}     \end{tikzpicture}      \end{document}


title: How do I create the headings for this multirow multicolum table?

text: I wish to create a table that looks like the following:               +-------++--------------------------++--------------------------+     |       ||          Category A      ||         Category B       |     | Title ++--------+--------+--------++--------+--------+--------+     |       || Item 1 | Item 2 | Item 3 || Item 1 | Item 2 | Item 3 |     +-------++--------+--------+--------++--------+--------+--------+     |   X   || 1      | 2      | 3      || 1      | 2      | 3      |     +-------++--------+--------+--------++--------+--------+--------+     |   Y   || 1      | 2      | 3      || 1      | 2      | 3      |     +-------++--------+--------+--------++--------+--------+--------+      but I am having great difficulty in formatting it like this. What latex code structures the headings like that shown above? I have looked at the reference page here: http://en.wikibooks.org/wiki/LaTeX/Tables but despite my experimentations I was unable to obtain this effect.


title: Start new paragraph inside a table cell

text: Look out for the \par below (on the row starting with "MSA" and notice it does not achieve the desired new paragraph. How to achieve the desired effect? Thanks.               \documentclass{article}     \usepackage{booktabs}               \begin{document}          \begin{figure*}          \small{     \begin{center}     \begin{tabular}{@{} l c c @{}}     \toprule     Characteristic & \multicolumn{2}{c}{Result}\\      \cmidrule{2-3}      & Seaweed isolate & Coral isolate \\      \midrule     Cell shape & Rod & Rod\\     Gram stain & $-$ & $-$\\     Oxidase & $+$ & $-$\\     Catalase & $+$ & $-$\\     Anaerobic & Growth (weak) & No growth\\     Motility & $+$ & $-$ or ? \\     Indole production & $+$ & $-$ or ? \\     Hugh \& Leifsons & ? & ? \\     MSA \par\medskip Growth \par Mannitol utilisation & Growth & No growth\\     %Growth in absence of salt & & \\ (Didn't get time to do this one.)     Colony pigmentation & White & White \\     Colony texture & Smooth, creamy & Waxy, pellet-like \\     Colony edges & Entire & Entire \\     Colony shape & Round & Round \\     Colony elevation & Flat & Buldge\\     Medium modifications & Cracked patterns & Clear halo, pits, liquification\\     \bottomrule     \end{tabular}     \end{center}     }          \end{figure*}                \end{document}      **Edit:** A number of you have helpfully pointed out my motivation isn't clear. "MSA" has two indented sub-entries underneath it. If I was doing it in Word, it would look like this: ![enter image description here](http://i.stack.imgur.com/WAiFb.jpg) With this in mind you may wish to revise your answers. Thanks! :) **Edit2:** Sorry, I removed \medskip immediately following /par. It is no longer needed. The aim is to be able to start new paragraphs inside a table cell.


title: Setting font size in Greek text with TexnicCenter and Miktex

text: How is it possible to define the fontsize in documents written in Greek? I am using TexnicCenter and Miktex and trying the following example               \documentclass{article}      \usepackage[utf8]{inputenc}     \usepackage[LGRx,T1]{fontenc}     \usepackage[english,greek]{babel}          \begin{document}          Ελληνικό Κείμενο           \end{document}      the output is fine. However once I combine two languages, for example               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[LGRx,T1]{fontenc}     \usepackage[english,greek]{babel}          \begin{document}          Ελληνικό Κείμενο \selectlanguage{english} English Text          \end{document}`      the english part just looks terrible in the pdf (pixelated). Similarly if I try to set the fontsize in the beginning, the same happens for the greek part of the text.               \documentclass[12pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[LGRx,T1]{fontenc}     \usepackage[english,greek]{babel}          \begin{document}          Ελληνικό Κείμενο          \end{document}`      I cannot really tell what causes this. Should I be using a different font? Are there some settings that should be used to make everything look OK? As I was looking for possible solutions I also came across this document that tries to describe some guidelines for the greek language for a different package, but the pdf itself has the same issues (just zoom in and notice the greek text) lgreekuse.pdf. Also here in this document, greek-usage.pdf the greek fonts have exactly the same issues.


title: How to combine several LaTeX files with equations and tables into one?

text: I am preparing a thesis including equations, figures, and tables. I have read up on combining LaTeX files, but my problem persists. I created the main file and imported preamble, chapterfiles, and bibliography into the main file. Chapter files having tables do not get processed without the required packages, but the declared packages are only in the preamble file and not in the chapter files. On the other hand, if I declare packages in the chapter files, the compiler gives error saying I cannot declare packages before `\documentclass{}`. But, I have to use only one `\documentclass{}` right? How to solve this problem? Please help me.


title: What's the best way make an "augmented" coefficient matrix?

text: When studying systems of linear equations, it's nice to remind people that the last column of the coefficient matrix holds the constants. This is often done in books by putting a vertical line between the last column and the next to last column. What is a good way to do this in LaTex?


title: Insert and compile EPS

text: I want to upload an .eps figure in my latex, i read this thread Why doesn't LaTeX allow me to import my .eps file when I compile it? Although i got confused, is TexMaker able to convert .eps fully or is there a package which i should use?               \documentclass[authoryear,preprint,review,12pt]{elsarticle}     \usepackage{graphicx}     \usepackage{float}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{mathtools}     \usepackage{adjustbox}           \usepackage{lineno}          \begin{document}          \begin{flushleft}     \begin{figure}[H]\label{East Scotland}     %\includegraphics[scale=0.35]{figures/2.jpg}     \includegraphics[width=1.3\textwidth,keepaspectratio]{figures/boundaries_1h.eps}     \caption{Mesh and coordinates for North Sea, depth is in meters(m) }     \end{figure}     \end{flushleft}               \end{document}      thank you


title: Line break in the table item

text: I am creating table in LaTeX and I need to get the text to perform line break automaticaly when it's too long. And if possible, I'd like to get the text alignment to the left. Is it possible to handle this situation?


title: What is the command to highlight bad boxes in pdf?

text: I seem to remember a command to show bad boxes in a PDF when using latex, but googling is not helping me to remember. How can I show bad boxes in my PDF?


title: Single Spacing Long Chapter Header in Table of Contents, Long Figure Captions in List of Figures

text: I am finishing up my dissertation and have a small issue. The dissertation format asks for single spacing the chapter heading in table of contents if it is too long and can't fit in one line. The same goes for list of figures and captions. I followed the post Single Spacing Long Subsection Header in Table of Contents, and modified my chapter headings from something like               \chapter{Implementation and modification of a three dimensional radiation stress formulation for surf zone and rip-current applications}       to               \chapter[\protect \vspace {-2ex}{Implementation and modification of a\\ three dimensional radiation stress formulation\\ for surf zone and rip-current applications]{Implementation and modification of a three dimensional radiation stress formulation for surf zone and rip-current applications}       This only partially works as I get an output in my table of contents with first two lines with single spacing but the third line with double spacing. What modification needs to be done if I want all three lines in this case to have single spacing? Also in general what should be done if I need "n" lines where n>2? My class file is officially hosted here, but it has also been uploaded to pastebin (33K). Let me know if you would need more information to answer my question.


title: Commenting out large blocks in the preamble when in draft mode

text: I would like something to enable me to comment out large blocks of my preamble when I've specified that my document is a draft. The `comment` environment provided by the `verbatim` package works well for commenting out a large block of my preamble. The problem I am having is that I'm not sure how to make the `comment` enviroment active only when the draft option is specified in `\documentclass[draft]{article}`. How do I make the inclusion/activation of this `comment` environment conditional upon the specification of the `draft` option? If that is not possible, is there some work around, perhaps through the creation of new booleans and something like `\ifbool`?


title: Hide a paragraph

text: > **Possible Duplicate:**   >  Commenting out large sections I have in my document a paragraph that I want to keep in my tex source. But when generating the PDF, I don't want it to appear. How can I hide a paragraph or a whole section ?


title: How to disable multiple lines with a single command?

text: I want to disable all the following lines:               \begin{flushright}     flush right\\     text     \end{flushright}     \begin{flushleft}     flush left\\     text     \end{flushleft}      I know that `%` at the beginning of a line will disable the the line. But I want to disable many lines using a command one time.               \documentclass{article}     \begin{document}     \begin{flushright}     flush right\\     text     \end{flushright}     \begin{flushleft}     flush left\\     text     \end{flushleft}     \noindent MKs \hfill MKS     \end{document}


title: Skip compilation of parts of a document

text: > **Possible Duplicate:**   >  Commenting out large sections I have a long document where sometimes I need to omit some parts for the compilation, and sometimes other parts. I do it by just commenting with `%` the necessary lines, but sometimes it gets tedious. I wonder if there are some commands which, put at the start and end of the part I want to avoid, would skip the compilation of that part.


title: Hiding and revealing interlaced paragraphs

text: > **Possible Duplicate:**   >  Commenting out large sections I am writing a document and I want to prepare two versions. Version 1 will contain the 'text'. Version 2 will contain the 'text' as well paragraphs of 'commentary'. The layout will interlace the two types of text e.g: text paragraph commentary paragraph text paragraph commentary paragraph and so on. Ideally, I would be able to produce the two versions from one source file by simply altering a parameter in the preamble. I imagine that I might be able to create an environment called commentary (or similar) such that all instances on the commentary environment can be hidden by altering a statement in the preamble. I hope this makes sense I am relatively new to latex.


title: How to make LaTeX not "Look like Lab Notes"

text: I often use LaTeX for general writings, as well as for my Lab and lecture notes. (Often, but not always via LyX). A large portion of this is RPG homebrew. One of my friends (who wouldn't know what LaTeX was if asked) often comments that it looks like Lab notes. "It looks like like my lab manual. That lab manual is a particularly good looking lab manual, but it still looks like it." He is right. What can I do to remove that technical writing feel? My first attempt was to change to san serif, but that just reminded him of a different set of notes. * * * **I'm looking for answers like:**   * "Don't use numbered headings, they always feel technical"   * "Use San Serif for Headings and Serif for body, this will invoke a more causal feeling"   * "Center Headings"   * "Use(/Don't use) columns"   * "Don't use Computer Modern, it will always invoke memories, instead use ..."   * "Use this package X" eg `wordlike`"   * "Use the `memoir` DocumentClass" * * * This may seem like a open ended question, but I've tried to close it down. It might belong on the Graphic Design SX EDIT: Clarification (thanks to vaettchen) I'm _not_ trying to imitate the output of a word processor. I'm trying to go for the appearance of a non- technical book, rather than feeling like something your university professor has handed you. I want something that looks like what I might make in InDesign. (but without the manual work of using something so WYSIWYG focused)


title: Graphing an exponential function and its inverse on the same Cartesian plane

text: I would like to graph an exponential function and its inverse on the same Cartesian plane using TikZ (or pgfplots). I have code using TikZ. Apparently, there is an error in the `\addplot` command. I would like to plot y = 2^{x} and y = \log_{2}(x). (The code is for e^{x} and \ln(x). I was not sure how to enter "\log_{2}(x)" in TikZ.) The exponential function should be labeled "y = 2^{x}" towards the top, where its graph ends, and the logarithmic function should be labeled "y = \log_{2}(x)" towards the bottom, where its graph ends.               \documentclass[10pt]{amsart}     \usepackage{tikz}     \usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}     \usepackage{tkz-euclide}     \usetkzobj{all}               \begin{document}               \begin{tikzpicture}[dot/.style={draw,fill,circle,inner sep=1pt}]     \draw[<->] (-7,0) -- (7,0) node[below]{$x$};     \draw[<->] (0,-7) -- (0,7) node[left]{$y$};     \draw[<->, dashed] (-6.5,-6.5) -- (6.5,6.5) node[right]{$y=x$};     \addplot [color=green]  {exp(x)};     \addplot [color=blue]  {ln(x)};     \end{tikzpicture}               \end{document}


title: T2A does not have some font sizes

text: Here is the minimal code. I need to use the encoding `T2A` for Cyrillic characters. But the problem is that some font sizes are not available. I discovered that I should use also `T1` after `T2A`. But using `12pt` the section's heading does not appear. The example below show the problem.               \documentclass[12pt]{report}     \usepackage[utf8]{inputenc}     \usepackage[T2A,T1]{fontenc}     \usepackage[russian]{babel}          \begin{document}      \chapter{Russian}     \section{title}              foo     \end{document}      Here is the important part from `log` file.               {\cyrillictext \CYRG \cyrl \cyra \cyrv \cyra } 1.     ! Font T2A/cmr/bx/n/17.28=labx1728 at 17.28pt not loadable: Metric (TFM) file not found.     <to be read again>                         relax      l.13 \section{title}      Any idea?


title: Using pgfkeys to switch between "enumerate" and "enumerate*" when using the enumitem package with the package option "inline""

text: No matter what I seem to do, I'm just getting this wrong. I would like to be able to set a key to determine how my list is arranged.               \documentclass{article}     \usepackage[inline]{enumitem}     \usepackage{xparse}     \usepackage{pgfkeys}     \usepackage{pgffor}     \pgfkeys{/ae/testing/.cd,       list collection/.store in=\mylistcollection,       arrange horizontally/.code={\def\myenumitem{enumerate*}},     }     \def\myenumitem{enumerate}     \def\aeset#1{\pgfkeys{/ae/testing/.cd,#1}}     \def\aeget#1{\pgfkeysvalueof{/ae/testing/#1}}          \NewDocumentCommand{\mylist}{ m }         {\bgroup          \aeset{#1}           \expandafter\begin\expandafter{\myenumitem}[label=(\alph*)]             \foreach \x in \mylistcollection {\item \x}           \expandafter\end\expandafter{\myenumitem}           \egroup         }          \pagestyle{empty}     \begin{document}          \mylist{list collection={a,b,c,d}}          \mylist{list collection={a,b,c,d},arrange horizontally}          \end{document}      Initially, I wanted to have the key `arrange horizontally` be defined as               arrange horizontally/.is if=ArrangeHorizontally,      and then also define               \newif\ifArrangeHorizontally     \ArrangeHorizontallyfalse      but that too was giving me problems (in fact, I've never been able to get `.is if` to work the way I expect them to. Nevertheless, the code as I've written it above results in an error:               ! Extra }, or forgotten \endgroup.     \item ...ctor \relax \fi }\color@endgroup \egroup                                                        \enit@outeritem      l.32 ...collection={a,b,c,d},arrange horizontally}          ?       I don't see what's going on. I would think everything should expand as expected. I also tried working around using `\expandafter\begin\expandafter{....` by directly calling `\enit@enumerate*` or `enit@enumerate`. But that too resulted in errors. **UPDATE** Here is my attempt with the `.is if` approach               \documentclass{article}     \usepackage[inline]{enumitem}     \usepackage{xparse}     \usepackage{pgfkeys}     \usepackage{pgffor}     \pgfkeys{/ae/testing/.cd,       list collection/.store in=\mylistcollection,       arrange horizontally/.is if=ArrangeHorizontally,     }     \newif\ifArrangeHorizontally     \ArrangeHorizontallyfalse          \def\myenumitem{enumerate}     \def\aeset#1{\pgfkeys{/ae/testing/.cd,#1}}     \def\aeget#1{\pgfkeysvalueof{/ae/testing/#1}}          \makeatletter     \NewDocumentCommand{\mylist}{ m }         {\bgroup          \aeset{#1}       \ifArrangeHorizontally\@nameuse{enumerate*}\else\expandafter\@nameuse{enumerate}\fi         [label=(\alph*)]         \foreach \x in \mylistcollection {\item \x}       \ifArrangeHorizontally\@nameuse{endenumerate*}\else\expandafter\@nameuse{endenumerate}\fi                \egroup         }          \makeatother     \pagestyle{empty}     \begin{document}          \mylist{list collection={a,b,c,d}}          \mylist{list collection={a,b,c,d},arrange horizontally=true}          \end{document}


title: dvipng: limit cropping in a single direction

text: I know that `-tight` switch arranges the image size to include all the ink on the page. For this instance, however, I want to give a width of my choice and crop only in the vertical direction. Furthermore I only want to crop the space _below_ the image. Is this possible without modifying the dvipng source code?


title: Insert negative kern before "Y" in Calabi-Yau

text: Some pairs of glyphs look more visually appealing when a kern is inserted between the glyphs. For instance, if the word Calabi–Yau is typeset with a font that does not include kerning information for the pair (–,Y), the space between the end of the en-dash and the stem of the letter Y is too large. Compare the results of `Calabi--Yau` without or with a kern: ![Calabi–Yau with differenti kernings](http://i.stack.imgur.com/Mc5al.png)               \documentclass{article}     \begin{document}     Calabi--Yau     Calabi--\kern-.15em Yau     \end{document}      Is there a way to automatically insert such a kern, preferably by inserting some code in the preamble, and no extra markup in the document?


title: TitlePage header and footer containing logo

text: I'm writing a report, and currently doing the title page. Well, I would like to have a header containing three logos and to have text under a logo. This is the image I want to get for the header : ![enter image description here](http://i.stack.imgur.com/tjDKq.png) This is the image I want to get for the footer: ![enter image description here](http://i.stack.imgur.com/x8jOE.png) This is the code I'm using :               \documentclass[12pt,french]{report}     \usepackage[T1]{fontenc}     \usepackage{times}     \usepackage[utf8]{inputenc}     \usepackage[a4paper]{geometry}     \usepackage{minitoc}     \geometry{verbose,tmargin=1.8cm,bmargin=1.8cm,lmargin=2cm,rmargin=2cm}     %\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in,headheight=12pt,headsep=25pt,footskip=30pt}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \setlength{\parskip}{\smallskipamount}     \setlength{\parindent}{0pt}     \usepackage{float}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{nomencl}     \usepackage{enumitem}%pou les puces     % the following is useful when we have the old nomencl.sty package     \providecommand{\printnomenclature}{\printglossary}     \providecommand{\makenomenclature}{\makeglossary}     \makenomenclature     \onehalfspacing          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     %/usepackage{t1enc}% un second package     \usepackage[francais]{babel}     % un troisième package     \usepackage{layout}     \usepackage[Lenny]{fncychap}     \usepackage{fancyhdr}     \usepackage[section]{placeins}     \usepackage{lettrine}      \usepackage{xcolor}          \floatstyle{boxed}          %\title{\Huge \textbf{Rapport de Projet de Fin d’Etudes     %}}          %\author{Amina GHABRI}     \makeatletter       \begin{titlepage}       \centering           {   \includegraphics[width=0.1\textwidth]{pic/garde/ensit.png}                   \includegraphics[width=0.1\textwidth]{pic/garde/etat.png}\\                       \includegraphics[width=0.35\textwidth]{pic/garde/arab.png}\\                 \large \textsc{Ecole Nationale Supérieure d’Ingénieurs de Tunis}}\\              \vspace{1cm}                   \vspace{1cm}           {\large\textbf{   \@date\\            Rapport de Projet de Fin d’Etudes}}\\         \vfill            {\LARGE \textbf{\@title}} \\         \vspace{2cm}             {\large \@author} \\         \vfill                 \end{titlepage}     \makeatother      This is the result I'm getting : ![enter image description here](http://i.stack.imgur.com/S14op.png)


title: Conditionals in lstlistings

text: I am trying to put in some lines of code using the lstlistings-package but the code differs on conditionals. How can I only change some lines depending on the conditional? Assume I have the If: `\newif\ifshell`. If it is true there should be the following code in a lst-environment:               pdprint -l      and a few other lines (which are the same for both, true and false). If `\shell` is false, there should be `pdfprintsvr -l` and the other lines instead. How can I include the conditional _inside_ the lst-environment? Thanks in advance


title: How do I change the basic font into 'Corbel'?

text: I just started using LaTeX, so I have no clue. I have been reading stuff such as `\usepackage`, as well as things as font families. If anyone could explain me, I'd be very grateful.


title: How can I generate just pgf/TikZ images, not placed a whole page or slide?

text: I'd like to generate only a pgf/TikZ image with LaTeX, but so far I just managed to insert it into a document. The problem is that so far I can only get a page/a beamer slide rather than just the image I'd like to have. What document class should I specify to get what I want?


title: Making an image with a transparent background

text: I do not know what is the official term for such images, but if I make an image in TikZ or `pstricks` then I want it to have no background; for example I might post it on a webpage with a different background than white, then it should blend in nicely. I have seen a couple of images in wikipedia that are like this (example), and they show up on image viewers to have some kind of a checkered background.


title: Environment definition separates matching braces

text: Suppose I want to define an environment which is essentially a modification of an existing one. I tried something like that:               \newenvironment{newenv}{%       \formatcommand{\begin{oldenv}%     }{%       \end{oldenv}}%     }      I would expect               \begin{newenv}Foo\end{newenv}      to result in the same output as               \formatcommand{\begin{oldenv}Foo\end{oldenv}}      But whenever I use `\begin{newenv}`, `pdflatex` says               Missing } inserted      and skrews up everything afterwards, of course. Without `\formatcommand` everything is fine, so apparently the orphan `{` form `\formatcommand` is the culprit. My guess is that `pdflatex` tries to treat stuff inside environment definition parts as something syntactically correct---which what I do clearly is not--- instead of "just" to replace text and parse afterwards. Is there a way to get around this, i.e. have a command span from a new environments beginning to end? **Use case:**               \newenvironment{card}{%       \resizebox{55mm}{85mm}{\begin{tabular*}{55mm}{| p{50.5mm} |}%       \hline%     }{%       \hline\end{tabular*}}%     }      If I put the _same_ `resizebox` around the usage site of `card`, it compiles and resizes (even though not the way I intended, but that's for another day).


title: Inserting subfigures

text: I'm trying to insert a nested figure using the environment subfigure following the example in http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Subfloats I added the following extra packages: `\usepackage{subfigure}`, `\usepackage{caption}` and `\usepackage{subcaption}`. this is my MWE:               \begin{figure}         \begin{subfigure}%[b]{0.5\textwidth}                 \centering                 \includegraphics[width=\textwidth]{SR4000}                 \caption{SwissRanger by MESA}                 \label{fig:SRl}         \end{subfigure}%          %add desired spacing between images, e. g. ~, \quad, \qquad etc.           %(or a blank line to force the subfigure onto a new line)         \begin{subfigure}%[b]{0.5\textwidth}                 \centering                 \includegraphics[width=\textwidth]{D-Imager}                 \caption{D-Imager by Panasonic}                 \label{fig:D-Imager}         \end{subfigure}         \caption{TOF depth cameras}\label{fig:TOF}     \end{figure}      but I am getting the following error               ! Use of \@subfloat doesn't match its definition. \reserved@c     ->\@subfloat {                               sub\@captype }[\@empty {\@empty }][{\@empty }]      l.64                 \centering      line 64 here is:               \includegraphics[width=\textwidth]{SR4000}


title: How to do overlaying and solve line drawing problem in this TikZ example?

text: I'm working on a picture (code given below) and I've stumbled onto two problems:   1. Lines drawn from the DRAM to the GPGPU don't connect properly. Also, when regenerating the picture the DRAM and GPGPU grows apart. How do I solve this?   2. The "zoom" lines from the GPGPU to the cluster go over the cluster. How do I make the cluster "lay on top of" the zoom lines? Here's an example of what it currently looks like (the zoom lines look messed up due to the constant shifting of the DRAM described in problem 1): ![enter image description here](http://i.stack.imgur.com/xmVif.png) Much obliged if anyone could help me with this.               \documentclass[a4paper, 11pt]{article}          % Load packages     \usepackage{tikz}     \usepackage[sc,osf]{mathpazo}          % Load TikZ libraries     \usetikzlibrary{shapes,arrows}     \usetikzlibrary{fit}     \usetikzlibrary{backgrounds}     \usetikzlibrary{positioning}     \usetikzlibrary{calc}          % Define colors     \definecolor{lightGrey}{rgb}{0.9, 0.9, 0.9}     \definecolor{shade0}{named}{white}     \definecolor{shade1}{named}{lightGrey}     \definecolor{shade2}{rgb}{0.8, 0.8, 0.8}     \definecolor{shade3}{rgb}{0.65, 0.65, 0.65}     \definecolor{shade4}{rgb}{0.45, 0.45, 0.45}          % Text settings     \newcommand{\figureTextSize}{\tiny}          % Figure element lengths     \newlength{\gpgpuElemSize}     \setlength{\gpgpuElemSize}{8mm}     \newlength{\gpgpuElemSep}     \setlength{\gpgpuElemSep}{1mm}          % TikZ styles     \newcommand{\arrowStyle}{stealth}     \newcommand{\lineThickness}{semithick}     \tikzstyle{box} = [%       draw,       rectangle,       \lineThickness,     ]          \begin{document}          \begingroup     \figureTextSize     \newcommand{\drawSM}{%       \begin{tikzpicture}[remember picture]         % SPs         \foreach \y in {1, ..., 4} {%           \foreach \x in {1, ..., 2} {%             \ifnum \x=1               \ifnum \y=1                 \node [sp] (sp\y-\x) {SP};               \else                 \pgfmathtruncatemacro\prevY{\y-1}                 \node [sp, below=of sp\prevY-\x] (sp\y-\x) {SP};               \fi             \else               \pgfmathtruncatemacro\prevX{\x-1}               \node [sp, right=of sp\y-\prevX] (sp\y-\x) {SP};             \fi           }         }              % SFUs         \foreach \i in {1, ..., 2} {%           \ifnum \i=1             \path let \p1 = (sp1-1.south west),                       \p2 = (sp1-2.north east)                    in                      node [%                        sfu,                        minimum width=\x2-\x1-\pgflinewidth,                        below right,                      ] at ([%                        yshift={-0.5\gpgpuElemSep},                      ] sp4-1.south west) (sfu\i) {SFU};           \else               \pgfmathtruncatemacro\prevI{\i-1}             \path let \p1 = (sp1-1.south west),                       \p2 = (sp1-2.north east)                    in                      node [%                        sfu,                        minimum width=\x2-\x1-\pgflinewidth,                        below=of sfu\prevI,                      ] (sfu\i) {SFU};           \fi         }              % Fetch/Dispatch         \node [issuer, right=of sp1-2] (issuer) {Fetch/Dispatch};              % Register file         \node [register, below=of issuer] (register) {Registers};              % Instruction cache         \node [cache, below=of register] (icache) {Inst. cache};              % Constant cach         \node [cache, below=of icache] (ccache) {Constant cache};              % Shared memory         \path let \p1 = (sfu2.south west),                   \p2 = (sfu1.north east),                   \p3 = (ccache.south west),                   \p4 = (ccache.north east)                in                  node [%                    memory,                    minimum width=\x4-\x3-\pgflinewidth,                    minimum height=\y2-\y1-\pgflinewidth,                    below=of ccache,                  ] (sharedmem) {%                    \begin{tabular}{c}                      Shared \\                      memory                    \end{tabular}                  };       \end{tikzpicture}     }     \begin{tikzpicture}[%         auto,         >=\arrowStyle,         remember picture,         every node/.style={%           node distance=0.5\gpgpuElemSep,         },         splitted/.style={%           rectangle split,           rectangle split parts=2,           rectangle split draw splits=false,         },         gpgpu/.style={%           box,           fill=shade2,           splitted,         },         gpgpu-part/.style={%           box,           fill=shade3,           minimum size=10mm,         },         dram/.style={%           box,           fill=shade1,           minimum width=8mm,           minimum height=5mm,           node distance=\gpgpuElemSep,         },         connection/.style={%           <->,           \lineThickness,         },         cluster/.style={%           box,           fill=shade3,           splitted,         },         sm/.style={%           cluster,           fill=shade0,         },         sp/.style={%           box,           fill=shade1,           minimum size=0.5\gpgpuElemSize,           inner sep=0pt,         },         sfu/.style={%           sp,         },         register/.style={%           box,           fill=shade2,           minimum height=0.5\gpgpuElemSize,           minimum width=2\gpgpuElemSize,           inner sep=0pt,         },         cache/.style={%           register,         },         memory/.style={%           register,         },         issuer/.style={%           register,           fill=shade3,         },         zoom-line/.style={%           \lineThickness,           dashed,         },       ]       \node (all-parts) {%         \begin{tikzpicture}[remember picture]           % GPGPU - zoomed out           \node [gpgpu] (gpgpu) {%             GPGPU             \nodepart{two}             \begin{tikzpicture}[remember picture]               % Clusters               \foreach \y in {1, ..., 3} {%                 \foreach \x in {1, ..., 4} {%                   \ifnum \x=1                     \ifnum \y=1                       \node [gpgpu-part] (gp\y-\x) {};                     \else                       \pgfmathtruncatemacro\prevY{\y-1}                       \node [gpgpu-part, below=of gp\prevY-\x] (gp\y-\x) {};                     \fi                   \else                     \pgfmathtruncatemacro\prevX{\x-1}                     \node [gpgpu-part, right=of gp\y-\prevX] (gp\y-\x) {};                   \fi                 }               }             \end{tikzpicture}           };                % DRAMs           \node [below=of gpgpu, yshift=-2\gpgpuElemSep] {%             \begin{tikzpicture}[remember picture]               \foreach \i in {1, ..., 5} {%                 \ifnum \i=1                   \node [dram] (dram\i) {DRAM};                 \else                   \pgfmathtruncatemacro\prevI{\i-1}                   \node [dram, right=of dram\prevI] (dram\i) {DRAM};                 \fi                      % Connect DRAM with GPGPU                 \draw [connection] (dram\i) -- (dram\i |- gpgpu.south);               }             \end{tikzpicture}           };         \end{tikzpicture}       };            % Cluster - in detail       \node [cluster, right=of all-parts, xshift=4\gpgpuElemSep] (cluster-big) {%         Cluster         \nodepart{two}         \begin{tikzpicture}[remember picture]           % SMs           \node [sm] (sm1)               {SM \nodepart{two}\drawSM};           \node [sm, right=of sm1] (sm2) {SM \nodepart{two}\drawSM};           % Texture memory           \path let \p1 = (sm1.south west),                     \p2 = (sm2.north east)                  in                    node [%                      memory,                      minimum width=\x2-\x1-\pgflinewidth,                      below right,                    ] at ([%                      yshift={-0.5\gpgpuElemSep},                    ] sm1.south west) (texturemem) {Texture memory};         \end{tikzpicture}       };            % Zoom lines       \draw [zoom-line] (gp2-4.north west) -- (cluster-big.north west);       \draw [zoom-line] (gp2-4.north east) -- (cluster-big.north east);       \draw [zoom-line] (gp2-4.south west) -- (cluster-big.south west);       \draw [zoom-line] (gp2-4.south east) -- (cluster-big.south east);     \end{tikzpicture}     \endgroup          \end{document}