title: Global bibliography - and multiple

text: I am using one .bib files and need to create multiple bibliographies for each chapter + one global one in the end - using biblatex (biber). Everything works smoothly with the multiple bibliographies using refsection, however, I fail to create the global biblio. I found a very similar problem here: Multiple bibliographies and one global bibliography - all with global labels \- however the solution               \nocite{*}      does not work for me as I need only those references cited (my .bib file is very large. My example:               \usepackage[refsection=chapter, style=authoryear-comp,natbib=false,mcite=false,backend=biber]{biblatex}     \addbibresource{refs.bib}     \begin{document}      \begin{refsection}     blabla \cite{}     \printbibliography[heading=subbibintoc]     \end{refsection}               % and now the global one that should include all previously cited documents          \printbibliography[heading=bibintoc]          \end{document}     \begin{refsection}     blabla \cite{}     \printbibliography[heading=subbibintoc]     \end{refsection}      It does neither produce a global biblio nor an entry in the toc.


title: New command for special elements in parenthesis

text: Sequences of elements like               $\{x_n\}_{n\in\mathbb{N}}$      are to awful to type. And they are very common, not only sequences of elements, but families of sets and some other sorts of mathematical structures. I'd like to create a command in which I can type a letter, say x, and a set, say `$\mathbb{N}$` such that the output be the sequence like               $\{x_n\}_{n\in\mathbb{N}}$


title: Give \printglossaries a section number and customize the name?

text: When I print my glossary using \printglossaries it prints the glossary on a chapter level (at least it gives it the style of a chapter heading + it appears in the index on a chapter level). However, it doesn't get a chapter number. In the example below the result would be: 1\. Content A. First Appendix Glossary Does anybody know how I could give it the proper chapter number (= B. Glossary) in this case? Being able to customize the term "Glossary" on top of that would be even better.               \documentclass{article}          \usepackage{glossaries}          \newglossaryentry{sample}{name={sample},description={an example}}          \renewcommand{\glstextformat}[1]{\textit{#1}}          \begin{document}     \chapter{Content}          \gls{sample}.          \Appendix     \chapter{First Appendix}     \printglossaries          \end{document}      Thanks


title: Avoid line breaks after \lstinline

text: I'm writing a computer science paper with LaTeX and have a lot of inline code. Now, when this code is followed by a comma and is at the end of line, the line break is inserted _before_ the comma, which is wrong and looks weird. Here's an example: > This is normal text with some `inlined code`, `more inlined code`   >  , and `even more inlined code`. Basically, the corresponding LaTeX code is (although I'm having problems reproducing the issue in this MWE):               \documentclass{minimal}     \usepackage{listings}     \begin{document}     This is normal text with some \lstinline{inlined code},      \lstinline{more inlined code}, and \lstinline{even more inlined code}.     \end{document}      How can I avoid the line break between the code and the comma? I found that putting `\mbox` around the comma and `\lstinline` macro works, but this feels not right. Are there better solutions? If the problem is due to settings in my universities `.sty` or `.cls` files, is there a way I could quickly find the offending option? … That is, without commenting most of it and then re-introduce every option one by one. * * * **edit** Finally managed to whip up a short working example:               \documentclass[11pt]{book}          \usepackage{listings}     \lstset{     basicstyle=\ttfamily\footnotesize,     breaklines=true     }          \begin{document}     Bacon ipsum dolor sit amet ball tip shankle i Nrtdy uses \lstinline{System.LongerCode}, whereas Uiae uses \lstinline{System.OtherCode}.     \end{document}      Removing `breaklines=true` seems like to avoid the problem. This in unfortunate, since I need automatic line breaks in listings in other places. Is there a sensible fix?


title: trouble getting Tikz matrix to compile

text: In advance of a summer class I'm teaching, I decided to try compiling my notes, which I haven't touched in any way, shape or fashion for 4-5 months. However, in that interval, I've updated laTeX packages as new updates have come online (using MikTeX 2.9). I have a large number of lectures containing tikzpictures, of the following general form (all of which used to compile perfectly):                 \documentclass{article}             \usepackage{tikz}           \usetikzlibrary{snakes,shapes,arrows,matrix,positioning}                \begin{document}            \begin{figure}[h]       \centering       \rule[-1.25cm]{0pt}{3.25cm}         \begin{tikzpicture}[>=stealth,->,shorten >=1.5pt,line width=0.75pt]        \matrix (a) [matrix of nodes,row sep=0.5em, column sep=3em]        { \node[circle,draw,font=\small,minimum width=1cm] {\sffamily{1}};  &   \node[circle,draw,font=\small,minimum width=1cm]{\sffamily{2}}; &  \node[circle,draw,font=\small,minimum width=1cm]    {\sffamily{3}}; \\};      \path[>=stealth,font=\small] (a-1-1) edge node[below] {$S_o$} (a-1-2);      \path[>=stealth,font=\small] (a-1-2) edge node[below] {$S_1$} (a-1-3);      \path[>=stealth,->,font=\small] (a-1-2) edge [bend right=50] node [above,near start] {$S_1F_2$} (a-1-1) ;      \path[>=stealth,->,font=\small] (a-1-3) edge [bend right=55] node [above,near start] {$S_2F_3$} (a-1-1) ;         \end{tikzpicture}       \end{figure}          \end{document}      When I try to compile the preceding MWE, I get all sorts of error messages about 'no shape named a-1-1 is know...' etc. etc. Which I find odd, because clearly, when it compiled perfectly before, said shape was known. I gather something has changed. Any insights/pointers to the obvious most appreciated.


title: How to properly modify certain behaviors of a document class?

text: This is a real example of what I'm trying to understand by this question: I'm rewriting my CV using `europecv` and one behavior that I don't like, is titles of personal information: ![enter image description here](http://i.stack.imgur.com/5LTr0.png) Lets say, I want to replace `Surename(s) / First name(s)` by a simple `Name`. In `europecv.cls` there are these line:               \newcommand*{\ecvname}[1]{\def\ecv@name{#1}}     .     .     .     \ecv@namekey & \large\textbf{\ecv@name}\tabularnewline[5pt]      And in a file called `ecven.def` there is a macro like so               \def\ecv@namekey{\ecv@utf{Surname(s) / First name(s)}}      I know by changing the line above in the original file I can achieve what I want, but I rather not to mess in the original classes (also I'm not sure if it is cool with `LPPL`). This answer says one can easily redefine `\def`, but where should I do this if document class is already using another definition? What is the proper way of redefining documentclass macros in general and this example in particular? Here is a MWE for your convenience:               \documentclass[10pt,notitle,nologo,totpages]{europecv}          % How to acheive the line below?     % \def\ecv@namekey{\ecv@utf{Name}}              \ecvname{Pouya}         \ecvtelephone{+1234567890}         \ecvemail{foo@bar.com}          \begin{document}            \begin{europecv}       \ecvpersonalinfo       \ecvsection[-1cm]{Current position}       \ecvitem{}{In front of the computer}       \end{europecv}          \end{document}


title: How to check if a variable contains a word in plain TeX?

text: I have a variable that contains a long list of keywords, e.g.:               \keywords{computers, business, biology, fine art, literature, zoology}      I need to make an if-then statement that checks for the presence of a particular keyword, e.g.:               IF "zoology" IN keywords     THEN         TRUE     ELSE         FALSE      How can I check if a variable contains a particular keyword in plain TeX?   * I can change the format of `\keywords`, e.g. `\keywords{computers biology fine_art}`, if that will be easier to implement.


title: Test whether token list is empty

text: Is it possible to test whether a token list register is empty without expanding it?


title: Extend a standard command

text: What I want to do is the following: whenever my code says `\begin{lstlisting}` I want it to be `\begin{lstlisting}[language=GLSL]` instead. What I tried was inserting `\renewcommand{\begin{lstlisting}}{\begin{lstlisting}[language=GLSL]}` into the preamble of my document. But it seems to cause an infinite loop when compiling. My question is: How could I get what I want without replacing every `\begin{lstlisting}` in the whole document?


title: index and item separation

text: I'm currently creating an index with the book class. I would like to play with the vertical separation between items in the index. Below is what I am redefining:               \renewcommand\@idxitem{\par\hangindent 40\p@}     \renewcommand\subitem{\vspace*{-2\p@}\@idxitem \hspace*{20\p@}}     \renewcommand\subsubitem{\vspace*{-4\p@}\@idxitem \hspace*{30\p@}}      and I control the vertical space with two \vspace* commands. Is this correct? Thanks


title: Suppress TeXworks PDF preview

text: Is there any way to suppress the PDF preview appearing? I really don't like the internal PDF viewer and I prefer using Acrobat. (I know that on Windows, Acrobat makes the `.pdf` file read-only, but I'm on linux and it behaves better here). It is annoying pop-up that I have to kill or so whenever I compile.


title: Parse comma-separated list of command names with spaces

text: ## Problem This question is related to How can I specify a long list of math operators? – but with a twist: I want to allow spaces in in the comma-separated list, like so:               \newacronyms{acm, ams, cpu, nih}      For each of these, the macro `\newacronym` (note missing suffix “ **s** ”) should be invoked, which is defined as follows:               \newcommand*\newacronym[1]{       \expandafter\newcommand\csname#1\endcsname[1][]{{\acronymstyle#1}##1\xspace}}      Then I can use the acronyms in a text as follows:               The \nih is the National Institute of Health.     Modern computers have several \cpu[s].      – But how does the `\newacronyms` macro look like? ## Partial solution I got it working without spaces – that is, it only works as `\newacronyms{foo,bar}`:               \newcommand*\newacronyms[1]{       \@for\@i:=#1\do{\expandafter\newacronym\expandafter{\@i}}}      ## My approach (not working …) Now I need a way to gobble the leading spaces inside the `\@i` macro but I’ve come up dry. My initial thought was that something along the following lines should work, but to no avail.               \def\gobble@spaces{\@ifnextchar\space{\@gobble\gobble@spaces}{}}          \newcommand*\newacronyms[1]{       \@for\@i:=#1\do{%         \edef\@ii{\expandafter\gobble@spaces\@i}%         \expandafter\newacronym\expandafter{\@ii}}}      It should be noted that `\gobble@spaces` _works_ in similar circumstances (although I’m not sure why … shouldn’t there be an `\expandafter` before the `\@gobble`?), just not in the above:               % This WORKS:     \def\mylst{1, 2, 3, 4}     \@for\i:=\mylst\do{print ``\expandafter\gobble@spaces\i''\\}      Incidentally, does an equivalent command already exist somewhere in the kernel? I can’t imagine that I’m the first to need it.


title: Stop a bitwise-or in \emph from becoming a dash

text: I want to use a "`|`" in my `\emph{}`, like `\emph{"Yes"|"No"}`, but it changes the `|` to a `--`. How do I stop this from happening?


title: How do I change the order of comma and ending double-quote after the title?

