title: List of appendices without chapter titles

text: This was somewhat similar to what I am looking for, but not exactly: How to make appendices behave like sections in ToC I would like for my appendices to do the following:   1. One chapter in the ToC for all appendices   2. Appendices behave like sections and are labeled A, B, C, etc.   3. \ref command inserts the appendix label, not a number   4. Appendices have their name and label in the page header, no need for chapter, section or other headings. The resulting ToC would look like this:               Some Chapter 1         Some section 1     Some Chapter 2         Some section 2     Appendices         Appendix A - Some name         Appendix B - Some name 2         etc.      Currently I can only reproduce this behaviour by adding the content lines manually, using phantom sections to get the page numbers correct and manual naming for the ToC lines and headers. This leads to a problem that my labels and references use numbers instead of the letters defined for the counter. With the command below I would have to define the header for each appendix manually.               \refstepcounter{AppCounter}     \phantomsection\addcontentsline{toc}{section}{Appendix \Alph{AppCounter} - Some name}     \includegraphics ...     \label{app:appA}      The other problem with using appendix package is that I could not figure out how to have appendix labels without chapters/sections. And chapter/section commands add the text to the page, which is something I have no use for.


title: How can I use -max-print-line in pdftex (TexLive)?

text: I know that Miktex has an option -max-print-line=n to change the width of the output. I wondered if something like that existed for pdftex from TexLive ? I'm on Gentoo. It is very annoying to have a tool using only half the width of the screen... Thanks


title: Mac OS LaTeX install not compiling bibliography

