title: How to implement topmarks similar to titleps

text: This is a follow-up question to Javier's answer on a solution for working topmarks here: How to add “cont.” section title to the top of pages? @Javier: could you please elaborate on your idea of how you implemented topmarks in titleps? I used titleps and it does work except for two things:   * I need the literal contents of `\topshortmark\indexthumb` for use in `\int_from_alph:n { \topshortmark\indexthumb }`, for instance, but instead I get the switching mechanism with `\@namedef`. If I use etex's `\newmarks` directly, then I get the true contents but the `\topmark` is wrong.   * Also, when using the `\xspace` macro in the mark contents, `\ifsamemark` breaks with an "Undefined control sequence" error. So I want to implement the titleps `\topmarks` without the switching mechanism. UPDATE: Following a hint from Javier, I tried the following setup, however, that didn't quite work yet:               \newmarkset{indexmark}     \newcommand{\indexthumb}{}     \newextramark{indexmark}{\indexthumb}          \NewDocumentCommand \indexsection {m} {         \renewcommand{\indexthumb}{#1}         \preextramark{indexmark}         \pagebreak[2]              \hskip 0pt plus 1fil { #1 } \hskip 0pt plus 1fil              \extramark{indexmark}              \fancytab{#1}{\int_from_alph:n {#1}}              \nopagebreak\vskip\onelineskip\par\nopagebreak     }          \AddEverypageHook{         \typeout{INT:~ \topextramarks{indexmark} \int_from_alph:n { \indexthumb } }     }


title: Arabic Typesetting with texmaker editor and pdfLatex

text: I'm writing a book in French, but i need to write a chapter in Arabic. To do so I've used the arabtex.               \usepackage{arabtex}      after the preamble I've done this               \chapter*{\<السلام عليكم>}      After compiling my code i get this : `! Illegal arabic command: ?.\a@cmderr ...age {Illegal arabic command: \nxp #1}\a@@cmd = {{\a@puttt #1\ar... \chapter{\<?????? ?????>}` But when ii change the arabic letter with the \<> tag               \chapter*{\<this is an arabic message>}      I got : ![enter image description here](http://i.stack.imgur.com/rEBUY.png) which is kind of random and insignificant, so how can I write in arabic in my texmaker editor and compile my code properly ? EDIT : This is a full Example :                 \documentclass[parskip=full,12pt,a4paper,twoside,frenchb,openany,fleqn]{book}         \usepackage{arabtex}         \usepackage[latin1]{inputenc}         \usepackage{titlesec}         \usepackage{ae}         \usepackage{aecompl}         \usepackage[T1]{fontenc}         \usepackage[latin1]{inputenc}         \usepackage[frenchb]{babel}         \usepackage[Sonny]{fncychap}         \begin{document}         \chapter{\<سلام>}         \end{document}


title: Customizing chapter's title

text: How to make this in LaTex? ![enter image description here](http://i.stack.imgur.com/kDBt5.png) I'm already making the chapter title using this:               \def\@makechapterhead#1{%     \vspace*{10\p@}%     {\parindent \z@     {\reset@font     \usefont{OT1}{phv}{m}{n}     \LARGE Chapitre \thechapter\par\nobreak}%     \par\nobreak     \vspace*{30\p@}     \interlinepenalty\@M     \usefont{OT1}{ptm}{b}{n}     {\raggedright \Huge #1}%     \par\nobreak     \vskip 20\p@     \hrule height 1pt     \par\nobreak     \vskip 45\p@     }}          \def\@makeschapterhead#1{%     \vspace*{10\p@}%     {\parindent \z@     {\raggedleft \reset@font     \scshape \vphantom{\@chapapp{} \thechapter}     \par\nobreak}%     \par\nobreak     \vspace*{30\p@}     \interlinepenalty\@M     \usefont{OT1}{ptm}{b}{n}     {\raggedright \Huge #1}%     \par\nobreak     \par\nobreak     \vskip 45\p@     }}      Any brilliant idea, please?


title: How do I add a separate LaTeX-document as an appendix?

text: I want to add LaTeX-documents to my main document as appendices. I have a set of documents (of class scrartcl) that all have their own tables of content, titles etc. Each of these documents should be included as an appendix in the main document. Optimally, it would work like:   * The main document lists every document in its TOC (e.g. ... 4. foo 5. bar A First Appendix ...)   * After the content of the main document has ended, the appendix documents are listed (each on a new page)   * Each appendix-document's content stays untouched (They have different headers etc.)   * (I don't think that's possible) The numbering for e.g. graphics is altered so that it is "Figure A 4.1" instead of "Figure 4.1 for Appendix A. Can something like this be done? If not, is it possible to stitch the pdfs of every document together? Then I would have to find a way to adjust the main TOC. Any help is highly appreciated.


title: How do I find which pgf version I have installed on Windows (MikTeX)?

text: I'm not sure how to find which version of `pgf` with MikTeX installed on my computer (Windows 7 - 64 bit).


title: One tabular with column input from multiple data files with pgfplotstable

text: I have a question which sort of extends the page Multiple Files input to one pgfplotstable. In the answer to this question, data is read from `dataB.dat` and subsequently appended to the data as described in `dataA.dat`. I want to be able to take arbitrary columns from both `dataA.dat` and `dataB.dat` and create a new tabular with that data, instead of appending. I looked in the `pgfplotstable manual Revision 1.9 (2013/10/03)` at `section 4`, but I can't to seem to solve the problem. A minimal working example is               \documentclass{article}     \usepackage{pgfplotstable}     \begin{document}         \pgfplotstablenew[]{3}{\dataC}         \pgfplotstablecreatecol[copy column from table={dataA.dat}{[index]0}]{par1}{\dataC}         \pgfplotstablecreatecol[copy column from table={dataB.dat}{[index]0}]{par2}{\dataC}         \pgfplotstabletypeset         [             columns={par1,par2},             columns/par1/.style=             {                 column name=test1,                 sci,                 sci 10^e,                 precision=5,             },             columns/par2/.style=             {                 column name=test2,                 sci,                 sci 10^e,                 precision=5,             },               ]         {\dataC}     \end{document}      It works, but I'm not sure if this is the correct way to do it. Is it?


title: How can I change \ref s output from 5.1 to "some text"

text: I'm currently developing a doclet which translates javadoc to LaTeX. I'm compiling the LaTeX document using `pdflatex` with a `sty` file I have from my school it generates a PDF document with links (red box) for all references this means that a I don't need the _chapter.section_ representation   I'm generating a label for example               \label{com.domain.package.Class}      when I reference it I get something like `5.1`. How can I change it ?


title: \noalign without line break / additional spacing

text: I need a non-breaking version/redefinition of `\noalign` to use it at the end of an environment (in this case align). So far I searched for the standard definition of `\noalign` to write a redefinition based on it, but I didn't find anything so far. It would be great, if somebody could provide a definition for `\noalign` without creating a newline automatically (instead done by `\noalign{}\\\`). More clearly: If you define a `\noalign`-row within an align-environment and close the environment immediately after it without any lines filled with content (math), some space/skip will result in the document. I don't want this space at all and would be glad for a workaround. ;) Minimal:               \documentclass{article}     \usepackage{amsmath}          \begin{document}     \section{minimal}     lipsum     \begin{align*}     \eta_D &= \eta_0 \cdot \eta_R \cdot \eta_H     \end{align*}     normal spacing above     new round     \begin{align*}     \noalign{\centering $\eta_D = \eta_0 \cdot \eta_R \cdot \eta_H$}     \end{align*}     extended spacing below the align-env.     \end{document}


title: Using \nameref within \path

text: ## Background Looking to apply a consistent style to file and directory names. The book's appendix has a subsection for every file referenced by the book. Every subsection has a label whose value is that of the subsection. In this fashion, changing the label will change all the references throughout the book, accordingly. ## Problem The `\path{}` command in the URL package takes an argument and applies its style while taking into consideration backslashes. For example, the following works as expected:               \path{cities.jsp}      What would be ideal is:               \path{\nameref{sub:cities.jsp}}      This will output `\nameref{sub:cities.jsp}` into the document, rather than the desired value of `cities.jsp`. The purpose is so that if I change my mind about the file name, all I need to do is change the label "sub:cities.jsp" to "sub:city.jsp", for example, and the entire document now references "city.jsp". I use a subsection so that hyperlinks are automatically applied. ## Question How can a parameter be added to `\path{}` that first expands `\nameref` before passing the argument to `\path{}`? That is, how can I write the following:               \filename{sub:cities.jsp}      And have it become:               \path{cities.jsp}      I have tried a number of variations, but I do not understand how to use `expandafter` with parameters (and even the simplest `expandafter` examples that I can find are Latin to me). I also want to keep the `\path` command unchanged (as I use it for directory names, not file names) and add a new command `\filename` that references the files by their corresponding subsection. Examples from the preamble: ### Attempt #1               % \newcommand{\filename}[1]{\path{#1}}     % \expandafter\filename\path     \expandafter\def\filename#1{\nameref{#1}} \path      The first line gives me the `\filename` command, but does not expand the parameter until `\path` looks at it, which is not surprising. The second line fails because the parameter is not taken into consideration, nor `\nameref`. The third line generates "Undefined control sequence" errors. ### Attempt #2               \def \filename #1{\nameref{#1}}     \expandafter\def\filename \path      ## Related   * When to use \edef, \noexpand, and \expandafter?   * http://www.tug.org/TUGboat/Articles/tb09-1/tb20bechtolsheim.pdf


title: Hyperref and theoremref conflict?

text: I initially thought that this problem was with Unicode characters, but reducing the file led to the MWE below which has none, so it seems that `theoremref` and `hyperref` don't like each other. Consider:               \documentclass{book}     \usepackage{theoremref}     \usepackage{hyperref}     \newtheorem{theorem}{Theorem}          \begin{document}     \begin{theorem}     \thlabel{vmezofelint}     Sample text     \end{theorem}     Sample text (see \thref{vmezofelint} ) .     \end{document}      It produces an error message saying               File ended before scanning use of \Hy@setref@link.      My question is: does anyone know a fix, or a simple workaround for this bug? One that requires few changes to the code? **UPDATE:** The problem no longer exists with the latest version of `theoremref.` See the maintainer's answer below.


title: figure overrides linespacing

