title: Minted, setstretch and font size

text: I'm using `minted` package. My problem is `\usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5}` line. I do need this line stretch, but I don't want it to affect code sources generated by `minted`. How can this be done? Also, I would like to be able to change font size used by code listings independently from rest of document. I think I want 10 or 11pts for code listings and 12pt for rest of the text.               \documentclass[12pt,a4paper]{mwrep}     \usepackage{minted}     \usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5}     \begin{document}     \begin{minted}{java}     public class Foo     {       public static void main(String[] args)       {         for(int i=0; i<10; i++)         {           System.out.println(i);         }       }     }     \end{minted}     \end{document}


title: Using garamondx for dummies

text: I use TeXworks on Windows to write and produce LaTeX files, which uses MiKTeX in some way I don't fully understant. I've been trying to install and use the `garamondx` package. After a lengthy process I managed to perform what appeared to be an installation of `garamondx` with the MiKTeX Package Manager (the default repository it was using didn't have the package, which took a very long time to figure out), and then the `fontaxes` package when it said it needed it. When I try to compile a document using the package, though, I get the following error (this is the text that appears at the end of the 'console' on TeXworks; text above that didn't appear to be relevant but I can post it if you want):               LaTeX Font Warning: Font shape `T1/zgmx/m/scsl' undefined     (Font)              using `T1/zgmx/m/n' instead on input line 27.          [1{C:/Users/win7/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]     (C:\Users\win7\Desktop\template.aux)Trying to make PK font zgmric8r at 600 DPI...     Running miktex-makemf.exe...     miktex-makemf: The zgmric8r source file could not be found.          Running ttf2pk.exe...     miktex-makepk: PK font zgmric8r could not be created.               LaTeX Font Warning: Some font shapes were not available, defaults substituted.           )     !pdfTeX error: pdflatex.EXE (file zgmric8r): Font zgmric8r at 600 not found      ==> Fatal error occurred, no output PDF file produced!     texify: pdflatex failed for some reason (see log file).      Googling solutions leads to solutions involving command lines, which (a) I don't understand because I only have a limited understanding of what it is that MiKTeX and TeXworks do respectively (b) I can't implement because I can't find a command line to put them in. Minimal sample document:               \documentclass{article}     \usepackage{garamondx}     \begin{document}     Hello, world!     \end{document}


title: How to make lstlisting look exactly like the algorithm environment?

text: I'm typesetting pseudocode with `algorithm` and `algorithmicx` to get results like the following (taken from the package documentation): ![algorithm + algorithmicx](http://i.stack.imgur.com/V3PWN.png) Now I would like to print real C++ code with the `listings` package. Is there any way to make a `lstlisting` look exactly the same (showing something like **Listing 1** instead of **Algorithm 1** , of course)?


title: Use macro to draw inside pgfplot/axis

