title: Animation on beamer

text: How to set this kind of animation on beamer? > show_me_first show_me_second. I'm trying to show this sentence as described. The `show_me_first` is showed first, and on click oon the Down button, it will shows the `show_me_second`. How to deal with this, please? Thanks a lot!


title: Compilation error when including enumitem and paralist packages

text: I encounter an error when I compile a LaTeX document which includes both the `enumitem` and the `paralist` packages. Here is my MWE code:               \documentclass{article}          \usepackage{enumitem}     \usepackage{paralist}          \begin{document}          \begin{tabular}{lp{10cm}}     \scshape Assume: & \begin{compactenum}     \item $(p_1, p_2)$ is an optimal price sequence     \item $p_2 > p_1 > 0$     \end{enum}     \\     \scshape Prove: & False     \end{tabular}               \begin{enumerate}[label=\bfseries Case \arabic*:,leftmargin=*]     \item     It rains today.     \item     It does not rain today.     \end{enumerate}          \end{document}      How do I fix the error? Is there a way to define my own `compactenum` using `enumitem` so I don't need to include the `paralist` package?


title: To develop part command in sectioning

text: I want to change Conzalo's command little (How to reset a section counter) by removing the representation of Part [number] in the document:               \usepackage{xpatch}     \makeatletter     \@addtoreset{section}{part}     \xpatchcmd{\@part}{\normalfont}{\normalfont\centering}{}{}     \xpatchcmd{\@part}{\Large}{\LARGE}{}{}     \renewcommand     % \partname{Topic}     \makeatother      I use the part command for Lectures, Practicals, Master Topics. My table of contents ![enter image description here](http://i.stack.imgur.com/XN6VE.png) and my document ![enter image description here](http://i.stack.imgur.com/SkSZi.png) I do not really understand the command because disabling these two lines do nothing:               % \xpatchcmd{\@part}{\normalfont}{\normalfont\centering}{}{}     % \xpatchcmd{\@part}{\Large}{\LARGE}{}{}      I want to remove the representation of Part and number. **How can you remove the representation of the Part headings every time you use part?**


title: Problems with pgfkeys

text: I'm trying to use pgfkeys to define commands with custom parameters, but I can't even get the example in pgfmanual to run:               \documentclass{article}     \usepackage{pgfkeys}     \begin{document}         \pgfkeys{/my key=hallo,/your keys/main key=something\strange,key name without path=something else}     \end{document}          ! Package pgfkeys Error: I do not know the key '/my key', to which you passed '     hallo', and I am going to ignore it. Perhaps you misspelled it.          See the pgfkeys package documentation for explanation.     Type  H <return>  for immediate help.     ...                                                        l.4 ...range,key name without path=something else}               ! Package pgfkeys Error: I do not know the key '/your keys/main key', to which      you passed 'something\strange ', and I am going to ignore it. Perhaps you missp     elled it.          See the pgfkeys package documentation for explanation.     Type  H <return>  for immediate help.     ...                                                        l.4 ...range,key name without path=something else}               ! Package pgfkeys Error: I do not know the key '/key name without path', to whi     ch you passed 'something else', and I am going to ignore it. Perhaps you misspe     lled it.          See the pgfkeys package documentation for explanation.     Type  H <return>  for immediate help      What's wrong here? How can I set keys? I tried it both with PGF 2.10 and 3.0 on Centos. Edit: I forgot to say that I did get the second example to work:                   \pgfkeys{/my key/.code=The value is ’#1’.}         \pgfkeys{/my key=hi!}      But that is more than I want. The pgfmanual says "Typically (but not necessarily) some code is associated with a key." I don't want to add any code, I just want to set the keys and read them later. I suspect that something else is going wrong here.


title: Political map in LaTeX

text: Is there a package that can be used to make political maps in LaTeX? Like a world map or a map of Europe?


title: How to number slides in the beamer theme Hannover ?

text: I used the package `beamer outer theme split numbered` to make it for themes with navigation. But the theme `Hannover` is different. Is re-defining the footline the only choice, or is there some other convenient way? Update: the solutions like               \useoutertheme{infolines}      or               \setbeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}      can both do the job, but not so grace as I expect. Both of them will ruin the layout of Hannover. It is better to put the page number on the bottom of the left column, or at the left side of the navigation row.


title: How to change looks of margin notes using memoir?