text: I am using framed package to draw a box around some texts. When I compile it without wrapping it up in the figure command I have no problem. However, when I use it like this:               \documentclass[a4paper,12pt]{report}     \usepackage{setspace} % for switching between double/single space in document     \usepackage{framed}     \usepackage[top=3cm,right=3cm,bottom=2.5cm,left=2.5cm]{geometry}          \doublespacing          \begin{document}     this is a line          this is a line          \begin{figure}     \begin{framed}     this is a line          this is another line     \end{framed}     \caption[figure1]{description for figure1}     \label{Fig_1} %for Lockstep point!see the comments!       \end{figure}          \end{document}      the linespacing reverts to default (see the attached image). Am I missing something?   BTW, I have seen Post1 and Post2, still no clue. If it is important why I used framed, I must mention that when using double spacing, the text spans more than 1 page and framed does a nice job. ![alt text](http://i.stack.imgur.com/pDJrA.png)


title: How to get hanging hyphenation?

text: I am using XeTeX from TeXLive-2010-Basic in OSX with plain-format. My try was to follow the TeXbooks setup for commas et such (which I already have working nicely):               \defaulthyphenchar=`‐% it is Unicode 2010     \font\rm="TeX Gyre Pagella"     \newdimen\hyphang \setbox0=\hbox{‐} \hyphang=\wd0     \def\hyphen{‐\kern-\hyphang\kern\hyphang}     \catcode`‐=\active \let‐=\hyphen      but it didn't work. TeXbook suggests to use "a special font with zero-width `\hyphenchar`", but I don't know how one would go about doing that. Would you have any suggestions on how to achieve this?


title: How to get new line after \subparagraph title?

text: Is there a default way to change the style of the `\subparagraph` title, namely to add a new line after the title? Is there a way to do it without `\renewcommand` (some style changes of something else) - if not, how to do it with `\renewcommand` corectly?


title: Strange spacing with gathered and aligned

text: I often want to list a number of short equations (like the non-zero components of a tensor) under a single equation number. To do this I use combinations of the `amsmath` environments `equation`, `gathered` and `aligned`. However, for some reason, the different parts of the `gathered` environment are not all centered. Consider the example               \documentclass{article}     \usepackage{amsmath}     \begin{document}          \begin{equation}       \begin{gathered}         \begin{aligned}           q &= r \,, &           x &= y \,, &           z &= w \,,         \end{aligned} \\         \begin{aligned}           A a &= B b \,, &           C c &= D d \,, \\           a &= b \,, &           c &= d \,.         \end{aligned}       \end{gathered}     \end{equation}          \end{document}      I would expect the first two lines both to be centered, but instead they come out more or less aligned at the right hand side. For a real world example consider               \documentclass{article}     \usepackage{amsmath}     \begin{document}          \begin{equation}       \begin{gathered}         \begin{aligned}           \omega_t{}^{01} = -\omega_t{}^{10} &= \sinh\rho \,, &           \omega_\phi{}^{12} = -\omega_\phi{}^{21} &= -\cosh \rho \,, &           \omega_\rho{}^{AB} &= 0 \,,         \end{aligned} \\         \begin{aligned}           \omega_{\varphi_+}{}^{35} = -\omega_{\varphi_+}{}^{53} &= 2\sin\beta_+ \cos\gamma_+ \,, &           \omega_{\varphi_+}{}^{45} = -\omega_{\varphi_+}{}^{43} &= 2\sin\gamma_+ \,, \\           \omega_{\varphi_-}{}^{68} = -\omega_{\varphi_-}{}^{86} &= 2\sin\beta_- \cos\gamma_- \,, &           \omega_{\varphi_-}{}^{78} = -\omega_{\varphi_-}{}^{87} &= 2\sin\gamma_- \,.         \end{aligned}       \end{gathered}     \end{equation}          \end{document}      Here the first line is pushed even more to the left. It seems like there is some extra space introduced at the end of the first line, but where does this space come from?


title: Unlike PGF/Tikz uses the middle part of stroke as the reference, what is the reason for choosing `dimen=outer` as the default in PSTricks?

text: The question has been written in the title above. Why not `dimen=middle` ?


title: Two Column Layout for Tables

text: I have a table with many rows, but only a single column. The column itself is a coefficient for an algorithm, hence just a number. Currently, when typeset with the `longtable` package it looks somewhat suboptimal. I wish to typeset it so that the table appears to have two columns with semantics similar to a two-column document layout (text goes top to bottom, left column to right column). While I could try to emulate the effect manually (by having a two columned table) this would require an immense amount of manual adjustment every time the pagination is changed. Is there a way of going about this? **Update** I've attached an example of what I mean (the image is taken from an old scientific paper). The data itself spans two pages (only the first of which is shown). ![Sample](http://i.stack.imgur.com/JkFok.png)


title: Why do we need eleven expandafters to expand four tokens in the right order?

text: In Appendix D - Dirty Tricks Knuth gives an example of expanding four tokens in the right order by using `eleven` `\expandafter` commands. Here, is the code slightly adapted for to-morrow!               \tracingmacros=2  \tracingcommands=2     \def\z{M}     \def\Z{C}     \def\a{\z er}     \def\b{ry }     \def\c{\Z hr}     \def\d{ist}     \def\e{mas}          \expandafter\expandafter\expandafter\expandafter     \expandafter\expandafter\expandafter\a     \expandafter\expandafter\expandafter\b\expandafter\c\d \e          \bye      This is in plain TeX, so you need to run it with pdfTeX. Why do we need 11 expandafters? Is there a rule of thumb for this type of definitions? How many do you need to expand five i.e, to expand `\e` also which I conveniently spaced out!


title: Prevent pagebreak inside table of contents entry

text: For a sandwich thesis, I'm typesetting a _List of Papers_ using the tocloft package. Each entry contains the full citation (using biblatex's `\fullcite`), so it can be rather long. I've currently typeset it as follows (where `\makeanypaperBiblio` is an argument to a custom function):                  \addcontentsline{pap}{papers}{%         {\bfseries Paper~\numberline{\Roman{paper}}}\\[.25\baselineskip]%         \fullcite{\makeanypaperBiblio}\vspace{2ex}}%      I want to ensure that the entire contents-line will be on a single page in my _List of Papers_ , but the usual way of preventing pagebreaks is not working. To illustrate the issue with a _MWE_ :               \documentclass[a5paper]{article}     \begin{document}%     \tableofcontents     \section{Test}     \addcontentsline{toc}{section}{Very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very long}     \addcontentsline{toc}{section}{Very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very long}     \addcontentsline{toc}{section}{\begin{samepage}Very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very very very very very very very very very very     very very very very very very long\end{samepage}}     \end{document}      Compiling this example fails with:               ! Argument of \@sect has an extra }.     <inserted text>                      \par      l.31 ...ry very very very very long\end{samepage}}          ?      Runaway argument?      Clearly, I cannot use the `samepage` environment inside `addcontentsline`, or at least not without trickery. How can I prevent a table of contents entry from spanning more than one page?


title: Printing text at the bottom of the next page

