title: Conflict between Geometry Ratio-Setting Keys and expl3 Syntax

text: I have found that when I try to use proportions-setting keys of the `geometry` package, like `hmarginratio = 1:1`, in the midst of a `expl3` class or package (i.e., such as declared with `\ProvidesExpl(Class|Package)`), I need to switch off the `expl3` syntax temporarily by issuing the `\ExplSyntaxOff` command before the `geometry` options, and returning back to `expl3` syntax afterwards by issuing `\ExplSyntaxOn`; otherwise, I get the error message `File ended while scanning use of \Gm@sep@ratio`. I guess this might be related to the `:` mark in the key value, but I'm not sure. Besides, I don't know if this just a bug in my installation or a feature that can be replicated by others. This is `myclass.cls`:               \RequirePackage{l3keys2e,xparse}     \ProvidesExplClass         {myclass}         {2013/08/25}         {1.0}         {myclass}          \LoadClass{memoir}          \RequirePackage{calc}          % Fine if the ExplSyntax lines below are uncommented. Error otherwise.     %\ExplSyntaxOff          \RequirePackage[         left = \paperwidth * 3/16,         hmarginratio = 1:1]{geometry}          %\ExplSyntaxOn      And this is `test.tex`:               \documentclass{myclass}          \begin{document}     Some text.     \end{document}


title: Display shifts in curve and slope with Pgfplots

