title: “! Misplaced \omit” error in multicolumn and BlackCell

text: I ran into a problem with “! Misplaced \omit” error. I have searched quite hard to find the relevant problem but only find mine is similar with bigbadpiano's question in which A.Ellett generated a nice table with WME. However, my personal desire is to put one multicolumn as black background and white text, for instance: ![an failed example](http://i.stack.imgur.com/lkjyR.png) This is an failed example since the whole first row should be black. I also get an error in Log File:" ! Misplaced \omit. \multispan ->\omit \@multispan l.10 ...multicolumn{8}{|c|}{\BlackCell{Dataset A}} \\hline I expect to see \omit only after tab marks or the \cr of an alignment. Proceed, and I'll ignore this case." If this question is duplicate, I am really sorry but I couldn't find the correct answer to my specific problem. In this case, please inform me the exact answer and I will delete this question later. Any help is appreciated.               \documentclass{article}     \pagestyle{empty}     \usepackage[table]{xcolor}     \newcommand\BlackCell[1]{%       \multicolumn{1}{c}{\cellcolor{black}\textcolor{white}{#1}}     }     \begin{document}     \begin{table}[h]          \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline          \multicolumn{8}{|c|}{\BlackCell{Dataset A}} \\\hline      L (m)  & T (s) & T$^2$ (s$^2$) & L$^{1/2}$ (m$^{1/2}$) & $\Delta$T$^2$ (s$^2$) & $\Delta$T (s) & Fitted T$^2$ (s$^2$) & Fitted T (s) \\ \hline         0.2 & 0.626 & 0.392         & 0.447                 & 0.006                 & 0.005         & 0.394                & 0.662 \\          0.3 & 0.889 & 0.790         & 0.548                 & 0.009                 & 0.005         & 0.797                & 0.889 \\          0.4 & 1.105 & 1.221         & 0.632                 & 0.011                 & 0.005         & 1.201                & 1.081 \\          0.5 & 1.261 & 1.590         & 0.707                 & 0.013                 & 0.005         & 1.604                & 1.250 \\          0.6 & 1.420 & 2.016         & 0.775                 & 0.014                 & 0.005         & 2.008                & 1.403 \\          0.7 & 1.555 & 2.418         & 0.837                 & 0.016                 & 0.005         & 2.411                & 1.543 \\          0.8 & 1.679 & 2.819         & 0.894                 & 0.017                 & 0.005         & 2.814                & 1.674 \\          0.9 & 1.798 & 3.233         & 0.949                 & 0.018                 & 0.005         & 3.218                & 1.797 \\          1.0 & 1.901 & 3.614         & 1.000                 & 0.019                 & 0.005         & 3.621                & 1.913 \\          1.1 & 2.000 & 4.000         & 1.049                 & 0.020                 & 0.005         & 4.025                & 2.023 \\\hline     \end{tabular}     \end{table}          \end{document}


title: Can pdf thumbnail previews in file explorer be influenced?

text: Some pdf files have a nice preview thumbnail in Windows (7) Explorer, e.g. those produced by my the software of my scanner: ![pdf w/ thumbnail](http://i.stack.imgur.com/HSpOf.png) For my LaTeX files produced with pdfTeX, however, it just shows the boring Adobe symbol: ![pdf w/o thumbnail](http://i.stack.imgur.com/sAcr5.png) **Is there a way to make sure to get these thumbnails via pdfTeX?** A package, hyperref option, . . . ? I have to admit, I'm not even sure if it really depends on the producing software; the scanning software seems to get it right every time, but then again there's a tool apparently fixing this problem (haven't tried it yet), which hints at a problem on Adobe's side. Any clarification is appreciated. * * * Edit:   1. The problem is _not_ getting the inline preview pictures of pages.   2. Looking at PDF-Versions and producing programs, this actually seems to be a flaw in Adobe Reader's production/display of thumbnail pictures (cf. comments). Taking this into consideration, the question is: Can AR's behavior be influenced in any way or are there any "rules" according to which it behaves?


title: How to change the distance between the nodes and club them and bring them to center in TikZ

text: \documentclass[12pt]{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}     [remember picture,overlay,every node/.style={inner sep=2pt}]     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.1\paperheight)$) {C};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.2\paperheight)$) {Y};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.3\paperheight)$) {B};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.4\paperheight)$) {Y};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.5\paperheight)$) {R};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.6\paperheight)$) {U};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.7\paperheight)$) {S};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.8\paperheight)$) {1};     \node[anchor=center,circle,fill=magenta,text=white,font=\sffamily,scale=2]     at ($(current page.north east)+(-0.5in,-0.9\paperheight)$) {4};     \end{tikzpicture}     \end{document}      Here , How do I reduce the distance between the nodes and group them and bring them in the center of the margin.


title: Directory organization with multiple papers that share files

text: Being a PhD student, I have written/will write several papers. Most of them share a common bibliography file and some styles, so I created a directory tree like this:               publications/         bibliography/biblio.bib         templates/             ....         conferences/             <name of conference>/<name of article>/<article files (tex etc.)>         journals/             <name of journal>/<name of article>/<article files (tex etc.)>      The problem is that each paper contains references to the parent directories, so it must be compiled inside this environment. I am now thinking of creating independent directories, i.e., moving bibliography and templates inside each directory. How did you solve this problem? Which layout do you use? **EDIT** : I'd also like to move them to other computers, using a version control system and two computers that can work using the VCS.


title: How to write in French when using Constantia font?

text: I can not write some French letters (é, è, â, ...) when I use the font `Constantia`.   This is what I declared before the start of my document:               \usepackage[utf8]{inputenc}       \usepackage[T1]{fontenc}        \usepackage{fontspec}     \setmainfont{Constantia}      How can I use this font and be able to write in French without a problem ? Here is the full packages list I loaded:               \usepackage[utf8]{inputenc}       \usepackage[T1]{fontenc}        \usepackage{fontspec}     \setmainfont{Constantia}     \usepackage[frenchb]{babel}       \usepackage[english]{babel}     \usepackage{multirow}     \usepackage{listings}     \usepackage[export]{adjustbox}     \usepackage{bchart}     \usepackage{array}%for setting cells length     \usepackage{color}      \usepackage{colortbl}     \usepackage[grey,utopia]{quotchap}     \usepackage{tabularx}     \usepackage{enumitem}     \usepackage{pifont}     \frenchbsetup{StandardLists=true}     \usepackage{wasysym}%for the phone     \usepackage[square, numbers, comma, sort&compress]{natbib}


title: Indentation after '\tabular' environments

text: I was filling some tables for my progress report and noticed something were odd. The following text/tables are indented. MWE:               \documentclass[12pt, oneside]{book}     \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{tabularx}     \usepackage[paper = a4paper, margin = 1in, headheight = 12pt, includehead, showframe]{geometry}          \begin{document}      \section*{Section 1}       \subsection*{Subsection 1}        \begin{tabular}{ l l p{0.5cm} l l }         TextText: & TextText & & TextText & TextText\\         TextText & TextText & & TextText & TextText        \end{tabular}        \vspace{12pt}        {\scriptsize{\bfseries{Little note!}}}        \vspace{12pt}        \begin{tabularx}{\textwidth}{| X |}         \hline         \bfseries{Tabletitle}\\         \hline         \\ \\ \\         \hline              \end{tabularx}     \end{document}      Is that really the normal behaviour and is there any other way as `\begin{flushleft} ... \end{flushleft}` to remove the indentation a get the right alignment?


title: Section{references} not appearing correctly over bibliography

text: I am using the tex style of SMC. Above my reference, this appears:               6. *      References      This instead of "6. References". I am using their style and printing the bibliography with:               \bibliographystyle{IEEEtran}     \bibliography{paper}      I went to the .sty file and I found the following entries:               \bibliographystyle{IEEEtran}          \def\thebibliography#1{       \section{References}\list       {[\arabic{enumi}]}{       \settowidth\labelwidth{[#1]}\leftmargin 1em       \advance\leftmargin\labelsep       \usecounter{enumi}       }       \def\newblock{\hskip .01em plus .01em minus .01em}       \sloppy\clubpenalty4000\widowpenalty4000       \sfcode`\.=1000\relax     }          \let\endthebibliography=\endlist          \long\def\@makecaption#1#2{       \vskip 10pt       \setbox\@tempboxa\hbox{#1. #2}       \ifdim         \wd\@tempboxa >\hsize #1. #2\par       \else         \hbox         to\hsize{\hfil\box\@tempboxa\hfil}       \fi     }      I notice the problem dissapears when I comment \uspackage{amsmath}. I have tried adding \usepackage{amsrefs}, but that says the bib environment is already defined. Here is a min working example and a link to the style file.               \documentclass{article}                    \usepackage{icmcsmc2014}           \usepackage[numbers]{natbib}     \usepackage{amsmath}               \begin{filecontents}{paper_test.bib}     @article{herremans2013composing,       title={Composing Fifth Species Counterpoint Music With A Variable Neighborhood Search Algorithm},       author={Herremans, Dorien and S{\"o}rensen, Kenneth},       journal={Expert Systems with Applications},       volume={40},       number={16},       pages={6427--6437},       year={2013},       publisher={Pergamon}     }     \end{filecontents}               \usepackage{times}     \usepackage{ifpdf}     \usepackage[english]{babel}     % \usepackage{cite}     %   \usepackage{multibib}                    % ***************************************** the document starts here ***************     \begin{document}                    \section{Introduction}          Here I want the author name to occur with citet as it is said by \citet{herremans2013composing}.          %   \bibliographystyle{IEEEtran}     %   \bibliographystyle{natbib}       \bibliography{paper_test}               \end{document}


title: Code to ignore all of document except for list environments and sections

