title: Pinyin with pdfLaTeX: Problem with spacings

text: I want to write a document in english and some words in chinese using pdfLaTeX. Here a MWE:               \documentclass{article}     \usepackage[UTF8]{ctex}     \begin{document}     nǔrén\v{a}amùtūou      \end{document}      This shows up as in the image below: ![enter image description here](http://i.stack.imgur.com/Uypu4.png) As you can see after the `ǔ` or the `ū` LaTeX puts automatically a free space even if it's not written in the code, but not after `\v{a}`. 1) Why happens this? 2) How can I avoid this problem? (As you can imagine its not easy to make the change every time) Thank you for any suggestions.


title: Hyphen, Capital T and Kerning

text: When using a hyphen directly next to a capital T the spacing (kerning) looks weird:   Input: `Abc-Tuv`   Output: ![kerning for hyphen next to capital T](http://i.stack.imgur.com/268hg.png)   It seems as there is too much space between the hyphen and the T. I can reproduce this behavior in PdfLaTeX and XeLaTeX (even Word) using the default font. Is this typographically correct? If it is not what would be correct? How can I achieve a consistent correct kerning throughout the document without specifying `\kern` manually on each occurrence? Thanks for your answers. **Edit** : Given that this question was marked as duplicate I realize that my formulation of the question was somewhat misleading. Maybe it would have been better to emphasize the typographical aspect of the question: Usually the automatic kerning works quite well (meaning that I never had to bother about it before). Why does the spacing look "wrong" in this special case? Am I mistaken and this is actually (typographically) correct? If it is not which value should I supply to `\kern`? Guessing a value and change it until it "feels" good? Is there a better way, so that the best value is chosen automatically? I hope this clears things up, sorry for not being precise in the first place.


title: biblatex: adding URL to techreport title doesn't work

text: Using `\DeclareFieldFormat` to add the URL to titles as a `href` doesn't work on a `@techreport` entry, though it works fine on, for instance, `@phdthesis`. Why would that be, I wonder? ![Screenshot of the MNWE.  Title of tech report is not a link.](http://i.stack.imgur.com/NrPZZ.png)               \documentclass{article}     \usepackage[english, american]{babel}     \usepackage{filecontents}          \usepackage[url=false]{biblatex}          \DeclareFieldFormat       [article,        inbook,        incollection,        inproceedings,        patent,        thesis,        unpublished,        techreport, % some problem here?        misc,        phdthesis]       {title}{\href{\thefield{url}}{#1}}          \usepackage{hyperref}          \begin{filecontents}{myreferences.bib}     @techreport{probation-report,       title={{Problem solving and mathematical knowledge}},       author={Joseph Corneli},       institution={Knowledge Media Institute},       url={http://kmi.open.ac.uk/publications/techreport/kmi-10-03},       year={2010},     }          @phdthesis{corneli-thesis,         title = {Peer produced peer learning: {A} mathematics case study},         school = {The Open University (submitted)},         author = {Corneli, Joseph},         year = {2013},             url={http://metameso.org/~joe/docs/submitted-version.pdf},     },     \end{filecontents}          \bibliography{myreferences.bib}          \begin{document}     My probation report --- \fullcite{probation-report} --- doesn't     actually resemble my thesis that closely ---     \fullcite{corneli-thesis}.     \end{document}


title: Coloring only the text area

text: I use the geometry package to define paper size and text area of a (one page) document:               \usepackage[       paperwidth=420mm,       paperheight=297mm,       text={365mm,270mm},       centering     ]{geometry}      I wish to color the background of the specified text area. I use this.               \usepackage{color}     \pagecolor{magenta}      This, however, colors the whole paper (420*297 mm2), rather than just the text area (365*270 mm2). How do I color _only_ the text area?


title: Create association lines with TikZ

text: I recently asked how to Create association lines between characters, and I was open to all kinds of suggestions. Unfortunately, I failed to understand most of the answers given. I should perhaps have emphasized that the suggestions needed to be "dumbed down" with explanations/comments such that I would understand them (so that I can modify them and reuse them later). I liked the output from some `pstricks` derivatives such as `pst-asr` (http://tex.stackexchange.com/a/139694/9077) and `pst-node` (http://tex.stackexchange.com/a/139726/9077), but I don't really understand the code, and since the `pst-asr` and `pst-node` manuals are like mystery novels to me, I got stuck before I even started. I will for that reason stick to `TikZ` for now, mainly because the manual is more or less comprehensible to me, and I've used `TikZ` a little bit before. Below is a MWE of what I have come up with, based on Alan Munn's answer. There are a few problems there already:   1. The space between the characters in the word 'asta' is uneven. I'd prefer the same distance between characters as when a word is typed in normal text.   2. The two lines in the word 'asta' are of unequal length. They should be the same length.   3. The two lines in the word 'asta' don't join smoothly. This is addressed on page 140 in the `TikZ` manual, but there is no explanation, it just says "appreciate the difference" (which I do).   4. The H in the word 'asta' should be in between the two anchors, not directly above the second anchor. If some of these issues cannot be resolved with `TikZ`, I'd be happy to go back to something like `pst-asr` or `pst-node` instead. If so, I should insist this time that the code is explained, otherwise it will not be worth your effort. Since I cannot understand the manuals for `pst-asr` or `pst-node`, I need to rely on explanations from you guys ... MWE:               \documentclass{article}     \usepackage{tikz}         \usetikzlibrary{matrix}     \begin{document}     \begin{tikzpicture}         \matrix (mymatrix) % assign matrix name in ()             [                 matrix of nodes,                 nodes = {inner sep = 0pt, outer sep = 1pt}                 % 'inner sep' sets the space around the node, i.e. between nodes                 % 'outer sep' sets the space between the node and the anchor that lines will be drawn from/to             ]         % create matrix of nodes: each node has the name 'matrix name'-'row number'-'column number'         {             & H &\\             [2ex] % distance between rows             a & s & a\\         };         \draw (mymatrix-1-2) -- (mymatrix-2-2); % draw line (--) from row1/column2 to row2/column2     \end{tikzpicture}     \begin{tikzpicture}         \matrix (mymatrix2)             [                 matrix of nodes,                 nodes = {inner sep = 0pt, outer sep = 1pt}             ]         {             & & H &\\             [2ex]             a & s & t & a\\         };         \draw (mymatrix2-1-3.south) -- (mymatrix2-2-2.north);          % south anchor = in the middle at the bottom of the node          % north anchor = in the middle at the top of the node         \draw (mymatrix2-1-3) -- (mymatrix2-2-3);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/gsfhx.png) * * * **EDIT: Alenanno's suggestion**               \documentclass{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}         [             every node/.style = % set style of all nodes                 {                     minimum height = 4mm, % set minimum height of node (the higher, the further away from the node the lines will be drawn)                     text height = 1mm, % set height of text in node? How can the text be 1mm high?                     text depth = 0ex % depth?? What does this do?                 },             level 1/.style = % set style for the highest level in the tree                 {                     level distance = 7mm, % set distance between levels in the tree                     sibling distance = 2mm % set distance between nodes within a level                 },             edge from parent/.style = % set style for the connection between parents and children???                 {                     draw,                     edge from parent path = % set the edges for parent node and child node                         {(\tikzparentnode.south) -- (\tikzchildnode.north)} % south/north = in the middle at the bottom/top of the node                 },             abs/.style = % ??                 {edge from parent/.style = {draw = none}} % ??         ]          \node{H} % the text of parent node         child[abs]  {node{a}}         child       {node{s}}          child[abs]  {node{a}}     ;          \node[xshift = 2cm]{H} % shift all points in this node on the x-axis (to avoid pictures to overlap)         child[abs]  {node{a}}         child       {node{s}}          child       {node{t}}         child[abs]  {node{a}}     ;     \end{tikzpicture}     \end{document}      Won't this always put `H` in the middle of the word? What if I want `H` to branch off only to the first two characters in the word or something like that?


title: Why do all symbols in $x \in X$ have their own baseline?

text: When looking closely at some set arithmetic, I realized that all of the three symbols in the following minimum example are rendered here (pdfLaTeX on Portable MiKTeX, Windows 7 x64) at different vertical positions:               \documentclass{article}     \begin{document}     $x \in X$     \end{document}      Magnified screenshot, when viewed in Adobe Acrobat Pro 9 (added red line manually): ![$x \\in X$](http://i.stack.imgur.com/LWPJy.png) **The question:** (why) is this as it should be? My naive view would expect at least `$x$` and `$X$` to share the same baseline.


title: Create professional looking table description above table

text: I'm searching for the 'best' method to create professional academic table descriptions above e.g. a regression table. I managed to create something as below, just wondering whether there is a prefered method to do so. I currently put a `\caption*` environment below the regular `\caption` and change the font size.               \documentclass{article}     \usepackage{caption}     \usepackage{booktabs}          \begin{document}               \begin{table}[htbp]\centering     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}     \caption{This is the heading}     \caption*{\footnotesize Smaller note of table that describes what the table is all about.}     \begin{tabular}{l*{3}{c}}     \toprule                     &\multicolumn{1}{c}{(1)}   &\multicolumn{1}{c}{(2)}   &\multicolumn{1}{c}{(3)}   \\                     &     Base   &   Robust   &  Cluster   \\     \midrule     Size            &-0.000645   &-0.000645   &-0.000645   \\                     &  (-0.83)   &  (-0.83)   &  (-0.39)   \\     \midrule     Observations    &     5035   &     5035   &     5035   \\     \bottomrule     \multicolumn{4}{l}{\footnotesize \textit{t} statistics in parentheses}\\     \multicolumn{4}{l}{\footnotesize * p<0.10, ** p<0.05, *** p<0.01}\\     \end{tabular}     \end{table}               \end{document}      The result of the code above: ![enter image description here](http://i.stack.imgur.com/cLFg2.png)


title: pgfgantt: Named links in order to maintain relationship between bars

text: I have a pretty complex pgfgantt chart. Several people are collaboratively working on it and it is subject to frequent change. In this chart the individual `\ganttbar` items are linked with the `\ganttlink` command. The ganttbar items are referred to by _elem0_ , _elem1_ , ..., _elemn_. To illustrate my problem consider this minimal pgfgantt example:               \begin{ganttchart}{3}{1}     \ganttbar {Task 1}{1}{2} \\     \ganttbar {Task 2}{2}{3} \\     \ganttbar {Task 3}{1}{2} \\     \ganttbar {Task 4}{2}{3}     \ganttlink {elem0}{elem1}     \ganttlink {elem2}{elem3}     \end{ganttchart}      Now lets assume that "Task 2" is removed:               \begin{ganttchart}{3}{1}     \ganttbar {Task 1}{1}{2} \\     \ganttbar {Task 3}{1}{2} \\     \ganttbar {Task 4}{2}{3}     \ganttlink {elem1}{elem2}     \end{ganttchart}      Of course I have to remove `\ganttlink {elem0}{elem1}`. However I also have to change all subsequent links as well in order to maintain the correct relationships. In the example above `\ganttlink {elem2}{elem3}` had to be changed to `\ganttlink {elem1}{elem2}`. In a complex gantt chart this quickly becomes tedious and very error prone . So my question is: Is it possible to reference a `\ganttbar` rather by a custom name than by _elemn_ , e.g. `\ganttlink{mytask1}{mytask2}`?


title: Looping Through a Nested List

text: I have a hunk of data like so: `{ { {AA},{AB}, ... {AZ} }, { {BA}, {BB}, ... {BZ} }, ... ... { {ZA}, {ZB}, ... {ZZ} } }` defined in a macro called `\clebschdata`. Each term XX is a list of eleven numbers (e.g., {2,4,5,1,2,0,0,0,3,1,1}). In other words, `\clebschdata` is a list of eleven things, each of which is a list of eleven things, each of which is a list of eleven numbers. The data corresponds to a matrix that I'd like to put into a 12x12 table. I want the left column (in descending order) to look like `\bigotimes \chi_1 \chi_2 ... \chi_11` and the top row (from left to right) to be the same: `\bigotimes \chi_1 \chi_2 ... \chi_11`, where the `\bigotimes` in both correspond to the top left cell. I have a macro defined `\chisum` that I would like to pass each entry of my data to before putting it into the remaining 11x11 table. How do I loop through my list to meet these specs? I have tried several looping macros from several different packages but I can't get any of them to work. In particular, I have the following thing:               \def\ttand{&}     \def\clebschtable#1{\hline\@for\tmpi:=#1\do{\chi\@for\tmpj:=\tmpi\do{\ttand$\chisum\tmpj$}}}          ...          ...          \begin{tabular}          \clebschtable{\clebschdata}          \end{tabular}      But it is giving me grief about an `! Undefined control sequence.` on `\tmpj`. Edit:               \def\clebschdata {{{1,0,0,0,0,0,0,0,0,0,0},{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,0,0,0,0,0},{0,0,0,1,0,0,0,0,0,0,0},{0,0,0,0,1,0,0,0,0,0,0},{0,0,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,1,0,0,0,0},{0,0,0,0,0,0,0,1,0,0,0},{0,0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,0,1,0},{0,0,0,0,0,0,0,0,0,0,1}},{{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,1,0,0,0,0,0},{1,0,0,0,0,0,0,0,0,1,0},{0,0,0,0,1,0,0,0,0,0,1},{0,0,0,0,0,0,1,1,0,0,0},{0,0,1,0,0,0,0,0,1,1,0},{0,0,0,1,0,0,1,0,0,0,1},{0,0,0,1,0,0,0,1,0,0,1},{0,0,0,0,0,1,0,0,1,1,0},{0,1,0,0,0,1,0,0,1,1,0},{0,0,0,0,1,0,1,1,0,0,1}},{{0,0,1,0,0,0,0,0,0,0,0},{1,0,0,0,0,0,0,0,0,1,0},{0,1,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,1,1,0,0,0},{0,0,0,1,0,0,0,0,0,0,1},{0,1,0,0,0,0,0,0,1,1,0},{0,0,0,0,1,0,1,0,0,0,1},{0,0,0,0,1,0,0,1,0,0,1},{0,0,0,0,0,1,0,0,1,1,0},{0,0,1,0,0,1,0,0,1,1,0},{0,0,0,1,0,0,1,1,0,0,1}},{{0,0,0,1,0,0,0,0,0,0,0},{0,0,0,0,1,0,0,0,0,0,1},{0,0,0,0,0,0,1,1,0,0,0},{0,0,1,0,0,1,0,0,1,0,0},{1,0,0,0,0,0,0,0,1,1,0},{0,0,0,0,1,0,1,1,0,0,1},{0,1,0,0,0,1,0,0,1,1,0},{0,1,0,0,0,1,0,0,1,1,0},{0,0,0,1,1,0,1,1,0,0,1},{0,0,0,1,0,0,1,1,0,0,2},{0,0,1,0,0,1,0,0,1,2,0}},{{0,0,0,0,1,0,0,0,0,0,0},{0,0,0,0,0,0,1,1,0,0,0},{0,0,0,1,0,0,0,0,0,0,1},{1,0,0,0,0,0,0,0,1,1,0},{0,1,0,0,0,1,0,0,1,0,0},{0,0,0,1,0,0,1,1,0,0,1},{0,0,1,0,0,1,0,0,1,1,0},{0,0,1,0,0,1,0,0,1,1,0},{0,0,0,1,1,0,1,1,0,0,1},{0,0,0,0,1,0,1,1,0,0,2},{0,1,0,0,0,1,0,0,1,2,0}},{{0,0,0,0,0,1,0,0,0,0,0},{0,0,1,0,0,0,0,0,1,1,0},{0,1,0,0,0,0,0,0,1,1,0},{0,0,0,0,1,0,1,1,0,0,1},{0,0,0,1,0,0,1,1,0,0,1},{1,0,0,0,0,2,0,0,1,2,0},{0,0,0,1,1,0,1,1,0,0,2},{0,0,0,1,1,0,1,1,0,0,2},{0,1,1,0,0,1,0,0,2,2,0},{0,1,1,0,0,2,0,0,2,2,0},{0,0,0,1,1,0,2,2,0,0,2}},{{0,0,0,0,0,0,1,0,0,0,0},{0,0,0,1,0,0,1,0,0,0,1},{0,0,0,0,1,0,1,0,0,0,1},{0,1,0,0,0,1,0,0,1,1,0},{0,0,1,0,0,1,0,0,1,1,0},{0,0,0,1,1,0,1,1,0,0,2},{1,1,1,0,0,1,0,0,1,2,0},{0,0,0,0,0,1,0,0,2,2,0},{0,0,0,1,1,0,1,2,0,0,2},{0,0,0,1,1,0,2,2,0,0,2},{0,1,1,0,0,2,0,0,2,2,0}},{{0,0,0,0,0,0,0,1,0,0,0},{0,0,0,1,0,0,0,1,0,0,1},{0,0,0,0,1,0,0,1,0,0,1},{0,1,0,0,0,1,0,0,1,1,0},{0,0,1,0,0,1,0,0,1,1,0},{0,0,0,1,1,0,1,1,0,0,2},{0,0,0,0,0,1,0,0,2,2,0},{1,1,1,0,0,1,0,0,1,2,0},{0,0,0,1,1,0,2,1,0,0,2},{0,0,0,1,1,0,2,2,0,0,2},{0,1,1,0,0,2,0,0,2,2,0}},{{0,0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,1,0,0,1,1,0},{0,0,0,0,0,1,0,0,1,1,0},{0,0,0,1,1,0,1,1,0,0,1},{0,0,0,1,1,0,1,1,0,0,1},{0,1,1,0,0,1,0,0,2,2,0},{0,0,0,1,1,0,1,2,0,0,2},{0,0,0,1,1,0,2,1,0,0,2},{1,1,1,0,0,2,0,0,2,2,0},{0,1,1,0,0,2,0,0,2,3,0},{0,0,0,1,1,0,2,2,0,0,3}},{{0,0,0,0,0,0,0,0,0,1,0},{0,1,0,0,0,1,0,0,1,1,0},{0,0,1,0,0,1,0,0,1,1,0},{0,0,0,1,0,0,1,1,0,0,2},{0,0,0,0,1,0,1,1,0,0,2},{0,1,1,0,0,2,0,0,2,2,0},{0,0,0,1,1,0,2,2,0,0,2},{0,0,0,1,1,0,2,2,0,0,2},{0,1,1,0,0,2,0,0,2,3,0},{1,1,1,0,0,2,0,0,3,3,0},{0,0,0,2,2,0,2,2,0,0,3}},{{0,0,0,0,0,0,0,0,0,0,1},{0,0,0,0,1,0,1,1,0,0,1},{0,0,0,1,0,0,1,1,0,0,1},{0,0,1,0,0,1,0,0,1,2,0},{0,1,0,0,0,1,0,0,1,2,0},{0,0,0,1,1,0,2,2,0,0,2},{0,1,1,0,0,2,0,0,2,2,0},{0,1,1,0,0,2,0,0,2,2,0},{0,0,0,1,1,0,2,2,0,0,3},{0,0,0,2,2,0,2,2,0,0,3},{1,1,1,0,0,2,0,0,3,3,0}}}          \makeatletter     \def\thect{\value{ct}}     \newcounter{ct}     \def\chisum#1{\setcounter{ct}{0}\@for\tmp:=#1\do{\stepcounter{ct}\expandafter\zzz\tmp\relax}}     \def\zzz#1\relax{         \ifnum #1=1         \zzsep\chi_{\thect}         \else         \ifnum #1=0         \else         \zzsep#1\chi_{\thect}         \fi         \fi     }     \def\zzsep{\def\zzsep{\oplus}}     \makeatother      Also does anybody see what's wrong with the following?               \def\decompgirreps{{1,0,0,0,0,0,0,0,0,0,0},{0,1,0,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,0,0,0,0,0}, {0,0,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,1,0,0}, {1,0,0,0,0,1,0,0,0,0,0},{0,0,0,0,0,0,0,0,0,1,0},{0,0,0,1,1,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,1},{0,0,0,0,0,0,0,0,0,0,1},{0,0,0,0,0,1,0,0,0,1,0}, {0,1,1,0,0,0,0,0,1,1,0},{0,0,0,0,0,1,0,0,1,1,0},{0,0,0,0,1,0,1,1,0,0,1}, {0,0,0,1,0,0,1,1,0,0,1}}     \begin{tabular}{| c || c | }         \hline $G^4$ Irreps & Decomp into $SL_2^7$ Irreps \\ \hline \hline     \setcounter{rowindex}{0}     \xintFor #1 in \decompgirreps \do {%        \stepcounter{rowindex}        $\mu_{\arabic{rowindex}}$ & $\chisum{#1}$%        \\ \hline     }%     \end{tabular}      The part with `\chisum` is not working. When I remove the `\chisum` part and just keep it as `#1` then I see it is indeed looping through `\decompgirreps`, but there are no brackets around it. It seems like it is being expanded to `\chisum0,0,0,1,0,0,1,1,0,0,1` for instance when it should be `\chisum{0,0,0,1,0,0,1,1,0,0,1}`. There's probably a really simple fix for this...


title: How do \lastskip and \ifdim work?

text: I thought I knew the answer to this question, but I can't understand the following plain TeX code:               \noindent\hskip1pt\ifdim\lastskip=0pt lastskip was 0pt\fi\par     \noindent\hskip1pt\showthe\lastskip     \bye      In the first paragraph (started with `\noindent`) I put a skip of `1pt`, but the test for the last skip yields `0pt`. In the second paragraph, `\showthe` shows that the last skip was `1.0pt`. What is happening here? (I was led to this question by trying to answer morbusg's question.)


title: Optical Kerning with microtype

text: I am dissapointed with microtypes kerning. This MWE:               \documentclass[ngerman,10pt]{article}     \usepackage[ngerman]{babel}     \usepackage{lmodern}     \usepackage[T1]{fontenc}          \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,babel]{microtype}          \begin{document}          CUA          \end{document}      … results in: ![LaTeX Output](http://i.stack.imgur.com/JfJ7u.png) While InDesigns optical kerning results in: ![InDesign Output](http://i.stack.imgur.com/riofX.png) The subtle difference is the reduced space between the U and the C. Is there a way to get similar results in LaTeX like in InDesign?


title: error at \ifnum\luatexversion<68

text: The following code (minimal example taken from here)               \documentclass{article}          % Both of these are require to duplicate the problem     \usepackage{pgfplots}     \usepackage[splitindex]{imakeidx}          \begin{document}     \end{document}      produces the following error in imakeidx.sty (only in texlive 2012, not in 2011)               ! Missing number, treated as zero.     <to be read again>                          <     l.48   \ifnum\luatexversion<                             68      Any idea why this happens or can be solved is welcome.


title: Column Spacing using esttab & longtable

text: I am outputting regression results from Stata to Latex. The problem is that, no matter how many columns I have, the spacing between the last column and the rest of the table is wider than other columns. I believe this is because I include a long note via the eesttab option in Stata:                addnote("\begin{minipage}[t]{\columnwidth} 4-line CAPTION \end{minipage}")      Here is an example of Latex output:               \begin{document}     \begin{landscape}     {     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}      \setlength{\tabcolsep}{1pt}     \renewcommand{\arraystretch}{.9}     \begin{longtable}{l*{8}{c}}     \caption{OLS: \% Managed Care (All Models)}\\     \hline\hline                         &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}&\multicolumn{1}{c}{(6)}&\multicolumn{1}{c}{(7)}&\multicolumn{1}{c}{(8)}\\                          &         b/t         &         b/t         &         b/t         &         b/t         &         b/t         &         b/t         &         b/t         &         b/t         \\     \hline     Emergency Fund Shock&    -0.00156         &    -0.00207\sym{**} &    -0.00293\sym{***}&    -0.00264\sym{***}&  -0.0000396         &    0.000367         &    0.000420\sym{***}&    0.000420\sym{***}\\                         &     (-0.52)         &     (-3.13)         &     (-3.71)         &     (-3.62)         &     (-0.18)         &      (0.67)         &      (4.20)         &      (4.60)         \\     \end{longtable}     }     \end{landscape}     \end{document}      Is there a better way to add a caption to tex tables via esttab in Stata? I am trying to avoid having to edit each table by hand.


title: biblatex: How to set citation options per citation command?

text: In the `alphabetic` style, I am using `maxcitenames=4` and `minnames=3` as global options. However, when using `\textcite` instead of `\cite`, these settings are pretty unreasonable, and I want it to behave as if `maxcitenames=3` and `minnames=1` were set. How do I achieve this? To be more specific, in the example below I want               \cite{ABCDE}      to produce > [ABG+01] , and               \textcite{ADCDE}      to produce > Alpha, _et al._ [ABG+01] **Example:**               \documentclass{article}          \usepackage[ style=alphabetic, maxcitenames=4, minnames=3 ]{biblatex}          % set \textcite option maxcitenames=3 and minnames=1 here          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @book{ABCDE,       author = {Alpha, A. and Beta, B. and Gamma, G. and Delta, D. and Epsilon, E.},       year = 2001     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \cite{ABCDE}     \textcite{ABCDE}              \end{document}


title: \color after inline section colors the section title

text: In the following document, the subsection title gets colored red. Why does this happen?               \documentclass{article}     \usepackage{color}     \newcommand{\comment}[1]{{\color{red}#1}}     \begin{document}       \paragraph{This should not be red!}       \comment{Only this!}     \end{document}      How can I fix it? If I replace `{\color{red}#1}` with `\textcolor{red}{#1}` I get a "runaway argument" error.


title: EPS figures are pixelized in the final PDF with LyX

text: This is the first time that I compile a LyX file with some EPS picture inside on my current computer. I already did that before on other computers, without any problem. But here, the result is pixelized. All the document can be compiled, and is rendered nicely, but the EPS file is pixelized. I know it is not due to my EPS file which is really in vectorial format because I can open it with other readers and zoom inside without any problem. Result : ![enter image description here](http://i.stack.imgur.com/UpErg.png) I tried to figure out which options I should activate or which converter I have to set but didn't find anything. This guy had the same problem than me : Link but I think he is working on a Windows OS while I am on Mac OS, and the resolution don't seems to work for me. EDIT : I tried for instance to set EPS to PDF (ps2pdf). The result is no longer pixelized but... takes the whole page, as a PS file. Here is an image of the result and the parameters : ![enter image description here](http://i.stack.imgur.com/KGDI6.png) EDIT again : Trying to use `epstopdf` is not working, image still pixelized, but maybe I don't use the correct parameters ? I was expecting something as 'PDF (epstopdf)' in the list but there is none of these. ![enter image description here](http://i.stack.imgur.com/Cp9zN.png)


title: Is anybody using TeX for business reporting?

text: Would TeX (LaTeX, ConTeXt, etc) be a good solution for PDF business reports that require dynamically generated graphs and tables? I need to create financial reports that must look top-notch in their graphics, charts, and typesetting. These reports are typically several pages long and will contain charts, tables of numbers, and typeset text. I have been using some 'general' PDF libraries, but these have been expensive and typically have some sort of limitation simply because 1) you are working at a higher level with the data and 2) their author's just didn't give them as much flexibility as I need. This question applies to other TeX flavors, but some of these specifics are related to ConTeXt. It has some amazing features:   * drawing support (MetaPost, TikZ/PGF)   * lua scripting (specifically, adding a JSON parser and using it to populate a .tex file would be awesome)   * as much layout control as you could possibly want So I could create my own reports where I lay things out and draw charts myself. Is there anybody out there using TeX for business reporting solutions like this? Would I be off my rocker to suggest such a thing?


title: Image at bottom right Corner of the type area

text: With the following code I put an image in the bottom left corner of a page (see How to place an image in bottom left hand corner on every page? too).               \newcommand{\BackgroundPic}     {%     \put(0,0){%     \includegraphics[width=1cm,height=1cm,%     keepaspectratio]{images/test.png}%     }}          \AddToShipoutPicture*{\BackgroundPic}      But I want to put the image to the _bottom right corner of the type area_. How can I do this? I need the coordinates of the bottom right corner of the type area (without TikZ) …


title: Minor bugfixes and adjustments for the TOC of classicthesis

text: I am using classicthesis and prepared my document with `parts`, `chapters` and `sections`. This produces the following **table of contents**. ![TOC](http://i.stack.imgur.com/D262v.png) There are some details that I would like to fix:   1. Longer `part` numbers run into the `part` name. (highlighted in red)   2. I would like to manipulate the distance between subsequent `chapter` entries (highlighted in green). Thus, `chapter` entries followed by `section` entries should not be affected. (highlighted in yellow)   3. `Part` entries should have a dotted line as `sections` have.   4. The font size of the page number for `parts`, `chapters` and `sections` should be adjustable. Last but not least, here is the MWE to test things out.               \documentclass[oneside, openright, titlepage, dottedtoc, numbers=noenddot,      headinclude, footinclude=true, cleardoublepage=empty, abstractoff, BCOR=5mm,      paper=a4, fontsize=11pt, ngerman] {scrreprt}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage{textcomp}     \usepackage[pdfspacing]{classicthesis}     \usepackage[dvipsnames]{xcolor}     \usepackage{lipsum,kantlipsum}          \hypersetup{         colorlinks=true,      % false: boxed links; true: colored links.         linktocpage=true,     % Moves the clickable link to the page numbers.         linkcolor=OliveGreen  % Color of internal links.     }     \begin{document}     \tableofcontents          \part{Baden-Württemberg} \chapter{Stuttgart} \chapter{Mannheim}     \part{Bayern} \chapter{Muenchen} \chapter{Nuernberg}          \part{Berlin}     \chapter{Berlin}     \section{Charlottenburg-Wilmersdorf}\clearpage     \section{Friedrichshain-Kreuzberg}\clearpage     \section{Lichtenberg}\clearpage     \section{Marzahn-Hellersdorf}\clearpage     \section{Mitte}\clearpage     \section{Neukoelln}\clearpage     \section{Pankow}\clearpage     \section{Reinickendorf}\clearpage     \section{Spandau}\clearpage     \section{Steglitz-Zehlendorf}\clearpage     \section{Tempelhof-Schoeneberg}\clearpage     \section{Treptow-Koepenick}\clearpage          \part{Brandenburg} \chapter{Potsdam} \chapter{Cottbus}     \part{Bremen} \chapter{Bremen}     \part{Hamburg} \chapter{Hamburg}     \part{Hessen} \chapter{Wiesbaden} \chapter{Frankfurt}     \part{Mecklenburg-Vorpommern} \chapter{Schwerin} \chapter{Rostock}     \part{Niedersachsen} \chapter{Hannover} \chapter{Braunschweig}     \part{Nordrhein-Westfalen} \chapter{Duesseldorf} \chapter{Koeln}     \part{Rheinland-Pfalz} \chapter{Mainz} \chapter{Ludwigshafen}     \part{Saarland} \chapter{Saarbruecken}     \part{Sachsen} \chapter{Dresden} \chapter{Leipzig}     \part{Sachsen-Anhalt}\chapter{Magdeburg}\chapter{Halle}     \part{Schleswig-Holstein}\chapter{Kiel}\chapter{Luebeck}     \part{Thüringen} \chapter{Erfurt} \chapter{Jena}          \end{document}


title: "Average sum" symbol

text: Is there a convention for an average sum symbol, for instance `\overline{\sum_{i \in I}}` to mean `\frac{1}{\#I} \sum_{i \in I}`? I can live with the `overline` option but it does not look good in inline mode as is. How to typeset a sum symbol with a **vertical** bar across it? **EDIT** : Following the answers given, let me add the requirement that the user should not be concerned whether the symbol is used in inline or display mode, and also stress that the vertical bar should be across the sum symbol (like the horizontal bar is across the integral sign in `\fint`).


title: Turn \mathbb characters bold in math mode

text: I've seen various topics here adressing how to turn math symbols bold, but none of them gives a suitable option for `\mathbb` characters, as in `\mathbb{ABC}`.   I have tested some options to see which commands turn which symbols in bold. Here is my code:               \documentclass{article}     \usepackage{amsmath} % some math-related packages, not sure which of them are necessary     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{bm} % for \bm     \usepackage{fixmath} % for \mathbold     \begin{document}     \section{Some text $\mathbb{ABC}abc\cosh\div+\alpha$ some text} %1     \section{Some text $\boldsymbol{\mathbb{ABC}abc\cosh\div+\alpha}$ some text} %2     \section{Some text $\mathbf{\mathbb{ABC}abc\cosh\div+\alpha}$ some text} %3     \section{Some text $\pmb{\mathbb{ABC}abc\cosh\div+\alpha}$ some text} %4     \section{Some text $\boldmath{\mathbb{ABC}abc\cosh\div+\alpha}$ some text} %5     \section{Some text $\bm{\mathbb{ABC}abc\cosh\div+\alpha}$ some text} %6     \section{Some text $\mathbold{\mathbb{ABC}abc\cosh\div+\alpha}$ some text} %7     \end{document}      ![enter image description here](http://i.stack.imgur.com/885h1.png) (The absence of `\div` in numbers 2 and 6 are not typos, neither is the 'ff' in number 3.) Apparently `\pmb` is the only command which turns `\mathbb{ABC}` bold. But it makes the characters quite ugly, take a close look: (on the right is the normal version) ![enter image description here](http://i.stack.imgur.com/HrNot.png) If no alternative shows up, I think I'll just use `\pmb` for the `\mathbb` characters and `\boldsymbol` or something for the others. > Is there any alternative to turn `\mathbb{ABC}` bold?


title: blank page not created

text: I create a blank page using               \newcommand\blankpage{ %comando pagina vuota         \null         \thispagestyle{empty}%         \addtocounter{page}{-1}%         \newpage}      Here it is one my page:               \thispagestyle{empty}     \addtocounter{page}{-1}          \null\vspace{\stretch{1}}         \begin{flushright}             \emph{Stay hungry, \\             stay foolish. \\}             \smallskip             Steve Jobs, Stanford University, 2005         \end{flushright}     \vspace{\stretch{5}}\null      Unfortunately adding \blankpage after that page, it doesn't work


title: \thispagestyle{empty} and page numbering

text: I'm trying to suppress the page number on a few pages of a large document. I'm using `\thispagestyle{empty}` to perform this task, and it works exactly as I want it to. However, when I later compile the document, the page numbers are wrong in my Table of Contents. I have determined that it is the above command that is throwing off the TOC. How can I suppress a page number, but have the TOC count it?


title: Setting page numbers correctly

text: I'm preparing a paper and I created a `title` page, an `abstract` page and an acknowledgments page. Those pages must not show page numbers. So I used               \setcounter{page}{-1}      for the title page and               \thispagestyle{empty}     \setcounter{page}{-1}      for the other pages. In this way the page numbers aren't shown. But is it right to set the `page` counter to `-1` for all pages where I don't want show the number?


title: New section using titlesec and titleclass

text: I'm trying to define an Appendix section with `titlesec` but I get an error every time I try to use `\appendix` . My code is               \titleclass{\appendix}{straight}     \newcounter{appendix}          \titleformat{\appendix}[display]%     {\bf \Large}%     % Default measures in cm     {%         \vspace{1cm}%                \begin{tikzpicture}[remember picture,overlay, xshift=-4cm]         \fill[black]          (0,0)%              rectangle%         (4, 1);%         \node(x)[rectangle,minimum width=1cm, minimum height=1cm, fill=mycolour, text=white] at (4,1) {\huge \Alph{appendix}};%         \node[rectangle, below right, minimum height=1cm, text width=13cm, fill=white, text=black, align=left] at (4.6,1.5) {~#1};%         \end{tikzpicture}%      }%     {5pt}%     {}      When I use the same code for changing `\section` it works fine, so I don't understand what's going on.


title: How to align terms in alignat: too much spaces and too few

text: Please, help me this code has too much spaces and too few, how can I fix it?               \begin{subequations}     \begin{alignat}{2}     \forall i \in[m]  &&  \sum \limits_{e \in N_{out(s_{i})}} y(i,e) - \sum \limits_{e \in N_{in(s_{i})}} y(i,e) =1\\     \forall i \in[m], v \in V \{s_{i}, v_{i}\}  && \sum \limits_{e \in N_{out(v)}} y(i,e) - \sum \limits_{e \in N_{in(v)}} y(i,e) =0\\     \forall i \in[m]  && \sum \limits_{e \in E} y(i,e) \leq w\\     \forall i \in[m], v \in V && \sum \limits_{e'=u',v'} y(i,e') \min \left\{1, \frac{d(u',v')^ \alpha}{d(u',v)^ \alpha}\right\} \leq w\\     \forall i \in[m], e \in E  &&   y(i,e) \in \{0,1\}     \end{alignat}     \end{subequations}      this is what I have: ![enter image description here](http://i.stack.imgur.com/6ReA2.png) this is what I need: ![enter image description here](http://i.stack.imgur.com/CY0yY.png)


title: How to open TeXShop remotely the command line

text: How would one open TeXShop, say, via command line using `ssh` and X-forwarding?


title: Marking the items in an "enumerate" list

text: I am using LaTeX and `enumitem`. In a list of the kind of               \begin{enumerate}[noitemsep,label=(\arabic*)]... \end{enumerate}      instead of having items numbered (1), (2), (3), ..., or another of the classical numeration, can I have items numbered with MY choice of marks, e.g., (sc), (cg), (cp) ? [This particular sequence would be for "sigma-compact", "compactly generated", "compactly presented".]


title: Tikz cylinder alignment and fit

text: I've tried fitting a cylinder to the height of both a block and another cylinder as shown in the code below. Cylinder 2 should fit exactly to the top edge of Block 1 and the bottom edge of Cylinder 1, respectively. When I use only blocks instead of the two cylinders, it works as intended. The red lines in the picture indicate the desired bounds of Cylinder 2.               \documentclass{report}     \usepackage{tikz}     \usetikzlibrary{shapes,positioning,fit}          \tikzstyle{b}=[draw, minimum height=2.5em]     \tikzstyle{c}=[draw, minimum height=5em, minimum width=4em, cylinder, shape border rotate=90, shape aspect=0.1]          \begin{document}     \begin{tikzpicture}         \node (block1) [b, anchor=north] {Block 1};         \node (cylinder1) [c, below=of block1] {Cylinder 1};              \node (cylinder2) [c, right=3cm of block1.north east,         anchor=north, fit=(block1)(cylinder1)] {Cylinder 2};     \end{tikzpicture}     \end{document}      ![minimal example](http://i.stack.imgur.com/L6whv.png)


title: What's the difference between ngerman and german in babel?

text: I use the following three packages to get correct German umlauts in the generated PDF:               \usepackage[utf8]{inputenc} % this is needed for umlauts     \usepackage[ngerman]{babel} % this is needed for umlauts     \usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf      Today, I have seen this:               \usepackage[german]{babel}      What's the difference between `ngerman` and `german`? I think `n` could probably mean new, but which one should I use? Do you have an example where it matters?


title: (not)implies sign as edges in tikz graph

text: I would like to make a graph in tikz as in ![enter image description here](http://i.stack.imgur.com/GCRkY.png) However I would like to have an `implies` symbol instead of an arrow. How can I make a figure such as above but with implies (as well as `not implies` signs) as edges?


title: Auto expand some of the branches in WinEdt tree

text: My tree panel in WinEdt is like this: ![enter image description here](http://i.stack.imgur.com/W7Oyh.jpg) I am wondering whether there is a way to expand all the packages and section branches, to avoid having to open all of the sections when looking for a specific figure? ![enter image description here](http://i.stack.imgur.com/vqOAK.jpg) EDIT: @Harish Kumar - thanks for your reply, but it makes the tree look like this: ![enter image description here](http://i.stack.imgur.com/vTAfd.jpg) Is there anyway to make it this way with the figures not showing the includegraphics: ![enter image description here](http://i.stack.imgur.com/sKZLp.jpg)


title: Beamer document class: nicely alligning different stuff

text: I have a frame with a large picture in the upper part. Under this picture, there's a caption in a small font size. Under that I want to use the itemize environment with two short lines of text. However, I would like to have 1) upon clicking the first line of text, 2) upon clicking once again a small picture which is aligned with the first line of text and 3) upon clicking once again the last line of text which is aligned with the first line of text, i.e., the bullets are on one line. At the moment I am using the code below, but it does not align neatly as I want it too.               \subsection{}      \begin{frame}{Title}     \vspace{-.7cm}     \begin{figure}[h!]        \includegraphics[]{}     \end{figure}     \vspace{-.8cm}     \begin{center}     \tiny     *Caption     \end{center}     \normalsize     \vspace{0cm}     \pause          \begin{columns}[b]     \begin{column}{0.50\textwidth}     \begin{overlayarea}{\linewidth}{4cm}     \begin{itemize}     \item<2->{Text 1}     \end{itemize}     \end{overlayarea}     \end{column}     \begin{column}{0.30\textwidth}     \begin{overlayarea}{\linewidth}{5cm}       \centering\vfill     \includegraphics<3->[]{}     \end{overlayarea}     \end{column}     \end{columns}     \vspace{-3cm}     \begin{itemize}     \item<4->{Text}     \end{itemize}     \end{frame}


title: bibliographystyle with comma after journal name (i.e., just before volume)

text: Does anybody know of a `\bibliographystyle` exactly like `chicago`, however with a comma **after** the journal name just before the volume? Or is there an easy way to implement a comma in the `chicago.bst` file? Like: > Ross, M. L. (2001). Does oil hinder democracy? World Politics, 53(3), > 325–361.


title: How can I use alignedat in subequations?

text: I have a set of equations inside a `subequations` environment. **Update** : I use a macro to generate long subsubscripts in `\rm`.               \newcommand{\foobar}{\rm foobar}     \begin{subequations}     \begin{alignat}{5}     t_{p_{\foobar}} &=& &\big\vert \big\{e \in E^\prime \vert& &\mathcal{P}_{\foobar}(e)       &&\wedge&      &\mathcal{H}_{\foobar}(e) \big\} \big\vert\\     f_{p_{\foobar}} &=& &\big\vert \big\{e \in E^\prime \vert& &\mathcal{P}_{\foobar}(e)       &&\wedge& \lnot&\mathcal{H}_{\foobar}(e) \big\} \big\vert\\     f_{n_{\foobar}} &=& &\big\vert \big\{e \in E^\prime \vert& \lnot &\mathcal{P}_{\foobar}(e) &&\wedge&      &\mathcal{H}_{\foobar}(e) \big\} \big\vert\\     t_{n_{\foobar}} &=& &\big\vert \big\{e \in E^\prime \vert& \lnot &\mathcal{P}_{\foobar}(e) &&\wedge& \lnot&\mathcal{H}_{\foobar}(e) \big\} \big\vert     \end{alignat}     \end{subequations}      These equations have a lot of unnecessary space between columns. Using `gather` along with `alignedat`, they are aligned the way I want them - without any additional horizontal space. However, this leads to the equations being assigned only a single equation number. When I use `alignat` instead, latex adds additional space between columns - which I don't want. How can I achieve correct alignment and correct numbering?


title: How to get the chapter name and other TOC data in the table of contents?

text: It's a good solution. But could you help me to change it a little bit. For example using `report` style in text I wrote:               \documentclass{report}     \usepackage{tocloft,calc}          \renewcommand\chaptername{Introduction}     \renewcommand\cftchappresnum{\chaptername\space}     \setlength{\cftchapnumwidth}{2cm}          \renewcommand{\thechapter}{}     \renewcommand{\thesection}%     {\Roman{section}.}       \pagenumbering{roman}          \renewcommand\chaptername{Introduction}      \chapter{Les initiatives}      \section{Bla bla bla1}      \section{Bla bla bla2}     \clearpage          \pagenumbering{arabic}          \setcounter{chapter}{0} \setcounter{section}{0}     \renewcommand{\chaptername}{Chapter}          \chapter{Les décisions}      Could you please tell me how to make the table of content like this: > Preface..................................i > > Introduction. Les initiatives ............v > > I.Bla bla bla1..........................vi > > II.Bla bla bla2.........................vii > > Chapitre 1. Les décisions ................1 > > 1.1 Bla bla bla3 ........................6 > > 1.2 Bla bla bla4 ........................7 > > Chapitre 2. Les conférence ...............10 > > Conclusion ...............................30 > > Appendix A ...............................35 > > Bibliographie ............................40 The code from answer above works fine, but it needs some changes for me, and I can't handle it well. Thank you.


title: natbib bst file with merge functionality

text: According to the documentation citations can be merged in natbib (several citations appear as one item in the bibliography). The different citations should be separated by semicolons, if the 'semicolon' option is used. I have tried this with several bst files (including all revtex bst files), but the semicolon never appears. Can anyone point me to a bst file, where the merging fuctionality of natbib works as it should?


title: Global typewriter tab stops every 1/2 inch

text: What is the best method, please, for setting up the equivalent of global (document-wide) typewriter tab stops every 1/2 inch? I'm reluctant to set up a tabular definition `\begin{tabbing}` at the document begin / end, because that might affect single / double spacing, double-indent quotations, etc. I've defined a keyword (`\tab`) to be equal to 1/2 inch, but that doesn't resolve the alignment issues. I do not want an outline feature per se. I just want global typewriter tab stops, if possible. Begin paragraph here. A. Subparagraph. (i.) Sub-sub-paragraph * This is a new paragraph that needs to line up with the letter `A.`


title: knitr. Splitting a function into several blocks

text: Is it possible with knitr to split an R function across several blocks (for documentation reasons)? Here is a MWE:               \documentclass{article}     \begin{document}     Part1 gives salutation.      <<part1>>=     hello <- function(x){       print("Hi")     @     Part2 adds the name.     <<part2>>=       print(x)}     @     \end{document}


I spell-checked my document, but somehow I must've added or deleted some '}' or something because LaTeX can't compile past a certain page, giving the error:               Runaway argument?     {J. Clerk Maxwell\index {Maxwell, James Clerk (1831-1879)}, \textit {\ETC.     ! File ended while scanning use of \@footnotetext.     <inserted text>                      \par      <*>       -               ? H     I suspect you have forgotten a `}', causing me     to read past where you wanted me to stop.     I'll try to recover; but if the error is serious,     you'd better type `E' or `X' now and fix your file.      I'm having a really hard time finding out what is triggering this, especially since the 87 pages of DVI that `latex` outputs before it halts looks completely fine, and Emacs's `check-parens` doesn't find any missing parens… Any ideas what is causing this?


title: Plot graph with axis discontinuities in PSTricks

text: Consider the following. **Code**               \documentclass{article}          \usepackage{pst-coil,pstricks-add}          \begin{document}          \psset{xunit=0.8,yunit=0.6}     \begin{pspicture}(13,14)      \pszigzag[coilheight=0.3](0,0)(2,0)      \psaxes[Ox=16,Dx=1,yAxis=false]{->}(2,0)(13,0)[$d$,0][,90]      \pszigzag[coilheight=0.1](0,0)(0,2)      \psaxes[Oy=18,Dy=2,dy=1,xAxis=false]{->}(0,2)(0,19.5)[,0][$V$,90]      \psplot[algebraic,linewidth=1pt,linecolor=blue]{2}{12.5}{0.075*x^2}     \end{pspicture}          \end{document}      **Output** ![enter image description here](http://i.stack.imgur.com/k2kob.jpg) **Question** How do I (A) get the `\psziazag`, at the beginning of the axes, to look better/proper, and (B) plot the graph of the function `0.075*x^2` for `$16 \leq x \leq 26$` correct (the y-values are not correct as it is now)?


title: Reduce space below an algorithm

text: I am using the `algorithm` package for my algorithms in the paper. I find that the space below the algorithm is very large after generating a PDF, so I want to shrink the space. Firstly, I come to add `\vspace{}` at the end of the algorithm, but then I realized that this method is not `safe`. Because there are more than one algorithms and other images in the paper, such `vspace{}` will sometimes reduce the space between two paragraphs, rather than the space below the algorithm. A MWE is provided below. As you can see, I have used the `\vspace{-0.4cm}` twice. The first is meant to reduce the space above the horizontal line (you will see this line in generated PDF), rather than the space below the entire algorithm. The other one is at the end of the algorithm (commented). I am wondering if there is any `safer` or `smartter` way to reach my goal? Please help!               \documentclass[9.5pt,conference,compsocconf,letterpaper]{IEEEtran}     \usepackage[demo]{graphicx} % demo is just for the example     \usepackage[caption=false]{subfig}     %\usepackage{kantlipsum} % just for the example     \usepackage[noend]{algpseudocode}     \usepackage[ruled]{algorithm}          \begin{document}          \alglanguage{pseudocode}     \begin{algorithm}[h]     \footnotesize     \caption{\small Function}     \label{Algorithm:function}     \begin{algorithmic}[1]     \Procedure{$\mathbf{foo}$}{}         \State sum $\gets$ 0;         \For{$i\gets 1 \to 10$}                \State sum $\gets$ sum + i;              \EndFor     \EndProcedure     \Statex     \end{algorithmic}       \vspace{-0.4cm}%     \end{algorithm}     %\vspace{-0.4cm}%           The algorithm environment provided by the algorithm2e package is a "floating" environment,      just like table and figure floating environments are. Hence, it can't be wrapped inside another floating group.               \end{document}


title: Verbments file *.pyg.vrb not found

text: I am using Verbments package in texworks from MiKeTeX and I have added -shell- escape to the argument list but I keep getting this error               ! LaTeX Error: File `untitled-2.pyg.vrb' not found.      here is my code               \documentclass[a4paper,12pt]{article}     \usepackage{graphicx}     \usepackage{verbments}               \begin{document}          Test     \begin{pyglist}[language=c]                      for(int i=0;i<32;i=i+2)                     {                         x[i]=a[i]*c[i];                         x[i+1]=a[i+1]*c[i+1];                     }                     \end{pyglist}          \end{document}


title: How to add tax to invoice?

text: I'm using the `invoice` package, and I'd like to know how to add tax into the totals. Are you supposed to add tax to a wholesale invoice? Also, how to add other fields to the table if possible.


title: Table: white spacing with rowcolor, multicolumn and multirow

text: I have the following table : ![problematic table](http://i.stack.imgur.com/3xzc2.png) It uses `\rowcolor`, `\multicolumn`, `\multirow` but it also has a wide white spacing between the cases. I need the title "Cobertura del transporte en el municipio de Monterrey" to be properly centered, respecting the 2 cases width, the padding and the space between the left, right and the cases below it. I also need to combine the two green cases rounded by the red ellipse and containing the "91.4%" value. These two cases would then become one (cf. the `\multirow` attempt below) green case spanning between the two rows and respecting the height and padding. I've been trying to get my table right with this method, only it does not seem to apply to my particular example because of the white spacing. The code for this table is the following :               \documentclass[11pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{color}     \usepackage{amsmath, amsfonts, amssymb}     \usepackage{mdframed}     \usepackage{multirow}     \usepackage{tikz,pgfplots}     \usepackage{colortbl}     \usetikzlibrary{shapes}          %------Column types--------------     \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}          %------Space between cases-------     \makeatletter     \newcommand{\thickhline}{%         \noalign {\ifnum 0=`}\fi \hrule height 2pt         \futurelet \reserved@a \@xhline     }     \newcolumntype{+}{@{\hskip\tabcolsep\vrule width 2pt\hskip\tabcolsep}}     \makeatother          %-------Colors--------------------     \definecolor{table1}{RGB}{255,129,54}     \definecolor{table2}{RGB}{41,148,178}     \definecolor{table3}{RGB}{255,129,54}     \definecolor{table4}{RGB}{220,220,77}     \definecolor{table5}{RGB}{58,58,58}          \begin{document}          \begin{table}[!ht]     \centering     \color{white}\sffamily     \begin{tabular}{L{3cm}+C{3cm}+C{3cm}+C{3cm}}              \rowcolor{table5}         Otra cosa & \multicolumn{2}{c}{Cobertura del transporte en el municipio de Monterrey} & Otra cosa\\              \thickhline         \rowcolor{table4}         - & \cellcolor{table3}\textcolor{table5}{Primer Cuadro} & \multirow{2}{*}{\textcolor{table5}{91.4\%}} & -\\              \thickhline         \rowcolor{table4}         - & \cellcolor{table3}\textcolor{table5}{Centro (Poniente)} &  & -\\              \thickhline         \rowcolor{table4}         - & \cellcolor{table3}\textcolor{table5}{Oeste} & \textcolor{table5}{90.1\%} & -\\         \hline          \end{tabular}     \end{table}          \end{document}      Note : I obviously tried replacing the line `\multicolumn{2}{c}{Cobertura del transporte en el municipio de Monterrey}` by this one : `\multicolumn{2}{C{6cm}}{Cobertura del transporte en el municipio de Monterrey}` but it did not provide anything good : ![enter image description here](http://i.stack.imgur.com/BDgYk.png) Does anyone has a proper solution for this issue?


title: Clear tableofcontents page in memoir

text: How do I clear the `\tableofcontents` page in `memoir`?               \documentclass[a4paper]{memoir}     \begin{document}     \pagestyle{headings}     \begin{titlingpage}       \maketitle     \end{titlingpage}          % i need clear this page     {\thispagestyle{empty} %but is not work     \tableofcontents}          \chapter{Memoir com Estilo de Página}          \end{document}


title: Font issue when including EPS from Metapost into XeLaTeX

text: I've run into strange problems with fonts in figures included in XeLaTeX document. I have figures generated from Metapost sources with rotated math labels. When I include resulting EPS into document its rendering depends upon including another figure before it. Example should clear what I mean. `problem.tex` is compiled with `xelatex`, both figures with `mpost`. When I don't include the first picture, the second one is alright. However, when it's included, rotated label (`$\text{odvěsna úhlu }\alpha$`) is displayed with totally inappropriate font. I've no idea if it's a bug or some hidden feature I am not aware of... (In a little bit different setup than presented only alpha is displayed incorrectly as ligature `ff`.) I'll be grateful for any ideas. problem.tex:               \documentclass{article}     \usepackage{xltxtra}     \usepackage[czech]{polyglossia}     \begin{document}     \begin{figure}[!h]         \includegraphics{imgA.eps} %this causes problem     \end{figure}          \includegraphics{imgB.eps}          \end{document}      imgA.mp:               input fks     verbatimtex     %&latex     \documentclass[9pt]{extarticle}     \usepackage[utf8]{inputenc}     \usepackage{fkssugar} % only helping macros     \begin{document}     etex     prologues:=3;     u:=1cm;     beginfig(1);          z0=(0,0);     z1=(0, 2u);     z2=( 3u, 0);          draw z0--z1--z2--cycle;          uhelR(z2,z0,4mm);     draw (thelabel.top(btex $a - \text{odvěsna}$ etex,z0)).rotated 90 .shifted    (.5[z0,z1]);     label.bot(btex $b - \text{odvěsna}$ etex,.5[z0,z2]);     label.urt(btex $c - \text{přepona}$ etex,.5[z1,z2]);          endfig;     verbatimtex     \end{document}     etex     end;      imgB.mp:               input fks     verbatimtex     %&latex     \documentclass[9pt]{extarticle}     \usepackage[utf8]{inputenc}     \usepackage{fkssugar}     \begin{document}     etex          prologues:=3;     u:=1cm;          beginfig(1);          z0=(0,0);     z1=(0, 2u);     z2=( 3u, 0);               draw z0--z1--z2--cycle;     uhel(z1,z2,z0,8mm);          uhelR(z2,z0,4mm);          draw (thelabel.top(btex $a - \text{protilehlá}$ etex,z0+(0,8pt))).rotated 90 .shifted(.5[z0,z1]);          draw (thelabel.top(btex $\text{odvěsna úhlu }\alpha$ etex,z0)).rotated 90 .shifted(.5[z0,z1]);     label.bot(btex $b - \text{přilehlá}$ etex,.5[z0,z2]);     label.bot(btex $\text{odvěsna úhlu } \alpha$ etex,.5[z0,z2]-(0,9pt));     label.urt(btex $c - \text{přepona}$ etex,.5[z1,z2]);     label.ulft(btex $\alpha$ etex,z2-(3mm,0));               endfig;          verbatimtex     \end{document}     etex          end;


title: Edit page headers

text: I am trying to edit my page titles with fancyhdr package. I want the top left of the page to present [section number]. [section name] in boldface and small caps. for example: **3.2. PYTHAGORAS THEOREM** I noticed that `\leftmark` puts the small-caps letter in a nice way (with proper space between them, and also straight, which doesn't happen with some other methods) but if I try to edit it               \renewcommand{\leftmark}{...}      I lose the small caps. What is the best way to achieve what I want? An example code to build on:               \documentclass[a4paper,11pt,english]{book}     \usepackage{fancyhdr}     \usepackage[english]{babel}     \fancyhead[LE,LO]{\leftmark}     \fancyhead[RE,RO]{\bfseries \thepage}     \pagestyle{fancy}          \usepackage{blindtext}     \begin{document}         \chapter{My first chapter}         \blindtext         \section{My first section}         \blindtext[10]       \end{document}


title: Inserting an A1 image into an A4 document whilst maintaining page numbers?

text: I'm a bit new to LaTeX so sorry if this is obvious. I'm trying to insert a large image (which I have created a pdf version of) into an A4 document. I have tried using pdfpages and fitpaper=true to insert the image but then the page number is displayed in the middle of the document, as it still treats the page as an A4 size. I have trawled the internet and found a method for changing the size of a single sheet in the document into an A3, which works fine, but I get issues when I try to adapt it for an A1. Below is the code I am currently using:               \newpage     \begingroup     \advance\textwidth\pdfpagewidth     \hsize=\textwidth\linewidth=\hsize\columnwidth=\hsize     \pdfpagewidth=4\pdfpagewidth     \pdfpageheight=2\pdfpageheight          \hfill\includegraphics[scale=0.80]{./Images/image.pdf}\hspace*{\fill}          \newpage     \endgroup      I believe the issue is due to the workable page space that hasn't been taken into account when I changed the physical size of the page. Alternatively if you use pdfpages:               \includepdf[pages=-,scale=0.8,fitpaper=true,pagecommand=\thispagestyle{plain}]{./Images/image.pdf}      The image appears correctly as an A1 drawing on an A1 sheet in an otherwise A4 document, but the page number does not display correctly on the bottom as a footer. If anyone can give any guidance that would be great. Thanks!


title: How do I run this poster template?

text: I found a _really_ nice example here that I would like to get going with as a template. There are _some_ instructions but I found that errors in my document from what I can follow.   * I downloaded `a0poster.cls` and `a0header.ps` (I have no idea what these are) and I put them in the file where I would like my `.tex` file to go (this location was a guess).    * I downloaded `a0size.sty` and did the same with that.   * The website says that I also need `multicol, pstricks and pst-grad` packages. I ignored this for the time-being and downloaded the `poster.tex` file (as well as `gklogo.eps` and `poster.bib`) just to see what happened first. I got a lot of errors! The error at the top of the list is "Undefined control sequence. \c@lor@to@ps \background {1.1.1.}{1.1.1.}{0.5}" I'm clearly out of my depth but I can't stand going back to PowerPoint, where can I start in getting this template to work?


title: Missing number, treated as zero. What is wrong in here?

text: \documentclass[a4paper,12pt]{article}     \usepackage[dutch]{babel} % Quotes won't work without babel     \usepackage[utf8]{inputenc}  % This is very important!     \usepackage[T1]{fontenc}          \usepackage{graphicx}     \usepackage{tabularx}          \newcolumntype{Y}{>{\raggedright}X}          \begin{document}     \begin{tabularx}{\linewidth}{|Y|Y|}\hline     \multicolumn{}{}{Some Text.}     More Text and some Items below:     \begin{itemize}     \item Item1     \item Item2     \item Item3     \item Item4     \item Item5     \item Item6     \item Item7     \end{itemize}     & \begin{center} \resizebox{10cm}{!}{\includegraphics{pic.png}}\\ \textit{Picture Description} \end{center}     \tabularnewline \hline     \end{tabularx}     \end{document}      Error message is:               Missing number, treated as zero.     <to be read again>      \relax      l.26 \end{tabularx}      Can somebody solve this, please?


title: Pgfplotstable without headings row

text: I would like to typeset a table with a multicolumn heading _only_. Here is my current attempt               \documentclass{article}     \usepackage{pgfplotstable}     \usepackage{booktabs}     \usepackage{array}     \usepackage{colortbl}          \begin{document}     \pgfplotstabletypeset[col sep=&, header=false,     every head row/.style={     before row={%     \toprule     Facteurs & \multicolumn{5}{c}{Niveaux}\\     }},     every last row/.style={     after row=\bottomrule},     display columns/0/.style={string type}     ]     {%     \pgfutilensuremath{\chi} & 8 & 11 & 14 & &     5 & 8 & 11 & 14 & 45 & 2.456     q & 8 & 11 & 14 & & 3     x & 8 & 11 & 14 & 5612345 & 4     b & 8 & 11 & 14 & & 5     }     \end{document}      which gives the following result: ![enter image description here](http://i.stack.imgur.com/eFa9S.png) How can I remove the headings row circled in red in the picture?


title: How to ensure document total page numbers is a multiple of four?

text: I'm producing a document (book class) that will ultimately be produced using offset lithography. It's therefore useful to ensure the total number of pages is a multiple of four by adding as many blank pages to the end as is appropriate. This answer deals with adding a page if necessary to make the total number even. I can't figure out how to adapt it to deal with multiples of four. Is there a way?


title: Highlight the next uncovered part in beamer

text: I have created the code below to highlight the parts where something need to be completed by the students. It works, but   * instead of frames there should be a light colored background   * this background would appear just before the part will be uncovered to know where is the next problem to solve   * the beamerarticle form should not have the frames (background color is all right) My code:               \documentclass{beamer}     \newcommand{\frameuncover}[2]{\framebox{\uncover<#1>{#2}}}          \begin{document}          \begin{frame}[fragile]       {Hamming distance}              The Hamming distance of the code below is \frameuncover{5-}{4}.          \begin{verbatim}     a 01010101     b 00001111     c 00110010     \end{verbatim}          d(ab) = \frameuncover{2-}{4}          d(bc) = \frameuncover{3-}{5}          d(ac) = \frameuncover{4-}{5}          \end{frame}          \end{document}


title: Relative positioning of node with TikZ Positioning

text: I am trying to replicate an automata with tikz and was wondering if there is a keyword that would allow be to mimic the position of the states with relative positioning without a "dummy" node. Below is my current solution with a blank node and an image of what I am trying to replicate the state positions of:               \documentclass[12pt,letterpaper]{article}     \usepackage[margin=1in]{geometry}     \usepackage{fancyhdr, float}          \usepackage{amsmath, amssymb, amsthm}     \usepackage{cleveref}     \usepackage{algorithm2e}     \usepackage{enumerate}     \usepackage{graphicx}          \usepackage{tikz}     \usetikzlibrary{automata,positioning}          \renewcommand{\a}{\mathtt{a}}     \renewcommand{\b}{\mathtt{b}}          \begin{document}     \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto]          \node[state,initial] (A_2) {$A_2$};         \node (Z) [right=of A_2] {};         \node[state,accepting] (B_2) [right=of Z] {$B_2$};         \node[state] (C_2) [below=of Z] {$C_2$};         \path[->]             (A_2) edge [bend left=15] node {$\varepsilon$} (B_2)         edge [swap] node {$\a$} (C_2)             (B_2) edge [bend left=15] node {$\a$} (A_2)             (C_2) edge [loop right] node {$\b$} ()         edge [swap] node {$\a,\b$} (B_2);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/3FIUn.png)


title: Expanding a sequence inside a TikZ path

text: I am trying to draw a simple path using TikZ, with a custom syntax to specify it. This works:               \documentclass{article}     \usepackage{tikz}     \begin{document}          \newcommand{\latticepath}[1]{         \draw[thick] (0,0) node{} \foreach \x in {#1}{ -- \if u\x ++(0,1) \else ++(1,0) \fi node{}};     }     \begin{tikzpicture}[x=3mm,y=3mm]         \tikzset{every node/.style={circle,fill,draw=none,inner sep=2pt}}         \latticepath{r,r,u,r,r,u,u,r,u,r,u,u}     \end{tikzpicture}          \end{document}      ![](http://i.stack.imgur.com/TJY3O.png) However, I would prefer not to comma-separate the values. So I wrote this command to convert a sequence of letters into path components:               \documentclass{article}     \usepackage{tikz}     \begin{document}          \makeatletter\let\mygobble\@gobble\makeatother     \newcommand{\readpath}[3]{         \def\pathimpl##1{\ifx##1.\let\rest\mygobble\else\ifx##1u#1\else#2\fi\def\rest####1{####1}\fi\rest\pathimpl}         \pathimpl#3.     }          \readpath{Up }{Right }{rrurruururuu}      ![](http://i.stack.imgur.com/XFAOR.png) However this implementation produces a bunch of errors due to the use of macros in paths:               \newcommand{\betterlatticepath}[1]{         \draw[thick] (0,0) node{} \readpath{++(0,1) node{}}{++(1,0) node{}}{#1};     }     \begin{tikzpicture}         \tikzset{every node/.style={circle,fill,draw=none,inner sep=2pt}}         \betterlatticepath{rrurruururuu}     \end{tikzpicture}          \end{document}      > Package tikz Error: Giving up on this path. Did you forget a semicolon?.   >  Undefined control sequence.   >  You can't use `macro parameter character #' in restricted horizontal mode.   >  Parameters must be numbered consecutively.   >  Parameters must be numbered consecutively.   >  Argument of \rest has an extra }.   >  Runaway argument? I tried `\pgfextra`, but this doesn't help. How can I make this work?


title: Is babel a proper place to reset document layout?

text: The babel package, when called with some language options, changes global document layout. For exapmle,               \usepackage[french]{babel}      forces first paragraph after sectioning command to be intented, resets `itemize` environment and performs a number of other changes to global document layout. On the other hand, there is a package `indentfirst` that makes the same changes regarding paragraph identation. And I am guessing that there are packages which could reset list environments on more regular basis. Therefore my question is **Is babel a proper place for resetting document layout?** I am asking because I found that Russian language definition file for babel had in the past similar functions borrowed from French language definition file but they were disabled later. Having looked at the French language definition file for `polyglossia` I would say that `polyglossia` does not care document layout and makes no changes to document layout except for switching on/off frenchspacing. Since `polyglossia` is promoted as future replacement for babel my question has strategic value.


title: tocloft recipe to simulate the titlecontents* behaviour of titletoc

text: I can't use `titletoc`, since there are incompatibilities between this package and others that I am using. However, `tocloft` works fine. I would like to simulate the `\titlecontents*` effect using tocloft. How can I do this (main problem, of course, being having all the entries on the same line)?               \documentclass{report}     \usepackage{lipsum}     \usepackage{titletoc}     \titlecontents*{section}         [1.5em]          {\small}          {\thecontentslabel. }          {}         {, \thecontentspage} [\ \textbullet\ ][.]     \begin{document}     \tableofcontents     \chapter{A chapter}     \section{A section}     \lipsum     \section{Another section}     \lipsum     \section{Yet another section}     \lipsum     \section{And another section}     \end{document}      ![output of code](http://i.stack.imgur.com/cnzGx.png) EDIT: When I try to run `titletoc` on my file (without providing the class, which is quite long to analyse, it is meaningless to put a MWE), I get an error code like this one:               \GenericError  ...                                     \endgroup  \addpenalty ...kipb \fi \fi \fi \else \@noitemerr      \fi  \l@chapterifnoframe ...ddpenalty {-\@highpenalty }     \vskip 1.0em \@plus \p@ \s... l.14 ...ine {chapter}{\numberline {B}Chapter 2}{5}      It is of course highly unspecific, and the l.14 in my code is a line not linked to any kind of title or table of content matter... That is why I leaned toward finding a way with `tocloft`... EDIT 2 : here is a link to the class (which is book-derived): http://www.loria.fr/~roegel/TeX/TL.tar.gz. I warn you, this might not be easy to see where it fails... EDIT 3 : The problem only appears when I am using this on subsection or subsubsection... It works fine with section. Any idea why?


title: Replacing "and" by "og" and "In"by "I" in references and bibliograpy using natbib

text: Since I am writing in norwegian, I would like to chang the two words "and" and "in" into norwegian. "And" appears both in references in the text and in the bibliography, while "in" appears in the bibliography. My document:               \documentclass[a4paper, norsk, 12pt]{article}      \usepackage[latin1]{inputenc}            \usepackage [norsk] {babel}                               \usepackage[round, longnamesfirst]{natbib}                \begin{document}          If I have more than one author, the reference would be a list of alle the authors the first time i cite it \citep{fysdid}.      The problem is that I can not have the word ''and'' in the reference when I am writing i norwegian. I would like to replace it by ''og''.          \renewcommand{\refname}{Litteratur}     \addcontentsline{toc}{section}{\refname}     \bibliography{litteratur}     \bibliographystyle{abbrvnat}               \end{document}           the bibtex-file:               @book{fysdid,     title= {Fysikkdidaktikk},     author= {Carl Angell and Berit Bungum and Ellen K. Henriksen and Stein Dankert Kolstø and Jonas Persson and Reidun Renstrøm},     year= {2011},     publisher={Manusutkast},     }      The result:               If I have more than one author, the reference would be a list of alle the     authors the rst time i cite it (Angell, Bungum, Henriksen, Kolst, Persson,     and Renstrm, 2011). The problem is that I can not have the word "and"     in the reference when I am writing i norwegian. I would like to replace it by     "og".          Litteratur          C. Angell, B. Bungum, E. K. Henriksen, S. D. Kolst, J. Persson, and     R. Renstrm. Fysikkdidaktikk. Manusutkast, 2011.


title: LaTeX3: \dim_set:Nn with l3calc or calc type dimension expression

text: I am getting an error when I try to set a dimension register with a l3calc/calc type dimension expression using LaTeX3 `\dim_set:Nn` command. Even wrapping the whole expression into `\dim_eval:n{}` doesn't help. What can I do?               \documentclass{article}     \usepackage{expl3}     \usepackage{l3calc}          \begin{document}          \newlength{\mydim}          \setlength\mydim{15pt*\ratio{5pt}{10pt}} %this works     \typeout{\the\mydim} %7.5pt          \ExplSyntaxOn     \dim_set:Nn\mydim{15pt*\ratio{5pt}{10pt}} %error     \dim_set:Nn\mydim{\dim_eval:n{15pt*\ratio{5pt}{10pt}}} %same error     \ExplSyntaxOff          \typeout{\the\mydim} %don't get here          \end{document}


title: How to get an "and" before the last element in BibLaTeX's textcite commands?

text: When using `\textcite` or `\textcites` with more than one author in BibLaTeX, the result is not really usable and has to be fixed manually which can hardly be the point of the command:               \documentclass{minimal}     \listfiles     \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @article{alice,       author = {Alice, A.},     }     @book{bob,       author = {Bob, B.},     }     @collection{charlie,       editor = {Charlie, C.},     }     \end{filecontents}     \usepackage[style=numeric,sortcites]{biblatex}     \addbibresource{\jobname.bib}     \begin{document}     Refer to the works of \textcite{charlie,alice,bob}.          Refer to the works of \textcite{alice,bob} and \textcite{charlie}.     \end{document}      Which looks like this: ![Alice, Bob, Charlie vs. Alice, Bob and Charlie](http://i.stack.imgur.com/38vHX.png) One can argue about having a comma between the second and third element but surely the "and" is mandatory in English. So is there a way to get BibLaTeX to behave that way?


title: Dynamic autocomplete for words (non-LaTeX commands) in WinEdt 6.0

text: Does anyone know how to get WinEdt 6.0 to perform dynamic autocomplete ?. I would like to expand words I've already used, either in the current `.tex` file, or in the directory tree for a given document, without typing the entire word. Any ideas ? Note, I'm not trying to expand latex commands, such as `\begin{... }..\end{}` but to expand words I have used.


title: using \ForEach to input chapters in a document

text: I have several chapters in the folder `/Chapters` and I have the following LaTeX code:               \newcommand\chapnames{Chap1, Chap2, Chap3, Chap4, Chap5, Chap6}          \ForEach     {,}     {\input{./Chapters/\thislevelitem}}     {\chapnames}      Unfortunately, this piece of code does not work unless I change it to:               \ForEach     {,}     {\input{./Chapters/\thislevelitem}}     {Chap1, Chap2, Chap3, Chap4, Chap5, Chap6}      Is there a way to make it work while using `\chapnames` variable as shown in the `\ForEach` code at the top?


title: What does the \the\everypar do?

text: If you test the following minimal it does not produce an error. What does it actually do?               \the\everypar     \bye      Why doesn't it produce an error as one would expect?


title: Misplaced Accents in Cyrillic Text

text: In educational material for the Russian language and linguistic literature the need to put accents on Cyrillic vowels often arises. However when I tried to do this with luaLaTeX the accents where misplaced.               \documentclass[11pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{fontspec}     \setmainfont{Linux Libertine:style=Regular}     \begin{document}          Е́сли вы изу́чите          \'{Е}сли вы из\'{у}чите          \'{E}сли вы из\'{y}чите % Here "E" and "y" are Latin glyphs, but this workaround does not                             % work with all Cyrillic letters e.g. Я, Ю     \end{document}      ![misplaced accents](http://i.imgur.com/8Cs31Gc.png) The last line would looks nice, but unfortunately these are Latin glyphs. Is this a problem with the font used (Linux Libertine) or with LaTeX? ![enter image description here](http://i.stack.imgur.com/zF6MA.png)


title: Need Latex compilation for only some eps files, want rest as precompiled pdfs or png

text: I am using the `chemscheme` package and in order to replace numbering in these schemes I have in my document, I need to compile those eps files with latex, then dvips, and finally ps2pdf. However, I have a very large number of images (upwards of 100, and it will only be increasing) that are perfectly fine to be used as the png they are in, or a precompiled pdf file. Since I need latex compilation for the `chemscheme` numbering, all those png or pdf images need to be in eps form, and it adds a solid 2-3 minutes to the compilation time. Is there any solution for this type of situation? I have read some solutions on here about packages like `standalone` and `externalize` but I confess to not fully understanding how to apply those solutions or if they even apply to this situation. I thought I would add that without these extra images, my latex file compiles in about 30 secs, with the images it is now almost at 4 minutes compilation time :( Here is an example of how the `chemscheme` package works (it is included as part of the `chemstyle` package. The file "reaction.eps" can be downloaded at the following link. The zip file also includes what the png looks like if you precompile it just on it's own (those TMP tags get replaced during the conversion process). The numbering commands `\CNlabel` and `\CNlabelsub` are sprinkled throughout the document, and they increment counters related to the compound numbering which is used in the replacement of the `TMP` tags within the images. However, only a handful of my images use these tmp tags and require this certain compilation. The rest have no `TMP` included and can be compiled externally without problem. In order to get the correct numbering, `latex` must be run twice, before calling `dvips`. eps and pdf files: http://www.filedropper.com/reaction_1               \documentclass{article}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{bpchem}     \usepackage[tracking=bpchem]{chemstyle}               \begin{document}          I am a document about methanol (\CNlabelsub{alcohol}{Me}), and the related alcohol isoamyl %     alcohol (\CNlabelsub{alcohol}{isoamy}).  \CNlabelsub{alcohol}{Me} can be converted to an alkyl %     halide with \BPChem{HCl} to give chloromethane (\CNlabel{MeCl}, \ref{sch:reaction}).     \begin{scheme}     \caption{I am a scheme}\label{sch:reaction}     \schemerefsub{alcohol}{Me}     \schemerefsub{alcohol}{isoamy}     \schemeref{MeCl}     \includegraphics{reaction}     \end{scheme}          \end{document}      **Update, possible solution, but not quite finished** From Garbage Collector's answer, it did occur to me. I can provide a premade list of all the compounds in the document with a command `\CNlabelnoref` and `\CNlabelsubnoref`. I have done that, and below is a MWE using the standalone package. However, I now get an error a whole list of errors beginning at the `\begin{figure}` line, the first one being > LaTeX Error: Something's wrong--perhaps a missing \item.               \documentclass[border=0pt]{standalone}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{bpchem}     \usepackage[journal=rsc,tracking=bpchem]{chemstyle}     \renewcommand*{\schemerefformat}{\small\fontfamily{cmr}}     \newcommand{\chemdrawgraphic}[1]{\includegraphics[scale=1]{#1}}     \setcounter{BPCno}{200}     \CNlabelsubnoref{alcohol}{Me}     \CNlabelsubnoref{alcohol}{isoamy}     \CNlabelnoref{MeCl}     \begin{document}     \begin{figure}         \schemerefsub{alcohol}{Me}         \schemerefsub{alcohol}{isoamy}         \schemeref{MeCl}         \chemdrawgraphic{reaction}     \end{figure}     \end{document}


title: Vertical text alignment in tabular is wrong

text: According to http://en.wikibooks.org/wiki/LaTeX/Tables ('The tabular environment' paragraph), I would have expected to be able to use 'p', 'b', 'm' to define vertical text alignment for a column. This Problem with Table Vertical Alignment question from 2010 tells otherwise and provides (a bit inflexible) workarounds. My question is, if there is something simple to vertically (top, bottom, center) align text in a cell? Here my code (which aligns 'middle, middle, top', i.e. 'p b m' doesn't work at all...):               \documentclass[10pt]{article}     \usepackage{array}     \begin{document}          \begin{tabular}{|p{4cm}|b{4cm}|m{5cm}|}     \hline       xxx & ab cd ... & ef gh ... \\[10ex]     \hline       xxx & ij kl ... & mn op ...\\     \hline     \end{tabular}          \end{document}      (I also tried with \parbox and \newcolumntype to no avail, \multirow could be an option but didn't try out yet). Edits: I'd like to achieve the following (as simple as possible;):               -----------------------------------------     | xxx       |           |               |     |           |           | ef gh ...     |     |           | ab cd ... |               |     -----------------------------------------     | xxx       | ij kl ... | mn op ...     |     -----------------------------------------


title: Texmaker / TeXstudio does not compile XeLaTeX with MiKTeX portable

text: I am trying to migrate from TeXworks to Texmaker (just for the fact that it is better for handling multi-files projects). I am using portable versions of both MiKTeX and Texmaker, so, in Texmaker I went to Options > Configure Texmaker > Commands and point every command available to the current path of MiKTeX. And it works just fine with PDFLaTeX, but at the moment I try to compile some XeLaTeX document it just do not generate any PDF output. For a brief moment, in the log frame says that it can not recognize `xdvipdfmx` as a program or a command. So I figure that it is trying to find it in the default installed MiKTeX directory (because `xdvipdfmx.exe` indeed exist in the same folder than `xelatex.exe` and TeXworks never has a problem finding it). There is an option to set the path to `dvipdfm` (which —I am guessing— works with PDFLaTeX), but not for `xdvipdfmx`. So, a concise question would be, Is there a way to change (or add) the default directory for Texmaker to look for? Or is the problem another? **[Addendum]** [edited] So, I decided to put a `xdvipdfmx.bat` file into the Windows folder (which only contains one line: `E:\LaTeX\MiKTeX\miktex\bin\xdvipdfmx.exe`), and now it appears that compiles as it should, BUT it does not produce any PDF file, even tho the log file ends saying “Output written on satre-merleau-ponty-levinas.pdf (175 pages)” or, if I add an `\includeonly` sentence, “Output written on satre-merleau-ponty- levinas.pdf (9 pages)”. Every auxiliar file is also created, just not the PDF. Any thoughts? A minimal example (not PDF output generated) is               \documentclass[11pt,twoside,book]{memoir}     \usepackage{lipsum}     \usepackage{fontspec}     \begin{document}     \lipsum     \end{document}      Under this conditions: MiKTeX portable 2.9, Texmaker portable 3.5.2 (or TeXstudio portable 2.5) It indeed generates a PDF output if I compile it from TeXworks OR if I comment out the `\usepackage{fontspec}` line and compile it with pdfLaTeX.


title: Vertically Centering Text/Numbers in Rows of Array using Math Mode

text: I am trying to center text in an array of two rows inside a math mode environment so that the text in the second column of the array appears half way between the first and second row of the first column. Here's an example of what I have done so far.               \documentclass{article}          \usepackage{amsmath}          \begin{document}       \[         A = \left[         \begin{array}{c|c}           B & \\           a^{T} & b \\         \end{array}         \right]       \]     \end{document}      This is how I would like it to appear: ![enter image description here](http://i.stack.imgur.com/KuiEq.jpg) Any help/suggestions on how to do this would be appreciated.


title: Indentation inside a new environment

text: I want to have my text lines in a new environment indented from the left, as happens within               \begin{minipage}{...}     \end{minipage}      The reason not to use a `minipage` inside the environment definition is to enable page breaking within the environment. How can I achieve that?


title: Full width table with caption in refman doc

text: The `refman` document class has a big left margin for text. Only the headings are on the normal left margin. Perfect for what I'm doing. But I have a wide table (float) that must be centered on the full page width (like `table*` in two-column mode). So far closest to success is the `changepage` package `adjustwidth` environment. It takes care of the table (`tabular` env) just fine. But the caption remains centered with respect to the wide left margin, even though it's inside the `adjustwidth`. A MWE:               \documentclass[11pt,letterpaper]{refart}     \usepackage[strict]{changepage}      \usepackage{array}     \begin{document}     \section{A section}     Here is some normal text at the normal margin.     Now let's insert wide Table~\ref{tbl:thetable}.\     \begin{table}     % Uncommenting this environment will move the          % table contents left, but not the caption!     %\begin{adjustwidth}{-1.5in}{}     \caption{The caption.}     \begin{tabular}{>{\sf}llp{7cm}}     {\bf Schedule item} & {\bf Type} & {\bf Description} \\ \hline      Start semifinals logins &            date &            semifinalists can log in to either            home page but not submit semifinal designs\\     \end{tabular}     \label{tbl:thetable}     %\end{adjustwidth}     \end{table}     And finish with more text.     \end{document}      This is frustrating! How can both table and caption be convinced to use full width?


title: Enumerated examples

text: I'm trying to create an example environment, so I've done the very simple               \newtheorem{example}{Example}[section]      which I can then use as               \begin{example}       Example 1     \end{example}      What I would really like to do is (sometimes) have example 12.1(a), 12.1(b), 12.1(c) and then also 12.2,12.3 etc. Is there a nice simple way to do this?


title: A TeX translation of old C code - Evaluating elements of an array *inside* a foreach loop

text: I'm trying to translate a conceptually simple part of an algorithm, from the original source for the `R`-engine (written in `C`) to TeX. This shouldn't take more than some logic trees and for/while loops. Per @percusse's comment I'll explain the full use case to understand what I want to do. The code I wish to mimic is the following:               int attribute_hidden chebyshev_init(double *dos, int nos, double eta)     {         int i, ii;         double err;              if (nos < 1)             return 0;              err = 0.0;         i = 0;  /* just to avoid compiler warnings */         for (ii=1; ii<=nos; ii++) {             i = nos - ii;             err += fabs(dos[i]);             if (err > eta) {             return i;             }         }         return i;     }      Source: https://github.com/wch/r-source/blob/776708efe6003e36f02587ad47b2eaaaa19e2f69/src/nmath/chebyshev.c#L48 (Lines 48-66) The real use case can be found at https://github.com/wch/r-source/blob/0b493ddbefbc3cc06f675841c4672b3197dbfbbb/src/nmath/gamma.c#L103. The arguments show:               ngam = chebyshev_init(gamcs, 42, DBL_EPSILON/20)      Gamcs is defined as:               const static double gamcs[42] = {     +.8571195590989331421920062399942e-2,     +.4415381324841006757191315771652e-2,     +.5685043681599363378632664588789e-1,     -.4219835396418560501012500186624e-2,     +.1326808181212460220584006796352e-2,     -.1893024529798880432523947023886e-3,     +.3606925327441245256578082217225e-4,     -.6056761904460864218485548290365e-5,     +.1055829546302283344731823509093e-5,     -.1811967365542384048291855891166e-6,     +.3117724964715322277790254593169e-7,     -.5354219639019687140874081024347e-8,     +.9193275519859588946887786825940e-9,     -.1577941280288339761767423273953e-9,     +.2707980622934954543266540433089e-10,     -.4646818653825730144081661058933e-11,     +.7973350192007419656460767175359e-12,     -.1368078209830916025799499172309e-12,     +.2347319486563800657233471771688e-13,     -.4027432614949066932766570534699e-14,     +.6910051747372100912138336975257e-15,     -.1185584500221992907052387126192e-15,     +.2034148542496373955201026051932e-16,     -.3490054341717405849274012949108e-17,     +.5987993856485305567135051066026e-18,     -.1027378057872228074490069778431e-18,     +.1762702816060529824942759660748e-19,     -.3024320653735306260958772112042e-20,     +.5188914660218397839717833550506e-21,     -.8902770842456576692449251601066e-22,     +.1527474068493342602274596891306e-22,     -.2620731256187362900257328332799e-23,     +.4496464047830538670331046570666e-24,     -.7714712731336877911703901525333e-25,     +.1323635453126044036486572714666e-25,     -.2270999412942928816702313813333e-26,     +.3896418998003991449320816639999e-27,     -.6685198115125953327792127999999e-28,     +.1146998663140024384347613866666e-28,     -.1967938586345134677295103999999e-29,     +.3376448816585338090334890666666e-30,     -.5793070335782135784625493333333e-31         }      `DBL_EPSILON` is defined as `DBL_EPSILON = 2^(-52)`. To know what result I'm looking for, we can mimic the entire calculation of `chebyshev_init`. To do that, you can run the following code in `R`:               DBL_EPSILON = 2^(-52)     err = 0.0     i = 0     dos = c(+.8571195590989331421920062399942e-2,     +.4415381324841006757191315771652e-2,     +.5685043681599363378632664588789e-1,     -.4219835396418560501012500186624e-2,     +.1326808181212460220584006796352e-2,     -.1893024529798880432523947023886e-3,     +.3606925327441245256578082217225e-4,     -.6056761904460864218485548290365e-5,     +.1055829546302283344731823509093e-5,     -.1811967365542384048291855891166e-6,     +.3117724964715322277790254593169e-7,     -.5354219639019687140874081024347e-8,     +.9193275519859588946887786825940e-9,     -.1577941280288339761767423273953e-9,     +.2707980622934954543266540433089e-10,     -.4646818653825730144081661058933e-11,     +.7973350192007419656460767175359e-12,     -.1368078209830916025799499172309e-12,     +.2347319486563800657233471771688e-13,     -.4027432614949066932766570534699e-14,     +.6910051747372100912138336975257e-15,     -.1185584500221992907052387126192e-15,     +.2034148542496373955201026051932e-16,     -.3490054341717405849274012949108e-17,     +.5987993856485305567135051066026e-18,     -.1027378057872228074490069778431e-18,     +.1762702816060529824942759660748e-19,     -.3024320653735306260958772112042e-20,     +.5188914660218397839717833550506e-21,     -.8902770842456576692449251601066e-22,     +.1527474068493342602274596891306e-22,     -.2620731256187362900257328332799e-23,     +.4496464047830538670331046570666e-24,     -.7714712731336877911703901525333e-25,     +.1323635453126044036486572714666e-25,     -.2270999412942928816702313813333e-26,     +.3896418998003991449320816639999e-27,     -.6685198115125953327792127999999e-28,     +.1146998663140024384347613866666e-28,     -.1967938586345134677295103999999e-29,     +.3376448816585338090334890666666e-30,     -.5793070335782135784625493333333e-31)     nos = 42     eta = DBL_EPSILON/20     for (ii in 1:nos) {     i = nos - ii     err = err + abs(dos[i])     if (err>eta)     {     break     }     }      The resulting value of `i` is 23, which is indeed the case if `err=>eta`. We've namely crossed the intended value by one by setting it larger (`>`) instead of larger or equal to (`=>`). The intended result also shows at https://github.com/wch/r-source/blob/0b493ddbefbc3cc06f675841c4672b3197dbfbbb/src/nmath/gamma.c#L115. Yes, I'm aware that knowing the result makes this a rather useless excercise, but this case is explanatory and the algorithm is required in more than just this case. So `R` in fact does give the correct result. I've made my own version of this algorithm, which would ideally would look a little like this:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{fpu}     \usepackage{xintexpr}     \def\gamcs{{     +.8571195590989331421920062399942e-2,     +.4415381324841006757191315771652e-2,     +.5685043681599363378632664588789e-1,     -.4219835396418560501012500186624e-2,     +.1326808181212460220584006796352e-2,     -.1893024529798880432523947023886e-3,     +.3606925327441245256578082217225e-4,     -.6056761904460864218485548290365e-5,     +.1055829546302283344731823509093e-5,     -.1811967365542384048291855891166e-6,     +.3117724964715322277790254593169e-7,     -.5354219639019687140874081024347e-8,     +.9193275519859588946887786825940e-9,     -.1577941280288339761767423273953e-9,     +.2707980622934954543266540433089e-10,     -.4646818653825730144081661058933e-11,     +.7973350192007419656460767175359e-12,     -.1368078209830916025799499172309e-12,     +.2347319486563800657233471771688e-13,     -.4027432614949066932766570534699e-14,     +.6910051747372100912138336975257e-15,     -.1185584500221992907052387126192e-15,     +.2034148542496373955201026051932e-16,     -.3490054341717405849274012949108e-17,     +.5987993856485305567135051066026e-18,     -.1027378057872228074490069778431e-18,     +.1762702816060529824942759660748e-19,     -.3024320653735306260958772112042e-20,     +.5188914660218397839717833550506e-21,     -.8902770842456576692449251601066e-22,     +.1527474068493342602274596891306e-22,     -.2620731256187362900257328332799e-23,     +.4496464047830538670331046570666e-24,     -.7714712731336877911703901525333e-25,     +.1323635453126044036486572714666e-25,     -.2270999412942928816702313813333e-26,     +.3896418998003991449320816639999e-27,     -.6685198115125953327792127999999e-28,     +.1146998663140024384347613866666e-28,     -.1967938586345134677295103999999e-29,     +.3376448816585338090334890666666e-30,     -.5793070335782135784625493333333e-31         }}     \xintNewExpr\DBLEPSILON{\xintPow{2}{-52}}     \ExplSyntaxOn     \cs_new:Npn \breakloop #1 #2       {         \fp_compare:nNnT { #1 } > { #2 }           { \breakforeach }       }     \ExplSyntaxOff     \makeatletter     \pgfmathdeclarefunction{chebyshevinit}{3}{%       \begingroup         \pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}           \pgfmathparse{#1}%           \edef\dos{\pgfmathresult}%           \pgfmathparse{#2-1}% This will allow to refer to the first element as 1 instead of 0           \edef\nos{\pgfmathresult}%           \pgfmathparse{#3}%           \edef\eta{\pgfmathresult}%             \pgfmathparse{0}%             \edef\err{\pgfmathresult}%             \edef\i{\pgfmathresult}%               \foreach \ii in {1,...,\nos}               {                 \pgfmathparse{\nos-\ii}%                 \xdef\i{\pgfmathresult}%                 \pgfmathparse{\err}%                 \xdef\err@{\pgfmathresult}%                 \pgfmathparse{\err@ + abs(\dos[\i])}%                 \xdef\err{\pgfmathresult}%                 \breakloop{\err}{\eta}%               }             \pgfmathparse{\i}%         \pgfmath@smuggleone\pgfmathresult%       \endgroup     }     \makeatother     \begin{document}     \pgfmathparse{chebyshevinit(\gamcs,42,\DBLEPSILON/20)}\pgfmathresult    %     \end{document}      Obviously the above example does not work: Arrays are not an actual "value" but hold multiple values which are expanded in various ways, making it considerably hard to use in a `\pgfmathparse` setting, even more so inside an actual function (Carlisle, 2014). I've had a simpler case of Andrew Swann's solution at PGF loop - how to use an array inside pgfmathdeclare function?, but this caused underflow. The `fpu` library cannot handle the smaller numbers! Andrew Swann also had the idea to move parts of the loop outside of the loop to be evaluated first in my previous question. This, however, does not answer my specific question now. Evaluating the value beforehand would not work if I had to evaluate a range of elements (which would be the case now). So how can I do an evaluation like this one in `pgfmath`? Solutions outside `pgfmath` will also work, as long as I can reuse the final result inside `pgfmath`, `tikzpictures`, etc., _and_ as long as the end result is at least similar to some digits to the `R` output. (10^{-4}? I'll go with anything at this point. `:-/`.) * * * **EDIT** I have brought this problem back to the essence a bit. This is another example with the same issue: how to evaluate the array inside the loop? Consider this code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{fpu}         \gdef\myarray{{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42}}          \makeatletter     \pgfmathdeclarefunction{blah}{2}{%       \begingroup         \pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}         \pgfmathparse{#1}%         \edef\x{\pgfmathresult}%         \pgfmathparse{#2}%         \edef\n{\pgfmathresult}%         \pgfmathparse{\x * 2}%         \edef\twox{\pgfmathresult}%         \pgfmathparse{0}%         \edef\b{\pgfmathresult}%         \edef\b@{\pgfmathresult}%         \edef\b@@{\pgfmathresult}%           \foreach \i in {1,...,\n}           {           \pgfmathparse{\b@}%           \xdef\b@@{\pgfmathresult}%           \pgfmathparse{\b}%           \xdef\b@{\pgfmathresult}%           \pgfmathparse{\myarray[\n-\i]}%           \xdef\arrayvalue{\pgfmathresult}%           \pgfmathparse{\twox * \b@ - \b@@ + \arrayvalue}%           \xdef\b{\pgfmathresult}%           }         \pgfmathparse{(\b-\b@@) * .5}%         \pgfmath@smuggleone\pgfmathresult       \endgroup     }     \makeatother          \begin{document}          \pgfmathparse{blah(5,22)}\pgfmathresult %          \end{document}      So as you can see, Andrew Swann's trick doesn't apply here and I'm struggling to find a workaround. How to use `myarray` inside my `foreach`?


title: How to hyperlink the 'general index' in the resulting PDF without it appearing in the table of contents?

text: I want my book (in PDF file) have an 'Contents' (general index) hyperlinked. But do not want the line of the word 'contents' (including page number) in the content of the table of contents, redundant to appear. To be exact: What would you change my tex file I put down here? Thanks in advance.               \documentclass[10pt]{book}     \usepackage[english]{babel}     \usepackage{lipsum}     \usepackage{url}     \usepackage{hyperref}     \begin{document}     \addcontentsline{toc}{chapter}{General Index}     \tableofcontents     \chapter{Chapter one}     \lipsum[1-2]     \section{section one}     \lipsum[1]     \end{document}      P.D. I put here a screenshot image of my PDF file describing what I look even better.![enter image description here](http://i.stack.imgur.com/NaAjT.jpg)