title: LaTeX example environment

text: I was inspired by the following LaTeX document: http://www.people.fas.harvard.edu/~djmorin/chap11.pdf (written by Prof. David Morin from Harvard university) I would like to produce a similar example environment, as seen in page 11 for a single example (a thick grey line before and after the example text, and also the "Example (...)" and "Solution" titles in each example.) Also, as in page 15 a thin grey line is separating two consecutive examples. Any idea how to create an environment with these macros? I might change it a bit but I would like to be able to produce it. EDIT: Is it possible to include the \begin{block} in the example and the \end{block} in the solution, so that I don't need to explicitly write it, but only               \begin{example}[Rear clock ahead]     \lipsum[1]     \end{example}          \begin{solution}     \lipsum[2]     \end{solution}          \begin{example}[Example 2]     \lipsum[1]     \end{example}          \begin{solution}     \lipsum[2]     \end{solution}      And finally, I would rather have a blank line between the "example" and "solution", and also have \blockline have an equal vertical distance from its top and bottom texts. I am just not sure where to put these commands in your definitions. Thanks. ![Framed](http://i.stack.imgur.com/DYCdg.png)


How can I ensure that a listing is not going to be split? If it is going to be split I want that the entire listing to move to the following page, effectively moving everything at pass. I mean any text that comes after the listing must remain after the listing.


title: Place figures side by side, spill into outer margin