text: I would like to implement a gantt chart function inside `pgfplots`. To draw the tasks, I have a macro that calculates the start and finish time of a task. However, when I use multiple tasks, the values inside are overridden and as a result it only shows a single task.               \documentclass[10pt]{article}     \usepackage{pgfplots}          \begin{document}          \newcommand{\task}[7]{         \pgfmathparse{#1/365+#2/12+#3}         \edef\taskstart{\pgfmathresult}         \pgfmathparse{#4/365+#5/12+#6}         \edef\taskfinish{\pgfmathresult}              \pgfmathparse{#7-0.4}         \edef\bottom{\pgfmathresult}         \pgfmathparse{#7+0.4}         \edef\top{\pgfmathresult}              \draw[blue,fill=blue!50!white] (axis cs:\taskstart,\bottom) rectangle (axis cs:\taskfinish,\top);     }          \begin{tikzpicture}         \begin{axis}[xmin=2011,xmax=2013,ymin=0,ymax=10]              \task{26}{1}{2011}{23}{6}{2011}{1} % this is not drawn             \task{26}{1}{2012}{23}{6}{2012}{3} % only this is drawn         \end{axis}     \end{tikzpicture}          \end{document}      I know that this is a question of expansion, but I have to admit that I do not know how to handle it within the `axis`.


title: Is there a list of <float> in ConTeXt?

text: In LaTeX we have `\listoftables`, `\listoffigures`, and so on (at least thats the name as far as I remember). Is there something to achive similar in ConTeXt? My first thought was to define a register for tables and one for figures and one for each other type of float I need, and use it together with every single `\placetable`, `\placefigure`, `\placeSOMETHING`, and put a corresponding `\completeregister` in the appendeix, but to use the register with every `\place…` is easy to forget. Also the ordering would be wrong, since I want to order floats in the corresponding list by occurence, not by “name” or “label” or what ever.


title: indent of custom float

text: In my preamble I defined a custom float to use it for my equations like this               \newfloat{formula}{ht}{frm}     \floatname{formula}{Formel}      then I use it like this               \begin{formula}     \begin{equation}     \begin{array}{rcl}     D(x,y,\sigma) & = & (G(x,y,k\sigma) - G(x,y,\sigma)) * I(x,y) \\                   & = & L(x,y,k\sigma) - L(x,y,\sigma)     \end{array}     \end{equation}     \caption[\glsentrydesc{DOG}]{\glsentrydesc{DOG} $D$ zweier benachbarter Bilder mit Weichzeichnungsfaktor $k$}     \end{formula}      which displays like that ![custom float with long caption](http://i.stack.imgur.com/eDmTe.jpg) The caption is pretty long and there is a line break in it. How can I achive that "faktor k" appears right under "Difference" instead of "Formel 2" ? I'm asking because regular captions for a figure show up differently. I want the above example to show up like that ![long caption in figure block](http://i.stack.imgur.com/Kvf7A.jpg) Here is a minimal document:               \documentclass{scrartcl}          \usepackage{amsmath}     \usepackage{float}     \usepackage{glossaries}          \newfloat{formula}{ht}{frm}     \floatname{formula}{Formel}          \newacronym{DOG}{DoG}{Difference of Gaussian}          \begin{document}          \begin{formula}     \begin{equation}     \begin{array}{rcl}     D(x,y,\sigma) & = & (G(x,y,k\sigma) - G(x,y,\sigma)) * I(x,y) \\                  & = & L(x,y,k\sigma) - L(x,y,\sigma)     \end{array}     \end{equation}     \caption[\glsentrydesc{DOG}]{\glsentrydesc{DOG} $D$ zweier benachbarter Bilder mit Weichzeichnungsfaktor $k$}     \end{formula}          \end{document}


title: How do I get two mathrings centered over a variable?

text: I am trying to represent a second order, dimensionless derivative by two open circles overtop a variable. I understand how to do one (`\mathring v`), and I understand how to do multiple solid dots (`\ddot v`), but I can't figure out how to get two open circles over my variable. Any help would be greatly appreciated.


title: How can I display a list of acronyms and a separate list of symbols in the same document?

text: I want to display both list of acronyms and list of symbols in my thesis.. I tried all, from the solutions I found here... but it is always showing "acro.sty not found" and some other error with glossaries package ("datatool- base.sty not found.") I copied as it is the code from here, even it is not working. Can any one give complete solutions for this in detail.. Please, am not understanding.. I saw some solutions and tried but not working? Both should have chapter level (as it is like lof, lot). I read like some `.tex` file we have to create separately with list of acronyms and list of symbols and we have to call these files from our file ..is it true? Really I got tired by searching about this. Only few days left to submit my thesis....


title: Page numbering in Latex TOC (using memoir class)

text: The issue that I am having is that the page numbers appearing in my TOC do not correspond with the actual pages on which the section/chapter is found. The problem occurs in the mainmatter, as well as in the backmatter. It gets progressively less accurate the further you go. At the end, it is off by about 20 pages. It starts getting things wrong from as early as page 11. I have extensively searched online already before posting. Did find the following thread: http://www.latex- community.org/forum/viewtopic.php?f=5&t=3577, but I am not using the addcontentsline command anywhere (I removed it, just be sure). A few sections are unnumbered (e.g.: \section*{Method}), but like I said, these are not added to the TOC with a addcontentsline command. My code is the standard TOC, no options added:               \setcounter{tocdepth}{1}     \tableofcontentssure      Any help will be much appreciated.


title: How retrieve items in a list of words by number?

text: I'm working on a character sheet for the Fate RPG, which rates its skills with a numerical scale that corresponds to an adjective scale. I've been trying to write a macro that will take `\skillAdj{4}` and turn it into "Great" in a more elegant way than with these conditionals. Ideally, I'd be able to do lookup in both directions, but I'm more concerned with going from number to adjective.               \usepackage{calc}     \usepackage{ifthen}     %     \newcounter{skillcounter}     \set{skillcounter}{0}     %     \newcommand[1]{\skillAdj}{\ifthenelse{\equal{#1}{8}     Legendary     }     {\ifthenelse{\equal{#1}{7}     Epic     }     {\ifthenelse{\equal{#1}{6}     Fantastic     }     {\ifthenelse{\equal{#1}{5}     Superb     }     {\ifthenelse{\equal{#1}{4}     Great     }     {\ifthenelse{\equal{#1}{3}     Legendary     }     {\ifthenelse{\equal{#1}{2}     Legendary     }     {\ifthenelse{\equal{#1}{1}     Legendary     }     {\ifthenelse{\equal{#1}{0}     Mediocre     }     {\ifthenelse{\equal{#1}{-1}     Poor     }     {\ifthenelse{\equal{#1}{-2}     Terrible     }     {\ifthenelse{\equal{#1}{-3}     Awful     }     {\ifthenelse{\equal{#1}{-4}     Abysmal     }     {Error}}}}}}}}}}}}}      This is the scale. > +8 Legendary   >  +7 Epic   >  +6 Fantastic   >  +5 Superb   >  +4 Great   >  +3 Good   >  +2 Fair   >  +1 Average   >  +0 Mediocre   >  -1 Poor   >  -2 Terrible   >  -3 Awful   >  -4 Abysmal I'd really appreciate any helpful advice people have. I haven't found anything in the documentation of any of the packages that seem like they might provide this function.


title: Is this a bug in pgf ? pgfpatharcto

text: I made a simple and shortest example. I create a simple path containing an arc. But if I compute that path before the begin document, I obtain garbage, whereas it works as expected after begin document. I'm not sure if it's a feature or a bug.               \documentclass{standalone}     \usepackage{tikz}     \makeatletter     %% create a simple path containing an arc     \newcommand{\mypath}[1]{\pgfpathmoveto{\pgfpoint{1cm}{1cm}}%     \pgfpatharcto{1cm}{1cm}{0}{1}{0}{\pgfpoint{2cm}{1cm}}\pgfsyssoftpath@getcurrentpath{#1}\pgfusepath{}}     %% compute and assign the path to \bugpath     \mypath\bugpath     \begin{document}     %% compute and assign the path to \path     x\mypath\path y% <- why so much space between x and y ?     %% stroke \path     \pgfsyssoftpath@setcurrentpath{\path}\pgfsyssoftpath@flushcurrentpath\pgfusepath{draw}%     %% stroke \bugpath in red     \pgfsetstrokecolor{red}%     \pgfsyssoftpath@setcurrentpath{\bugpath}\pgfsyssoftpath@flushcurrentpath\pgfusepath{draw}%     %% stroke a blue rectangle to contain the previous strokes     \tikz{\path[draw=blue] (0,0) rectangle (5cm,5cm);}     \end{document}      I would like to understand why the path in red and the path in black are not the same. Subsidiary question : why so much space between x and y ? ![Result of the example](http://i.stack.imgur.com/8RqYU.png)


title: How to modify unsrtnat.bst

text: I use `unsrtnat.bst` and I need to change the form: > N.W. Ashcroft. Phys. Rev. Lett., 92, 187002. (2004). to > N.W. Ashcroft. Phys. Rev. Lett. **92** , 187002 (2004). So I need to delete comma after journal title, delete dot after page and bold the volume. Below I present `FUNCTION {format.date}`               FUNCTION {format.date}     { year duplicate$ empty$         { "empty year in " cite$ * warning$            pop$ "" }         'skip$       if$       month empty$         'skip$         { month           " " * swap$ *         }       if$       duplicate$ empty$ 'skip$ %% added       { "(" swap$ * ")" *}     %% added     if$       extra.label *     }      and `FUNCTION {article}`               FUNCTION {article}     { output.bibitem       format.authors "author" output.check       author format.key output       new.block       format.title "title" output.check       new.block       crossref missing$         { journal emphasize "journal" output.check           eid empty$             { format.vol.num.pages output }             { format.vol.num.eid output }           if$           new.block                        %% added           format.date "year" output.check         }         { format.article.crossref output.nonnull           eid empty$             { format.pages output }             { format.eid output }           if$         }       if$       format.issn output       format.doi output       format.url output       new.block       note output       fin.entry     }


title: Add custom extensions and directives to arara

text: This is a more general version of Adam Liter's question about setting up an `arara` rule for `knitr`. The basic question is this: > _How can I enable support for customised extensions and directives > in`araraconfig.yaml`?_ The answer would be straightforward if it were not that the documentation is apparently rather buggy. The problem is that using the syntax modelled in the manual results in the following error when `arara` is run:               I didn't find any directives in 'myfile.XXX', and so didn't do anything. Is that what you really wanted?      where `XXX` is the extension you tried to enable. Adam's question includes a fully documented example of the error for the case of `knitr`.


title: Displaying caption of a long table on multiple pages

text: I'm trying to display a table on three pages. What's the best way to display captions on these three pages and how to do that, please?               \documentclass{report}     \usepackage{longtable}     \begin{document}     \listoftables          \section{section}     \begingroup     \setlength{\LTleft}{-20cm plus -1fill}     \setlength{\LTright}{\LTleft}     \begin{longtable}{|p{1.5cm}|p{7cm}|p{7cm}|}     \hline     \textbf{Message} & \textbf{Entrée(s)} & \textbf{Sortie(s)} \\     \hline \vspace{-\baselineskip}     \textbf{\#1} & L'utilisateur s'identifie en introduisant     son matricule et son mot-de-passe. & Le système autorise l'accès. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#2} & \begin{itemize}     \item[-] Demande d'ajout, de modification ou     de suppression d'un système d'exploitation.     \item[-] Demande de consultation des détails     d'un système d'exploitation ou de la     liste des systèmes d'exploitation.     \end{itemize} & \begin{itemize}     \item[-] Le système enregistre les mises-à-jour     effectuées ainsi que l'opération.     \item[-] Le système affiche les caractéristiques     d'un système d'exploitation ou la liste     des systèmes d'exploitation.     \end{itemize} \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#3} & \begin{itemize}     \item[-] Demande d'ajout, de modification, de     suppression ou de consultation d'un     poste de travail.     \item[-] Demande de consultation des détails     d'un poste de travail ou de la liste des     postes de travail.     \item[-] Demande de transfert d'une ressource.     \item[-] Demande de traçage de l'activité d'un     poste de travail.     \item[-] Demande de télé-assistance d'un poste     de travail.     \end{itemize} & \begin{itemize}     \item[-] Le système enregistre les mises-à-jour     effectuées ainsi que l'opération.     \item[-] Le système affiche les caractéristiques     d'un poste de travail ou de la liste des postes de travail.     \item[-] Le système transmet la ressource en     question et enregistre l'opération.     \item[-] Le système affiche la traçabilité de l'activité du poste et enregistre l'opération.     \item[-] L'utilisateur final télé-assiste le poste souhaité et enregistre l'opération.     \end{itemize} \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#4} & Demande d'afficher des statistiques sur le     nombre d'heures d'exécution des applications     métier. & Le système affiche les données correspondantes.\tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#5} & \begin{itemize}     \item[-] Demande de consultation des détails     d'une alerte ou de la liste des alertes.     \item[-] Demande de réparation d'une alerte.     \end{itemize} & \begin{itemize}     \item[-] Le système affiche les détails d'une     alerte ou la liste des alertes.     \item[-] Le système enregistre les détails de la     réparation ainsi que l'opération.     \end{itemize} \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#6} & Demande d'effectuer une recherche. & Le système renvoie le résultat de la recherche. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#7} & \begin{itemize}     \item[-] Demande d'ajout, de modification ou     de suppression d'une application métier.     \item[-] Demande de consultation des détails     d'une application métier ou de la liste     des applications métier.     \end{itemize} & \begin{itemize}     \item[-] Le système enregistre les mises-à-jour     effectuées ainsi que l'opération.     \item[-] Le système affiche les caractéristiques     d'une l'application métier ou la liste     des applications métier.     \end{itemize} \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#8} & Demande de consultation des détails d'une opération ou de la liste des opérations. & Le système affiche les détails d'une opération ou la liste des opérations. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#9} & \begin{itemize}     \item[-] Demande d'ajout, de modification ou     de suppression d'un compte.     \item[-] Demande de consultation des détails     d'un compte ou de la liste des comptes.     \end{itemize} & \begin{itemize}     \item[-] Le système enregistre les mises-à-jour     effectuées ainsi que l'opération.     \item[-] Le système affiche les détails d'un     compte ou la liste des comptes.     \end{itemize} \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#10} & Enregistrer les détails d'une application     métier en cours d'exécution ou mise-àjour     de la date fermeture d'un processus. & Le système sauvegarde le nouveau enregistrement     ou la mise-à-jour apportée. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#11} & Enregistrer une alerte. & Le système sauvegarde l'alerte. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#12} & À la demande d'un utilisateur via l'application Web, le système transmet la ressource au poste de travail cible. & Le système sauvegarde le nouveau enregistrement     ou la mise-à-jour apportée. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#13} & Réception d'une ressource. & Le poste de travail enregistre l'opération     au bon emplacement. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#14} & Envoyer un journal des touches et des fenêtres     à un serveur Web cible. & Journal envoyé. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#15} & Réception d'un journal des touches et des     fenêtres. & Le serveur Web enregistre le journal reçu au bon emplacement. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#16} & Envoyer des flux images à un serveur Web     cible. & Flux images envoyés. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#17} & Réception des flux images. & Le serveur Web enregistre l'image reçue au bon emplacement. \tabularnewline     \hline \vspace{-\baselineskip}     \textbf{\#18} & Le système demande de télé-assister un     poste cible. & L'image est affichée à l'écran du demandeur. \tabularnewline     \hline     \multicolumn{3}{l}{} \\[-7pt]       \caption{Description du diagramme de contexte dynamique}     \label{tbl:contextedyn}     \end{longtable}     \endgroup     \end{document}


title: Horizontal Line Extends Past Table Edge

text: I am having an issue with a `tabular` table with the `\hline`s extends past the table edge. I have fixed the problem by using `\cline`s instead, making it go from first to last cell (`\cline{1-18}`), but this seems forced. Is there a reason not to use \hline? Note I have left one horizontal line as \hline. MWE:               \documentclass{article}          \usepackage{multirow}     \usepackage{multicol}     \usepackage{array}          \newcounter{vonecount}     \setcounter{vonecount}{0}     \newcommand{\vone}{\stepcounter{vonecount}\thevonecount}          \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}          \begin{document}          \begin{tabular}{r|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}}      \cline{1-18}     \multicolumn{1}{|r|}{Section One}                           &        \multicolumn{17}{>{\centering}p{4in}|}{Part One - Synonyms} \\      \cline{1-18}     Question \#     &        \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone \\     \cline{2-18}     Correct Answer  &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A \\     Your Answer     & & & & & & & & & & & & & & & & & &  \\     \cline{1-18}     \multicolumn{1}{|r|}{Section One}                                       &        \multicolumn{17}{>{\centering}p{4in}|}{Part Two - Sentence Completions} \\      \cline{1-18}     Question \#     &        \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone \\     \cline{2-18}     Correct Answer  &        A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A \\     Your Answer     & & & & & & & & & & & & & & & & & &  \\     \hline     \multirow{2}{*}{Scores}                 &        \multicolumn{4}{c|}{Correct}            &        \multicolumn{4}{c|}{Total}              &        \multicolumn{4}{c|}{Stanine}            &        \multicolumn{5}{c|}{Percentile Rank}    \\     \cline{2-18}                             &        \multicolumn{4}{c|}{}   &        \multicolumn{4}{c|}{}   &        \multicolumn{4}{c|}{}   &        \multicolumn{5}{c|}{}   \\     \cline{2-18}     \end{tabular}          \end{document}


title: \jot is assigned only inside document

text: The length `\jot` controlling the vertical space in align, etc. envs can be assigned only after `\begin{document}`. Can I do the assignment in some my sty-package file or in preamble?


title: openany denies subsection?

text: I'm using a preamble like below:               \documentclass[12pt, a4paper]{book}          \usepackage{graphicx}           \usepackage{rotating}            \usepackage{subfigure}       \usepackage{epic}         \usepackage{verbatim}       \usepackage{amssymb}        \usepackage{amsmath}        \usepackage{polski}      \usepackage{longtable}     \usepackage[OT4]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{indentfirst}     \usepackage{bibentry}     \usepackage{cite}     \setcounter{secnumdepth}{3}          \textwidth      16cm     \textheight     25.5cm     \evensidemargin -3mm     \oddsidemargin  -3mm     \topmargin      -20mm      I used to have `\documentclass[12pt, a4paper, openany]{book}`, but with that, `\subsection` just returned its title without any special formatting. Without openany everything works fine. How's that? Should I forget `openany` or search for another method?


title: How can I get the following Word template in Latex? Or settle for a similar SDE resume Latex template?

text: I am applying to software development positions, and I found this great resume template on CareerCup.com: http://www.careercup.com/resume Unfortunately, it is in Microsoft Word, and I prefer the level of control offered by Latex. Can I find this template in Latex? Or, I can settle for a very similar one, optimized for early career SDE industry positions. Any resource suggestions/links are also appreciated.


title: Centering Text in Table Cell

text: I have tried to center text within a cell in my table by defining a new column type = `\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}` Yet in my MWE, my contents are still not centering MWE:               \documentclass{article}          \usepackage{multirow}     \usepackage{multicol}     \usepackage{array}          \newcounter{vonecount}     \setcounter{vonecount}{0}     \newcommand{\vone}{\stepcounter{vonecount}\thevonecount}          \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}          \begin{document}          \begin{tabular}{r|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}|C{2mm}}      \cline{1-18}     \multicolumn{1}{|r|}{Section One}                           &        \multicolumn{17}{>{\centering}p{4in}|}{Part One - Synonyms} \\      \cline{1-18}     Question \#     &        \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone \\     \cline{2-18}     Correct Answer  &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A \\     Your Answer     & & & & & & & & & & & & & & & & & &  \\     \cline{1-18}     \multicolumn{1}{|r|}{Section One}                                       &        \multicolumn{17}{>{\centering}p{4in}|}{Part Two - Sentence Completions} \\      \cline{1-18}     Question \#     &        \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone &      \vone \\     \cline{2-18}     Correct Answer  &        A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A \\     Your Answer     & & & & & & & & & & & & & & & & & &  \\     \hline     \multirow{2}{*}{Scores}                 &        \multicolumn{4}{c|}{Correct}            &        \multicolumn{4}{c|}{Total}              &        \multicolumn{4}{c|}{Stanine}            &        \multicolumn{5}{c|}{Percentile Rank}    \\     \cline{2-18}                             &        \multicolumn{4}{c|}{}   &        \multicolumn{4}{c|}{}   &        \multicolumn{4}{c|}{}   &        \multicolumn{5}{c|}{}   \\     \cline{2-18}     \end{tabular}          \end{document}


title: Graphical connection between two matrix

text: I need to show the connection of an element of a matrix, with a column on another matrix, like this: ![Sparse matrix Save on coordinate method](http://i.stack.imgur.com/LWXzR.jpg) How i can do this?


title: siunitx S-column in table: can I combine scientific notation and decimal numbers in one column?

text: I have a table with values exported from a statistics software, where the values are formatted like this (see example below): Some (very small ones) are in scientific notation, some are in "normal" decimal notation.               \begin{tabular}{r}     3,158722 \\     -0,00061 \\     6,28E-05 \\     0,000303 \\     1,67E-04 \\     0,000175 \\     -0,00017 \\     0,000025 \\     -0,00012 \\     -7,7E-05 \\     -0,00042 \\     -0,0005 \\     0,128871 \\     -0,00689 \\     0,004255 \\     -0,00245 \\     0,010475 \\     0,007083 \\     0,000852 \\     0,004583 \\     -0,00042 \\     0,002032 \\     -0,00111 \\     0,000556 \\     12,53887 \\     0,0024 \\     -0,00387 \\     0,002836 \\     -0,00052 \\     -0,00022 \\     5,41E-05 \\     -0,00063 \\     3,17E-04 \\     0,000187 \\     -0,08153 \\     -0,07881 \\     0,316826 \\     0,001066 \\     0,009783 \\     -0,02701 \\     0,006054 \\     0,004167 \\     \end{tabular}%        * How can I define a number formatting that makes sense?   * Is it possible with `siunitx`to combine decimal and scientific notation in one column?   If yes, how can I define when the scientific notation is used and when not?


title: How to include SVG diagrams in LaTeX?

text: I'm making all my diagrams in SVG format using Inkscape and then I export them to some other format (e.g. PDF, EPS or PNG). I wrote a short script that does this for me automatically, but I'd like to avoid this step, if possible --- sometimes the conversion from SVG converts the text labels into vectors, and that's annoying. Hence the question: _Is there a way to include SVG diagrams directly without conversion to an intermediate format?_ Package suggestions, or instructions for specific LaTeX distribution welcome. Tips and personal experience on which tools you have found to be working reliably would be also appreciated.


title: How to include SVG syntax into LaTeX

text: Is it possible to include SVG code into LaTex? If it's possible how can I do that ? Short Example:               <svg xmlns="http://www.w3.org/2000/svg" version="1.1">         <path d="M150 0 L75 200 L225 200 Z" />     </svg>      I do not have a file with extension .svg, and I have access only to its code. For result I want to display svg "image".


title: About including svg into LaTeX or workaround

text: I am looking for a way to include `svg` image into the LaTeX. I know there are some discussion on this topic before and I think LaTeX just don't support SVG directly. I read few posts here and people suggest to use Inkscape to edit the `svg` and save it as LaTeX-`pdf`-`svg` then use command `\includesvg` to insert the image. But since I have too many `svg` created before and it is no way for me to edit them one by one with Inkscape. I am looking for other workaround (I mean still keep it as scalable vector image supported by LaTeX). The first way I can think of is to convert the `svg` with imagemagick to `eps`, which can be done with script. However, I don't know why, the converted `eps` is all black and all detail are gone. So besides imagemagick, any free code do you recommend to convert `svg` to `eps` in Linux? or do you have any other suggestion on inserting `svg` to LaTeX? p.s. The system is opened to a group of people and they can generate and upload their SVG. So before I insert all those images into LaTeX, I have to convert them into LaTeX-supporting format. But the server doesn't have inkscape installed, I am looking for other converter.


title: How could I include svg directly into LaTeX?

text: > **Possible Duplicate:**   >  How to include SVG diagrams in LaTeX? Is there a way to include svg figures directly into LaTeX? This is my current way to include eps file:               \clearpage         \begin{figure*}          \psfig{figure=187947.fig.001.eps}         \caption{} \label{fig:1}         \end{figure*}


title: How to configure TeXstudio editor for multibib?

text: I want to use multiple bibliographies for which I am using following code. However, I realize that I need to configure my text editor to properly process this code but I don't have any idea how.               \documentclass[12pt]{article}          \usepackage{multibib}          \newcites{journal,conference}{Refereed Journal Articles, Refereed Conference Publications}          \begin{document}     Hi, this is an example of the multibib.     \bibliographystylejournal{plain}     \nocitejournal{*}     \bibliographyjournal{journal}          \bibliographystyleconference{plain}     \nociteconference{*}     \bibliographyconference{conference}          \end{document}      My conference.bib and journal.bib file are:               @inproceedings{entry1,         author = {Author name},         address = {address},         booktitle = {Some conference},         title = {Title},         year = {2013},     }      and               @article{entry2,         author = {Author name},         journal = {Some Journal},         title = {Title},         year = {2013},     }      Ask asked by Harish Kumar, here is the screenshot of my TexStudio configuration. ![enter image description here](http://i.stack.imgur.com/UzOb3.png) Ask asked by Harish Kumar, here is my log and output after compiling with arara ![enter image description here](http://i.stack.imgur.com/RqQBW.png) ![enter image description here](http://i.stack.imgur.com/p2XJ4.png)


title: In tikz is there a way to set a node style to center the center of each node within a given scope

text: In the following MWE, I know that the commented line works. What I want to know is why the `every node/.style` approach is not working.               \documentclass{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}[x=2in,y=2in]            \node (A) at (1,0)   {};       \node (B) at (0,1)   {};       \node (C) at (-1,0)  {};       \node (D) at (1,1)   {};           %      \draw  (A.center) -- (B.center) -- (D.center) -- (C.center) -- cycle;       \draw[every node/.style={anchor=center}] (A) -- (B) -- (D) -- (C) -- cycle;     \end{tikzpicture}          \end{document}      Is there some way I can do this without having to write `(<node_name>.center)` for each node I wish to connect with a line? **UPDATE** I can write something like the following:                 \def\concatenatedpoints{}       \foreach \x in {A,B,C,D}           {\xdef\concatenatedpoints{\concatenatedpoints (\x.center) -- } }       \draw \concatenatedpoints     cycle;      which has the desired effect. And, of course, I could write a macro to accomplish this for whenever I want to be able to connect nodes this way.   But it seems that they's got to be a more `tikz`-flavored approach to efficiently connect the nodes as though they were `coordinate`s. **FURTHER UPDATE** I've tried something very similar to a suggestion made by @percusse in the comments and @jldiaz in his answer. What I had tried was               \draw \foreach \x in {A,B,D,C}{(\x.center) -- } cycle;       I'd be very curious for an explanation of why my approach fails but either of theirs works.


title: How can I round numbers relative to their order of magnitude?

text: This is a question which came up in the answer http://tex.stackexchange.com/a/183227/1537 . Suppose we have a _sequence_ of numbers for which we know that they are the log of some quantity. Now I want to compute exp of the input value and format the result in some cool way. How can I avoid rounding inaccuracies such that it fits _all_ numbers in the sequence? Let us assume that the problem is stated as ![enter image description here](http://i.stack.imgur.com/1svHc.png)               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{fpu}          \begin{document}     \thispagestyle{empty}          % use \newcommand (not \def), so the one (and only)     % argument can be specified in {} (and not in []) brackets     \newcommand{\mynum}[1]{       % =\pgfmathparse{e^\tick}\pgfmathresult : ! Dimension too large. ; - use exp(x)       \pgfkeys{/pgf/fpu}% else dimension too large!       \pgfmathparse{exp(#1)}%       \pgfmathfloattofixed\pgfmathresult       \pgfmathresult     }          \message{^^J}          \mynum{-0.69316}          \mynum{0.0}          \mynum{1.60942}          \mynum{2.30258}          \mynum{3.912}          \mynum{4.60516}          \mynum{6.21458}          \mynum{6.90775}          \mynum{8.51717}          \mynum{9.21033}          \mynum{10.81975}          \mynum{11.51291}     \end{document}      Ideally, each number would be rounded to a relative accuracy of, say, 3 digits - but relative to the number as such.


title: LuaTeX readline encoding

text: **Must LuaTeX's`\readline` use latin-1 encoding?** In the example below, I first store `é` in a file (well, and `^^J`) which works well. Then I read it back in, using `\readline` and get two characters `Ã©` (and `^^M`). Then writing it back to a file yields those two characters (or rather, the bytes in their utf-8 encoding). I would like to be able to do the round-trip "reading a utf-8 file and writing it back" without modification (besides some end-line space trimming perhaps).               % Write some Unicode char to a file tmp.aux     \immediate\openout5=tmp.aux     \immediate\write5{é}     \immediate\closeout5     %     % Read it back in, _using \readline_     \openin6=out.aux     \readline6 to \foo     \closein6     %     \message{\foo}                   % => Ā© and a carriage return     %     % Write again: the file is different from tmp.aux.     \immediate\openout5=out.aux     \immediate\write5{\foo}     \immediate\closeout5     %     \csname bye\endcsname     \csname @@end\endcsname      Using `\read` instead of `\readline` avoids the encoding problem but tokenizes the lines, which I don't want to do.


title: reproduce envelope design

text: Not being a specialist of TikZ, I have no chance to succeed in posting a MWE to reproduce the envelope design above. Any hint to start? ![enter image description here](http://i.stack.imgur.com/Ul0Iy.jpg)


title: Set notations problem

text: I am trying to write that y contains the elements a,b and c and that y is a subset of x and that x contains {a, b, c} and d and e. However, my latex code doesn't parse. I have been trying this for hours and have tried different spacing, alternate notation but none of it has worked. Can someone please tell me how to amend it. Thank you. My code:               $latex y = \{ {a ,b ,c}\}\newline  y\subseteq x\newline  x = \{ {\{{a, b, c}\}, d, e, f}\} $      FYI, latex has worked before.


title: dot2tex does not work when there there is math

text: I am not able to reproduce an example from dot2tex documentation. Is there something wrong with my installation? Is there a bug? How can I solve this? This is directly from dot2tex documentation. File is saved as try.dot :               digraph G {     node [shape=rectangle];     a_1 [texlbl="$x^2+\frac{\sin y}{y^2+\cos \beta}+\gamma_3$"];     a_1 -> a_2 [label=" ", texlbl="$x_1+x_3^2+z+c+v~~$"];     a_2 -> a_1;     }      This is the command I produce tex file:               dot2tex -tmath --autosize try.dot > example.tex      This is the produced tex file               \documentclass{article}     \usepackage[x11names, rgb]{xcolor}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usetikzlibrary{snakes,arrows,shapes}     \usepackage{amsmath}     %     %          %          %          \begin{document}     \pagestyle{empty}     %     %     %          \enlargethispage{100cm}     % Start of code     % \begin{tikzpicture}[anchor=mid,>=latex',line join=bevel,]     \begin{tikzpicture}[>=latex',line join=bevel,]       \pgfsetlinewidth{1bp}     %%     \pgfsetcolor{black}       % Edge: a_2 -> a_1       \draw [->] (89.221bp,33.97bp) .. controls (96.296bp,39.297bp) and (103.02bp,45.998bp)  .. (106.93bp,54bp) .. controls (111.62bp,63.582bp) and (111.62bp,68.418bp)  .. (106.93bp,78bp) .. controls (105.02bp,81.901bp) and (102.45bp,85.493bp)  .. (92.026bp,95.826bp);       % Edge: a_1 -> a_2       \draw [->] (21.273bp,95.975bp) .. controls (14.327bp,91.202bp) and (8.0377bp,85.272bp)  .. (3.9328bp,78bp) .. controls (-1.3109bp,68.711bp) and (-1.3109bp,63.289bp)  .. (3.9328bp,54bp) .. controls (8.9103bp,45.183bp) and (17.1bp,38.337bp)  .. (34.884bp,28.295bp);       \definecolor{strokecol}{rgb}{0.0,0.0,0.0};       \pgfsetstrokecolor{strokecol}       \draw (55.433bp,66bp) node {$x_1+x_3^2+z+c+v~~$};       % Node: a_2     \begin{scope}       \definecolor{strokecol}{rgb}{0.0,0.0,0.0};       \pgfsetstrokecolor{strokecol}       \draw (61.933bp,18bp) node {$a_2$};     \end{scope}       % Node: a_1     \begin{scope}       \definecolor{strokecol}{rgb}{0.0,0.0,0.0};       \pgfsetstrokecolor{strokecol}       \draw (61.933bp,114bp) node {$x^2+\frac{\sin y}{y^2+\cos \beta}+\gamma_3$};     \end{scope}     %     \end{tikzpicture}     % End of code          %     \end{document}     %      And this is the graph drawn after I compile tex file. Notice that edges are there, but the nodes are missing. ![prev](http://i.stack.imgur.com/Aqx91.png)


What is best method to insert an ellipsis in a (Xe)TeX document?               \documentclass{article}     \usepackage{fontspec}     \setmainfont{Times New Roman}          \begin{document}     a...b a ... b %or          a\ldots b a \ldots  b %or          a…b a … b            $a...b  a ... b$ %or          $a\ldots b  a \ldots  b $ %or          $a…b  a … b  $     \end{document}       Their results seem to be similar. ![enter image description here](http://i.stack.imgur.com/kvMGv.png)


title: Package inputenc error - trying to decipher the log

text: I got an inputenc error. From what I understand, this means that I have used an undefined character. However, I cannot find that character in my document. I need help in understanding the log messages. Here is the part of the log that seems relevant:               ...          Overfull \hbox (3.69263pt too wide) in paragraph at lines 167--174 \T1/cmtt/m/n/10 http://www.worldscientific.com/doi/abs/10.1142/S021884300900205 1\T1/cmr/m/n/10 . []          [36] Underfull \hbox (badness 10000) in paragraph at lines 176--182 []\T1/cmr/m/n/10 Z. Lan-dau, O. Reid, and I. Yer-shov. A fair di-vi-sion so-lu - []          Underfull \hbox (badness 6893) in paragraph at lines 176--182 \T1/cmr/m/n/10 tion to the prob-lem of re-dis-trict-ing. \T1/cmr/m/it/10 So-ci al Choice and Wel- []          Underfull \hbox (badness 2809) in paragraph at lines 176--182 \T1/cmr/m/it/10 fare\T1/cmr/m/n/10 , 32(3):479--492, 2009. doi: 10.1007/s00355 -008-0336-6. URL []          ! Package inputenc Error: Keyboard character used is undefined (inputenc) in inputencoding `latin9'.          See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.192 ...Fair division and collective welfare}} . You need to provide a definition with \DeclareInputText or \DeclareInputMath before using this key.          ! Package inputenc Error: Keyboard character used is undefined (inputenc) in inputencoding `latin9'.          See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.192 ...Fair division and collective welfare}} . You need to provide a definition with \DeclareInputText or \DeclareInputMath before using this key.          Overfull \hbox (575.80292pt too wide) in paragraph at lines 191--196 \T1/cmtt/m/n/10 http://books.google.com/books?hl=iw&lr=&id=qQXtEnb2B2cC &oi=fnd&pg=PA1&dq=fair+division+incremental&ots=mAHSbq1bK7& sig=xmB3IOFf5gFGIxPQk_k7w3Roed8\T1/cmr/m/n/10 . []          ...      And here is another possibly related section - it's a record from my BibTex file:               @book{Moulin2004Fair,         abstract = {{The concept of fair division is as old as civil society itself. Aristotle's "equal treatment of equals" was the first step toward a formal definition of distributive fairness. The concept of collective welfare, more than two centuries old, is a pillar of modern economic analysis. Reflecting fifty years of research, this book examines the contribution of modern microeconomic thinking to distributive justice. Taking the modern axiomatic approach, it compares normative arguments of distributive justice and their relation to efficiency and collective welfare. The book begins with the epistemological status of the axiomatic approach and the four classic principles of distributive justice: compensation, reward, exogenous rights, and fitness. It then presents the simple ideas of equal gains, equal losses, and proportional gains and losses. The book discusses three cardinal interpretations of collective welfare: Bentham's "utilitarian" proposal to maximize the sum of individual utilities, the Nash product, and the egalitarian leximin ordering. It also discusses the two main ordinal definitions of collective welfare: the majority relation and the Borda scoring method. The Shapley value is the single most important contribution of game theory to distributive justice. A formula to divide jointly produced costs or benefits fairly, it is especially useful when the pattern of externalities renders useless the simple ideas of equality and proportionality. The book ends with two versatile methods for dividing commodities efficiently and fairly when only ordinal preferences matter: competitive equilibrium with equal incomes and egalitarian equivalence. The book contains a wealth of empirical examples and exercises.          -          CONTENTS:     1 Microeconomic Foundations     3 Cardinal     6 Ordinal     14 Externalities and Fair Division9     15 Private versus Public Contracts13     16 Organization and Overview of ...15     17 Introduction to the Literature18     Fair Distribution21     22 A Simple Model of Fair Distri...27     23 Contested Garment Method37     24 Equal Sacrifice in Taxation41     25 SumFitness and Equality44     26 Introduction to the Literature51     Exercises to Chapter 252     Cardinal Welfarism63     32 Additive Collective Utility F...66     33 Egalitarianism and the Leximi...70     34 Comparing Classical Utilitari...76     35 Failures of Monotonicity81     36 Bargaining Compromise86     37 Introduction to the Literature95     Exercises to Chapter 396     Voting and Social Choice107     42 Condorcet versus Borda110     43 Voting over Resource Allocation116     44 SinglePeaked Preferences118     45 Intermediate Preferences122     46 Preference Aggregation and Ar...126     47 Introduction to the Literature130     Exercises to Chapter 4131     The Shapley Value139     Definition143     53 The Standalone Test and Stand...147     54 Standalone Surplus156     55 Axiomatizations of the Shaple...159     56 Introduction to the Literature162     Exercises to Chapter 5163     Managing the Commons169     62 Constant Returns to Scale173     Three Interpretations175     Decreasing Returns184     65 Increasing Returns190     66 Axiomatic Comparison of the T...199     67 Introduction to the Literature208     Exercises to Chapter 6209     Fair Trade and Fair Division221     72 Imperfect Competition228     73 Destructive Competition232     74 No Envy and the Assignment Pr...235     75 The CEEI and Egalitarian Equi...240     76 Axiomatics of Fair Division248     77 Introduction to the Literature251     Exercises to Chapter 7252     A Glossary of Definitions and Re...261     277 References}},         author = {Moulin, Herve},         citeulike-article-id = {12226526},         citeulike-linkout-0 = {http://books.google.com/books?hl=iw\&\#38;lr=\&\#38;id=qQXtEnb2B2cC\&\#38;oi=fnd\&\#38;pg=PA1\&\#38;dq=fair+division+incremental\&\#38;ots=mAHSbq1bK7\&\#38;sig=xmB3IOFf5gFGIxPQk\_k7w3Roed8},         keywords = {externalities, fair-division, review, social-choice, voting},         posted-at = {2013-03-30 22:19:59},         priority = {5},         publisher = {MIT Press},         title = {{Fair division and collective welfare}},         url = {http://books.google.com/books?hl=iw\&\#38;lr=\&\#38;id=qQXtEnb2B2cC\&\#38;oi=fnd\&\#38;pg=PA1\&\#38;dq=fair+division+incremental\&\#38;ots=mAHSbq1bK7\&\#38;sig=xmB3IOFf5gFGIxPQk\_k7w3Roed8},         year = {2004}     }


title: What is the right way to set predetermined column widths with tabularx?

text: I was just wondering about this, because I went over the `tabularx` documentation and I couldn't find an answer. So, there are several questions going on here:   1. Is it better to use a proportion of the size of an `X` column or is better to use a defined length (e.g.: 13mm) for column widths in `tabularx` environment?   2. Is question 1) even possible? Could you predefine the width of an `X` column by length units? (I guess it could be set also using a `p` column, but I don't know if this actually causes any change or just messes things up).   3. What's the advantage of using `hsize` over, let's say, the total width of the table?   4. What is the right approach when dealing with a mixture of fixed-width columns and `X` columns?


title: ifoddpage not working

text: I'm testing `ifoddpage` but it seems to say that every page is even:               \documentclass{article}          \usepackage{lipsum}     \usepackage{ifoddpage}          \newcommand\printpage{%     Page is \thepage. It is \ifoddpage odd\else even\fi.     }          \begin{document}          \lipsum          \printpage           \lipsum          \printpage          \end{document}      outputs: > Page 2. It is even. and then > Page 3. It is even.


title: Is there a package for concise notes?

text: I'm thinking of creating concise pages of notes, mainly text, in the form of multiple layers of bullet points. Is there a package that I can give bullet pointed notes and it crams them as tightly on to a page as it can. Thank you


title: How to install the tikzscale package?

text: I downloaded `tikzscale.zip` from CTAN. I extracted the following files from `tikzscale.zip`:               3Dplot.tikz     README     histogramNormal.tikz             linewidth.tikz     pgfplots-test.tikz     pgfplots.randn.dat     test-tikzscale.pdf     test-tikzscale.tex     testNode.tikz       testRectangle.tikz       testgraphic2D.tikz       tikzscale.dtx     tikzscale.ins     tikzscale.pdf       I put all the above files in the same file folder as my main tex file: `main.tex`. The minimal working environment of `main.tex` is as follows.               \documentclass[journal,twoside]{IEEEtran}     \usepackage{amssymb,amsmath,mathrsfs,bm,graphicx,color,cite,subfigure}          \usepackage{tikz, pgfplots}          \pgfplotsset{compat=newest}          \pgfplotsset{plot coordinates/math parser=false}          \begin{document}          ....          \end{document}      But I always got the following error message:               Latex Error: File `tikzscale.sty' not found.      I am really confused why this happens? Does anybody know how to isntall this package properly? Thanks


title: Overlay LaTeX/TeX coding easily on PDF with 300 pages

text: I've been looking for a way to overlay TeX/LaTeX i.e maths language etc (everything LaTeX is designed for) onto a background document containing 310 pages combined together in a PDF file. So far I have been eagerly under the impression it would be easy to do using `pdfpages` and once I had done this:               \documentclass{article}     \usepackage[final]{pdfpages}     \begin{document}     \includepdf[pages=-]{completenotes310pages.pdf}     $hello     $\end{document}      the `hello` would appear on a extra 311th page. Note: `completenotes310pages.pdf` had 310 pages. I have noticed a person trying to do it here: How can I superimpose LaTeX / TeX output over a PDF file? but it wasn't clear if he had one PDF page or two or more in his PDF file. I'm currently looking to install the `tikz.sty` file but can't find it. I'll keep this updated with my anticipation etc.


title: Change caption number of an algorithm

text: I am wondering if I can manually set the caption number of an algorithm, or let the caption number of the algorithms in an article start from 2. The following is a MWE.               \documentclass[conference]{IEEEtran}          \usepackage[ruled]{algorithm}     \usepackage{algpseudocode}     %\usepackage{subfigure}     \usepackage[demo]{graphicx}     \usepackage{times}     \usepackage{amssymb}     \usepackage{url}     \usepackage{hyperref}     \usepackage{amsmath}     \usepackage{multirow}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{wrapfig}     \algnewcommand{\LineComment}[1]{\State \(\triangleright\) #1}          \begin{document}          %\title{xxx}     %     %\maketitle          \alglanguage{pseudocode}     \begin{algorithm}[h]     \large     \caption{\large Insert into CBF}     \label{Algorithm:insert}     \begin{algorithmic}[1]     \Procedure{$\mathbf{InsertItem}$}{item $x$}         \LineComment{\emph{First insert $x$ into CBF}}         \For {$i = 1 \to k$}                 \State $C_{f_i(x)\%N}$ ++         \EndFor     \EndProcedure     \Statex     \end{algorithmic}       \vspace{-0.4cm}%     \end{algorithm}          \end{document}       Help is much appreciated!


title: Show plan before each section except the first one

text: I wanted to show a plan before every section in my presentation, so I have added the following code before `\begin{document}`               \AtBeginSection[]     {      \begin{frame}<beamer>      \frametitle{Plan}      \tableofcontents[currentsection]      \end{frame}     }      Now I would like to always do that **except the first section** , does anyone know how to deal with this exception?


title: Showing/Hiding verbatim environment based on boolean condition

text: I would like to show and hide a `verbatim` or `spverbatim` environment based on a boolean condition (sth. like `\showenv`). I tried the solutions proposed at Hide custom environment content based on boolean, e.g. when using               \usepackage{environ}     \NewEnviron{myenv}{       \ifshow         \spverbatim{\BODY}       \fi}          ...          \begin{myenv}     Test 1       Test 2     \end{myenv}      I get the following errors:               ! Undefined control sequence.     \env@myenv@process -> \ifshow     ! Extra \else.     ! Extra \fi.     ! Paragraph ended before \@tempa was complete.     ! Paragraph ended before \verbatim@test was complete.


title: Have one plot as background for stacked plots

text: I have a series of plots that are stacked up:               \documentclass{article}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \pgfplotsset{compat=1.10}     \tikzexternalize% activate externalization!     \begin{document}       \begin{figure}         \begin{tikzpicture}           \begin{axis}[stack plots=y,                        area style,                        enlargelimits=false,                        ymin=0,                        ylabel = {\small time for million dof updates},                        xlabel = {\small Order},                        grid=major,                        legend style={                          at={(0.5,-0.10)},                          anchor=north                        },                        width=15.0cm]             \addplot[draw=cyan, fill=cyan] table[x expr=\thisrow{X}^0.33333333333, y expr=\thisrow{A}*10^6/(\thisrow{Y}*\thisrow{Z})]{data.dat} \closedcycle;             \addlegendentry{A}             \addplot[draw=yellow, fill=yellow] table[x expr=\thisrow{X}^0.33333333333, y expr=\thisrow{B}*10^6/(\thisrow{Y}*\thisrow{Z})]{data.dat} \closedcycle;             \addlegendentry{B}             \addplot[draw=gray, fill=gray] table[x expr=\thisrow{X}^0.33333333333, y expr=\thisrow{C}*10^6/(\thisrow{Y}*\thisrow{Z})]{data.dat} \closedcycle;             \addlegendentry{C}           \end{axis}         \end{tikzpicture}       \end{figure}     \end{document}      In addition, I want to have one plot out of these not stacked up, but have it to be something like a background. The easiest way to get something like this was to leave the stacked up area plots as they are and add the background plot using a line plot:               \documentclass{article}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \pgfplotsset{compat=1.10}     \tikzexternalize% activate externalization!     \begin{document}       \begin{figure}         \begin{tikzpicture}           \begin{axis}[stack plots=y,                        area style,                        enlargelimits=false,                        ymin=0,                        ylabel = {\small time for million dof updates},                        xlabel = {\small Order},                        grid=major,                        legend style={                          at={(0.5,-0.10)},                          anchor=north                        },                        width=15.0cm]             \addplot[draw=cyan, fill=cyan] table[x expr=\thisrow{X}^0.33333333333, y expr=\thisrow{A}*10^6/(\thisrow{Y}*\thisrow{Z})]{data.dat} \closedcycle;             \addlegendentry{A}             \addplot[draw=yellow, fill=yellow] table[x expr=\thisrow{X}^0.33333333333, y expr=\thisrow{B}*10^6/(\thisrow{Y}*\thisrow{Z})]{data.dat} \closedcycle;             \addlegendentry{B}             \addplot[draw=gray, fill=gray] table[x expr=\thisrow{X}^0.33333333333, y expr=\thisrow{C}*10^6/(\thisrow{Y}*\thisrow{Z})]{data.dat} \closedcycle;             \addlegendentry{C}             \addplot[draw=magenta, fill=magenta, line legend, thick, sharp plot, stack plots=false] table[x expr=\thisrow{X}^0.33333333333, y expr=\thisrow{D}*10^6/(\thisrow{Y}*\thisrow{Z})]{data.dat};             \addlegendentry{D}           \end{axis}         \end{tikzpicture}       \end{figure}     \end{document}      But the plot appears still to be affected by the area style of the axis environment. Any idea how to have the last plot only as a simple line? Another solution that comes to mind is to start a second axis and add the line there. But in this case it wouldn't be part of the first plot's legend. So this is also not applicable. The data file should look like this:                A  B  C   D  X    Y     Z      7  1  1  11  8 1000  3072     11  3  2  18 27 1000 10368     14  2  5  24 64 1000 24576


title: Metapost "odd" operator fails with negative value?

text: Has anyone else noticed that in Metapost the `odd` operator appears to fail with negative numbers? Here's my test program (which works with both Metafont and Metapost).                 for i=-2 upto 2: show(i); show(odd i); endfor end      If I run this through Metafont I get               This is METAFONT, Version 2.7182818 (TeX Live 2014) (preloaded base=mf)     (test.mf     >> -2     >> false     >> -1     >> true     >> 0     >> false     >> 1     >> true     >> 2     >> false )     Transcript written on test.log.      but Metapost gives this:               This is MetaPost, version 1.902 (TeX Live 2014) (kpathsea version 6.2.0)     (/usr/local/texlive/2014/texmf-dist/metapost/base/mpost.mp     (/usr/local/texlive/2014/texmf-dist/metapost/base/plain.mp     Preloading the plain mem file, version 1.005) ) (./test.mf     >> -2     >> false     >> -1     >> false     >> 0     >> false     >> 1     >> true     >> 2     >> false )     Transcript written on test.log.      The value for `-1` appears to be wrong. This appears to be a bug.


title: how set subfigure 4 rows and 8 cols and a line in middle as figure shows

text: How I finish this effect in my paper, 4 rows figures and 8 eights figures, especially a red line is in middle of the whole figure. Please. Can you help me finish? ![enter image description here](http://i.stack.imgur.com/F7RGz.png)


title: Scaling a glue in TeX

text: is there a possibility to scale a glue in TeX? Consider the following example:               \newskip\foo     \newskip\bar          \foo=10pt plus 2pt minus 3pt     \bar=2.5\foo\relax     \showthe\foo     \showthe\bar          \bye      When feeding this code into TeX, it will produce the following output in the log file, showing that the stretch and shrink of \foo are discarded during the assignment to `\bar`.               > 10.0pt plus 2.0pt minus 3.0pt.     l.6 \showthe\foo          ?      > 25.0pt.     l.7 \showthe\bar          ?       Apparently `\foo` is converted into a dimen by the scaling. Is there a way to get _25.0pt plus 5.0pt minus 7.5pt_ as a result? `\multiply` only works when the factor is an integer. At least a way to copy the stretch or shrink of a glue into a `dimen` register would suffice. But I didn't find an appropriate hint in chapters 12 and 15 of the `TeXBook`. Does anybody know how to scale a glue correctly? Thanks in advance.


title: Beamer Multifile and Figure Issues in Emacs 24.3.1 / AucTeX-11.87 in Ubuntu 12.04

text: I'm trying to edit multifile beamer presentation documents in AUCTeX. I use Emacs 24.3.1 / AucTeX-11.87 / TeX 3.1415926 (TeX Live 2012/Debian) in Ubuntu 12.04. The most simple code that explains my issue is attached below **MasterFile** ( _mainFile.tex_ )               \documentclass[compress, 9pt, t,xcolor={usenames,dvipsnames,svgnames,table}]{beamer}     \mode<presentation> {     \usetheme{Madrid}     }          % include packages     \usepackage{graphicx}               \title[ShortTitle]{Beamer in AUCTeX}     \subtitle{Beamer in AUCTeX}     \author[WM]{\small WanderingMind}     \institute[World]     {     \begin{center}        \includegraphics[scale=0.3]{figure1}     \end{center}     Department \\     Organization \\ % Your institution for the title page     \medskip     \textit{email@email.com} % Your email address     }     \date{\today}          \begin{document}     \frame{     \titlepage     }     \section{Introduction}     \label{sec:Intro}     \input{sec1_Intro}          \end{document}      **SlaveFile** (*sec1_Intro.tex*)               \section{Introduction}                 \begin{frame}{Introduction}       \begin{block}{}          \begin{figure}                           \begin{center}        \includegraphics[width=0.35\textwidth,keepaspectratio]{figure1}       \end{center}       \end{figure}            \begin{itemize}        \item Beamer with AUCTeX trial.        \item Issue with MultiFile.        \item Schrodinger Eq. $i\hbar\frac{d\left|\psi(t)\right>}{dt}=H\left|\psi(t)\right>$.       \end{itemize}       \end{block}       \end{frame}                     %%% Local Variables:      %%% mode: latex     %%% TeX-master: mainFile     %%% End:       However I'm having two important issues. (1) _I'm unable to compile the beamer from one of the section files buffer_ (in this case sec1_Intro.tex). The AUCTeX throws me an error stating `ERROR: Undefined control sequence.`   * I do include the local variables definition at the end of the section files (see sec1_Intro.tex).    * Further in order to avoid automatic master file, I also perform `(setq-default TeX-master nil)` in the Init File in addition to other AUCTeX options described here. (2) _The eps figures (figure1.eps) does not show up in the xdvi while performing View (C-c C-v) command_   * The eps figure is visible from other viewers such as evince. But this is not helpful since I cannot perform inverse search from evince to emacs.


title: Two separate acronym list using package glossaries

text: I want to create two separate acronym list. One with 3 columns and the other with four columns. I have defined the two styles for the two types of acronym list, `style1` and `style2`. I have my acronym files `INP-00-glossary.tex` and `INP-01-glossary.tex` How can I print two separate list of acronyms on separate pages? EDIT: The two lists I need are like following: List 1: (Which I call Nomenclature) This list consists of all the mathematical symbols that I have used. For example               **Nomenclature**      **Symbol     Description     Units       First used on Page No.**           T            Temperature      K                    5      I have second list which is like following               **Abbreviations**      **Term     Description                First used on Page No.**           MD          molecular dynamics                       7      The Nomenclature I have defined as \acronym. For example               \newacronym[user1={K}]{T}{\textit{T}}{temperature}       The Abbreviations I have defined as Glossaries. For example               \newglossaryentry{md}     {       name={MD},       description={molecular dynamics},     }      Now When I refer to `\gls{T}`. it expands on first occurrence and puts the symbol T in parenthesis. But when I refer to `\gls{md}`, it only writes MD. I want it like the first list I have created, both expansion and abbreviation in parenthesis. So I wanted both the list to be defined as acronyms. MWE:               \documentclass[12pt,a4paper]{article}                         %hyperlink     %\usepackage[backref=page]{hyperref}     \usepackage{hyperref}     \hypersetup{         bookmarks=true,         % show bookmarks bar?         unicode=false,          % non-Latin characters in Acrobat’s bookmarks         pdftoolbar=true,        % show Acrobat’s toolbar?         pdfmenubar=true,        % show Acrobat’s menu?         pdffitwindow=false,     % window fit to page when opened         pdfstartview={FitH},    % fits the width of the page to the window         pdftitle={My title},    % title         pdfauthor={Author},     % author         pdfsubject={Subject},   % subject of the document         pdfcreator={Creator},   % creator of the document         pdfproducer={Producer}, % producer of the document         pdfkeywords={keyword1} {key2} {key3}, % list of keywords         pdfnewwindow=true,      % links in new window         colorlinks=true,       % false: boxed links; true: colored links         linkcolor=red,          % color of internal links         citecolor=blue,        % color of links to bibliography         filecolor=magenta,      % color of file links         urlcolor=cyan           % color of external links     }               \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{enumerate}               \usepackage{tocloft}% deal with Tables of Contents     \usepackage[T1]{fontenc} %font encoding     \usepackage{lmodern} % better font     \usepackage{lipsum,appendix}     \usepackage{booktabs}%beautiful table     \usepackage{siunitx} %angstrom use: \si{\angstrom}     \usepackage{setspace}%one and half space     \usepackage[english]{babel}     \usepackage[round]{natbib}     \usepackage{upgreek}     \usepackage{pdflscape} %landscape page     \usepackage{mhchem} %left superscript subscipt     \usepackage{float}%exact location     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption} % for subfigures                         %glossaries and acronym     \usepackage[acronym,xindy,toc,numberline,indexonlyfirst, nomain]{glossaries}               \newglossary[nlg]{nomenc}{not}{ntn}{Nomenclature}     \newglossary[slg]{abbrev}{sot}{stn}{Abbreviations}                    %custom glossary style     \newglossarystyle{long6col}{%     % put the glossary in a longtable environment:     \renewenvironment{theglossary}%     {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%     {\end{longtable}}%     % Set the table’s header:     \renewcommand     *     {\glossaryheader}{%     \bfseries Symbol & \bfseries Description & &     \bfseries Units & & \bfseries Page List     \\\endhead}%     % No heading between groups:     \renewcommand     *     {\glsgroupheading}[1]{}%     % Main (level 0) entries displayed in a row optionally numbered:     \renewcommand     *     {\glossaryentryfield}[5]{%     \glsentryitem{##1}% Entry number if required     \glstarget{##1}{##2}% Name     & ##3% Description     & ##4% Symbol     & \glsentryuseri{##1}% Units     & \glsentryuserii{##1}% Dimensions     & ##5% Page list     \\% end of row     }%     % Similarly for sub-entries (no sub-entry numbers):     \renewcommand     *     {\glossarysubentryfield}[6]{%     % ignoring first argument (sub-level)     \glstarget{##2}{##3}% Name     & ##4% Description     & ##5% Symbol     & \glsentryuseri{##2}% Units     & \glsentryuserii{##2}% Dimensions     & ##6% Page list     \\% end of row     }%     % Nothing between groups:     \renewcommand     *     {\glsgroupskip}{}%     }     %END: custom glossary style                    %custom glossary1 style     \newglossarystyle{long6col1}{%     % put the glossary in a longtable environment:     \renewenvironment{theglossary}%     {\begin{longtable}{lp{\glsdescwidth}cccp{\glspagelistwidth}}}%     {\end{longtable}}%     % Set the table’s header:     \renewcommand     *     {\glossaryheader}{%     \bfseries Term & \bfseries Description & &      & & \bfseries Page List     \\\endhead}%     % No heading between groups:     \renewcommand     *     {\glsgroupheading}[1]{}%     % Main (level 0) entries displayed in a row optionally numbered:     \renewcommand     *     {\glossaryentryfield}[5]{%     \glsentryitem{##1}% Entry number if required     \glstarget{##1}{##2}% Name     & ##3% Description     & ##4% Symbol     & \glsentryuseri{##1}% Units     & \glsentryuserii{##1}% Dimensions     & ##5% Page list     \\% end of row     }%     % Similarly for sub-entries (no sub-entry numbers):     \renewcommand     *     {\glossarysubentryfield}[6]{%     % ignoring first argument (sub-level)     \glstarget{##2}{##3}% Name     & ##4% Description     & ##5% Symbol     & \glsentryuseri{##2}% Units     & \glsentryuserii{##2}% Dimensions     & ##6% Page list     \\% end of row     }%     % Nothing between groups:     \renewcommand     *     {\glsgroupskip}{}%     }     %END: custom glossary style                              %START hyperlink glossaries of 2nd instance onward off     \usepackage{etoolbox}     \makeatletter     %% patch first occurence of "\@gls@link[#1]{#2}{\@glo@text}", as this is the one for \glsused{#2}     \patchcmd{\@gls@}       {\@gls@link[#1]{#2}{\@glo@text}}       {\@gls@link[#1,hyper=false]{#2}{\@glo@text}}       {}{}               \patchcmd{\@Gls@}       {\@gls@link[#1]{#2}}       {\@gls@link[#1,hyper=false]{#2}}       {}{}          \patchcmd{\@GLS@}       {\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}}       {\@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}}       {}{}     \makeatother     %END hyperlink glossaries of 2nd instance onward off                         \renewcommand*{\glspostdescription}{}%removes dot at end     \glssetwidest{AAAAAAA}% widest name     \renewcommand*{\glsnamefont}[1]{\textmd{#1}}                    \makeglossaries          %\loadglsentries[nomenc]{INP-00-glossary}     \let\oldacronymtype\acronymtype     \def\acronymtype{nomenc}     \loadglsentries[nomenc]{INP-00-glossary}     \let\acronymtype\oldacronymtype          \loadglsentries[abbrev]{INP-01-glossary}               %table header multiline START     \newcommand{\specialcell}[2][c]{%       \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}     %table header multiline END               \usepackage[showframe=false]{geometry}     \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1.5in,rmargin=1in}               \renewcommand*\appendixpagename{Appendix}     \renewcommand*\appendixtocname{Appendix}          \renewcommand*{\acronymname}{Nomenclature}%     \renewcommand*{\pagelistname}{First used on page no.}%     %\renewcommand*{\glossaryname}{Abbreviations}     \usepackage{longtable}%for example, manual nomenclature                                   \begin{document}          %\maketitle     \pagenumbering{alph}     \renewcommand*{\glossaryname}{Abbreviations}                    \begin{titlepage}     \begin{center}     \linespread{1}     \Huge\bf{\uppercase{ The Title Page}}\\                         \end{center}     \end{titlepage}                                        \pagenumbering{roman}          \newpage     \onehalfspace     \tableofcontents     \newpage          %list of tables     \phantomsection \label{listoftab}     \addcontentsline{toc}{section}{List of Tables}     \listoftables     \newpage               %list of figures     \phantomsection \label{listoffig}     \addcontentsline{toc}{section}{List of Figures}     \listoffigures     \newpage                    \glsaddall          \printglossary[style=long6col,type=nomenc]     \newpage     \printglossary[style=long6col1,type=abbrev]                         %\setcounter{page}{3}     \newpage               \setcounter{secnumdepth}{0}     %\include{nomeclature_manual}     %\include{abbreviations}     \setcounter{secnumdepth}{4}     \pagenumbering{arabic}     \include{textbody}                    \end{document}      The content of INP-00-glossary.tex               \newacronym[user1={$\AA$}]{a}{\textit{a}}{lattice constant}     \newacronym[user1={$K^{-1}$}]{alphat}{$\alpha_T$}{linear thermal expansion coefficient}      The content of INP-01-glossary.tex               \newglossaryentry{MC}     {       name={MC},       description={Monte Carlo},       first={\glsentrydesc{MC} (\glsentrytext{MC})}     }     \newglossaryentry{MD}     {       name={MD},       description={molecular dynamics},       first={\glsentrydesc{MD} (\glsentrytext{MD})}     }      The content of textbody.tex               \section{My First Section}          text first page \gls{MD}     \newpage     text second page \gls{a}     \newpage     text third page \gls{alphat}     \newpage     text fourth page \gls{MC}      The name of the glossary styles `long6col` and `long6col1`


title: A line of text with proper positioning but consuming no space?

text: Welcome to part 4 in a series of questions about me trying to improve my crazy layout! I'm using `tabu` to create a table with a central heading, and two small blocks of text on the left and right which are vertically centered. Now I'd like to add a small subheading — but **the main heading should still be vertically centered with respect to the left and right text blocks**. Here's the starting point: ![](http://i.stack.imgur.com/DDO3Z.png)               \documentclass{article}     \usepackage{tabu}           \begin{document}          \noindent     \begin{tabu}{|X[m,c]|X[-2,m,c]|X[m,c]|} \tabucline \\         \scriptsize This is something \linebreak on the left         &         \Huge Here's a Title         &         \scriptsize And here's some stuff \linebreak on the \linebreak right side         \\ \tabucline \\     \end{tabu}          \end{document}      When I use               \Huge Here's a Title \linebreak \normalsize And a subtitle!      I get this: ![](http://i.stack.imgur.com/8fCgW.png) Clearly the centering is preserved overall, but I don't want the subtitle to contribute to the positioning. So I tried `\smash`:               \Huge Here's a Title \smash{\linebreak \normalsize And a subtitle!}      But the result is no better (in fact, it's worse): ![](http://i.stack.imgur.com/qGclp.png) (And I tried some other arrangements too, to no avail.) Is there any way to do this, or am I crazy for trying?


title: Tikz labelling picture

text: I have the following code. I, somehow, could not manage to number the whole figure. I have tried with label but, it does not show label at all.               \begin{figure}     \centering          \subfigure[Single Crossing]{\resizebox{0.4\textwidth}{!}{ %     \begin{tikzpicture}[scale=1.5]     \draw (0,0) -- +(4,0) node[pos=0,left]{\tt\color{black}1};          \draw (0,-4)-- +(4,0) node[pos=0,left]{\tt\color{black}0};          \draw [red,line width=2pt, name path= F] (0,-4) -- (0.5,-4) to [out=20, in=195] (3.5,0)--(4,0);     \draw [blue, line width=2pt, name path= G] (0,-4) -- (1,-4) to [out=20, in=195] (3,0) -- (4,0);          \fill[gray,name intersections={of=F and G,total=\t}]     \foreach \s in {1,...,\t}{(intersection-2) node[left] {E}};           \draw [fill] (0,-1.5) circle[radius=0.03];           \draw [dashed,lightgray] (0,-1.5) node[left,black]{$p$} -- (2.12,-1.5) -- (2.12,-4);           \draw [dashed,thick,gray] (2.12,-4) -- (2.12, -1)-- (0,-1)node(yline)[left,black]   {$p^{\prime}$};           \draw [fill] (0,-1) circle [radius=0.03];           \draw [fill=gray] (intersection-2) circle [radius=0.03];          \end{tikzpicture}


title: List of theorems: no links when problem title is non-english

text: I'm trying to make use of this solution to get list of problems. I'm using XeTeX, and if I use non-english as a problem name -- hyperref's links to problem in "List of problems" doesn't work. Here's a MWE:               \documentclass{book}          % =====================     %% XeTeX customization:          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{Arial}     \setsansfont{Arial}     \setromanfont{Arial}     \setmonofont{DejaVu Sans Mono}          % Russian/English document:     \usepackage{xecyr}     \newfontfamily\cyrillicfont{Arial}          \setmainlanguage{russian}     \setdefaultlanguage{russian}     \setotherlanguage{english}               % =======================     %% hyperref and ntheorem:          \usepackage[hyperref]{ntheorem}     \theoremlisttype{all}          \makeatletter     \newtheoremstyle{problem}       {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}%       {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]}     \makeatother     \theoremstyle{problem}     \newtheorem{Задача}{Задача}[chapter]          \usepackage{hyperref}               \begin{document}          \chapter*{List of problems}     \listtheorems{Задача}          \chapter{foo}          \begin{Задача}[Short foo name]       Foo!     \end{Задача}          \chapter{bar}          \begin{Задача}[Short bar name]       Bar!     \end{Задача}          \end{document}      It needs to be compiled with `xelatex`. I want to get clickable list of problems. I tried to add some options to hyperref:               \hypersetup{xetex,       unicode=true,       pdfencoding=unicode,       bookmarks={true},     }      it doesn't work. **Edit** : Versions:               ntheorem 1.31      hyperref 6.82q     polyglossia 1.2.1     xecyr 1.0      Complete compile log is here. **Edit 2** : Here's thm file on request of egreg:               \contentsline {Задача}{{Задача}{1.{1}}{Short foo name}}{3}{Задача.1.1}     \contentsline {Задача}{{Задача}{2.{1}}{Short bar name}}{5}{Задача.2.1}      With the solution I posted below the same file is               \contentsline {problem}{{Задача}{1.{1}}{Short foo name}}{3}{problem.1.1}     \contentsline {problem}{{Задача}{2.{1}}{Short bar name}}{5}{problem.2.1}


title: How to horizontally align rotated text in a table?

text: I am trying to horizontally align text that has been rotated in a table. I want the rotated "Lorem Ipsum" and the rotated "Lorem Ipsum & Lorem Ipsum" text to be horizontally centered in the cell. When I adjust the width of each column manually, the alignment is no longer centered. I need to modify the width of each column so that my table will fit in the width of a single column. I tried using the `\multirow` command from Table rotated text alignment but I was only able to modify the vertical alignment. Here is what my table looks like: ![Table](http://i.stack.imgur.com/iTjru.png) Here is the code (apologies if I included some unnecessary packages):               \documentclass{article}     \usepackage{array}     \usepackage{tabularx}     \usepackage{rotating}     \usepackage{lipsum}     \usepackage{multirow}     \begin{document}          \newcommand\RotText[1]{\fontsize{9}{9}\selectfont \rotatebox[origin=c]{90}{\parbox{2.6cm}{\centering#1}}}     \newcolumntype{G}{>{\centering\arraybackslash}m{.0625cm}}     \newcolumntype{U}{>{\centering\arraybackslash}m{.375cm}}          {\centering     \begin{center}\begin{table}[ht]\caption{Lorem Ipsum Table}     \footnotesize     \centering     \begin{tabular}{|c|G|U|U|U|U|G|G|G|U|}     \hline      & \multicolumn{9}{c|}{Lorem Ipsum} \\      \cline{2-10}          Instruction & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} &      \RotText{Lorem Ipsum \& Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum} & \RotText{Lorem Ipsum \& Lorem Ipsum} \\     \hline     Lorem Ipsum     &      & & X   & & & & & & \\          \hline     \end{tabular}     \end{table}     \end{center}     }          \lipsum          \end{document}


title: Best way to get the unit vector of a given vector in tikz 3d

text: Suppose I have a coordinate in tikz 3d which I interpret as a vector, for example `\coordinate (v) at (3,2,9);` What's the best way to get the unit vector pointing into the same direction? My first idea was to use the `let` syntax, but this doesn't work in 3d. For example `\path let \p1 = (v) in ($1/(x1^2 + x2^2 + x3^3)^(0.5)*(v)$) coordinate (vv);` Anyhow I am looking for a more easy to use solution than using `let` for this...


title: Documentation of the tikz 3d library

text: Where can I find the documentation of the tikz 3d library? There seems to be no such section in the manual and google didn't help me in this case.


title: Default sans-serif for T1

text: When using `\usepackage[T1]{fontenc}`, my understanding was that the fonts were pretty much the same as the defaults, except that they carried native accentuated characters. Now, I use sans-serif in my document, and the difference is really important between T1 and the default. Here is the result (top is default, bottom is T1): ![Top is normal, bottom is with T1](http://i.stack.imgur.com/SvrPe.png) **Question:** How can I have the regular sans-serif fonts with a document using T1? Note; I only need the accents in the main, serifed text. Thanks!


title: Beamer: Positioning of images using framebreaks

text: I have three pictures that build upon each other, much like a gif (and no I don't want a gif). I have one frame where I want to show the three pictures one after the other using `\framebreak`. The idea is to build some simple animation. This requires that all images are positioned in exactly the same location across all three slides. However, when using framebreaks, the first image is positioned slightly lower than the other two. Here is my code:               \begin{frame}[allowframebreaks]       \frametitle{Blah Blah}       \begin{figure}          \includegraphics[scale = 0.8]{Probability1.pdf}       \end{figure}       \framebreak       \begin{figure}          \includegraphics[scale = 0.8]{Probability2.pdf}       \end{figure}        \framebreak       \begin{figure}          \includegraphics[scale = 0.8]{Probability3.pdf}       \end{figure}      \end{frame}      I've tried reducing the scale but the first picture is never exactly aligned with the other two. Any advice?


title: tikz - specifying more controls on curved lines

text: Im drawing a temperature profile for a given body of water:               \begin{tikzpicture}[scale=0.3]     \draw [>=stealth, ->,thick](0,0) -- (0,-22) node[left = 7mm, midway] {Depth [m]};      \draw [>=stealth, ->,thick](0,0) -- (22,0) node[above = 7mm, midway] {Temperature [$^{o}$C]};     \foreach \x in {0,4,10,20} { \draw(\x,-2mm)--(\x,2mm) node[above]{\x};}      \foreach \y in {0,-5,-10,-15,-20} { \draw(-2mm,\y)--(2mm,\y) node[left]{\y};}      \draw (6,-20) .. controls (6,-4)  and (17,-6) .. (17.5,0);     \end{tikzpicture}      From here I would like to copy the profile i.e. the curved line where the temperature at depth is increased as +2 degC and -2degC but where the surface of the water remains the same. For example:               \begin{tikzpicture}[scale=0.3]     \draw [>=stealth, ->,thick](0,0) -- (0,-22) node[left = 7mm, midway] {Depth [m]};     \draw [>=stealth, ->,thick](0,0) -- (22,0) node[above = 7mm, midway] {Temperature [$^{o}$C]};     \foreach \x in {0,4,10,20} { \draw(\x,-2mm)--(\x,2mm) node[above]{\x};}      \foreach \y in {0,-5,-10,-15,-20} { \draw(-2mm,\y)--(2mm,\y) node[left]{\y};}         \draw (6,-20) .. controls (6,-4)  and (17,-6) .. (17.5,0);      \draw[dashed,red](8,-20) .. controls (8,-4)  and (17,-6) .. (17.5,0);      \draw[dashed,blue] (4,-20) .. controls (4,-4)  and (17,-6) .. (17.5,0);     \end{tikzpicture}      This will generate two additional curved lines, the problem here is that the temperatures do not differ by the amount specified all the way down the profile i.e. the difference between the lines are 2degC at the bottom but up to a depth of 10 m they linearly increase to 2degC. I realise this problem is probably due to the number of control points used, but I can't seem to solve the problem. amended: working example               \documentclass[12pt]{article}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing,calc,shapes,arrows,snakes,shapes.geometric,patterns}          \begin{document}     \begin{figure}[ht]     \centering     \begin{tikzpicture}[scale=0.3]     \draw [>=stealth, ->,thick](0,0) -- (0,-22) node[left = 7mm, midway] {Depth [m]}; % draw xaxis for the diagram     \draw [>=stealth, ->,thick](0,0) -- (22,0) node[above = 7mm, midway] {Temperature [$^{o}$C]}; % draw yaxis     \foreach \x in {0,4,10,20} { \draw(\x,-2mm)--(\x,2mm) node[above]{\x};} % temperatures for graph     \foreach \y in {0,-5,-10,-15,-20} { \draw(-2mm,\y)--(2mm,\y) node[left]{\y};} % depth for graph          \draw (6,-20) .. controls (6,-4)  and (17,-6) .. (17.5,0); % draw temperature profile i.e. curved line     \draw[dashed,red](8,-20) .. controls (8,-4)  and (17,-6) .. (17.5,0); % temp profile = 1degC     \draw[dashed,blue] (4,-20) .. controls (4,-4)  and (17,-6) .. (17.5,0); % draw new temperature profile     \end{tikzpicture}     \end{figure}     \end{document}      producing: ![enter image description here](http://i.stack.imgur.com/Hc4AD.png) From here, you can see that at the lowe depths the difference between the curves lines is not as specified. I would like to generate the graph where the three lines are the same at depth = 0m but thereafter they vary by 2degC. How could I do this?


title: Beamercolorbox has no color

text: I'm using the `Warsaw` beamer theme and try to customize it because the section headline is way too big for my presentation (about 7 sections). I found a way to display only the section names in the headline. It looks pretty much like I want it to except the headline is not colored. The highlighting of the sections works but the colors won't. I'm not quite sure what the problem is. I use a `beamercolorbox` but it's just white. In the footline the exact same code produces a colored box. The code I use for the headline:               \setbeamertemplate{headline}     {%     \begin{beamercolorbox}[wd=\paperwidth,ht=5ex,dp=3.5ex]{sec}%         \raggedright%         \hspace*{2em}%         {\insertsectionnavigationhorizontal{0.7\textwidth}{}{}}%     \end{beamercolorbox}%     }      ![enter image description here](http://i.stack.imgur.com/YUX3R.png) I'd really appreciate your help,


title: Why is my in-center not located correctly?

text: Could someone explain why my in-center has fallen outside of the triangle?               \documentclass{article}     \usepackage{tikz}     \usepackage{tkz-euclide}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}            \coordinate (A) at (0,0);       \coordinate (B) at (30:2in);            \coordinate (tC/A) at ($(A)!1in!-30:(B)$);       \coordinate (tC/B) at ($(B)!1in!60:(A)$);            \tkzInterLL(tC/A,A)(tC/B,B) \tkzGetPoint {C}            \draw (A) -- (B) -- (C) -- cycle;            \tkzInCenter(A,B,C)       \tkzGetPoint{cABC}       \node at (cABC) {{\small\texttt{In-center???}}};            \draw[red,dashed] (A) -- (cABC)                         (B) -- (cABC)                         (C) -- (cABC);            \node at ($(A)+(-90:1ex)$) {A};       \node at ($(B)+(+90:1ex)$) {B};       \node at ($(C)+(-90:1ex)+(1ex,0)$) {C};            \path (A) -- (B) node [midway,sloped,above=2pt] {Hypotenuse}; %%,sloped       \path (B) -- (C) node [midway,right]            {Shorter Leg};       \path (A) -- (C) node [midway,below]            {Longer Leg};     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/UMR5s.png) **UPDATE** Curiously enough, if I change the order of the vertices, I can get different results:               \tkzInCenter(C,A,B)      seems to provide the correct in-center. Very curious to know what's going on. My French is very shaky, but the manual seems to suggest these points can be provided in any order. Something seems to be going wrong with `\tkzDefBisectorLine(....)` which is used in the definition of `\tkzInCenter`. In particular, if I write                 \tkzDefBisectorLine(C,A,B) \tkzGetPoint{testA}       \draw[blue,dashed] (A) -- (testA);            \tkzDefBisectorLine(C,B,A) \tkzGetPoint{testB}       \draw[blue,dashed] (B) -- (testB);       \node[inner sep=4pt,fill] at (testB) {};      The choice of an order of `C,A,B` and `C,B,A` is based upon how the definition would work with `\tkzInCenter(A,B,C)`. The first line shows up, but `testB` seems to be place at the same coordinate for `B`.


title: LaTeX Error: \begin{document} ended by \end{section}

text: I am encountering the above error message. This is what I have so far:               \documentclass{article}     \title{Assignment \#1}     \author{Giridhaar Guruparan}     \date{March 20, 2014}          \begin{document}     \maketitle          \section*{Question 1}     \textit{Scenario containing 2 pirates :} \\*\\*     Regardless of how the gold is split, the 2nd pirate will vote against the 1st pirate and take all the gold. \\*\\*     \end{section}          \textit{Scenario containing 3 pirates:}           \begin{table}[ht]     \caption{3 Pirates}     \centering     \begin{tabular}{c c c}     \hline\hline     Pirate\#1 & Pirate\#2 & Pirate\#3 \\       \hline     x & x &  x \\     \hline     \end{tabular}     \end{table}               \end{document}


title: Problem with \SIlist with two values and list-final-separator = {, }

text: First and foremost, thanks to Joseph Wright for developing and maintaining `siunitx` package. I have a problem with `\SIlist` macro. The desired result: > 3.23 (dd, _J_ = 3.9, 0.9 Hz, 1H). and I'm using this code:               \num{3.23} (dd, \emph{J} = 3.9, \SI{0.9}{\Hz}, 1H).      It works fine but I thought I could use `\SIlist` macro and eventually automate things a bit:               \num{3.23} (dd, \emph{J} = \SIlist[list-units=single,list-final-separator = {, }]     {3.9;0.9}{\Hz}, 1H)      I get the following result: > 3.23 (dd, _J_ = 3.9 and 0.9 Hz, 1H) A list of three or more values works OK:               \num{3.23} (ddd, \emph{J} = \SIlist[list-units=single,list-final-separator = {, }]     {3.9;0.9;0.1}{\Hz}, 1H)      > 3.23 (dd, _J_ = 3.9, 0.9, 0.1 Hz, 1H) Any ideas? Thank you. `siunitx` version 2013/02/01 v2.5p.   Win7, MiKTex 2.9


title: Active strings in WinEdt 8

text: I use WinEdt build 20131031 (v. 8.1) - 64-bit on a Windows 7 (64 bit) machine. My active strings are not working. I tried a lot, e.g., "Load Script" in the Options Interface (under Delimiters, Active Strings, Abbreviations... -> Active Strings). For example, I would like to have the typical `\ref{}` active string (such that the labels given in the main file pop-up after typing in `\ref{}`). It does not work (by contrast to WinEdt 5 or so). Now it becomes really weird: I have created my own active strings and put them into a file called `myActiveStrings.ini` which is located in `%b\ConfigEx\`. In `ActiveStrings.ini` (i.e., the active strings file that comes with WinEdt) I inserted `%INCLUDE="ConfigEx\myActiveStrings.ini"`. Now, my OWN active strings work, but not the active strings in `ActiveStrings.ini`! Help...! ;-)


title: Why are some characters not allowed in command sequences

text: From my understanding a control sequence is ended by any non-alphabetic character such that `\mycsA` is one token, but `\mycs1` is two tokens. This means things like starred commands `\mycs*` are actually two tokens with the `*` being the first "argument" to `\mycs` (even when `\mycs` isn't defined as taking an argument. This seems to be more confusing than defining a much smaller set of characters that end a control sequence (e.g., white space). What is the advantage of TeX behaving the way it was designed? **EDIT** I realized from David's answer, that my focus on terminating characters is incorrect, and I am more interested in the advantages/disadvantages of only allowing a small set of characters to be easily used in command sequences.


title: Contextual newlines in tocloft

text: I'm using a `shorttoc` with `tocloft` to put the names of chapters on a newline. Unfortunately, there are some chapters (such as the Preface or Index) which are not numbered, and I end up with additional, ugly, newlines between them: ![Shorttoc with ugly newlines](http://i.stack.imgur.com/rKpPl.png) Here is a MWE of my problem:               \documentclass{scrbook}          \usepackage[english]{babel}     \usepackage{shorttoc}          \usepackage{tocloft}     \renewcommand\cftchappresnum{Chapter\ }     \renewcommand\cftchapaftersnumb{\newline} % This is the newline I'd like to be contextual     \renewcommand\cftchapleader{\cftdotfill{1}}     \renewcommand\cftsecleader{\cftdotfill{1}}               \usepackage{blindtext}               \begin{document}          \shorttableofcontents{Contents}{0}          \addchap{Preface}     \blindtext          \Blinddocument          \addchap{Postface}     \blindtext          \tableofcontents          \end{document}      and the result is: ![MWE of the problem](http://i.stack.imgur.com/KbLwZ.png) How could I keep the newlines for numbered chapters and get rid of it for entries that are not numbered? **Edit:** Actually, I'm realizing that what I'm trying to achieve is to _reduce the interline_ between the chapter entries in the toc. How can I do that?


title: Using graphics from others' publications

text: I don't know the correct forum to ask this, but if I am doing research and find a very nice graphic I would like to use in my paper, can I cut and paste and cite?


title: Xelatex Crashes on item-bullets

text: I have installed a local version of the latest TeXLive distribution and xelatex crashes with the following error message, using the little document below.               This is XeTeX, Version 3.1415926-2.3-0.9997.5 (TeX Live 2011)     restricted \write18 enabled.     entering extended mode     ...     (./xelatex-test.aux)     Output file removed.     )     Error 256 (driver return code) generating output;     file xelatex-test.pdf may not be valid.     Transcript written on xelatex-test.log.      When putting in \item[] to avoid the bullet the file compiles. However `\usepackage[T1]{fontenc}` did not bring the solution.               \documentclass[a4paper,11pt]{report}          \usepackage{fontenc}     \usepackage{xunicode}     \usepackage{xltxtra}     \defaultfontfeatures{Mapping=tex-text} % To support LaTeX quoting style          %\usepackage{amssymb, amsthm}  %amsthm depends on amssymb     \usepackage{unicode-math}               \begin{document}     \begin{itemize}      \item test     \end{itemize}          \end{document}


title: How can I create my own listings style/format?

text: I'm trying to format some SQL statements using the `listings` package. It looks OK for small statements but the long ones look bad.               select * from Customers where C_nID=10;      to               select *     from customers     where C_nID=10;      So I tried to create my own style this works :               \lstdefinelanguage{mojsql}     {keywords={SYSDATETIME,sysdatetime,the,list,is,too,long%     sensitive=true,%     comment=[l]{\#},%     literate= {ä}{{a}}1 {\\}{{}}0 {?}{{\textcolor{red}{\textbf{?}}}}1,     string=[b]",%     string=[b]'%     }          \lstset{         language=mojsql, %% Troque para PHP, C, Java, etc... bash é o padrão         extendedchars=true,         breaklines=true, breakatwhitespace=false,         numbers=left,               frame=single     }      Then I wanted to format the statement (for example a new line before every `where` and so on). I have found the `\lstdefineformat{}` command but it doesn't work (command not defined error). I also tried the `\usepackage[format]{listings}` for importing, but I get an option clash for package `listings` error So how can I make sure that a new line is inserted before every `where` or other keywords? * * * **UPDATE:** Ok I've found the problem and I can execute the function but unfortunately new problems rose. I have described them in the working example.               \documentclass[12pt,oneside,a4paper]{book}     \usepackage[formats]{listings}     \usepackage{color}     \lstdefinelanguage{mojsql}     {keywords={select,top,from,too,long,for,a,minimal,example},%     sensitive=false,%     morecomment=[s]{/*}{*/},%     morecomment=[l]{//},%     literate= {ä}{{a}}1 {\\}{{}}0 {?}{{\textcolor{red}{\textbf{?}}}}1 {1}{{\textcolor{red}{\textbf{1}}}}1,%I tried something like {AND}{\newline AND}3 the text was repleaced bud the new line command was ignored ...     string=[b]",%     string=[b]'%     }     %The command works now (I had a typo and an older version of listings Im not sure which one fixed the problem)     \lstdefineformat{mojsqlFormat}{     \{ =\newline\string,%this works fine ( to test replace "{" with "(" there are no { in the statement     %I want the exact same thing with the WHERE keyword but where=\newline\string does not work -> ! LaTeX Error: Missing \begin{document}. Is there simple solution for this?     %,where=\newline\string     }     \lstset{         language=mojsql, % Troque para PHP, C, Java, etc... bash é o padrão         format=mojsqlFormat,         extendedchars=true,         breaklines=true, breakatwhitespace=false,         numbers=left,               frame=single     }     \begin{document}     %long unformated sql statement (im a script to inject it before the compilation)     \begin{lstlisting}      SELECT (SELECT TOP 1 a.id FROM vAnalysesHistory AS a WHERE a.companyid = n.stockid ORDER BY a.chosendatetime DESC) AS id, n.name, (SELECT TOP 1 a.chosendatetime FROM vAnalysesHistory AS a WHERE a.companyid = n.stockid ORDER BY a.chosendatetime DESC) AS chosendatetime FROM vStockNames AS n         \end{lstlisting}     \end{document}