title: Use black and white image for printing, color image for viewing

text: I have a color figure (image1.pdf) in a document which conveys some information nicely; however, when I print the document on a black and white printer, most of the information is lost. I have created a black and white version in Illustrator (image2.pdf, using patterns instead of colors) to replace it. I was wondering if it is possible to show the color figure, image1.pdf, while someone is viewing the document on a computer but replace it with a black and white figure, image2.pdf, when someone wants to print it?


title: Typeset two styles of the same text over top each other

text: So the goal of this exercise is to have text that can be displayed via the `ocg-p` package in two distinct styles depending on the OCG layer that is in effect (similar to this question/answer). _The heart of this question is in typesetting two versions of the same text on top of each other; OCG is **not** where my problem lies._ ## Question: I have two styles that I need to layer. **How can I actually typeset the same content in the same location on the page in two different styles?** That is, I get how to typeset things on a small scale in the same space, perhaps with something like:               After this, \rlap{This is one version}This is another version          This is completely separate.      But... **How do I go about doing that for something that is a multi-line, full page environment?** _Note, myother question refers specifically to this problem from the perspective of getting `ocg-p` to work for the solution. This question is about making the content typeset twice, in two styles, over top each other._ To get the desired effect, I need to have one OCG-wrapped environment with a monochrome style in the same location on the page as a color style. I'd like to do this in two locations:   1. Title page (full page)   2. Section/Chapter titles The color style should be presented as the base layer, while the black and white should be layered on top via OCG on top of the color style. OCG will be used to present the black and white layer so that it does not display by default, but always prints (as shown below). This will allow for graceful degradation, with the B&W version both showing on screen and printing in PDF viewers that do not have OCG compatibility (virtually anything besides Adobe...).               \begin{ocg}[printocg=always]{MonochromeVersion}{monochrome}{0}     content ...     \end{ocg}      ## Examples styles ### Color vs. B&W _Titlepage_ : ![titlecolor](http://i.stack.imgur.com/CU1sT.png) ![titlebw](http://i.stack.imgur.com/puywR.png) ### Color vs. B&W _Section header_ : ![sectioncolor](http://i.stack.imgur.com/V9Bkr.png) ![sectionbw](http://i.stack.imgur.com/P2SHM.png) ## MWE This code presents the two styles that I'd like to layer as static versions that are distinguished by the state of the `bool` named `usecolor`. This variable is set up front, and the document is typeset in the set style:               \setbool{usecolor}{false}      The full example:               \documentclass[titlepage,twoside,11pt]{article}          \usepackage[demo]{graphicx}          \usepackage{etoolbox}     \providebool{usecolor}     % Will set color title page and section headings     \setbool{usecolor}{false}          % ----- STY File Contents     % Set page geometry     \usepackage[margin=2.0cm,top=1.5cm,includehead,includefoot]{geometry}     \setlength{\headheight}{15pt}          %%%% Title Page stuff     \ifbool{usecolor}{%     \usepackage[pagecolor=none]{pagecolor}%     \definecolor{MyBlue}{HTML}{1b3667}%     \usepackage{afterpage}}{}          \newcommand{\MyTitle}[2]     {       \thispagestyle{empty}       \ifbool{usecolor}{%       \pagecolor{MyBlue}%       \afterpage{\nopagecolor}}{}       \begin{center}       {\ifbool{usecolor}{\color{white}\sffamily}{\sffamily}%  Set text color white or leave black       % put logo gold or blue       \ifbool{usecolor}{\includegraphics[width=1.5in]{logo-gold}}{\includegraphics[width=1.5in]{logo-white}}       \\\vskip 1in       \begin{huge}             \textbf{#1}             \vskip 0.1ex\rule{0.5\textwidth}{0.8pt}\vskip 1ex             #2\\       \end{huge}       \vfill       \large Authors:  \ldots \\       \vfill       }       \end{center}     \newpage     }          %%%% Section Style Format     \usepackage[usenames,svgnames]{xcolor}     \usepackage{tikz}     \usepackage{mathabx}     \usepackage[explicit]{titlesec}     \newcommand*\sectionlabel{}     \titleformat{\section}     {\gdef\sectionlabel{}     \thispagestyle{plain}\ifbool{usecolor}{\color{white}}{}\normalfont\sffamily\LARGE}     {\gdef\sectionlabel{\thesection.\ \ }}{0pt}     {\begin{tikzpicture}[remember picture,overlay]                     \node[xshift=-.2in,rounded corners=.5cm,inner sep=11pt] at (0,0)                     {\begin{tikzpicture}[remember picture, overlay]                                     \ifbool{usecolor}{\fill[MyBlue]}{\draw[fill=LightGrey]} (0,0) rectangle                                     (\paperwidth,1cm);                                     \node[anchor=west,xshift=.1in,yshift=.5cm,rectangle]                                     {\sectionlabel#1};                             \end{tikzpicture}                     };             \end{tikzpicture}     }     \titlespacing*{\section}{0pt}{50pt}{10pt}          \begin{document}     \MyTitle{Title}{Subtitle}          \section{First Section Title}               \end{document}


title: PDF not generated but I see no error!

text: I am having a lot of trouble adding png images and also with hyphenations, All of a suddent I was adding the following tkiz scheme and when I add the lattest part I started getting a bunch of Underfull vbox and Overfull xbox/hbox, I worked around it (or I thingk) but then as I said when I added the second half of the scheme my pdf is not generated anymore.. I have tried splitting the tikz pictures into to figures and force a \pagebreak in between and other stuff but so far nothing... I am adding both the tikz scheme which seems to be the problem and the output I get at the very end. CODE:               \begin{figure}     \centering     \begin{tikzpicture}     \node [fill=white, draw=black, name=force_operator, shape=rectangle, text width=1.5cm,text centered, minimum width = 1.5cm, font=\footnotesize] at (0,0) {Operator's Force};     \node [fill=black!20, draw=black, name=sum1, shape=circle, inner sep=2pt, right=0.75cm of force_operator, minimum size= 0.5cm, font=\footnotesize] {+};     \node [fill=blue!20, draw=black, name=model_master, shape=rectangle, text width=2cm, text centered, font=\footnotesize, right=0.5 of sum1] {$\frac{1}{m\cdot{s} + b}$};     \node [fill=blue!20, draw=black, name=delay1, shape=rectangle, text width=1cm, text centered, font=\footnotesize, right=1.5cm of model_master] {$e^{-2s\tau}$};     \node [fill=blue!20, draw=black, name=simplification_slave, shape=rectangle, text width=4cm, text centered, font=\footnotesize, right=0.5cm of delay1] {$\frac{B\cdot{s} + K {m\cdot{s^2} + (B+b)\cdot{s} + K}$};     \node [fill=white, draw=white, name=a, right=0.5cm of simplification_slave]{};     \node [fill=blue!20, draw=black, name=master_controller, shape=rectangle, text width=2cm, text centered, font=\footnotesize, below=1cm of model_master]  {$\frac{B\cdot{s} + K}{s}$};     \node [fill=black!20, draw=black, name=sum4, shape=circle, inner sep=2pt, right=0.5cm of master_controller, minimum size= 0.5cm, font=\footnotesize] {$+$};          \draw[->] (force_operator) -- node[above, font=\footnotesize]{$F_h$}(sum1);     \draw[->] (sum1) -- node[above, font=\footnotesize]{}(model_master);     \draw[->] (model_master) -- node[above, font=\footnotesize, name=c]{$V_m$}(delay1);     \draw[->] (delay1)  -- node[above, font=\footnotesize]{}(simplification_slave);     \draw[-] (simplification_slave) -- node[above, font=\footnotesize]{}(a.center);     \draw[-] (a.center)     |- node[above, font=\footnotesize]{}(sum4);     \draw[->] (sum4)    -- node[above, font=\footnotesize]{}(master_controller);     \draw[->] (master_controller) -| node[left, pos=0.95] {\footnotesize{$-$}} node[left, font=\footnotesize]{$F_m$}(sum1);     \draw[->] (c) -- (sum4);     \end{tikzpicture}     \end{figure}          \pagebreak[4]          \begin{figure}     \centering     \begin{tikzpicture}     \node [fill=white, draw=black, name=force_operator, shape=rectangle, text width=1.5cm, text centered, minimum width = 1.5cm, font=\footnotesize] at (0,0) {Operator's Force};     \node [fill=black!20, draw=black, name=sum1, shape=circle, inner sep=2pt, right=0.75cm of force_operator, minimum size= 0.5cm, font=\footnotesize] {+};     \node [fill=blue!20, draw=black, name=model_master, shape=rectangle, text width=2cm, text centered, font=\footnotesize, right=0.5 of sum1] {$\frac{1}{m\cdot{s} + b}$};     \node [fill=blue!20, draw=black, name=simplification, shape=rectangle, text width=2cm, text centered, font=\footnotesize, right=1cm of model_master] {};%$\frac{m\cdot{s^2} + (B+b)\cdot{s} + K + (B\cdot{s} +K)\cdot{\exp{-2s\tau}}}{m\cdot{s^2} + (B+b)\cdot{s} + K}$};     \node [fill=white, draw=white, name=a, right=0.5cm of simplification{};     \node [fill=blue!20, draw=black, name=master_controller, shape=rectangle, text width=2cm, text centered, font=\footnotesize, below=1cm of model_master]  {$\frac{B\cdot{s} + K}{s}$};          \draw[->] (force_operator)  -- node[above, font=\footnotesize]{$F_h$}(sum1);     \draw[->] (sum1)        -- node[above, font=\footnotesize]{}(model_master);     \draw[->] (model_master)    -- (simplification);     \draw[-] (simplification)   -- (a.center);     \draw[->] (a.center) |- node[above, font=\footnotesize]{}(master_controller);     \draw[->] (master_controller)   -| node[left, font=\footnotesize]{$F_m$}(sum1);     \end{tikzpicture}     \end{figure}      AND THE OUTPUT: > (...) > > LaTeX Warning: Reference `eq:B_for_critically_damped_no_delay' on page 28 > undef ined on input line 223. > > LaTeX Warning: Reference `eq:B_for_critically_damped_no_delay' on page 28 > undef ined on input line 223. > > Overfull \hbox (103.13486pt too wide) in paragraph at lines 230--232 [] [] > [28] [29]) (./chapters/Related_Work/2.1.3.The_Effect_of_Delay.tex > > LaTeX Warning: Reference `fig:pos_pos_sym_delay' on page 30 undefined on > input line 5. > > LaTeX Warning: Reference `fig:pos_force_delay' on page 30 undefined on input > li ne 5. > > Overfull \hbox (2.18416pt too wide) in paragraph at lines 40--41 [][] > > LaTeX Warning: Reference `' on page 30 undefined on input line 77. > > LaTeX Warning: Reference `' on page 30 undefined on input line 77. > > Underfull \vbox (badness 10000) has occurred while \output is active [30]


title: How to get fractional labels with psaxes?

text: The objective is to get fractional labels (not in decimal) for both vertical and horizontal axes. In my experience, non-trigonometric labels are written in decimals and trigonometric labels can be written in fractional via `trigLabels` and `trigLabelBase`. I attempted to abuse these keys to get fractional non- trigonometric by using `\let\pi=\relax`, but it causes a problem where   * `\pi/n` becomes `/n` (that should be `1/n`),   * `-\pi/n` becomes `-/n` (that should be `-1/n`),   * `-\pi` becomes `-` (that should be `-1`),   * `\pi` becomes `<empty>` (that should be `1`) where `<empty>` stands for empty . My question, what is the best trick to convert every `\pi` to `relax` but prevent the problems from happening?               \documentclass[pstricks,border=12pt,12pt]{standalone}     \usepackage{pst-plot}     \usepackage[nomessages]{fp}          \FPeval\XMin{0-2}     \FPeval\XMax{2}     \FPeval\YMin{0-1}     \FPeval\YMax{1}     \FPeval\temp{1/3}          \psset     {         ytrigLabels=true,         xtrigLabels=true,         trigLabelBase=3,         unit=3cm,     }          \let\pi=\relax          \begin{document}     \begin{pspicture}(\XMin,\YMin)(\XMax,\YMax)         \psaxes[dx=\temp,dy=\temp](0,0)(\XMin,\YMin)(\XMax,\YMax)         \psplot[algebraic,plotpoints=100]{\XMin}{\XMax}{x-2/3}     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/MqVSF.png) ## More general case Sometimes I need to change `\pi` to `\sqrt{2}`, for example. I tried with               \let\pi={\sqrt{2}}      but it does not compile.