text: I have spent some time now trying to figure out how to change the looks of the margin notes produced by the memoir class. I would like to try ragged right and ragged left in italics (so they align with the magin on each page) but I can't even begin to effect the looks of them even a little. Page 250 of the memoir documentation has made me believe the following example code should change the look of them but no such luck:               \documentclass{memoir}          \newcommand*{\sideparform}{\raggedleft}     \newcommand*{\sideparfont}{\itshape}          \begin{document}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris hendrerit     justo vel lorem eleifend id porttitor nunc dictum. Aenean ut iaculis sem.     Fusce urna augue, sagittis a dignissim at, lobortis eget purus. Duis     pellentesque commodo enim. Maecenas nec mi sed sapien iaculis congue. Proin     ut justo erat. Etiam tincidunt ornare sagittis. Suspendisse potenti.     Vivamus metus nisl, malesuada eu dignissim ac, congue eu arcu. Praesent ac     mollis nisl. Integer pulvinar dui vel sem viverra hendrerit. Donec non quam     leo. Cras metus leo, malesuada nec fermentum ut, aliquam id mi. Integer sit     amet semper nibh. Integer dictum volutpat nisi, nec luctus arcu vulputate     blandit. Sed tristique scelerisque mi id auctor. Vestibulum ac sem elit.     Pellentesque venenatis imperdiet turpis eu suscipit.          \marginpar{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}     Aliquam lectus nisl, mattis at adipiscing nec, semper sit amet risus. In     ultrices eros vel ligula bibendum pretium. Ut quis purus tempus turpis     facilisis varius sit amet vitae arcu. Cum sociis natoque penatibus et     magnis dis parturient montes, nascetur ridiculus mus. Donec nibh libero,     interdum sit amet ultricies pretium, vulputate sit amet odio. Nunc quam     nisi, lacinia ac pulvinar et, fermentum quis enim. Suspendisse eu blandit     lectus. Nulla neque urna, molestie ut faucibus et, suscipit porta metus. In     hac habitasse platea dictumst. Maecenas orci ligula, mattis eu malesuada     ut, hendrerit a sem. Maecenas venenatis dapibus massa quis tempor.     Vestibulum lobortis mattis mi, at molestie sem accumsan vitae.          \end{document}      Clearly I am doing something wrong, and it's probably going to be emberassing to find out, but please, what is it? :) > EDIT > > Based on the answer by Seamus I came up with this: >   >   >     \newcommand\mymarginpar[1]{ >     \marginpar{\flushright \checkoddpage >                   \ifoddpage \flushleft \fi >                \textit{#1}}} >   > > I am not happy with this though. It feels complicated... Do I really have to > create my own \mymarginpar?


title: catcodes vs. autonum

text: I'm trying to make certain equations with large amounts of special characters more readable by playing with catcodes. This works:               \documentclass[12pt]{book}          \begin{document}          $$     \catcode`X\active     \defX{\times}     X     $$          \begin{equation}     \catcode`X\active     \defX{\times}     X     \end{equation}          \[     \catcode`X\active     \defX{\times}     X     \]          \end{document}      But when I `\usepackage{autonum}`, the third option (`\\[\\]`) breaks with "Undefined control sequence". Is there a way around this other that always going for the second option? [MiKTeX 1/31/2014] EDIT: in the actual document, I am switching catcodes only for specific parts of equations by using custom environments inside the latter. So while redefining catcodes outside an equation could be made to work, this question is more about how to do this without turning equations inside out.


title: How can I open an online .pdf to a specific page from a LaTeX generate .pdf from footnote?

text: I'm try to open a .pdf to a specific page from my pdf generate using pdflatex, this is a valid `url`that do what I want in my browser: http://www.icomos.org/charters/venice_e.pdf#page=4 `#page=4` indicate the page I want to open, but it seems that when I use it in a `\footnote`doesn't work:               \footnote{\url{http://www.icomos.org/charters/venice_e.pdf#page=4}}      In my LaTeX document, doesn't work I've got this error: `Illegal parameter number in definition of \Hy@tempa.<to be read again>p ....icomos.org/charters/venice_e.pdf#page=4}}` Caused by `#page=4`. This is a MWE:               \documentclass[12pt,a4paper]{book}     \usepackage{hyperref}     \begin{document}     words words words \footnote{\url{http://www.icomos.org/charters/venice_e.pdf#page=4}}     \end{document}      How can I solve the problem?


title: Test success of write18

text: For the new version of my package and class `standalone` I like to call external programs: further `(pdf)latex` runs to optionally compile included `standalone` files, and to convert the resulting PDF to PNG (depends on the fact that the PDF created by the last run isn't overwritten at least until `\begin{document}` or until the first page is flushed out). I know of course this can be done using `\immediate\write18{<command> <arguments>}` which requires the command to be either added to the `shell_escape_commands` variable of `texmf.cnf` and `shell_escape` to be set to `p` or that the user uses the `-shell-escape` argument. Now I like to test in my code if the `write18` call was successfully, i.e. if it was allowed to be executed. I know that `\ifeof18` will return _false_ if the `write18` feature is _completely_ disabled (`shell_escape = 0` in `texmf.cnf` or when the `-no-shell-escape` argument is used), but it returns _true_ if the _restricted_ `write18` mode is activated which is the default. Is there a way to test if the last write18 call was blocked? (I know that I can test manually if the file which should be produced by the `write18` call was created or updated.) * * * ### Update In the `.log` file there its one of the following lines displayed for every write18 call, depending if this feature is disabled, enabled or running in restricted mode with the command allowed or not, respectively:               runsystem(<command>)...disabled.     runsystem(<command>)...executed.     runsystem(<command>)...executed safely (allowed).     runsystem(<command>)...disabled (restricted).      So how can I get this information inside the LaTeX file (without actually reading the `.log` file in)?


title: bottomrule not working in a self-made environment

text: I have this environment for consistent tables in my LaTeX documents:               \newenvironment{defaultTable}[2] {      \@float{table}[h]      \noindent      \tabularx{\textwidth}{#1}      \specialrule{0.5pt}{10pt}{0pt}      \rowcolor[gray]{.9}      \gdef\mycaption{#2}     } {      \bottomrule      \endtabularx      \emph{\caption{\mycaption}}      \end@float     }      Unfortunately, the line with `\bottomrule` leads to this error, which i don't understand:               ! Misplaced \noalign. \bottomrule     ->\noalign                     {\ifnum 0=`}\fi \@aboverulesep =\aboverulesep     \global... l.27 \end{defaultTable}      When I use it inside the environment it works though               \begin{defaultTable}{X X}{Blablah Table}     (..)     \bottomrule     \end{defaultTable}      What am I doing wrong?


title: How to use tikz-timing together with the external library

text: I would like to generate a tikz-timing signal in my LaTeX document and to save it, using external library as pdf file. Here is an example of a combine code:               \documentclass[border=5pt]{scrbook}     \usepackage{tikz-timing}     \usetikzlibrary{external}     \tikzexternalize[       figure list=true,       prefix=./]     \usetikztiminglibrary{nicetabs} % a bit strange with \Huge; use belowrulesep to adjust          \begin{document}      \begin{figure}       \begin{tikztimingtable}        & 4L      \\         & 4H      \\         & 2LCH    \\         & [C]CCCC \\        & 2{2C}   \\        \extracode        \tablegrid[black!25,step=1]       \end{tikztimingtable}      \end{figure}     \end{document}      the error that i get is:               Opening 'test.figlist' for writing.     **Writing './signal1' to 'test.figlist'.     )     Runaway argument?      \par      ! File ended while scanning use of \tikzexternal@laTeX@collect@until@end@tikzpi     cture.     <inserted text>


title: How to get an exponent hat

text: I would like to use a hat in exponent for a notation, and I have found no satisfactory way of doing this. If I go for `$f^{\hat{\null}}$`, the hat is far too high, while `$f^\wedge$` gives to big and too acute a hat. I would like to have the regular hat, but placed in exponent just as if it where usually drawn in the center of the line, not on the top. Any idea? **Precision:** I seek a symbol that I could use quite like `\wedge`, in the sense that I should be able to write `$f^\solution$` and more importantly `$f_x^\solution$` with the hat and the index aligned correctly. A solution that would need to rewrite all my $f^\wedge$ in a slightly different way but would give good alignment without too much twiddling would already be good. **Additional precision:** I also have to deal with double anitderivatives, so I need to be able to have the equivalent of $f^{\wedge\wedge}$, with both hats on level. The really best solution would be to extract the symbol used by \hat, without the surrounding command (i.e., the command that puts this symbol on top of the next letter).


title: Sectioning bibliography by type (with multiple types per section)

text: I would like to distinguish books from articles, manuals, etc. This can be done by using:               \printbibliography[heading=subbibliography,title={Book References},type=book]      or               \printbibliography[heading=subbibliography,title={Other References},nottype=book,nottype=manual]      Multiple 'nottype' can be entered to restrict the types of a certain subsection. But: I would like to 'whitelist' instead of 'backlist' my types, e.g.:               \printbibliography[heading=subbibliography,title={Articles, Proceedings},type={article,inproceedings}]      However, this does not seem to work (using multiple type identifiers does not work either). I checked the manual and could not find how this may work out. Can this be done without using custom extra keys?


title: Single entry in list of tables using datatool + longtable

text: I'm using the `\DTLdisplaylongdb` from `datatool` in order to create a multi- page table with `longtable`. How do I provide a caption that only shows up once in the list of tables? (Right now it's showing an entry for every page of the table.)


title: longtable spanning textwidth

text: > **Possible Duplicate:**   >  How to fit landscape multi-page table to textwidth I am trying to fit a `longtable` in a page with the following specifications:               \documentclass{article}     \usepackage[letterpaper]{geometry}     \geometry{tmargin=2cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.7cm}     \usepackage{array}     \usepackage{longtable}     \begin{document}     \begin{longtable}{|c|>{\raggedright}p{4.5in}|p{0.85in}|}     \hline     \textbf{Week} & \textbf{Content} & \textbf{Assessments}\tabularnewline     \hline     \endfirsthead     \hline     \hline     \textbf{Week} & \textbf{Content} & \textbf{Assessments}\tabularnewline     \hline     \hline     \endhead     \hline     Week 1 & Unit 1     &HW, Q, T\tabularnewline     \hline     Week 2 & Unit 2     &HW, Q, T\tabularnewline     \hline     \end{longtable}     \end{document}      Note that to the naked eye, the table seems to be perfect, but I know that one can make the long table to span through the entire text width. I am looking for improvements and how to achieve the above effect (use of the text width.) If a similar question has been asked please redirect me.


title: Resize longtable to width of landscape page

text: \documentclass[a4paper,12pt]{article}          \usepackage{longtable}     \usepackage{pdflscape}     \usepackage{graphicx}          \begin{document}     \begin{landscape}     % \resizebox{\textwidth}{!}{  }     \begin{longtable}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! & A & very & wide & and & long & table & here & ! \\     \hline     \end{longtable}     \end{landscape}     \end{document}      I want to use something like \resizebox{\textwidth}{!} to shrink the longtable to the width of the page. It should scale the table as a whole and not just padding/margin of the cells.


title: Indented longtable

text: My ltxtable is indentated on both sides and I don't want the indents. My MWE is:               \documentclass{scrreprt}     \usepackage[latin1]{inputenc}     \usepackage[ngerman]{babel}     \usepackage{ltxtable, filecontents}     \begin{document}               \begin{filecontents}{longtable.tex}     \noindent     \begin{longtable}{|X|m{20ex}|m{5ex}m{5ex}|}     \hline     \textbf{Verlaufstyp} & \parbox{16ex}{\textbf{ergänzende Beschreibung}} & \multicolumn{2}{c|}{\textbf{Probanden}} \\     \hline     \hline     \endhead     1.\,monophasisch zur Vollremission & 17,2 Monaten Dauer & 50 \newline 10 &  10,0\,\% \newline 2\,\% \\     \hline     \end{longtable}     \end{filecontents}     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo     \LTXtable{\textwidth}{longtable.tex}          \end{document}      ![example with indentation](http://i.stack.imgur.com/jggmj.png)


title: Define a custom command with name, label and linkable

text: I'd like to create a command with the following features:               \newcommand{\mycom}[2]{...}     \newcommand{\linktomycom}[1]{...}      In the doc body:               \mycom{firstitem}{This is the first item}      and later:               \linktomycom{firstitem}      Which would be equivalent to:               \hyperref[firstitem]{This is the first item}      and link to the position where I wrote `\mycom`. ... I played around with phantomsec, but it seems to miss a naming feature. Thanks for any hint.


title: Scaling tikz-cd labels

text: I'd like to scale a custom symbol drawn in `tikz`, such that it's the same size as surrounding text in a `tikz-cd` diagram. For example, in the following code I'd like the box to the left of `A_2` to be proportionally the same as the box to the left of `A_1`: currently it's the boxes are the same size, even though `A_2` is smaller than `A_1`.               \documentclass{standalone}     \usepackage{tikz-cd}          \newcommand{\boxL}{%       \tikz[baseline=0em,xscale=0.02em,yscale=0.02em]       \fill (1,0) -- (0,0) -- (0,1) -- (1,1) -- cycle;\mspace{1mu}}          \begin{document}     \begin{tikzcd}     {\boxL A_1} \rar{\boxL A_2} & A_3     \end{tikzcd}     \end{document}      ![enter image description here](http://i.stack.imgur.com/cWX7M.png) Here, `tikz-cd` uses `\scriptstyle` for labels, which is good, but the box in the label isn't getting scaled properly. For the record, this can be fixed if the equation is replaced with:               {\boxL A_1} \rar{\scriptsize\boxL A_2} & A_3      This results in the following picture: ![enter image description here](http://i.stack.imgur.com/ZRWaL.png) However, I don't want to have to add `\scriptsize` explicitly everywhere.


title: Reset pgfkey to default value in nested command call

text: I have created a new command whose argument can be a new call to the same command. How can I then reset the values of the pgfkeys in the nested call to their default values, so that they don't have the values that were set in the first call of the command? Specifically, the width of the overlaid image becomes 2cm instead of 6cm, which is the default, because the width was set to 2cm in the parent command call. I know I could use `\pgfkeys{/icon/.cd,overlay,width,#1)` to reset `\width`, but then it becomes empty, and not the default value.               \documentclass{article}     \usepackage{tikz}     \usepackage{etoolbox}     \usepackage{overpic}          \pgfkeys{         /icon/.cd,         width/.store in = \width,         width/.default = ,         overlay/.store in = \overlay,         overlay/.default = ,         width,overlay,     }          \newcommand\icondefaults[1]{%         \pgfkeys{/icon/.cd,#1}%         \pgfkeys{             width/.default = \width,         }%     }     \newcommand{\icon}[2][]{%         {%             \pgfkeys{/icon/.cd,overlay,#1}% "overlay" to prevent infinite loop of overlays             \def\options{}%             \ifdefvoid{\width}{}{\edef\options{width=\width,\options}}%             \ifdefvoid{\overlay}{%                 \edef\graphic{\noexpand\includegraphics[\options]{#2}}%             }{%                 \edef\temp{\noexpand\begin{overpic}[\options]{#2}}%                 \def\graphic{\temp\put(0,0){\overlay}\end{overpic}}%             }%             \graphic%         }%     }%          \begin{document}          \icondefaults{width=6cm}     \icon{example-image} % Image gets default width 6cm     \icon[width=2cm,overlay={\icon{example-image-overlay}}]{example-image} % Image gets width 2cm, but the overlaid image also gets width 2cm     \icon{example-image} % Image gets default width 6cm          \end{document}      By the way, sorry for all the `%`. I haven't understood when they are need and not yet.


title: Why does \jobname give asterisks/stars instead of spaces, and how do I fix this?

text: When I LaTeX a file named `test 1.tex` with the code `\edef\temp{\jobname.txt}\show\temp`, I get               > \temp=macro:     ->test*1.txt.      This seems to work fine with LaTeX's internal commands, but if I then mix this with `\write18`, it fails.   For example, something like               \newwrite\tempwrite     \immediate\openout\tempwrite\temp\relax     \immediate\write\tempwrite{test}     \immediate\closeout\tempwrite     \immediate\write18{rm "\temp"}      How can I get a version of `\jobname` that actually uses spaces instead of the asterisks? (Can I do something fancy with catcodes to make `\write18` transform asterisks into spaces?)


title: Nested subequations --> Following equations get wrong numbers

text: In a document, I use the subequations environment inside another subequations environment - to e.g. have equations numbered as (1a), (1b), (1ca), (1cb), (1d) etc. At an overall level, all the equations belong together, hence they all have number (1), and furthermore, at a nested level, the two (1c) equations belong together, hence (1ca) and (1cb). This all works fine, but the equations that then follow - which should be (2), (3) etc. - get different numbers. In the example below, the last equation outside all of the subequations should be number (2), but when I compile it it gets number (5). I suppose there is some conflict causing the wrong numbering, but could anyone tell me how I obtain the correct numbering? The code is as follows:               \documentclass[10pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \begin{document}     \section{Section}     \begin{subequations}     These equations are numbered as subequations:     \begin{align}     F &= m a \\     p & = mv     \end{align}     These equations are also numbered as subequations, and they are numbered correctly:     % % %     \begin{subequations}     \begin{align}     F &= m a \\     p & = mv     \end{align}     \end{subequations}     \begin{subequations}     \begin{align}     F &= m a \\     p & = mv     \end{align}     \end{subequations}     \end{subequations}     But the next equation is then not numbered correctly; It should have number (2):     \begin{align}     F &= ma     \end{align}          \end{document}


title: Macros for hiding empty sections do not work properly

text: In an attempt to make it possible to outline much of my document by adding new parts to it, but without making parts that I have not written anything on show up in the compiled document, I have defined five macros based on a macro from Hiding section titles when the section is empty:               \newcommand{\showpart}[2]{%         \ifstrequal{ #2}{ }{}{\part{#1} #2}%     }     \newcommand{\showchapter}[2]{%         \ifstrequal{ #2}{ }{}{\chapter{#1} #2}%     }     \newcommand{\showsection}[2]{%         \ifstrequal{ #2}{ }{}{\section{#1} #2}%     }     \newcommand{\showsubsection}[2]{%         \ifstrequal{ #2}{ }{}{\subsection{#1} #2}%     }     \newcommand{\showsubsubsection}[2]{%         \ifstrequal{ #2}{ }{}{\subsubsection{#1} #2}%     }      and now I'm using them all over my source file instead of the normal `\part`, `\chapter`, `\section`, `\subsection` and `\subsubsection`. I've also added `\usepackage{etoolbox}` in the preamble in order to get the `ifstrequal` macro. However, all the parts that I have not started to write anything on still show up in the compiled document. What am I doing wrong?


title: TikZ - game tree representation with continuum of moves

text: I have been using TikZ to draw game-trees for my game-theory lectures (mostly using the automata package) but I could not figure out how to draw an arc across the edges the leave a given node. When we want to denote that a player has a continuum of actions available at a node, we usually draw an arc across the edge leaving such node. For example see the arc crossing the edges that leave the first node in this picture: ![enter image description here](http://i.stack.imgur.com/YIn6Q.gif) Any suggestions on how I could try to implement this in TikZ? Thanks!


title: Index for part of document

text: I have a document with hundreds of `\index` entries. I'm trying to generate the index for some part of the document. The best I could come up with is to disable the `\index` command temporarily. I did it like this:               \let\origindex\index     \newcommand\indexoff{\renewcommand\index[2][]{}}     \newcommand\indexon{\let\index\origindex}      I use it like this to generate the index of, say, chapter 2 only:               \indexoff     \include{chapter1}     \indexon     \include{chapter2}     \indexoff     \include{chapter3}      Is there a better or cleaner way? (My experience with this sort of macros is rather limited. I'm not even sure what `\let` does exactly.)


title: A new environment based on enumerate

text: I have defined the following simple environment:               \newenvironment{renumerate}{\begin{enumerate}\raggedright}{\end{enumerate}}      I wonder how the above can be modified to use with, say, the following:               \begin{renumerate}[label=\color{blue}10.\theenumi]     \item blah     \item blah     \end{renumerate}      The options given in `[]` are not known in advance.


title: Table of contents: Dots and title

text: * I want to remove the dots of the table of content (toc), so i used:              \makeatletter \renewcommand{\@dotsep}{10000} \makeatother      but it doesn’t work…   * How can I remove the title (name) of the toc? I’m using `memoir` class and XeLaTeX.


title: Sudoku - Special styles for hints

text: In the following code, I would like to use one style so as to color background for each hint, and not all the hints, and I would also like to put each single hint in a rounded rectangle. This is to illustrate what the players call "chain-rules".               \documentclass{article}         \usepackage{tikz}         \usetikzlibrary{backgrounds}         \usepackage{graphicx}          % Some customizable styles         \tikzset {             highlight/.style = {                 yellow,                 opacity = 0.3             },             digit/.style = {                 minimum height = 5mm,                 minimum width = 5mm,                 anchor = center             },             circle/.style = {                 draw = green!80!black,                 dotted,                 very thick             },             circle number/.style = {                 draw = #1,                 very thick             },             cross/.style = {                 red,                 opacity = .5,                 shorten >= 1mm,                 shorten <= 1mm,                 very thick,                 line cap = round             },             hint/.style = {                 blue,                 font = \sf,                 minimum width = 3mm,                 minimum height = 3mm             }         }          % Modified the \node to give a unique name to each one, which is the     % row number, a dash and the column number. E.g: 1-1, 4-5, etc.         \newcounter{row}         \newcounter{col}              \newcommand\setrow[9]{             \setcounter{col}{1}             \foreach \n in {#1, #2, #3, #4, #5, #6, #7, #8, #9} {                 \edef\x{\value{col} - 0.5}                 \edef\y{9.5 - \value{row}}                 \node[digit,name={\arabic{row}-\arabic{col}}] at (\x, \y) {\n};                 \stepcounter{col}             }             \stepcounter{row}         }          % New code -------------------------------------------------------------         \def\highlightcell#1#2{             \begin{scope}[on background layer]                 \fill[highlight] (#1-#2.north west) rectangle (#1-#2.south east);             \end{scope}         }              \def\circlecell#1#2{             \draw[circle] (#1-#2) circle(4mm);         }              \def\crosscell#1#2{             \draw[cross] (#1-#2.north west) -- (#1-#2.south east);             \draw[cross] (#1-#2.north east) -- (#1-#2.south west);         }              \def\highlightrow#1{             \begin{scope}[on background layer]                 \fill[highlight] (#1-1.north west) rectangle (#1-9.south east);             \end{scope}         }              \def\highlighcolumn#1{             \begin{scope}[on background layer]                 \fill[highlight] (1-#1.north west) rectangle (9-#1.south east);             \end{scope}         }              \def\highlightrectangle#1#2#3#4{             \begin{scope}[on background layer]                 \fill[highlight] (#1-#2.north west) rectangle (#3-#4.south east);             \end{scope}         }              \def\hintcell#1#2#3{             \node at (#1-#2) {\hintbox{#3}};         }               % Command to circle numbers:     % #1: optional -> circle color     % #2: mandatory -> cell identifier     % #3: mandatory -> name of the cell         \newcommand\circlenumber[3][red!80!black]{             \draw[circle number=#1, radius=5mm] (#2) circle node[outer sep=1mm] (#3){};         }          % UGLY code. Do not read :-)         \def\hintbox#1{             \resizebox{4.5mm}{4.5mm}{%                 \tikz[scale=0.3]{%                     \def\auxc{0}                     \foreach \m in {1,...,9} {                         \pgfmathparse{mod(\auxc,3)}                         \xdef\x{\pgfmathresult}                         \pgfmathparse{-floor(\auxc/3)}                         \xdef\y{\pgfmathresult}                         \xdef\hintprinted{0}                         \foreach \n in {#1} {                             \ifnum\n=\m                                 \node[hint] at (\x,\y) {\n};                                 \xdef\hintprinted{1}                             \fi                         }                         \ifnum\hintprinted=0                             \node[hint, opacity=0.1] at (\x,\y) {\m};                         \fi                         \pgfmathparse{\auxc+1}                         \xdef\auxc{\pgfmathresult}                     }                 }%             }         }               \begin{document}          \begin{tikzpicture}[scale=.5]         \begin{scope}             \draw (0, 0) grid (9, 9);             \draw[very thick, scale=3] (0, 0) grid (3, 3);                  \setcounter{row}{1}             \setrow { }{2}{ }  {5}{ }{1}  { }{9}{ }             \setrow {8}{ }{ }  {2}{ }{3}  { }{ }{6}             \setrow { }{3}{ }  { }{6}{ }  { }{7}{ }                  \setrow { }{ }{1}  { }{ }{ }  {6}{ }{ }             \setrow {5}{4}{ }  { }{ }{ }  { }{1}{9}             \setrow { }{ }{2}  { }{ }{ }  {7}{ }{ }                  \setrow { }{9}{ }  { }{3}{ }  { }{8}{ }             \setrow {2}{ }{ }  {8}{ }{4}  { }{ }{7}             \setrow { }{1}{ }  {9}{ }{7}  { }{6}{ }                  \hintcell{5}{5}{2,7,8}             \hintcell{1}{1}{3,4,6,7}              \end{scope}     \end{tikzpicture}          \end{document}


title: Adding a 'bridge' or link between two rows in a table

text: I'm making a report and I've been asked to do something which I have no idea is even possible or not. I have this table:               \begin{table}     \begin{center}     \caption{Cryostat-In Pin Outs and Resistances}     \label{cryoin}     \begin{tabular}{ccc}     \hline     \aline     ~ Pin & Device & Resistance \\     \hline     \hline     A & Thermometer & NA\\     B & Thermometer & NA\\     C & Detector & 24.3$\Omega$\\     D & Detector & 25.3$\Omega$\\     E & Detector & 24.4$\Omega$\\     F & Detector & 25.3$\Omega$\\     G & Resistor & 25.6$\Omega$\\     H & Resistor & 25.6$\Omega$\\     J & Resistor & 25.6$\Omega$\\     K & Resistor & 25.6$\Omega$\\     \hline     \end{tabular}     \end{center}     \end{table}      However, I am attempting to show which pins are connected together by a pair of wires, via putting a "[" symbol or something similar between two rows (e.g. between C and D) to the left of the table/letters themselves, such that the ends of the symbol are pointing to both the letters (and the symbol isn't simply suspended between them). In case my description is unclear, I basically wanted to do this (sorry for the blur): ![enter image description here](http://i.stack.imgur.com/XOpMS.jpg)


title: Combination of siunitx and light weight font fails to compile ...?

text: ## Question I am trying to use the package `siunitx` in combination with the Opensans Light font. To make `siunitx` detect the font weight, I pass `\sisetup{detect- weight}`. However, the document fails to compile. Can anyone reproduce this behavior? Is there a workaround? Thank you! ## Minimal example               \documentclass{minimal}          \usepackage[default]{opensans}     \usepackage{siunitx}     \sisetup{detect-weight}          \begin{document}          \fontseries{l}\selectfont This is quite light: \SI{1}{\milli\gram}          \end{document}      ## Edit 1 To clarify: replacing `\fontseries{l}` with `\fontseries{m}` or `\fontseries{b}` works as expected


title: "Automatic" section labeling?

text: I would like to be able to link within a document to another section without having to explicitly put a label after that other section command. `hyperref` does this with the TOC labels, so I think that this isn't an insane desire or anything. I've got a very large document that I'm converting to LaTeX (1100 pages) and much of the conversion has been automated in terms of `\section`, `\subsection`, and `\subsubsection` declarations. But I also need to be able to link to other sections based on their name. As an example, the text (a game's rulebook) will refer to rules written in another section such as: > Creatures immune to acid's caustic properties might still drown in it if > they are totally immersed (see Drowning). and then "(see Drowning)" should have the word Drowning be a link to the section (or subsection) titled Drowning. It's not always clear which other parts will be sections or subsections as I'm going through and adding links (because of the size of the work, I can't remember all of it all the time), so I'd like sections, subsections, and subsubsections to all have the same "prefix" on their label, 'sec:' Right now I have a command               \newcommand{\skillentry}[2]{\subsection[#1]{#1 #2}\index{#1}\label{skill:#1}}      and then an associated command               \newcommand{\linkskill}[1]{\hyperref[skill:#1]{#1}}      Given that no two sections, subsections, or subsubsections will ever have duplicate names, and also that a whole lot of the document is already written so that I don't want to just use a custom command, It _seems like_ the logical solution would be to redefine `\@makesectionhead` so that it includes               \label{sec:#1}      inside the `\section`, `\subsection`, and `\subsubsection` command definitions (with `#1` here being the name of the section to be created), and a custom shortcut command such as:               \newcommand{\linksec}[1]{\hyperref[sec:#1]{#1}}      then in the appropriate places I just write `(see`\linksec{Drowning}`)` and things all connect up properly. Stop me now if this sounds crazy so far. The catch is that I don't know what the `\section` command is actually doing. I do have a custom chapter appearance which involves altering `\@makechapterhead`, so I assume that to change how sections work it would be `\@makesectionhead`, but I don't know what the default definition of `\@makesectionhead` is and I can't seem to find it with a google search (probably because I don't know what to search for). **So the question is:** What do I write to redefine `\section`, `\subsection`, and `\subsubsection` so that they contain labels as above, but without altering their appearance or anything like that. I'm using the Memoir class if it's relevant (which I think it is). I'm also not using any custom appearance for any of the sectioning commands (though I am for `\chapter`), because I like the default appearance of them just fine.


title: How to cross-reference inside of a verbatim (or listings) environment

text: I would like to reference other parts of my document (e.g. equations, figures) inside of some source code. Is there an escape sequence such that `\ref` will be parsed instead of printed as a literal \ref? My minimal example is as follows:               \documentclass{article}          \usepackage{amsmath}     \usepackage{listings}          \begin{document}     This is the pythagorean theorem:     \begin{equation}\label{eq:pyth}     a^2+b^2=c^2     \end{equation}          I can reference it normally: Equation \ref{eq:pyth}.          I can write a code example that won't work:     \begin{verbatim}     # An R function to solve for c.     # See Equation \ref{eq:pyth} for details.     solve.for.c <- function(a,b){       return( sqrt(a^2 + b^2))     }     \end{verbatim}          And one that works, but is very ugly and hard to maintain: \\     \verb@# An R function to solve for c.@ \\     \verb@# See Equation@ \ref{eq:pyth} \verb@for details.@ \\     \verb@solve.for.c <- function(a,b){@ \\     \verb@solve  return( sqrt(a^2 + b^2))@ \\     \verb@}@ \\          How can I do this better?     \end{document}      Any thoughts on how to do this better? Is there a simple feature I'm missing?


title: Macro Improvements

text: I am looking to simplify and improve on the code below:               \documentclass{article}     \usepackage{filecontents}     \begin{filecontents}{test.txt}     a an and the this by on of     \end{filecontents}          \begin{document}     \makeatletter          \in@false     \def\upfirst#1#2\upfirst{%        \in@{#1#2}{a and of that this}%        \ifin@{\LARGE#1#2}\else {\Huge\MakeUppercase#1}{\LARGE#2 }\fi     }          \def\smallcaps#1\upfirst{\textsc{#1} }          \def\boldfirst#1#2\upfirst{\textbf{\uppercase{#1}}#2 }          \def\everytoken#1#2{%     \def\everytoken@##1{%        \@tempcntb=0        \@tfor \i :=##1  \do{\expandafter#2\i\upfirst          }}     \everytoken@{#1}%     }          \everytoken {{the} {battle} {and} {the} {resistance} {of} {france}}{\upfirst}          \everytoken {{Life} {death} {and} {the} {Universe}}{\smallcaps}          \everytoken {{The} {battle} {and} {the} {Resistance} }{\boldfirst}          \makeatother     \end{document}      What the code does it styles titles, by upper casing the first letter (if the word is not in a bag of reserved words) or styles in smallcaps or bolds and uppercases the first letter. ![enter image description here](http://i.stack.imgur.com/CQv2u.jpg) I am looking for improvements in the interface (currently the title words must be enclosed in braces) and for ways to input a file with the reserved words rather than just typing them in. (See the code around `in@`.


title: Helvetica neue for a table

text: How can I set Helvetica Neue font (with a specified size and color - i.e. 9) for all the tables in my LaTeX file? I'm trying with `\fontfamily{helveticaneue}\selectfont` but it doesn't work and honestly I don't have any idea about how to set it for all the tables in my paper. This is an example of what I am doing; I would like to set "Helvetica neue, size 9" as the default font for all the tables:               \documentclass[a4paper,10pt]{article}     %\documentclass[a4paper,10pt]{scrartcl}          \usepackage[utf8]{inputenc}     \usepackage[margin=1in]{geometry}     \usepackage{chngcntr}     \counterwithin{table}{section}     \usepackage{tabularx}          \title{Paper 1}          \begin{document}     \maketitle     \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}          \section{Dati}          \begin{table}[htb!]     \centering     \fontfamily{helvet}\selectfont     \begin{tabular}{L{2cm}|L{13cm}}           \hline         \textbf{Variabili} & \textbf{Descrizione} \\         \hline               gdp\_us & GDP USA trimestrale nominale (dal Q1 1947 al Q4 2013), fonte: FRED2\\           \hline     \end{tabular}     \caption{N/A}     \label{tab2.1}     \end{table}          \end{document}


title: Beamer - building footnote example with columns and minipage

text: While trying to construct a `beamer` slide illustrating usage of `footnote` command I hit upon the following problems. When I compile a slide with the following code:                    \documentclass{beamer}          \begin{document}          \begin{frame}[fragile]{Footnotes}     \begin{columns}[t,onlytextwidth]\footnotesize     \begin{column}{0.5\textwidth}     He was a ruffian\footnote{A thug, hoodlum.} to the bone who hated both Alice and White Hare.     \end{column}     \begin{column}{0.5\textwidth}     \begin{semiverbatim}     He was a     ruffian\\footnote\{A thug, hoodlum.\}     to the bone who hated     both Alice and White Hare.     \end{semiverbatim}     \end{column}     \end{columns}     \end{frame}          \end{document}           what I receive is the following slide: ![enter image description here](http://i.stack.imgur.com/yWTIv.jpg) So I decided to resort to `minipage` environment to avoid flushing the code beyond the frame:                    \documentclass{beamer}          \begin{document}          \begin{frame}[fragile]{Footnotes}     \begin{columns}[t,onlytextwidth]\footnotesize     \begin{column}{0.5\textwidth}     \begin{minipage}[t]{0.5\textwidth}     He was a ruffian\footnote{A thug, hoodlum.} to the bone who hated both Alice and White Hare.     \end{minipage}     \end{column}     \begin{column}{0.5\textwidth}     \begin{minipage}[t]{0.5\textwidth}     \begin{semiverbatim}     He was a     ruffian\\footnote\{A thug, hoodlum.\}     to the bone who hated     both Alice and White Hare.     \end{semiverbatim}     \end{minipage}     \end{column}     \end{columns}     \end{frame}          \end{document}           Yet in this case, although aligning is OK, the text in the left minipage is squeezed in a way which makes it look rather, say, inelegant: ![enter image description here](http://i.stack.imgur.com/JwaWG.jpg) I would like to ask you to help me understand what's going on here and why, and tell me what is best remedy. I know there are beamer packages that are particularly suited for frames like this, but I am curious why these problems arise why I use the tools above.


title: Alignment problem if line breaks are used in listings

text: I am using a monospace font and I want that all lines are horizontally aligned ("a" should be directly under "a"). How can I do this? I have noticed that also the pagebreak symbol shifts the text. How can I draw a symbol e.g. in Tikz which has a maximum width of one character?               \documentclass{article}     \usepackage[english]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{amsmath}     \usepackage{listings}     \usepackage{mathabx}               \lstset{        breaklines=true,        frame=lines,        basicstyle=\ttfamily,        numbers=left,        postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\drsh\space}},        showlines=true     }          \begin{document}          \begin{lstlisting}     a = a a a a a a a a a a a a a a a a a a a a a a a ab a a a a a a a a a a a a a a a a a     \end{lstlisting}          \end{document}      ![enter image description here](http://i.stack.imgur.com/evY6U.png)


title: Pgfgantt backwards incompatibility

text: I just installed TeXLive 2013 in favor of TeXLive 2012, and there seems to be a backwards incompatibility with the way milestones are rendered in `pgfgantt`. In TeXLive 2012, my Gantt chart code is rendered as follows: ![enter image description here](http://i.stack.imgur.com/9DZZU.png) However, in TeXLive 2013, after fixing some apparently deprecated attributes (such as `milestone width`), it is rendered as follows: ![enter image description here](http://i.stack.imgur.com/vC2cT.png) I like the original milestone signs much better, but I haven't been able to figure out how to get back the original milestone style. Does anyone know how to do this? The code is essentially: (I've stripped it down to a MWE)               \documentclass{standalone}          \usepackage{tikz}     \usepackage{pgfgantt}          \begin{document}     \begin{ganttchart}[inline,vgrid]{1}{17}       \gantttitlelist{1,...,17}{1} \\       \ganttbar{$(1,2)$}{1}{15}        \ganttbar{$(1,3)$}{1}{10}        \ganttbar{$(4,6)$}{11}{13}       \ganttbar{$(1,4)$}{1}{8}       \ganttbar{$(4,5)$}{9}{14} \\       \ganttmilestone{$1$}{0}       \ganttmilestone{$4$}{8}       \ganttmilestone{$2$}{15}     \end{ganttchart}     \end{document}


title: How do I make uniform spacing for minipages in multicols

text: I'm trying to make a A3 page for the wall of our office, we have a coffee maker and with there are different options for each capsule. What I want to do is have an equally spread set of `minipage`s inside the `multicol`. I've attached Bitbuck Repo where you can see the code (and icons), I don't know if I'm doing it correctly so please give advice and criticism on my choices.               \documentclass[12pt, landscape]{article}     \errorcontextlines 10000     %     %All the data is downloaded with Kasper Langers     %gist: https://gist.github.com/kasperlanger/fd28cb49c2535c0f5cdb     %     %     \title{Coffee Cheat Sheet}     \author{Xamarin Test Cloud}     %paper size     \usepackage[a3paper]{geometry}          \usepackage{framed}          %colums package     \usepackage{multicol}          \usepackage[space]{grffile}          \usepackage{float}          \usepackage{graphicx}          \usepackage[utf8]{inputenc}     \usepackage[english]{babel}          \newcommand{\coffee}[5]{         \begin{minipage}{3 cm}              \begin{figure}[H]         \includegraphics[width=2.5cm]{images/#1.png}         \end{figure}         \end{minipage}         \begin{minipage}{5cm}         \textbf{{#1}}              Intensity {#2}              \includegraphics{icons/Ristretto}{#3} ml              \includegraphics{icons/Espresso}{#4} ml              \includegraphics{icons/Lungo}{#5} ml         \\           \end{minipage}     }               \begin{document}          \begin{framed}     To select the perfect brew you have to look for your nespresso capsule and turn the dial for the right amount of water     \begin{multicols}{2}          \includegraphics[width=2cm]{icons/espressoCup.png}          The left dial have the following options:     \begin{enumerate}         \item{25 ml}         \item{30 ml}         \item{40 ml}         \item{50 ml}         \item{60 ml}     \end{enumerate}          \includegraphics[width=2cm]{icons/lungoCup.png}          The right dial have the following options:     \begin{enumerate}         \item{70 ml}         \item{90 ml}         \item{110 ml}         \item{130 ml}         \item{150 ml}     \end{enumerate}          \end{multicols}     \end{framed}          \begin{multicols}{3}          \coffee{Dharkan}{11}{25}{40}{}          \coffee{Kazaar}{12}{25}{40}{}          \coffee{Ristretto}{10}{25}{40}{}          \coffee{Arpeggio}{9}{25}{40}{}          \coffee{Roma}{8}{25}{40}{}          \coffee{Livanto}{6}{}{40}{}          \coffee{Capriccio}{5}{}{40}{}          \coffee{Volluto}{4}{}{40}{}          \coffee{Cosi}{3}{}{40}{}          \coffee{Indriya from India}{10}{25}{40}{}          \coffee{Rosabaya de Colombia}{6}{}{40}{}          \coffee{Dulsao do Brasil}{4}{}{40}{}          \coffee{Fortissio Lungo}{7}{}{}{110}          \coffee{Vivalto Lungo}{4}{}{}{110}          \coffee{Linizio Lungo}{4}{}{}{110}          \coffee{Decaffeinato Intenso}{7}{}{40}{}          \coffee{Decaffeinato Lungo}{3}{}{}{110}          \coffee{Decaffeinato}{2}{}{40}{}          \coffee{Ciocattino}{6}{}{40}{}          \coffee{Vanilio}{6}{}{40}{}          \coffee{Caramelito}{6}{}{40}{}          \end{multicols}     \end{document}


title: change maxnumber in the middle of document with biblatex

text: Is there a possibility to change biblatex's maxnames option in the middle of the document? Background: I am including a list of my own publication at the end of my thesis. I include also some papers where I am not the first author, so I need to show the full list of authors here. The most helpful comments I found are in this question. As far as I understand:   1. Using the options field in the .bib file won't work without some additional work and duplication of entries in the bib file, since I might cite the same article in the main document (where I want to have only maxnames displayed at maximum) and in my publications list (where I need full author list.   2. Duplicating my own articles into a second file would be possible. I'd still prefer a pure biblatex solution without the need to adapt the .bib file. If that is the only way, though, I'd need advice on how to get this to work as well. Many thanks in advance! Regards, Andreas Here is the MWE:               \documentclass{article}     \usepackage{biblatex}     \usepackage{currvita}          % just for demonstration     \ExecuteBibliographyOptions{maxnames=3}     \addbibresource{biblatex-examples.bib}          \begin{document}     \section{Main Document}     Here I write about our method \parencite{herrmann}.          \printbibliography          \clearpage     \begin{cv}{Max Mustermann}            %% personal information       \begin{cvlist}{Personal Information}         \item[Date of Birth] 01 March 2013         \item[Place of Birth] Berlin         \item[Nationality] German       \end{cvlist}            %% Publications       %% \ExecuteBibliographyOptions{maxnames=99}       \setlength{\cvlabelwidth}{0mm}       \begin{cvlist}{Publications}         \item \fullcite{herrmann}       \end{cvlist}          \end{cv}          \end{document}


title: drawing package in tex

text: I just want to learn how to make graphics in TeX. I have looked through this site and tried some TeX source file. But I am confused by the TikZ and tkz packages. Do they have any relation or are they completely different? In my daily work, I draw 2D graphics. It is about general arrangement of buildings. For example:               |-----------|-----------|-----------|-----------|     |-----------|-----------|-----------|-----------|     |-----------|-----------|-----------|-----------|     |-----------|-----------|-----------|-----------|      All the lines are axis lines. Columns are placed at the intersection. Beams are placed at all the lines. Beam lines will be offset to both side based on the axis line. For this kind of graphics, which package is the best choice?


title: Highlighting text with citations and references

text: I was using the package soul to highlight text. It is pretty good, except for the fact that I get errors when I try to highlight a block of text with references or a citation. For example:               \hl{\citet{stuff} some text...}      gives               ! Argument of \@citex has an extra }.


title: How do I set group headings for an index in Lyx?

text: I want to set group headings, in form of a corresponding letter, for an index in lyx. I have one main lyx file, containing links (with include) to other lyx files, placed in a subfolder. I tried following, but it doesn't work. First I created a file called test.ist in the same directory as my main lyx file, containing folling:               quote '>'     headings_flag 1     heading_prefix "\\textbf\{\\huge "     heading_suffix "\}"      In my lyx main file I opend document settings, changed the processor under Indexes to "makeindex" and entered in option field "-g -s test.ist" (without quotes) The lines corresponding to index in my log file look like this               (C:\...\miktex\tex\latex\base\makeidx.sty          Package: makeidx 2000/03/29 v1.0m Standard LaTeX package     )     \@indexfile=\write3          Writing index file test.idx      Also the -g option doesn't show any effect. Do you have a clue what to do and may give me a hint, please? Thank you.


title: Can someone help me figure out what this code does?

text: The following code is from our universities thesis template, which is not very well documented, and as I'm the most skilled LaTeX user, and I'm a middling user at best, we don't know what a lot of the code in it does. Could someone help us figure out what this macro does? I can tell that it has something to do with `hyperref`, but beyond that we don't know. It is right above a bunch of code for modifying `csthesis` to add a List of Programs, so it could have something to do with that? Is there enough here to tell what it is doing? Oh and no, I can't post up a MWE as we don't know what it does, and it was taken out of an entire Ph.D. thesis.               \makeatletter     \def\contentsline#1#2#3#4{%       \ifx\\#4\\%         \csname l@#1\endcsname{#2}{#3}%       \else         \csname l@#1\endcsname{%           \hyper@linkstart{link}{#4}{#2}\hyper@linkend         }{%           % same link destination for the page:           \hyper@linkstart{link}{#4}{#3}\hyper@linkend           % link destination is the page itself:           % \hyperpage{#3}%         }%       \fi     } \makeatother      (I'm hoping there is enough code there, this is sitting off by itself in the template so I'm hoping it is self contained. I'm also hoping this is not too localized.)


title: Fixme List with Chapter names

text: I am using the FixMe-package documented here. In the beginning of my document, I print a list of fixme's with \listoffixmes, but this list is rather tedious to read. Is it possible to break this list up by my chapters, such that I can easily see the fixme's of each section in a separate list?


title: Is there any way other than \pmb to produce bold greek letters when mathptmx is used?

text: I know that mathptmx does not contain bold symbols for greek letters in math mode, and the result of `\pmb` is too ugly. Is there a way to specify LaTeX to use CM fonts for bold greek letters when mathptmx is used?


title: Merge two BibTeX files

text: I was constructing a BibTeX file for my Thesis. At the middle of that I had copied that bib file to another document I had to produce, I had to add some new citations to the copy of the original. Now I have 2 bib files that have a lot in common but differ in some citations. Is there a way to merge them? So that I have one single file with all the citations from both files but no duplicates?


title: Force sideways graphic to fit page

text: I'm using this preamble:               \documentclass[pdftex,10pt,b5paper,twoside]{report}     \usepackage[lmargin=25mm,rmargin=25mm,tmargin=27mm,bmargin=30mm]{geometry}     \usepackage[comma]{natbib}     \usepackage{lmodern}     \usepackage{setspace}     \usepackage{amsmath,amssymb,amsfonts}      \usepackage{graphics}                      \usepackage{color}                   \usepackage{hyperref}                  \usepackage{graphicx}     \usepackage{listings}     \usepackage{courier}                  \usepackage{longtable}     \usepackage{rotating}     \usepackage{calc}     \usepackage{caption}     \usepackage{booktabs}     \usepackage{ctable}     \usepackage{mathtools}      I need to include some plots with captions (sideways) and I use:               \begin{sidewaysfigure}     \captionsetup{width=0.75\textwidth}     \begin{center}     \includegraphics[keepaspectratio=true, width=\textwidth]{./Figur/fundvar.png}     \caption[Commercial crude oil inventories, SPX excess returns, S\&P GCSI excess return time series]{Commercial crude oil inventories calculated as the logarithm of the current value divided by the mean of same weekly values over the past 5 years, Log excess returns on the S\&P Goldman Sachs Commodity Index,  Log excess returns on the S\&P 500 index.}     \label{fig:fundvar}     \end{center}     \end{sidewaysfigure}      The captions have different lengths, so how can force latex to fit the plot and caption to the page (inside the margin specified) and also keeping the aspect ratio of the plot? EDIT: Also, latex always put sideways figures on a new page. If i try to put                \section{Variables}      the sidewaysfigure is placed on the next page, any way to prevent this?


title: How do I use aliascnt with cleveref?

text: I'm trying to compile the HoTT book with htlatex, and was trying to reproduce an issue that occurs with htlatex but not pdflatex. However, I couldn't even manage to get a small working example using pdflatex. I would like to know why this code does not work, and how to fix it.               \documentclass{article}     \usepackage{amsthm}     \usepackage{aliascnt}     \usepackage[capitalize]{cleveref}     \usepackage{hyperref}          \newtheorem{thm}{Theorem}[section]     \crefname{thm}{Theorem}{Theorems}     \theoremstyle{remark}     \newaliascnt{rmk}{thm}     \newtheorem{rmk}[rmk]{Remark}     \aliascntresetthe{rmk}     \crefname{rmk}{Remark}{Remarks}          \begin{document}     .     \begin{thm}     .     \end{thm}     \begin{rmk}     .     \end{rmk}     \end{document}      It gives me               This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9 64-bit)     entering extended mode     (D:\Documents\GitHub\book\test.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar     abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,     croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga     lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland     ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,      lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n     german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman     ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm     an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl     ishmax, welsh, loaded.     ("D:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("D:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))     ("D:\Program Files\MiKTeX 2.9\tex\latex\amscls\amsthm.sty")     ("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\aliascnt.sty"     ("D:\Program Files\MiKTeX 2.9\tex\latex\carlisle\remreset.sty"))     (D:\Documents\GitHub\book\cleveref.sty)     ("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hyperref.sty"     ("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-hyperref.sty"     ("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\hobsub-generic.sty"))     ("D:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")     (D:\Documents\GitHub\book\ifxetex.sty)     ("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\auxhook.sty")     ("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\kvoptions.sty")     ("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\pd1enc.def")     ("D:\Program Files\MiKTeX 2.9\tex\latex\00miktex\hyperref.cfg")     ("D:\Program Files\MiKTeX 2.9\tex\latex\ltxmisc\url.sty"))          Package hyperref Message: Driver (autodetected): hpdftex.          ("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\hpdftex.def"     ("D:\Program Files\MiKTeX 2.9\tex\latex\oberdiek\rerunfilecheck.sty"))     (D:\Documents\GitHub\book\test.aux)     ("D:\Program Files\MiKTeX 2.9\tex\latex\hyperref\nameref.sty"     ("D:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\gettitlestring.sty"))     (D:\Documents\GitHub\book\test.out) (D:\Documents\GitHub\book\test.out)          ! LaTeX Error: No counter 'r' defined.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...          l.20 \begin{rmk}          ?     ! Emergency stop.      ...          l.20 \begin{rmk}          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on test.log.      Why is it looking for a counter "r", and how do I fix this?


title: Pascal's triangle in Tikz with symbols

text: I have a follow-up question to Pascal's triangle in tikz with row headers. Is it possible to produce Mark's solution with symbols in Pascal's triangle? So, I could create the same figure, but instead of numbers, I would generate Pascal's triangle with `${\n \choose \k}$` at each node. Thanks!


title: Numbered citations in Tufte-Latex 3.5

text: Tufte-LaTeX 3.5 (compiling with PDFTexify) I need to have my citations in the numbered format e.g. [1], [2], etc. I tried adding the following to the preamble `\usepackage[numbers]{natbib}` but get an error as long as `[numbers]` is present Please advise


title: Is the inline scaling of $\gtrsim$ or $\gtrapprox$ ok?

text: I want to write the commands `\gtrsim` or `\gtrapprox` from the `amsart` class inline but the symbols look disproportionally big compared to x, y:               \documentclass[11pt]{amsart}     \usepackage{amssymb}          \begin{document}           $x\gtrsim y$ or  $x\gtrapprox y$          \end{document}      ![enter image description here](http://i.stack.imgur.com/B2pxk.png) I tried `\scriptstyle` but it looks awful. Is the scaling correct and if no what to do?


title: Is there a package for warning about unbalanced delimiters?

text: I'm copy-editing a rather lengthy set theory book. One thing I'd like to check systematically is whether all left-right unambiguous delimiters (parentheses brackets curly, square and angle) are balanced. I could write a Perl script to check for this, but was thinking that there might already be a LaTeX package which warns you about unbalanced delimiters. Is there such a thing?


title: TeX capacity exceeded in Table of Contents due to macro

text: I'm working on a macro that when given `Hello` will make a chapter named hello, and number it like this: `1 - Hello`, with the `1 -` inside the margins. I also want it to automatically label the chapter by lower-casing the argument and remove all the spaces, creating a `\label{chap:hello}`. So far, I've figured out that to remove the "Chapter" declaration, I must use `\chapter*{}`, and I have to append other commands to make sure the chapter is properly numbered and displayed in the TOC.   * How to remove chapter numbering without removing it from tableofcontents   * Chapters without the “chapter” text in content [closed]   * chapter headings without the word "chapter" What I have now is:               \renewcommand{\chapter}[1]     {%     \chapter*{#1}     \addcontentsline{toc}{chapter}{#1}     \stepcounter{chapter}     }      In a MWE (Minimum working example):               \documentclass{report}     \title{An Example} \author{Nobody}     \renewcommand{\chapter}[1]{%     \chapter*{#1}     \addcontentsline{toc}{chapter}{#1}     \stepcounter{chapter}     }     \begin{document}     \maketitle     \tableofcontents     \chapter{Hello}     \end{document}      (The title is needed for some formatting issues.) When I test this though, I get the error:               line 10: TeX capacity exceeded, sorry [input stack size=5000] \tableofcontents      I can't seem to find an answer to this anywhere:   * TeX capacity exceeded error   * Error Latex TeX capacity exceeded   * TeX capacity exceeded error  It seems to be a very non descriptive error. Help? One request: If you give me a macro that does the entire job, please explain how it works. (With documentation if it isn't too much trouble)


title: Optimizing size (font AND width) of tables produced with dcolumn/siunitx

text: I have a couple of tables in my document, and it's time to finalize them. This means I want to optimize: 1) the size of the font (if possible obtain \normalsize as in the rest of the document, or at least the largest size possible to fit the table within the space); and 2) the distance between columns (if possible it should be equal) Note that I have to follow these settings (thesis guidline): `geometry{left=2cm,right=5cm,top=2cm,bottom=2cm}` As an aside, I'd like the table captions not too big. I wonder if my size is normal here. For the solution, I'd appreciate if I can follow it, so I can apply it to all my tables. This means I need to understand the steps undertaken to optimize each of those. Here is the MWE in terms of dcolumn. I have tried to add only parts of my preamble which I think are important for this task.               \documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}     \usepackage{setspace}     \usepackage[a4paper]{geometry}     \usepackage{booktabs}     \usepackage[labelfont=bf,labelsep=newline,singlelinecheck=false,     format=plain,indention=2cm]{caption}     \usepackage{dcolumn}     \newcolumntype{Y}{D..{-1}}          \KOMAoption{captions}{tableheading}     \onehalfspacing     \geometry{left=2cm,right=5cm,top=2cm,bottom=2cm}     \pagestyle{headings}          \begin{document}     \begin{table}[htbp]     \centering     \caption{Caption...}      \label{a1}     {\scriptsize     \begin{tabular}{lYYYYYYYYYYYY}     \toprule        & \multicolumn{2}{c}{X1} & \multicolumn{2}{c}{X2} &       \multicolumn{2}{c}{X1}  & \multicolumn{2}{c}{X1}  & \multicolumn{2}{c}{X2} &       \multicolumn{2}{c}{X2} \\       \cmidrule(rl){2-3} \cmidrule(rl){4-5}\cmidrule(rl){6-7} \cmidrule(rl){8-9}   \cmidrule(rl){10-11}        \cmidrule(rl){12-13}        & \multicolumn{1}{c}{A} & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{A} &  \multicolumn{1}{c}{B} &        \multicolumn{1}{c}{A} & \multicolumn{1}{c}{G} & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{A}        & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{G} & \multicolumn{1}{c}{A} & \multicolumn{1}{c}{B}        \\       \midrule C1 & 0.37 & 0.37 & 0.45 & 0.45 & 0.45 & 0.44 & 0.50 & 0.45 & 0.45 & 0.45 &  0.47 & 0.26 \\        C2 & 0.37 & 0.31 & 0.43 & 0.29 & 0.29 & 0.29 & 0.48 & 0.50 & 0.72 & 0.75 & 0.45 &   0.38 \\        C3 & 0.37 & 0.29 & 0.29 & 0.12 & 0.15 & 0.37 & 0.41 & 0.46 & 0.45 & 0.45 & 0.45 & 0.43 \\        C4 & 0.37 & 0.20 & 0.25 & 0.45 & 0.45 & 0.18 & 0.45 & 0.45 & 0.38 & 0.44 & 0.45 & 0.38 \\        Clongnamehere5 & 0.37 & 0.32 & 0.45 & 0.12 & 0.45 & 0.50 & 0.45 & 0.45 & 0.57 & 0.59 & 0.45 & 0.51 \\        \bottomrule\end{tabular}       % cut here but goes on much further      }      \end{table}      \end{document}      I have just noticed, that siunitx seems to do the job, **BUT ONLY under scriptsize**. Is this the better for the purpose? MWE with siunitx:               \documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}     \usepackage{setspace}     \usepackage[a4paper]{geometry}     \usepackage{booktabs}     \usepackage[labelfont=bf, labelsep=newline,singlelinecheck=false,     format=plain,indention=2cm]{caption}     \KOMAoption{captions}{tableheading}     \onehalfspacing     \geometry{left=2cm,right=5cm,top=2cm,bottom=2cm}     \pagestyle{headings}          \usepackage{siunitx}     \begin{document}          \begin{table}[htbp]     \centering     \caption{Caption...}      \label{ovb1}     {\scriptsize     \begin{tabular}{l     S[table-format=1.2]     S[table-format=1.2]      S[table-format=1.2]      S[table-format=1.2]     S[table-format=1.2]      S[table-format=1.2]      S[table-format=1.2]      S[table-format=1.2]     S[table-format=1.2]     S[table-format=1.2]      S[table-format=1.2]      S[table-format=1.2] }     \toprule        & \multicolumn{2}{c}{X1} & \multicolumn{2}{c}{X2} &       \multicolumn{2}{c}{X1}  & \multicolumn{2}{c}{X1}  & \multicolumn{2}{c}{X2} &       \multicolumn{2}{c}{X2} \\       \cmidrule(rl){2-3} \cmidrule(rl){4-5}\cmidrule(rl){6-7} \cmidrule(rl){8-9}   \cmidrule(rl){10-11}        \cmidrule(rl){12-13}        & \multicolumn{1}{c}{A} & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{A} &  \multicolumn{1}{c}{B} &        \multicolumn{1}{c}{A} & \multicolumn{1}{c}{G} & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{A}        & \multicolumn{1}{c}{B} & \multicolumn{1}{c}{G} & \multicolumn{1}{c}{A} & \multicolumn{1}{c}{B}        \\       \midrule C1 & 0.37 & 0.37 & 0.45 & 0.45 & 0.45 & 0.44 & 0.50 & 0.45 & 0.45 & 0.45 &  0.47 & 0.26 \\        C2 & 0.37 & 0.31 & 0.43 & 0.29 & 0.29 & 0.29 & 0.48 & 0.50 & 0.72 & 0.75 & 0.45 & 0.38 \\        C3 & 0.37 & 0.29 & 0.29 & 0.12 & 0.15 & 0.37 & 0.41 & 0.46 & 0.45 & 0.45 & 0.45 & 0.43 \\        C4 & 0.37 & 0.20 & 0.25 & 0.45 & 0.45 & 0.18 & 0.45 & 0.45 & 0.38 & 0.44 & 0.45 & 0.38 \\        Clongnamehere5 & 0.37 & 0.32 & 0.45 & 0.12 & 0.45 & 0.50 & 0.45 & 0.45 & 0.57 & 0.59 & 0.45 & 0.51 \\        % cut here but goes on much further       \bottomrule\end{tabular}       }       \end{table}       \end{document}      Thanks.


title: Small Axis arrows in PGFplots

text: I would like to draw small arrows (through a macro probably), to show the coordinate directions like the plot below. It would be nice to have the option to turn on/off the grids as well. The MWE for generating the plot:               \documentclass[12pt]{article}     \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}          \begin{axis}     [view = {120}{10}     ,grid = both     ]     \addplot3[surf] {x^2+y^2};     \end{axis}          \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/TeD0i.png)


title: command for automatically indexing

text: I'm finishing up my Master's thesis and need to auto-index all similar terms after identifying the first one. ex:               \documentclass{article}     \usepackage{makeidx}          \makeindex     \begin{document}          %%%page1          \section{blah blah}          I'm **finishing** \index{finishing} up my thesis.      %.....     %....          %%% page2          Before **finishing**  my thesis..          \printindex          \end{document}      I want to include automatically the term **finishing** on page 2 (or other pages) in my index. Something like that: > Index > > finishing, 1, 2. Is this possible?


title: LyX + SyncTeX + Document Viewer Evince

text: I am running LyX 2.0.2 in Ubuntu 12.04 and using the default PDF viewer Evince. I want to setup SyncTeX to go back and forth between the document and the source, at the right position in the text. I found this in the LyX website, but it doesn't give the Evince viewer.   http://wiki.lyx.org/LyX/SyncTeX Does anybody know how to set it up?


title: align table inside table on the top

text: I have sub-tables inside a table and I want that the text of the sub-tables is on the top of the row like on the second image. ![Example](http://i.stack.imgur.com/bSsc0.jpg) MWE:               \documentclass[12pt,a4paper]{article}     \usepackage[latin1]{inputenc}     \usepackage{tabularx}     \newcommand{\listingsymbol}{\textbullet\thinspace}     \begin{document}     \begin{table}[]     \begin{tabularx}{\textwidth}{|l|p{2.5cm}|p{3cm}|X|}     \hline     item 0 &  \begin{tabular}[x]{@{\listingsymbol}l@{}}     item 1\\     item 2\\     \end{tabular}     & \begin{tabular}[x]{@{\listingsymbol}l@{}}     item 1 \\     item 2\\     item 3\\     \end{tabular} &      \begin{tabular}[x]{@{\listingsymbol}p{139pt}@{}}     item 1\\     item 2\\     item 3.1 \newline item 3.2\\     item 4\\          \end{tabular} \\ \hline          \end{tabularx}     \end{table}     \end{document}


title: Error With modiagram

text: I am trying to compile the following code from the `modiagram` Manual:                   \begin{MOdiagram}[names]         \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{1s=.2;up,up-el-pos={1sleft=.5}}         \atom[Xe]{right}{1s=1.25;pair}         \molecule[\ch{XeF2}]{1sMO={1/.25;pair}}         \AO(1cm){s}{0;up}         \AO(3cm){s}{0;pair}         \connect{ AO1 & AO2 }         \node[right,xshift=4mm] at (1sigma) {\footnotesize bonding};         \node[above] at (AO2.90) {\footnotesize non-bonding};         \node[above] at (1sigma*.90) {\footnotesize anti-bonding};     \end{MOdiagram}      But it dose not compile with `pdflatex`. The following code dose compile:                   \begin{MOdiagram}         \atom[\lewis{0.,F}\hspace*{5mm}\lewis{4.,F}]{left}{1s=.2;up,up-el-pos={1sleft=.5}}         \atom[Xe]{right}{1s=1.25;pair}         \molecule[\ch{XeF2}]{1sMO={1/.25;pair}}         \AO(1cm){s}{0;up}         \AO(3cm){s}{0;pair}         \connect{ AO1 & AO2 }         \node[right,xshift=4mm] at (1sigma) {\footnotesize bonding};         \node[above] at (AO2.90) {\footnotesize non-bonding};         \node[above] at (1sigma*.90) {\footnotesize anti-bonding};     \end{MOdiagram}      The error seems to be in the `[<option>]` comand. I tried changing `[names]` to `[lables]` and got the same error:                   \end{MOdiagram}          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.      I have `modiagram` version `0.2c`


title: Making a table with cols

text: Right now I am doing something like:               \twocolumn     {\footnotesize     \begin{center}         \tablehead{$x$ & $y$ \\ \hline}         \begin{supertabular}{ccc}             entry_x & entry_y \\             etc      Is there a way to do this over a few columns?


title: How to make a larger {}?

text: I have this equation:               $$P^{-1}(C) = \{\vec{x} = (x_{1:n},x_{n+1}) \in \mathbf{R}^{n+1} \mid \frac{x_{1:n}}{x_{n+1}} \in C , x_{n+1} > 0\}$$      but the `{}` brackets and the `|` sizes aren't auto adjusted, I found a post which doesn't work, and even `$\sfrac$` doesn't work for me.


title: Texmaker cannot compile the tex file

text: Texmaker is not compiling ! every times it show me package installation required as attached picture what is the missed ! any suggestion![here](http://i.stack.imgur.com/iG5NZ.png)


title: Biburl cannot take % symbol in url

text: i am trying to quote from this url `http://www.crmsoftwareblog.com/2009/11/what-is-xrm-how-crm-software-can- track-more-than-just-%E2%80%9Ccustomers%E2%80%9D/`, but because of % symbol, latex is telling that something is wrong. I have also tried to escape %, result was: `http://www.crmsoftwareblog.com/2009/11/what-is-xrm-how-crm-software-can- track-more-than-just-\%E2\%80\%9Ccustomers\%E2\%80\%9D/`, but it still did not work. Can you please tell me how to solve it?


title: Abstract - doublespace

text: I have got a problem with an abstract. I created a PHD Thesis in Latex. I use _thesis_ document style. I want abstract to be doublespaced. I put that code to obtained it:               {\doublespacing      \newpage\ifpdf\pdfbookmark[1]{Acknowledgement}{label:ack}\fi\input{acknowledge.tex}      \newpage\ifpdf\pdfbookmark[1]{Abstract}{label:abst}\fi     \input{abstract.tex}     }      Unfortunately, everything is doublespaced, except the end of the abstract (see picture): ![The interline attribute is changed in the end of the abstract](http://i.stack.imgur.com/fLg4J.jpg) Does anybody has any suggestions? Regards.


title: Cross-reference of custom environments created with environ and TikZ package

text: **Problem:** I want to create an environment named Example, and the environment has a counter (number within chapter). I want to refer to the counter for illustration just as the table, figure and equation environment. When using `\newenvironment`, the command `\refstepcounter` works. However, since the new environment includes a TikZ code, I can not use `\newenvironment` to create the environment. Alternatively, I used _environ_ package. The only problem is that the cross-reference of the counter doesn't work, even though I use `\refstepcounter` in my customized environment. **Example** Minimal Example is given as follows:               \documentclass{book}          \usepackage{lipsum}     \usepackage{mathpazo}          \newcounter{exam}[chapter]     \setcounter{exam}{0}     \renewcommand{\theexam}{\thechapter.\arabic{exam}}          % % Method 1          % \newenvironment{example}[1][]{\refstepcounter{exam}\par\medskip\noindent%     %    \textbf{Example \theexam~ #1} \rmfamily}{\medskip}          % Method 2     \usepackage{environ,tikz}     \tikzstyle{title}=[right=10pt,fill=gray,text=green!50]     \tikzstyle{context}=[thick,rectangle,draw=gray,inner sep=10pt, inner ysep=10pt]     \NewEnviron{example}[1][{}]{%     \par\noindent\centering     \begin{tikzpicture}         \node[context](box){             \begin{minipage}{0.93\textwidth}                 \BODY             \end{minipage}};         \node[title] at (box.north west){         \refstepcounter{exam}\par\medskip\noindent \textbf{Example \theexam~ #1}};     \end{tikzpicture}}          \begin{document}          \setcounter{chapter}{2}          \begin{example}[First]\label{exam:1}         \lipsum[4]     \end{example}          \lipsum[2]          \begin{example}[Second]\label{exam:2}       \lipsum[5]     \end{example}          Example ~\ref{exam:1} and ~\ref{exam:2} are the new environments!          \end{document}      **Method 1 works, but method 2 does not work.** How can I make it work? Additional information: if possible I would try to not use _ntheorem_ or _tcolorbox_. Thank you!


title: Merge arrows with TikZ

text: I am still learning to use TikZ and now I find myself in a tight spot. I want to draw three processes on the lhs and one on the rhs. These processes are represented by a circle. I then want three arrows comming from the lhs to merge in the space between and go to the process on the rhs. Further more I would like the arrow from the bottom one to be dotted at the midway. I have the following to create the four processes and join them with arrows, but how do I merge them in between               \begin{tikzpicture}       \tikzstyle{every node}=[draw,shape=circle];        \node (P0) at (0,  0.0) {$P_0$};       \node (P1) at (0, -1.0) {$P_1$};       \node (Pn) at (0, -2.5) {$P_n$};            \node (Q) at (2, -1) {$Q$};            \draw [dotted] (P1) -- (Pn);       \draw [->] (P0) -- (Q);       \draw [->] (P1) -- (Q);       \draw [->] (Pn) -- (Q);     \end{tikzpicture}      My very bad hand drawing from Google Drawing can be seen below ![enter image description here](http://i.stack.imgur.com/RBJnN.png)


title: \parskip inserts extra space after floats (and listings)

text: This question seems to be a duplicate of How to remove the skip after a listing when "\parskip" is increased with "\baselineskip"? but the answer given there doesn’t work although it’s accepted. How can I set a `\parskip` which is _only_ inserted between paragraphs. At the moment my setting leads to an extra vertical space after an `[h]`-float or a `{lstlisting}`. The latter is not used in my document but illustrates the problem, with display styled environments.* There’s no problem with equations. ![problem](http://i.stack.imgur.com/x3Isr.png)               \documentclass[fleqn]{book}          \usepackage{parskip}          \usepackage{listings}          \begin{document}     XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX     \begin{equation}     xxxxx = xxxxx     \end{equation}     XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX          XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX     XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX     \begin{lstlisting}     LLLLLLLLLLLLLLLLLLL     \end{lstlisting}     XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX          XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX     XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX     \begin{figure}[h]     \rule{10cm}{2cm}     \end{figure}     XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX     XXXXXXXXXXX XXXXXXXXXX XXXXXXXXXXX XXXXX XXXXX     \end{document}      I could fix this by inserting `\vspace{-\parskip}` but this is a bad solution—so MS Word like ;-) * I’m using an own environment created with `mdframed` to get framed boxes.


title: How to make Sanskrit Title in Devanagari Package

text: I generally type sanskrit using the "devnag" preprocessor. But when making a sanskrit title it is showing an error. Can you please help me in rectifying this. My input `vivekachoodamani.dn` file is given below:               \documentclass[10pt]{article}     \usepackage[ansinew]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{devanagari}     \usepackage{fontspec,bera}     \usepackage[width=4.5in, height=7.0in, top=1.0in, papersize={5.5in,8.5in}]{geometry}          \begin{document}     \title{{\dn vivekachoodama.ni}}     \author{Sri Sankaracharya}          \maketitle          \begin{flushleft}               {\dn sarvavedaantasiddhaantagocara.m tamagocara.m | \\ govinda.m paramaananda.m {sad}guru.m pra.nato.asmyaham ||  1}          {\small I prostrate myself before Govinda, the perfect teacher, who is absorbed always in the highest state of bliss. His true nature cannot be known by the senses or the mind. It is revealed only through knowledge of the scriptures.}          \end{document}


title: Subfloat indexes misaligned when using setcaptionwidth

text: I have the following document:               \documentclass{article}     \usepackage{subfig}     \usepackage{graphicx}     \usepackage{geometry}     \setcaptionwidth{12cm}     \begin{document}     \begin{figure}[t]       \centering%       \subfloat[]{\label{figa}\includegraphics[width=38mm,%         height=32.48mm]{fig1}}\hspace{3mm}%       \subfloat[]{\label{figb}\includegraphics[width=38mm,%         height=32.48mm]{fig2}}\hspace{3mm}%       \subfloat[]{\label{figc}\includegraphics[width=38mm,%         height=32.48mm]{fig3}}%       \caption{Some caption.}       \label{fig-moire-comp-xue}     \end{figure}     \end{document}      I want the captions of all figures to have a width of 12cm (slightly less than main body text), and have TeX generate the (a), (b) labels for me. This is the result: ![Incorrect image](http://i.stack.imgur.com/MqlWK.png) If I then comment out the line in the preamble setting the caption width to 12cm, it aligns as I want: ![Correct image](http://i.stack.imgur.com/agSYS.png) (This is an issue in my thesis, a much more complicated document, but I think I have narrowed it down to this conflict.) I just want the alignment to be fixed, but still have 12cm wide captions for all figures. I don't really care if the solution is an ugly per-figure hack, I just care about alignment. Thanks for any help.


title: Applying an operation only to capitals

text: I'd like to apply a function to capitals only so that:               \emphcaps{YaWeH}      Outputs like:               \emph{Y}a\emph{W}e\emph{H}      Preferably without using too many packages (I already use `memoir`). NOTES: I use XeLaTeX (as it's bidi support seems best).


title: What to do when a line in a bibliography entry overflows?

text: The usual solution to fix lines that overflow is to rewrite it. However, that hardly works with bibliography entries that experience the same problem. So what can I do to fix it? I can't rewrite anything since the information needs to be "as-is". I can't provide a minimal example because if I take the entry that overflows in my document, then the problem fixes itself as the font, font size and margins change. ### EDIT Even though I've accepted an answer, please submit more answers if you have a good approach for addressing this issue. Maybe it can assist someone else who have the same problem and don't want to resort to using "ragged right".


title: No Color Showing in TikZ Drawing

text: I am trying to draw some pictures using TikZ within LaTeX. I have started by using simple examples, but I am having trouble getting colors to show. For example, I use the following commands, but only get black and white output for the items created with TikZ. As suggested, I am supplying a full, compilable document that generates the behavior:               \documentclass{article}          \usepackage{color}     \usepackage{xcolor}          \usepackage{tikz}     \usetikzlibrary{calc,through}          \begin{document}          \begin{tikzpicture}[scale=1.2]      \draw [gray] (0,1) -- (2,1);     \draw [red] (0, 0.5) -- (2,0.5);     \draw [blue] (0,0) -- (2,0);     \end{tikzpicture}          \textcolor{red}{this shows in red correctly}          \end{document}      I am using scientific workplace to create my document. I have used the `tikz` package, as well as the `color` and `xcolor` packages. Any thoughts as to why there is no color. I know the system is generally capable of creating color, as the second `\textcolor` statement comes out in red.


title: How to use algorithmicx package?

text: I found the `algorithmicx` package on this page, and tried to compile this example from the pdf file.               \documentclass{article}     \usepackage{algorithmicx}     \begin{document}          \begin{algorithm}     \caption{Euclid’s algorithm}\label{euclid}     \begin{algorithmic}[1]     \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}        \State $r\gets a\bmod b$        \While{$r\not=0$}\Comment{We have the answer if r is 0}           \State $a\gets b$           \State $b\gets r$           \State $r\gets a\bmod b$        \EndWhile\label{euclidendwhile}        \State \textbf{return} $b$\Comment{The gcd is b}     \EndProcedure     \end{algorithmic}     \end{algorithm}          \end{document}      With `pdflatex example.tex`, I got this error.               ! LaTeX Error: Environment algorithm undefined.      What's wrong with this?


title: Misalignment with framed package and column

text: I'm trying to use the shaded environment as follows:               \documentclass[11pt]{beamer}     \usepackage{xcolor}     \usepackage{framed}     \definecolor{shadecolor}{rgb}{1,0.8,0.3}               \begin{document}     \begin{frame}     \begin{columns}[t, totalwidth=\linewidth]     \begin{column}{0.5\linewidth}     \begin{shaded}     Foo     \end{shaded}     \end{column}     \begin{column}{0.5\linewidth}     Foo     \end{column}     \end{columns}     \end{frame}     \end{document}      I get the following output (although, oddly, there is no Overfull hbox error): ![misalignment](http://i.stack.imgur.com/dC9EF.png) Without the shaded environment around the first "foo", I get ![enter image description here](http://i.stack.imgur.com/BX2le.png) Do I need to give up on the shaded environment, or I am doing something else wrong?


title: How do I suppress the list of acronyms

text: I am using the `acronym` package to handle my acronyms. To use the package, I have to define all the acronyms within a `\begin{acronym} ... \end{acronym}`. This generates a listing of acronyms that I want to exclude from my final output. Is there a way to exclude these pages?


title: model2-names.bst, unpublished reference and cites in the footnote

text: I am using `model2-names.bst` for the bibliographical style format. But I have found a couple of problems when using it. First, when I include an unpublished reference, with the web page where it is found, the following error appears:               ! File ended while scanning use of \bibinfo......I suspect you have forgotten a `}', causing me      The problem occurs only when I include in JabRef in the note field the webpage for the reference like this: `\url{http://webpage.pdf}`. If I don´t include the webpage, the compilation works. Additionally, the same error is found when I include cites in the footnote like this;               \footnote{ Text \citep{ref1, ref2, ref3, ref4}}      I included the following packages in my tex file               \documentclass[preprint,authoryear,12pt]{elsarticle}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage[centertags]{amsmath}     \usepackage[left=1in, right=1in, top=1in, bottom=1in]{geometry}     \usepackage[flushmargin,multiple]{footmisc}     \usepackage[labelsep=period,font={bf},textfont={normalsize},labelfont={normalsize}]{caption}     \usepackage{float}     \usepackage{booktabs}     \usepackage[hidelinks]{hyperref}          \journal{Journal }          \begin{document}


title: Inserting a \bigskip between section and subsection using a macro?

text: I'm trying to conform to the IoP guidelines, which from the IoP latex files they provide do not seem to follow the IoP guidelines. Several colleagues of mine have altered the files so they do fit the guidelines, with the caveat of needing to place `\bigskip{}` between section and subsection where one immediately follows the other. Is it possible to automate this with a macro, so I don't need to go through my document and manually insert/remember to insert one? I'm already using a macro as such:               \makeatletter     \g@addto@macro\@floatboxreset\centering     \makeatother      Do I follow that formatting? How is it done?


title: Formatting locally the \hline command in a table

text: Is it possible to alter the `\hline` command in a table to mimic commands like `\dotfill`? I would like to be able to change the way the `\hline` command looks without loading another package like `arydshln`.


title: defining a new pgf class fails

text: I want to use the pgf oo library to create a new class. Unfortunately, even this fails:               \documentclass{article}          \usepackage{tikz}     \usepgfmodule{oo}          \pgfooclass{mapEntry}{ %         \method mapEntry() {%         }     }          \begin{document}         \pgfoonew \myObj = new mapEntry()     \end{document}      This is the error message I get:               Runaway argument?     \myObj = new mapEntry() \end {document}      ! File ended while scanning use of \pgfoo@new.     <inserted text>                  \par      Why does it fail? I found literally nothing useful about this, apart from the tikz manual chapter on the oo library.


title: Oddly wide spaces in subsection title

text: I have a problem, this is what it looks like: ![enter image description here](http://i.stack.imgur.com/501a7.png) And this is the code:               \subsection{Bakterienst\"amme und Anzuchtbedingungen}      Where does the huge whitespace come from?