title: Displaying two plots side by side not displaying titles correctly

text: I’m writing a report and using the following code to display a bode-diagram. To save some space (I have several of these figures), I’ve displayed them side by side, but the title of the right plots’s in the left plot and it doesn’t improve by changing 0.5\linewidth to 0.45\linewidth... Anyone can help? A code sample:               \documentclass[11pt,a4paper]{article}          \usepackage{tikz}     \usepackage{subcaption}     \usepackage{amsmath}          \usepackage{SIunits}     \usepackage{pgfplots}          \begin{filecontents}{data.dat}     %data     f,Df,VP,DVP,VS,DVS,phi,Dphi,T     0.05,0.0004,9.61,0.01,197.6,0.1,178,1,0.020562     0.1,0.0001,9.65,0.01,199.4,0.1,178,1,0.020663     0.2,0.0004,9.7,0.03,200.7,0.2,178.6,0.2,0.020691     0.5,0.0002,9.75,0.01,201.7,0.2,179.5,0.5,0.020687     1,0.0003,9.77,0.01,201.3,0.2,180,0.3,0.020604     2,0.001,9.76,0.01,205,0.3,180.5,0.4,0.021004     5,0.002,9.85,0.01,199.5,0.2,180.5,0.1,0.020254     10,0.01,9.85,0.01,198.3,0.3,180.5,0.5,0.020132     20,0.006,9.85,0.01,197.5,0.7,180.5,0.2,0.020051     50,0.002,9.85,0.01,195.5,0.3,180,1,0.019848     60,0.02,9.86,0.01,193.5,0.7,179.5,4,0.019625     70,0.02,9.81,0.01,190,0.7,177.5,0.5,0.019368     79.99,0.04,9.86,0.01,188.9,0.6,172,0.6,0.019158     90.01,0.02,9.87,0.01,223.5,0.1,167,0.5,0.022644     94.99,0.03,9.73,0.01,240.8,0.8,170.9,0.3,0.024748     100,0.04,9.87,0.01,294.7,0.5,173.5,0.8,0.029858     150,0.1,9.85,0.04,296.9,0.5,183.5,0.6,0.030142     200.1,0.1,9.8,0.05,313.8,0.6,207,1,0.03202     299.9,0.2,9.77,0.02,256.9,0.4,215,1,0.026295     400,0.6,9.6,0.06,167.9,0.9,140,1,0.01749     450,1,9.72,0.01,385.2,0.4,158,1,0.03963     500,1,9.63,0.07,529.7,0.7,177,1,0.055005     600,1,9.6,0.03,861,2,207,1,0.089688     700,0.2,9.75,0.02,1206,1,248,0.4,0.12369     800,0.6,9.41,0.01,1168,1,70.8,0.5,0.12412     900,1,9.4,0.02,1011,6,318,1,0.10755     1000,1,9.32,0.01,905,3,340,1,0.097103     1500,2,9,0.01,757,1,111,1,0.084111     2000,2,8.7,0.01,375,1,180,1,0.043103     \end{filecontents}          \begin{document}     %Bode-diagram (met fase) opdracht 1.2     \begin{figure}[htbp]     \centering     \begin{minipage}{0.45\linewidth}     \centering     \begin{tikzpicture}     \begin{loglogaxis}[         xlabel=frequentie $f (\kilo\hertz)$,         ylabel=transferfunctie $T\ (\frac{\volt}{\volt})$,         grid=both,          ymin = 0.01,         ymax = 0.4,         ytick={0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.2,0.3,0.4},         yticklabels={,0.02,0.03,,0.05,,0.07,,,0.1,0.2,0.3,},         minor grid style={gray!25},          major grid style={gray!25}]     \addplot table[x=f,y=T,col sep=comma]{data.dat};     \end{loglogaxis}     \end{tikzpicture}     \subcaption{Amplitude Bode-diagram $\dfrac{V_S}{V_P}$.\label{bodeAO12}}     \end{minipage}%     \begin{minipage}{0.45\linewidth}     \centering     \begin{tikzpicture}     \begin{axis}[         xmode=log,         ymode=normal,         ytick={0,45,-45,90,-90,135,180,225,270,315,360},         ymin=-10,         xlabel=frequentie $f (\kilo\hertz)$,         ylabel=fase $\phi (\degree)$,         grid=both,          minor grid style={gray!25},          major grid style={gray!25}]         \addplot table[y=phi,x=f,col sep=comma]{data.dat};     \end{axis}     \end{tikzpicture}     \subcaption{Frequentie Bode-diagram $\dfrac{V_S}{V_P}$.\label{bodeFO12}}     \end{minipage}     \caption{Bode-diagram $\dfrac{V_S}{V_P}$.\label{BO12}}     \end{figure}     \end{document}


title: chemfig and lego-style molecule construction

text: Many biochemical molecules, such as nucleic acids for example, are composed by nature in a hierarchical fashion from a limited number of building blocks. It would be nice to replicate this approach when typesetting these molecules. In the case of DNA and RNA, a natural approach would be:   1. Define separate structures for ribose, phosphate and the bases (A,C,G,T,U)   2. Derive deoxyribose from ribose   3. Create nucleosides by combining ribose or deoxyribose with each of the bases   4. Write DNA and RNA molecules as alternations of nucleosides and phosphate.  The `chemfig` package provides a `\definesubmol` command that allows for the definition of sub-molecules, which can then be substituted into other molecules. However, the package does not provide a built-in mechanism for making the results of such substitutions available as new sub-molecules. So, the question is how to define a command with the following behavior:               % "\derivesubmol" defines the new #1 submol, obtained by replacing all the     %  occurrences of "#3" by "#4" in the code of #2 submol          % arguments: #1 = new submol name, #2 = old submol name,     %            #3 = old substring, #4 = new substring     \newcommand*\derivesubmol[4]{% ...      This description is taken from the code that the package author of `chemfig` has provided to me by email. An example of his code in action is provided in the answer that I supply below. To indicate that this question is, indeed, a question, let me add: **???**


title: Manipulate TOC: How to move partnumber to pagenumber's position?