text: I would like to place two figures side by side ( _not_ subfigures) and what’s more, I’d like to let the figures spill into the outer margin (since they are too wide for the the text width. Like this: ![screenshot](http://i.stack.imgur.com/CxEl7.png) (Black lines delimit the page borders. Full page [pdf]) The following actually works very nicely:               \begin{figure}[h]       \setcapwidth{0.6\textwidth}       \begin{flushright}         \hspace{-\marginfigwidth}%         \begin{minipage}[t]{0.6\textwidth}           \centering           \includegraphics{gfx-1}           \caption{Caption 1}         \end{minipage}%         \hspace{1cm}%         \begin{minipage}[t]{0.6\textwidth}           \centering           \includegraphics{gfx-2}           \caption{Caption 2}           \label{fig:free-lunch}         \end{minipage}       \end{flushright}     \end{figure}      Unfortunately, there’s a snag: this only works on the _left hand page_ , since I force it into the margin via `\hspace{-\marginfigwidth}` command (where `\marginfigwidth` is defined as `\marginparwidth + \marginparsep`). I can’t wrap my head around how this must be changed to work on all pages. If I just remove the negative `hspace` on a right-hand page, the page will automatically break. I can of course wrap the whole thing into yet another `minipage` but this doesn’t work since it won’t respect the specified `\hspace` between the figures and spill over the page border. The `wrapfigure` environment doesn’t help me either since that is designed to work with _single_ pictures only. **How can I make this code work independent of the page (left/right) so that it always spills into the _outer_ margin?**


title: Install pbox with MikTex 2.9

text: I'm trying to install the pbox package on my MiKTeX 2.9 installation, and failing miserably. The miktex package manager fails with the message "Remote file not found". I got the package from http://www.ctan.org/tex- archive/macros/latex/contrib/pbox and tried to make it, but it attempts to run `/usr/bin/install` which isn't on my Windows machine. What should I do? Is anyone else able to install pbox?


title: Very thin white line in colortbl

text: Whenever I use the `colortbl` package to format tables, a thin white space between the cells sometimes shows up on screen (not in print for as far as I can tell). For example in this table: ![](http://i.imgur.com/gVFTP.png) Is there an easy way to enlarge each rectangle by a tiny amount so that the white space is not visible anymore? (My guess is that the white space appears due to rounding in my pdf viewer, `evince`. I don't know if other pdf viewers have the same issue. Regardless, I would like to have my pdf file look good in common pdf readers)


title: Label functions generated with gnuplot in pgfplots

text: I would like to generate four hyperbolas in the plane and label them. I'm using the following code (sorry for its length, feel free to shorten it...):               \documentclass{standalone}     \usepackage{pgfplots}     \pgfplotsset{width=7cm,compat=1.9}     \begin{document}          \begin{tikzpicture}       \begin{axis}[         every inner x axis line/.append style={help lines},         every inner y axis line/.append style={help lines},         every axis label/.append style={gray},         axis lines = center,         xtick = \empty,ytick=\empty,         xlabel={\tiny$x$},ylabel={\tiny$y$},         enlargelimits=auto         ]         \addplot+[mark=none,red!80!black] function[raw gnuplot] {           set xrange [-5:5];           set yrange [-5:5];           set contour base;           set cntrparam levels discrete 0.0;           unset surface;           set view map;           set isosamples 70;           splot x*x/0.5-y*y/1.25-1;         } node[pos=0.4999,sloped,below]{\tiny$\frac{x^2}{a^2} - \frac{y^2}{b^2} = 1$};              \addplot+[mark=none,red!90] function[raw gnuplot] {           set xrange [-5:5];           set yrange [-5:5];           set contour base;           set cntrparam levels discrete 0.0;           unset surface;           set view map;           set isosamples 70;           splot x*x/0.5-y*y/1.25+1;         } node[pos=0.95,sloped,below]{\tiny$\frac{x^2}{a^2} - \frac{y^2}{b^2} = -1$};              \addplot+[mark=none,blue!80!black] function[raw gnuplot] {           set xrange [-5:5];           set yrange [-5:5];           set contour base;           set cntrparam levels discrete 0.0;           unset surface;           set view map;           set isosamples 70;           splot x*x/1.25-y*y/0.5-1;         } node[pos=0.9999,sloped,below]{\tiny$\frac{x^2}{b^2} - \frac{y^2}{a^2} = 1$};              \addplot+[mark=none,blue!80] function[raw gnuplot] {           set xrange [-5:5];           set yrange [-5:5];           set contour base;           set cntrparam levels discrete 0.0;           unset surface;           set view map;           set isosamples 70;           splot x*x/1.25-y*y/0.5+1;         } node[pos=0.6,sloped,below]{\tiny$\frac{x^2}{b^2} - \frac{y^2}{a^2} = -1$};            \end{axis}     \end{tikzpicture}     \end{document}      My problem is the placement of the labels. I'm trying to tweak the `pos=` key, but I never manage to find the right position. I guess that because of its branching behavior it is jumping around unexpectedly. I can only find a satisfying positioning for 3 out of the four. What is the right way to label the hyperbolas? I considered using absolute positioning, but I hope there's a nicer way out. ![enter image description here](http://i.stack.imgur.com/edmsB.png)


title: Create legend tikzpicture without pgfplots

text: I already tried to create a legend with pgfplots but it seems that conflicts with tikz-uml library (another tikzpicture that I have in the same file) so I want to know how can I create a legend with this example (taken from http://www.woggie.net/2012/07/16/drawing-feature-models-in-pgf-tikz/):               \documentclass[tikz]{standalone}     \usetikzlibrary{matrix,arrows,positioning,shadows}     \tikzset{         feature/.style={draw, inner sep=1.5mm, font=\small\sffamily, fill=white, drop shadow},         opt/.style={fill=white}}          \begin{document}          \begin{tikzpicture}[node distance=.8cm]       \node[feature] (phone) {Phone};            \matrix (sub)[matrix of nodes,                     below=of phone,                     column sep=3mm, row sep=0mm, nodes=feature]{       Processor & %sub-1-1       NFC & %sub-1-2       Camera & %sub-1-3       4G \\ %sub-1-4       };            \matrix (group)[matrix of nodes,                        below=of sub-1-1,                       column sep=3mm, row sep=0mm, nodes=feature]{       ARM & %group-1-1       OMAP & %group-1-2       Snapdragon \\ %group-1-3       };            \draw (phone.south) -- (sub-1-1.north);       \draw (phone.south) -- (sub-1-2.north);       \draw (phone.south) -- (sub-1-3.north);       \draw (phone.south) -- (sub-1-4.north);            \draw (sub-1-1.south) -- (group-1-1);       \draw (sub-1-1.south) -- (group-1-2);       \draw (sub-1-1.south) -- (group-1-3);            %cross-tree constraint       \draw[-triangle 45,dashed] (sub-1-4) |- (group-1-3)         node[pos=.6,anchor=south east] {implies};            %optional / mandatory       \draw[opt] (sub-1-2.north) circle (.8mm);        \draw[opt] (sub-1-4.north) circle (.8mm);        \fill[draw] (sub-1-1.north) circle (.8mm);        \fill[draw] (sub-1-3.north) circle (.8mm);             %Group arc       \begin{scope}         \path[clip] (sub-1-1.south) -- (group-1-1.center) -- (group-1-3.center) -- cycle;         \draw (sub-1-1.south) circle (.5cm);       \end{scope}     \end{tikzpicture}          \end{document}      The idea is to create a legend at the top right like this example (taken from wikipedia) ![enter image description here](http://i.stack.imgur.com/wL09g.jpg) Can anyone help me? Thank you!


title: Redefine 'includegraphics' to add space

text: I am trying to redefine the command `includegraphics` to add vertical space below and after my image (I am not using the figure environment since I need to place my images quite carefully.) I was trying something like below but that doesnt work. Any suggestions?                 \renewcommand{\includegraphics}{\vspace*{3pt}\includegraphics\vspace*{3pt}}


title: Fancy colored array in LaTeX?

text: I would like to reproduce these kinds of arrays in Latex (probably with `tcolorbox`) but I have no idea how to achieve this. So is there a way to make these kinds of tables ? ![enter image description here](http://i.stack.imgur.com/mAJLP.png) Note : I would like the switching between colors from one line to another to be automatic.


title: Better arrowheads in commutative diagrams

text: The Fourier package gives a different look for the arrowheads, which looks nice to me. I also want to use this arrowhead in the commutative diagrams. I have tried Taylor's diagrams package, xy-matrix, but the arrowheads they produce is not the type I want. The best one is the Stealth style arrowhead from tikz. Since I only need simple diagrams, I really don't want to be tortured by tikz complicated syntax. Is it possible to transplant this Stealth style to diagrams or xy-matrix?


title: Wrong Sorting nomenclature and predefined variables

text: This time I'm writing my Bachelor Thesis on Uni Stuttgart. Now I got a problem. I predefined my Variables for being able to change them easily in the whole document. For example I did it like this:               \newcommand{\x}{L_i}      If I now create a list of variables by `\makenomenclature` the variables are sorted by the command. Here `\x`. Is it possible to sort it by the given Variables? Here `L_i`? It would be very nice to have a most possible easy solution for this. Thank you and sorry for my bad english. Regards Manuel


title: Nested styles in TikZ

text: I have:               \pgfkeys{/TransformerNetwork/.style={             transformer/.style 2 args={draw, cylinder, gray!80, rotate=90, minimum height=#1, minimum width=#2},             }}      And then:               \begin{tikzpicture}[/TransformerNetwork]         \node [transformer={2.3cm}{1cm}] () at (0,0.6) {};      but tikz complains:               Illegal parameter number in definition of \pgfkeys@temp.      How do I let it know that the 2 arguments are for the nested style?


title: Siunitx - significant stars (***) far away

text: I'm testing Stata → LaTeX integration, and reading some guides, I was satisfied with the results. Unfortunately, it seems that one can only use the `dcolumn` package in Stata. Knowing that the `siunitx` package is the one that many people prefer around here, I changed that part of the code manually. However, for some reason the stars ( `***` ) on 3673.1 are far away, and the `(` of the corresponding standard error estimate is not properly aligned. I am not sure what is wrong? Don't worry about the double estimates, I by mistake did not clear the `eststo` function. Here is a picture: ![enter image description here](http://i.stack.imgur.com/4lnLx.png) The code doesn't look particularly clean to me (it is produced using the `esttab` command in Stata), but it does its job. MWE               \documentclass{article}     \usepackage{booktabs}     \usepackage{siunitx}     \sisetup{input-symbols = ()}     \begin{document}     \begin{table}[htbp]\centering     \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}     \caption{This is a regression table\label{tab1}}     \begin{tabular}{l*{4}{S}}     \toprule                     &\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\                     &\multicolumn{1}{c}{Price}&\multicolumn{1}{c}{Price}&\multicolumn{1}{c}{Price}&\multicolumn{1}{c}{Price}\\     \midrule     Weight (lbs.)       &       1.747\sym{**} &       3.465\sym{***}&       1.747\sym{**} &        3.465\sym{***}\\                     &     (0.641)         &     (0.631)         &     (0.641)         &       (0.631)         \\     \addlinespace     Mileage (mpg)       &      -49.51         &       21.85         &      -49.51         &       21.85         \\                     &     (86.16)         &     (74.22)         &     (86.16)         &     (74.22)         \\     \addlinespace     Car type            &                     &      3673.1\sym{***}&                     &      3673.1\sym{***}\\                     &                     &     (684.0)         &                     &     (684.0)         \\     \addlinespace     Constant            &      1946.1         &     -5853.7         &      1946.1         &     {-5853.7}         \\                     &    (3597.0)         &    (3377.0)         &    (3597.0)         &    (3377.0)         \\     \midrule     Observations        &          {74}         &          {74}         &          {74}         &          {74}         \\     Adjusted \(R^{2}\)  &       0.273         &       0.478         &       0.273         &       0.478         \\     \bottomrule     \multicolumn{5}{l}{\footnotesize Standard errors in parentheses}\\     \multicolumn{5}{l}{\footnotesize Source: UCT Institutional Planning Department}\\     \multicolumn{5}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \   (p<0.001\)}\\     \end{tabular}     \end{table}     \end{document}


title: Is it possible to download TeX Live in a separate, single file?

text: Installation through the internet is so harsh... For example, is there a torrent for TeX Live?


title: Create Custom tabular

text: Is there a way to make something like tabular such that in a loop we get each column in a line and render them in a custom format. Like this               \begin{custom_tabular}     l1c1 & l1c2 & l1c3 \\     l2c1 & l2c2 & l2c3     \end{custom_tabular}      and render the the elements in a custom format, e.g.               \textbf{l1c1}: l1c2$^{l1c3}$      for all the lines. Expected output: ![enter image description here](http://i.stack.imgur.com/UBtyH.png)


title: How to put an image as backgroud in a beamer presentation?

text: I want to get rid of the standards backgrounds of beamer. I want to put my own image as background. How can I make it?


title: Loop with tikz index problem

text: I need a loop that ends with a test, why this one doesn't work and how use an index in this kind of loop ?               \documentclass[tikz]{standalone}     \usepackage{}     \usetikzlibrary{}          \begin{document}          \begin{tikzpicture}     \count255 = 0     \loop     \draw (0,0) -- (\count225,1) ;       \advance\count255 by 1     \ifnum\count255 < 4     \repeat     \end{tikzpicture}          \end{document}


title: URLs set with lining figures regardless font settings

text: I’ve noticed during my XeLaTeX typesetting with `hyperref` package that since not so long ago, URLs (using `\url`) have been typed in lining figures (as opposed to the oldstyle figures) whatever my setting for default body font is. I think that this was done for good reason to improve the readability of the URLs. Nevertheless, can this actually be easily changed if I want to have all figures in my text back to oldstyle, including those in the URLs?


title: How to typeset the formatted counter in compactenum (paralist)?

text: I am using the `compactenum` environment from the `paralist` package, and would like to know how I can typeset the counter. What I mean is               \begin{compactenum}[a)]     \item I would like to typeset "a)" here.     \end{compactenum}      I was trying to read through the documentation but couldn't figure out which macro stores the counter. Also, in this case, I don't want to build a reference, because I am only asking for the item label inside that item, i.e., when that counter is at that particular value.


title: Messy flowchart using tikz

text: I have a beamer slide:               \documentclass{beamer}          \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \tikzstyle{decision} = [diamond, draw, fill=blue!20, text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]     \tikzstyle{block} = [rectangle, draw, fill=blue!20, text width=5em, text centered, rounded corners, minimum height=4em]     \tikzstyle{line} = [draw, -latex]          \begin{document}          \begin{frame}{Simulated Annealing (SA)}       \begin{center}         \resizebox{0.4 \linewidth}{!}{%           \begin{tikzpicture}[node distance = 2cm, auto]             \node[block]                  (init){Init $n=0$, $T_0$, and $S_0$};             \node[block, below of=init]   (nbrh){$S_{n+1}=N(S_n)$};             \node[decision, below of=nbrh](ovgt){$f(S_{n+1}) \le f(S_n)$};             \node[block, below of=ovgt]   (accp){Accept $S_{n+1}$};             \node[decision, right of=ovgt](rand){Accept with $P = e^{-\frac{\Delta f}{t_n}}$};             \node[block, right of=nbrh, anchor=west]   (rejj){Reject $S_{n+1}$};             \node[block, below of=accp]   (incr){$T_{n+1} = K(T_n)$ and $n=n+1$};             \node[block, below of=incr]   (stop){Stop};             \node[decision, left of=stop] (stcd){Stop?};                  \path[line] (init) --          (nbrh);             \path[line] (nbrh) --          (ovgt);             \path[line] (ovgt) -- node{yes}(accp);             \path[line] (ovgt) -- node{no} (rand);             \path[line] (rand) -- node{no} (rejj);             \path[line] (rejj) --          (nbrh);             \path[line] (rand) |- node{yes}(accp);             \path[line] (accp) --          (incr);             \path[line] (incr) --          (stcd);             \path[line] (stcd) -- node{yes}(stop);             \path[line] (stcd) |- node{no} (nbrh);           \end{tikzpicture}%         }%       \end{center}     \end{frame}          \end{document}      which gives: ![Capture with highlights](http://i.stack.imgur.com/bWahC.gif) There are a few things I'm not happy with in the output:   1. Simple equations like `$S_{n+1}=N(S_n)%` should be on 1 line. It's okay for the text to be smaller. Similarly, `$T_{n+1}=K(T_n)$` should be on 1 line, ' _and_ ' can be on it's own line, and `$n=n+1$` should be on it's own line. The inequality in the decision should also be on one line.   2. The vertical 'no' line connecting the "Accept" decision on the right, and the "Reject" action is not quite vertical. Also, this decision is larger than the decision immediately to the left.   3. There is very little space between these two decisions.   4. The "Accept" action under the inequality decision overlaps with the decision above. In contrast, that decision is quite far from the action above that.   5. Lastly, I'm not happy with the bottom two elements. I would have preferred to have the "Stop?" decision directly underneath, and the "Stop" action to the right. Unfortunately, I'm not sure how to put 2 bends in the "no" from "Stop?", meaning that the line actually cuts through everything above. I tried `|-|` and `-|-` but this doesn't work. I asked a previous question here about scaling the whole tikzpicture to the height of the slide, however the solution that was presented did not work for me. It is still being cut off at the bottom. The problem may have to do with the fact that my actual beamer presentation uses the Hannover theme, and as such there is less usable space in the slide? I have gotten around it by using `0.4 \linewidth` temporarily.


title: Bibtex entry with URL

text: I want to cite some lecture notes in my thesis where the main and only source is a webpage (including some PDFs which are the lecture notes). I am using Bibtex. I tried `@webpage`, like:               @webpage{CAVR112,         Author = {Rajeev Alur and Thomas A. Henzinger},         Date-Added = {2012-07-10 03:24:13 +0000},         Date-Modified = {2012-07-10 03:30:02 +0000},         Institution = {MTC EPFL},         Lastchecked = {2012-07-10},         Title = {Computer-Aided Verification},         Url = {http://mtc.epfl.ch/courses/CAV_WS2004/},         Year = {2004}}      in my bib-file but that gave me the warning `Warning--entry type for "CAVR112" isn't style-file defined` and the URL was not shown in the bibliography section (`\bibliographystyle{alpha} \bibliography{bibliography}`). I also tried `@misc` but the URL is also not shown. As the URL is quite important for this source, I want to have it shown but I'm not sure what bibtex entry type I should use. * * * Just found this very related question. It works by using `howpublished = {\url{...}}`. Not sure if I should close this as duplicate or if my other questions are relevant (e.g. I'm still not sure about the entry type here...).


title: LaTeX + Biblatex bibliography to other formats via Pandoc

text: I am trying to convert a simple LaTeX file that uses biblatex-chicago for citation formatting to, say, .docx via Pandoc. Unfortunately, I don't seem to be able to find the right invocation of Pandoc that results in a bibliography (or even the citations) included in the doc. What I'm proposing doesn't have any complicated formulas, tables, or figures-- just the bibliography. This question's author seems to have gotten the bibliography working with Pandoc, though it appears he's maybe using straight up bibtex with maybe the natbib citation commands. Sample LaTeX (foo.tex):               % !TeX TS-program = pdflatexmk     % !BIB TS-program = biber          \documentclass[12pt,letterpaper]{article} % for a short document          % Bibliography     \usepackage[authordate,strict,bibencoding=inputenc,doi=true,isbn=false,backend=biber]{biblatex-chicago}     \addbibresource{./foo.bib}               \title{On Banality}     \author{Bob Dwyre}          \date{}          %%% BEGIN DOCUMENT     \begin{document}          \raggedbottom     \maketitle          People typically prefer to travel shorter distances than longer distances \parencite{zipf1946p1}. \textcite{dijkstra1959note} proposes one way of finding the shortest path.          \printbibliography     \end{document}      And a sample .bib (foo.bib):               @article{dijkstra1959note,         Author = {Dijkstra, Edsger W},         Date-Added = {2014-04-28 19:35:12 +0000},         Date-Modified = {2014-04-28 19:35:12 +0000},         Journal = {Numerische mathematik},         Number = {1},         Pages = {269--271},         Publisher = {Springer},         Title = {A note on two problems in connexion with graphs},         Volume = {1},         Year = {1959}}          @article{zipf1946p1,         Author = {Zipf, George Kingsley},         Date-Added = {2014-04-28 19:32:00 +0000},         Date-Modified = {2014-04-28 19:32:00 +0000},         Journal = {American sociological review},         Pages = {677--686},         Publisher = {JSTOR},         Title = {The P1 P2/D hypothesis: On the intercity movement of persons},         Year = {1946}}      My invocation of Pandoc is as follows, but I see nothing related to bibliography in the final output:               pandoc -o foo.docx foo.tex --biblatex --bibliography=foo.bib


title: Meaning of "Macro packages", "TeX engines" and "Distributions" of TeX

text: I was wondering what relations and differences are between "Macro packages", "TeX engines" and "Distributions" of TeX？ I saw these concepts when looking at the following table at the end of this wikipedia page: ![enter image description here](http://i.stack.imgur.com/YhNvU.png) I am not able to find their meanings, and wonder what they mean?


title: How to inject text globally into memoir class crosshead chapterstyle

text: I wish to add a pifont character (actually `\ding{80}`) to appear spaced after all chapter numbers, and spaced before chapter headings, like this: `2 * Light`, where `*` represents the character I want injected into the chapterstyle. memoir.dtx shows that this crosshead chapterstyle includes:               \renewcommand{\afterchapternum}{}      And LarsMadsen's MemoirChapStyles.pdf > `Source for the AlexanderGrebenkov style` contains this line in that style's definition:               \renewcommand{\afterchapternum}{. }      So I assumed I could do the same trick with the crosshead chapterstyle. This is what I tried as a first shot (injecting just a `*`, not a pifont yet):               \documentclass[mypreferences]{memoir}     \chapterstyle{crosshead}     \renewcommand{\afterchapternum}{ * }      - but that last line creates nothing new. So how do I make this work?


title: framed-like boxes across pages [mathspec or biblatex packages]

text: I'm trying to find the code to get boxes like the ones we can enjoy in the mathspec or biblatex user guides. It seems to be based on the listings and framed packages. Here is a working minimal example               \documentclass{book}     \usepackage{listings}     \usepackage{xcolor}     \usepackage[top=9cm,bottom=10cm]{geometry}     \usepackage{lipsum}     \definecolor{boxframe}{rgb}{0.99,0.05,0.05}     \definecolor{boxfill}{rgb}{0.99,0.95,0.95}     \lstdefinestyle{plain}{escapechar={\#}}     \lstnewenvironment{example}[1][]     {\lstset{aboveskip=15pt,xleftmargin=3pt,xrightmargin=3pt,basewidth=0.5em,basicstyle=\normalsize,frame=single,backgroundcolor=\color{boxfill},fillcolor=\color{white},rulecolor=\color{boxframe},framesep=2pt,framerule=0.5pt,style=plain,#1}}{}     \begin{document}     \lipsum[1]     \lipsum[1]     \begin{example}     listing     listing     listing     listing     listing     listing     \end{example}     \lipsum[1]     \end{document}      I'd like to be able to extract the relevant piece of code in the listings package for other purposes but, so far, in vain. I thought it was using the framed package but it is not.


title: LaTeX fails to find my .sty file

text: ! LaTeX Error: File `mypackage.sty' not found.          Type X to quit or <RETURN> to proceed,     or enter new name. (Default extension: sty)      I am getting the above error message in Ubuntu 10.10. I used this on the Windows machine with MikTeX and it worked fine. I am running TeX Live 2010 on my Ubuntu machine. I put `mypackage.sty` in a folder called `mypackage` under directory               /usr/local/texlive/2010/texmf-dist/tex/latex


title: How can I reset the chapter number from zero with memoir?

text: I'm working with `memoir` class, the first chapter was numbering (chapter 1) but I would like numbering it from zero... how can I do this?


title: BibTeX references on facing page

text: I'm writing my thesis in LyX / LaTeX and using BibTeX to manage references. I prefer numerical references (eg. 1) instead of verbose references (eg. (Smith et al., 1993)) as I think it makes the text easier to read, but it bugs me that you have to constantly flick to the back to find the references. So, question: **Is it be possible to print included references on the facing page?** I made a quick mockup to demonstrate: ![enter image description here](http://i.stack.imgur.com/KKTKk.png) (bonus points if it's possible to have them at the same height as in the facing text, as shown) I'm fairly new to LaTeX, so if this is impossible, that's an ok answer as well!


title: 'Fake' variants in expl3

text: Suppose you have a function that operates on three tokens,               \cs_new:Nn \@@_on_three:NNN { #1, #2, #3 }      And you have a variable whose value is the three tokens:               \tl_set:Nn \l@@_three_tl { foo }      And you would like to have a variant               \@@_on_three:V      so that you can say               \@@_on_three:V \l@@_three_tl      However, if I'm not mistaken, a direct `\cs_generate_variant` would be confused by the different number of arguments (`NNN` vs. `V` or `x`), and in any case it will pass the expanded argument _within braces_ , right? So what you need is a kind of 'fake' variant, defined as:               \cs_new:Nn \@@_on_three:V       { \exp_last_unbraced:Nx \@@_on_three:NNN #1 }      To be clear: **this works**. My question is rather whether there was another way to do this that is less 'naughty'---less mid-level tricking of `expl3`.


title: rotated text and figure side with vertical alignment

text: I am using subfig package to place three figures and a one rotated text side by side. Attached below is the mwe               \documentclass[draft]{article}     \usepackage{subfig}     \usepackage[demo]{graphicx}     \begin{document}          \begin{figure*}[ht!]      \captionsetup[subfigure]{labelformat=empty}           \subfloat[]{        \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig1.pdf}     }\hspace{-1em}      \subfloat[]{        \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig2.pdf}     }\hspace{-2em}      \subfloat[]{        \includegraphics[width=1.50in,height=1.50in,angle=-90]{fig3.pdf}     }     \subfloat[]{        \rotatebox{90}{DWAG}     }     \end{figure*}     \end{document}      However text is not aligned with the figure (output attached). How to fix this. ![enter image description here](http://i.stack.imgur.com/KXBVQ.png)


title: How to generate a series of \paused stand-alone TikZ images?

text: I've built a beamer presentation in which a TikZ graph is built up sequentially using `\pause`. Example:               \documentclass{beamer}     \usepackage{tikz}     \begin{document}             \begin{frame}                     \begin{tikzpicture}[ scale=5 ]                             \draw (0,0) -- (1,0) node[below] {$f_1$};                             \pause                             \draw (0,0) -- (0,1) node[left] {$f_2$};                             \pause                             \draw (0,0) -- (0.87,0.5) node[right] {$f_3$};                     \end{tikzpicture}             \end{frame}     \end{document}      This results in three slides. I want these as three separate images in which each TikZ picture covers an entire "page" or "slide". That is, I want the output slide1.pdf, slide2.pdf and slide3.pdf, and in each of them, the TikZ picture should cover the entire slide. I could accomplish this by creating three standalone .tex files with a lot of duplicate TikZ code, but I suppose there is a better way. What is a good solution?


title: Drawing a Venn-Style-Diagramm underlying a Graph with TikZ

text: I want to draw a graph (the data structure) such that certain subgraphs form a sunflower (a notion from combinatorics). ![enter image description here](http://i.stack.imgur.com/XOgwB.png) In other words I want to indicate that the sets overlap in the middle (1,2,3,4). The idea is that all the colors combined result in white (is that clear enough?). The problem is the spaces where exactly two colors overlap. I could use for example yellow!20!green!20 for the bottom shape but I do not know how to draw a shape like this. In a mathematical sense there is no overlapping of the green and yellow set which does not also contain blue and red but it looks a bit ugly. Any ideas? Maybe a different way to depict it?                   \begin{tikzpicture}[scale=1]         \tikzstyle{rect}=[rectangle, thick,          draw=black, rounded corners, node distance = 2cm]         \tikzstyle{diedge}=[->,thick,shorten <=2pt, shorten >=2pt]         \tikzstyle{udiedge}=[thick,shorten <=2pt, shorten >=2pt]         \tikzstyle{circ}=[circle, thick,          draw=black, rounded corners, node distance = 1cm,         font=\tiny]              \fill[blue!20] (-2.4,2.4) circle (1.2cm);         \fill[red!20] (2.4,2.4) circle (1.2cm);         \fill[green!20] (2.4,-2.4) circle (1.2cm);         \fill[yellow!20] (-2.4,-2.4) circle (1.2cm);              \draw[blue!20,line width=2.4cm] (-2.4,2.4) -- (0,0);         \draw[red!20,line width=2.4cm] (2.4,2.4) -- (0,0);         \draw[green!20,line width=2.4cm] (2.4,-2.4) -- (0,0);         \draw[yellow!20,line width=2.4cm] (-2.4,-2.4) -- (0,0);              \fill[white] (0,0) circle (1.2cm);              \node[circ] at (-0.5,0.5) (1) {$1$};         \node[circ, below of = 1] (2) {$2$};         \node[circ, right of = 1] (3) {$3$};         \node[circ, right of = 2] (4) {$4$};              \path (1) edge[udiedge] (2);         \path (1) edge[udiedge] (3);         \path (2) edge[udiedge] (4);         \path (3) edge[udiedge] (4);              \node[circ, node distance = 2cm, above right of = 3] (5) {$5$};         \node[circ, right of = 5] (6) {$6$};         \node[circ, above of = 5] (7) {$7$};              \path (5) edge[udiedge] (7);         \path (5) edge[udiedge] (6);         \path (7) edge[udiedge] (6);                       \node[circ, node distance = 2cm, above left of = 1] (8) {$8$};         \node[circ, left of = 8] (9) {$9$};         \node[circ, above of = 8] (10) {$10$};              \path (9) edge[udiedge] (10);         \path (10) edge[udiedge] (8);         \path (9) edge[udiedge] (8);                       \node[circ, node distance = 2cm, below right of = 4] (11) {$11$};         \node[circ, below of = 11] (12) {$12$};         \node[circ, right of = 11] (13) {$13$};         \node[circ, right of = 12] (14) {$14$};              \path (11) edge[udiedge] (12);         \path (11) edge[udiedge] (13);         \path (12) edge[udiedge] (14);         \path (13) edge[udiedge] (14);              \node[circ, node distance = 2cm, below left of = 2] (15)         {$15$};              \path (3) edge[udiedge] (5);         \path (1) edge[udiedge] (8);         \path (4) edge[udiedge] (11);         \path (2) edge[udiedge] (15);     \end{tikzpicture}


title: Align axis of separate plots in pgfplots

text: I am preparing a talk using plots generated in `pgfplots`' `axis`-environment. I want the plots' axes to be of the exact same size and position. Unfortunately, plots with different axis- and plot-labels differ in size and produce small "jumps" when flipping through the pages of the presentation. In the code below, I illustrate the problem. The axes have the same size, but due to the different labels, their horizontal position shifts. If one comments the `varwidth`option, one can see, that the same thing happens in the vertical direction.               \documentclass[crop,10pt,     varwidth=250pt     ]{standalone}     \usepackage[english]{babel}     \usepackage{pgfplots}     \pgfplotsset{compat=1.9}     \begin{document}          \begin{tikzpicture}       \begin{axis}[       width=200pt,       heigth=200pt,       xmin=0,xmax=1,ymin=0,ymax=1,       xlabel=xlabel,       ylabel=ylabel,       scale only axis       ]       \addplot coordinates{        (0.1,0.1)       (0.9,0.9)       };       \end{axis}     \end{tikzpicture}     \begin{tikzpicture}       \begin{axis}[       width=200pt,       heigth=200pt,       xmin=0,xmax=100,ymin=0,ymax=100,       xlabel=x$_l^a$bel,       ylabel=y$_l^a$bel,       scale only axis,       ]       \addplot coordinates{        (10,10)       (90,90)       };       \end{axis}     \end{tikzpicture}          \end{document}      Is there a way to produce separate plots with axes of exact same size and position?


title: First line number in lstinputlisting environment

text: I use the following code to display line 23-45 of `sort.cpp`:               \lstinputlisting[language=C++,linerange=23-45]{sort.cpp}      However, the line numbering starts with 1 while I want it start at 23. I found some reference that suggested to change this to               \lstinputlisting[language=C++,linerange=23-45,firstnumber=23]{sort.cpp}      It works, and I want this to be the default setting. According page 31 of the `listings` documentation, > **auto** lets the package choose the first number: a new listing starts with > number one, a named listing continues the most recent same-named listing > (see below), and a stand alone file begins with the number corresponding to > the first input line.   >  **last** continues the numbering of the most recent listing and number sets > it to the number. It should be the default. What's wrong here, or am I misundersting the reference? My listings setting:               \usepackage{xcolor,listings}%color support for listings     \lstset{     basicstyle=\footnotesize,     numbers=left,      numberstyle=\footnotesize,      keywordstyle=\color{blue!70},      commentstyle=\color{red!50!green!50!blue!50},      %stringstyle=\ttfamily, % typewriter type for strings     %frame=shadowbox,      rulesepcolor=\color{red!20!green!20!blue!20},     escapeinside=``,      xleftmargin=2em,xrightmargin=2em, aboveskip=1em,     breaklines=true             % sets automatic line breaking     }


title: How to install mathtools package?

text: I'm new to Latex so forgive me if the questions are dumb... I was trying to right left-top corner superscript, someone recommended mathtools package on this forum: Left and right subscript. So I downloaded mathtools.zip from CTAN, unzip it, there's an "mathtools.dtx". In the package there are documents but none talked about how to install, I fancy the installation is just too primary to real Latex users. OK, then, there's still another thread here explained the steps: How can I manually install a package on MiKTeX (Windows) . So here I follow   1. I ran "tex XXX.dtx" (there's no *.ins files) on all the .dtx files under the extracted folder, that includes: breqn.dtx, flexisym.dtx, mathstyle.dtx, empheq.dtx, mathtools.   2. Then I created a folder "C:\athos\localtexmf\mathtools" and put all the new files in.    3. Then I go to "Windows -> Start -> Programs -> MikTex 2.9 -> Maintenance (Admin) -> Settings (Admin) "; in "Roots" tab I added path "C:\athos\localtexmf"; in "General" tab I clicked "Refresh FNDB" and then clicked "OK" to close it.   4. I restarted my WinEdt, added "\usepackage{mathtools}" under "\documentclass..."; and added "test $\prescript{14}{2}{\mathbf{C}}$ " in the main body. After that when I try to "MikTex", the error still comes up: "The required file tex\latex\mh\mathtools\sty is missing. It is a part of the following pakage: mh . The package will be installed from ..." Seems the folder "C:\athos\localtexmf\mathtools" is not captured by MikTex? Then in the error message dialog, I choose "Change", choose "Package shall be installed from a directory", click "Next", choose ""C:\athos\localtexmf\" or "C:\athos\localtexmf\mathtools", in either try it says "Not a local package repository". What shall I do? I'm on Microsoft Windows XP Prefessional SP3, WinEdt 8 (Build: 20140613 (v. 8.2) - 32-bit), and MikTex 2.9.


title: outline image over entire page width

text: I am probably not the first to ask this question but I have tried every answer I could find before asking it here. The problem is that I want an image (eps) be on the top of the page. I want to add a header on the top of the page starting at an inch from the top and starting at the side of the page (no margin). I have tried \noindent , raisebox & makebox, outlining it to the left.... All the answers I could find. However, I keep getting this. I want it to be higher and starting from the left side of the paper. ![enter image description here](http://i.stack.imgur.com/4kBTF.jpg) Code:               \documentclass[11pt]{article}     \usepackage{graphicx}      \usepackage[a4paper]{geometry}       \usepackage{epstopdf}     \begin{document}     \begin{titlepage}     \begin{center}     \raisebox{100pt}{\includegraphics[width=\paperwidth]{figures/eb.eps}}     \end{center}     \end{titlepage}     \end{document}      Thank you in advance!


title: Manual Bibliography Entries in BibTeX

text: I need to create a bibliography that meets very specific style guidelines not compatible with any packages in LaTeX. Therefore, I need to be able to enter the exact text I want to appear in my bibliography. However, I also want to reuse bibliography entries as I would with BibTeX, keeping a central bibliography in a separate file from my documents. How can I keep my exact bibliography entries in a database similar to BibTeX so that I will be able to \cite them in my documents? (I do not insist on the command being \cite, but I want it to have the same effect as \cite would in a traditional bibliography.)


title: Commercial stock printing with LaTeX (prefer memoir, if possible)

text: In paragraph 2 of Section 2.2 of `texdoc memoir`, I quote > ... with one page per piece of stock. In commercial printing the stock > material is much larger with several pages being printed on each stock > piece; the stock is then folded, cut and trimmed to form the final pages for > binding. The class assumes that desktop publishing is the norm. Is it possible to configure `memoir` to output large stock, multi-page per sheet PDF's, like in commercial printing? If it is not possible to use `memoir` for this, my solution chain would be:   1. Use `memoir` ordinarily, with `\documentclass[showtrims]{memoir}`, among other options.   2. Output single-page per sheet PDF.   3. Use another tool to output the desired large stock, multi-page per sheet PDF. What tool is best for this?


title: copy and reuse the content of an environment

text: is there a way to embed an text in several environments (or structures, \chapter, \section etc.) in one file and "copy"/insert the content of single environment items in other files? i've noticed the clipboard and extract packages and had the thought about \def and \newcommand. but those aren't satisfying, mostly because it seems unaesthetic to me; I just want ordinary environments. The extract package just places the content into a new file, which is what I seek to avoid. Consider an huge collection of aphorisms, quotes or equations (and others, so the solution should be abstract enough to handle different content, I guess environments would fit well). I just don't want a file for each single item, it would be far too many. So something like "I want to use the environment x, this x shall be named x1, that x2 the other x3", as I would do with the extract package would be pleasant, just I need now access to these x1, x2 and x3 instead of a file. Something like "here I want to place a copy of x1, there of x2, here of x1 again, there of x3". So as example I want something like: quotesFile.tex:               \begin{myquote} % any environment     \contentName{quote1} % define some kind of identifier                           % for this environments content     This is a quote     \end{myquote}          \begin{myquote}     \contentName{quote2}     lorem ipsum dolor sit amet     \end{myquote}          \begin{myquote}     \contentName{quote3}     foo bar baz foobar foobaz     \end{myquote}      and in otherfile.tex: \include{quotesFile}               \placeContent{quote2} % I want something as simple                            % as this to insert the content                            % of the environment, here with                            % the identifier "quote2"          \placeContent{quote3}       so the output should be:   lorem ipsum dolor sit amet      foo bar baz foobar foobaz I do not want something like               \newcommand{\quote1}[]{This is a quote}      for several reasons. Well, it kinda would solve the problem but it just doesn't seem aesthetical to me (blame me). I prefer to keep things clear and tidy and all the brackets and commands which are actually just simple text don't seem tidy to me but rather confusing. According to my opinion and understanding commands/macros shall serve to avoid repetition of code but aren't to be used for ordinary text content.


title: No Text selection tool in Kile with Okular as reader

text: I'm using `Kile` as my LaTeX IDE with `Okular` as pdf viewer. Everything works fine except the fact that I cannot find the text selection tool to copy text from the previewed pdf. I know that this tool exists in Okular but I can't figure out to find it. The only tool that I have is the browse tool which doesn't allow to copy text.


title: Include only specific environments

text: I wish to typeset a document and only include occurrences of one specific environment for the output. One thing I tried was using the `comment` package and putting `\begin{comment}`just after `\begin{document}` and `\end{comment}` just before `\end{document}`. Then I redefined the environment I wanted to include to begin with `\end{comment}` and end with `\begin{comment}`. This way only this environment should be uncommented. It compiled fine but gave no page as output. Another option might be to use the `tagging` package, but as far as I understand this lets you exclude certain parts. I want to do the opposite, only include certain parts. EDIT: The background is that I am working on a thesis in linguistics with a large number glossed and numbered examples (sentences with detailed morpheme- by-morpheme translations). There are around hundred of them in total spread around the text and they are all in an `example` environment from the `covington` package. I want to generate a document containing only the examples to proofread them extra carefully and to check them against the recordings they are transcribed from.


title: "! Paragraph ended before \document was complete.<to be read again>\parl.69"

text: I'm writing up my latest assignment in LaTeX. Unfortunately the copy I was given by my lecturer didn't work "out of the box" in LaTeX. Original: http://pastebin.tlhiv.org/7m9aiLWK My version: http://pastebin.tlhiv.org/qgLkJU7T So I'm attempting to make it work, but I've gotten stuck on this error:               ! Paragraph ended before \document was complete.<to be read again>\parl.69      * * * Many thanks to marcellus for helping me get this working (#latex on FreeNode):               \documentclass[a4paper,11pt]{article}     \usepackage[english]{babel}     \usepackage[pdftex]{graphicx}     \usepackage[all]{xy}     \usepackage{amsmath,amssymb,ntheorem}     \usepackage{multicol}          \title{}     \begin{document}               \begin{enumerate}     \item Negate the sentence $$\exists x\,  \left(\forall y\, \left(Qx \wedge \left(\left(-Px \vee Qx\right)     \rightarrow Qy\right)\right)\right)\,.$$          Your final answer may involve $-Px$, $-Qx$, $-Py$ and $-Qy$, but should not use $-$ in any other context.     %%%     \item  Write down the negation of the statement     $$     \exists x \in \mathbb{Z},\left(\exists y \in \mathbb{Z}, \left(\left(\left(x+1\right)^2 > y^2\right)      \rightarrow \left(x \ne y\right)\right)\right)     $$     Which, if any, of the two statements is true?     %%%     \item Suppose the universal set $\mathcal{E} = \{x \in \mathbb{N} \mid\ x \le 12\}$. Let $A = \{x\ \mid\ x \text{\ is\ odd}\}$,        $B = \{x\ \mid\  x > 7\}$ and $C = \{x\ \mid\  x$ is\ divisible by $3\}$.\newline        Write the each of following sets in enumerated form, then depict each using a Venn diagram.     \begin{multicols}{2}     \begin{enumerate}        \item $A \cap B$        \item $B \cup C$        \item  $\overline{A}$        \item  $(A \cup \overline{B}) \cap C$        \item $\overline{A \cup C} \cup \overline{C}$     \end{enumerate}     \end{multicols}{2}     %%%     \item Show that $\overline{\overline{A} \cap B} = A \cup \overline{B}$, using the laws of sets.     %%%     \eject     \item In a class of 35 students, there are 12 students who can speak German and 5 students who can speak Japanese. If 2 students can speak both     of these languages, how many students in the class can speak neither language? Justify your answer by constructing some appropriate sets and     considering their cardinality.     %%%     \item With the aid of a Venn diagram, find an expression for the cardinality of $A \cup B \cup C$, for any sets $A,B,C$.          \item   Show that $G=(V,E)$ has no Hamiltonian cycle,     where $V=\{\,a,b,c,d,e,f,g\,\}$ and     $E=\{\,ab,ac,bc,bd,cd,de,df,ef,eg,fg\,\}$.          \item   Prove that $G=(V,E)$ has no Eulerian walk,          where     \begin{align}      V&=\{\,a,b,c,d,e,f\,\} \text{ and}\\     E&=\{\,ab,ac,bc,bd,ce,de,df,ef\,\}.     \end{align}               Show that it is possible to add one edge to $G$ to form a graph that does have an Eulerian walk, and find such a walk.          \item %\bookmark%      Here is a weighted graph. The numbers in the table give     the weight of the edge joining each pair of vertices. Use Prim's     algorithm to find a minimal spanning tree in this weighted graph.     Then use Kruskal's algorithm to do the same thing.     % $$     % \paste{pics/assign2tbls}1     % $$     \end{enumerate}          The %\paste%      command above includes the output of the following code to typeset the table, produced with yet another tex variant.          % \boxedtables     % \sides     % \table     % \tss \g(10pt)\cmath\Black\g(10pt)\rt7{&\g(10pt)\cmath\g(10pt)}\\ \hl      % |b|c|d|e|f|g|h\\ \hl       % a|18|4|37|93|28|46|55\\ \hl      % b|\g(-10pt)\Gray\vrule width28pt\g(-10pt)\Black|47|12|9|51|72|63\\ \hl      % c|\xx2\g(-10pt)\Gray\vrule width57pt\g(-10pt)\Black|65|82|11|44|33\\ \hl      % d|\xx3\g(-10pt)\Gray\vrule width85pt\g(-10pt)\Black|94|17|61|56\\ \hl      % e|\xx4\g(-10pt)\Gray\vrule width114pt\g(-10pt)\Black|29|73|38\\ \hl      % f|\xx5\g(-10pt)\Gray\vrule width142pt\g(-10pt)\Black|31|5\\ \hl      % g|\xx6\g(-10pt)\Gray\vrule width171pt\g(-10pt)\Black|59\\ \hl      % \endtable          \end{document}


title: Use 'space' glyph from a font

text: Is there a way to globally (or in an environment) set the 'space' glyph as the interword space? I'm importing the OpenType font via `fontspec` which has a specially designed 'space' glyph that I want to use.


title: How to set a "formula triangle" in LaTeX?

text: I'd like to typeset a formula triangle ("Formeldreieck") for the `U=E*d` formula - is there an easy way of doing this within LaTeX (I actually use LaTeXit on Mac OS X, but I do know how to add packages if necessary)?


title: Making Tikz automatic node placement relative to the quantity of nodes

text: This is a follow-up question to this one: Making Tikz automatic node placement work Especially to the post of Mark Wibrow (second one). His solution works with 16 nodes, but I'm looking for a solution that does the same but with 32 nodes, like this:               \foreach \bytes [count=\y from 0] in {        {null},        {a,b,c,d,e},         {ab,ac,ad,ae,bc,bd,be,cd,ce,de},         {abc,abd,abe,acd,ace,ade,bcd,bce,bde,cde},         {abcd,abce,abde,acde,bcde},        {abcde}}      Can you help me editing the following:   1. the              at ({\x+abs(2-\y)+(mod(\y, 4)==0)/2}, -\y)      that all 32 nodes are symmetrical centered. The solution above only works for 16 nodes!   2. that my nodes a -> ab, a -> ac, a -> ad and so on are connected. The solution              \foreach \x in {0,...,15}{         \foreach \y in {\x,...,15}{             \ifnum\x=\y             \else                 \process{\x}{\y}                 \ifnum\pgfmathresult=1                     \draw [<->] (\x) -- (\y);                 \fi             \fi              }     }      doesn't work. I wan't to draw graph to look like this (taken from [1], p. 8) ![enter image description here](http://i.stack.imgur.com/Dh2IG.png)


title: How to make url in footnote clickable?

text: How to make url in footnote clickable? Currently I have:               \paragraph{Some text \protect\footnote{xyz available at \protect\url{https://someplace.org}}}      The footnote appears just fine but nothing happens when I click the url.


title: How to change the width of a column individually in tikz matrix

text: I want to individually change the width of the different columns in the following matrix:               \documentclass{standalone}     \usepackage{tikz}     \begin{document}          \begin{tikzpicture}[font=\small]     \matrix[column sep=4ex,fill=none] {       \draw(0,0)--(1,1); & \draw(0,0)--(1,1); & \draw(0,1)--(1,0); & \draw(0,0)--(1,1); \\     };     \end{tikzpicture}          \end{document}      Basically what I want is something equivalent to the `@{}` operator used in arrays. I tried many options: `@{}`, `minimum width`, `minimum size`, `inner sep`, and other but none worked.


title: xparse verbatim with newline

text: I'm trying to define a simple command using `xparse` and it's `verbatim` argument:               \DeclareDocumentCommand\macro{v}{#1}      but see               ! LaTeX error: "xparse/verbatim-newline"     !     ! Verbatim argument of \macrocode ended by end of line.     !     ! See the LaTeX3 documentation for further information.     !     ! For immediate help type H <return>.      when the argument is multiple lines of code (i.e., contains a new line):               \macro{This     Is     A     Test}      but it has no problem for something like                 \macro{This    Is    A    Test}      In my case, I need it to work with new lines. Update:               \documentclass{book}     \usepackage{luatex,xparse}     \directlua{tex.enableprimitives('',tex.extraprimitives())}     \begin{document}          \DeclareDocumentCommand{\macro}{+v}{\directlua{print("\luaescapestring{#1}")}}     \DeclareDocumentCommand{\macroa}{+v}{#1}          \macro{     This     Is     A     Test     }          \macroa{     This     Is     A     Test     }          \end{document}      macro prints "ThisIsATest" without newlines. I need to print **Exactly** what is passed to the macro. macroa gives fi Thisfi Isfi Afi Testfi. BTW, here is a MWE of it working but I want to "wrap" the behavior inside a macro for convenience:               \documentclass{book}        \usepackage{luatex}         \directlua{tex.enableprimitives('',tex.extraprimitives())}         \begin{document}          \endlinechar`\^^J%     \catcode`\^^M=13%     \directlua{print("\luaescapestring\expandafter{\detokenize{%     This     Is     A     Test     }}")}%     \catcode`\^^M=5          \end{document}      **EXCEPT** Some random characters are output to the pdf (In my working example this doesn't happen because, I guess, I'm using a different font encoding).


title: “Missing $ inserted” in included .tex file via \input

text: I've included a .tex file by using `\input` macro, but the problem comes when I use special characters (because I'm writing in Spanish, I use `á`, `é`, and characters like that). I can use those caracters without any problem in the parent file (I have the spanish package declared), but not in the included file. For that reason I get "Missing $ inserted" error.


title: How to modify the following Beamer theme?

text: I'm using               \documentclass{beamer}     \usepackage{BeamerColor}     \usepackage[english]{babel}          \mode<presentation> {     \usetheme{myown}     \usecolortheme[named=salmon]{structure}     \setbeamercovered{transparent} }          \setbeamercolor{lower separation line head}{bg=LightSteelBlue3}     \setbeamercolor{lineup}{bg=salmon}     \setbeamercolor{linemid}{bg=IndianRed2}     \setbeamercolor{linebottom}{bg=LightSteelBlue3}          \begin{document}     title     \end{document}      where `\usetheme{myown}` is defines as               \useoutertheme[footline=authortitle]{miniframes}     \useinnertheme{rectangles}     \usecolortheme{whale}     \usecolortheme{orchid}               \definecolor{beamer@blendedblue}{rgb}{0.137,0.466,0.741}          \setbeamercolor{structure}{fg=beamer@blendedblue}     \setbeamercolor{titlelike}{parent=structure}     \setbeamercolor{frametitle}{fg=black}     \setbeamercolor{title}{fg=black} \setbeamercolor{item}{fg=black}          \setbeamertemplate{headline}     {%       \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}       \end{beamercolorbox}       \begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%           leftskip=.3cm,rightskip=.3cm plus1fil]{section in head/foot}         \vskip2pt\insertsectionnavigationhorizontal{\paperwidth}{}{}       \end{beamercolorbox}%       \ifbeamer@theme@subsection%         \begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}         \end{beamercolorbox}         \begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%           leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}           \usebeamerfont{subsection in head/foot}\insertsubsectionhead         \end{beamercolorbox}%       \fi%       \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}       \end{beamercolorbox}     } \mode <all>          \makeatletter     \DeclareOptionBeamer{compress}{\beamer@compresstrue}     \ProcessOptionsBeamer          \mode<presentation>          % The footline template is a modification of the one used in the     % Torino theme, Copyright 2007 by Marco Barisione     \setbeamercolor*{lineup}{parent=palette primary}     \setbeamercolor*{linemid}{parent=palette secondary}     \setbeamercolor*{linebottom}{parent=palette tertiary}     \setbeamercolor*{page header}{parent=titlelike}     \mode <all>          % some lengths (the height of the lines)     \newlength{\beamer@decolines@linemid}     \setlength{\beamer@decolines@linemid}{.015\paperheight}          \newlength{\beamer@decolines@lineup}     \setlength{\beamer@decolines@lineup}{.025\paperheight}          \newlength{\beamer@decolines@linebottom}     \setlength{\beamer@decolines@linebottom}{.01\paperheight}               % String used between the current page and the total page count.     \def\beamer@decolines@pageofpages{/}          \defbeamertemplate*{footline}{decolines theme}     {       \leavevmode%       % First line.       \hbox{%       \begin{beamercolorbox}[wd=.8\paperwidth,ht=\beamer@decolines@lineup,dp=0pt]{lineup}%       \end{beamercolorbox}%       \begin{beamercolorbox}[wd=.2\paperwidth,ht=\beamer@decolines@lineup,dp=0pt,right]{}%         \hbox{\usebeamerfont{palette primary}\footnotesize\insertframenumber{} \beamer@decolines@pageofpages{} \inserttotalframenumber\hspace*{2ex}}%       \end{beamercolorbox}%       } %       % Second line.       \hbox{%       \begin{beamercolorbox}[wd=\paperwidth,ht=\beamer@decolines@linemid,dp=0pt]{linemid}%       \end{beamercolorbox}%       } %       % Third line.       \hbox{%       \begin{beamercolorbox}[wd=.9\paperwidth,ht=\beamer@decolines@linebottom,dp=0pt]{linebottom}%       \end{beamercolorbox}%       \begin{beamercolorbox}[wd=.1\paperwidth,ht=\beamer@decolines@linebottom,dp=0pt]{}%       \end{beamercolorbox}%       }%     }     \makeatother      and the question is how to modify the theme to get the two top lines in the same color as is used down, that is the first one salmon and the second one IndianRed2.


title: Space between Hebrew letters larger with MacTeX than with MiKTeX

text: I'm writing LaTeX using LyX on Macintosh, and in Hebrew. My problem is that when exporting the document I get bigger spaces between my Hebrew letters than if compiling the same file on a Windows machine, with MiKTeX. The problem is not specific to LyX; even when I export a LaTeX file I see the same difference in letter spacing. Where can I change the spacing between the letters?               \documentclass[english,hebrew]{article}     \usepackage[utf8x]{inputenc}     \usepackage{babel}          \begin{document}     זוהי דוגמה לכך שהרווחים כאן בעברית גדולים מדי. זוהי דוגמה לכך שהרווחים כאן בעברית גדולים מדי. זוהי דוגמה לכך שהרווחים כאן בעברית גדולים מדי. זוהי דוגמה לכך שהרווחים כאן בעברית גדולים מדי.     \end{document}


title: How to hide a footnote in a section title from the table of contents

text: This is a question that arose in the comments here: Change Section titles to Small Caps only in ToC I normally hide footnotes from the TOC by doing this: `\section[title]{title\footnote{This is a footnote.}}`. This works in a lot of document classes (memoir, article, ...), but not in all of them. `amsbook`, for example, uses the optional argument only for the running heads so the footnote mark still ends up in the TOC. So what is the 'universal solution'?


title: Nesting of test commands (IfStrEq, IfSubStr etc.) of xstring

text: The following code does not work:               \documentclass{article}          \usepackage{xstring}          \newcommand\checkempty[1]{         \IfStrEq{#1}{}{%             Empty         }{%             NonEmpty         }     }          \begin{document}         \checkempty{\IfStrEq{justadummyvalue}{justadummyvalue}{somevalue}{}}     \end{document}      [Edit: What I expect with `\checkempty{\IfStrEq{a}{a}{val}{}}` is `NonEmpty`. However, `\checkempty{\IfStrEq{a}{b}{val}{}}` shall result in `Empty`. ] However, I get some errors like               Argument of \@xs@expand@and@assign has an extra }. \firstif{a}{b}{c} (followed by: )    document.tex    /test   line 19 Texlipse Build Error      and finally also this               TeX capacity exceeded, sorry [input stack size=65000]. \firstif{a}{b}{c} (followed by: )    document.tex    /test   line 19 Texlipse Build Error      Basically, I can guess the problem. `\IfStrEq` cannot be expanded (or however this phenomenon is called exactly) and cannot be nested. Therefore, most commands in `xstring` provide a syntax like `\StrLeft{xstring}{4}[\Result]`. The result string is stored in `\Result` then. However, test commands do not provide this syntax, and I also guess that it would not be meaningful. However, I still hope that there are some tweaks to get my example working. Please tell me, if there is a tweak I can put inside of `\checkempty`. I need to determine (via any case of `if`) inside of a command (here `\checkempty`), if the passed argument (expanded) is empty or not. [Edit: The outer `IfStrEq` shall be expanded before!] If there is no tweak, I cannot use `IfStrEq`, right? In past I worked with the `xifthen` package. It was a complete pain, and I could not manage some expansion problem. With `xstring` and `IfSubStr` everything worked fine, except in the case I am showing in my example :(


title: Making figure captions wider

text: I have the working sample below:               \documentclass[a4paper,11pt,twoside]{report}     \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage[T1]{fontenc}     \usepackage{amsmath, graphicx, tikz, enumerate, amssymb, pgf}          \usepackage{setspace}     \usepackage{pgfplots}     \usepackage{slashbox}     \usepackage{bchart}     \usepackage{float}     \restylefloat{table}     \usepackage{caption}          \usepackage{listings}     \usepackage{color}     \usepackage{textcomp}     \definecolor{dkgreen}{rgb}{0,0.6,0}     \definecolor{gray}{rgb}{0.5,0.5,0.5}     \definecolor{mauve}{rgb}{0.58,0,0.82}     \lstset{     %frame=tb,       language=C++,       aboveskip=3mm,       belowskip=3mm,       showstringspaces=false,       columns=flexible,       %basicstyle={\small\ttfamily},       basicstyle=\ttfamily\footnotesize\bfseries,       numbers=none,       numberstyle=\tiny\color{gray},       %keywordstyle=\color{blue},       commentstyle=\color{dkgreen},       %stringstyle=\color{mauve},       breaklines=true,       breakatwhitespace=true,       tabsize=3     }                    \begin{document}          \begin{center}     \begin{minipage}{.45\linewidth}     \begin{figure}[H]     \begin{lstlisting}     # Query 0 -- Type: Truth, Instructions: 0     array stat_1[144] : w32 -> w8 = symbolic     (query [(Eq false                 (Eq 0                     N0:(ReadLSB w64 56 stat_1)))             (Eq false                 (Eq 0 N1:(URem w64 8 N0)))             (Eq false                 (Eq 0 (URem w64 N0 N1)))]            (Eq false                (Eq 0 N2:(Read w8 56 stat_1))))     #   OK -- Elapsed: 39.8942     #   Is Valid: true               \end{lstlisting}     \caption{A query instance logged by the PC-Logging Solver}     \end{figure}     \end{minipage}          \end{center}          \end{document}      How can I make the caption be longer ? I other words, I want the caption all be on a single line and not do a line break


title: Latex widetext environment without the lines

text: In a two column latex document, I use `widetext` environment which results in a line above and below the `widetext`. This is to guide the reader from the two column to the `widetext` but I want to get rid of it. How can I do it? I tried using `\onecolumngrid` but this retained the line (it now stretches across both columns). Clearly, the lines can be manipulated, now I want to remove them. MWE here.               \documentclass[aps,prl,twocolumn,balance,superscriptaddress,floats,showpacs,a4paper]{revtex4}     \usepackage{latexsym}     \usepackage{dcolumn}     \usepackage{amsmath}     \usepackage{epsf}     \usepackage{float}     \usepackage{hyperref}          \begin{document}          Blah blah, blah blah blah blah          \begin{widetext}     Yada Yada Yada     \end{widetext}          Blah blah blah          \end{document}


title: Using \lstinline[] changes all text colour in editor after use

text: Ben using `\lstinline` today from the listings package... and every time I use it, it seems to change the colour of all text following it in texmaker to light brown... which is very annoying when trying to separate what is what in the text. Anyone know why? and a fix? This is how I'm using it...               price of the data set and finally a scalar float, \lstinline[basicstyle=\ttfamily\small]$pct_change$, which defines the minimum percentage distance between each peak and trough.      Now literally all text following that last `$` is light brown... Any ideas?


title: How to make parentheses usable as macro delimiters when the macro is passed as a point in RPN notation?

text: How to make `(` and `)` usable as macro delimiters when the macro is passed as a point in RPN notation?               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-plot}          \def\f#1{#1 2 exp 1 sub}     \def\g[#1]{#1 2 exp 1 sub}     \def\h(#1){#1 2 exp 1 sub}     \def\i<#1>{#1 2 exp 1 sub}     \def\j|#1|{#1 2 exp 1 sub}          \begin{document}     \begin{pspicture}[showgrid=bottom](-4,-2)(4,4)         \psplot{-2}{2}{\f x}         \psdots(!0 \f{0})         \psdots(!-2 \g[-2])     %   \psdots(!2 \h(2))% <== cannot be compiled!         \psdots(!1.25 \i<1.25>)         \psdots(!1.5 \j|1.5|)     \end{pspicture}     \end{document}


title: Make the contents of a sentence fit to a line?

text: I have been working on a resume. However, some of the text is going beyond a line. For instance, the "Thesis topic" here exceeds the single line as seen: !["Levels" is overflowing into the next line](http://i.stack.imgur.com/bxgN7.png) Here is the code:               \documentclass[10pt]{article}     \usepackage{calc}          \reversemarginpar          \usepackage[paper=letterpaper,                 includefoot, % Uncomment to put page number above margin                 marginparwidth=1.2in,     % Length of section titles                 marginparsep=.05in,       % Space between titles and text                 margin=0.5in,               % 1 inch margins                 includemp]{geometry}          \setlength{\parindent}{0in}          \renewcommand{\section}[1]{\pagebreak[3]%     \vspace{1.3\baselineskip}%     \phantomsection\addcontentsline{toc}{section}{#1}%     \noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%     \vspace{-\baselineskip}\par}          \begin{document}          \section{Education}     M.S., Civil Engineering, The University of Texas at Austin, Austin, TX\hfill\textbf{Dec 20XX}\\     Thesis: \emph{On Accommodating Spatial Dependence in Bicycle and Pedestrian Injury Counts by Severity Level}\\     Adviser: Dr. ABC          \end{document}      If we were to compile this code the "Level" in Thesis topic overflows into the next line. That is the issue at hand. Is it possible to make the text fit to that one line in anyway? Thanks for the inputs!


title: Which typeface is used in moderncv?

text: I am curious which typeface is used in the `moderncv` document class. I wrote a CV with the following document class invocation:               \documentclass[10pt,a4paper,sans]{moderncv}      If I have to write a letter in a word processor, which font should I use to get the same font as `moderncv` with the `sans` option?


title: Separate numbering for problems in two different sections

text: So I am trying to find a way to number my problems from one section to another. Like I want [section 1: Problem 1-5] ; [section 2: Problem 1-5] Instead, I keep on getting the following when I finish writing [Section 1: Problem 1-5] ; [section 2: Problem 6-10] Like I want a new set of numberings every time a start a section. Write now I only know how to use the multialign environment, if you guys have new methods I would be very pleased if you show me how. Well here are my codes:               \section*{Solutions to Problems}          \begin{multialign}          \item          &10(4-5)^2-5+10 && \\          &= 10(-1)^2-5+10 && \text{Parentheses} && \\          & = 10(1)-5+10 && \text{Exponents}&& \\          &= 10-5+10 && \text{Multiplication}&& \\          & = 5 +10 && \text{Subtraction}&&\\          &= 15 && \text{Addition}&& \\          \item          & \frac{(5-2)^2}{9}+5 && \\          &= \frac{3^2}{9}+5 && \text{Parentheses}&& \\          &=\frac{9}{9} +5 && \text{Exponents}&& \\          &=1+5 && \text{Division} && \\          &= 6 && \text{Addition} && \\          \item          & (3-0)^3-9 && \\          &= 3^3-9 && \text{Parentheses}&& \\          &= 27-9 && \text{Exponents}&& \\          &= 18 && \text{Subtraction} && \\          \item          & (10-8)^3*1+8-16 && \\          &=2^3+8-16 && \text{Parentheses}&&\\          & = 8 + 8 - 16 && \text{Exponent}&& \\          & = 16-16 && \text{Addition}&& \\          & = 0 && \text{Subtraction}&& \\          \item          & 0.5(2-5)^4-\frac{81}{2} && \\          &= 0.5(-3)^4-\frac{81}{2} && \text{Parentheses}&& \\          &= 0.5(81) - \frac{81}{2} && \text{Exponents}&& \\          &= 0 && \text{Subtraction}&& \\          \end{multialign}          \section*{New Section}          \begin{multialign}          \item          & \text{Let $(9,8)=(x_1,y_1)$ and $(10,6)=(x_2,y_2)$}\\          & m= \frac{y_1-y_2}{x_1-x_2}&&&& \text{Write out the Slope equation}\\          & m= \frac{8-6}{9-10}&&&&\text{ Plug points into equation}\\          & m= \frac{2}{-1}=-2 &&&& \text{Simplify}\\          & y-y_1=m(x-x_1) &&&& \text{Write out the Point-slope form}\\          & y-8= -2(x-9) &&&& \text{Plug in the values}\\          & y-8= -2x+18 &&&& \text{Distribute the $-2$}\\          & y-8+8 = -2x +18+8 &&&& \text{Add 8 to both side}\\          & y= -2x+26 &&&& \text{Simplify}\\          \item          & \text{Let $(7,2)=(x_1,y_1)$ and $(11,3)=(x_2,y_2)$}\\          & m= \frac{y_1-y_2}{x_1-x_2}&&&& \text{Write out the Slope equation}\\           & m= \frac{2-3}{7-11}&&&&\text{ Plug points into equation}\\          & m= \frac{-1}{-4}=\frac{1}{4} &&&& \text{Simplify}\\          & y-y_1=m(x-x_1) &&&& \text{Write out the Point-slope form}\\          & y-2= \frac{1}{4}(x-7) &&&& \text{Plug in the values}\\          & y-2= \frac{1}{4}x - \frac{7}{4} &&&& \text{Distribute the $\frac{1}{4}$}\\          & y-2+2 = \frac{1}{4}x - \frac{7}{4} +2 &&&& \text{Add 2 to both side}\\          & y= \frac{1}{4}x - \frac{7}{4} +\frac{8}{4} &&&& \text{Find the LCD}\\          & y= \frac{1}{4}x + \frac{1}{4} &&&& \text{Simplify}\\          \end{multialign}      Here's a picture of what I mean: ![enter image description here](http://i.stack.imgur.com/wrhye.png)


title: Libertine and Biolinum KeyCap Macros

text: For no obvious reason reason the use of the following example               \documentclass{scrartcl}     \usepackage{libertine}     \begin{document}          \LKeyCtrl          \end{document}      produces the following error of an undefined control sequence:               There were errors in your LaTeX source          Undefined control sequence. [\LKeyCtrl]      I am on a mac with TexLive 2013 and just updated all packages and reinstalled the libertine separately (but this did not help) I proceeded as suggested by Kurt:   1. downloaded `libertine-legacy`   2. unzipped it to the root of my `texmf-local` under `/usr/local/texlive`   3. Updated via terminal with              texhash texmf      and afterwards              cpleul-mbp:~ cpleul$ updmap --enable Map=libertine.map      The example runs fine just using "normal" text but produces the same error when using e.g. `\LKeyCtrl`


title: Table containing symbols in a fixed-width column results in underfull hbox

text: As part of a large table I have a column where each row contains a number of variables/symbols. The column should have a fixed width to fit the rest of the table. The problem is that the collection of symbols give a bunch of underfull hbox warnings. With large tables this quickly results into dozens of warnings. I have reduced the problem down to this example:               \documentclass{article}     \usepackage[utf8]{inputenc}          \begin{document}          \begin{table}     \centering     \caption{Test table}     \begin{tabular}{|p{3cm}|}     \hline     $C_{X_u}$, $C_{Z_u}$, $C_{m_u}$, $C_{X_\alpha}$, $C_{Z_\alpha}$, $C_{m_\alpha}$, $C_{Z_{\dot{\alpha}}}$, $C_{m_{\dot{\alpha}}}$, $C_{X_q}$, $C_{Z_q}$, $C_{m_q}$ \\     \hline     \end{tabular}     \end{table}          \end{document}      Thanks in advance!


title: Special arrangement of subfigures

text: I need an image with five subfigures arranged this way. ![enter image description here](http://i.stack.imgur.com/dKRbe.png) I have tried to use subfig and floatrow, but I haven't been able to place the figures as I need them


title: Spacing issue in new environment from a theorem

text: I'm trying to create a theorem environment that I can use to repeat a theorem that has been previously stated in a book but number it the same as the 1st instance. I found some sort of solution:               \documentclass{article}          \usepackage{amsthm}           \newtheorem{theorem}{Theorem}     \newcounter{thmC}     \newtheorem{rethm}[thmC]{Theorem}          \newenvironment{retheorem}[1]%     {\setcounter{thmC}{#1}%     \addtocounter{thmC}{-1}%     \begin{rethm}}%     {\end{rethm}\ignorespacesafterend}          \begin{document}          \begin{theorem}\label{theorem:Hi}     Hi this is my theorem.     \end{theorem}          \begin{theorem}\label{theorem:another}     Another theorem.     \end{theorem}          \begin{theorem}\label{theorem:third}     third theorem     \end{theorem}          \begin{retheorem}{\ref{theorem:third}}     third theorem     \end{retheorem}          \begin{retheorem}{\ref{theorem:another}}     Another theorem.     \end{retheorem}          \begin{retheorem}{\ref{theorem:Hi}}     Hi this is my theorem.     \end{retheorem}          \end{document}      It nearly works but there is a spacing issue. ![output picture](http://i.stack.imgur.com/RZwpL.png) My further concern is will this approach work for theorems labeled with the section               \numberwithin{theoremC}{section}     \newtheorem{theorem}[theoremC]{Theorem}


title: Create list of all external files used by master LaTeX document?

text: Is there an easy way to create a list of all external files (complete path) which are used by a LaTeX document (and its "sub-documents") by   * `\input`   * `\include`   * `\includegraphics` ? (may I have forgotten some input sources?)


title: Increase vertical space between inference rules

text: I am using the `semantic` package with `beamer` to make some inference rules for a language. There are about 10 relatively small-sized rules and I want them to be all in one slide. However, the rules are so piled up that the slide is hardly readable. Is it possible to increase the vertical space between them?               \makeatletter\let\ifGm@compatii\relax\makeatother     \documentclass{beamer}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage[latin1]{inputenc}     \usetheme{Boadilla}     \usepackage{wrapfig}     \usepackage{semantic}          \begin{document}     \begin{frame}{Frame}       $\inference[Bracketing]{X:\theta}{(X):\theta}$       $\inference[Zero]{}{0:\textbf{val}[\textbf{nat}]}$       $\inference[Succ]{N:\textbf{val}[\textbf{nat}]}{succ N:\textbf{val}[\textbf{nat}]}$       $\inference[Truth]{}{\textbf{true}:\textbf{val}[\textbf{bool}]}$     \end{frame}     \end{document}


title: Verbal descriptions of bibliography styles

text: I am trying to determine the how the many bibliography styles are different. Every source that I could find (such as this one) states several options with accompanying pictures of examples, but does not explain the difference in words. Where can I find verbal descriptions explaining the difference among the many bibliography styles?


title: External images displayed in circle

text: I'd like to have several external images organized in a circular shape, with TikZ drawing on top of it. I tried the scope option in TikZ with `\includegraphics` command, the whole thing being included in a `\foreach` command, but `\includegraphics` doesn't take the scope command in consideration.


title: How can I achieve \verb like behavior with an xparse argspec?

text: How can I use a previously scanned token as an argument to `u{}` in an `xparse` argspec?               \documentclass{article}     \usepackage{xparse}          \NewDocumentEnvironment {some-cool-env} {D<>{\stopscan} u{#1}} {%       Here is the text up until the stopping token: ``#2'' \newline       Here's the rest of the environment:                  \par     } {}          \begin{document}     \begin{some-cool-env}       I am a\stopscan teapot     \end{some-cool-env}          (some inner text)          \begin{some-cool-env}<|>       A custom built|teapot.     \end{some-cool-env}     \end{document}      which would give               Here is the text up until the stopping token: "I am a"     Here's the rest of the environment:          teapot          (some inner text)          Here is the text up until the stopping token: "A custom built"     Here's the rest of the environment:          teapot.      How might I achieve the syntax I'd like? (Hopefully without breaking into `xparse`'s internals…) The naïve approach above produces the following error: > >     ERROR: Illegal parameter number in definition of \__xparse_grab_arg:w. >   >     --- TeX said --- >     <to be read again> >                        1 >     l.9 \DumbVerb >                  <|>test| >     --- HELP --- >     This is probably caused by a \newcommand, \renewcommand, >     \newenvironment, or \renewenvironment command in which a # is used >     incorrectly.  A # character, except as part of the command name \#, >     can be used only to indicate an argument parameter, as in #2, which >     denotes the second argument. This error is also caused by nesting one >     of the above four commands inside another, or by putting a parameter >     like #2 in the last argument of a \newenvironment or \renewenvironment >     command. >   * * * I have edited the question body quite a bit since @egreg's answer, but the question title remains the same. It should be noted that the question @egreg answered was for single commands defined with `xparse`. In such a case his answer would work, but it unfortunately is not immediately generalizable to defining similar environments. (Well that's not true; you can still define an auxiliary environment, but this still feels like cheating…)


title: Producing a column with rotated text in all cells

text: I would like to set the first and the second column of the shown `tabularx` table to automatically rotate any text inside a single cell of one row or a single cell consisting of cells joined by `\multirow` and to center it both vertically and horizontally while allowing to adjust the height of the columns by `\\\\[height]` or other method with top vertical alignment of the content. _Just to explain the rule through the first column, I also need`\noalign{\hrule height 1pt}` to behave like `\cline{2-4}`, hence not affecting the first column, but that is for another question, I guess._ Minimal working example:               \documentclass[11pt, a4paper]{article}     \usepackage{lmodern}     \usepackage{array}     \usepackage{graphicx}     \usepackage{multirow}     \usepackage{tabularx}     \begin{document}          \scriptsize     \setlength{\extrarowheight}{0.2em}     \noindent\begin{tabularx}{\textwidth}{!{\vrule width 1pt} p{0.3cm} !{\vrule width 1pt} p{0.5cm} | p{4cm} | X !{\vrule width 1pt}}     \noalign{\hrule height 1pt}     \multirow{4}{*}{\rotatebox{90}{Ten}}&\multirow{2}{*}{\rotatebox{90}{Eight}} & One & Two\\[0.5cm] \cline{3-4}     & & Three & Four\\[1cm] \noalign{\hrule height 1pt}     &\multirow{2}{*}{\rotatebox{90}{Nine}} & Five & Six\\[0.5cm] \cline{3-4}     & & \multicolumn{2}{ l !{\vrule width 1pt}}{Seven}\\[1cm]     \noalign{\hrule height 1pt}     \end{tabularx}          \end{document}      ![The current state.](http://i.stack.imgur.com/wwYJZ.png) **Fig. 1:** The current state. ![The objective.](http://i.stack.imgur.com/LwSCV.png) **Fig. 2:** The approximate objective (digitally manipulated in a graphics editing program).


title: Cite dataset with bibtex using Mendeley

text: The question was already asked (here and here) but I was not able to find a proper answer: How can I cite a dataset with bibtex? I'm using Zenodo as a place to put my data, and I have a DOI. So I include the DOI and the URL, I put Zenodo as the publisher and I'm a bit blocked to explicitly show in the bibliography that this is a dataset. When I use the "report" type, it is written "Technical report" in my bibliography. With data, I would use a "misc" type, but I would like to write, similarly to "Technical report", "Dataset". How would you cite a dataset? Anyone already met this issue? Not in the bibliography? Zenodo official recommendation is: > Last name, First name (year). Title. ZENODO. 10.5281/zenodo.8492 But their bibtex exporter does not work.


title: How to insert multiple paragraph in a \cventry

text: Here is the syntax of `\cventry`:               \cventry{1}{2}{3}{4}{5}{desc}      How to insert multiple paragraph in a `desc` part. Also it seems that `cventry` does not span in multiple pages which make the CV to seem awkward.


title: addplot3[surf] creates lines instead of a surface

text: I have been trying to create a surface plot but I am unable to get it to work. Any help would be greatly appreciated. I've tried using `surf` which only produces lines instead of a surface (Fig. 1). Note: Although I was originally able to produce output, the`surf` plot no longer compiles: "Package tikz Error". I've tried compiling with both pdflatex and lualatex with -shell- escape flag. ![enter image description here](http://i.stack.imgur.com/OlpPe.png) Figure 1 I also tried to use the `patch` style plot. This produces gibberish (Fig. 2) ![enter image description here](http://i.stack.imgur.com/UWMU7.png) Figure 2 MWE:               \documentclass{article}     \usepackage{pgfplots}     \usepgfplotslibrary{external}     \usepgfplotslibrary{patchplots}     \tikzexternalize          \begin{document}     \begin{figure}[t]       \centering            \tikzsetnextfilename{surface_plot}       \begin{tikzpicture}         \begin{axis} [           height=12cm,           width=15cm,           grid=major,           grid style={dotted},           colormap/jet,           mesh/ordering=x varies         ]           %\addplot3[patch,patch type=biquadratic,shader=faceted interp,patch refines=3] coordinates {           \addplot3[surf] coordinates {          (-6,-6,446.788)  (-5,-6,423.361)  (-4,-6,413.264)  (-3,-6,402.349)  (-2,-6,388.948)  (-1,-6,391.747)  (0,-6,386.874)  (1,-6,423.778)  (2,-6, 439.19)  (3,-6,449.074)  (4,-6,462.155)  (5,-6,484.399)  (6,-6,505.412)     (-6,-5, 423.48)  (-5,-5,392.382)  (-4,-5,406.696)  (-3,-5,392.592)  (-2,-5,371.158)  (-1,-5,384.142)  (0,-5,394.666)  (1,-5,408.105)  (2,-5, 422.51)  (3,-5,420.173)  (4,-5,445.816)  (5,-5,464.731)  (6,-5,485.349)     (-6,-4,402.646)  (-5,-4,371.879)  (-4,-4,376.239)  (-3,-4,396.874)  (-2,-4,382.761)  (-1,-4,386.665)  (0,-4,397.148)  (1,-4,410.875)  (2,-4,425.998)  (3,-4,385.143)  (4,-4,420.458)  (5,-4,438.432)  (6,-4,    458)     (-6,-3,423.219)  (-5,-3,370.582)  (-4,-3,464.786)  (-3,-3,443.921)  (-2,-3,425.196)  (-1,-3,427.138)  (0,-3,438.002)  (1,-3, 453.97)  (2,-3,473.021)  (3,-3,418.583)  (4,-3,435.887)  (5,-3,414.993)  (6,-3,475.148)     (-6,-2,401.995)  (-5,-2,385.612)  (-4,-2,438.956)  (-3,-2,418.583)  (-2,-2,400.093)  (-1,-2,400.773)  (0,-2, 410.58)  (1,-2,426.024)  (2,-2, 444.92)  (3,-2,397.131)  (4,-2,413.739)  (5,-2,431.741)  (6,-2,451.267)     (-6,-1,382.978)  (-5,-1,335.274)  (-4,-1,416.598)  (-3,-1,396.718)  (-2,-1,378.348)  (-1,-1,377.455)  (0,-1,32.0089)  (1,-1,400.683)  (2,-1,419.918)  (3,-1,377.371)  (4,-1,393.286)  (5,-1,374.648)  (6,-1,429.077)     (-6, 0,365.902)  (-5, 0,350.965)  (-4, 0,397.527)  (-3, 0, 378.36)  (-2, 0,360.454)  (-1, 0,358.447)  (0, 0,    363)  (1, 0,381.147)  (2, 0,401.177)  (3, 0,362.155)  (4, 0,378.174)  (5, 0,395.513)  (6, 0, 414.34)     (-6, 1,372.511)  (-5, 1,326.945)  (-4, 1,407.215)  (-3, 1,388.646)  (-2, 1,371.945)  (-1, 1,371.003)  (0, 1,380.027)  (1, 1,396.414)  (2, 1,416.602)  (3, 1,374.897)  (4, 1,391.276)  (5, 1, 373.32)  (6, 1,428.284)     (-6, 2,391.149)  (-5, 2,376.191)  (-4, 2,406.941)  (-3, 2,369.633)  (-2, 2,393.583)  (-1, 2,394.184)  (0, 2,404.263)  (1, 2,420.588)  (2, 2,  440.5)  (3, 2,416.631)  (4, 2,374.948)  (5, 2,391.855)  (6, 2,418.511)     (-6, 3,375.967)  (-5, 3,361.698)  (-4, 3,357.421)  (-3, 3,368.273)  (-2, 3,377.106)  (-1, 3,378.664)  (0, 3,369.175)  (1, 3, 382.42)  (2, 3,397.821)  (3, 3,377.942)  (4, 3,384.944)  (5, 3,387.862)  (6, 3,424.429)     (-6, 4,396.478)  (-5, 4,381.554)  (-4, 4,376.162)  (-3, 4,388.843)  (-2, 4,375.881)  (-1, 4,378.384)  (0, 4, 355.14)  (1, 4,403.654)  (2, 4,419.779)  (3, 4,398.599)  (4, 4,407.113)  (5, 4,426.715)  (6, 4,448.245)     (-6, 5,409.364)  (-5, 5,380.492)  (-4, 5,387.843)  (-3, 5,360.034)  (-2, 5, 362.23)  (-1, 5,364.909)  (0, 5,358.321)  (1, 5,363.226)  (2, 5,379.325)  (3, 5,397.152)  (4, 5,410.086)  (5, 5,433.909)  (6, 5,460.548)     (-6, 6, 423.99)  (-5, 6,408.967)  (-4, 6,400.475)  (-3, 6,372.922)  (-2, 6,371.116)  (-1, 6, 373.92)  (0, 6,384.778)  (1, 6,  398.8)  (2, 6, 415.62)  (3, 6,420.127)  (4, 6,436.064)  (5, 6,461.957)  (6, 6,491.123)                };         \end{axis}       \end{tikzpicture}          \end{figure}     \end{document}      Thank you so much.


title: Horizontal rule with adjustable height behaving like \cline{n-m}

text: How can I produce `\noalign{\hrule height 1pt}` only through a certain number of columns just like with `\cline{n-m}` (or basically `\cline` with adjustable thickness)? ![The objective.](http://i.stack.imgur.com/dDber.png) **Fig. 1:** The approximate objective (digitally manipulated in a graphics editing program).


title: Customizing list of theorems (LaTeX)

text: Is it possible to avoid brackets surrounding the name of a theorem in the `\listoftheorems` from `thmtools`? And if so, how do I do that?


title: Use same font in Lilypond lyrics as in surrounding LaTeX document

text: I use LaTeX and lilypond-book to create a hymn sheet. I increased the font size with KOMA script to increase the readability. Now the font sizes in the LaTeX document does not match the embedded lyrics from Lilypond. What can I do that Lilypond re-uses LaTeX' font size? (Probably the problem is more difficult than I thought: Lilypond uses different fonts like truetype or type1 and not LaTeX' Computer Modern. Somewhat solved in comment) Code with manually adjusted sizes that somehow match:               \documentclass[a4paper,fontsize=15pt]{scrartcl}     \usepackage{tgschola}     \addtokomafont{disposition}{\rmfamily}          \begin{document}     \begin{lilypond}     \version "2.12.3"     \paper { indent = 0 }      Melodie = \relative c' {       \clef treble       \time 2/4       \omit Staff.TimeSignature            c2 d2 e2 g2       \bar "|."     }          Text = \lyricmode {       Lo -- rem ip -- sum     }          \score{       <<         \new Voice = "eins" {           \autoBeamOff           \Melodie         }         \new Lyrics \lyricsto "eins" \Text       >>       \layout {         \context {          \Lyrics          \override LyricText #'font-size = #3          %\override LyricText #'font-name = #"Computer Modern"        }       }     }     \end{lilypond}          2. Lorem ipsum dolor sit amet, / consetetur sadipscing elitr          \end{document}      The - in Lo -- rem is smaller than the letters. How do I adjust that?


title: Custom page number positioning in a rotated A4 environment

text: I have the following code:               \documentclass[landscape,english]{article}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage{geometry}% http://ctan.org/pkg/showframe     \pdfpageheight\paperheight     \pdfpagewidth\paperwidth     \usepackage{babel}          \begin{document}     \setcounter{page}{9}     TEST     \end{document}      The issue here is that the footer of my page is now on the side of the normal A4 format. If I run this, the page number 9 will end up at the bottom of the rotated page. What I want to do is the following:   * Either rotate the text I have on my page (not really the solution I'm looking for, but it would work) or   * Force the page number to appear in the same place as when I didn't rotate the entire page.


title: Adjust parameters of resumed lists

text: When an `enumitem` list is resumed there is some additional vertical space that is applied as can be seen in the difference in the vertical alignment of the 2nd item: ![enter image description here](http://i.stack.imgur.com/aOswm.png) I assume this is related to `topsep`. So, I could adjust the `topsep` parameter manually each time I resume a list, but wondering if there is a way to define the `MyEnumerate` list so that the values of `topsep` (and perhaps any others things that need tweaking) are different for resumed lists vs. the initial (non-resumed) list. Also, what is the correct mathematical computation of the `topsep` value required in terms of the other `enumitem` spacing parameters? ## References:   * Resuming a list ## Code:               \documentclass{article}     \usepackage{enumitem}          \newlist{MyEnumerate}{enumerate}{3}     \setlist[MyEnumerate]{label*=(\arabic*)}          \begin{document}     \begin{minipage}[t]{0.45\linewidth}         My List of items:         \begin{MyEnumerate}             \item First Item.             \item Second Item.             \item Third Item.             \item Fourth Item.         \end{MyEnumerate}%         End of list.     \end{minipage}%     \hfill%     \begin{minipage}[t]{0.45\linewidth}         My List of items:         \begin{MyEnumerate}[series=foo]             \item First Item.         \end{MyEnumerate}         \begin{MyEnumerate}[resume*=foo]             \item Second Item (resumed).         \end{MyEnumerate}%         \begin{MyEnumerate}[resume*=foo]             \item Third Item (resumed).         \end{MyEnumerate}%         \begin{MyEnumerate}[resume*=foo]             \item Fourth Item (resumed).         \end{MyEnumerate}%         End of resumed list.     \end{minipage}%     \end{document}


title: multipart nodes anchors for dividers

text: How can a node be positioned at the center/edge of a part in a multipart node using relative positioning?               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes.multipart}     \usetikzlibrary{positioning}     \begin{document}     \begin{tikzpicture}     \node[align=center,draw,shape=rectangle split,rectangle split horizontal,rectangle split parts=3, text width=2cm] (A) at (1.5,3)      {one\nodepart{two}two\nodepart{three}three};     \node[draw,shape=circle] (E) at (2.7,1) {$E$};     \node[draw,shape=circle] (C) at (3.7,1) {$C$};     \end{tikzpicture}     \end{document}      This is the desired result: ![enter image description here](http://i.stack.imgur.com/tuVEp.png)


title: How to disable all Vim-LaTeX mappings?

text: I like some of the features provided by the Vim-LaTeX suite, but not all of them. In particular, I dislike all of the mappings like `[[ = \left[ \right]` and the automatic placeholder stuff with `<++>`. I am a very fast typist but with that comes more typing mistakes, which I correct almost instantly by pressing backspace. Unfortunately, if something has automatically added a bunch of place-holders or expanded some expression, I then have to move around the document and remove more characters than necessary. For example, if I accidentally press `[` twice, instead of only having to delete one character, I have to delete 10. Having already looked through the documentation, and some of the source, I have managed to disable some of these "features", but not all of them: In particular:               let g:Tex_SmartKeyBS = 0     let g:Tex_SmartKeyQuote = 0     let g:Tex_SmartKeyDot = 0      (Turn off maps for backspace, double quote and triple dot.)               let g:Imap_UsePlaceHolders = 0      (Turn off `<++>` placeholder insertion.) But I can't seem to find a way of turning off the other stuff. Anyone have any suggestions? **Edit** : I was able to "disable" some more things by setting:               let g:Tex_Leader = '`tex'     let g:Tex_Leader2 = ',tex'      (Which stops some expansions but still not all. It's not really disabling it but just making it less likely that you're going to type in ``texa` as opposed to the potentially more common ``a`, for example.) PS: Personally, I think it is very poor practice to make an optional package that, when installed, greatly changes the default handling of your system. I don't mind some intelligent source highlighting etc, or some new commands (that don't clobber any old ones), but it seems unhelpful to enable this drastic kind of key remapping by default.


title: How to horizontally draw a line passing through a point A until it reaches the border of a node B using TikZ?

text: Given point A and a node B with an ellipse shape, how to draw a line from A horizontally until it reaches the border of B? ![tikz](http://i.stack.imgur.com/aRcou.png)


title: texdoc can't find gnome-open (ubuntu 12.04, texlive 2009)

text: I have a full texlive ubuntu (2009) installation and typing something like               texdoc caption      returns the following error message: sh: 1: gnome-open: not found if I type texdoc -f, I get the message:               absent  /home/user/texmf/texdoc/texdoc-bin.cnf     (*) absent  /home/user/texmf/texdoc/texdoc.cnf     absent  /home/user/texmf/texdoc/texdoc-dist.cnf     absent  /usr/local/share/texmf/texdoc/texdoc-bin.cnf     absent  /usr/local/share/texmf/texdoc/texdoc.cnf     absent  /usr/share/texmf/texdoc/texdoc.cnf      (*) This is the recommended configuration file for your personal preferences Is there any way to avoid this error and make texdoc work?


title: How to form braces or brackets used in math formulas around nodes in a TikZ picture?

text: > **Possible Duplicate:**   >  Adding a large brace next to a body of text I'm trying to create a brace or bracket around two or more nodes within a TikZ picture. Since there are more elements in the picture which are not to be encompassed by the bracket or brace, I can't use the "insert the picture into LaTeX math mode" approach. ![How do I get that bracket there in TikZ?](http://i.stack.imgur.com/jRvJ6.png) Here's the example code, for easy copy-pasting:               \documentclass{standalone}          \usepackage{tikz}     \usetikzlibrary{shapes,arrows}     \usetikzlibrary{positioning}          \begin{document}          \begin{tikzpicture}[box/.style={rectangle, fill=black, minimum size=1cm}]       \node [box] (a) {};       \node [box, below=of a] (b) {};       \node [box, below=of b] (c) {};       \node [box, below=of c] (d) {};     \end{tikzpicture}          \end{document}


title: Highlighting specific lines with lstinputlisting

text: > **Possible Duplicate:**   >  highlight lines in listings How can I include a source file with the `listings` package and highlight specific lines (coloured text or coloured background will do)?


title: Environment with customizable number of table columns

text: I want to make macros for drawing group of questions with same answers with customizable text, number of answers and design (column widths, alignment, etc.), like this: ![enter image description here](http://i.stack.imgur.com/cOlk4.png)               \begin{questionGroup}{Question group description}{3}{|p{100}|c|c|c|}         Questions& yes& no& maybe\\\hline         \groupQuestion{Question1}         \groupQuestion{Question2}     \end{questionGroup}      The number of columns in generated rows is dynamical and numbers in all cells except first are also generated. The best I had managed to make work is:               \documentclass{article}     \usepackage{tikz}     % #1 - question group title     % #2 - answer count     % #3 - table design     \newenvironment{questionGroup}[3]{     \noindent\QuestionID{}\textbf{#1}\\     \setlength{\tabcolsep}{2pt}     \setcounter{subQuestionID}{0}     \newcounter{answerCount}     \setcounter{answerCount}{#2}     \begin{tabular}{#3}     \hline     }{\end{tabular}\\}     \newcommand{\groupQuestion}[1]{     \subQuestionID{}.~#1&     \foreach \n in {1,...,\value{answerCount}}{       \n      }     \\\hline     }     \newcounter{QuestionID}     \newcommand{\QuestionID}{\addtocounter{QuestionID}{1}\textit{\arabic{QuestionID}.}}     \newcounter{subQuestionID}     \newcommand{\subQuestionID}{\addtocounter{subQuestionID}{1}{\textit{\alph{subQuestionID}}}}          \begin{document}     \begin{questionGroup}{Question group description}{3}{|p{100}|c|c|c|}         Questions& yes& no& maybe\\\hline         \groupQuestion{Question1}         \groupQuestion{Question2}     \end{questionGroup}     \end{document}      To complete this I need the following:   * [DONE] ~~pass a number of answers (parameter of the environment) inside`\groupQuestion{}` command;~~   * [DONE] ~~print incrementing numbers for each answer of each question in separate column from 1 to number given as environment parameter;~~   * output table column separators from `\foreach` - currently it returns error after inserting `&` before `\n`