text: I am having some trouble placing text at the bottom of the next page. For some reason, the text is being printed at the bottom of the current page. I tried nesting but it only works for the first printing on next page command. Please help me fix this.                       \documentclass{article}             \usepackage{atbegshi}             \usepackage{blindtext}             \usepackage{picture}                  \newcommand{\printnextpage}[1]{             {\LARGE to print on bottom of next page }                       \AtBeginShipoutNext{%             \AtBeginShipoutUpperLeft{%              \put(0.1\paperwidth,-0.95\paperheight){#1}%              }%             }             }                  \begin{document}             \blindtext[2]             \printnextpage{i am at bottom}             \blindtext[7]             \printnextpage{im at bottom too}             \blindtext[9]             \end{document}


title: Detect aspect ratio in beamer

text: I'm doing my slides with `beamer`. At the moment I am not sure about the aspect ratio that will be used at the presentation. I know I can change the ratio with class options of `beamer`. The problem is that changing the aspect ratio changes the document dimension, so I have to adjust some parameters (figure height) in my presentation. I will like to design the presentation for 4:3 and 16:9 ration. Is it possible to have something like               \ifratio{34}{do somthing}     \ifratio{169}{do ohters}      or               \ifratio{34}{do this}{else this}


title: Inline citations with only author, title and year

text: I would like to put a few reference inside a beamer presentation. Adding a full fledge bibliography is certainly awkward but the output of the `\fullcite` command from the `biblatex` pacakge is too verbose. I am looking for a command similar to `\fullcite` that would only insert author, title and year Some sort of MWE would be:               \documentclass{beamer}     \usepackage[backend=bibtex, style=authoryear-comp]{biblatex}     \addbibresource{biblio}          \begin{document}     \begin{frame}       \XXXcite{Kennedy01}     \end{frame}          \end{document}      with biblio.bib containing               @Article{Kennedy01,       author =       {Kennedy, Marc C. and O'Hagan, Anthony},       title =        {Bayesian calibration of computer models},       journal =      {Journal of the royal statistical society: series b (statistical methodology)},       year =         2001,       volume =    63,       number =    3,       pages =     {425-464}}      and `\XXXcite` being the needed command similar to `\fullcite`. I suppose that Where can I find collections of bibliography styles? could be used but I have only a very restricted understanding of the working of `biblatex`.


title: Citing and printing only last name of author(s) using biblatex-chicago

text: I would like a citation command to reference and print only the last name(s) of the author(s) of my sources while writing my thesis in `biblatex-chicago` (which would include an hyperlink as well). What should I do to achieve this? For example, given the following reference in my .bib file,                  @BOOK{GThomson,        title = {Rethinking Secondary Education: A Human-Centred Approach},        publisher = {Pearson Education},        year = {2012},        author = {{Gill, Scherto} and {Thomson, Garrett}},        address = {Great Britain},        edition = {1st}        }      how can I reference the authors as "Gill and Thomson" in my thesis instead of "Gill, Scherto and Thomson, Garrett" (with an added `hyperlink` hopefully as well)?


title: How to insert a main caption beside subfigures?

text: I have 3 subfigures that I insert at `width=0.5\textwidth`, which leaves some empty space. I would like to insert the main caption in this space. How can I do this? I am using `subcaption` package for this but I read that `floatrow` might be a bit more flexible in cases like this. Solutions with either (or any other) package are welcome.               \documentclass[10pt, a4paper]{report}     \usepackage[paperheight=5.5in, paperwidth=6.267in, top=0in, bottom=0in, left=0in, right=0in]{geometry}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage{uarial}     \renewcommand{\familydefault}{\sfdefault}                    \usepackage{graphicx}      \usepackage[bf]{caption}     \usepackage[singlelinecheck=false, aboveskip=-3pt]{subcaption}     \renewcommand\thesubfigure{\Alph{subfigure}}                \begin{document}     \pagenumbering{gobble}     \setcounter{figure}{6}     \begin{figure}             \captionsetup[subfigure]{labelformat=simple}             %\captionsetup{font={onehalfspacing},skip=-10pt}             \begin{subfigure}[t]{0.5\textwidth}                     \caption{}                                   \includegraphics[width=\textwidth]{dummy.png}                     \label{fig2d}             \end{subfigure}             \begin{subfigure}[t]{0.5\textwidth}                     \caption{}                                   \includegraphics[width=\textwidth]{dummy.png}             \end{subfigure}\vspace{-10pt}             \begin{subfigure}[t]{0.5\textwidth}                     \caption{}                                   \includegraphics[width=\textwidth]{dummy.png}                     \label{fig2d}             \end{subfigure}\vspace{-15pt}             \caption{Figure caption describes subfigures A, B and C}     \end{figure}          \end{document}      ![example](http://i.stack.imgur.com/vPWvI.png) EDIT: sorry for not being clear, the empty space I refer to is [below subfigure B and beside subfigure C]. That is, when I have an odd number of subfigures and I'd like to not have the main caption below the whole figure but use space more efficiently by inserting it to the right of the last subfigure. I'll upload a figure soon to make this clear. If I insert an additional subfigure (but only the legend without the actual figure), I get something close to what I want:               \begin{subfigure}[t]{0.49\textwidth}                     %\caption{}                                   \vspace{50 pt}                             \caption{Figure caption describes subfigures A, B and C; this is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legend}             \end{subfigure}      The problem with this is that the legend has subfigure numbering, whereas I need it to be main figure numbering. I suspect that there might be a way to define a new subtype of caption, maybe in `subcaption.sty` but I am not sure how! ![example2](http://i.stack.imgur.com/Dwq86.png)


title: In LyX, what is the most standard way to type a system of equations?

text: I have a system of equations and would like the alignment to be done on the equal sign.                phi_{t+1}  =  F\xi_{t}        y_t        =  A'X_t      \theta_t   = \mu + \epsilon_t      What is the most standard way to have this with LyX ? Do I need to install additional packages ?


title: Newline in a "cases" environment

text: I have the same issue as in this question: Split-like environment inside cases environment with one difference - I would like to get the same result with LyX, using as little LaTeX code as possible. How can I do that? Here's my formula:               \begin{cases}     \epsilon & \exists k\left[i_{k}=0\right]\\     \mbox{LCS}\left(X_{1}\left(i_{1}-1\right),X_{2}\left(i_{2}- 1\right),\ldots,X_{n}\left(i_{n}-1\right)\right)||\sigma_{1}^{i_{1}} & \sigma_{1}^{i_{1}}=\sigma_{2}^{i_{2}}=\ldots=\sigma_{n}^{i_{n}}\\     \max\left\{ \mbox{LCS}\left(X_{1}\left(i_{1}-1\right),X_{2}\left(i_{2}\right),\ldots,X_{n}\left(i_{n}\right)\right),\mbox{LCS}\left(X_{1}\left(i_{1}\right),X_{2}\left(i_{2}-1\right),\ldots,X_{n}\left(i_{n}\right)\right),\ldots,\mbox{LCS}\left(X_{1}\left(i_{1}\right),X_{2}\left(i_{2}\right),\ldots,X_{n}\left(i_{n}-1\right)\right)\right\}  & \mbox{else}\end{cases}


title: Make \part in scrartcl

text: I am using the `scrartcl` of well-known KOMA-script (to those that know it well). As you know the article class has an environment called **Abstract**. Great, I like this and I use it. However, what I actually a making (and I have asked many questions here about the same and I am sorry I do not really answer questions because I am way more incompetent than the people that can actually answer them. Perhaps soon after I learn more!) What I have is an document called `Puzzles.tex` that is basically a template for each puzzle which is in a `<description of puzzle>.tex` file. Great! However, I also have different categories of these puzzles. What I would like is a page in between that states say: _APPLES!!_ for problems related to apples. That could be named I. APPLES!! on the page and for the rest an empty pagestyle (or whatever). The next files are included and the title is a `section` and the parts are `subsections`. **Summary:** So, basically the problem is: How do I make a `\part` for the scrartcl class? I also would like to have it in the TOC. Another option would be to implement an abstract in the book class (and then do section -> chapter and subsection -> section), but using the book class seems weird as I probably have less than 30 pages. Any option that would give me what I need would be interesting, even the ones I did not mention. My ignorance can contribute to the fact that I miss better solutions.


title: Handout: beamerarticle + ignorenonframetext?

text: I need an article version of my beamer presentation. But here, the non-frame text should be excluded (cf. beamer option "ignorenonframetext"). I tried:               \usepackage[active,generate=tischvorlage,extract-env={frame},extract-cmd={section,subsection}]{extract}       but this did not work (strange errors). What strategy could work?               \documentclass{article}      \usepackage{beamerarticle,blindtext}      %\documentclass[ignorenonframetext,handout]{beamer}          \begin{document}      \begin{frame}      \tableofcontents      \end{frame}           \section{Heading}      \begin{frame}{Frame title}      \blindtext      \end{frame}      \textbf{Manuscript part} \blindtext           \subsection{Subsection without frame}      \textbf{Manuscript part} \blindtext           \end{document}       XPost: http://www.golatex.de/viewtopic.php?p=61511 (no reactions so far)


title: Hyperref, amsmath, and horizontal spacing at start of a numbered equation

text: When `amsmath` is loaded before `hyperref` (which I thought was the preferred order), spacing within the equation environment is altered:               \documentclass{article}     \usepackage{amsmath}     \usepackage{hyperref}     \begin{document}     \begin{equation}       -x = -x     \end{equation}     \end{document}      gives ![an equation with wrong spacing](http://i.stack.imgur.com/ZiWkK.jpg), where the first minus sign seems to be taken as a binary operator, rather than a unary sign. When `hyperref` is loaded before `amsmath`, the spacing is identical on both sides of the equation. What is going on? Is the fix simply to load the packages in the opposite order? (In fact, I set `\pagestyle{empty}\hsize=70pt` to get the number close enough to get a good-loooking cropped output.)


title: Bibtex4word, revtex4, and AIP style

text: I am trying to get the AIP bst files to word with `bibtex4word`. I am new at pretty much all of it. I was using the word references but it does not have many styles, including Applied Physics Letters. I am using MikTeX 2.9, JabRef 2.9.2, and `Bibtex4word`. I have my references in JabRef. I am able to use `Bibtex4word` with the default styles (plain, alpha, `IEEEtran`) but am having a hard time installing the new styles. I downloaded the files here: http://publish.aps.org/revtex then copied the "required" files as described in the Readme in the appropriate directories. I used MikTeX program manager to install the `Revtex` package and styles. I was then able to get the styles to work in `bibtex4word`, sort of. The `aipnum4-1` style should use a superscript number for the reference and should be a minimal bibliography. The data in the bibliography seems to work right but there is a ton of extraneous stuff (like the category labels). I've included a "plain" and an `aipnum4-1` example below using the `Test4w.doc` file included with the `Bibtex4word`. Have I done something wrong in my setup? Is this a problem that others have? How do I fix it? Is there a better AIP-APL `bibtex` package that might work? This is what I get using "plain" style:               Citation List          [1, 2, 3, 4]          Bibliography          [1] Bob Ollerton, Bill Ollerton, and Barnaby Ollerton. Dynamic stabilty in rapid turn manoevres. Journal of Broomstick Design, 52(4):273–282, January 1926.     [2] Claude E. Shannon. Juggling with quafffles. In Proc. Warlock Juggling Federation Convention, pages 384–389, Hogsmeade, January 1975.     [3] Kennilworthy Whisp and J. K. Rowling. Ancient broom games, chapter 2, pages 3–6. In [4], 2001.     [4] Kennilworthy Whisp and J. K. Rowling. Quidditch through the ages. Whizz Hard Books, 2001.      This is what I get using the "aipnum4-1" style:               Citation List          [[Ollerton, Ollerton, and Ollerton(1926), [Shannon(1975), [Whisp and Rowling(2001a), [Whisp and Rowling(2001b)]          Bibliography          [[Ollerton, Ollerton, and Ollerton(1926)]   author author B. Ollerton, author B. Ollerton,  and author B. Ollerton, 10.1598/JBD.52.4.1 journal journal Journal of Broomstick Design volume 52, pages 273–282 (year 1926)NoStop%     [[Shannon(1975)]    author author C. E. Shannon, in @noop  booktitle Proc. Warlock Juggling Federation Convention (address Hogsmeade, year 1975) pp. pages 384–389NoStop%     [[Whisp and Rowling(2001a)] author author K. Whisp and author J. K. Rowling, title Ancient broom games, Chap. chapter 2, pp. pages 3–6, in [[Whisp and Rowling(2001b)] (year 2001)NoStop%     [[Whisp and Rowling(2001b)] author author K. Whisp and author J. K. Rowling, @noop  title Quidditch through the ages (publisher Whizz Hard Books, year 2001)NoStop%


title: Creating a strikeout command

text: I am trying to create a command that works in mathmode which simulates a strikeout diagonally while leaving the math display intact. ![enter image description here](http://i.stack.imgur.com/jbHCn.png)               \documentclass{article}     \usepackage{amsmath,amssymb}     \usepackage[dvipsnames]{xcolor}     \usepackage{tikz}     \usetikzlibrary{shapes.misc}          \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}     \newcommand{\strikeout}[1]{%     \ifmmode%           \tikz[inner sep=0.5pt,baseline] \node [strike out,draw=OrangeRed,anchor=text]{$#1$};%     \else%           \tikz[inner sep=0.5pt,baseline] \node [strike out,draw=OrangeRed,anchor=text]{#1};%     \fi%     }          \begin{document}     $\dfrac{x^2\times 10^3}     {x^2\strikeout{\times 10^3}}$          $\dfrac{x^2\times 10^3}     {x^2\tikzmark{matha}\times 10^3\tikzmark{mathb}}$     \tikz[remember picture, overlay,OrangeRed]     {\draw ($(matha)+(0.1em,-0.125em)$) --                 ($(mathb)+(-0.1em,0.825em)$);}          $\dfrac{x^2\times 10^3}     {x^2\tikzmark{matha}\times 10^3\tikzmark{mathb}}$     \tikz[remember picture, overlay,OrangeRed,baseline]     {\draw[anchor=text] (matha.south west) --                 (mathb.north east);}     \end{document}      Note the discrepancies in the displays. The first does not maintain the `mathmode`. Note I want this to work for any scenario thus I was thinking of redefining the `strikeout` command I have by using `remember picture, overlay`. But note my problem is to get to the line to be drawn like the original `strikeout` command. The second code seems to do the trick but it is fixed and am trying to make a user friendly command and well the third, its just out of the question. Thus, I am looking for a suitable way to make a command usable and with the results desired.


title: Adjusting layout of text/bullets within beamer

text: This is a rather simple question, but I've been having trouble. My simplest goal is to be able to easily adjust my frame environment so that its displays like this: **First-line -- I want this BOLD**   * Bullet one   * Bullet two The below code works fine... however, I'd like to avoid typing textbf{} at the beginning of each line and just have every frame defined in this way.               \begin{frame}{Frame title}        \textbf{First line -- I want this BOLD}            \begin{itemize}            \item Bullet one            \item Bullet two            \end{itemize}     \end{frame}      * * * If this is easy enough to tweak, what I'd really like to do is have all of the itemizing and sub-itemizing to follow this format: **Size 16**   * Size 14 (with circle bullet point)   * Size 14 (with circle bullet point)      * Size 12 (with dash bullet point) Is there a way to do this?


title: KILE replace phrase in all project files

text: I know it is not directly a LaTeX question, but it is regarding the TeX-editor KILE: There is a "Find in Project" option but I don't find any "Replace in Project" option. Is there any? What is the easiest way to replace all "ABC" strings by "abc" in all project files?


title: Draw a line under the headertext in ConTeXt

text: Sometimes, in order to seperate the headertext from the text area, I need draw a line just under the headertext.               \setuppagenumbering     [location=,      alternative=doublesided]          \definepagebreak     [chapterpagebreak]     [yes,header,footer,right]          \setuphead     [chapter]     [style=\bfc,      header={empty,nomarking},       page=chapterpagebreak]          \def\pageoddoreven{%     \ifodd\pagenumber       {\getmarking[sectionnumber]\hskip1em\getmarking[section][first]}     \else       {Chapter~\getmarking[chapternumber]\hskip1em\getmarking[chapter]}     \fi}          \setupheadertexts     [text][\pageoddoreven][pagenumber]          \setupheader     [style=bold,after=\thinrule]          \starttext     \chapter{First Chapter}     this is the first chapter     \page        the second page of the first chapter     \chapter{Second Chapter}     this is the second chapter     \page     the second page of the second chapter     \stoptext      but the `\thinrule` will be across the whole page, that is what I what. ![thinrule](http://i.stack.imgur.com/teNm2.png) I want a line that is only across the text area, not extending to the left and right margin. How can I draw this line?


title: Wrong Reference in glossary - difference shown pagenumber and reference location

text: As in this previous Link Problem I reproduced the error. First, this is my code:               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}      \usepackage[     bookmarks,     bookmarksnumbered,         bookmarksopen=true,     bookmarksopenlevel=1,     %backref,     pdftex,     plainpages=false,      pdfpagelabels=true,      hypertexnames=false,      linktocpage      ]{hyperref}          \usepackage{lipsum}          \usepackage[     toc,     nolong,      nosuper,      notree,     section = section]{glossaries}     \makeglossaries          \newglossaryentry{glos:sample}{name=sample,description={an example}}          % Here starts the document          \pagenumbering{Alph}     \begin{document}     \title{ Here it is}     \maketitle     \clearpage          \pagenumbering{Roman}     \pdfbookmark[1]{"content table"'}{toc}          Content table          \newpage     content     \newpage     content     \newpage               list of tables          \newpage          list of figures          \newpage          \pagenumbering{arabic}     %Some input          \lipsum[1-60]          \newpage     % some \gls{label} on Page "12" (but 18 of Total pages)     \gls{glos:sample}          \newpage          \lipsum[61-80]          % input ends here     \clearpage     \appendix     \pagenumbering{roman}     %some appendix content     \lipsum[81-120]     \clearpage     \printglossary     \end{document}      With this, the glossary-Entry shows "12" (arabic), which is right, but it references and jumps to Page 12 of total Pages, which should be 18 in the example. Do I have some options wrong? It turns me crazy. My distribution is MikTex 2.9 on x64 with texlipse-plugin in Eclipse (Windows 7 x64).


title: Spreading newenvironment over two pages

text: I am using a template found online to do my CV and I am getting a hard time trying to spred the content of a newenvironment over two pages. I want the content of one of my `rubrique` to be over the end of a page and the beginning of the next one instead of having everything on the second page. My document look like the following code. Thanks for any advices.               \newcommand{\ligne}[1]{\rule[0.5ex]{\textwidth}{#1}\\}     \newcommand{\interRubrique}{\bigskip}     \newcommand{\styleRub}[1]{\noindent\textbf{\large #1}\par}     \newcommand{\indentStd}{\noindent\hspace{\lenA}}          \newenvironment{rubrique}[2][\linewidth] {         \styleRub{#2}         \setlength{\lenB}{#1}         \setlength{\lenC}{\linewidth}         \addtolength{\lenC}{-\lenA}         \addtolength{\lenC}{-\lenB}         \addtolength{\lenC}{-\parindent}         \addtolength{\lenC}{-1pt}         \indentStd\begin{tabular}[t]{p{\lenB}p{\lenC}}     }          \newcommand{\lieu}[1]{{\textmd{\textsl{#1}}\ }}     \newcommand{\activite}[1]{\textmd{\textbf{#1}}\ }     \newcommand{\comment}[1]{\textmd{#1}\ }     \pagestyle{empty} % pour ne pas indiquer de numro de page...               \begin{document}          \newlength{\lenA} % indentation au dbut d'une ligne     \setlength{\lenA}{0.cm}     \newlength{\lenB} % Taille champ dates     \newlength{\lenC} % Taille champ description          \interRubrique           \begin{rubrique}[15cm]{Education}       \ligne{0.1mm}        \activite{Ph.D. Candidate} \comment{(blabla)}        & 2009 - current \\       \lieu{Memorial University of Newfoundland               , St John's, NL, Canada}\\           \\                 \activite{Master of Science}\comment{(Earth)}      \end{rubrique}          \interRubrique           \begin{rubrique}[15cm]{Professional experience}         \ligne{0.1mm}         \activite{Aaaaaa}                 &2011 (1 week)\\                  \lieu{  Pasadena}                  \begin{itemize}                 \item[$\bullet$] \comment{Build a new                   international collaboration ...}                \end{itemize}                           \\         \activite{Research assistant}         & 2008 (6 months)  \\                 \lieu{Laboratoire}                 \begin{itemize}                 \item[$\bullet$] \comment{Analysed ...}                  \end{itemize}                           \\         \vspace{0.2cm}\\     \end{rubrique}     \end{document}


title: change bib-style plaindin with fullstop at the end

text: I use the bibliographystyle `plaindin`. The resulting bibliography looks very much how I want it to be, but there are two problems:   1. Having more than one author the output is  > author 1 ; author 2 ; ... but I want it to be like this: > author 1; author 2; ... without the space before the semicolon.   2. I want to have a fullstop at the end of each entry. Is there an easy way to fix it?


title: Conditional based on packageoption

text: I added a counter to the `todonotes` packages `\todo` so I could display the total number of todos I have left. However I also enjoy working with the package option disabled. Therefore I would like to wrap the part where I typeset the counter in a conditional that is only executed when the packageoption `disable` is NOT given. However I do not know how I can access this package option. MWE:               \documentclass{report}     \usepackage{letltxmacro}                        %properly rename protected macros     \usepackage{totcount}                           %counter totals before last increment     \usepackage{xcolor}                             %for the red text (will be loaded by todonotes but for completness)     \usepackage{todonotes}     \usepackage{hyperref}                           %make links in listoftodos clickable          \newtotcounter{todocounter}     \LetLtxMacro{\oldTodo}{\todo} %avoid endless recursion be redefining \todo as \todo+x     \renewcommand{\todo}[2][]{\stepcounter{todocounter}\oldTodo[#1]{#2}}          \begin{document}     \LARGE{\textcolor{red}{\total{todocounter} todos left}} %if wrap this line     \todo{1}          later     \todo{some more}     \listoftodos     \end{document}


title: Uneven line height in XeTeX

text: I'm embarking on a journey to create a conference abstract book using XeTeX and got stuck within five minutes: > ![enter image description here](http://i.stack.imgur.com/XsA5u.png) The missing 'g' in 'somethin' influences the line height of the following line. How can I correct this? At the end I want to be able to include the abstracts and corresponding information through our online registration system, so this should be a global setting. My MWE:               \documentclass[10pt, a5paper]{article}     \usepackage{fontspec}          %% GEOMETRY     \usepackage[left=2cm, right=1.5cm]{geometry} % to change the page dimensions          \newenvironment{AbsHead}     {         \fontsize{16}{22}\headfont\noindent     }%     {         \vspace{0.5 cm}     }          \newenvironment{AbsAuthors}     {         \fontsize{12}{14}\authorfont\noindent     }%     {        \vspace{0.5 cm}     }          \begin{document}          ￼￼￼￼\setmainfont{Minion Pro}     \newfontfamily\authorfont{Helvetica Neue Light}     \newfontfamily\headfont{Helvetica Neue Condensed Bold}          \begin{AbsHead}The XIAP  something something something somethin somethin somethin somethin somethin somethin somethin something something\end{AbsHead}           \begin{AbsAuthors}Somebody Someone\end{AbsAuthors}           \noindent Purpose: Lorem ipsum     \end{document}


title: Too much space between author and year in apacite citations

text: Does anyone else feel that there's too much whitespace between author and year in the following example (note the red brackets)? Or is it proper standard and just annoys me because I'm not used to it? ![citation with too much spacing](http://i.stack.imgur.com/infGX.png) If you agree; how would I go about removing it, considering the following minmal working example?               \documentclass{report}     \usepackage[natbibapa]{apacite}     \bibliographystyle{apacite}     \bibliography{sample}     \begin{document}         \noindent \citep{bundesen2005,logan1996,logan2001,logan2002}.     \end{document}      sample.bib


title: Highlighting code like one would in a SE post

text: When posting on SE, users can "highlight" code by using the ``` symbol. Is there any way to get that in LaTeX? My intention is to highlight segments of code or particular functions. To be clear, I'm not speaking of something like Syntax highlighting for different programming languages. I want to be able output `this_instead` (no magic wizardry involved). I'm not sure what this is called, so I didn't know how to search for it. I'll delete it if it's a duplicate though.


title: Is it possible to change jobname from within the input file?

text: > **Possible Duplicate:**   >  How to influence the name of the pdf file created with pdfLaTeX (from > within the source code)? I have a template as follows.               % template.tex     \documentclass{article}     \usepackage{pstricks}     \SpecialCoor     \usepackage[active,tightpage]{preview}     \setlength\PreviewBorder{0pt}     \PreviewEnvironment{pspicture}          \begin{document}     \InputIfFileExists{\InputFileName}{%         % if it is compiled with latex.exe, it will produce DVI output with \InputFileName as its name.         % if it is compiled with pdflatex.exe or xelatex.exe, it will produce PDF output with \InputFileName as its name.     }{%         % notify error!     }        \end{document}      If I execute either `TeXDviPsPdf.bat subfile` or `TeXPdf.bat subfile` in the DOS prompt,               rem TeXDviPsPdf.bat takes a file name without extension     latex "\def\InputFileName{%1}\input{template}"     dvips %1.dvi     ps2pdf %1.ps     acrord32 %1.pdf                    rem TeXPdf.bat takes a file name without extension     xelatex "\def\InputFileName{%1}\input{template}"     acrord32 %1.pdf      where the `subfile.tex` contains code as follows               % subfile.tex     \input{pstricks}     \begin{pspicture}(1,1)     \psframe(1,1)     \end{pspicture}      I will obtain `subfile.pdf` rather than `template.pdf`. Is it possible to produce a DVI or PDF output with a name specified in the TeX input file? Note: I can actually rename it in the batch files, but I want to know whether it is possible to be done internally.


title: exporting pdf with file name time stamped

text: I want to export the latex lyx file to pdf with the name with pattern - file name -date stamp .pdf . Can this be done using any package? Eg name.tex should export as name20140110.pdf


title: Tikz and babel error

text: This code works correctly:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{positioning,calc}     \begin{document}          \begin{tikzpicture}       \tikzset{         every picture/.prefix style={           execute at begin picture=\shorthandoff{;}         }       }       \def\names{{"1", "2"}}       \foreach \i in {0,1} {%         \ifnum\i=0\relax           \node (\i) [draw] {\pgfmathparse{\names[\i]}\pgfmathresult};         \else           \pgfmathparse{int(\i-1)}           \node (\i) [draw,right= 1cm of \pgfmathresult]                 {\pgfmathparse{\names[\i]}\pgfmathresult};           \draw[dotted] ($(\pgfmathresult.south east) !.5! (\i.south west)$)                 -- +(0,1cm);       \fi     }     \end{tikzpicture}     \end{document}      But when I add               \usepackage[utf8]{inputenc}     \usepackage[german]{babel}      to the preamble, it starts giving an error:               ! Argument of \language@active@arg" has an extra }.     <inserted text>                      \par      l.25 }      the same for russian. It is somehow related to the quotes in the array:               \def\names{{"1", "2"}}      I tried the tricks, shown here for the french, but they don't work.


title: Which dot character to use in which context?

text: Wikipedia lists several dot characters in Unicode. These are the ones that are ambiguous to me:   * interpunct, middle dot (*) `·` `·` `U+00B7` "midpoint (in typography)"   * dot operator (⋅) `⋅` `⋅` `U+22C5`   * bullet operator (∙) `∙` `U+2219` "(mathematics)"   * bullet (•) `•` `•` `U+2022` "black small circle" "often used to mark list items" I'm mostly interested in the Unicode characters, but Math.SE told me to try here, and LaTeX likewise has:   * `\cdot`   * `\cdotp`   * `\bullet`   * `\textbullet` * * * For example:   * Wikipedia shows multiplication as both "x ⋅ y" ("dot operator") and "x ∙ y" ("bullet operator") in the same paragraph.    * WP List of mathematical symbols uses "middle dot" for multiplication.   * WP Multiplication article uses `\cdot` for scalar multiplication.   * WP says the matrix dot product should be written using the "bullet operator" character, like " **a** ∙ **b** ".   * The WP Dot product article uses the LaTeX `\cdot` character for dot products.   * Wikipedia shows a raised decimal point example "£21·48", which uses the "middle dot" character.   * Wikipedia notates chemistry hydrates like "CuSO4 · 5H2O", which uses the "middle dot" character.   * Combined units can also be written with a dot, like "N·m". Wikipedia uses a "middle dot" for this, not the "dot operator".   * Characters in SI notations has a paragraph on combined units, seeming to say that dot operator is preferred for this, like "N ⋅m".   * Wolfram Alpha considers `\cdot` and `·` to be equivalent, as well as `\bullet` and `•`. Valid? Of course it's pedantic, they all look the same, and the meaning can always be assumed from context, but I'd like to know, once and for all, which Unicode/HTML and LaTeX characters are semantically correct in each application? (If there are other examples I left out, feel free to edit the question and add them.)


title: What is the difference between \ldots and \cdots?

text: What is the difference between `\ldots` and `\cdots`? For example, To write a sequence of points which is best to use? `a_1,\ldots,a_n` Or `a_1,\cdots,a_n`. Couple of examples of the difference can be useful.


title: Draw offset of polylines

text: I'm afraid that I have a followup question to this one. Consider the following MWE               \documentclass{standalone}          \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}       \begin{tikzpicture}[scale=.25]         \tikzset{           ncbar/.style={             to path=%             ($(\tikztostart)!#1!90:(\tikztotarget)$)             -- ($(\tikztotarget)!($(\tikztostart)!#1!90:(\tikztotarget)$)!90:(\tikztostart)$)           },           ncbar/.default=0.5cm,         }              \draw[red,ultra thin] (0,0) -- (1,2) -- (2,0);         \draw[blue,ultra thin] (0,0) to[ncbar=0.25cm] (1,2) to[ncbar=0.25cm] (2,0);            \end{tikzpicture}     \end{document}      which yields: ![enter image description here](http://i.stack.imgur.com/NprbO.png) Note that the source of the second part of the blue path is not "correct". In turn, the second blue part is _not_ parallel to the red counterpart. How can I fix this? Somehow reset/set `\tikztostart`? **Bonus question:** How can I bridge the gap between the two blue parts using the missing part of a circle arc (this circle centered at the apex of the red curve and of radius `0.25cm` in this example)?


title: what is the way to make a sqbullet in itemize structure

text: First of all, when I want to use an itemize structure in simply latex document I have not this problem, I mean, I got sqbullet in itemize list. But.. when I inlcude a tikz picture, maybe, I load some packages and then I got dots in itemize list. For this reason, I would like to know how to get sqbullet in this cases. I´ve tried               \begin{itemize}         \item [\sqbullet] A     \end{itemize}      or somethin like this How to change the nested itemize bullet characters? But I didn´t. Thank you in advance!


title: Which one should be used in limit, \rightarrow or \to?

text: Which one should be used in limit, `\rightarrow` or `\to`?


title: How to add label to a 'copy shadow' of an object?

text: I use the following MWE which produces a stack of 4 squares with the top one marked by '0' label. What I want is to add labels '1', '2' and '3' to corresponding squares behind the top one.               \documentclass{report}     \usepackage[english]{babel}          \usepackage{tikz}     \usetikzlibrary{shadows}          \begin{document}     \begin{tikzpicture}        \node[         minimum width = 3cm,         minimum height = 3cm,         draw, fill = white,         copy shadow = {shadow xshift = 3ex, shadow yshift = -3ex},         copy shadow = {shadow xshift = 2ex, shadow yshift = -2ex},         copy shadow = {shadow xshift = 1ex, shadow yshift = -1ex}       ] (Block) {};            \node[inner sep = 2pt, below left] at (Block.north east) {0};     \end{tikzpicture}     \end{document}


title: Beamer frame: adding something to the last slide

text: How can one create a new environment `eframe` so that some element is added (the place can be hardcoded) on the last slide of the frame? Suppose I have many frames with lots of `\pause`s:               \begin{frame}{Frame 1}         one\pause two     \end{frame}          \begin{frame}{Frame 2}         one\pause two\pause three     \end{frame}      Replacing `frame` by `eframe` I would like to end up with the following behaviour:               \begin{frame}{Frame 1{\onslide<3>{END}}}         one\pause two     \end{frame}          \begin{frame}{Frame 2{\onslide<4>{END}}}         one\pause two\pause three     \end{frame}      I don't want to hardcode this numbers `3` and `4` because if later I decide to add more `pause`s, I would have to change those numbers.


title: Escape special characters in text field of pdf form

text: I am using `hyperref` to render a form. I would like to initially fill the text fields with some dynamic content. Therefore, I have to escape special characters in the content. I managed to discover how I can escape `&`, `%`, `$`, `#`, `_`, and `^` by trial and error but how can I escape `\`, `{`, `}`, and `~`?               \documentclass{article}          \usepackage{hyperref}          \begin{document}          \TextField[value={&\%$\#_^}]{}          % \TextField[value={\{}~}]{}          \end{document}


title: Latexmk and fontspec

text: I'm trying to use `latexmk` with XeLaTeX. When I type:               latexmk.pl -xelatex -pvc -cd -auxdir=TeXAux myfile.tex      it all works fine. However I would like to use switches with XeLaTeX, such as `synctex=1`, and when I type:               latexmk.pl -pdflatex="xelatex --synctex=1 %O %S" -pvc -cd -auxdir=TeXAux myfile.tex      I have the following message from fontspec:               Fatal fontspec error: "cannot-use-pdftex"     The fontspecpackage requires either XeTeX or LuaTeX to function.     &c.      What did I not understand?


title: adding equations into footnote

text: I would like to ask how can we add equation into the footnote? I tried               \footnote{\begin{equation} some equation \end{equation}}      but apparently it does not work. Any suggestion is appreciated               \documentclass{article}     \begin{document}     \section{dsfsdfs}     This is to proof the proof works! This is to proof the proof works!This is to     proof the proof works!This is to proof the proof works!This is to proof the     proof works!This is to proof the proof works! This is to proof the proof     works!This is to proof the proof works! This {\bf is to proof} the proof     works\footnote{\begin{equation} some equation \end{equation}}     \end{document}


title: What's causing extra white space to the left of my standalone TikZ image?

text: I have extra whitespace to the left of a TikZ image produced in a `standalone` environment: ![Extra whitespace to the left of this image](http://i.stack.imgur.com/Q18oA.png) I don't know why this is occurring. I thought perhaps the left projector bounding box, but the right projector is a mirror of the first using `\begin{scope}[xscale=-1]`, and it doesn't produce the same whitespace to the right. I can probably crop this fairly easily, but I'd like to know why it's happening to prevent it in the future. Comments on my code are welcome; I'm new to TikZ. My working example:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{shapes}          \begin{document}          \pgfmathsetmacro{\cubex}{1}     \pgfmathsetmacro{\cubey}{1}     \pgfmathsetmacro{\cubez}{1}          \def\projector[#1:#2:#3] {         % Angle and place the projector         \begin{scope}[rotate around={#1:(#2,#3)}]             % Projector and lens             \draw [red] (#2, #3) rectangle (#2 + 1, #3 + .5);             \draw [red] (#2 + 1, #3 + .175) rectangle (#2 + 1.25, #3 + .325);             % Field-Of-View annotation             \draw ( #2 + 1.25, #3 + .325 ) -- ( #2 + 4, #3 + 2);             \draw ( #2 + 1.25, #3 + .175 ) -- ( #2 + 4, #3 - 1);         \end{scope} }          \begin{tikzpicture}     % Draw a cube.     \draw[fill=blue] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,-\cubey,0) -- ++(\cubex,0,  0) -- cycle;     \draw[fill=green] (0,0,0) -- ++(0,0,-\cubez) -- ++(0,-\cubey,0) -- ++(0,0,      \cubez) -- cycle;     \draw[fill=red] (0,0,0) -- ++(-\cubex,0,0) -- ++(0,0,-\cubez) -- ++(\cubex,0,   0) -- cycle;     % Draw a projector.     \projector[-40:-4.5:2]     % Second projector is mirrored     \begin{scope}[xscale=-1]         \projector[-40:-3.5:2]     \end{scope}          \end{tikzpicture}          \end{document}


title: Incompatibility with TikZ and Mac OS X Preview

text: I was quite suprised to find that some TikZ documents render incorrectly under Preview (on Mac OS X), despite working fine in Adobe Reader (on Mac OS X) and Evince (on Linux). This is Mac OS X version 10.8.4. The easiest way to reproduce this is with the custom pattern designs from this answer (see the custom north west lines example in the second code block). I will also reproduce the code below in case that answer is ever edited. When I view the document in Preview on Mac OS X, this is what I see. Note in the third panel that the thick black lines do not go all the way to the edge of the box. ![Preview on Mac OS X 10.8.4](http://i.stack.imgur.com/KBx5j.png) In Adobe Reader and Evince, I see the intended result: ![Adobe Reader](http://i.stack.imgur.com/rh2NC.png) My question is: is this a result of TikZ using some non-standard (or less well supported) feature of PDFs? Or is this a bug in Preview? (Note: even if this is a bug in Preview, if there is a workaround that is available on the TikZ side, that's probably much easier than trying to get Apple to fix it.) I tried this in MacTeX (aka TeX Live) 2012 and 2013, and also TeX Live 2013 in Linux. I'm not sure exactly what version of TikZ is installed with those (I have done no customization of my installations).               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{patterns}          % defining the new dimensions and parameters     \newlength{\hatchspread}     \newlength{\hatchthickness}     \newlength{\hatchshift}     \newcommand{\hatchcolor}{}     % declaring the keys in tikz     \tikzset{hatchspread/.code={\setlength{\hatchspread}{#1}},              hatchthickness/.code={\setlength{\hatchthickness}{#1}},              hatchshift/.code={\setlength{\hatchshift}{#1}},% must be >= 0              hatchcolor/.code={\renewcommand{\hatchcolor}{#1}}}     % setting the default values     \tikzset{hatchspread=3pt,              hatchthickness=0.4pt,              hatchshift=0pt,% must be >= 0              hatchcolor=black}     % declaring the pattern     \pgfdeclarepatternformonly[\hatchspread,\hatchthickness,\hatchshift,\hatchcolor]% variables        {custom north west lines}% name        {\pgfqpoint{\dimexpr-2\hatchthickness}{\dimexpr-2\hatchthickness}}% lower left corner        {\pgfqpoint{\dimexpr\hatchspread+2\hatchthickness}{\dimexpr\hatchspread+2\hatchthickness}}% upper right corner        {\pgfqpoint{\dimexpr\hatchspread}{\dimexpr\hatchspread}}% tile size        {% shape description         \pgfsetlinewidth{\hatchthickness}         \pgfpathmoveto{\pgfqpoint{0pt}{\dimexpr\hatchspread+\hatchshift}}         \pgfpathlineto{\pgfqpoint{\dimexpr\hatchspread+0.15pt+\hatchshift}{-0.15pt}}         \ifdim \hatchshift > 0pt           \pgfpathmoveto{\pgfqpoint{0pt}{\hatchshift}}           \pgfpathlineto{\pgfqpoint{\dimexpr0.15pt+\hatchshift}{-0.15pt}}         \fi         \pgfsetstrokecolor{\hatchcolor}     %    \pgfsetdash{{1pt}{1pt}}{0pt}% dashing cannot work correctly in all situation this way         \pgfusepath{stroke}        }          \begin{document}          \begin{center}     %     \begin{tikzpicture}     \draw[pattern=custom north west lines] (0,0) rectangle (3,4);     \end{tikzpicture}%     %     \begin{tikzpicture}     \draw[pattern=custom north west lines,hatchspread=6pt,hatchthickness=1pt,hatchcolor=red] (0,0) rectangle (3,4);     \end{tikzpicture}%     %     \begin{tikzpicture}     \draw[pattern=custom north west lines,hatchspread=10pt,hatchthickness=5pt] (0,0) rectangle (3,4);     \end{tikzpicture}%     %     \begin{tikzpicture}% hatchshift must be >= 0     \draw[pattern=custom north west lines,hatchspread=10pt,hatchcolor=red] (0,0) rectangle (3,4);     \draw[pattern=custom north west lines,hatchspread=10pt,hatchcolor=blue,hatchshift=2.5pt] (0,0) rectangle (3,4);     \draw[pattern=custom north west lines,hatchspread=10pt,hatchcolor=green!65!black,hatchshift=5pt] (0,0) rectangle (3,4);     \draw[pattern=custom north west lines,hatchspread=10pt,hatchcolor=violet,hatchshift=7.5pt] (0,0) rectangle (3,4);     \end{tikzpicture}%     %     \end{center}          \end{document}


title: Arrow scaling problem. How can I zoom properly a very tiny part of a drawing?

text: Thanks to this solution, I can draw tangent line to a path. I'd like to zoom a very little part of my drawing. Here it is the code:               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc,arrows,spy,decorations.markings,decorations.text}     \tikzset{tangent/.style={decoration={markings,                                          mark=at position #1 with {\coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);                                                                    \coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);                                                                    \coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);}},                                          postaction=decorate},              use tangent/.style={shift = (tangent point-#1),                                  x     = (tangent unit vector-#1),                                  y     =(tangent orthogonal unit vector-#1)},              use tangent/.default = 1     }          \usepackage{siunitx}          \begin{document}     \begin{tikzpicture}[>=angle 45,                         spy scope = {connect spies,                                      every spy on node/.style = {circle,draw},                                      every spy in node/.style = {circle,draw},                                      magnification            = 15}]          % Terrain parameters     \def\SoilWidth{7.75}     \pgfmathsetmacro{\MaxDepPos}{.3*\SoilWidth}     \pgfmathsetmacro{\ErDepth}{5/19}     \pgfmathsetmacro{\cdI}{.07*\SoilWidth}     \pgfmathsetmacro{\cdII}{.8*\MaxDepPos}     \pgfmathsetmacro{\cdIII}{.5*\SoilWidth}     \pgfmathsetmacro{\cdIV}{.2*\SoilWidth}          %%%%%%%%     % DRAW %     %%%%%%%%     \coordinate[label=O] (O) at (0,0);          %-> Terrain points      \coordinate (S1) at ($(O)+(\MaxDepPos,-\ErDepth)$);     \coordinate (S2) at ($(O)+(\SoilWidth,0)$);          %-> Terrain control points     \coordinate (SC1) at ($(O)+(\cdI,0)$);     \coordinate (SC2) at ($(S1)+(-\cdII,0)$);     \coordinate (SC3) at ($(S1)+(\cdIII,0)$);     \coordinate (SC4) at ($(S2)+(-\cdIV,0)$);     \draw[densely dashed] (O)--(S2);          %-> Erosion depth     \draw[tangent=0.1] (O) ..controls (SC1) and                        (SC2)..(S1)..controls (SC3) and                        (SC4)..(S2);          %%%% PROBLEM HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \def\LineScale{.2}                                                                  %     \draw[use tangent,                                                                  %           orange,                                                                       %           line width= \LineScale*.4pt,                                                  %           ->] (0,0)--(.1,0)                                                             %               (0,0)coordinate(SlopedPoint)                                              %               (0,-.1) -- (0,.1);                                                        %                                                                                %     \coordinate (SlopedPoint1) at (SlopedPoint|-O);                                     %                                                                                %     \draw[line width = \LineScale*.4pt,                                                 %           decoration = {markings,                                                       %                         mark=at position 0 with {\arrowreversed[scale=\LineScale]{>}};, %                         mark=at position 1 with {\arrow[scale=\LineScale]{>}};},        %           postaction = {decorate}](SlopedPoint1)--(SlopedPoint);                        %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \spy [red,           height = 4cm,           width  = 4cm] on ($(SlopedPoint1)!.57!(SlopedPoint)$) in node at (6,3);               \node[left,           scale = .1] at($(SlopedPoint1)!.5!(SlopedPoint)$){$\delta$};     \end{tikzpicture}     \end{document}][1]      The problem I encounter is the arrow scaling. How it can be seen on the picture, the result is not so good.![](http://i.stack.imgur.com/L5Seb.jpg) Can somebody explain me how to scale _only_ the line width and the arrows in a proper way? With transformation canvas I obtain a total scaling, and it is not ok because it translate the lines.


title: How draw an add-two shape?

text: I have two shapes:                   (x0,y0) (x1,y1) ..... end is join to x0,y0         ...      How get shape who is additive this two shapes?


title: convert ctable to rtf/word/odt etc

text: I need to convert ctables, like the following, into a format for a word processor (MS Word, OOWrite etc.) It should be an editable table but in worse case, an img would be also fine...               \ctable[         cap = {Beispielverteilung der Infrastrukturmerkmale},         caption = {Beispielverteilung der Infrastrukturmerkmale},     label = BspInfra,     width = 87mm,     pos   = ht,     center,     ]{lrrr}{     }{         \FL         & Merkmal 1 & Merkmal 2 & Merkmal 3 \NN         \cmidrule(l){1-4}         Haushalt 1 & 1 & 0 & 1\NN         Haushalt 2 & 0 & 0 & 1\NN         Haushalt 3 & 0 & 1 & 1\NN         Haushalt 4 & 1 & 1 & 0\NN     \NN     \multicolumn{4}{l}{Normalisierte Matrix $ R^{-\frac{1}{2}} \Sigma C^{-\frac{1}{2}} $}\NN         Haushalt 1 & 0,500 & 0,000 & 0,408\NN         Haushalt 2 & 0,000 & 0,000 & 0,577\NN         Haushalt 3 & 0,000 & 0,500 & 0,408\NN         Haushalt 4 & 0,500 & 0,500 & 0,000\NN     \LL     }      I tried to convert that with LyX to an OpenDocument format, but I get a corrupt file. I also tried the to convert it to an html document, which also doesn't work... :-\ Does anyone have a suggestion?


title: Miktex runtime error!

text: When I compile `latex` for `pdflatex` for some times, the following error appears: > Runtime Error! R6016 - not enough space for thread data. I use tex editor `texmaker`. After this error, the `pdflatex` works very, very slowly (approximetly 1 minute). Is there ways, how can I solve this problem?


title: Strange message on console

text: What does the warning message               Overfull \hbox (1.08093pt too wide) in paragraph at lines 29--30      []\EU1/TimesNewRoman(1)/m/it/10 Sia $\OML/ztmcm/m/it/10 A$      \EU1/TimesNewRoman(1)/m/it/10 irriducibile.      mean? In fact, is it a warning?


title: How to choose singular or plural form from presence of \and in argument

text: I need a new command `\director` (similar to `author`) to write project's director names. But I would like to write the word Director or Directors (if more than one) in front of the names. The easiest way is to use two commands `\director` and `\directors` but is it possible to use one command who detects the word `\and` into the argument and selects plural form. An example: `\director{John}` produces Director: John `\director{John and Paul}` produces Directors: John, Paul


title: How to fill a specified area using TikZ

text: I want to fill some regions which are only parts of a shape in a TikZ drawing (marked as "Here" in the following drawings):               \documentclass{standalone}     \usepackage[tikz]{bclogo}     \usetikzlibrary{arrows,shapes,backgrounds,calc,arrows}     \begin{document}         \begin{tikzpicture}[axis/.style={very thick, ->, >=stealth'}]         % axis             \draw[axis] (9,2.5)  -- (13.5,2.5) node(xline)[right]                 {$x_N$};             \draw[axis] (11.25,0.5) -- (11.25,4.5) node(yline)[above] {$\hat{x}_N$};              \draw[->, ultra thick](7,2.5) -- (8.5,2.5);             \draw [very thick] plot [smooth cycle] coordinates {(2,4) (5,3) (2,0.5) (1,1.75) (1,4) };         %\draw[very thick] (0.5,3) to [ curve through ={(5.5,2) . . ( 3,0.25) . . (1,0.25) }]( 0.5,3 ) ;              \draw[dashed, very thick] (11.25,2.5) ellipse (1cm and 1.5cm);         \draw[dashed, very thick] (5,3) ellipse (1.5cm and 1cm);         \draw[step=0.25cm,gray,very thin] (0,0) grid (15,5);         \node (a) at (4,3) {Here};         \node (b) at (11.7,3) {Here};         \node (a) at (11.7,2) {Here};              \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/jlb8V.png) How can I achieve that?


title: Taking a detour or choosing a sequence of slides "on the fly"

text: I have a beamer presentation to describe a very rough overview of my project, but I abstract out the details. However, I would like to show details on slides in case someone asks me questions. Since I want to decide if I want to show details, on the fly, I want to be able to "press a key" and "take a detour" or activate a sequence of slides. If I don't press this key then I would like to skip the set of slides (describing the details). Can anyone give me a hint of how I can do this in beamer. Of course I don't know how this works with a presentation remote, but I guess that is really software dependent and its off context for this forum.


title: Can I define more than one label inside an equation environment?

text: I would like to give one equation two separate labels; can I do this? The purpose of this is to have a long section in which I give a long list of equations, explaining them as I go along. I then de-dimentionalise them for which I will need to say something like 'de-dimentionalising equations (1) to (20) yields...'. Thus I need to be able to refer to label equation (1) twice, once as the first equation in the list and secondly as the equation I want to discuss. Of course I could give it only one label, but it would be convenient to give it two labels such that if I reorder/add in equations I can move the 'first equation' label, and then everything will still make sense. As a concise example, what I want to do is               \begin{equation}     \label{first_equation} \label{special_equation}     a=b     \end{equation}      Edit: The above code does compile, but the inclusion of the `amsmath` package prevents it from doing so. Is there any way to use the features in this package and have the ability to multi-label?


title: Why does MiKTeX have old version of The Comprehensive LaTeX Symbol List?

text: On CTAN, the package named "Comprehensive" contains a version of The Comprehensive LaTeX Symbol List dated **09 November 2009**. But the corresponding package on MiKTeX contains a version of the file from **3 January 2008**. Why doesn't MiKTeX reflect the latest version on CTAN? Can this be fixed?


How can I draw oval circle around a string? For example, when I have "1,3,4,6", how can I put them in a circle? ![enter image description here](http://i.stack.imgur.com/HNmfC.png)


title: babel, beamer problem: refuse name change to part

text: I wanted to change the name in my beamer slide from Part to Theme. So in the Google BOK if found:               \renewcommand*{\partname}{Theme}      I could not get to work. Then I start to switch off (%) everything that I added and found that:               \usepackage[english]{babel}      is the holder of the key. An MWE:               \documentclass[compress,infolines,smaller]{beamer}          %\usepackage[english]{babel}     \useinnertheme[shadow=true]{rounded}     \usecolortheme{beaver}          \renewcommand*{\partname}{Theme}               \begin{document}          \AtBeginLecture{     \begin{frame}     \titlepage     \end{frame}     }          \part{Title}     \begin{frame}<beamer>     \partpage     \end{frame}     \section{test1}     \begin{frame}     Test     \end{frame}          \end{document}      Is there a way to get passed this?


title: Join figure and table on the same page

text: I have a figure and and a table and I want to make sure they both appear on the same page. I want both objects to keep their natural numbering and captioning: The Figure should be captioned `Figure 1.2.3: Text` and the Table should be captioned `Table 1.2.3: Text 2`. Currently, I specified `[pt]` as placement for both, but this (of course) does not what I need. I know the following two solutions:   1. Use `\subfloat`   2. Use a single `figure` and put both, the table and the figure in this figure and using `\caption` twice. Both solution do not lead to the captioning I need: The first solution generates a single figure and the second one creates two figures. I need a Figure and a Table for the captions.


title: Different package manager: Why?

text: I was wondering why do we need different package managers in TeXLive and MiKTex? Would it not be better and less work for both authors if there was a common approach and even other persons taking care of the package management? (My tags maybe are not correct.)


title: \hhline adds white line where no line is intended

text: In a table, containing colored cells, i want to have a `\hline` dividing only some cells, similar to `\cline` but compatible with coloring single cells with `\cellcolor`, which is possible by using `\hhline` with fitting parameters. Now I have come to the appended code, which results in: ![tables_hhline](http://i.stack.imgur.com/baJjf.png) There are two points I want to work around. First, the black cells should not be crossed by a white line. Since they will not be black in the final document, I need them to be not black, either. Is there a way to not draw any line at all? These cells should look like a multirow cell, colored consistently. The second problem are the hline fragments at the right end of the table. How can I get rid of them? Complete code:               \documentclass[11pt]{article}          \usepackage{color}     \usepackage{colortbl}     \usepackage{multirow}     \usepackage{hhline}          \setlength{\arrayrulewidth}{1pt}               \begin{document}     % Empty table     \begin{tabular}{*{5}{!{\vrule width 1.5pt}p{1.5cm}}!{\vrule width 1.5pt}l}     \centering 4 &     \centering 10 &     \centering 24 &     \centering 48 &     \centering 72 &\\ \hhline{*{5}{|-}|~|}      &  &  &  &  & Optic tectum \\ \hhline{*{2}{|~}*{3}{|-}|~|}      &  &  &  &  & Retina \\ \hhline{*{2}{|~}*{3}{|-}|~|}      &  &  &  &  & Myomeres \\ \hhline{*{5}{|-}|~|}      &  &  &  &  & Arches \\ \hhline{*{5}{|-}|~|}     \end{tabular} \\          \hspace*{1cm}          % Partically filled table     \begin{tabular}{*{5}{!{\vrule width 1.5pt}p{1.5cm}}!{\vrule width 1.5pt}l}     \centering 4 &     \centering 10 &     \centering 24 &     \centering 48 &     \centering 72 &\\ \hhline{*{5}{|-}|~|}      & \cellcolor{black} &  & \cellcolor{green} &  & Optic tectum \\ \hhline{*{2}{|~}*{3}{|-}|~|}      & \cellcolor{black} &  & \cellcolor{red} &  & Retina \\ \hhline{*{2}{|~}*{3}{|-}|~|}      & \cellcolor{black} &  & \cellcolor{blue} &  & Myomeres \\ \hhline{*{5}{|-}|~|}      & \cellcolor{blue} &  & \cellcolor{yellow} &  & Arches \\ \hhline{*{5}{|-}|~|}     \end{tabular}          \end{document}


title: Where to save a Latex Template

text: I am interested in saving a Latex template (that I wrote) so that I can use it via the "create new from template" file option. Can anyone tell me where I need to save this template in order to do this? I am using a Mac OSX with Lion installed.


title: Vertical line in longtable

text: I would like my vertical line to be slightly detached from the horizontal lines. I am using               \usepackage{longtable}.          \footnotesize          \begin{longtable}{r | p{10cm}}          \caption{My caption 1\label{1}}\\          \hline          \endfirsthead          \caption[]{(continued)}\\          \endhead          \hline          \endlastfoot          \textsc{Newspaper Name}&\emph{Daily Triplicate}\\          \textsc{Availability}&text\\          \textsc{founded}&date\\          \textsc{Circulation}&number\\          \textsc{Coverage}&text\\          \textsc{Frequency}&text\\          \hline          \textsc{Newspaper Name}&\emph{Eureka Times-Standard}\\          \textsc{Availability}&text\\          \textsc{founded}&1997date\\          \textsc{Circulation}&number\\          \textsc{Coverage}&text\\          \textsc{Frequency}&text\\          \end{longtable}


title: How do you use texdoc to search for example pdfs?

text: I usually use `texdoc <package>` to quickly access doc files. However, sometimes the doc file is not useful and you want to look to example pdf files. As an example, try `texdoc moderncv`. Is there a way to quickly access example docs (something like `texdoc moderncv example`)like you do for standard docs?


title: change Linespread in longtable and table

text: In my document i am using a `\linespread{1.5}` for the whole document, but I would like to have a `\linespread{1}` for tables and long tables. How can I change it?


title: How to get headings indented as the first lines of paragraphs?

text: I would like the chapter and (sub)section headings to be indented as much as the first lines of paragraphs (`\parindent` value). By default using koma-script I get them aligned with left boundary of the page: ![enter image description here](http://i.stack.imgur.com/avQJi.png) The desired effect is the following: ![enter image description here](http://i.stack.imgur.com/JVQx3.png) The MWE I use is the following:               \documentclass{scrreprt}          \usepackage[english]{babel}     \usepackage{indentfirst}     \usepackage{lipsum}          \setlength{\parindent}{1cm}           \begin{document}          \addchap{Chapter without number}     \addsec{Section without number}     \lipsum[1-4]          \chapter{Chapter with number}     \section{Section with number}     \lipsum[1-4]          \end{document}


title: RequirePackage and usepackage behave differently

text: I design exams which should contain code samples using pdflatex. In lecture scripts I successfully use the listings package. The general design is done via the exam document class. I created my own class file expanding the exam class file and channeling down the options to the exam class.               \DeclareOption*{\PassOptionsToClass{\CurrentOption}{exam}}     \DeclareOption{answers}%         {%             ...             \PassOptionsToClass{\CurrentOption}{exam}%pass option to exam         }     \ProcessOptions     \LoadClass[a4paper,12pt,oneside,openany,\droptnm]{exam}      This class defines a special predefined format for the listings and deals with problems. Therefore, my 'private' exam class would like to use               \RequirePackage{listings}     \RequirePackage{probsoln}      This, unfortunately, causes error messages beginning with:               ! LaTeX Error: Command \abovecaptionskip already defined.     ...     ! LaTeX Error: Command \belowcaptionskip already defined.     ...     ! LaTeX Error: Command \solution already defined.     ...      The following code in the main exam document works:               \usepackage{listings}     \usepackage{probsoln}      When I look up information sources I gather the information that `RequirePackage` and `usepackage` are identical with the difference that `RequirePackage` is allowed before `documentclass` but `usepackage` is not. Anybody around to enlighten me why `RequirePackage` does not work in the class file here?


title: A letter under word

text: How can I write a letter under a word. Eg: Assume that I have to write `$\textbf{P}$` centered under the word "maximize". When I tried with "_", the output is               \begin{equation}     maximize_{\textbf{P}}     \end{equation}


title: twocolumn span across multiple pages

text: I want to prevent twocolumn from using magazine-style section breaks across multicolumn pages. I'm currently invoking twocolumn like so:               \documentclass[twocolumn]{article}      But this is creating the following layout in the document:               Page 1: A B     Page 1: A C     Page 2: C D     Page 2: D E      The letters illustrate a single section. I would much rather prefer:               Page 1: A B     Page 1: A C     Page 2: D C     Page 2: D E      So ideally, it should go something like this: `'If this is a section to be continued on the next page, continue it in the same column on the next page, otherwise put it in the left column'.`


title: Use case for pdfTeX's \quitvmode

text: While reading one of Lev's answers, I encountered a pdfTeX primitive `\quitvmode` that I have never noticed before. The pdfTeX manual states that this causes TeX to leave (internal) vertical mode and enter horizontal mode--the mode in which TeX is building paragraphs. This is the purpose of the plain TeX and LaTeX macro `\leavevmode`. The manual states that this does so without any bad interaction with `\everypar`. The only examples I can think of where this would be useful are horribly contrived. For example,               \everypar{\foo}     \def\foo#1{{\tt\string#1}}     \leavevmode foo          \quitvmode bar     \bye      produces ![](http://i.stack.imgur.com/8AgG6.png) which is more or less what I'd expect, but this use of `\everypar` is really silly. **What is an actual use where using`\quitvmode` instead of `\leavevmode` matters?**


title: Using \underbrace interferes with frame around Listings

text: I am having some issue when it comes to use a _frame_ around my `listings`. The usage of `underbrace` breaks the frame. Can anybody help out and let me know how to fix this?                \documentclass[a4paper]{scrbook}      \usepackage{amsmath}      \usepackage{listings}                        \lstset{                  escapechar = \% ,                       frame = single                }            \begin{document}       \noindent\begin{minipage}{\textwidth}       \begin{lstlisting}             %$\underbrace{Lorem ipsum}_{ipsum lorem}$%        \end{lstlisting}       \end{minipage}        \end{document}      Result: ![http://i.stack.imgur.com/7Hqey.png](http://i.stack.imgur.com/7Hqey.png) **Edit:**   Problem is not really solved as I rely on `minipage` in order to prevent my `Listings` from being split over two pages.   Actually, the frame around the Listings always "dashes" when escaping.   Does anyone know of a solution how I can keep a frame around a Listing that looks like a usual Listing? Especially, I need a caption to be displayed above the frame (and not inside). Here's a snippet to see what I mean:               \documentclass[a4paper]{scrbook}     \usepackage{mdframed}     \usepackage{listings}     \usepackage{amsmath}     \lstset{mathescape=true, frame = single,  escapechar        = \% }          \begin{document}          \noindent\begin{minipage}{\textwidth}     \lstset{caption = {Caption1},label = {label1}}     \begin{lstlisting}     Blabla %bla\_4%     %$\underbrace{BlaBla}_{Blubb}$%     \end{lstlisting}     \end{minipage}           \lstset{caption = {Caption2},label = {label2}, frame= none}     \begin{mdframed}     \begin{lstlisting}     $\underbrace{Lorem ipsum}_{ipsum lorem}$     \end{lstlisting}     \end{mdframed}          \end{document}      ![enter image description here](http://i.stack.imgur.com/7HQ4L.png) **Edit 2:**   For now, I've switched from _frame = single_ to _frame = lines_ which circumvents the issue but I don't like the look of it.


title: A small inline graphic

text: Let's say I have the following text (a part of a paragraph):               hello world      I want to be able to typeset a small star/smiley/whatever graphic in between these two words. This graphic should of course be treated like a regular word, in the sense that we get proper spacing around it, just like for regular words. The graphic should preferably be written right there in some MetaPost/PSTricks-like code, but I can also accept that I have to include it through an external PDF file. How can I do this? Edit: Come to think about it, I guess what I may be asking for is a way to create a new character, without actually having to mess with font-related stuff.


title: Create Diagram - 4 blank horizontal lines in a row - Labels underneath w/lines or arrows pointing

text: So I want to draw a diagram explaining names of digit places ('hundreds' 'tens' 'ones'). I want blank lines with these labels underneath. I'm thinking qtree might be an idea (4 top branches being the blank lines with 1 branch coming off each for the labels). I am curious is anyone knows an easier way. Thanks a lot!


title: How to plot a data from excel file with multiple sheets

text: I am really new in latex. I have a data from excel file, which contains different sheet. I need to plot these data on latex, any one have an idea?? I need it urgently please.


title: Use autoref with minted and its listing environment

text: I would like to use `autoref` from the `hyperref` package to create a reference to a floating listing as provided by minted. This code               \documentclass[a4paper]{book}     \usepackage{minted}     \usepackage{hyperref}          \begin{document}     \chapter{My chapter}     Take a look at the code in \autoref{lst:mylisting}.     \begin{listing}[htb]       \begin{minted}{erlang}         foo         bar       \end{minted}       \caption{My listing}       \label{lst:mylisting}     \end{listing}     \end{document}      should produce something like `Listing 1.1` with a link around it. I don't want to use `Listing~\ref{lst:mylisting}`, because it wouldn't be consistent with all the other links produced by `autoref`. Any ideas?


title: TeXlipse hotkeys for bold, italic, underlined

text: Are there any hotkeys to make a text bold or italic in TeXlipse plug-in? It is tiresome to type `\textbf{}` and `\textit{}` each time I need to emphasize some word. Most of other TeX-editors support standard `Ctrl`+`B`" and `Ctrl`+`I`, but in TeXlipse it doesn't work.


title: pgfplots: x-axes do not align due to different labels

text: This is my first post, so I hope I do everything right :)   I have the following problem:   Using pgfplots I create two graphs next to each other which have identical y-axes, but different x-axes. I want the x-axes to be aligned, and the y-axes to be of the same height, but due to the different labels on the x-axes, the second graph is shifted down. Is there a way to align the axes? Here is my code:               \documentclass[crop,10pt]{standalone}     \usepackage[english]{babel}     \usepackage{pgfplots}     \begin{document}%         \fbox{         \begin{tikzpicture}         \begin{axis}[         width=0.6\linewidth,         height=5cm,         xmin=0,xmax=1,ymin=0,ymax=1,         ytick pos = left,         xtick pos = left,         enlargelimits=false,         tick align = outside,         xlabel={$|k|_{\parallel}$}         ]         \end{axis}         \end{tikzpicture}}%         \fbox{         \begin{tikzpicture}         \begin{axis}[         width=0.30\linewidth,         height=5cm,         xmin=0,xmax=0.5,ymin=0,ymax=1,         ytick pos = left,         xtick pos = left,         enlargelimits=false,         tick align = outside,         xlabel={Intensity}         ]         \end{axis}         \end{tikzpicture}%     }%     \end{document}      The `\fbox{}` enironment was just set to see the boundaries. The right graph is in fact smaller than the left one due to the different label, though the y-axes do have the same length. When I use identical labels, everything is nicely aligned.   Any suggestions are appreciated.   Thanks in advance,   John


title: Stripey balls in tikz

text: I would like to insert a stripey ball in TikZ, i.e. a filled-in circle that looks like this one. Would you know a clever solution for doing that? ![stripy ball](http://i.stack.imgur.com/guz2T.png)


title: How exactly does \def\p@figure{Figure~} work?

text: I took this line from my thesis style and added it into my document (preceded by `\makeatletter`) and what it does that whenever I used `\ref{figureid}` instead of putting just the figure number, it puts "Figure 1". I can do the same thing for tables, by having `\def\p@table{Table~)` but what I don't know is what exactly is:               \p@figure     \p@table      I assume they're used internally by ref, but is there anything more (such as `\p@(object)` is always used as the beginning of something ...)


title: Error in \setmainfont

text: I'm trying to follow the example on the Wikipedia page about XeTeX. But when I run the TeX code, I get this error:               (/usr/share/texmf/tex/latex/etex-pkg/etex.sty)     (/usr/share/texmf/tex/latex/base/fixltx2e.sty))kpathsea: Invalid fontname `Linux Libertine O', contains ' '          ! Font \zf@basefont="Linux Libertine O" at 10.0pt not loadable: Metric (TFM) file or installed font not found.     \zf@fontspec ...ntname \zf@suffix " at \f@size pt                                                    \unless \ifzf@icu \zf@set@...     l.3 ...infont[Mapping=tex-text]{Linux Libertine O}      Any idea why that is? I have both the TTF files for Libertine installed and I also have the XeTeX libertine package. [EDIT] I'm on openSUSE 11.3 and I've installed XeTeX from the TeX Live 2010 CD.


title: Sections \label and \nameref

text: \documentclass[fleqn,12pt,a4paper]{article}     \usepackage{fontspec,xltxtra,xunicode}     \usepackage{fancyhdr}     \pagestyle{fancy}     \usepackage{color}     \usepackage{setspace}     \usepackage{hyperref}     \usepackage{cmll}     \usepackage{tabularx}     \usepackage{pifont}     \usepackage{amstext, amsmath}     \usepackage{enumerate}           %========================================================     \begin{document}     \section{This is Header1 6.1.77} \label{6.1.77}     \subsection*{This is sub header}     .     .     .     .     .a document of 100 pages     .     .a document of various tables and other sections      .     .     .recalled lables at various places through out the document,     \nameref{} entire section header appeared nicely.           \end{document}       %========================================================      Above code worked like a charm, I can use `\nameref{}` anywhere in the document and it created a hyperlink. I went crazy and created as many as 3900 subsections and now the PDF prints only two pages and I get stack over flow error. Hyperlinks appear as `??`. I tried using `enumerate` and it does not hyperlink to specific line as it does in case of `\section{}`, also tried putting lines with labels and still it did not work.


title: Different marker shape for pgf/TikZ

text: I have a figure in my paper which compared 6 different cases. The figure needs to be in black and white. In below is the code I used to create the figure.               \documentclass{standalone}          \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}                  \begin{axis}[%                     width=10cm,                     height=4cm,                     scale only axis,                     xmin=1, xmax=3,                     xtick={1,2,3},                     xticklabels={Step1,Step2,Step3},                     xmajorgrids,                     ymin=0.4, ymax=1.2,                     ylabel={$\xi$},                     ymajorgrids,                     title={Stroke Ratio Comparison},                     axis lines*=left,                     line width=1.0pt,                     mark size=2.0pt,                     legend style={at={(1.03,1)},anchor=north west,draw=black,fill=white,align=left}]                               \addplot [                     color=black,                     solid,                     mark=*,                     mark options={solid},                     smooth                     ]                     coordinates{                      (1,0.941517254116162)(2,0.833049791172753)(3,0.911012408209885)                      };                     \addlegendentry{$L/D$=2.5};                               \addplot [                     color=black,                     dotted,                     mark=*,                     mark options={solid},                     smooth                     ]                     coordinates{                      (1,0.848646925806495)(2,0.889383162622147)(3,0.901265846062356)                      };                     \addlegendentry{$L/D$=3.5};                               \addplot [                     color=black,                     dash pattern=on 1pt off 3pt on 3pt off 3pt,                     mark=*,                     mark options={solid},                     smooth                     ]                     coordinates{                      (1,0.773775422607358)(2,0.836291579743709)(3,0.91821563038864)                      };                     \addlegendentry{$L/D$=4.0};                               \addplot [                     color=black,                     dashed,                     mark=*,                     mark options={solid},                     smooth                     ]                     coordinates{                      (1,0.846412925696005)(2,0.909313371999676)(3,0.916886900310392)                      };                     \addlegendentry{$L/D$=4.5};                               \addplot [                     color=black,                     dash pattern=on 3pt off 6pt on 6pt off 6pt,                     mark=*,                     mark options={solid},                     smooth                     ]                     coordinates{                      (1,0.884302757051131)(2,0.941642806394511)(3,0.995341242858434)                      };                     \addlegendentry{$L/D$=5.0};                               \addplot [                     color=black,                     dotted,                     mark=*,                     mark options={solid},                     smooth                     ]                     coordinates{                      (1,0.789821315674376)(2,0.981738703732297)(3,1.04121306622012)                      };                     \addlegendentry{$L/D$=6.0};                  \end{axis}     \end{tikzpicture}%          \end{document}      Here is the result of the compilation. ![enter image description here](http://i.stack.imgur.com/0pZLJ.png) I would like to have different marker shape such that the figure is easy to understand. Also, as can be seen, the legend does not clearly illustrate the differences between line types. How can I make this more clear to the reader? I would be grateful if I could use other's experiences on creating a professional figure?