title: Reading data from an ODS file in LaTeX?

text: I've been using `csvtools` to read data from CSV files. Is there any way to read data directly from a ODS file, to put the data into a LaTeX document?


title: How to include the subsection numbers when using the algorithm2e package?

text: I am using the package `algorithm2e`. By default, the numbers of the algorithms either related to part, chapter or section. what I want is to get the following numbering for the algorithms: > Algorithm section.subsection.algorithm How to get this?


title: Fancy chapter head with fancyhdr?

text: I use `fancyhdr' to make chapter title for my thesis, `\usepackage{fancyhdr}` `\usepackage[Lenny]{fncychap}` Any idea of other fancy headings using the same package? I don't want to change 'fancyhdr' as that will amount to me changing a lot in my template. Martin's submission (link below) looks really great...with title **'Chapter 3'**. Is it possible to use `fancyhdr` to do same? Fancy Chapter Headings


title: What "smooth" plot interpolation algorithm does pgfplots use?

text: In the pgfplots manual it says:               \addplot+[smooth]     Smooth plots interpolate smoothly between successive points.      In order to choose the right sampling of points from a function evaluation for plotting, I need to know with some detail what is the "interpolation" that "smooth plot" actually pgfplots (or tikz) implements. For example, is it cubic splines (probably not), Akima splines, home brew? If it is not a standard one, what properties does it have? continuity, continuity of first derivative, second derivative, monotonicity, maximum tolerated curvature?


title: Warning "Command \@makecol has changed."

text: When I compile my document I get the following warning `Command \@makecol has changed.` TexStudio points to the file `footmisc.sty`. Of course I've tried to install its latest version (2011/06/06 v5.5b) but still have the problem :( MWE:               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}          \usepackage{fancyhdr}     \usepackage[bottom,hang]{footmisc}     \usepackage[T1]{fontenc}          \begin{document}     mediante DHCP\footnote{Se puede obtener más información sobre esta utilidad en el documento anexo Guía de usuario de Xen: Instalación, configuración y primeros pasos}          \end{document}      I've seen that by reordering the `fancyhdr` and `footmisc` sentences the warning doesn't occur, but still not sure if with that there's no error or it's just that `fancyhdr` doesn't check well.


title: Diagram draw with xy package looks wrong

text: I'm trying out the xy package and have compiled one of the examples on this website: http://en.wikibooks.org/wiki/LaTeX/Creating_Graphics#Xy-pic               \begin{displaymath}         \xymatrix{             A \ar[d] \ar[dr] \ar[r] & B \\             D                       & C }     \end{displaymath}      But when I compile the latex code with `latex test.tex` and look at the resulting test.dvi, I get this: ![image as appears in test.dvi](http://i.stack.imgur.com/FduJI.png) The arrow pointing to the bottom right looks wrong. How do I fix this? **EDIT:** Here's the full latex code:               \documentclass[12pt]{article}     \usepackage[all]{xy}     \begin{document}     \begin{displaymath}       \xymatrix{         A \ar[d] \ar[dr] \ar[r] & B \\         D                       & C }     \end{displaymath}     \end{document}


title: How to use biber

text: Simply put I want to know what steps I need to take to start `biber` with `biblatex`. I haven't been able to find any proper tutorials or guides showing how you go about using it instead of BibTeX.   * What is `biber`'s syntax?   * How do you compile?   * Etc. Are there any tutorials or guides available?


title: Disable keyword highlighting in lstset

text: I have the following lstset defined for my listings               \lstset{         numbers=left,                         numberstyle=\scriptsize,         tabsize=4,         rulecolor=,         language=java,             basicstyle=\scriptsize,             upquote=true,             aboveskip={1.5\baselineskip},             columns=fixed,             showstringspaces=false,             extendedchars=true,             breaklines=true,             prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},             frame=single,             showtabs=false,             showspaces=false,             showstringspaces=false,             identifierstyle=\ttfamily,     }      However, the issue is that when I create some java code in a listings, the keywords, such as private, boolean, return etc are hightlighted in bold. I do not want this. Is it possible to disable the bold keyword highlighting?


title: Need good looking replacement for \widetilde{s'} (to mark something with a prime)

text: Throughout my document I have several formula elements named `s` with variants marked as `s'`. Furthermore, I need to mark these using some other means. Currently, I use `\widetilde`, giving me `\widetilde{s'}`. However, when `\widetilde{s}` and `\widetilde{s'}` appear close together (which happens frequently), the difference in height is quite disturbing (as the tilde is placed above the `'` character). The same problem happens with `\overline{s'}`. Could you hint me to at least two ways that make it possible to differentiate between `s`, `\markOne{s}`, and `\markTwo{s}`, while `s'`, `\markOne{s'}`, and `\markTwo{s'}` still look nice? As I already often use subscripts, playing around with those is not possible. EDIT: I should point the following additional facts:   * I also have items wider than `s` to mark, at the moment I can see `\widetilde{pp'_i}` (although, as mentioned, `\widetilde{pp}'_i` might solve this particular problem)   * The document is quite large and currently I have `\something{x}` where `x` may include primes and subscripts, e.g. `\something{pp'_i}`. Thus, it would be rather hard to replace it by `\somethingElse{pp}'_i` automatically. EDIT2: If no better solution pops up, I'll use some Regexp magic to work around the problem mentioned in the last bullet point of my first edit.


title: Suppress poem line numeration only in selected environments

text: I would like to drop the poem line numeration for only one poem, thus forcing it to behave differently from the general setting defined for the `verse` environment of my document. Please consider the following MWE               \documentclass{article}     \usepackage{verse}          \begin{document}          % Global setting     \verselinenumbersleft     \setlength{\vrightskip}{-3em}     \poemlines{2}               \poemtitle{Garden}     \begin{verse}     I used to love my garden \\     But now my love is dead \\     For I found a bachelor's button \\     In black-eyed Susan's bed.\\!     I used to love my garden \\     But now my love is dead \\     For I found a bachelor's button \\     In black-eyed Susan's bed.\\!     \end{verse}          \poemtitle{No Poem Lines for this enviroment!}     \begin{verse}     I used to love my garden \\     But now my love is dead \\     For I found a bachelor's button \\     In black-eyed Susan's bed.\\!     I used to love my garden \\     But now my love is dead \\     For I found a bachelor's button \\     In black-eyed Susan's bed.\\!     \end{verse}                    \end{document}


title: Subscript spacing in newtxmath (comma issue)

text: I've found a strange behavior of `newtxmath` package. Using my code with `documentclass[12pt]`all commas are glued to the next letter, which can be hard to read: ![12 pt](http://i.stack.imgur.com/mQFRC.png) When I change`documentclass[11pt]` everything looks very nice: ![11pt](http://i.stack.imgur.com/1sDPV.png)               \documentclass[12pt]{report}     \usepackage[T1]{fontenc}     \usepackage{newtxmath}          \begin{document}          \begin{equation}     Q_i=Q_{inf,i}+Q_{vent,i}+Q_{g,c,i}     \end{equation}     \end{document}      Could someone help me with this issue ?


title: I have 3 errors running this code with \toprule and \midrule in a table... If include booktabs package in my preamble, I have 9 errors

text: \begin{table}[htbp]       \centering       \caption{Zeros e pesos para quadratura de Gauss-Legendre}         \begin{tabular}{cccccc}         \toprule         \multicolumn{2}{c}{n = 5} & \multicolumn{2}{c}{n = 10} & \multicolumn{2}{c}{n = 15} \\         \midrule         $x_{i}$       & $w_{i}$           &  $x_{i}$           &  $w_{i}$          &  $x_{i}$          & $w_{i}$             \\     -0.906179845938664& 0.236926885056189 & -0.973906528517172 & 0.0666713443086882& -0.987992518020485& 0.0307532419961175 \\     -0.538469310105683& 0.478628670499366 & -0.865063366688985 & 0.149451349150581 & -0.937273392400706& 0.0703660474881079 \\      4.143437923020e-17& 0.568888888888889 & -0.679409568299024 & 0.219086362515983 & -0.848206583410427& 0.107159220467172  \\     0.538469310105683 & 0.478628670499367 & -0.433395394129247 & 0.269266719309996 & -0.72441773136017 & 0.139570677926154  \\     0.906179845938664 & 0.236926885056189 & -0.148874338981631 & 0.295524224714753 & -0.570972172608539& 0.166269205816994  \\           -           &       -                 &  0.148874338981631 & 0.295524224714753 & -0.394151347077564& 0.186161000015562  \\           -           &       -                 &  0.433395394129247 & 0.269266719309996 & -0.201194093997434& 0.198431485327111  \\           -           &       -                 &  0.679409568299025 & 0.219086362515982 &  2.99577686686e-17&  0.202578241925561  \\           -           &       -             &  0.865063366688984 & 0.149451349150581 &  0.201194093997435&  0.198431485327112  \\           -           &       -                 &  0.973906528517172 & 0.0666713443086877&  0.394151347077563&  0.186161000015561  \\           -           &       -                 &         -          &        -          &  0.570972172608539&  0.166269205816994  \\           -           &       -                 &         -          &        -          &  0.72441773136017 &  0.139570677926154  \\           -           &       -                 &         -          &        -          &  0.848206583410427&  0.107159220467171  \\           -           &       -                 &         -          &        -          &  0.937273392400706&  0.0703660474881083 \\           -           &       -                 &         -          &        -          &  0.987992518020486&  0.0307532419961175      \bottomrule     \end{tabular}      \label{table:zerosPesosQuad} % is used to refer this table in the text      \end{table}


title: Move a pgf plot, after its drawn, (on a layer) behind another plot in same axis?

text: I have already seen Filling path in pgfplot and pushing into background? \- that doesn't help me much because it's simply about `axis on top`. I've also seen Why does pgfplots package cause tikz layer to disappear? \- I don't think I'm hitting that bug, as I'm on pgfplots 1.5.1 (and the example in the answer there works for me as is). Anyways, this is my MWE - in it, I'd like the strokes of the `cos(x)` function to be drawn behind the strokes of the `sin(x)` \- even if `cos(x)` is plotted after `sin(x)` (this is a stand-in for my eventual use case, where I'd like to calculate some intersections based on a plot, and draw them behind the plot):               \documentclass{standalone}          \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}          \pgfdeclarelayer{front}     \pgfdeclarelayer{back}     \pgfsetlayers{back,main,front}     % \pgfsetlayers{back,front}          \begin{tikzpicture}       \begin{axis}         \begin{pgfonlayer}{front}           \filldraw (0.5,0.5)--(1.5,0.5)--(1.5,1.5)--(0.5,1.5)--cycle;           \addplot[name=one,blue,mark=+,domain=1:64] {sin(deg(x))};         \end{pgfonlayer}         \begin{pgfonlayer}{back}           \addplot[name=two,red,mark=+,domain=1:64] {cos(deg(x))};           \filldraw [red] (0,0) --(2,0)--(2,2)--(0,2)--cycle;         \end{pgfonlayer}         \end{axis}         \filldraw [green] (0,0) --(1,0)--(1,1)--(0,1)--cycle;     \end{tikzpicture}          \end{document}      It produces something like this: ![test_pdf](http://i.stack.imgur.com/NQylbm.png) ... zoomed in `evince`: ![zoom_evince](http://i.stack.imgur.com/U1gzsm.png) The problems here are:   * even if the `cos` is supposedly drawn in the "back" layer - its strokes (red) are still above the `sin` (blue)   * If I use `\pgfsetlayers{back,front}`, instead of `{back,main,front}` \- I get a blank output; which probably means that the plots are drawn on `main` anyway (with layering controlled by order of addplot commands), and so drawing in `back` or `front` layer fails   * The `\addplot`s are shown - however, the `\filldraw`s within the `axis` environment aren't  Is it possible to use layering in this sense in a pgf plot, within an `axis` environment?


title: character in the PDF

text: Here is my MWE:               \documentclass{scrartcl}     \usepackage{beramono}     \usepackage[T1]{fontenc}     \begin{document}     \begin{verbatim}     ' only a test     \end{verbatim}     \end{document}      If I copy the text from the PDF viewer, the following characters are in the clipboard:               ’ only a test      The apostrophe is different. What can I do, that in the PDF I can grab the original input character?


title: media9 error: "support outdated", Support package l3kernel too old

text: My OS is Windows 7 64-bit. I have been learning Asymptote, and when I try to output a 3D image as a pdf I consistently get the error message in the title of this post. I dug around and I guess it is a `MikTex 2.9` issue. I tried downloading `media9`, `l3kernel`, and `l3packages` from CTAN. The installation instructions in the pdf that comes with media9 say to put the `media9` folder in the local TDS directory, which they tell you how to find, and then to update the filename database by typing `texhash` in the command line. I cannot find any installation instructions for `l3kernel` or `l3packages` \- I tried just doing the same thing with them that the `media9` instructions said to do for it, but that's obviously just a guess. So far, nothing has made any difference whatsoever. Can anyone help me to fix this problem? * * *               ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\pgf\frontendlayer\tikz\librarie     s\tikzlibrarytopaths.code.tex"     File: tikzlibrarytopaths.code.tex 2008/06/17 v2.10 (rcs-revision 1.2)     )))     Package: media9 2014/06/25 v0.45 acrobat-9/X compatible media               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !     ! media9 error: "support outdated"     !      ! Support package l3kernel too old.     !      ! See the media9 documentation for further information.     !      ! For immediate help type H <return>.     !...............................................            l.75 }          |'''''''''''''''''''''''''''''''''''''''''''''''     | Please install an up to date version of l3kernel.     | Loading media9 will abort!     |...............................................          )          ! LaTeX Error: Unknown option `bigfiles' for package `media9'.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        <*> \newif               \ifplaybutton          The option `bigfiles' was not declared in package `media9', perhaps you     misspelled its name. Try typing  <return>  to proceed.               *\count255=\the\catcode`\@\makeatletter%          *\@ifpackagelater{media9}{2013/11/15}{}{\playbuttontrue}%          *\catcode`\@=\the\count255          *%          *\def\ASYprefix{}          *\newbox\ASYbox     \ASYbox=\box51          *\newdimen\ASYdimen     \ASYdimen=\dimen182          *\long\def\ASYbase#1#2{\leavevmode\setbox\ASYbox=\hbox{#1}%\ASYdimen=\ht\ASYbox     %          *\setbox\ASYbox=\hbox{#2}\lower\ASYdimen\box\ASYbox}          *\usepackage{graphicx}          *\begin{document}     No file texput.aux.     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 0.     LaTeX Font Info:    ... okay on input line 0.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 0.     LaTeX Font Info:    ... okay on input line 0.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 0.     LaTeX Font Info:    ... okay on input line 0.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 0.     LaTeX Font Info:    ... okay on input line 0.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 0.     LaTeX Font Info:    ... okay on input line 0.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 0.     LaTeX Font Info:    ... okay on input line 0.     LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 0.     LaTeX Font Info:    ... okay on input line 0.     LaTeX Font Info:    Checking defaults for PU/pdf/m/n on input line 0.     LaTeX Font Info:    ... okay on input line 0.     \AtBeginShipoutBox=\box52     Package hyperref Info: Link coloring OFF on input line 0.     ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\hyperref\nameref.sty"     Package: nameref 2010/04/30 v2.40 Cross-referencing by name of section          ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\gettitlestring.sty"     Package: gettitlestring 2010/12/03 v1.4 Cleanup title references (HO)     )     \c@section@level=\count195     )     LaTeX Info: Redefining \ref on input line 0.     LaTeX Info: Redefining \pageref on input line 0.     LaTeX Info: Redefining \nameref on input line 0.     \@outlinefile=\write4               Package hyperref Warning: Rerun to get /PageLabels entry.          ABD: EveryShipout initializing macros     *\makeatletter%          *\let\ASYencoding\f@encoding%          *\let\ASYfamily\f@family%          *\let\ASYseries\f@series%          *\let\ASYshape\f@shape%          *\makeatother%          *\fontsize{12}{14.4}\selectfont          *     (Please type a command or say `\end')     *\usefont{\ASYencoding}{\ASYfamily}{\ASYseries}{\ASYshape}%          *     (Please type a command or say `\end')     *\setbox\ASYbox=\hbox{%          *\ifplaybutton%          *\includemedia[3Dlights=Headlamp,3Dmenu,activate=pagevisible,3Dtoolbar=true,lab     el=,3Daac=16.961886281,3Dc2w=0.624695048 -0.780868809 0 -0.232810099 -0.1862480     79 0.954521404 -0.745355992 -0.596284794 -0.298142397 211.301305888 178.6528737     41 65.497472713,3Droo=283.550260095,3Dpsob=H,3Dbg=1 1 1,add3Djscript=asylabels.     js,width=39.14625pt,height=107.40125pt]{}{09_three+0.prc}%          *\else%          *\includemedia[noplaybutton,3Dlights=Headlamp,3Dmenu,activate=pagevisible,3Dtoo     lbar=true,label=,3Daac=16.961886281,3Dc2w=0.624695048 -0.780868809 0 -0.2328100     99 -0.186248079 0.954521404 -0.745355992 -0.596284794 -0.298142397 211.30130588     8 178.652873741 65.497472713,3Droo=283.550260095,3Dpsob=H,3Dbg=1 1 1,add3Djscri     pt=asylabels.js,width=39.14625pt,height=107.40125pt]{}{09_three+0.prc}%     ! Undefined control sequence.     <*> \includemedia                      [noplaybutton,3Dlights=Headlamp,3Dmenu,activate=pagevisible...     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.          ! Missing $ inserted.     <inserted text>                      $     <*> ...,width=39.14625pt,height=107.40125pt]{}{09_                                                       three+0.prc}%     I've inserted a begin-math/end-math symbol since I think     you left one out. Proceed, with fingers crossed.          LaTeX Font Info:    External font `cmex10' loaded for size     (Font)              <12> on input line 0.     LaTeX Font Info:    External font `cmex10' loaded for size     (Font)              <8> on input line 0.     LaTeX Font Info:    External font `cmex10' loaded for size     (Font)              <6> on input line 0.     ! Extra }, or forgotten $.     <*> ...625pt,height=107.4012


title: Why is a varwidth incorrectly vertically centered by \raisebox{-0.5\height}?

text: I was creating a pseudocode/JavaScript comparison table, and wanted to typeset algorithms written with the algorithm2e package vertically centered in table cells. Out-of-the box, algorithm2e can't do this, but I modded the code, and everything but one point seems to be working. That's this: algorithm2e normally places pseudocode lines in boxes out to \hsize, but in the table context I want their natural size, so I used the varwidth environment. And that has broken the vertical centering. MWE:               \documentclass{article}          \usepackage{varwidth}          \newcommand{\verticalcenter}[1]{\raisebox{-0.5\height}{#1}}          \begin{document}          \begin{tabular}{ll}       \hline       \verticalcenter{%         \begin{varwidth}{\hsize}%           text\par           text\par           text\par         \end{varwidth}%       }&\verticalcenter{\rule{1cm}{1pt}}\\       \hline     \end{tabular}          \end{document}      This produces: ![A table with the centered rule appearing well above the center of the pseudocode](http://oi58.tinypic.com/28jfwqb.jpg) where the centerline is well above the center of the text. I tried to dive in the varwidth code, but nothing is jumping out at me. How can I fix the varwidth's dimensions?


title: Formatting linear programs

text: When stating LP problems I usually use something along the following               \begin{tabular}{ l c p{1pt} c }     max     & \multicolumn{3}{l}{$300x + 100y$} \\     s.t.    & $6x + 3y$ & $\leq$ & $40$\\             & $x - 3y$  & $\leq$ & $0$ \\             & $x + \frac{1}{4}y$ & $\leq$ & $4$ \\     \end{tabular}      ![](http://i.stack.imgur.com/44dom.png) But this forces the use of inline math, and require me to adjust column width manually (and it's still not perfect since the spacing between the right hand side and left hand side of \leq is wrong). What I really would like was a solution that allowed for display math, with correct spacing and no need for manual formatting with `p{}`. How would I write a version that fixes this?


title: Why the summation is printed like this?

text: The values of the upper and lower limits of a summation are usually printed below and above sigma. But I find TeX something very unusual. How to correct this? Here is the MWE:               \documentclass[12pt]{article}     \usepackage{amsmath}     \begin{document}     \begin{align}     <\mu_{m}> = \frac{\sum_{-J}^{J}{-g\mu_{\beta}M_{J}B.\exp{\left(\frac{-g\mu_{\beta}M_{J}B}{kT}\right)}}}{\sum_{-J}^{J}{\exp{\left(\frac{-g\mu_{\beta}M_{J}B}{kT}\right)}}}     \end{align}     \end{document}      The output:   ![enter image description here](http://i.stack.imgur.com/5ST5s.png)


title: How to set different color in listing?

text: I want to split the listing into three different colors. How to do it? ![enter image description here](http://i.stack.imgur.com/xLZ8o.png) I have read Peter Grill's answer and apply it like this:               \documentclass[12pt]{article}     \usepackage[utf8]{inputenc}     \usepackage[svgnames]{xcolor}     \usepackage{remreset}     \usepackage{bera}     \usepackage{geometry}     \usepackage{listings}          \lstset{language=[LaTeX]TeX,     basicstyle=\color{DarkSlateGray}\small,     texcsstyle=\bf\color{Aquamarine},     identifierstyle=\color{Crimson}\bfseries,     stringstyle=\color{brown}\ttfamily,     columns=fullflexible,     breaklines=true,     escapeinside=<>,{},     keywordstyle=\color{teal},     stringstyle=\color{brown}\ttfamily,     commentstyle=\color{cyan},     morekeywords={},     otherkeywords={$,\{ ,\} , [ , ], & },     moretexcs={maketitle, subsection, subsubsection, appendix, tableofcontents,includegraphics},     }          \begin{document}     \section*{How to set different color in listing}     \begin{lstlisting}     \perintahbeamer[<argumen opsional>]{<argumen pertama>}{<argumen kedua>}     \end{lstlisting}          \end{document}


title: questions regarding table of contents

text: I am using article for my lecture note.. but in the content i am having the problem that the title of the chapter is not formatted in correct manner.`                \documentclass[12pt,a4paper]{article}     %\usepackage{lgrind,latexcad}          \usepackage{graphicx,amsmath,amsthm,amssymb,amsfonts,thesisb1,fancyhdr,mathrsfs,      indentfirst,dsfont,lipsum,multicol}          \newcommand{\setlinespacing}[1]%                {\setlength{\baselineskip}{#1 \defbaselineskip}}     \newcommand{\doublespacing}{\setlength{\baselineskip}%                                {2.0 \defbaselineskip}}      \pagestyle{fancy}          %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      \numberwithin{equation}{chapter}      \numberwithin{figure}{chapter}      \numberwithin{table}{chapter}      \newcommand{\ntt}{\normalfont\ttfamily}     \begin{document}     \pagenumbering{roman}     \tableofcontents     \input{unit3.tex}          \end{document}      In this i am having my table of contents as, ![enter image description here](http://i.stack.imgur.com/eOafX.jpg) Note that the third chapter is not in the correct manner.. i should have in this way               3 The complex potential for two dimensional, irrorational,          incompressible flow      Help me to do the correction... In addition i am giving the chapter 3 codes als...               \chapter{The complex potential for two dimensional, irrorational, incompressible flow}       \section{Complex potential}       Suppose that  $z=x+iy$ and that $W=f(z)$,       \begin{equation}        W=f(z)=\phi(x,y)+i\psi(x,y)\\       \end{equation}     \begin{equation}      \phi(x,y)+i\psi(x,y)=f(x+iy)\\     \end{equation}


title: Merging many tex-documents together?

text: I have a serie of publication papers that I would like to gather into one group of papers (or a collection). Is there some easy way for that without removing all headers such as `\documentclass{article}...etc`? I initially thought about just appending them as PDFs but it is a bit poor looking -- page numbers not getting fixed or anything like that.   1. How would you merge such papers?   2. Is it possible to autogenerate finding-aid for such documents? (It is extremely hard reading without some instructions about the papers.)


title: How to change the font and size of the Chapters titles and numbers of Bjornstrup

text: This is a follow-up question to Question about Bjornstrup, where, in the answers, Gonzalo Medina posted a short script on how to change the background and numbers colors of a specific Chapter format. The question I have now is: How can I change the font and size of the Chapters titles and numbers? There should be some lines to change in the script but I don't know where ....


title: Multiple references to the same footnote inside a table environment

text: I followed the steps in this answer to get multiple references to the same footnotes working. As shown in this minimal example, the solution is working great for footnotes in the text, also getting the correct hyper references in the compiled pdf. But when using multiple footnotes in a table environment the solution doesn't work, for the second reference in the table environment I get "a^0" instead of another "^a". I guess the problem is that numbering consist of (a,b,...) instead of numbers but I'd like to keep that behavior. How should I adapt the solution to work inside the table environment ??               \documentclass{article}     \usepackage{hyperref}     \usepackage{cleveref}     \crefformat{footnote}{#2\footnotemark[#1]#3}          \begin{document}          This is a paragraph\footnote{\label{first}some footnote}.          This is another paragraph\footnote{\label{second}another footnote}.          This is another paragraph using the first footnote\cref{first}.               \begin{table}     \caption{A table}     \begin{minipage}{\textwidth}     \begin{tabular}{l r r r l}     \hline      & E\footnote{\label{1sttablefoot}Some table footnote} & F\cref{1sttablefoot} & G \footnote{Another table footnote} & \\  \hline            & 1 & 2 & 3 & \\ \hline          \end{tabular}     \end{minipage}     \end{table}          \end{document}      Can't attach the image result because of being new user :S


title: How do I discover the shorthands defined by babel in my language?

text: The reason I want to do it is that I want to set brazilian language in babel and I want to use xy-pic package, but I have to use it inside an environment in which the shorthands are off.


title: What is the \rule equivalent for \hrule?

text: I've tried to put a rule long as the text in this way:               \rule{\textwidth}{0.4mm}      but I obtain a rule slightly smaller that the text width. How to obtain the same effect as `\hrule`?


title: \hline spacing warning

text: > **Possible Duplicate:**   >  What is the \rule equivalent for \hrule? How do I get spacing after a hline without an error? Here is what I currently have:               End of content\\[5pt]     \hline\\[5pt]      But this throws a coupe of errors:               hw.tex:XXX: There's no line here to end.     hw.tex:XXX: leading text:     \hline\\[5px]      This is related to: http://stackoverflow.com/questions/696157/latex-hline- spacing, but the answer there is the reason I'm getting errors.


title: Use \fill (or similar) to extend a table to the end of the page

text: I am currently trying to make an invoice from a template which requires a table to extend to the end of the page regardless of the content. I tried using `\fill` as below (in `\tabularnewline[\fill]`), but instead of extending the row height to the end of the page, it does nothing. Is there some way to extend the table, as you'd naively expect this code to? I've the majority of the formatting in as I'm not sure if they would interfere with any possible solution.               \documentclass{article}     \usepackage{array}          \begin{document}     Front matter (name, address, etc.)          \noindent     \begin{tabular}{|>{\raggedright}p{0.2\linewidth}|>{\raggedright}p{0.3\linewidth}|>{\raggedright}p{0.3\linewidth}|>{\raggedright}p{0.2\linewidth}|}\hline         Quantity & Description & Unit Price & Amount \tabularnewline\hline          &  &  & \tabularnewline[\fill]\hline         \multicolumn{2}{>{\raggedright}p{0.4\linewidth}|}{Bank Details} & Total & \tabularnewline\cline{3-4}     \end{tabular}     \end{document}      ![The not expanded table](http://i.stack.imgur.com/buA48.png)


title: How to limit the width of equations?

text: I want to control the width of the equations so they don't exceed a predefined width. Firstly I used `minipage` environment and put the `eqnarray` within that. This does not produce the line breaks before and after the equations. I manually use line break, then there would be extra space between text and equations. Is there any other way to set an specific width for an equation without affecting the line breaks? I specifically want to use `eqnarray` and not any other environments like `align` for typesetting equations.               \documentclass[]{article}         \newenvironment{myenv}{ \begin{minipage}{5cm}\begin{eqnarray}           }{\end{eqnarray}\end{minipage} }          \begin{document}               dummy text here     \begin{myenv}       a &= s^3-s       \\       b &=s^2+s     \end{myenv}     dummy text here          \end{document}      ![enter image description here](http://i.stack.imgur.com/hSyWH.png) with added line breaks:               \newenvironment{myenv}{\\ \begin{minipage}{5cm}\begin{eqnarray}       }{\end{eqnarray}\end{minipage} \\}      ![enter image description here](http://i.stack.imgur.com/dZqWn.png)


title: Place sidewaystable at the end of document (below instead of above list of figures)

text: I've seen a lot of questions concerning how to place a `sidewaystable` (I'm using the `rotating` package) floating in the document, but not one on how to place it at the end. My documentclass is `\documentclass[Journal]{ascelike}` and I would like the `sidewaystable` to end up at the end of my document, below the list of figures. As it is now, the table ends up wherever I place it in the code. How can I achieve the right position of my `sidewaystable`? It works perfectly fine with my standard tables. Regards, Kristin


title: Detecting the mode of the exercise package

text: I am trying to detect whether the exercise package's option **_noanswer_** is on, with the intention of not displaying parts in either mode. Here is my mwe: * * *               \documentclass{minimal}     \usepackage[noaswer]{exercise}          \newif\ifpaper     \newif\ifmemo     \paperfalse     \memofalse          \makeatletter%     \@ifpackagewith{excercise}{noanswer}{%     \papertrue%     }{%     \memotrue%     }%     \makeatother%          \begin{document}     \ifpaper     paper     \fi          \ifmemo     memo     \fi          \end{document}      With this I always get memo, whether **_noanswer_** is provided or not. * * *   1. Is there something I'm missing?   2. Or there another approach to ensure the correct detection?


title: How do I place braces on a line segment?

text: So I have this code here,                  \begin{tikzpicture}              % Draw the axes         \draw [->,black] (-1.5,0) -- (3,0) ;         \draw [->,black] (0,-1.5) -- (0,3) ;              % Draw the line         \draw[-,black](0,0)--(3,2);              % Draw the circle         \path [draw,green] (+1.5,0) circle (1.5);         \path [draw,cyan] (0,1.5) circle (1.5);              % Intersection of circle and line         \draw[dashed,cyan](0,0.93)--(1.38,0.93);         \draw[dashed,cyan](1.38,0.93)--(1.38,0);         \draw[dashed,green](0,1.38)--(2.1,1.38);         \draw[dashed,green](2.1,0)--(2.1,1.38);       %  \node[] at (-0.25,1.78){$y$};               \node[] at (-0.25,0.93){$y_3$};          \node[] at (1.38,-0.25){$x_3$};               \coordinate (a) at (0,0);           \coordinate (b) at (1.38,0.93);         \draw[decorate,decoration={brace,amplitude=5pt,raise=1pt,mirror},yshift=0pt] (a) -- (b) node [midway,yshift=-10pt, xshift = 10pt]{$|z_3|$};          \node[] at (-0.25,1.38){$y_2$};          \node[] at (2.1,-0.25){$x_2$};               % \node[] at (2.9,-0.25) {$x$};              % Draw the angle         \draw [red] (0,0.3) arc (90:33:0.3);         \draw[red] (0,0.4)arc(90:33:0.4);         \node[] at (60:.6)  {$\alpha$};              % Done     \end{tikzpicture}      , which gives me the following image: ![enter image description here](http://i.stack.imgur.com/XiwkI.png) However, what I would like to do is make brace/markers on the segments shown in the picture. (It is clear where I have hand-drawn them in). How can I modify the above to be able to do so?


title: How change math font size in power?

text: How can I change the font for power such a way that the power symbol is rendered much smaller than the number 3 in the following formula? I need to sum (necessarily with \displaystyle) was much smaller number of 3.               \pdfoutput=0     \documentclass[fleqn]{article}     \usepackage[T2A]{fontenc}     \usepackage[cp1251]{inputenc}     \usepackage{concmath}     \usepackage{amsmath}          \begin{document}     \thispagestyle{empty}          \begin{displaymath}     3^{\displaystyle \sum_{n=0}^{\infty}\frac{(-1)^n}{2^n}}     \end{displaymath}          \end{document}      which renders as ![Formula](http://i.stack.imgur.com/EKUXa.png) But it does sum in power too large. How to make, that sum was, for example, is 10 times less than the number 3? Or 5 times less than the number 3? The number 3 to make very large. And sum to make very small. Possibly?


title: How to put a sectlof outside its section

text: I would like to put section-based list of figures out of their sections and in an appendix, but for only for two specific sections. My intention was to put the sectlof, like it would appear in section 2 and appendix B, instead in appendix C. I only need a list of figures for these two sections, the rest is not needed. My problem is that I did not manage to put a sectlof outside its section. Does anybody know a solution for this problem?               \documentclass[a4paper,11pt,titlepage]{article}          \usepackage[utf8x]{inputenc}     \usepackage[insection]{minitoc}     \usepackage[titletoc]{appendix}               \begin{document}            \dosectlof        \fakelistoffigures            \section{Section 1}       Lorem ipsum dolor sit amet            \section{Section 2}       Lorem ipsum dolor sit amet            \begin{figure}[htb]         \caption{some figure}       \end{figure}            \sectlof            \begin{appendices}              \section{Appendix A}         Lorem ipsum dolor sit amet              \section{Appendix B}         Lorem ipsum dolor sit amet              \begin{figure}[htb]           \caption{another figure}         \end{figure}              \sectlof              \section{Appendix C}         Lorem ipsum dolor sit amet              Figures of section 2         %I want to put the sectlof of section 2 here              Figures of appendix B         %I want to put the sectlof of appendix B here            \end{appendices}          \end{document}


title: How to sort all chinese references before English ones

text: I'm writing my phd thesis, which is in Chinese. It's required to sort the all Chinese references before English ones in the Section of reference. However, it seems that there is not any existing sorting options that can support this. I tried to use `\usepackage[backend = biber, style=alphabetic, sorting=nty]{biblatex}`. All Chinese references were listed behind English ones. Is there any way that can sort all the Chinese references before all the English ones?


title: Confused with TeX terminology: height, depth, width

text: The LaTeX reference card states for example > `\strut` box w/ ht and depth of “(”, zero width I came to see text as a two dimensional feature, but I must be missing out on something... (following was off-topic: by the way, im trying to find documentation on how to use `\vbox`, `\hbox`,… i.e. to align a hbox within a vbox to the right)


title: More than one width of a glyph in LaTeX or LuaLatex

text: I don't know where I can ask about it. I have font with 2 or 3 versions of letter 'a'. How I can put this information to LuaLaTeX, LaTeX etc.? When the paragraph are breaking/making LaTeX made him some free spaces. And then one could use a different width of letters, but I do not know how to tell these LaTeX. How to intervene in the submission of a paragraph. My letter a is in normal 'a' position and in user space range unicode. BTW: this editor is wonderfull: FontEditor BitfontMaker http://www.pentacom.jp/soft/ex/font/ ![example](http://i.stack.imgur.com/0DcYJ.png)


title: modify html output of htlatex

text:
When latex figures are converted to html, htlatex generates markup as follows:

         Abbildung 7:         Sample Image
      Is it possible, e.g. through hooks and parameters in the config file, to change the output in such a way, that the resulting markup code looks like below?

       Abbildung 7:       Sample Image
      Regards, Chris Edit: Added an MWE and modified needed output (anchor should also contain a 'title' attribute with the caption's content and the image path should be relative with a leading slash)               \documentclass{article}     \usepackage[ngerman]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[final]{graphicx}     \begin{document}     \begin{figure}     \centering     \includegraphics{sampleImage.png}     \caption{My sample image}     \label{fig:mysampleimage}     \end{figure}     \end{document}         The code is compiled with:               htlatex.bat src.tex "html"


title: How to check if token is a macro?

text: I am thinking about possibility to parse LaTeX document. What I really need is to track category codes of symbols. As I understand TeX expands all of macros in his mouth and tracks changes of category codes without executing anything. Is it possible to check if the next token is a macro, collect it unexpanded (together with arguments), execute it and move to next token?


title: Beamer \tableofcontents does not display the correct section number after \setcounter{section}{...}

text: I use beamer to make presentations for my lectures (I despise PowerPoint). Each presentation represents one chapter of the textbook. Therefore, I need the section numbers in the beamer presentation to match the section numbers in the textbook chapter. However, since we sometimes skip sections, I must use `\setcounter{section}{...}`. In the code displayed below, the headlines of the second and third slides display the section numbers correctly as `1` and `9`, respectively. However, the table of contents on the first slide displays the section numbers incorrectly as `1` and `2`. The table of contents seems to ignore the `\setcounter{section}{...}` command. Looking in the `toc` file, this is indeed the case               \beamer@endinputifotherversion {3.26pt}     \beamer@sectionintoc {1}{First}{2}{0}{1}     \beamer@sectionintoc {9}{Ninth}{3}{0}{2}      The third and fifth parameters of the `\beamer@sectionintoc` macro have not been changed to reflect the non-sequential value of the section number. Is there something else that needs to be set in order for beamer to display the correct section number in the table of contents?               \documentclass{beamer}     % This gets rid of the font warnings     \usepackage[T1]{fontenc}     \usepackage{lmodern}          \setbeamertemplate{section in toc}[sections numbered]          \setbeamercolor{headline colour}{fg=blue,bg=yellow}     \setbeamertemplate{headline}     {        \leavevmode%        \hbox{%           \begin{beamercolorbox}[wd=\paperwidth,ht=4ex,dp=1.5ex]{headline colour}%           \raggedright           \hspace*{2em}%           {\small%              \ifx\insertsection\empty%                 \relax%              \else                 Section \#\thesection\ \insertsectionhead%              \fi           }%           \hspace*{2em}%           \end{beamercolorbox}%        }%     }          \begin{document}          \begin{frame}        {Table of Contents}        \tableofcontents     \end{frame}          \section{First}     \begin{frame}        Something in the First section.     \end{frame}          \setcounter{section}{8}     \section{Ninth}     \begin{frame}        Another thing in the Ninth section.     \end{frame}          \end{document}


title: "songs" package, chord size

text: I am trying to write an A6 songbook in latex(just getting started). For chords above lyrics I use the `songs` package, but the chords looks bigger than the lyrics. Can't find anything in the documentation on how to make the text for the chords smaller. Annyone know how? A minimal working example showing the default settings:               \documentclass{article}     \usepackage[chorded]{songs}          \newindex{titleidx}{titleidx}     \noversenumbers          \begin{document}     \showindex{Complete Index of Songs}{titleidx}     \songsection{Worship Songs}          \begin{songs}{titleidx}     \beginsong{Doxology}[by={Louis Bourgeois and Thomas Ken},                          sr={Revelation 5:13},                          cr={Public domain.},                          index={Praise God, from Whom all blessings flow}]     \beginverse     \[G]Praise God, \[D]from \[Em]Whom \[Bm]all \[Em]bless\[D]ings \[G]flow;     \[G]Praise Him, all \[D]crea\[Em]tures \[C]here \[G]be\[D]low;     \[Em]Praise \[D]Him \[G]a\[D]bove, \[G]ye \[C]heav'n\[D]ly \[Em]host;     \[G]Praise Fa\[Em]ther, \[D]Son, \[Am]and \[G/B G/C]Ho\[D]ly \[G]Ghost.     \[C]A\[G]men.     \endverse     \endsong     \end{songs}          \end{document}      ![enter image description here](http://i.stack.imgur.com/7vqgC.png)


title: Convert PGFplot to html?

text: I'd like to convert a simple piece of LaTeX code which is basically some text with some centered graphs in between. This is a dummy version of the code I'd like to convert to HTML:               \documentclass{article}     \usepackage{lmodern}     \usepackage{pgfplots}     \usepackage{lipsum}     \pgfplotsset{compat=1.9}          \begin{document}     \lipsum     \begin{center}         \begin{tikzpicture}             \begin{axis}[                 ybar stacked,                 ymin=0, ymax=35,                 width=9cm,                 height=6cm,                 symbolic x coords={Zimbabwe, France, Italy, Kenya, Germany},                 xtick=data,                 bar width=15pt,                 axis lines*=left,                 ytick={0,5,...,35},                 xticklabel style={                     text height=1.5ex,font=\footnotesize                 },                 yticklabel style={                     font=\footnotesize                 },                 ymajorgrids,                 xlabel={ ... ... ... ... ... , 2004-2009},                 xlabel style={yshift=5.8cm,xshift=.9cm},                 ]                 \addplot[fill=gray!50] coordinates {                     (Zimbabwe,16)                     (France,30)                     (Italy,10)                     (Kenya,5)                     (Germany,20)                 };             \end{axis}         \end{tikzpicture}     \end{center}     \end{document}      I tired with `latex4ht`, which I used in the past, but it seems that it does not work with the PGFplot code. So my question is: how do you convert PGFplot graphs to html? Thanks for your help


title: How do I give an equation a name instead of a number?

text: > **Possible Duplicate:**   >  Custom equations' names I'd like to label a couple of equations by **name** , right-aligned, where the (number) would normally appear in the document: how do I do this?


title: How to put a text like this pattern? (different size, style)

text: It is difficult to explain what I want so I found this text and I planning to make a small book that containts, quotes and some poetry so I thought it will be nice to have this kind of text, not to messy but with different styles ![like this](http://i.stack.imgur.com/tYtIF.jpg) I found this package http://mirror.math.ku.edu/tex- archive/macros/latex/contrib/verse/verse.pdf you can see on page 14 one example that I like


title: biblatex-apa puts comma at the end of collection-entries instead of period

text: I am writing my thesis with biblatex-apa style for biblatex. Unfortunately biblatex-apa behaves strange for whole collections. Instead of putting a period at the end of such an entry it puts a comma there. This minimum example shows what I mean:               \begin{filecontents*}{collection.bib}     @COLLECTION{Doe2013,       editor = {Doe, John},       title = {Some collection},       year = {2013},       publisher = {Publisher},       location = {Location}     }     \end{filecontents*}          \documentclass[a4paper]{scrreprt}          \usepackage[backend=biber,style=apa]{biblatex}     \usepackage[american]{babel}     \usepackage[babel,autopunct=true]{csquotes}     \DeclareLanguageMapping{american}{american-apa}     \bibliography{collection}          \begin{document}     Some text and then a cite \parencite{Doe2013}.          \printbibliography     \end{document}      It produces this: ![http://web263.login-1.hoststar.at/johanngruendl/files/example.jpg](http://web263.login-1.hoststar.at/johanngruendl/files/example.jpg) Since I was about to finish my thesis when I found this problem, I would be very grateful if someone could provide a quick fix for this strange behavior.


title: Detect if all required glyphs are available

text: In XeTeX, a message is printed to the log file if a glyph is not available with the current font. The input               \documentclass{scrartcl}          \begin{document}       α     \end{document}      leads to the following entry in the log:               Missing character: There is no α in font cmr10!      Is there a way to check for a given input if all glyphs required to render it are available, without relying on the log file? Apparently, there is no Command to flush log file, and (in a scenario where I pipe into a running XeLaTeX process) I'd like to know before XeTeX is terminated.


title: Advanced Wrapfig

text: Consider the following code and output.               \documentclass{article}         \usepackage{lipsum}         \usepackage{graphicx}         \usepackage{wrapfig}          \begin{document}         \begin{wrapfigure}{o}{0.5\textwidth}             \centering             \includegraphics[width=2in]{image.png}         \end{wrapfigure}         \noindent\lipsum[1]     \end{document}      ![Output](http://i.stack.imgur.com/OHfKK.png) How can I have the text follow the gradient of the triangle in the image?


title: JabRef creates an empty line in the .bib-file for every (new) item I create or edit

text: * JabRef 2.10   * Win 7 64-bit Whenever I add a new entry or edit an old one, I see that JabRef created an empty line in the source code for the bib item (which I can see in the last tab). Does anyone have any idea how to stop this behavior? **edit** I also posted this on the _Discussion_ page of the JabRef project over at soureforge page.


title: threeparttable notes layout

text: I am using threeparttable for adding notes to my table. Here is a minimal working example:               \documentclass[12pt]{memoir}          \usepackage[para,online,flushleft]{threeparttable}          \begin{document}     \par     Lets test the threeparttable package.     \begin{table}[h]     \caption{Some very informative caption}     \begin{center}     \begin{threeparttable}     \begin{tabular}{c c c c}         \toprule         \textbf{1st Column} & \textbf{2nd Colimn} & \textbf{3rd Colimn} & \textbf{4th Colimn} \\ \midrule           QWERTY\tnote{1}   &                     &                     &  \\           ASDFGH\tnote{2}   &                     &                     &  \\ \bottomrule     \end{tabular}     \begin{tablenotes}     \item[1] qwerty; \item[2] asdfgh     \end{tablenotes}     \end{threeparttable}     \end{center}     \label{table:simDisimCoefNewDef}     \end{table}     \end{document}       which produce the following: ![threeparttable](http://i.stack.imgur.com/Vc97M.png) So what I need is to set minimum distance between notes on same line like in normal text. Is that possible?


title: Using bibtex to cite a chapter in a handbook that is part of a series

text: I need to cite a chapter of a book (with editors that differ from the chapter author) that is part of a series of books with different editors. It should look like: "Rogoff, B. (1998). Cognition as a collaborative process. In D. Kuhn & R. S. Siegler (Eds.), Cognition, language, and perceptual development (Vol. 2). In W. Damon (Series Ed.), Handbook of child psychology (5th ed., pp. 679–744). New York: John Wiley & Sons." Can anyone offer any suggestions? At the moment I'm inclined to ignore the fact that the book is part of a series but this seems like a cop out! Many thanks!


title: longtable misplaced noalign

text: # Question Why am I getting multiple `misplaced \noalign` errors? ## Reproducible example               \documentclass{scrartcl}     \usepackage{longtable}     \usepackage{booktabs}          \begin{document}          \section{Table test}          \begin{longtable}{llc}     \hline      &  & \multicolumn{1}{c}{All} \\      \hline     m & \rule{0pt}{1.7\normalbaselineskip}April  & $1$ \\      & \nopagebreak July  & $1$ \\      & \nopagebreak June  & $1$ \\     l & \rule{0pt}{1.7\normalbaselineskip}C  & $1$ \\      & \nopagebreak F  & $1$ \\      & \nopagebreak S  & $1$ \\     nums & \rule{0pt}{1.7\normalbaselineskip}28  & $2$ \\      & \nopagebreak 62  & $1$ \\     \hline      \end{longtable}     \end{document}      ## Desired output (through reproducible research toolchain---see below) ![desired output](http://i.stack.imgur.com/EjCYp.png) ## Troubleshooting---Manual Tex Editing It seems `misplaced /noalign` errors can be vexing. My `\hline` is preceeded by `\\`. Does the comment about `booktabs` apply here? If so, how do I fix it? Changing `\\` to `\\*` or `\tabularnewline` doesn't seem to help. As far as I can tell, this is not a `\centering` issue. Removing `\nopagebreak` seems to make the errors go away but I don't think this is the right solution for me since the solution must work with long data tables in the context of a report using longtable. Please see below. ## Context I believe that this is really a LaTeX question and not an R question but some context might help. I am trying to generate a long report with multiple tables while adhering to principles of reproducible research by using R and the tables and Hmisc packages. I would like to dynamically create a table with frequency counts of observations across multiple factored variables with some vertical space between each factored variable. The tables package helps me do that using a nice formula interface, reminiscent of SAS proc tabulate. The `RowFactor()` function with the `suppressfirst=FALSE` and `spacing=X` arguments produces the necessary output provided I specify `nopagebreak = ""` instead of `nopagebreak = "\\nopagebreak "` or if I use a tabular environment instead of the longtable package. Unfortunatley, some of my tables are long and span page breaks. The tables package supports the LaTeX **longtable** package, as implemented on pages 26-28 of the tables vignette; but it doesn't seem to work with my data tables or with my minimal reproducible example. ## Reproducible R/Sweave code:               \documentclass{scrartcl}     \usepackage{longtable}     \usepackage{booktabs}          \begin{document}     \SweaveOpts{concordance=TRUE}     \section{Table test}          <<test, echo=TRUE, results=tex>>=     options(width=80)     require(tables)     set.seed(10)     df <- data.frame(id=seq(1,3,1),                       m=sample(month.name, 3, replace=TRUE),                       l=sample(LETTERS, 3, replace=TRUE),                       nums=sample(1:100, 3, replace=TRUE))     latex(       tabular(         RowFactor(m,                    suppressfirst=FALSE,                   ## default argument                   nopagebreak = "\\nopagebreak ",                   ## works if specify the following                   #nopagebreak = "",                   spacing=3)         +RowFactor(l,                    suppressfirst=FALSE,                   ## default argument                   nopagebreak = "\\nopagebreak ",                   ## works if specify the following                   #nopagebreak = "",                   spacing=3)         +RowFactor(nums,                     suppressfirst=FALSE,                    ## default argument                    nopagebreak = "\\nopagebreak ",                    ## works if specify the following                    #nopagebreak = "",                    spacing=3) ~1, data=df),        options=list(tabular="longtable")     )          @     \section{Session info}     <<sessionInfo>>=     sessionInfo()     @               \end{document}


title: How to customize the font and margin for lstlistoflistings TOC entry?

text: In my LaTeX template, I define the chapter and section TOC entry with the `titletoc` package:               \titlecontents{chapter}[0pt]{\vspace{.1\baselineskip}\bfseries}         {\thecontentslabel\hspace{2.8mm}}{}         {\hspace{.5em}\titlerule*[5pt]{$\cdot$}\contentspage}      But I don't know how to apply this to the `listing` environment. I guess it would be:               \titlecontents{listing}[0pt]{\vspace{.1\baselineskip}\bfseries}         {\thecontentslabel\hspace{2.8mm}}{}         {\hspace{.5em}\titlerule*[5pt]{$\cdot$}\contentspage}      But I am wrong. Does anyone know how to do that? I need to ensure that the TOC entry style is consistent.


title: New to MiKTeX: Errors when updating and compiling

text: I've just migrated from MacTeX (on 10.7) to MiKTeX 2.9 (Windows 7) and I'm getting some pretty nonproductive errors. I'm using the "Basic" MiKTeX install (via `basic-miktex-2.9.4407.exe`) and I have not manually altered the distribution in any way. This is a completely out-of-the-box install. Whenever I try to update MiKTeX via the "Update" program, I get the following error:               The operation could not be completed for the following reason:     Windows API error 5: Access is denied.     Details: C:\      When I try to install a package that I don't currently have, I get the following error:               pdflatex.EXE: Windows API error 5: Access is denied.      Basically, whenever I try to do anything in MiKTeX I get some flavor of the `Windows API error 5: Access is denied.` error. Further searching/Googling of the internet and document hasn't yielded any specific results or potential fixes. I'm new to Windows (and MiKTeX, for that matter), so I'm kind of puzzled on what's going on and how to fix it.


title: Nested enumerate list, Page breaks

text: I am currently writing a multiple choice exam: There is a enumerated list for the question number and then a nested list for the choices within each multiple choice question:   1\. Question 1   a)   b)   c)   d)   2\. Question 2   a)   b)   c)   d) ...   With a long list of questions, it is common that the choices to a particular question become separated between pages. The most straightforward way to fix this problem is to just write `\newpage` where ever the break occurs. I am wondering if there is a better way? Is it possible to change (or create a new) envirement that always groups the choices so that they never get separated between pages?


title: Remove "abstract name" in abstract (cyr)

text: In Remove "Abstract" title from Abstract people were able to remove the abstract name from abstract. I downloaded an article template with colored fonts from HowToTeX.com, changed it a little to accept cyr symbols (russian) and now the abstract name doesn't go away!               %%%%% Preamble     \documentclass[10pt,a4paper]{article}          \usepackage[T2C]{fontenc}     \usepackage[bitstream-charter]{mathdesign}          \usepackage[cp1251]{inputenc}                           % Input encoding     \usepackage{amsmath}                                    % Math          \usepackage[english,russian]{babel}          \usepackage{xcolor}     \definecolor{bl}{rgb}{0.0,0.2,0.6}                \usepackage{sectsty}     \usepackage[compact]{titlesec}      \allsectionsfont{\color{bl}\scshape\selectfont}          %%%%% Definitions     % Define a new command that prints the title only     \makeatletter                           % Begin definition     \def\printtitle{%                       % Define command: \printtitle         {\color{bl} \centering \huge \sc \textbf{\@title}\par}}     % Typesetting     \makeatother                            % End definition          \title{Гибридные вложенные сети Петри \\              \large \vspace*{-10pt} Описание нового формализма\vspace*{10pt}}          % Define a new command that prints the author(s) only     \makeatletter                           % Begin definition     \def\printauthor{%                  % Define command: \printauthor         {\centering \small \@author}}               % Typesetting     \makeatother                            % End definition          \author{%         Калашников Антон Олегович \\         akalashnikov@hse.ru \\         \vspace{20pt}         }          % Custom headers and footers     \usepackage{fancyhdr}         \pagestyle{fancy}                   % Enabling the custom headers/footers     \usepackage{lastpage}            % Header (empty)         \lhead{}         \chead{}         \rhead{}         % Footer (you may change this to your own needs)         \lfoot{\footnotesize \texttt{HowToTeX.com} - Template}         \cfoot{}         \rfoot{\footnotesize page \thepage\ of \pageref{LastPage}}  % "Page 1 of 2"         \renewcommand{\headrulewidth}{0.0pt}         \renewcommand{\footrulewidth}{0.4pt}          % Change the abstract environment     \usepackage[runin]{abstract}            % runin option for a run-in title     \setlength\absleftindent{30pt}      % left margin     \setlength\absrightindent{30pt}     % right margin     \abslabeldelim{\quad}                       %      \setlength{\abstitleskip}{-10pt}     \renewcommand{\abstractname}{}     \renewcommand{\abstracttextfont}{\color{bl} \small \slshape}    % slanted text               %%% Start of the document     \begin{document}     %%% Top of the page: Author, Title and Abstact     \printtitle           \printauthor          \begin{abstract}     Здесь будет короткое описание проделанной работы и выводы.     \end{abstract}          %%% Start of the 'real' content of the article, using a two column layout     \section{Heading on level 1 (section)}     Some text.         \begin{split}         (x+y)^3     &= (x+y)^2(x+y)\\                         &=(x^2+2xy+y^2)(x+y)\\                         &=(x^3+2x^2y+xy^2) + (x^2y+2xy^2+y^3)\\                         &=x^3+3x^2y+3xy^2+y^3         \end{split}                      \end{align}     Some text.          \subsection{Heading on level 2 (subsection)}     Some text.      \begin{align}         A =          \begin{bmatrix}         A_{11} & A_{21} \\         A_{21} & A_{22}         \end{bmatrix}     \end{align}          \subsubsection{Heading on level 3 (subsubsection)}     Some text.          \paragraph{Heading on level 4 (paragraph)}     Some text.               \section{Lists}     \subsection{Example for list (itemize)}     \begin{itemize}         \item First item in a list          \item Second item in a list          \item Third item in a list     \end{itemize}          \subsubsection{Example for list (3*itemize)}     \begin{itemize}         \item First item in a list              \begin{itemize}             \item First item in a list                  \begin{itemize}                 \item First item in a list                  \item Second item in a list                  \end{itemize}             \item Second item in a list              \end{itemize}         \item Second item in a list      \end{itemize}          \subsection{Example for list (enumerate)}     \begin{enumerate}         \item First item in a list          \item Second item in a list          \item Third item in a list     \end{enumerate}          \subsubsection{Example for list (3*enumerate)}     \begin{enumerate}         \item First item in a list              \begin{enumerate}             \item First item in a list                  \begin{enumerate}                 \item First item in a list                  \item Second item in a list                  \end{enumerate}             \item Second item in a list              \end{enumerate}         \item Second item in a list      \end{enumerate}          \end{document}


title: Missing $ inserted while adding resizebox

text: This is probably a noob error. I get a "Missing $ inserted" error when compiling the following code:               \item $%     \begin{array}{c}     w_{M}>w_{F} \\      \text{or }w_{F}>w_{M}%     \end{array}%     :\left\{      \resizebox{6.3cm}{!}{%     \begin{array}{l}     \text{the one earning more will continue working, } \\      \text{whilst the one earning less will} \\     \text{go on if }w>\eta \text{, otherwise he/she }\\     \text{will drop out and provide homecare}%     \end{array}%     }     \right. $      I tried to solve it by adding `$` signs anywhere I though it would be correct, but I was not able to get rid of the error. I also tried removing all `$`. Nevertheless, if I skip this error while compiling, the result is precisely the one I wanted. EDIT: Thank you. It turns out I was using resizebox in the wrong way. The right code is               \item $     \begin{array}{c}     w_{M}>w_{F} \\      \text{or }w_{F}>w_{M}%     \end{array}%     :\left\{      \resizebox{6.3cm}{!}{%     $     \begin{array}{l}     \text{the one earning more will continue working, } \\      \text{whilst the one earning less will} \\     \text{go on if }w>\eta \text{, otherwise he/she }\\     \text{will drop out and provide homecare}%     \end{array}%     $     }     \right. $


title: Remove ugly borders around clickable cross-references and hyperlinks

text: I know that I can use `hyperref` to make cross-references and hyperlinks clickable. That makes the clickable areas outlined in fluorescent green, however. How can I make the green boxes go away?


title: Disabling the colored box surrounding links in hyperref

text: > **Possible Duplicate:**   >  Remove ugly borders around clickable crossreferences and hyperlinks I don't want that my links would have a colored box around them. Currently what I do is               \usepackage[colorlinks,urlcolor=black]{hyperref}      or               \usepackage[pdfborder=0]{hyperref}      But both doesn't seem right. How can I explicitly disable the colored box? The manual implies that setting `pdfborder` to `0` is the correct way to do that, but maybe there's still a better way. > The style of box around links; defaults to a box with lines of 1pt > thickness, **but the`colorlinks` option resets it to produce no border**. But I still didn't see any explicit way to disable it.


title: Changing PDF links style

text: > **Possible Duplicate:**   >  Remove ugly borders around clickable crossreferences and hyperlinks When I generate PDF, a red border surround all links (internal and external).   * Which package draws this borders around links automatically ?    * How I can change this behavior, so link text become blue, instead of putting in box?


title: How to add hyperlink in Latex generated pdf (without a surrounding bluebox)

text: > **Possible Duplicate:**   >  Remove ugly borders around clickable crossreferences and hyperlinks I want to generate a pdf from latex with hyperlinking text - i.e. when some part of text in the pdf is clicked, the associated URL should be opened. I know that this could be done by `\href{webpage address}{(My Text)}` but this generates a blue box around the text. I don't want to see the blue box around, just when the user moves the mouse cursor over it, I want to show the hand cursor - and then the user can click to visit the link. How can this be done?


title: Red box around \nameref{}

text: > **Possible Duplicate:**   >  Remove ugly borders around clickable crossreferences and hyperlinks               \usepackage{hyperref}          \section{some text} \label{reftext}     .     .     \nameref{reftext}      Usage of `\nameref{}` creates a red box around the section header. Is it possible to replace the box with underline or just highlight the test to show that it is hyper-linked. When I create a TOC for sections it puts a same redbox around the section headings in TOC thanks Aku


title: Get rid of box around URL with hyperref

text: > **Possible Duplicate:**   >  Remove ugly borders around clickable cross-references and hyperlinks Let's say we have document with url:               \documentclass[a4paper,10pt]{article}     \usepackage{hyperref}     \begin{document}     \url{http://tex.stackexchange.com/}     \end{document}      How to get rid of box around url (and ensure it's black) ? (pdflatex)


title: How to remove the red boxes around toc

text: This is in with regards to the below post How to add an extra level of sections with headings below \subsubsection The code works flawlessly. But do I remove the red frame boxes which cover the entries in table of content? Sorry about the stupid question but I am new to latex and just trying to learn ... MB


title: Format Table of Contents

text: > **Possible Duplicate:**   >  Remove ugly borders around clickable crossreferences and hyperlinks I downloaded a Latex model to build my finishing degree course, but the summary came in a strange format, like in image, each section became a link with a red tectangle around it. ![Summary](http://i.stack.imgur.com/AypXe.png) I took a look at the code and didn't find out how to take it off this red rectangles. These are the packages in the file:               \documentclass[svgnames,12pt,oneside, openright,a4paper]{scrbook}     \usepackage[section]{placeins}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{tikz,blindtext}     \usepackage[T1]{fontenc}     \usepackage{palatino}     \usepackage{chngpage,calc}     \usepackage{hyperref}         \usepackage{kpfonts}     \usepackage{conf}     \usepackage{graphicx}     \usepackage[portuguese, english, brazil]{babel}      \usepackage{setspace}     \usepackage{cite}      Can anyone help me?


title: Red boxes around hyperlinks

text: I am getting red boxes around hyperlinks on the PDF output. Apparently contrary to this question the boxes are actually part of the final PDF, as when I save a copy of the PDF the red boxes remain. I think the problem is coming from the only error I get on build:               ! Package hyperref Error: Wrong DVI mode driver option 'hypertex'      which I believe has been produced since changing from LaTeX>>DVI to LaTeX>>PDF Using TeXnic Center and the following packages:               \documentclass[a4paper,twoside,10pt]{report}     \usepackage[hypertex]{hyperref}     \usepackage[USenglish]{babel} %francais, polish, spanish, ...     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage[ansinew]{inputenc}     \usepackage{lmodern} %Type1-font for non-english texts and characters     \usepackage{caption}          \renewcommand{\labelitemii}{$\star$}     \begin{document}


title: How to make a vertical/horizontal line cap independent of how the paths lies?

text: Is it possible to make the line cap in TikZ always be vertical (or horizontal or a 90 degree edge)? Maybe as an option to `line cap` or even better as an arrow tip. I imagine a type `vertical` resulting in some thing like this ![vertical](http://i.stack.imgur.com/RRY95.png) `horizontal` could look like this   ![horizontal](http://i.stack.imgur.com/8BdFO.png) and a `90 degree corner`, which is rotate so that one of it’s edges is parallel to the horizon. (Other that the `triangle 90 degree cap`.)   ![90 degree corner](http://i.stack.imgur.com/7tcml.png) I created the images with a clipping, but clipping the path is no option …


title: How can I prevent LaTeX from breaking inline formulas globally?

text: I am using the `acmsmall` template and my inline formulas are being broken at equal signs and arrows; how can I prevent them from being typeset like that globally (i.e. without having to put tildes everywhere)? ![Screenshot](http://i.stack.imgur.com/UgJC9.jpg)


title: How do I keep a string of text together without it doing a line break?

text: I'm writing up a long paper, in which in prose I have various equations. However, I do not want a line break to occur within the equation - I want the equation to stick together. I want to do this without displaying the equation, though. Is there a way to do this?


title: How do I export adjustbox-parameters?

text: I have got two `adjustbox`es (from the adjustbox package). Now I need to give the second box the same totalheight as the one which the first box got.               \documentclass{article}     \usepackage{etex}     \usepackage[etex=true,export]{adjustbox}     \begin{document}          \begin{adjustbox}{width={\textwidth},totalheight={8cm},keepaspectratio}     ...some content ...     \end{adjustbox}          (In between is some text and a page break.)          \begin{adjustbox}{totalheight={<the same as in the first adjustbox>},keepaspectratio}     ...other content...     \end{adjustbox}          \end{document}      I can't use the `8cm` (in the real document there is another variable instead of a fixed value), because the height might be smaller if the box needed to be scaled down because it was too wide. Adjustbox says that `\totalheight` would contain this height, but how do I export this to be re-used in the second box?


title: Visualizing correct page lengths with 'layouts' and 'tikz' packages?

text: I am currently working on a project with `xelatex`/`fontspec` and tikz, and so, this example is basically the same as the one from layouts package reads all length as zero with tikz/fontspec/xelatex?. Basically, I'm trying to typeset some text - and then, using the `layouts` package to draw a visualization of the page, in a `tikz` node aligned to the upper right corner of "the paper size" ( _as opposed to "the page", which would refer to the space within the margins of the ... well... the page`:)`_). The problem - everything seems to work as expected for A4 size; but things seem strange when switching to A5. Here is the MWE (test.tex), formulated for A4 page, and compiled with `xelatex test.tex`:               \documentclass[12pt,a4paper]{article}          \usepackage[pass]{geometry}     \usepackage{tikz,enumitem}          \usepackage{fix-cm}          \usepackage{fontspec}     \defaultfontfeatures{Ligatures=TeX}     \setmainfont{Junicode}          \usepackage{layouts}          \usepackage{etoolbox}     \patchcmd{\drawpage}{\ifdrawparameters}{\iftrue}%       {\typeout{^^J*******\string\drawpage fixed*******^^J}}%       {\typeout{^^J*******\string\drawpage not fixed*******^^J}}          \usepackage{lipsum}                    \begin{document}               \lipsum[1]          Trying          some          text                    \begin{tikzpicture}[overlay,remember picture,inner sep=0pt,yscale=-1,outer sep=0pt,anchor=north west]            \begin{scope}[shift={(0pt,0pt)}]% layer1            %\path[..] (0,0) node[below right] (dbg) {% this goes to (0,0) - but after margin       %\path[..] (current page.north west) node[below right] (dbg) {% this goes to (0,0) - but before margin; that is, upper right corner of paper size            \path[anchor=north west] (current page.north west) node[below right] (dbg) {%           \begin{minipage}{\paperwidth}%             \setlayoutscale{1} % {1} for A4; {0.7} for A5             %             \printparametersfalse % do not print table of parameters at end; no effect on \drawpage             \printheadingsfalse % do not print the "The circle is at 1 inch from the ... " headings; works only for \pagedesign             \drawdimensionstrue %             %     %           \trypaperwidth{\paperwidth}     %           \trypaperheight{\paperheight}     %           \tryhoffset{\hoffset}     %           \tryvoffset{\voffset}     %           \tryoddsidemargin{\oddsidemargin}     %           \tryevensidemargin{\evensidemargin}     %           \trymarginparwidth{\marginparwidth}     %           \trymarginparsep{\marginparsep}     %           \trymarginparpush{\marginparpush}     %           \trytopmargin{\topmargin}     %           \tryheadheight{\headheight}     %           \tryheadsep{\headsep}     %           \tryfootskip{\footskip}     %           \trytextheight{\textheight}     %           \trytextwidth{\textwidth}     %           \trycolumnsep{\columnsep}     %           \trycolumnseprule{\columnseprule}             \currentpage % "collects together the page parameter settings for the current document for the page on which it is issued."             \currentparagraph % "sets the drawing parameters to the settings for the current document."     %         \drawpage             \pagedesign %     %         \pagediagram %           \end{minipage}       }%path       ;            \end{scope}          \end{tikzpicture}               \end{document}      Note that above, I've written and commented the `\try...` commands, to keep in mind that that is what the `\currentpage` macro should do - and to also keep in mind, that if I specificially set a length there, then the produced page layout diagram should be modified accordingly ( _as much as I can understand the documentation,`layman.pdf`, that is_) When this document is built (after running `xelatex` twice), I get the following pdf ( _click on images for full size_ ): ![](http://i.stack.imgur.com/NLIQy.png) Now, I'm not sure if paragraph text should be typeset in the `\headsep` space below the header - but other than that, diagram seems reasonable to be. Ok, now, let's just replace document class to A5 paper size:               \documentclass[12pt,a5paper]{article}     ...      ... after compiling twice, one can see something is not right in the pdf: ![](http://i.stack.imgur.com/SGc6E.png) To me, it looks like the `layouts` package still draws dimensions and lengths for A4 - even if the page should be now changed to A5 ! So, I thought, OK , lets also modify the layout scale, so we'd now have:               \documentclass[12pt,a5paper]{article}     ...             \setlayoutscale{0.7} % {1} for A4; {0.7} for A5     ...      ... which results with the following PDF, when compiled twice: ![](http://i.stack.imgur.com/JNfyY.png) Again, this looks sort of reasonable - but I've scaled dimensions manually, "by eyeballing", which I don't like; and also text runs outside of the right body margin, and doesn't start exactly at top body margin. Finally, if in this case I try to do something very obvious, such as enabling a statement like `\tryheadheight{50pt}` from the `\try..` statements there - there is absolutely no change in the drawn height of the header. So, if there is a right way in using the `layouts` package, so I get accurate lengths visualization in this case, I'd love to know it - but I guess, all this should tell me that, unfortunately, I actually cannot get accurate visualization of dimensions with `layouts` package? Can anyone please confirm? Many thanks in advance for any asnwers,   Cheers!


title: biblatex: Mixing biblatex-dw styles with other styles

text: I use `biblatex` with `style=footnote-dw` for my citations displayed with `\cite{key}`. But now I want to use `\printbibliography` as if I have used `style=numeric` in the optional parameter of the `biblatex` package.


title: How to keep aspect ratio of marks in TiKZ plot when using different xscale and yscale?

text: I would like to scale my TiKZ plots using different scale for X axis and Y axis. The problem I had is the plot markers size are affected by the scale and do not maintain the aspect ratio. How do I maintain aspect ratio of the plot markers? There is no problem with maintaining aspect ratio of nodes. Thank you in advance. ![sample image](http://i.stack.imgur.com/1urLT.jpg) Here is my code:               \documentclass{article}          \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{plotmarks,positioning,shapes,arrows,backgrounds}          \begin{document}          \begin{tikzpicture}[xscale=0.080,yscale=0.160]     \draw[step=20cm,gray!20,very thin] (0,0) grid (100,80);          \tikzstyle{neuron}=[circle,fill=black,minimum size=5pt,inner sep=0pt]     \tikzstyle{data}=[diamond,fill=red,minimum size=8pt,inner sep=0pt]     \tikzstyle{edge}=[dashed,thick,color=black!50]     \node[neuron] (n0) at (20.77, 61.16) {}; \node[neuron] (n1) at (70.78, 31.07) {};      \node[data] (d0) at (42.77, 21.16) {}; \node[data] (d1) at (52.78, 11.07) {};      \draw[edge] (n0) -- (n1);     \draw plot[only marks,mark=x,mark size=60pt,mark options={color=red,scale=1.0}] coordinates{     (62.46,25.59) (39.97,33.29) (60.67,39.50)       };     \draw plot[only marks,mark=*,mark size=60pt,mark options={color=black}] coordinates{     (59.56,62.57) (71.05,65.27)      };          \draw[->] (0,0) -- coordinate (x axis mid) (100,0);     \draw[->] (0,0) -- coordinate (y axis mid) (0,80);     \foreach \x in {0,20,...,100}     \draw (\x cm,1pt) -- (\x cm,-3pt) node[anchor=north,font=\footnotesize] {$\x$};     \foreach \y in {0,20,...,80}     \draw (1pt,\y cm) -- (-3pt,\y cm) node[anchor=east,font=\footnotesize] {$\y$};     \end{tikzpicture}          \end{document}


title: Mark 90 degree angle in tikz in german convention

text: What's the best way to denote a 90 degree angle with german convention like on the following picture in tikz: ![right angle](http://i.stack.imgur.com/ZkCth.png) Suppose I start with something like this:               \documentclass{article}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}        \coordinate (O) at (0,0); %        \coordinate (A) at (1,1); %        \coordinate (B) at (1,-1); %             \draw (O) -- (A); %        \draw (O) -- (B); %          \end{tikzpicture}               \end{document}


title: What does the command \@dblarg in a class?

text: In the definition of a command appears the declaration of `\@dblarg`, as follows: `\def\title{\@dblarg\CJ@title}`. What exactly does `\@dblarg` do?


title: How can I put the vertical line using multicolumn?

text: How can I fix the vertical lines?               \begin{landscape}         \begin{table}[htbp]         \caption{Cronograma de Actividades}         \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}         \hline          Objetivos & Actividades/Tiempo (meses) & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 \\ \hline         \multicolumn{1}{|c|}{Escoger zonas potenciales} & 1. Búsqueda de información&\\&         de mapas de LAI y &\\         & de tipos de cobertura  & X &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 2. Escoger lugares extremos &  & X & X &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 3.Escoger zonas intermedias &  & X & X &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 4. Seleccionar los mapas&\\         & a relacionar con&         \\ &las variables atmosféricas &  &  & X &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ \hline         \multicolumn{ 1}{|c|}{Definir los transectos} & 1. Búsqueda de información&\\          &de DEMs y datos atmosféricos & X &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 2. Análizar las variables&\\          &atmosféricas y las topográficas &  & X & X & X &  &  &  &  &  &  &  &  &  &  &  &  &  & \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 3. Establecer los ríos aereos& \\         &de humedad atmosférica &  &  &  & X & X & X &  &  &  &  &  &  &  &  &  &  &  &  \\ \hline         \multicolumn{ 1}{|c|}{Evaluar la influencia} & 1. Búsqueda de información&\\          &de evapotranspiración y &\\         &de temperatura atmosférica & X &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 2. Realizar gráficas de&\\          &P Vs distancia, P Vs Cobertura,&\\          &P Vs LAI, P Vs T y P Vs ETP &  &  &  &  &  & X & X & X & X & X &  &  &  &  &  &  &  &  \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 3. Explicar mediante principios&\\          &físicos los resultados obtenidos &  &  &  &  &  &  &  & X & X & X & X & X &  &  &  &  &  &  \\ \hline         \multicolumn{ 1}{|c|}{Otros objetivos} & 1. Elaboración de informes&\\         & escritos y artículos  &  &  &  &  &  &  &  &  &  &  &  & X & X & X & X & X & X & X \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 2. Revisión de los resultados&\\          &obtenidos y ajustes &\\         &que sean necesarios &  &  &  &  &  &  &  &  &  &  &  & X & X & X & X & X &  &  \\ \cline{ 2- 20}         \multicolumn{ 1}{|c|}{} & 3. Exposiciones, reuniones&\\          &y discusiones & X & X & X & X & X & X & X & X & X & X & X & X & X & X & X & X & X & X \\ \hline         \end{tabular}         \label{actividades}         \end{table}         \end{landscape}      ![Vertical lines problem](http://i.stack.imgur.com/CGpKj.png)


title: Matlab->plot2svg->Inkscape->pdf+latex->includesvg = slow rendering pdf + large file. How to solve that?

text: I have the following workflow. I use matlab to produce 3D plots with transparency and I want to use the workflow of setting the text inside the figure in latex. I am using Texniccenter and MikTex the most recent versions my driver is pdflatex. I use the matlab central funktion plot2svg to export my plot into svg. Than I use Inkscape to generate the pdf and the corresponding tex file. This generated pdf is already 3.5 MB large. I have two surfaces plotted with transparency. Maybe that's why the file is that large. My whole pdf resulting from my latex project is about the same size. Of course if I use the includegraphics function with inside the picture environment and the the final pdf is larger than 6 MB. So if I have 10 pictures I already get a file more than 30 MB. So far so good. But if I open the file and navigate to the corresponding figure I can watch how the picture gets renderred. This takes several seconds. Is there a way how to rreduce the file sizes maybe before including it into my document? Thanks for your suggestions


title: Why does url.sty appear in 3 different places in the TeX Directory Structure?

text: On my up-to-date MiKTeX system, there is a copy of `url.sty` in three different places in the TDS:   * `texmf\tex\xelatex\xetexurl` (part of MiKTeX package `xetexurl`, packaged on 2007-Sep-05)   * `texmf\tex\latex\url` (part of MiKTeX package `url`, packaged on 2010-Jan-26)   * `texmf\tex\latex\ltxmisc` (part of MiKTeX package `ltxmisc`, packaged on 2012-Dec-20) The first one (in `xetexurl`) is version 3.1; the other two are version 3.3. Why does the package exist in 3 different locations? Given that this is the case, how does the TeX program know which one to use? It seems that when I run `pdfLaTeX` or `LuaLaTeX`, it chooses the one from `ltxmisc`, giving log entry               Package: url 2006/04/12  ver 3.3  Verb mode for urls, etc.      while when running `XeLaTeX` it chooses the one from `xetexurl`, giving this log entry:               Package: url 2004/03/15  ver 3.1  Verb mode for urls, etc.      Why the discrepancy?


title: Digit grouping -- Apostrophe or space as decimal point

text: Today, I had to deal with large number blocks with >10 digits. With my current setup, the whole number is shown without any grouping or decimal point, making it hard to read them, especially when they contain large amounts of zeros. My preamble:               \documentclass[paper=a4, fontsize=12pt,]{scrartcl}      % Für Spracheingaben und korrekte Trennung     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}      \usepackage[ngerman]{babel}          % Matherelevante Pakete     \usepackage[decimalsymbol=comma]{siunitx}     \usepackage{icomma}     \usepackage{amsmath}          % Sonstige Parameter     \setlength{\parindent}{0pt}     \numberwithin{equation}{subsection}      As you can see, I’m using commas as the regular decimal symbol, so a comma as a decimal point wouldn’t make too much sense. Anyway, how do I get digits to be grouped automatically? So far, I’ve been using the following, manual way to achieve spacing between larger numbers, but that isn’t too comfortable:               \sqrt[2]{1,6 \cdot 10^{13}} = \sqrt[2]{16\,000\,000\,000\,000} &= 4\,000\,000\\      ![intended ouput](http://i.stack.imgur.com/fmLEL.png) So my question is: How do I get automatic digit grouping with the decimal point being either an apostrophe or a non-braking space?