title: set the length of the column separation rule in multicols

text: I have trouble to make the line which separates two columns in a multicols environment reaching the bottom of the columns.                   \setlength{\columnseprule}{1pt}       is managing the rule width. Is there any command to set the rule length? My code and the output                   \documentclass[12pt,a4paper]{article}         \usepackage[utf8x]{inputenc}         \usepackage{ucs}         \usepackage{amsmath}         \usepackage{amsfonts}         \usepackage{amssymb}         \usepackage{multicol}         \usepackage{enumitem}         \usepackage{setspace} % pr utiliser spacing         \usepackage{graphicx}         \begin{document}         \textbf{Exercice 1}\\ Factoriser au maximum les expressions suivantes.         \setlength{\columnseprule}{1pt}         \begin{multicols}{2}         \begin{enumerate}[itemsep=150pt]         \item $15y^2-5yz-6y+2z$         \item $y^2+12y+35$         \item $25y^2-40y+16$         \item $t^2-2t-8$          \item $z^3+3y^3+3z^2y+zy^2$         \item $81x^2-90x+25$         \end{enumerate}         \end{multicols}         \end{document}      ![column separation rule](http://i.stack.imgur.com/y1gIm.png) I can manage it through some fancy ad hoc manipulations. Any elegant idea to solve this would be greatly appreciated! Thomas


title: Making efficient use of \writes

text: I'm currently trying to compile my thesis using LaTeX and have run up against the old `! No room for a new \write .` problem. After some googling it seems the only way to actually resolve this problem is to restructure your document to minimise the number of writes being consumed. To that end I've been looking through the `.log` to find where they are all being consumed. Here's the results grepped down to those lines containing `write`.               \write18 enabled.     (/usr/local/texlive/2010/texmf-dist/tex/latex/rvwrite/rvwrite.sty     Package: rvwrite 2010/08/25 1.2 enhanced write registers (CVR)     Package rvwrite Warning: ****************************************     (rvwrite)                Package rvwrite v,1.2 loaded     (rvwrite)                [enhanced write registers (CVR)]     (rvwrite)                ****************************************.     \rvtwrite=\write3     \openout3 = `thesis-write.tex'.     \@glossaryfile=\write4     \@outemp=\write5     \verbatim@out=\write6     runsystem(echo 'write18-test-20114121256'>"thesis.w18")...executed.     \w@pgf@writea=\write7     \tikzexternal@outfile=\write8     \glswrite=\write9     \glo@main@file=\write10     \FV@OutFile=\write11     \@outlinefile=\write12     \tikzexternal@dep@file=\write13     \tikzexternal@outmakefile=\write14     \tf@tdo=\write15      Where have `\write0`, `\write1` & `\write2` gone? Is the use of these somehow restricted? I'm using standard packages: `algorithm2e`, `listings`, `glossaries`, `pgf`/`tikz`, `emp`. Some of these appear quite greedy with the resources. `glossaries` has claimed `\write4`, `\write9`, and `\write10`. `verbatim` and `fancyvrb` are loaded by other packages and they claim `\write6` and `\write11` respectively. The worst culprit seems to be PGF/TikZ taking four writes. My compilation breaks when LaTeX is trying to construct the Table of Contents listings. I want to make a ToC, a list of Figures, Tables, Listings, and Algorithms. At present there are no where near enough writes to do this. Does anyone have any advice about how I can control the rampant `\write` consumption of these packages? How do people actually make sizable documents using LaTeX with such restrictions? Am I being unreasonable assuming I'll be able to have a 7 chapter document with a ToC, 4 listofs, index, glossary, and bibliography? Or is that beyond the resource limits of LaTeX?


title: Conventions for formatting scientific units?

text: I would appreciate some guidance on how to format units that incorporate SI, molecules, and text. Right now I am formatting the letters in chemicals or names as 'text' and the SI units, sub/super scripts and numbers in math. For example, I would appreciate feedback on how to format the following for publication:   * meter squared leaf area per meter squared of ground: $m^2$leaf$m^{-2}$leaf   * grams carbon: $g$C   * carbon dioxide CO$_2$ This previous question about [what package should be used to typeset units] is similar, except that I am not convinced that I need to add another package like siunitx (publishers request that I minimize use of extra packages). Thanks!


title: How to draw this picture in 3D (TikZ)

text: How to draw this picture in 3D (TikZ)? ![enter image description here](http://i.stack.imgur.com/zFK4j.jpg)               \documentclass[tikz,border=2mm]{standalone}     \usepackage{tikz}     \usetikzlibrary{calc,3d}     \begin{document}     %%%%%%%%%%%%%%%%%     \begin{tikzpicture}     [x={(-0.6cm,-0.4cm)}, y={(1cm,0cm)}, z={(0cm,1cm)}, scale=1.0]     \def\sizeX{12}     \def\sizeY{12}     \def\sizeZ{5}     %                       Рисуем пласт                       %     \begin{scope}[dashed, line width=1.5pt]     \coordinate (p1) at (0,0,0);     \coordinate (p2) at (0,0,\sizeZ);     \coordinate (p3) at (0,\sizeY,\sizeZ);     \coordinate (p4) at (0,\sizeY,0);     %     \coordinate (pp1) at (\sizeX,0,0);     \coordinate (pp2) at (\sizeX,0,\sizeZ);     \coordinate (pp3) at (\sizeX,\sizeY,\sizeZ);     \coordinate (pp4) at (\sizeX,\sizeY,0);          \draw (p1) -- (p2) --  (p3) -- (p4) -- (p1) (pp1) --  (pp2) -- (pp3) -- (pp4) -- (pp1) (p1) -- (pp1) (p2) -- (pp2) (p3) -- (pp3) (p4) -- (pp4);     \end{scope}     %                Рисуем трупопровод                %     \begin{scope}[blue, line width=2.5pt]     \coordinate (b1) at ($(p2)!.5!(p3) + (0,0,1)$);     \coordinate (b2) at ($(b1) + (5,0,0)$);     \coordinate (b3) at ($(b2) + (0,-2,0)$);%скв     \coordinate (b4) at ($(b2) + (4,0,0)$);     \coordinate (b5) at ($(b4) + (0,2,0)$);%скв     \coordinate (b6) at ($(b4) + (3,0,0)$);%скв     \fill[black] (b1) circle (4pt);     \draw (b1) -- (b2) (b2) -- (b3) (b2) -- (b4) (b4) -- (b5) (b4) -- (b6);     \end{scope}     %                Рисуем скважины                %     \begin{scope}[line width=2.5pt]     \coordinate (z1) at ($(b3) + (0,0,-3)$);     \coordinate (z2) at ($(b5) + (0,0,-3)$);     \coordinate (z3) at ($(b6) + (0,0,-3)$);     \draw (b3) -- (z1) (b5) -- (z2) (b6) -- (z3);     \end{scope}     %           Рисуем контуры влияния         %     \begin{scope}     \clip (z1) circle (4);     \fill[red] (z2) circle (2.5);     \end{scope}     \begin{scope}     \clip (z2) circle (2.5);     \fill[red] (z3) circle (3);     \end{scope}     \begin{scope}[dashed, line width=1pt]     \draw (z1) circle (4);     \draw (z2) circle (2.5);     \draw (z3) circle (3);     \end{scope}     \end{tikzpicture}     %%%%%%%%%%%%%%%%%     \end{document}      ![enter image description here](http://i.stack.imgur.com/tIGcg.png) How to get the coordinates x,y,z from 3D points? How to move the shape to the front? How to get a point on the circle?


title: Manually setting the total number of points in the exam document class

text: I am writing an exam using the exam document class. In the exam you only need to answer 10 out of 12 questions (10 points each question). When I create the grade table with the command `\gradetable`, the total number of points is 120. How can I manually set the total number of points to 100?


title: Scale an image where both width & height are off limits

text: When using images bigger than the text-area, I want to scale them but considering at the same time width and height. The problem happens to appear when **both width and height are off limits.** Here, I have to determine which one is the bigger, and then scale it, so the process will affect the other one too, and the image will be perfectly fitted in the text-area. I've tried several ways to solve this. For example: (I'm using the `calc` package)               \makeatletter     \def\ScaleThisP{%         \ifdim\Gin@nat@width>\Gin@nat@height             \ifdim\Gin@nat@width>\textwidth                 \textwidth             \else                 \Gin@nat@width             \fi         \else             \ifdim\Gin@nat@height>\textheight                 \Gin@nat@width/{\Gin@nat@height/{\textheight}}             \else                 \Gin@nat@height             \fi         \fi     }     \makeatother          ...          \includegraphics[width=\ScaleThisP]{myfig.jpg}      The result (always considering width and height bigger than text-area) are:   * Case 1 : width > height | Works properly!   * Case 2 : height > width | It doesn't show anything. No images included at all! If you notice, I'm using width to scale because, if I use the scale attribute in `\includegraphics`, it gives an error. I've tried many other ways, but no one gives me the result I want. I think the problem is the line where I perform the calculation:               \Gin@nat@width/{\Gin@nat@height/{\textheight}}      If I replace that with, for example,               .5\textwidth      it shows reduced images maintaining the aspect ratio (so, I know it works... somewhat). Can anyone help me resolve this problem. I don't know what else to do, maybe use the `xifthen` package?


title: Is there any good XY plot tools using latex

text: > **Possible Duplicate:**   >  Comparison of plotting packages? Let us say I have x-axis data and the corresponding y-axis data. I was wondering if latex had any graphing abilities. I might want to put axis labels, put some title. Some times, there will be multiple y-axis data, as I might be comparing functions for same x-axis values. In that case, I will need to label each function curve with different marker (symbol). Any graphical tool which does this is more than welcome but I don't mind taking the extra effort of learning some latex library if thats what it takes ( I learned tikz for drawing pictures, and I find it amazing!!). Between, matlab does a good job for me now. But, I would like to get that "everything in my hands" feel when one uses latex to create docs.


title: Footnote in minipage wit newtxtext misses mark

text: With the `newtxtext` LaTeX package, footnotes inside a minipage miss the mark.               \documentclass{article}          \usepackage[papersize={6cm,4cm},margin={2mm,2mm}]{geometry}     \usepackage{newtxtext}          \begin{document}          This a paragraph\footnote{A footnote inside a paragraph} with a     footnote.          \vfil          \framebox{     \begin{minipage}[b]{4cm}       This a minipage\footnote{A footnote inside a minipage} with a       footnote.     \end{minipage}     }          \end{document}      ![output](http://i.stack.imgur.com/OFq8k.png) This seems to happen only when the `newtxtext` package is used. How to fix this?


title: exceltex dependencies in latexmk

text: I'm working on getting exceltex and `latexmk` communicating by adding custom dependencies to `.latexmkrc`. As far as I understand, `exceltex` works by writing an entry for each `\inctab`/`inccell` command to an `excltx` file upon compilation, and the using the `Perl` script `Spreadsheet::ParseExcel` to extract information from the `.xls` file. The manual routine: `latexmk`, `exceltex`, `latexmk`, and it works. So I believe I need the following dependency relations:   1. `excltex` and `xls`: if the `xls` file is changed, `exceltex` is invoked.    2. `excltex` and `tex`: if the `tex` file with `\inccell`/`\inctab` calls changes, `exceltex` is invoked.  As I have understood, `latexmk` doesn't handle multiple files in one dependency, so I first focused on getting #2 working. I have tried:               add_cus_dep('excltx', 'tex', 0, 'excel2tex');         sub excel2tex {             system("exceltex \"$_[0].tex\"") ;         }      which makes `latexmk` generate the following output:               For rule 'cusdep excltx tex test', running '&do_cusdep(  )' ...     Latexmk: Possible misconfiguration or bug:       In trying to apply custom-dependency rule       to make 'test.tex' from 'test.excltx'       the function name is blank.      My intention is that the dependency will trigger `exceltex file.tex`. Why doesn't this happen? How can I change my dependency such that it will run `exceltex`? Follow up: Assuming the above dependency works (which it does after commenting out all other dependencies in `.latexmkrc`, running `latexmk` and uncommenting the pacified dependencies), how can I make `latexmk` run `exceltex` when the `xls` file is changed? I have tried with               add_cus_dep('tex', 'xls', 0, 'excel2tex');      and               add_cus_dep('excltx', 'xls', 0, 'excel2tex');       (and both, for good measure). It works if I force a complete recompilation. With a normal compilation, where the content of the `tex` document is untouched but the `xls` file is changed, `latexmk` refuses to notice a change in just the `xls` file.


title: Reduce source code of different tcolorbox macros

text: in my book I have a lot of tcolorboxes to use. They are slightly different so I added a macro that decides depending on the arguments, which tcolorbox to draw. Obviously that produces a LOT of source code (one command per tcolorbox). So I tried to reduce it but it doesn't work properly.               \documentclass{article}          \usepackage[many]{tcolorbox}     \usepackage{calc}     \usetikzlibrary{calc}          \definecolor{mp}{RGB}{240,240,240} % Farbe für + -          \newlength{\bs}\setlength{\bs}{30pt} % Basislänge        \newlength{\ns}          \newcommand{\iround}{                     interior titled code={                         \fill[mp,rounded corners=15pt]                             ([xshift=-1pt,yshift=-10pt]interior.west)                             rectangle                             ([xshift=\ns,yshift=3pt]title.north west);                          \draw[rounded corners=15pt,color=mp, line width=1pt,fill=white]                             (frame.south west) --                              (title.south west) --                              (title.south east) --                             (frame.south east) -- cycle;}     }          \newcommand{\ibs}[3]{\scantokens{%             \setlength{\ns}{\widthof{#1}+\bs}                 \begin{tcolorbox}[                        arc=15pt,                     outer arc=15pt,                     title=#1,                     coltitle=black,                     enhanced,                     freelance,                     frame code={},                     \iround                 ]                 \raggedright #2                 \end{tcolorbox}}}               \begin{document}          \ibs{title}{A}{B}          \end{document}


I am using a template for a conference and everything is OK, except for the "Keywords", This is strange, it didn't occur to me before. Usually I don't use a specific package for keywords. and the code is as: `\begin{keywords} one, two, three, four \end{keywords}`. However, at this time the error is like below: `LaTeX Error: Environment keywords undefined` I would be so glad if you help me with this problem. Mohammad.


title: French characters applemac not working

text: I'm completely new here, and trying LaTeX to write my PhD dissertation (in the humanities, mind you!). I have to write in several languages, and especially French. It is therefore much easier to type the French characters directly on the keyboard. I have a mac with OS 10.8.5. I used the tip given here on the Tex stack exchange (\usepackage[applemac]{inputenc}) and it worked really fine. But, now it suddenly does not work any more without me touching anything when I run it in PDF. I set the following in my configuration:               \usepackage[applemac]{inputenc}                       \usepackage{etoolbox}     \usepackage{fontspec}      \usepackage{polyglossia}                  \setdefaultlanguage[british,ordinalmonthday=true]{english}      \setotherlanguage[spelling=old,latesthyphen=true,babelshorthands=true]{german}      \setotherlanguage{french}      \setotherlanguage{italian}      \usepackage{xspace}          \usepackage[style=british,autostyle=true,strict=true,english=british,autopunct=true,parthreshold=true,german=guillemets]{csquotes}     \setquotestyle{british}     \SetBlockThreshold{3}


title: Quotchap editing space

text: I am using the quotchap package and was wondering how to set the height smaller for the quote. As example if you don't have any quote at all or just a short one it could be less high. Unfortunately I couldn't find the proper solution in the read me pdf of the package just that it is usually about 10cm which they reserve for the quote.


title: Prevent oval loops when using Tikz package

text: I'm just starting to learn LaTex, escpecially graphics, and this is my (simplified) code:               \documentclass{article}          \usepackage{tikz}     \usetikzlibrary{automata,positioning}     \begin{document}     \tikzset{every loop/.style={in=30,out=160,looseness=5}}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,bend angle=80]         \tikzstyle{place}=[circle,thick,draw=blue!75,fill=blue!20,minimum                                 size=6mm]             \node[state,initial] (s_0)   {$s_0$};              \path[->]         (s_0) edge [loop above] node {x} ();          \end{tikzpicture}     \end{document}      As you can see, the loops are somewhat oval: ![Current version](http://i.stack.imgur.com/z8oBI.png)![Current version incl. lines](http://i.stack.imgur.com/BdDVL.png) I want the blue lines to be of equal length (second picture). I found a very impressive solution here, but I do not need text within the arc. So my question: is there any easier trick?


title: Caption on side of page

text: I have a image that I want to include in my thesis. It's long, so I have to rotate it, however when I do this the caption remains at the bottom of the page. How can I make the caption go to the side of the page, so it's under the image still?


title: \centering breaks fragile command (is there a fix?)

text: Many on this site know (and perhaps find slightly annoying) that I will try to solve any LaTeX problem with the use of my `stackengine` package. My motto is like one of the overnight delivery services: "if it stacks, we ship it". I found an odd problem in one of my parsing routines from that package, and I know it very much relates to the topic or robustness (which I kind of understand in theory, but certainly don't know enough to overcome). What I found surprising is that this particular problem only arises after an invocation of `\centering` which I found quite odd and unexpected. I've boiled the problem down to this MWE. Here, `\@readMANYrows` will take an argument consisting of multi-row data, each row separated by a "end-of-line" (EOL) character, and parse it into individual row data. The `stackengine` package, for historical reasons, defaults this EOL character to a space, but has a package option to make the EOL a `\\\` to be more in line with what LaTeX users might expect (I realize `\\\` is a macro, not a character, and that perhaps is the root of this problem). When the EOL is set to `\\\`, everything works fine. If `\centering` is invoked, however, the routine will only work if the EOL is something other than `\\\`. Finally, if I make `\protect\\\` the EOL, everything works again even when centering, but that last syntax is really a nuisance and for academic interest only. So my question is two-fold: I am curious how it is that `\centering` undermines the parsing routine (it is not as if `\centering` is an argument to my routine... it is not)?; AND, is there an easy way to make the parsing routine robust without, for example, rewriting it in LaTeX3, as egreg did at Parsing rows (`\\`) and tab characters (`&`)? I would only add, as a postscript, that `\usepackage{fixltx2e}` does not resolve this problem.               \documentclass{article}     \usepackage{ifthen}     \newcounter{ROWcellindex@}     \makeatletter     \newcommand\setstackEOL[1]{%       \ifthenelse{\equal{#1}{}}{\def\SEP@char{ }}{\def\SEP@char{#1}}%       \expandafter\define@processROW\expandafter{\SEP@char}%     }          \newcommand\define@processROW[1]{%         \def\@processROW##1#1##2||{%           \protected@edef\@preSEP{##1}%           \protected@edef\@postSEP{##2}%         }%     }          % FOR PROCESSING A GROUP OF STACK ROWS SEPARATED BY \SEP@char     \newcommand\@readMANYrows[1]{%       \def\@doneROWreads{F}%       \def\@postSEP{#1\SEP@char}%       \setcounter{ROWcellindex@}{0}%       \whiledo{\equal{\@doneROWreads}{F}}{%         \stepcounter{ROWcellindex@}%         \expandafter\@processROW\@postSEP||%         \ifthenelse{\equal{\@postSEP}{}}{%           \def\@doneROWreads{T}%         }{}%         \ifthenelse{\equal{\SEP@char}{ }}%           {\def\@preSEPtemp{\@preSEP}}%           {\def\@preSEPtemp{\ignorespaces\@preSEP\unskip}}%         \expandafter\protected@edef\csname arg\roman{ROWcellindex@}\endcsname{%           \@preSEPtemp}%       }%     % \narg GIVES HOW MANY ROWS WERE PROCESSED       \xdef\narg{\arabic{ROWcellindex@}}%     }     \begin{document}          % OK IF NO CENTERING     \setstackEOL{\\}     \@readMANYrows{a \\ b \\ c}     \argi, \argii, \argiii\\          % OK IF DIFFERENT EOL CHARACTER     \centering     \setstackEOL{$}     \@readMANYrows{d $ e $ f}     \argi, \argii, \argiii\\          % BREAKS! \\ NOT ROBUST     %\centering     %\setstackEOL{\\}     %\@readMANYrows{g \\ h \\ i}     %\argi, \argii, \argiii\\          % PROTECTING \\ WORKS, BUT IS A NUISANCE TO USE     \centering     \setstackEOL{\protect\\}     \@readMANYrows{j \protect\\ k \protect\\ l}     \argi, \argii, \argiii\\          \end{document}


title: tocloft package interfering with ToC page style?

text: I use the trick from How to get header and footer over ToC, LoF and Nomeclature? to ensure that all pages[1] (including the 1st page of the Table of Contents) have headers and footers:               \tableofcontents\thispagestyle{fancy}      That works fine. However, I then use the trick from TOC Text - numbers alignment to widen the space reserved for section numbers (so that section "10.10" doesn't cause overlapping text)               \usepackage{tocloft}     \setlength{\cftsubsecnumwidth}{3em}      Adding the tocloft command seems to reverse the 'fancy page style' command, so that the ToC no longer has headers and footers. Do these commands need to be in some specific order to work correctly? Alternatively, is there some other (non-tocloft) way to fix ToC numbers and text that overlap? [1] Actually, we want the title page to not have header/footer, so can't just redefine `\fancypagestyle{plain}` like in Header and Footer on multipage listoffigures


title: Reduce vertical space before part title in ToC

text: How do I reduce the vertical space before a part title in the ToC? Here is what I have that's related to headers and their ToC entries (I think):               \documentclass{article}          \usepackage{titletoc}          \makeatletter     \def\@part[#1]#2{%         \ifnum \c@secnumdepth >\m@ne           \refstepcounter{part}%           \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%         \else           \addcontentsline{toc}{part}{#1}%         \fi         {\parindent \z@          \interlinepenalty \@M          \normalfont          \ifnum \c@secnumdepth >\m@ne            \Large\bfseries\hfil\partname~\thepart\hfil            \par\nobreak          \fi          \huge\bfseries\sffamily\raggedleft #2%          \markboth{}{}\par}%         \nobreak         \vskip 3ex         \@afterheading}     \makeatother          \makeatletter       \@addtoreset{section}{part}       \@addtoreset{subsection}{section}       \@addtoreset{subsubsection}{subsection}     \makeatother     \titlecontents{section}[1.8em]{}{\contentslabel{1.8em}}{\hspace*{0em}}{\titlerule*[1pc]{.}\contentspage}     \titlecontents{subsection}[4.65em]{}{\contentslabel{2.85em}}{\hspace*{0em}}{\titlerule*[1pc]{.}\contentspage}     \titlecontents{subsubsection}[8.35em]{}{\contentslabel{3.75em}}{\hspace*{0em}}{\titlerule*[1pc]{.}\contentspage}          \renewcommand*\thepart{\arabic{part}}     \renewcommand*\thesection{\thepart.\arabic{section}}               \begin{document}          \tableofcontents     \newpage          \part{sxsafawf}     \section{sasrvth}          \part{sxsafawf}     \section{sasrvth}          \end{document}      ![output](http://i.stack.imgur.com/kEl8w.jpg)


title: Umlaut appears on unwanted position

text: I am using the following imports to be able to write German umlauts.               \usepackage[utf8]{inputenc}      \usepackage[ngerman]{babel}      This works just fine, but I am having trouble writing the following sentence: > ...bezüglich "Verbrauch von Zufall" analysieren. The output is the following, as you can write the umlaut ä using "a > bezüglich ”Verbrauch von Zufallänalysieren. Does anyone have a suggestion on how to solve this? I installed texlive on Ubuntu and I'm using LaTeXila. Thanks for help.


title: How can I create an angled grid in a 2D PGFPlots plot?

text: Is it possible to make PGFPlots display 45° height lines in an axis? Basically, what I am looking for is a grid defined by y=-x + k*1000, k being a natural number. My numbers are rather large, e.g. y is between 54,000 and 59,000 and x between 0 and 5000 for one of my plots, which causes `dimension too large` errors when employing Jake's solution. Is there a way to achieve this without plotting the grid lines as functions? The respective plot is axis equal.


title: Last bibitem in beamerpost bibliography has strange spacing

text: I'm making an academic poster using the beamerposter package in LaTeX. The poster has a bibliography. The final entry in the bibliography block puts large vertical spaces between each line of the entry. Example: this code:               \begin{block}{Bibliography}     \begin{thebibliography}{1}         {\scriptsize \bibitem{keyname1}           Author1, Author2 and Author3, {\em A long long long long long long long long long long title.}, Some Journal, Some Year}         {\scriptsize \bibitem{keyname2}           Author1, Author2 and Author3, {\em A long long long long long long long long long long title.}, Some Journal, Some Year}         {\scriptsize \bibitem{keyname3}           Author1, Author2 and Author3, {\em A long long long long long long long long long long title.}, Some Journal, Some Year}         {\scriptsize \bibitem{keyname4}           Author1, Author2 and Author3, {\em A long long long long long long long long long long title.}, Some Journal, Some Year}     \end{thebibliography}     \end{block}      Produces: ![bib example](http://i.stack.imgur.com/LlB4Y.png) In practice, this happens independent of which references I put last, and of the way the reference is formatted (i.e. the length can come from things other than the title). It also doesn't matter where in the document I put the bibliography block.


title: \pagestyle does not work as expected

text: I'm using the `fancyhdr` package and I have defined headers & footers for the `fancy` page style using the `fancypagestyle` command. I have also defined a new page style, `tocstyle`, using the same command. Defined in this order:               \pagestyle{fancy}{%         \def\footnotelayout{\color{darkgrey}}         \renewcommand{\chaptermark}[1]{\markboth{#1}{}} % To change from all CAPS          \renewcommand{\sectionmark}[1]{\markright{#1}{}} % to normal case         \fancyhf{}         \fancyhead[RO]{\thechapter\ | \leftmark}         \fancyhead[RE]{\textcolor{darkgrey}{Group 7}}         \fancyhead[LO]{\textcolor{darkgrey}{P2 Report - CPR Teacher}}         \fancyhead[LE]{\thesection\ | \rightmark}         \fancyfoot[RE]{\footnotesize{\thepage\ \textsl{of} \pageref{LastPage}}}         \fancyfoot[LO]{\footnotesize{\thepage\ \textsl{of} \pageref{LastPage}}}     }          \fancypagestyle{tocstyle}{%         \fancyhf{}         \renewcommand{\headrulewidth}{0pt}         \fancyfoot[RE]{\footnotesize{\thepage}}         \fancyfoot[LO]{\footnotesize{\thepage}}     }      In the main .tex file I use the `tocstyle` for the `ToC` and then I change to `fancy`, but instead of applying the `fancy` style it looks like it has the `empty` style, the pages are completely empty.               \documentclass[a4paper,11pt,titlepage,twoside,parskip=half-,bibliography=totoc]{scrreprt}         \begin{document}             \pagestyle{tocstyle}             \tableofcontents             \clearpage             \pagestyle{fancy}                  \include{baForeword}             \include{bIntroduction}             ...         \end{document}


title: ignoring chapter easily

text: When working on a book I'd like to "ignore"(not compile) all chapters but the current one. I know there are methods to use like include and such BUT I do not want to use external files or some complex method. I simply want to use `\iffalse` and `fi`(or something similar) BUT I want it transparent: e.g.,               \ignorechapters{3,4} % <- Ignores all chapters **BUT** 3,4      and that is all that is needed so that only chapters 3 and 4 show up in the pdf. So what is needed to do this? I imagine each `\chapter` macro will need to be modified in a robust way so that it will conditionally include the chapter or not e.g., normally one has               \chapter[mc]{my chapter}     ....     \chapter[mc2]{my chapter 2}     ....     \chapter[mc3]{my chapter 3}      and I do this manually:               \chapter[mc]{my chapter}     \iffalse     ....     \fi     \chapter[mc2]{my chapter 2}     \iffalse     ....     \fi     \chapter[mc3]{my chapter 3}      and as you can see, it each `\iffalse` and `\fi` could easily be consumed into the `\chapter` macro without causing problems and done so transparently. (Assuming we can modify `\chapter` easily and not break it's original functionality) --- Edit pseudo-code               newchapter macro     if previous chapter ignored  % Obviously if previous chapter doesn't exist this should be ignored        insert `\fi`     end     if chapter ignored        insert `\iffalse`     end        insert `chapter data`     end macro      Hence the the newchapter macro will insert a `\fi` then an `\iffalse` into the stream if necessary. We would also have to override the `\end{document}` to insert the final `\fi` if necessary(if the last chapter is to be ignored(which means it has an `\iffalse` and requires a `\fi`).


title: Page border coloured

text: How to create a coloured page border for a document using KOMA-Script `scrbook` class? Something like this: ![enter image description here](http://i.stack.imgur.com/noA8y.png) (image taken from the `memoir` tutorial)


title: Vertical node spacing

text: Ok. I'm trying to make the left look like the right. I'm kinda lost here. Suggestions? ![tikz](http://i.stack.imgur.com/TVhJX.png) ![word](http://i.stack.imgur.com/qreis.png)               \documentclass{article}          \usepackage{tikz}     \usepackage[margin=0.5in]{geometry}     \pagestyle{empty}          \begin{document}          %\input{../tikz-setup.tex}     \usetikzlibrary{shapes, arrows, calc, positioning, matrix }          % Define block styles     \tikzstyle{line}    = [ draw, -triangle 45 ]          \tikzstyle{list}  = [ rectangle, draw,                             minimum width = 6em                                                 ]          \tikzstyle{ptr-box}  = [ rectangle,                              text width = 8em                                                 ]          \begin{center}     \begin{tikzpicture}[align = flush center, font = \small]     % Place nodes         \matrix [matrix of nodes, row sep = 0em] (age)         {             |[list] (free)| Free Page \\             |[list] (free2)| Free Page \\             |[list] (pg6)| Page 6 \\             |[list] (pg12)| Page 12 \\         |[list] (pg4)| Page 4 \\         |[list] (pg8)| Page 8 \\         };              \matrix [matrix of nodes, row sep = 0em,                       left = of age,                       nodes={text width=6em},                      matrix anchor = north east,                      ] (ptr) at (age.north west)         {             |[ptr-box, ] (oldest)| \textbf{oldest\_ptr} \\ \tiny{Points to pool of free pages.}  \\         |[ptr-box] (oldest-valid)| \textbf{oldest\_valid\_ptr} \\ \tiny{Points to oldest vaild cache page, else NULL if cache is empty.}  \\         |[ptr-box] (newest)|\textbf{newest\_ptr} \\ \tiny{Points to newest vaild cache page.}  \\         };                         % Draw edges         \path [line] (oldest) -- (free);         \path [line] (oldest-valid) -- (pg6);         \path [line] (newest) -- (pg8);               \end{tikzpicture}     \end{center}     \end{document}


title: How to scale Tikz drawings and text together?

text: I'm trying to build a diagram (a logo, actually) that I can scale easily through a parameter. I'd like to be able to scale both drawing and fonts through a single parameter. Here's my current MWE, which I hope will illustrate my difficulties:               \documentclass{standalone}     \usepackage{tikz}     \usepackage{fontspec}     \begin{document}     \begin{tikzpicture}[scale=1.0]     \node [draw=black] at (0,0)     {\fontspec[Scale=2.0]{Bookman Old Style Bold}B};      \node [draw=none] at (0,-0.5)     {\fontspec[Scale=1.0]{Bookman Old Style} This is a B};      \end{tikzpicture}     ~     \begin{tikzpicture}[scale=2.0]     \node [draw=black] at (0,0)     {\fontspec[Scale=4.0]{Bookman Old Style Bold}B};      \node [draw=none] at (0,-0.5)     {\fontspec[Scale=2.0]{Bookman Old Style} This is a B};      \end{tikzpicture}     \end{document}      which gives me this: ![two sizes of logo](http://i.stack.imgur.com/Q5phb.png) I have two problems:   1. How can I derive the scale=1/2/4s from a single parameter?   2. Why is there proportionally less space between the box and the dot on the "i" of "is". * * * Update: Thank you all for the answers and comments so far. The consensual approach seems to be "transform everything", which I am happy with, although it seems to me to be (somewhat) a second-best solution. Why? Well, as I understand it, scaling fonts isn't strictly linear point-by point. In other words, I believe that a 10pt font scaled by x2 is _not_ the same as the same font at 20pt. As well as this, global scaling will also scale the line thicknesses; this may well limit just how far I can scale up or down. Clearly I was assuming that fontspec scale= does a proper "font upsizing". Otherwise my code is just as "second-best" as everyone else's. I'll leave things alone for a bit more time, then accept and vote on the answers. BTW, for those who don't have the font family installed, that's not an important part of the question. "Any font will do, except Comic Sans".


title: Beamer - Using \pause within lstlisting

text: I am preparing a `beamer` presentation and using the `lstlisting` environment in order to put in code. However, I would like to use the `\pause` command within `lstlisting`. By definition that is not possible. I am numbering the lines so it is bad if I just end and begin the environment again in order to insert `\pause`. Any tips?


title: How to store the definition of an environment? Or, how to disable locally an environment?

text: ## what? I would like to "store" the definition of the environment `figure` into `\something` so that the following logics will work:               % the following line is what I am looking for     store(figure, \something)     % and then I want to achieve what follows          \renewenvironment{figure}{}{}     {}          \doalotofstuff          \renewenvironment{figure}     {get_the_initial_definition_from(\something)}     {get_the_final_definition_from(\something)}          % now I can again use \begin{figure}...\end{figure} with its usual definition      Is it possible and easily achievable? ## but why?! I want to disable the environment `figure` in some parts on my document and be able to get again theenvironment `figure` after. This question is related to this post (the solution does not work if the environment `figure` is active).


title: How to make the function identifier ( f(x) ) more dominant?

text: When a function has a rather complex set of parameters, the function identifier (usually simply _f_ ), gets dwarfed by the parentheses and the parameters inside of them: ![function identifiers](http://i.stack.imgur.com/PI7iJ.png) As you can see in the red circle, the _"f"_ looks more like a factor, than the function name. The way how the function is displayed in the blue circle is fine. I used the same code, basically, for both function names (simplified code):               \( f\left(\xi_{n,j}\right) \)      and               \( f(x) \)      Now, is there a way how to make the function identifier more "prominent", so it does not look like a factor to a parenthesis, but something _more important_ I guess?


title: What does "restricted \write18 enabled" mean and why does TexLive keep reporting it?

text: I've installed a backported version of TL2012 on Ubuntu 12.04, and every time I start pdftex, xetex, luatex, pdflatex, xelatex, or lualatex, I get the statement `restricted \write18 enabled. entering extended mode`. I don't recall seeing this in Miktex so I wonder whether I did something wrong during the installation. Interestingly, I don't get the message when I run `tex`. First of all, what does it mean? Second, is it a normal message for Tex Live (2012)? Finally, if it is an error, how can I fix it?


title: difference between \vspace and \vspace* for negative arguments

text: Is there ever a difference between `\vspace{...}` and `\vspace*{...}` if a _negative_ argument is supplied? Most importantly, does the choice of which macro to use have an influence on page breaking behavior?


title: How can I automatically abbreviate page ranges in citations (biblatex)

text: I am using `biblatex` for my citations, and I was wondering if there was a way to automatically abbreviate the page ranges in citations. (The reason I ask is because I have them all in long-style, and I need to change about 200 citations). So what I want is:               \cite[111-119]{book1}      to give me:               Author1, Title1, pp. 111-9      Is this possible in `biblatex`?


title: Is there a \foreach function that works in the preamble?

text: Tikz/PGF has an extremely useful implementation of \foreach, which allows for instance the construction               \foreach \x / \y in {1/a,2/b,3/c,4/d} {\x is a lot like \y}      in which you can iterate over a pair of lists. This command only works within a tikz environment, so in particular doesn't work in the preamble, where I want to use it for defining a huge number of very similar looking macros, with say `\newcommand{\task\x}{\function\y}`; (really I'm defining new shapes in tikz, each of which is fifty or more lines of code, so just repeating it all a few hundred times is genuinely impractical). Is there a function in tex that will easily do something similar? I am aware that I could hack together this functionality using ForArray functions or nested forloops, but the results seemed like they would be comparatively inelegant, and I hoped someone here might have a clean approach (or a clean implementation using arrays or loops).


title: While loops in TikZ?

text: Is it possible to have `while` loops in TikZ, or some equivalent loop which only terminates after a certain condition?


title: Rubber with etex package

text: I am using `rubber` to compile my documents. In some of them (usually Beamer presentations), I use the `etex` package. In such a case, `rubber` aims to use as the command `elatex` to invoke the `e-TeX` engine for the compilation. But there is no such `elatex` command, so it does not work! As mentioned in a bug report on Launchpad, a solution is to invoke `rubber` with the options `-d` (for PDF) and `-e 'set program pdflatex'` to force using the command `pdflatex` instead of `elatex`.¹ What is the problem then? Well, I'd like to invoke `rubber` simply with `rubber -d foo.tex` for instance. A solution for avoiding command-line options is the use of _directives_ , adding lines in the source such as:               % rubber: set program pdftex      But these directives seem to correspond to the `-c` option, that is they are given to `rubber` before it analyzes the sources. Therefore, it does not work in my case since after I tell it to use `pdftex`, it will read the line               \usepackage{etex}      and switch to `e-TeX`. (At least, it is how I interpret the behavior — I may well be wrong!) **My question:** Is it possible to _really_ force `rubber` to use some specific engine, with some directive in the source? Or (more or less equivalently) is it possible to give a directive in the source corresponding to a `-e` option instead of a `-c` option? **A comment:** I am aware that the _right_ solution would be to remove the bug in `rubber`, but since it does not seem to be maintained anymore, I am interested in a _pure`rubber` solution_ if it exists! ¹ The `-e` option allows to set so-called _variables_ after analysis of the sources, so that even though `rubber` has noticed the `etex` package, we can force it to use `pdftex`.


title: Declaring an arrow for chemical equilibrium (steady-state arrow)

text: I tried to create an steady state arrow with `pgfarrowsdeclare` and `pgfsetinnerlinewidth` which seems to have no effect, when placed in the arrow declaration. So the following code shows my solution, which is not handy at all.                \documentclass[border=5mm]{standalone}         \usepackage{tikz}              \begin{document}         \newdimen\arrowsize         \pgfarrowsdeclare{mya}{mya}{% next two lines do not work as expected.          %   \pgfsetinnerlinewidth{3pt} %no effect here         %   \pgfsetlinewidth{5pt} % works but spreads over every line in the file         \arrowsize=0.2pt \advance\arrowsize by .5\pgflinewidth %     \pgfarrowsleftextend{-4\arrowsize-.5\pgflinewidth} %         \pgfarrowsrightextend{.5\pgflinewidth}          }%          {%           \pgfsetlinewidth{1pt}           \pgfsetdash{}{0pt} % do not dash            \pgfsetroundjoin % fix join            \pgfsetroundcap   % fix cap       \pgfpathmoveto{\pgfpoint{-10pt}{12pt}} \pgfpatharc{180}{270}{10pt} %       \pgfusepathqstroke%      }          \begin{tikzpicture}       \node  (n1) at (0,0) {Node1};       \node(n2)at (0,2) {Node2} ;       \node(n3)at (0,4) {Node3} ;     %The following code produces correct output       {\pgfsetinnerlinewidth{3pt} %wont stay local        \pgfsetlinewidth{5pt} % seems to stay local        \draw[mya-mya] (n1)--(n2); }        \pgfsetlinewidth{1pt}        \draw (n2)--(n3);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/l5qpD.png) Is there a way to tell pgf to make an arrow double lined without setting `hlinewidth` and `innerlinewidth` manually? In the arrow declaration maybe? PS I took a short look into the chemfig package and it seems to me that Christian uses several separated paths to construct a double arrow. Maybe that's easier so I will consider that in further approaches. Edit: Here´s the output produced by               \documentclass[border=5mm]{standalone}           \usepackage{tikz}                \begin{document}             \newdimen\arrowsize             \pgfarrowsdeclare{mya}{mya}{% next two lines do not work as    expected.                     \pgfsetinnerlinewidth{4pt} %does sth strange                    \pgfsetlinewidth{5pt} % works but spreads over every          %line in the file                 \arrowsize=0.2pt \advance\arrowsize by .5\pgflinewidth%                 \pgfarrowsleftextend{-4\arrowsize-.5\pgflinewidth} %                 \pgfarrowsrightextend{.5\pgflinewidth}                  }%                  {%                   \pgfsetlinewidth{1pt}                   \pgfsetdash{}{0pt} % do not dash                    \pgfsetroundjoin % fix join                    \pgfsetroundcap   % fix cap                   \pgfpathmoveto{\pgfpoint{-10pt}{12pt}}\pgfpatharc{180}{270}{10pt} %                  \pgfusepathqstroke}              \begin{tikzpicture}           \node  (n1) at (0,0) {Node1};           \node(n2)at (0,2) {Node2} ;           \node(n3)at (0,4) {Node3} ;         %            \draw[mya-mya] (n1)--(n2);%             \draw (n2)--(n3);         %         \end{tikzpicture}                   \end{document}      ![enter image description here](http://i.stack.imgur.com/j8HCA.png)


title: How can I make inverse/forward PDF searching mark and navigate to the line of the code?

text: I use TeX Live 2011, WinEdt 6.0 and SumatraPDF, the inverse and forward PDF search can only mark and navigate to the paragraph, how to make them point to the line ?


title: Page upside down?

text: I have a quite wide table in my document, that I would like to display "rotated". Everything seems fine, but apparently there is some problem towards the end: when I try to print out (print to file) I get the rotated page upside down. Is there a way to solve the issue? (Latex->dvi2ps->ps2pdf->View PDF (I use Texmaker))               \documentclass[twoside,openright]{report}     \usepackage[]{rotating}     \usepackage[]{fancyhdr}          \fancyhead[RE,LO]{\fancyplain{}{\textbf{\textit{\leftmark}}}}     \fancyhead[LE,RO]{\fancyplain{}{\textbf{\thepage}}}     \fancyfoot[]{}          \pagestyle{fancyplain}          \begin{document}     Normal page.     \clearpage     \begin{sidewaystable}     \begin{tabular}{|c|c|c|c|}     \hline \textbf{Bla Bla Bla} & 01/01/2009 & 01/01/2010 & \\      \hline \textbf{Abcd efc} & Something something & Little bit longer description for something.\\      \hline      \end{tabular}      \caption{Something.}     \end{sidewaystable}     \clearpage     Another normal page.          \end{document}


title: TikZ in LyX - compiles, but acrobat says the pdf has an error

text: I'm using LyX. I'm trying to use TikZ for the first time (to draw graphs, specically - trees). The LyX code compiles and the pdf is created, but when I open the pdf, Acrobat reader says: > "An error exists on this page. Acrobat may not display this page correctly. > Please contact the person who created the PDF document to correct the > problem". The drawing does not appear in the document. Here's my LaTeX preamble:               \date{}     \usepackage{tikz}     \usepackage{pgfplots}     \usepackage[compact]{titlesec}     \titlespacing*{\section}{0pt}{*0}{0pt}     \usepackage{colortbl}     \definecolor{lightgray}{gray}{0.8}      and here's what I wrote inside the TeX box in the LyX editor:               \begin{tikzpicture}     \draw (0,0) -- (1,0);     \end{tikzpicture}      I get the same error message in acrobat even if I remove the `\draw` line and only leave the `\begin` and `\end` lines. **EDIT** : Here are links to my PDF and LyX files: > http://www.2shared.com/file/kqhal5As/example.html and > http://www.2shared.com/document/0bwz3mrn/example.html I am using LyX 2.0.0, MiKTeX 2.9, Acrobat Reader 10.1.1 (all in Windows). I am writing in Hebrew.


title: Citations in order of appearance

text: I am currently writing my thesis and using the class file provided by my university. Everything is fine and compiles well except for the citations and references. The default setting is order the references alphabetically, but I want them ordered numerically....that is in the order in which I cited the references. I have tried using               \usepackage[super,sort&compress]{natbib}      and then               \begin{document}     \bibliographystyle{unsrtnat}     \bibfiles{chap1,chap2,chap3,chap4,chap5}     \bibpunct{[}{]}{,}{s}{}{}       It does not work....I can see it modifying my references in some way. The first citation is [1] and then [2], but the third citation is [39]! I also tried `biblatex`.               \pdfoptionpdfminorversion=6     \documentclass[12pt,hyperref]{gatech-thesis}     \usepackage{amsmath,amssymb,latexsym,float,epsfig,subfigure,textcomp}     \usepackage[style=numeric-comp]{biblatex}     \bibliography{chap1,chap2,chap3,chap4,chap5,chap6}     \usepackage[]{hyperref}          \begin{document}     \printbibliography      This one gives me a Latex error "Can only be used in preamble"....I tried reordering the location of the `\usepackage[style=numeric-comp]{biblatex`} command, but I still cannot get it to work. But I did notice that a test file that I created to check `biblatex` (below) runs perfectly without any issues.               \documentclass{article}     \usepackage[style=numeric-comp]{biblatex}     \bibliography{examples}     \begin{document}     \nocite{*}     \printbibliography     \end{document}      So, I am not sure I understand why it won't work with the original class file. I would appreciate your help. I think this is further complicated by the fact that I have citations within Figure captions. `\caption{blah blah...\cite{xyz}}` This might also be responsible for the problem.


title: Writing text content as labels and refer to them with \nameref*

text: I stumbled this morning, when I tried to improve (a possible) solution answer I gave to some question. I try to write automatically generated labels (using a unique naming scheme with prefixes etc.) with text (or even mathematical content etc) to the `.aux` file and refer to it later on, using the label name, via `\nameref*` from `nameref`. The MWE below is reduced to the basic problem, I created a small command `\WriteMyLabel` doing the job. However, I can not write something like               \WriteMyLabel{\textbf{some bold text}}      LaTeX provides the very fascinating error message > \text@command #1->\def \reserved@a { #1}\ifx \reserved@a \@empty \let > \check@... How can I cope around this problem? Is it possible at all?               \documentclass[12pt]{scrartcl}     \usepackage{blindtext}%     \usepackage{xcolor}     \usepackage{etoolbox}     \usepackage{hyperref}          \newcounter{TotalLabelCounter}          %%%% A command to make the references clearer, just for debugging, not in      %%%% end production code     \newrobustcmd{\refcommand}[1]{\fbox{\textbf{\textcolor{blue}{\nameref*{#1}}}}}          \makeatletter     \newrobustcmd{\WriteMyLabel}[1]{%     \refstepcounter{TotalLabelCounter}%     \immediate\write\@auxout{%     \string\newlabel{MyLabel::\number\value{TotalLabelCounter}}{{\thesection}{\thepage}{#1}{}}     }% End of writing to AUX file     }%     \makeatother          \begin{document}          \section{First}          \WriteMyLabel{The Three Witches}          \WriteMyLabel{$E = mc^2$}          \blindtext[1]          \newpage     \section{Another section}     \blindtext[1]          \WriteMyLabel{\textbf{some bold text}}          \refcommand{MyLabel::1} from the play 'Macbeth' have a very important part, however, there are no nice formulas such as \refcommand{MyLabel::2} and      it would be better, if \refcommand{MyLabel::3} would work.          \end{document}      ![enter image description here](http://i.stack.imgur.com/Vvsd9.jpg)


title: Algorithm spanning more than one page

text: I have an algorithm which is too long to fit on one page. Someone suggested splitting the algortithm manually and then altering the second algorithm's line numbers to follow on the first. I know `\begin{algorithmic}[1]` numbers every line, whereas `\begin{algorithmic}[5]` numbers every fifth. How to I change the starting number from "1" to something else?


title: Remove date from the french style for the ConTeXt letter module

text: I'm using the ConTeXt's letter module with the `french` style but I don't want the date do appear. I tried to setup an empty list of elements to display but it didn't work,               \setupletter         [list={}]      Edit: The following version has the date. But if I change the style to `knuth` the date disappears.               \usemodule[letter][style=french]          \starttext          \setupletter       [fromname={Your Name},        fromaddress={Street\\Town},        fromphone={Phone}]          \setupletter       [list={}]          \setupletter       [subject={Subject}]          \setupletter       [toname={Addressee},        toaddress={Street\\Town}]          \startletter       [opening={Dear Reader},        closing={Sincerely,},        signature={Signature}]               \stopletter          \stoptext


title: How to line-number 1,5,10,15,20,25... in Program Listing in Lyx

text: I basically want every 5th line numbered, but would like to keep to 5,10,15,20,... as that seems intuitive to readers. So that means 1,5,10,15,... The first gap is 4, all subsequent ones are 5. Is there a way to do this? Thanks!


title: Adding supervisor to thesis

text: I am writing some thesis in Latex and I use some template. At the first page I would like to add my supervisor. In one file there is possibility to add it. There is macro like: \college{}; \author{}; \title{}, but there are no for supervisor something like: "\supervisor{}". Do you know what macro I can use to add supervisor? Thanks. I am using this template: https://drive.google.com/file/d/0BwyOySLlDTB_a3R5aFZQNzVFRG8/edit?usp=sharing There is the file "thesis-info.tex", where I can define \college{}; \author{}; \title{}, etc., but I don't know how to add supervisor...?


title: Dynamically sized brackets/parentheses for text

text: I'd like to have a large bracket that shows a relationship from one set of text to another, like this:               Nam dui ligula, fringilla a,     )     euismod sodales, sollicitudin    )     vel, wisi. Morbi auctor lorem    )  Nulla malesuada porttitor diam. Donec felis erat,      non justo. Nam lacus libero,     )  congue non, volutpat at, tincidunt tristique, libero.      pretium at, lobortis vitae,      )  Vivamus viverra fermentum felis.     ...                              )      Instead of the line of round braces `)`, I'd like to replace them with one proportional curly brace `}`. I'd like the size of the brace to change to fill the amount of vertical text on the "longer" side. Here are my ASCII abilities put-to-the-test, depicting what I'd like (where, obviously, the lines are meant to be parts of one glyph for a brace):               Nam dui ligula, fringilla a,     \     euismod sodales, sollicitudin    |     vel, wisi. Morbi auctor lorem    \  Nulla malesuada porttitor diam. Donec felis erat,      non justo. Nam lacus libero,      >  congue non, volutpat at, tincidunt tristique, libero.      pretium at, lobortis vitae,      /  Vivamus viverra fermentum felis.     ...                              |                                      /      In the degenerate case, I'd like:               Nam dui ligula, fringilla a.     } Nulla malesuada portitor diam.      As one side of the text or the other becomes larger, I'd like the brace to grow to be at least as high as the height of the taller side of text. A starting point I'm working from with the Tex is:               \documentclass[12pt]{memoir}     \usepackage{fontspec,xltxtra,xunicode}     \usepackage{lipsum}          \begin{document}     \begin{tabular}{lcr}     \parbox{0.425\textwidth}{\lipsum[2]}%         & )%         & \parbox{0.425\textwidth}{\lipsum[3]} \\     \end{tabular}     \end{document}      Obviously in the above case we end up with a small and statically sized `)` and not a proportionally sized `}`, however it's just an example of the lines I'm thinking along. In the past, I've avoided this problem by selecting a sufficiently large font for the `}`. That technique requires unnecessary "eyeballing", that I'd like to avoid. I've used braces in math mode, like this:               \begin{math}       \left[% superfluous       \parbox{0.425\textwidth}{\lipsum[2]}%       \right\}%       \parbox{0.425\textwidth}{\lipsum[3]}     \end{math}      This is the right concept, except (1) the braces are proportional to the left side; and (2) there's a superfluous left brace. I'm grateful for any thoughts & suggestions. Thank you for reading. **Edit** : Related questions:   * Adding a large brace next to a body of text   * Vertically asymmetric size variation for parentheses   * Stretchable square brackets outside math environment


title: Foreach loop between two lists

text: \documentclass{article}     \usepackage{tikz}          \def\firstlist{0,1,2}     \def\secondlist{0,1,2}          \newcommand{\testa}{      \foreach \x/\y in {\firstlist/\secondlist} {         \draw(0,\x)--(1,\y);         }     }          \newcommand{\testb}{      \foreach \x/\y in {0/0,1/1,2/2} {         \draw(0,\x)--(1,\y);         }     }     \begin{document}     \begin{tikzpicture}     \testa     \end{tikzpicture}     \end{document}      How can I make the output of the `\testa` command equal to the output of the `\testb` command?


title: Too long hyperlink can not fit on page

text: I have a problem with a too long hyperlink. This reference is one word, but it is too long and doesn't set the text width, so some part is pushed beyond the margin:               \hyperlink{label}{IS_TOO_LONG_WORD_WITHOUT_ANY_SEPARATORS...}      How to pledge hyperlink to break on a new line (similarly as when LaTeX breaks words across lines)?


title: longtable vertical column separators

text: I have a quite complex `longtable` design and I would like to add white column separators. I can add black separators using `|` but the placement of the lines does not seem ideal either. ![enter image description here](http://i.stack.imgur.com/gIuyK.png)               \documentclass{article}          \usepackage[table]{xcolor}     \usepackage{float}     \usepackage{array}     \usepackage{longtable}          \restylefloat{table}          \definecolor{Gray}{gray}{0.65}     \definecolor{Blue}{RGB}{0,176,240}     \definecolor{light-gray}{gray}{0.90}          % Margins     \topmargin=-0.45in     \evensidemargin=0in     \oddsidemargin=0in     \textwidth=6.5in     \textheight=8.5in     \headsep=0.25in           \linespread{1.1} % Line spacing          \newcommand{\specialcell}[2][c]{\begin{tabular}[#1]{@{}c@{}}#2\end{tabular}}     \newcommand\setrowfont[1]{\noalign{\gdef\rowfont{#1}}}     \gdef\rowfont{}          \makeatletter     \newcommand*{\@rowstyle}{}          \newcommand*{\rowstyle}[1]{% sets the style of the next row       \gdef\@rowstyle{#1}%       \@rowstyle\ignorespaces%     }          \newcolumntype{=}{% resets the row style       @{\zz}>{\gdef\@rowstyle{}}%     }     \makeatletter     \def\zz{%     {\let\CT@color\color\CT@row@color\leaders\vrule\hskip\linewidth}%     \kern-\linewidth}          \newcolumntype{+}{% adds the current row style to the next column       >{\@rowstyle}%     }     \newcolumntype{C}{>{\rowfont}c}          \let\oldlongtable\longtable     \let\endoldlongtable\endlongtable     \renewenvironment{longtable}{\rowcolors{2}{light-gray}{Gray}\oldlongtable} {     \endoldlongtable}          \begin{document}          \setlength\LTcapwidth{\textwidth}     \setlength\LTleft{0pt}     \setlength\LTright{0pt}     \begin{longtable}{@{\extracolsep{\fill}}=C|+C|+C@{}}     \rowcolor{Blue}      \rowstyle{\color{white}}     A & B & C \\     1 & 2 & 3 \\     4 & 5 & 6 \\     7 & 8 & 9 \\     \end{longtable}          \end{document}      Ideally I would like the table to look something like this: ![enter image description here](http://i.stack.imgur.com/OpNaF.png)


title: Tikz itemize line spacing

text: I have a diagram in `tikz` where each node contains an itemized list.               \documentclass[11pt, authoryear, 3p]{elsarticle}          \usepackage{tikz}     \usetikzlibrary{shapes,positioning,arrows}          \begin{document}          \begin{figure}     \tikzstyle{dataset} = [rectangle, draw, text width = 2in, minimum height=1in, ]     \begin{tikzpicture}[auto, font=\scriptsize]         % Place nodes         \node [dataset] (tm) {Data 1 \begin{itemize}                 \item{\# Adults } \item{\# Children} \item{Income}                  \item{Ethnicity}               \end{itemize}};         \node [dataset, right of=tm, node distance=3in] (dmv) {Data 2 \begin{itemize} \item{Data 2} \end{itemize}};         % draw links         \path [<->] (tm) edge node[above, sloped] {Address} (dmv);     \end{tikzpicture}         \caption{Analysis dataset assembly.}         \label{fig:dataset}     \end{figure}               \end{document}       ![Output](http://i.stack.imgur.com/dgMDU.png) The items are double-spaced, as the rest of the document. How can I set these nodes to be single-spaced? I have tried encasing the chunk in a `singlespaced` environment, and related questions (e.g., this one) don't seem to be precisely applicable.


title: Center in ConTeXt

text: What is the equivalent of `\begin{center}...\end{center}` in ConTeXt? I know `\raggedcenter`, but that not an environment. I could define one command, but surely there is anything like that predefined.


title: Draft mode in Tikz externalize hides graphics, but not without externalize

text: Maybe this is expected behaviour, but it's not documented in the manual, and it certainly surprised me. When you use the `draft` class option and use the `tikz` `external` library, all Tikz pictures are replaced by a box with the name of the externalized graphic. MWE:               \documentclass[draft]{article}     \usepackage{tikz}     \usetikzlibrary{external}     \tikzexternalize     \begin{document}     \begin{tikzpicture}       \draw (0,0) circle [radius=1];     \end{tikzpicture}     \end{document}      ![result with draft](http://i.stack.imgur.com/Jum7U.png) The fact that it displays the correct filename leads me to think it's the `external` library doing this, because whilst I know that `pgf` itself does a similar thing with the `draft` option, I wouldn't expect it to know the filename (and anyway, I haven't loaded `pgf` directly, and I think it only obeys `draft` when called directly.) However, commenting out the `\tikzexternalize` line gives the picture. ![Result without draft](http://i.stack.imgur.com/LYutG.png) I'm not saying that this behaviour wouldn't often be useful! However, it's not what I'd prefer in what I'm working on, and as it isn't documented I don't know what I can do about it. I can try and work around it, and not use `draft` but it's in a big document that already does several different things depending on whether `draft` is set. What are my options?


title: Beamer doesn't compile on windows using minted

text: Have the same problem than him: Beamer presentation fails to compile after TeX Live upgrade I'm on windows using miktex (texworks), compiling with --shell-escape. I have the same message:               LaTeX Warning: You have requested, on input line 406, version                `2010/12/07' of package ltxcmds,                but only version                `2010/03/09 v1.4 LaTeX kernel commands for general use (HO)'                is available.          ! Undefined control sequence.     l.542 \ltx@newglobalif                       \ifGPT@pagecolor     ?      I think I need the version of the 2010/12/07 but I can't find it. Does anybody have the solution ? Edit 28/11: I tried changing the source (pdftex) and patching by myself, but didn't succeed. Edit 29/11: Here is the log Joseph, http://pastebin.com/ELiHYKHR. I just wanted to make you remember what is written in minted documentation: "Windows support is sketchy / untested at the moment. There are two complications: installation and usage." But I'd really like to make it work, and write a tutorial about it. Edit 29/11 13h45: I removed the sty, I got this:               C:\Users\Minipada\Desktop\Cours LaTeX\Presentation>set  /p x= 0<nul: 1>>presentation_1.aex      C:\Users\Minipada\Desktop\Cours LaTeX\Presentation>set  /p x= 0<nul: 1>>presentation_1.aex      C:\Users\Minipada\Desktop\Cours LaTeX\Presentation>set  /p x= 0<nul: 1>>presentation_1.aex      file deleted     ! Package minted Error: You must have `pygmentize' installed to use this package. See the minted package documentation for explanation.     Type  H <return>  for immediate help.     ...                                                        l.80 \usepackage                 [utf8]{inputenc} % Allows accents     ?       I don't have this when I keep .sty files. Strange ...


