title: How can I move my table on top of the page?

text: How can I adjust my table on the top of the page? I want to move slightly my table on top. Should I use some margin or padding command in order to that?               \documentclass[english,a4paper,12pt]{report}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{listings}     \usepackage{changepage}          \begin{document}          \clearpage     \begin{table}[ht]     \begin{adjustwidth}{-3.7cm}{}     \begin{tabular}{|p{.6\textwidth}|p{.75\textwidth}|}     \hline     {\begin{lstlisting}[basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,language={Java},     numbersep=8pt,numbers=left,xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords={class,run}]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }     class X ext ProxifiedObject {         PrintHelloThread thread         void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}}     &     {\begin{lstlisting}[     basicstyle={\scriptsize\ttfamily},     identifierstyle={\color{black}},     tabsize=2,     language={Java},     numbersep=8pt,     numbers=left,     xleftmargin=0.5cm,frame=tlbr,framesep=2pt,framerule=0pt,     morekeywords ={class,run}     ]     class PrintHelloThread ext Thread {         void run(Dummy x) {             out.println("Hello world")         }     }     class X ext ProxifiedObject {         PrintHelloThread thread         void main(X x) {             x.thread := new PrintHelloThread;             x.thread.start(0);             x.thread.join(0);         }     }     \end{lstlisting}}     \\     \hline     \end{tabular}     \end{adjustwidth}     \caption{\label{fig:text}text experiment ent experiment experiment}     \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/OXDxZ.gif)


title: Creating and using custom referencing style

text: first of all, I'm a tex virgin so my knowledge of the tools and terminology is pretty much at the same level with a fish. I'm using Win7(64 bit). I installed winEdt. I want to write a paper with a custom referencing style that my school demands. It is very similar to harvard style with some differences (3 authors for et al. kind of stuff). My questions are   1. How can I modify the existing style or create a new style by changing the copy of an existing one?   2. How do I add reference details to my project. Is there a program like Endnote where you can store all your references, modify them and use directly to create refs in Word?    3. How do I add references in my text?   4. Does latex auto update my bibliography when I add a new reference in text?   5. How do I add sources in the bibliography by hand? I want to add sources that I don't cite but used. please explain like you are explaining to an idiot. a lot of questions but I really want to go on with and learn LaTeX, but unless I can find answers to these, I will go on with the Ms Word solution.


title: How to change or hide the word 'pages' in the reference list using bibtex?

text: I am using bibtex to generate a reference list. Given those .tex and .bib files test.tex               \documentclass[a4paper]{IEEEtran}     \usepackage{german}          \begin{document}         \cite{test}         \bibliographystyle{plain}         \bibliography{literature}     \end{document}      literature.bib               @inbook{test,     author = {test},     title = {test},     year = {test},     pages = {1--2}     }      the result of running pdflatex, bibtex and pdflatex is similar to > [1] > > LITERATUR > > [1] test. _test_ , pages 1–2. test. Note that using `\usepackage{german}` changes References to **Literatur** , while **pages** is untouched. I would prefer to use **S.** instead of **pages** , but if it is only possible to hide **pages** completely, that's fine as well. How can I accomplish this? Edit: Desired Output: > [1] > > LITERATUR > > [1] test. _test_ , S. 1–2. test.


title: TikZ-PGF child nodes in different locations

text: When I use TiKz to draw two trees, each in a nested picture, the position of the middle child of the second tree is different from the first. This is even though the code for the trees is basically identical (save the right=of test parameter). ![enter image description here](http://i.stack.imgur.com/y0AAT.png) Am I doing something wrong? Is there a way to fix this so that both middle children are positioned directly under their respective parents? Code:               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{positioning}          \begin{document}     \begin{tikzpicture}          \tikzstyle{every node}=[draw]          \node (test) {     \begin{tikzpicture}     \node {}         child { node {} }         child { node {} }         child { node {} };     \end{tikzpicture}     };          \node [right=of test] {     \begin{tikzpicture}     \node {}         child { node {} }         child { node {} }         child { node {} };     \end{tikzpicture}     };          \end{tikzpicture}     \end{document}


title: Problem with `longtabu` package not doing pagebreak

text: I wanted to insert some text in my `longtabu` table and was surprised that I don't get a pagebreak and the whole text is on the second page. The table doesn't even break the page on the second page. Here is my MWE:               \documentclass[pdftex, 12pt, oneside]{book}          \usepackage[ngerman]{babel}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lipsum}     \setlength{\parindent}{0pt}     \usepackage[scaled]{helvet}         \renewcommand{\familydefault}{\sfdefault}     \usepackage{setspace}     \usepackage{longtable}     \usepackage{tabu}     \usepackage[paper = a4paper, margin = 1in]{geometry}          \begin{document}       \begin{onehalfspace}         Some text above:\\         \lipsum[1]         \begin{longtabu} to \linewidth {| X |}           \hline           \bfseries{Example table}\\           \hline           \endhead           \lipsum[2-7] \\           \hline                 \end{longtabu}       \end{onehalfspace}     \end{document}      Am I missing something?


title: Is there way to put hard space after defined words?

text: In Polish typography, one should avoid putting prepositions at the end of the line.   Example:   `Nie wiedziałem, że nie umieszcza się przyimków na   końcu strony.` \- bad   `Nie wiedziałem, że nie umieszcza się przyimków   na końcu strony.` \- good Can I force LaTeX to put `~` after every word that is a preposition (e.g. `w`, `z`, `na`, `o` etc...) so I don't need to put them manually?


title: Pass options to the scope that is internally created by preaction

text: In the reply to this question on shadows, it was suggested to use the `backgrounds` library so that the shadow of one object doesn't overlap another object drawn previously. If I understand the documentation correctly, I have to pass `on background layer` as an option to the `scope`, not to the `path`. On the other hand, a `preaction` constructs a scope internally (according to the docs). Is it possible to change the options for the scope that is constructed internally by `preaction`? How? If not, an enhancement to TikZ would solve the "overlapping shadows" problem in an elegant way.


title: Strange error related to \verb in section titles

text: I'm writing a document about LaTeX, a sort of guide for my classmates. I've transported the here present practice of distinguishing code from text (backticks and 4-space indenting) by using `\verb` to show code. Trouble is, I have section titles which are package names, e.g. `\subsection*(\verb"thmtools")` coupled with `\addcontentsline{toc}{subsection}{\verb"thmtools"}`. The result of that is the following error:               Runaway argument?     |\@empty \relax \hbox {}#I\catcode `\ \active \<let>-command \csname\endcsname     ./Preambolo consigliato.tex:586: Paragraph ended before \HyPsd@@ProtectSpacesFi     was complete.     <to be read again>                     \par      l.586 ...ntsline{toc}{subsection}{\verb"geometry"}`      I therefore tried to construct an MWE to post here, writing:               \documentclass{report}       \begin{document}       \section*{\verb"mu"}       \addcontentsline{toc}{section}{\verb"mu"}       \tableofcontents       \end{document}      only with that the error has changed to:               ./mu26.tex:13: LaTeX Error: \verb illegal in command argument.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.13 \section*{\verb"mu"}      Stranger still, with `thmtools` as a title the error vanishes, whereas with `geometry` it reappears! I've gisted `.tex` and `.log` at https://gist.github.com/anonymous/8235120, and `.aux`, `.out`, `.synctex.gz`, `.toc` and `.pdf` are blank or inaccessible. Why _is_ this happening?


title: How to perform an action once Mathjax loaded completely?

text: I'm developing an online exam application.The questions contain just text or equations or both text and equations. The equations are displayed using Mathjax.There is a timer on the page. I want to start the timer only when the Mathjax equations are loaded completely.If the question doesn't contains any equation then the timer has to be started without waiting for Mathjax.How can this be done? The application is developed in PHP.


title: How to typeset this symbol?