text: I am trying to typeset all of the (description) lists in my document without any of the surrounding text or figures (with the exception of desiring some context by way of section headings). I thought that the `preview` package could help, and have a MWE working, but it typesets everything on individual pages. I can't see an option that would change this behavior. Is there a way to do this type of parsing, but have all the content appear with pagination dictated by the traditional TeX methods? The `xcomment` package (http://ctan.org/pkg/xcomment) almost does this, but doesn't appear to support allowing section headings through. MWE:               \documentclass[]{article}               %% Use below code to get just an outline and description lists     \usepackage[active,delayed,tightpage,pdftex]{preview}     \PreviewMacro[*[!]{\section} % Include Section headings     \PreviewMacro[*[!]{\subsection} % Include Subsection headings     \PreviewEnvironment{description} % Include description environments     \setlength{\PreviewBorder}{2ex} % Give a little bit of a border     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \usepackage{blindtext}          \begin{document}          \blindtext     \section{Short lists}     \blinditemize     \blindtext     \blinddescription     \blindtext     \section{Long lists}     \begin{description}     \item[First] \blindtext     \item[Second] \blindtext     \end{description}     \blindenumerate          \end{document}      This gives separate pages...: ![pages](http://i.stack.imgur.com/Ysov2.png) **Side question:** When I remove the `tightpages` option, the lists are not all contained in the page. This is seen most obviously with the long lists, shown below. Is this normal? How is it fixed? ![longlists](http://i.stack.imgur.com/6rA94.png)


title: How to write (La)TeX (with parentheses) [or any other TeX-related logo]

text: I'm looking after a macro to write the (La)TeX logo (with parentheses), i.e. something similar to `\TeX`, `\LaTeX`, but where the output includes ()'s.


title: How to render \Lyx like \LaTeX

text: > **Possible Duplicate:**   >  How to write (La)TeX (with braces) [or any other TeX-related logo] Is there a macro defined somewhere that I can use so that `\LyX{}` renders like `\LaTeX` in pure LaTeX? This is really hard to google and grep for...


title: XeLaTeX logo with pdfLaTeX?

text: > **Possible Duplicate:**   >  How to write (La)TeX (with braces) [or any other TeX-related logo] I try to typeset the XeLaTeX logo in a document that has to be run through pdfLaTeX (for a journal). I know that the logo is in `xltxtra`, but loading this package breaks the pdfLaTeX run. Is there a way to use part of the `xltxtra` package? I looked at the code, but it does not make sense to me.


title: special latex words

text: > **Possible Duplicate:**   >  How to write (La)TeX (with braces) [or any other TeX-related logo] I'm looking for other specially formatted words in LaTeX similar to `\LaTeX` or `\TeX`. Does anyone know of a list (if there are any other words) and/or if there is one for TikZ?


title: How can I write 'METAPOST' logo in LaTeX?

text: I'd like to type `METAPOST` and `METAFONT` logo in my LaTeX document, but I couldn't find clear way to do that. What font should I use? (in pdfLaTeX) Or is there any command to write that? (for example `\LaTeX`)


title: Special string like \LaTeX

text: I am looking for a list of all the strings the render special in LaTeX, for example `\latex` and `\python`, I believe are both special. Are there others? Is there a list somewhere?


title: How to print "LaTeX" as shown in many tutorials and books?

text: > **Possible Duplicate:**   >  How to write (La)TeX (with braces) [or any other TeX-related logo] I came across the tug tutorial, and writing down the very first basic example of printing simple document. My LaTeX file is:               mt4k@laptop:$ cat myfile.tex      \documentclass{article}     \begin{document}     This is my \emph{first} document prepared in \Latex.     \end{document}      I am getting the following message for `\Latex`:               mtk4@laptop:$ latex myfile.tex      This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)     entering extended mode     (./myfile.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang,     noh     yphenation, loaded.     (/usr/share/texmf-texlive/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texmf-texlive/tex/latex/base/size10.clo)) (./myfile.aux)     ! Undefined control sequence.     l.3 ...my \emph{first} document prepared in \Latex                                                       .     ?      In the output pdf, the `Latex` word has been omitted. Can anyone tell me how to print words in that fashion? (In a way similar as the word 'LATEX' is printed in the pdf in the link above) Please let me know if you need more info. Also I have searched the SO and this site, and couldn't find any similar question, If I have missed out, please point me to it.


title: Biber and Biblatex: Reference within the Bibliography

text: I have a problem, where all my googeling has left me standing alone. Currently I am preparing my thesis and I am using biblatex in conjunction with biber. When dealing with the entrytype `set` everything worked quite well. Now the following Problem has occurred: I am citing a book first and thereafter this book shall be part of a `set`, where I can add an comment to this and some other references. For example: > Here is where the book is cited.[foo] Some other Text, with some more > citations.[baz,biz,buz] Then some more text and reference to a set of > references.[foobar] Now the bibliography should show like this: > [foo] The Author, The Title... > > [baz] The Author, The Title... > > [biz] The Author, The Title... > > [buz] The Author, The Title... > > [foobar] a) [foo] b) a comment c) The Author, The Title... (of [bar1]) d) > The Author, The Title... (of [bar2]) d) ... Apparently this is not possible, as the output changes automatic to citing members of the set: > Here is where the book is cited.[foobar-a] Some other Text, with some more > citations.[baz,biz,buz] Then some more text and reference to a set of > references.[foobar] and the bibliography: > [baz] The Author, The Title... > > [biz] The Author, The Title... > > [buz] The Author, The Title... > > [foobar] a) The Author, The Title... (of [foo]) b) a comment c) The Author, > The Title... (of [bar1]) d) The Author, The Title... (of [bar2]) d) ... I know one can work-around this problem with creating `misc` type entries, where the note command references the actual book:               @MISC{foo-ref,       note = {\cite{foo}}     }      and including these into the set. I could work with that, but I would rather find a more elegant solution. Browsing the biblatex manual I couldn't find an option which completes my goal, or maybe I missed it (It is kind of huge.) Therefore I would be very grateful if anyone has a better solution. **Edit:** Here is a MWE:               \RequirePackage{filecontents}     \begin{filecontents}{test.bib}     @BOOK{foo,       title = {Foo},       publisher = {the Press},       year = {3000},       author = {the Foo},     }          @ARTICLE{baz,       author = {the Baz},       title = {Baz},       journal = {J. of Baz},       year = {3001},       volume = {1},       pages = {22},     }          @ARTICLE{buz,       author = {the Buz},       title = {Buz},       journal = {J. of Buz},       year = {3001},       volume = {1},       pages = {22},     }          @MISC{comment,       note = {a comment},     }          @BOOK{bar,       title = {Bar},       publisher = {the Press},       year = {3002},       author = {the Bar},     }          @SET{foobar,       entryset = {foo,comment,bar},     }     \end{filecontents}          \documentclass[12pt,final]{scrreprt}                         \usepackage[ngerman]{babel}                        \usepackage[utf8]{inputenc}                        \usepackage[T1]{fontenc}                                \usepackage[german=quotes                ]{csquotes}     \usepackage[backend=biber,                 sorting=none,                 style=numeric-comp,                 style=chem-angew,                 subentry=true,                 maxcitenames=5,mincitenames=4,                 maxbibnames=99,                 backref=true,                 natbib=true                 ]{biblatex}          \addbibresource{test.bib}          \begin{document}     Here is where the book is cited.\autocite{foo}     Some other Text, with some more citations.\autocite{baz,buz}           Then some more text and reference to a set of references.\autocite{foobar}          \printbibliography     \end{document}      That results in attached picture (top). With the workaround I get what I want (bottom). But this is clearly not an elegant solution as one can see with the backreferences, which are pointing to the bibliography entry of 1. (But I could live with that.) ![enter image description here](http://i.stack.imgur.com/aJQnD.jpg)


title: How to include tex files