title: Cite completion on Texmaker

text: I'm working with TexMarker on Win7. My *.bib file (I'm using biblatex) has about 30 entries, mostly `@Book`and `@Article` but also some `@ELECTRONIC`. Problem is that the `@ELECTRONIC` entries doesn't appear in TexMarkers `\cite` completion list. What can i do?


title: draw a cone with two regions

text: I have the following code for generating a cylinder               \documentclass[border=1cm]{standalone}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric,calc,decorations.pathmorphing,shapes,arrows,snakes,patterns}     \usepackage{amsmath}     \begin{document}     \begin{tikzpicture}[scale = 4, every node/.style={scale = 4}, mycyl/.style={cylinder, shape border rotate=90, draw, minimum width=1cm, aspect=0.25,anchor=south, text width=1cm, text height=.1cm}]      \node [mycyl , fill=blue, minimum height=1.6cm] (bl) at (0,0) {};     \node [mycyl , minimum height=.3cm, fill = cyan] (yell) at (0,1) { };     \foreach \y in {.6, .7, .8}{     \draw[dashed, cyan] (.619,\y+.3) arc[x radius=.619cm, y radius=.154cm, start angle=0, end angle=-180];}     \end{tikzpicture}     \end{document}      resulting in ![enter image description here](http://i.stack.imgur.com/248O1.png) I would now like to repeat this but for a conical shape. I have seen many examples of drawing conical shapes and have used one here:               \documentclass[border=2cm]{standalone}     \usepackage{tikz}     \begin{document}         \begin{tikzpicture}             \shade[top color=blue!40!white,opacity=0.75] (-1,0) arc (180:0:2cm and 0.5cm) -- (1,-4) -- cycle;             \draw [](-1,0) arc (180:360:2cm and 0.5cm) -- (1,-4) -- cycle;             \draw [](-1,0) arc (180:0:2cm and 0.5cm);         \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/wpQCM.png) However, I'm unsure of how to repeat what I've done above but for the conical shape. Specifically, I'm unsure how to draw the dashed lines and how to separate the cone into two regions. Can anyone suggest how this can be done?


title: How to use \pgftransformcm and  \inheritsavedanchors  in a new shape (batman) from an ellipse

text: I try to make this shape but I have several problem.   1. First to place the logo inside the ellipse, I used `\pgftransformcm{1}{0}{0}{1}{\centerpoint}` perhaps there is a better solution. I need to use `\pgftransformcm{-1}{0}{0}{1}{\centerpoint}` at the end because the text is inverted but with all the transformations I lost the baseline and the text is misplaced. This is the main question   2. I try to use `\inheritsavedanchors` but without success   3. To get some good results, I think it's important to keep a ratio between height and width but how do this ?   4. Perhaps the calculations are bad but I prefer to understand how I need to do before remake all the calculations. It's possible to use the ratio height/width to get better results. Here the long code, results are fine when I fixed the dimensions. ![enter image description here](http://i.stack.imgur.com/2GWyM.png)               \documentclass{article}     \usepackage{tikz,fullpage}     \usetikzlibrary{shapes}     \begin{document}     \thispagestyle{empty}      \makeatletter     \newdimen\batmanx     \newdimen\batmany             \tikzset{     shape example/.style={         color=black!30,         draw,         fill=yellow!30,         line width=.5cm,         inner xsep=2.5cm,         inner ysep=0.5cm}     }                 \pgfdeclareshape{batman}     {       \savedanchor\centerpoint{%         \pgf@x=.5\wd\pgfnodeparttextbox%         \pgf@y=.5\ht\pgfnodeparttextbox%         \advance\pgf@y by-.5\dp\pgfnodeparttextbox%       }       \savedanchor\radius{%         %          % Caculate ``height radius''         %          \pgf@y=.5\ht\pgfnodeparttextbox%         \advance\pgf@y by .5\dp\pgfnodeparttextbox%         \pgfmathsetlength\pgf@yb{\pgfkeysvalueof{/pgf/inner ysep}}%         \advance\pgf@y by\pgf@yb%         %          % Caculate ``width radius''         %          \pgf@x=.5\wd\pgfnodeparttextbox%         \pgfmathsetlength\pgf@xb{\pgfkeysvalueof{/pgf/inner xsep}}%         \advance\pgf@x by\pgf@xb%         %          % Adjust         %          \pgf@x=1.4142136\pgf@x%         \pgf@y=1.4142136\pgf@y%         %          % Adjust height, if necessary         %          \pgfmathsetlength\pgf@yc{\pgfkeysvalueof{/pgf/minimum height}}%         \ifdim\pgf@y<.5\pgf@yc%           \pgf@y=.5\pgf@yc%         \fi%         %          % Adjust width, if necessary         %          \pgfmathsetlength\pgf@xc{\pgfkeysvalueof{/pgf/minimum width}}%         \ifdim\pgf@x<.5\pgf@xc%           \pgf@x=.5\pgf@xc%         \fi%         %          % Add outer sep         %          \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%           \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%           \advance\pgf@x by\pgf@xb%         \advance\pgf@y by\pgf@yb%       }       % Anchors       \anchor{center}{\centerpoint}       \anchor{mid}{\centerpoint\pgfmathsetlength\pgf@y{.5ex}}       \anchor{base}{\centerpoint\pgf@y=0pt}       \anchor{north}       {         \pgf@process{\radius}         \pgf@ya=\pgf@y%         \pgf@process{\centerpoint}         \advance\pgf@y by\pgf@ya       }       \anchor{south}       {         \pgf@process{\radius}         \pgf@ya=\pgf@y%         \pgf@process{\centerpoint}         \advance\pgf@y by-\pgf@ya       }       \anchor{west}       {         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@process{\centerpoint}         \advance\pgf@x by-\pgf@xa       }       \anchor{mid west}       {%         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@process{\centerpoint}         \advance\pgf@x by-\pgf@xa%         \pgfmathsetlength\pgf@y{.5ex}       }       \anchor{base west}       {%         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@process{\centerpoint}         \advance\pgf@x by-\pgf@xa%         \pgf@y=0pt       }       \anchor{north west}       {         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@ya=\pgf@y%         \pgf@process{\centerpoint}         \advance\pgf@x by-0.707107\pgf@xa         \advance\pgf@y by0.707107\pgf@ya       }       \anchor{south west}       {         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@ya=\pgf@y%         \pgf@process{\centerpoint}         \advance\pgf@x by-0.707107\pgf@xa         \advance\pgf@y by-0.707107\pgf@ya       }       \anchor{east}       {%         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@process{\centerpoint}         \advance\pgf@x by\pgf@xa       }       \anchor{mid east}       {%         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@process{\centerpoint}         \advance\pgf@x by\pgf@xa%         \pgfmathsetlength\pgf@y{.5ex}       }       \anchor{base east}       {%         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@process{\centerpoint}         \advance\pgf@x by\pgf@xa%         \pgf@y=0pt       }       \anchor{north east}       {         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@ya=\pgf@y%         \pgf@process{\centerpoint}         \advance\pgf@x by0.707107\pgf@xa         \advance\pgf@y by0.707107\pgf@ya       }       \anchor{south east}       {         \pgf@process{\radius}         \pgf@xa=\pgf@x%         \pgf@ya=\pgf@y%         \pgf@process{\centerpoint}         \advance\pgf@x by0.707107\pgf@xa         \advance\pgf@y by-0.707107\pgf@ya       }       \anchorborder{         \edef\pgf@marshal{%           \noexpand\pgfpointborderellipse           {\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}           {\noexpand\radius}%         }%         \pgf@marshal%         \pgf@xa=\pgf@x%         \pgf@ya=\pgf@y%         \centerpoint%         \advance\pgf@x by\pgf@xa%         \advance\pgf@y by\pgf@ya%       }            %       % Background path       %       \backgroundpath       {         \pgf@process{\radius}%         \pgfutil@tempdima=\pgf@x%         \pgfutil@tempdimb=\pgf@y%         \pgfmathsetlength{\pgf@xb}{\pgfkeysvalueof{/pgf/outer xsep}}%           \pgfmathsetlength{\pgf@yb}{\pgfkeysvalueof{/pgf/outer ysep}}%           \advance\pgfutil@tempdima by-\pgf@xb%         \advance\pgfutil@tempdimb by-\pgf@yb%         \batmanx=\pgfutil@tempdima%         \batmany=\pgfutil@tempdimb%         \pgfpathellipse{\centerpoint}                        {\pgfqpoint{\pgfutil@tempdima}{0pt}}                        {\pgfqpoint{0pt}{\pgfutil@tempdimb}}%       \pgfsetfillopacity{.5}         \pgfsetfillcolor{yellow}       \pgfusepath{fill,stroke}          \pgfsetlinewidth{0.05\pgfutil@tempdima}%       \pgfutil@tempdima=0.90\pgfutil@tempdima%       \pgfutil@tempdimb=0.90\pgfutil@tempdimb%               \pgfpathellipse{\centerpoint}{\pgfqpoint{\pgfutil@tempdima}{0pt}}                                      {\pgfqpoint{0pt}{\pgfutil@tempdimb}}%          \pgfusepath{stroke}             \pgfsetlinewidth{0.4 pt}        \pgftransformcm{1}{0}{0}{1}{\centerpoint}               \pgfpathmoveto{\pgfpoint{0 cm}{0.66\batmany}}       \pgfpathlineto{\pgfqpoint{0.07\batmanx}{0.66\batmany}}       \pgfpathlineto{\pgfqpoint{0.14\batmanx}{0.793\batmany}}       \pgfpathcurveto{\pgfqpoint{0.17\batmanx}{0.317\batmany}}                      {\pgfqpoint{0.186\batmanx}{0.24\batmany}}                      {\pgfqpoint{0.28\batmanx}{0.24\batmany}}       \pgfpathcurveto{\pgfqpoint{0.42\batmanx}{0.24\batmany}}                      {\pgfqpoint{0.42\batmanx}{0.537\batmany}}                      {\pgfqpoint{0.28\batmanx}{0.756\batmany}}       \pgfpatharcto{0.84\batmanx}{0.80\batmany}{0}{0}{0}                    {\pgfqpoint{0.457\batmanx}{-0.683\batmany}}          \pgfpathcurveto{\pgfqpoint{0.56\batmanx}{-0.488\batmany}}                       {\pgfqpoint{0.56\batmanx}{0 cm}}                      {\pgfqpoint{0.314\batmanx}{-0.44\batmany}}        \pgfpathcurveto{\pgfqpoint{0.214\batmanx}{-0.24\batmany}}                      {\pgfqpoint{0.14\batmanx}{-0.24\batmany}}                      {\pgfqpoint{0 cm}{-0.78\batmany}}          \pgftransformcm{-1}{0}{0}{1}{\pgfpointorigin}       \pgfpathcurveto{\pgfpoint{0.14\batmanx}{-0.24\batmany}}                      {\pgfpoint{0.214\batmanx}{-0.24\batmany}}                      {\pgfpoint{0.314\batmanx}{-0.44\batmany}}        \pgfpathcurveto{\pgfpoint{0.56\batmanx}{0 cm}}                    {\pgfpoint{0.56\batmanx}{-0.488\batmany}}                     {\pgfpoint{0.457\batmanx}{-0.683\batmany}}       \pgfpatharcto{0.84\batmanx}{0.80\batmany}{0}{0}{1}                    {\pgfpoint{0.28\batmanx}{0.756\batmany}}       \pgfpathcurveto{\pgfpoint{0.42\batmanx}{0.537\batmany}}                    {\pgfpoint{0.42\batmanx}{0.24\batmany}}                    {\pgfpoint{0.28\batmanx}{0.24\batmany}}%        \pgfpathcurveto{\pgfqpoint{0.186\batmanx}{0.24\batmany}}                    {\pgfqpoint{0.17\batmanx}{0.317\batmany}}                    {\pgfqpoint{0.14\batmanx}{0.793\batmany}}        \pgfpathlineto{\pgfqpoint{0.07\batmanx}{0.66\batmany}}%         \pgfpathmoveto{\pgfpoint{0 cm}{0.66\batmany}}             \pgfsetfillopacity{1}%           \pgfsetfillcolor{black}%           \pgfusepath{fill,stroke}         \pgftransformcm{-1}{0}{0}{1}{\centerpoint}%           \pgfsetlinewidth{0.4pt}%         }     }           \Huge     \begin{tikzpicture}       \node[name=s,shape=batman,minimum height=8.2cm,minimum width=14cm] {\color{red}Batman\vrule width 1pt height 2cm};       \foreach \anchor/\placement in         {north west/above left, north/above, north east/above right,          west/left, center/above, east/right,          mid west/right, mid/above, mid east/left,          base west/left, base/below, base east/right,          south west/below left, south/below, south east/below right,          text/left, 10/right, 130/above}          \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}            node[\placement] {\color{red}\scriptsize\texttt{(s.\anchor)}};     \end{tikzpicture}          \end{document}       With the next code the results are correct                 \begin{tikzpicture}     \node[draw,shape=batman,minimum height=4.1cm,minimum width=7cm,text=white] (A) {\Large Bat me up};             \node[draw,shape=batman,minimum height=8.2cm,minimum width=14cm,text=white] (B) at ([yshift=-12cm]A) {\Huge Bat me down  };     \draw [red,ultra thick,double,->](A) --(B);       \end{tikzpicture}      and with                 \begin{tikzpicture}     \node[draw,shape=batman,text=white] (A) {\Large Bat me up};             \node[draw,shape=batman,text=white] (B) at ([yshift=-3cm]A) {\Huge  Bat me down  };     \draw [red,ultra thick,double,->](A) --(B);       \end{tikzpicture}        it's very bad (ratio text etc.)


title: How to extend the \romannumeral-based \fullyexpand to handle empty/all-space arguments?

text: In Expandable full expansion of tokens that preserves catcodes, Joseph Wright presents the following code:               \long\def\fullyexpand#1{%       \csname donothing\fullyexpandauxi{#1}{}%     }     \long\def\fullyexpandauxi#1{%       \expandafter\fullyexpandauxii\romannumeral -`0#1\fullyexpandend     }     \long\def\fullyexpandauxii#1#2\fullyexpandend#3{%       \ifx\donothing#2\donothing         \expandafter\fullyexpandend       \else         \expandafter\fullyexpandloop       \fi       {#1}{#2}{#3}%     }     \long\def\fullyexpandend#1#2#3{\endcsname#3#1}     \long\def\fullyexpandloop#1#2#3{%       \fullyexpandauxi{#2}{#3#1}%     }     \def\donothing{}      Of which he says: > I'd also note that the above code needs some guards adding for a blank > (empty or all space) argument, as currently things fail in these cases. And this is true enough, if not exactly grammatical. Unfortunately, I'm not up to scratch on my TeX, so I'm not sure how to add such guards. Any takers? (For my application, anything that will work in pdfTeX is fine.)


title: Enable parentheses bib entry with RefTeX

text: I have built my `.bib` file using parentheses, like this:               @ARTICLE(Campbell2006,     author="Campbell, K. and McKay, M.D. and Williams, B.J.",     title="Sensitivity Analysis when Model Outputs are Functions",     journal="{Reliability Engineering \& System Safety}",     volume=91,     number="10-11",     pages="1468--1472",     year=2006,     publisher="{Elsevier}")      When typing `C-c [` and then `Campb``Tab`, RefTeX correctly proposes `Campbell2006`, but on pressing `Ret`, I get the message `Sorry, no matches found`. I found that replacing the opening and closing parentheses by braces makes it work. However I suppose that it is possible to configure Emacs and RefTeX so as to spare with this reformatting. Is it?


title: overriding \section{} and stripping decorations out of LaTeX source string

text: I am trying to solve a problem that I have with Pandoc's LaTeX output ([1]; I have implemented a patch to Pandoc itself but I am also looking for a LaTeX only solution, in case the patch is not acceptable for Pandoc). Basically, I want the strings produced into TOC in rendered PDF document to be nice and not to contain artefacts caused by formatting used for the string in the document text itself: ![PIC](https://github- camo.global.ssl.fastly.net/975ecbfea9bc1e5f9201fde94480d92a4b74b311/687474703a2f2f692e696d6775722e636f6d2f4b7063696e55312e706e673f31) The `!` is a remnant of `\subsection{\lstinline!--enable-debugging!}`. I am looking for a way to override `\subsection{}` (and other `\chapter` and `\section` commands) to have the effect of `\subsection{\texorpdfstring{\lstinline!--enable-debugging!}{--enable- debugging}`. Is this possible? Second, is there a way to get from `\lstinline!--enable-debugging!` to `\--enable-debugging` using just LaTeX? IOW, is there some command that evaluates into the undecorated version of the text (possibly keeping some basic stuff like `\/` and `{}` in)?


title: On the use of \titleofcontents to customize the table of contents

text: I use the following piece of code (titletoc package) to customize the "part entries" of my table of contents. Can you help me to push the page number to the right so that it is aligned with the other page numbers?               \titlecontents{part}[0pt]{     \protect\addvspace{15pt}%     }{}{\large\bfseries\partname{} }{$\;$\titlerule$\;$\large\bfseries\thecontentspage}[]      ![enter image description here](http://i.stack.imgur.com/RChSv.png) * * * **Complete working example**               \documentclass{book}          \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}      \usepackage{titletoc}          \titlecontents{part}[0pt]{     \protect\addvspace{15pt}%     }{}{\large\bfseries\partname{} }{$\;$\titlerule$\;$\large\bfseries\thecontentspage}[]          \begin{document}          \tableofcontents          \part{Part 1}     \chapter{Chapter 1}     \section{Section 1.1}     \section{Section 1.2}     \chapter{Chapter 2}     \section{Section 2.1}     \section{Section 2.2}     \part{Part 2}     \chapter{Chapter 1}     \section{Section 1.1}     \section{Section 1.2}     \chapter{Chapter 2}     \section{Section 2.1}     \section{Section 2.2}     \end{document}


title: Should I use \documentclass[12pt]{article} with \Large or \documentclass{article} with \LARGE?

text: So, I'm working on making some cards, and they need to have nice, large, clear text. So I've set the text to be \LARGE. Then I was thinking, am I doing bad things to the font by over-enlarging it? It seems the size options in `article` only go up to 12pt, but should I be using 12pt and \Large instead? That seems to be roughly equivalent. Are either of these the right way to get very large text for printing cards and such, if that is the majority of the text in my document, or should I be defining the text as large somewhere else?


title: How to limit number of authors in square brackets in alphabetic biblatex style?

text: I'm using **biblatex** with the `alphabetic` style. If there are multiple authors it takes the first Letter of every author (first example), but **I'd like to have just the first author** (second example, but also if there would be multiple authors) - how can I achieve this? I was not able to find the according option in biblatex. ![enter image description here](http://i.stack.imgur.com/Soxmm.png) Though there would be a doubling, both notations in the square brackets should be the same in this case. other example: ![enter image description here](http://i.stack.imgur.com/JyGO5.png) should be [Box60] and [Box51]. My minimal example:               \documentclass{article}     \usepackage[backend=bibtex,style=alphabetic]{biblatex}          \begin{filecontents}{references.bib}     @ARTICLE{boxwilson,      author={Box, G. E. P. and Wilson, K. B. },      journal={Journal of the Royal Statistical Society. Series B (Methodological)},      title={On the Experimental Attainment of Optimum Conditions},      year={1951},      volume={13},      number={1},      pages={1-45},      ,}     }     \end{filecontents}               \bibliography{references.bib}      \begin{document}     \cite{boxwilson}     \printbibliography     \end{document}      A distinction between doubled entries is alright: [Box60a] and [Box60b]. Thank you! * * * Edit: # Any Biblatex with bibtex backend solution would still be appreciated! Best **biber** solution I finally found.


title: Lstlistings reference to line number

text: How can I place a 'label' marker inside a lstlisting environment (external file imported and formatted via the listinputlisting command) so that I can cross-reference a particular line number? In other words, I would like to be able to use the following sort of text content in my document. > "By referring to line **LINE_NUMBER** , in listing ABC, the use of DEF > object has resulted in GHI objectives being met" etc... Where the **LINE_NUMBER** would be marked in the file to the effect of `\label{line:marker}` and then used in the document with `\ref{line:marker}`. It may require the use of an encapsulating flag/s, such as `<\label{line:marker}>` to differentiate from surrounding actual code, which is fine with me. Cheers.


title: New environment type without automatic numbering

text: I'm trying do define a new environment using `tabu` as a building block. The reason to use `tabu` is that it will break nicely across pages for long tables. I would like to have some help on doing the following:   1. Create a new type of environment that appears in `\listofinterfaces` instead of `\listoftables`;   2. The caption should read `Interface X: text` instead of `Table X: text`; and   3. There is no need for automatic numbering, since I would prefer to use my own number provided with each table (it's currently the 3rd argument of `ryetable`); this also means that when I reference the new environment, the number provided is shown and not some automatic counter. I understand you may need some serious latex voodoo to achieve this but even some pointers on the right direction would be helpful. * * *               \documentclass{article}          \usepackage{array, booktabs, longtable, tabu}          % Usage: {}{<label>}{<ifNum>}{<caption>}     \newenvironment{ryetable}[4]{%       \gdef\tmpheaders{#1} % Not currently used       \gdef\tmplabel{\label{#2}} % Save label for later use       \gdef\tmpifnum{#3} % Save interface number       \gdef\tmpcaption{\caption{#4}} % Save caption for later use       \renewcommand{\arraystretch}{1.3} % More space between rows       \begin{longtabu} to \textwidth {@{} X[1,l] X[1,l] X[1,l] >{\raggedright}X[1,l] @{}}         \\\toprule\rowfont\bfseries         Header1 & Header2 & Header3 & Description \\         \midrule       \endfirsthead         \multicolumn{4}{@{}c@{}}{\small\textit{(continued)}}\\         \toprule\rowfont\bfseries         Header1 & Header2 & Header3 & Description \\         \midrule       \endhead         \bottomrule         \multicolumn{4}{@{}r@{}}{\small\textit{(continues)}}\\       \endfoot         \bottomrule         \tmpcaption         \tmplabel       \endlastfoot     }{%       \end{longtabu}     }          \begin{document}     \listoftables     %\listofinterfaces %TODO     \section{MySection}     For a simple table see Table~\ref{tab:somelabel} and for a nifty new environment check Interface~\ref{if:myinterface}.          %TODO: 31 here should be the environment's number     \begin{ryetable}{}{if:myinterface}{31}{This is my pretty interface.}     a & b & c & d\\     e & f & g & h\\     i & j & k & l\\     m & n & o & p\\     q & r & s & t\\     u & v & w & x\\     y & z & -- & --\\     \end{ryetable}               % Some other table to show on list     \begin{table}[h]       \centering       \begin{tabular}{c|c}         a&b\\         c&d\\       \end{tabular}       \caption{Caption of tabular table.}       \label{tab:somelabel}     \end{table}     \end{document}      * * * ![enter image description here](http://i.stack.imgur.com/AOe3a.png)


title: filling area between 2 functions, with shading

text: I would like to plot two (rather simple) functions `f, g` over domain `-2:2` and fill the area between them. The fill color should be red if `f > g` and green if `f < g` (for example), and in later stage also shaded depending the `x` coordinate (to show weighting of the difference). So far I got to filling the area between them with uniform color with               \documentclass{minimal}     \usepackage{tikz,pgfplots}     \begin{document}     \tikz[scale=.6,domain=-2:2]{         \begin{axis}[axis on top=false, axis x line=middle, axis y line=middle,stack plots=y]             % plot first function             \addplot+[mark=none] {.55*x+.13} \closedcycle;             % substract first function from the second one, since they are stacked, and fill that area             \addplot+[mark=none,fill] {.2*x^3-.05*x^2+.2-(.55*x+.13)} \closedcycle;             \addplot+[mark=none] {0} \closedcycle; % should make the second function visible?         \end{axis}     }     \end{document}      ![result of the source above](http://i.stack.imgur.com/IdocW.png) with the following problems/questions:   1. the second function is not shown, it is only border of the filled area   2. how to make the fill color different depending on the sign of the difference?   3. how to shade it depending on `x`?   4. would I finally be better off using plain TikZ, perhaps specifying the functions as splines?


title: Use \ref as part of a graphic

text: Is it possible to make a reference as part of a graphic, which is included in a LaTeX document?   If so, what would be the preferred format for such a graphic (EPS, ...)? Mockup: ![Mockup](http://i.stack.imgur.com/0Jw7a.png) I'm using pdflatex for compiling.


title: Manually set first-use flag using glossaries

text: I am using `glossaries` to keep track of my acronyms and a few other lists. However, I am running into a situation where I want to use `\acf` to print the full acronym, and the description should not be repeated by subsequent `\ac` commands. By default, if one uses `\acf` first, the first occurrence of `\ac` will again print the entire acronym such as Test Acronym (TA). In specific, I am making a `description` list to introduce a few terms, and want to make sure the full acronym is in the label:               \documentclass{scrreprt}          \usepackage[xindy, shortcuts]{glossaries}          \newacronym{TA}{TA}{Test Acronym}         \makeglossaries          \begin{document}          \printglossary[type=\acronymtype]          \begin{description}         \item[\acf{TA}] This is an explanation of the item…              The first use flag should be set after this!              But it does!, and will display Test Acronym (TA) again… Which is not intended!     \end{description}          When using \ac{TA} here like this, it should not reproduce the entire entry again.          \printglossary          \end{document}      Thus, **how can I set/enforce the first use flag manually, or circumvent this problem here?**


title: Add a phrase to an existing algorithmic command/environment

text: I would like to add a new command to an existing environment. The `\renewenvironment` command does not help a lot since I need to copy and paste the entire environment definition. For an example I would like to make a `\FORALL_P` for the `algorithmic` environment such that instead of producing               forall ... do       as original `\FORALL`, it produces               forall ... do in parallel


title: Two images inside minipage (side by side) with one common caption that says "Figure 1 & 2:"

text: I have two images inside a `minipage`, so I can have them side by side. When I make a caption for the images it only comes up as "figure 3: text", but I would like to have it showing "Figure 3 & 4: text". I tried to `\end{figure}` and `\begin{figure}` in each `minipage` but the images would not show side by side anymore. The code I have at the moment is:               \begin{figure}[h]     \begin{minipage}[h]{0.3\textwidth}     \includegraphics[scale=0.58]{fig1}     \end{minipage} \hspace{0.2\textwidth}     \begin{minipage}[h]{0.3\textwidth}     \includegraphics[scale=0.58]{fig2}     \end{minipage}     \caption{text}     \end{figure}


title: Finding a table's row height

text: I have two tables, one of which has two rows as a header. The first table's header looks something like this:               \toprule     \footnotesize\textsc{Stars}\\     \tiny{Name} & \tiny{SHA} & \tiny{Dec}\\     \midrule      I want the second table's header rows to be the same height, but with only the second line of text:               \toprule     \\     \tiny{Latitude}\\     \midrule      Because of the difference in text sizes between the two rows, PdfLaTeX makes the second table's top row narrower so the `\midrule` doesn't line up with the first table's. The contents of the tables are different enough that I can't just create one table. Is there a way of determining a row's height, or should I create a box for each column of a fixed height?


title: Long URL in Bibliography section exceeds the bounds of the page

text: I have an external bib where I put a reference to an external URL.               @misc{myreference,       author = {The Author},       title = {The Title},       howpublished = "\url{http://thisismyurl/2010/3/a-long-url-here}",       year = {year}     }      When I compile, the URL (when displayed in Bibliography) exceeds the bounds of the page (set as customs). The URL is composed by different terms concatenated with `-` symbol. `a-long-url-here` can be the following:               abc-abc-abca-abc-ab-abc-abc-abc-a-abcabc-ab-abc-abc/      The bib is inserted in the following manner:               \bibliographystyle{IEEEbib}     \bibliography{bibliog}      Is there any mechanism to fix this behaviour? I checked perform a line break of an URL in bibliography manually (biblatex, hyperref) but I don't know how to use it in my situation. **Edit** For the sake of completeness, I use **PdfLatex**.


title: Wrong tick labels alignment on baseline

text: Here is an example replicating a problem I faced using the `xticklabels from table` feature:               \documentclass{article}          \usepackage{pgfplots}     \usepackage{tikz}          \usepackage{siunitx}          \begin{document}     \begin{tikzpicture}       \begin{axis}[         xtick={1e-4, .1, .3},         xticklabels={\num{e-4}, .2, .3},         ]         \addplot[only marks] table[x=x, y=y] {           x y           -.3 .7           .2 .1           .5 .6           0.4 -0.5         };       \end{axis}     \end{tikzpicture}     \end{document}      and a picture of the output: ![sample output](http://i.stack.imgur.com/2Uq7Z.png) The xticklabels are not properly aligned on their baseline. I suppose I could correct this by altering the xticklabels properties or maybe by using another way to format the numbers. What would be the bette way to ensure proper alignment?


title: Error compiling CJK with \tableofcontents and \makeindex

text: A basic document with Chinese text works fine:               \documentclass{article}     \usepackage{CJKutf8}     \title{标题}     \begin{document}         \begin{CJK}{UTF8}{gkai}             \maketitle             (text)         \end{CJK}     \end{document}      When I add a table of contents and 1 section with Chinese text, it does not compile:               \documentclass{article}     \usepackage{CJKutf8}     \begin{document}         \begin{CJK}{UTF8}{gkai}             \tableofcontents             \section{第一章}             (text)         \end{CJK}     \end{document}      > Package inputenc Error: Unicode char \u 8:第 not set up for use with LaTeX. When I create an index entry with Chinese text, it also does not compile:               \documentclass{article}     \usepackage{CJKutf8}     \usepackage{makeidx}     \makeindex     \begin{document}         \begin{CJK}{UTF8}{gkai}             (text) \index{nihao@ 你好 nihao}             \printindex         \end{CJK}     \end{document}      > ! Package inputenc Error: Unicode char \u 8:你 not set up for use with LaTeX. > > See the inputenc package documentation for explanation. Type H for immediate > help. ... > > l.3 ...reak or to continue without it.} \GenericError {(inputenc)... What am I doing wrong?


title: Install font on Mac

text: I have been trying to install a font called Frutiger that I have in a zip file `myfonts.zip` using this guide on TUG site. By the way, I'm on a Mac with MacTeX. The zip file has this tree structure:               myfonts/dvips/psfonts/frutiger.map     myfonts/fonts/amf/frutiger/*.amf files     myfonts/fonts/tmf/frutiger/*.tmf files     myfonts/fonts/type1/frutiger/*.pfb files     myfonts/fonts/vf/frutiger/*.vf files     myfonts/tex/latex/psnfss/*.fd files      I have put the above files into `/usr/local/texlive/texmf-local/`. For example `myfont.map` is in `/usr/local/texlive/texmf-local/dvips/psfonts/frutiger.map` and so on. Then I did these steps:               1. Run 'sudo -H mktexlsr' in the console.     2. Run 'sudo -H updmap-sys --enable Map=myfont.map'     3. Run 'sudo -H mktexlsr' again.      In my .tex file I added `\usepackage{frutiger}`. When I run my .tex file with PDFLaTeX I get this error:               ! LaTeX Error: File `frutiger.sty' not found.      I have tried to download and put `frutiger.sty` in the same folder as my .tex file but the new font is not showing up. I have tried the above steps several times but it does not seem like the font is being installed correctly. Last time I got this output in the console.               1. sudo -H mktexlsr     mktexlsr: Updating /usr/local/texlive/2012/../texmf-local/ls-R...      mktexlsr: Updating /usr/local/texlive/2012/texmf/ls-R...      mktexlsr: Updating /usr/local/texlive/2012/texmf-config/ls-R...      mktexlsr: Updating /usr/local/texlive/2012/texmf-dist/ls-R...      mktexlsr: Updating /usr/local/texlive/2012/texmf-var/ls-R...      mktexlsr: Done.          2. sudo -H updmap-sys --enable Map=frutiger.map     updmap is using the following updmap.cfg files (in precedence order):     /usr/local/texlive/2012/texmf-config/web2c/updmap.cfg     /usr/local/texlive/2012/texmf/web2c/updmap.cfg     /usr/local/texlive/2012/texmf-dist/web2c/updmap.cfg     updmap is using the following updmap.cfg file for writing changes:     /usr/local/texlive/2012/texmf-config/web2c/updmap.cfg     /usr/local/texlive/2012/texmf-config/web2c/updmap.cfg unchanged.  Map files not recreated.          3. sudo -H mktexlsr     mktexlsr: ... Same as in step 1 ....      Do you have any clue on what could be wrong? EDIT: Here is the content of `frutiger.sty`:               \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{frutiger}         [2005/08/08 v1.2 Style file for Linotype Frutiger]     \RequirePackage[T1]{fontenc}     \RequirePackage{textcomp}     \DeclareOption{lining}{\renewcommand*{\rmdefault}{lfrx}}     \DeclareOption{oldstyle}{\renewcommand*{\rmdefault}{lfrj}}     \ExecuteOptions{oldstyle}     \ProcessOptions\relax     %%     %% End of file 'frutiger.sty'      Here is a minimal example of what I'm trying to do.               \documentclass{article}     \usepackage{lipsum}     \usepackage[T1]{fontenc}     \usepackage{frutiger}     \title{\textbf{Lorem ipsum dolor sit amet consectetur adipiscing elit}}     \begin{document}     \maketitle     \section{Section I}     \lipsum     \end{document}      Adding `\usepackage{frutiger}` doesn't change the font more than that bold text becomes normal. I have checked the zip file and it seems to be okay as I can read the files with an editor. Also, I tried to force the map to be recreated using `sudo -H updmap-sys --force --enable Map=frutiger.map`. AFAIK there is no difference. Adding `\fontfamily{pfr}\fontseries{m}\selectfont` before any text makes the text look like Frutiger, I don't know if it actually is real Frutiger though. How do I find out?