text: An example of a BiBTeX reference of mine               @ARTICLE{58,       author = {{Craig M. Pratt and Terry Eaton and Marilyn Francis and Antonio Pacifico}},       title = {{Ambulatory  Electrocardiographic Recordings: The Holter Monitor}},       journal = {{1988 Year Book Medical Publishers Inc.}},       year = {1988},       owner = {larselgaardmikkelsen},       quality = {1},       review = {hvad er en holter monitor},       timestamp = {2013.05.06}     }      Output: > Craig M. Pratt and M.D.n Terry Eaton and R.N. and Marilyn Francis R.N. and > Antonio Pacifico, M.D., “Ambulatory Electrocardiographic Recordings: The > Holter Monitor,” 1988 Year Book Medical Publishers Inc., 1988. How do I move the comma at the end of the title, so that it is outside the title? I have `"title,"` and I want `"title",`. Added the following as a minimal example This is my master.tex (shortened version)               \input{preamble.tex}     \begin{document}     \frontmatter     \pagenumbering{roman}% Page number in roman style     \input{frontpage}     \addcontentsline{toc}{chapter}{Resumé}     \input{resume}     \addcontentsline{toc}{chapter}{\abstractname}     \input{abstract}     \input{preface}     \input{tableofcontent}     \mainmatter     \input{introduction}     .     .     \input{conclusion.tex}     \appendixpage     \appendix     \input{appendix.tex}     \backmatter     \input{akronym.tex}     %\bibliographystyle{plain}     \bibliographystyle{ieeetr}     \begingroup     \raggedright     \bibliography{references/speciale}     \endgroup     \end{document}      I am using Memoir. And this is from my preamble:               \documentclass[a4paper,oneside,11pt]{memoir}     \usepackage[utf8]{inputenc} % Input encoding - Depending on editor     \usepackage{lmodern} % Modern LaTeX font     \usepackage[english]{babel} % Language package     \usepackage[T1]{fontenc} % Hyphenation     \usepackage{fix-cm} % Fix for cm     \usepackage{graphicx} % To handle pictures     \usepackage{graphics}     \usepackage[usenames,dvipsnames]{xcolor}     \usepackage{tikz} % Graphical tool     \usepackage{mathtools} % To use \eqref     \usepackage{url} % Use of urls in the text     \usepackage{varioref} % Smarter references     \usepackage{calc}% Auto calculate     \usepackage{lipsum} % Debugging text     \usepackage{sansmath,subfig} % Gives a warning because subfig loads caption     \usepackage{epstopdf}     \usepackage{multirow}     \usepackage{listings}     \usepackage{float}     \restylefloat{table}     \usepackage{caption}     \usepackage{enumitem}      Hope this is better - if not please let me know.


title: Alignment of \includegraphics in a tabular

text: When putting a graphics inside a table, the text at the right is too much at the bottom Minimum example :               \documentclass{article}[12pt]     \usepackage{graphicx} % This is already loaded by the atlasnote class                            % Just use it to include your plots!          \begin{document}          abc     \begin{table}[h!]     \begin{center}     \begin{tabular}{|c|l|c|}     \hline     ABCD, put me at the top     &\includegraphics[height=2.5cm]{invariant_mass_eX_Asymmetric}   &line1, i wish to be much more at the top\\     &                               &line2, idem\\     &                               &line3, idem\\     &                               &line4, idem\\     \hline     \end{tabular}     \end{center}     \end{table}          def          \end{document}      Current output: ![enter image description here](http://i.stack.imgur.com/N1K1q.png) I read the link Insert image and list inside a table but this didn't resolve my problem.


title: Writing in the same line as the section title

text: I needed to add some text after some of my section title and it certainly needs to be in the same line, and not to be in ToC or bookmarks. Therefore i decided to create my own subsection-type-thingy with an option to write text after the title, and that text wouldn't be added to ToC and bookmarks. Is there any clean way to do that? (by redefining subsection which i cannot find a nice tuorial on, or some other way?) my thingy: (i removed all font things and so on as they aren't the clue)               \def\MySubSection#1#2{\pagebreak[3]\noindent\thesection{.}\arabic{@MyCounter} #1 #2\addcontentsline{toc}{subsection}{\protect\numberline{\thesection.\arabic{@MyCounter}}#1}\\}


title: labels for itemize in proposition

text: I have a Proposition which consists of an itemize with three claims, i.e.               \begin{prop}     \begin{itemize}     \item[(i)] ...     \item[(ii)] ...     \item[(iii)] ...     \end{itemize}     \end{prop}      I wish to insert labels and references in such a way to get things like "...due to Proposition 4.1 (ii)..." or similar. How can I do? Should I use enumerate instead of itemize? Thanks.


title: Where to put a custom macros file?

text: I have a bunch of common commands I put in document preambles. I don't always use them all, but it makes the preamble too long for my tastes. I want to put them all in an external file (preferably in my user texmf tree). A class file seems like overkill; it isn't robust and I don't know TeX anyway. Creating a package seems intimidating as well. Can I just put the macros in a `macro.tex` in my tree and use `\include{macro.tex}` in my preamble? Also, could I include the same after `\begin{document}`?


title: Hyperref breaks my all-caps ToC entries

