title: Horrible table layout

text: I have a table which gives an overview of some theory. It includes a lot of words or combination of words. The layout is horrible and not LaTeX quality. Some guidance as to how to improve would be welcome. my MWE table is as follows                   \documentclass[11pt,pdftex]{report}          \usepackage{booktabs}     \usepackage[a4paper]{geometry}     \usepackage{tabularx}     \usepackage{microtype}          \geometry{       includeheadfoot,       margin=2.5cm,       hdivide={ ,19cm, }       }     \setlength{\hoffset}{0.00cm}     \setlength{\voffset}{0.00cm}               \begin{document}     \begin{table}[htdp]       \caption{Pillar of Institutions}\label{tab:Pillars}     \centering     \begin{tabularx}{0.99\textwidth}{lXXX}        \toprule                               & Regulative & Normative& Cultural-cognitive \\      \midrule     Basis of  \linebreak compliance       &Expedience& Social obligation & Take-for-grantedness \linebreak Shared understanding\\     Basis of order & Regulative rules& Binding Expectations &Constitutive Schema\\     Mechanisms & Coercive     &Normative & Mimetic\\     Logic &instrumentally     & Appropriateness& Orthodoxy\\     Indicators & Rules \linebreak Laws  \linebreak Sanctions    &Certifications \linebreak Accreditation  & Common beliefs\linebreak Shared logic of action\\     Basis of legitimacy      &Legally sanctioned & Morally governed & Comprehensible \linebreak Recognisable \linebreak Culturally supported\\     Supported by &Economists  & Early Sociologist & Late Sociologist\\     Primary Propagandists     & North & Selznick & DiMaggio and Powell, Scott\\     Degree of formality       &Formal institutions &Informal institutions&Informal institutions\\     \bottomrule     \end{tabularx}     \end{table}          \end{document}      ![enter image description here](http://i.stack.imgur.com/GRbPv.jpg)


title: Fully robust way to access the first item in a token list (expandably)

text: Given a token list such as `\a\b\c` or `{ab}c`, I define the first item to be what `\@gobble` would get as its argument (recall the definition `\long\def\@gobble#1{}`). It is not hard to devise a macro which extracts the first item from a token list, and, for instance, wraps it in eTeX's `\unexpanded`:               \begingroup       \catcode`@=11       \long\gdef\firstofmany#1{\@firstofmany#1\@marker}       \long\gdef\@firstofmany#1#2\@marker{\unexpanded{#1}}     \endgroup     \message{"\firstofmany{\a\b\c}"} % => "\a "     \message{"\firstofmany{ { ab} c}"} % => " ab"      However, this macro fails if the token list contains the marker, which I chose to be `\@marker`. Is it possible to write a variant of this macro which would work for an arbitrary token list? (I don't care what token lists consisting only of spaces, which thus have no first item, produce.) EDIT: I should have made it clearer that the solution is not to produce a less common delimiter. I would like a `\firstofmany` function which does not choke on any part of its own definition (and definitions of auxiliaries too, of course).


title: Aligning proofs from the proof package

text: I am trying to align several proofs produced with the `infer` command from the proof package. I want to be able to produce the following: ![enter image description here](http://i.stack.imgur.com/CeAg8.png) But I cannot align is this way. Here is a minimal example:               \documentclass{article}     \usepackage{proof}     \begin{document}     \[       \begin{array}{cc}         \vcenter{\infer[rule~name]{equation}{equation}}         &         conditions\ \vcenter{\infer[rule~name]{equation}{equation}}         \\[1.5em]         conditions\ \vcenter{\infer[rule~name]{equation}{equation}}         &         \vcenter{\infer[rule~name]{equation~maybe~longer}{equation}}       \end{array}     \]     \end{document}      which produces the following: ![enter image description here](http://i.stack.imgur.com/GjQTS.png)


title: Enable letters with diaeresis

text: My document is in in dutch and there are quite a few letters with diaeresis in it. I have this on top of my document:               \usepackage[dutch]{babel}      I thought this would fix the language-problem but every letter with a diaeresis in it is left out. Any ideas how to enable those? It's mostly ï's and ë's.


title: Will LaTeX3 improve freedom of package ordering and reduce "options clash"?

text: A prefatory afterthought: you may think this question better asked on the LaTeX3 mailing list, but I believe there may be a more general interest in the rather Byzantine rules for package load order. I only mention LaTeX3 as, perhaps, the most obvious opportunity for fixing this. * * * This is a working MWE; swapping the marked lines makes it fail (options clash):               \documentclass[draft]{memoir}     \usepackage[final]{graphicx}   % <== Swap this one     \usepackage{fontspec}          % <== with this to break it     \usepackage[final]{microtype}     % =================================================     \begin{document}     % =================================================     \mainmatter     For that reason among others,     typography and typographers must honour      the variety and complexity of human language,     thought and identity, instead of      homogenizing or hiding it.     % =================================================     \end{document}      Obviously, somewhere in `fontspec` is loading graphicx (though I couldn't find where). Although _I_ am fairly happy to live with this kind of minor annoyance, it occurs to me that constraints on the order of loading packages could be one of the factors that might discourage potential TeX adopters. Do the LaTeX3 team have any views on this? Might it be possible, for example, to suppress option clash checks when using `RequirePackage` as opposed to `usepackage`, or provide package writers with a generic means of suppression? Or is this something that _needs to be_ under the detailed scrutiny of each package writer?


title: Strange difference in usage of \pgfmathprintnumber

text: I encountered a strange spacing difference in the following example:               \documentclass{article}          \usepackage{tikz}          \begin{document}              number printer inside of fbox with -5e-5:              \fbox{\pgfmathprintnumber{-5e-5}}              \fbox{$\pgfmathprintnumber{-5e-5}$}     \end{document}      ![enter image description here](http://i.stack.imgur.com/f6CNS.png) I know that `\pgfmathprintnumber` eventually uses `\pgfutilensuremath` which is defined by               \def\pgfutilensuremath#1{%       \ifmmode#1\else$#1$\fi     }      The question is: how can I get consistent behavior? More precisely: how can I change `\fbox{\pgfmathprintnumber{-5e-5}}` (i.e. change `\pgfmathprintnumber`) such that it does the same as the other statement (the other way round is not my use case). Note that this actually a regression in pgfplots: version 1.4 used the second approach whereas version 1.5 uses the first. I would like to keep the first, but with the spacing of the second. Could it be related to TeX's strategy to look for the next following char after `$` to see if it might be a `$$`? If so, how can I avoid it?


title: Lists of Theorems (XeLaTeX)

text: I've found out how to use the `thmtools` package to make lists of theorems. My questions on this are:   1. Adding `[name=xxx,label=thm:...]` after `\begin{yyy}` (xxx is a title for the theorem, ... a label appearing in the list, yyy the theorem kind) labels a theorem. If I try to put any maths beyond superscript and subscript (for now I've only tried `\mathbb`) into a label, I get a `missing \endcsname inserted` error related to a line of the .aux files. MWE:              \documentclass[a4paper]{report}       \usepackage{thmtools,amssymb}       \declaretheorem[name=Definizione]{defi}       \begin{document}       \begin{defi}[name=$\mathbb R$,label=thm:$\mathbb R$definizione]       Ah beh, s\`i beh.       \end{defi}       \listoftheorems       \end{document}        which gives:   ![Error message in TeXShop Console](http://i.stack.imgur.com/qPxwl.png).   The same error is obtained by placing a `\ref` in a label. In fact, `\mathbb` gives problems anywhere in those [], just like a comma in the middle of a name or label, even within dollars to mark an interval like (0,1). How do I solve that?   1. (should be 2) And finally, I'm using theorems with `[subsection]` numbering. Now, in the list, the number overlaps the theorem kind (i.e. I get `1.2.1.1` overlapping `Definizione (Spazio Metrico)`). How do I solve that?


title: Count "a" in text not in math mode, verbatim or lstlisting

text: I would like to count the "a" word in a text and put output to the PDF file, eg. > This is a document about processing text in TeX.   >  The document has a new macro but `$a = 10$` is not counted,   >  nor `\lstinline{a = 2}`   >  nor `\begin{lstlisting}a = 1;\end{lstlisting}` Code should output 2, as "a" is only two times mentioned. I do not want to process math, verbatim or lstlisting. I have seen the answer for a question Environment that counts words inside and I can count only 'b' letters (not words)               \documentclass{article}     \begingroup     \lccode`\~=`\b%     \lowercase{%       \gdef\assignment{\setcounter{word}{0}%         \catcode`~=\active         \def~{b\stepcounter{word}}}}%     \endgroup     \newcounter{word}     \def\endassignment{\marginpar{\arabic{word} words}}     \begin{document}          \begin{assignment}     Here are some bad words.     \end{assignment}          \end{document}      A problem here is that, when I would like to write word **bad** in bold using `\textbf{bad}`, the source code is not compiling. This question is only half-way. I would like to automatically modify every `"a word"` to `"a~word"`.


title: Conditional inputfile , latex

text: I am using a conditionalinput file inside my main file %% Out2 doesn't exits %% Out exists I don't want to get caption and table number at position where I don't have file.               \documentclass{article}        \usepackage[ngerman]{babel}     \usepackage{caption}             \makeatletter     \newcommand{\testfileexists}[1]{%       \IfFileExists{#1}%         {\def\inputtestedfile{\@@input #1 }}         {\let\inputtestedfile\@empty}%     }     \makeatother                   \centering         \testfileexists{out}     \captionof{table}{ my cation }       \begin{tabular}{ll}        L01&  \inputtestedfile       \end{tabular}                \testfileexists{out2}     \captionof{table}{ my caption}       \begin{tabular}{ll}         L02&  \inputtestedfile      \end{tabular}                   \centering     \testfileexists{out}     \captionof{table}{ my caption}       \begin{tabular}{ll}         L03&  \inputtestedfile       \end{tabular}           \end{document}      %%%Contents of out.tex               \begin{tiny}\begin{tabular}{|l|C{2cm}|C{2cm}|}     \hline     &\textbf{col 1}&\textbf{col 2}\\\hline     \textbf{row 1}&1.50&1.76\\\hline     \textbf{row 2}&3.52&0.20\\\hline     \end{tabular}     \end{tiny}


title: How to establish node-anchor-like points on a (tikz) rectangle path (is there a better method than the one described)?