text: I have the following MWE and would like to plot three lines on it, displaying the shift in height (and maybe the change in slope) between the second and third lines.               \documentclass{article}     \usepackage{pgfplots}        \begin{document}          \begin{tikzpicture}[scale=0.45,trim axis left, trim axis right]     \begin{axis}[ylabel={$\hat{S(4)}$},xlabel={$S{^*}_{breakeven}$},ylabel style={rotate=-90},domain=1:25, legend style={legend pos=north west,font=\scriptsize}, legend cell align=left]     \addplot+[black, mark=none, loosely dashed,forget plot]{x};     \addplot+[samples=200,mark=none]                                                    {exp(0 + 1*ln(x))};     \addplot+[samples=200,mark=none, dotted, thick]             {exp(0.46 + 0.28*ln(x))-1};     \addplot+[samples=200,mark=none, dotted, thick]             {exp(1.66 + 0.28*ln(x))-1};     \end{axis}     \end{tikzpicture}     \end{document}      Is there any way to display lines and arrows to show the shift in the curve, similar to the annotations that have been added to the following image i.e. an annotated bracket (with arrows) for the shift in the curve and an annotated right angle (with arrows) to show the slope? ![enter image description here](http://i.stack.imgur.com/wx0kz.jpg)


title: Beamer Latex Code Error In Listings Environment

text: I want to display a short latex code in my beamer. The code is also the about beamer. And I don't want to use the `\lstinputlisting{file.tex}`. So is there any way to do that? Here is the code without error. Anyway, when I the three disable lines are enable, error occur.               \documentclass{beamer}     \usetheme{Madrid}     \usepackage{listings}     \lstset{         language=[latex]tex,         breaklines=true}     \begin{document}         \begin{frame}[fragile]             \begin{lstlisting}                 \documentclass{beamer}                 \begin{document}     %               \begin{frame}     %                   Test     %               \end{frame}                 \end{document}             \end{lstlisting}         \end{frame}     \end{document}


title: Position margin notes relative to left margin in plain TeX

text: I want to add margin notes in the Tufte style to my Plain TeX document. (I'm using eplain, if that matters.) I know that if I were using LaTeX I could just use tufte-latex, but as a thorough contrarian I enjoy coding these things myself. I'm _almost_ there but my current macro will place text relative to the current location when I invoke it, instead of the margin. In my MWE, the note is placed smack dab in the middle of things. But if you move the invocation of `\sidenote` around, the side note may appear closer to the left margin. How can I reposition my sidenote text relative to the left (or right) margin, instead of the current location? (I used the left margin in my MWE.) The thing I really _do_ like about my macro is that the baselines of the first line of the side note and the main body text to which it refers align. I want to keep that. And any other suggestions about my macro are welcome. MWE:               \input eplain     \leftmargin=2in          \font\sidenotefont=      pxi at8.5pt          \long\def\sidenote#1{\llap{\smash{\vtop{%     \parindent=0pt\hsize=1.5in\rightskip=.87in\parfillskip=0pt\leftskip=-1in plus1fil%     \baselineskip=10pt\sidenotefont #1}}}}               When we are working at a difficult task and strive after a good thing, we are     fighting a righteous battle, the direct reward of which is that we are kept from     \sidenote{This note has been brought to you by the letter pi and     the number e. Please make a note of it. The reason for its existence is the     great lengths I went to do things.}much evil. As we advance in life it becomes more and more difficult, but in     fighting the difficulties the inmost strength of the heart is developed. Indeed     life is a have to defend and protect ourselves, and with a cheerful and brace     spirit we must battle; we plan and calculate in order to make progress.          \bye


title: Why does TeX Live's pdfTeX's %& parsing override the executable name?

text: In testing my answer to this question, I initially wrote the file               %& eplain     % code to answer question here     \bye      and compiled with `pdftex e`. Much to my surprise, the penultimate line of output was               Output written on e.dvi (1 page, 352 bytes).      If I change the first line to `\input eplain` or add the command line argument `-output-format=pdf`, then I get a pdf. This same behavior can be observed by by starting a LaTeX file with `%& latex` and compiling with either `pdflatex` or `pdftex` so it's unrelated to `eplain`.


title: How can I draw an arrowhead only at the end of a path drawn with \foreach?

text: I want to define a command for drawing some special polygonal lines with pgf/tikz. In these polygonal lines, the line styles are of alternating change. The following is my latex code:               \documentclass{standalone}     \usepackage{tikz}     \newcommand{\drawline}[4][]{       \foreach \v [remember=\v as \u,count=\i] in {#4} {         \ifnum \i > 1           \ifodd \i \draw[#1,#3] \u -- \v; \else \draw[#1,#2] \u -- \v; \fi         \fi       }     }     \begin{document}     \begin{tikzpicture}     \drawline{solid,color=blue}{dashed,color=green}{(0,0),(1,1),(2,3),(5,5),(8,-1),(5,1)}     \end{tikzpicture}     \end{document}      The output figure is as follows: ![enter image description here](http://i.stack.imgur.com/o94sH.png) Now I want to add an arrow at the end of the polygonal line. How could I modify the above command definiton for this? ![enter image description here](http://i.stack.imgur.com/LHQHK.png)


title: Page header with box sections & page border

text: So I'm currently working on converting some documents used in our university to use LaTeX, and I'm stuck on a bit of a hangup. I've been able to nail down all the basics, using plotting, etc; but I can't seem to figure out how I can re-create the headers and page look. Here's an example of the header on the title page (the upper section will be present throughout the doc): ![](http://i.stack.imgur.com/IPe3C.png) I've been able to create the page border with pgfpages, but I cant seem to make the coherent page table show up and work. Is this stuff even possible with LaTeX?


title: Alignment of Arabic transcriptions - ʾ and ʿ

text: When typesetting linguistic examples with transcriptions of the Arabic letters _hamza_ and _ayn_ , ʾ and ʿ respectively, the alignment with the literal translation on the line below looks awkward. See example (1). This also goes for lists and tabular environments. The alignment in Table 1 is not nice. A way to remedy this is to use `\llap{ʾ}` to push this character to the left and making the word align with the second character. This gives the much better looking (in my opinion) example (2) and Table 2. Now to my question. Is there a way to automate this? I want two character, ʾ and ʿ to become `\llap{ʾ}` and `\llap{ʿ}` when preceded by a space (and if possible also by the tab character) in certain environments, primarily `example`. This solution would work for tables by adding a space before the items, as in the code fore Table 1. I figure it would be possible to activate these characters. (As far as I understand is possible to activate Unicode characters in XeLaTeX, which is what I am using.) I know about `\@ifnextchar`, but what would be needed here is something like `\@ifprevchar`. EDIT: I need a solution in which I can put individual words in the example transcription in environments, e.g. `\textbf{}`.               \documentclass{article}     \usepackage{fontspec}     %\usepackage[utf8]{inputenc}     \usepackage{array}          \usepackage{covington}               \begin{document}               \begin{example}     \gll bi-lātīk ʾanā ʾaktub ʾaḥla nuṣūṣ     with-latex I write prittyest texts     \glt `With \LaTeX{} I can write the prettiest texts.'     \glend     \end{example}          \begin{example}     \gll bi-lātīk \llap{ʾ}anā \llap{ʾ}aktub \llap{ʾ}aḥla nuṣūṣ     with-latex I write prittyest texts     \glt `With \LaTeX{} I can write the prettiest texts.'     \glend     \end{example}          \begin{table}[h!]     \centering     \caption{Ugly alignment}     \begin{tabular}{>{\itshape}ll}      ʾanna & comp.\\      ʾinna & `verily'\\      lākinna & `but'\\      laʿalla & `perhaps'\\      layta & `if only'\\     \end{tabular}     \end{table}               \begin{table}[h!]     \centering     \caption{Nice alignment}     \begin{tabular}{>{\itshape}ll}     \llap{ʾ}anna & comp.\\     \llap{ʾ}inna & `verily'\\     lākinna & `but'\\     laʿalla & `perhaps'\\     layta & `if only'\\     \end{tabular}     \end{table}          \end{document}      ![enter image description here](http://i.stack.imgur.com/o8mGk.gif)


title: Error while printing chinese character

text: I am printing a document with Chinese and getting some errors. Below is a MWE with the character causing problems.               \documentclass[11pt,table,a5paper]{article}     \usepackage[T1,T2A]{fontenc}     \usepackage{CJKutf8}     \usepackage[english,russian]{babel}     \begin{document}     \begin{CJK*}{UTF8}{gbsn}      塞     \end{CJK*}{UTF8}{gbsn}     \end{document}      This is the error message:               Error:     ! Font C70/gbsn/m/n/10.95/f9=gbsnuf9 at 10.95pt not loadable: Metric (TFM) file      not found.     <to be read again>                         relax       How can I fix this problem?


title: Not include listing in list of listing

text: I would not add to list of listing some of my listings. For example I import my `matlab` file through `\lstinputlisting`. What command I should use to not add that code to list of listing?


title: Represent an arc over letters

text: I want to have a flat arc over some letters. How is it possible?               \documentclass{article}     \usepackage{graphicx,amsmath}     \newcommand\bigfrown[2][\textstyle]{\ensuremath{%       \array[b]{c}\text{\scalebox{2.4}{$#1\frown$}}\\[-1.3ex]#1#2\endarray}}          \begin{document}          \bigfrown{PQR}              \end{document}


title: Heatmap over country like Google Map

text: Is there a way to make a map similar to Google Map heatmap/marker cluster? I know that I can put in a picture, but I just want to make sure whether there is any alternative in LaTeX. ![enter image description here](http://i.stack.imgur.com/6c7ks.png)


title: Times New Roman font with TeXnicCenter

text: I'm new to LaTeX and trying to write my rapport with TeXnicCenter. I want to use the times new roman font, but i don't know why it does not works with me. This the beginning of my code :               \documentclass[12pt,french]{report}     \usepackage{times}     \usepackage[T1]{fontenc}     \usepackage[utf8]{luainputenc}     \usepackage[a4paper]{geometry}     \usepackage{minitoc}     \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=3cm,rmargin=3cm}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \setlength{\parskip}{\smallskipamount}     \setlength{\parindent}{0pt}     \usepackage{float}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{nomencl}     % the following is useful when we have the old nomencl.sty package     \providecommand{\printnomenclature}{\printglossary}     \providecommand{\makenomenclature}{\makeglossary}     \makenomenclature     \onehalfspacing          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{t1enc}% un second package     \usepackage[francais]{babel}     % un troisième package     \usepackage{layout}     \usepackage[Lenny]{fncychap}     \usepackage{fancyhdr}     \usepackage[section]{placeins}     \usepackage{lettrine}           \floatstyle{boxed}     \title{Rapport de Projet De Fin D'Études}     \author{Amina GHABRI}     \usepackage{palatino}%police     \renewcommand{\baselinestretch}{1.5}          \AtBeginDocument{       \def\labelitemi{\normalfont\bfseries{--}}     }                    \usepackage{babel}               \addto\extrasfrench{%        \providecommand{\og}{\leavevmode\flqq~}%        \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%     }          \pagestyle{fancy}     \fancyhf{}     \fancyhead[LE,RO]{\leftmark}     \fancyhead[RE,LO]{\ }     \fancyfoot[CE,CO]{\thepage}     \fancyfoot[RE,LO]{\ }          \renewcommand{\headrulewidth}{1pt}     \renewcommand{\footrulewidth}{1pt}                         \usepackage{babel}          \addto\extrasfrench{%        \providecommand{\og}{\leavevmode\flqq~}%        \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%     }                         \makeatother          \usepackage{babel}     \makeatletter     \addto\extrasfrench{%        \providecommand{\og}{\leavevmode\flqq~}%        \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%     }     \rmfamily     \makeatother          \begin{document}     \maketitle      \dominitoc\tableofcontents{}\listoffigures          \listoftables          \chapter{Présenation du projet}     \label{sec:PrésenationDuProjet}      And this is what i'm getting : ![enter image description here](http://i.stack.imgur.com/vMQ5v.png)


title: How to paste a line break into the find box

text: This is a very, very simple question, but I can't seem to find an answer anywhere. I pasted a document from Word into TeXnicCenter. The tabs copied over nicely, and I can paste those into the find feature, and it works just fine. What I want to do is replace all of the tabs with line breaks. However, for the life of me I can't figure out how to put a line break (like just hitting the enter key) in the "Replace with" box. I want to avoid code like \newline. Thanks!


title: Compact block matrix

text: I'm trying to create a block matrix and surely there are hundreds of question about those already. But most of what I read so far, seems quite hackish in the end. What I have is:               \documentclass{article}          \usepackage[fleqn]{amsmath}     \usepackage{blkarray}     \usepackage{multirow}     \usepackage{mathtools}     \usepackage{graphicx}     \newcommand{\rdots}{\hspace{.2ex}\raisebox{1ex}{\rotatebox{-12}{$\ddots$}}}          \begin{document}          \begin{equation}         \begin{blockarray}{(c@{}c@{}c|c@{}c@{}c)l}             1&&0&\BAmulticolumn{3}{c}{\multirow{3}{*}{\huge$0$}}&\multirow{3}{*}{$\dim F\;\text{vertical}$}\\&\rdots&&&&&\\0&&1&&&&\\             \cline{1-6}             \BAmulticolumn{3}{c|}{\multirow{3}{*}{\huge$0$}}&\tfrac{1}{t}&&0&\multirow{3}{*}{$\dim Z\;\text{horizontal}$}\\&&&&\rdots&&\\&&&0&&\tfrac{1}{t}&\\         \end{blockarray}     \end{equation}          \end{document}      ![current output](http://i.stack.imgur.com/oVBdN.png) There are a lot of bits, that could be improved, but most importantly the spacing in the submatrices is too wide. I also tried to enclose things that occur multiple times in macros               \newcommand\zeroblock[3][]{\BAmulticolumn{#2}{c#1}{\multirow{#3}{*}{\huge$0$}}}          \newcommand\position[3]{\mspace{#1}\raisebox{#2}{$\mathclap{#3}$}}     \newcommand\diagonal[1]{\begin{matrix}#1&\position{-8mu}{-2em}{\rdots}\scalebox{1.5}{0}\\\scalebox{1.5}{0}&#1\end{matrix}}          \begin{document}          \begin{equation}         \begin{array}{c|c}             \diagonal{1}&\zeroblock33\\             \zeroblock33&\diagonal{\tfrac{1}{t}}         \end{array}     \end{equation}      but `\zeroblock` gives me               ! Misplaced \omit.     \multispan ->\omit                         \@multispan      l.18        \diagonal{1}&\zeroblock33                                     \\      and `diagonal`, while it works inside of `array`, does not work in `blockarray` and gives               ! Incompatible list can't be unboxed.     <argument> \BA@first@box       Also it does not look good: ![output of <code>\\diagonal{1}</code>](http://i.stack.imgur.com/X1clv.png) So I was thinking, that certainly there must be a better way to do these things. Is there?


title: How to draw forms using TikZ

text: How to draw something like this using TikZ please? ![enter image description here](http://i.stack.imgur.com/kyZA7.png) So I'm trying here to draw one cercle related to two lines which are related to one rectangle, with the preservation of the white colors (noncontinuous lines). Any brilliant proposition, please? Thanks a lot!


title: vectorized pdf in latex : i can't see the letters/numbers

text: Here is a screenshot when I compile my latex file with a pdf graphic from Mathematica : ![http://i.stack.imgur.com/srC6h.png](http://i.stack.imgur.com/srC6h.png) Symbol or sign are ok but i can't see any letter or number, why?


title: Is it possible to have a footnote in rotated material?

text: I'd like to have a footnote in a rotated material but each solution I tried (with `\rotatebox` from `graphicx` package, `rotate` environment from `isorot` or `rotating` packages, etc.) fails: the footnote mark is as expected but the footnote text (that I'd like not rotated and located, as usual, at the bottom of the page) isn't displayed. The following MWE shows the trouble.               \documentclass{article}     \usepackage{rotating}     \begin{document}     \begin{rotate}{90}       Foo\footnote{Bar.}.     \end{rotate}     \end{document}      I guess this is related to an underlying box for the rotated material. But, anyway, is it possible to have a footnote in rotated material?


title: Font switch in ConTeXt mkiv

text: I am struggling to switch the fonts in ConTeXt accordingly and feel that I am missing something basic. I try to mimic               \RequirePackage{fontspec}          % Use Neo Euler as math font     \RequirePackage[vargreek-shape=TeX]{unicode-math}%      \setmathfont{Asana Math}%     % Use the Palatino-Clone Tex Gyre Pagella as main font     \setmainfont[Ligatures=TeX, Numbers=OldStyle]{Tex Gyre Pagella}%     % Use Tex Gyre Cursor as Monospace Font     \setmonofont{Tex Gyre Cursor}%     % Use Tex Gyre Heros Cn as Sans Serif Font     \setsansfont{Tex Gyre Heros}%     % fontsize is 10pt, 13pt for book and 12pt, 15pt for handout     \renewcommand{\normalsize}{\fontsize{10pt}{13pt}\selectfont}%     % fontsize is 10pt, 13pt for book and 9pt, 11pt for kindle     \renewcommand{\footnotesize}{\fontsize{8pt}{10pt}\selectfont}%      which works fine in a LuaLaTeX file. My best try so far is               %setup the fonts     \usemodule[simplefonts]      \definefontfeature[default][default][onum=yes]     %     \setmathfont[Asana Math]%     % Use the Palatino-Clone Tex Gyre Pagella as main font     \setmainfont[Tex Gyre Pagella]%     % Use Tex Gyre Cursor as Monospace Font     \setmonofont[Tex Gyre Cursor]%     % Use Tex Gyre Heros Cn as Sans Serif Font     \setsansfont[Tex Gyre Heros]%     \setupbodyfont[TeX Gyre Pagella,10pt]          \definebodyfontenvironment [10pt] [a=16pt]          \starttext     italic but not math \it mathmode 123          $123 mathmode$          \tfa Big     \stoptext      I know that a couple of things go wrong here. My question is now: What is best practice in context? I feel that I am mixing `simplefonts` macros (`setmainfont`) with `context-core` ones (`\setupbodyfont[TeX Gyre Pagella,10pt]`). Could someone clarify if I have to use different `simplefonts` macros for e.g. fontsize? Do I have to decide, either only `context-core` or `simplefonts`. And which one is recommended?


title: New command for a height-flexible rect

text: I'm trying to create a command that will take in one argument and create a rectangle around that number of empty lines. I have the following:               \newcommand{\putansbox}[1]{      \framebox[\textwidth]{         \vspace{\the\baselineskip}      }     }      It only creates one line though. How can I use the `#1` in here?


title: etoc and memoir compatibility isuues

text: I was just doing some test with the `etoc` package and as soon as I changed the document class from `book` to `memoir`, errors appeared. This simple document               %\documentclass{book}     \documentclass{memoir}     \usepackage{etoc}          \begin{document}          \tableofcontents     \chapter{A test chapter}          \end{document}      triggers the error message               ! Undefined control sequence.     <argument> \if@cftnctoc                              \else \renewcommand *\etocstandarddisplaystyle {\eto...     l.1150      }      which indicates that `\if@cftnctoc` is not defined. I checked the code for `etoc` and in lines 1106 to 1124 (one can also see this in the page 88 of the package documentation), there are two uses of this command, but I couldn't figure out what the problem really was. The `etoc` documentation mentions that the package is compatible with `memoir`, so I am lost. Am I missing something? Edit: this appears in the _Foreword_ of `etoc`'s documentation: > `etoc` appears to be (at least partially) compatible with the `article`, > `book`, `report`, `scrartcl`, `scrbook`, `scrreprt` and `memoir` classes. > Starting with release 1.07k it is possible to use `etoc` concurrently with > package `tocloft`.


title: Is there a modern equivalent to the midfloat package?

text: The package claims to do the wonder of placing a one-column text in a two- column document, without ejecting the page. This seems to work, but breaks when I try to place a figure within the `strip` environment (in an `sigplanconf.cls` style sheet.) I am aware of the `multicol` package, but it does not like figures in it.


title: biblatex multiple sourcemap : add field to entry

text: I am trying to add a field to biblatex entries in the `tex`file. I am currently not able to apply a rule to one entry then apply it other rules to other entries. I defined a command to add a field. Something is wrong with it but I don't know what it is:               \newcommand{\addnotetoentry}[2]{%       \DeclareSourcemap{%       \maps[datatype=bibtex]{%         \map[overwrite]{%           \step[fieldsource=entrykey,match=\regexp{^#1$},final]%           \step[fieldset=note,fieldvalue={#2}]%         }%       }%     }%     }      Which is used like this:               \addnotetoentry{a}{one note --- hello my friend}     \addnotetoentry{b}{another note}      MWE:               \documentclass[12pt,letterpaper]{article}     \usepackage[backend=biber,style=alphabetic-verb,doi=false,eprint=false]{biblatex}     \usepackage{filecontents}          \begin{filecontents}{jobname.bib}     @ARTICLE{a,        author = {Doe, J.},        title = {The Title},        journal = {The Journal},     }     @ARTICLE{b,        author = {Smith, J.},        title = {The New Title},        journal = {The Same Journal},     }     \end{filecontents}     \addbibresource{jobname.bib}          \newcommand{\addnotetoentry}[2]{%       \DeclareSourcemap{%       \maps[datatype=bibtex]{%         \map[overwrite]{%           \step[fieldsource=entrykey,match=\regexp{^#1$},final]%           \step[fieldset=note,fieldvalue={#2}]%         }%       }%     }%     }     \addnotetoentry{a}{one note}     \addnotetoentry{b}{another note}     \AtEveryBibitem{\printfield{note}\clearfield{note}\item}          \begin{document}          \nocite{*}     \printbibliography     \end{document}      I get in the ouput's references only one note (the last one that I defined): ![buggy output](http://i.stack.imgur.com/KtbGT.jpg)


title: Can I install new packages for texlive

text: It seems that I can not do anything to update this outdated TeXlive+Kile system.               ********:~/TeX$ texhash     texhash: /usr/local/share/texmf/ls-R: no write permission. Skipping...     texhash: /var/lib/texmf/ls-R-TEXMFMAIN: no write permission. Skipping...     texhash: /var/lib/texmf/ls-R-TEXLIVE: no write permission. Skipping...     texhash: /var/lib/texmf/ls-R: no write permission. Skipping...     texhash: Done.


title: splitting middle equation of 2 rows

text: I have a very long equation which does not fit on the page and I am wondering if anybody can help me to align it properly.               \begin{align*}     &(q^1+q^3+q^5+q^7)(q^2+q^4+q^6+q^8) \\      &=q^{1+2}+q^{1+4}+q^{1+6}+q^{1+8}+q^{3+2}+q^{3+4}+q^{3+6}+q^{3+8}+q^{5+2}+q^{5+4}+q^{5+6}+q^{5+8}+q^{7+2}+q^{7+4}+q^{7+6}+q^{7+8} \\     &=q^3+2q^5+3q^7+4q^9+3q^{11}+2q^{13}+q^{15}     \end{align*}      It would be nice if the helpful if the last line was numbered like other equations but not essential.


title: How to change the order in new commands

text: Being quite an amateur to LaTeX, I am sorry, I don't know how to ask my question without telling the whole story: In a large document, I made a rather simple command for citing (Classical Latin) authors following other conventions than I use for citing modern authors (where I use BibTeX, etc.). This is the command I use:               \newcommand{\citeCL}[3]{#1, \emph{#2}, \textbf{#3}}     %\citeCL{author}{text}{chapter}      As the first two arguments I use yet other commands from a list of author names and text titles (as I use every name several times and may be inconsistent if writing it in full every time), e.g.,               \newcommand{\Per}{N. Per.}     \newcommand{\PerRud}{Rud. gram.}      Within the document, I could call the cite command thus:               \citeCL{\Per}{\PerRud}{1117}      This cite command I use both in footnotes and in this quotation environment:               \newcommand{\QuoteCL}[4]{     \vspace{5pt}     \begin{quote}\itemsep1pt\parskip0pt\parsep0pt\begin{spacing}{1}     #4 \par\hspace*{\fill}\footnotesize{\citeCL{#1}{#2}{#3}}     \end{spacing}     \end{quote}     \vspace{-20pt}     }      In the document I call the command with the same three arguments as for the `\citeCL`, and additionally the text to quote, e.g.,               \QuoteCL{\Per}{\PerRud}{§ 1119}{Quis maxime proponendus est quem studeant adolescentes imitari? Marcus Cicero.}      All this works fine, and I have used it throughout my thesis. Now I wish to differ between the ways the author names and titles are written in footnotes and in quotations, using the abbreviated form in footnotes and a new, long form in quotations. My intuitive, naive approach was this:               \newcommand{\citeCL}[3]{#1, \emph{#2}, \textbf{#3}}     % Original command now used for footnotes          \newcommand{\citeCLLong}[3]{#1Long, \emph{#2Long}, \textbf{#3}}     % New command to be called by the \quoteCL command.          \newcommand{\Per}{N. Per.}     \newcommand{\PerLong}{Niccolò Perotti}     \newcommand{\PerRud}{Rud. gram.}     \newcommand{\PerRudLong}{Rudimenta grammatices}     % Duplicating the list of names and titles, adding a long version to be called by the \citeCLLong:          \newcommand{\QuoteCL}[4]{     \vspace{5pt}     \begin{quote}\itemsep1pt\parskip0pt\parsep0pt\begin{spacing}{1}     #4 \par\hspace*{\fill}\footnotesize{\citeCLLong{#1}{#2}{#3}}     \end{spacing}     \end{quote}     \vspace{-20pt}     }     % The command is changed to call the new \citeCLLong          \begin{document}     \QuoteCL{\Per}{\PerRud}{§ 1119}{Quis maxime proponendus est quem studeant adolescentes imitari? Marcus Cicero.}     \end{document}      Now to my question: I was hoping that adding `Long` to the arguments in `\citeCLLong` (`#1Long, \emph{#2Long}`) would make LaTeX choose, e.g., `\PerLong` instead of merely `\Per` from my author list, even though I call the `\quoteCL` command with the argument `\Per`. That the `Long` part would be added before it is decided whether to read `\Per` or `\PerLong`. But it writes, e.g., "N. Per.Long" instead of choosing `\PerLong` = "Niccolò Perotti". Can this be done somehow, or is there any other, smarter solution, that does not need me to go through my entire thesis changing all arguments in all quotations, but make it possible to control from the preample? And that lets my citations in footnotes stay the same, original form?


title: Custom label for chemical structures

text: I need a custom label for my chemical structures and everything works fine but the label isn't centered. Does anyone know how to center the label?               \documentclass{minimal}     \usepackage{hyperref}          \makeatletter     \newcounter{chem}     \addtocounter{chem}{1}     \newcommand{\chemlabel}[1]{%       \hypertarget{#1}{\textbf{\number\value{chem}}}        \protected@write\@auxout{}{\string\newlabel {#1}        {{\number\value{chem}}{\thepage}{\number\value{chem}}{#1}{}}}%        \refstepcounter{chem}      }     \makeatother          \usepackage{chemfig}     \begin{document}          \chemname{\chemfig{*6(-=-=-=)}}{Benzen}     \chemname{\chemfig{*6(-=-=-=)}}{\chemlabel{str:benzen}}     \chemname{\chemfig{*6(-=-=-=)}}{\chemlabel{str:benzen1}}     \chemname{\chemfig{*6(-=-=-=)}}{\chemlabel{str:benzen2}}     \chemname{\chemfig{*6(-=-=-=)}}{\chemlabel{str:benzen3}}               \end{document}       ![](http://i.stack.imgur.com/NYl2E.png)


title: Changing Number Font Into Sans Serif

text: I want to use **Libertine Sans Serif** **numbers** (only numbers) in math font. Can i get this result using a command like this:                   \DeclareSymbolFont{numbers}{T1}{libertine}{m}{n}         \SetSymbolFont{numbers}{bold}{T1}{libertine}{bx}{n}         \DeclareMathSymbol{0}\mathalpha{numbers}{"30}         \DeclareMathSymbol{1}\mathalpha{numbers}{"31}         .         .      Example:               \documentclass[11pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{libertine}     \renewcommand*\familydefault{\sfdefault}      \usepackage[libertine,liby,libaltvw,vvarbb]{newtxmath}     \usepackage[T1]{fontenc}          %\DeclareSymbolFont{numbers}{T1}{libertine-SF}{m}{n}     %\SetSymbolFont{numbers}{bold}{T1}{libertine-SF}{bx}{n}     %\DeclareMathSymbol{0}\mathalpha{numbers}{"30}     %\DeclareMathSymbol{1}\mathalpha{numbers}{"31}     %\DeclareMathSymbol{2}\mathalpha{numbers}{"32}     %\DeclareMathSymbol{3}\mathalpha{numbers}{"33}     %\DeclareMathSymbol{4}\mathalpha{numbers}{"34}     %\DeclareMathSymbol{5}\mathalpha{numbers}{"35}     %\DeclareMathSymbol{6}\mathalpha{numbers}{"36}     %\DeclareMathSymbol{7}\mathalpha{numbers}{"37}     %\DeclareMathSymbol{8}\mathalpha{numbers}{"38}     %\DeclareMathSymbol{9}\mathalpha{numbers}{"39}          \begin{document}          \noindent 1234567890 TEXT\\     $1234567890$ MATH\\     is it possible to make numbers in math as in text.          \end{document}


title: How to decrease the file size of pdf with a lot of (clipped and downscaled) png images

text: I am writing a report that includes a results section with a lot of generated images. These images are .png files. Judging by the file size of the resulting pdf, these images are included in their entirety, even when they are resized and clipped (trimmed). An image of 4MB will increase the size of the resulting pdf by about 4MB, regardless of the fact that I only show half of the image and the image is greatly downscaled. I'm using:               \includegraphics[keepaspectratio,%         width=0.5\linewidth,height=6cm,%         clip,trim=700 0 700 300]         {../results/img01.png}      In my case, this leads to a pdf that is over 100MB. **How can I tell LaTeX to compress the images or discard the parts that are not shown?** I know I can print it afterwards with a pdf-printer and it will reduce the file size to about 20MB (which is a lot smaller than 100MB) but I would rather not have this intermediate step. Why can't pdfLaTeX reduce this file size too?


title: Landscaped Longtables

text: I am currently using the `longtable` environment, but I would like to change the orientation of the table and make it landscape. Using the `lscape` environment I am only able to modify the orientation of the page, rather than that of the table itself. Could you help me please? In the preamble:               \usepackage{longtable}      \usepackage{lscape}      Then the syntax to insert a longtable:                \begin{document}      \begin{landscape}      \begin{center}      \scriptsize      \begin{longtable}{|p{2cm}|p{4cm}|p{8cm}|}\hline\hline      \multicolumn{1}{|p{2cm}|}{\textbf{Text1}} &      \multicolumn{1}{p{4cm}|}{\textbf{Text2}} &      \multicolumn{1}{p{8cm}|}{\textbf{Text3}}\\ \hline       \endfirsthead          \multicolumn{3}{p{3cm}}     {{\bfseries \tablename\ \thetable{} -- continued from previous page}}\\       \hline\multicolumn{1}{|p{2cm}|}{\textbf{Text1}} &      \multicolumn{1}{p{4cm}|}{\textbf{Text2}} &      \multicolumn{1}{p{8cm}|}{\textbf{Text3}}\\\hline       \endhead          \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline     \caption[Caption]{Caption}\label{label-caption}      \endfoot     \caption[Caption]{Caption}\label{label-caption}      \endlastfoot          \end{longtable}     \end{center}     \end{landscape}     \end{document}


title: Insert the content of the annote field using new \citexxx and \newcommand

text: I am new to TeX (MacTeX 2011, with XeLaTeX and BibDesk / BibTeX). In parts I found this answer to my question - but it is not what I want : Get the "annote" field of a bibtex file I look for a way to insert the content of my annote field in direct quotes.   1. I like to have a new command like `\annotecite`.   2. it should insert the content of the `annote` filed in the text.   3. it should not modify the existing citations, like change the counts of citations and so on.   4. it should not use `biblatex`, `jurabib` and so on - the citation styles are ok as they are and I want only to insert the content of the field (also if I change the style).


title: bibtex: author and editor inbook

text: In the .bst file, the `inbook` function looks like this:               FUNCTION {inbook}     { output.bibitem       author empty$         { format.editors "author and editor" output.check         }         { format.authors output.nonnull           crossref missing$             { "author and editor" editor either.or.check }             'skip$           if$         }       if$       new.block       format.btitle "title" output.check       crossref missing$         { format.in.ed.booktitle "booktitle" output.check          format.bvolume output               format.chapter.pages "chapter and pages" output.check           new.block           format.number.series output           new.sentence           format.publisher.address output         }         {           format.chapter.pages "chapter and pages" output.check           new.block           format.book.crossref output.nonnull         }       if$       format.edition output       format.date "year" output.check       new.block       format.note output       fin.entry     }      and produces a `can't use both editor and author fields` error. However, for `inproceedings` it's fine:               FUNCTION {inproceedings}     { output.bibitem       format.authors "author" output.check       new.block       format.title "title" output.check       new.block       crossref missing$         { format.in.ed.booktitle "booktitle" output.check           format.bvolume output           format.number.series output           format.pages output           new.sentence           publisher empty$             { format.organization.address output }             { organization "organization" bibinfo.check output               format.publisher.address output             }           if$           format.date "year" output.check         }         { format.incoll.inproc.crossref output.nonnull           format.pages output         }       if$       new.block       format.note output       fin.entry     }      Does somebody know how to fix the `ìnbook` entry?


title: Decorative hook or symbol before chapter (or section) title

text: I'm writing my PhD thesis in latex and learned a lot from this forum. However, I could not find an answer to the question how do I put an decorative hook before the chapter title. I think that it looks rather nice to have this but thats personal.


title: Latex Beamer - Toc too long

text: I'm preparing for a master thesis defense... but my presentation is getting a bit lengthy... ...anyways when the ToC gets too long on the side it stretches over. See attached image. Any good advise on how to fix that? ![screenshoft_of_the_presentation_notice_the_overlap_on_the_left](http://i.stack.imgur.com/wwi0f.png)               \documentclass{beamer}          \usepackage[ngerman, english]{babel} % Deutsch or English     \usepackage[utf8x]{inputenc} %coding utf8     \usepackage{amsmath,amsfonts,amssymb} %Math symbols     \usepackage{lmodern} % For arbitrary font sizes     \usepackage{pgf} %for logo     \usepackage{etex} %More Registers - against no room for \dimen     \usepackage{graphicx} %for images          \include{physcommand} % my own physics commands     \include{tikz} % Tikz Commands          \usetheme{Berkeley} %general theme     \usecolortheme{default} %color     \usefonttheme{professionalfonts} %font     \useinnertheme{default} %header, footer, sidebar : circles | default | inmargin | rectangles | rounded     \useoutertheme{default} %slide size and element position:   default | infolines | miniframes |  shadow | sidebar | smoothbars | smoothtree | split | tree     \setbeamerfont{page number in head/foot}{size=\large} %Make Slide Number large     \setbeamertemplate{footline}[frame number] % Show Slide Number     \setbeamertemplate{bibliography item}{[\theenumiv]} % Fix References Numbers     \beamertemplatenavigationsymbolsempty % No Navigation in lower right               \title[BCFW For Loop-Level]{BCFW Recursion Relations At Loop-Level} %title     \subtitle[Yang-Mills]{For Yang Mills Theory} %subtitle     \author[H. Hanssen]{Master Thesis Defense} %author     \institute[ T2 -- UHH]{Henrik Hanssen \\[.25cm] II. Institut für Theoretische Physik \\ Universität Hamburg} %Institute     \date[01/10/14]{October 1st 2014} %date     \logo{\pgfimage[width=1cm,height=1cm]{uhh_logo}} %uhh logo     \subject{BCFW for loops}          %\frame[Overlay-Aktionen][Optionen]{Titel}{Untertitel}          \AtBeginSection{\frame{\sectionpage}} % Adds Section Title Pages     \AtBeginSubsection{\frame{\subsectionpage}} % Adds Section Title Pages


title: Hyphenation, long words, linebreaks and extdash

text: Currently I am using LaTeX to write a document in German (= containing many long words). Sometimes, I wish to place a hyphen at the end of the word. For example:               Averylongword-, Anotherverylongword- and Yetanotherverylongword      This causes LaTeX to avoid hyphenation inside the first two words resulting in words exceeding the page border. To fix this, I loaded the extdash package which provides the shortcut `\\-/` allowing "hyphenation of compound words":               Averylongword\-/, Anotherverylongword\-/ and Yetanotherverylongword      Now, the words are hyphenated correctly. However, the usage of `\\-/` introduces another issue: Sometimes, a word ending on `\\-/,` is placed as the last word of a page but the comma transfers to the following page resulting in:               Averyongword-          [pagebreak]          , Anotherverylongword- and Yetanotherverylongword      How can I solve this issue and make the comma "stick" to the end of the word?


title: text over figure in latex

text: I just need to insert a figure in the latex document I am writing -nothing big.Problem is the text keeps floating over the figure and the figure is not centered.Here is my code               \begin{figure}[h!]     \begin{center}     \resizebox{20pt}{!}{\includegraphics{FigureStereo.jpg}}     \caption{Epipolar Geometry}     \label{fig:cclogo}     \end{center}     \end{figure}


title: Define a Macro via Macro if Given Macro is not defined

text: I want to define a macro if it is not already defined. I can do this inline as the example below shows. But I would like to have a macro to do this functionality for me. My attempt to make this work is `DefineMacroIfUndefined`, but not sure how to adjust it to make it work. I have commented out the call to `DefineMacroIfUndefined` as this does not compile otherwise.               \documentclass{article}          \newcommand{\CheckIfCommandDefined}{         \ifdefined\MyNewCommand             MyNewCommand is defined.\par%         \else             MyNewCommand is not defined.\par%         \fi     }          % Define macro to the given value if not already defined     \newcommand{\DefineMacroIfUndefined}[2]{     % #1 is name of macro     % #2 is value to be assigned if this macros is not already defined.     \ifdefined\csname#1\endcsname         % Do nothing since it is already defined     \else         \newcommand{\csname#1\endcsname}{#2}     \fi     }          \begin{document}          % This works great.     \ifdefined\MyNewCommand         % Do nothing since it is already defined     \else         \newcommand{\MyNewCommand}{true}     \fi          \CheckIfCommandDefined     \let\MyNewCommand\undefined % Undefine \MyNewCommand          \CheckIfCommandDefined     % But want to be able to do the above thru a macro     %\DefineMacroIfUndefined{MyNewCommand}{true}     \CheckIfCommandDefined          \end{document}


title: Show current section or chapter in header in ConTeXt

text: I've found this command:               \setupheadertexts[][{\getmarking[sectionnumber]\ \getmarking[section]}]      to show the current section in the header. But how can I show either the current chapter or the current section in the header depending on the fact the current page already belongs to a section or not?


title: Elsevier `elsart`/`elsart3p` incompatibility with `algorithmic`

text: Stuggling with the following problem for a small while and am stumped. I'm using the the `elsart3p.cls` document class, but it seems not to work well with the `algorithmic` package. Here's a minimal working example:               \documentclass{elsart3p} %also doesn't work with elsart     \usepackage{algorithmic}     \usepackage{algorithm}          \begin{document}          \begin{algorithm}[ht]     \begin{algorithmic}[1]     \REQUIRE help?     \end{algorithmic}     \caption{Algorithm}     \label{alg:test}     \end{algorithm}          \end{document}      When compiling using `latex` or `pdflatex`, I get a single error (per `\begin{algorithmic}` for each algorithm):               LaTeX Error: Command \AND already defined      ...but the output looks okay. Usually I wouldn't mind too much, but I'll be passing on sources. Anyone got any ideas for a workaround? I have a good few algorithms, so not keen on moving to another package (plus, I was never a big fan of algorithmic2e... too many braces give me vertigo). I know this question isn't exactly blockbuster Hollywood material, but any help much appreciated!


title: Questions about pgfmath

text: \pgfkeys{/pgf/fpu}           \pgfmathsetlengthmacro\x{5^2}     \show\x -> 25.0pt % OK, thanks.          \pgfmathparse{5cm^2}        1. What is the meaning of `]` in the following?              \show\pgfmathresult % ->1Y2.0238983e4].          \pgfkeys{/pgf/fpu/output format=sci}      gives the expected format, but what is the cryptic `]`?   2. Why does this fail? Is unit not allowed in `{<expr>}`? The manual says `\pgfmathsetlengthmacro` "defines `<macro>` as the value of `<expression>` in points."              \pgfmathsetlengthmacro\y{5cm^2} % ! Illegal unit.     \pgfmathsetlengthmacro\y{5^2cm} % ! Illegal unit.     \show\y      **EDIT** Here is a minimal example:               \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \pgfkeys{/pgf/fpu}     \pgfkeys{/pgf/fpu/output format=sci}     \pgfmathparse{5cm^2}     %\show\pgfmathresult % -> 2.0238983e4.          % Both of these give error:     \pgfmathsetlengthmacro\x{5mm^2}     \pgfmathsetlengthmacro\x{5^2}          \pgfkeys{/pgf/fpu=false}          \end{document}          Error msg:          ! Illegal unit of measure (pt inserted).     <to be read again>                        e     l.10 \pgfmathsetlengthmacro\x{5mm^2}


title: How to put two images side by side and put some symbol in the center?

text: I want to put two images side by side and put a comparison symbol in between them. Here is the tikz code :               \documentclass{article}          \usepackage{tikz}          \usepackage[margin=15mm]{geometry}          \usepackage{calc}          \usetikzlibrary{matrix,arrows}          \usetikzlibrary{positioning,arrows}          \usetikzlibrary{shapes,arrows,fit,calc,positioning,automata}          \begin{document}          \begin{tikzpicture}[node distance=5cm,auto,>=latex', scale = 0.75, transform shape]                \coordinate (a1) [] {};           \node[rectangle] (a) [draw,minimum width=2cm,minimum height=1cm, below of=a1,node distance=1.5cm] { };           \node[rectangle] (b) [draw,minimum width=2cm,minimum height=1cm, below of=a,node distance=2cm] { };           \coordinate[below=1cm of b] (b1)  {};           \path[->] (a)  edge node {{$\gamma$} } (b);           \path[->] (a1) edge node {{$\alpha.\beta$} } (a);           \path[->] (b)  edge node {{$\delta$} } (b1);     \end{tikzpicture}                \begin{tikzpicture}[node distance=5cm,auto,>=latex', scale = 0.75, transform shape]           \coordinate (a1) [] {};           \node[rectangle] (a) [draw,minimum width=4cm,minimum height=1cm, below of=a1,node distance=1.5cm] {};           \coordinate[below=1cm of a] (b1)  {};                \path[->] (a1) edge node {  $\alpha.\beta$ } (a);           \path[->] (a) edge node {  $\delta$ } (b1);           \end{tikzpicture}          \end{document}       I want to put these to images side by side with an equality symbol in between them. How do I do that?


title: float a wide ctabular in two columns

text: I have a very long table (slightly more than 2 pages) and so, am using the `ctabular` environment of the `memoir` class. I understand how a float defeats the purpose of a continuous tabular but I would like to mimic the behaviour of only starting at the top of the next page, or after the previous floats. Also, the table is quite wide (I would use `table*` environment) but the document is in two columns. `ctabular` doesn't seem to accept specifying the width. How can I make a wide continuous table and mimic the float choice of placement?


title: font name with a space, using XeLaTeX and fontspec

text: I use `XeLaTeX`, `amsmath`, `fontspec`, `unicode-math` and `standalone` to create a pdf containing one single equation which I then import to Inkscape for a poster. When using font names with a space in it, XeLaTeX finds the font, but in the resulting pdf the font name will be saved without the space, e.g. `Cambria Math` becomes `CambriaMath`. When opening the pdf in Inkscape, Inkscape will complain about a missing font, because Inkscape doesn't know `CambriaMath`, but only `Cambria Math`. How would I have to specify the font name in order to preserve the space character?   I tried some brackets, quotes, underscore, ... but could not find a solution. Here is a MWE:               % !TEX program = XeLaTeX     \documentclass{standalone}     \usepackage{amsmath}     \usepackage{fontspec}     \setmainfont{Rotis Serif Std}     \setsansfont{Rotis SemiSans Std}     \usepackage[]{unicode-math}     \unimathsetup{math-style=ISO}     \setmathfont{Cambria Math}     % ==== ==== ==== ====     \begin{document}     $\displaystyle       \mathrm{det}(J) =        \begin{vmatrix}         a & b & c \\         d & e & f \\         g & h & i       \end{vmatrix} =       aei+bfg+cdh-ceg-bdi-afh        $     \end{document}      PS: Inkscape offers to replace fonts by 'the most similar font', but that gives me some other trouble so I would prefer to not replace any fonts.


title: Decorate path with arrows at nodes

text: Standalone example:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{shapes}          \begin{document}     \begin{tikzpicture}       \draw[black, very thick] plot[smooth] coordinates {(4,1) (2,2) (1,3) (2,4) (4,3)};            \node[fill=green!60, inner sep=3pt, circle, draw] at (4, 1) {};       \node[fill=green!60, inner sep=3pt, circle, draw] at (2, 2) {};       \node[fill=green!60, inner sep=3pt, circle, draw] at (1, 3) {};       \node[fill=green!60, inner sep=3pt, circle, draw] at (2, 4) {};       \node[fill=green!60, inner sep=3pt, circle, draw] at (4, 3) {};     \end{tikzpicture}     \end{document}      Result: ![enter image description here](http://i.stack.imgur.com/NPDna.png) What I want: ![enter image description here](http://i.stack.imgur.com/SEhQT.png) I like to have arrows before each node point at the node on all nodes in the path. How do I achieve this?


title: algorithmicx package comments on a single line

text: Is it possible in `algorithmicx` package to have comments not aligned to the right side? For example I have code like this -               \begin{algorithm}[!ht]     \caption{My Algo.}     \label{myalgo}     \begin{algorithmic}          \State $\epsilon$ = 1.0;          \Comment{Explore Latency Dimension}     \While {explorationTime <= timeLimit}         \State $\epsilon$ = $\epsilon$ / 2;         \State calculateIncrements($\epsilon$);              \Comment{Explore L dimension}              \While {lQuery <= lUpperLimit}              \State Query (0, Query, bQuery, pQuery);              \If {result = WORKING}                  \State mark points                   \Comment{no need to explore more. we just want to stop over here.}                  \State Break              \Else                  \If {result = NOT WORKING}                     \State mark from 0 to lQuery as NOT WORKING.                  \EndIf              \EndIf                   \State lQuery += lEpsIncr;         \EndWhile     \EndWhile          \State $calcPoints()$          \end{algorithmic}     \end{algorithm}      So what is happening is that, the package everytime aligns the comments to the right side. But for this comment `\Comment{no need to explore more. we just want to stop over here.}`, I would like it to have it on single line rather than multiple lines and aligned to right. It becomes a little confusing for me. Is it possible that we can have comments like -               > no need to explore more. we just want to stop over here.     Break      It should be aligned at the indentation level of the statements.


title: scrlttr2 no firsthead

text: I am currently writing a job application using the scrlttr2 package. I am sending the application as a pdf file, so I really don't need the `\firsthead`, so I emptied it by using `\firsthead{}`. However, there is still a lot of blank space above the backadress. I know that this is needed for letters which are actually printed out and mailed, but since I am not mailing this letter I would like to remove that extra space. Is that possible using something like KOMAoptions or am I using the wrong `\documentclass`?


title: Rename sections with ngerman

text: I am searching for a possibility to rename sections. I am using the ngerman package. I have tried something similar to http://stackoverflow.com/questions/3125231/how-to-rename-sections-in-latex, with `\subsectionname`, but it doesn't work. With Google I can only find the constellation ngerman and babel. Thanks for any advices. EDIT:   So I am using babel again. Here is the mini example:               \documentclass{scrartcl}     \usepackage[ngerman]{babel}     \usepackage{hyperref}          \makeatletter     % Ändert den Style von paragraph ähnlich zu den von einen Unterkapitel     \renewcommand{\paragraph}{%         \@startsection{paragraph}{4}{\z@}%         {3.25ex \@plus1ex \@minus.2ex}%         {1ex \@plus .1ex}%         {\raggedsection\normalfont\sectfont\size@paragraph}%     }     % Ändert den Style von subparagraph ähnlich zu den von einen Unterkapitel     \renewcommand{\subparagraph}{%         \@startsection{subparagraph}{5}{\z@}%         {3.25ex \@plus1ex \@minus.2ex}%         {1ex \@plus .1ex}%         {\raggedsection\normalfont\sectfont\size@subparagraph}%     }     \makeatother          \setcounter{tocdepth}{5}     \setcounter{secnumdepth}{5}          \begin{document}          \section{Title}     \autoref{sec:label1}     \autoref{sec:label2}     \autoref{sec:label3}     \autoref{sec:label4}          \subsection{Subtitle}     \label{sec:label1}     \subsubsection{Another subtitle}     \label{sec:label2}     \paragraph{Paragraph}     \label{sec:label3}     \subparagraph{Subparagraph}     \label{sec:label4}     \end{document}      Label3 isn't really nice, because of the multiple **unter**. My idea is to replace them all with my own definition.


title: Biblatex: Removing underlining of journal title and enabling line break of it

text: I'd like to use authoryear-comp for my bibliography. However, I'd like to suppress underlining the journal title that seems to be set default. Also, I got the problem that a line break is not inserted into the journal title, so that the title extends beyond the border. Is there a way to change this? Here is an MWE:               \documentclass[12pt]{scrbook}     \usepackage[style=authoryear-comp, maxnames=1, doi=false, url=false, backend=bibtex8]{biblatex}     \bibliography{LitThesis}          \begin{document}     Here is my reference \parencite{Hummelen1997}.          \printbibliography          \end{document}      Bibtex code:               @ARTICLE{Hummelen1997,     author = {the author},     title = {the title},     journal = {Chemistry},     year = {1997},     volume = {3},     pages = {1489--1493},     number = {9},     month = {09}     }      So concerning the problem with the month I tried to do the following:               \usepackage[style=authoryear-comp, maxnames=1, doi=false, url=false, month=false, backend=bibtex8]{biblatex}      But I get an error because "month" is not recognized as a value. Is there a way to suppress showing the month in the bibliography?


title: License of the Minion Pro fonts that came with Adobe Reader

text: Adobe Reader comes bundled with an open type version of Minion Pro, Myriad Pro and some other fonts. What is the license status with these fonts? Can they be used freely?


title: Using datatool on files with lines breaks

text: I have a generated CSV file which has line breaks (newline characters) in values. They are properly quoted. When reading this data with `DTLloadrawdb` LaTeX complains as those line breaks still breaks the reading. The problem is that I do not know how could I fix this with `\DTLrawmap` (to change newlines into `\DTLpar`). Or is there some other way to fix it? I would like to not have to preprocess CSV files outside of LaTeX.


title: amsthm: what are the newtheoremstyle parameters for the default styles?

text: The package `amsthm` contains the predefined theorem styles `plain`, `definition` and `remark` which you can employ using `\theoremstyle` before your `\newtheorem`. You can also create new theorem styles like this: `\newtheoremstyle{NAME}{ABOVESPACE}{BELOWSPACE}{BODYFONT}{INDENT}{HEADFONT}{HEADPUNCT}{HEADSPACE}{CUSTOM- HEAD-SPEC}`. I.e. you have to set all properties of your new style at once. But I mostly like them as they are, I only want to change like 1 parameter. Therefore I'd like to know the `\newtheoremstyle` parameters which produce the predefined styles, so I can copy them and only change what I want. I would expect that information to be in the documentation of the package, but it isn't. Does anyone know what they are?


title: plus-minus symbol with parenthesis around the minus sign

text: I need one (or maybe two) LaTeX symbols that I don't find in the comprehensive list of symbols. The symbol is like the normal plus-minus sign `\pm`, but with parenthesis around the minus sign. Is such a symbol available somewhere? And if not, what is the best way to construct it from `(`, `\pm` and `)`? Preferably I would also want the opposite: `\mp` with parenthesis around the plus. Any ideas?


title: How to manage numbering in lineno package?

text: I use `classic thesis` for my thesis and I use the `lineno` package in order to present interviews I made. I use the following commands : `\begin{linenumbers}`and `\end{linenumbers}`between each interview. I have 6 interviews. For the moment, the numbering of the lines is continuous. But I would have a broken one. How could I do that : having the numbering of the lines of my interviews begin from the start for each interview ? This my MWE :               % book example for classicthesis.sty     \documentclass[11pt,a4paper,footinclude=true,headinclude=true]{scrbook} % KOMA-Script book     \usepackage[T1]{fontenc}            \usepackage[applemac]{inputenc}            \usepackage[frenchb]{babel}     \usepackage{setspace}      \usepackage{hyperref}      \usepackage{epigraph}      \usepackage{scrpage2}     \usepackage[tight,french]{minitoc}     \usepackage{apacite}     \usepackage{lipsum}     \usepackage[parts,pdfspacing,dottedtoc,eulerchapternumbers]{../classicthesis} % ,manychapters     %\usepackage[osf]{libertine}                              \renewcommand\textflush{flushright}                    \usepackage{etoolbox}     \makeatletter     \newlength\epitextskip     \pretocmd{\@epitext}{\em}{}{}     \apptocmd{\@epitext}{\em}{}{}     \patchcmd{\epigraph}{\@epitext{#1}\\}{\@epitext{#1}\\[\epitextskip]}{}{}     \makeatother          \setlength\epigraphrule{0pt}     \setlength\epitextskip{2ex}     \setlength\epigraphwidth{.8\textwidth}          \FrenchFootnotes     \usepackage{amsthm}     \usepackage{lineno}     \setcounter{tocdepth}{3}     \setcounter{secnumdepth}{3}     \AtBeginDocument{\renewcommand{\thepart}{\Roman{part}}}     \frontmatter          \begin{document}          %   \pagestyle{scrheadings}     %   \manualmark     %   \markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}     \pagestyle{scrheadings}     \tableofcontents          \clearpage                    \newpage     \pagenumbering{Roman}     \appendix     \renewcommand{\thesection}{\Alph{section}}      \setcounter{section}{0}     \addcontentsline{toc}{part}{Annexes}          \chapter{Entretiens cliniques}                    \section{Premier entretien}               \begin{linenumbers}     blablablabla     blablablabla     blablabla     blabla          bla     \end{linenumbers}          \begin{linenumbers}     blablablabla     blablablabla     blablabla     blabla          bla     \end{linenumbers}          \end{document}


title: Error typesetting large bracket with multiple lines

text: I was following a Wikibooks section to create multiple lines within a single large bracket. Something like this. The problem is that when I type in the given code, which is               \[      u(x) =       \begin{cases}        \exp{x} & \text{if } x \geq 0 \\        1       & \text{if } x < 0       \end{cases}     \]      I get the following error in my document:               Misplaced alignment tab character &.      Any idea what might be going wrong?


title: Switch twocolumn between right-to-left and left-to-right with the package multiind in polyglossia

text: Writing a book in arabic, I want to obtain a dictionnary of used words in my document between arabic and english, and want that the entries of the dictionnary will be in two different orders, in arabic alphabetic order and in english alphabetic order. My idea is to use the package multiind which produces several indexes, to produce two idx files `dic_english.idx` and `dic_arabic.idx`. The commands               \index{dic_english}{Random@\idxsechead{Random\hfill arabic_word}|idxnopage}       and               \index{dic_arabic}{arabic_word@\idxsechead{Random\hfill arabic_word}|idxnopage}      will produce these two files, the same files, in english order for the first and arabic order for the second. My problem is that the twocolumn command will produce columnation on the right for the two files (first column on the right and second on the left)... but I want to obtain the index in english order having the first column on the left and the second column on the right. Someone have some idea for this ?... Precisely, How can I obtain an index right-to-left and an index left-to-right in the same time? Thanks, Faouzi


title: Removing space before Section in Table of Contents when using Article

text: How can I remove the vertical spacing before each section in the table of contents from a 'article' documentclass?


title: Changing implementation of 'draft' option

text: In my lab we frequently make several drafts of documents before a final version. We will pass these draft version around for input from many people. It would be convenient to use the 'draft' option that many of the latex classes have, since it does some useful things, but this is impossible because it will always replace images with a framebox the size of the image and the name of the image in the box. Since much text in our docs is usually devoted to discussing those images (plots of data, analysis, etc), removing the images means that evaluating and improving any discussion of the content of an image is not possible, so we cannot use the `draft' option for draft versions. I've never really understood why draft versions will remove an image and replace it with a framebox. I've assumed it's a holdover from the days when putting an image in a dvi file for viewing was harder. But, today it seemed absurd, and I've decided to do something about it in the new version of a thesis class that I've written. The class is based on memoir, and I've looked at the memoir code and I can't figure out how it's removing the images when the draft option is called. I've concluded that it's not actually done in memoir, but is done is somewhere else, probably in the latex2e code itself. So, can anyone tell me how I can remove this functionality from the draft option? If the only way to do it is to hijack the draft option for my class, that's ok, but nothing I've tried works so far, like the answer I got in this question should work, but it doesn't. Apologies for the length of my question. _From reading the answers I see that I wasn't clear in my question. I want to **keep** all of the things that a draft version does, and indeed, add some of my own, **except** the removal of images. I want to have a working option 'draft', but I want to keep all of the images visible._


title: How to control pgfplots axis scaling for engineering notation (multiple of 3 exponent)?

text: The automatic power-of-ten scaling of pgfplots is a great feature that unclutters the numeric ticks in the axis (see image). However since the exponent value (e.g. 10^3, 10^4) is difficult to keep consistency between plot that range over different but similar range (e.g. one plot with data between 8000 and 9000 and another between 11000 and 12000. Moreover if the units are SI one tends to confuse the prefixes if the exponent if it is not a multiple of 3. **Is there a way to force pgfplots to choose scaling only for power of ten that are also power of 10^3? For example, 10^6, 10^9, 10^12, but never 10^4, or 10^10.** In this example the power chosen (automatically by pgfplot was 10^10), how can I make it choose 10^9 automatically (with the corresponding change --multiplied by 10-- in the numbers beside the axis) ![poweroften](http://i.stack.imgur.com/x165j.png)


title: Header and margins

text: 1. I would like to set a thicker header line   2. I want to have a larger margin from the top and the bottom of the page.   3. I have a problem with the header, which takes the name of my section which is two sentences long - it doesn't look good. How can I avoid that without changing the section title? I don't know if this is all you need to answer my questions:               \usepackage[T1]{fontenc}     \usepackage[ansinew]{inputenc}     \usepackage[danish, english]{babel}     \usepackage{graphicx}     \usepackage{microtype}     \usepackage{lmodern}     \usepackage{lipsum}     \usepackage[intoc]{nomencl} % Nomenclature package     \usepackage{color}     \usepackage{times}     \usepackage{textcomp}     \usepackage{hyperref}     \usepackage{textpos}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{ifthen}     \usepackage{mathtools}     \makeheadrule{headings}{\textwidth}{0.3pt}     \newcommand{\HRule}{\rule{\textwidth}{3mm}}          % Enable subfigures     \newsubfloat{figure}          % Path to graphics     \graphicspath{{gfx/}}          \everymath{\displaystyle}          % Avoid a warning     \pdfminorversion=5          % Define layout dimensions          \setlrmarginsandblock{35mm}{25mm}{*}     \setulmarginsandblock{30mm}{30mm}{*}     \setheadfoot{8mm}{10mm}     \checkandfixthelayout     \OnehalfSpacing      I hope you can help me. Thank you very much.


title: How to change color of hyperlink to an external URL?

text: I have written the following command to create a link with black or green color :               \documentclass[11pt,twoside,a4paper]{article}          \usepackage[margin=1.5in]{geometry}     \usepackage{hyperref}     \hypersetup{     colorlinks=true,     linktoc=all,     linkcolor=black,     }     \begin{document}     For online \LaTeX ~solution click on the  link :     \href{http://stackexchange.com/}{http://stackexchange.com/}     \end{document}      Produces : ![enter image description here](http://i.stack.imgur.com/Am5cN.png) I want to change the link color as my choice ? How can I do that ?


title: options for appearance of links in hyperref

text: If I use                  \usepackage[colorlinks]{hyperref}      I get colored links for `\cite` (not good for printing or even viewing) but table of content looks fine. If I use                   \usepackage[colorlinks=false]{hyperref}      I get `\cite` links in black with a colored frame (this looks very good) but the table of content looks strange with extra long boxes. What are my other options? Can you have two styles in different parts of a document? How do you make the page numbers in TOC to be the links instead of the section headers?


title: How to remove the indentation from the first line of a paragraph

text: I am using a template provided by our university. I have read and tried many way to remove the indent from the first line in a paragraph. I have the paragraph below:               \paragraph{1. Number of Sides (n)\\}     For each iteration, every segment of the figure from the previous iteration      will be converted to four segments in the following iteration. Since we begin      with three sides, the formula for the number of sides in the Koch curve is      it prints: >   1. Number of Sides (n) > > >      For each iteration, every segment of the figure from the previous > iteration will be converted to four segments in the following iteration. > Since we begin with three sides, the formula for the number of sides in the > Koch curve is where it leave a space at the beginning of the first line. I don't want this indent, I tried `\noindent` and `\setlength\parindent{0pt}` but they didn't work. I tried `\textit`, it did not indent the first line but it indents the "1. Number of Sides (n)" itself. I can not use `\subsubsection` because it sub of `\subsubsection`. If you have a command that will perform this, I would appreciate it.


title: Using the \newarrow command from Taylor's commutative diagrams package

text: I want to define new arrows to use in a commutative diagram, but I just can't make it work. The documentation is not particularly helpful; it doesn't even tell you where to put the               \newarrow{Name}{tail}{filler}{middle}{filler}{head}      bit for example. Even when TeX stops complaining about how I've defined the arrow, it won't use it; the undefined control sequence error comes up whenever I try and use the arrow. The error message suggests using the PostScript Option, but that also doesn't work. Any ideas? (For now, I'll try and use a different diagrams tool, but I'd really like to know how to get this to work.) Any help would be much appreciated. Edit: After doing what Stefan's answer suggested, I'm now trying               \documentclass[a4paper,10pt]{report}     (other packages)     \usepackage[small,nohug]{diagrams}     \diagramstyle[labelstyle=\scriptstyle]     \newarrowtail{-}     \newarrowead{-}     \newarrow{Dots}{-}...{-}     (other pramle etc)     \begin{document}     (blah)     \begin{diagram}     A & \rDots & B     \end{diagram}     (blah)     \end{document}      which works (in so much as TeX now produces the desired diagrams), but now it says: LaTeX Error: missing \begin{document} ... \newarrow{Dots}{-} ...{-} So presumably is has a problem with the arrowhead being a -? How to fix that? (I'm trying to get an arrow looking something like - \cdots - to intidacate an infinite line (currently it just looks like \cdots, but that's fine I suppose).


title: Ensure the font size for captions of figures and tables

text: A reviewer says that I have to ensure that               Captions of figures and tables: Font size should be 8 point.      Is there anyway I can ensure this? As I can't tell what is the size that I am currently using, thanks. Here's the preamble               \documentclass[conference]{IEEEtran}      \usepackage{etex}     \usepackage{amsmath, amssymb, url, proof} % mathabx,     \usepackage[             colorlinks=true,             citecolor=black,             linkcolor=black,             urlcolor=black,             ]{hyperref}          \usepackage{textcomp}     \usepackage{listings}     \usepackage{times}     \usepackage{csp}     \usepackage{epsfig}     \usepackage{float}     \usepackage{multirow}     \usepackage[ruled,vlined,linesnumbered]{algorithm2e}     \usepackage{tikz}     %add usepackage%     \usetikzlibrary{shapes,arrows,positioning}     \usepackage{wrapfig}     \usepackage{graphicx}     \usepackage[latin1]{inputenc}     \usetikzlibrary{trees}     \usepackage{verbatim}     \usetikzlibrary{trees,decorations.pathmorphing}     \usepackage{listings}     \usepackage[T1]{fontenc}     \usepackage[scaled]{beramono}     \usepackage[skip=2pt]{caption}     \lstset{language=XML,     numberstyle=\footnotesize,     basicstyle=\footnotesize,     numbers=left,     stepnumber=1,     frame=shadowbox,     breaklines=true}     \DeclareMathOperator*{\sq}{\square}


title: create text blocks with zero pt leading

text: What I want to achieve is a text block with zero or, better, nearly zero leading and with searchable text. ![Example:](http://i.stack.imgur.com/6pMuc.png) The above example is a tikz picture, created with inkscape and exported to tikz. My own efforts did only lead to something like this, which apparently is not sufficient in any case: ![example2](http://i.stack.imgur.com/LB9Ny.png) The source:               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Courier Std}     \usepackage[svgnames]{xcolor}     \parindent0cm     \renewcommand{\baselinestretch}{0}     \begin{document}      \fontsize{42}{56}\selectfont     The {\color{DarkRed}pitbull} lies\\     well-behaved and\\     chained /It belc\\     hes and it snore\\     s mutedly in its\\     sleep /A melanch\\     oly muzzle on it\\     s snout.........\\     \end{document}


title: Problem with \maketitle: "there's no line here to end"

text: I'm using MiKTeX 2.9 and i'm new to TeX. Simplified, I have this code:               \newcommand{\aone}{Anna}     \newcommand{\atwo}{Bob}     \newcommand{\topic}{Tpoic}     \subject{University \\ Paper}     \title{ \\topic\\ suubtitle}     \author{\aone\and \atwo}     \begin{document}     \begin{titlepage}     \maketitle     \end{titlepage}     \end{document}      Error: > There's no line here to end. \end (at `\end{titlepage}`) Log: > l.7 `\end{titlepage}` What can be the problem? I have exclude the titlepage, all seems ok. I have no idea.


title: Weird side effects with Tikz positioning library

text: I use Tikz and chronology in a paper. However, as soon as I use the Tikz positioning library, I observe weird side effects. I can solve this problem if I remove the positioning library (and include it everywhere, which is not intended, I'd say). Why is that and how to correctly use these libraries and prevent such side effects?               \documentclass[10pt,a4paper,final]{report}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \usepackage{tikz}     \usetikzlibrary{shapes,arrows,backgrounds,positioning} % remove 'positioning' for correct result     % http://i.imgur.com/DJNlDtv.jpg          \usepackage{chronology}          \begin{document}     \begin{figure}     \begin{chronology}[1]{1998}{2008}{7ex}{1\textwidth}     \event[1999]{2002}{ABC}     \event[2003]{2006}{DEF}     \event[2006]{2008}{GHI}     \end{chronology}     \end{figure}          \end{document}      ![Image](http://i.stack.imgur.com/o2BLV.jpg)


title: How to manually draw horizontal legend and place it correctly in tikz?

text: This is my tikz code to draw some plots.               \documentclass{article}     \usepackage{tikz,subfig}     \begin{document}          \begin{figure}       \centering       \subfloat[Iteration Domain for a Tile]{           \begin{tikzpicture}             \draw (0,0) rectangle (3.8,3.8);           \end{tikzpicture}       }       \subfloat[Convex Bounding Boxes]{           \begin{tikzpicture}             \draw (0,0) rectangle (3.8,3.8);           \end{tikzpicture}       }       \subfloat[Disjoint Bounding Boxes]{           \begin{tikzpicture}             \draw (0,0) rectangle (3.8,3.8);           \end{tikzpicture}       }       \caption{Bounding boxes for disjoint union of data regions}     \end{figure}          \end{document}      And this is the output: ![enter image description here](http://i.stack.imgur.com/IIKDh.png) I want to draw something like this: ![enter image description here](http://i.stack.imgur.com/hcXaR.png) How do I do it? There are mainly two things:   1. I want to put legend at the top.   2. I want to put some description for (a) and some description for both (b) and (c) as shown in above figure.


title: How to draw clipart icons in tikz?

text: Is there a way to draw clipart icons in tikz? Or is there a way to export them or should I use some other software for this purpose? I want to draw the following 5 icons: ![enter image description here](http://i.stack.imgur.com/GAMup.png) ![enter image description here](http://i.stack.imgur.com/cJj44.png) ![enter image description here](http://i.stack.imgur.com/roFl9.png) ![enter image description here](http://i.stack.imgur.com/BD1fi.gif) ![enter image description here](http://i.stack.imgur.com/Js62W.png)


title: Arrows crossing blocks TikZ

text: I did several research and many tests and I didn't figure out how to draw the line from (U) and goes to the bottom of S and Q. This is the code of what I did right now and I want your help to add the line wanted... ![enter image description here](http://i.stack.imgur.com/2wXTt.png)               \documentclass{report}          \usepackage[latin1]{inputenc}     \usepackage{tikz}     \definecolor{arm}{RGB}{100,140,171}     \usetikzlibrary{shapes.geometric}     \usetikzlibrary{shapes,arrows}     \usetikzlibrary{positioning}          \begin{document}      \pagestyle{empty}     \begin{figure} [htbp]     \hspace{-1.9cm}     \resizebox{!}{10cm}{\begin{tikzpicture}[node distance = 1.5cm, auto,>=stealth]          \tikzstyle{los} = [diamond, draw,fill=arm,text width=3em, text badly centered, text=white, node distance=3cm, inner sep=0pt]      \tikzstyle{quadri} = [rectangle, draw, fill=arm, text width=6em, text centered,text=white , rounded corners, minimum height=2.5em]      \tikzstyle{line} = [draw, thick, color=black, -latex']                \node[quadri] (A) {A};      \node[quadri, below of=A, node distance=1.6cm] (B) {B};      \node[quadri, below left=1cm and 2cm of B ] (C) {C};      \node[los, below of=C , node distance=2.2cm] (D) {D};      \node[quadri,below left=1cm and 1.6cm of D] (E) {E};       \node[quadri,below of=E, node distance=1.6cm](F) {F};      \node[quadri,below of=D, node distance=1.97cm](G) {G };      \node[quadri,below of=G, node distance=1.6cm](H) {H};      \node[quadri,below right=1cm and 1.6cm of D] (I) {I};      \node[quadri,below of=I, node distance=1.6cm](J) {J};       \node[quadri, below right=1cm and 2cm of B ] (K) {K};     \node[quadri,below left=1.3cm and 0.22cm of K] (L) {L};     \node[quadri,below of=L,node distance=1.6cm] (M) {M};     \node[los,below right of=K,node distance=3cm] (O) {O};     \node[quadri,below left=1cm and 0.05cm of O](P){P};     \node[quadri,below of=P, node distance=1.6cm](Q) {Q};     \node[quadri,below right=1cm and 0.05cm of O](R){R};     \node[quadri,below of=R, node distance=1.6cm](S) {S};     \node[quadri,right of=A ,node distance=3.5cm](T) {T};     \node[quadri, text width=7em,right of=T ,node distance=3.4cm](U){U};               \path [line] (A) -- (T);     \path [line] (T) -- (U);     \path [line] (A) -- (B);     \path [line] (B) -- (C);      \path [line] (B) -- (K);      \path [line] (C) -- (D);      \draw[line] (D) -| node [near start,above] {$=0$} (E);     \path [line] (E) -- (F);     \draw[line] (D) -- node[right] {$=1$} (G);     \path [line] (G) -- (H);     \draw[line] (D) -| node [near start,above] {$=0$} (I);      \path [line] (I) -- (J);      \path [line] (K) -- (L);      \path [line] (K) -- (O);      \path [line] (L) -- (M);      \draw[line] (O) -| node [near start,above] {$=1$} (P);      \draw[line] (O) -| node [near start,above] {$>1$} (R);      \path [line] (P) -- (Q);      \path [line] (R) -- (S);           \end{tikzpicture}      }       \caption{Flowchart}       \label{fig:flowchart}          \end{figure}          \end{document}


title: How to install or replace fonts in old TeX files?

text: I got interested in a research paper from 1991, which I cannot get an electronic online version of. The author was kind enough to send me his tex sources, but is himself unable to produce a pdf file from it. Now I am trying to get this file compiled. The "style files" that are loaded start with a number of font command definitions that fail on my machine:               \font\fivesym=msym5          \font\tenss=amss10          \font\tenssi=amssi10          \font\sixrm=amr6     \font\sixi=ammi6     \font\sixsy=amsy6     \font\sixbf=ambx6     \font\sixsym=msym6          \font\sevensym=msym7          \font\eightrm=amr8     \font\eighti=ammi8     \font\eightsy=amsy8     \font\eightbf=ambx8     \font\eightsl=amsl8     \font\eightit=amti8     \font\eightsym=msym8          \font\eighttt=amtt8          \font\ninerm=amr9     \font\ninei=ammi9     \font\ninesy=amsy9     \font\ninebf=ambx9     \font\ninesl=amsl9     \font\nineit=amti9     \font\ninesym=msym9          \font\elevenbf=ambx10 scaled 1095     \font\tensmc=amcsc10     \font\tensym=msym10     \font\twelvesmc=amcsc10 scaled 1200     \font\fourteensmc=amcsc10 scaled 1440      Trying to compile this document in TeX results in errors of the form:               ! Font \tenss=amss10 not loadable: Metric (TFM) file not found.      To start with the first line above, my system does not have a file msym5.tfm, and no package in Ubuntu contains a file named like this. I could find some versions of the file on the Web but I am unable to install this font without a map file (which I failed to find). Is there a good way to get hold of old fonts to compile such old documents? Can I replace the definitions by something that works today? Unfortunately, I have no idea how the font is supposed to look in each case (the Web did not provide any clue), and some of the fonts might be symbol fonts used for special math characters.


title: Change only the ending with renewenvironment

text: I have a theorem environment I've made called "ex" (using the theoremstyle "definition"), which I use for examples in a book document class. I like that I can number the examples, but I want a proof symbol to occur at the end of every example. I have something that looks like:               \newtheorem{ex}{Example}[section]       \renewenvironment{ex}{}{\qed \\}      However, I want "Example 1.1.1" to show up when I call \begin{ex}. How do I change the environment so that there is no change to the beginning definition, but changes the ending definition to the qed symbol? Here is a MWE:               \documentclass{book}     \usepackage{amssymb, amsmath, amsthm}     \newtheorem{ex}{Example}[chapter]     \begin{document}     \begin{ex}     This is my example     \end{ex}     \end{document}


title: Coloured footnotes split across multiple pages

text: I am typesetting a book with long footnotes, and some phrases or words in footnotes are colored. I ran into a problem for which I have an MWE below.               \documentclass{article}     \usepackage{lipsum}     \usepackage{xcolor}     \usepackage[colorlinks=true]{hyperref}     \begin{document}     \lipsum[1-2]     \lipsum[3]\footnote{\textcolor{red}{\lipsum[1-5]}}     \lipsum[4-20]     \end{document}      Whats wrong here? The textcolor work fine for the footnote text on the first page, but the continued footnote on the second page is not affected? I am using XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/W32TeX). **Edited at 10:20 PM on Friday, 9 May, 2014 (GMT):** Thanks for the responses, using bigfoot helped. One minor thing which I think does not need a new question. Redefining `\thefootnote` seems to have no effect with `bigfoot`. How to make the following work?               \documentclass{article}     \usepackage{lipsum}     \usepackage{xcolor}     \usepackage{bigfoot}     % The line below has no effect     \renewcommand{\thefootnote}{\textcolor{red}{\fnsymbol{footnote}}}     \usepackage[colorlinks=true]{hyperref}     \begin{document}     \lipsum[1-2]     \lipsum[3]\footnote{\textcolor{red}{\lipsum[1-5]}}     \lipsum[4-20]     \end{document}


title: how to draw a chain of gears

text: I'd like to draw a chain of gears, like this: ![enter image description here](http://i.stack.imgur.com/vrX98.png) I'm using the macro provided by Alain Matthes in Creating gears in TikZ for drawing a single gear with some modification to obtain the "double gear" effect (i.e. an inside/outside gear). My actual code is this:               \documentclass{standalone}     \usepackage{tikz}          \newcommand{\gear}[5]{%     \foreach \i in {1,...,#1} {%       [rotate=(\i-1)*360/#1]  (0:#2)  arc (0:#4:#2) {[rounded corners=1.5pt]                  -- (#4+#5:#3)  arc (#4+#5:360/#1-#5:#3)} --  (360/#1:#2)     }}          \begin{document}       \begin{tikzpicture}         \matrix[column sep=-0.1cm,draw=none,fill=none,ampersand replacement=\&] {         %%%%%%%%%%%%%%         % First gear %         %%%%%%%%%%%%%%         \node[circle,minimum size=40mm,fill=gray,shade] at (0,0){};         \node[circle,minimum size=30mm,fill=white] at (0,0){};         \draw[thick,rotate=10,fill=gray,shade] \gear{18}{2}{2.2}{10}{2};         \draw[thick,rotate=22,fill=white] \gear{18}{1.5}{1.7}{6}{1};\&         %%%%%%%%%%%%%%%         % Second gear %         %%%%%%%%%%%%%%%         \node[circle,minimum size=40mm,fill=gray,shade] at (0,0){};         \node[circle,minimum size=30mm,fill=white] at (0,0){};         \draw[thick,rotate=10,fill=gray,shade] \gear{18}{2}{2.2}{10}{2};         \draw[thick,rotate=22,fill=white] \gear{18}{1.5}{1.7}{6}{1};\\         };         \end{tikzpicture}       \end{document}      which produces:![enter image description here](http://i.stack.imgur.com/BiNv2.png) to move the second gear left/right i've put the gears in a `\matrix` so that I just need to copy the code from the first gear in the second cell of the matrix and specify a `column sep` such that the gears are at the desired distance. This method however doesn't work anymore when you add a third gear that needs a different `column sep`. to move the second gear up/down so to obtain the effect of the first image I tried with `xshift` and `yshift` options in `\draw` (that is how i got the first image) but it's a lot of work and requires many recompilations. So my question is:   Is there a better way to move a gear (where a gear consist in two `\draw` and two `\node` commands, as shown in the code) to the left-right-up-down with respect of the other without having to manually positioning it with `xshift`and `yshift`? ## A more general approach To make the question more general, let's just consider the case where every gear is only made by one gear, without the inner gear, background, etc. the `tikzpicture` in the above code become:               \begin{tikzpicture}         \matrix[column sep=-0.1cm,draw=none,fill=none,ampersand replacement=\&] {         %%%%%%%%%%%%%%         % First gear %         %%%%%%%%%%%%%%         \draw[thick] \gear{18}{2}{2.2}{10}{2};\&         %%%%%%%%%%%%%%%         % Second gear %         %%%%%%%%%%%%%%%         \draw[thick] \gear{18}{2}{2.2}{10}{2};\\         };       \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/2RE8I.png)   How to chain two or more gears shifting their position like in the first image?


title: Managing hundreds of separate components in a large document

text: I am making a workbook containing hundreds activities. Each activity appears as its own section and generally contains instructions, spaces to write or draw, and sometimes illustrations or diagrams to complete. In past projects, I have found such documents end up quite long and difficult to manage. I have tried a couple of solutions. Initially, I just created one macro per activity in an external file, then simply retrieving the macros within the main file:               \define\activityone {         \section{Bird Watching}             How many birds can you find near your home? Draw a picture of them in the space below.     }          \define\activitytwo{         \section{What kind of bird?}             Use the bird guide to find the birds. What are they called? Write the names near your picture above.     }      As each is unique, but there might be some which appear with identical formatting, I also tried making different macros for each format, which are placed in the main file like this:                \activitystyle{Bird Watching}{How many birds can you find near your home? Draw a picture of them in the space below.}      Both of these solutions help somewhat to separate content from format, but, in the end, they do not seem to make the document any cleaner to manage. Are there any other methods for managing many pieces of text in a larger document?   * I am using ConTeXt, but sometimes solutions from on variety of TeX are applicable to other varieties.


title: Possible incompatibility between tufte-latex classes, footnotes and LuaLaTeX

text: I think I came across an incompatibility between LuaLaTeX and `tufte-handout` or `tufte-book` class. The document should also contain footnotes. Here is a MWE:               \documentclass{tufte-handout} % Or tufte-book          \usepackage{fontspec}      \defaultfontfeatures{Mapping=tex-text}      \setmainfont{Lin Libertine O} % Or maybe any other font...          \begin{document}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod     tempor incididunt ut labore et dolore magna aliqua.\footnote{Lorem ipsum!}     Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi     ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit     in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur     sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt     mollit anim id est laborum.\footnote{Dolor si amet}          \end{document}      I'm using LuaTeX, Version beta-0.70.1-2011062107 (rev 4277), the one which came with TeXLive 2011. MWE above compiles perfectly under XeLaTeX or under LuaLaTeX provided there are no footnotes; it also compiles without errors under both systems using the standard `article` class. However introducing footnotes _and_ tufte classes produces errors. The relevant part of the log files is:               luaotfload | Updating the font names database:     luaotfload | Scanning TEXMF fonts...     luaotfload | Scanning OS fonts...     luaotfload | Font names database saved: %s      : /Volumes/Users/michael/Library/texlive/2011basic/texmf-var/luatex-cache/generic/names/otfl-names.lua     luaotfload | define font: font with name pplr9t is not found     luaotfload | define font: unknown font pplr9t, loading aborted     ! Font \OT1/pplx/m/n/10=pplr9t at 10pt not loadable: metric data not found or bad.     <to be read again>                     relax      l.10 ...olore magna aliqua.\footnote{Lorem ipsum!}                                                        Ut enim ad     ?      luaotfload | define font: font with name pplr9t is not found     luaotfload | define font: unknown font pplr9t, loading aborted     ! Font \OT1/pplx/m/n/7.6=pplr9t at 7.60001pt not loadable: metric data not found or bad.     <to be read again>                         relax      l.10 ...olore magna aliqua.\footnote{Lorem ipsum!}                                                        Ut enim ad     ? X      (Of course the final `X` is me aborting compilation) This may has to do with the class rather than LuaLaTeX but i wonder if I'm missing a setting (perhaps in `fontspec`?) or there is some option clash. Or possibly a bug.


title: How to create new table environment

text: I am working on a book that has many many such tables. Is there a way to create shortcut for the code shown below. I want to make table caption a variable, because in the MWE shown below except `\caption` and cell data everything else is constant. what I am trying to achieve is - I should be able to say `\starttable` ..... `\endtable` copying this much code will give me the results I want but it will make it less like LaTeX               \begin{document}          \begin{table}[!htbp]     \begin{minipage}[b]{0.5\linewidth}%\centering     {\caption{Table name - 1}     \renewcommand{\arraystretch}{1.1}     \begin{tabular}{|c|c|c|c|}          \hline     Text-1  & Text-2 & Text-3 & Text-4 \\      \hline        &  &  &  \\       &   &   &   \\     &   &   &   \\     \hline     \end{tabular}}          \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.5\linewidth}     \centering     {\caption{Table Name - 2}     \renewcommand{\arraystretch}{1.1}     \begin{tabular}{|c|c|c|c|}     \hline     Text-1  & Text-2 & Text-3 & Text-4 \\      \hline        &  &  &  \\       &   &   &   \\     &   &   &   \\     \hline     \end{tabular}}          \end{minipage}     \end{table}


title: siunitx rounding in table with parentheses

text: I'm trying to create a standard regression table with standard errors in parentheses below the coefficients, while using `siunitx` to align the numbers on the decimal point, and to round the numbers. I use the option `input-symbols=()` to make `siunitx` ignore the parentheses, which works fine for alignment, but the numbers in parentheses are not rounded:               \documentclass{article}     \usepackage{siunitx}     \begin{document}     \begin{tabular}{l*{2}{S[input-symbols=(),round-mode=figures,round-precision=1]}}      \hline     & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} \\     \hline     X & 0.0131     & 0.00265{***} \\       & (0.000731) & (0.000547)   \\     \hline     \end{tabular}     \end{document}      If I instead put the parentheses in curly brackets, the rounding works, but the left paranthesis ends up left aligned in the table cell:               \documentclass{article}     \usepackage{siunitx}     \begin{document}     \begin{tabular}{l*{2}{S[round-mode=figures,round-precision=1]}}      \hline       & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c}{(2)} \\     \hline     X & 0.0131         & 0.00265{***}   \\       & {(}0.000731{)} & {(}0.000547{)} \\     \hline     \end{tabular}     \end{document}      Is there a way to get rounding to work with parantheses? I have the latest version of `siunitx`, 2.4j.