text: How can the **partnumber in TOC** be **displayed at** the position where usually the corresponding pagenumber can be found; namely at **the end of the toc line**. On the other hand the partnumber shall be **removed from the front completely**. I would await this to be possible by tocloft package, but cannot find it. Here is a minimal working example of what I am talking about:               \documentclass{scrbook}          %% toc manipulation:     \usepackage[titles]{tocloft}          % chap:     \renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % leading dots          % part:     \renewcommand\cftpartafterpnum{\par\vspace{-8pt}\hrulefill\par}     \setlength{\cftpartnumwidth}{0pt}          %% dummy document     \begin{document}       \tableofcontents       \part{Part Foo} \chapter{Bla} \chapter{Blabb}          \part{Part Bar} \chapter{Blu} \chapter{Blubb}          \part{Part Foobar} \chapter{Blo} \chapter{Blobb}      \end{document}      ![Black: Result of MWE, Red: Dreamed-of Manipulations](http://i.stack.imgur.com/fze6g.png)


title: use numbering instead of italics in a subsection

text: I have the following problem: The following LaTeX code:               \section{A Section with some Tables}           In this section we present the results of our computations for the Coxeter     groups of types $B_3$, $H_3$, $B_4$, $D_4$, $F_4$, and $H_4$, thus verifying     Theorem~\autoref{thm:main} for irreducible Coxeter groups of rank three and     four.          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \subsection{$W$ of type $B$}     \label{BTheorySection}     Assume now that $V$ is the reflection representation of $W=W(B_n)$ with     $n\geq 2$ and let $\{\, v_1, \dots, v_n\,\}$ be a basis of $V$.  We view $W$     as acting on $V$ by signed permutations of $\{\,v_1,v_2,\ldots,v_n\,\}$.     Namely, the Coxeter generators $s_1,s_2,\ldots,s_n$ are given by      Produces the following output: ![enter image description here](http://i.stack.imgur.com/YaZcT.jpg) I want the the subsection to be numbered instead of being in italics, in this case the desire output should be: 2.2 A section with some Tables ... 2.2.1 W of type B ... You can find my LaTeX files in the following link: https://www.dropbox.com/s/iz7w3lwr65yds87/fancy.zip The file to compile is called "fancydissertation.tex" Thank you for your help.


title: Typeset a system of equations in LyX

text: I want to create an system of equation in LyX, like this: > ![equation](http://i.stack.imgur.com/YZQg2.png) Can anyone help me?


title: What is this symbol called?

text: I have just found the following symbol in the book, Multidimensional Real Analysis I: Differentiation by "J.J. Duistermaat and J.A.C. Kolk. The meaning of the symbol is "a map from a subset of the domain to the range". I would like to know the latex code of the symbol. ![enter image description here](http://i.stack.imgur.com/nUiys.png)


title: How to just print the calculation using sagetex

text: I want a command `\simp` which takes an algebraic expression E_1 and outputs E_1 = E_2 where E_2 is the simplified form of E_2. To do so I tried to use `sagetex` like this:               \documentclass{article}     \usepackage{sagetex}          \newcommand{\simp}[1]{$\sage{#1} = \sage{simplify(#1)}$}     \pagestyle{empty}          \begin{document}          \simp{3*x^(7-2) + 3*x^5}          \end{document}      Which results in ![output](http://i.stack.imgur.com/PLcrb.png) and not in ![desired output](http://i.stack.imgur.com/IKL6q.png). Any idea how to fix this? Solving this from the sage point of view doesn't seem to be so easy because sage seems to lack a global hold feature: http://trac.sagemath.org/ticket/10035 So is there any idea how to solve this in an elegant way from the LaTeX side? There are two other minor issues about this approach:   * I want that `*` is printed as a `\cdot` when one has something like `3*(x + y)` but that it is not printed at all if one has `3*x`   * I am not sure about the correct spacing (see the difference in my second output) and how to get it. I also really want to use sage for this simplification and not a handmade latex-solution because I plan to do similar but more complex things in the future such that it is a good idea to have the power of a computer algebra- system in the background.


title: Logo next title poster

text: I have a problem with placing one logo on the appropriate place in my poster. I have two logo's, there is no problem with the first logo, which stands left to the title. The second logo is right to the title, but it should be translated to the left. The situation now is that the right logo leaves the box of my poster. The scale is fine etc, I only need to shift it to the left (there is enough place, the title is not too big). Here is the latex command for the "title box" of my poster.                 \begin{document}       % Left logo       \begin{minipage}[c][0.1\textheight][c]{0.12\textwidth}       %\hfill       \hspace*{1.2cm}       \includegraphics[height=3cm,angle=0]{logo1.eps}       \end{minipage}       %Title       \begin{minipage}[c][0.05\textheight][c]{0.75\textwidth}       \begin{center} \LARGE       {\textbf{Title}}\\[-5.0mm]       {\large \textbf{Name 1}$^{(1)}$, \textbf{Name 2}$^{(2)}$}\\[3mm] \small       {$^{(1)}$ department, University, country \\[2mm]       $^{(2)}$ department, University, country \\[2mm]        contact: \emph{email}}       \end{center}       \end{minipage}       % Right logo       \begin{minipage}[c][10cm][c]{5cm}       \begin{figure}[H]       \hfill       \includegraphics[width=13cm]{logo2.eps}       \end{figure}       \end{minipage}            \end{document}


title: Different paths for drawing and filling

text: I want to design a `tikz` shape that uses different background paths for different purposes. Consider the following minimal example where a new shape named `simple rectangle` is declared. The background path used for filling the shape is different from the background path for other purposes, like drawing or clipping: filling does not include the region of the text below the base line.               \documentclass[tikz]{standalone}          \makeatletter          \pgfdeclareshape{simple rectangle}{       \savedanchor{\upperrightcorner}{         \pgf@x=.5\wd\pgfnodeparttextbox % widht of the box         \pgf@y=.5\ht\pgfnodeparttextbox % height of the box, ignoring the depth       }       \saveddimen{\depth}{         \pgf@x=\dp\pgfnodeparttextbox       }       \anchor{north east}{         \upperrightcorner       }       \anchor{center}{         \pgfpointorigin       }       \anchor{text}{         \upperrightcorner         \pgf@x=-\pgf@x         \pgf@y=-\pgf@y       }       \backgroundpath{         \tikz@mode         \upperrightcorner         \pgf@xa=-\pgf@x         \pgf@ya=-\pgf@y         \iftikz@mode@draw           \advance \pgf@ya by -\depth         \fi         \pgfpathrectanglecorners{\upperrightcorner}{\pgfpoint{\pgf@xa}{\pgf@ya}}       }     }          \makeatother          \begin{document}          \huge     \begin{tikzpicture}       \node at (0,3) [simple rectangle]{This is my test.};       \node at (0,2) [simple rectangle,fill=yellow!40]{This is my test.};       \node at (0,1) [simple rectangle,draw]{This is my test.};       \node at (0,0) [simple rectangle,fill=yellow!40,draw]{This is my test.};     \end{tikzpicture}          \end{document}      ![different paths for background](http://i.stack.imgur.com/RWaDs.png) This example works only if filling is not combined with other actions, like drawing, as can be seen. How to fix this?


title: Conflicts with Datatool and babel (french)

text: I am having trouble compiling a latex document using an external CSV file with datatool and using the french language from the babel package. The content of my latex file is:               \documentclass[letterpaper,12pt]{article}     \usepackage[T1]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage[francais]{babel}     \usepackage{longtable}     \usepackage{datatool}          \begin{document}          \DTLsetseparator{;}     \DTLloaddb{tableBesoins}{babel_datatool_conflict.csv}     \begin{longtable}{| p{0.9in} | p{0.6in} | p{1.6in} | p{1.2in} | p{1.6in} | }        \caption{Besoins\label{tbl:besoins}}\\        Besoin & Priorité & Préoccupations & Solution actuelle & Solution proposée%        \DTLforeach{tableBesoins}{%        \besoin=Besoin,\priority=Priorite,\preoccupation=Preoccupations,%        \currentsolution=Solution actuelle,\newsolution=Solution proposee}{%        \\        \besoin & \priority & \preoccupation & \currentsolution & \newsolution}     \end{longtable}          \end{document}      The content of babel_datatool_conflict.csv file is there: http://pastebin.com/6nv6v9SH The error I am getting is:               (/usr/share/texmf-texlive/tex/generic/babel/frenchb.cfg)))     (/usr/share/texmf-texlive/tex/latex/carlisle/scalefnt.sty)     (./babel_datatool_conflict.aux)     (/usr/share/texmf-texlive/tex/latex/ucs/ucsencs.def)     ! Use of \@dtl@lopoff doesn't match its definition.     \@dtl@lin@ ->;                   "Besoin";"Priorite";"Preoccupations";"Solution actuelle";"Solu...     l.13 ...tableBesoins}{babel_datatool_conflict.csv}          ! Missing $ inserted.     <inserted text>                      $     l.13 ...tableBesoins}{babel_datatool_conflict.csv}          ! Undefined control sequence.      I've uploaded the full error here: http://pastebin.com/uZEANpd4 I've tried to change [francais] to [french] or [frenchb], to use [utf8] instead of [utf8x], changed the order of the packages. It just won't compile unless I comment out the usepackage babel line.


title: Multirow Nested Table

text: I am trying to built a 6x6 table which contains mutlirows. My code is               \documentclass[a4paper,11pt]{article}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{multicol}     \usepackage{multirow}          \begin{document}     \begin{table}[H]     \begin{center}     \begin{tabular}{|c|c|c|c|c|c|} \hline     \multicolumn{6}{|c|}{$\mathbf{n_1n_2n_3}$}\\ \hline     \multirow{6}{*}{$500$} & \multirow{3}{*}{$410$} & \multirow{2}{*}{$320$} & {} & {}& $005$\\     {} & {} & {} & $203$ & $104$ & $041$\\     {} & {} & \multirow{2}{*}{$302$} & $230$ & $140$ & $014$\\     {} & \multirow{3}{*}{$401$} & {} & $221$ & $122$ & $032$\\     {} & {} & \multirow{2}{*}{$311$} & $212$ & $131$ & $023$\\     {} & {} & {} & {} & $113$ & $050$\\     \hline     \end{tabular}     \end{center}     \caption{Table}     \label{tab:matrix}     \end{table}     \end{document}      Mu output is ![](http://i.imgur.com/qJ7Tc.jpg) As you can see the 4th and 5th column from left are not fancy. How can I make this table a bit better-loking?


title: How to plot a scatterplot in PGFPlots

text: I tried to plot a scatterplot from data. I took hint from the site http://pgfplots.sourceforge.net/gallery.html and my tex file is               \documentclass[a4paper]{amsart}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[finnish]{babel}     \usepackage{url}     \usepackage{parskip} % Tyhjä rivi kappaleiden väliin.     \usepackage{booktabs}     \usepackage{tikz,pgfplots}     \renewcommand*\arraystretch{2}     \listfiles     \begin{document}          \begin{tikzpicture}     \begin{axis}[%     scatter/classes={%         a={mark=o,draw=black}}]     \addplot[scatter,only marks,%         scatter src=explicit symbolic]%     table[meta=label] {     x y label     1 4.3 a     2 5.1 a     3 5.7 a     4 6.3 a     5 6.8 a     6 7.1 a     7 7.2 a     8 7.2 a     9 7.2 a     10 7.2 a     11 7.5 a     12 7.8 a         };     \end{axis}     \end{tikzpicture}     \end{document}      However, LaTeX said the following:                   ! Package pgfplots Warning: You requested to open table ' x y label 1 4.3 a 2 5         .1 a 3 5.7 a 4 6.3 a 5 6.8 a 6 7.1 a 7 7.2 a 8 7.2 a 9 7.2 a 10 7.2 a 11 7.5 a          12 7.8 a ', but there is also a ' x y label 1 4.3 a 2 5.1 a 3 5.7 a 4 6.3 a 5 6         .8 a 6 7.1 a 7 7.2 a 8 7.2 a 9 7.2 a 10 7.2 a 11 7.5 a 12 7.8 a .tex'. TeX will          automatically append the suffix '.tex', so I will now open ' x y label 1 4.3 a          2 5.1 a 3 5.7 a 4 6.3 a 5 6.8 a 6 7.1 a 7 7.2 a 8 7.2 a 9 7.2 a 10 7.2 a 11 7.         5 a 12 7.8 a .tex'. Please make sure you don't accidentally load TeX files - th         is may produce unrecoverable errors.         ! Extra \or.         <argument> ...dcsname \end \pgfplotstable@EOI \or                                                            \let \pgfplotstableread@im...         l.33     };              ? x      Log file gives:               File: tikzlibrarytopaths.code.tex 2008/06/17 v2.10 (rcs-revision 1.2)     ))) (/usr/share/texmf-texlive/tex/latex/pgfplots/pgfplots.sty     Package: pgfplots 2009/02/14 Version 1.2.2          (/usr/share/texmf-texlive/tex/generic/pgfplots/pgfplots.code.tex     (/usr/share/texmf-texlive/tex/generic/pgfplots/pgfplotscore.code.tex     \t@pgfplots@toka=\toks37     \t@pgfplots@tokb=\toks38     \t@pgfplots@tokc=\toks39     \pgfplots@tmpa=\dimen173     )     (/usr/share/texmf-texlive/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsup     p_loader.code.tex     Package pgfplots: loading complementary code for your PGF version...          (/usr/share/texmf-texlive/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsup     p_misc.code.tex)     (/usr/share/texmf-texlive/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsup     p_pgfkeysfiltered.code.tex     \pgfkeys@tmptoks=\toks40     )     (/usr/share/texmf-texlive/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsup     p_pgfmathfloat.code.tex     \c@pgfmathroundto@lastzeros=\count124     )     (/usr/share/texmf-texlive/tex/generic/pgfplots/oldpgfcompatib/pgfplotsoldpgfsup     p_pgflibraryplothandlers.code.tex     File: pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex 2009/02/13 v2.10 (rcs-     revision 1.7)     \pgf@plot@mark@count=\count125     \pgfplotmarksize=\dimen174     )     (/usr/share/texmf/tex/generic/pgf/libraries/pgflibraryfpu.code.tex))     (/usr/share/texmf-texlive/tex/generic/pgfplots/util/pgfplotsutil.code.tex     (/usr/share/texmf-texlive/tex/generic/pgfplots/liststructure/pgfplotsliststruct     ure.code.tex)     (/usr/share/texmf-texlive/tex/generic/pgfplots/liststructure/pgfplotsliststruct     ureext.code.tex)     (/usr/share/texmf-texlive/tex/generic/pgfplots/liststructure/pgfplotsarray.code     .tex     \c@pgfplotsarray@tmp=\count126     )     (/usr/share/texmf-texlive/tex/generic/pgfplots/numtable/pgfplotstable.code.tex     \c@pgfplotstable@counta=\count127     \pgfplotstable@outfile=\write4          (/usr/share/texmf-texlive/tex/generic/pgfplots/numtable/pgfplotstable.coltype.c     ode.tex)))     (/usr/share/texmf-texlive/tex/generic/pgfplots/util/pgfplotscolormap.code.tex)     (/usr/share/texmf-texlive/tex/generic/pgfplots/pgfplots.stackedplots.code.tex)     (/usr/share/texmf-texlive/tex/generic/pgfplots/pgfplotscoordprocessing.code.tex     ) (/usr/share/texmf-texlive/tex/generic/pgfplots/pgfplotsticks.code.tex)     (/usr/share/texmf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecor     ations.code.tex     (/usr/share/texmf/tex/generic/pgf/modules/pgfmoduledecorations.code.tex     \pgfdecoratedcompleteddistance=\dimen175     \pgfdecoratedremainingdistance=\dimen176     \pgfdecoratedinputsegmentcompleteddistance=\dimen177     \pgfdecoratedinputsegmentremainingdistance=\dimen178     \pgf@decorate@distancetomove=\dimen179     \pgf@decorate@repeatstate=\count128     \pgfdecorationsegmentamplitude=\dimen180     \pgfdecorationsegmentlength=\dimen181     )     \tikz@lib@dec@box=\box38     )     (/usr/share/texmf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecor     ations.pathmorphing.code.tex     (/usr/share/texmf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.p     athmorphing.code.tex))     (/usr/share/texmf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarydecor     ations.pathreplacing.code.tex     (/usr/share/texmf/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.p     athreplacing.code.tex))     \pgfplots@numplots=\count129     \pgfplots@xmin@reg=\dimen182     \pgfplots@xmax@reg=\dimen183     \pgfplots@ymin@reg=\dimen184     \pgfplots@ymax@reg=\dimen185     \pgfplots@zmin@reg=\dimen186     \pgfplots@zmax@reg=\dimen187     )     (/usr/share/texmf/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryplotm     arks.code.tex     File: tikzlibraryplotmarks.code.tex 2008/01/09 v2.10 (rcs-revision 1.1)      So, what is an easy way to draw scatter plots in LaTeX? And how can I add a regression line to the plot? Update: These are the versions of files I'm using:               grep File testi.log     File: amsgen.sty 1999/11/30 v2.0     File: umsa.fd 2009/06/22 v3.00 AMS symbols A     File: utf8.def 2008/04/05 v1.1m UTF-8 support for inputenc     File: t1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc     File: ot1enc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc     File: omsenc.dfu 2008/04/05 v1.1m UTF-8 support for inputenc     File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file     File: babel.def 2008/07/06 v3.8l Babel common definitions     File: graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live     File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)     File: pgf.cfg 2008/05/14  (rcs-revision 1.7)     File: pgfsys-dvips.def 2008/04/03  (rcs-revision 1.20)     File: pgfsys-common-postscript.def 2008/10/01  (rcs-revision 1.22)     File: pgfsyssoftpath.code.tex 2008/07/18  (rcs-revision 1.7)     File: pgfsysprotocol.code.tex 2006/10/16  (rcs-revision 1.4)     File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive     File: pgfcorepoints.code.tex 2010/04/09  (rcs-revision 1.20)     File: pgfcorepathconstruct.code.tex 2010/08/03  (rcs-revision 1.24)     File: pgfcorepathusage.code.tex 2008/04/22  (rcs-revision 1.12)     File: pgfcorescopes.code.tex 2010/09/08  (rcs-revision 1.34)     File: pgfcoregraphicstate.code.tex 2008/04/22  (rcs-revision 1.9)     File: pgfcoretransformations.code.tex 2009/06/10  (rcs-revision 1.11)     File: pgfcorequick.code.tex 2008/10/09  (rcs-revision 1.3)     File: pgfcoreobjects.code.tex 2006/10/11  (rcs-revision 1.2)     File: pgfcorepathprocessing.code.tex 2008/10/09  (rcs-revision 1.8)     File: pgfcorearrows.code.tex 2008/04/23  (rcs-revision 1.11)     File: pgfcoreshade.code.tex 2008/11/23  (rcs-revision 1.13)     File: pgfcoreimage.code.tex 2010/03/25  (rcs-revision 1.16)     File: pgfcoreexternal.code.tex 2010/09/01  (rcs-revision 1.17)     File: pgfcorelayers.code.tex 2010/08/27  (rcs-revision 1.2)     File: pgfcoretransparency.code.tex 2008/01/17  (rcs-revision 1.2)     File: pgfcorepatterns.code.tex 2009/07/02  (rcs-revision 1.3)     File: pgfmoduleshapes.code.tex 2010/09/09  (rcs-revision 1.13)     File: pgfmoduleplot.code.tex 2010/10/22  (rcs-revision 1.8)     File: pgflibraryplothandlers.code.tex 2010/05/31 v2.10 (rcs-revision 1.15)     File: pgfmodulematrix.code.tex 2010/08/24  (rcs-revision 1.4)     File: tikzlibrarytopaths.code.tex 2008/06/17 v2.10 (rcs-revision 1.2)     File: pgfplotsoldpgfsupp_pgflibraryplothandlers.code.tex 2009/02/13 v2.10 (rcs-     File: tikzlibraryplotmarks.code.tex 2008/01/09 v2.10 (rcs-revision 1.1)     File: pgflibraryplotmarks.code.tex 2010/10/15 v2.10 (rcs-revision 1.12)     File: umsa.fd 2009/06/22 v3.00 AMS symbols A     File: umsb.fd 2009/06/22 v3.00 AMS symbols B


title: How to place a "banner image" at the top of a paper

text: When using this class: http://daviddoria.com/Uploads/acmtog.cls I am trying to place a `figure*` right under the title/authors. I tried this:               \documentclass{acmtog}     \pdfminorversion=5          \usepackage{float}     \usepackage{graphicx}     \usepackage[caption=false,format=hang]{subfig} % needed for \subfloat. caption=false fixes: ``Unsupported document class (or package) detected, (caption) use of the caption package is not recommended''. format=hang makes the hanging indention in the figure captions look correct.     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{algpseudocode}     \usepackage{algorithm}     \usepackage{lipsum}          \acmVolume{VV}     \acmNumber{N}     \acmYear{2012}     \acmMonth{April}     \acmArticleNum{XXX}     \acmdoi{10.1145/XXXXXXX.YYYYYYY}          \begin{document}          \title{My paper}          \author{Me {\upshape and} My Friend     \affil{Affiliation}}          \maketitle          \begin{bottomstuff}          Authors' addresses:      \end{bottomstuff}          \def\BannerFigSize{.25}     \begin{figure*}[ht!]     \centering     \subfloat[a.]       {       \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }       \label{fig:banner:scene}       }     \subfloat[b.]       {       \fbox{\rule{0pt}{1in} Some text \rule{1in}{0pt} }       \label{fig:banner:strokes}       }     \caption{Our algorithms.}     \label{fig:banner}     \end{figure*}               \lipsum[1-4]          \end{document}      But the figure appears on the next page. I also tried `[H]` placement (from the `float` package) but that seems to make the image disappear entirely. Is there a better way to do this?


title: How to get harvard style through "agsm"

text: I wan't to use harvard style in my paper. I'm using TeXMaker and `natbib`. I got `agsm.bst` downloaded. But it's not helping. I'm using these commands               \documentclass{article}     \usepackage{natbib}     \begin{document}          \bibliography{FILE}     \bibliographystyle{agsm}  % that loads file agsm.bst      % it's working fine for \bibliographystyle{plain}, but that's not the referencing I want     \end{document}       I doubt it's a problem with the way I'm saving `agsm`. Can someone help me out?


title: Italic in ConTeXt

text: What is the equivalent of the LaTeX-code `\textit{}` in ConTeX? It sets the text in the brackets italic. There is `\it` but I am searching for something like `\startit...\stopit`.


title: Typesetting Meijer's G function in LaTeX

text: At the moment I'm working on a paper, where I use Meijer's _G_ function. The problem is that I don't like the way my _G_ functions look. Let me first tell how I'm typesetting the function at present, and then what I don't like about it. At present I use               \documentclass[11pt]{article}          \usepackage{amssymb,amsmath,mathtools}          \newcommand{\MeijerG}[7]{G \begin{smallmatrix} #1 & #2 \\ #3 & #4 \end{smallmatrix} \left( \begin{smallmatrix} #5 \\ #6 \end{smallmatrix} \middle\vert #7 \right) }          \begin{document}          \begin{equation}     \MeijerG{m}{n}{p}{q}{a_1,\ldots,a_p}{b_1,\ldots,b_q}{z}     \end{equation}          \end{document}      There are several things I would like to change. First, I would like to have a functionality similar to that of commands defined using `\DeclarePairedDelimiter` from the package `mathtools`. The following example should illustrate what I mean               \documentclass[11pt]{article}          \usepackage{amssymb,amsmath,mathtools}          \DeclarePairedDelimiter{\average}{\langle}{\rangle}          \begin{document}          \begin{equation}     \average*{\sum_k \delta(x-x_k)}      \neq     \average[\Big]{\sum_k \delta(x-x_k)} \neq     \average{\sum_k \delta(x-x_k)}     \end{equation}          \end{document}      The second problem is that I don't like the spacing around the `m,n,p,q`. This can to some extent be improved by using `\\!`:               \newcommand{\MeijerG}[7]{G \begin{smallmatrix} #1\! & #2 \\ #3\! & #4 \end{smallmatrix}\!\! \left( \begin{smallmatrix} #5 \\ #6 \end{smallmatrix} \middle\vert #7 \right) }      But I don't know if there is better way to fix this. If you have any suggestions on how to improve the above defined `\MeijerG` or if you would define the Meijer's _G_ function in a completely different way, then please write an answer. Actually I have an additional question: Do you think that any effort (regarding the typesetting of Meijer's _G_ function) will be eliminated when the manuscript is summited to a journal?


title: Using htlatex to convert LaTeX to HTML

text: I appear to have `htlatex` and `htxelatex` already installed on my computer. However when I try to run them, it comes up with the message, `'I can't write on file 'texput.log''` I am trying to convert a LaTeX file to HTML. This is on Windows, with MiKTeX.


title: Replace 'and' with ampersand in bibliography and parenthetical citations using BibLaTeX

text: By default, author-year style in BibLaTeX uses the word 'and' before the last author. I would like to retain this for in-text citations, but would like to replace 'and' with an ampersand (&) in the bibliography and in parenthetical citations. For example, I would like the following:               In-text citation: Smith and John (2013)     Parenthetical citation: (Smith & John, 2013)     Bibliography: Smith, A.B. & John, C.D. (2013)...      How can I do this? I found another answer that specified how to turn all instances of 'and' to ampersand, but I haven't been able to find out how to change only the bibliography and parenthetical citations to ampersand (not the in-text citations): http://tex.stackexchange.com/questions/68053/use-ampersand-in-citations-and- bibliography-in-biblatex


title: How to include a PDF image into a PDFLaTeX document

text: I am generating a PDF file using `pdflatex` and need to include another PDF file. The reason is that I have a `graphMl` file which I exported from _yEd_ graph editor to a PDF file, named `sample.pdf`. The TeX code to be compiled with `pdflatex` is given below. I need to include that file at the start of the document.               \documentclass[a4paper,leqno,twoside]{article}          \usepackage[latin1]{inputenc}     \usepackage[english]{babel}     \usepackage{multirow}          \begin{document}           [% FOREACH st IN Service %]        Name,Id:       [% st.Id %], [% st.Name %]             des:       [% st.Description %]            Customers:      [% FOREACH softservice IN st.Customers %]       [% FOREACH swid IN softservice.SW %]      [% swid.Service %]       [% FOREACH st IN Service %][% IF swid.Service == st.Id %]         ([% st.Name %])             [% END %] [% END %][% END %][% END %]            Suppliers:            [% FOREACH shservice IN st.Suppliers %]        [% FOREACH sw IN shservice.SW %][% sw.Service %]         [% FOREACH st IN Service %][% IF sw.Service == st.Id %]([% st.Name %])          [% END %][% END %][% END %]            [% FOREACH hw IN shservice.HW %][% hw.Type %][% hw.Nr %][% END %]       [% END %]       \newpage       [% END %]     \end{document}


title: TeX & Troff a reflection on the history of Computer Typography

text: I'm interested in relationship between two very important Computer Typography systems Troff and TeX. In particular, I would like to find any statements made by Donald Knuth about the influence (or not) of Troff on the early development of TeX78. Could anyone point me to a suitable resource? I have tried hard to find any records of remarks made by Don related to Troff and its influence on the creation of TeX. I was also preparing to ask him that question personally year and a half ago in San Francisco. Unfortunately, I saw that dramatical iTeX(to be read text) announcement only on video. Since there are many people here who know Don personally, has anybody bother to ask him that question privately? I am bit surprised to find that this question has not been asked earlier as I recognize many names on this portal who made significant contributions to both systems and who have used computers long before Microsoft "invented Windows". It is a bit inspired by the talk of Brian Reid, the creator of another legendary but now forgotten typesetting system Scribe, about his disillusion with the business of computer typography. I had true privilege attending that talk many years ago. Unlike TeX, it seems to me that Scribe was a legit attempt to take computer typesetting in a "radically" different direction than Troff. As somebody who essentially grow up using TeX as THE computer typographic system and only learning Troff as a part of general Unix folklore, it would seem to me more logical that Don tried 1978 to fix what was wrong with Troff and continue on his work on Art of Computer Programming instead of creating entirely new typographic system from the scratch. Although proprietary, Troff definitely was not closed source (at least for somebody at Stanford) and it is very formidable general purpose typesetting system. I know enough (I should say little) about both systems and some of their major internal differences to appreciate TeX contributions to the world of Computer Typography. On the another hand, the idea of pre-processors utilized by Troff is very close to my heart being a Unix addict even though `\special` is indeed very special command in TeX. I like the fact that Troff is tiny comparing to TeX even that one that I use mandoc (OpenBSD user here) and mdoc macros is not at this point general purpose typesetting system (at least not yet usable for Mathematics). I am really curious to get some answers on this one. Maybe people who abandoned Music TeX in favor of developing LilyPond can also shed some light.


title: Using of \usetikzlibrary in an expl3 package fails

text: In the example below I provided a small test package `mytestpackage.sty` which uses the syntax of `expl3`. If I use the command `\usetikzlibrary` inside the package I will get the error: Runaway argument?               v\pgfversion ]$Header:/cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz\ETC.     ! File ended while scanning use of \next.     <inserted text>                      \par       The MWE:               \documentclass{report}     \usepackage{filecontents}          \begin{filecontents}{mytestpackage.sty}     \RequirePackage{expl3}     \ProvidesExplPackage{mytestpackage}{2012/05/26} {0.1}{mytestpackage}     \RequirePackage{tikz}     \usetikzlibrary{calc,backgrounds,arrows,matrix}     \end{filecontents}     \usepackage{mytestpackage}     \begin{document}     foo bar     \end{document}      The first quick fix is:               \ExplSyntaxOff     \usetikzlibrary{calc,backgrounds,arrows,matrix}     \ExplSyntaxOn      How can I patch TikZ (`\usetikzlibrary`) to use it inside my package? Based on this solution we can send a bug report.


title: \graphicspath for Inkscape pdf_tex files

text: For writing a lecture note, I have put my images in a subdirectory named "image". In the `main.tex` file I have added `\graphicspath{{image/}}`. I have also included:               \newcommand{\executeiffilenewer}[3]{%      \ifnum\pdfstrcmp{\pdffilemoddate{#1}}%      {\pdffilemoddate{#2}}>0%      {\immediate\write18{#3}}\fi%     }          \newcommand{\includesvg}[1]{%      \executeiffilenewer{#1.svg}{#1.pdf}%      {inkscape -z -D --file=#1.svg %      --export-pdf=#1.pdf --export-latex}%      \input{#1.pdf_tex}%     }      in order to include `pdf_tex` files. In the `main.tex` file I am inserting the SVG file by:               \begin{figure}     \input{filename.pdf_tex}     \end{figure}      but I am getting the following error:               ! LaTeX Error: File `relativeposition.pdf_tex' not found.      Can anyone tell me what I should do to keep all my SVG files in the image subdirectory and input them from `main.tex`?


title: Upper Case Page Header KOMA

text: I am trying change the page header in `scrbook` so that it contains upper case letters. To do so, I am using `fancyhdr` which gives me the required look for all the chapters. ![enter image description here](http://i.stack.imgur.com/G61HP.png) Unfortunately there is a problem with the page header in the bibliography that still contains lower case letters. ![enter image description here](http://i.stack.imgur.com/K5bIB.png) How can I change this, so that it looks like this? ![enter image description here](http://i.stack.imgur.com/clg1T.png) I know that if use `book` instead of `scrbook` everythink works fine, but since I am using a lot of other things from scrbook this is really an unwanted option. Usually `scrpage2` is recommended for the use with KOMA-script, but I don't know a way to have upper case letters in the page headers there. Here is my code                   \begin{filecontents}{mybib.bib}         @article{Smith2000,         author = {Smith, John},         journal = {Journal A},         number = {1},         pages = {1--38},         title = {{Science}},         volume = {1},         year = {2000}         }         \end{filecontents}              \documentclass{scrbook}         \usepackage{biblatex}         \usepackage{blindtext}         \bibliography{mybib}         \usepackage{fancyhdr}              \makeatletter{%         \fancyhead[L]{\leftmark}%         \fancyhead[R]{\thepage}%         }\makeatother         \pagestyle{fancy}                   \begin{document}         \chapter{Test}         \blindtext[5]         \cite{Smith2000}         \printbibliography         \blindtext[5]         \end{document}


title: Text alignment in a Marginpar (Arabic)

text: how can I write a marginpar in Arabic with a text alignment from right to left. I use XeLaTeX. When I write               \marginpar{{\A كتاب حلية الأبدال وما يظهر عنها من المعارف والأحوال}}       Then that comes as a result The A definition is for:               \newfontfamily{\A}{Geeza Pro}      The last word shall be right justified. Thank you for helping me. * * *               \documentclass[11pt,twoside=true,a5paper,pagesize]{scrbook}     \usepackage{fontspec,xltxtra,xunicode}     \usepackage[margin=1.3in]{geometry}     \usepackage[ german]{babel}     \usepackage [para]{footmisc}     \usepackage{endnotes}     \usepackage{marginnote}      \setcounter{secnumdepth}{-2}     \newcommand{\mymparsetup}{\itshape}     \renewcommand{\theendnote}{\Roman{endnote}}      \renewcommand{\thefootnote}{\textit{\arabic{footnote}}}     \renewcommand{\notesname}{Bemerkungen und Kommentare}     \usepackage{titlesec}     \titleformat{\section}  {\normalfont\scshape}{\thesection}{1em}{}          \begin{document}     \sloppy     \newfontfamily{\A}{Geeza Pro}     \newfontfamily{\B}{Charis SIL}     \newfontfamily{\C}{AGA Arabesque}          \title{Die spirituelle Metamorphose}     \author{}     \date{}     \maketitle          \section{Einführendes Kapitel}               \marginpar{{\A كتاب حلية الأبدال وما يظهر عنها من المعارف والأحوال}}      Dank gebührt Allah {\C} für das, wozu er uns inspiriert      hat sowie für seine Belehrung dessen, was wir nicht wussten.      Wahrlich die Gunst Allahs gegenüber uns ist gewaltig.      Und Friede und Segen seien auf dem größten Meister,      dem edelsten Propheten, welchem...            ...                \newpage           \theendnotes      \end{document}


title: Can I include an article (revtex4) inside a book-class latex document?

text: I would like to include in an Appendix of my thesis some articles written, and I would like to do so in the original style which is revtex-prl. The thesis is written as a book. Can I actually do this?


title: insert code before chapter title

text: I would like to insert some code before the chapter title appears. I have defined:               \newcommand{\toptitle}[2]{\itshape #1 \hfill #2 \par}      Then, if I am writing for example:               \begin{document}     \toptitle{Quantum Mechanics}{15.10.2011}     \chapter{My Chapter}     \end{document}      the chapter title does not appear because this code precedes it. I am using the titlesec package but couldn't find a command to append code before the chapter title. Is it possible?


title: Drawing "blobs"

text: I would like to draw diagrams representing sets as `blobs` using tikz, that is an object having no distinct shape (this is one definition of `blob`.) It doesn't have to be tikz specifically : any solution is welcome, it just happens to be the only way I am aware of to draw diagrams in LaTeX. Also, I have to be able to fit the drawings in `commutative diagrams` containing standard arrows etc, which is why I felt compelled to use tikz. At any rate, I would like to create drawings that look like the one below ![Screen shot](http://i.imgur.com/M1pReQU.jpg) How do I create these "generic shapes"? Here's a drawing more in line with the result I want to achieve. ![Screen shot](http://i.imgur.com/Nx56Ve8.jpg) The bent line in `X` is supposed to represent the inverse image under the map `f` of the point drawn in `f(X)`, and the two points on it are the images of the two points on the left under the map `alpha`. Related Question.


title: What is the restriction on \foreach with \from and \to statements?

text: I am trying to draw an automaton using TikZ and `\foreach` statement. Below is the sample of what I have. Now, two questions I have is,   1. Is there any way to use curly braces `{,}` instead of `(,)` as I have now to label some states of the automaton? I would like to have `A{A}`, not `A(A)`.   2. `\foreach` statement does not let me draw arrows in some situations. I want to draw arrows from `A` to `A(A)` (ideally, `A{A}` after the fix) and from `A` to `A'(A)` as well, but for some reason, it does not like how I name those states with parentheses. Is there anybody who can help me with this? I greatly appreciate it.               \documentclass{article}     \usepackage{tikz}     \begin{document}     \[\begin{tikzpicture}[shorten >=1pt,->]     \tikzstyle{vertex}=[circle,fill=black!25,minimum size=17pt,inner sep=0pt]     \foreach \name/\a in {A/90, A''/180, A(A)/270, A'(A)/0}     \node[vertex] (\name) at (\a:3cm) {$\name$};     \foreach \from/\to in {A/A'', A/A(A), A/A'(A)}     \draw (\from) -- (\to);     \end{tikzpicture}\]     \end{document}      ![enter image description here](http://i.stack.imgur.com/PvrbX.png)


title: How to fix the overlapped nodes with long text, in TikZ. Concept maps

text: I'd like to get helping from you.   I want to have paragraphs in the nodes of the concept map with Tikz, I mean, texts with multiple lines.   I have a problem with texts, the nodes are overlapped.   Here's the code:               \documentclass{article}       \usepackage{tikz}       %       \usetikzlibrary{mindmap}       \usetikzlibrary{trees}          \begin{document}       \begin{center}     \begin{tikzpicture}[edge from parent fork down,edge from parent/.style={black,thick,draw},every node/.style={rectangle,draw,rounded corners}]     \node at (0,0) {     \begin{tabular}{m{30mm}}     Text very long Text very long Text very long Text very long Text very long Text very long Text very long Text very long Text very long\\     Text very long Text very long Text very long Text very long Text very long Text very long Text very long\\     \end{tabular}     }     child {node {text}}     child {node {text}     child {node {\begin{tabular}{m{30mm}}     Text very long Text very long Text very long Text very long Text very long Text very long Text very long Text very long Text very long\\     Text very long Text very long Text very long Text very long Text very long Text very long Text very long\\     \end{tabular}}}     child {node {\begin{tabular}{m{30mm}}     Text very long Text very long Text very long Text very long Text very long Text very long Text very long Text very long Text very long\\     Text very long Text very long Text very long Text very long Text very long Text very long Text very long\\     \end{tabular}}}     };     \end{tikzpicture}     \end{center}          \end{document}


title: How to carry long text of \href to the next line while ocgcolorlinks is present?

text: This simplest code               \documentclass[a4paper]{book}          \usepackage[ocgcolorlinks]{hyperref}          \begin{document}         \href{"some URL"}{"long text"}     \end{document}      by compiling with **pdflatex** puts the `"long text"` in one line, i.e. with overfull of the line. When the option `ocgcolorlinks` of the `hyperref` package is omitted, the text is normally carried over to the next lines. My question: How can I force the text to be carried over to the next lines with `ocgcolorlinks` present?


title: Error with TextMate 2, PATH, --shell-escape and gnuplot in 10.8.2

text: I reopen this post, which was started some time ago but didn't came with a solution. I don't really remember what was the exact problem with this (well, of course, `gnuplot` didn't work correctly). So I write here my actual problem, which is the same as before. ## Problem I reinstalled the operating system (Mac OS X 10.8.2), installed MacTeX (the last one), installed MacPorts and `gnuplot` through it (in an administrator account). In this account, the command `port` works correctly from terminal (which let mi install `gnuplot`), and also does `gnuplot` app (from terminal). Then created a new (non-admin) account, and then neither `port` nor `gnuplot` worked. After little hacking (here it is more info), I solved it. Now `port` and `gnuplot` work both from terminal in both accounts. But here is the problem. I use TextMate to compile my documents, which compiles everything perfectly. But if I use some code which needs of `gnuplot` it isn't able to call it. See at the bottom for some examples. On the contrary, if I call the file from the terminal with `pdflatex --shell- escape file.tex` then it compiles perfect. ## Question What happens? Is it a PATH problem? How can I solve it? (I don't really understand what is a PATH, therefore I can't try/imagine by myself) ## Code and Logs ### Example 1:               \documentclass{scrartcl}     \usepackage{gnuplottex}     \begin{document}         \begin{gnuplot}             plot sin(x)         \end{gnuplot}     \end{document}      Part of the .log file > >     \openout3 = `Ejercicio1-gnuplottex-fig1.gnuplot'. >   >     Opening gnuplot stream Ejercicio1-gnuplottex-fig1.gnuplot >     runsystem(gnuplot Ejercicio1-gnuplottex-fig1.gnuplot)...executed. >   >     Package gnuplottex Warning: Conversion of Ejercicio1-gnuplottex- > fig1.gnuplot fa >     iled. >   >     Package gnuplottex Warning: Please convert Ejercicio1-gnuplottex- > fig1.gnuplot m >     anually. >   And from the terminal no error at all. ### Example 2:               \documentclass{scrartcl}     \usepackage{pgfplots}     \begin{document}         \begin{tikzpicture}             \begin{axis}                 \addplot gnuplot {sin(x)};             \end{axis}         \end{tikzpicture}     \end{document}      The .log problems from TextMate: > Latex Error: ./Ejercicio1.tex:6 Package pgfplots Error: Sorry, the gnuplot- > result file 'Ejercicio1.pgf-plot.table' could not be found. Maybe you need > to enable the shell-escape feature? For pdflatex, this is '>> pdflatex > -shell-escape'. You can also invoke '>> gnuplot .gnuplot' manually on the > respective gnuplot file.. > > ! Package pgfplots Warning: You have an axis with empty range. Replacing it > with a default range and clearing all plots. And no errors from terminal with `pdflatex --shell-escape file.tex`.


title: Consistant formatting with siunitx and pgf: Thousands Separator

text: I like the default behavior of the `siunitx` package in that the thousands separator is _not_ applied to four digit numbers, but _is_ applied when the number of digits exceeds four. In documents that contain `pgfplots`, `\pgfmathprintnumber` is used for the formatting of the numbers, but it does not exhibit this behavior: ![enter image description here](http://i.stack.imgur.com/ddQ36.png) Is there a setting for `\pgfmathprintnumber` to format numbers similar to the `\num` macro from the `siunitx` package so either method can be freely used with for formatting numbers ## Code:               \documentclass{article}          \usepackage{siunitx}     \usepackage{pgf}          \sisetup{         group-digits=true,         group-separator={\,},     }          \pgfkeys{/pgf/number format/.cd, set thousands separator={\,}}%          \begin{document}     \begin{tabular}{rll}     siunitx: &\num{9000}                &\num{19000} \\         pgf: &\pgfmathprintnumber{9000} &\pgfmathprintnumber{19000} \\     \end{tabular}     \end{document}


title: System: XeLaTeX, Circumstance: Automation, PROBLEM: error message "missing \item"

text: I am currently generating PDF's with variable contents from a template I made. Data is fetched from a database and used to create reports. This has been working greatly until recently I needed to change the layout. In a series of traditional description environments I set an item containing a certain score achieved. For example **\item[1/2]**. After this a subsubsection* will serve as title, followed by a paragraph of simple text. The problem occurs when the database has no text to insert in the subsubsection* body. I receive the well known "perhaps a missing \item" error. Is there any way around this? *EDIT: Below is functioning code. Haha, guess the \noindent is vestigial code from when the titles were still set as sidetags (not sure if mattered there either to be honest). I need a markup that will print the headings and score even if there is no text to put in the body of that specific list environment. Suggestions for a complete new solution are very welcome.. would not want LaTeX to remain in a state of error waiting to happen.               \documentclass[11pt, a4paper]{article}          % DOCUMENT LAYOUT     \usepackage{geometry,fancyhdr,tikz,everypage}     \geometry{a4paper, right=2cm, textheight=22cm, marginparsep=0.5cm, marginparwidth=3.5cm, left=2cm, footskip=3.5cm}     \definecolor{AltisLight}{HTML}{B9BAD6}     \definecolor{AltisDark}{HTML}{05266D}     \definecolor{AltisBlue}{HTML}{1E2060}     \definecolor{IngBlue}{HTML}{162D66}     \definecolor{IngOrange}{HTML}{F25C19}          \fancyhf{}     \fancyhfoffset[L]{1cm}     \lhead{\nouppercase{\leftmark}}     \rhead{}     \lfoot{\textcolor{IngOrange}{For internal use only}}     \cfoot{\thepage}     \pagestyle{fancy}          % FONTS     \usepackage{fontspec,xunicode,xltxtra}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont [Ligatures={Common}, Numbers={Lining}]{Linux Libertine O}          % ---- MARGIN LABELS     \usepackage{marginnote}     \newcommand{\sidetag}[1]{\noindent{\parindent=0pt\marginnote{\scriptsize #1}}}     \renewcommand*{\raggedleftmarginnote}{}     \setlength{\marginparsep}{-3.5cm}     \reversemarginpar          % HEADINGS     \usepackage{sectsty}     \usepackage[normalem]{ulem}     \sectionfont{\mdseries\upshape\Large}     \subsectionfont{\mdseries\scshape\normalsize}     \subsubsectionfont{\mdseries\upshape\small}          % BULLET LISTS     \usepackage{enumitem}     \setitemize{topsep=0pt,partopsep=0pt,parsep=0pt,itemsep=0pt}     \setdescription{topsep=0pt,partopsep=0pt,parsep=0pt,itemsep=0pt,labelwidth=1cm}          % DOCUMENT     \begin{document}     \clearpage\phantomsection\addcontentsline{toc}{section}{Robeco}\markboth{Robeco}{Robeco}%     \begin{tikzpicture}[remember picture,overlay]\node [xshift=-3cm, yshift=-5cm, scale=5]at (current page.north east) {None};\end{tikzpicture}     \section*{Score Card}\begin{description}[leftmargin=2.4cm]\item[]\sidetag{Fund name}Robeco          \end{description}\begin{description}[leftmargin=2.4cm]\item[]\sidetag{Analyst}LB          \end{description}\begin{description}[leftmargin=2.4cm]\item[]\sidetag{Period}2013 Q1          \end{description}\begin{description}[leftmargin=2.4cm]\item[]\sidetag{Last update}20130305          \end{description}\section*{Governance - Corporate}\noindent\begin{description}\item[1/2]\subsubsection*{Vivamus interdum}           Lorem ipsum dolor sit amet, consectetur adipiscing elit.      Nullam ultrices mollis posuere. Vivamus interdum, velit nec mollis dapibus,      mauris turpis posuere velit, aliquam porttitor felis dolor sed lorem.      Vivamus ac lectus ut sapien sodales lacinia. Praesent eleifend erat vel      mi placerat sit amet gravida ligula cursus. Donec volutpat consequat est      eu consequat. Etiam sit amet facilisis dui. Ut tempus laoreet sodales.          \end{description}\begin{description}\item[2/2]\subsubsection*{Donec volutpat consequat}           Lorem ipsum dolor sit amet, consectetur adipiscing elit.      Nullam ultrices mollis posuere. Vivamus interdum, velit nec mollis dapibus,      mauris turpis posuere velit, aliquam porttitor felis dolor sed lorem.      Vivamus ac lectus ut sapien sodales lacinia. Praesent eleifend erat vel      mi placerat sit amet gravida ligula cursus. Donec volutpat consequat est      eu consequat. Etiam sit amet facilisis dui. Ut tempus laoreet sodales.          \end{description}\begin{description}\item[2/2]\subsubsection*{ velit nec mollis dapibus}           Lorem ipsum dolor sit amet, consectetur adipiscing elit.      Nullam ultrices mollis posuere. Vivamus interdum, velit nec mollis dapibus,      mauris turpis posuere velit, aliquam porttitor felis dolor sed lorem.      Vivamus ac lectus ut sapien sodales lacinia. Praesent eleifend erat vel      mi placerat sit amet gravida ligula cursus. Donec volutpat consequat est      eu consequat. Etiam sit amet facilisis dui. Ut tempus laoreet sodales.          \end{description}\begin{description}\item[1/2]\subsubsection*{Etiam sit amet facilisis dui.}           Lorem ipsum dolor sit amet, consectetur adipiscing elit.      Nullam ultrices mollis posuere. Vivamus interdum, velit nec mollis dapibus,      mauris turpis posuere velit, aliquam porttitor felis dolor sed lorem.      Vivamus ac lectus ut sapien sodales lacinia. Praesent eleifend erat vel      mi placerat sit amet gravida ligula cursus. Donec volutpat consequat est      eu consequat. Etiam sit amet facilisis dui. Ut tempus laoreet sodales.          \end{description}     \end{document}


Which is the most suitable ultra-portable device for full LaTeX functionality? With "ultra-portable" I mean devices like the iPad or the Asus Eee Pad Transformer with low weight, long battery lifetime, fast boot etc. I am not speaking of smart phones. With "full LaTeX" I mean a well maintained LaTeX distribution like MiKTeX or TeXLive in combination with a nice comfortable editor like WinEdt or TeXstudio. I have read the various posts on TeX.SE regarding LaTeX on iPad and Android phones (note that Asus Eee Pad has Android OS). What I am missing, however, is a recommendation which device/OS I should buy having LaTeX compatibility in mind as one of the main applications I want to use on that device. The point is that I really want to base my decision on the suitability for LaTeX. Possibly none of the devices mentioned above is really good for LaTeX (yet) and one had better forget about tablets and get a netbook or ultrabook like MacBook Air or Asus Eee PC instead!?


title: Problem with babel [brazil] and tikz-cd's phantom arrows

text: I'm trying to draw the following diagram using tikz-cd               \documentclass[11pt]{article}          %\usepackage[brazil]{babel}     \usepackage{amssymb, tikz-cd}     \tikzset{commutative diagrams/.cd}          \begin{document}          \[ \begin{tikzcd}     0 \ar{r} & L' \ar{r}{j} \ar[equal]{d} & E' \times_{B'} B \ar{d}[swap]{p_1} \ar{r}{p_2} \ar[dr, phantom, "\square"] & B \ar{r} \ar{d}{v} & 0 \\     0 \ar{r} & L' \ar{r}[swap]{j'} & E' \ar{r}[swap]{f'} & B' \ar{r} & 0     \end{tikzcd} \]          \end{document}      Everything goes fine until I load `babel` package. The problem is specifically with the phantom option. I've tried solutions for similar problems, but none of them worked. Would it be possible to make this work?


title: Restarting Rowcolors

text: This should be a simple question. I am using `\rowcolors{1}{}{lightgray}` to alternate coloring of rows in a table. Is there a way to "restart" the re-coloring after a certain point so that I ensure that regardless of how many rows are above, I can guarantee that the alternating behavior resumes starting with a given, pre-set row? MWE:               \documentclass[11pt]{article}     \usepackage{threeparttable}             % tables with footnotes, capions all the same width     \usepackage{dcolumn}                    % decimal-aligned tabular math columns     \usepackage{multirow}                   % Allow table cells to span multiple rows     \usepackage{booktabs}                   % Formatting options for publication-quality tables     \usepackage{ltxtable}                   % long tabularx     \usepackage{colortbl}     \usepackage[table]{xcolor}     \definecolor{lightgray}{gray}{0.9}     \begin{document}     \rowcolors{1}{}{lightgray}     \LTXtable{\textwidth}{testtable}     \end{document}      testtable.tex:               \begin{longtable}{p{3cm} X}         \toprule         Heading row & This should be lightgrey \\         \hline % I use \hline because \midrule counts as a row and screws with the colors         A data row & This row should be uncolored \\         A data row & This row should be lightgrey \\         A data row & This row sometimes doesn't exist. It would be uncolored if it did \\         \hline         A new heading row & This should be lightgrey regardless of whether the previous row exists.     \end{longtable}


title: How can I pass optional arguments as optional arguments?

text: I have the following environments which are being used in my document. As you can see, a lot of unnecessary complexity is being added by my arcane optional argument handling using `\IfValueTF`. Is there a way to simplify this code such that `expl3` 'does what I'm thinking'? I'd like to be able to express the logic with something like `\begin{displayquote}[#1]`, where `#1` retains its value/no-value status when it's passed to `displayquote`.               \documentclass{article}     \usepackage{expl3,xparse,csquotes} \ExplSyntaxOn          \NewDocumentEnvironment { citeverse } { o } {       \IfValueTF{#1}         {\begin{displayquote}[#1]}         {\begin{displayquote}}     } {       \end{displayquote}     }          \NewDocumentEnvironment { citeverse* } { o } {       \IfValueTF{#1}         {\begin{citeverse}[#1]}         {\begin{citeverse}}            % make square paragraph       \setlength{\parindent}{0pt}       \setlength{\parskip}{.5\baselineskip}       \setlength{\parfillskip}{0pt}       \setlength{\emergencystretch}{.5\textwidth}     } {       \end{citeverse}     }          \NewDocumentEnvironment { pageverse } { o } {       \thispagestyle{empty}       \null       \vfill       \IfValueTF{#1}         {\begin{citeverse}[#1]}         {\begin{citeverse}}     } {       \end{citeverse}       \vfill       \null     }          \NewDocumentEnvironment { pageverse* } { o } {       \IfValueTF{#1}         {\begin{citeverse*}[#1]}         {\begin{citeverse*}}     } {       \end{citeverse*}     }          \ExplSyntaxOff     \begin{document}     \begin{citeverse}     Easy come, easy go.     \end{citeverse}          \begin{citeverse}[Winston Churchill]     You have enemies?  Good.     That means you've stood up for something,       sometime in your life.     \end{citeverse}          \begin{citeverse*}     A bird in the hand beats two in the bush.     In other news, this needs to be made longer       to really show off the square paragraph functionality.     \end{citeverse*}          \begin{citeverse*}[Benjamin Disraeli]     Action may not always bring happiness;       but there is no happiness without action.     \end{citeverse*}          \begin{pageverse}     Coming with quotations is hard.     \end{pageverse}          \begin{pageverse}[Abraham Lincoln]     Tact is the ability to describe others as they see themselves.     \end{pageverse}          \begin{pageverse*}     This is supposed to be a really long quotation---one that fills an entire page,       but I've completely run out of axioms to use!     I can only take comfort in the trend that axioms are short and pithy.     \end{pageverse*}          \begin{pageverse*}[Albert Einstein]     Only one who devotes himself to a cause with       his whole strength and soul can be a true master.     For this reason mastery demands all of a person.     \end{pageverse*}     \end{document}


title: Creating unnumbered chapters/sections (plus adding them to the ToC and/or header)

text: I'm using the `report` document class for a thesis, and I need to add things like "Acknowledgements" and an "Introduction". I noticed that there is an `\abstract` command which would have been wonderful if applied similarly. How do I add these without messing up the chapters' numbering while being picked up by the ToC in proper order and page numbering?


title: adding acknowledgement in .tex file

text: > **Possible Duplicate:**   >  Creating unnumbered chapters/sections (plus adding them to the ToC and/or > header) I want to thank my professor with mention in my LaTeX document, so I need to add a section (without section number) "acknowledgement" before the introduction in my .`tex` file . How can I write there?


title: How can I get my unnumbered chapter to appear in the table of contents?

text: I use an unnumbered chapter for my abstract, followed by the table of contents. However, that unnumbered chapter does not appear in the ToC. How can I fix this?               \documentclass[12pt,a4paper, oneside, bold]{thesis}     \usepackage[left=3cm,right=2cm,top=3cm,bottom=2cm]{geometry}     \begin{document}     \chapter*{abstract}     \tableofcontents     \chapter{1}     \chapter{2}     \chapter{3}     \end{document}


title: How to add a section* to the list of contents, but without giving it a number?

text: I have several section* 's in my LaTex text. But I only want the first one (abstract) to appear in the list of contents, although without a number. All the other section* 's are just a few subheadlines which should not appear anywhere and also don't have a number so far, which is good. Is there any exception regulation for this case only?


title: How to draw the following figure using TikZ?

text: > **Possible Duplicate:**   >  Aligning trees built with tikzpicture Is it possible to draw the following figure using TikZ? ![enter image description here](http://i.stack.imgur.com/gCC07.png) It know how to draw simple tree diagrams using TikZ. But this is little bit trickier for me.


title: How to redraw a previous arrow?

text: I'm trying to write a macro `\mappingto` which, basically, called after an arrow has been drawn, should add another one below clarifying what elements are mapped to. e.g. in an easy situation, I'd like               \xymatrix{%         A \ar[rr]^{f}           \mappingto{x}{f(x)}         && B}      to expand to               \xymatrix{%         A \ar[rr]^{f}           \ar@{|->}[]!/:a(-90) 3ex/*{x};[rr]!/:a(-90) 3ex/*{f(x)}         && B}      The main problem I have is how to get the source and target of the previous arrow? I naively thought that               \newcommand{\mappingto}[2]{%         \POS c="target"         \POS p="source"         \ar@{|->}"source"!/:a(-90) 3ex/*{#1};"target"!/:a(-90) 3ex/*{#2}     }      would do the trick, but it obviously doesn't : both items get typeset at the same place, namely below A. I tried all switching of `c` and `p`, including `c=..., c=...` and `p=..., p=...,` in case the `<coord>=<"Id">` does update `c` and `p`, but none did change anything. I'm pretty convinced now, even though I couldn't find confirmation in the reference manual, that arrows and paths save the `xy` state before being drawn, and restore it afterwards. So here is my question : is there any way to recover the target of the last drawn arrow? (Since c is always the source, recovering the source isn't a problem) I also have considered the following solutions :   * pass the direction again as a parameter : it would work, but I don't really like it, in the idea of logical coding   * pass the direction as a parameter and make the `\mappingto` macro draw both macros : I'd like to be able to use the `\mappingto` macro with any specific shape, label, position for the "regular" arrow, so it would need a lot of more parameters   * pass the code of the previous arrow as a parameter : Just calling it and saving c and p before or after wouldn't do the trick, because I can already do that. I could actually do something with the code of the macro : extract the direction : from `"\ar[rr]^{f}"`, get `"rr"`. I can almost do it using `xstring`, but it seems `xy-pic` can't expand macros inside `[ ]`, so I'm back to step one. Do you guys see any solution? (preferably in a logical programming mood, aka if I could have a way not forcing me to pass direction or previous arrow to the macro, it would be even nicer ^^) Minimal example for those who want to experiment:               \documentclass{article}     \usepackage[all]{xy}     \usepackage{xstring}           % Clean code version     \newcommand{\mappingtoI}[2]{%         \POS c="target"         \POS p="source"         \ar@{|->}"source"!/:a(-90) 3ex/*{#1};"target"!/:a(-90) 3ex/*{#2}     }           % Dirty version     \newcommand{\mappingtoII}[3]{% % First argument is now the first arrow         \StrBetween{#1}{[}{]}[\direction]         % Now \direction expands to the direction of the arrow         #1%     % We draw the first arrow...         \ar@{|->}[]!/:a(-90) 3ex/*{#2};[\direction]!/:a(-90) 3ex/*{#3}                 % ... and then we try to draw the second one.     }          \begin{document}          % % Uncomment this part to see the expected output.         % Expected output :     % \xymatrix{%     %    A \ar[rr]^{f}     %      \ar@{|->}[]!/:a(-90) 3ex/*{x};[rr]!/:a(-90) 3ex/*{f(x)}     %    && B     % }          What the basic macro gives :     \xymatrix{%         A \ar[rr]^{f}           \mappingtoI{x}{f(x)}         && B     }          What the "string processing" macro gives :       % Won't compile, comment this matrix out if you are trying to get an output!     \xymatrix{%         A \mappingtoII{\ar[rr]^{f}}                       {x}{f(x)}         && B     }                  \end{document}      Edit : It seems I was wrong stating that xy-pic couldn't expand the macros inside direction definition. Now I think xy-pic tries to evaluate `\ar` inside macros arguments. :/ Actually, the following macro               \newcommand{\mappingtoTest}[3]{%         \StrBetween[1]{#1}{[}{]}[\direction]         \direction     }      which should just print the direction of the entered macro, returns an error message               !Argument of \next has an extra }.      Funny enough, the following macro doesn't return an error :               \newcommand{\mappingtoTest}[3]{}      Adding `\protect` before `\ar` doesn't help, and I tried to play with `xstring` options, finally getting to this macro, which is the most likely to work at the moment, but still doesn't :               \newcommand{\mappingtoTest}[3]{% % First argument is now the first arrow         \noexpandarg          \StrBetween{#1}{[}{]}[\direction]          % Now \direction expands to the direction of the arrow         \fullexpandarg         #1%     % We draw the first arrow...         \ar@{|->}[]!/:a(-90) 3ex/*{#2};[\direction]!/:a(-90) 3ex/*{#3}                 % ... and then we try to draw the second one.     }      The `noexpandarg` makes a difference though, because               \newcommand{\mappingtoTest}[3]{% % First argument is now the first arrow         \noexpandarg          \StrBetween{#1}{[}{]}[\direction]}      does compile, while the same without `noexpandarg` didn't. If I try to print `\direction`, I get an obscure xy error again, though. :/


title: TexMaker + Sumatra PDF Forward search

text: I am trying to configure TexMaker with SumatraPDF. This has previously been discussed   Configure forward search with Texmaker + SumatraPDF   but the solutions did not work for me. Under "Options >> Configure TexMaker >> Commands >> PDF viewer", I have entered the following               "C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe"  -invert-colors -reuse-instance "%.pdf" -reuse-instance -forward-search "%.tex" @      This "almost works". When I build and view the output, I get two PDFs. One PDF is the document I wish to view. This PDF also has the correct source links so I can do an inverse search from sumatra. But SumatraPDF also tries to the same PDF file, but from the following location:               C:\users\mattlorig\documents      which is not where the document is located. Also, I use the `-invert-colors` option so that I get a black PDF with white letters.


title: Pretty Table of Contents

text: I would like to know if it's possible to have a Table of Contents looking like the following, where the number of the page is the big number on the left. ![PrettytTOC](http://i.stack.imgur.com/CyoX5.png) The sections could look like in the following "uggly-font-formatted" example. If someone has a better idea for the sections and subsections... ![Section](http://i.stack.imgur.com/7BioQ.png)


title: How to debug an infinite loop in pdfLaTeX code

text: I have some code which crashes when loading the myriadpro package and loading in the document only the symbol `\oiint`               \documentclass[]{scrbook}     \usepackage[T1]{fontenc}      \usepackage{amsmath} %     \usepackage[%       onlytext,    % only change the text fonts       sansmath,    % provide math version sans and sansbold      ]{MyriadPro}     \begin{document}     \begin{equation}     \oiint       \end{equation}     \end{document}      Note that the MyriadPro package and the fonts are not available on ctan. Any idea how to find out why pdflatex crashes? (CPU is 100%) EDIT: pdftex version is: `This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2011.12.12)` EDIT2: The author of the MyriadPro package confirmed, that this endless loop happens when "Myriad is loaded with onlytext and sansmath and in the document a math command is called in the mathversion normal, which is not defined by MyriadPro (\oiint)." EDIT3: Here the code of the endless loop, it is repeated endlessly with the last number increasing. However, I have not idea where the error comes from. Anyway I now know a bit more how to debug such an error and can provide a better error description to the author of the package.               is@range #1-#2@nil ->if >#2expandafter check@single else expandafter check@rang     e fi      #1<-5     #2<->     {if: (level 6) entered on line 10}     {true}     {expandafter}     {else: if (level 6) entered on line 10}     {fi: if (level 6) entered on line 10}          check@single #1>#2<#3@nnil ->def reserved@f {extract@rangefontinfo <#3@nnil }if     dim f@size p@ =#1p@ set@simple@size@args #2<#3@nnil execute@size@function sizef     n@info ifx external@font @empty else let reserved@f @empty fi fi reserved@f      #1<-5     #2<-     #3<-6><7><8><9><10><12>gen*cmr<10.95>cmr10<14.4>cmr12<17.28><20.74><24.88>cmr17     <-*>@nil <     {def}     {changing reserved@f=relax}     {into reserved@f=macro:->extract@rangefontinfo <6><7><8ETC.}     {ifdim: (level 6) entered on line 10}          f@size ->8     {false}     {fi: ifdim (level 6) entered on line 10}          reserved@f ->extract@rangefontinfo <6><7><8><9><10><12>gen*cmr<10.95>cmr10<14.4     >cmr12<17.28><20.74><24.88>cmr17<-*>@nil <@nnil           extract@rangefontinfo #1<#2>->is@range #2->@nil #2>     #1<-     #2<-6


title: Block quote in figure caption

text: I need to put a multi-line quote in a figure caption. I've put code together that does this correctly if I override several errors, but I'd like the document to compile without errors. The code:               \begin{figure}       \begin{center}          \includegraphics[width = 6in]{myfigure.png}        \end{center}        \caption[Reproduced from foo.]{text.           \begin{quote}            Quoted text from reproduction          \end{quote}          No really this is important.}\label{mylabel}     \end{figure}      The error I get is:               ./chap1.tex:166: LaTeX Error: Something's wrong--perhaps a missing \item.      Thanks for the help.


title: How is the center point of an arc path determined?

text: I'm having some difficulty drawing an arc as part of a path. What I'd like to do is draw a whole ellipse then shade only part of it. The shaded part is defined by four points on the ellipse. I can do this by clipping, but I'd like to understand from where the `arc` path is subtended. Additionally, it seems like drawing the path with arcs would be a better option since I can use the `cycle` path operation at the end and, ideally, it would cover up the dashed ellipse. Example code as a starting point:               \documentclass[border=5pt]{standalone}          \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}          \usepackage{tikz}     \usetikzlibrary{positioning}     \usetikzlibrary{intersections}     \usetikzlibrary{calc}          \begin{document}          \begin{tikzpicture}[every text node part/.style={font=\footnotesize},                         >=latex]            \draw (0, 0) [dashed, name path=footprint] circle [x radius=2, y radius=4];       \path [name path=top slice] (-2, 1) -- (2, 1);       \path [name path=bottom slice] (-2, -1) -- (2, -1);            \path [name intersections={of=footprint and {top slice}, name=top}];       \path [name intersections={of=footprint and {bottom slice},                                  name=bottom}];            \pgfmathanglebetweenpoints{%         \pgfpointorigin}{%         \pgfpointanchor{top-1}{center}}       \let\angleorigr\pgfmathresult            \pgfmathanglebetweenpoints{%         \pgfpointorigin}{%         \pgfpointanchor{bottom-2}{center}}       \pgfmathsetmacro{\angleendr}{\pgfmathresult - 360}            \pgfmathanglebetweenpoints{%         \pgfpointorigin}{%         \pgfpointanchor{top-2}{center}}       \let\angleendl\pgfmathresult            \pgfmathanglebetweenpoints{%         \pgfpointorigin}{%         \pgfpointanchor{bottom-1}{center}}       \pgfmathsetmacro{\angleorigl}{\pgfmathresult}            % It should look something like:       %\begin{scope}       %  \path [clip] (-2, 1) -- (2, 1) -- (2, -1) -- (-2, -1) --       %    cycle;       %  \path [clip] (0, 0) circle [x radius=2, y radius=4];       %  \filldraw [fill=lightgray, fill opacity=0.5]       %    (-2, 1) -- (2, 1) (2, -1) -- (-2, -1)       %    (0, 0) circle [x radius=2, y radius=4];       %\end{scope}            % Using arcs it looks crazy:       \draw [fill=lightgray, opacity=0.5]         (top-2) -- (top-1)         arc [x radius=2, y radius=4, start angle=\angleorigr,         end angle=\angleendr]         (bottom-2) -- (bottom-1)         arc [x radius=2, y radius=4, start angle=\angleorigl,         end angle=\angleendl];          \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/x0ylg.png) So how is the "center point" of the arc component determined (please modify this example to show the path can be generated using arcs)?


title: Using HSRM beamer theme, change boldness of navigation bar font when selected

text: I am attempting to modify the HSRM beamer theme found here. At the top in the navigation bar on every frame, I'd like to make the font bolder when a section is selected. Currently, when I have the table of contents or introduction selected, the bolded font is barely discernible from the normal font. How do I make it larger? Using `\setbeamerfont{section in head/foot}` changes the size of all the fonts in the nav bar. I just want to change the boldness when selected. Thanks a lot!


title: problem with Greek in beamer (windows)

text: I am trying to write my thesis presentation in windows with Beamer but i have an issue with Greek language. when i want to add a definition from drop down menu , the letters dont appear right in the compiled file. for example if i add Definition , in the compiled pdf appear Δεφινιτιον instead of Ορισμος (Definition in Greek).


I am trying to compile memman.tex:               % Memoir class user manual (Part II only)  last updated 2009/09/07     % Author: Peter Wilson     % Copyright 2001, 2002, 2003, 2004, 2008, 2009 Peter R. wilson      I get the error:               ! LaTeX Error: File `memsty.sty' not found.      How do I add the package to my MacTex install? I have OS X 10.8.4 and TeXLive-2013.


title: How to get HTML tags displayed in LaTeX?

text: I am making a LaTeX document and I am having HTML tags like `List<? extends Number>` which when I put in LaTeX turn out to be `List¡? extends Number¿`. I tried escaping with `\` but did not help. Anybody knows how to escape `<` and `>` in LaTeX?


title: Drawing Mass Spring Damp Systems in TikZ

text: I'd like to draw a Spring-Mass-Damping system by TikZ. I found the example in Drawing Mechanical Systems in LaTeX But I have problems compiling it. If I delete the damper code `\draw [dampener] (ground2.north) -- ($(M.south east)!(ground2.north)!(M.south west)$)` it works well The error message as below:               ! Package pgfkeys Error: I do not know the key '/pgf/decoration/mark connection node' and I am going to ignore it. Perhaps you misspelled it.          See the pgfkeys package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.30 \draw [dampener]                           (ground2.north) -- ($(M.south east)!(ground2.north)!(M...          ?      [1      As I can't reply to the original question, I have to posted a new question about this issue.


title: Using Tikz, is it possible to draw a cube within a sphere?

text: I would like to construct a diagram of a cube sitting inside a sphere. I can draw them both separately, but need some idea of how to construct the diagram such that the cube sits exactly within the sphere, the relationship between the side of the cube and the radius of the sphere would then be r=sqrt(3)*s/2, where r is the radius of the sphere holding the cube of side length s. @Torbjørn T. @hugovdberg - Thanks for your suggestion! I tried the following code, borrowing parts from segments available on the web. However, my sphere currently does not sit correctly at the same position of the cube. Also, I have the orientation of the sphere in error.               \documentclass[11pt]{scrartcl}      \PassOptionsToPackage{dvipsnames,svgnames}{xcolor}             \usepackage{xkeyval,tkz-base}     \usetikzlibrary{arrows,calc}          \usepackage{tikz}                    \begin{document}          \begin{tikzpicture}         [cube/.style={very thick,black},             grid/.style={very thin,gray},             axis/.style={->,blue,thick}]          %draw a grid in the x-y plane     \foreach \x in {-0.5,0,...,2.5}         \foreach \y in {-0.5,0,...,2.5}         {             \draw[grid] (\x,-0.5) -- (\x,2.5);             \draw[grid] (-0.5,\y) -- (2.5,\y);         }          %draw the axes     \draw[axis] (0,0,0) -- (3,0,0) node[anchor=west]{$x$};     \draw[axis] (0,0,0) -- (0,3,0) node[anchor=west]{$y$};     \draw[axis] (0,0,0) -- (0,0,3) node[anchor=west]{$z$};          %draw the top and bottom of the cube     \draw[cube] (0,0,0) -- (0,2,0) -- (2,2,0) -- (2,0,0) -- cycle;     \draw[cube] (0,0,2) -- (0,2,2) -- (2,2,2) -- (2,0,2) -- cycle;          %draw the edges of the cube     \draw[cube] (0,0,0) -- (0,0,2);     \draw[cube] (0,2,0) -- (0,2,2);     \draw[cube] (2,0,0) -- (2,0,2);     \draw[cube] (2,2,0) -- (2,2,2);                    \foreach \t in {0,10,...,180}         {\draw[gray] ({2*cos(\t)},{2*sin(\t)},0)              \foreach \rho in {5,10,...,360}                  {--({2*cos(\t)*cos(\rho)},{2*sin(\t)*cos(\rho)},              {2*sin(\rho)})}--cycle;         }     \foreach \t in {-90,-85,...,90}% parallels             {\draw[gray] ({2*cos(\t)},0,{2*sin(\t)})          \foreach \rho in {5,10,...,360}          {--({2*cos(\t)*cos(\rho)},{2*cos(\t)*sin(\rho)},                  {2*sin(\t)})}--cycle;         }           \end{tikzpicture}          \end{document}


title: Sloped Tikz node with rotation and scale

text: There should be an easy way to place a `sloped` `node` along a path. Using `sloped` works great (as in the black text). However, if there is a `rotate=` applied then the text is no longer _along_ the path (as in the red and blue examples). I can get the correct direction if I use `transform shape` (as in the orange example), but then the text gets scaled if a `scale=` is being applied. **Question:** How do I define the `\MyDraw` macro so that it can be used with a `rotate` _and_ a `scale` such that:   * the text is along the path even if a `rotate=` is applied, and   * the text is _not_ affected by a `scale=`. ![enter image description here](http://i.stack.imgur.com/ZBZiw.png) ## Notes:   * In my actual use, these drawing are all in the same `tikzpicture` and I use a `scope` to apply the desired transformations. To keep the MWE as close to possible as my actual use case, I used `scope`s in the MWE below instead of applying the options to the `tikzpicture` itself. ## Code:               \documentclass{article}     \usepackage{tikz}          \newcommand*{\MyDraw}[1]{%         \draw [ultra thick, -latex] (0,0) -- (1,4)              node [midway, above, sloped, align=center] {#1};     }%          \begin{document}     \begin{tikzpicture}         \MyDraw{not rotated};     \end{tikzpicture}%     % --------------------------------- apply "rotation"     \begin{tikzpicture}         \begin{scope}[rotate=-25, red]             \MyDraw{rotated};         \end{scope}     \end{tikzpicture}%     % --------------------------------- apply "rotation" and "scale"     \begin{tikzpicture}         \begin{scope}[rotate=-15, scale=1.3, blue]             \MyDraw{rotated and scaled};         \end{scope}     \end{tikzpicture}%     % --------------------------------- apply "rotation", "scale" and "transform shape"     \begin{tikzpicture}         \begin{scope}[rotate=-15, scale=1.5, transform shape, orange]             \MyDraw{rotated, scaled and \\ ``transform shape"};         \end{scope}     \end{tikzpicture}     \end{document}


title: Problem with nested \noexpand and \edef

text: I have a LaTeX problem and want to explain it with the following code snippet:               \documentclass{article}     \begin{document}            \def\myline{A}       \edef\myline{\myline \noexpand\bf B}       \edef\myline{\myline C}            \myline     \end{document}      I have to build up a line incrementally. This happens inside of a for loop. The problem is that I want to highlight some text in bold, but whenever I expand my line, I get the following error:               ! Missing control sequence inserted.     <inserted text>                      \inaccessible      l.9 \myline          ? X      I think, it is because of the third `\edef`, which tries to expand the `\bf` in the second `\edef`, however I have to expand it to avoid infinite recursion.


title: Build Sequence to create a PDF with citations from .bib

text: I seem unable to configure TexMaker's quick build so that if I have a .bib file, and a .tex file in a directory, and I click 'Quick Build' once, I get a PDF. Can someone either tell me the sequence of commands I need to run, or the ordered list of commands I need to include in the wizard? And I would like it to work both from a clean state and when files like .bbl,.aux,.blg or anything already exist. (I'm using MikTex 2.9)


title: How to check if the selected letter is uppercase or lowercase in a macro?

text: I'm using Texmaker and want to define some custom macros. The macros shall check if a selected letter is uppercase or lowercase and then replace that letter by a sequence defined in the macro. I need this macro to substitute turkish characters   * `\u{g}` – ğ   * `\u{G}` – Ğ   * `\c{c}` – ç   * `\c{C}` – Ç   * `\c{s}` – ş   * `\c{S}` – Ş   * `{\i}` – ı   * `\\.{I}` – İ but I don't want to manually select the uppercase or lowercase version of the character everytime. I did not find any reference to macros in the texmaker documentation and ixquicking _latex uppercase macro_ turns up results with overly complicated scripts. I want the macro to work like this: in the text 'Şimşek' I select the 'ş' and by pressing the hotkey assigned to my macro the letter turns into `\c{s}`. That same macro should turn The 'Ş' into `\c{S}` when it is selected and the hotkey is pressed. How what I define a macro to do just that?


title: What LaTeX Lab packages use expl3?

text: I am trying to migrate documents to http://latexlab.org, but they won't compile because they require expl3.sty. Yesterday I started by uploading all of the expl3 sty files but then latex demanded even more. I would be happy to do without expl3, but I can't determine what packages are calling it. _note: While writing this message, I realized that the xfrac package (seesiunitx) was the culprit._


title: `xkeyval` key doesn't work for setting `fragile` option in beamer

text: I'm trying to set a custom macro to create frames in my presentations. However, when I tried to set the options I can pass to the frame using `xkeyval` the whole macro stops working. How can I pass the `fragile` option to the frame using a defined macro? Additionally, can you explain why is not working?               \documentclass{beamer}     \usepackage{xkeyval}          \makeatletter     % Define the keys for the myframe (my)     \define@cmdkey[abc]{mf}{title}{}%    title of the frame     \define@cmdkey[abc]{mf}{options}{}%  options to the frame     \presetkeys[abc]{mf}{title=,options=}{}          \newcommand{\myframe}[3][]{%     \setkeys[abc]{mf}{#1}     \begin{frame}[\cmdabc@mf@options]{\cmdabc@mf@title}%     % my frame definition here     #2 #3     \end{frame}%     }     \makeatother          \begin{document}     % this works     \myframe[title=test]{test1}{test 2}     % this doesn't     \myframe[options=fragile,title=test]{test1}{test 2}          \end{document}      ![enter image description here](http://i.stack.imgur.com/CYIj4.jpg)


title: Why is \color moving the relative position of an entire \picture environment?

text: I've been writing a set of simple line drawing macros for some piecewise functions. For some reason, when I attempt to add color to the lines, each segment is translated to the right. I've verified that this is not because of a shared variable name, and placed a MWE below, along with the output. Removing the \color statement from the \drawthedamnline macro yields the correct output (the line segments are contiguous). My suspicion is that this has something to do with the way I've written the macros. Any advise would be helpful.               \documentclass[12pt]{article}          \usepackage[nomessages]{fp}     \usepackage{color}     \usepackage{wrapfig}     \usepackage{amsmath}     \usepackage{ifthen}          \newcommand{\ticks}[5]{ %x,y,numticks,direction (x=0,y=1),tickwidth         \ifthenelse{#3=0}{              }         {             \ifthenelse{#4=0}{                 \FPadd{\newx}{#1}{#5}                 \FPset{\newy}{#2}                 \put(\newx,\newy){\line(0,1){5}}             }             {                 \FPset{\newx}{#1}                 \FPadd{\newy}{#2}{#5}                 \put(\newx,\newy){\line(1,0){5}}             }             \FPsub{\numticksleft}{#3}{1}             \FPclip{\numticksleft}{\numticksleft}             \ticks{\newx}{\newy}{\numticksleft}{#4}{#5}         }     }               \newcommand{\peakplot}[5]{ %x,y,height,width,num_candidates        \put(#1,#2){\vector(0,1){#3}}        \put(#1,#2){\vector(1,0){#4}}         \FPsub{\tickspacex}{#3}{10}         \FPsub{\tickspacey}{#4}{10}         \FPdiv{\tickwidth}{\tickspacex}{#5}         \FPclip{\tickwidth}{\tickwidth}        \ticks{#1}{#2}{#5}{1}{\tickwidth}         \FPdiv{\tickwidth}{\tickspacey}{#5}        \ticks{#1}{#2}{#5}{0}{\tickwidth}     }          \newcommand{\drawthedamnline}[1]{             \color{\mylinecolor}             \put(\mypeakx, \peaky){\line(1,#1){\peakspace}}     }          \newcommand{\plotpeaks}[1]{ %used by \peak to plot a peak.             \drawthedamnline{#1}             \FPadd{\mypeakx}{\mypeakx}{\peakspace}             \FPmul{\ymove}{\peakspace}{#1}             \FPadd{\peaky}{\ymove}{\peaky}             \ifthenelse{\numpeaks=1}{}{                 \FPsub{\numpeaks}{\numpeaks}{1}                 \FPclip{\numpeaks}{\numpeaks}                 \plotpeaks             }     }     \newcommand{\peak}[5]{ %x,y, num_args, width, color, arg1, arg2,...argn.         \FPset{\mypeakx}{#1}         \FPset{\peaky}{#2}         \FPset{\numpeaks}{#3}         \FPdiv{\peakspace}{#4}{#3}         \FPclip{\peakspace}{\peakspace}         \def \mylinecolor {#5}         \plotpeaks     }          \begin{document}               \begin{wrapfigure}{r}{0.33\textwidth}       \begin{center}         \begin{picture}(100,100)             \thicklines             \peakplot{0}{0}{100}{100}{5}             \peak{0}{0}{5}{90}{red}{1}{1}{1}{1}{1}             \peak{0}{90}{5}{90}{blue}{-1}{-1}{-1}{-1}{-1}             \peak{0}{0}{5}{90}{green}{2}{1}{2}{-1}{-1}         \end{picture}       \end{center}       \caption{}       \label{condorcetFig}     \end{wrapfigure}          \end{document}      ![enter image description here](http://i.stack.imgur.com/hgLjG.png)


title: Using the parskip package, I find the space between subtitles ugly

text: I recently started using the `parskip` package. However, I find the space between the ending of text and the next subtitle too small. Similarly, I find the space between the Subtitle and the subsubtitle too big. Also the space between the subsubtitle and the next text is too big. What is the most preferred way to change this, remembering I am using the `parskip` package?


title: Tikz positionning on the baseline

text: I have the following piece of code               \begin{tikzpicture}     [mainbullet/.style={rectangle, minimum size=0.3cm,draw=orange!100, fill=orange!100,thick}, %     maintitle/.style={rectangle,opacity= 0.5}, %     date/.style={black, opacity=0.5}]     \tikz[baseline=(experiencetitle.base)]{%     \node[mainbullet] (experiencebullet) at (0,-23) {}; %     \node[maintitle](experiencetitle)[right =10mm of experiencebullet]{Experience};     \node(experiencedesc1)[below= 5mm of experiencetitle] {Experience};     \node[date](date1)[left=15mm of experiencedesc1]{1999-2000};}     \end{tikzpicture}     \end{document}      I would like the `experiencetitle` and the `experiencebullet` to be aligned on their baseline. The code shown hereabove seems to align them based on the rectangle center (the `experiencebullet` node) rather than its baseline and I do not understand why. Could someone give me a hint about where I am mistaking ?


title: Isometric Elevation Grid in TikZ

text: Is there a (simplistic?) way to draw a 3D elevation grid like this in Tikz or PGFPlots? ![3D Elevation Grid](http://i.stack.imgur.com/XMdYY.png) The blue line should be able to move up or down and, eventually, submerge the interior blocks. I've looked at this example, and follow it well enough that I could probably reconstruct things on my own, but it seems like at least some part of this may already exist as a package. I would also be willing to use packages aside from TikZ or PGFPlots.


title: Curvy arrows between two tables (with tikz?)

text: I try to connect two arbitrary tables with arrows. The code example below should demonstrate how: say we want to connect the "1" in A with the "5" in B, the "2" in A with the "7" in B and so on. My wish would be to have "curvy" arrows (as far as i know the `tikz` packages provides them) and not "straight" arrows. Is it even possible to combine "ordinary" tabular elements with `tikz` nodes oder drawings? If yes, how? If not, is there a pure `tikz` way to solve that problem? Thanks for any advices or hints!               \documentclass[12pt,a4paper,twoside]{scrartcl}     \begin{document}      \begin{center}            \begin{tabular}{c c c c c c}        $A$ & 1 & 2 & 3 & 4 &        \end{tabular}            \vspace{15mm}            \begin{tabular}{c c c c c c c c c c }        $B$ & \fbox{5} & 6 & \fbox{7} & 8 & \fbox{9} & 10 & \fbox{11} & 12 &         \end{tabular}          \end{center}     \end{document}


title: using xr with import package

text: I am working on the following project. It is a series of labs designed to teach numerical computing. https://github.com/byuimpact/numerical_computing The latex files are organized into to subdirectories which are subimported into `Vol1.tex` in the main root directory. Problem: I want to reference entire labs from within other labs. So if I am in lab1, be able to refer to 'lab 2' with a hyperlink to lab2. How can this be done. At the beginning of some labs, I have `\label{lab:lab1}`, but trying to refer to it with `\ref{lab:lab1}` in `lab2.tex` does not seem to work.


title: knitr and font style consistency in graphics

text: I am starting to use **knitr** to print graphics from R in my document. So far what I have been doing (I don't know if this is the best approach, but it is working) is to load the my R workspace with               <<prepare-data, include=FALSE>>=     load("~/Desktop/r_work_directory/workspace.RData")     @       after the preamble, then calling an R script to produce the graphics with               <<child-foo, child='figure/foo.R', include=FALSE>>=     @      and finally adding the figure with               \begin{figure}       \centering       \makebox[\textwidth]{\includegraphics[width=0.7\paperwidth]{figure/foo.pdf}}       \caption{This is Foo}            \label{fig:Foo}     \end{figure}      The only thing I couldn't get with this method is to have the fonts in the graphics to match those in my document. I saw in the **knitr** manual that consistency is given (only?) through the **tikzDevice**. Unfortunately the **tikzDevice** package is not available with **R** 3.0. Is there any other approach to get font style consistency?


title: Aesthetic issue in fractions

text: While I was typing a document related to special relativity, I came across this slight misalignment in `\frac{V}{c}`(shown with huge text size so that the effect is easily seen) ![V/c](http://i.stack.imgur.com/iN8xo.png) The 'problem' is that the `V`'s bottom point is not at all close to `c`'s top point. I'm guessing that this has something to do with the fact that the alignment is done using the borders of bounding boxes and that due to `V`'s asymmetric design (perhaps exaggerated by the relative thickness of its slant edges?). On trying `\frac{\mathrm{V}}{\mathrm{c}}`, one obtains: ![enter image description here](http://i.stack.imgur.com/KeVb0.png) This looks good by itself but extremely out of place with all the other variables italicised in the equation. I would not like to use `mathrm` everywhere as entire non-italicised equations are somewhat harder to read in my opinion. Also, speed of light is always written as _c_ and not c. My question : is there any 'middle-way' solution to this (using alternate fonts or otherwise)? An ideal solution would be to very slightly 'straighten' `V` and `c` to get a cross between the two illustrated cases. On another note: is this even a problem? While I certainly noticed it at normal font size, I'm not sure whether this is something to be taken seriously or not.


title: Untyped character at the end of chapter

text: Although there is no "f" typed, there exists a "f" character at the end of the chapter when pdf is created. What can be the problem? I can't find it! Even I delete all the text, and just type a character, still there is a "f" at the end. Please help. There is no compilation error or warning related to it.


title: How to define a new command based on \section with its optional argument?

text: I've defined a new command called `\mysec` like the below:                \documentclass{article}     \newcommand{\mysec}[1]{\section{#1}}     \begin{document}     \mysec[Foo foo]{Bla bla bla}     \end{document}      But in the PDF output, I get: > 1 [ > > Foo foo]Bla bla bla How to solve this problem? By the way, I'd prefer to have the solution without using extra packages. Also note that I don't want to redefine the `\section` command.


title: Adding page breaks to pandoc latex template when converting markdown

text: Perhaps I'm missing something, but is there a way to either (a) ensure that pandoc places pagebreaks before level 1 and level 2 headers in markdown (`#`,`##`), or (b) hide `\newpage` from other markdown tools? Is it possible to edit the template that pandoc uses for the conversion in order to do (a)? Any ideas gratefully received. :-)


title: Microtype and word spacing

text: I'm trying to change the default word spacing for some font. I know 2 ways to do it: setting `\fontdimen`s or `\spaceskip`. With these approaches and `microtype`'s `\textls` I get two different results, none of them satisfactory. How can I get the same (increased) interword space inside letterspaced text and between it and regular text? Example:               \documentclass{book}          \def\test#1{{#1\relax     \textls[200]{test test} test test\par}}          \usepackage{microtype}          \begin{document}     \test{}     \test{\spaceskip 10pt}     \test{\spaceskip 0pt\fontdimen2\font 10pt}          \end{document}


title: Problem with musixtex's mezzo piano dynamic

text: I am trying to use dynamics marks on my text by using the `musixtex` package. It works well except for the mezzo piano mark (\mp), which is not recognized. According to the manual (section 2.17.5) my code is correct (http://icking- music-archive.org/software/musixtex/musixdoc.pdf). Can someone spot what is wrong here?               \documentclass{article}     \usepackage{musixtex}     \begin{document}     \pppp, \ppp, \pp, \p, \mf, \f, \ff, \fff, \ffff, \sF % all these work fine     \mp % but this doesn't     \end{document}