text: ## Background and desired functionality Rectangles can be drawn with tikz in a number of ways, one way of doing so is to define a rectangle node as follows:               \node (rectangle) [draw, rectangle] {A rectangle};     % Strictly speaking, rectangle is not needed in the [] as nodes are rectangular by default      A useful feature of this is that, as a node, it has anchor points around it such as `rectangle.north`, `rectangle.south west` and so on. Another way is to draw a rectangle path, like this:               \draw (0,0) rectangle (3,2);      I would like to be able to use this second path-based method* but also be able to have (some) named anchors on the path. ## Approach from the time of asking ### MWE: The method I had for this is demonstrated by the following MWE (inspired by this inventive answer and later improved by Altermundus' comment):               \documentclass{report}          \usepackage{tikz}          \begin{document}          \begin{tikzpicture}              \draw             (0,0)                 coordinate [xshift=-{0.5\pgflinewidth},yshift=-{0.5\pgflinewidth}] (rectangle south west)             rectangle                 coordinate (rectangle center)             (3,2)                 coordinate [xshift={0.5\pgflinewidth},yshift={0.5\pgflinewidth}] (rectangle north east)             edge [draw=none]                 coordinate (rectangle north)             (rectangle north east -| rectangle south west)         ;          \end{tikzpicture}          \end{document}      Obviously this only defines anchors for `center`, `north`, `north east`, and `south west`, but it can be fairly easily extended to provide `south`, `east`, `west`, `north west` and `south east` (as demonstrated in my answer). ### Caveat: As pointed out by Andrew Stacey in his answer, there was a slight discrepancy between the positioning of these pseudo-anchor coordinates and the anchors on a normal rectangular node. The `edge`-based solution above originally placed the pseudo-anchors exactly on the coordinates of the rectangle whereas on a rectangular node they would be placed at the outside edge of the lines of the rectangle. Although this was only likely to cause issues with thick line widths I have now added some x/yshifting to the above code to compensate. The following image shows the difference in anchor positioning between standard node rectangles, the original `edge`-based solution (without x/yshifting) and the above (revised) `edge`-based solution (with x/yshifting). The line widths for the lower pictures are set to 0.5cm. ![Comparison of rectangular nodes and edge-based solutions \(with and without x/yshifting\), illustrating the discrepancy in anchor positioning](http://i.stack.imgur.com/NtBn7.png) _Node rectangle labelling code to illustrate the key to the colours (and for the generally curious):_               % styling yoinked from Altermundus' answer     \tikzset{dot/.style={circle,fill=#1,inner sep=0,minimum size=4pt}}     \node [dot=red] at (rectangle.south west) {};     \node [dot=blue] at (rectangle.center) {};     \node [dot=purple] at (rectangle.north east) {};     \node [dot=green] at (rectangle.north) {};     \node [dot=orange] at (rectangle.north west) {};     \node [dot=yellow] at (rectangle.south) {};     \node [dot=brown] at (rectangle.south east) {};     \node [dot=black] at (rectangle.east) {};     \node [dot=pink] at (rectangle.west) {};      ## Back to the question Is there a neater/better way to establish node-anchor-like points on a rectangle path* than the method given in the MWE above? _* = An equivalent drawing method that also allows specifying a rectangle by corner coordinates would be more than acceptable_!


title: Bold enumeration in multienum package