text: Is there any way that I can add different `.tex` files (From different folders) into another folder's `.tex` file? I meant that all of the `.tex` files will be fine and separated and I just need to aggregate into one without copy & pasting these files into a single one. ![enter image description here](http://i.stack.imgur.com/e9442.png) I have saved the input file like this, but it's not working when I write in another file, like ![enter image description here](http://i.stack.imgur.com/FSEYG.png)               \include{oscillonsource.tex}.      It's still not working. :-(


title: enumerate, overlays and beamer

text: I would like to understand the following behaviour of enumerate in beamer. The following example               \documentclass{beamer}          \newcommand{\marca}{\onslide<2>{\makebox[0pt][r]{$\clubsuit$\qquad}}}     \begin{document}          \begin{frame}     My list          \begin{enumerate}     \item\marca One     \item Two     \end{enumerate}     \end{frame}          \end{document}      shows a list. I would like that first overlay shows the numbered list, and the second overlay shows the clubsuit on first item. However, first number does not appear. If I change my command `\marca` in the following way               \newcommand{\marca}{\makebox[0pt][r]{\overlay<2>{$\clubsuit$\qquad}}}      then I get what I want. But I don't understand why. Any explanation?


title: Gap between top margin and figure

text: I am getting this ugly gap between subfigures and the top margin. I'm really puzzled because when it's only one figure it's nicely aligned. How can I align my subfigures to the top margin? I'm using koma-script book, but the problem persists when I change to book.               \documentclass[11pt,english,british]{scrbook}          \usepackage{mathptmx}     \usepackage[showframe, paperwidth=17cm,paperheight=23cm]{geometry}     \usepackage[draft]{graphicx}     \usepackage{subfig}     \usepackage{lipsum}          \geometry{verbose,tmargin=2.2cm,bmargin=2.5cm,lmargin=2.1cm,rmargin=1.3cm,footskip=1cm}          \begin{document}          \lipsum          \begin{figure}     \centering{}\rule{0.5\textwidth}{0.5\textwidth}%     \caption{Single figure nicely aligned}%     \end{figure}          \lipsum[5]          \begin{figure}     \centering%     \subfloat[First subfigure]{\rule{0.49\textwidth}{5cm}}%     \hfill%     \subfloat[Second subfigure]{\rule{0.49\textwidth}{5cm}}%     \caption{Group of figures with ugly gap on top}%     \end{figure}          \end{document}      ![enter image description here](http://i.stack.imgur.com/hPrep.png)


title: Alignment of image (via includegraphics) in fancyhdr with and without tabular environment

text: Below I show two examples; an image (via includegraphics) is placed in fancyhdr with and without tabular environment. When the image is placed in the tabular environment, a vertical offset is apparent, the cause of which is unknown to me. Any comments or suggestions are greatly appreciated. Common files: address.tex               868 Sunrise Ave. \\     Garden City \\      body.tex               \lipsum[1]      First example, no tabular environment: theletter.cls               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{theletter}[]     \LoadClass[]{letter}          \RequirePackage{lipsum}     \RequirePackage{fancyhdr}     \RequirePackage[demo]{graphicx}     \RequirePackage{catchfile}          \RequirePackage[showframe,%     textwidth=345.0pt,%     top=2in,     headheight=1.0in,     headsep=0.20in]{geometry}          \newcommand{\getaddressfrom}[1]{\CatchFileDef{\thefromaddress}{#1}{}}          \signature{Mae L. Mann}          \AtBeginDocument{%     \fancypagestyle{plain}{%     \fancyhead[L]{%     \includegraphics[height=1.0in, keepaspectratio=true]{image.png}%     }%     \renewcommand{\headrule}{}%     }     \pagestyle{empty}     \makeatletter     \let\ps@firstpage\ps@plain     \makeatother       \begingroup\def\tempa{\endgroup\begin{letter}{1234 Central St. \\ Western City}}         \expandafter\tempa\expandafter{\thefromaddress}%       \opening{\theopening}     }%          \AtEndDocument{%     \closing{\theclosing}     \ps{\thepostscript}     \end{letter}     }      aletter.tex               \NeedsTeXFormat{LaTeX2e}     \documentclass{theletter}     \getaddressfrom{address.tex}     \newcommand{\theopening}{Dear Recipient}     \newcommand{\theclosing}{Sincerely,}     \newcommand{\thepostscript}{}     \begin{document}     \input{body.tex}     \end{document}      I am attaching the output associated with this example first, followed by the output from the second example. The files associated with the second example are as follows: thelettertabular.cls               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{theletter}[]     \LoadClass[]{letter}          \RequirePackage{lipsum}     \RequirePackage{fancyhdr}     \RequirePackage[demo]{graphicx}     \RequirePackage{catchfile}          \RequirePackage[showframe,%     textwidth=345.0pt,%     top=2in,     headheight=1.0in,     headsep=0.20in]{geometry}          \newcommand{\getaddressfrom}[1]{\CatchFileDef{\thefromaddress}{#1}{}}          \signature{Mae L. Mann}          \AtBeginDocument{%     \fancypagestyle{plain}{%     \fancyhead[L]{%     \begin{tabular}{c}     \includegraphics[height=1.0in, keepaspectratio=true]{image.png}%     \end{tabular}     }%     \renewcommand{\headrule}{}%     }     \pagestyle{empty}     \makeatletter     \let\ps@firstpage\ps@plain     \makeatother       \begingroup\def\tempa{\endgroup\begin{letter}{1234 Central St. \\ Western City}}         \expandafter\tempa\expandafter{\thefromaddress}%       \opening{\theopening}     }%          \AtEndDocument{%     \closing{\theclosing}     \ps{\thepostscript}     \end{letter}     }      And finally the call of the second example: bletter.tex               \NeedsTeXFormat{LaTeX2e}     \documentclass{thelettertabular}     \getaddressfrom{address.tex}     \newcommand{\theopening}{Dear Recipient}     \newcommand{\theclosing}{Sincerely,}     \newcommand{\thepostscript}{}     \begin{document}     \input{body.tex}     \end{document}      ![Output from first example](http://i.stack.imgur.com/aBJE1.png)![Output from second example](http://i.stack.imgur.com/4awdM.png)


title: add \figurename to \listoffigures (package titletoc)

text: at the moment I'm a little bit fighting with my listoffigures. - I 'just' want to put the `\figurename`(here it is "Pict.") in front of the `\contentslabel` in the lof. Here's a little code example:               \documentclass[oneside,openright,BCOR=5mm,paper=a4,fontsize=11pt]{scrbook}          \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage[ngerman]{babel}     \usepackage[automark]{scrpage2}     \usepackage{xcolor}          \usepackage{geometry}     \geometry{a4paper, top=35mm, left=30mm, right=30mm, bottom=25mm, headsep=15mm, footskip=12mm}          \usepackage[demo]{graphicx}     \usepackage{textpos}     \usepackage{blindtext}     \usepackage{lipsum}     \usepackage{titletoc}          \usepackage{mparhack}          \addto\captionsngerman{\renewcommand{\figurename}{Pict.}}     \titlecontents{figure}[2.0cm]{\footnotesize}{\contentslabel{2.0cm}}{\hspace*{-1.5cm}}{\titlerule*[0.12cm]{.}\contentspage}[\addvspace{6pt}]          \begin{document}     \pagestyle{scrheadings}     \clearscrheadfoot     \ohead[\headmark]{\headmark}          \listoffigures          \chapter{Chapter}     \lipsum[1]          \begin{figure}[htbp]       \centering       \includegraphics[width=8cm,height=5cm]{demo}%       \caption{My Picture}     \end{figure}          \end{document}      At the moment I tried this one:               \titlecontents{figure}[2.0cm]{\footnotesize}{\figurename\contentslabel{2.0cm}}{\hspace*{-1.5cm}}{\titlerule*[0.12cm]{.}\contentspage}[\addvspace{6pt}]      ... but this always leads to something like:               "1.1 Pict.            My Picture ................................ 2"      But - as you might guess - that's not the thing I want. I want a result like:               "Pict. 1.1            My Picture with a long caption that has to                           be broken ................................. 2"      Does anyone have a solution for me? Thanks in advance, eniem


title: Lilypond: How to control the paper size to create images

text: My question concerns the creation of images using lilypond. Until know I've created some music sheets and lilypond has been really great. However I have a website and I would like to post some examples to illustrate what I'm saying. The images should just fit the size of what is written. It will mostly been 2-3 bars max, but I would like the size to fit automatically as it could be bigger. When I use the --png option, it creates an image the size of an A4 page. I tried using the snippets shown in the doc, for exemple here : http://lilypond.org/doc/v2.12/input/lsr/12/lily-1ed76b9d.ly If I comment the _\include "lilypond-book-preamble.ly"_ , then it shows as an A4 document. If I leave it, then I'm asked to add _-dbackend=eps_ to the command line. If I add it, then **it actually produces the result i'm searching for.** However it also adds a whole bunch of files (multiple .pdf, .eps, .tex, .texi, .count). Is there a proper way to do it, or should I write a bash script to clean the folder after the lilypond command? Another thing: with the **--png option** , are we able to define an image size? I'm able to change it using _-dresolution_ but it's not very handy as you have to try to see the output size, then change and try again... Maybe is it better to create .pdf and use other scripts to convert into .png? Thank you in advance! I searched for this information but found very little about it so far...


title: "Grab to #{" macro arguments

text: In How to create a macro with two or three ;-separated arguments?, Herbert uses a macro definition               \def\defpoint#1#{\expandafter\defpoint@i#1;;\@nil}      which Joseph Wright reports as having a "grab to `#{`" argument. How does this work? Where is it useful? Are there any restrictions? Does it extend in the same way nested macro definitions would? As in, using `##{` if redefining a macro within another one.


title: Avoid page break after last line in lstlisting

text: I have a listing as follows:               \lstdefinestyle{yamlCode} {         numbers=left,         language=Yaml,         backgroundcolor={\color{lightgray!40}},         breaklines=true,         frame=single,         columns=fixed     }          [...]          \begin{lstlisting}[style=yamlCode,label=YamlList,     caption=List of Maps in YAML.]     persons:       - name:  Peter         email: peter@example.org       - name:  Sally         email: sally@example.org     \end{lstlisting}      Now that listing might break _after_ the last line of code, as can be seen in this screenshot: ![page break](http://i.stack.imgur.com/rwX9H.png) How can I prevent the page break after the last line? At least one line should be moved to the next page as well. Just to be clear: I do want it to break pages, however, not after the _last_ line. How can I achieve that? PS: Are the white lines between the code lines rendering artefacts or real? When I open the PDF in Adobe Reader and zoom in, I can still see them. Not very nice.


title: How do I split large numbers into groups of five digits?

text: I need to split a number of 27 digits into groups of 5 digits. I already had a look at `siunitx`, `telprint` and `numprint`. But these just allow me to generate groups of two or three digits. Is there any known way to do split the number into groups of 5?


title: Colored box for theorem with ntheorem

text: I would like to have every theorem with the same style to have the same colored box and to be able to configure the color. Like this : ![enter image description here](http://i.stack.imgur.com/F1Jll.jpg) I tried to use the package ntheorem with the option framed and to call the package framed but LaTeX returned the following errors :               ! Undefined control sequence.\att@framecommand ->\psframebox[fillstyle=solid, fillcolor=red, linecolor=red] \begin{att}      Compiled with the following code :               \documentclass[12pt,a4paper]{book}          \usepackage[utf8]{inputenc}     \usepackage[francais]{babel}     \usepackage[T1]{fontenc}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{lmodern}     \usepackage{fourier}               \usepackage{etoolbox} %Pour la forme des démonstrations     \usepackage{fancybox,lipsum,changepage}     \usepackage[thmmarks, amsmath, framed]{ntheorem}     \usepackage{framed} % Pour les fonds colorés     \usepackage{pifont} % Pour les symboles !     \usepackage[x11names]{xcolor} % Pour la couleur !               \begin{document}          {         \shadecolor{red}         \theoremstyle{break}         \theoremheaderfont{\sffamily\bfseries}         \theorembodyfont{\sffamily}         \newshadedtheorem{att}{\danger Attention !}          }          \begin{att}     \lipsum[1]     \end{att}               \end{document}      My try for the package tcolorbox give this result : ![enter image description here](http://i.stack.imgur.com/nKvUq.png) the following error :               ! Undefined control sequence.\kvtcb@fonttitle ->\sffamily \bfserie L      With this code :               \documentclass[12pt,a4paper]{book}          \usepackage[utf8]{inputenc}     \usepackage[francais]{babel}     \usepackage[T1]{fontenc}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{lmodern}     \usepackage{fourier}               \usepackage{etoolbox} %Pour la forme des démonstrations     \usepackage{fancybox,lipsum,changepage}     \usepackage[thmmarks, amsmath, framed]{ntheorem}     \usepackage{framed} % Pour les fonds colorés     \usepackage{pifont} % Pour les symboles !     \usepackage[theorems]{tcolorbox} % Pour la couleur !                    \begin{document}          \newtcbtheorem     {att}{\danger Attention !}     %     {colback=green!5,colframe=green!35!black,fonttitle=     \sffamily\bfserie     }{th}           \begin{att*}     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus     elit, vestibulumut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida     mauris. Namarcu libero, nonummy eget, consectetuer id, vulputate a, magna.     Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus     et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra     metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus     eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium     quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum.     \end{att*}               \end{document}


title: How do I center and scale vertical harpoons?

text: I need to create something very much like this: ![](http://i.stack.imgur.com/1N5rx.png) However, I'm having trouble scaling the vertical harpoons to make them look right with the rates on either side. For the horizontal harpoons I'm using `\xleftrightharpoons`. Also, I need to fix it all so the `+`, the harpoons, and the `\cdot` are all aligned vertically. What I have so far is this:               \documentclass{article}     \usepackage{mathtools}     \usepackage{amssymb,amsmath}     \usepackage{mathabx}        \begin{document}          \begin{align*}     Ras^{GDP}&+SOS & Ras^{free}&+SOS & Ras^{GTP}&+SOS     \\      k_{p3}&\downupharpoons{k_{m3}} &  k_{p2}&\downupharpoons{k_{m2}} &  k_{p7}&\downupharpoons{k_{m7}}     \\     Ras^{GDP}&\cdot{SOS} &\xleftrightharpoons[k_{m4}]{k_{p4}} Ras^{free}&\cdot{SOS} &\xrightleftharpoons[k_{m4}]{k_{p4}} Ras^{GTP}&\cdot{SOS}     \end{align*}           \end{document}      Which looks like this: ![](http://i.stack.imgur.com/2iapj.png) I'd like the rates next to the vertical harpoons to look smaller and the vertical harpoons to be longer. Also, I'm not sure why I have that huge gap left of the horizontal harpoons but I'd obviously like to center that out.


title: Adding numbering/label of fullcite entries in text?

text: I've discovered `biblatex` and it's great. Specially for the `\fullcite` option which is exactly what I want (in order to add the full citation in the text and not wait for the bibliography section). However I was wondering if it is possible to add the numbering as well. For all intents and purposes I wish to have the same type of entry we would have in the bibliography section but in the text using a `\fullcite` type command.               \fullcite{toto}      should provide > [1] toto el al, 'writen by toto' At the moment it only produces > toto el al, 'writen by toto'


title: Random decoration of plot axis messes up direction of axis arrow

text: I've been experimenting with "xkcdifying" a plot I want to make, based on the information found here and some pasting from other sources (this is my first time using pgfplots). Everything worked fine so far, until I wanted to give the axes arrows. But it seems that the `random steps` decoration always turns up the arrow head on the x axis: ![enter image description here](http://i.stack.imgur.com/Wvx0L.png) If the marked line in the below code is commented out, the arrow is displayed correctly again, but of course the nice random effect is gone:               \documentclass{article}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \pgfplotsset{every axis/.append style={line width=1pt}}          \begin{axis}[%       axis lines=middle,       decoration={%         random steps, % CRITICAL LINE         segment length=1mm,         amplitude=0.2pt       },        every tick/.style={thick,black,decorate},       enlarge x limits=true,       y tick style={draw=none},       yticklabel=\empty,       every inner x axis line/.append style={->},       every inner y axis line/.append style={->},     ]     \begin{scope}[decoration={random steps,segment length=3pt,amplitude=0.5pt},decorate]     \addplot [blue,samples=50, domain=0:120] {(2479*x^6)/5513508000000-(13697*x^5)/61261200000+(7935509*x^4)/220540320000-(1889983*x^3)/816816000+(2038007*x^2)/40840800+(335201*x)/1021020};     \end{scope}     \end{axis}          \end{tikzpicture}     \end{document}      Now, am I right in my guess that this is an error due to the randomization? And how can it be fixed?


title: Special sign \pounds changed to dollar sign in alignment surrounding

text: I am writing a beamer and use               \begin{align*}     \pounds^i_M   etc.     \end{align*}      on a slide. The pounds sign then changes to a dollar sign. How do I write to get the pounds sign?               \documentclass{beamer}     \usepackage{amssymb}     \usepackage{apalike}     \usepackage{multicol}     \usepackage[all]{xy}     \usepackage[ngerman]{babel}     %\usepackage[applemac]{inputenc}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{endnotes}     \def\L{\mathcal{L}}     \setlength{\unitlength} {1mm}     \usetheme{Madrid}          \begin{document}          \frame { \maketitle}          \frame{ \frametitle{Prescriptions of \pounds \ I: Classical logical maxims} \begin{align*}     \pounds^i_M & \qquad A\rightarrow (B\rightarrow A)     \end{align*}     }     \end{document}


title: mathrm changes everything

text: I am trying to make the differentiation mark in integrals (d) not italic. Example:               \documentstyle[html]{article}       \title{QED}     \author{Ali}          \date{September 8, 2013}     \begin{document}                \maketitle                        \section{Q1}       Test            \[ \int 2x \mathrm{d}x = x^{2} \]      \end{document}      This makes ALL the letters that appear after mathrm non italic. But I only want the "d" to be non italic, not everything. Any idea?


title: Modify eqnarray to match that of amsmath's align

text: This is a follow-up question to `\eqnarray` vs `\align`. Sadly, some journals (and their accompanying document classes) still require the use of `eqnarray` to arrange a number of equations in a single block. What would be the easiest (and best) way to modify the `eqnarray` environment to match the output of `align` _without_ having to modify the input regime. Something that produces the _output_ of the second set of equations (in `align`) given the first set (in `eqnarray`): ![enter image description here](http://i.stack.imgur.com/1YGFX.png)               \documentclass{article}     \usepackage{amsmath}% http://ctan.org/pkg/amsmath     \begin{document}     \begin{eqnarray}       f(x) & = & ax^2 + bx + c \\       g(x) & = & dx^2 + ex + f     \end{eqnarray}          \setcounter{equation}{0}     \begin{align}       f(x) & = ax^2 + bx + c \\       g(x) & = dx^2 + ex + f     \end{align}     \end{document}       The idea is to provide a very minimal package that could be added to a document when it still uses `eqnarray`, without having to modify the code used for `eqnarray`. My first attempt was to modify the setup within `\eqnarray` (from `latex.ltx`). Currently defined as               \def\eqnarray{%        \stepcounter{equation}%        \def\@currentlabel{\p@equation\theequation}%        \global\@eqnswtrue        \m@th        \global\@eqcnt\z@        \tabskip\@centering        \let\\\@eqncr        $$\everycr{}\halign to\displaywidth\bgroup            \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel           &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil           &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep              $\displaystyle{##}$\hfil\tabskip\@centering           &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup              \tabskip\z@skip           \cr     }      It's obvious that the three components of an equation are handled _separately_. Additionally, a horizontal skip of `2\arraycolsep` is inserted around the middle component while also making that component equivalent to `\mathord` (wrapping it within `{..}`). A possible correction of this is therefore: ![enter image description here](http://i.stack.imgur.com/tziZR.png)               \documentclass{article}     \usepackage{amsmath}% http://ctan.org/pkg/amsmath     \makeatletter     \def\eqnarray{%        \stepcounter{equation}%        \def\@currentlabel{\p@equation\theequation}%        \global\@eqnswtrue        \m@th        \global\@eqcnt\z@        \tabskip\@centering        \let\\\@eqncr        $$\everycr{}\halign to\displaywidth\bgroup            \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel           &\global\@eqcnt\@ne${}##{}$% Removed horizontal skip + forced mathord           &\global\@eqcnt\tw@% Removed horizontal skip              $\displaystyle{##}$\hfil\tabskip\@centering           &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup              \tabskip\z@skip           \cr     }     \makeatother     \begin{document}     \begin{eqnarray}       f(x) & = & ax^2 + bx + c \\       g(x) & = & dx^2 + ex + f     \end{eqnarray}          \setcounter{equation}{0}     \begin{align}       f(x) & = ax^2 + bx + c \\       g(x) & = dx^2 + ex + f     \end{align}     \end{document}      What else?


title: Table notes in threeparttable misaligned

text: Very new to this. Have written something like this:               \begin{threeparttable}          ..... table contents....               \end{tabular}        \begin{tablenotes}[flushleft]          \small     \item table comment 1     \item table comment 2     \item blah blah comment 3        \end{tablenotes}      \end{threeparttable}      I wanted the notes to be flush left against the left edge of table, which it has done, but it is misagligned - there is a space before the first character of the first line of each note, the second line is aligned further left. So looks like this:                   table comment 1..........           table 1 comment continued (spans two lines)              table comment 2      I want the notes to line up left in a straight line. Also, anyway to put a small space between the notes? Thanks for any help!


title: Change matrix figure layout

text: I have a figure where I am writing som matrices I want something like ![enter image description here](http://i.stack.imgur.com/D5JGv.png) but I am getting this, How to change it? ![enter image description here](http://i.stack.imgur.com/GHWxP.png) I have               \begin {figure}[h]     \centering      \small      \textbf{X}     \[\left( \begin{array}{cccc}     x_{11} & x_{12} &\cdots & x_{1d} \\     x_{21} & x_{22} &\cdots & x_{2d} \\     \vdots & \vdots &\ddots & \vdots  \\     x_{n1} & x_{n2} &\cdots & x_{nd} \end{array} \right)\]     \[ \boldsymbol{n \times d} \]     \textbf{Data}     \Huge      \[\downarrow \]     \small     \textbf{\[\rho\]}     \[\left( \begin{array}{cccc}     \rho_{11} & \rho_{12} &\cdots & \rho_{1d} \\     \rho_{21} & \rho_{22} &\cdots & \rho_{2d} \\     \vdots    & \vdots    &\ddots & \vdots    \\     \rho_{d1} & \rho_{d2} &\cdots & \rho_{dd} \end{array} \right)\]     \[ \boldsymbol{d \times d} \]     \textbf{Correlation Matrix}     \Huge      \[\downarrow \]     \small     \textbf{U}     \[\left( \begin{array}{ccc}     u_{11} & \cdots & u_{1d} \\     \vdots & \ddots & \vdots    \\     u_{d1} & \cdots & u_{dd} \end{array} \right)\]     \[ \boldsymbol{d \times d} \]     \textbf{EigenVectors}     \textbf{\[\Sigma\]}     \[\left( \begin{array}{ccc}     \sigma_{11} & 0         & \cdots \\     0                & \ddots & \vdots    \\     \vdots        & \cdots & \sigma_{dd} \end{array} \right)\]     \[ \boldsymbol{d \times d} \]     \textbf{Singular Values}     \caption{ Steps in matrix notation of SVD}     \label{fig:stpeE}     \end{figure}


title: Fully connected network diagram

text: I'm trying to draw a fully connected network diagram. I've been using the source code from this answer ( Neural Network representation) however, if I create new nodes the nodes do not attach themselves to each other node automatically. ![enter image description here](http://i.stack.imgur.com/Fuv1N.png) EDIT: I have this so far (this code is modified from the answer that I have linked to above):               \documentclass{article}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage{tikz}     \usetikzlibrary{calc}     \usetikzlibrary{arrows}     \begin{document}       \begin{tikzpicture}         %%Create a style for the arrows we are using         \tikzset{normal arrow/.style={draw, thin}}         %%Create the different coordinates to place the nodes         \path (0,0) coordinate (1) ++(0,-2) coordinate (2) ++(0,-2) coordinate (3);         \path (1) ++(-3,-.2) coordinate (x1);         \path (3) ++(-3, .2) coordinate (x2);         %%Use the calc library and partway modifiers to generate the second and third level points         \path ($(1)!.5!(2)!3 cm!90:(2)$) coordinate (4);         \path ($(2)!.5!(3)!3 cm!90:(3)$) coordinate (5);         \path ($(4)!.5!(5)!3 cm!90:(5)$) coordinate (6);         \path (6) ++(3,0) coordinate (7);         %%Place nodes at each point using the foreach construct         \foreach \i/\color in {1/Magenta!60,2/MidnightBlue!60,3/CadetBlue!80,4/CadetBlue!80,5/CadetBlue!80,6/CadetBlue!80}{           \node[draw,circle,shading=axis,top color=\color, bottom color=\color!black,shading angle=45] (n\i) at (\i) {$f_{\i}(e)$};         }         %%Place the remaining nodes separately         \node (nx1) at (x1) {$\mathbf{x_1}$};         \node (nx2) at (x2) {$\mathbf{x_2}$};         \node (ny)  at (7)  {$\mathbf{y}$};         %%Drawing the arrows         \path[normal arrow] (nx1) -- (n1);         \path[normal arrow] (nx1) -- (n3);         \path[normal arrow] (nx2) -- (n1);         \path[normal arrow] (nx2) -- (n3);         \path[normal arrow] (n1)  -- (n4);         \path[normal arrow] (n1)  -- (n5);         \path[normal arrow] (n2)  -- (n4);         \path[normal arrow] (n2)  -- (n5);         \path[normal arrow] (n3)  -- (n4);         \path[normal arrow] (n3)  -- (n5);         \path[normal arrow] (n4)  -- (n6);         \path[normal arrow] (n5)  -- (n6);         \path[normal arrow] (n6)  -- (ny);         %%Drawing the cyan arrows including the labels         \path[normal arrow,Cyan] (nx1) -- node[above=.5em,Cyan] {$\mathbf{w_{(x1)2}}$} (n2);         \path[normal arrow,Cyan] (nx2) -- node[below=.5em,Cyan] {$\mathbf{w_{(x2)2}}$} (n2);       \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/s2L0K.png) The problems with my solution is that it has unnecessary labels, as well as a node at the very end, which is unnecessary. I can't find a way to position the nodes cannot be positioned in a circular pattern in my solution.


title: Subscript Bracket

text: > **Possible Duplicate:**   >  How to put a big bracket under different parts of a equation so that I > could write e.g. a text specific to that part in the equation? Does anyone know how to code the subscript squiggle thing? It looks kind of like               $f_a + f_a + f_a$        ~~~~~~~~~~~~~~~~~              f_n        I personally don't know how to explain it. It's used in math. If you have a set of numbers and you put the squiggle underneath them and in the center below the squiggle you put like `f_n` denoting that the expression above the squiggle is the same as `f_n`.


title: Change the size of only a part/subset of a single equation

text: For example, I'd like to do:               $Q^{r<1}$      but with the `r<1` having a much smaller font size than the `Q`. Of course `r<1` will naturally have a smaller size since it is a superscript, but I want to make it even smaller, without changing the size of `Q`. I prefer a solution in LyX, but a TeX solution will do.


title: How come Minion is such a hassle to use in pdfLatex when Palatino isn't?

text: Palatino (or some copy of it) is very easy to use in pdfLatex -- just use package `mathpazo` and you're set to go. How come Minion doesn't have such an easy-to-use package? I tried to install it using a step-by-step guide, but in the end it complained about missing some font file. And it took me a couple of hours just to get there.


title: How to change the language of the TeXStudio?

text: I just can't figure out how to change the language of the IDE itself (not for the document)? I am using TeXStudio (v.2.6.2).


title: Multilingual citation lists with apacite

text: I am writing a paper for university and i need to use german and english captions in the bibliography list. If the source is in english then the entry must be also in english, if it's in german it must be in german. Can anybody help me. I am using apacite and bibtex since i have to cite according to APA.


title: Why is LateX Suite (Vim) so inconsistent

text: I am trying to transition to Latex Suite for Vim, but it seems to have several problems, observe: ![Latex Suite Screenshot](http://i.stack.imgur.com/gh9dz.jpg) The first `\subsection` command (90) is shown but the second one (124) is not. Again the third one is (132), but the fourth one isn't (154). A similar problem exists for the figure (163). There is other strange behaviour too, sometimes the `\begin{itemize}` doesn't fold at all, other times, only its individual items fold. There seems to be no method to this madness, if I issue any of the commands   * `za`   * `zM`   * `zR` nothing really changes. ~~If I have word wrap set, folding and unfolding might result in the entire line disappearing (until I scroll down)~~. Is this problem specific to me (ie. am I using it incorrectly, installed it incorrectly...) or is Latex-suite unreliable?


title: How to print the newline character "\\" from a macro so that it is recognized as newline in tabular

text: > **Possible Duplicate:**   >  How to programmatically make tabular rows using `\\\whiledo` ? I have a problem that may have an interesting answer. I am writing a macro whose output I would like to be a collection of rows to use within a tabular environment. I would like to do something similar to the following:               \begin{tabular}{stuff}       \myMacro{}     \end{tabular}      and the net effect would be,               \begin{tabular}{stuff}       row1\\       row2\\     \end{tabular}      However, the following code:               \documentclass{report}     \usepackage{xparse}     \usepackage{etoolbox}          \newbool{myBool}%     \newcounter{rownum}%     \setcounter{rownum}{0}          \NewDocumentCommand\buildrows{}{%     \booltrue{myBool}%     \whileboolexpr{ bool {myBool} }{%        \stepcounter{rownum}%        \ifnumless{\therownum}{5}%           {\therownum\\}%           {\boolfalse{myBool}\setcounter{rownum}{0}}%     }%     }          \begin{document}     \noindent     \begin{tabular}{|c|}     \buildrows{}     \end{tabular}\\     Above is the output from buildrows, called inside of tabluar.     \hrule          \vspace{1cm}     \noindent     \buildrows{}     Above is the output from buildrows, after using tabular.     \hrule          \vspace{1cm}     \noindent     \buildrows{}     Above is the output from buildrows, after using buildrows.     \hrule          \vspace{1cm}     \noindent     \begin{tabular}{|c|}     1     2     3     4     5     \end{tabular}\\     This is what I think the first command is doing, but its not.     \hrule     \end{document}      (where the command in question is: `{\therownum\\\\}%`) is doing some weird things.   * First, and this is 'obvious' after thinking about it, rather than printing the `\\\` to use in tabular, a new line is started and the loop progresses. How can I have the loop print the `\\\` so that it is recognized by tabular? Subbing `\textbackslash` doesn't work.   * Second, what is tabular doing to the counter so that it starts at 2 the second time around? Thanks for any help you can give!


title: Workaround how to use expl3 functionality in tikz

text: # What I want to do I want to create a command `\planfigur{<edges>}{<angles>}` which draws a triangle using `TikZ`. `\planfigur` should have 2 mandatory arguments, which let me specify edges and/or angles (where a = alpha, b = beta and c = gamma) of the triangle, which are drawn in red instead of black color. E. g. `\planfigur{ab}{bc}` draws a black triangle, where the edges a and b and the angles beta and gamma are red. ![planfigur](http://i.stack.imgur.com/pquw1.png) I use `expl3` and `xparse`. I already have read (Is it reasonable to expect an expl3-compatible release of TikZ/PGF in the future?), that there are problems in using `expl3` and `tikz` together (which makes sense). So I played around and tried to outsmart `TikZ`. I had the following idea, which unfortunately doesn't work (1:0 for `TikZ` :-)). The approach is to move all `expl3` code into a new command, where I can use `\tl_if_in:nnT` to check the arguments. # Code               \documentclass{article}          \usepackage{expl3, xparse}          \usepackage{tikz}     \usetikzlibrary{calc}          \ExplSyntaxOn          \tl_new:N \__edu_planfigur_temp          \DeclareDocumentCommand \planfigurLines { m } {            \tl_clear:N \__edu_planfigur_temp            \tl_if_in:nnT {#1} {a} {         \tl_put_right:Nn \__edu_planfigur_temp {\draw (b) -- (c);}       }            \tl_if_in:nnT {#1} {b} {         \tl_put_right:Nn \__edu_planfigur_temp {\draw (a) -- (c);}       }            \tl_if_in:nnT {#1} {c} {         \tl_put_right:Nn \__edu_planfigur_temp {\draw (a) -- (b);}       }            \tl_use:N \__edu_planfigur_temp     }          \DeclareExpandableDocumentCommand \planfigurAngles { m } {       \tl_if_in:nnT {#1} {a} {         \tl_put_right:Nn \__edu_planfigur_temp {\draw ($(a) + (0:1)$) arc (0:40:1) ($(a) + (20:0.7)$) node {$\alpha$};}       }       \tl_if_in:nnT {#1} {b} {         \tl_put_right:Nn \__edu_planfigur_temp {\draw ($(b) + (120:1)$) arc (120:180:1) ($(b) + (150:0.7)$) node {$\beta$};}       }       \tl_if_in:nnT {#1} {c} {         \tl_put_right:Nn \__edu_planfigur_temp {\draw ($(c) + (220:1)$) arc (220:300:1) ($(c) + (260:0.65)$) node {$\gamma$};}       }            \tl_use:N \__edu_planfigur_temp     }          \ExplSyntaxOff          \DeclareExpandableDocumentCommand \planfigur { m m } {       \begin{tikzpicture}[scale=0.65, line join=round, thick]              \coordinate (a) at (0,0);         \coordinate (b) at (5,0);         \coordinate (c) at (3.37, 2.83);              \draw (a) -- node[below] {$c$} (b) -- node[above right] {$a$} (c) -- node[above left] {$b$} (a) -- cycle;              \draw (a) node[left] {$A$};         \draw (b) node[right] {$B$};         \draw (c) node[above] {$C$};              \begin{scope}[color=red, fill=red!25, very thick]           \planfigurLines{#1}           \planfigurAngles{#2}         \end{scope}          \end{tikzpicture}     }          \begin{document}          \planfigur{ac}{a}          \end{document}      # Error > ! Package pgf Error: No shape named 0:1 is known. > > See the pgf package documentation for explanation. Type H for immediate > help. ...   >  l.70 \planfigur{ac}{a}


title: Evenly split the columns of a multirow table in lyx

text: I would like to have a table like this:               % Preview source code          %% LyX 2.0.6 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[spanish,english]{scrartcl}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     %% Because html converters don't know tabularnewline     \providecommand{\tabularnewline}{\\}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{lipsum}     \usepackage{array}     \newcolumntype{C}{>{\centering\arraybackslash}m{10em}}     \usepackage{amsmath}          \makeatother          \usepackage{babel}     \addto\shorthandsspanish{\spanishdeactivate{~<>}}          \begin{document}     \selectlanguage{spanish}%     \begin{center}     \begin{table}     \begin{centering}     \begin{tabular}[b]{|c|C|C|C|}     \hline      Fkrmula & \multicolumn{3}{c|}{$\frac{2\alpha}{\beta+5.4\cos{\left(\pi\gamma\right)}}$}\tabularnewline     \hline      Error & \multicolumn{3}{c|}{$\sqrt{4\left\lvert {\frac{\Delta_{\alpha}}{\beta+5.4\cos{\left(\pi\gamma\right)}}}\right\rvert ^{2}+4\left\lvert {\frac{\Delta_{\beta}\alpha}{\left(\beta+5.4\cos{\left(\pi\gamma\right)}\right)^{2}}}\right\rvert ^{2}+116.64\pi^{2}\left\lvert {\frac{\Delta_{\gamma}\alpha\sin{\left(\pi\gamma\right)}}{\left(\beta+5.4\cos{\left(\pi\gamma\right)}\right)^{2}}}\right\rvert ^{2}}$ }\tabularnewline     \hline      Variable & $\beta$ & $\gamma$ & $\alpha$\tabularnewline     \hline      Valor & $1.02$ & $0.600$ & $5.0$\tabularnewline     \hline      Error & $0.10$ & $0.006$ & $0.5$\tabularnewline     \hline      Error en resultado & $2.4$ & $2.3$ & $1.5$\tabularnewline     \hline      Error total & \multicolumn{3}{c|}{$3.7$}\tabularnewline     \hline      Resultado & \multicolumn{3}{c|}{$-15\pm4$}\tabularnewline     \hline      \end{tabular}     \par\end{centering}          \caption{Errores}     \end{table}          \par\end{center}\selectlanguage{english}%          \end{document}      Where the three small columns are evenly split. I have tried this solution, but columns are only approximately equal when I set the correct parameter of the width. The problem us that I don't know what's going to be inside the cells (as the tables are autogenerated) nor the number of columns, and don't want to manually set the width every time; ie, there can be longer or shorter formulas in the second row and the number of var columns can be different for each table. Ideally, the resulting table should be editable in the normal lyx gui (not ERT). Also, I'd like to have more vertical spacing for the formulas.


title: Difficulty getting pgfkeys to set my fontsizes as I want

text: I apologize that this isn't particularly short. I'm going through old code and refactoring. In the process, I'm running into various _bugs_ in how I've written things. In this particular example, the font sizes are not getting properly initialized and I can figure out why. My issue here is that I can't seem to get the `usefontsize/.initial` to take effect unless I explicitly make a call to the `fontsize` key.               %-@-(1)-     \begin{filecontents}{samplecode}     % first line of material I don't want to see       \documentclass{article}       \begin{document}       document content here       \end{document}     \end{filecontents}     %-@-(2)-     \begin{filecontents}{ncode}     \makeatletter     \def\ae@box@fbox{}     \def\ae@mboxheight{}     \def\ae@value@is@none{}     \def\code@cat{%       \renewcommand{\FancyVerbFormatLine}[1]{##1}%       \ae@ncode@set{fontsize/relsize={-0.75},                     examcodecolor,                     input/method={\VerbatimInput                            [gobble=\ae@ncode@get{gobble},                             firstline=\ae@ncode@get{firstline},                             lastline=\ae@ncode@get{lastline},                             firstnumber=\ae@ncode@get{firstnumber},                             numbers=\ae@ncode@get{numbers},                             numbersep=\ae@ncode@get{numbersep},                             fontfamily=courier,                             fontsize=\relsize{-0.75},                            ]}}}     \pgfkeys       {%         /ae/ncode/.is family,         /ae/ncode,         %%:         input/method/.initial,         %%:         examcode/.code       = {\code@cat},         %%:         gobble/.initial        = 2,         width/.initial         = 3in,         firstline/.initial     = 1,         lastline/.initial      = 5000,         firstnumber/.initial   = 1,         rulecolor/.initial     = black,         fillcolor/.initial     = red!20,         numbers/.initial       = none,         numbersep/.initial     = 1em,         indent/.initial        = 0pt,         %%:         usefontsize/.initial     = \normalsize,         fontsize/.style          = { usefontsize=\csname #1\endcsname},         fontsize/relsize/.style  = { usefontsize=\relsize{#1}},         %%:         examcodecolor/.style   = { fillcolor=#1 },         examcodecolor/.default = red!30,         %%:         mboxheight/.initial = \ae@mboxheight,         height/.code = {\expandafter\ifx\csname ae@value@is@#1\endcsname\ae@value@is@none\else                         \edef\ae@mboxheight{[#1]}\fi                          },         %%:         /ae/ncode/.cd,         fbox/.style = { select/box/style/#1/.get = \ae@box@fbox, },          select/box/style/.cd,           none/.initial,           fbox/.initial      = \fbox,           fcolorbox/.initial = \fcolorbox{\ae@ncode@get{rulecolor}}{\ae@ncode@get{fillcolor}},                          }     \def\ae@ncode@get#1{\pgfkeysvalueof{/ae/ncode/#1}}     \def\ae@ncode@set{\pgfqkeys{/ae/ncode}}     \newcommand{\nncode}[2][]{%       \pgfqkeys{/ae/ncode}{usefontsize,#1}% <--- doesn't seem to matter whether `usefontsize` is here or not       \edef\ae@begin@minipage{\noexpand\minipage[t]\ae@ncode@get{mboxheight}{\dimexpr\ae@ncode@get{width}-\ae@ncode@get{indent}}}%       \ae@box@fbox{%         \hspace*{\ae@ncode@get{indent}}%'         \ae@begin@minipage           \ae@ncode@get{usefontsize}% <--- doesn't seem to be taking effect in left version           \ae@ncode@get{input/method}{#2}%'         \endminipage}%'      }     \makeatother     \end{filecontents}     %-@-(3)-     \documentclass{article}     \usepackage{pgfkeys}     \usepackage{fancyvrb}     \usepackage{relsize}     \usepackage{xcolor}     \usepackage[margin=0.5in]{geometry}     \input{ncode}     \setlength{\parindent}{0pt}     \begin{document}          Shouldn't the left and the right boxes look identical?          {\nncode[examcode,             width={\dimexpr2.25in-2\fboxrule-2\fboxsep},             fbox=fcolorbox,             height=none,             firstline=6,             gobble=2,             indent=0.5em,             fontsize=normalsize,            ]{samplecode}}%     %%'     {\nncode[examcode,             width={\dimexpr2.25in-2\fboxrule-2\fboxsep},             fbox=fcolorbox,             height=none,             firstline=6,             gobble=2,             indent=0.5em,     %        fontsize=normalsize,            ]{samplecode}}%          \end{document}      ![enter image description here](http://i.stack.imgur.com/oxpdp.png) I know there are parts of this code I could have written differently. For example, it looks like I could have just written one key word `fontsize` to accept, not a bare word, but the actual command name for the font. But keep in mind that I'm refactoring old code. My old version of this code, when I was just learning to use _key-values_ , didn't allow me to pass command names. I now have hundreds of lines of code which now depend upon that old syntax. So, I need a solution that recognizes the need for the `fontsize` key word to accept a bare word (instead of macro name) for its value. Similarly with the wonky way I'm handling the keyword `height` since in my old code it's not always specified as a dimension. **EDIT** I should point out that there are other keys where I do similar _finagling_ with other initialized keys. For example, `examcodecolor` resets the `fillcolor`, but seems to work fine whether or not `examcodecolor` was actually invoked. A bit more off the beaten path is `height`, but if you redefine `\ae@mboxheight` as say:               \def\ae@mboxheight{[2in]}      without having to invoke `height` at all the correct parameter value is used. Is there something special about `\normalsize` that I'm not considering? Is it somehow being invoked at the time I'm defining `usefontsize/.initial`?


title: Linux Libertine small caps fail for some Unicode characters

text: I'm using XeTeX and Linux Libertine, since I want "true" small caps. However it seems that the small caps don't work for certain Unicode characters. Here is a minimal example:               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Linux Libertine O}     \begin{document}     h ħ ö Ö H Ħ          \scshape{h} \scshape{ö} \scshape{ħ}     \end{document}      This is what I get in my PDF (using `latexmk -xelatex`): ![Small caps fails with some Unicode characters](http://i.stack.imgur.com/NxwfM.png) I am using the latest OTF versions of Libertine (downloaded just now). When I try this sequence on the Linux Libertine live-renderer, the smallcaps ħ is displayed correctly: ![Screenshot from Linux Libertine live- renderer](http://i.stack.imgur.com/lZMdI.png) So this must be a Xetex thing. Any ideas?


title: LaTeX: Different spaces when using readarray, whiledo and value

text: _**The answer of the following problem is given in Ulrikes Comment. Thank you very much!_** I am trying to use external data for similar documents I have to write. The number of these data varies so I would like to use whildo or forloop, but both tools create too big spaces between the single data sets. Thank you Trillan Here is a short example:               \documentclass[a4paper,10pt]{scrartcl}          \usepackage{ifthen}     \usepackage{arrayjob}     \usepackage{forloop}          %opening     \newarray\Test     \readarray{Test}{%        Eintrag 1&%        Eintrag 2&%        Eintrag 3&%        Eintrag 4     }%          \begin{document}          Normal Space:          \Test(2) \Test(3) \Test(4) \Test(1)          \newcounter{i}     \setcounter{i}{1}          Big Space mit whiledo:     \whiledo {\value{i}  <  5}{%        \Test(\value{i})%        \stepcounter{i}     }%          A little bit better with forloop:          \forLoop[1]{1}{4}{i}{%       \Test(\value{i})%     }          Without value everthing is working fine:          \setcounter{i}{1}     \whiledo {\value{i}  <  5}{%        \Test(3) %        \stepcounter{i}%     }%          \end{document}


title: Upright math in italic lemma

text: I naively entered the following math-mode/text mix in a theorem environment, but the way LaTeX treats the parenthesis doesn't seem right. Especially upright math formulas in italic text parenthesis look strange, even though this is exactly how I would write it in regular text. Also the parenthesis in the end seem weird in contrast to the big upright one in the formula. Is this a problem in LaTeX that is supposed to be circumvented manually? If so, what is the best way to make this look more consistent?               \begin{conj}       Let $a$ ($b$) be $3$ ($5$). (Recall that $c=\Big( \AImatrix(C) \lor \AIclause(C) \Big)$.)     \end{conj}      ![enter image description here](http://i.stack.imgur.com/chgJh.png)


title: How to make the document title appear in PDF bookmarks?

text: My sections and subsections appear in the bookmarks, but the title does not. I've seen papers including their titles as bookmarks in the PDF.


title: Something is wrong with my multirow

text: \begin{tabular}{p{2cm} p{2cm} p{2cm} p{2cm} p{2cm}}     \hline       & \multicolumn{2}{c}{Latin America}& \multicolumn{2}{c}{ Africa}\\     \hline       & {\large $\Delta p_c$} &  {\large $\Delta p_o$} & {\large $\Delta p_c$} & {\large $\Delta p_o$}\\     \hline     {\large $\Delta p_{c-1}$} &–1.191***    & 0.361*** & –1.07*** & 0.382** \\       & (0.153) & (0.153) & (0.16) & (0.196) \\          {\large$\Delta p_{o-1}$} & –0.084 & –0.084 & 0.120 & 0.283*\\       & (0.149) & (0.149) &(0.215) & (0.155)\\            $c$ & –0.001 & 0.005 & 0.001 & 0.003\\       & (0.025) & (0.025) & (0.029) & (0.035)\\            $\alpha $& 0.073 & –0.580*** & 0.150 & –0.497***\\       & (0.323) & (0.172) & (0.236) & (0.197)\\     \hline     \end{tabular}          \begin{tabular}{p{2.5cm}| p{1cm} p{1cm} p{1cm} p{1cm} p{1cm} p{1cm} p{1cm}}     \multicolumn{7}{l}{Test results}\\     \hline          $R^2$ &0.428 &  & 0.174 & & 0.428 & & 0.174 \\          \textit{F-statistic} & 6.988** &  & 3.181* &  & 6.988** & & 3.181*\\            \textit{Log Likelihood} &  & 30.87 &  &  &  & 16.57 &\\            \multirow{2}{*}{\textit{LM-Test (p-values) for autocorrelation, lag 1}} & & & & & & &\\       & (0.323) & (0.172) & (0.236) & (0.197) & \\     & (0.025) & (0.025) & (0.029) & (0.035) &\\       \hline     \end{tabular}      ![enter image description here](http://i.stack.imgur.com/fHYZk.jpg) Please help me figure this out... the last row just isn't working.


title: How to make LyX process TeX code without converting it into .lyx format?

text: When I do `\input{file}` in a `.tex` document I later import in LyX, LyX converts `file.tex` into `file.lyx` and changes `\input{file}` to `\input{file.lyx}`. But LyX doesn't do well with the TeX code it does not support natively and `\input{file.lyx}` is a rather corrupted conversion. How can I make LyX just pass the code from `file.tex` to `pdflatex` as a part of a bigger file without LyX making any conversions?


title: How to implement forward-inverse-search with TeXStudio and Evince in Ubuntu?

text: I am using Ubuntu 12.04 with TexStudio and Evince 3.4.0 installed. Can I use them to realize forward-inverse-search between my tex source code and the pdf file? How? I tried the method described here, but it doesn't work for me. Maybe this is because I don't know how to edit their code. I tried `texstudio %f -line %l &` and `texstudio %.pdf -line %l &` in modifying the `evince` code provided in the line above. Hopefully there will be a perfect solution. PS: With the help of Daleif, I find out that the internal pdf-viewer of TeXStudio works perfectly on forward-inverse-search using the default `control-click` settings. I would leave this post open, in case anyone is still more interested in using the external Evince pdf reader. I will help verify the validity of solutions. Thanks.


title: What´s the best way to put footnotemarks in a flowchart?, with Pstricks/psmatrix?

text: The footmark may induce to confussion, so ... what´s the best practice to notemarks in flowcharts? ![image](http://i.stack.imgur.com/EA0Bp.png)


title: TikZ - Smooth curve surrounding points without specifying control points

text: This is what I have right now:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning,automata}     \definecolor{light-gray}{gray}{0.6}     \begin{document}     \begin{tikzpicture}[line width=.1cm,shorten >=0pt,auto,on grid=false, every state/.style={minimum size=0pt}, level distance=2.0cm, level 1/.style={sibling distance=2cm}, level 2/.style={sibling distance=1cm}, level 3/.style={sibling distance=.5cm}]     \tikzstyle{every node}=[font=\tiny , circle, outer sep=0pt, inner sep=0pt]                \node[state] (S) {}                child {node[state] (S1) {}                   child {node[state] (S11) {}                      child {node[state] (S111) {} }                      child {node[state] (S112) {} }                   }                   child {node[state] (S12) {}                      child {node[state] (S121) {} }                      child {node[state] (S122) {} }                   }                }                child {node[state] (S2) {}                   child {node[state] (S21) {}                      child {node[state] (S211) {} }                      child {node[state] (S212) {} }                   }                   child {node[state] (S22) {}                      child {node[state] (S221) {} }                      child {node[state] (S222) {} }                   }                };     \end{tikzpicture}     \end{document}      ![TikZ Tree](http://imgur.com/GlXxIG6.jpg) I want something like this: ![TikZ Tree with curves and arrows](http://i.imgur.com/dWed2hQ.jpg) Actually, this is just the top portion of the bigger tree I'm working on and I have to do this for a lot of paths in the tree, so I don't want to calculate the control points manually. I would rather just specify the points which the curve should surround(S, S1, S11, S111) and a distance which should be maintained between the points and the curve. Is this possible? Any help would be appreciated! Edit: I tried what percusse and Torbjørn T. suggested. Added this code in the tikzpicture:                          \node[draw=none, above=5mm of S] (1p1) {};                \node[draw=none, left =5mm of S1] (1p2) {};                \node[draw=none, left =5mm of S11] (1p3) {};                \node[draw=none, below left =5mm and 2mm of S111] (1p4) {};                \node[draw=none, below right=5mm and 2mm of S111] (1p5) {};                \node[draw=none, right=5mm of S11] (1p6) {};                \node[draw=none, right=5mm of S1] (1p7) {};                \node[draw=none, below right=5mm and 2mm of S] (1p8) {};                \draw[black, line width=0.05cm] plot [smooth cycle] coordinates {(1p1) (1p2) (1p3) (1p4) (1p5) (1p6) (1p7) (1p8)};                     \node[font=\small,rectangle,inner sep=5pt, above left=1.0cm and 0.5cm of 1p2] (curve) {Curve};                \path[->] (1p2) edge (curve);      The end result looks like this: ![TikZ tree with surrounded nodes](http://i.imgur.com/YcpsXu6.jpg) and contrary to my expectation, its pretty easy to use this method for a lot of paths just by copy-pasting and using regular expressions. While this solves my problem for now, it is not the solution to my question. A proper solution would still be really helpful!


title: \animategraphics does not show the poster image in pdf viewers without javascript support

text: Below is a minimal example that compiles fine but that does not show any image on viewers without javascript like evince, okular, xpdf, etc. Any ideas what going wrong (does not work either with the article class)? The animations work great on adobe reader though. I'm using TeX Live 2013/Debian.               \documentclass[compress]{beamer}          \usepackage{animate}          \title{title}          \begin{document}     \begin{frame}{animate}     \begin{center}     \animategraphics[autoplay,loop,width=0.6cm,poster=first]{4}{image-}{1}{4}     \end{center}     \end{frame}     \end{document}


title: Wrong sorting for Biber with Norwegian sortlocale

text: There is a problem with the sorting for Biber when using `sortlocale=nb_NO`.               \RequirePackage{filecontents}     \begin{filecontents}{test.bib}       @misc{a,author = {A}} @misc{b,author = {B}} @misc{c,author = {C}}       @misc{d,author = {D}} @misc{e,author = {E}} @misc{f,author = {F}}       @misc{g,author = {G}} @misc{h,author = {H}} @misc{i,author = {I}}       @misc{j,author = {J}} @misc{k,author = {K}} @misc{l,author = {L}}       @misc{m,author = {M}} @misc{n,author = {N}} @misc{o,author = {O}}       @misc{p,author = {P}} @misc{q,author = {Q}} @misc{r,author = {R}}       @misc{s,author = {S}} @misc{t,author = {T}} @misc{u,author = {U}}       @misc{v,author = {V}} @misc{w,author = {W}} @misc{x,author = {X}}       @misc{y,author = {Y}} @misc{z,author = {Z}} @misc{ae,author = {Æ}}       @misc{oe,author = {Ø}} @misc{aa,author = {Å}}     \end{filecontents}     \documentclass{article}     \usepackage[norsk]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[backend=biber,sortlocale=nb_NO]{biblatex}     \addbibresource{test.bib}     \begin{document}     \nocite{*}     \printbibliography     \end{document}      Compiling this file gives this result: ![](http://i.stack.imgur.com/2DhZl.png) The letters Æ, Ø and Å should be last. It seems this question looks too much like a bug report. I was kinda hoping for a workaround.


title: Empty line (in code) before enumerate environment

text: I like my code to look like this:               \documentclass{article}     \begin{document}          \begin{enumerate}       \item test text            \begin{enumerate}         \item 1         \item 2         \item 3         \item 4         \item 5       \end{enumerate}     \end{enumerate}          \end{document}      For the sake of readability I like to put a blank line before a new environment starts. In the particular case I'm considering, the blank line adds some vertical space between the item from the first level enumerate and the first item from the second level enumerate. So my question is: is there a best practice to format code related to blank lines before environments start? Should I avoid it? Should I comment out the blank line? **Clarification:** I'm talking about the vertical space between "test text" and "1". But, I'm not asking for a way to remove the extra space added by the blank like, I already know how to do that. My reasoning is the following: Since adding a blank like before a new enumerate adds vertical space, it means that that blank line is meaningful for TeX. Since it is meaningful for TeX, is it OK to use it for the mere purpose of formatting code or should I avoid it?


title: nodal-graph in table spacing issue

text: Good day, hi, I am having some difficulty with including graphics in a table. If you happen to have some spare time, please kindly enlighten me on the following problem I would like to know how to allow the table to align properly, i.e., the second column is equally spaced and I would like to use multirow on the the third column but failed. Could you please provide advice or guidance on the issue? Thanks a million in advance.               \documentclass{article}     \usepackage[english]{babel}     \usepackage{tikz}     \usepackage{multirow}          \begin{document}     \begin{tabular}{ |l|l|l|l| }     \hline     \multicolumn{4}{ |c| }{Convergence} \\     \hline     Time & \multicolumn{2}{ |c| }{Information} & Graph \\ \hline     \multirow{3}{*}{1} & Vertice & 1 &  \begin{tikzpicture}     [scale=.3,auto=left]     \node (n1) at (10.6,4.9) [draw, circle,fill=green!20] {1};     \node (n2) at (4,0.8) [draw, circle,fill=blue!20] {2};     \node (n3) at (3.8,11.4) [draw, circle,fill=green!20] {3};     \node (n4) at (0.1,6.4) [draw, circle,fill=green!20] {4};     \node (n5) at (3.6,3.4) [draw, circle,fill=blue!20] {5};     \node (n6) at (7.4,2.3) [draw, circle,fill=blue!20] {6};     \node (n7) at (9,10.4) [draw, circle,fill=green!20] {7};     \node (n8) at (18,10.8) [draw, circle,fill=green!20] {8};          \foreach \from/\to in {n6/n2,n2/n5,n5/n6}     \draw[blue] (\from) -- (\to);     \foreach \from/\to in {n1/n8,n8/n7,n7/n1,n3/n7,n4/n3}     \draw[green] (\from) -- (\to);     \foreach \from/\to in {n6/n1,n5/n4,n2/n4,n1/n5}     \draw[red] (\from) -- (\to);          \end{tikzpicture} \\ \cline{2-1} \cline{3-1}& ${P(1)}$ & 0.5 &   \\ \cline{2-2} \cline{3-2} & Chance & 0.5 &   \\          \hline     \multirow{3}{*}{1} & Vertice & 1 & 0.5  \\     & ${P(1)}$ & 0.5 & 0.5 \\     & Chance & 0.5 & 0.5 \\          \hline     \end{tabular}     \end{document}      ![](http://i.stack.imgur.com/g4lwl.png)


title: Switching fonts in section titles while maintaining a serif/sans-serif distinction for ToC vs. title itself

text: The solution to this problem is probably something absurdly simple, but I'm too stupid to see it … Consider a document written in blackletter. German blackletter typography rules require latin words and uppercase abbreviations to be set in antiqua. I have followed the advice of the fontspec package and created a new font family and a little `\antiqua`-macro. This works perfectly inside text paragraphs, because I know if I want a serif or a sans-serif typeface. However, I am not able to create something, that would render the antiqua part in sans-serif in the section title itself, while turning the same thing to the corresponding serif typeface in the table of contents … What's the simple solution?               \documentclass[12pt,a4paper,twoside]{scrreprt}     {numerous other packages}     \usepackage{mathspec} %loads fontspec     \setmainfont[Mapping=tex-text]{UnifrakturMaguntia} % for blackletter     \setsansfont[Mapping=tex-text]{UnifrakturCook} % for headers,     \newfontfamily\antiquafont[Mapping=tex-text]{LiberationSerif} %antiqua serif typeface     \newfontfamily\antiquasans[Mapping=tex-text]{LiberationSans} %antiqua sans-serif typeface     \newcommand\antiqua[1]{{\antiquafont #1}} %creates my antiqua-macro     \newcommand\antisans[1]{{\antiquasans #1}} %creates a similar macro for sans-serif antiqua typing          \begin{document}     \tableofcontents     \chapter{My Blackletter Text about \antisans{NMR}}     So any appearance of the abbreviation \antiqua{NMR,} other abbreviations,     other paragraph text \antiqua{etc.} can be set perfectly here, but     the \antiqua{NMR}-part in the table of contents will be sans-serif, which     it mustn't.     \end{document}      If I'm perfectly honest I wouldn't have expected this code to work without flaws, because there is no connection between the serif and the sans-serif part (save the fact that the name starts with the same word). The minimal example can of course be worked with any other combination of two fonts different enough to tell them apart.


title: How do I recreate these ornaments?

text: I was referring the `psvectorian` package for attractive borders and styles. I came across this: ![enter image description here](http://i.stack.imgur.com/VcUry.png) I badly know how to do this.The documentation doesn't show much on how to achieve this.Please help me.


title: Using 'bigfoot' and 'hyperref' package - PDF bookmarks reference to wrong page/line

text: Please compile the following document:               \documentclass{book}          \usepackage{bigfoot}     \usepackage{hyperref}     \usepackage{blindtext}          \begin{document}          \chapter{Chapter}          \blindtext          \blindtext           \blindtext           \blindtext          \blindtext            \blindtext          \blindtext              \section{MySection}          \blindtext            \blindtext            \end{document}      Open it in your Adobe Reader and use the 'two pages' view. The first section 'MySection' will be on the third page, so not visible if you open the document. If you use PDF bookmark for navigating to 'MySection', the page does not change! In Adobe 'single page' view, the page will change to page 2. In a 'continuous ' view, the view will change to the line right before page 3. To cut a long story short, the bookmark seems to be one line before the section header. Remove the `bigfoot` package and everything works as expected. I want to use the package, because it solves some footnote problems I have. Do you know any tweaks or fixes I can use in order to use the package **and** correct PDF bookmarks. Quote from `bigfoot` documentation: _Purpose of this package is to provide a one-stop solution to almost all problems related to footnotes. You can use it as a drop-in replacement of the manyfoot package, but without many of its shortcomings, and quite a few features of its own. It uses the existing document class layouts for footnotes, so you can usually use it without having to worry about the looks._


title: Fixing a circuit diagram

text: Making some electric circuits in tikz for the very first time, and need to replicate the following image ![enter image description here](http://i.stack.imgur.com/syTsR.png) Not a very complicated circuit. Now here is what I have done so far ![enter image description here](http://i.stack.imgur.com/JI0JV.png)               \documentclass[10pt,a4paper]{minimal}     \usepackage{tikz}     \usetikzlibrary{circuits}     \usetikzlibrary{circuits.ee.IEC}     \tikzset{circuit declare symbol = ac source}     \tikzset{set ac source graphic = ac source IEC graphic}     \tikzset{              ac source IEC graphic/.style=               {                transform shape,                circuit symbol lines,                circuit symbol size = width 3 height 3,                shape=generic circle IEC,                /pgf/generic circle IEC/before background=                 {                  \pgfpathmoveto{\pgfpoint{-0.8pt}{0pt}}                  \pgfpathsine{\pgfpoint{0.4pt}{0.4pt}}                  \pgfpathcosine{\pgfpoint{0.4pt}{-0.4pt}}                  \pgfpathsine{\pgfpoint{0.4pt}{-0.4pt}}                  \pgfpathcosine{\pgfpoint{0.4pt}{0.4pt}}                  \pgfusepathqstroke                 }               }             }     \begin{document}          \begin{tikzpicture}[circuit ee IEC]       \draw (0,0) to [capacitor={info={$q$\ \ $-q$}}]     ++(1, 0)                   to [resistor={info ={$R$}}]             ++(2, 0)                    to [current direction' = {info = {$I$}}]++(0,-2)                    to [inductor={info=$L$}]                  (0,-2)                     to [ac source={info={$V$}}]               (0,0);     \end{tikzpicture}          \end{document}      I have no idea what I have done so far, I just randomly copied examples from the internet. The nodes is a mess, as I just kept trying until they all connected. What does the ++ mean? And could someone help me understand how to fix my circuit diagram to resemble the image above? =)


title: What are some best practices for the typography of tables and figures?

text: I put captions above my tables and below my figures. I use the `booktabs` package (and no vertical lines) for my tables. Do I show both tables and figures (graphs) for the same data? If so, in what order? In general, should I use `[h]`, `[t]`, or `[b]` at all? When I should I use them? Is it okay for several floats to stack up on a page by themselves? Is it necessary to have a list of tables and a list of figures? If so, where? At the beginning (after the table of contents)? At the end of each chapter? At the end, before the index? (My particular use case is a thesis, but answers for all document types are appreciated.) **EDIT** : Also, where should tables and figures be placed in the source document? Definitely within the same section that references the table or figure, but in general before, in-between, or after the paragraphs in question?


title: Counters for Chapter and Section environments when using tcolorbox for listings

text: This is a followup question of this question. With my MWE I'm getting wrong `Listing numbers`, wrong `toc` (including Chapter and Section environments from listings) and wrong `bookmarks` in pdf `toc`. Any help will be highly appreciated. Thanks * * * ## MWE * * *               \documentclass[oneside]{book}     \usepackage{listings}     \usepackage{tcolorbox}     \tcbuselibrary{listings}%     \usepackage{xcolor}     \usepackage[bookmarks=true, bookmarksopenlevel=2]{hyperref}               %Definition of New Environments     \tcbset{     texexp/.style={colframe=green!85!black, colback=red!5!white,     coltitle=red!50!yellow!3!black, left=6mm,     listing options={style=tcblatex,numbers=left,numberstyle=\tiny\color{red!75!black}},     fonttitle=\small\textsc\bfseries, fontupper=\small, fontlower=\small},     example/.style 2 args={texexp,     title={Listing \thetcbcounter: #1},label={#2}},     }               \newtcblisting{texexp}[1]{texexp,#1}          \newtcblisting[auto counter,number within=section]{texexptitled}[3][]{%     example={#2}{#3},#1}          \newtcolorbox[use counter from=texexptitled]{texexptitledspec}[3][]{%     example={#2}{#3},#1}          \lstset{ % General setup for the package         language={[LaTeX]TeX},         basicstyle=\small\sffamily,         numbers=left,         numberstyle=\tiny,         frame=tb,         tabsize=4,         columns=fixed,         showstringspaces=false,         showtabs=false,         keepspaces,         commentstyle=\color{red},         keywordstyle=\color{blue}     }%                    \tcbset{listing engine={listings}}               \usepackage[english]{babel}     \usepackage{blindtext}          %%% Storage tool macros          \listgadd{\restorecounterlist}{} % Dummy list     \newcommand{\newbackupcounter}[1]{%       \ifltxcounter{#1}{%         \newcounter{backup#1}%       }{}%     }%               \newcommand{\PushCounterValue}[1]{%       \ifltxcounter{#1}{%         \setcounter{backup#1}{\number\value{#1}}         \setcounter{#1}{0}       }{%       }%     }%          \newcommand{\PushCounterValues}{%     \forlistloop{\PushCounterValue}{\restorecounterlist}%     }%               \newcommand{\PopCounterValue}[1]{%       \ifltxcounter{#1}{%         \setcounter{#1}{\number\value{backup#1}}%         \setcounter{backup#1}{0}% For 'safety'       }{}%     }%          \newcommand{\PopCounterValues}{%     \forlistloop{\PopCounterValue}{\restorecounterlist}%     }%               \AtBeginDocument{%     % Setup the counter lists and provide the backup counters     \forcsvlist{\listgadd{\restorecounterlist}}{part,chapter,section,subsection,subsubsection,paragraph,subparagraph}%     \forlistloop{\newbackupcounter}{\restorecounterlist}%     }%          \begin{document}          \tableofcontents          \mainmatter          \chapter{First Chapter}     \section{First Section}     \subsection{Outer subsection Number one}     \subsection{Outer subsection Number two}          \blindtext          % Redefine the document environment within a group     \begingroup     \PushCounterValues% Push the counter values to the backup values     \renewenvironment{document}{}{}     \renewcommand\documentclass[2][]{}     \setcounter{chapter}{0}          \begin{texexptitled}{Example}{mylab}     \documentclass{book}     \begin{document}       \chapter{Chapter Test}         \section{Section 334}         Here, we use Example  with a title line.     \end{document}     \end{texexptitled}     \PopCounterValues% Restore the original counter values%          \endgroup          \chapter{New Chapter}     \section{New Section}     \blindtext          \end{document}      * * * ## Output * * * ![enter image description here](http://i.stack.imgur.com/v2Pxc.png) ![enter image description here](http://i.stack.imgur.com/sACY1.png)


title: Determine whether the first non-space character of #1 is a letter?

text: Let's say I have a class file with `\title` command, and I want to check that the title starts with a letter, and not with math or a number or a symbol. How can I do that? This is my MnWE, the syntax of `\@iffirstnotletter` can be of course reasonably modified. If it recognized accented characters as well, it would be a bonus, but it's not necessary.               \documentclass{article}          \makeatletter     \newcommand\@iffirstnotletter[3]{#2} % <-- should be modified          \renewcommand\title[1]{\@iffirstnotletter{#1}{%         \GenericWarning{}{Please start the title with a letter!}%       }{}%       \def\@title{#1}%     }%     \makeatother          \title{Ahoj}          \begin{document}          \maketitle          \end{document}      * * * **EDIT:** My first idea was along the lines of this:               \def\ONETWO#1#2\ENDONETWO{#1} % strips the 1st token of                                  % whatever is between `\ONETWO...\ENDONETWO`     \def\@iffirstnotletter#1#2#3{%       % checks the \catcode of the 1st token of #1        \expandafter\ifnum\expandafter\the\expandafter\catcode         \expandafter`\csname\ONETWO#1\ENDONETWO\endcsname=11\relax       #3\else#2     \fi}      But it has a crazy behaviour for example when the very first thing is `\\(` as a beginning of a math-mode: then it gives `! Missing \endcsname inserted.`


title: Problem with Table of Contents chapter line breaking

text: I am working with the `book` document class. Concerning the table of contents, is there any way to break the chapter title as you like? For example, instead of e.g. >   1. How to effectively feed swiss brown cows so as to pro-   >  duce more milk > to have >   1. How to effectively feed swiss brown cows so as to   >  produce more milk > I don't want to make any changes in the body of the rest of the book, only in the table of contents. Is there any way??


title: Is it possible to use the figure environment with the standalone package?

text: I can not get `standalone` to work with figures; I get the error `Not in outer par mode`. (The figure is in the included file.)


title: Figure in standalone documentclass

text: I am using the document class:`\documentclass{standalone}`. However, I am unable to use the commands `\begin{figure}` and `\end{figure}`. What package do I need to include to be able to use the commands `\begin{figure}` and `\end{figure}`.


title: Is there a rule of thumb to set the space between columns?

text: I've never heard about a convention to adjust the space between columns in a writing, it seems it depends on aesthetic sense--even in scientific literature ---doesn't it?


title: Normal footnote in epigraph command

text: I would like to create a "normal" footnote inside epigraph command. This command cites the reference in a footnote _just below_ the epigraph and not at the end of the page :               \epigraph{text}{source\footcite{key}}      For example :               \epigraph{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut}{Author\footcite{author00:_title}}      creates : ![enter image description here](http://i.stack.imgur.com/00q3V.png) How can I create a normal footnote? MWE :               \begin{filecontents}{bib.bib}     @Book{author00:_title,       author =   {Author},       title =    {Title},       publisher =    {Publisher},       year =     2000}     \end{filecontents}          \documentclass[12pt,twoside,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[english,french]{babel}     \frenchbsetup{StandardLists=true}          \usepackage{setspace}     \usepackage{graphicx}      \usepackage{lmodern}     \usepackage{xspace}     \usepackage{epigraph}     \usepackage{lipsum}     \usepackage{filecontents}          \usepackage[autostyle=true]{csquotes}     \usepackage[style=authoryear-comp,          hyperref,          backend=biber,          isbn=false,          doi=false,          url=false,          date=year]{biblatex}     \AtEveryBibitem{\clearlist{language}}     \renewcommand*{\newunitpunct}{\addcomma\space}     \bibliography{bib}     \usepackage[colorlinks]{hyperref}          \begin{document}          \epigraph{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut}{Author\footcite{author00:_title}}     test     \end{document}


title: Multi level timeline

text: I am fairly new to LaTeX and I want to write my internship report with it. I have briefly summarized the history of the company and I want to use something visual. I tried to reproduce this (done with a WYSIWYG editor): ![example](http://i.stack.imgur.com/2KJBR.png) I'm sure something beautiful can be done with Tikz but I have absolutely no idea on how to use it. So I tried to do this timeline by creating a table, but the result is not so great. the text is doing some weird things and the images are not centered verticaly, also I can't make the last image bigger because my column size is fixed. Here is my MWE:               \documentclass[a4paper]{report}     \usepackage[francais]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{graphicx}          \begin{document}          \begin{tabular}{p{0.33\textwidth} p{0.33\textwidth} p{0.33\textwidth}}     \includegraphics[width=0.3\textwidth]{hydravion} & \includegraphics[width=0.3\textwidth]{stato} & \includegraphics[width=0.3\textwidth]{sudaviation}\\     1938: naissance de la société SNCASE (Société nationale de construction aéronautique du sud-est). & 1943: le premier appareil à voilure tournante voit le jour à Marignane. 1956: la SNCASE se transforme en SUD-EST-AVIATION. & 1957: SUD-EST-AVIATION se transforme en SUD-AVIATION\\     \includegraphics[width=0.3\textwidth]{snias} & \includegraphics[width=0.3\textwidth]{aerospatiale} & \includegraphics[width=0.3\textwidth]{eurocopter}\\     1970: SUD-AVIATION, NORD-AVIATION, SEREB fusionnent et donnent naissance à la SNIAS (Société Nationale industrielle aérospatiale). & 1984: la SNIAS devient AEROSPATIALE. Son activité est concentrée dans les domaines de l'aéronautique, de l'espace, ainsi que de l'étude et la production d'avions et d'hélicoptères & 1992: La division "hélicoptère" de l'entreprise Aerospatiale s'unit avec l'hélicoptériste allemand, MBB, pour donner naissance à Eurocopter. 1998: Eurocopter devient Eurocopter EADS company en fusionnant avec le groupe espagnol CASA.\\     & \includegraphics[width=0.3\textwidth]{airbushelicopters} & \\     & 2014: le groupe tourne une page de son histoire et se renomme Airbus Helicopters &     \end{tabular}          \end{document}      Here it what is does: ![enter image description here](http://i.stack.imgur.com/HEIPO.png) Can you give me some hints to improve my design ?