text: I have recently installed LaTeX on my Mac using the standard MacTeX package. I have 2 documents (my thesis and a paper I'm writing) and I have tried to compile both. Neither will compile the references or the bibliography... I keep getting the same error > Citation undefined, Undefined references, I have the following code ### `testDoc.tex`:               \documentclass[a4paper]{article}     \usepackage[T1]{fontenc}     \usepackage[applemac]{inputenx}               \begin{document}          This is my first document with a bibliography generated by Bib\TeX. Now I cite an article by Duffie\cite{Duffie2001}.          \bibliographystyle{plain}     \bibliography{foo}              \end{document}      In the same folder I have a `foo.bib` file. ### `foo.bib`               @BOOK{Duffie2001,     title = {{Dynamic Asset Pricing Theory}},     year = {2001},     author = {Duffie, Darrell},     edition = {3}     }      Please note that this is just a simple example. My thesis has 100 references and my paper has 48. When I compile that simple document it gives me the error :               LaTeX Warning: Citation `Duffie2001' on page 1 undefined on input line 7.     No file testDoc.bbl.      However I have not referenced a file `testDoc.bib` but `foo.bib` If I rename `foo.bib` to `testDoc.bib` I get that same error. * * * Things I have tried   * I have tried 3 different editors each has the same error, Texmaker is my favourite and is the one I'm trying to get working   * I have checked the settings to ensure that Texmaker is pointing at the `bibtex` program, it is (I think) `/usr/local/texlive/2012/bin/x86_64-darwin/bibtex %.aux` Could anyone point me in the right direction?


title: Unwanted indentation in custom environment inside tabular

text: I created two custom environment and a custom command to easily display an overview of modules and classes they contain in tabular format. However, I end up with unwanted indentation for the the first class name in each module. How can I remove this indentation? Example:               \documentclass[12pt]{article}          \usepackage{multirow}     \usepackage{etoolbox}          % PREAMBLE          %     % ===================== %     % Module overview table %     % ===================== %     \newenvironment{moduleoverview}{%         \begin{tabular}{|c|c|}             \hline                 \textbf{Module} &                  \textbf{Class}             \\ \hline     }     {%         \end{tabular}     }          \newtoggle{firstmtclass}     \newenvironment{momodule}[2]{%         % First argument: module name         % Second argument: number of classes in module         \multirow{#2}{*}{%             #1           }         &            \toggletrue{firstmtclass}     }     {%         \hline     }          \newcommand{\moclass}[1]{%         % First argument: class name         \iftoggle{firstmtclass}{%             \togglefalse{firstmtclass}         }{%             &         }             #1         \\     }          \begin{document}          \begin{moduleoverview}         \momodule{Module name A}{2}             \moclass{class name 1}             \moclass{class name 2}         \endmomodule         \momodule{Module name B}{3}             \moclass{class name 3}             \moclass{class name 4}             \moclass{class name 5}         \endmomodule     \end{moduleoverview}          \end{document}      Produces: ![enter image description here](http://i.stack.imgur.com/u0ATk.png)


title: How to arrange a large picture on the side on the current page?

text: I have a decorative picture that I want to display on the right side current page. The picture should fill the whole vertical length of the text body (maybe even 1cm larger). The picture is long and narrow, so I imagine it to leave about 1/3rd on its right side for the text. So a right sketch of the pages would look like that:               +------------------+  +------------------+  +------------------+      |                  |  |            \/\/\/|  |                  |     |  the quick brow  |  |  whole pag /\/\/\|  |  And This  page  |     |  n fox jumps ov  |  |  e. It  is \/\/\/|  |  has normal lay  |     |  er the lazy do  |  |  longer th /\/\/\|  |  out again.      |     |  g. Franz fährt  |  |  en one pa \/\/\/|  |                  |     |  im Taxi quer d  |  |  ge but co /\/\/\|  |                  |     |  urch Bayern. T  |  |  ntains  a \/\/\/|  |                  |     |  his is just  a  |  |  long tikz /\/\/\|  |                  |     |  standard  text  |  |  picture s \/\/\/|  |                  |     |  that fills the  |  |  omewhere. /\/\/\|  |                  |     |                41|  |            \/\/42|  |                43|     +------------------+  +------------------+  +------------------+       I use tikz to generate that picture:               \begin{tikzpicture} [scale=0.3,         every node/.style={shape=circle, fill=black!30},     ]           \node at (17,-20) {};      \node at (2,-19) {};     %...      \node at (16,42) {};      \node at (8,43) {};      \node at (28,44) {}; % 20.4.2014      \node at (13,45) {};     %...      \node at (17,75) {};      \node at (2,76) {};      \node at (22,77) {};      \node at (13,78) {};      \node at (26,79) {};          \draw[draw=black!20,thick]      (0,-20) -- (0,80)      (14,-20) -- (14,80)      (21,-20) -- (21,80)      (28,-20) -- (28,80)     ;          \path[draw=black!100,very thick,every node/.style={sloped,anchor=south,auto=false}]      (7,-20) edge node {1.April} (7,80) % 1.4.     ;          \path[draw=black!100,very thick,every node/.style={sloped,anchor=south,auto=false}]      (-1,44) edge node {2014} (33,44) % 1.4.     ;          \end{tikzpicture}


title: Tikz: shading region bounded by several curves with previously named path tikz

text: This two questions have been answered sepatly it should be interesting to be able to shade a region using previously named path. Is there a possibility to combine this two macros ? ![enter image description here](http://i.stack.imgur.com/ExVcl.png)               \documentclass[tikz]{standalone}     \usetikzlibrary{intersections}          %%%% Tikz: shading region bounded by several curves     %%%% thanks to Qrrbrbirlbel     %%%% http://tex.stackexchange.com/questions/140312/tikz-shading-region-bounded-by-several-curves     \tikzset{       saveuse path/.code 2 args={         \pgfkeysalso{#1/.style={insert path={#2}}}%         \global\expandafter\let\csname pgfk@\pgfkeyscurrentpath/.@cmd%         \expandafter\endcsname           % not optimal as it is now global through out the document         \csname pgfk@\pgfkeyscurrentpath/.@cmd\endcsname         \pgfkeysalso{#1}},/pgf/math set seed/.code=\pgfmathsetseed{#1}       }          %%%% Calling a previously named path in tikz     %%%% thanks to Andrew Stacey     %%%% http://tex.stackexchange.com/questions/26382/calling-a-previously-named-path-in-tikz     \makeatletter     \tikzset{       use path for main/.code={%         \tikz@addmode{%           \expandafter\pgfsyssoftpath@setcurrentpath\csname tikz@intersect@path@name@#1\endcsname         }%       },       use path for actions/.code={%         \expandafter\def\expandafter\tikz@preactions\expandafter{\tikz@preactions\expandafter\let\expandafter\tikz@actions@path\csname tikz@intersect@path@name@#1\endcsname}%       },       use path/.style={%         use path for main=#1,         use path for actions=#1,       }     }     \makeatother          \begin{document}          \begin{tikzpicture}          \path[name path={Rond}] (0,0) circle (.5) ;     \draw[use path=Rond] ;          \begin{scope}[overlay]     \clip[saveuse path={A}{(0,0) circle (1.5)}] [preaction={fill=red!30}] ;     \path[saveuse path={B}{(0,0) circle (1 and 2)},dashed] [draw,preaction={fill=blue!30}];     \end{scope}          \path[A,B] ;          \end{tikzpicture}     \end{document}


title: hash-tag in \href causes error

text: I'm creating a `beamer` presentation. I want to put a link to a source which has a hash-tag in it (`#`). When I try to compile this I get an error:               ! Illegal parameter number in definition of \test.     <to be read again>                         }     l.91 \end{itemize}                        % ends low level     ? x      This is the line I'm using:               \href{http://highered.mcgrew-hill.com/classware/ala.do?isbn=0072956208&alaid=ala_1500202&showSelfStudyTree=true#}{source}      Is there a way around this?


title: Arrow half straight line half dotted

text: > **Possible Duplicate:**   >  Draw a path with dashed start and solid end Can anyone help me figure out how to draw an arrow that is half straight line and half dotted? Much appreciated!


title: Tikz positioning in matrices

text: Due to the help of some posts on StackExchange (mostly [1] and [2]) I think that I got the gist of categorizing matrix rows and columns with braces and separating them with lines in TikZ. However, I can't get the referencing of the positions in the draw command to work, strangely enough only within a certain matrices. The examples in the links (4x4 matrices) compile flawlessly, but the bigger matrix below doesn't. (I only exchanged the smaller matrices in the examples with the bigger matrix.)               \begin{tikzpicture}[decoration=brace,every left delimiter/.style={xshift=3pt},                         every right delimiter/.style={xshift=-3pt},node distance=-1ex]     \matrix [matrix of math nodes,left delimiter=(,right delimiter=),              row sep=0.5cm,column sep=0.5cm] (m) {         x & x & \otimes & x       & x       & x       &         &         &         &         &         &         & \\           &   &         & \otimes & x       &         & x       & x       &         & x       &         &         & \\                   x &   & x       &         & \otimes &         &         &         &         &         &         &         & \\           &   &         &         &         & \otimes & x       &         &         &         &         & x       & \\                &   &         &         &         &         & \otimes & x       &         &         &         & x       & \\           &   &         &         &         &         & x       & \otimes &         & x       &         &         & \\           &   &         &         &         &         &         &         & \otimes & x       &         &         & \\           &   &         &         &         &         &         &         & x       & \otimes & x       &         & \\           &   &         &         &         &         &         &         &         &         & \otimes & x       & \\           &   &         &         &         &         &         &         &         &         &         & \otimes & \\               &   &         &         &         &         &         &         &         &         & x       &         & \\                       &   &         &         &         &         &         &         &         &         & x       & x       & \\                   &   &         &         &         &         &         &         &         &         &         & x       & \\};     \draw[dashed] ($0.5*(m-1-2.north east)+0.5*(m-1-3.north west)$) --       ($0.5*(m-4-2.south east)+0.5*(m-4-3.south west)$);     \draw[dashed] ($0.5*(m-2-1.south west)+0.5*(m-3-1.north west)$) --       ($0.5*(m-2-4.south east)+0.5*(m-3-4.north east)$);     \node[above=10pt of m-1-1] (top-1) {a};     \node[above=10pt of m-1-2] (top-2) {b};     \node[above=10pt of m-1-3] (top-3) {c};     \node[above=10pt of m-1-4] (top-4) {d};          \node[left=12pt of m-1-1] (left-1) {$\alpha$};     \node[left=12pt of m-2-1] (left-2) {$\beta$};     \node[left=12pt of m-3-1] (left-3) {$\gamma$};     \node[left=12pt of m-4-1] (left-4) {$\delta$};          \node[rectangle,above delimiter=\{] (del-top-1) at ($0.5*(top-1.south) +0.5*(top-2.south)$) {\tikz{\path (top-1.south west) rectangle (top-2.north east);}};     \node[above=10pt] at (del-top-1.north) {$A$};     \node[rectangle,above delimiter=\{] (del-top-2) at ($0.5*(top-3.south) +0.5*(top-4.south)$) {\tikz{\path (top-3.south west) rectangle (top-4.north east);}};     \node[above=10pt] at (del-top-2.north) {$B$};          \node[rectangle,left delimiter=\{] (del-left-1) at ($0.5*(left-1.east) +0.5*(left-2.east)$) {\tikz{\path (left-1.north east) rectangle (left-2.south west);}};     \node[left=10pt] at (del-left-1.west) {$C$};     \node[rectangle,left delimiter=\{] (del-left-2) at ($0.5*(left-3.east) +0.5*(left-4.east)$) {\tikz{\path (left-3.north east) rectangle (left-4.south west);}};     \node[left=10pt] at (del-left-2.west) {$D$};          \end{tikzpicture}      Specifically, I get the error message "!Package pgf Error: No shape named m-4-2 is known.", which occurs in the first line where the dashed line is drawn. However, the shapes named m-1-3 and m-1-2 are known. I am out of my wits here, as I can't make a connection between the errors and the code that could be wrong. [1] How to Specify two level row and column labels of a matrix by braces? [2] Create a math matrix in TikZ partition lines


title: LaTeX does not render the picture?

text: I am a bit new LaTeX, so having some difficulties. I am writing a paper using the IEEtran template. I use the graphicx package to insert the figures: `\usepackage[pdftex]{graphicx}` I try to add the figure using the following code:               \begin{figure}[!t]     \centering     \includegraphics[width=2.5in]{testy.pdf}     \caption{Simulation Results.}     \label{fig_sim}     \end{figure}      The figure is in the same directory with the *.tex file But, after the tex file is complied, the borders of the figure show up in the resulting pdf, also the captions are there, but the picture itself in not rendered. There is a strange border with the name of the picture within it. What am I doing wrong?


title: Plain TeX and different hyperlink styles in dvi and pdf

text: I use the harvmac macros to write papers with plain TeX, and harvmac loads the hyperbasics file to enable hyperlinks. However I can't figure out why the hyperlinks have a different appearance in the dvi and the PDF files and I can't find where the defaults are defined so that I can change them. Furthermore, I get different styles for the hyperlinks in the pdf depending on how I compile to get the PDF. With the MWE below, the dvi file from `tex MWE.tex` has a blue hyperlink with no surrounding box (see image below), whereas the outcome of `dvips -z MWE.dvi; ps2pdf14 MWE.ps` has a black hyperlink inside a blue box. The outcome of `xetex MWE.tex` has invisible hyperlinks (black equation number, no surrounding box). I'd like to understand where these style definitions come from, since I prefer the DVI style and I'd like the PDF to be the same (blue equation number, no surrounding box). The macros from `hyperbasics.tex` do not seem to define any default, so out of luck I like the DVI style, but not the PDF style. So, how can I get the blue equation number with no box in the PDF file? MWE:               \input harvmac          \newsec{Some title}          One equation:     \eqn\ps{ A = 0}     Reference: See equation \ps.          \bye      In the DVI file: ![DVI style as seen with xdvi](http://i.stack.imgur.com/q3RFn.png) In the PDF file: ![enter image description here](http://i.stack.imgur.com/PppIr.png)


title: When I use \animate in beamer, how do I move back in my presentation?

text: Matthew Leingang just provided a nice example of beamer's `\animate` method. If in this example (don't want to repeat it here) I replace `\animate<2-10>` with `\animate<3-10>`, how will I then be able to move back from the last page to the _second_ page? (Moving to the first page is easy ...) I tried the navigation symbols, but to no avail.


title: How to use the Multi Bibliography resource from biblatex with beamer?

text: I am working with `beamer` and `biblatex`. I am writing a series of lectures and I want each one of them to have a separate bibliographical reference. I am running               pdflatex foo.tex      biber foo.bcf      pdflatex foo.tex      After that, something strange happens. If I run `pdflatex foo.tex` I get the following error message:               Package biblatex Error: Nested 'refsection' environment.       If I change the document class from `beamer` to `article`, everything works fine. The question is: How to fix this error? EDIT: I added a new MWE to illustrate what I want to do. The MWE: `foo.tex`               \documentclass{beamer}     \usepackage{biblatex}     \addbibresource{biblio.bib}     \begin{document}          \section{Chapter One}     \refsection     This is Chapter One.     \cite{goossens93}, \cite{lamport94}, \cite{rahtz89}      \printbibliography[heading=subbibliography]     \endrefsection          \newpage     \section{Chapter Two}     \refsection     This is Chapter Two.     \cite{lamport94}     \printbibliography[heading=subbibliography]     \endrefsection          \newpage     \section{Chapter Three}     \refsection     This is Chapter Three.     \cite{greenwade93}, \cite{patashnik88}, \cite{knuth79}     \printbibliography[heading=subbibliography]     \endrefsection          \end{document}      New MWE:               \documentclass{beamer}     \usepackage{biblatex}     \addbibresource{biblio.bib}     \begin{document}               \section{Chapter One}     \refsection     \begin{frame}     This is Chapter One.     \cite{goossens93}, \cite{lamport94}, \cite{rahtz89}      \printbibliography[heading=subbibliography]     \end{frame}     \endrefsection          \section{Chapter Two}     \refsection     \begin{frame}     This is Chapter Two.     \cite{lamport94}     \printbibliography[heading=subbibliography]     \end{frame}     \endrefsection          \section{Chapter Three}     \refsection     \begin{frame}     This is Chapter Three.     \cite{greenwade93}, \cite{patashnik88}, \cite{knuth79}     \printbibliography[heading=subbibliography]     \end{frame}     \endrefsection     \end{document}      The bibliography file is: `biblio.bib`               @book{goossens93,         author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",         title = "The Latex Companion A",         year = "1993",         publisher = "Addison-Wesley",         address = "Reading, Massachusetts"          }          @article{greenwade93,          author = "George D. Greenwade",         title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",         year = "1993",         journal = "TUGBoat",         volume = "14",         number = "3",         pages = "342--351",                url=" www.ctan.org"     }          @book{knuth79,         author = "Donald E. Knuth",         title = "Tex and Metafont, New Directions in Typesetting",         year = "1979",         publisher = "American Mathematical Society and Digital Press",         address = "Stanford"     }          @book{lamport94,         author = "Leslie Lamport",         title = "Latex: A Document Preparation System",         year = "1994",         edition = "Second",         publisher = "Addison-Wesley",         address = "Reading, Massachusetts"     }          @misc{patashnik88,         author = "Oren Patashnik",         title = "{B}ib{T}e{X}ing.  Documentation for General {B}ib{T}e{X} users",         year = "1988",         howpublished = "Electronic document accompanying BibTeX     distribution"     }          @techreport{rahtz89,         author = "Sebastian Rahtz",         title = "A Survey of {T}ex and graphics",         year = "1989",         institution = "Department of Electronics and Computer Science",         address = "University of Southampton, UK",         number = "CSTR 89-7"     }


title: showexpl LTXexample and references inside enumerate

text: I've used the wonderful `LTXexample` environment defined by `showexpl` to illustrate some LaTeX basics. However, the following code confuses it: the reference remains **??** no matter how many times I recompile...               \documentclass{article}     \usepackage{showexpl}     \begin{document}          \begin{LTXexample}[frame=none]       \begin{enumerate}       \item No need to manually number items here!       \item\label{second} Number two added automatically       \item Third item       \end{enumerate}       And here is a reference to item number \ref{second}     \end{LTXexample}          \end{document}      I've managed references inside `LTXexample` in equation environments, so this is something specific to enumerate... Any ideas how to fix it? (I can't even cheat and just put "2" because the code is shown side-by-side with it...) **UPDATE:** I emailed the author of `showexpl` but I've had no reply. Does anyone feel like delving into the code to see if it's obvious how to fix this?


title: Animating Protocols

text: I'm creating a `beamer` presentation on network protocols. I like to put very simple animations in the slides, like an **arrow** extending from sender to receiver, showing the flow of network messages. I saw LaTeX packages like `animate` which can do this. Yet I believe they are an overkill. Or, don't they? Well, I don't know. > Is there a simple way for doing what I'm after?


title: How can I layout images side by side to allow comparison?

text: I am very very new to TeX/LaTeX, I am writing my first document. So far, I love the way it shows everything. The learning curve is steep though. I have images that needs to be compared, so they must be close to each other. How can I achieve that? In the image below, you can see an example of what I want (I know it is ugly, that is why I am using LaTeX ;) ). I used subfig package, but it's main purpose looks like to caption subfigures. I do not want to caption them separately, it would lead to information duplication. It does not need to be exactly like in the image, I am open to suggestions. ![alt text](http://i.stack.imgur.com/Cl50P.png)


title: Centering table with 4 images in beamer

text: I am trying to center a table containing 4 images and a foot note in beamer (the lines are only for debug). This is the code I am using:               \documentclass[]{beamer}          \usepackage[spanish]{babel}     \usepackage[utf8]{inputenc} % acentos     \usepackage{listings} % incluir código     \usepackage{caption}  % titulos para los listings     \usepackage{color}     \begin{document}     \begin{frame}         \begin{centering}             \begin{tabular}{ | r | l | }                 \includegraphics[width=0.325\textwidth]{img/g2} &                 \includegraphics[width=0.325\textwidth]{img/g2Isodata} \\                 \includegraphics[width=0.325\textwidth]{img/g2Huang} &                 \includegraphics[width=0.325\textwidth]{img/g2Default} \\                 \multicolumn{2}{p{\dimexpr\textwidth-\tabcolsep\relax}}{\tiny \center Imagen binarizada mediante el algoritmo Isodata (arriba a la derecha), el algoritmo de Huang (abajo a la izquierda) y el algoritmo por defecto (abajo a la derecha)} \\                  \end{tabular}         \end{centering}     \end{frame}     \end{document}      This is however the result I am getting: ![enter image description here](http://i.stack.imgur.com/404uy.png) I dont understand why it behaves that way. How can I properly center that table?


title: How can I draw a tangent ending smoothly in a circle?

text: I'm trying to draw a tanget on a circle, but I'm not happy with the result I get from the `tangent` option. ![all](http://i.stack.imgur.com/hcM0b.png) particularly, I'd like to have the lines ending smoothly in the circle. The problem is shown enlarged here: ![enlarge1](http://i.stack.imgur.com/tdRMI.png) ![enlarge2](http://i.stack.imgur.com/AFZGq.png) Here is the code for this mininmal example               \documentclass{standalone}     \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}       \begin{tikzpicture}[thick]         \node[draw,circle,xshift=2.2cm] (big) [minimum size=25mm] {};         \node[draw,circle] (small) [minimum size=2mm] {};         \draw (small.south) -- (tangent cs:node=big,point={(small.south)});         \draw (small.north) -- (tangent cs:node=big,point={(small.north)},solution=2);        \end{tikzpicture}     \end{document}      I'd greatly appreciate any advice allowing me to do this!


title: Protecting negative spacing in math mode

text: I am using `\\!` to create negative spacings and put a dash over a symbol in math mode. (Here I am denoting missing transverse energy by defining a command `\met` where a dash is put across `E_T`, see code below.) This works well in most cases (when using `beamer`), but in the article class it can fail when lines are filled with additional space. Then the dash is no longer in the right position. Is there a better way to put the dash in place? Minimal example:               \documentclass{article}          \usepackage{xspace}     \usepackage{multicol}          \begin{document}            % \met has the negative spacing       \newcommand{\met}{\ensuremath{\not\!\!E_T}\xspace}            % fails here       \begin{multicols}{2}         A model for \met trigger rates.         Lorem ipsum dolor sit amet, consectetuer         adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,         adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu         libero, nonummy eget, consectetuer id, vulputate a, magna. Donec         vehicula augue eu neque.        \end{multicols}            % works here       A model for \met trigger rate prediction.       Lorem ipsum dolor sit amet, consectetuer       adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,       adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu       libero, nonummy eget, consectetuer id, vulputate a, magna.               \end{document}      PS: Feel free to put appropriate tags.


title: Hyphenation of terms containing symbols other than letters

text: I'm trying to hyphenate a chemical name and have come into difficulty. The word I'm trying to hyphenate is _poly(ethyeneglycol)_. I'm using `babel` and `inputenc`. I've tried specifying a custom hyphenation pattern using `\hyphenation{poly(ethylene-glycol)}` but it fails to complete. Being chemistry terminology I wondered if this was dealt with by a chemistry package such as `mhchem` but have not found a package that does it.


title: Refer to some equation number in different environments

text: I hope there is a solution for this. When I refer to some equation I always get something like `37`, but I would like to have `(37)`. I could make a new command but the problem is I use many kind of environments in my text: equation (needs `\eqref`), multline (needs `\ref`), theorems (need `\ref`). I don't want parantheses when referring to theorem numbers. Any advice is appreciated.


title: How I can put the title on the head on the left side and the name of the chapter on the right?

text: I'm working with Lyx, and I have the fancy style in the page layout. My document is printed on both sides. On the left side, I want to only have the title of the document and on the right the name of the chapter. Example:               Title of my thesis (left aligned) | Chapter 4. Chapter name (aligned right)      regards


title: How to change section/subsection font size?

text: I'm writing a paper that requires the section titles to be in `12pt` font, I can get the title to be in `12pt` using:               \section{\fontsize{12}{15}\selectfont Introduction}      but the section number does not change size, is there a way to do this? I've also tried looking at `titlesec` but have not been able to find any suitable examples.


title: citet vs cite using natbib

text: this one looks like a question that should be solved just reading the package manual, but oddly I couldn't solve it neither that way. I'm using natbib for a Author-Date bibliography style. I understood the difference between \citet and \citep. But I can't understand the difference between \citet and the plain \cite. Are they equal? Should I change all the \cite in \citet? (when I started writing I was using the classical Vancouver style without natbib). Apparently the outputs of cite and citet look exactly the same... Thank you, bye!


title: To draw two arrows to one point

text: I want pictures where I can point by two arrows with labels to one point like here ![enter image description here](http://i.stack.imgur.com/PxxCn.png) **How can you have two arrows pointing to one point?**


title: How to have center title in listings when you have subcaption (workaournd conflict between listing caption and subcaption class)?

text: I want to use **listings package** (`\usepackage{listings}`) to show a matlab code in a paper (using elsarticle class) but the title is not aligned in center below the code. This happened after I added `xleftmargin=3.5cm` and `xrightmargin=3.5cm` to add margin from left and right. If I remove these two options, title appears at the center of page! How can I have both margin and center title with listings? I used `\centering` and `\begin{center}...\end{center}` but they didn't work. **UPDATE:** I found out that `\usepackage{subcaption}` is the problem. without it title will be centered. But I need subcaption! my code:               \documentclass[3p,times]{elsarticle}          \usepackage{ecrc}     \volume{00}     \firstpage{1}     \journalname{Best Journal Ever}     \runauth{S. Gerami}     \jid{}     \jnltitlelogo{Best Journal Ever}     \CopyrightLine{2013}{Published by Elsevier Ltd.}     \usepackage{amssymb}     \usepackage[figuresright]{rotating}     \usepackage[ruled,vlined]{algorithm2e}          %%FOR MATH     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{amsfonts}          %%I NEED THESE PACKAGED FOR FIGURES AND SUBCAPTIONs     \usepackage{graphicx}     \usepackage{caption}     \usepackage{subcaption}          %%FOR CODES     \usepackage{listings}     \usepackage{color}          %%FOR TABLES     \usepackage{array}     \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}          \usepackage{lipsum}     \begin{document}          \begin{frontmatter}     \dochead{}     \title{title of my paper}          \author[bahonar]{Sajjad Gerami}     \ead{sajjad.gerami@gmail.com}     \address[bahonar]{Faculty of Mathematics and Computer Science, Best University, Somewhere, The One Country}          \begin{abstract}     abstract text....     \end{abstract}          \end{frontmatter}          \section{First section}     \lipsum{}     \definecolor{mygreen}{rgb}{0,0.6,0}     \definecolor{mygray}{rgb}{0.5,0.5,0.5}     \definecolor{mymauve}{rgb}{0.58,0,0.82}          \lstset{ %       backgroundcolor=\color{white},   % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}       basicstyle=\footnotesize,        % the size of the fonts that are used for the code       breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace       breaklines=true,                 % sets automatic line breaking       captionpos=b,                    % sets the caption-position to bottom       commentstyle=\color{mygreen},    % comment style       deletekeywords={...},            % if you want to delete keywords from the given language       escapeinside={\%*}{*)},          % if you want to add LaTeX within your code       extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8       frame=single,                    % adds a frame around the code       keepspaces=true,                 % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)       keywordstyle=\color{blue},       % keyword style       language=Octave,                 % the language of the code       morekeywords={*,...},            % if you want to add more keywords to the set       numbers=left,                    % where to put the line-numbers; possible values are (none, left, right)       numbersep=5pt,                   % how far the line-numbers are from the code       numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers       rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))       showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'       showstringspaces=false,          % underline spaces within strings only       showtabs=false,                  % show tabs within strings adding particular underscores       stepnumber=1,                    % the step between two line-numbers. If it's 1, each line will be numbered       stringstyle=\color{mymauve},     % string literal style       tabsize=2,                       % sets default tabsize to 2 spaces     %  title=Script 1: A program in Matlab to estimate the total area under sin(x),                   % show the filename of files included with \lstinputlisting; also try caption instead of title       xleftmargin=3.5cm,       xrightmargin=3.5cm     }          \begin{lstlisting}[title={Script 1: A program in Matlab to estimate the total area under $\sin(x)$}]     a=0;     b=pi/2;     h=max(feval(@func,linspace(a,b,n)));     x=a+(b-a)*rand(n,1);     y=h*rand(n,1);     N=0;     f=sin(x);     for j=1:n         if y(j)<=f(j)             N=N+1;         end     end     ans=N/n*h*(b-a)     \end{lstlisting}     %*****************     \lipsum{}          \end{document}      output: ![enter image description here](http://i.stack.imgur.com/GXSLi.png) **UPDATE2:** I tested method proposed in following link and not worked: Center caption in listing but then I saw this answer and edited to this:               \begin{figure}[thp]     \begin{center}       \begin{lstlisting}[numbers=left]       My Code       Another line       \end{lstlisting}     \end{center}     \caption{my caption or title}     \end{figure}      result: ![enter image description here](http://i.stack.imgur.com/DKyGW.png) It's good but the gap between box and caption is too much. I need to reduce it for good result. **UPDATE3:** This link has the best answer to removing gap for just one figure.               \begin{figure}[!ht]       \centering       \includegraphics[width=0.5\textwidth]{image}                          \vspace{-1em}       \caption{\textcolor{gray}{\footnotesize \textit{ImageCaption}}}       \vspace{-1.5em}     \end{figure}


title: TexNicCenter problem using \footcite

text: I am trying to create foot citations in my document. However I keep getting the following warning:               LaTeX Warning: Citation 'A01' on page 1 undefined on input line 21.     LaTeX Warning: Empty bibliography on input line 23.      The output I get for the footcite is "A01". Since for some reason if doesn't associate the book info with A01 although it is right there. The example I am trying to use is:               \documentclass{article}     \usepackage[style=mla]{biblatex}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @book{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     \end{filecontents}          \addbibresource{\jobname.bib}          \textheight=150pt% just for the example          \begin{document}          Some text.\footcite{A01}          \printbibliography          \end{document}


title: How to wrap text around theorem box?

text: I'm using the `thmtools` to create theorem boxes.               \usepackage{thmtools}     \usepackage[unq]{unique}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{wrapfig}     \usepackage{float}          \declaretheoremstyle[     spaceabove=6pt, spacebelow=6pt,     headfont=\normalfont\bfseries,     notefont=\mdseries, notebraces={(}{)},     bodyfont=\normalfont,     postheadspace=1em,     qed=     ]{mystyle}          \declaretheorem[style=mystyle, numbered=yes,name=Definition of bla and bla, shaded={bgcolor=Lavender,textwidth=20em}]{defBDL}      How do I wrap text around that 20em-wide box?


title: Change the algorithm enumeration in the algorithm2e package

text: I would like to translate the algorithm enumeration into another language, it is always printed in English:   * Algorithm 1 [Title]   * Algorithm 2 [Title]   * ... I am using the algorithm2e package.


title: why is GnuPlot .tex to .pdf, large compared with raster images?

text: Raster scanned articles tend to be quite a bit larger than vector graphics based articles. In practice when I make a plot with gnuplot, the resulting pdf is large compared for what it displays. I look at the tex code it creates and draws the sine curve by multiputting `\rule` rectangles along sections of the graph. Why cant gnuplot sensibly emit say `\qbezier`'s?


title: Setting an alphabetic citation style in LyX

text: How can I get LyX to use a different citation style? Instead of the numeric citations `[1]` I would like abbreviations of the author names and a 2-figure year: `[EPR35]`. I believe the `alphaabbrv` style does this, but any roughly equivalent style would be fine. `[1] A. Einstein, B. Podolsky, and N. Rosen, Can quantum-mechanical description of physical reality be considered complete? Phys. Rev. 47 777 (1935)`


title: Lyx in Hebrew doesn't work

text: I will write the order of when things started occurring. When I started writing with LyX, I couldn't write in Hebrew, until someone sent me this package called `culmus`, which fixes the problem. The problem basically was not being able to preview what I was writing, so after installing this everything was OK for a while. Then I added modules and added shortcuts (shortcuts from Hebrew to English and Theorem module). Then for some reason it stopped previewing my files again. So I changed the settings back to what they were before. It didn't work. I uninstalled and installed LyX and that Hebrew package a million times, and I still can't preview my things. I will write what it is written in the log. I just found out I can't upload notepad files, so I will just copy paste the log.. If there is a better way for me to present the problem, please let me know, I don't really understand how the program works. I have friends in the university that write with LyX in Hebrew and they don't have this problem, and they didn't know how to fix it unfortunately, so if someone here can help me fix this problem that would be awesome. Thanks! ![enter image description here](http://i.stack.imgur.com/cigPa.png)               This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2014.7.31)  31 JUL 2014 20:07 entering extended mode     **newfile1.tex          (C:\Users\DavidCiprut\AppData\Local\Temp\lyx_tmpdir.bMcmcnO18020\lyx_tmpbuf0\ne wfile1.tex LaTeX2e <2014/05/01> Babel <3.9k> and hyphenation patterns for 68 languages loaded.          ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2007/10/19 v1.4h Standard LaTeX document class ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo" File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\base\fontenc.sty" Package: fontenc 2005/09/27 v1.99g Standard LaTeX package ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\base\t1enc.def" File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file LaTeX Font Info:    Redeclaring font encoding T1 on input line 43. )) ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\base\inputenc.sty" Package: inputenc 2014/04/30 v1.2b Input encoding file \inpenc@prehook=\toks14 \inpenc@posthook=\toks15 ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\latin9.def" File: latin9.def 2014/04/30 v1.2b Input encoding file ) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\babel-hebrew\cp1255.def" File: cp1255.def 2004/02/20 v1.1b Hebrew input encoding file )) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\theorem.sty" Package: theorem 1995/11/23 v2.2c Theorem extension package (FMi) \theorem@style=\toks16 \theorem@bodyfont=\toks17 \theorempreskipamount=\skip43 \theorempostskipamount=\skip44 ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\thp.sty" File: thp.sty 1995/11/23 v2.2c Theorem extension package (FMi) )) \c@theorem=\count87 ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\babel\babel.sty" Package: babel 2014/03/24 3.9k The Babel package     *************************************     * Local config file bblopts.cfg used     * ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\bblopts.cfg" File: bblopts.cfg 2006/07/31 v1.0 MiKTeX 'babel' configuration ) ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\babel-english\english.ldf" Language: english 2012/08/20 v3.3p English support from the babel system ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\babel\babel.def" File: babel.def 2014/03/24     3.9k Babel common definitions \babel@savecnt=\count88 \U@D=\dimen103 ) \l@canadian = a dialect from \language\l@american  \l@australian = a dialect from \language\l@british  \l@newzealand = a dialect from \language\l@british  ) ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\babel-hebrew\rlbabel.def" File: rlbabel.def 2005/03/30 v2.3h Right-to-Left support from the babel system  Hebrew language support from the babel system ) ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\babel-hebrew\hebrew.ldf" File: hebrew.ldf 2005/03/30 v2.3h Hebrew language definition from the babel sys tem Hebrew language support from the babel system          Package babel Warning: No hyphenation patterns were preloaded for (babel)                the language `Hebrew' into the format. (babel)  Please, configure your TeX system to add them and (babel)              rebuild the format. Now I will use the patterns (babel)                preloaded for english instead on input line 57.          \l@hebrew = a dialect from \language0 )) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\babel-hebrew\lheenc.def" File: lheenc.def 2005/05/20 v1.2c 7-bit Hebrew font encoding (test version: sti ll liable to change) ) No file newfile1.aux. LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 29. LaTeX Font Info:    ... okay on input line 29. LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 29. LaTeX Font Info:    ... okay on input line 29. LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 29. LaTeX Font Info:    ... okay on input line 29. LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 29. LaTeX Font Info:    ... okay on input line 29. LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 29. LaTeX Font Info:  ... okay on input line 29. LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 29. LaTeX Font Info:    ... okay on input line     29. LaTeX Font Info:    Checking defaults for LHE/cmr/m/n on input line 29. LaTeX Font Info:    Try loading font information for LHE+cmr on input line 29. ("C:\Program Files (x86)\MiKTeX     2.9\tex\latex\babel-hebrew\lhecmr.fd" File: lhecmr.fd 2005/05/20 v1.2c Hebrew default font (test version: still liabl e to change) ) LaTeX Font Info:    ... okay on input line 29. ! Font LHE/cmr/m/n/10=jerus10 at 10.0pt not loadable: Metric (TFM) file not fou nd. <to be read again>                         relax  l.29 \begin{document}                           I wasn't able to read the size data for this font, so I will ignore the font specification. [Wizards can fix TFM files using TFtoPL/PLtoTF.] You might try inserting a different font spec; e.g., type `I\font<same font id>=<substitute font name>'.          Missing character: There is no y in font nullfont! Missing character: There is no c in font nullfont! Missing character: There is no b in font nullfont! Missing character: There is no y in font nullfont! Missing character: There is no c in font nullfont! Missing character: There is no 1 in font nullfont! [1          ] (C:\Users\DavidCiprut\AppData\Local\Temp\lyx_tmpdir.bMcmcnO18020\lyx_tmpbuf0\ne wfile1.aux) )  Here is how much of TeX's memory you used:  1194 strings out of 493706  14431 string characters out of 3142147  68928 words of memory out of 3000000  4552 multiletter control sequences out of 15000+200000  4403 words of font info for 15 fonts, out of 3000000 for 9000  1025 hyphenation exceptions out of 8191  25i,4n,23p,176b,122s stack positions out of 5000i,500n,10000p,200000b,50000s          Output written on newfile1.pdf (1 page, 870 bytes). PDF statistics:  6 PDF objects out of 1000 (max. 8388607)  0 named destinations out of 1000 (max. 500000)  1 words of extra memory for PDF output out of 10000 (max. 10000000)


title: How to adjust the width of a frame to a given text?

text: I'm currently trying to get a frame around some text or pictures with an header as the "W" in this answer. My code is actually the following:               \documentclass{article}          \usepackage{tikz}          \newcommand{\titlebox}[2]{     \begin{tikzpicture}     \node[align=center,draw,thick,text width=\textwidth,inner sep=6mm] (titlebox) {#2};     \node[fill=white] (Title) at (titlebox.north) {\bfseries \large #1};     \end{tikzpicture}     }          \begin{document}          \titlebox{Title}{Text in the frame.}          \end{document}      which yields this: ![Frame and text](http://i.stack.imgur.com/7nOuQ.png) My question is how to make sure that the width of the frame will automatically fit the width of the inner text or elements (pictures)?


title: Frame on lstlisting opened on the bottom when code longer than one page

text: In my `\lstset` I have:               \lstset{     language=Java,                    % the language of the code     basicstyle=\sffamily\large,        % the size of the fonts that are used for the code     %numbers=left,                      % where to put the line-numbers     %numberstyle=\footnotesize,         % the size of the fonts that are used for the line-numbers     %stepnumber=1,                      % the step between two line-numbers. If it's 1, each line                                          % will be numbered     %numbersep=10pt,                      % how far the line-numbers are from the code     %backgroundcolor=\color{white},      % choose the background color. You must add \usepackage{color}     showspaces=false,                   % show spaces adding particular underscores     showstringspaces=false,           % underline spaces within strings     showtabs=false,                   % show tabs within strings adding particular underscores     frame=single,                      % adds a frame around the code     tabsize=2,                        % sets default tabsize to 2 spaces     captionpos=t,                     % sets the caption-position to bottom     breaklines=true,                  % sets automatic line breaking     breakatwhitespace=false,           % sets if automatic breaks should only happen at whitespace     %title=\lstname,                   % show the filename of files included with \lstinputlisting;     caption=grail.sablecc,             % also try caption instead of title     escapeinside={\%*}{*)},            % if you want to add a comment within your code     morekeywords={*,...}               % if you want to add more keywords to the set     }         taken from a wikibook. The problem is that when the source code is really long and requires 2 or more pages, I would like that the frame would close on every page instead of having the bottom of the listing open. Is that possibile?


title: Command to display free-text answers from a survey, eliminating ascii control chars

text: I'd like to create a report from a survey with free-text answers that is collected in a database. For each question there are typically many answers which I could present in an itemize environment, one answer per item. The problem I have is that an individual answer (in Latin1 encoding) might contain double spaces, returns and other control characters that should not matter in the presentation. Is there a suitable environment or command (implemented probably using catcode trickery) that smoothes these out, resulting in a nice even presentation?               \answer{Code with  double spaces, returns, linefeeds and other control character that should not matter here}      An alternative would be to filter all these out using the software that fetches the data from a database and generates the LaTeX code. However, I'd prefer a TeX/LaTeX solution. I'd be also interested in other creative solutions.


title: Quantifier spacing with unicode-math

text: When using consecutive quantification in a math formula, there is not enough spacing around the quantifiers. For example:               \documentclass{article}          \usepackage[colon=literal]{unicode-math}     \setmainfont{STIXGeneral}     \setmathfont{XITS Math}          \begin{document}              \[∀{δ>0}∃{ε>0}∀{x: |x-x_0| < ε ⇒ |f(x)-f(x_0)| < δ}\]              \[∀\,{δ>0}\;∃\,{ε>0}\;∀\,x: |x-x_0| < ε ⇒ |f(x)-f(x_0)| < δ\]     \end{document}      I’m using TeXLive 2012 and XeLaTeX. The output is ![output of quantifier formula](http://i.stack.imgur.com/HyIGc.png) Now I certainly don’t want to manually put the spacing around all the quantifiers. I tried to use               \usepackage{newunicodechar}     \makeatletter     \newcommand\@quantifierspacing[1]{\,#1\@ifnextchar∃{\;}{\@ifnextchar∀{\;}{}}}     \newunicodechar{∀}{∀\@quantifierspacing}     \newunicodechar{∃}{∃\@quantifierspacing}     \makeatother      but that does not add the spacing in front. I also considered               \newunicodechar{∀}{\;∀\,}      Although I don’t think it is prudent, because then additional spacing is also added in front of the first quantifier. Is there a better way?


title: Remove [number] in the bibliography

text: I want to put at the end of my bibliography a list of "suggested reading", that are NOT cited in the text but are present in the `.bib` file. I use `biber`+`bibtex` with the `numeric` style. By using the `\BibliographyCategory` command I was able to create 2 categories and It works fine. The only thing I don't like is that the "suggested reading" are printed in the bibliography with the [number] on the left, and I don't want that, mainly because there's no citation of these in the document. Here's a screenshot: ![enter link description here](http://i.imgur.com/kr21S5o.png) Is there any way I can remove the citation number **only** on the entries of a specific bibliography category?


title: Small bibliography inside a document with its own bibliography

text: A document (class article) has a bibliography (using biblatex) printed at the end. But inside the document, a small section (call included section in my example) has its own bibliography (not part of the main bibliography) which is printed at the end of the included section. This small sectop, has no citations to the main bibliography.               \documentclass{article}          \usepackage[defernumbers=true]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},       category = {internal}     }          @misc{B02,       author = {Buthor, B.},       year = {2002},       title = {Bravo},     }          @misc{C03,       author = {Cuthor, C.},       year = {2003},       title = {Charlie},     }     \end{filecontents}          \bibliography{\jobname}          \DeclareBibliographyCategory{internal}          \begin{document}          \nocite{*}     \addtocategory{internal}{A01}          \section{first section}          blabla~\cite{B02}               \section{included section}          blabla~\cite{A01}          \printbibliography[title={bibliography of included section},category=internal]          \section{other sections...}          blabla~\cite{C03}          \printbibliography[title={Full bibliography without internal category},notcategory=internal]          \end{document}      The PDF is the following: ![PDF](http://i.stack.imgur.com/VwoYv.png) The main problem is that the included bibliography is part of the main bibliography: the main bibliography starts at [2], because it contains the bibliography of the included section. How can i (logicaly) separate the two bibliography ? I want the small bibliography to used references like '[Babar2007]' and the main bibliography to be numbered like "[23]" (with its own reference counter: main bibliography starts at 1) ?


title: Textmate + Latexmk

text: Textmate for OS X, has a LaTeX bundle (a great bundle indeed). But this bundle packs the latexmk script (version 3.7 or so), I am wondering if anyone was able to update the latexmk version that comes within the bundle, or even to have it use the system's version of it. PS: I know this is not *TeX related issue, but I though there might be someone with a solution around here. Moderators may delete this if its against the rules.


title: how do I set up a table in a page such that it is flipped?

text: I have a table which is too wide to appear horizontally. I want to flip it such that it appears vertically, and put it in a page by itself (no other text appearing in that page). How would I approach it? Thanks


title: Substrings in ConTeXt

text: # Problem Trying to get the first letter of a word for a chapter heading. The chapter style is being applied as follows:                 \setuphead[chapter][         command=\StyleChapter,         % Hide the header's chapter name.         header=empty,         % Hide the footer's page number.         footer=empty,       ]      To emphasize the first character of the word (e.g., "Bread"), I've written:               \define[2]\StyleChapter{%       \framed[         frame=off,         width=local,         align={flushright,low,nothyphenated,verytolerant},         width=\dimexpr\textwidth+\rightmargindistance,         height=\dimexpr\textheight-\footerheight,       ]{\substring{#2}{1}{1}}{#2}     }      As well as:                 ]{\substring{#2}{1}{1}{#2}}      And:                 ]{{#2}{\substring{#2}{1}{1}}}      And:               \defineframed[StyleChapterFramed][       frame=off,       width=local,       align={flushright,low,nothyphenated,verytolerant},       width=\dimexpr\textwidth+\rightmargindistance,       height=\dimexpr\textheight-\footerheight,     ]          \define[2]\StyleChapter{%       \StyleChapterFramed{%         {\getfirstcharacter{#2}\firstcharacter #2}       }      }       And variations thereof. It seems `\substring` is not a macro available in ConTeXT? The effect I'm trying to produce: ![Lunch](http://i.stack.imgur.com/l93lF.png) The effect I've achieved so far: ![Soup](http://i.stack.imgur.com/9sklI.png) Using the following yields the letter H, but I'm trying to use the chapter title, which is parameter `#2`:               {\getfirstcharacter{Hello}\firstcharacter #2}      Any ideas how to obtain a substring in ConTeXt?


title: Difference between geometry, changepage and vmargin packages?

text: While struggling a bit with layout, I have encountered a few useful packages, namely `geometry`, `changepage` and `vmargin` but I'm wondering a bit about the difference between them. An important one that I have already figured out: the `changepage` package doesn't force some default layout settings that differ from the ones of my document class (in my case `report`), which is extremely nice when you just want to locally change the layout (in my case for the title page). Are there other differences?


title: how to rotate wide table in page thatnot outside of page

text: My table is very wide and gets the outside of the page how to rotate table that placed landscape.               \begin{table}[!h]     \centering     \footnotesize     \caption{}\\     \label{tab11}      \begin{tabular}{ccccc}     \hline     \rl{AAAAAAAAAAAAA}&\rl{BBBBBBBBBBBBBBBBBBB}&\rl{CCCCCCCCCCCCCC}&$f[]$&$x$\\     \hline     $f[x_0,x_1,x_2,x_3]=\frac{f[x_1,x_2,x_3]-f[x_0,x_1,x_2]}{x_3-x_0}$&$f[x_0,x_1,x_2]=\frac{f[x_1,x_2]-f[x_0,x_1]}{x_2-x_0}$&$f[x_0,x_1]=\frac{f(x_1)-f(x_0)}{x_1-x_0}$&$f[x_0]$&$x_0$\\     \\     $f[x_1,x_2,x_3,x_4]=\frac{f[x_2,x_3,x_4]-f[x_1,x_2,x_3]}{x_4-x_1}$&$f[x_1,x_2,x_3]=\frac{f[x_2,x_3]-f[x_1,x_2]}{x_3-x_1}$&$f[x_1,x_2]=\frac{f(x_2)-f(x_1)}{x_2-x_1}$&$f[x_1]$&$x_1$\\     \\     $$&$f[x_2,x_3,x_4]=\frac{f[x_3,x_4]-f[x_2,x_3]}{x_4-x_2}$&$f[x_2,x_3]=\frac{f(x_3)-f(x_2)}{x_3-x_2}$&$f[x_2]$&$x_2$\\     \\     $$&$$&$f[x_2,x_4]=\frac{f(x_4)-f(x_3)}{x_4-x_3}$&$f[x_3]$&$x_3$\\     \\     $$&$$&$$&$f[x_4]$&$x_4$\\          \hline      \end{tabular}     \end{table}


title: BibLaTeX – idem and \autocite + \autocites

text: I'm using biblatex with the `verbose-trad1` style and mixing the `\autocite` and `\autocites` commands as necessary. However, when the same reference is used in an `\autocites` following an `\autocite`, it is not shortened to _Ibid._ as it should be, but _Idem, Work title_ is used instead. For example:               Text text\autocite[p.10]{Smith} text text\autocites[p.20]{Smith}[p.100]{Jones} text...      Will produce:               1) Smith, Work title, p.10.     2) Idem, Work title, p.20; Jones, Other title, p.100.      Instead of:               1) Smith, Work title, p.10.     2) Ibid., p.20; Jones, Other title, p.100.      Is there any way to get around this?


title: Mathematical symbols- a thick bigger question mark

text: I would need to get in Beamer presentation a thick bigger question mark. How is it possible to make it?


title: Separate section number in headers

text: I'm writing a book and want my separate odd and even headers, with centered chapter/section titles on even/odd pages respectively. On both pages I want to print the section number on the outside of the page. I thought this would be easy to do with, for example,               \fancyhead[LE]{\thesection}     \fancyhead[RO]{\thesection}      Unfortunately, this fails when a new section heading starts at the top of a page, in which case the previous page gets labelled with the new section number. I know this happens because \thesection is expanded too late, but I want an easy fix. Also, I can't use the \rightmark to store the section number because I'm using that to store the section name. Here's a minimum working example that illustrates the problem:               \documentclass{article}     \usepackage{lipsum}          \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhead{}     \fancyhead[L]{\leftmark}     \fancyhead[R]{\thesection}          \renewcommand{\sectionmark}[1]{\markboth{\thesection. #1}{}}           \begin{document}     \section{Introduction}     \lipsum[1-4]     \lipsum[2]          \section{Blah}     \lipsum[1]     \end{document}      ![Should have a 1 on the right-hand side](http://i.stack.imgur.com/19UAX.png)


title: Multiple indices with biblatex and indexing

text: I need two indices: one of names, one of concepts. I'm using `biblatex` with indexing (and TeXshop on a mac, I am a newbie of LaTeX, so sorry for any stupid question). This works fine for the index of names, but I need to index also concepts. Until now, I did with `\index{concept1}`. I get one index with both names and concepts. This was fine until my supervisor wanted two different indices. Now, with the code below, I get only one index of things I manually indexed, but no more names from `biblatex`               \documentclass[12pt,a4paper,twoside,openright,titlepage,fleqn,%     headinclude,,footinclude,BCOR5mm,%                numbers=noenddot,cleardoublepage=empty,%                tablecaptionabove]{scrreprt}          \usepackage[style=philosophy-modern,indexing,hyperref,square,natbib,backref]{biblatex}          \usepackage{imakeidx}     \makeindex[name=title,title={List of Titles}]                    \renewbibmacro*{citeindex}{%     \ifciteindex     {\indexnames{labelname}}%     {}}     \renewbibmacro*{bibindex}{%     \ifbibindex     {\indexnames{author}%     \indexnames{editor}%     \indexnames{editora}%     \indexnames{editorb}%     \indexnames{editorc}}%     {}}%     %\DeclareIndexFieldFormat{indextitle}{%     %\usebibmacro{index:title}{\index}{#1}}     %\DeclareIndexNameFormat{default}{%     %\usebibmacro{index:name}{\index[nomi]}{#1}{#3}{#5}{#7}}     \usepackage{index}     %\newindex{default}{idx}{ind}{Index}     %\newindex{nomi}{ndx}{nnd}{Index of Names}               \usepackage{makeidx} %\usepackage{imakeidx}     %\DeclareIndexFieldFormat{indextitle}{}{}{}               \usepackage[eulerchapternumbers,subfig,beramono,eulermath,pdfspacing,listings]{classicthesis} %minionpro parts     \usepackage{arsclassica}               \input{arsclassica-settings}          \makeindex%[program=xindy]          \begin{document}               \input{Chapters/hw}      \index{normativity}          \printbibliography          \printindex     %\printindex[title]          \end{document}      I hope to have provided a MWS – I suspect I must run twice something I don't know.


title: Macro, new command or new environment for code?

text: I am using the `listings` package to typeset code. I have defined a custom style using `\lstdefinestyle{verbo}` and then typeset code in a `lstlisting` environment as in the following MWE.               \documentclass{article}          \usepackage[T1]{fontenc}  % to retain double quotes in lstlistings     \usepackage{listings}  % to typeset code     \usepackage{upquote}  % to retain single qutoes in lstlistings          \lstdefinestyle{verbo}{  % code typesetting optins         basicstyle=\small\ttfamily,         breaklines=true,         breakatwhitespace=true,         language=Python,         tabsize=1,         resetmargins=true,         xleftmargin=0pt,         frame=single,         showstringspaces=false     }          \begin{document}          \begin{lstlisting}[style=verbo]     >>> print "Hello World!"     \end{lstlisting}          \end{document}      which produces ![Hello World](http://i.stack.imgur.com/L0j11.png) I would like to make the LaTeX code more readable by typing the following instead of the `lstlisting` environment but achieving the same result.               \begin{code}     >>> print "Hello World!"     \end{code}      I tried various things - defining a macro, a new command, a new environment - but all failed. Is there some way to do this? ## Failed Attempts Below are my failed attempts, all of which result in errors similar to the following               ! Emergency stop.     <*> \input mwe-code.tex          !  ==> Fatal error occurred, no output PDF file produced!      **Macro**               \def\code{\begin{lstlisting}[style=verbo]}     \def\ecode{\end{lstlisting}}       ...         \code     >>> print "Hello World!"     \ecode      **New command**               \newcommand{\code}[1]{\begin{lstlisting}[style=verbo]#1\end{lstlisting}}       ...     \code{     >>> print "Hello World!"     }      **New environment**               \newenvironment{code}     {\begin{lstlisting}[style=verbo]}     {\end{lstlisting}}       ...     \begin{code}     >>> print "Hello World!"     \end{code}


title: Unbreakable cventry in moderncv

text: I'm trying to update my CV and I hit a limitation. I use `moderncv` and have been quite satisfied with it so far. But now that my experience section has grown beyond a presumed limit it yields an odd result. Here is an MWE:               \documentclass{moderncv}          \moderncvtheme[blue]{classic}     \usepackage{lipsum}     \usepackage[utf8]{inputenc}     \usepackage[scale=0.85]{geometry}                             \firstname{Jack}\familyname{Ceevee}     \address{876A Defect Lane}{San Francisco, California}      \mobile{+1-615-555-1212}\email{j.ceevee@mail.com}                  \begin{document}          \maketitle          \section{Summary}     \cvline{}{\lipsum[1]}          \section{Technical Skills}     \cvline{A great skill}{\lipsum[2]}          \section{Experience}     \cventry{2000--present}{Space occupier}{freelance}{San Francisco}{}{%     \lipsum[3-5]}          \end{document}      The odd thing is that the last section is not broken in two, rather it is moved to a new page leaving about 1/3rd of page 1 empty. I wonder if it is caused by the minipage environment `moderncv` uses for _cventry_ (at least I think it does) or maybe something else. Regardless, I'm looking for a way to fix the issue.


title: Modifying the appearance of appendix titles

text: I want to modify the appearance of appendix titles. For that I use the package appendix with the following options:               \documentclass[     numbers=noenddot     ]{scrreprt}          \usepackage[         automark,                               %% Kapitelangaben in Kopfzeile automatisch erstellen         plainheadsepline,                       %% Linie         plainfootsepline                        %% Linie     ]{scrpage2}     \usepackage[ngerman]{babel}                 %% Deutsches Sprachpaket     \usepackage[utf8]{inputenc}                 %% Eingabezeichensatz UTF-8     \usepackage[T1]{fontenc}                    %% Kodierung für Umlaute     \usepackage[     titletoc,     toc,      page,     title,      header     ]     {appendix}                        \addtokomafont{pageheadfoot}{\small}            %% Kopfzeile klein     \setheadsepline{0.4pt}                          %% Kopf-Linie     \setfootsepline{0.4pt}                          %% Fuß-Linie          \clearscrheadfoot     \pagestyle{scrheadings}     \ihead[]{}     \chead[]{}     \ohead[\headmark]{\headmark}          \ifoot[]{}     \cfoot[\pagemark]{\pagemark}     \ofoot[]{}          \begin{document}          \tableofcontents     \clearpage          \chapter{chapter}          \begin{appendices}     \chapter{Main}         ...     \chapter{Practical implementation}         ...     \end{appendices}          \end{document}      But unfortunately the options title and header seems not to work. It should look like this: ![enter image description here](http://i.stack.imgur.com/V6yL1.png) What could be the reason?


title: ConTeXt: How can I prevent a block of text from being split over a page break?

text: At the end of below minimum working example there is a funny `\startdelimitedtext[endtext]` which should be printed at the bottom of the last page without being split over a page break. How do I render `[endtext]` indivisible?               \setuppapersize [A4][A4]     \setuplayout    [width=middle,  backspace=1.5in, cutspace=1.5in,                      height=middle, topspace=0.75in, bottomspace=0.75in]          \setuppagenumbering[location={footer,center}]          \setuptolerance[horizontal, tolerant, stretch]          \setupexternalfigures [location=default]          \definedelimitedtext[endtext]     \setupdelimitedtext[endtext][before={\vfill}]          \starttext       \input douglas.tex            \input douglas.tex          One line          A second line          And another line          \startendtext     \startalignment[middle]     Written in Hasselt, Belgium!\crlf     \externalfigure[cow][height=31pt]\crlf     This work is licensed under a Creative Cows\crlf Attribution-NonCowmercial-MilkAlike 3.0 Unported License.\crlf     Other licensing available on request. Typesetting by \ConTeXt\ \contextmark.     \stopalignment     \stopendtext          \stoptext


title: Q&A Template in LaTeX

text: I am preparing a Q&A document. I created the image below in MS Word. I was wondering if there is a way this can be accomplished in LaTeX. I want to keep formatting consistent through out the document. Is there such a template available? If not then how can i create my own templates/ environments ![Q&A](http://i.stack.imgur.com/aisQe.jpg)


title: Table with text wrapping and two "=" aligned equations in one cell

text: Regarding this post: Table with text wrapping?               \documentclass{article}     \usepackage{array}     \newcolumntype{L}{>{\centering\arraybackslash}m{3cm}}          \begin{document}          \begin{table}     \begin{tabular}{|L|c|L|}\hline     one & two & three \\\hline     This is two line thing and centered & only one line&  \multicolumn{1}{m{3cm}|}{This is justified and may go to second line as well, neatly}\\\hline       one & two & three \\\hline       one & two & three \\\hline     \end{tabular}     \end{table}     \end{document}      Now I would like to enhance this table as follows:   1. Turn the Row 2, Column1 text into two equations aligned at the "=" within that cell. That is:  > y=mx+b   >  y=x+1   2. Insert caption and label    3. Position the table and caption in the center of the page


title: How can I install scientific dictionaries to use with TeXworks?

text: > **Possible Duplicate:**   >  TeXworks: How to add a word to the spell checker dictionary? I frequently use terminology common in biology and chemistry, but not found in the hunspell dictionary. I have dictionaries in `.dic` format. Can I just add them to the hunspell dictionary or do I have to be sure the "new" list is alphabetized. Alternatively, is there a way to make TeXworks read the directory as is?


title: Creating a two column table for a math class

text: I am having trouble creating two column tables. I want to create 2 two column tables side by side, but my code doesn't seem to work:               \documentclass{article}     \usepackage[english]{babel}     \usepackage{array}          \begin{document}     \title{Example: Exponents}     \author{Ms. Lampianerani}      \date{}     \pagenumbering{gobble}     \maketitle                    \begin{center}      \setlength\extrarowheight{6pt}      \begin{tabular}{ | l | p{4.5cm} |}      \hline       Expression & Equivalent Value Simplified\\ \hline       $2^2 $&  4  \\ \hline       $2^1$ &  2 \\ \hline       $2^0$ &  1 \\ \hline       $2^-1$ &   $\frac{1}{2}$  \\ \hline       $2^-2$ &  $\frac{1}{4}$  \\  \hline      \end{tabular}      \end{center}           \begin{center}        \setlength\extrarowheight{6pt}      \begin{tabular}{ |  l  | p{4.5 cm} |}      \hline      Expression & Equivalent Value Simplified\\ \hline      $3^2$ &    \\ \hline      $3^1 $ &   \\ \hline      $3^0$ &  \\ \hline      $3^{-1}$  &   \\ \hline      $3^{-2} $ &   \\  \hline      \end{tabular}      \end{center}           \end{document}       I want one table with the powers of 2 on the LHS side and another with the powers of 3 on the RHS side, but this code doesn't even work for the powers of 2. EDIT: I now can create a table with powers of 2. I only need the code to create side-by-side columns with space in between.


title: Positioning equation number not working

text: In this example the equation number is even below the equation itself.   I thought a `[t]` of `[m/c]` option could position the number. Doesn't work. How can I get the equation number to be at the top, centered, at the bottom?               \documentclass{article}          \usepackage{showframe}   %% just for demo     \usepackage{mathtools}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{mathtools}     \usepackage{relsize}     \usepackage{stmaryrd}     \usepackage{bm}          \newcommand{\h}[1]{\widehat{\bm{#1}}}          \begin{document}          \begin{align}     \begin{aligned}[t]     \hspace{3cm} R(\alpha \h{a})    &\hspace{1cm}  \longmapsto  \hspace{1cm}  a.     \intertext{Note the special cases for the identity and the $\pi$-rotation:}     \mbox{Identity}    &\hspace{1cm}   \longmapsto     \hspace{1cm}  1         \equiv  -1 \\     \mbox{$L_a$}       &\hspace{1cm}    \longmapsto    \hspace{1cm}  a   \equiv  - a.     \end{aligned}     \end{align}          \begin{equation}     \begin{split}     \hspace{3cm} R(\alpha \h{a})    &\hspace{1cm}  \longmapsto  \hspace{1cm}  a.     \intertext{Note the special cases for the identity and the $\pi$-rotation:}     \mbox{Identity}    &\hspace{1cm}   \longmapsto     \hspace{1cm}  1         \equiv  -1 \\     \mbox{$L_a$}       &\hspace{1cm}    \longmapsto    \hspace{1cm}  a   \equiv  - a.     \end{split}     \end{equation}          \end{document}


title: How to left aligne the page numbers with the tocloft package

text: Using the `tocloft` package I would like to have the (`Roman`) page numbers in the table of contents to be aligned left (in the MWE chapter 1-3) instead of right (in the MWE chapter 4-5). (And later right aligned for the `arabic` page numbers.) Is there some easier way than redefining `\cftchapfillnum`? The example is just about chapters, but in the not-minimal-document I also redefine it for `part` and `section` (and if somebody uses `subsection`,..., those redefinitions must be done, too.)               \documentclass{report}     \usepackage{letltxmacro}          \usepackage{tocloft}          \makeatletter     \renewcommand{\cftchapdotsep}{\cftdotsep}     \renewcommand{\@pnumwidth}{6em}     \renewcommand{\@tocrmarg}{8.55em}          \LetLtxMacro{\origcftchapfillnum}{\cftchapfillnum}     \renewcommand{\cftchapfillnum}[1]{%     {\cftchapleader}\nobreak     \hb@xt@\@pnumwidth{\cftchappagefont #1\hfil}\cftchapafterpnum\par}          \makeatother          \begin{document}     \pagenumbering{Roman}          \tableofcontents     \newpage     \addcontentsline{toc}{chapter}{one}     1     \newpage     \addtocounter{page}{25}     \addcontentsline{toc}{chapter}{two}     2     \newpage     \addtocounter{page}{9}     \addcontentsline{toc}{chapter}{three}     3          \addtocontents{toc}{\string\LetLtxMacro{\string\cftchapfillnum}{\string\origcftchapfillnum}}          \newpage     \addtocounter{page}{9}     \addcontentsline{toc}{chapter}{four}     4          \newpage     \addtocounter{page}{1}     \addcontentsline{toc}{chapter}{five}     5               \end{document}      The MWE really works (MWEs usually do not work - in spite of their name), but the question is whether there is some easier solution which I just did not find?


title: Read integers from external data file to document programming code in LaTeX

text: I am attempting to document my MATLAB programming code in LaTeX. For this, I use the `mcode` package, which defines the MATLAB `lstlisting` environment. With the commands               \newcommand{\mfileMain}{main.m}     \newcommand{\mfileMainFirstNumber}{\mfileMainFirstLine}     \newcommand{\mfileMainFirstLine}{26}     \newcommand{\mfileMainLastLine}{33}     \lstinputlisting[firstnumber=\mfileMainFirstNumber,                      firstline=\mfileMainFirstLine,                      lastline=\mfileMainLastLine]{\mfileMain}      I set the `firstnumber`, `firstline` and `lastline` parameters and use them to import a piece of MATLAB code into the LaTeX document with `\lstinputlisting`. However, when I add some code before the `\mfileMainFirstLine`, in this case 26, the code is shifted and the documentation is ruined. To fix this, I would have to update the line numbers. I am trying to fix this issue by adding 'tracers' to my MATLAB program. I use the commands               filename=['lstinputlisting_line_numbers_' mfilename '.txt'];     fileID=fopen(filename,'w');      to create a text file in which I store the line numbers for which the code is documented using the command               dbstack_eval=dbstack;fprintf(fileID,[num2str(dbstack_eval.line+1) '\n']);      . This results in a text file `lstinputlisting_line_numbers_.txt` with content for instance like               53     62     75     91      in case I want to document four parts of the MATLAB program `main.m`. What I want to do from here is simply use this line number data in the `\lstinputlisting` commands. Perhaps it is possible to store the line numbers in the `\newcommands{}{}`, or perhaps there is a better, more elegant way of doing it. In this way, the line numbers would update automatically in case I add new lines of code. Consequently, my LaTeX document would still be okay, saving me a lot of time not having to update the line numbers myself. A minimum working example could look like the following. The LaTeX file `main.tex` would have the content               \documentclass[a4paper]{article}     \usepackage[framed,numbered]{mcode}          % Data for the 'lstinputlisting' environments.     \newcommand{\mfileMain}{main.m}     \newcommand{\mfileMainFirstNumberA}{\mfileMainFirstLineA}     \newcommand{\mfileMainFirstLineA}{WHAT SHOULD I PUT HERE?}     \newcommand{\mfileMainLastLineA}{WHAT SHOULD I PUT HERE?}     \newcommand{\mfileMainFirstNumberB}{\mfileMainFirstLineB}     \newcommand{\mfileMainFirstLineB}{WHAT SHOULD I PUT HERE?}     \newcommand{\mfileMainLastLineB}{WHAT SHOULD I PUT HERE?}          \begin{document}         In the code         \lstinputlisting[firstnumber=\mfileMainFirstNumberA,                          firstline=\mfileMainFirstLineA,                          lastline=\mfileMainLastLineA]{\mfileMain}         we calculate the ....               And in the code         \lstinputlisting[firstnumber=\mfileMainFirstNumberB,                          firstline=\mfileMainFirstLineB,                          lastline=\mfileMainLastLineB]{\mfileMain}         we calculate the.....     \end{document}      . The MATLAB file `main.m` would have the content               %% Line number output.          filename=['lstinputlisting_line_numbers_' mfilename '.txt'];     fileID=fopen(filename,'w');          dbstack_eval=dbstack;fprintf(fileID,[num2str(dbstack_eval.line+1) '\n']);         %% Input to be specified by user.          alpha=10; % PDE parameter.     x_s=0; % Starting coordinate.     x_e=1; % End coordinate.     N_n=1e2+1; % (N)umber of (n)odes.     N_ip=2; % (N)umber of (i)ntegration (p)oints.          dbstack_eval=dbstack;fprintf(fileID,[num2str(dbstack_eval.line+1) '\n']);         fclose(fileID); % Close the file 'fileID'.


title: When to use LuaJitTeX in favour of LuaTeX?

text: Since a few weeks LuaJitTeX is available ¹, which is LuaTeX with Lua replaced by LuaJIT. Binaries are available for various platforms. It is already included in the ConTeXt standalone distribution. I wonder which sort of documents benefit from using LuaJitTeX? If non-standard fonts are used XeTeX is a good choice, if MetaPost is involved LuaTeX is a good choice, just to give an example.   * What's exactly the use case for LuaJitTeX?   * Does it ever make sense to turn Jit on (in contrast to just using the virtual machine of LuaJitTeX)? The ConTeXt help states: `\--jiton jit turned on (in most cases not faster, even slower)` and running a small test suggests that it really appears to be slower. I don't know if that is always the case and I wonder if there are any counter examples. ¹ The source code can be obtained with: `svn co http://foundry.supelec.fr/svn/luajittex/trunk`. The binaries can be found on http://svn.contextgarden.net/suite-bin/tex/.


title: Correct usage of \ifmmode

text: Seems that there is some subtlety in using `\ifmmode` that I am not aware of. For some reason, using:               \newcommand{\hlcodeA}[1]{\ifmmode\else\small\fi\texttt{\hilight{#1}}}%      is not quite identical to:               \newcommand{\hlcodeB}[1]{\texttt{\hilight{\ifmmode\else\small\fi#1}}}%      where I moved the `\ifmmode` test to the inner level of the macro from the outer. Both are ok, **except** in an `align`environment where `\hlcodeB` has no problems, but `\hlcodeA` yields a warning: > LaTeX Font Warning: Command \small invalid in math mode on input line 26 ## Notes:   * No problems are reported when used in an `equation` environment.   * The MWE below yields a warning, but replacing `\hlcodeA{y2}` with `\hlcodeB{y2}` in the `align` environment, no warnings are reported.   * This example is not really intended to produce proper output in math mode, but it seems that I am _abusing_ the `align` environment in my real example. This is old code for my internal documentation where I now know that I should have used `tabular` instead -- this was not obvious to me in early 2011 when I started this document :-) , and am just now trying to clean up some of the warnings. ## Code:               \documentclass{article}     \usepackage{xcolor}     \usepackage{amsmath}          \newcommand{\hilight}[1]{\colorbox{yellow}{#1}}%               \newcommand{\hlcodeA}[1]{%         \ifmmode\else\small\fi\texttt{\hilight{#1}}%     }%          \newcommand{\hlcodeB}[1]{%         \texttt{\hilight{\ifmmode\else\small\fi#1}}%     }%               \begin{document}     \hspace*{5.0cm}\hlcodeA{y} = \hlcodeA{x}%   This is ok (no warnings)          \begin{equation*}%         This is ok (no warnings)     \hlcodeA{y1} = \hlcodeA{x1}     \end{equation*}          \begin{align*}%         This is NOT ok (warnings but only from \hlcodeA)     \hlcodeA{y2} = \hlcodeB{x2}     \end{align*}     \end{document}


title: \setcounter{tocdepth}

text: Using `\setcounter{tocdepth}{0}` displays just the chapter's title in the table of contents. In the last chapter, there's a subsection. I want to use `\setcounter{tocdepth}{0}`! Therefore no subsection should be displayed in the table of content. However, using the option 0, a problem shows up. The subsections are not displayed in the table of contents, but there's a gap between the last chapter and the references in the end. It seems like the option 0 just doesn't print the subsection in the contents, leaving some space between the last chapter and the references chapter. I added a picture, as well as the used template (not the complete, it's too long). If I use `\setcounter{tocdepth}{1}` there is no gap, and everything looks fine! But I do not want to have the sections in the table of content Here is a test code, but without the `thesis.cls` it won't compile.               \documentclass[10pt,twoside,openright]{thesis}     \usepackage{graphicx}   % if you want to include graphics files     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{amsfonts}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \begin{document}      %\titlepage             % Print titlepage        \newpage               % blank page     %\copyrightpage        % optional              \tableofcontents       % required      %\listoftables          % required if there are tables     %\listoffigures         % required if there are figures               \chapter{test1}     some text     \chapter{test2}     more text     \section{test3}     ds     \chapter{test4}     \end{document}      ![table of content with gap](http://i.stack.imgur.com/5k3RM.jpg) Some lines from the `thesis.cls` file.               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %                            SECTION HEADINGS     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      \newcommand\chaptersize{\large}     \newcommand\sectionsize{\large}     \newcommand\subsectionsize{\normalsize}     \newcommand\subsubsectionsize{\normalsize}     \newcounter{firstchapter}     \setcounter{firstchapter}{0}          \setcounter{secnumdepth}{3}    % Number subsubsections in the chapters     \setcounter{tocdepth}{0}       % Put subsubsections in the table of contents          % Print "CHAPTER" if chap option is specified:     \ifchap       \renewcommand\@chapapp{\chaptername}     \else       \renewcommand\@chapapp{}     \fi          \def\specialhead#1{%   GENERAL HEADING WITHOUT A NUMBER (for abstract, etc.)          \ifx\phantomsection\undefined          \else             \clearpage\phantomsection          \fi          \addcontentsline{toc}{chapter}{#1}          \chapter*{\centering #1 \@mkboth{#1}{#1}}}               \def\@chapter[#1]#2{\ifnum\c@firstchapter=0    % start of rpi added stuff                           \if@twoside\cleardoublepage\suppressfloats[t]\fi                           \pagenumbering{arabic}                            \setcounter{firstchapter}{1}                         \fi                         \renewcommand{\thepage}{\arabic{page}}                         \thispagestyle{plain}                         \pagestyle{myheadings}      % end of rpi added stuff                         \ifnum \c@secnumdepth >\m@ne                              \refstepcounter{chapter}%                              \typeout{\@chapapp\space\thechapter.}%                              \addcontentsline{toc}{chapter}%                                        {\protect\numberline{\thechapter.}#1}%                         \else                           \addcontentsline{toc}{chapter}{#1}%                         \fi                         \chaptermark{#1}%      %                    \addtocontents{lof}{\protect\addvspace{10\p@}}%     %                    \addtocontents{lot}{\protect\addvspace{10\p@}}%                         \if@twocolumn                           \@topnewpage[\@makechapterhead{#2}]%                         \else                           \@makechapterhead{#2}%                           \@afterheading                         \fi}     \def\@makechapterhead#1{%       \vspace*{0\p@}%       {\parindent \z@ \raggedright \centering \normalfont \chaptersize         \ifnum \c@secnumdepth >\m@ne           \ifchap              \bfseries \@chapapp{} \thechapter    % print "Chapter" and number              \vskip -3pt           %\par\nobreak (original)            \else              \bfseries \thechapter.             \fi         \fi         \interlinepenalty\@M         \bfseries #1\par\nobreak         \vskip 15\p@       }}          \def\@makeschapterhead#1{%    heading for chapter* command (no numbering)       \vspace*{0\p@}%       {\parindent \z@ \raggedright \centering         \normalfont  \chaptersize          \interlinepenalty\@M         \bfseries  #1\par\nobreak         \vskip 15\p@       }}          \renewcommand\section{\@startsection {section}{1}{\z@}%                                        {3.5ex \@plus 1ex \@minus .2ex}%                                        {.5ex \@plus .3ex}%{1.4ex \@plus.2ex}%                                        {\normalfont\sectionsize\bfseries}}     \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%                                          {3.25ex\@plus 1ex \@minus .2ex}%                                          {.3ex \@plus .2ex}%{1.2ex \@plus .2ex}%                                          {\normalfont\subsectionsize\bfseries}}     \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%                                          {3.25ex\@plus 1ex \@minus .2ex}%                                          {.2ex \@plus .1ex}%{1ex \@plus .2ex}%                                          {\normalfont\subsubsectionsize\bfseries}}     % \paragraph and \subparagraph headings unchanged from report.cls.     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %  TABLE of CONTENTS,  LIST OF TABLES,  LIST OF FIGURES      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \renewcommand\tableofcontents{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\contentsname             \@mkboth{%                \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%         \vskip -1em \begin{singlespace}      % singlespacing         \@starttoc{toc}%         \if@restonecol\twocolumn\fi         \end{singlespace}         }          \renewcommand*\l@chapter{\pagebreak[3]\vskip 10pt plus 1pt minus 1pt                              \@dottedtocline{0}{0em}{1.4em}}     \renewcommand*\l@section{\vskip 6pt plus 1pt minus 1pt                              \@dottedtocline{1}{1.5em}{2.3em}}     \renewcommand*\l@subsection{\ifnum\c@tocdepth>1\vskip 4pt minus 1pt \fi                              \@dottedtocline{2}{3.8em}{3.2em}}     \renewcommand*\l@subsubsection{\ifnum\c@tocdepth>2 \vskip 3pt minus 1pt \fi                              \@dottedtocline{3}{7.0em}{4.1em}}          % The following removed because it's not consistent with entries from longtable     %% modify the definition below (taken from latex.ltx) to include      %% "Table" and "Figure" in entries for lot and lof:      %\long\def\@caption#1[#2]#3{%\baselineskip 14.5 pt     %  \addcontentsline{\csname ext@#1\endcsname}{#1}%     %  {\protect\numberline{\csname fnum@#1\endcsname}{\ignorespaces #2}}%     %  \begingroup     %    \@parboxrestore     %    \normalsize     %    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par     %  \endgroup}          \renewcommand\listoffigures{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \ifx\phantomsection\undefined           \else             \clearpage\phantomsection           \fi         \addcontentsline{toc}{chapter}{\listfigurename}  % add lof to toc         \chapter*{\centering\listfigurename  % center it           \@mkboth{\MakeUppercase\listfigurename}%                   {\MakeUppercase\listfigurename}}%         \vskip -1em \begin{singlespace}  % singlespacing         \@starttoc{lof}%         \if@restonecol\twocolumn\fi         \end{singlespace}         }          \renewcommand\listoftables{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \ifx\phantomsection\undefined           \else             \clearpage\phantomsection           \fi         \addcontentsline{toc}{chapter}{\listtablename}  % add lot to toc         \chapter*{\centering\listtablename  % center it           \@mkboth{\MakeUppercase\listtablename}%                   {\MakeUppercase\listtablename}}%             \vskip -1em \begin{singlespace}  % singlespacing         \@starttoc{lot}%         \if@restonecol\twocolumn\fi         \end{singlespace}         }          %remove following at same time as remove code to put "Figure" in LOF     %\renewcommand*\l@figure{\vskip 10pt plus 1pt minus 1pt     %                       \@dottedtocline{1}{0em}{5.8em}}          \renewcommand*\l@figure{\vskip 10pt plus 1pt minus 1pt                            \@dottedtocline{1}{0em}{2.8em}}     \let\l@table\l@figure          \let\rpicaption\caption     \let\lrpicaption\caption               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %  BIBLIOGRAPHY     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % RPI def: for use in making an unnumbered bibliography with hanging indents     \def\bibentry{\vskip10pt\par\noindent\hangindent=40pt\frenchspacing}          % report definition modified for no automatic heading and use ragged right     \newcommand{\bibalign}{\raggedright}          \renewenvironment{thebibliography}[1]          {\bibalign\frenchspacing           \list{\@biblabel{\@arabic\c@enumiv}}%                {\settowidth\labelwidth{\@biblabel{#1}}%                 \leftmargin\labelwidth                 \advance\leftmargin\labelsep                 \@openbib@code                 \usecounter{enumiv}%                 \let\p@enumiv\@empty                 \renewcommand\theenumiv{\@arabic\c@enumiv}}%           \sloppy\clubpenalty4000\widowpenalty4000%           \sfcode`\.=\@m}          {\def\@noitemerr            {\@latex@warning{Empty `thebibliography' environment}}%           \endlist}


title: Changing margins removes page number

text: I've used \newgeometry \restoregeometry to change the margins of one page so I can fit two images onto it. However as a result of this, the page number for that page has disappeared. The page is still counted, as the page following that (with the restored margins) has a page number as if the page before existed.


title: Write a class with language dependent strings

text: I am unable to make my class strings language dependent using babel. I have the following minimal example: file `test-babel.cls`               \NeedsTeXFormat{LaTeX2e}[1999/12/01]     \ProvidesPackage{test-babel}[2012/10/22 v0.1]          \DeclareOption{spanish}{%       \AtBeginDocument{%           \renewcommand*\conclusionsname{Conclusiones finales}          }       \AtEndOfClass{\main@language{spanish}}     }          \DeclareOption{english}{%       \AtBeginDocument{%         \renewcommand*\conclusionsname{Final conclussions}       }       \AtEndOfClass{\main@language{english}}     }          \newcommand\conclusionsname{dumyy}               \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}     \ProcessOptions\relax          \LoadClass{report}     \newcommand\print{\conclusionsname}      I use this test `tex` file:               \documentclass{test-babel}     \usepackage[spanish]{babel}     \begin{document}     \print     \end{document}      The result of compilation is the word `dummy`, the default value, and not the Spanish translation. Can someone help me to understand how to use `babel` while writing a class?


title: Multibib & indentation

text: I use multibib to apply more than one bibliography in my document. The problem is when using more than 9 entrys, there occurs an indentation.               \documentclass{article}          \usepackage[resetlabels]{multibib}     \newcites{lit}{Literature1}     %\newcites{lit2}{Literature2}          \usepackage{etoolbox}     \makeatletter     \patchcmd{\thebibliography}{%       \section*{\refname}\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%     }{}{}{}     \makeatother          \usepackage{filecontents}          \begin{filecontents}{Lit1.bib}     @misc{A01,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A02,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A03,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A04,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A05,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A06,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A07,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A08,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A09,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A10,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     @misc{A11,       author = {Author, A.},       year = {2001},       title = {Alpha},     }     \end{filecontents}               \begin{document}          \makeatletter\renewcommand{\@biblabel}[1]{[A\,#1]}\makeatother     \nocitelit{*}     \bibliographystylelit{plain}     \bibliographylit{Lit1}          \end{document}      How can I avoid this indentation?


title: Basic kerning with XeTeX

text: Trying to use custom fonts with LyX, so I started using XeTeX. Unfortunately, It seems kerning only works with certain OpenType fonts (Linux Libertine) but not for others (Doulos SIL or Charis SIL). Are there additional settings I have to set up in order for this to work? **Edit:** Images from the pdf output (with Linux Libertine and Doulos SIL respectively): ![Kerning with Linux Libertine](http://i.stack.imgur.com/OpQTY.png) ![No kerning with Doulos SIL](http://i.stack.imgur.com/4axHV.png)


title: footnote double spacing with memoir package

text: I haven't found any possible way to double space my footnote while using the `memoir` package. There is another question which has been closed because not general.. well, I have the same request.               \documentclass[12pt,article,oneside]{memoir}     \usepackage{lipsum}     \begin{document}     Test a\footnote{\lipsum[1]} and b\footnote{\lipsum[1]}.     \end{document}      The only working command I found is `\setlength{\footnotesep}{\baselineskip}`


title: why latex templates downloaded from latextemplates.com not working in my tex editor?

text: I downloaded templates from latextemplates.com and opened them in texeditor and kile and while compiling it gives so many errors but I am able to compile them online on share latex website.Can anyone help?