text: I am trying to bold the enumeration in the `multienum` package. The MWE illustrates what I have so far:               \documentclass[letterpaper]{article}     \usepackage{multienum}     \begin{document}         \begin{multienumerate}         \renewcommand{\itemx}[1]{\parbox[t]%         {\labelwidth}{\hfill{\bfseries\labelname}}\hskip\labelsep%         \parbox[t]{\remainx}{\raggedright #1}\par}%\smallskip         \renewcommand{\itemxx}[2]{\parbox[t]%         {\labelwidth}{\hfill{\bfseries\labelname}}\hskip\labelsep         \parbox[t]{.5\remainxx}{\raggedright #1}\hfill\parbox[t]%         {\labelwidth}{\hfill{\bfseries\labelname}}\hskip\labelsep         \parbox[t]{0.5\remainxx}{\raggedright #2}\smallskip}         \setlength\hsize{\linewidth}%                  \mitemx{Some random item.}             \mitemxx{Second}{Third}         \end{multienumerate}     \end{document}      But as you notice, it is not the most pleasant way of doing it if I am to bold locally within the `multienumerate` environment more than once in a document. What I want to achieve are commands like `\boldx`, `\boldxx`, or simply `\boldmultienum` that will ensure that the enumeration is done locally. Thus instead of the above I would have something like               \documentclass[letterpaper]{article}     \usepackage{multienum}     \begin{document}         \begin{multienumerate}                 \boldx\boldxx % or \boldenumerate to be more general. Need both cases.              \mitemx{Some random item.}             \mitemxx{Second}{Third}         \end{multienumerate}     \end{document}      Or even something like:               \begin{multinenumerate}[label=\bfseries\labelname]     \mitemx{one}     \mitemxx{two}{three}     \end{multienumerate}


title: Vertical spacing between sidenotes (and, between sidenotes and captions) in tufte-book

text: Within from LyX, using various sidenotes in a tufte-latex-book environment, along with float figures, results sometimes in an overlapping of sidenotes and caption(s). For example, two sidenotes followed by a figure caption (may) look like in the following screenshot: ![screenshot of an overlapping sidenote and a figure caption](http://i.stack.imgur.com/uriQD.png) **As requested in the comments,** a minimal working example: My guess is that this issue is rather generic and not LyX-specific. How can one adjust the vertical spacing _between sidenotes_ , as well as _between sidenotes and figure captions_?               % Preview source code          %% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \RequirePackage{fix-cm}     \documentclass[11pt,twoside,english,nohyper,notitlepage]{tufte-book}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \setlength{\parskip}{\bigskipamount}     \setlength{\parindent}{0pt}     \usepackage{color}     \usepackage{babel}     \usepackage{fixltx2e}     \usepackage{graphicx}     \usepackage{setspace}     \onehalfspacing     \usepackage[unicode=true,      bookmarks=true,bookmarksnumbered=true,bookmarksopen=false,      breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=true]      {hyperref}     \hypersetup{      pdfauthor={Nikos Alexandris}}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.          \title{Some title}     \author{by Nikos Alexandris}     \pdfpageheight\paperheight     \pdfpagewidth\paperwidth          %% A simple dot to overcome graphicx limitations     \newcommand{\lyxdot}{.}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     % inline item enumeration     \usepackage{paralist}          \makeatother          \begin{document}     \maketitle          \subsection{Trim fringes\label{sub:Trim fringes}, in case they exist}          The Level 1 product generation system (LPGS\sidenote{Differences between the two main Landsat production systems are summarised     in USGS' webpage about \href{http://landsat.usgs.gov/products_IP_LPGSvsNLAPS.php}{LPGS and NLAPS Processing Systems Comparison}}) does not trim band offsets (fringes)\sidenote{Source: \href{http://landsathandbook.gsfc.nasa.gov/pdfs/Landsat7_Handbook.pdf}{Landsat 7 Science Data Users Handbook})}\sidenote{Detailed information upon this can be researched at \href{http://landsat.usgs.gov/tools_project_documents.php}{Landsat Missions, Project Documentation}}     \begin{figure}     \includegraphics[width=1\columnwidth,height=8cm,keepaspectratio]{/geo/grassdb/exported/arcfuel/LT51840322011266MOR00_B7_no_Nulls\lyxdot png}          \caption{Fringes are visible in the borders of an Landsat acquisition due to }     \end{figure}          \end{document}      This results in a very similar overlapping effect, as the screenshot given above which was taken after compiling a large document. ![another screenshot of an overlapping sidenote and a figure caption](http://i.stack.imgur.com/LVcmW.png) **Update (13. 01. 2013)** For completeness, exporting the LyX file as LaTeX (pdflatex) and compiling it -- without any modifications -- from within Kile, results, again, in the same overlapping effect.               %% LyX 2.0.3 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \RequirePackage{fix-cm}     \documentclass[11pt,twoside,english,nohyper,notitlepage]{tufte-book}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \setlength{\parskip}{\bigskipamount}     \setlength{\parindent}{0pt}     \usepackage{color}     \usepackage{babel}     \usepackage{fixltx2e}     \usepackage{graphicx}     \usepackage{setspace}     \onehalfspacing     \usepackage[unicode=true,      bookmarks=true,bookmarksnumbered=true,bookmarksopen=false,      breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=true]      {hyperref}     \hypersetup{      pdfauthor={Nikos Alexandris}}          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.          \title{Some title}     \author{by Nikos Alexandris}     \pdfpageheight\paperheight     \pdfpagewidth\paperwidth          %% A simple dot to overcome graphicx limitations     \newcommand{\lyxdot}{.}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     % inline item enumeration     \usepackage{paralist}          % The default minimum amount of space between \marginnotes is 10 pt.     \setlength\marginparpush{20pt}          \makeatother          \begin{document}     \maketitle          \subsection{Trim fringes\label{sub:Trim fringes}, in case they exist}          The Level 1 product generation system (LPGS\sidenote{Differences between the two main Landsat production systems are summarised     in USGS' webpage about \href{http://landsat.usgs.gov/products_IP_LPGSvsNLAPS.php}{LPGS and NLAPS Processing Systems Comparison}}) does not trim band offsets (fringes)\sidenote{Source: \href{http://landsathandbook.gsfc.nasa.gov/pdfs/Landsat7_Handbook.pdf}{Landsat 7 Science Data Users Handbook})}\sidenote{Detailed information upon this can be researched at \href{http://landsat.usgs.gov/tools_project_documents.php}{Landsat Missions, Project Documentation}}          \begin{figure}     \includegraphics[width=1\columnwidth,height=8cm,keepaspectratio]{/geo/grassdb/exported/arcfuel/LT51840322011266MOR00_B7_no_Nulls\lyxdot png}          \caption{Fringes are visible in the borders of an Landsat acquisition due to }     \end{figure}          \end{document}      This time, a full-witdh screenshot of an overlapping sidenote and a figure caption.


title: How to write "ℰ"

text: could anyone please tell me how I can write "ℰ" in latex in both text and math enviroment? I have already tried `$\mathscr{E}$` and `$\mathcal{E}$`, but none of those are satisfying. What I want to have is ![enter image description here](http://i.stack.imgur.com/TTesG.png) but not any of these ![enter image description here](http://i.stack.imgur.com/n78w8.jpg)


title: Command that gobbles all following empty lines

text: One distinction between `knitr` and `Sweave` is that the former forcibly inserts two empty lines in the generated TeX source for chunks that do not do any output. I'm not sure if this issue is a bug or a feature, but for now I'm looking for a workaround. The problem can be summarized as follows: `.Rnw` code like               a     <<q,echo=FALSE,results='hide'>>=     getwd()     @     b      produces LaTeX code like               a               b      where the space between `a` and `b` is not always desired. The best workaround that I found so far is to write               a\q{     <<q,echo=FALSE,results='hide'>>=     getwd()     @     }b      and define `\q` as a one-parameter command that expands to a single space. Is there a shorter way to achieve a similar result, perhaps without using braces and without affecting the line that starts with `b`? **ADDED** : Is there a way to assign to a special character, say, `§`, the semantics of this command, so that the following will work:               a §     <<q,echo=FALSE,results='hide'>>=     getwd()     @     b      (Of course, a `knitr` way to achieve this would be most welcome, too.) This answer seems related, but I haven't been able to get the `\eatpar` command to work. Would it eat two empty lines, too?


title: pgfplots: how to display a label next to my plot when the option clip = true cuts out a part of the graph?

text: ## Question I want to attach a label to the curves I draw. My current solution is to add a node after the plot of my function (see the code below). But, when I explicitly cut out a part of my graph, with the option `clip = true`, the label can be completely away from the curve (see the picture below). Do you have an idea on how to resolve this issue, or a different approach to the issue of labeling my curves? I am looking for an automatic solution, if possible. ## Picture ![enter image description here](http://i.stack.imgur.com/tZily.png) ## Code               \documentclass{article}     \usepackage[x11names]{xcolor}     \usepackage{tikz}     \usepackage{pgfplots}     \begin{document}                    \begin{tikzpicture}[domain=0.01:5]     \begin{axis}     [grid = major,      clip = true,      clip mode=individual,      axis x line = middle,      axis y line = middle,      xlabel={$x$},      xlabel style={at=(current axis.right of origin), anchor=west},      ylabel={$y$},      ylabel style={at=(current axis.above origin), anchor=south},      domain = 0.01:5,      xmin = 0,      xmax = 5,      enlarge y limits={rel=0.13},      enlarge x limits={rel=0.07},      ymin = -10,      ymax = 10,      after end axis/.code={\path (axis cs:0,0) node [anchor=north west,yshift=-0.075cm] {0} node [anchor=south east,xshift=-0.075cm] {0};}]          \addplot[color=Firebrick2, samples=100, smooth, ultra thick] {x^2}     node(endofplotsquare){} ;     \node [right, color=Firebrick2] at (endofplotsquare) {$x^2$};          \addplot[color=DodgerBlue2, samples=100, smooth, ultra thick] {exp(x)};          \addplot[color=Gold3, samples=1000, smooth, ultra thick, unbounded coords=jump,  no markers] {ln(x)};     \end{axis}          \end{tikzpicture}          \end{document}


title: First indent is shorter than it should be

text: I am using `\paragraph{}` at the beginning of chapter. All my paragraphs are intended automatically but first indent is always little bit shorter than others (I mean that white space). Does anyone experienced this problem before? I have no idea what's wrong               \documentclass[a4paper,12pt,oneside,onecolumn,final,openany]{report}     \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[slovak]{babel}     \usepackage{ae}     \usepackage{fancyhdr}     \usepackage{graphicx}     \usepackage{makeidx}     \usepackage[top=2.5cm, bottom=2.5cm, left=3cm, right=2.5cm, includefoot]{geometry} %total={17cm,25cm},     \usepackage{longtable}     \usepackage{amsthm}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{textcomp}     \pagestyle{fancy}     \usepackage{hyperref}     \usepackage{float}     \usepackage{subfig}     \usepackage{booktabs, multicol, multirow}     \usepackage{bigstrut}          \begin{document}          \def\baselinestretch{1.2}\normalsize          \chapter*{First one}          \paragraph{}     \bigskip          {\bf First} - aaaaaa\\          {\bf Second} - bbbbbb\\          {\bf Third} - ccccccc\\          \end{document}


title: How to name subfigures in different figures independently

text: I have a problem with subfigure. I want to put some figures at different places in the section. I want to have them in pairs, so I use subfigure. But, instead of labels (a) and (b) in the Figure 1, and labels (a) and (b) in the Figure 2, I have (a) and (b) in Figure 1 and (c) and (d) in Figure 2. And it is like this in whole section. So in the end of the section, I have a pair of pictures, which I have to refer at as Figure 3(e) and 3(f). Instead of that, I would like to have each pair of pictures be named as (a) and (b). So I would have Fig. 1(a) and 1(b), Fig. 2(a) and 2(b), and so on. Do anyone know what to do with it? Thanks.                    \documentclass[12pt,a4paper]{article}              \usepackage[english]{babel}              \usepackage{graphicx}              \usepackage{caption}             \usepackage{subcaption}             \usepackage{color}              \usepackage{float}                  \begin{document}                  \begin{figure}[H]              \begin{subfigure}{.9\textwidth}               \centering               \includegraphics[width=.5\linewidth]{1.pdf}               \caption{$H \rightarrow b\overline{b}$}              \end{subfigure}             \begin{subfigure}{.9\textwidth}               \centering               \includegraphics[width=.5\linewidth]{2.pdf}            \caption{$H \rightarrow \gamma \gamma$}           \end{subfigure}           \caption{mmmm}         \end{figure}          text text text            \begin{figure}[H]              \begin{subfigure}{.9\textwidth}               \centering               \includegraphics[width=.5\linewidth]{1.pdf}               \caption{$H \rightarrow b\overline{b}$}              \end{subfigure}             \begin{subfigure}{.9\textwidth}               \centering               \includegraphics[width=.5\linewidth]{2.pdf}            \caption{$H \rightarrow \gamma \gamma$}           \end{subfigure}           \caption{mmmm}         \end{figure}              \end{document}


title: Help in choosing LaTeX2e books in light of LaTeX3 development

text: I'm quite new to LaTeX (~3 months) and I'm excited about buying the books. I just bought The TeXbook on eBay and hopefully it should arrive next week. I might even want to get a printed copy of TeX by Topic since I'm not a big fan of reading on-screen. Next in line, I want to get either The LaTeX Companion or Guide to LaTeX.   1. Is it too late to get hold of the LaTeX2e-related books considering LaTeX3 is coming (though I don't know of any time frame yet)?   2. Kindly enlighten me on the following assumptions. From what I've read around here, I have a general feeling that:     * The TeXbook and The LaTeX Companion lean on a more narrative style     * TeX by Topic and Guide to LaTeX read more like a reference book   3. For a starter, I can only afford:     * either The TeXbook or TeX by Topic; and     * either The LaTeX Companion or Guide to LaTeX. I can already navigate `lshort` (the "narrative tutorial") quite well, so I'm leaning towards Guide to LaTeX (the "reference manual").   4. What do you think of my book choices? I tend to prefer something in the style of a reference manual.


title: How to force nodes on different lines to have equal y-positioning

text: I have, hopefully, a very simple question. I use tikz to make a figure for confirmatory factor analysis (CFA). In the minimal example there a 6 arrows going from the circle to a fixed place. However, as a previous question pointed out (TikZ: How to set a node on an exact position on a line?) the positioning depends on the length of the line so therefore the nodes do not align vertically (although it is only marginal...). I wonder, therefore, if its possible (probably yes), to have all nodes still snapped to the lines but on exactly the same y coordinate (height).               \documentclass{article}     \usepackage{tikz}          \begin{document}          \begin{tikzpicture}     \node[circle,draw] (A) at (0,0) {A};          \draw[->] (A) -- (-2.5,-2) node[near end,fill=white] {u};     \draw[->] (A) -- (-1.5,-2) node[near end,fill=white] {v};     \draw[->] (A) -- ( -.5,-2) node[near end,fill=white] {w};     \draw[->] (A) -- (  .5,-2) node[near end,fill=white] {x};     \draw[->] (A) -- ( 1.5,-2) node[near end,fill=white] {y};     \draw[->] (A) -- ( 2.5,-2) node[near end,fill=white] {z};     \end{tikzpicture}          \end{document}


title: Setup for sub-captions for two sub-figures one below the other

text: I am using the caption and subcaption packages to create sub-figures in a document. I have two cases of sub-figures:   1. Two sub-figures side-by-side. For this, the captioning is excellent.   2. Two sub-figures one below the other. in this case, the first sub-caption appears immediately above the second sub-figure. How can I configure the sub-captions to include a small space between themselves and the next element in the second case, without messing up the setup for the first case? The rude way is to stick a vskip explicitly after the first sub-figure. I prefer to avoid this hack.


title: Is it possible to have a variable chapter header spacing?

text: I've noticed in my document class that when I have really long chapter titles, the title can end up mixing in with the first line of text on the page. My default spacing is 50pt. If I set it higher, to say 150pt, the page with the long chapter name looks fine, but all the rest with single line chapter names have too much white space below it for my taste. I don't want to have to manually alter the spacing at each chapter... is there a way I can tie the spacing to the size of the minipage that I use for the chapter title?               \documentclass{book}     \let\cleardoublepage\clearpage          \RequirePackage{tikz}     \RequirePackage[explicit]{titlesec}     \RequirePackage{DejaVuSansCondensed}     \RequirePackage[normalem]{ulem}     \RequirePackage[       left=2.25in,       right=0.75in,       top=1.25in,       bottom=1.25in,       marginparwidth=1.75in,       marginparsep=.25in,       asymmetric]{geometry}          \renewcommand*\familydefault{\sfdefault} % Set default font          \makeatletter     \titleformat{\chapter}       {\normalfont\sffamily\Huge\scshape}       {}{0pt}       {\thispagestyle{empty}    % Remove page number on new chapters       %\setcounter{definition}{0}       \begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3cm] at (current page.north west)           {\begin{tikzpicture}[remember picture, overlay]             \draw[fill=cyan] (0,-1) rectangle               (25cm,3cm);             \draw[fill=cyan] (0,-24) rectangle               (25cm,-25cm);             \ifttl@label% <---------------------- Added condition on \ifttl@label               \node[anchor=west,xshift=.21\paperwidth,yshift=-.01\paperheight,rectangle]                   {\color{white}\LARGE \MakeUppercase{\@chapapp} \Huge\thechapter};             \fi% <------------------------------- end condition on \ifttl@label             \node[anchor=north west,xshift=.21\paperwidth,yshift=-.040\paperheight,rectangle]                   {\begin{minipage}{.9\textwidth}                     \color{cyan}\Huge\raggedright\MakeUppercase{#1}                   \end{minipage}};            \end{tikzpicture}           };        \end{tikzpicture}       }     \makeatother          \titlespacing*{\chapter}{0pt}{50pt}{0pt}{}          \titleformat{\section}{\color{cyan}\itshape\LARGE}{\llap{\thesection} #1}{1em}{}[\titleline{\color{cyan}\titlerule[1pt]}]     \titleformat{\subsection}{\color{cyan}\normalfont\large}{\; #1}{1em}{}          \begin{document}       \chapter{A normal chapter}         \section{A Section}       \chapter{ON COMPUTABLE NUMBERS, WITH AN APPLICATION TO THE ENTSCHEIDUNGSPROBLEM}         \section{Another Section}     \end{document}


title: Problem with dynamic table creation

text: I've wandered into uncharted territory with a package I'm writing. At one point I need to create a table of 'n' columns (n supplied by user in doc). Creating a variable in the preamble of the tabular declaration will handle the number of rows and the justification, but I can't seem to figure out how to create a row of labels with 'n' cells. Hopefully this MWE example will clarify (I've massively simplified my code to focus on, what I think, is the problem). This will generate the error.                   \documentclass{memoir}         \begin{document}               \ newcounter{n}           \newcommand{\repeatntimes}[2]{ % usage:\repeatntimes{c}{3} -> ccc           \setcounter{n}{0}%           \loop\addtocounter{n}{1}{#1}%           \ifnum\value{n}<#2\repeat}                \newcommand{\sublabels}{\repeatntimes{blah &}{2}}                \begin{tabular}[t]{ccc}           \sublabels blah \\           \end{tabular}         \end{document}      I need \sublabels to expand such that what gets typeset is               \begin{tabular}[t]{ccc}     blah & blah & blah \\     \end{tabular}      I know that this is an expansion problem, but there's another problems also, which is that the '&' is one of the 10 special characters that do funny things. The error message is               ! Missing } inserted.     <inserted text>                     }      I recall Knuth talking about this in the TeXbook, but I spend a long time today trying to find it and couldn't. I've tried all sorts of ways to sequence the expansion, but none work, I _think_ because of the way '&' functions, but I'm not sure. I would appreciate any ideas. TIA


title: Compiling only a page range or page selection

text: How do I easily compile only a page range or page selection? That is, I would like a document that   * looks exactly like the full document,   * **has only the subset of pages that were manually chosen, by page number** (this can be one contiguous range or a more complicated selection, like "12-15,23,45-49"),   * has correct page numbers, and   * has correct links, except links to missing pages should be either dysfunctional or absent.


title: Embedding fonts in PDF

text: I coauthored a book that I want to publish in India. The Indian publisher said "some of the fonts are not embedded in the PDF file shared". They sent me a screenshot of the problematic fonts ( **Item 1** ). The book pdf is created with pdflatex (version info in **Item 2** ). I created a minimum working example (listing is **Item 3** , screenshot is **Item 4** ). The Linux pdffonts command run on my MWE, as well as the book seems to indicate that the fonts are embedded ( **Item 5** ). `pdftexDownloadBase14 true` is set in `/usr/local/texlive/2012/texmf/web2c/updmap.cfg` My question is - is there a problem with my pdf? Specifically, does Acrobat seem to say that the font is not embedded (which I take `encoding: custom` to mean), while `pdftools` says it is? The font issue must be related to the fact that I'm using packages like `skull` (see MWE) and `clock`. The book itself has a large number of fonts (28 Type 1) and (10 Type 3) - `pdffonts` shows all the Type 3 fonts show as embedded (like Item 5 below) and all being with `[none]` for the name - can anyone tell me if this is significant? **Item 1** : Pothi's feedback ![Feedback](http://i.stack.imgur.com/7T1FQ.jpg) **Item 2** : Tex Version > [adnan@Adnans-Mac-mini]/Users/adnanaziz 1333 pdflatex --version > > pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012) **Item 3** : Minimum working example               \documentclass[]{article}     \usepackage{skull}     \begin{document}     \thispagestyle{empty}     Hello World. $\skull$     \end{document}      **Item 4** : Acrobat screenshot of MWE: ![skull](http://i.stack.imgur.com/eqs8a.png) **Item 5** : pdffonts ouput on MWE: > name type emb sub uni object ID > > * * * > > LAGHAY+CMR10 Type 1 yes yes no 4 0 > > [none] Type 3 yes no no 5 0


title: Making sense of compile error logs

text: Is there a documentation somewhere which gives a gentle guidance on interpreting error logs? Sometimes it is really hard to figure out how to correct something judging by the log and it would be useful to know some tricks for this, I think. EDIT: A user has suggested a good wikibook and this seems to have some helpful hints (same goes for the latex companion suggested) but there is still a lot of mystery in the contents of these log files. Moreover, It is a bit confusing that there are so many ways to compile the document dvi, pdflatex, conteXt etc. Why is this? Simple evolution or is there some special reason to compile one way over another? I get the fact that bibtex needs to be compiled separately but other than that I am a bit confused by the amount of choice here. What files(and where are they) are getting called during this?


title: Changing Font Style in Minipage

text: I am trying to generate a pull quote in my document, which I want to have with a different font style. To accomplish this, I have a wrapfig environment containing a minipage. I'd like to set the font style to be different just in this minipage. Below is an MWE; here is what it looks like. I'd like the red quote to be in the Cabin font, for instance. ![enter image description here](http://i.stack.imgur.com/jxEpW.png)               \documentclass[11pt]{article}          \usepackage{float}                      % Define tables and floating elements     \usepackage{flafter}                    % Never put floats before their references     \usepackage{floatflt}                   % wrap text around floats     \usepackage{wrapfig}                    % wrap text around figures     \usepackage[usenames,dvipsnames]{color}                     % Enable colors     \usepackage{lipsum}                     % Lorem Ipsum, for placeholder text.          \usepackage{cabin}     \usepackage{setspace}     \usepackage[T1]{fontenc}          \begin{document}     \section{My Section Heading}\label{sec:mysect}              %%% If the pull quote comes immediately after a section heading, the next three lines are needed, as well as the line after the paragraph         \newlength{\tempintextsep}         \setlength{\tempintextsep}{\intextsep}         \setlength{\intextsep}{0pt}         %%         \begin{wrapfigure}[20]{r}{2.2in}         \textcolor{red}{         \setlength{\abovedisplayskip}{0pt}         $$         \left\{\;\;\;         \begin{minipage}{1.65in}         \centering         \begingroup         \fontfamily{Cabin}\selectfont         \huge         \textrm{         \linespread{2}         Among all of the important things that were ever important, this thing is the most important of all of them; or at least the most important of all of them that appear on this page.         }         \endgroup         \end{minipage}\;\;\;         \right\}         $$         }         \end{wrapfigure}              \lipsum[1-4]         %% if the pullquote came after a section heading, use the following line         \setlength{\intextsep}{\tempintextsep}          \end{document}


title: lstlisting line wrapping

text: How is it possible to let `lstlisting` wrap lines? I've troubles with following block:               \begin{lstlisting}[language=java]      public class MeasureStationControllerV0Test {        MeasureStationControllerV0 controller;       MeasureStation ms = new MeasureStation();        MeasureStationConfiguration config = new MeasureStationConfiguration();          DataServer dataserver = new DataServer();      In the PDF output there is an overflow: ![overlapping code](http://i.stack.imgur.com/ZiJeB.png) Other code-snippets look horrible too.   * So have I to manually wrap them or is `listings` able to handle that?   * Why isn't syntax highlighting working?


title: LaTeX - place more than one small pictures on top of a big one

text: I've been trying to put several small images on top of a large one. One way I found to place one picture on top of another one was to use the `stackengine` package. I couldn't figure how to place several of them on the same figure though. What I tried was something like this bellow:               \documentclass[a4paper]{article}     \usepackage{latexsym,amsmath,epsfig}      \usepackage{graphicx}          \usepackage{stackengine}     \parskip 1em          \begin{document}          def\big{\includegraphics[width=0.99\textwidth]{Re80ro40mu50}}     def\little1{\includegraphics[width=0.15\textwidth]{image0001}     def\little2{\includegraphics[width=0.15\textwidth]{image0004}}     \def\stackalignment{l}     \bottominset{\little1}{\big}{0.25\textwidth}{0.17\textwidth}     \topinset{\little}{\big}{2cm}{3cm}     \bottominset{\little2}{\big}{0.25\textwidth}{0.17\textwidth}\par     \def\stackalignment{r}     \topinset{\little}{\big}{2cm}{1cm}     \bottominset{\little}{\big}{1cm}{2cm}          \end{document}      But what it does is it makes 4 figures, and places the small figure differently in each (instead of putting them on the same). Another way I tried was to use boxes, like bellow:               \documentclass[a4paper]{article}     \usepackage{latexsym,amsmath,epsfig}      \usepackage{graphicx}          \usepackage{stackengine}     \parskip 1em          \begin{document}          \begin{figure}     \centering     \setbox1=\hbox{\includegraphics[width=0.99\textwidth]{Re80ro40mu50}}     \includegraphics[width=0.99\textwidth]{Re80ro40mu50}\llap{\makebox[0.85\wd1][l]{\raisebox{3.4cm}{\includegraphics[height=2cm]{image0001}}}}\llap{\makebox[0.7\wd1][l]{\raisebox{3.8cm}{\includegraphics[height=2cm]{image0004}}}}\llap{\makebox[0.53\wd1][l]{\raisebox{5cm}{\includegraphics[height=2cm]{image0008}}}}\llap{\makebox[0.4\wd1][l]{\raisebox{9cm}{\includegraphics[height=2cm]{image0011}}}}\llap{\makebox[0.3\wd1][l]{\raisebox{2.8cm}{\includegraphics[height=2cm]{image0014}}}}     \caption{Drag coefficient history during the deformation of the droplet}     \end{figure}nter code here          \end{document}      This one actually works, but if want to rotate the whole image by adding `angle=270` in the `\includegraphics` options, so that I get a full-page image in large, it gives an error and complains about the options for `graphics` package. (Angle option works without adding the small images on top, so if it's just one picture.) I would be really greatful if someone could tell me why I cannot rotate the images in the 2nd version, or how can I add all small images to the big one in the same figure. (Or any ways to add more than one small images /also rotated/ to one big rotated image!) Thanks!


title: Need help indexing subfigures: reference bugs using `subfigure` and `subcaption` not compatible with specialized document class

text: I'm a PhD student currently coding my dissertation into Latex. My school developed a customized document class that they strongly recommend using for compliance with layout and formatting standards. After employing their document class and using the subfigure package for displaying sub-figures, I discovered referencing errors after compiling the document: successive figure numbers were often incremented by 2, rather than 1, when figures comprised of subfigures were indexed. This issue, I believe, has been described here: subcaption vs. subfig: Best package for referencing a subfigure. Next, I tested a fix (suggested here: Subcaption package: compatibility issue) using the `\captionsetup{compatibility=false}` specifier to override document class customization of the caption package. Application of the subcaption package and the `compatibility=false` option here did correct the indexing issue. But, as warned, the captions were no longer formatted as specified in the document class. It seems I'm stuck between a rock and a hard place... My question is (finally): is there a solution that solves my indexing problem **and** permits customization of figure captions? Any guidance on this would be very much appreciated. Thanks for reading! ~~~~~~~~~~~~~~~~~~~~~~ As requested, what follows is a minimum working example (MWE) of the indexing problem described above. I've since discovered that figures are numbered correctly if I compile the following code using `\documentclass [11pt, twoside] {book}` instead of the customized thesis template called using `\documentclass [11pt, twoside] {uwthesis}[2012/06/19]`. With this known, it seems the cause of the indexing problem lies somewhere in the corresponding document-class file, `uwthesis.cls`, a portion from which--containing customization of figure captions--I've posted below. The MWE is as follows:               \documentclass [11pt, twoside] {uwthesis}[2012/06/19]     %\documentclass [11pt, twoside] {book}          \setcounter{tocdepth}{1}  % Print the chapter and sections to the toc          \usepackage{alltt}  %     \usepackage{graphicx}     \usepackage{epstopdf}          \usepackage{caption}     \usepackage{subcaption}     %\DeclareCaptionSubType*[alph]{figure}     %\captionsetup[subfigure]{labelformat=simple,labelsep=space}     %\captionsetup{compatibility=false}          \usepackage{float}     \usepackage{xfrac}     \usepackage{mathtools}     \usepackage{amsfonts}     \usepackage{gensymb}     \usepackage{inputenc}     \usepackage{rotating}     \usepackage[table]{xcolor}     \usepackage{booktabs}     \usepackage{multirow,bigdelim}     %\usepackage{fixltx2e}     \usepackage[xspace]{ellipsis}     \usepackage{changepage}     \usepackage[acronym]{glossaries}           \newenvironment{demo}       {\begin{alltt}\leftskip3em          \def\\{\ttfamily\char`\\}%          \def\{{\ttfamily\char`\{}%          \def\}{\ttfamily\char`\}}}       {\end{alltt}}          % metafont font.  If logo not available, use the second form     %     % \font\mffont=logosl10 scaled\magstep1     \let\mffont=\sf     % --- end-of-sample-stuff ---          \begin{document}          %     % ==========      Text pages     %          \textpages          %\include{Figures_SubcaptionsTest}     %\include{Figures_CaptionsTest}          % ================== figure 1, no subfigures     \begin{figure}         \centering             \includegraphics{//SampleFig.eps}         \caption{Sample caption for figure 1.}         \label{fig:Figure1}     \end{figure}          % ================= figure 2,  includes subfigures     \begin{figure}[h!p]         \begin{subfigure}[b]{0.45\textwidth}             \centering             \includegraphics[width=\textwidth]{//SampleSubfig.eps}             \caption{First subfigure sample.}             %\subcaption{First subfigure sample.}             \label{fig:FirstSampleSubFig}         \end{subfigure}         \hfill         \begin{subfigure}[b]{0.45\textwidth}             \centering             \includegraphics[width=\textwidth]{//SampleSubfig.eps}             \caption{Second subfigure sample.}             %\subcaption{Second subfigure sample.}             \label{fig:SecondSampleSubFig}         \end{subfigure}         \caption{Sample composite caption for figure 2.}         \label{fig:Figure2}     \end{figure}          % ================== figure 3, no subfigures     \begin{figure}         \centering             \includegraphics{//SampleFig.eps}         \caption{Sample caption for figure 3.}         \label{fig:Figure3}     \end{figure}          \end{document}      The complete document-class file, `uwthesis.cls` (minus some comments and identifiers) is:               %     % Documentation is in the companion document (uwthesis.tex)     %          \ProvidesClass{uwthesis}[2012/06/19]     \NeedsTeXFormat{LaTeX2e}          %     % footnote stuff for option processing     %          \newwrite\tf@not          \newif\ifendnotes      % true if doing endnotes       \endnotesfalse     \newif\ifchapternotes  % true if doing chapternotes       \chapternotesfalse     \let\printchapternotes\relax     \let\printendnotes\relax          \DeclareOption{footnotes}% selects bottom-of-page notes (default)       {}     \DeclareOption{chapternotes}% selects end-of-chapter notes       {\chapternotestrue}     \DeclareOption{endnotes}% selects end-of-thesis notes       {\endnotestrue}          %     % ----  Timely loading of specific packages -----------------------------     %     \newif\if@natbib      % true if including natbib       \@natbibfalse     \DeclareOption{natbib}% includes natbib package       {\@natbibtrue}          %     % ----  Thesis is a modified (default 12pt) book style  -----------------     %          \def\@f@ntsize{12pt}     \DeclareOption{10pt}{\def\@f@ntsize{10pt}}     \DeclareOption{11pt}{\def\@f@ntsize{11pt}}     \DeclareOption{12pt}{\def\@f@ntsize{12pt}}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}     \ProcessOptions     \PassOptionsToClass{\@f@ntsize}{book}     \PassOptionsToClass{openany}{book}     \ProcessOptions     \LoadClass{book}          \if@natbib       \usepackage{natbib}     \fi          %     % ---- page sizes ----------------------------------------------     %     % margins are 1 inch (72pt) all around,     % except 1.5 inch (108pt) at the binding     %     % text size computed from paper size     %          \voffset -1in  % undo primitive default margins     \hoffset -1in          \topmargin 72\p@       \headheight 12\p@     \headsep 36\p@     \oddsidemargin 108\p@      \evensidemargin 72\p@     \newdimen\botmargin     \botmargin 72\p@     \marginparwidth 72\p@     \marginparsep 7\p@     \footskip \z@ % set later     \footnotesep 14\p@     \parindent 1.5em          \textheight\paperheight       \advance\textheight by-\topmargin       \advance\textheight by-\headheight       \advance\textheight by-\headsep       % \advance\textheight by-\footskip       \advance\textheight by-\botmargin     \textwidth\paperwidth       \advance\textwidth by-\oddsidemargin       \advance\textwidth by-\evensidemargin          % ---------------          \def\baselinestretch{1.5}    % not quite doublespaced          \setcounter{totalnumber}{5}     \setcounter{topnumber}{5}     \renewcommand\topfraction{.7}     \renewcommand\textfraction{.2}     \setlength\floatsep    {18\p@ \@plus 2\p@ \@minus 4\p@}     \setlength\textfloatsep{30\p@ \@plus 2\p@ \@minus 4\p@}     \setlength\intextsep   {20\p@ \@plus 4\p@ \@minus 4\p@}     \let\@normalsize\normalsize  % retain old definition     \setlength\abovecaptionskip{10\p@}     \setlength\belowcaptionskip{10\p@}               %     %  ----  Footnotes  ------------------------------------------     %     % Footnote placement option     %     %   [endnotes] put the references at the thesis end     %   [chapternotes] put the references at the chapter end     %   [footnotes] put the references at the page bottom     %     %   When text is written to file (.not) the source linebreaks     %   are maintained.  This keeps the individual lines in the file short.     %   Control sequences in the note text are not expanded.     %          \let\n@teitem\relax     \def\@n@teitem#1{\def\@currentlabel{#1}\item[#1]}          \def\@chapternotetext{\begingroup       \catcode`\^^M=12\newlinechar=`\^^M       \catcode`\\=12       \d@chapternote}          \long\def\d@chapternote#1{%       \immediate \write\tf@not           {\n@teitem{\note@label} #1\relax}%       \endgroup}          %     \def\@startnotes{%  opens the .not file       \immediate \openout\tf@not\jobname.not\relax       \immediate \write\tf@not{\relax}       \setcounter{footnote}{0}}          %     % chapternotes     %          \ifchapternotes       % \typeout{Doing chapternotes}       \let\@footnotetext\@chapternotetext       \@startnotes       \def\note@label{\arabic{footnote}}       \def\printchapternotes{% Prints the accumulated notes         \ifnum\c@footnote>0           \clearpage           \begin{center} Notes to Chapter \arabic{chapter} \end{center}\par           \addcontentsline{toc}{section}{\protect               \numberline{}{Notes to Chapter \arabic{chapter}}}           \begin{description}           \immediate\closeout\tf@not           \catcode`@=11           \let\n@teitem\@n@teitem           \@input{\jobname.not}           \end{description}           \clearpage           \@startnotes         \fi       }       \let\old@enddocument\enddocument       \def\enddocument{\printchapternotes\old@enddocument}     \fi          %     % endnotes     %          \ifendnotes       % \typeout{Doing endnotes}       \let\@footnotetext\@chapternotetext       \@startnotes       \def\note@label{\arabic{chapter}.\arabic{footnote}}       \def\printendnotes{% Prints the accumulated notes         \chapter*{Notes}         \addcontentsline{toc}{chapter}{Notes}         \thispagestyle{empty}         \begin{description}         \immediate\closeout\tf@not         \catcode`@=11         \let\n@teitem\@n@teitem         \@input{\jobname.not}         \end{description}         \@startnotes  % allows multiple endnotes        }     \fi          %     %  bottom-of-page footnotes format     %  full width line and hanging indent     %     \def\footnoterule{\kern-3\p@      \hrule width \columnwidth \kern 2.6\p@}     \long\def\@makefntext#1{\parindent 1em\noindent \hangindent\parindent      \def\baselinestretch{1.0}\normalfont      \hb@xt@1.8em{\hss\@makefnmark}#1}          %     %  ----  Text pages  ----------------------------------     %     %  In two-sided style Chapter 1 is right handed     %     \def\textofChapter#1{\gdef\@textofChapter{#1}}  \textofChapter{Chapter}     \def\textofAppendix#1{\gdef\@textofAppendix{#1}}  \textofAppendix{Appendix}          \def\textpages{% Start of text pages          \advance\textheight by\footskip % has to be done before the clearpage        \clearpage        \pagestyle{empty}        \cleardoublepage        \pagestyle{myheadings}\markboth{}{}        \def\@chapapp{\protect\@textofChapter}        \def\Thechapter{\arabic{chapter}}        \pagenumbering{arabic}          \footskip\z@        }          \def\appendix{\par      \setcounter{chapter}{0}      \setcounter{section}{0}      \def\@chapapp{\protect\@textofAppendix}      \def\Thechapter{\Alph{chapter}}      \def\thechapter{\Alph{chapter}}}               %     %  Parts     %     \def\@makeparthead#1{ \vspace*{2pc} {\centering      \ifnum \c@secnumdepth >\m@ne \large Part \thepart \par      \vspace{10\p@} \fi        \def\baselinestretch{1.0}\normalfont       \large\bf \uppercase\expandafter{#1}\par      \nobreak \vspace{20\p@}} }     %     \def\@makesparthead#1{ \vspace*{2pc} {\centering      \large\bf \uppercase\expandafter{#1}\par      \nobreak \vspace{20\p@}} }     %     \def\part{%        \printchapternotes        \if@openright\cleardoublepage\else\clearpage\fi        % \thispagestyle{empty}%        \global\@topnum\z@        \@afterindenttrue        % \let\\\relax        \secdef\@part\@spart}     %     %  Complication is added here to allow line breaks     %  in the part titles (via \\).     %     \def\@part[#1]#2{       \ifnum \c@secnumdepth >\m@ne       \refstepcounter{part}       \typeout{<<\thepart>>}       {\def\\{ }  % allow \\ in title        \addcontentsline{toc}{part}{\protect          \numberline{Part\ \thepart:}#1}}\else       {\def\\{ }  % allow \\ in title        \addcontentsline{toc}{part}{#1}}\fi      \addtocontents{lof}{\protect\addvspace{5\p@}}      \addtocontents{lot}{\protect\addvspace{5\p@}}      \if@twocolumn       \@topnewpage[\@makeparthead{#2}]       \else \@makeparthead{#2}       \@afterheading \fi}     \def\@spart#1{\if@twocolumn \@topnewpage[\@makesparthead{#1}]       \else \@makesparthead{#1}       \@afterheading\fi}               %     %  Chapter headings     %     \def\@makechapterhead#1{ \vspace*{2pc} {\centering      \ifnum \c@secnumdepth >\m@ne \large \@chapapp{} \Thechapter \par      \vspace{10\p@} \fi        \def\baselinestretch{1.0}\normalfont       \large\bf \uppercase\expandafter{#1}\par      \nobreak \vspace{20\p@}} }     %     \def\@makeschapterhead#1{ \vspace*{2pc} {\centering      \large\bf \uppercase\expandafter{#1}\par      \nobreak \vspace{20\p@}} }     %     \def\chapter{%        \printchapternotes        \if@openright\cleardoublepage\else\clearpage\fi        % \thispagestyle{empty}%        \global\@topnum\z@        \@afterindenttrue        % \let\\\relax        \secdef\@chapter\@schapter}     %     %  Complication is added here to allow line breaks     %  in the chapter titles (via \\).     %     \def\@chapter[#1]#2{       \ifnum \c@secnumdepth >\m@ne       \refstepcounter{chapter}       \typeout{<<\thechapter>>}       {\def\\{ }  % allow \\ in title        \addcontentsline{toc}{chapter}{\protect          \numberline{\@chapapp\ \thechapter:}#1}}\else       {\def\\{ }  % allow \\ in title        \addcontentsline{toc}{chapter}{#1}}\fi      \addtocontents{lof}{\protect\addvspace{5\p@}}      \addtocontents{lot}{\protect\addvspace{5\p@}}      \if@twocolumn       \@topnewpage[\@makechapterhead{#2}]       \else \@makechapterhead{#2}       \@afterheading \fi}     \def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]       \else \@makeschapterhead{#1}       \@afterheading\fi}     %     %  Section headings     %     \renewcommand\section{%       \@startsection {section}{1}{\z@}%            {-3.5ex \@plus -1ex \@minus -.2ex}%            {2.3ex \@plus.2ex}%            {\def\baselinestretch{1.0}\reset@font\normalsize\bfseries\slshape}}     \renewcommand\subsection{%       \@startsection{subsection}{2}{\z@}%            {-3.25ex\@plus -1ex \@minus -.2ex}%            {1.5ex \@plus .2ex}%            {\reset@font\normalsize\mdseries\itshape}}     \renewcommand\subsubsection{%       \@startsection{subsubsection}{3}{\z@}%            {-3.25ex\@plus -1ex \@minus -.2ex}%            {1.5ex \@plus .2ex}%            {\reset@font\normalsize\mdseries\itshape}}          % part     \renewcommand\l@part[2]{%       \ifnum \c@tocdepth >\m@ne         \addpenalty{-\@highpenalty}%         \vskip 1.0em \@plus\p@         \setlength\@tempdima{75\p@}%         \@dottedtocline{0}{\z@}{\@tempdima}{#1}{#2}%       \fi}          %     %  Provide for `Chapter ' in the toc     %  (increase \@tempdima)     %     \renewcommand\l@chapter[2]{%       \ifnum \c@tocdepth >\m@ne         \addpenalty{-\@highpenalty}%         \vskip 1.0em \@plus\p@         \setlength\@tempdima{75\p@}%         \@dottedtocline{0}{\z@}{\@tempdima}{#1}{#2}%       \fi}          %      % extra space between toc entries     %     \def\@dottedtocline#1#2#3#4#5{%       \ifnum #1>\c@tocdepth \else         \vskip -\baselineskip % \@plus.2\p@%         \vskip 1.2\baselineskip         {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip          \parindent #2\relax\@afterindenttrue          \interlinepenalty\@M          \leavevmode          \@tempdima #3\relax          \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip          {#4}\nobreak          \leaders\hbox{$\m@th             \mkern \@dotsep mu\hbox{.}\mkern \@dotsep             mu$}\hfill          \nobreak          \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%          \par}%       \fi}          %     % ------ Special captions ---------------------     %     % \caption[]{text} produces normal caption and numbering     % \caption(-){(continued)} produces `(continued)' caption and      %        same-as-last caption number     % \caption(x)[]{text} produces lettered caption.  1.1a, 1.1b, ...     %        If (x) is (a) or (A) then caption number is incremented,     %        else it is same numbered.          \def\thecaptionletter{}     \newif\ifcaptiontotoc\captiontotoctrue          \def\caption{\@ifnextchar({\@specialcaption}{\@normalcaption}}          \def\@normalcaption{\refstepcounter\@captype \@dblarg{\@caption\@captype}}     \def\@specialcaption(#1){%       \def\thecaptionletter{#1}%       \captiontotocfalse       \if#1-\def\thecaptionletter{}\fi       \if#1a\refstepcounter\@captype\captiontotoctrue\fi       \if#1A\refstepcounter\@captype\captiontotoctrue\fi       \@dblarg{\@caption\@captype}}          \long\def\@caption#1[#2]#3{\par       \ifcaptiontotoc         \addcontentsline{\csname         ext@#1\endcsname}{#1}{\protect\numberline{\csname         the#1\endcsname}{\ignorespaces #2}}%       \fi       \begingroup         \@parboxrestore         \def\baselinestretch{1.0}         \normalsize  % UW grad school doesn't allow \footnotesize         \@makecaption{\csname fnum@#1\endcsname             \thecaptionletter}{\ignorespaces #3}\par       \endgroup}          \def\@listI{\leftmargin\leftmargini \parsep 7\p@ plus 3\p@ minus 1\p@\topsep      12\p@ plus 5\p@ minus 6\p@\itemsep 7\p@ plus 3\p@ minus 1\p@}               %     %  ----  Facing pages and double-page figures and tables     %     %  \begin{fullpage} ... \end{fullpage}     %  \begin{leftfullpage} ... \end{leftfullpage}     %  \begin{xtrafullpage} ... \end{xtrafullpage}          \newif\if@LP \@LPfalse     \newif\if@XP \@XPfalse          \newbox\@@wholepage     \def\fullpage{\setbox\@@wholepage=\vbox\bgroup}     \def\endfullpage{\egroup\dp\@@wholepage\z@        \vbox to\textheight{\vss\unvbox\@@wholepage\vss}}     \def\leftfullpage{\setbox\@@wholepage=\vbox\bgroup}     \def\endleftfullpage{\egroup\dp\@@wholepage\z@        \vbox to\textheight{\vss\unvbox\@@wholepage\vss}\global\@LPtrue}          \if@twoside        \typeout{Formatting for twoside printing.}        \let\xtrafullpage\fullpage        \let\endxtrafullpage\endfullpage     \else        \typeout{Formatting for oneside printing.}        \def\xtrafullpage{\setbox\@@wholepage=\vbox\bgroup}        \def\endxtrafullpage{\egroup\dp\@@wholepage\z@           \vbox to\textheight{\vss\unvbox\@@wholepage\vss}\global\@XPtrue}     \fi          \let\oldend@float\end@float     \def\end@float{%       \if@LP\global\@namedef{LP:\expandafter\string\@currbox}{L}%       \else \global\@namedef{LP:\expandafter\string\@currbox}{z}%       \fi       \if@XP\global\@namedef{XP:\expandafter\string\@currbox}{X}%       \else \global\@namedef{XP:\expandafter\string\@currbox}{z}%       \fi       \global\@LPfalse       \global\@XPfalse       \oldend@float     }               \if@twoside          % reject a left-side float that appears on an odd page      \let\old@xtryfc\@xtryfc      \def\@xtryfc #1{%        \expandafter\if\csname LP:\string#1\endcsname L%           % \typeout{facing page in xtryfc}%           \ifodd\count0\global\@colht\z@               \typeout{I moved a leftpage float from page \the\count0.}%           \fi\fi         \old@xtryfc #1}          \else          \def\unstep@page{\addtocounter{page}{-1}}          % flip a facing page caption      \let\@oldwtryfc\@wtryfc      \def\@wtryfc #1{%       \expandafter\if\csname LP:\string#1\endcsname L\gdef\LP@page{}%           \typeout{Encountered a facing page.}%        \fi       \expandafter\if\csname XP:\string#1\endcsname X\gdef\XP@page{}%           \typeout{Encountered an extra page.}%        \fi        \@oldwtryfc #1}           \let\old@outputpage\@outputpage      \def\@outputpage{%        \begingroup        \@ifundefined{LP@page}          {\let\@themargin\oddsidemargin \let\@thehead\@oddhead}          {\let\@themargin\evensidemargin \let\@thehead\@evenhead            \typeout{Printing a left-hand one-side page.}%            \global\let\LP@page\relax           }        \@ifundefined{XP@page}          {}          {\let\@thehead\@empty \let\@thefoot\@empty            \typeout{Printing an extra page.}%            \global\let\XP@page\relax            \aftergroup\unstep@page           }        \old@outputpage\endgroup      }     \fi          %     %  ----  Preliminary pages  ---------------------------     %     \def\prelimpages{ % sets page numbering for the preliminary pages        \pagestyle{empty} % will be {plain} at start of toc        \pagenumbering{roman}        \setcounter{page}{1}        \footskip 30\p@ % allowance for the roman page numbers         \advance\textheight by-\footskip          }     %     %      (The following macros are used once and discarded)     %     %  Title page     %     %  (Defaults are for dissertation.  See \MasterThesis below.)     %     \def\Title#1{\gdef\@Title{#1}}     \def\Author#1{\gdef\@Author{#1}}     \def\Year#1{\gdef\@Year{#1}}  \Year{\year}     \def\Degree#1{\gdef\@Degree{#1}} \Degree{Doctor of Philosophy}     \def\Program#1{\gdef\@Program{#1}} \Program{your program here}     %     \def\School#1{\gdef\@School{#1}} \School{University of Washington}     \def\GSchool#1{\gdef\@GSchool{#1}} \GSchool{Graduate School}     \def\Degreetext#1{\gdef\@Degreetext{#1}}        \Degreetext{A dissertation\\ submitted in partial fulfillment of the\\requirements for the degree of}     \def\Programtext#1{\gdef\@Programtext{#1}}              \Programtext{Program Authorized to Offer Degree: }          \def\textofCommittee#1{\gdef\@textofCommittee{#1}}              \textofCommittee{Reading Committee: }     \def\textofDate#1{\gdef\@textofDate{#1}}  \textofDate{Date}          \def\textofChair#1{\gdef\@textofChair{#1}}            \textofChair{Chair of the Supervisory Committee: }          \newcount\@Chair \@Chair0     \def\Chair#1#2#3{       \global\@namedef{C:\expandafter\the\@Chair}{#1}       \global\@namedef{T:\expandafter\the\@Chair}{#2}       \global\@namedef{D:\expandafter\the\@Chair}{#3}       \ifnum\@Chair>0\textofChair{Co-Chairs of the Supervisory Committee:}\fi       \global\advance\@Chair by1}               \newcount\@Sign\@Sign0     \def\Signature#1{       \global\@namedef{S:\expandafter\the\@Sign}{#1}       \global\advance\@Sign by1}               \def\copyrightpage{                   % Prints the copyright page         \vspace{7pc}         \begin{center}           \par\vskip\z@ plus4fill\relax           \copyright Copyright \@Year           \par           \@Author           \par\vskip\z@ plus2fill\relax         \end{center}       \let\copyrightpage\relax\relax}          \def\titlepage{                   % Prints the title page         \cleardoublepage         \vspace{7pc}         \begin{center}           {\def\baselinestretch{1.0}\normalfont\Large           \lineskip 3ex           \@Title\par}           \par\vskip\z@ plus4fill\relax           \@Author           \par\vskip\z@ plus4fill\relax           {\def\baselinestretch{1.0}\normalfont           \@Degreetext\par}           \par\vskip\z@ plus2fill\relax           \@Degree           \par\vskip\z@ plus2fill\relax           \@School           \par\vskip\z@ plus1fill\relax           \@Year           \par\vskip\z@ plus4fill\relax                % signers           \@textofCommittee \par            \count1=0           \@whilenum \count1<\@Chair \do            {\vskip12\p@ \baselineskip12pt             \csname C:\the\count1\endcsname, Chair             \advance\count1 by1}           \count1=0           \@whilenum \count1<\@Sign \do            {\vskip12\p@ \baselineskip12pt             \csname S:\the\count1\endcsname             \advance\count1 by1}                \par\vskip\z@ plus4fill\relax            {\def\baselinestretch{1.0}\normalfont           \@Programtext \par \@Program\par}           \par\vskip\z@ plus1fill\relax         \end{center}          \vspace{2pc}\relax       \let\titlepage\relax}               %     %   Abstract     %     %  normal parameters     \def\textofAbstract#1{\gdef\@textofAbstract{#1}}  \textofAbstract{Abstract}          \newsavebox\abs@savebox% (\abs@savebox compliments of blerner@cs.washington.edu)     \long\def\abstract#1{        \cleardoublepage        \begin{center}           \@School           \par\vskip1pc           {\bf\@textofAbstract}%           \par\vskip1pc           {\def\baselinestretch{1.0}\normalfont \@Title \par}           \par\vskip1pc           \@Author           \par\vskip1pc            {\def\baselinestretch{1.0}\normalfont           \@textofChair           \par            \count1=0           \@whilenum \count1<\@Chair \do            {% \vskip12\p@ \baselineskip12pt             \csname T:\the\count1\endcsname\ \csname C:\the\count1\endcsname             \par \csname D:\the\count1\endcsname\par\vskip6\p@             \advance\count1 by1}            \par}           \par\vskip1pc        \end{center}        \if@twoside         \begingroup % have to set multiple abstract pages 1-sided         \def\@blankpage{\if\@@blankpage B                 \setbox\abs@savebox\box255\shipout\vbox{}\setbox255\box\abs@savebox                 \global\advance\count\z@ by1\fi                 \global\def\@@blankpage{B}}         \def\@@blankpage{A}         \output=\expandafter{\expandafter\@blankpage\the\output}        \fi        #1        \vfill\clearpage        \if@twoside\endgroup\fi        \let\abstract\relax}     %     %     %   Table of contents (right side page) (always page `i')     %     %     \def\textofToC#1{\gdef\@textofToC{#1}}  \textofToC{Table of Contents}     \def\tableofcontents{\cleardoublepage        \chapter*{\@textofToC\@mkboth{}{}}        \pagestyle{plain}        \thispagestyle{plain}        \setcounter{page}{1}        \hbox to\textwidth{\hfill Page}        {\let\footnotemark\relax  % in case one is in the title         \def\baselinestretch{1.0}\normalfont        \@starttoc{toc}         }        }     %     %   List of figures     %          \def\textofLoF#1{\gdef\@textofLoF{#1}}  \textofLoF{List of Figures}     \def\listoffigures{\chapter*{\@textofLoF\@mkboth{}{}}        \thispagestyle{plain}        \addcontentsline{toc}{chapter}{\protect\@textofLoF}        \hbox to\textwidth{Figure Number \hfill Page}        {\let\footnotemark\relax  % in case one is in the title         \def\baselinestretch{1.0}\normalfont        \@starttoc{lof}         }        }     %     %   List of tables     %     \def\textofLoT#1{\gdef\@textofLoT{#1}}  \textofLoT{List of Tables}     \def\listoftables{\chapter*{\@textofLoT\@mkboth{}{}}        \thispagestyle{plain}        \addcontentsline{toc}{chapter}{\protect\@textofLoT}        \hbox to\textwidth{Table Number \hfill Page}        {\let\footnotemark\relax  % in case one is in the title         \def\baselinestretch{1.0}\normalfont        \@starttoc{lot}         }        }     %     %  Bibliography     %     \def\textofBIB#1{\gdef\@textofBIB{#1}}  \textofBIB{Bibliography}     \def\thebibliography#1{\chapter*{\@textofBIB\@mkboth{}{}}      \addcontentsline{toc}{chapter}{\protect\@textofBIB}      \list      {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth      \advance\leftmargin\labelsep      \usecounter{enumi}}      \def\newblock{\hskip .11em plus .33em minus .07em}      \sloppy\clubpenalty4000\widowpenalty4000      \def\baselinestretch{1.0}\normalfont      \sfcode`\.=1000\relax}          %     %   Acknowledgments     %     \def\textofAck#1{\gdef\@textofAck{#1}}  \textofAck{Acknowledgments}     \long\def\acknowledgments#1{\chapter*{\@textofAck\@mkboth{}{}}        \thispagestyle{plain}        #1\par        \vfill        \let\acknowledgments\relax}          %     %   Dedication     %     \def\textofDed#1{\gdef\@textofDed{#1}}  \textofDed{Dedication}     \long\def\dedication#1{\chapter*{\@textofDed\@mkboth{}{}}        \thispagestyle{plain}        #1\par        \vfill        \let\dedication\relax}          %     %   Vita     %     \def\textofVita#1{\gdef\@textofVita{#1}}  \textofVita{Vita}     \long\def\vita#1{\chapter*{\@textofVita\@mkboth{}{}}        #1\par        \vfill        \let\vita\relax}          %     %   Gratis definition of a glossary environment     %     \renewenvironment{glossary}       {\begin{list}{}{\setlength\itemindent{\parindent}        \def\makelabel##1{\footnotesize\uppercase{##1:}\hfill}}}       {\end{list}}          % End of the thesis style      These two code blocks should be sufficient to reproduce the indexing problems that I've been having. Thanks in advance for your help on this!!!


title: Ensure full-page figure is on facing page of first reference

text: I have several full-page figures in my LaTeX document that is based off of a two-sided book class. I would like to ensure that these figures are placed on the opposite page of where I first reference the figure using `\ref{}`, or at least on the opposite page of some possibly-manually-placed code that I can insert. In other words, if my reference to Figure 5.3 would naturally appear on a "left" even page, I'd like the figure to appear on the corresponding "right" on page. It would also be fine if the figure and reference swapped pages, so long as they face each other. What I don't want is for the reference and the figure to appear on the back & front of a single page. I don't want the reader to have to flip pages to see the full-page figure. Here is a simple working example that has the figure on page 4, but the reference on page 3. The user would have to flip.               \documentclass[12pt,twoside]{book}     \usepackage[english]{babel}     \usepackage{blindtext}     \begin{document}          \Blindtext     \Blindtext     And this is a reference to Figure~\ref{myfig}.          \begin{figure}     \centering     \rule{6in}{8in}     \caption{Caption here.}     \label{myfig}     \end{figure}          \end{document}


title: Have XeLaTeX use the default Times font in Ubuntu

text: Using the Texlive PPA backport to Ubuntu 12.04, I am having trouble getting XeLaTeX to use a standard times font (i.e. one that would not be embedded). I am using e.g. `\setmainfont{times}` and `\newfontfamily\fontfamilyname{Times}`, and have installed the `texlive-fonts- recommended` package, which says (in the `apt-cache show texlive-fonts- recommended`):                times -- Select Adobe Times Roman (or equivalent) as default font.      timesnew -- the URW Times fonts and support for the Adobe font set.      When I run xelatex on a tex file that tries to use the fonts above, I get a long list of errors, many like the following:               Please type another input file name     ! Emergency stop.      ...e:=ljfour; mag:=1; nonstopmode; input times          Transcript written on mfput.log.     grep: times.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input times'      failed to make times.tfm.          kpathsea: Running mktextfm times     /usr/share/texlive/texmf/web2c/mktexnam: Could not map source abbreviation  for times.     /usr/share/texlive/texmf/web2c/mktexnam: Need to update ?     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input times     This is METAFONT, Version 2.718281 (TeX Live 2012/Debian)      I would be grateful for thoughts on how to use the standard Times font in PDFs created with XeLaTeX on Ubuntu. * * * **EDIT** Sorry I didn't post the example earlier -- had to put the little one to bed, and I had hoped this was a mind-numbingly simple oversight on my part :) Here's an example:               \documentclass{memoir}     \usepackage{fontspec}      \setmainfont{Times}     \begin{document}      In Times we trust.     \end{document}      Here is what XeLaTeX responds with:               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !     ! fontspec error: "font-not-found"     !      ! The font "Times" cannot be found.     !      ! See the fontspec documentation for further information.     !      ! For immediate help type H <return>.     !...............................................        One solution that occurs to me is to manually install an OTF or TTF font that is a substitute for Times, but I would expect that the texlive distribution or Ubuntu otherwise has that - but it is not immediately apparent where.


title: Beamerposter example does not work

text: I want to create a poster using `beamerposter`. I am trying to compile this example from the package documentation. Without touching anything, when I compile the `example-style-I6dv.tex`, I obtain 75 errors. I have `beamerposter.sty` and `beamerthemeI6dv.sty` in the project directory, so I don't understand why this example is not compiling smoothly. Sample of errors that come up from the `beamerposter.sty`:               ./beamerposter.sty:0: You have requested, on input line 42, version`2006/11/18' of package xkeyval,but only version`2005/01/30 v2.0 package option processing (HA)'is available.     ./beamerposter.sty:128:Undefined control sequence. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Missing \begin{document}. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Undefined control sequence. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Undefined control sequence. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Undefined control sequence. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Undefined control sequence. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Undefined control sequence. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Missing number, treated as zero. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128:Undefined control sequence. \ExecuteOptionsX{size=a0,scale=1.0}     ./beamerposter.sty:128: the input \ was incorrect and was ignored. on input line 128. the input \ was incorrect and was ignored.     ./beamerposter.sty:129:Undefined control sequence. \ProcessOptionsX\relax     ./beamerposter.sty:129:Undefined control sequence. \ProcessOptionsX\relax     ./beamerposter.sty:129:Undefined control sequence. \ProcessOptionsX\relax     ./beamerposter.sty:129:Undefined control sequence. \ProcessOptionsX\relax     ./beamerposter.sty:129:Undefined control sequence. \ProcessOptionsX\relax     ./beamerposter.sty:129:Undefined control sequence. \ProcessOptionsX\relax     ./beamerposter.sty:129:Missing number, treated as zero. \ProcessOptionsX\relax     ./beamerposter.sty:129:Undefined control sequence. \ProcessOptionsX\relax      What to do?


title: Index not linked properly in the navigation

text: I'm having troubles making Index visible in the navigation that is shown with the pdf preview of the document. Namely, the following is the end of my main .tex file:               % Bibliography     % =================================================================     \bibliographystyle{plainnat}     \bibliography{refs}     \addcontentsline{toc}{chapter}{Bibliography}     % =================================================================          \printindex     \addcontentsline{toc}{chapter}{Index}      This indeed show Index in the navigation, but it actually points to bibliography. Exchanging places of \printindex and \addcontentsline removes Index from the navigation. How could I achieve precise navigation to Index?


title: Strange spacing when putting a math macro before a binary operation

text: I found there to be very odd spacing when using a math macro just before a binary operation. Here is a minimal example:               \documentclass[11pt]{article}     \usepackage{amsmath}     \DeclareMathOperator{\id}{id}     \begin{document}          $x\otimes \id$          $\id \otimes x$          \end{document}      produces ![enter image description here](http://i.stack.imgur.com/WjccA.png) I am aware that sometimes a macro "eats up" the space after it, requiring that we put it in braces or put a `\` after it, but I wouldn't have expected the space **after** the operation to be what is affected. Can someone explain what is going on, and how I could set this up differently so that the spacing will turn out correctly?


title: pgfplots with symbolic x coords and error bars

text: I am trying to plot explicit error bars like this:               \begin{tikzpicture}      \begin{axis} [symbolic x coords={Lighting,Computers,Total}]     \addplot+[only marks] plot[error bars/.cd, y dir=both, y explicit]     coordinates{         (Lighting,0.12) +- (0.31,0.03)         (Computers,0.06) +- (0.12,0.01)          (Total,0.07) +- (0.14,0.02)     };     \end{axis}      \end{tikzpicture}      Except this produces a constant error instead of the explicit values I have provided. For example, for Lighting, it produces 0.12 +-0.03 (see below). Did I misread the manual?! There is also some weirdness with the labels on the x-axis and I'd rather not have the y-axis use exponential notation for y<0.1. (I tried posting the output, but apparently I need more cred!)


title: Not having "Chapter" appear in chapter names

text: If, in `amsbook`, I write something like               \chapter{My great chapter}      it appears in the text as **Chapter 1. My great chapter** I would like to make it appear simply as **1\. My great chapter** Anyone have any suggestions? It would be great if it reflected the same change in the ToC too.


title: set minor grid values in pgfplots

text: I have a weibull plot (at least I try to create a decent one), based on the code shown here. However I do want to have a minor grid as it typically appears in log plots. Here however the y axis tics are completely self defined. So I want to have the major y ticks and major y grid lines at               yticklabels={0.1,0.2,0.3,0.4,0.5,1,2,3,4,5,10,20,30,40,50,60,70,80,90,99,99.9},      and the minor y grid to be shown inbetween at               {0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2,0.21,0.22,0.23,0.24,0.25,0.26,0.27,0.28,0.29,0.3,0.325,0.35,0.375,0.4,0.425,0.45,0.475,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2,2.25,2.5,2.75,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,90.9,91.8,92.7,93.6,94.5,95.4,96.3,97.2,98.1,99,99.1,99.2,99.3,99.4,99.5,99.6,99.7,99.8,99.9}      The basic plot is created with               \begin{tikzpicture}     \begin{axis}[scale only axis,         xmode=log,log ticks with fixed point,         only marks,         xmin=0,xmax = 20.0,         ymin=0.001, ymax=0.999,         grid=major,         ytick  ={0.001,0.002,0.003,0.004,0.005,                  0.01,0.02,0.03,0.04,0.05,                  0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,0.99,0.999},         yticklabels={0.1,0.2,0.3,0.4,0.5,1,2,3,4,5,10,20,30,40,50,60,70,80,90,99,99.9},         y coord trafo/.code=\pgfmathparse{ln(-ln(1-#1)))},         y coord inv trafo/.code=\pgfmathparse{exp(-exp(-#1-1))}         ]     %     \addplot[domain=0.01:100, sharp plot] gnuplot{ 1-exp(-x**2)};     \end{axis}      \end{tikzpicture}      The following picture shows the resulting plot ![enter image description here](http://i.stack.imgur.com/PC30I.png) The question is how to create/define minor grid tics ? EDIT: Here is a part of an image I want to recreate with this plot: ![enter image description here](http://i.stack.imgur.com/R1mn6.png) EDIT: I implemented all suggestions but now realized that I can not set the style (color of the lines) of the extra y tick positions independent on the major grid style. The extra ticks however shall define the minor grid positions and thus be printed in the style of the minor grids. Also, the grid positions at the low values are calculated false. There spacing does not match the inserted values. Here is the code and the resulting picture:               \begin{tikzpicture}     \begin{axis}[scale only axis,       % plot style       every axis plot/.append style={line width=1.0pt,blue},       % labels       xlabel=Lebensdauer $t$,       ylabel=Ausfallhäufigkeitssumme $R(t)$,       % axis limits       xmin=0,xmax = 20.0,       ymin=0.001, ymax=0.999,       % calculate functions only in this domain       domain=0.1:20,       % x-axis: log scale with linear numbers       xmode=log,log ticks with fixed point,       % grid style       grid=both, % major and minor for both axis (alt: major, minor, none)       minor grid style={gray!25},       major grid style={black!50},       % -- set weibull plot grid positions --       % remove tick lines       major tick length=0pt,       minor tick length=0pt,       % yticks (major grid lines)       ytick      ={0.001,0.002,0.003,0.004,0.005,                    0.01,0.02,0.03,0.04,0.05,                    0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,0.99,0.999},       % according labels       yticklabels={0.1,0.2,0.3,0.4,0.5,1,2,3,4,5,10,20,30,40,50,60,70,80,90,99,99.9},       %        extra y tick style={yticklabels={},color=red}, % color is ignored !       % position of minor y-grid lines       extra y ticks=  {0.001,0.0011,0.0012,0.0013,0.0014,0.0015,0.0016,0.0017,0.0018,0.0019,0.002,0.0021,0.0022,0.0023,0.0024,0.0025,0.0026,0.0027,0.0028,0.0029,0.003,0.00325,0.0035,0.00375,0.004,0.00425,0.0045,0.00475,0.005,0.0055,0.006,0.0065,0.007,0.0075,0.008,0.0085,0.009,0.0095,0.01,0.011,0.012,0.013,0.014,0.015,0.016,0.017,0.018,0.019,0.02,0.0225,0.025,0.0275,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.2,0.21,0.22,0.23,0.24,0.25,0.26,0.27,0.28,0.29,0.3,0.32,0.34,0.36,0.38,0.4,0.42,0.44,0.46,0.48,0.5,0.52,0.54,0.56,0.58,0.6,0.62,0.64,0.66,0.68,0.7,0.72,0.74,0.76,0.78,0.8,0.82,0.84,0.86,0.88,0.9,0.909,0.918,0.927,0.936,0.945,0.954,0.963,0.972,0.981,0.99,0.991,0.992,0.993,0.994,0.995,0.996,0.997,0.998,0.999},       % tic position calculation (coord. transformation)       % must be below the tick positions !       y coord trafo/.code=\pgfmathparse{ln(-ln(1-#1)))},       y coord inv trafo/.code=\pgfmathparse{exp(-exp(-#1-1))}     ]     %     \addplot[domain=0.01:100, sharp plot] gnuplot{ 1-exp(-x**2)};     \end{axis}      \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/NBmPg.png)


title: Inserting a line to separate the text and the margin note

text: How can I insert a vertical line through a whole page to separate the text and the margin notes?


title: with each subsequent column the images scale up

text: I'm trying to create a table with 5 columns and 2 rows. The first row should shows images and the second row shows the according text. In my main tex-file I have following code to import the table `\input{chapter3/buttonTable}`. My `buttonTable.tex` File has following code in it:               \begin{table}[b]     \begin{tabularx}{\textwidth}{ |X|X|X|X|X| }         \hline         \includegraphics{./images/buttons/Windows-Buttons.png}         &          \includegraphics{./images/buttons/MacOSX-Buttons.png}         &          \includegraphics{./images/buttons/Gnome-Buttons.png}         &          \includegraphics{./images/buttons/iOS-Buttons.png}         &          \includegraphics{./images/buttons/Android-Buttons.png}         \\ \hline         Windows 7 & Mac OS X & Gnome & iOS & Android \\         \hline     \end{tabularx}     \end{table}      This is the output: ![http://i47.tinypic.com/1z5r8ys.jpg](http://i.stack.imgur.com/kT00y.jpg) Basically I have two questions:   1. Why do the images get bigger and bigger and how can I avoid it?   2. How can I center the text in the table?


title: Why does microtype cause auto-pst-pdf to run slowly?

text: I have a build process using pdflatex that had been working fine (and reasonably fast) until I added `auto-pst-pdf` in order to process some EPS figures. Doing this causes rendering to slow down and generates error messages:               -------------------------------------------------     auto-pst-pdf: Auxiliary LaTeX compilation     -------------------------------------------------     This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)     entering extended mode          kpathsea: Running mktextfm cmr10+20     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmr10+20     This is METAFONT, Version 2.718281 (TeX Live 2011)          kpathsea: Running mktexmf cmr10+20          ! I can't find file `cmr10+20'.     <*> ...ljfour; mag:=1; nonstopmode; input cmr10+20          Please type another input file name     ! Emergency stop.     <*> ...ljfour; mag:=1; nonstopmode; input cmr10+20          Transcript written on mfput.log.     grep: cmr10+20.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmr10+20' failed to make cmr10+20.tfm.     kpathsea: Appending font creation commands to missfont.log.          kpathsea: Running mktextfm cmr10-20     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmr10-20     This is METAFONT, Version 2.718281 (TeX Live 2011)          kpathsea: Running mktexmf cmr10-20          ! I can't find file `cmr10-20'.     <*> ...ljfour; mag:=1; nonstopmode; input cmr10-20          Please type another input file name     ! Emergency stop.     <*> ...ljfour; mag:=1; nonstopmode; input cmr10-20          Transcript written on mfput.log.     grep: cmr10-20.log: No such file or directory     mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input cmr10-20' failed to make cmr10-20.tfm.     -------------------------------------------------     auto-pst-pdf: End auxiliary LaTeX compilation     -------------------------------------------------      Even for a minimal file using the `article` class (see MWE), I see a few such messages. For a file of any complexity, and using more complex document classes, I see many dozens, resulting in rendering times that are unacceptable, and, in some instances, time-outs and pdflatex crashes. Commenting out the line               \RequirePackage[protrusion=true,expansion,tracking=true,kerning=true,spacing=true]{microtype}      in my document class restores performance and eliminates crashes. It appears that by turning off `expansion` I can reduce these symptoms, but I don't know why. What do these errors mean? Do they mean that I'm not "really" getting font expansion anyway (perhaps because of some font limitations)? Is there an incompatibility between `microtype` and `auto-pst-pdf`? Is there something I can do to restore performance while still using all the features of `microtype`? * * *               \documentclass{article}          \usepackage{auto-pst-pdf}          \RequirePackage[protrusion=true,expansion,tracking=true,kerning=true,spacing=true]{microtype}          \begin{document}          \end{document}


title: xcolor and everycr-Problem

text: I'm trying to insert some `\noalign`-code in every row of a tabular by using `colortbl` and `\everycr` or `\CT@everycr`. In most cases it works fine, but not if there is a `\rowcolors`-command (from `xcolor`) after my command: `\rowcolors` uses this code:               \CT@everycr{\@rowc@lors\the\everycr}       This doesn't expand `\the\everycr` and so whatever I put in `\everycr` is always ignored. Is this a bug or did I overlook something?               \documentclass{article}     \usepackage{array}     \usepackage[table]{xcolor}          \begin{document}     \makeatletter     \newcommand\test{\noalign{\hrule height 0.1cm width 5cm}}     \rowcolors{0}{green}{blue}     %Works after/without \rowcolors:     \CT@everycr\expandafter{\expandafter\test\the\CT@everycr}     \begin{tabular}[t]{ll}     foo & foo\\     foo & foo\\     \multicolumn{2}{l}{blub}     \end{tabular}          \bigskip               %this fails:     \everycr\expandafter{\expandafter\test\the\everycr}     \rowcolors{0}{red}{green}     %\CT@everycr{\@rowc@lors\the\everycr}%inserted by @rowcolors          %it would work if \rowc@lors would use this:     %\CT@everycr\expandafter{\expandafter\@rowc@lors\the\everycr}%     \makeatother          \begin{tabular}[t]{ll}     foo & foo\\     foo & foo\\     \multicolumn{2}{l}{blub}     \end{tabular}     \end{document}


title: How to control \chapter text related to \tableofcontents

text: How can I control `\chapter` text associated with `\tableofcontents`   1. How to change the font size of `\chapter{text}` in TOC page.   2. How to restrict TOC pages to ONE. (Two pages are coming as default).   3. At the beginning of the chapter, text is coming in very big size font. How can I control it.   4. Chapter text is coming immediately after page number. I want to introduce space between page number and chapter text. How can I do it.   5. How can I change the page number position. Here is the code:               \documentclass[a4paper,10pt]{book}     \usepackage{longtable}     \begin{document}          \tableofcontents     \chapter{(Chapter One)}