text: I started out on this earlier question. I now have a simple and elegant `etoolbox` solution to making all-caps chapter entries, but leaving appendix entries untouched. Simple, elegant, and incompatible with `hyperref`, it seems. MWE:               \documentclass{memoir}     \usepackage{etoolbox}     %\usepackage{hyperref}          \makeatletter     \ifpatchable*{\@chapter}{\typeout{Chapter can be patched}}{\typeout{Chapter cannot be patched}}     \patchcmd{\@chapter}%     {\addcontentsline{toc}{chapter}}%     {\let\f@rtocold\f@rtoc \def\f@rtoc{\uppercase\expandafter{\f@rtocold}} \addcontentsline{toc}{chapter}}%     {\typeout{Succeeded}}%     {\typeout{Failed}}     \makeatother          \begin{document}     \tableofcontents*          \chapter{One}     \chapter{Two}     \appendix \appendixpage     \chapter{Alpha}     \end{document}      which indicates that the `\@chapter` command can be patched, my patch succeeds, and I get the PDF output I wanted: ![ToC with all-caps chapters, normal appendices, and no hyperrefs](http://i.stack.imgur.com/iN0Ts.png) Enabling the `hyperref` package reverts my changes to the ToC format, somehow: ![ToC with normal chapters and appendices, plus hyperrefs](http://i.stack.imgur.com/oHd0U.png) * * * EDIT: After adding `\tracingpatches` to the preamble, the working version puts the following in the logs:               Chapter can be patched     [debug] tracing \patchcmd on input line 8     [debug] analyzing \@chapter     [debug] ++ control sequence is defined     [debug] ++ control sequence is a macro     [debug] ++ macro can be retokenized cleanly     [debug] ++ search pattern found in replacement text     [debug] ++ patching possible     [debug] == retokenizing macro now     Succeeded      and the failing version puts instead:               Chapter can be patched     [debug] tracing \patchcmd on input line 8     [debug] analyzing \@chapter     [debug] ++ control sequence is defined     [debug] ++ control sequence is a macro     [debug] ++ macro can be retokenized cleanly     [debug] -- search pattern not found in replacement text     Failed      I don't see any obvious places where hyperref modifies `\@chapter`, but I could have certainly missed something. * * * Final Working Example (including hyperref):               \documentclass{memoir}     \usepackage{etoolbox}     \ifpatchable*{\@chapter}{\typeout{Chapter can be patched}}{\typeout{Chapter cannot be patched}}     \patchcmd{\@chapter}%     {\addcontentsline{toc}{chapter}}%     {\let\f@rtocold\f@rtoc \def\f@rtoc{\uppercase\expandafter{\f@rtocold}} \addcontentsline{toc}{chapter}}%     {\typeout{Succeeded}}%     {\typeout{Failed}}     \makeatother     \usepackage{hyperref}          \begin{document}     \tableofcontents*     \chapter{One}     \chapter{Two}     \appendix \appendixpage     \chapter{Alpha}     \end{document}      ![ToC with hyperrefs, and in all caps](http://i.stack.imgur.com/FmhMj.png)


title: Converting command to result

text: Consider this example:               \documentclass{article}          \newcommand{\foo}{}     \newcommand{\currentbar}{\thebar}          \newcounter{bar}     \setcounter{bar}{0}          \makeatletter     \newenvironment{baz}{\addtocounter{bar}{1}}{\g@addto@macro\foo{\currentbar}}     \makeatother          \begin{document}          \begin{baz}     \end{baz}          \begin{baz}     \end{baz}          \foo     \end{document}      I have a command named `\foo`, a counter named `bar` and an enviroment `baz`. I would like `\foo` to store the state of the counter `bar` at each end environment `baz`. At the end of the first `baz`, `bar` equals `1`, so `1` should be written to `\foo`. At the end of the second `baz`, `bar` equals `2` so `\foo` should be `12` (2 is concantenated to the already existing `1`). As is, the `\foo` is most likely actually `\currentbar\currentbar`, and that outputs `22` when called at the end of the document. How could I "expand" the `\currentbar` to `1` and `2` so that `\foo` would be `12` at the end?


title: How to use Unicode characters with Sphinx rst documents and properly generate PDF files?

text: I discovered that if I use some Unicode characters inside `.rst` files, I will loose them when I convert the documentation to pdf using Sphinx. Example chars: "șț". When I run `make latexpdf` I get a document without these Unicode characters.


title: How to define an indentation command?

text: I'm confused in how I might go about writing a command to create an indention in LaTeX. For example, I am making an outline, and I want the Main Points to have an `\hspace` of `30pt`. How do I create a command (`\main`) that will allow me to do that consistently throughout my document? I am trying to learn LaTeX, but even this simple task is eluding me.               \newcommand{\main}          %% I know this is wrong     {          \hspace{30pt}     }


title: What fonts are compatible with T2A (Cyrillic) encoding?

text: I'm trying to figure out what fonts are compatible with T2A encoding - seems like there's no such a list known to Google. I've identified that iwona and computer roman (default) are supported. However, attempts to use other fonts with either `\usepackage{lmodern}` or `\renewcommand*\rmdefault{phv}` in preamble result in a warning > Font shape "T2A/lmr/m/n" undefined(Font) using "T2A/cmr/m/n" instead.               \documentclass[10pt,a5paper,draft]{book}     \usepackage[T2A]{fontenc}     \usepackage[utf8x]{inputenc}     \usepackage[russian, english]{babel}     \usepackage{iwona}     \begin{document}     Some meaningful text.          Какой-то осмысленный текст.     \end{document}      Fonts I've tried so far are: times new roman, garamond, helvetica, palatino. Maybe I'm missing something, so I'd be happy to be pushed in the right direction.


title: Adding arrow to one tree node and presenting tree in a step-wise fashion

text: I have the following MWE               %http://www.texample.net/tikz/examples/probability-tree/     \documentclass{article}          \usepackage[latin1]{inputenc}     \usepackage{tikz}     \usetikzlibrary{trees,arrows}     \begin{document}     \pagestyle{empty}               % Set the overall layout of the tree     \tikzstyle{level 1}=[level distance=3.5cm, sibling distance=3.5cm]     \tikzstyle{level 2}=[level distance=3.5cm, sibling distance=1.2cm]          % Define styles for bags and leafs     \tikzstyle{bag} = [circle,draw]     \tikzstyle{square} = [rectangle,draw]          % The sloped option gives rotated edge labels. Personally     % I find sloped labels a bit difficult to read. Remove the sloped options     % to get horizontal labels.      \begin{tikzpicture}[grow=right, sloped]     \node[square] {25}         child {             node[bag] {25}                         child {                     node[label=right:                         {25}] {}                     edge from parent                     node[above] {0.2}                     node[below]  {}                 }                child {                     node[label=right:                         {30}] {}                     edge from parent                     node[above] {0.6}                     node[below]  {}                 }                 child {                     node[label=right:                         {10}] {}                     edge from parent                     node[above] {0.2}                     node[below]  {}                 }                 edge from parent                 node[above] {Buy}                 node[below] {abroad}         }         child {             node[bag] {21}                         child {                     node[label=right:                         {40}] {}                     edge from parent                     node[above] {0.2}                     node[below]  {}                 }                child {                     node[label=right:                         {20}] {}                     edge from parent                     node[above] {0.6}                     node[below]  {}                 }                 child {                     node[label=right:                         {5}] {}                     edge from parent                     node[above] {0.2}                     node[below]  {}                 }                 edge from parent                  node[above] {Buy}                 node[below]  {locally}         }             child {             node[bag] {14}                         child {                     node[label=right:                         {55}] {}                     edge from parent                     node[above] {0.2}                     node[below]  {}                 }                child {                     node[label=right:                         {10}] {}                     edge from parent                     node[above] {0.6}                     node[below]  {}                 }                 child {                     node[label=right:                         {-15}] {}                     edge from parent                     node[above] {0.2}                     node[below]  {}                 }             edge from parent                          node[above] {Manufacture}                 node[below]  {themselves}         };     \end{tikzpicture}          \end{document}      I am struggling to add **one and only one** arrow (not red necessarily) as shown below ![probability tree](http://i.stack.imgur.com/CZnc7.png) The bonus question is how to make numbers 14,21,25 (circles) and 25 (square) appear in a step-wise fashion for use with beamer (i.e. initially having empty circles and empty square and then numbers appearing). Of course I could copy and paste the tree and remove the numbers from the first slide and add them on the second, but is there a `\pause` item possible to be utilised with tikz to automate this?


title: Making a unary operator out of a binary operator or relation symbol

text: Often in physics, the symbol `\sim` is used as a unary operator to mean "approximately." For example, one might say "`the energy of these processes is $\sim 4$ eV.`" However, this looks awkward because `\sim` is a binary operator and the spacing is incorrect. How can one use `\sim` act as a unary operator?


title: Office 2013 handling of (Xe)LaTex PDFs?

text: I just read that Office 2013 now includes PDF import and editing functionality, so that it converts the PDF automatically into a format that could be edited and saved as a .doc. I was wondering whether anyone has had a chance to play with this, and if so how well it handles academic papers written in Latex/Xelatex, especially with respect to footnotes, multiple languages or fonts, and citations/references (and math, though this isn't as important to me personally). It would be nice to get some sense of how well it works before considering upgrading to the 2013 suite, since I'm sure that will come with its own set of new UI, etc. headaches.


title: Loading a package more than once

text: What would happen when you load a package more than once, say via `\usepackage{<package>}` or `\RequirePackage{<package>}`. For example:               \documentclass{book}          \usepackage{geometry}     \usepackage{geometry}          \begin{document}     test     \end{document}      Will LaTeX ignore the double loading of `geometry`, or are there some problems and repercussions?


title: Scaling inset plot relative to main plot axis length

text: I want to create a plot with a second, smaller plot as an inset. This is easy enough using the following code, where the `width`s of the plots are defined. However, I often use figures in several different documents like two-column papers, presentations and my thesis, each of which have different `\textwidth`s. I therefore use `tikzscale` to scale the figure to the appropriate size while preserving font-sizes etc. This, however, implies, that I should not define a `width` for the `axis` environment as shown in this question. But if I don't define a fixed `width` for the main plot, then I also cannot define a width for the inset.   Is there a possibility to set the `width`of the inset to a value relative to the main plot's `width` without having given the main plot an explicit width (i.e. the main plot's `width`is unknown)?               \documentclass[crop,10pt]{standalone}     \usepackage[english]{babel}     \usepackage{tikz}     \usetikzlibrary{calc}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}          \begin{document}     \begin{tikzpicture}     \begin{axis}[         width=12cm,         name=mainplot,         enlargelimits=false,         ]         \addplot coordinates {(0,0) (1,1) (2,2)};     \end{axis}     \begin{axis}[         width=4cm,         at={($(mainplot.north west) + (rel axis cs:0.1,-0.1)$)},         anchor=north west,         enlargelimits=false,         ]         \addplot coordinates {(0,2) (1,1) (2,0)};     \end{axis}     \end{tikzpicture}     \end{document}


title: Placing text, includegraphics or a table above and below Tikz picture in standalone

text: The documents I am working with produce very large Tikz pictures (using Forest package) that span multiple horizontal and vertical pages in PDF. These pictures need to have titles, compbined of text, regular JPG images (logos) and PST pictures (QR code). When using standalone class, Forest is produced fine, but any text/tables prior to it appear on its left. Using `varwidth` parameter to standalone I can put them above Forest, but it will no longer span multiple pages. How can I get the best of both worlds: put the title above Forest and let it take as much space as it needs at the same time? Also need to put copyright notice below the Forest. That must have something to do with the calculation of `\textwidth` but what?               \documentclass[varwidth=true,border=10pt]{standalone}     %\documentclass[border=10pt]{standalone}     \usepackage{forest}     \usepackage{adjustbox}     \usepackage{pst-barcode}     \usepackage[crop=off]{auto-pst-pdf}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}           \begin{document}          \begin{tabular*}{\textwidth}{@{}l @{\extracolsep{\fill}} r@{}}     \begin{tabular}[t]{@{}l@{}}     Title\\ Text     \end{tabular} &     \begin{adjustbox}{valign=t}     \begin{pspicture}(0.7in,0.7in)         \psbarcode{http://www.ctan.org}{}{qrcode}     \end{pspicture}     \end{adjustbox}     \end{tabular*}          \begin{forest}      for tree={         draw=black, align=center, l sep=4ex, parent anchor=south, child anchor=north,         node options={font=\footnotesize, minimum width=14em, minimum height=10ex, rounded corners=1ex},         edge path={             \noexpand\path[\forestoption{edge}]             (!u.parent anchor) -- +(0,-2ex) -| (.child anchor)\forestoption{edge label};         },         where n children=0{             child anchor=west,             edge path={                 \noexpand\path[\forestoption{edge}]                 ([xshift=-6em]!u.parent anchor) |- (.child anchor)\forestoption{edge label};             },             draw=red,for parent={                 parent anchor=south, l sep=-12em, grow'=east, calign=child edge, draw=blue                       }         }{}     }         [Parent,name=Parent             [Child1                 [,phantom]                 [Child11]                 [Child12]             ]             [Child3                 [,phantom]                 [Child31]                 [Child32]             ]             [Child3                 [,phantom]                 [Child31]                 [Child32]             ]             [Child3                 [,phantom]                 [Child31]                 [Child32]             ]             [Child3                 [,phantom]                 [Child31]                 [Child32]             ]             [Child3                 [,phantom]                 [Child31]                 [Child32]             ]             [Child3                 [,phantom]                 [Child31]                 [Child32]             ]             [Child3                 [,phantom]                 [Child31]                 [Child32]             ]         ]     % <===== Insert below snippet with \node here =====     \end{forest}     \begin{tiny}Copyright \textcopyright Myself, 2014\end{tiny}     \end{document}      If Child1 and Child3 nodes were left, it would render just fine, but including the duplicates of Child3 clips the Forest. Edit: One of the workarounds I can think of would be including the necessary content into a `\node` inside the forest. But when I am trying to move the `tabular*` environment into a node as follows and to a line indicated by a comment above, it does not seem to be able to calculate the total width of the forest correctly:               \node(title) at (0,35ex){     \begin{tabular*}{\textwidth}{@{}l @{\extracolsep{\fill}} r@{}}     \begin{tabular}[t]{@{}l@{}}     Title\\Subtitle\\\begin{tiny}as of June 20, 2014\end{tiny}     \end{tabular} &     \begin{adjustbox}{valign=t}     \begin{pspicture}(0.7in,0.7in)         \psbarcode{http://www.ctan.org}{}{qrcode}     \end{pspicture}     \end{adjustbox}     \end{tabular*}     }[];      The end result of the MWE is a clipped forest with correctly placed Title and QR Code picture: ![enter image description here](http://i.stack.imgur.com/UINtZ.png) If the `tabular*` environment at the top of the document was moved to the commented line and `varwidth` option removed from the document class, it would look like below with Title and QRCode in the middle of the page, instead of at left and right side respectively: ![enter image description here](http://i.stack.imgur.com/8zpNR.png) **Edit:** Tried to implement John's `savebox` tip from the comment, but the contents of `savebox` are rendered side by side with the `tabular*` environment, not above it. They are equal width though, which is good.               \documentclass[border=10pt]{standalone}     \begin{document}          \newsavebox{\forestbox}     \sbox{\forestbox}{     oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo     }          \newlength{\forestboxlen}     \settowidth{\forestboxlen}{\usebox{\forestbox}}          \begin{tabular*}{\forestboxlen}{@{}l @{\extracolsep{\fill}} r@{}}     \begin{tabular}[t]{@{}l@{}}     Title\\ Text     \end{tabular} &     \begin{adjustbox}{valign=t}     \begin{pspicture}(0.7in,0.7in)         \psbarcode{http://www.ctan.org}{}{qrcode}     \end{pspicture}     \end{adjustbox}     \end{tabular*}          \usebox{\forestbox}          \end{document}


title: How to display two pictures that have not the same size with the same height?

text: I use this code to display two pictures:               \begin{figure}[htbp]     \minipage{0.45\textwidth}     \begin{center}     \includegraphics[width=1\textwidth]{methods.png}     \caption{Methods}     \label{fg:methods}     \end{center}     \endminipage\hfill     \minipage{0.1\textwidth}     \begin{center}     \end{center}     \endminipage\hfill     \minipage{0.45\textwidth}     \begin{center}     \includegraphics[width=1\textwidth]{method_detail.png}     \caption{Method detail information}     \label{fg:method_detail}     \end{center}     \endminipage\hfill     \end{figure}      Now I want assure that both pictures are not wider than `\textwidth`. This I have already achieved. But I'd like that the picture with the higher height is reduced to the height of the smaller image (while preserving the aspect ratio). Then the whole width isn't needed any more for the higher picture, so I'd like to use this width for the smaller picture to make it wider. I think I could do this by trying to use different width parameters in the includegraphics command, but isn't there a way to do that automatically?


title: Node shapes in TikZ

text: I want to draw a block diagram for a software app and I need two shapes which I couldn't find on the Internet. The shapes are a parallelogram and a rectangle with double side margins. One is for data and the other for a predefined process. They look like this: ![blockdiagram-flowchart-symbols](http://i.stack.imgur.com/SRZlg.gif) Does anyone know how could I draw those two shapes (maybe using TikZ)?


title: pgfplots - divide y-axis in 2 parts

text: I have a plot, code here. Now the problem I have is that because of the scale of y-axis it looks as if the plots are actually just 3 lines. Now what I want is that the y-axis is sort of splitted. Into a section ranging from -0.2 to 0.2 and a part ranging from -1.5 to -1.3... So the y-axis would look like something                0.2 -|           |           |     -0.2 -|           |     -1.3 -|           |           |     -1.5 -|           ----------------------------      Is this possible? \-- Okay I see there is a workaround for this using groupplots. But the plot that I give, I was already going to use this inside a groupplot environment with 2 other plots. So can I also use the suggested method in combinations with other normal plots which are combined in a groupplot. My current setup, now I need the splitting for the third groupplot               \begin{tikzpicture}          \pgfplotsset{%       width=4cm,       height=4cm,       scale only axis,       every x tick label/.append style={font=\scriptsize\color{gray!80!black}},       xmajorgrids,       xminorgrids,       every y tick label/.append style={font=\scriptsize\color{gray!80!black}},       ymajorgrids,       yminorgrids     }          \begin{groupplot}[%       group style={         group size=3 by 1,         horizontal sep=50pt,         vertical sep=40pt       }     ]          \nextgroupplot[     xmin=0,     xmax=800,     xlabel={Time [\si{\second}]},     ymin=-0.000196069528802578,     ymax=0.000140838393117182,     ylabel={State error $\mathbf{x} - \mathbf{x}'$},     ]          \addplot [     color=red,     solid,     forget plot     ]     table[row sep=crcr]{     };          \addplot [     color=green,     solid,     forget plot     ]     table[row sep=crcr]{     };          \addplot [     color=blue,     solid,     forget plot     ]     table[row sep=crcr]{     };          \nextgroupplot[     xmin=0,     xmax=800,     xlabel={Time [\si{\second}]},     ymin=-3.50920459213846,     ymax=2.98111910953132,     ylabel={$||\delta(t)||/{\delta_0}$}     ]     \addplot [     color=blue,     solid,     forget plot     ]     table[row sep=crcr]{     };          \nextgroupplot[     xmin=0.5,     xmax=800,     xlabel={Time [\si{\second}]},     ymin=-1.35665432608546,     ymax=0.168623669468375,     ylabel={Lyapunov exponents},     ]     \addplot [     color=blue,     solid,     forget plot     ]     };     \addplot [     color=green!50!black,     solid,     forget plot     ]     table[row sep=crcr]{     };     \addplot [     color=red,     solid,     forget plot     ]     table[row sep=crcr]{     };          \end{groupplot}          \end{tikzpicture}%      Let me also note that I need a common y-label, so this solutions to it should be able to work... Create x and y label which overlaps for multiple plots


title: How to do extra spacing when using small caps for abbreviations?

text: The default letter spacing for small capitals seem optimised for use in headlines and such but a bit too cramped for use in abbreviations. How should I do to get the letter spacing more suitably bigger for abbreviations? Also, I am using the `memoir` class and `\usepackage[osf]{mathpazo}`.


title: Kerning and long subscripts or superscripts

text: For really long sub(super)scripts, does it look bad to decrease the kerning? i.e.               \lim_{n\to\infty}{\dfrac{1}{s_n^2}\sum_{i=1}^n \int_{|x-\mu_i|>\varepsilon s_n} (x-\mu_i)^2f_i(x)dx}=0      ![enter image description here](http://i.stack.imgur.com/nRFal.png)               \lim_{n\to\infty}{\dfrac{1}{s_n^2}\sum_{i=1}^n \int_{|x-\mu_i|>\varepsilon s_n} \kern-1cm(x-\mu_i)^2f_i(x)dx}=0      ![enter image description here](http://i.stack.imgur.com/YDe9A.png)               \lim_{n\to\infty}{\dfrac{1}{s_n^2}\sum_{i=1}^n \int_{|x-\mu_i|>\varepsilon s_n|} \kern-1.5cm(x-\mu_i)^2f_i(x)dx}=0      ![enter image description here](http://i.stack.imgur.com/2o5Am.png) Is it innappropriate to decrease the kerning? If not, which one looks best? Also, is there a better way to do this?


title: Caption for a listing

text: I have captions on each of my listings. Each caption is prefaced with "Listing # [text]" where # is the number of the listing. Each caption is centered over my listing. How can I modify the options of these captions? Here is a visual:![enter image description here](http://i.stack.imgur.com/UqfdS.png)   1. I want to get truncate the caption to only contain [text]   2. I want to move the position of the caption from the center towards the left-side


title: BibTex: citation in an Enumerate is backref'ed with index, not page number

text: I have the following text: > \begin{enumerate}   >  \item bla   >  \item blabla   >  \item Quando o material termoplástico resfria, este endurece, desenvolvendo > aderência entre o aço e o concreto, agora comprimido. \cite{Leonhardt}   >  \end{enumerate} This section happens in what ends up being page 12. Now, when the bibliography is presented, it comes out as: ![LEONHARDT, F. Prestressed concrete design and construction. Berlin- Wilmersdorf,     Alemanha: Verlag von Wilhelm Ernst & Sohn, 1964. Traduzido por C. van Amerongen. 3](http://i.stack.imgur.com/8LS7R.jpg) Where that `3` is obviously the backref to the citation. This is the index of the enumerate item (if I move the citation to the second item, it becomes a 2, for example). How does one make the backref return the page number?


title: Openright in oneside book

text: I'm using book with the oneside option. Although, I'm using the oneside option I would like to start the chapters in odd pages only (like if the openright option was enabled). Apparently, the openright option does not work because with oneside all pages are right. Do you know how to solve it? best, minimal example:               \documentclass[a4, 11pt,oneside,openright]{book}          \begin{document}      \chapter{First}       \chapter{Second}       \chapter{Third}     \end{document}


title: Problem with the nomenclature?

text: I am trying to use the `nomencl` package. I am following an excellent looking guide available here: http://www.cs.brown.edu/system/software/latex/doc/nomencl.pdf However, I can't for the life of me get even the most basic example working despite the document building with no errors. This is the basic example:               \documentclass{article}     \usepackage{nomencl}     \makenomenclature     \begin{document}     \section*{Main equations}     \begin{equation}     a=\frac{N}{A}     \end{equation}%     \nomenclature{$a$}{The number of angels per unit area}%     \nomenclature{$N$}{The number of angels per needle point}%     \nomenclature{$A$}{The area of the needle point}%     The equation $\sigma = m a$%     \nomenclature{$\sigma$}{The total mass of angels per unit area}%     \nomenclature{$m$}{The mass of one angel}     follows easily.     \printnomenclature     \end{document}      When I build this document (using Texmaker and MikTex 2.9), I get a page with the equations and text. There are no errors or warnings shown and it even creates an ".nlo" file with the correct information inside. But no nomenclature. Can anyone think of anything I have missed or should try?


title: texlive: How to determine which package a font is contained in?

text: I've written a script that repeatedly runs `lualatex file.tex` to install missing packages, but I'm having a hard time doing the same with missing fonts. When an error message like               ! Font \OT1/ppl/m/n/9=pplr7t at 9pt not loadable: metric data not found or bad. comes up, I would like to determine the package containing `ppl`. Is there a way to do this algorithmically? (For example, when there were missing `x.sty` or `x.cls` files, I was able to run `tlmgr search --file x.sty` and parse out the package it was in. If there is a `ppl.some_extension` file that every font has and that tlmgr could search for, that would be perfect.) The script can be found here.


title: Position of figures

text: I have a question: can I put 3 pictures one beside the other in the same line? Actually I put them one after the other and I would like to put them in the same line if is possible. This is my code               \begin{figure}[!h]     \centering        \includegraphics[width=0.4\linewidth,clip,trim=0cm 0cm 8cm 0cm]        {t1}       \bf{\caption{Nb des pages qui ont reçu la pub partagé dans le réseau Num 5}}     \end{figure}           \begin{figure}[!h]     \centering        \includegraphics[width=0.4\linewidth,clip,trim=0cm 0cm 8cm 0cm]        {t2}       \bf{\caption{Nb des pages qui ont reçu la pub partagé dans le réseau Num 7}}     \end{figure}     \newpage      \begin{figure}[!h]     \centering        \includegraphics[width=0.4\linewidth,clip,trim=0cm 0cm 8cm 0cm]        {t3}       \bf{\caption{Nb des pages qui ont reçu la pub partagé dans le réseau Num 9}}     \end{figure}


title: Save wiki page in TEX?

text: Lot of wiki pages are excellent but there is no way to save it in LaTeX format so that the formula are kept. Even if we can use wiki's "create a book" function to save as pdf. The formula in wiki are just image files, however the html code has the "alt" property which seems is in LaTeX format. Example: from "Forward Measure" wiki page, the first formula is ![enter image description here](http://i.stack.imgur.com/Emx4e.png) while the html code is > < img class="mwe-math-fallback-png-inline tex" alt="B(T) = > \exp\left(\int_0^T r(u)\, du\right)" > src="//upload.wikimedia.org/math/7/8/c/78c74ca7d7162a9d58f72f3fd56d1b09.png"> Is there a way to save wiki page in tex?


title: Compiling Master and Individual Child documents with correct pagination

text: I'm using a master document by including the child documents with `\include{}` command. I can compile the master document to get the big document with all child documents included. I wonder how to get one big master document as well as individual child documents with the correct pagination through only one compile.


title: Change the vertical spacing above unnumbered sections headings

text: How can I change the vertical spacing above the section heading that dont have a number (like for instance the table of contents, the list of figures and the bibliograpy) while keeping the spacing of all other chapters the same? (I am using the report class.)


title: TikZ: How to center the text in a node with the scrartcl class

text: ![enter image description here](http://i.stack.imgur.com/i3Dus.png) I want to draw a probability tree. In Beamer it looks good. But in scrartcl the texts in the node are aligned right. I want the text to be centered. How can I solve this?               \documentclass[a4paper,11pt,fleqn]{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{ntheorem}     \usepackage{here}     \usepackage{multirow}     \usepackage{eurosym}     \usepackage{graphicx}     \usepackage{array}     \usepackage{colortbl}     \usepackage[ngerman]{babel}     \usepackage{geometry}     \newcommand{\changefont}[3]{     \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}     \geometry{a4paper, top=15mm, left=25mm, right=25mm, bottom=20mm,     headsep=10mm, footskip=12mm}     \theoremstyle{break}     \newtheorem{def1}{Definition}[section]     \usepackage{amsfonts}     \usepackage{color}       \usepackage{tikz}     \usepackage{pgf,tikz}     \usetikzlibrary{arrows}     \usetikzlibrary{shadows}     \pagestyle{empty}     \usepackage{booktabs}     \usepackage{amssymb}     \usepackage{amsmath}     \addtokomafont{caption}{\footnotesize}     \setlength{\mathindent}{0pt}     \makeatletter     \g@addto@macro\normalsize{%       \setlength\abovedisplayskip{0pt}       \setlength\belowdisplayskip{10pt}       \setlength\abovedisplayshortskip{0pt}       \setlength\belowdisplayshortskip{20pt}     }     \makeatother     \setlength{\intextsep}{0pt}          \begin{document}     \begin{center}     \begin{tikzpicture}[-,>=stealth',shorten >=0.5pt,auto,minimum size=0.3cm,inner sep=0pt,node distance=4cm,       thick,main node/.style={circle,fill=red!20,drop shadow,draw,font=\sffamily\normalsize\bfseries}]       \coordinate[] (1) {};       \node[main node] (2) [right of=1,yshift=2.1cm] {$R$};       \node[main node] (3) [right of=1,yshift=-2.1cm] {$F$};       \node[main node] (4) [right of=2,yshift=1.1cm] {$R$};       \node[main node] (5) [right of=2,yshift=-1.1cm] {$F$};       \node[main node] (6) [right of=3,yshift=1.1cm] {$R$};       \node[main node] (7) [right of=3,yshift=-1.1cm] {$F$};       \path[every node/.style={font=\sffamily\small}]         (1) edge [] node[above]{\footnotesize $0,5$} (2)         (1) edge [] node[below,yshift=-2pt]{\footnotesize $0,5$} (3)         (2) edge [] node[above]{\footnotesize $0,5$} (4)         (2) edge [] node[below]{\footnotesize $0,5$} (5)         (3) edge [] node[above]{\footnotesize $0,5$} (6)         (3) edge [] node[below]{\footnotesize $0,5$} (7);     \end{tikzpicture}     \end{center}     \end{document}


title: Horizontally align figures using parbox

text: I have 6 images and I need to align them in a 2x3 matrix with 3 images on 1 line and 3 on the other. This is the code so far which vertically aligns all 6 images. How do I change it?               \parbox{\columnwidth}{      \parbox{0.3\columnwidth}{     \begin{center}       \includegraphics[width=0.3\textwidth]{img/preproc_1.png}       Raw Image     \end{center}     }}     \parbox{\columnwidth}{     \parbox{0.3\columnwidth}{     \begin{center}       \includegraphics[width=0.3\textwidth]{img/preproc_2.png}       Gaussian Smoothing     \end{center}      }}     \parbox{\columnwidth}{     \parbox{0.3\columnwidth}{     \begin{center}       \includegraphics[width=0.3\textwidth]{img/preproc_3.png}       Eigenvalues     \end{center}     }}     \parbox{\columnwidth}{     \parbox{0.3\columnwidth}{     \begin{center}       \includegraphics[width=0.3\textwidth]{img/preproc_4.png}       Seeds     \end{center}     }}     \parbox{\columnwidth}{     \parbox{0.3\columnwidth}{     \begin{center}       \includegraphics[width=0.3\textwidth]{img/preproc_5.png}       Labeled Seeds     \end{center}     }}     \parbox{\columnwidth}{     \parbox{0.3\columnwidth}{     \begin{center}       \includegraphics[width=0.3\textwidth]{img/preproc_6.png}       Boxes     \end{center}     }}


title: Image file not found

text: I was developing a document in `Latex` using `TexStudio` that was installed in `windows7` and now I want to continue in `Ubuntu`. I installed Latex in Ubuntu and compiled my same project but I got error               ! LaTeX Error: File `./DFKI_logo' not found.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.     ...                                                        l.26 ...raphics[width=0.55\textwidth]{./DFKI_logo}                                                   ~\\[1cm]     I could not locate the file with any of these extensions:     .png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps     Try typing  <return>  to proceed.     If that doesn't work, type  X <return>  to quit.


title: Indentation problem in lists using custom label

text: I am having a small problem using lists with a custom label for each item. When I use the following code, the list item is not indented correctly, it uses the second number after the `\Rightarrow` to indent the paragraph               \documentclass[a4paper]{article}     \begin{document}     \noindent Some text before     \begin{enumerate}     \item[$(1)\Rightarrow (2)$:] Proof 1      \item[$(2)\Leftrightarrow (3)$:] Proof 2     \item[$(2)\Rightarrow (1)$:] Proof 3     \end{enumerate}     Some text after     \end{document}      I tried using the `\indent` command as well as `\hspace`, but I can't get it to work. Can anyone please help me?


title: What does (,li) mean in Vim Latex

text: I am using Macvim together with Vim-Latex suite. On the Vim Latex webpage they list Environment macros as follows:               ELI (,li)------------- list     EDE (,de)------------- description      etc. What does (for example) `,li` mean in this context?. How do I use this key combination to put a list in my `.tex` file. I am assuming `,li` means hit the local leader key and then hit `li` in normal mode. But I have remapped the leader key in vim to `,`. Can anybody shed some light on this?


title: Page range in TOC chapter entry in scrbook

text: I asked the question KOMA: Page range in TOC chapter entry Answer linked to Chapterwise page range in the TOC But i do not get the result for the following code...               \documentclass{scrbook}     \usepackage{lmodern}% for sans-serif plus bold plus italic               \usepackage{tocstyle}     \usetocstyle{standard}     \usetocstyle{nopagecolumn}          \settocstylefeature[0]{leaders}{\hfill}%     \settocstylefeature{pagenumberhook}{\itshape~}          \usepackage{blindtext}          \makeatletter     \newif\if@chap@enddc       \@chap@enddctrue     \let\ltx@@chapter\@chapter     \renewcommand{\@chapter}[2][]{%     \ltx@@chapter[#1]{#2}     \expandafter\label{chap:\thechapter}     }     \let\ltx@toc\tableofcontents     \renewcommand{\tableofcontents}{%     \ltx@toc     \let\ltx@chapter\chapter     \renewcommand{\chapter}{%     \expandafter\label{prenextchap:\thechapter}     \ltx@chapter     }}     \let\ltx@enddocument\enddocument     \renewcommand{\enddocument}{%     \if@chap@enddc\expandafter\label{prenextchap:\thechapter}\fi     \ltx@enddocument     }     \def\chaprange{\expandafter\pageref{chap:\thechapter}--\expandafter\pageref{prenextchap:\thechapter}}     \let\ltx@addcontentsline\addcontentsline     \def\CR@addcontentsline#1#2#3{%       \addtocontents{#1}{\protect\contentsline{#2}{#3}{\chaprange}}     }     \def\ToggleChaprange{\let\addcontentsline\CR@addcontentsline}     \def\BypassChaprange{\let\addcontentsline\ltx@addcontentsline}     \def\BreakChaprange{%       \expandafter\label{prenextchap:\thechapter}       \let\addcontentsline\ltx@addcontentsline       \@chap@enddcfalse     }     \let\ltx@section\section     \renewcommand{\section}[2][]{%     \BypassChaprange     \if\relax\detokenize{#1}\relax       \ltx@section{#2}     \else       \ltx@section[#1]{#2}     \fi     \ToggleChaprange     }     \makeatother          \begin{document}     \tableofcontents     \ToggleChaprange     \blinddocument     \BreakChaprange     \clearpage     \addcontentsline{toc}{chapter}{References}     \null     \appendix     \chapter{Additional Content}          \end{document}      ![enter image description here](http://i.stack.imgur.com/mbPFC.jpg) > Page range is printed for subsections also....


title: Address before appendix in amsart

text: I am writing an article using `amsart` class and because I'm having a little problem with placing the address, I'd like to ask for your help. If I use predefined commands to print out the address (school, town etc.) and email, they appear at the very end of the document (last page of text). But I would like them to appear before the appendix, as in my case it's only a set of figures... Also if I use predefined keywords command, they get printed in footnotes. How would I get them printed under (after) the abstract and in the same formatting as abstract? Do you know any simple way of doing that? Enclosing minimal working example... Thanks a lot in advance. Emil MWE:               \documentclass{amsart}          \usepackage{graphicx}    %and others          \begin{document}          \title[short title]{Title}          \author[Emil Skrisovsky]{Emil Skrisovsky\textsuperscript{1}}          \address{\textsuperscript{1}Faculty of Mathematics and Physics, Charles University. Prague, Czech Republic.}          \email{emil.skrisovsky@gmail.com}          \keywords{keyword1, keyword2, keyword3, ...}          \begin{abstract}     Abstract.....     \end{abstract}          \maketitle   %prints out Title, Author and Abstract (all in smallcaps)          %here is the contents, several pages of text      %introduction, main part, conclusion          \begin{thebibliography}{99}     %references     \end{thebibliography}          % i'd like to have the address placed here          \newpage     \begin{appendix}     %lots of figures     \end{appendix}     \end{document}


title: Lettrine package and the letter L

text: I am using the package `lettrine` to typeset capitals. In the documentation there are some special parameters to get the text closer in certain letter. For example, with the `A` you can set up lettrine to follow the inclination of the letter. Same with the `V` and other examples. What I would like is to get the text closer in the `L`. To make it clear. I get the following: ![enter image description here](http://i.stack.imgur.com/Osand.png) and I would like this: ![enter image description here](http://i.stack.imgur.com/CpzNB.png) Ideas?


title: Centering a TikZ picture around an area

text: I often find myself in the following situation: A `tikzpicture` of mine consists of a main area and some outer material like text labels which are hardly symmetric around the main area. If such a picture is centered the main area is not in the center which often looks not very nice. ![Not nicely centered](http://i.stack.imgur.com/KzaT3.png) I would like to state which (rectangle) area of the picture should be placed in the center. This should be best possible with either a macro or an option (TikZ setting) where I can state the lower-left and upper-right coordinates of the main area. ![Nicely centered](http://i.stack.imgur.com/prJh7.png) I know I could use `use as bounding box` when drawing the main area so that everything is not taken as part of the official picture, but this is often not useful. If the picture is converted to a PDF image using `preview` or `standalone` the outer areas would be clipped. Also the main area might be quite complicated and not easily put into a single scope. _So my idea is to have some code which measure the existing bounding box around the given main area and expands the bounding box by adding some white space so that this area is in the center._ Horizontal centering is the main target, but vertical centering might also be possible. An example would be:               \documentclass{article}          \usepackage{tikz}          \begin{document}          \hrule          \begin{figure}         \centering     \begin{tikzpicture}[<some key>={1,0}{6,5}]      \draw (1,0) rectangle (6,5);      \draw (1,0) -- (6,5);      \node [left] at (0,2.5) {Text};      \orsomemacro{1,0}{6,5}     \end{tikzpicture}     \caption{Caption}     \end{figure}          \end{document}      I personally would prefer a TikZ key/style, but an alternative macro provided in addition would be a bonus. Special care must be taken because the coordinates are not yet defined at the beginning of the picture. The coordinate argument should allow any TikZ coordinate including `calc` expressions with internal `( )`. The coordinates could be given using `{ }` instead of `( )` to simply the parsing. However, normal TikZ syntax is of course preferred. I (of course) already coded something like this and will post it as an answer after a while. I'm happy to see other solutions and will be happy to give away a bounty for the best one.


title: Problem using etaremune (reversing the labels of items in a list)

text: I am using the `etaremune` package to have the labels decreasing instead of increasing. I am writing my CV and would like to put reversing numbers for my publications. For some reason, when I create a list using `\begin{etaremune}`, the labeling of the items is not affected and remains increasing instead of decreasing. The following is the preamble of my CV document. In the document I used the `res` style file which can be found in this link.               \documentclass[margin,line]{res}          \usepackage{setspace}     \usepackage{hyperref}     \usepackage{graphicx}     \usepackage[lofdepth,lotdepth]{subfig}     \usepackage{etaremune}          \oddsidemargin -.5in     \evensidemargin -.5in     \textwidth=6.0in     \itemsep=0in     \parsep=0in          \newenvironment{list1}{       \begin{list}{\ding{113}}{%           \setlength{\itemsep}{0in}           \setlength{\parsep}{0in} \setlength{\parskip}{0in}           \setlength{\topsep}{0in} \setlength{\partopsep}{0in}            \setlength{\leftmargin}{0.17in}}}{\end{list}}     \newenvironment{list2}{       \begin{list}{$\bullet$}{%           \setlength{\itemsep}{0in}           \setlength{\parsep}{0in} \setlength{\parskip}{0in}           \setlength{\topsep}{0in} \setlength{\partopsep}{0in}            \setlength{\leftmargin}{1em}}}{\end{list}}          \hypersetup{pdfauthor = {AF}, colorlinks = true, urlcolor = blue, bookmarks = false}      I can overcome this problem by providing the starting label such as the following:               \section{\sc Peer-reviewed publications}         \begin{etaremune}[leftmargin=0pt, start=34]     ....     ....     \end{etaremune}      If I remove `start=34`, the labeling becomes increasing: 1, 2, ..., 34. What could be the problem? Is there a better package for reversing the labeling of a list? Could someone please help me?


title: "No room for a new \read" with writing a journal

text: I'm fairly new to TeX and learning as I go. I am trying to keep a journal in LaTeX. I'm using the solution provided at Using LaTeX to keep a diary . It's essentially a setup where each day's entry is stored in a new file. I hit the `No room for a new \read` error at entry 14. It seems like there are only so many files that I can include like this. Even then 14 sounds like a very small number. Is there a solution to this? A solution which will let me go on for years, adding thousands of entries. I have looked at No room for a new \read/\write which seems to discuss this or similar issue. But I'm not sure how to fix this code. I have put the code in `journal.tex` file. In the same directory there is a folder called 2013, which contains a folder called Jan, which contains 14 `.tex` files `1.tex` \- `14.tex`. All of them are completely empty. `journal.tex` follows.               %This file layout courtesy of the following online recipe     %http://tex.stackexchange.com/questions/68525/using-latex-to-keep-a-diary          \documentclass{tufte-book}     %\usepackage{lipsum}     \usepackage{tikz}     \usepackage{xifthen}     \usepackage{soul}     \usepackage{minted}               \newenvironment{loggentry}[2]% date, heading     {\noindent\textbf{#2}\marginnote{#1}\par}{\vspace{0.5cm}}          \def\?#1{}          \pgfmathtruncatemacro{\StartYear}{2012}     \pgfmathtruncatemacro{\EndYear}{2013}          \newcommand{\writetitle}{0}     \newcommand{\mytitle}[1]     {   \ifthenelse{\writetitle=1}{#1}{}     }          \begin{document}          \foreach \Year in {\StartYear,...,\EndYear}     {   \foreach \Month in {Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}         {   \foreach \Day in {1,...,31}             {   \IfFileExists{\Year/\Month/\Day}                     {   \newread\mysource                         \openin\mysource=\Year/\Month/\Day.tex                         \read\mysource to \firstline                         \closein\mysource                         \xdef\writetitle{1}                         \begin{loggentry}{\Year - \Month - \Day}{\firstline}                                 \xdef\writetitle{0}                             \input{\Year/\Month/\Day}                         \end{loggentry}                      }                     {   % files does not exist, so nothing to do                     }             }           }     }          \end{document}


title: Rectangle around data points in pgfplots

text: If I have some data points in a pgfplot, how can I draw a rectangle around them, with the rectangle using the same coordinate system as the points? I've included an example which does not work below.               \begin{tikzpicture}[scale=1.5]     \begin{axis}[xlabel=x, ylabel=y]     \addplot[smooth,mark=*,blue] plot coordinates {         (0,2)         (2,3)         (3,1)     };     \addplot[red, thick,rounded corners] (0,-1) rectangle (0,0);     \end{axis}     \end{tikzpicture}      (Why is there a cross not a rectangle?) From the manual I would expect that using:               \addplot[red, thick,rounded corners] (axis cs: 0,-1) rectangle (axis cs: 0,0);      might force the rectangle to use the same coordinate system as the points, but it does not, the code no longer compiles.


title: Noun in math mode

text: this is propably an Ubuntu packaging error; but just to confirm...               \documentclass{article}     \begin{document}     $\noun{name}$     \end{document}      ... this works on your texlive (2009) distribution with pdflatex? I get `Undefined control sequence.` on the noun command. Hmm


title: Record page number when citing in .tex file for bookkeeping, but hide it in the .pdf

text: I'm using `natbib` to display my citations as simple numbered subscripts. But I also want to record the page number of the source I'm citing in/near the `\citep{}`, just for myself. What's the best way of doing this? Thanks! Oh, and I don't think I can use `biblatex`!


title: How to use the \substitutefont in the normal font?

text: How to use the `\substitutefont` in the normal font? I need substitute `cmr (\familydefault)` to `yvo` (Venturis ADF Old) but is no work.               \documentclass[a4paper]{article}     \usepackage{parskip}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lipsum}     \usepackage{substitutefont}          % Normal     \substitutefont{T1}{cmr}{yvo} % Venturis ADF Old          % Sans Serif     \substitutefont{T1}{cmss}{pzc} % Zapf Chancery          % Monospaced     \substitutefont{T1}{cmtt}{phv} % Helvetica          \begin{document}          \textbf{Normal}          \lipsum[1]          \textbf{Sans}          \textsf{\lipsum[1]}          \textbf{TT}          \texttt{\lipsum[1]}          \end{document}      ![enter image description here](http://i.stack.imgur.com/SfGKi.png)


title: Are there other "fun" packages like the "coffee stains" package?

text: I'm trying to convert some friends to LaTeX and have come up against a (to me) unexpected objection: there are too few packages that support "fun" (really), to which I responded: ![enter image description here](http://i.stack.imgur.com/ERRDS.png) I know there are examples of clever and creative (and a bit silly) output coaxed out of otherwise quite sertious packages like TikZ, but I also wonder: Are there other _packages_ , like Hanno Rein's coffee package, that demonstrate LaTeX's lighter side?


title: document management system

text: I am writing technical documents with math/diagrams/plots/code etc. I want to compile them into a single document and also must be able to run each of them independently. These technical documents belonging to each topic are in their floders. Can someone guide me how to manage it better and also make it portable? Like I work on the same documents on Mac OSX/MS Windows.


title: endfloat: List of Tables and Figures at end of each chapter

text: How can I put a list of tables and figures after each chapter, rather than just once at the end of the document?               \documentclass[a4paper,12pt,twoside]{book}     \usepackage{pdflscape}          \usepackage{endfloat}          \renewcommand{\theposttable}{\Roman{posttbl}}     \renewcommand{\thepostfigure}{\Roman{postfig}}     \renewcommand{\thefigure}{\Roman{figure}}     \renewcommand{\thetable}{\Roman{table}}          % new environment for landscape tables         \newenvironment{ltable}       {\begin{landscape}\begin{table}}       {\end{table}\end{landscape}}          % make it known to endfloat     \DeclareDelayedFloatFlavor{ltable}{table}          \begin{document}          \chapter{This is Chapter 1}     Some text in chapter 1.  See my figure \ref{tab:table1}.          \begin{table}     \caption{First Table} \label{tab:table1}     \end{table}          \chapter{This is Chapter 2}     Some text in chapter 2.  See my figure \ref{tab:table2}.          \begin{ltable}     \caption{First Table} \label{tab:table2}     \end{ltable}          \end{document}


title: Number equation with previously used (auto-assigned) number

text: Assume you have a long text (i.e. a thesis/book/etc) with a lot of equations per chapter. At some point later in the text, you not only want to reference an equation but actually spell it out again, for the convenience of the reader. The same equation has been used before, so you don’t want a new number for it. You could put it in the text without a number. But what would be the best way to reproduce the original equation number for this second (or any subsequent) appearance? Ideally the solution would work with the hyperref package, allowing to place a link to the original equation in the pdf.


title: how to draw angle line?

text: > **Possible Duplicate:**   >  how to draw special line in a picture I use the code below to draw a picture, however the line is straight from s2 to s4 refer to the image.![enter image description here](http://i.stack.imgur.com/4NdP9.jpg) However, I want the line like an angle like the red line in the picture.would someone help me how to do it?               \usepackage{tikz}     \usetikzlibrary{trees}     \resizebox{.5\textwidth}{!}{     \tikzset{level 1/.style={level distance=0.7cm, sibling distance=3cm}}     \tikzset{level 2/.style={level distance=0.7cm, sibling distance=6cm}}          \tikzset{bag/.style={text centered,yshift=-0.2cm}}     \begin{tikzpicture}[grow=down, -stealth]     \node[bag]{$S_0{:}(B,true,0)$}         child{ edge from parent node[right]{$\lsInvoke \_ DS$}; \node[bag]{$S_1{:}(R_{good})$}                 child{ edge from parent node[right]{and}; \node[bag]{$S_2{:}(and)$}                         child[missing]                         child{ edge from parent node[right=0.1cm]{$[else]$}; \node[bag]{$S_3{:}(A_1)$}                         }                         child{ edge from parent node[right=0.9cm]{$[if]$}; \node[bag]{$S_4{:}(R_{good})$}                         }                 }         };     \end{tikzpicture}}


title: tabular vertical alignment to top?

text: I'm trying to create a simple tabular with two cells of text and two images below them like so:               \begin{tabular}[h]{ c | c}      \emph{Normal} & \emph{Cone} \\      \includegraphics[width=0.39\textwidth]{images/pipe1} &      \includegraphics[width=0.61\textwidth]{images/pipe2}        \end{tabular}      The first image is shorter than the second and I want it to be aligned at the top of the cell but for some reason it gets aligned to the **bottom** of the cell instead. I've tried using the `array` package and do this:               \begin{tabular}[h]{ p{0.39\textwidth} | p{0.61\textwidth} }      \emph{Normal} & \emph{Cone} \\      \includegraphics[width=0.39\textwidth]{images/pipe1} &      \includegraphics[width=0.61\textwidth]{images/pipe2}        \end{tabular}      But this doesn't change anything. The first image is still aligned to the bottom.   Why is that?   Could there be something else going on which forces the alignment to stick to the bottom?


title: Three (or more leg) xor gate for tikz

text: You know how the `tikz` gate libraries have 3-input OR and AND gates but not an XOR one. I am specifically looking for the US style of it. I was somewhat surprised that this isn't available. I was thinking about producing it myself but looking through the code for the OR is somewhat daunting. Is there an easy way to do it, maybe somehow inheriting from the OR? The image I am looking for looks like this ![xorgate](http://upload.wikimedia.org/wikipedia/commons/thumb/archive/0/01/20081219104814%21XOR_ANSI.svg/120px- XOR_ANSI.svg.png), not like the IEEE one, except for the three or more legs of course.


title: Side-to-side figure and table in beamer problem

text: \begin{figure}         %\centering             \begin{minipage}[h]{0.58\textwidth}             \centering             \includegraphics[scale=0.4,trim=12mm 15mm 12mm 15mm]{fig1}             \end{minipage}             \begin{minipage}[h]{0.38\textwidth}             \centering             \include{fig2}             \end{minipage}     \end{figure}      I get the fig1 nicely placed in the center of the left side BUT fig2 'sank' at the bottom of the right side. I dont really know what's wrong with the code. Actually fig2 is a table which i store as a tex file with codes only, something like:               \begin{tabular}{|c|c|}         \hline         aa  & bb  \\ \hline         0 & 10 \\ \hline         1 & 2 \\ \hline     \end{tabular}      Hope someone will help me fix this. Thanks in advance.


title: Enable PDF commenting with TexShop

text: I'm using TexShop (Mac OS 10.5) to typeset a manuscript and I would like to share the generated PDF with some colleagues. In the process, I would like to add some comments to the generated PDF and allow my colleagues to do the same. The freely available Acrobat Reader has commenting functionality, but apparently the PDF must explicitly allow commenting (and probably other forms of editing as well). Is there a way that I can tell TexShop and/or the underlying Tex distribution to typeset the PDF with the proper permissions? As an alternative, I just discovered the `todonotes` package, with which pop- up comments can be added to the source code and created when the document is originally typeset. This will work for me and perhaps one other colleague, but it's unlikely that I will be able to get all of my colleagues to pull the tex source from my git repo and edit it...so my original question remains.


title: Vertical cofibration arrow in xypic

text: I want to use `xypic` to make diagrams using vertical _cofibration arrows_ , i.e. ones that look like `$\rightarrowtail$`. Naively using `\ar@{>->}` gives an arrow whose tail overlaps with the source object. There is an exercise in the `xyguide` that fixes this: `\newdir{ >}{{}*!/-5pt/@{>}}`. But using this for vertical arrows gives tails that are horizontally shifted and do not attach to the shaft. How can I fix this or is there a nicer way to do such arrows in xypic anyway? This is the best I have seen so far but the results are not exceptional. Here's a MWE               \documentclass{article}     \usepackage[all]{xy}     \newdir{ >}{{}*!/-5pt/@{>}}          \begin{document}     \[     \xymatrix{      S_{P} \ar@{=}[r] \ar@{ >->}[d] & S_{P} \ar@{->>}[r] \ar@{ >->}[d] & 0 \ar@{ >->}[d] \\      R' \ar@{ >->}[r] \ar@{->>}[d] & R \ar@{->>}[r] \ar@{->>}[d] & M \ar@{=}[d] \\       P' \ar@{ >->}[r] & P \ar@{->>}[r] & M     }     \]     \end{document}      ![enter image description here](http://i.stack.imgur.com/FDfa4.png)


title: Hooking into \( and \)

text: Joseph Wright mentions in an comment to this tex.SE answer that it is possible to “hook into” the `\(` and `\)` commands to change their behaviour. Say that I'd like to force a cramped style on _all_ inline equations by e.g. wrapping them in `\cramped` (from the mathtools package) by hooking into the `\(` and `\)` commands. How would I do that? Or is there perhaps an easier way to force a cramped style?


title: Biblatex and listings incompatibility...

text: Does someone know why biblatex and listings are incompatible and if there is a way to fix it? I have a Lyx document and whenever I insert program listings I get errors like:                al trabajo de \citet{Fernandez2007}.                                                Más adelante se describe la     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      or like                \printbibliography\newpage                                  {}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      This happens only when I add the use of package listings. I am including biblatex like this:               \usepackage[natbib=true,style=alphabetic-verb,sorting=nty,hyperref,backend=bibtex8]{biblatex}      Any help will be very much appreciated. Bests, B. **Edit** (more details): Since I've been asked an example, I actually don't have one. Because all I have to do is adding:               \usepackage{listings}      to my Latex preamble (I am using Lyx) to get these errors. I have not even inserted source code listings yet. If I insert a source code listing using Lyx menu I will have the same problem since Lyx currently uses listings package and it will automatically insert listings package in the preamble. This is really strange, because I don't see why when I insert listings that would undefine \citet or other commands. I just upgraded from Lyx 1.6.8 to Lyx 2.0.0 to see if this fixed something, but no. I also updated the MikTex packages but it does not fix anything.


title: .doc -> latex preserving font

text: This is a follow-up to Converting MS Word .doc to LaTeX by command line. Do any of those utilities, or any others, have a mechanism to preserve the _font_ when converting from `.doc` to tex? I'm dealing with a document in which source code is indicated by Courier font, and all of the approaches I've attempted (e.g., textutils -> html -> pandoc) preserve some of the formatting but ignore the font. I've found no clear way to pull out source code by other means (e.g., regexp).


title: Ignoring asterisks * in the whole document

text: When using `*` to remove headlines from the toc, there might be times when you would like to see all the headlines in the toc -- including the removed ones. But you would like to see the headlines just temporarily to check what is in your document and what is not there without changing all the `*`-ed headlines to non-`*`-headlines (and back afterwards). My question: Is there a command or something to ignore the `*`-ing globally in the whole document, that can be switched on and off at any time?


title: XeLaTeX rotating my figures in Beamer

text: Whenever I compile my beamer presentations with `xelatex`, it forces any .pdf figures I've included with `\includegraphics` to rotate 90 degrees. If I compile with `pdflatex` or `lualatex`, I do not have this problem. Has anyone else seen this issue and/or know how to fix this? For example, if I compile the following .tex code with `lualtex`, the sizing and positioning of fig1.pdf is as I expect. If I compile with `xelatex`, the figure is rotated by 90 degrees.               \documentclass{beamer}          \usepackage{fontspec}     \setsansfont[Ligatures=TeX]{GillSansMT}          \begin{document}          \begin{frame}     \frametitle{Frame Title}     \includegraphics[width=0.5\textwidth]{fig1.pdf}     \end{frame}          \end{document}      Compiling with `xelatex` also outputs the message               <use  "fig1.pdf" > [1] (./slides.aux)     ** WARNING ** << /Rotate 90 >> found. (Not supported yet)      )


title: TeX Live 2013 on Red Hat 6.4

text: As many of you know, Red Hat 6.4 comes with obsolete version of TeX Live from 2007. Unfortunately, TeX Live is dependency for many important packages we use in the Lab most notably `R-3.0.2`. Could anybody share the wisdom or point me to a document describing the installation of TeX Live 2013 on the Red Hat in the sandbox so that it doesn't conflict with the default TeX installation? I would be happy to test somebody's RPM only if they behave like `Python 2.7.5` (unfortunately actual version is `2.7.3`) RPMs vs obsolete system Python. Note also that changing the operating system is not an option as I am not doing this for fun or hobby.


title: Change language to chinese (XeLaTeX, memoir, polyglossia)

text: I am writing a document, which is to be available in english, danish, german and chinese (so far). Changing between the first three languages is easily achieved; by substituting the desired language in the following two commands               \documentclass[english]{memoir}      and               \setdefaultlanguage{english}      references (tables, figures, ...), captions and headings (table of contents, bibliography, ...) are displayed in the correct language (I am using `cleveref` for references if that matters). Now the question is what to do to achieve the same result with chinese? Note, this question is **not** about how to type chinese in LaTeX, but about how to get the auto generated "text bits" translated into chinese. In addition, since I am using a great deal of the memoir functionality, changing the document class to ctexart is not an option. Is there any pretty solution available - or do a have to redefine the macros myself?


title: Insert second slide with Lyx and Beamer

text: I am trying to create a presentation in LyX using Beamer. I am using LyX 2.1.0. I created a new document, and selected `Document -> Settings -> Document Class -> Presentations -> Beamer`. Then, I tried to add a new slide using the LyX section selector. I selected `Frame`. This allowed me to create the first frame, give it a title, and write the content for the first frame. However, I can't work out how to insert the second frame. Or rather, I can't work out how to end the first frame which would then allow me to start the next frame. How do you create multiple Beamer slides in LyX 2.1.0?


title: How LaTeX compiler is written

text: Looking for some introductory materials on LaTeX compiler. I would like to know more about how a LaTeX compiler is built


title: How to quick enter the math mode delimiters ($ $) using WinEdt?

text: Just like `$6/8f=2/8f + 4/8f$`. Forgive my laziness, and I don't want to repeatedly enter the `$$`. So, is there any shortcut key or something that can help me type the `$$` immediately, or select the letter and just a click to change `AAA` to `$AAA$`.


title: Mathjax inline mode not rendering

text: In wordpress, I appended the Mathjax CDN to my header file. The inline equations do not render while the display-mode equations seem fine. An example: ![enter image description here](http://i.stack.imgur.com/IlTfh.png) I have experience with Mathjax on another CMS (Drupal) and never had such a problem, or even on Math.SE . The reason I do not post it on the wordpress forum is because I did not install any plugin, so this has nothing to do with wordpress I guess. Does anyone know why this is happening? For completeness, I appended the following script before the `</head>`               <script type="text/javascript"        src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">     </script>


title: Is there an overview of Beamer's slide (page) geometry anywhere?

text: I find this classic figure of LaTeX's page geometry very helpful: ![geometry](http://i.stack.imgur.com/hL92b.png) Source: http://commons.wikimedia.org/wiki/File:Latex_layout.svg Now, I am fiddling with some `beamer` slides and I could really use such an overview of `beamer`'s slide layout. Does it exist anywhere? I have not been able to find it... For now, I need it to figure out how to get the height of a frame's body.


title: KOMA-article: Page X of Y not showing in first page footer

text: (Warning: Question from newbie to LaTeX :-) Using koma-article in Org-mode, I want to show "X of Y" in the footer of all pages. I followed the instructions in this post, and it works fine for pages 2 and after, but the first page shows only "1" in the footer. I have the following:               #+TITLE: Title     #+AUTHOR: Author     #+DATE: Today     #+OPTIONS:   H:3 num:nil toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t     #+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc     #+LaTeX_CLASS: koma-article     #+LaTeX_HEADER: \usepackage{lastpage}     #+LaTeX_HEADER: \usepackage{scrpage2}     #+LaTeX_HEADER: \pagestyle{scrheadings}     #+LaTeX_HEADER: \cfoot{\thepage\ of \pageref{LastPage}}      Adding the following 2 lines to the above makes the footer on the first page to show "1 of Y" as wanted, but then the title and author is missing from the top of the first page (although the date still shows at the top):               #+LaTeX_HEADER: \maketitle     #+LaTeX_HEADER: \thispagestyle{scrheadings}      How do I show "1 of Y" on the first page while keeping the title and author format intact? Thank you in advance for any advice.


title: Listing index uses wrong dashes

text: When generating an index of all my Listings, the library seems to use the wrong dashes to connect words: _Expected_               Unported-2.0-Graphic      _Actual_               Unported—2.0—Graphic      In the title of the listings, I used the normal dash `-`, so it has to be somewhere in the library that the double dashes `--` are created. As this is not really a big issue, but totally wrong typography, I'd very much like to change it to the correct way. _MWE_               \documentclass[11pt,oneside,a4paper]{scrartcl}     \usepackage{listings}     \lstset{caption=\lstname}     \begin{document}     \lstlistoflistings     \begin{lstlisting}[name=Unported-2.0-Graphic]     \end{lstlisting}     \end{document}


title: Which books can I read via texdoc?

text: For years, I was faithfully downloading a copy of _TeX by Topic_ whenever I reinstalled my computer. Then I learnt about `texdoc texbytopic` and my life got just that smidgen easier. I've just returned from a foray in cyberspace where I wanted to learn about the `\mathpalette` command and found _TeX for the impatient_. One of the exotic fruits I found on that foray was Where can I find an online manual for low-level LaTeX commands? where Martin suggested `texdoc impatient`. On the basis that a book in `texdoc` is   1. free,   2. on my system, and   3. at least vaguely approved by the TeX community if I found myself at a loose end one evening and wanted to curl up with a good book on TeX, the ones in `texdoc` seem a good place to start. But knowing what is there is a difficult task, so I thought that a nice CW list would help us all find something to read on those long winter nights. I think that this is an obvious CW question (assuming it doesn't get closed) and one organised answer would be better than a load of disorganised ones. What would be useful information to have would be:   1. Name of book   2. `texdoc` invocation   3. Which main distributions is it in (TeXLive? MikTeX?)   4. Vague area of coverage As I intend this to be CW, we can build that up incrementally, so if you know of a book but don't know about distributions, list it and someone can test if it's in their distribution. One thing to be clear is that this is _not_ for individual packages, even if the documentation is more like a book than anything else.


title: Automatic line break in alignat

text: Consider the following example from http://tex.stackexchange.com/a/12782/4011               \documentclass{article}     \usepackage{amsmath}     \newcounter{eqn}     \renewcommand*{\theeqn}{\alph{eqn})}     \newcommand{\num}{\refstepcounter{eqn}\text{\theeqn}\quad}     \begin{document}     \begin{alignat*}{6}       \num&& x^2 + y^2 &= 1 \qquad& \num&& a + b &= c               &  \num&& r-x &= y+z \\       \num&\quad& f - y &= z      & \num&& a - b &= 2d         \qquad&  \num&& r+x &= 2y-3z     \end{alignat*}     \end{document}      ![output](http://i.stack.imgur.com/39nwB.png) Here one has (as usual) to specify where to break the line via `\\`. However is there a way to do the linebreak automatically, such that you give the space between the equations and `TeX` automatically decides how much equations fit (under the constraint of the given spaces) into the fullest row (say n) and breaks the lines so that you get n equations in each row alignet like in the example above.


title: Space and Position in Cover Letter Title

text: I attached my code for my cover letter of one job, and the picture of compiled pdf below. Can anyone help me accomplish the following things:   * How to make my `Name` show on the left with certain nice space above the `hline`?    * How to make my `address`, `email` and `phone number` show on the right with certain nice space below the `hline`?   * How to make certain nice vertical space between `phone number` and `date` I put there, because I feet like it is too jammed there.   * Any other modification or suggestion is also very welcome. For example, what about the `font` of the body paragraph? What about the `line space` between each line?   * Forgive me not put my real application here in `body paragraph`   * Just help me make this cover letter look nice and perhaps stylish. Thanks so much guys!                  \documentclass[11pt]{letter} % Default font size of the document, change to 10pt to fit more text              \usepackage{newcent} % Default font is the New Century Schoolbook PostScript font          %\usepackage{helvet} % Uncomment this (while commenting the above line) to use the Helvetica font              % Margins         \topmargin=-1in % Moves the top of the document 1 inch above the default         \textheight=8.5in % Total height of the text on the page before text goes on to the next page, this can be increased in a longer letter         \oddsidemargin=-10pt % Position of the left margin, can be negative or positive if you want more or less room         \textwidth=6.5in % Total width of the text, increase this if the left margin was decreased and vice-versa              \let\raggedleft\raggedright % Pushes the date (at the top) to the left, comment this line to have the date on the right              \begin{document}              %----------------------------------------------------------------------------------------         %   ADDRESSEE SECTION         %----------------------------------------------------------------------------------------              \begin{letter}{Jesse O'Dell and Eilene Powell \\         TOP Coordinators \\         Office of Instructional Development\\         70 Powell Library, Box 951515\\         Los Angeles, CA 90095-1515 }               %----------------------------------------------------------------------------------------         %   YOUR NAME & ADDRESS SECTION         %----------------------------------------------------------------------------------------              \begin{center}         \large\bf David Harris \\ % Your name         \vspace{20pt}          \hrule height 1pt % If you would like a horizontal line separating the name from the address, uncomment the line to the left of this text         Springfield 500 \\ Los Angeles, California 99999 \\ 111-111-1111 % Your address and phone number         \end{center}                    \signature{David Harris} % Your name for the signature at the bottom              %----------------------------------------------------------------------------------------         %   LETTER CONTENT SECTION         %----------------------------------------------------------------------------------------              \opening{Dear Coordinators Jesse O'Dell and Eilene Powell:}          As Livy states in The Rise of Rome about his purpose of writing history, “My wish is that each reader will pay the closest attention to the following: how men lived, what their moral principles were … then let him follow in his mind how, as discipline broke down bit by bit, morality at first foundered” (Livy, preface). Although Livy never steps forward to articulate the specific “moral principles” in the preface, he does, afterwards, demonstrate the “right” Roman values for Roman citizens to emulate, which especially focus on women’s gender roles. Indeed, by highlighting Lucretia’s dedication to her domestic duties and honoring her unhesitant suicide in the face of having been raped, Livy establishes a positive role model for Roman women, which dictates conjugal obligations and female chastity. \\\\         By awarding Lucretia universal praise for her diligent household service even at the absence of her husband, Livy promotes and justifies his feminine ideal that as men’s property women must fulfill their marital duties, such as staying at home and obeying their husbands. According to Collatia, “Though the evening was late, they found Lucretia still in the main hall of her home, bent over her spinning and surrounded by her maids as they worked by lamplight. Lucretia was the clear winner of the contest” (Livy, 1.57). The fact that it is not Lucretia but her male counterparts who judge her loyalty displays Livy’s objectification of women. Instead of granting women freedom to value themselves, men, in Livy’s opinion, should govern women’s daily lives and evaluate their morals based on male standards. Most notably, the word “clear” illustrates how the male judgment of wifely virtues applies to Lucretia; Collatia and his companions act collectively and unanimously to select Lucretia as the most virtuous woman among their wives. Furthermore, Livy’s emphasis on the young princes’ royal status solidifies his notion of conjugal duties. Since the upper-class men prefer women with affinity to household service and conformity to their husbands, the same principle probably applies to the lower-class males as well. By integrating his view of women’s duties into the whole society from his narrative of Lucretia, Livy successfully answers and justifies one part of his “moral principles”—martial obligation—which requires women to submit to their male counterparts. \\\\         By lauding the suicide of Lucretia and the subsequent overthrow of the monarchy, Livy identifies and reinforces another aspect of his female model—chastity. In the story, although Lucretia considers herself innocent of fault, she cannot “absolve herself from punishment” (Livy, 1.58). She claims, “Let no unchaste woman hereafter continue to live because of the precedent of Lucretia” (Livy, 1.58). The unavoidability of Lucretia’s death shows Livy’s ideal for women that purity takes precedence over any virtue. By glorifying Lucretia’s suicide as an honorable, heroic act, Livy further justifies the high value he places on women’s chastity. Moreover, Livy strengthens the notion of purity from his narrative about the destruction of Roman monarchy. Upon Lucretia’s collapse into his chest, Collatia vows, “By this blood, so pure before defilement by prince Tarquin, I hereby swear that I will drive out Lucius Tarquinius Superbus and all his progeny with sword, fire, and whatever force I can muster” (Livy, 1.58). Collatia’s vengeance for Lucretia’s unchaste body symbolizes men’s defense on women’s chastity. As a matter of fact, Livy aims at elevating female purity to such a high position that it deserves relentless protection from Roman citizens even at the cost of the collapse of government. In this way, Livy not only establishes, but also solidifies the seriousness of preserving female chastity.         \closing{Sincerely yours,}         \end{letter}         \end{document}      ![enter image description here](http://i.stack.imgur.com/Iyc1n.jpg)


title: background framed box with newenvironment "encadre"

text: I want to use a floating framed box that could be nicely placed in the text. `\fbox` needs to be placed by hand. I wrote this code which was exactly what I want to get...but with a floating object.               \documentclass[a4paper,12pt]{book}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[francais]{babel}     \usepackage{lipsum}     \usepackage{caption}     \usepackage[usenames,dvipsnames]{color}      \usepackage{framed}     \usepackage{hyperref}      \newcounter{encadre}     \newenvironment{encadre}     \refstepcounter{encadre}\vspace{0.2cm}\textsc{\bfseries encadré \theencadre\ :}}     {\par\vspace{0.2cm}}     \begin{document}     \lipsum     \fcolorbox{Black}{Gray}{     \begin{minipage}{\linewidth}        \begin{encadre}\label{enc:metamere}     blabla     \end{encadre}     \lipsum[10]     \end{minipage}     }     \end{document}      So I use framed (impossible to install `mdframed` on my LaTeX version of 2009 on Ubuntu 12.04) My question : Where must I define `\defineshadecolor` as it is said in the framed documentation? > framed doc p2 :"In fact, the “shaded” environment just redefines > `\FrameCommand` to be `\colorbox{shadecolor}` (and you have to define the > color “shadecolor”: `\definecolor{shadecolor}`...)." I tried to put it as an option or to write it like directly in the preamble, but it does not work. Here is the framed code, but without background.               \documentclass[a4paper,12pt]{book}     \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}     \usepackage[francais]{babel}     \usepackage{lipsum}     \usepackage{caption}     \usepackage{xcolor}     \usepackage{framed}     \usepackage{hyperref}          \newcounter{encadre}     \newenvironment{encadre} {\refstepcounter{encadre}     \vspace{0.3cm}\textsc{\bfseries encadré \theencadre\ :}}     {\par\vspace{0.3cm}}          \begin{document}      \lipsum [50]          \begin{framed}      \begin{encadre} test      \end{encadre}\label{enc}     \lipsum[15]     \end{framed}               l'encadré \ref{enc} est à la page \pageref{enc}           \lipsum      \end{document}