text: ![symbol i would like to typeset](http://i.stack.imgur.com/NElXD.png) It's not `\mathscr{I}`, which is more italic (slanted)


title: How do I insert a tie (~) under expl3 syntax?

text: I need to define a token list of the form               \tl_new:N  \g_silly_tl     \tl_set:Nn \g_silly_tl { Text ~ and ~ a ~ tie:?? }      How do I do this? * * * More generally, is there a reference where one can see how to input characters 'normally' under expl3 syntax?


title: \makeglossaries conflict with indexing

text: This is my first post to ask for help since I cannot find any solution. I use MacTex. I am using glossaries pkg to generate list of acronyms, symbols and glossary of terms. I want to include also an index, however, the instruction `\makeglossaries` won't let any index to be generated. When I omit `\makeglossaries` and `\gls{whatever}` from the code (and delete the temp files) the index is generated, but of course not everything else related to glossaries. Here is my MWE:               \documentclass[a4paper, 14pt, oneside]{article}          \usepackage{makeidx}     \usepackage[     acronym,     toc,     shortcuts,     ]{glossaries}     \glsaddall          %\makeglossaries     \makeindex               \begin{document}     \newacronym{iex}{IEX}{Ion Exchange Chromatography}          Some dumb text\index{test} and %\gls{iex} and again \gls{iex}          \printindex     \printglossary[type=\acronymtype]               \end{document}      Could somebody please explain me what am I doing wrong, the conflict here or what can I do to avoid it? Thanks in advance.


title: Using songs.sty, how do I make a small index not consume the entire page?

text: I'm building a song book with the songs package from songs.sourceforge.net and I'm trying to create topical indexes for songs. The small indexes consume an entire page each. I'd like to squeeze them so they don't take up a whole page. Here's an MWE:               \documentclass[12pt,twoside,titlepage]{article}     \usepackage[top=0.7in, bottom=0.7in, left=1in, right=1in]{geometry}     \usepackage{times}     \title{My MWE}          \usepackage[lyric]{songs}     \newindex{titleidx}{titleidx}     \newauthorindex{authoridx}{authoridx}     \newindex{mytopic}{mytopicidx}     \begin{document}          \songcolumns{1}          \showindex{Title Index}{titleidx}     \showindex{Author Index}{authoridx}     \showindex{My Topic}{mytopic}               \songsection{}          \begin{songs}{titleidx,authoridx}               \beginsong{Just some song}[       by={me},       cr={},       li={}]          \indextitleentry[mytopic]{\songtitle}          \endsong          \end{songs}          \end{document}


title: Can \documentclass{minimal} create documents with nonstandard page sizes?

text: I need to create a document for a square piece of paper. I've been trying to use `\documentclass{minimal}`, but it doesn't work. This is my code:               \documentclass{minimal}          \special{papersize=14in,14in}     \setlength{\paperwidth}{14in}     \setlength{\paperheight}{14in}     \setlength{\textwidth}{12in}     \setlength{\textheight}{12in}          \topskip0pt     \setlength{\headheight}{0pt}     \setlength{\headsep}{0pt}     \setlength{\topmargin}{0pt}     \setlength{\oddsidemargin}{0pt}          \begin{document}     \ldots     \end{document}      But the PDF file I get is by no means square. What is wrong with my code?


title: Non-repository management of TeXLive packages on Ubuntu

text: How do I install a package which is supplied by a publisher (like Springer or Elsevier)? In MikTex (windows), I have to copy it into specified folder and than run some file which install the package. What are the corresponding actions in ubuntu with TeXLive?


title: Why we can not use \< to specify \textless

text: Less than and more than can be specified by using `\textless` and `\textgreater`. Why we can not use something like `\<` or `\>`? Won't it be much easier?


title: Still having difficulty with use of `\expandafter`

text: Firstly, my apologies for any previous confusion, I've separated out various questions onto distinct pages. This problem came up in the context of trying to split a decimal number. Good solutions to both my questions with pgf and package independent have been provided or will be soon on those pages. The main intent of this question is that I'm trying to better understand how things are expanded in LaTeX. There is good information in the answers below about just this aspect. Perhaps if those people wouldn't mind moving sidetrack stuff to either of the two questions linked above to help me simplify the situation. I realise this is a bit tricky as the expansion idea was being discussed in the context of splitting a length. Thanks in advance. The MWE is just a whole bunch of ideas I was experimenting with, trying to expand values to get at what I wanted and failing because I don't yet fully understand how LaTeX, or TeX, expands various types of value. **MWE Output** ![MWE Output](http://i.stack.imgur.com/TN301.jpg) **MWE Code**               \documentclass[12pt]{article}     \usepackage[a5paper,margin=14mm]{geometry}          \makeatletter     \def\printplainbefore#1{\expandafter\@printplainbefore#1..\@nil}     \def\@printplainbefore#1.#2.#3\@nil{#1}     \def\printplainafter#1{\expandafter\@printplainafter#1..\@nil}     \def\@printplainafter#1.#2.#3\@nil{#2}          \newcommand*{\getlength}[1]{\strip@pt#1}          \makeatother          \def\mythe#1{\expandafter\getlength{#1}}          \newcommand{\savenum}[2]{\expandafter\xdef\csname num#1\endcsname{#2}}     \newcommand{\getnum}[1]{\csname num#1\endcsname}          \newlength{\thislength}     \setlength{\thislength}{123.456pt}     \tracingmacros=1          \begin{document}     \par The: \the\thislength         \quad Split: \printplainbefore{\the\thislength} -- \printplainafter{\the\thislength}     \par Getlength: \getlength{\thislength}         \quad Split: \printplainbefore{\getlength{\thislength}} -- \printplainafter{\getlength{\thislength}}     \par MyThe: \mythe\thislength         \quad Split: \printplainbefore{\mythe\thislength} -- \printplainafter{\mythe\thislength}     \par Getlength variable first: \getlength{\thislength}         \quad Split: \xdef\test{\getlength{\thislength}} \printplainbefore{\test} -- \printplainafter{\test}     \par Getlength save: \getlength{\thislength}         \quad Split: \savenum{thislength}{\getlength{\thislength}} \printplainbefore{\getnum{thislength}} -- \printplainafter{\getnum{thislength}}     \end{document}


title: Changing from \def to \newcommand*

text: Consider the following example:               \documentclass{article}          \usepackage{pstricks-add}     \def\door(#1,#2)#3{       \psline[         linecap = 0,         linewidth = 1.5\pslinewidth,         linecolor = white       ](#1,#2)(!#1 #2 #3 add)       \psline[         linecap = 2       ](#1,#2)(!#1 #3 add #2)       \psarc[         linestyle = dotted       ](#1,#2){#3}{0}{90}     }          \begin{document}          \begin{pspicture}(1,1)       \door(0,0){1}     \end{pspicture}          \end{document}      Is it possible to change `\def` to `\newcommand*` and keep the syntax               \door(a,b){c}      instead of               \door{0}{0}{1}      ?


title: Simple list of abbreviations manually

text: I have written my whole document without using any packages like `nomencl` or `acronym` because it wasn't necessary in my case, that means I only have a few abbreviations which should fit on one page easily. I'd like to do that by hand, that means manually within a tabular (or maybe longtable?) environment. The problem is, I cannot fix the abbreviations column on the left while at the same time increasing the distance to the column on the right. If possible I'd like to fill the distance with `cdot`. So the list should consist of 2 columns, the left fixed with variable/changable distance to the right. Here is my MWE with `tabularx`. You will see the prob if you compile: every word fills 2 lines instead of just one if the distance is too small (in this case 3cm).               \documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}     \usepackage{tabularx}     \begin{document}     \begin{tabularx}{3cm}{XX}     US  & United States \\     EU & European Union \\     Gvmt & Government \\     \end{tabularx}     \end{document}      Let me know. If it's not possible, I might have to use one of the above packages. But I think that's not the most effective way in my case. edit: This seems to be a better MWE, but I am still not sure which environment is best in this case and which kind of columns are.               \documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}     \usepackage{tabularx}     \begin{document}     \begin{tabular}{p{4cm}p{12cm}}     US  & United States \\     EU & European Union \\     Gvmt & Government \\     \end{tabular}     \end{document}      I have found this: Creating abbreviations list with manual entries but it does not add `cdots` and it doesn't work for longer abbreviations because the distance b/w the columns is too small. I'd like to have control over the distance. Thanks.


title: Font installed, compiles to dvi, but fails compiling to pdf. "font at 600 not found"

text: After having answered this question I thought "hmm, maybe I should actually install that package and see if it's as good as it looks... So I tried. I downloaded `ccicons.tds.zip` from here and unzipped it into my `~/texmf` this is a procedure that has worked for me before with siunitx and a couple of other packages, so I thought there'd be no problems here. But when I try and use the package, I got an error. So I went and had a look at the readme, and it told me to run `updmap --enable Map ccicons.map` so I did. But I still get an error:               kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 cciconsmktexpk: don't know how to create bitmap font for ccicons.     kpathsea: Appending font creation commands to missfont.log.      )     !pdfTeX error: pdflatex (file ccicons): Font ccicons at 600 not found      ==> Fatal error occurred, no output PDF file produced!          LaTeX exited abnormally with code 70 at Thu Jan 13 17:39:09      I don't know how to fix this. If I compile to DVI rather than straight to PDF (that is, if I use auctex's LaTeX mode rather than the PDFLaTeX mode) I can compile the document, but the `\ccLogo` appears as a capital gamma... Also, when I compile to pdf, it says `LaTeX successfully formatted [0] pages` but the log file contains the error above. I'm on Ubuntu 10.10 using the package manager version of TeXlive. I have similar issues with certain of the TeX gyre fonts installed through the package manager: `tgpagella` and `tgtermes` for instance. I get more or less the same behaviour: compiles 0 pages in PDFLaTeX mode, logs an error about font not found (again mentioning "at 600" whatever that means), but I can compile to dvi fine... I've run just about every version of `updmap` I can imagine, and since the issue also occurs with fonts installed through the ubuntu package manager, I don't think the issue has to do with that. Complete log available here (with listfiles)


title: How to add indentation to all verbatim environment?

text: I have a style where all paragraphs have indentation of about 5cm. Verbatim environment does not have any indentation to the combination of paragraphs and verbatim environments does not look good. Something like this: > >                  This is paragraph ... >               Next line of the same paragraph. >   > > and this is verbatim Is it possible to define an global indent for verbatim environment?


title: Label referring problem

text: I'm new here and new user of LaTeX I'm trying to write my PhD, intermediate reports with it and I am facing some problems. I tried to look on the internet for 2 weeks, but found no answer to my problem (or maybe I'm not getting everything I read). I'm posting the log file:               This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8)     entering extended mode     ("E:/Rapport/Rapport TeX/Exemples/ModeleRapportStageLatex/Global.tex"     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, german, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french,      greek, italian, russian, turkish, ukenglish, farsi, loaded.     ("C:\Program Files\MiKTeX 2.8\tex\latex\base\report.cls"     Document Class: report 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files\MiKTeX 2.8\tex\latex\base\size12.clo"))     ("C:\Program Files\MiKTeX 2.8\tex\generic\babel\babel.sty"     *************************************     * Local config file bblopts.cfg used     *          ("C:\Documents and Settings\karoui\Application Data\MiKTeX\2.8\tex\latex\arabi\     bblopts.cfg") ("C:\Program Files\MiKTeX 2.8\tex\generic\babel\frenchb.ldf"     ("C:\Program Files\MiKTeX 2.8\tex\generic\babel\babel.def")     *************************************     * Local config file frenchb.cfg used     *     ("C:\Program Files\MiKTeX 2.8\tex\generic\babel\frenchb.cfg")))     ("C:\Program Files\MiKTeX 2.8\tex\latex\carlisle\scalefnt.sty")     ("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\keyval.sty")     ("E:\Rapport\Rapport TeX\Exemples\ModeleRapportStageLatex\ucs.sty"     ("E:\Rapport\Rapport TeX\Exemples\ModeleRapportStageLatex\uni-global.def"))     ("C:\Program Files\MiKTeX 2.8\tex\latex\base\inputenc.sty"     ("E:\Rapport\Rapport TeX\Exemples\ModeleRapportStageLatex\utf8x.def"))     ("C:\Program Files\MiKTeX 2.8\tex\latex\ltxmisc\url.sty")     ("C:\Program Files\MiKTeX 2.8\tex\latex\geometry\geometry.sty"     ("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\ifpdf.sty")     ("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\ifvtex.sty")     ("C:\Program Files\MiKTeX 2.8\tex\latex\geometry\geometry.cfg"))     ("C:\Documents and Settings\karoui\Application Data\MiKTeX\2.8\tex\latex\listin     gs\listings.sty"     ("C:\Documents and Settings\karoui\Application Data\MiKTeX\2.8\tex\latex\listin     gs\lstmisc.sty")     ("C:\Documents and Settings\karoui\Application Data\MiKTeX\2.8\tex\latex\listin     gs\listings.cfg")) ("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\lscape.sty"     ("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\graphics.sty"     ("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\trig.sty")     ("C:\Program Files\MiKTeX 2.8\tex\latex\00miktex\graphics.cfg")     ("C:\Program Files\MiKTeX 2.8\tex\latex\pdftex-def\pdftex.def")))     ("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\graphicx.sty")     ("C:\Program Files\MiKTeX 2.8\tex\latex\tools\multicol.sty")     ("C:\Program Files\MiKTeX 2.8\tex\latex\base\makeidx.sty")     Writing index file Global.idx     ("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\color.sty"     ("C:\Program Files\MiKTeX 2.8\tex\latex\00miktex\color.cfg"))     ("C:\Documents and Settings\karoui\Application Data\MiKTeX\2.8\tex\latex\setspa     ce\setspace.sty"     Package: `setspace' 6.7 <2000/12/01>     ) ("E:\Rapport\Rapport TeX\Exemples\ModeleRapportStageLatex\Global.aux"          LaTeX Warning: Label `image_EFA' multiply defined.               LaTeX Warning: Label `image_EFA' multiply defined.               LaTeX Warning: Label `image_EFA' multiply defined.               LaTeX Warning: Label `image_EFA' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.               LaTeX Warning: Label `image_courbe' multiply defined.          ! Missing \endcsname inserted.     <to be read again>                         \unhbox      l.81 \newlabel{image_crit\IeC {\`e}re}{{4.2}{26}}          ?       So I hope someone can help me. I removed all labels by putting `%` before them. I removed the whole text. Nothing changes, I still get the same error.


title: Get tokens between two commands

text: I'm trying to create a `screenplay`-like class that uses a very simple syntax to create the dialogue, _and_ dumps it as a plain text file for use in subtitles. To divide the subtitle sections I use `&`, `^` sets a new speaker, like that:               \documentclass{article}     \catcode`\^=13     \def^#1: {\par \textbf{#1:}}     \catcode`\&=13     \def&{\par \hspace{10pt}}     \begin{document}      ^Alice: &Hello; Bob. &What;'s up?      ^Bob: &Nothing;, really. &Goodbye.;     \end{document}      Now I would like to get at the text between `&...&` (i.e. from `&` to just before the next `&`, so `&a&b&c` should expand to `\foo{a}\foo{b}\foo{c}`) to save it with a running index to my text file. So I tried `\bgroup`/`egroup` as in:               \documentclass{article}     \usepackage{color}     \def\testcommand{\textcolor{blue}}     \catcode`\^=13     \def^#1: {\egroup \par \textbf{#1:} \bgroup}     \catcode`\&=13     \def&{\egroup \par \hspace{10pt} \testcommand\bgroup}     \begin{document}      \bgroup      ^Alice: &Hello; Bob. &What;'s up?      ^Bob: &Nothing;, really. &Goodbye.;      \egroup     \end{document} And it seems to work, since `\textcolor` doesn't just colorize the next letter but the whole line, but when I use `\def\testcommand#1{(#1)}` it is called with an empty argument (produces _() Hello Bob. () What…_ ). I guess this has something to do with the fact that when I use `\begingroup`/`\endgroup` with _my_ `\testcommand` nothing changes but `\textcolor` breaks with `Extra }, or forgotten \endgroup` on the first `&`. In `color.sty` they use `\def\textcolor#1#` which I have never seen before (and when I use it with my `testcommand` it breaks with `\begin{document} ended by \end{)}`. What magic is that? Very difficult to google… My other attempt `\def&#1&{ \testcommand{#1} }` doesn't work either because it eats the next `&`… (is there some kind of lookahead? So I could use `\def&` and eat tokens until the next one would be `&` or `^`?) Any pointers appreciated!


title: Why can't I get the height of my memoir typeblock right?

text: I'm trying to define my own type area on A5 paper using the `memoir` commands, according to the following construction after Tschichold, where the text width is given by Høgholm's curve fitting of Bringhurst's copyfitting table: ![type area construction](http://i.stack.imgur.com/eXGsY.png) If we ignore for the moment that the header should probably be considered part of the type area with the style used in the following MWE, the definition should be relatively straightforward:               \documentclass{memoir}     \renewcommand*{\sfdefault}{uop} % Classico (Optima clone) font     \renewcommand{\familydefault}{\sfdefault} % sans serif default     \setstocksize{210mm}{148.5mm}     \settrimmedsize{210mm}{148.5mm}{*}     \setlxvchars     \settypeblocksize{*}{\lxvchars}{1.41421356}     %\settypeblocksize{*}{289.25285pt}{1.41421356}     %\settypeblocksize{409.06398pt}{289.25285pt}{*} % should be the same as either definition above     \setulmargins{21.9mm}{*}{*}     %\setulmargins{*}{*}{2} % should be about the same as the definition above     \setlrmargins{*}{*}{2}     \setheaderspaces{*}{18.06749pt}{*} % keep standard head sep because I don't know how to determine the "right" one     \checkandfixthelayout     \pagestyle{ruled}     \usepackage{layouts}     \usepackage{lipsum}     \begin{document}     \chapter{Lorem Ipsum}     \section{Dolor Sit Amet}     \lipsum\lipsum     \newpage     \pagevalues     \begin{figure}     \currentstock     \oddpagelayouttrue     \stockdiagram     \caption{Odd page layout for this document}     \end{figure}     \end{document}      This is the output of `\checkandfixthelayout`:               Stock height and width: 597.50787pt by 422.52342pt     Top and edge trims: 0pt and 0pt     Page height and width: 597.50787pt by 422.52342pt     Text height and width: 418pt by 289pt     Spine and edge margins: 44.41833pt and 88.85223pt     Upper and lower margins: 62.80518pt and 116.7027pt     Headheight and headsep: 12pt and 18.06749pt     Footskip: 25.29494pt     Columnsep and columnseprule: 10pt and 0pt     Marginparsep and marginparwidth: 7pt and 74.85223pt     Sidecapsep and sidecapwidth: 7pt and 128pt     Sidebarhsep and sidebarwidth: 7pt and 128pt     Sidebarvsep and sidebartopsep: 12pt and 0pt     Sidebarheight: 548.39996pt     Sidefoothsep and sidefootwidth: 7pt and 128pt     Sidefootvsep and sidefootheight: 12pt and 548.39996pt      However, this is what the following values _should_ look like:               \paperheight = 597.507874pt     \paperwidth = 422.523425pt     \textheight = 409.06530pt     \textwidth = 289.25285pt     \spinemargin = 44.1017717pt     \uppermargin = 62.3115354pt      The crucial difference is in `\textheight` which is about 9pt too large. This is also visible when the diagonals from the construction are overlaid on top of the actual text: ![diagonals from construction on actual text](http://i.stack.imgur.com/o4VDZ.jpg) It might well be that I made a stupid mistake or misunderstood the `memoir` manual. In either case, I'd be really glad if someone could tell me what causes the problem.


title: (Total and Surjective) Relation - arrows

text: I am looking for following symbols: Total Relation: <<->   Surjective Relation: <->>   Total surjective Relation: <<->> This is the sort of thing I’m looking for (source): ![enter image description here](http://i.stack.imgur.com/8eGo5.png) Can anybody help me? Thanks in advance.


title: Tikz - How to Draw Boxes Around Set of Nodes

text: How to draw the boxes as shown in the attached image? I could only manage to draw the chart but could not highlight the desired node / nodes with a rectangle box. Preferably dotted. I could not draw dotted in MS paint. ![alt text](http://i.stack.imgur.com/2yfGv.jpg)               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{figure}[!htb]     \begin{center}     \begin{tikzpicture}     [auto,      block/.style ={rectangle, draw=blue, thick, fill=blue!20, text width=5em,align=center, rounded corners, minimum height=2em},      block1/.style ={rectangle, draw=blue, thick, fill=blue!20, text width=5em,align=center, rounded corners, minimum height=2em},      line/.style ={draw, thick, -latex',shorten >=2pt},      cloud/.style ={draw=red, thick, ellipse,fill=red!20,      minimum height=1em}]     \draw (2.5,-2) node[block] (C) {Subanta};     \path (0,-3) node[block] (G){ Pumlinga}           (0,-4) node[block] (H){ Strilinga}           (0,-5) node[block] (I){ Napumsaka}           (5,-3) node[block] (J){ Pumlinga}           (5,-4) node[block] (K){ Strilinga}           (5,-5) node[block] (L){ Napumsaka};     \draw (C.south) -- ++(0,-0.25) coordinate (linga);     \draw (linga) -- ++(-1,0) coordinate (ling);     \draw[-latex] (ling) |- (G.east);     \draw[-latex] (ling) |- (H.east);     \draw[-latex] (ling) |- (I.east);     \draw (linga) -- ++(1,0) coordinate (hling);     \draw[-latex] (hling) |- (J.west);     \draw[-latex] (hling) |- (K.west);     \draw[-latex] (hling) |- (L.west);     \end{tikzpicture}     \end{center}     \caption{Summary of Linga } \label{linga}     \end{figure}     \end{document}      Thanks for your help.


title: How to fill a rectangle with two corners on the function

text: I would like to be able to apply the same thing in the following figure for any function: ![enter image description here](http://i.stack.imgur.com/OxfWS.jpg) Right now my code is like this(which is an edited version of some post here in Tex.sx): Wich only fills under the curve completely!               \documentclass[11pt,bezier]{article}     \usepackage{xstring}     \usepackage{collcell}     \usepackage{pgfplots}     \usetikzlibrary{patterns}     \begin{document}     \begin{figure}[ht!]         \centering         \begin{tikzpicture}             \begin{axis}[xmin=-1,xmax=9,xlabel={Y},ymin=0,ymax=10]              \addplot[color=black,domain=-1:9,samples=100]                 {(-(x-3)^2+(x-3)^4-(x-1)^3+4)/40+5};             \addplot[color=black,fill=lime,  domain=5.8:7,samples=100]                 {(-(x-3)^2+(x-3)^4-(x-1)^3+4)/40+5} \closedcycle;             \end{axis}         \end{tikzpicture}         \end{figure}     \end{document}


title: hyperlink to the ToC page

text: I want to have hyperlinks pointing to the ToC page. (In my MWE, the links are situated in the section titles, but it makes no difference for the discussion here). My MWE:               \documentclass{article}     \usepackage{hyperref}     \usepackage{blindtext}          \let\oldtableofcontents\tableofcontents     \renewcommand{\tableofcontents}[0]{\label{toc}\oldtableofcontents}          \begin{document}     First page\newpage     \tableofcontents\newpage          \section{Premier. Go to \hyperref[toc]{toc}}     \blindtext  \blindtext       \section{deuxieme. Go to \hyperref[toc]{toc}}     \blindtext  \blindtext       \section{Troisieme. Go to \hyperref[toc]{toc}}     \blindtext  \blindtext       \end{document}      It works only partially: the links are there, but if I click on them, it goes to the "first page", instead of the ToC page. I redefined `\tableofcontents`, in order to put a label juste before `\tableofcontents`, but I guess this is the problem. In the original command `\tableofcontents`, the must be at the beginning some initialisation, like `\newpage` or similar, which makes the problem.


title: bibtex: editor field: how to clasp a none-name value?

text: For compiling a bibliography I'm using BibLaTex and for managing the bib-file I'm using BibDesk. The names-sequence is surname before given name(s) separated by a comma. For example: Müller, Peter (2011): XYZ. Stuttgart: Verlag. For incollections it is the same schema, but with added editor for example: Müller, Peter (2010): XYZ. In: Meier, Hans (Hrsg.): ABC. Tübingen: Verlag, S. 5-29. For the cases of incollections I'm having the problem, that the editor value is not always a sequence of given names and surname, sometimes it's an association like "Deutsche Gesellschaft für Sprachheilkunde". This will be compiled as follows: Müller, Peter (2009): XYZ. In: Sprachheilkunde, Deutsche Gesellschaft für (Hrsg.): ABC. Hamburg: Verlag, S. 12-51. Is there a easy way to clasp the associations name, best in BibDesk with the use of brackets. Or where and how do I need to define asscociation names as not splitable?


title: Best practice for quoting a website

text: How should I quote a website? E.g. I'm using the android reference. Here is my BibTeX entry:               @ELECTRONIC{Google2012,       author = {Google},       month = {01},       year = {2012},       title = {Android Developers},       language = {english},       url = {http://developer.android.com/reference/},     }      I quote different parts of that page and I think it is a bad idea adding dozens of references to the same site only to another page. Actually I'm using this:               The Activity Lifecycle is blah blah\footnote{\url{http://developer.android.com/reference/android/app/Activity.html\#Fragments}}.\cite{Google2012}      But I think I should cite it e.g.:               The Activity Lifecycle is blah blah\cite[\url{http://developer.android.com/reference/android/app/Activity.html\#Fragments}]{Google2012}.      But that produced a very long line which I don't want. My next try was this here:               The Activity Lifecycle is blah blah\cite[Lifecycle\footnote{\url{http://developer.android.com/reference/android/app/Activity.html\#Fragments}}]{Google2012}.      The last one produces some strange errors:               Overfull \hbox (6.45833pt too wide) in paragraph at lines 463--464     []\T1/lmr/m/n/12 The Ac-ti-vi-ty Li-fe-cy-cle is blah blah[[]Goo12[], []$\T1/lm     tt/m/n/12 http : / / developer . android . com / reference /$     ! Use of \@xfootnote doesn't match its definition.     \@ifnextchar ...eserved@d =#1\def \reserved@a {#2}     \def \reserved@b {#3}\futu...     l.467 .../Activity.html\#Fragments}}]{Google2012}.      So what is the best practice for quoting and how can I fix my last solution? * * * After reading the answers I build my own solution. But I have got some trouble with that quotes in image lables. Here is the compleate example:               \documentclass[         a4paper,         parskip,         pdftex,         ]{scrreprt}          \usepackage[utf8]{inputenc}     \usepackage{graphicx}     \usepackage[backend=bibtex, natbib=true, citestyle=alphabetic, bibstyle=alphabetic]{biblatex}     \usepackage{hyperref}     \usepackage[all]{hypcap}     \usepackage{csquotes}     \usepackage{etoolbox}     \usepackage{blindtext}          \bibliography{source}          \newrobustcmd{\staticURL}[1]{%       \expandafter\footnote\expandafter{\expandafter\url\expandafter{\detokenize{#1}}}}          \newcommand{\citeUrl}[3]{\cite[#1\staticURL{#2}]{#3}} %what, url, source          \begin{document}     \chapter{Example}     Here is some text related on bluetooth\citeUrl{Activity}{http://developer.android.com/reference/android/bluetooth/package-summary.html\#footer}{Google2012}          \Blindtext          \begin{figure}[htp]       \centering       \includegraphics[width=10cm]{img/activity_lifecycle}       \caption{Activity Lifecycle \citeUrl{Activity}{http://developer.android.com/reference/android/app/Activity.html\#Fragments}{Google2012}}       \label{activity_lifecycle}     \end{figure}     \end{document}      * * * In mention of "Note that # doesn't need to be escaped." I'll get this error:               Chapter 1.     ! Illegal parameter number in definition of \reserved@a.     <to be read again>                         f     l.26 ...h/package-summary.html#footer}{Google2011}


title: Fixing an overfull box

text: I have an overfull box in a French text which looks like this: ![overfull box](http://i.stack.imgur.com/Gxojk.png) The sequence at the end of the line is:               d'Ananias~: \og Vous      "Vous" cannot be hyphenated and `\og` inserts a non-secable space, so the only place where it could be cut is after the colon. I'm using XeTeX with microtype (2.5 beta6 for XeTeX support). How can I fix this overfull box? Do I have to allow lines to stretch more (and how)?


title: Is it wrong to use \clearpage instead of \newpage?

text: The commands `\newpage` and `\clearpage` both force a page break. In addtion, the latter command also "flushes" all pending floats from the stack, i.e., forces them to be typeset starting on the page that follows the page break. My question is: Is it ever a mistake to use `\clearpage` rather than `\newpage`, other than in cases where one might _not_ want any pending floats to be flushed? From a casual inspection of the definitions of the two commands (see below), I can't tell if there's any trouble lurking in always using `\clearpage`. For ease of reference, here's the definition of `\newpage` (from `latex.ltx`):               \def \newpage {%       \if@noskipsec         \ifx \@nodocument\relax           \leavevmode           \global \@noskipsecfalse         \fi       \fi       \if@inlabel         \leavevmode         \global \@inlabelfalse       \fi       \if@nobreak \@nobreakfalse \everypar{}\fi       \par       \vfil       \penalty -\@M}      and here's the definition of `\clearpage` \-- note that it invokes `\newpage`:               \def\clearpage{%       \ifvmode         \ifnum \@dbltopnum =\m@ne           \ifdim \pagetotal <\topskip             \hbox{}%           \fi         \fi       \fi       \newpage       \write\m@ne{}%       \vbox{}%       \penalty -\@Mi     }


title: Is there an alternative to \Call{Algorithm}?

text: I would like to format names of algorithms just as they appear inside the `algorithmic` environment. For an example, see the title "An unsuccessful attempt: Flip-and-Match" of this paper. So far I've been using `\Call{MyFunc}{}`, but guts tell me this is not the right thing to do, and more importantly, it doesn't work if I want to use it in section titles. What is the proper command to use for such cases?


title: How to make verbatim text in multicols environment not overflow to other columns?

text: I prefer to use `\begin{multicols}{2}` over `\documentclass[12pt,twocolumn]{article}` so I can control when to have 2 columns and when not. The problem comes when using `\begin{Verbatim}....\end{Verbatim}`. With `\documentclass[12pt,twocolumn]{article}` verbatim automatically wraps inside each column and will not overflow to the other column. But when using `\begin{multicols}{2}` it does not do this, and it will overflow to the column next to it. MWE:               \documentclass[12pt]{article}     \usepackage{multicol}     \setlength{\columnsep}{20pt}     \setlength{\columnseprule}{0.01pt}     \usepackage{fancyvrb}          \begin{document}     \begin{multicols}{2}     \begin{Verbatim}     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     \end{Verbatim}     \end{multicols}          \end{document}      MWE for `twocolumn`               \documentclass[12pt,twocolumn]{article}          \setlength{\columnsep}{20pt}     \setlength{\columnseprule}{0.01pt}     \usepackage{fancyvrb}          \begin{document}     \begin{Verbatim}     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     \end{Verbatim}     \end{document}      side-by-side ![enter image description here](http://i.stack.imgur.com/E3guD.jpg) The solution I came up with is to put `Verbatim` in minipage, using `columnwidth` as size for width of minipage, and that worked to some extent, but for some reason, I can't make the width of the minipage smaller than column width, as verbatim still goes a little over. When I write say `0.6\columnwidth` it has no effect on the result. It looks the same for any value I tried.               \documentclass[12pt]{article}     \usepackage{multicol}     \setlength{\columnsep}{20pt}     \setlength{\columnseprule}{0.01pt}     \usepackage{fancyvrb}          \begin{document}     \begin{multicols}{2}     \begin{minipage}{0.6\columnwidth}     \begin{Verbatim}     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     blablabla blablabla blablabla blablabla     \end{Verbatim}     \end{minipage}     \end{multicols}          \end{document}      ![enter image description here](http://i.stack.imgur.com/BBfHP.jpg) **question is: What is the best way to handle`Verbatim` in multicols environment?**


title: Beamer: Uncover underbrace

text: I've got an underbrace (`\underbrace{foo}_{bar}`) which I want to uncover (i.e. `foo` should be there from the beginning, while the underbrace and the `bar` should be uncovered on the next slide. I've tried the following, which (not surprisingly) doesn't work:               \documentclass{beamer}          \begin{document}     \begin{frame}       Without uncover (this is what it should look like on the second subframe):       \begin{displaymath}         \underbrace{foo}_{bar}       \end{displaymath}       With uncover (doesn't work):       \begin{displaymath}         \uncover<2>{\underbrace}{foo}\uncover<2>{_{bar}}       \end{displaymath}     \end{frame}     \end{document}      In the second `displaymath`, the underbrace is displayed before `foo` and the `bar` as index to `foo`, and moreover the underbrace is immediately visible. Note that `\only` wouldn't be a solution because on one hand in my actual document I use `\setbeamercovered{transparent}` so the underbrace and the text below should be lightly visible from the beginning, and on the other hand `\only` would also not keep the space for the underbrace. So how can I achieve that?


title: Hyphenation in Beamer Presentations

text: I am using `beamer` in LaTeX to create a presentation. But it seems hyphenation is disabled. At least for the items inside `itemize` environments and text inside the blocks I don't see any hyphenation while by eye inspection I expect LaTeX to do automatic hyphenation and produce nicer paragraphs. Is there any specific command so that I can force LaTeX to run automatic hyphenation?


title: How to make "draft margin notes" for floats?

text: Page 394 of the memoir manual provides a snippet by Bastian Veelo for making margin comments out over the part of the stock paper that would be cut away. This very handy for making comments only appearing in the draft. However if I want to comment a float like for example a figure it complains about not being in outer par mode. How can I adopt the code:               \documentclass[draft]{memoir}          \makeatletter     \ifdraftdoc     \newlength{\draftnotewidth}      \newlength{\draftnotesignwidth}      \newcommand{\draftnote}[1]{\@bsphack%     {%% do not interfere with settings for other marginal notes      \strictpagecheck%      \checkoddpage%     \setlength{\draftnotewidth}{\foremargin}%      \addtolength{\draftnotewidth}{\trimedge}%      \addtolength{\draftnotewidth}{-3\marginparsep}%      \ifoddpage     \setlength{\marginparwidth}{\draftnotewidth}%     \marginpar{\flushleft\textbf{\textit{\HUGE !\ }}\small #1}%      \else     \settowidth{\draftnotesignwidth}{\textbf{\textit{\HUGE\ !}}}%      \addtolength{\draftnotewidth}{-\draftnotesignwidth}%      \marginpar{\raggedleft\makebox[0pt][r]{%% hack around     }% \fi     \parbox[t]{\draftnotewidth}{%%%%%%%%% funny behaviour      \raggedleft\small\hspace{0pt}#1%     }}\textbf{\textit{\HUGE\ !}}%     }\@esphack} \else     \newcommand{\draftnote}[1]{\@bsphack\@esphack} \fi     \makeatother          \begin{document}     \begin{figure}     \draftnote{Lorem ipsum}     \end{figure}     \end{document}       to work also with floats?


title: Get BibTeX to ignore citation numbering in a figure caption

text: Here's the problem. I have the main text of a document which includes a citation late in the document, say `\cite{ref20}`. One of my figure captions has in it, the `\cite{ref20}`. What happens is that the number given to `ref20` is now entirely dependent upon the location of the `figure` in the document. What I want is the numbering to be the same regardless of the position of the figure, so that a version with all figures grouped at the end has the same numbering. Any ideas?


title: Anonymous Functions (Closures) in LaTeX

text: Is there a way to have an anonymous function or closures in LaTeX. I am using Will Robertson's mlist, and I have need for several macros that have a very limited usefulness. So, I'd like to be able to define a macro in place, like this               \newfunc\wavefcn{\Psi}[elemcmd=\anon{\vec{r}_#2},index={1,2,:,n}]      where `\wavefcn` produces ![Psi as a function of n variables](http://i.stack.imgur.com/gZxYS.png). In the above declaration, `\anon{\vec{r}_#2}` is the anonymous function that is defined in place. How would one set this up?


title: Obstacles to simulating an amsmath matrix by a TiKZ matrix of math nodes

text: I'm trying to figure out a `TiKZ`-based solution to this problem involving arrows between matrix rows. To this end, I would like to at least be able to make a `matrix of math nodes` simulate the behaviour of the `matrix` environment from `amsmath`. I have encountered several problems in doing so. One of them is the appearance of the matrices themselves and their relation to the surrounding text. Consider the following example:               \documentclass{article}     \usepackage{amsmath,tikz}     \usetikzlibrary{matrix}          \newlength\mtxrowsep   \setlength\mtxrowsep{2ex}     \newlength\mtxcolsep   \setlength\mtxcolsep{\arraycolsep}          \begin{document}     \begin{gather*}         4 \times         \left[\begin{matrix} a & b \\ c & d \end{matrix}\right]     \qquad         4 \times         \left[\begin{tikzpicture}           \matrix [matrix of math nodes, ampersand replacement=\&,                    inner sep=0pt, column sep=\mtxcolsep, row sep=\mtxrowsep]               { a \& b \\ c \& d \\ };         \end{tikzpicture}\right]     \qquad         4 \times         \left[\begin{minipage}{1.7em}           {}\hfill\begin{tikzpicture}             \matrix [matrix of math nodes, ampersand replacement=\&,                      inner sep=0pt, column sep=\mtxcolsep, row sep=\mtxrowsep]                     { a \& b \\ c \& d \\   };           \end{tikzpicture}\hfill{}         \end{minipage}\right]     \end{gather*}     \end{document}      This produces the following output: ![comparison of matrices](http://i.stack.imgur.com/vjuoP.png) The genuine `amsmath` matrix is on the left. The matrix in the middle suffers from the fact that the `matrix of math nodes` in the `tikzpicture` environment is apparently sitting on top of the baseline of the surrounding math. The matrix on the right is properly aligned because it is sitting inside of a `minipage`, whose width was manually specified. (Not pictured is anything using `left delimiter` or `right delimiter`, which has spacing issues of its own and suffers from the same vertical alignment issues.) **Main questions.**   1. Is there any way native to `tikz` to change the vertical alignment of the `tikzpicture` for the matrix in the middle? (I didn't find anything whilst scanning through the manual...)   2. Is there any way to extract the width of an image automatically, to allow automatic resizing of the `minipage` for the matrix on the right?


title: How to create beamer slides with source code that can be copied?

text: We are converting our course slides from Powerpoint to LaTeX, to be able to offer all code in a more open format and to let students easily copy code from the slides. However, the latter does not seem to work: LaTeX or listings or beamer transform all code into more beautiful characters, which can not be copied anymore. Consider this LaTeX code:               \documentclass{beamer}          \usepackage{listings}          \begin{document}          \lstset{breakatwhitespace=true,     language=C++,     columns=fullflexible,     keepspaces=true,     breaklines=true,     tabsize=3,      showstringspaces=false,     extendedchars=true}          \begin{frame}[fragile]     \begin{lstlisting}     const char *processing() const{         somestring = "-1";     }     \end{lstlisting}     \end{frame}          \end{document}      Copying the code from a PDF opened in OSX Preview will result in a special asterisk, special quotes and even a different minus sign. How can this be avoided, how can we make sure all code can be copied immediately as-is? Or is the PDF viewer to blame? Then which format should we render out LaTeX to, to make sure the code can be copied: HTML?


title: How to make only specific entries in glossaries list small caps

text: I'm wondering how to make just specific entries in a glossary package acronym list appear in small caps. I found other threads where someone has asked how to make all entries small caps but not how to make just one specific entry in small caps. I've tried doing the following:               \documentclass[12pt,a4paper]{report}     \usepackage[T1]{fontenc}     \usepackage[acronym,sort=use,toc,nopostdot]{glossaries}          \newacronym{ac}{ac}{Alternating Current}     \newacronym{mosfet}{{\sc mosfet}}{Metal Oxide Semiconductor Field Effect Transistor}          \makeglossaries          \begin{document}          \printglossary[type=\acronymtype,title=Abbreviations]          \gls{mosfet} is supposed to be written in small caps but \gls{ac} is not.          \end{document}      The problem I get with this is that all other entries are bold while that particular one in small caps is not in bold. So the abbreviations list looks quite ugly. Does anyone here know an easy fix for this problem?


title: How to properly typeset all forms of punctuation used in English-language documents?

text: English documents tend to use these types of punctuation:   * periods   * apostrophes   * brackets of various kinds   * colons and semicolons   * commas   * dashes and hyphens   * ellipsis   * exclamation and question marks   * quotation marks   * slashes Some software, such as word processors, will attempt to automatically handle and properly typeset punctuation, but with TeX, everything is done manually. One must be careful in placing such punctuation in a document. There are two issues:   * Some punctuation requires special symbols before and after, depending on the situation, to ensure they are placed correctly in the document.   * Some punctuation is easily confused with other, similar punctuation. Here are some examples:   * According to Is a period after an abbreviation the same as an end of sentence period? and Abbreviations and spacing, to give proper spacing after a period appearing within a sentence, and not used to mark the end, one should use a `\`. E.g.:               Mr.\ Green ate lunch at approx.\ 10:45.        * According to Range of Dates (1999-01 -- 2012-12)?, to display a range of dates, one should use `--`, rather than `-`. E.g.:               Mr.\ Green (1950--1999) always ate three fish sandwiches for lunch.      Generally, style guides do not consider such small details, however, TeX offers such control which the authors of these guides may have overlooked.   * In addition to the recommendations above, about the proper typesetting of periods and hyphens, what other special considerations must one take when typesetting the other punctuation in various situations with TeX?   * Has anyone compiled a comprehensive list which details the best method of typesetting the various forms of punctuation typically found in English-language documents?


title: How can we detect that we are right after display math mode? (for vertical spacing)

text: I need a "`\smartmedskip`" feature/macro in plain TeX which is in usual identical to `\medskip`, however, if we are right after display math mode, then it should be just "disabled", i.e. it should then behave as `\par` (or `\vskip0pt`). (I want to use this in a macro that inserts exercises to my exercise list. Now if the last line of an exercise is a math formula, then in sum I get too much space between this and the next exercise.) Thanks in advance.


title: Enumerate in Abstract (scrartcl-class)

text: When using the enumerate environment inside the abstract environment of the scrartcl-class, the intend for the first item does not match those of the following items:               \documentclass{scrartcl}     \usepackage[latin1]{inputenc}     \usepackage{lipsum}          \author{{\scshape I am Author}}     \title{This Is My Title}          \begin{document}          \maketitle          \begin{abstract}     \begin{enumerate}         \item \lipsum[1]         \item  \lipsum[2]         \item  \lipsum[3]     \end{enumerate}     \end{abstract}               \end{document}      How can be that changed to be consitently (e.g. like items 2-x)?


title: Why does increasing hscale produce overfull hbox?

text: I would like help understanding why increasing the proportion of the page available for text produces an overfull `\hbox` error. In the output, this results in my preliminary markers being skewed right. The problem doesn't seem to affect regular text or (as far as I'm aware) headers/footers. Rather, it seems to affect only text added by packages such as `prelim2e` which add text below the page footer, for example. Here's a minimal example:               \documentclass{article}     \usepackage{url,svn-multi}         \svnidlong             {$HeadURL: file:///svn/myproject/tweaked-branch/usr/local/texlive/current/texmf-dist/tex/latex/something/something.sty $}             {$LastChangedBy: cfr $}             {$LastChangedRevision: 19567 $}             {$LastChangedDate: 2014-04-16 19:46:05 +0100 (Mer, 16 Ebr 2014) $}     % \usepackage{geometry}     \usepackage[hscale=.875]{geometry}     \usepackage{prelim2e}     \makeatletter       \AtBeginDocument{%         \renewcommand{\PrelimText}{\centering \small \textsf{Draft --- pdf\LaTeX{}ed --- \today}}%         \@ifpackageloaded{svn-multi}{%             \newsavebox{\prelimtxt}             \sbox{\prelimtxt}{%                 \parbox{\textwidth}{%                         \urlstyle{sf}%                         \centering \small \textsf{Draft --- \today\ --- Revision \svnrev\ --- \svnyear--\svnmonth--\svnday\ \svnhour:\svnminute:\svnsecond}\\[1em]                         \centering \tiny \textsf{\svnkw{HeadURL}}%                         }% end parbox                 }% end sbox             \renewcommand{\PrelimText}{\usebox{\prelimtxt}}             }{}}     \makeatother     \usepackage{kantlipsum}     \begin{document}     \kant[1-5]     \end{document}      ![Overfull hbox error with marker skewed right](http://i.stack.imgur.com/YFuul.png) If I merely load `geometry` but do not change the defaults, I do not get the error and the preliminary marker is (at least closer to being) correctly centred: ![No error](http://i.stack.imgur.com/xhdqd.png) If I don't load `geometry` at all, I get no error but the preliminary marker is skewed to the left rather than the right: ![No error without marker skewed left](http://i.stack.imgur.com/D2DTd.png) I guess what is puzzling to me (and which probably reveals my naivete) is that _prima facie_ I would expect providing more room for text to _reduce_ overfull hboxes at least for single lines where the problem isn't merely an artefact of altered line breaking. If the box isn't overfull in _less_ space, how does it become overfull in _more_?


title: Strategies for corrections in book typeset with TeX

text: I have typeset a long book using TeX and now it is time to re-print it. This is an opportunity to incorporate corrections to the errata discovered in the initial printing. Unfortunately TeX may completely change pagination, even with minimal changes to the text; but my publisher would like to re-print the minimum number of pages possible (and, of course, this would minimize the possibility of introducing new errors, badly printed pages, etc). So I would like to know if there are any strategies I could follow in order to minimize changes to the pagination of my book.


title: How can I append switches to the existing value of the TikZ font key?

text: Is it possible to append switches to the existing settings for the TikZ `font` key? For example, suppose that I want all nodes to be in the `\sffamily` typeface. This can be done by setting `every node/.append style={font=\sffamily}`. I might later wish to have a node that inherits the `every node` `font` settings and, additionally, uses the italic shape `\itshape`. Unfortunately, as the following shows, it does not work to simply add `font=\itshape`; doing so overrides the previous `font` setting, and the default type family (in italic) is used.               \documentclass{standalone}     \usepackage{tikz}          \begin{document}       \begin{tikzpicture}[every node/.append style={font=\sffamily}]         \node {Sans serif};         \node [font=\itshape] at (3,0) {Sans serif, italic};       \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/lt5Zm.png) Digging through the manual, I found the `<key>/.append` handler, which looked promising. > Key handler `<key>/.append={<append value>}`   >  Adds the `<append value>` at the end of the value stored in `<key>`. What if I used `font/.append=\itshape`? Well, this does not work either:               \documentclass{standalone}     \usepackage{tikz}          \begin{document}       \begin{tikzpicture}[every node/.append style={font=\sffamily}]         \node {Sans serif};         \node [font/.append=\itshape] at (3,0) {Sans serif, italic};       \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/GMkEh.png) Thus, I have two questions:   * Why does `font/.append=\itshape` not work here?   * How can I append switches to the existing settings for `font`?


title: ToC, chapter problem, adding a dot next to the number of chapter

text: \documentclass[openany, 10pt]{book}     \usepackage[utf8]{inputenc}     \usepackage[MeX]{polski}     \usepackage{titleps}     \usepackage[Lenny]{fncychap}          %\usepackage{tocloft}     \makeatletter         \renewcommand\@seccntformat[1]{\csname the#1\endcsname.\quad}         \renewcommand\contentsname{Spis}         \renewcommand\numberline[1]{#1.\hskip0.7em}         %\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}     \makeatother          \newcommand\MyTitle{\scshape Pacjent i Analityk}          \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhead[LE,RO]{\normalsize\thepage}     \fancyhead[RE]{\scriptsize \textsc{\leftmark}}     \fancyhead[LO]{\scriptsize \textsc{\MyTitle}}     \fancyfoot[L,C,R]{}                \frenchspacing           %style form chapter           %http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html      \usepackage{pstcol}      \makeatletter          \def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}          \def\LignesVerticales{          \let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}          \def\GrosCarreAvecUnChiffre#1{%          \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%          \rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%          \vrule height 0pt width 1cm depth 0pt}               \def\@makechapterhead#1{\hbox{%          \huge           \LignesVerticales          \hspace{-0.5cm}%          \GrosCarreAvecUnChiffre{\thechapter}          \hspace{0.2cm}\hbox{#1}%          \renewcommand\numberline[1]{#1.\hskip0.7em}        }\par\vskip 2cm}             \def\@makeschapterhead#1{\hbox{%        \huge         \LignesVerticales        %\hspace{0.5cm}%        \hbox{#1}%        }\par\vskip 2cm}             \newcommand\MySquare{% thanks to Gonzalo Medina          %http://tex.stackexchange.com/users/3954/gonzalo-medina        \leavevmode\hbox to 1.2ex{\hss\vrule height .9ex width .7ex depth -.2ex\hss}}        \renewcommand\labelitemi{\MySquare}             \usepackage{titletoc}             \title{Foo is getting older}        \author{Joseph Bar}        \date{}             \begin{document}        \maketitle                       \frontmatter            \tableofcontents     \chapter*{Chapter whitout a number}     \addcontentsline{toc}{chapter}{Chapter without a number}          \mainmatter         \chapter{Solution}\label{chap:one}         \section{One}         \section{Two}         \section{Another section}         \chapter{Second solution}         \chapter{Third chapter}         \chapter*{Chapter without a number}         \section{One}         \section{Two}     \end{document}      The goal is:   1. Put the dots next to chapter a) in ToC, b) in text   2. Get left marking work correct, meaning - I want a name of chapter, number of a chapter [with dot], but without a word:"Chapter"   3. Add dots from chapter to the page number in ToC,   4. Enumerate style change: from native to dark square with bold number inside


title: How does TeX handle \else and \fi in conditionals?

text: I have seen packages using               \def\afterelse#1\else#2\fi{\fi#1}      which TeX seems happy to accept. But on taking the first branch, isn't TeX expecting `\else` instead of `\fi`? That is, isn't the following the correct syntax for the first fork? This too is accepted by TeX.               \def\afterelse#1\else#2\fi{\else#1}      **EDIT** Thanks to Egreg. Tracing `\if`s shows what is happening.               \def\loggingallstuff{%       \tracinggroups\@ne\tracingifs\@ne\loggingall\tracingassigns\@ne     }          \def\afterelse#1\else#2\fi{\fi#1}          {\loggingallstuff       %\edef\x{\iftrue\afterelse T\else F\fi}       \edef\x{\iftrue T\else F\fi}     %  \edef\x{\iffalse T\else F\fi}     }          % \iftrue     {\edef}     {\iftrue: (level 1) entered on line 23}     {true}     {\else: \iftrue (level 1) entered on line 23}     {\fi: \iftrue (level 1) entered on line 23}     {changing \x=undefined}     {into \x=macro:->T}          % \iffalse:     {\edef}     {\iffalse: (level 1) entered on line 24}     {false}     {\else: \iffalse (level 1) entered on line 24}     {\fi: \iffalse (level 1) entered on line 24}     {changing \x=undefined}     {into \x=macro:->F}      Here is one case I find interesting:               \documentclass{article}     \usepackage{pgfkeys}     \makeatletter          \def\pgfkeysafterfi#1\fi{\fi#1}     %\def\pgfkeysafterelsei#1\else#2\fi{\fi#1}     \def\pgfkeysafterelsei#1\else#2\fi{\else#1} % wrong but gives no error.          \def\pgfkeysifkeydef#1#2#3{%       \ifcsname pgfk@#1/.@cmd\endcsname         \pgfkeysafterelsei{#2}\else\pgfkeysafterfi{#3}\fi     }     \pgfkeys{%       /handlers/.if definable/.code 2 args={         \pgfkeysifkeydef{\pgfkeyscurrentpath}{%           \@latexerr{Oops, key '\pgfkeyscurrentpath' already exists}             {You aren't in trouble here!}%         }{%           \pgfkeys{\pgfkeyscurrentpath/.default=#1,\pgfkeyscurrentpath/.code=#2}%         }%       }%     }     \pgfkeys{       /fam/.is family,/fam/.cd,       keya/.if definable=\relax\@empty,       keya/.if definable=\@empty{\def\x##1{##1*#1}},     }     \makeatother     \begin{document}     x     \end{document}


title: Why doesn't ellipse (\p and 1) work?

text: \documentclass{article}          \usepackage{tikz}          \begin{document}               % DOES NOT WORK     %\tikz \foreach \p in {1,2,...,3} \draw (\p,0) ellipse (\p and 1);               %WORKS     \tikz \foreach \p in {1,2,...,3} \draw (\p,0) ellipse (1 and \p);          \end{document}      `(1 and \p)` works but `(\p and 1)` does not, why?


title: Header doesn't align with decorative line

text: I use `tabular` in header with package `fancyhdr`. I added `settototalheight` to calculate the header height. Following is a small example. The question is that header doesn't align with the decorative line at the right end. But it does at the left end. What is the problem?               \documentclass[titlepage,a4paper]{article}          \usepackage{fancyhdr}     \usepackage{calc}          \usepackage[english]{babel}     \usepackage{datetime}        \renewcommand{\dateseparator}{-}     \newcommand{\headertoday}{\the\year \dateseparator \twodigit\month \dateseparator \twodigit\day}          \usepackage[lmargin=1.800000cm,rmargin=1.000000cm,tmargin=2.500000cm,bmargin=1.000000cm]{geometry}          %### define an environment to have a local `\arraystretch'     \newenvironment{TabLocalVerticalSpacing}[1]       {\def\arraystretch{#1}\tabular}       {\endtabular}     %#####################################          \pagestyle{fancy}     \fancyhf{}     \newcommand\leftheadercalc[1]{%     \begin{TabLocalVerticalSpacing}{#1}[b]{@{}ll}\footnotesize{Static Calculation Foundation Loads and concrete columns basic parameter}&\footnotesize{}\\\footnotesize{Project: xxxxxx}&\footnotesize{}\end{TabLocalVerticalSpacing}     }     \newcommand\rightheadercalc[1]{%     \begin{TabLocalVerticalSpacing}{#1}[b]{rr@{}}\footnotesize{Date:}&\footnotesize{\headertoday}\\\footnotesize{Page:}&\footnotesize{\thepage}\end{TabLocalVerticalSpacing}     }     \newcommand\midheadercalc[1]{%     \begin{TabLocalVerticalSpacing}{#1}[b]{cc}\footnotesize{}&\footnotesize{}\\\footnotesize{}&\footnotesize{}\end{TabLocalVerticalSpacing}     }     \settototalheight\headheight{\maxof{\leftheadercalc{0.600000}}{\rightheadercalc{0.600000}}{\midheadercalc{0.600000}}}     \lhead{\leftheadercalc{0.600000}}     \rhead{\rightheadercalc{0.600000}}     \chead{\midheadercalc{0.600000}}          %########## header decorative lines     \makeatletter     \def\headrule{{\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi%     \hrule\@height 0.500000pt \@width\headwidth\vskip1.000000pt     \hrule\@height 0.500000pt\@width\headwidth}}         \makeatother               %########## footer decorative lines     \makeatletter        \def\footrule{{\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi%     \hrule\@height 0.500000pt \@width\headwidth\vskip1.000000pt      \hrule\@height 0.500000pt\@width\headwidth}}         \makeatother          \newcommand\leftfootercalc[1]{%     \footnotesize{xxx GmbH}     }     \newcommand\rightfootercalc[1]{%     \footnotesize{Document: g-zzz}     }     \newcommand\midfootercalc[1]{%     \footnotesize{Principal: civil eng. yyy}     }     \settototalheight\footskip{\maxof{\leftfootercalc{0.600000}}{\rightfootercalc{0.600000}}{\midfootercalc{0.600000}}}     \lfoot{\leftfootercalc{0.600000}}     \rfoot{\rightfootercalc{0.600000}}     \cfoot{\midfootercalc{0.600000}}          \begin{document}     balala     \end{document}


title: Latex Table of Content problem with Space

text: The problem is **space of table of content** as it can be seen form the diagram. How to specify the same space for each section and subsection and update table of content accordingly. ![enter image description here](http://i.stack.imgur.com/0AYmq.png) Thank you very much for suggestion.


title: Tabular with linespacing

text: Moin, I want the rowspacing behavior to be default. So this:               \usepackage{longtable}          % ... MAGIC ... %          \begin{longtable}{ccc}       entry1 & entry2 & entry3 \tabularnewline       entry4 & entry5 & entry6 \\       entry7 & entry8 & entry9 \newline                         foobar     \end{longtable}      should produce the same output as this:               \usepackage{longtable}          % ... MAGIC ... %          \newlength\myRowSpacing     \myRowSpacing1ex          % ... MAGIC ... %          \begin{longtable}{ccc}       entry1 & entry2 & entry3 \tabularnewline[\myRowSpacing]       entry4 & entry5 & entry6 \\[\myRowSpacing]       entry7 & entry8 & entry9 \newline                         foobar     \end{longtable}      Note how it should not apply to newlines (so multi-line cells have default linespacing). What I tried:               \usepackage{longtable}     \usepackage{setspace}     \usepackage{etoolbox}     \AtBeginEnvironment{longtable}{\doublespacing}          % ... MAGIC ... %          \begin{longtable}{ccc}       entry1 & entry2 & entry3 \tabularnewline       entry4 & entry5 & entry6 \\       entry7 & entry8 & entry9 \newline                         foobar     \end{longtable}      This produces something I like. Might be even better than the fixed spacing solution, if I figure out a nice factor... **Except that it also applies to newlines** \- and I haven't succeeded in redefining newlines (yet). So, what hack have I missed? Regards, LDericher


title: Why does \textbackslash render as "n" in math mode?

text: I've just rendered the following:               \documentclass[varwidth=true, border=2pt]{standalone}          \begin{document}$\textbackslash$     \end{document}      which seems to give the same as `$n$`. Do you know why? As `\textbackslash` is for textmode and not for mathmode, I've expected TeX to fail in this situation. Instead, I get > LaTeX Warning: Command \textbackslash invalid in math mode So why does `\textasciitilde` in math mode make LaTeX crash but `\textbackslash` not?


title: Songs order alphabeticallly

text: I was wondering if it's possible to order the songs in alphabetical when generate the pdf file using the package "songs" also if they was written in another order in source code. As a Minimal Working Example of source code, you can consider the sample at http://songs.sourceforge.net/docs.html In the songs.sbd file the songs are written without a aspecific order, but i would like that in the final pdf file the song are in alpabetical order. Thanks in advance. Flavio


title: Curves with Latex

text: How I can draw curves as : ![enter image description here](http://i.stack.imgur.com/SvBpL.png) Any help would be appreciated.


title: Using knitr, beamer, and /foreach to produce unique section titles in pdf from R string variable

text: Using R, knitr, and beamer, I have created a pdf that contains a graph for each school in our district. I read in each graph using the \includegraphics command within a /foreach loop. I want to create a unique section name for each school using the R-variable 'school'. I want this section name to appear in the left hand Table of Contents. Relevant code is below. Thanks.               \foreach \i in {1,...,\Sexpr{length(school)}} {%     \section{\Sexpr{school[i]}}    %%% Here is where it is breaking down     \begin{frame}         \includegraphics[width=\textwidth,height=\textheight,keepaspectratio]{plot_\i.pdf}     \end{frame}%       }


title: Installing latex font as a system font for Adobe Flash

text: I've installed the fonts from the package:               \usepackage{mathptmx}     \usepackage[T1]{fontenc}      and it works great in latex, but I imported the output file into adobe flash professional, and it needs to font map all the fonts, and everything looks messed up. Is there a way around this?


title: How to make a new line without indenting?

text: How can I make a new line without it being indented? Here is what I have so far:               \documentclass[11pt, oneside, reqno]{article}     \usepackage{amssymb, amsthm, amsmath, amsfonts}     \usepackage{bardmacros}          \begin{document}          \demo          However, since $y \notin B$, we have $\mathbb{X\restriction_B} = 0$.  This is a contradiction, because $1 \neq 0$.  Therefore, $A=B$ must be true for $\mathbb{X\restriction_A} = \mathbb{X\restriction_B}$.\\\          $\Rightarrow$  Let $\mathbb{X\restriction_A} \neq \mathbb{X\restriction_B}$ and let $A=B$.     \edemo     \end{document}      And this is what the output looks like. The indent right before the => is what I'd like to eliminate: ![And the output](http://i.stack.imgur.com/IEhNF.png) I am very new the LaTeX, so thanks for your patience!


title: How to retrieve color from a specific location and use it?

text: > Please save your time and energy on this question, this is not an important > one. What's the color in the middle (or anywhere else) in these pictures? How to retrieve/compute that color to be used for drawing later? ![Four working examples serving as test cases.](http://i.stack.imgur.com/6ixgg.png)               \documentclass[a4paper]{article}     \pagestyle{empty}     \parindent=0pt     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}     \usetikzlibrary{shadings}     \usetikzlibrary{pgfplots.colormaps}          \begin{document}     \centering     \begin{tikzpicture}     \begin{axis}[colormap={mal-map}{[1cm] rgb255(0cm)=(50,50,10) color(1cm)=(white) rgb255(5cm)=(200,100,150)}, colorbar horizontal, colorbar/width=2cm, hide axis]     %\addplot[mesh, point meta=y, line width=4mm, samples=150] {x^2}; % Some graph to show...     \end{axis}     \end{tikzpicture}\bigskip          \begin{tikzpicture}     \begin{axis}[colormap/bright, colorbar horizontal, colorbar/width=2cm, hide axis]     %\addplot[mesh, point meta=y, line width=4mm, samples=150] {x^2}; % Some graph to show...     \end{axis}     \end{tikzpicture}\bigskip          \begin{tikzpicture}     \shade[upper left=brown, upper right=yellow,       lower left=cyan, lower right=black!50]       (0,0) rectangle (4,4);     %\draw (0,0) grid (4,4); % help lines     \end{tikzpicture}\bigskip          \begin{tikzpicture}     \shade[ball color=red, opacity=0.50] (1,0) circle (2.0cm);     \shade[ball color=black, opacity=0.50] (0.5,0) circle (1.5cm);     %\draw (-1,-2) grid (3,2); % help lines     \end{tikzpicture}     \end{document}      I am aware of the `\extractcolorspecs` command from `xcolor` package, but this is not the case. First two pictures were prepared in `pgfplots` by using `colormap`/`colorbar`, next two were prepared in `tikz` by using `\shade` command from `shadings` library. We tried to duplicate and use colors from the `colorbar` from specific locations, for more details about that experiment, please, see this question. We could guess color in the first picture, sort of, we could compute color in the second picture, because we know the distance between two key colors. Well, it looks that the difficult cases are the remaining two. The third example uses both directions to place the colors (not only horizontal or vertical direction is used as seen on examples from `pgfplots`) and the last example uses opacity and layers. I was wondering if somebody needed to solve this problem. There is a conversion from `colormap` to `shadingspec`, it is mentioned on page 173 of the pgfplots manual. I was thinking of this command (if I omit opacity for a minute): `\getmecolor{x-coordinate}{y-coordinate}` and the result would be color in RGB or CMYK.


title: How do I make a border for a resume span multiple pages in Latex?

text: I'm using the package `fancybox` to create a border around my resume however, I'm not sure how to alter the length and width parameters such that it extends to the portion of my resume on the second page. More specifically, I don't want the border to continue onto the second page with the top cut off (as if it were all one continuous page) but rather to be one whole border all of its own. That is, encompass the stuff on the second page just as on the first. This is an empty slate of my resume with all the info removed:               \documentclass[margin]{res}       \textwidth=5.2in      \usepackage{fancybox}          \begin{document}           \thisfancyput(3.25in,-4.5in){     \setlength{\unitlength}{1in}\fancyoval(7,9.8)}               \name{}      \address{}           \begin{resume}           \section{Objective}                \section{Education}                     \section{Leadership}           {\bf ,}  \hfill   {\bf 2012-2013}             \begin{itemize} \itemsep -2pt  % reduce space between items             \item                           \item                         \end{itemize}                    {\bf ,}  \hfill   {\bf 2013-2014}             \begin{itemize} \itemsep -2pt %reduce space between items             \item                                \item                               \item                               \end{itemize}          {\bf ,}  \hfill   {\bf 2011-2012}                       \begin{itemize} \itemsep -2pt                      \item                                        \item                                       \item                    \end{itemize}               \section{Experience}           {\bf ,}   \hfill   {\bf 2012}                      \begin{itemize} \itemsep -2pt                     \item                           \item                        \end{itemize}          {\bf ,}  \hfill {\bf 2013}                                     \begin{itemize} \itemsep -2pt                      \item                             \item                             \item              \end{itemize}               \section{Work}                           {\bf  ,}       \hfill                                {\bf 2010-2014}                       \begin{itemize} \itemsep -2pt                           \item                                          \item                                 \end{itemize}          \section{Hobbies}               \section{Academic Honors}           % Tabulate Computer Skills; p{3in} defines paragraph 3 inches wide     \section{Computer \\ Skills}        \begin{tabular}{l p{3in}}         \underline{Languages:} &  \\               \underline{Software:} &        \end{tabular}          \end{resume}      \end{document}


title: New Wiley LaTeX style

text: I really like the new scientific book design used by Wiley. You can find an example here. I would like to use this layout style for my thesis, so I was wondering whether there's something available (perhaps similar to tufte-book or classicthesis) implementing this design. If there isn't, any help to identify and code the used fonts, header styles, page numbering style etc. would be much appreciated. Thanks!


title: Tabular overfill

text: This table overfill the margins. I am working on a document with several tables and in some cases the tables overfill the margin. I have tried mini page but with little success - any suggestions?               \begin{table}[ht]     \caption{Implied Cost of Funds}     \begin{center}          \begin{tabular}{lrrl}     \hline     \multicolumn{3}{l}{\textbf{Beginning Market Value}}\\     Principal Proceeds & \$ &1,028,437 & $\text{\$1,000,000} \times \text{\$102-27}$ \\     Accrued Interest & \$ &1,986 & 13 days accrued interest @ 5.50\%\\     \circled{1} \textbf{Market Value} &\$& 1,030,424 & Total proceeds on the "roll out" date \\     \hline          \multicolumn{3}{l}{\textbf{Future Value} - \textit{Pmts. Received}}\\     Coupon Income Received & \$& 4,583 & Interest earned @ 5.50\%  based on 30/360\\     Scheduled Principal Received & \$ &1,070 & Scheduled principal paid\\     Prepaid Principal Received & \$ & 29,254 & Prepaid Principal Received @ 30 CPR\\     Total Payments Received & \$& 34,907 & Expected payments (remittance date)\\     \circled{2} \textbf{Disc. value of the carry} & \$ & 34,911 & Present value of the payments received\\     &&&assuming the alternate financing rate (0.31\%) \\     &&&and using actual day count (13 days) - act/360 - \\     &&& on the "roll in" date.\\           \hline      Remaining principal balance & \$ & 969,676 & Remaining current balance\\     Principal proceeds   & \$ & 993,615 & Remaining balance $\times$ \$102-15\\     Accrued Interest & \$ & 1,807 & 12 days of accrued interest\\     Roll in proceeds &  \$ & 995,422 & Roll in proceeds\\     \circled{3}Future Value of principal and carry & \$ & 1,030,333 & Total amount financed\\     \hline          Future value \circled{3} & \$ &  \$1,030,333 &\\     Less Market Value \circled{1} & \$ & \$ 1,030,424 & \\     Implied cost of financing &\$ & -\$91 &\\     \circled{4} \textbf{Implied cost of funds} && -0.106\% &  (-\$91 $\div$ \$ 969,676) $\times$ 100 \\          \end{tabular}          \end{center}     \end{table}


title: Remove paragraph indent from abstract in article class

text: I'm just getting started with LaTeX to write scientific papers. I don't want to have paragraph indentation, so I've used the parskip package to deal with that. However, that doesn't seem to deal with the indentation of the first line of the abstract. I've tried manually setting parident but that doesn't seem to work either. Is there a special way of setting the paragraph indent within the abstract section?               \documentclass{article}     \usepackage{parskip}          \begin{document}          \title{What are the fundamental gaps in scientific knowledge?}     \author{Robin Wilson}          \maketitle          \begin{abstract}     Recent reports by the global environmental ...     \end{abstract}          \section{Introduction}     Here is the text of your introduction.          And another paragraph here.          \end{document}


title: How to compile a LaTeX document?

text: Up until now, I've just been using LyX for all my LaTeX needs. Now I have a `.tex` file and I need to compile it (turn to pdf). How do I do this on Windows XP? Obviously I have LaTeX installed (MikTeX).


title: How to split an example into two parts?

text: I am trying to have an example (using the theorem environent in amsmath) split in two parts: Example 1 ... Some more discussion Example 1 (continued) ... What is the best way to do this ? The code I have so far is               \documentclass{article}          \usepackage{amsmath}     \newtheorem{example}{Example}          \begin{document}          Consider the following example:          \begin{example}       $a = b + c$     \end{example}          Now, consider what happens if we add $d$ to $a$:          \begin{example}[continued] % I'd like to have this to output Example 1 (continued)       $a + d$     \end{example}          \end{document}


title: Dividing an equation into two lines

text: I am trying to divide this equation into two different lines but I am not able to. I tried to use package `breqn` but that started giving me some compilation errors on the style file itself.               \frac{ \sum_{n_i\in S_{c_k}} P_{ij} ( x_{i} P(y_i = 1\ |\ x_i = 1) + (1- x_{i}) P (y_i = 1\ |\ x_i=0))}{\sum_{n_i\in S_{c_k}} P_{ij}}      The problem here is `\frac{}` which prevents me from using `align` to break the equation. ![enter image description here](http://i.stack.imgur.com/eR8Lc.png)


title: Asymptote: Is there an equivalent to silhouette for surfaces?

text: ## Update If there is no equivalent to `silhouette` could you comment on my following ideas: I can get the projection of my surface using the `planeproject` transformation. This is still a three dimension surface but maybe it is easier to extract the outline path or paths from this simpler surface? If this isn't possible neither maybe the following algorithm could work:   1. `planeproject` the surface   2. extract a dense mesh of points lying on this transformed surface (these points should ly within the same plane); or maybe it is even possible to extract the border points of the flat surface somehow (maybe via their slope being different from the other points on flat part of the surface)   3. use some concave hull algorithm (that would have to be implemented first, of course) to find the concave hull of the aforementioned points.   4. use the path along the concave hull as outline Here I'm particularly uncertain if there is an easy way to do step 2. And I will have to think about what to do when the concave hull consists of several paths, e.g. like for a torus where you get the outer outline and the hole in the middle. Do you think this would be possible? ## Original Question The `solids` package defines `revolution` objects whose outlines can be accessed via `silhouette`. Example:               size(200);     import solids;     settings.render=0;     settings.prc=false;          currentprojection=perspective(4,4,3);     revolution hyperboloid=revolution(new real(real x) {return sqrt(1+x*x);},                                   -2,2,20,operator..,X);     draw(hyperboloid.silhouette(64),blue);      ![enter image description here](http://i.stack.imgur.com/2noQf.png) Is there an equivalent way to get the outline path of a `surface`? For example the outline of such a `surface` (I know that the object in this example is spherically symmetric and so I could define a `revolution` that describes it but I would like to know if there is a general way to get the outline of a `surface`):               import graph3;     import palette;     size(200);     currentprojection=orthographic(6,8,2);     viewportmargin=(1cm,0);          real c0=0.1;          real f(real r) {return r*(1-r/6)*exp(-r/3);}          triple f(pair t) {       real r=t.x;       real phi=t.y;       real f=f(r);       real s=max(min(c0/f,1),-1);       real R=r*sqrt(1-s^2);       return (R*cos(phi),R*sin(phi),r*s);     }          bool cond(pair t) {return f(t.x) != 0;}          real R=abs((20,20,20));     surface s=surface(f,(0,0),(R,2pi),100,8,Spline,cond);          s.colors(palette(s.map(abs),Gradient(palegreen,heavyblue)));          render render=render(compression=Low,merge=true);     draw(s,render);     draw(zscale3(-1)*s);      ![enter image description here](http://i.stack.imgur.com/PTajI.png)


title: Drawing network protocols

text: I want to produce network protocols, a very simplified example of which is depicted below: ![A simple protocol](http://i.stack.imgur.com/EseFA.png) The protocol has two parties, each of which does some computation and then communicated with the other. I can use a 3-column table, but I want to know if there is any better solution. Especially, whether there is any particular package for this, or any simple way to do it in TikZ.


title: How to enforce the position of table* (wide table)

text: I'm writing a paper using SIGPLAN conference **2 columns** format. I maintain separate .tex files per each chapters:               %% main.tex         \documentclass[preprint, 10pt]{sigplanconf}     \usepackage{ ... }     ...     \maketitle     ...     \input{abstract}     \input{intro}     \input{related}     ...      'abstract' and 'intro' together has 1.2 page long, and 'related' follows then. The length of 'related' is 0.8 page long. That means all contents until 'related are in page 2. The problem is that I have a wide table, `{table*}` that spans two columns in the 'related' file.               %% related.tex     \begin{table*}[t]     \begin{center}     \begin{tabular}{|l|l|l|}     ...     \end{table*}      However, this wide table is always located at page 3, not page 2. To make this wide table to be page 2, I need to move the table into the middle of 'intro', which is very ugly. Even worse, this can make the table caption numbers to be out of order. **Is there any way to enforce the location of a wide table?** In my case, I want to draw the wide table at page 2. I came across `fixltx2e` package, but inserting this package just makes huge errors on `{table*`} and `{figure*}`.


title: chapter headings vertically centered but not table of contents

text: My university requires the chapter headings to be on a separate page and vertically and horizontally cantered. Based on some of the answers on this forum i used the following code to achieve it.               \documentclass[thesis,letterpaper,12pt]{utthesis}     \usepackage{fancyhdr}                % fancy headers and footers     \usepackage{titlesec}     \titleformat{\chapter}[display]{\vfil\normalfont\huge\bfseries\centering}{\chaptertitlename\ \thechapter}{20pt}{\Huge}    % for vertical and horizontal centring      \renewcommand\contentsname{Table of Contents}     \setcounter{chapter}{-1}  % PACKAGES PRELOADED WITH CLASS: amsmath,amsthm,amssymb,setspace,geometry,hyperref,and color     \begin{document}     \pagenumbering{alph} % this is needed to clear certain issues with the hyperref package     \pagenumbering{roman}     \setcounter{page}{10}     \addToPDFBookmarks{0}{Table of Contents}{f}     \tableofcontents     \include{chapters/preface}     \include{chapters/chap1}`      I was running all fine, but now i have noticed that the table of contents is not showing properly. It starts at almost the end of the page although it should start from the beginning of the page. Can anyone help?


title: Setting acronyms to appear as a footnotes in margin cause Marginpar moved warning

text: I am using glossaries package with the acronym and footnote option. I also set footnotes to appear in the margin. With multiple acronyms in a line, multiple footnotes are placed in the margin. To avoid overlap, the notes are moved which causes Marginpar moved warning. Is there a way to prevent Marginpar warnings when multiple notes are generated in the margin corresponding to content from a single line?


title: A horizontal line with the same space-filling behaviour as /hfill?

text: Is there a command or package which would allow me to draw a line in the largest available space in the way that `\hfill` fills up the remaining space in a line? _i.e._ , a command to draw a line from the end of the text, wherever it happens to fall, to the right edge of the textwidth (leaving space for any additional text indented to be at the end of the line)?


title: Looking for an example of an OLAP cube with dimensions drawn in TikZ

text: I am looking for an example of a TikZ picture of an OLAP cube with dimension hierarchy. More-less something like this cube: ![enter image description here](http://i.stack.imgur.com/XbrcS.gif) I know how to draw a cube based on What is the easiest way to draw 3D cube with TikZ? and Sudoku 3D cube example. But I wonder how to put nicely also dimensions' hierarchies, e.g., with trees tikz library.


title: containverbatim shows up in output

text: When I compile the following code in XeLaTeX (also works with pdflatex) under windows, `[containsverbatim]` shows up in the ouput: ![Ouput](http://i.stack.imgur.com/k7iZ1.png) Here is the code:               \documentclass{book}      \usepackage{showexpl}      \usepackage[frenchb]{babel}     \usepackage[T1]{fontenc}     \usepackage[top=5cm, bottom=5cm, left=6cm, right=3cm]{geometry}          \lstloadlanguages{[LaTeX]Tex}      \lstset{%           basicstyle=\ttfamily\small,           commentstyle=\itshape\ttfamily\small,           showspaces=false,           showstringspaces=false,           breaklines=true,           breakautoindent=true,           captionpos=t      }           \begin{document}          \begin{frame}[containsverbatim] %Problem here          \begin{LTXexample}           \chapter{Good buy}     \section{haha}     lorem ipsum dolor si amet...lorem ipsum dolor si amet...lorem ipsum dolor si amet...lorem ipsum dolor si amet...lorem ipsum dolor si amet...lorem ipsum dolor si amet...     \end{LTXexample}          \end{frame}          \end{document}      When I don't add `[containsverbatim]` it still works, but it leaves an annoying dot: ![Output 2](http://i.stack.imgur.com/5Q3hH.png) I'm surely doing something wrong here, so I appreciate any help.


title: How can I produce vertical white space in a table with LuaLaTeX?

text: How to add a few blank lines without using `\vspace`? Trying to use `\\` always gets me in trouble... Now I'm trying to format a simple lua table in LaTeX for display. I am using a combination of `\\` (which requires me to use code like `\noexpand\\noexpand\\`) and `\vspace`. The table is formated nicely **EXCEPT** I have to use an actual character               tex.print("-")      works fine but if I change it to               tex.print("\noexpand~")      or               tex.print(" ")      things quickly become bad. I've also tried               tex.print("\noexpand\\hspace\noexpand{1mm\noexpand}")      but it only works if there is some initial piece of text My Code               for i = 0, ofs + 1*idx - 1 do         tex.print("-")         tex.print("\noexpand\\hspace\noexpand{0.1mm\noexpand}")                                 end


title: how do I escape a comma?

text: I have a tikz picture and at some point I draw the following node:               \node[thick,           scale=0.5,           minimum size=1.3cm,           fill=red,           circle,           draw,           fill opacity=0.3,           label=right:$= (0 1 0 1 0 \ldots)$           ] (the) at (6.2, 1.5) { };      The thing is that I want to separate the 0 1 0 1, etc with commas. I can't do that, because I think TikZ thinks it separates the next parameter in the square brackets. How can I escape the comma?


title: \fontspec or \setmainfont do not load fonts from current directory

text: I am trying to use GARA.TFF (Garamond) in my latex document. \setmainfont can not find the font when I try to load it from the current directory. Here is the document:               \documentclass{article}     \usepackage{fontspec}     \begin{document}         \setmainfont{GARA.TTF}         Testfont     \end{document}      Directory contents:               drwxr-xr-x 2 reuter ids_s   4096 2011-06-09 16:39 .     drwxr-xr-x 4 reuter ids_s   4096 2011-06-09 16:38 ..     -rw-r--r-- 1 reuter ids_s 198072 2004-04-02 21:06 GARA.TTF     -rw-r--r-- 1 reuter ids_s    115 2011-06-09 16:39 test.tex      Output of `xelatex test.tex`:               [...]     fontspec.cfg loaded.     (/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg))     No file test.aux.          kpathsea: Running mktextfm GARA     /usr/share/texmf/web2c/mktexnam: Could not map source abbreviation G for GARA.     /usr/share/texmf/web2c/mktexnam: Need to update /usr/share/texmf-texlive/fonts/map/fontname/special.map?     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input GARA     This is METAFONT, Version 2.718281 (TeX Live 2009/Debian)               kpathsea: Running mktexmf GARA     ! I can't find file `GARA'.     <*> \mode:=ljfour; mag:=1; nonstopmode; input GARA          Please type another input file name     ! Emergency stop.     <*> \mode:=ljfour; mag:=1; nonstopmode; input GARA          Transcript written on mfput.log.     grep: GARA.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input GARA' failed to make GARA.tfm.     kpathsea: Appending font creation commands to missfont.log.     ! Font \zf@basefont=GARA.TTF at 10.0pt not loadable: Metric (TFM) file or insta     lled font not found.     \zf@fontspec ...ntname \zf@suffix " at \f@size pt                                                        \unless \ifzf@icu \zf@set@...     l.7 \setmainfont{GARA.TTF}          ?       I am at a loss. Is it supposed to strip the extension? I can succesfully load fonts that are installed. `\setmainfont{Arial}` works like a charm. This is on Kubuntu, by the way.