title: Ref list listing arg instead of actual argument's text in a newcommand

text: What i'm trying to do is to set up a quick insert of a pdf at a default size with the new command `\zfh`. **The problem** lies with the label and how it's listed in my label list database. _**example:_** `\zhf{FileLocation}{xpicture}` my label list has "fig_ #3" instead of listing "fig_ xpicture" I'm new to latex, any help would be appreciated and if there's a better method to confronting this problem, i'd be glad to hear it.               \documentclass[10pt,a4paper]{article}          \usepackage{graphicx}          \begin{document}          \newcommand{\zfh}[3][2in]{         \begin{figure}[H]             \begin{center}                \includegraphics[height= #1]{./FT/#2}             \end{center}             \caption{\protect\detokenize{#3}}             \label{fig_  #3}         \end{figure}         }              \zfh{zzz.pdf}{XCaption}              \ref{fig_  #3}  % fig_ #3 is listed instead of the actual text inserted as the #3 arg     \end{document}


title: Changing vertical spacing between equations

text: I'd like to reduce vertical spacing between `dmath` equations. I don't know how spacing works here. I tried changing line spacing with `setspace` but to no effect. This is meant to be a formula sheet with many stacked equations. One of the possible ways to go about this is to use `dgroup`.               \documentclass[a4paper,landscape]{article}     \usepackage{amsmath}     \usepackage{breqn}          \begin{document}     \begin{dmath}     Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)      \end{dmath}      \begin{dmath}     Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P{(O \mid \lambda )} \sum_s \sum_m \sum_t             \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} \right| + \left(    \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t -   \hat{\mu}_m^{(s)}\right) \right)      \end{dmath}      \end{document}


title: How to round to units of thousands or millions, etc., in a table column?

text: I have a table with lots of raw numbers in the billions and hundreds of millions. I'd like to abbreviate the figures in these columns to millions. So instead of `234,091,123` as per the input, I'd like to display `234.09` without having to change the raw figures. (I can then manually add the unit `(m)` to the column header.) For example, I'd like to go automatically... **FROM:**               \documentclass{standalone}     \usepackage[input-ignore={,},input-decimal-markers={.},group-separator={,}]{siunitx}     \begin{document}     \begin{tabular}{l S[table-format=9.0]}     \textbf{String} & \textbf{Number}\\     A & 123,456,789\\     B & 1,234,098\\     {...} & {...}\\     \end{tabular}     \end{document}      ![from](http://i.stack.imgur.com/WtAxH.png) **TO:** ![enter image description here](http://i.stack.imgur.com/Afyim.png) I might have overlooked something, but I didn't find anything in `siunitx`. Any ideas how this can be achieved?


title: letterspacing italic small caps automatically

text: The `MinionPro-It.otf` file I am using contains italic small caps, confirmed with `otfinfo -f MinionPro-It.otf` and `cfftot1 MinionPro-It.otf | t1testpage | epstopdf --filter > MinionPro-It.pdf`. The following code               \documentclass{scrbook}     \usepackage{fontspec}     \setmainfont[SmallCapsFeatures={Renderer=Basic}]{Minion Pro}     \usepackage[tracking=true]{microtype}     \SetTracking[no ligatures]{encoding = *, shape = sc*}{250}     \newcommand*\qbf{The quick brown fox jumps over the lazy dog.}     \begin{document}     \qbf          \textit{\qbf}          \textbf{\qbf}          \textbf{\textit{\qbf}}          \textsc{\qbf}          \textsc{\textbf{\qbf}}          \textsc{\textit{\qbf}}          \textls[250]{\textsc{\textit{\qbf}}}     \end{document}      produces ![enter image description here](http://i.stack.imgur.com/KWf1k.png) using `luatex 0.76` on a recenty updated TeXLive 2013. The medium and bold small caps are letter spaced automatically, however the italic small caps in the second to last line are not. It is possible to explicitly specify letter spacing as seen in the last line. But I have found no way to enable automatic letter spacing of italic small caps. Section 15.8.4 on page 167 of the `microtype` manual contains the code for setting the protrusion settings for the Minion italic small caps, hinting that the shape may be named `scit` or `si`. Unfortunately changing the `\SetTracking` parameters makes no difference. Any idea why it works for `sc + bf` but not for `sc + it`?


title: Color of chess notation (xskak)

text: I would like to set color for specific moves in `\mainline`, like `\mainline{1. f4 e5 2. {\color{red} g4} Qh4#}`. Is is any way to change the color for some moves?


title: Drawing simple graphs on LaTeX

text: Let me just say I am NOT drawing graphs from Graph Theory. I am just strictly asking about simple graphs we do in algebra. I just started with MiKTeX and I am trying to read and absorb everything in the "The Not So Short Introduction to LaTeX" on drawing pictures and graphics. However I've noticed that to draw even the simplest graph like a rectangle on the first quadrant, you have to be VERY specific with the `\put(x, y){\line(x1, y1){length}}` command. Is there a faster way? Yes I realize usually people import graphs from software devices like Maple or Mathematica but I don't have those right now. Could someone teach me a quick way of drawing them? An example I want to draw is: > a triangle formed by x + y = 1 and the coordinate axis on xy-plane. My best attempt at this is               \setlength{\unitlength}{2mm}     \begin{picture}(10,20)     \put(0,0){\vector(1,0){40}}     \put(0,0){\vector(0,1){40}}     \put(10,0){\line(-5,6){10}}     \put(10,0){\line(5,-6){10}}     \end{picture}      Unfortunately it displays nothing like I intended.               \put(10,0){\line(-5,6){10}}         \put(10,0){\line(5,-6){10}} does opposite things as I wanted a line straight through.      Could someone also detailedly explain to me what do the parameters `(x,y)` do after `\begin{picture}(x,y)`?


title: Changing the style of a single section

text: I'm trying to change the format of a single section in my document. The section is the introduction of my document, and therefore, I don't want it to be numbered. I tried to define a new command               \newcommand{\ssection}[1]{%       \section[#1]{\centering\normalfont\scshape #1}}      it works, however, I can't suppress the numbering.


title: What is the best way to get BibTeX entries from ISBN number?

text: I was wondering if the members of the community would kindly share their wisdom in what is the best way to get BibTeX entries from ISBN number? I am currently using this service but results leave much to be desired for. Before I start writing a script which will fix all "imperfection" of the above service is there a better way to get BibTeX references from ISBN? In particular I am interested in web-sites which scale well because I would just like to get BibTeX reference of the web with the script and be done with it.


title: Include information at the beginning of a document based on what comes later

text: I need to show a list of items/keywords/duedates used throughout my document at the beginning of the document, and make them hyperlinks. To be able to use this information the beginning of the document, I'm (ab)using a ToC-like structure:               \documentclass{article}     \usepackage{hyperref}          \makeatletter         \newcommand\listofduereviews{\textbf{Due Dates:}~\@starttoc{due}}     \makeatother          \newcommand{\duedate}[1]{%         \hypertarget{link.#1}{#1}%         \addtocontents{due}{\protect\hyperlink{link.#1}{(#1)}\quad}%         }          \begin{document}     \listofduereviews     \bigskip          The first due date is \duedate{01-May-2012}, and the second due date is \duedate{02-May-2012}.     \end{document}      This does what I want: ![enter image description here](http://i.stack.imgur.com/qUB69.png) But I feel I'm abusing ToCs for what they are not made for (or maybe I'm not, I just don't have enough LaTeX literacy to judge myself). What is a more elegant way to achieve this? Perhaps writing directly to a (non-listof) file?


title: Getting the Proper Format

text: I have to submit a thesis in a proper format. What I need to do is have the left margins be 1.5 inches, every other margin 1 inch. I also need the page number to be in the upper right corner of every page, without exceeding the margins. Finally, I need to have all the pages before the proper part of my thesis to be written in Roman numerals. My preamble looks like this:               \documentclass[12pt]{amsart}          \usepackage{amsmath,amsthm,amsfonts,amssymb,mathrsfs,mathtools}          %\usepackage[margin=1in]{geometry}     \usepackage[total={6in,9in},     top=1in, left=1.5in, right=1in, bottom=1in]{geometry}          \usepackage{setspace}          \usepackage[nice]{nicefrac}          \usepackage[all,cmtip]{xy}          \usepackage{multind}          \usepackage{lscape}          \usepackage{varioref}     \usepackage{cite}                    \pagestyle{plain}      What happens is that every other page has the correct margins, but every other page makes the 1.5 inch margin on the right instead of left. I have tried to look up how to change the page number, which led me to fancyhdr, but I can't get it to work.


title: How to correctly set a colorbar for an external graphic?

text: I created a pdf file from a Matlab imagesc plot. I have remove the colorbar and axis and now I want to have this image in my tex document. I manged to get the axes almost as I want them, but the colorbar won't work. There is no error, but also no colorbar. What am I missing?               \documentclass[a4paper,10pt]{scrartcl}          \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}     \begin{axis}[axis on top,title=Test,colormap/jet]      \addplot graphics[xmin=0,xmax=1,ymin=0,ymax=1,zmin=0,zmax=.5]        {image.pdf};     \end{axis}     \end{tikzpicture}          \end{document}


title: Using multiple fonts for maths and text

text: When using the Fourier font for text is it possible to use the standard times new roman latex font (or any other) for equations?


title: Font size of subscripts too high in classic thesis template

text: The font size of the subscripts is too high in my formulas if I use the classic thesis template. Here an example:               \documentclass{scrbook}     \usepackage{classicthesis}     \usepackage{amsmath}          \begin{document}       $H^{v_{2\text{2}}}$     \end{document}      The size of the first index "2" should be the same as the size of the second index "2". If I use document class "article" instead, both index are the same and correct.


title: Surfaces rendered using Asymptote won't layer correctly

text: # Question I recently asked a question here: How to plot a lattice of points on the surface of a torus? Where I have two answers, but both render incorrectly on my machine. They are supposed to look like: ## Given Images ![torus](http://i.stack.imgur.com/54ol4.png) ![torus2](http://i.stack.imgur.com/bdgig.png) But they actually look like: ## Rendered Images ![final-torus](http://i.stack.imgur.com/bk7gg.jpg) ![final torus](http://i.stack.imgur.com/yLIC7.jpg) I've included the code at the end of this post. ## The Problem It appears that the solid surfaces are not blocking the lines rendered later, as they should, but instead the arrows are being layered on top of the torus graphic. I've done a fair bit of goggling but can't seem to find an answer anywhere. # Original Code Credits to Alex \documentclass{standalone} \usepackage{asymptote}               \begin{document}          \begin{asy}[width=10cm,height=10cm]     import graph3;     import three;          size3(200);     currentprojection=orthographic(3,3,5);     currentlight=light(gray(0.4),specularfactor=3,viewport=true,                (-0.5,-0.25,0.45),(0.5,-0.5,0.5),(0.5,0.5,0.75));          int nb = 20, ns = 10;     real rb = 5.0, rs = 2.0;          triple torus(pair z) {            return ((rb + rs*cos(2*pi*z.x/ns))*cos(2*pi*z.y/nb),           (rb + rs*cos(2*pi*z.x/ns))*sin(2*pi*z.y/nb),           rs*sin(2*pi*z.x/ns));          }          surface site = scale3(0.1)*unitsphere;          for(int k1=0; k1<ns; ++k1) {       for(int k2=0; k2<nb; ++k2) {         draw(surface(torus((k1,k2))--torus((k1+1,k2))--torus((k1+1,k2+1))--torus((k1,k2+1))--cycle),          lightgray);         draw(torus((k1,k2))--torus((k1+1,k2)),Arrow3);         draw(torus((k1,k2))--torus((k1,k2+1)),Arrow3);         draw(shift(torus((k1,k2)))*site,red);       }     }          \end{asy}          \end{document}      Credits to g-kov               size(200);     import graph3;          pen surfPen=rgb(1,0.7,0);     pen xarcPen=deepblue+0.7bp;     pen yarcPen=deepred+0.7bp;          currentprojection=perspective(5,4,4);          real R=2;     real a=1;          triple fs(pair t) {       return ((R+a*Cos(t.y))*Cos(t.x),(R+a*Cos(t.y))*Sin(t.x),a*Sin(t.y));     }          surface s=surface(fs,(0,0),(360,360),8,8,Spline);     draw(s,surfPen,render(compression=Low,merge=true));          int m=20;     int n=10;     real arcFactor=0.85;          pair p,q;          for(int i=1;i<=n;++i){       for(int j=0;j<m;++j){         p=(j*360/m,(i%n)*360/n);         q=(((j+arcFactor)%m)*360/m,i*360/n);         draw(fs(p)..fs((p+q)/2)..fs(q),xarcPen,Arrow3(size=4));         q=(j*360/m,((i%n)-arcFactor)*360/n);         draw(fs(p)..fs((p+q)/2)..fs(q),yarcPen,Arrow3(size=3));         dot(fs(p));       }     }      I have modified both scripts in the following way to make them render with the correct orientation: First Script:               ... for(int k1=ns; k1>0; --k1) ...      Second Script:               No Modifications.


title: arc that passes from (B) having a center on (A), automatically calculates (AB) distance

text: I want to create an arc which automatically calculates the distance (AB). Inspired by page 58 at pgf manual. But the code block `% \draw (H) ++arc (15:60: $ (A) ! - ! (B) $);` does not help much. Namely I want one arc that passes from (B) having a center on (A). Any idea? These answer actually gives a lot of useful information but I can not figure out. How can I compute the distance between two coordinates in TikZ? and TikZ: Drawing an arc between two coordinates? ![enter image description here](http://i.stack.imgur.com/jjSsE.png)                \documentclass[b5paper,11pt]{book}          \usepackage{tikz}      \usetikzlibrary{decorations.markings,calc,intersections,through,backgrounds}          \begin{document}          \begin{center}       \begin{tikzpicture}[scale=1.25]%,cap=round,>=latex]              \draw[step=.5cm,gray,very thin] (-2.0cm,-2.0cm) grid (2.cm,2.0cm);              \coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);         \coordinate [label=right:$C$] (C) at (1.5cm,-1.0cm);         \coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);         \draw (A) -- node[above] {$g$} (B) -- node[right] {$a$} (C) -- node[below] {$b$} (A);              \filldraw [ color = green!10!white, draw=green!10!black] (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);          %     \draw (H)  ++arc (15:60: $ (A) ! - ! (B) $);                  \draw  (5:2cm) arc(15:60:2cm);                 \end{tikzpicture}     \end{center}     \end{document}      Αs a final result I want to create something like this ![enter image description here](http://i.stack.imgur.com/mPlDY.png)


title: Parallel text in ConTeXt

text: I need to type parallel text on facing pages (original text on right page and translation on left one) in ConTeXt. I've used `ledpar` in Latex but wasn't satisfied with the results (text is aligned on a paragraphs leaving blanks if one of the texts is longer than the other, a common situation). Now I would like to try it in Context. Ideally both paragraphs will have same height, I suppose changing interlinear space, etc.)


title: Right-align the prebreak symbol in a listings environment

text: I’m using the `breaklines` and `prebreak` option with listings, but I find it visually not very pleasing that the prebreak-symbols are not vertically aligned. I’d prefer if they were all on the very right of the listing. Here is example code.               \documentclass{standalone}     \usepackage{listings}     \begin{document}     \begin{lstlisting}[breaklines,breakatwhitespace,prebreak=!,basicstyle=\ttfamily]     This is a long line This is a long line This is a long line This is a long line This is a long line     This is another long line This is another long line This is another long line This is another long line     \end{lstlisting}     \end{document}      Which yields: ![enter image description here](http://i.stack.imgur.com/86Ano.png) while I want something like ![enter image description here](http://i.stack.imgur.com/uUfTH.png)


title: What does "Limit controls must follow a math operator" mean?

text: When I try to compile this:               \documentclass{article}     \usepackage{amsmath}     \usepackage{nath}     \DeclareMathOperator{\argmin}{arg\,min}     \begin{document}         \begin{equation}             \argmin \log(\sum_{x=1}^2 x^2)         \end{equation}     \end{document}      I get:               Test.tex:7: Limit controls must follow a math operator     Test.tex:7: Limit controls must follow a math operator      What exactly does this mean and how can I fix it?


title: How to use empheq environment in TikZ nodes?

text: Using the `empheq` environment from the `empheq` package in a TikZ node is throwing errors for me (although it seems to be plotted correctly):               \documentclass{scrartcl}          \usepackage{empheq}     \usepackage{tikz}          \begin{document}         \begin{tikzpicture}             \node at (0,0)             { % empheq is plotted but throws errors                 \begin{empheq}[left=\empheqlbrace]{align*}                     a = b                 \end{empheq}             };         \end{tikzpicture}     \end{document}      **Errors**   1. Bad math environment delimiter.   2. `\begin{equation*}` on input line ... ended by `\end{AmSequation*}`. **What I already know** From Aligned equations inside of TikZ node. I have learned that `align` environment can be replaced by `aligned`:                   % --- align does not work ---         \node at (0,0) {  \begin{align*} a = b \end{align*}  };              % --- aligned does ---                 \node at (0,0) {  $\begin{aligned} a = b \end{aligned}$  };      Please note that I depend on `empheq`'s functionality although the minimal working examples here do not reveal that.


title: How can I make something like a superscript that doesn't go as high?

text: The `\textsuperscript` command makes the superscripted text go above the top of capital letters. Here's an example showing what I mean:               \textsuperscript{3} И сказ      ![enter image description here](http://i.stack.imgur.com/2CQDy.png) As you can see, the superscripted 3 goes above the capital letter height. I would like something similar to a superscript, but that is constrained by the capital letter height, as shown below. ![enter image description here](http://i.stack.imgur.com/fsBAa.png) Is there a relatively simple way to do this in TeX?


title: tikz euclide \tkzMarkAngle causing error in bounding box?

text: I am experiencing strange behaviour with tkz-euclide. The `\tkzMarkAngle[size=2](P,R,S)` command in the code below seems to mess up the bounding box.               \documentclass{minimal}          \usepackage{tikz}     \usepackage{tkz-euclide}     \usetkzobj{all}          \begin{document}          \begin{center}     \begin{tikzpicture}[scale=.3]     \tkzDefPoint(0,0){S}     \tkzDefPoint(42:20){P}     \tkzDefPoint(0:21.1){R}     \tkzDrawSegments[thick](S,P P,R R,S)     \tkzLabelPoints[left](S)     \tkzLabelPoints[above](P)     \tkzLabelPoints[right](R)     \tkzMarkAngle[size=2](P,R,S)     \tkzLabelAngle[pos = 3.5](P,R,S){$65^{\circ}$}     \tkzMarkAngle[size=2](R,S,P)     \tkzLabelAngle[pos = 3.5](R,S,P){$42^{\circ}$}     \tkzLabelSegment[above left](S,P){$20$ m}     \end{tikzpicture}     \end{center}          \end{document}      This above code produces the correct picture but not centered, whereas the following code (with a single line commented out) produces a picture that does get centered.               \documentclass{minimal}          \usepackage{tikz}     \usepackage{tkz-euclide}     \usetkzobj{all}          \begin{document}          \begin{center}     \begin{tikzpicture}[scale=.3]     \tkzDefPoint(0,0){S}     \tkzDefPoint(42:20){P}     \tkzDefPoint(0:21.1){R}     \tkzDrawSegments[thick](S,P P,R R,S)     \tkzLabelPoints[left](S)     \tkzLabelPoints[above](P)     \tkzLabelPoints[right](R)     %\tkzMarkAngle[size=2](P,R,S)     \tkzLabelAngle[pos = 3.5](P,R,S){$65^{\circ}$}     \tkzMarkAngle[size=2](R,S,P)     \tkzLabelAngle[pos = 3.5](R,S,P){$42^{\circ}$}     \tkzLabelSegment[above left](S,P){$20$ m}     \end{tikzpicture}     \end{center}          \end{document}      Does anyone have any idea why this is happening and how I can get my picture centered?


title: In plain tex, how to use Small Caps in equations?

text: In LaTeX, we can write > `$T_{\textsc{max}}$` In plain TeX, we can do thing like > `\font\scshape=cmcsc10` > > `{\scashape max}`. But this method does not work inside $$. We cannot write > `$T_{{\scshape max}}$` So is there any way to make it work?


title: How can I convince hyperref and xindy to play together nicely?

text: I'm using `xindy` to generate indexes for a manual that gets translated into multiple languages. Unfortunately, `hyperref` and `xindy` don't like to play nicely together. I found some older mailing list threads that suggest that fixing this in `xindy` would require too much effort. My question is: how can I get `xindy` and `hyperref` to play nicely together. What is the best workaround for this incompatibility? An example document will demonstrate the problem:               \documentclass{article}          \usepackage{lipsum}     \usepackage{makeidx}     \usepackage{hyperref}          \makeindex          \begin{document}          \index{single}     \index{range|(}     \lipsum     \index{range|)}          \printindex          \end{document}      I compile this document (named `x.tex`) using `xelatex` and `xindy`:               xelatex x     xindy -C utf8 -M texindy -L english x.idx     xelatex x     xelatex x      Page numbers that are part of a range are missing from the index: ![Missing page range numbers](http://i.stack.imgur.com/eWdmr.png) The `xindy` output makes a few complaints:               WARNING: Found no :close-range matching an already opened one!              Location-reference is 1 in keyword (range).              Maybe I lost some of the regular location-references.          WARNING: Found a :close-range in the index that wasn't opened before!              Location-reference is 2 in keyword (range)              I'll continue and ignore this.      These errors make sense when we look at the `x.idx` file:               \indexentry{single|hyperpage}{1}     \indexentry{range|(hyperpage}{1}     \indexentry{range|)}{2}      The `hyperpage` command isn't used in the close-range entry. In order of preference, here are my desired outcomes:   1. `xindy` and `hyperref` work perfectly together and generate indexes with hyperlinked page numbers without any external processing.   2. `xindy` and `hyperref` can generate indexes with hyperlinked page numbers with the aid of an external script to pre- or post-process the index files before/after passing them through xindy. (I'm not currently using any special formatting for page numbers if that simplifies things.)   3. `xindy` can be pacified by removing hyperlinks from the page numbers (with or without the use of an external script). Alternatively, is there a different indexing program that can work with UTF-8-encoded files, `hyperref`, and knows to collate various languages?


title: multiple listing styles with hyperref and caption packages

text: This is a follow-up question to Multiple listings styles. The MWE from the accepted answer works fine. Unfortunately, when I add the `hyperref` package OR the `caption` package (or both of them), the entries for `\lstlistofcplusplus`, `\lstlistofrcode` and `\lstlistofpseudocode` are not shown in the output. The generated `.loc`, `.lor` and `.lop` files are also empty when adding one of these two packages. Here is the minimum (non-)working example:               \documentclass{article}     \usepackage{regexpatch}% http://ctan.org/pkg/regexpatch     \usepackage{listings}% http://ctan.org/pkg/listings          % --- problem when loading one of these two packages     \usepackage{hyperref}     \usepackage{caption}     % ---          \makeatletter     % --------------------------------------- C++     \newcommand{\lstlistcplusplusname}{List of C++}     \lst@UserCommand\lstlistofcplusplus{\bgroup         \let\contentsname\lstlistcplusplusname         \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{loc}}%         \tableofcontents \egroup}     \lstnewenvironment{cplusplus}[1][]{%       \renewcommand{\lstlistingname}{C++ Code}%       \xpatchcmd*{\lst@MakeCaption}{lol}{loc}{}{}%       \lstset{language=C++,#1}}       {}     % --------------------------------------- R     \newcommand{\lstlistrcodename}{List of R}     \lst@UserCommand\lstlistofrcode{\bgroup         \let\contentsname\lstlistrcodename         \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lor}}%         \tableofcontents \egroup}     \lstnewenvironment{rcode}[1][]{%       \renewcommand{\lstlistingname}{R Code}%       \xpatchcmd*{\lst@MakeCaption}{lol}{lor}{}{}%       \lstset{language=R,#1}}       {}     % --------------------------------------- Pseudocode     \newcommand{\lstlistpseudocodename}{List of Pseudocode}     \lst@UserCommand\lstlistofpseudocode{\bgroup         \let\contentsname\lstlistpseudocodename         \let\lst@temp\@starttoc \def\@starttoc##1{\lst@temp{lop}}%         \tableofcontents \egroup}     \lstnewenvironment{pseudocode}[1][]{%       \renewcommand{\lstlistingname}{Pseudocode}%       \xpatchcmd*{\lst@MakeCaption}{lol}{lop}{}{}%       \lstset{basicstyle=\ttfamily,#1}}       {}     \makeatother          \begin{document}          \lstlistofcplusplus     \lstlistofrcode     \lstlistofpseudocode          \begin{cplusplus}[caption={Hello world}]     // 'Hello World!' program           #include <iostream>          int main()     {       std::cout << "Hello World!" << std::endl;       return 0;     }     \end{cplusplus}          \begin{rcode}[caption={Hello world}]     cat('Hello, world!\n')     \end{rcode}          \begin{pseudocode}[caption={Hello world}]     print "Hello world"     \end{pseudocode}          \end{document}      Here is the output: ![output of LaTeX code from above](http://i.stack.imgur.com/KOv6W.png)


title: .bib file causing bibtex to crash using vancouver style, no errors in log

text: I am currently writing a thesis using the vancouver style, and I have encountered an error. When I add any more citations to my .bib file (using jabref or otherwise), when I next go to compile, bibtex crashes and will no longer resolve until I load up a previous version of the .bib file. Previously, there were lots of errors in the log file, but having cleaned them up, there now appears to be no log file when it crashes, and the problem has not resolved. The chapters and .bib file can be found here. Any advice would be greatly appreciated.               \documentclass[12pt, a4paper, oneside]{Thesis}      \graphicspath{{./Pictures/}}      \usepackage[super,comma,sort&compress]{natbib}      \usepackage{textcomp}     \usepackage{mhchem}     \usepackage{tabu}     \usepackage{pdfpages}     \usepackage{booktabs}     \usepackage{pbox}     %\usepackage{tabularx,ragged2e,booktabs,caption}     \hypersetup{urlcolor=black, colorlinks=true}      \title{\ttitle}          \begin{document}     \begin{titlepage}     \begin{center}          \mainmatter           \pagestyle{fancy}           \input{./Chapters/01_introduction}     \input{./Chapters/02_litreview}      \input{./Chapters/03_general_materials_and_methods}     \input{./Chapters/04_up_experimental}      \input{./Chapters/05_mycoplasma_experimental}      \input{./Chapters/06_general_discussion_and_conclusions}           \addtocontents{toc}{\vspace{2em}}          \appendix           %\input{./Appendices/AppendixB}     %\input{./Appendices/AppendixC}          \addtocontents{toc}{\vspace{2em}} % Add a gap in the Contents, for aesthetics          \backmatter          \label{Bibliography}          \lhead{\emph{Bibliography}} % Change the page header to say "Bibliography"          \bibliographystyle{vancouver} % Use the "unsrtnat" BibTeX style for formatting the Bibliography          \bibliography{Bibliography} % The references (bibliography) information are stored in the file named "Bibliography.bib"          \end{document}


title: Crossreference in Ref Range [(1a-1e) to (1a-e)]

text: I am just a beginner in LaTeX, I am facing a problem in Ref Range,               \documentclass{article}     \usepackage{amsmath,amsfonts,amssymb,cleveref}     \begin{document}     \ref{eq1a,eq1b,eq1c,eq1d,eq1e}     \begin{subequations}       \begin{align}         1+1=2\label{eq1a}\\         1-1=0\label{eq1b}\\         23+23=46\label{eq1c}\\         d+e=f\label{eq1d}\\         e+f=g\label{eq1e}       \end{align}     \end{subequations}     \ref{eq1a,eq1b,eq1c,eq1d,eq1e}     \cref{eq1a,eq1b,eq1c,eq1d,eq1e}     \end{document}      My problem is I want to display the refrange like `1a-e` if I use `\cref`, but I am getting an output like `1a-1e` but is it possible to hide the 1 in the refrange (1a-e) I went through the cleveref style file (Dont know anything about that :)), I found out the command which is replacing the (1a-1e) (cleverref.sty Line Number: 1022)                           \textup{(#3#1#4)}--\textup{(#5#2#6)}}}{}}{}%      In the above mentioned coding from cleverref.sty, I need to delete the Number and retain the 'e' from #2, Please guide me in this problem, thanks in advance


title: Moving a subfigure

text: I need to move the left part of the subfigure in the following picture upward: ![img1](http://i.stack.imgur.com/JGZUh.jpg) That is, the image should like the following: ![img2](http://i.stack.imgur.com/RIqJA.jpg) so the subfigures are aligned vertically at the top. Document:               \documentclass{article}          \usepackage[utf8]{inputenc}          \usepackage{graphicx}     \usepackage{tikz}                                   % graphics     \usetikzlibrary{shapes.geometric,calc,arrows,decorations.markings,decorations.pathmorphing}     \usepackage{pgfplots}     \usepackage{subfigure}          \begin{document}          \section {First}          text          \begin{figure}[h]      \centering       \subfigure[text]       {       \begin{tikzpicture}     \draw (-2,0) arc (180:360:2cm and 0.5cm) -- (0,6) -- cycle;     \draw[densely dashed] (-2,0) arc (180:0:2cm and 0.5cm);          \fill[top color=gray!50!black,bottom color=gray!10,middle color=gray,shading=axis,opacity=0.25] (0,0) circle (1cm and 0.5cm);     \fill[left color=gray!50!black,right color=gray!50!black,middle color=gray!50,shading=axis,opacity=0.25] (1,0) -- (1,3) arc (360:180:1cm and 0.5cm) -- (-1,0) arc (180:360:1cm and 0.5cm);     \fill[top color=gray!90!,bottom color=gray!2,middle color=gray!30,shading=axis,opacity=0.25] (0,3) circle (1cm and 0.5cm);     \draw (-1,0) -- (-1,3) arc (180:360:1cm and 0.5cm) -- (1,0) ++ (-1,0) circle (1cm and 0.5cm);     \draw[densely dashed] (-1,3) arc (180:0:1cm and 0.5cm);             \end{tikzpicture}     }       %     \subfigure[text]       {       \begin{tikzpicture}     \draw (-2,0) -- (0,6) -- (2,0) -- (-2,0);          \draw (-1,0) -- (-1,3)  -- (1,3) -- (1,0);     \draw[thick] (0,6) -- (0,0);     \draw[thick] (0,0) -- (-2,0);     \draw[thick] (-2,0) -- (0,6);     \draw[thick] (-1,0) -- (-1,3) node[below] at (-1,-0.4) {$\scriptstyle{a}$} node[right] at (-1,1.5) {$\scriptstyle{v}$};     \draw[thick] (-1,0) -- (-2,0) node[below] at (-1.5,0.1) {$\scriptstyle{a-r}$};     \draw[thick] (-1,3) -- (0,3) node[above] at (-0.5,2.9) {$\scriptstyle{r}$};          \draw[<->] (0.2,6) -- (0.2,0) node[right] at (0.2,2.5) {$\scriptstyle{b}$};     \draw[<->] (-2,-0.4) -- (0,-0.4) ;     \end{tikzpicture}     }     \caption{text}     \label{fig:text}     \end{figure}          \end{document}


title: LaTeX - a single code listing over multiple pages

text: I'm using the `lstlisting` package in my diploma thesis to include code snippets. Unfortunately one of them won't fit on a single page. Stil LaTeX won't split it over multiple pages and instead the text goes under the bottom of the page. What am I doing wrong? My setup follows.               ...     \newfloat{Algorithm}{t}{lop}     ...     \lstset{ %     basicstyle=\footnotesize,       % the size of the fonts that are used for the code     numbers=left,           % where to put the line-numbers     numberstyle=\footnotesize,  % the size of the fonts that are used for the line-numbers     stepnumber=1,           % the step between two line-numbers. If it is 1 each line will be numbered     numbersep=5pt,          % how far the line-numbers are from the code     backgroundcolor=\color{white},  % choose the background color. You must add \usepackage{color}     showspaces=false,           % show spaces adding particular underscores     showstringspaces=false,     % underline spaces within strings     showtabs=false,         % show tabs within strings adding particular underscores     frame=single,           % adds a frame around the code     tabsize=2,              % sets default tabsize to 2 spaces     captionpos=b,           % sets the caption-position to bottom     breaklines=true,            % sets automatic line breaking     breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace     escapeinside={\%*}{*)}      % if you want to add a comment within your code     }     ...     \begin{Algorithm}[!htp]        \begin{lstlisting}[mathescape]     ... a code snippet which is way too long ...        \end{lstlisting}        \caption{caption}        \label{label}     \end{Algorithm}     ...


title: LaTeX Suite Autocompletion Feature Not working With Rnw file

text: I have been a great fan of Vim with its awesome Vim-latex suite providing extremely useful keybindings and autocompletion features. Then I installed `vim-r-plugin` and opened a `.Rnw` Sweave file. While syntax highlighting and other R related features such as key shortcuts are working fine, LaTeX shortcuts no longer works. For example, if I type `SSE` it longer gives `\section{}`. But if I instead I open a .tex file, those shortcuts works just fine. I am using gVim 7.3 in windows 7. Any suggestions would be highly appreciated.


title: Compiler automatically create specified output directory

text: I would like to handle my projects such that every time I compile a `.tex` file, the compiler would always place the output `.pdf` in a directory named `output` (and create it if it doesn't exist). Here's a sample Terminal session where the `\--output-directory` option cannot create the specified directory if it doesn't exist.               $ tex --output-directory=output     This is TeX, Version 3.1415926 (TeX Live 2010)     **\relax     ! I can't write on file `texput.log'.     (Press Enter to retry, or Control-D to exit; default file extension is `.log')     Please type another transcript file name:       In TeXShop, how do I specify the command to do as I wish? ![enter image description here](http://i.stack.imgur.com/TyWiO.png)


title: Problem with LuaTeX : can't write on the .aux file at second pass

text: I use MiKTeX 2.9 for Windows, format Plain eTeX. I have my own macro package which I've used for years, and I tried recently to use it with LuaTeX (included MiKTeX version) in order to use UTF-8 encoding (say). All things worked fine at the first pass and LuaTeX correctly created the `.aux` file and wrote suitable commands. But at the second pass, LuaTeX failed and output the message: > I can't write on file luatest.aux. My macro package uses only eTteX commands like openin/write etc. and all things work fine when compiled with pdfTeX. I believe this is only a matter of parameter setting when calling LuaTex from the command line, but what can it be ?


title: Custom-length arrows, text over and under

text: Expanding on this question I'd like to know if it's possible to modify this macro to allow for text under the arrow as well, as the `\xrightarrow[below]{under}`. I don't have any experience with macros but using the answer to the aforementioned question I tried this to no effect               \newlength{\arrow}     \settowidth{\arrow}{\scriptsize$1000$}     \newcommand*{\myrightarrow}[2]{\xrightarrow[#1]{\mathmakebox[\arrow]{#2}}}      What would be the right way to do this?


title: What does the titlepage environment do and what are its benefits?

text: I'm speaking about the `article` document class only, because `report` and `book` deal with titles in a different way. Obviously, the `titlepage` environment triggers a new page after it, and it resets the page counter to start at 1 over again. As long as you don't use `\maketitle` on your `titlepage`, the page style is set to `empty`, i.e. no page number is shown on the title page. If, however, you do use `\maketitle` within the `titlepage` environment, that sets the pagestyle to `plain` (page number in the footer) again, resulting in two consecutive pages numbered "1". If we go a step further and use `hyperref`, which is pretty standard package, we get a warning about the page number 1 being used twice:               pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has      been already used, duplicate ignored This shows how `titlepage` messes up internal references slightly. This question is not about how to fix the things `titlepage` messes up, I've got all that figured out; I'm rather wondering what the point of using `titlepage` in a non-trivial document is – besides the nice semantic markup in the source. I could as well just use `\newpage`, considering that I've got to fix the page numbering at any rate. So: **What precisely does the`titlepage` environment do and what are its benefits?** If you want to see the phenomena I described, here's a MWE for you to copy. The lines appended with `% *` might be interesting to comment out.               \documentclass{article}          \usepackage{hyperref}% *          \author{John Doe}     \title{Foo Bar}          \begin{document}     \begin{titlepage}     \maketitle% *     Baz     \end{titlepage}     Hello World     \end{document}      * * * **Edit:** Thanks to Werner for the answer. I haven't accepted it though because I'm still not really clear on some things. Let me clarify my question – it'd be great if Werner or someone else could elaborate a bit on them:   * What exactly does the `titlepage` environment (not the document class option) in `article` do; what macros and environments does it change and how? I looked into `article.cls` but I didn't understand all of the relevant parts.    * What is the point of using this environment after all? Why don't I just write `\newpage` after the title page? * * * **Edit 2:** It'd be interesting to hear if you personally are actually using the `titlepage` environment and perhaps to see a small example in which it is used advantageously.


title: WinEdt keeps compiling a closed document

text: I have a simple template whose codes I copy over to a new document each time. But once in a while, when I compile the new document, the old template still shows up as the dvi (despite multiple re-compilation). I would tweak this and that, restart WinEdt, etc., and would get it to work. But not knowing the reason really bugs me. It sounds like it has an obvious reason that I simply do not know. Can anyone help?


title: Include full screen image in beamer with text on it

text: I would like to include a full screen image in beamer and write "Thank you" in the middle of the bottom right hand quarter of the image in large letters (preferably in a nice font). To that end I have               \documentclass{beamer}          \usepackage{pdfpages}          \begin{document}     \begin{frame}     \frametitle{Frame one}     \end{frame}        {         \setbeamercolor{background canvas}{bg=}         \includepdf{bp.pdf}     }       \end{document}      How can I write the text onto the image? Alternatively I also tried               \documentclass{beamer}     \usepackage{chngpage}     \usepackage{calc}     \begin{document}        \begin{frame}     \frametitle{Frame one}     \end{frame}      \newgeometry{margin=0pt}       \begin{adjustwidth}{-\oddsidemargin-1in}{-\rightmargin}       \includegraphics[width=\paperwidth]{bp.jpg}       \end{adjustwidth}     \end{document}      but I am still not sure how to write on the image.


title: How to collect all parts in Beamer?

text: I would like to use `\tableofcontents` to get contents of all the parts in `beamer` including only the names of parts, not including sections and subsections, how should I do?


title: LaTeX - Insert thumbnail with link to fullsize image contained in appendix

text: What is the best way to include a small thumbnail image which links to the fullsize image which should be contained in the appendix? Ideally it would be nice to have a macro which created a thumbnail inline and also automatically added a larger image to the appendices. Does this exist? -- Edit -- Issue with subfigure.               \begin{figure}[H]         \begin{subfigure}             \centering         \thumbnailandappendix{images/iPadMyPdfs}          \end{subfigure}%         \begin{subfigure}             \centering         \thumbnailandappendix{images/iPadMyPdfsPort}          \end{subfigure}     \caption{Main Tab}     \end{figure}      ![Output](http://i.stack.imgur.com/yC0MC.png) Packages used               \usepackage{array} %% so can bold columns in a latex table     \usepackage{float} %% used to help position images exactly where typed     \usepackage{subfigure}     \usepackage{subcaption}     \usepackage{graphicx}     \usepackage{hyperref}


title: Times New Roman with LaTeX (mathptmx)

text: Is it possible to change the look of `\infty` when using `mathptmx`? It looks horribly small compared to the other characters.


title: Greek to ShareLaTeX and moderncv

text: I tried to use the ShareLaTeX for my resume using `monderncv` but the tried and could not write Greek. There is a solution, someone has managed to load the Greek in this program?


title: How tell LaTeX to use existing bbl file without running bibtex?

text: How can I tell LaTeX that it should use an existing bbl file `foo.bbl`, say, without running `bibtex`?


title: LuaLaTeX and PSTricks

text: Is there the possibility to produce PSTricks graphics in LuaLaTeX? I tried it, but i get                   ! Undefined control sequence.         <recently read> \c@lor@to@ps               l.9 \psline(             -5,2)(5,4)      With `auto-pst-pdf` I get a warning to use pdflatex. So how can i use pstricks in LuaLaTeX? Edit:@Marco Daniel I asked where to pack packages for specified for lualatex, "normal packages", and pstricks packages: Maybe something like this:                   \RequirePackage{ifluatex}         \documentclass{scrartcl}         \usepackage{amsmath}              \ifluatex             \usepackage{fontspec}             \defaultfontfeatures{Ligatures=TeX}             \usepackage{lua-visual-debug}         \else              \usepackage{pstricks}              \usepackage{pst-plot}         \fi              \usepackage{auto-pst-pdf}         \begin{document}         Here text...         \end{document}      Niklas


title: Help in making some symbol in tikz?

text: I want make a symbol like this: ![enter image description here](http://i.stack.imgur.com/KwzWk.jpg) Is it possible to make in tikz?


title: Draw a cylindrical volume

text: I am trying to draw this image ![](http://i.imgur.com/torgQ.jpg) My code is               \documentclass[11pt,a4paper]{book}     \usepackage{kerkis}     \usepackage{tikz}     \definecolor{Darkgreen}{rgb}{0,0.4,0}     \definecolor{Darkblue}{rgb}{0,0,0.4}     \begin{document}     \begin{tikzpicture}          \draw (0,0) ellipse (1cm and 3cm);     \draw (0,0) ellipse (0.7cm and 2.1cm);     %\draw (0cm,0cm) circle (2cm);      %\draw (0cm,0cm) circle (3cm);          \draw (0,3) -- (3,4);     \draw (0,-3) -- (3,-2);          %% First clip      \path[clip] (4cm,5cm) --  (4cm,-3cm) -- (-4,-3) -- (-4,5) -- cycle;     %%The circle      %\node[circle,draw=black,minimum size=13cm] at (-10cm,1cm) (circ) {};          %\draw (3,4) arc (0:-30:13cm);     \draw (-9.5,1) circle (13cm);%This circle crosses desired points in a desired arc angle          \end{tikzpicture}     \end{document}      First of all I cannot realise the best way to draw the front side. I used ellipses and circles but I don't seem able to produce the same output. Secondly I can't find out how to make the arc on the right side be placed properly. My ugly output is ![](http://i.imgur.com/URaCT.jpg)


title: How to get longtable to make the rows flushbottom?

text: I have a `longtable` where every row can have a slightly different height and is followed by a `\hline`. How can I get the rows of the pages to be `\flushbottom`end? Here's a MWE:               \documentclass[a5paper]{article}     \usepackage{longtable}     \usepackage[showframe]{geometry}     \usepackage{lipsum}     \setlength{\parindent}{0pt}     \flushbottom     \begin{document}     \lipsum[1-4]\newpage     \begin{longtable}{@{}p{\linewidth}@{}}     \lipsum[1]\tabularnewline\hline     \lipsum[1]\tabularnewline\hline     \lipsum[1]\tabularnewline\hline     \lipsum[1]\tabularnewline\hline     \lipsum[1]\tabularnewline\hline     \end{longtable}     \end{document}      A pdf is here. Ideally every row should stretch, but I'd be satisfied if only the last one was stretched.


title: How to produce full author list in the first citation instead of "et al." in *achicago* package?

text: I use the `achicago` package and need to produce full list of authors when a source is cited for the first time and then "et al." afterwords. I found that `natbib` has a `longnamesfirst` option that does that. Is this possible with `achicago`?


title: Formatting a comma separated list of values

text: I'm creating a set of mathematics worksheets, and I'd like to have an upside down "answer key" below a set of enumerated questions. Here is what I have at the moment:               \usepackage{graphicx}          Answers:          \rotatebox{180}{$1. \underline{5}$ $2.\underline{5}$     $3.\underline{10}$ $4.\underline{8}$}      This produces the following: ![enter image description here](http://i.stack.imgur.com/iWeQZ.png) Given that all the answers are in the same format (problem number, then an underlined answer), is there a way to create a command that would produce the formatted text (I can add the `\rotatebox` myself) for a set of values? I'm thinking something like this:               \createanswerbox[5,5,10,4]


title: Combine boldsymbol and widebar

text: I would like to have boldsymbol and widebar inside an equation combined as something like               $\widebar{\boldsymbol\mu}$      However, while this compiles in my code, I only have a mu with a bar over it. (It's not bold). I can do something similar with               $\bar{\boldsymbol\mu}$      but I really would like to use the widebar. How can I combine these two things? I'm using the following code for widebar in the preamble.               %%%%%%%% To create wide bars %%%%%%%%%%     \makeatletter     \newcommand*\if@single[3]{%       \setbox0\hbox{${\mathaccent"0362{#1}}^H$}%       \setbox2\hbox{${\mathaccent"0362{\kern0pt#1}}^H$}%       \ifdim\ht0=\ht2 #3\else #2\fi       }     %The bar will be moved to the right by a half of \macc@kerna, which is computed by amsmath:     \newcommand*\rel@kern[1]{\kern#1\dimexpr\macc@kerna}     %If there's a superscript following the bar, then no negative kern may follow the bar;     %an additional {} makes sure that the superscript is high enough in this case:     \newcommand*\widebar[1]{\@ifnextchar^{{\wide@bar{#1}{0}}}{\wide@bar{#1}{1}}}     %Use a separate algorithm for single symbols:     \newcommand*\wide@bar[2]{\if@single{#1}{\wide@bar@{#1}{#2}{1}}{\wide@bar@{#1}{#2}{2}}}     \newcommand*\wide@bar@[3]{%       \begingroup       \def\mathaccent##1##2{%     %If there's more than a single symbol, use the first character instead (see below):         \if#32 \let\macc@nucleus\first@char \fi     %Determine the italic correction:         \setbox\z@\hbox{$\macc@style{\macc@nucleus}_{}$}%         \setbox\tw@\hbox{$\macc@style{\macc@nucleus}{}_{}$}%         \dimen@\wd\tw@         \advance\dimen@-\wd\z@     %Now \dimen@ is the italic correction of the symbol.         \divide\dimen@ 3         \@tempdima\wd\tw@         \advance\@tempdima-\scriptspace     %Now \@tempdima is the width of the symbol.         \divide\@tempdima 10         \advance\dimen@-\@tempdima     %Now \dimen@ = (italic correction / 3) - (Breite / 10)         \ifdim\dimen@>\z@ \dimen@0pt\fi     %The bar will be shortened in the case \dimen@<0 !         \rel@kern{0.6}\kern-\dimen@         \if#31           \overline{\rel@kern{-0.6}\kern\dimen@\macc@nucleus\rel@kern{0.4}\kern\dimen@}%           \advance\dimen@0.4\dimexpr\macc@kerna     %Place the combined final kern (-\dimen@) if it is >0 or if a superscript follows:           \let\final@kern#2%           \ifdim\dimen@<\z@ \let\final@kern1\fi           \if\final@kern1 \kern-\dimen@\fi         \else           \overline{\rel@kern{-0.6}\kern\dimen@#1}%         \fi       }%       \macc@depth\@ne       \let\math@bgroup\@empty \let\math@egroup\macc@set@skewchar       \mathsurround\z@ \frozen@everymath{\mathgroup\macc@group\relax}%       \macc@set@skewchar\relax       \let\mathaccentV\macc@nested@a     %The following initialises \macc@kerna and calls \mathaccent:       \if#31         \macc@nested@a\relax111{#1}%       \else     %If the argument consists of more than one symbol, and if the first token is     %a letter, use that letter for the computations:         \def\gobble@till@marker##1\endmarker{}%         \futurelet\first@char\gobble@till@marker#1\endmarker         \ifcat\noexpand\first@char A\else           \def\first@char{}%         \fi         \macc@nested@a\relax111{\first@char}%       \fi       \endgroup     }     \makeatother     %%%%%%%%%%%%%%%%%%%%%%%%%%%%


title: How to define new loops in algorithmicx?

text: How can I define a new loop in algorithmicx? For example, code like this: ex1) PreLoop s do --statement1 --statement2 ex2) PostLoop s do --statement1 --statement2 Is it possible to define it as a command?


title: Slider ticker on beamer runs off page

text: I am creating a presentation using the beamer class and the Singapore theme, however I have so many sections that the slide ticker bar at the top runs off the edge of the page. Is there a way to make a second row of section names in the header, or alternatively insert a line break into the section names? I have tried following the advice here: using \textit in \section{} with beamer class to try and get formatting in the section to no avail, and here How to put a line- break in section heading? but it doesn't seem to work with beamer. Minimum working example:               \documentclass[compres]{beamer}     \documentclass[compres]{beamer}     \usetheme{Singapore}          \begin{document}          \section{Bijection to nondeterministic metric space}     \subsection{}     \begin{frame}{}     \end{frame}          \section{Introduction to Langevin diffusion}     \subsection{}     \begin{frame}{}     \end{frame}          \section{Twice differentiable complexity classes}     \subsection{}     \begin{frame}{}     \end{frame}          \section{Applications in 4D}     \subsection{}     \begin{frame}{}     \end{frame}          \section{Conclusions}     \subsection{}     \begin{frame}{}     \end{frame}          \end{document}      In this example, line breaking the section headings would allow the problem to be fixed.


title: How to globally left align the text of paragraphs containing variable-length headers with the first line of the paragraph?

text: I have several `paragraph`s each with unique headers of differing lengths:               \documentclass[12pt]{article}          \begin{document}          \subsection{Subsection 1}          \paragraph{Title}     Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here.          \subsection{Subsection 2}          \paragraph{Long Title}     Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here.          \paragraph{Long Long Title}     Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here. Paragraph text here.          \end{document}      I'm looking for a global setting which will variably format each paragraph's text such as (disregarding the '...'): > **Subsection 1** > > **Title** Paragraph text here. Paragraph text here. Paragraph text here. > Paragraph text here. ........Paragraph text here. Paragraph text here. > Paragraph text here. Paragraph text here. > > **Subsection 2** > > **Long Title** Paragraph text here. Paragraph text here. Paragraph text > here. Paragraph text .................here. Paragraph text here. Paragraph > text here. Paragraph text here. Paragraph .................text here. > > **Long Long Title** Paragraph text here. Paragraph text here. Paragraph text > here. Paragraph ..........................text here. Paragraph text here. > Paragraph text here. Paragraph text here. > ..........................Paragraph text here. I'm sure there's a `enumitem` solution, however I want to stick with using `paragraph`s and stay away from `enumitem` workarounds. I believe some usage of `\hangindent` and/or `\hangafter` might work, but I'm not sure how to do so.


title: Creating picture using LaTeX

text: I want to create picture on the following link. How can I create this picture using LaTeX? I have tried different things but nothing works. ![enter image description here](http://i.stack.imgur.com/ttH71.png) Reference: p.510 of http://www.pearsonschoolsandfecolleges.co.uk/Secondary/Mathematics/14-16/EdexcelGCSEMathematics/Samples/StudentBooksamples/SamplepagesfromLinearHigherStudentBook.pdf


title: How to improve color consistency of bitmap pictures from native format to target pdf file?

text: For the first time I am concerned about proper rendition of pictures for the draft of a document with artistic content. I use the basic macro below to embed the pictures. The pictures are in .jpg format and have embedded ICC profiles. Once in the target pdf, the pictures are noticeably darker than viewed natively. I have made various experiments to identify the source of the problem, and came to the conclusion that:   * native pictures are seen consistently regardless of the software used (Several navigators, Gimp, preview, etc)   * the target pdf is also viewed consistently when viewed from various pdf viewers, navigators, etc. I wonder what can create this situation. Would a conversion of all pictures into an alternate format prior to compilation help? If yes, which one?              \newcommand{\SinglePicture}[3]{%       \begin{figure}[#1]     \centering       \includegraphics[width=\textwidth]{#2}\caption*{#3}       \end{figure}     }


title: Exsheets does not work with unicode-math package

text: Here is the code:               \documentclass{article}     \usepackage[vmargin=1in]{geometry}     \usepackage{xfrac,fontspec,unicode-math}     \setmathfont[version=lm]{Latin Modern Math}     \setmathfont[version=cambria]{Cambria Math}     \usepackage{xgreek}     \usepackage{exsheets}     \begin{document}          \setmainfont{Latin Modern Roman}     \mathversion{lm}     \section*{Latin Modern}     There follows a question     \begin{question}     This is the first question     \end{question}\\     \begin{question}[name=Problem]     This is the second question     \end{question}               \setmainfont{Cambria}     \mathversion{cambria}     \section*{Cambria, Cambria Math}     There follows a question      \begin{question}     This is the first question     \end{question}\\     \begin{question}[name=Problem]     This is the second question     \end{question}     \end{document}      and the output is ![enter image description here](http://i.stack.imgur.com/Oogcj.png) Does anybody has a solution? *Exsheets works fine with xelatex if unicode-math is not in the preamble


title: How can I center multiline text in the horizontal remainder of a page?

text: I'd like to produce a bunch of pages in the 'minicard' format (2.75 by 1.1), with a 1-inch qr code taking up one side of the thing, and centered multiline text on the other side. ![](http://zpmorgan.github.com/card-table-wanted.png) Unfortunately, I don't have a handle on vertical centering. My current approach uses the 'm' column type, which supposedly centers text vertically, but that isn't happening: ![](http://zpmorgan.github.com/card-table.png)               \documentclass{article}          \usepackage{graphicx}     \usepackage{array}     \usepackage[margin=.05in,papersize={2.75in,1.1in}]{geometry}     \begin{document}          \renewcommand\arraystretch{0}     \renewcommand\tabcolsep{0pt}          \begin{table}     \begin{tabular}{p{1in} | >{\centering\arraybackslash}m{1.65in} |}     \hline     \includegraphics[width=1in,height=1in]{600px-QR_code_Wikimedia_Commons_(URL).png}      & unique key a      \\ \hline     \end{tabular}     \end{table}          \end{document}      A solution would be wonderful, but I'd settle for an explanation. Should I even be using a table?


title: Headlines in Beamer

text: In Beamer presentation on one page I would like to get rid of headline. I would prefer to leave the background but get rid of the names of sections and subsections. How is it possible to do this?               \setbeamertemplate{headline}     {%       \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}       \end{beamercolorbox}       \begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%           leftskip=.3cm,rightskip=.3cm plus1fil]{top}         \vskip2pt\insertsectionnavigationhorizontal{\paperwidth}{}{}       \end{beamercolorbox}%       \ifbeamer@theme@subsection%         \begin{beamercolorbox}[colsep=1.5pt]{middle separation line head}         \end{beamercolorbox}         \begin{beamercolorbox}[ht=1.7ex,dp=1.125ex,%           leftskip=.3cm,rightskip=.3cm plus1fil]{bottom}           \usebeamerfont{subsection in head/foot}\insertsubsectionhead         \end{beamercolorbox}%       \fi%       \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}       \end{beamercolorbox}     } \mode <all>


title: Font scaling in mixed-font writing

text: How can I scale up/down the size of a font so that it looks coherent when mixed with other fonts on the same line? As a concrete example, how can the first 'a' in the following snippet be scaled down to the size of the second and third? ![a-character-in-different-sizes](http://i.stack.imgur.com/4jlD4.png)               \documentclass[12pt]{article}     \pagestyle{empty}          \newcommand\pagmsl{\usefont{\encodingdefault}{pag}{m}{sl}}     \newcommand\pbklit{\usefont{\encodingdefault}{pbk}{l}{it}}     \newcommand\bchmit{\usefont{\encodingdefault}{bch}{m}{it}}          \begin{document}          \pagmsl a     \pbklit a     \bchmit  a          \end{document}


title: Continuance of environment

text: I am using an continuous example in my text, but I don't know how to do define the corresponding nice environment. I am using the amsmath and ntheorem package and defined my own example- environment:               \newtheorem{theorem}{Theorem}[chapter]     \newtheorem{example}[theorem]{Example}      I am using the following documentclass:               \documentclass[11pt,a4paper,twoside,openright]{book}      What I would like is a possibility to continue the example maybe like this               \begin{example} \label{ex1}      This is an example.     \end{example}          Some text stands here. And then there is some space between this and the continued example.      Further should the continued example not be intended but start at the beginning of the line.          \begin{continuance}[\ref{ex1}]     This is the continued example.     \end{continuance}          Some more text, which should follow after a little vertical space.      With the result: Example 1.1 _This is an example._ Some text stands here. And then there is some space between this and the continued example. Further should the continued example not be intended but start at the beginning of the line. Continuance of Example 1.1 _This is the continued example._ Some more text, which should follow after a little vertical space. How can I define this continuance-environment? Edit: The problem now is that it looks like this Example 1.1 _This is an example._ Some text stands here. And then there is some space between this and the continued example. Further should the continued example not be intended but start at the beginning of the line.   [Here is an indention] Continuance of Example 1.1 _This is the continued example._   Some more text, which should follow after a little vertical space.


title: Apparent altering of Tex Live Utility's "umask"

text: Yesterday, I installed the TeX Live Utility update to version 1.15. After downloading and installing and relaunching TeX Live Utility, I got the following message: > **You have altered the system's umask** > > The normal umask is 022 and yours is set to 022. This more restrictive umask > may cause permission problems with TeX Live. I have three questions:   1. What exactly is a `umask`?   2. Should I be concerned about this message? (I've never done anything, as far as I'm aware, to alter the `umask`, so I'm not sure why I'm getting this message to begin with.)   3. And, finally, as far as I can tell "022" is the exact same as "022", so does anyone have any idea _why_ I might be getting this message?


title: Geometry settings for default document layout?

text: How can I obtain the corresponding settings for the `geometry` package so that the document looks just like the standard `article` or `report`? Assume that I have a document in the default style, and I would like to modify only _some_ of the layout options; for example, I might want to change the `headheight` and leave everything else the same. Try for example the following two option settings for `geometry`, the first of which shows the default layout, and then how everything changes even if I _just_ wanted to change one of the settings.               \documentclass{article}     \usepackage[showframe,pass]{geometry}     %\usepackage[showframe,headheight=1.5cm]{geometry}     \begin{document}     Hello World     \end{document}      There is a related question (from which I learned about the `pass` option), but note that the following               \usepackage[showframe,pass,headheight=1.5cm]{geometry}      doesn’t work.


title: Structuring a collection of patches for various classes and packages

text: I develop a package whose main part consists of fixes and patches to other document classes and packages. Naturally, I only want to apply a patch if the class or package in question has been loaded. Furthermore, there can be patches that apply to several classes/packages, and there can be patches that apply to a class/package _only_ if some other class/package has not been loaded (for example, `hyperref` modifies many things in the standard classes, and if I were to modify them too, I would have to use two versions, depending on if `hyperref` has been loaded). Since I don't want to force any particular loading order, I also want to run the package detection/patching part AtBeginDocument. One thing that comes to mind is to extend the `\@ifclassloaded` and `\@ifpackageloaded` commands to accept a comma-separated list of names using `\@for`. Then I would say               \PatchClassIfLoaded{article,report,book}{<commands>}      and so on. But then `<commands>` have to be inside an argument and will be "read" twice (pardon my insufficient TeX knowledge to describe it better), which I don't like. While this would be necessary for package patches because of `\AtBeginDocument`, this is not required for classes. I would better like a construct such as               \IfClassLoaded{article,report,book}       <commands>     \fi      I know I can program it if I go one level lower than `\@ifclassloaded`. But this feels more like a hack which shouldn't be relied on. The above was just an example of what I'm trying to achieve. The question itself is broader: Are there different solutions to the problem? Is there a package implementing similar things? What methods do packages like `hyperref` and `caption` use to accommodate for a large variety of classes and packages?


title: Unknow option `ngerman' babel

text: I'm using LaTeXila on Fedora 19. I switched from MikTeX on Windows to that and I want to work with the files I created there. But every time I compile my `.tex` it gives me the error               Package babel Error: Unknow option `ngerman'. Either you misspelled it     or the language definition file ngerman.ldf was not found.      I included the language like this               \usepackage[ngerman]{babel}      Any help is appreciated. EDIT: I got it myself! I just had to reinstall TeXLive and it worked


title: make numname and enumitem work together

text: `numname` is a package that allows you to write out (e.g.) chapter titles in words. It's basically some code taken out of `memoir.cls` apparently. There appears to be something wrong with the code, however. I tried to make an option to have `enumerate`'s with word labels like so:               \documentclass{article}     \usepackage{enumitem}          \usepackage{numname}     \makeatletter     \newcommand*{\nthwords}[1]{%       \expandafter\@nthwords\csname c@#1\endcsname}     \newcommand*{\@nthwords}[1]{%       \ordinaltoName{#1}}     \AddEnumerateCounter{\nthwords}{\@nthwords}{eleven}          \makeatother          \newcounter{tctr}     \setcounter{tctr}{12}          \begin{document}     \nthwords{tctr}          % \begin{enumerate}[label=\nthwords*]     % \item Boo     % \item Far     % \item Faz\label{fz}     % \end{enumerate}     % \ref{fz}          \end{document}      This works fine, but uncommenting out the enumerate environment makes it complain about an "`incomplete \iffalse`" at the line with the first `\item`. Now, commenting out `\usepackage{numname}` and changing the documentclass to `memoir` fixes things. So _something_ has gone wrong. Any clues as to what that might be? Or should I email the author of numname? [I ask because I know we have some `memoir` experts who might be able to spot the problem...]


title: How can I test if a document is being compiled by XeLaTeX?

text: Is there a way to programatically test whether the current document is being compiled by (pdf)LaTeX or XeLaTeX?


title: Clipping a formula to make a nice compliment

text: I just found a nice cartoon and wonder if this is possible with LaTeX as well. If you draw "128 \sqrt{e 980}" on the blackboard (sqrt written with the root character) and erase the approximately upper half, you get "I love you". ![enter image description here](http://i.stack.imgur.com/qD0QX.jpg) Has anyone a nice suggestion how to clip the text from the following document?               \documentclass[12pt]{article}     \usepackage{amsmath}     \begin{document}          {\large \[ 128 \sqrt{\text{e}980}\]}          \end{document}


title: xskak and xelatex

text: \documentclass{article}          \usepackage{xltxtra}     \usepackage{skak}          \setmainfont{Arial}     \setmonofont{Courier New}          \usepackage{polyglossia}     \setmainlanguage{english}          \catcode"2654=\active     \catcode"2655=\active     \catcode"2656=\active     \catcode"2657=\active     \catcode"2658=\active     \catcode"2659=\active          \def\K{\fontspec{FigurineCB AriesSP}\char"00A2}          \let♔\K     \let♕\symqueen     \let♖\symrook     \let♗\symbishop     \let♘\symknight     \let♙\sympawn          \begin{document}               ♔♕♖♗♘♙          ♔♕♖♗♘♙          \end{document}      Why does `xskak` produce an incompatibility error when using XeLaTeX?               Error: `\Finv already defined \{mathord}{AMSb}{"60}'         `skak` works fine.


title: listings font in pdflatex

text: I'm using `\ttfamily` but it renders listing with the Times New Roman. What am I doing wrong? I'm getting a warning message: > Font shape `T2A/fi4/bx/n' undefined(Font) using`T2A/fi4/m/n' instead on > input line 322. Font shape `T2A/fi4/bx/n' undefined(Font) using`T2A/fi4/m/n' > instead`.               \lstset{         commentstyle = \color{gray},         extendedchars=\true,         basicstyle=\footnotesize\ttfamily,         columns=fixed,         inputencoding=utf8x,         language = php,         keepspaces=true,         keywordstyle = \bfseries,         morekeywords={function, return, new}     }


title: How to turn on the PDFTexify option?

text: I have read through the manual as best I can. But I can't find where you enable or turn on the PDFTexify. I put in some sample text. Then I hit enter to try and "run" the text that I typed. So, then I read the manual again it said to hit "PDFTexify." Okay, I went to Tex and scrolled down to PDF. When I scrolled over to PDFTexify the option is greyed out. So, am I trying to read where it tells you how to "turn on" the PDFTexify option. If you are patient enough please respond back with how to get that option to work.


title: \hspace is not working after \newline command

text: I am currently working on my thesis report and would like to add affirmation to it. Following is the minimal code for the same :               \documentclass[]{article}     \begin{document}     \section*{Affirmation}     \addcontentsline{toc}{section}{Affirmation}     \hspace{1cm}something     \vspace{2cm}     \hspace{1cm}city, date \hspace{3cm}\line(1,0){200}     \newline     \hspace{8cm}(name)     \clearpage     \end{document}      It produces the following output![The output image](http://i.stack.imgur.com/ug1bu.jpg) As it can be seen, the (name) should come below the line, But due to some reason the `\hspace` before (name) isn't working. Any help would in this regards would be really appreciated.


title: Springer Latex Macro Package

text: Just downloaded the Springer latex macro package to prepare manuscript for submission. What do I do next in terms: 1. Getting it started and working 2. If I could use Jabref here since it has a different .bst file? 3. I tried running the example tex file but it said error, what must I do to correct it.


title: How to label arrows in this commuting cube?

text: I would like to draw a commuting cube, where all the edges are also labeled. Below is my cube but I don't know how to do this, as the `stackrel` doesnt seem to work.               \documentclass[12pt]{article}     \usepackage{graphicx}     \usepackage[margin= 1.1 in]{geometry}     \usepackage{natbib}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{tikz}     \usetikzlibrary{matrix}     \tikzset{node distance=2cm, auto}          \title{Essays}     \begin{document}          \begin{tikzpicture}[     back line/.style={densely dotted},     cross line/.style={preaction={draw=white, -,     line width=6pt}}]     \matrix (m) [matrix of math nodes,     row sep=3em, column sep=3em,     text height=1.5ex,     text depth=0.25ex]{     & S\left(a,b\right) & & S'\left(a,b\right) \\     S\left(a',b\right) & & S'\left(a',b\right)  \\     & S\left(a,b'\right) & & S'\left(a,b'\right) \\     S\left(a',b'\right)  & & S'\left(a',b'\right) \\     };     \path[->]     (m-1-2) edge (m-1-4)     edge (m-2-1)     edge [back line] (m-3-2)     (m-1-4) edge (m-3-4)     edge (m-2-3)     (m-2-1) edge [cross line] (m-2-3)     edge (m-4-1)     (m-3-2) edge [back line] (m-3-4)     edge [back line] (m-4-1)     (m-4-1) edge (m-4-3)     (m-3-4) edge (m-4-3)     (m-2-3) edge [cross line] (m-4-3);     \end{tikzpicture}          \end{document}


title: Smooth curve through points with pgfplots

text: I know that one can get smooth point connections with option `smooth` to `\addplot` that takes the previous and the next point into account, but this still _connects_ all the points. How can I draw a smooth curve through the points using `pgfplots` that are _not necessarily_ connected? I'm not fully sure if this is correct, but I think I'm looking for "bezier curves" (correct me if wrong). To be clear: I do _not_ want curve-fitting like one can do with `gnuplot`, just some "sloppy- smooth" connecting of points. Example picture (not from my data!): ![enter image description here](http://i.stack.imgur.com/AiYj2.jpg) Here is my real data, they don't follow a known, analytical, mathematical function:               43  3.22     44  3.26     45  3.28     46  3.40     47  3.60     48  3.53     49  3.50     50  3.60     51  3.59     52  3.54     53  3.55     54  3.51     55  3.35     56  3.45     57  3.42     58  3.43     59  3.42     60  3.42     61  3.43     62  3.47     63  3.45     64  3.40     65  3.20     66  3.21     67  3.17     68  3.20     69  3.22     70  3.36     71  3.37     72  3.37     73  3.30     74  3.33     75  3.39     76  3.41     77  3.34     78  3.45     79  3.42     80  3.38     81  3.33     82  3.15     83  3.35     84  3.33     85  3.20     86  3.24     87  3.20


title: Why/When should I pay attention to warnings?

text: I often see warnings in the compilation-log of my tex-files. I searched in the internet and did not find a good answer to this question. And in my opinion there must be a reason why tex warns me about something. So, why should I pay attention to warnings? And when there are warnings, of which of them should I pay more or less attention? I hope this question is not to unspecific, but it teases me since some weeks.


title: Process Last Item in \ForEach (forarray package)

text: The following command of the **forarray** package               \ForEach{,}{\thislevelitem(\the\thislevelcount) : }}{x,y,z}      produces the output               x(1) : y(2) : z(3) :      I want to have the same output without the last ":". The **forarray** package does not provide any command like `\maxount` to test if `\thislevelcount == \maxcount`. Surly I could test for the first item `\thislevelcount == 0` but what to do if this cannot be done for some reason? How can I process the last item separately if the number of items is variable/unknown?


title: How to put data labels next to the text labels in a bar plot?

text: I am trying to reproduce using PGFPlots the bottom-most graph found in this link: ![enter image description here](http://i.stack.imgur.com/n6yHu.jpg) The following is my best attempt:               \documentclass{standalone}          \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[         ytick={1,...,5},         yticklabels={Barnes-Jewish,UCLA,UC San Francisco,John Hopkins,UCNI},         xbar,         title=Number of Verifications in 14 Specialty Areas of Neurological Care,         nodes near coords, nodes near coords align={horizontal}]            \addplot coordinates {         (13,5)         (10,4)         (9,3)         (9,2)         (2,1)       };     \end{axis}     \end{tikzpicture}     \end{document}      And the output is ![output of code](http://i.stack.imgur.com/c9cv5.png) The key difference which I am concerned about in this question is that the data labels are near the end of the bars in my graph, and are next to the text labels in the link. How do I put the data labels next to the text labels?


title: isov2 document class and definition list

text: I am currently using the **isov2** document class. I would like to create a list of definitions. I currently have the following output (style) ![Current Definitions List Formatting](http://i.stack.imgur.com/KP3h3.png) using the code:               \begin{definitions}     \definition{agent}{Device that provides data in a manager-agent communicating system.}     \end{definitions}      However, I'd like instead for the term and definition to be on one line, separated by a colon, similar to the image below: ![Ideal Definitions List Formatting](http://i.stack.imgur.com/BzDDX.png)


title: position a label closer to a particular box in a flow chart in tikz

text: I need to position the label `No` closer to the box `check if flag set`. What option should I use.               \documentclass{sig-alternate}     \usepackage{tikz}     \usetikzlibrary{shapes.geometric, arrows}     \tikzstyle{process} = [rectangle, minimum width=2cm, minimum height=1cm, text centered, text width=2cm, draw=black]     \tikzstyle{connector} = [circle, minimum width=1cm, minimum height=0.5cm, text centered, text width=1cm, draw=black]     \tikzstyle{arrow} = [thick,->,>=stealth]     \begin{document}     \begin{tikzpicture}     \node (p0) [] {foo(K)};     \node (p1) [process, below of=p0, text width=3cm] {search for key K};     \node (p2) [process, below of=p1, yshift=-1cm, text width=3.5cm] {Create key K for insertion};     \node (p3) [process, below of=p2, yshift=-1cm, text width=3.5cm] {Attempt to insert};     \node (retF) [process, right of=p1, xshift=3cm, text width=1cm, minimum width=1cm] {return false};     \node (p4) [process, below of=p3, yshift=-1cm, text width=3cm] {check if flag set};     \node (retT) [process, right of=p3, xshift=3cm, text width=1cm, minimum width=1cm] {return true};     \node (h1) [connector, below of=p4, yshift=-1cm] {bar()};                    \draw [arrow] (p1) -- node[anchor=west] {K not found} (p2);     \draw [arrow] (p1) -- node[anchor=south] {K found} (retF);     \draw [arrow] (p2) -- node {} (p3);     \draw [arrow] (p3) -- node[anchor=east] {failed} (p4);     \draw [arrow] (p3) -- node[anchor=south] {successful} (retT);     \draw [arrow] (p4) -- node[anchor=west] {Yes} (h1);     \draw [arrow] (p4.west) -- ++(-1,0) |- node[anchor=south] {No} (p1.west);     \draw [arrow] (h1.west) -- ++(-2.5,0) |- node[anchor=south] {} (p1.west);     \end{tikzpicture}     \end{document}      ![output](http://i.stack.imgur.com/y6dRY.png)


title: Suggestions to a better preamble for creating a handbook

text: The following is the preamble I was given to work with to create a student handbook. I believe there are a few things that are not right. The document compiles well but I am looking for suggestions of improvement.               \documentclass[11pt,twoside]{report}          \usepackage[text={6in,7.25in},centering,papersize={7in,8.5in},top=0.5in]{geometry}     \usepackage{newpxtext,newpxmath}     \usepackage{lipsum}          \setlength{\oddsidemargin}{-0.75in}     \setlength{\evensidemargin}{-0.4in}          \setlength{\parindent}{0pt}          \begin{document}             \lipsum     \end{document}      ![enter image description here](http://i.stack.imgur.com/AMXid.png) First of all, why the `report` class? Is it the best? And well with the geometry, they are trying to maximize the use of the paper size indicated (This, I suppose, remains unchanged.) Of course there is also the `oddsidemargin` and `evensidemargin` issue. Note that I have removed all unnecessary packages and text just to focus on the geometry, class and implementation. PS: I am not good with the topic of geometry and how its best implemented.


title: Beamer: Media 9 with overlay

text: I've used `\includemedia` to insert an animation (.swf file) in my slides. It works. Besides the animation, I also want to include three bullet items that show up one after one, which are done by `\item<1->`, `\item<2->`, `\item<3->`. I want the animation to keep running during all three items. The problem is, the animation needs to be either reloaded (if set `activate=pageopen`, which takes time to reload) or click (if set `activate=onclick`, which I prefer). Below is my MWE. Is there a better solution?               \documentclass[10pt]{beamer}     \usepackage{media9}          \begin{document}     \begin{frame}          \begin{figure}[ht]     \includemedia[width=5cm,height=2.5cm,activate=onclick,deactivate=pageclose]         {\colorbox{white}{click}}{test.swf}     \end{figure}          \begin{itemize}     \item<1-> \textbf{\texttt{One}}     \item<2-> \textbf{\texttt{Two}}     \item<3-> \textbf{\texttt{Three}}     \end{itemize}          \end{frame}     \end{document}


title: Removing the "chapter" title for one chapter only

text: How can I remove the "chapter" title for one chapter only? E.g. if I want to remove the "chapter" title for chapter 2 only, using               \documentclass{report}          \begin{document}          \chapter{Hello}     \chapter{World}     \chapter{!}          \end{document}      I get: ![enter image description here](http://i.stack.imgur.com/vtxDv.png) I would like to obtain instead: ![enter image description here](http://i.stack.imgur.com/Yrx9F.png)


title: Is there such a thing as a `\mathrule`? (rounded endcaps)

text: When I am creating hybrid math glyphs, I will find myself often times stacking `\rule`s about the place. But if you look at a collection of CM math symbols (top row), and compare it to a `\rule` (2nd row)               \documentclass{article}     \begin{document}     \noindent$+ - = \subset \geq \ni$\\$\rule{2ex}{.3pt}$     \end{document}      ![enter image description here](http://i.stack.imgur.com/hZJ4C.jpg) you will find that strokes comprising the math glyphs exhibit rounded ends, whereas a `rule` has flattened ends. At typical size, the difference may be insignificant, but for scaled-up glyphs, it is noticeable. Is there a version of a `\rule`, which I jokingly here called `\mathrule`, that will provide the functionality (even the syntax) of a `\rule`, but with rounded endcaps? (preferably not with `tikz`, but something more native). I've considered stretching and squeezing, for example, a minus sign, but that will result in spherical end caps becoming elliptical, especially when the distortion is large. * * * I was going to put this attempt up to get the ball rolling, but Herbert beat me to it. I'll still leave it here as food for thought.               \documentclass{article}     \usepackage{scalerel}     \usepackage{verbatimbox}     \newsavebox\clippedbullet     \sbox{\clippedbullet}{\addvbuffer[.0pt -.55pt]{$\bullet$}}     \def\CB{\usebox{\clippedbullet}}     \newcommand\mathrule[3][0pt]{%     \raisebox{#1}{\scaleleftright{\kern-.8pt\CB\kern-2.5pt}%       {\rule{#2-#3}{#3}}{\kern-2.4pt\CB\kern+.0pt}}%     }     \begin{document}     \noindent\mathrule[2pt]{2ex}{.5pt} \mathrule{3ex}{1pt} \mathrule[-1pt]{2ex}{2pt}\\     \rule[2pt]{2ex}{.5pt} \rule{3ex}{1pt} \rule[-1pt]{2ex}{2pt}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Uh1ww.jpg)


title: Library for generating bibtex entries

text: Is there a library that can help turn user inputs for various fields into a proper bibtex entry that can be put into `.bib` file?


title: Change font also on axes in pgfplots

text: I need to change the font from the standard cnr to Times. I tried `\usepackage{times}` but that did not change the font of the tick mark numbers on the axes. I pasted the code and an image of the output below. As is seen in the image, the digits on the axes are still formatted to `cnr`, although the rest of the graph is formatted to `Times`. How can I get the digits on the axes tick marks to be formatted to `Times`?               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}     \pgfplotsset{compat=1.3, width=70mm, height=60mm} %use to get tight spacing of labels to tickmarks. Not enabled by default because it affects the spacing.     \usepackage[tightpage,active]{preview}     \usepackage{times}     \begin{document}     \begin{preview}     \begin{tikzpicture}     \pgfplotsset{every axis legend/.append style={     font={\tiny}}}     \begin{semilogyaxis}[     legend pos = north east,     unbounded coords=jump,     xmin=-50,     xmax=1000,     ymin=1e-5,     ymax=1e-1,     minor x tick num = {2},     tick style={color=black},     xtick={0, 300, 600, 900},     ytick={1e-2, 1e-3, 1e-4},     every tick/.append style={thin,black},     xlabel=xlabel (times),     ylabel=ylabel (times),     after end axis/.append code={                    \draw[black,dotted] (axis cs:200,1e-5) -- (axis cs:200,1e-1);                    \node [rotate=90,anchor=north west] at (axis cs:200, 1e-5) {\tiny{side one (times)}};                    \node [rotate=90,anchor=south west] at (axis cs:200, 1e-5) {\tiny{side two (times)}};                  }]     \addplot+[mark=nothing,     thin,     solid,     black     ]     coordinates {(0, 5e-3) (500, 6e-2) (900, 9e-4)};     \addplot+[mark=nothing,     thin,     dashed,     black     ]     coordinates {(0, 1e-3) (300, 1e-2) (1000, 3e-4)};     \end{semilogyaxis}     \end{tikzpicture}     \end{preview}     \end{document}      ![enter image description here](http://i.stack.imgur.com/1Me3l.png)


title: Sharing alignment between equations in two different items

text: In the following minimal example, I have two equations inside an `itemize` environment, with an `item` per equations. Each equation is defined in its own `equation` environment.               \documentclass{article}     \usepackage{amstext}          \begin{document}          \begin{itemize}      \item Lorem ipsum dolor sit amet, consectetur adipiscing elit:           \begin{equation}         f(x) = \left\{         \begin{array}{l l}           1 & \text{ nisl justo, hendrerit} \\           0 & \text{ sagittis condimentum}\\         \end{array} \right.      \end{equation}           \item Duis magna nunc, ultrices at fringilla non, feugiat sed massa:           \begin{equation}         g(x) = \left\{         \begin{array}{l l}           -1 & \text{ fermentum fringilla mauris eget} \\           0 & \text{ gravida ipsum vitae}\\         \end{array} \right.      \end{equation}     \end{itemize}          \end{document}      However, each equation has its own alignment, giving the following result: ![Result of minimal example](http://i.stack.imgur.com/eKKfM.png) It would be nice (I think) if both equations could be aligned in the same way, something like this: ![Equations aligned](http://i.stack.imgur.com/wgONi.png) Is this possible? _Note: it would be nice if the solution could be also applied to equations in different paragraphs._ * * * **UPDATE:** Ryan presented a very nice solution, which is currently the most upvoted, but it does not work quite well:               \documentclass{article}     \usepackage{amsmath}     \begin{document}      This is a list.      \begin{itemize}        \item First item.       \begin{align*}       f(x) &= \begin{cases} 0 & \text{now} \\ 1 & \text{then} \end{cases}       \intertext{\item Second item.}       g(x) &= \begin{cases} 0 & \text{here and there}  \\ -1 & \text{to and fro} \end{cases}       \end{align*}      \end{itemize}      After the list.     \end{document}      ![Ryan's result](http://i.stack.imgur.com/zqUkr.png) Can you see? "now" and "then" are not aligned to "here and there" and "to and fro". Can we solve this? :)


title: How to test if a given reference belongs to a list of labels?

text: This question is a prolongation of my previous question How to choose from a list for using result in \ref?. I got really good and interesting answers. Unfortunately I can not implement them for my final task. Let us consider few objects, say equations, which are labeled with `\label`,               \begin{equation}     2+2=4 \label{aaa}     \end{equation}          \begin{equation}     3+3=6 \label{bbb}     \end{equation}          ...............          \begin{equation}     22+22=44 \label{zzz}     \end{equation}      It may also be important that the command `\theequation` is redefined as               \renewcommand{\theequation}{eq.~\arabic{equation}}      In this case `\ref{aaa}` gives eq.~1, `\ref{bbb}` gives eq.~2 and so on. I need the command `\IfRefList` that check if a given reference is included in a certain reference list. In other words it should work as               \IfRefList{eq.~1}{aaa;bbb;ccc} --> true     \IfRefList{eq.~4}{aaa;bbb;ccc} --> false     \IfRefList{eq.~2}{aaa;ccc} --> false     \IfRefList{eq.~1}{bbb;aaa;ccc} --> true      The result I am going to use in `\ifthenelse`. The list can include an arbitrary number of items including 1. I have checked several possibilities with the solution of Heiko Oberdiek proposed in the referred above question. My attempts do not work. I would be very appreciate for your help.


title: longtable with large cell content possibly bigger than a page

text: I am modifying an existing C program which trawls through a database and creates a Latex document from the guff it finds. The majority of the data needs to be plopped into tables, so it uses the `longtable` environment to allow for page-spanning tables. There are now instances where the data to be added to a cell is _sooo_ large that `latex` pushes the cell off the bottom of the page, then recognises it can't fit the table on the page and tries on another page. This goes on and on, finishing up with `.dvi` and `.log` files which fill the `swap` space on the production server. This is not good, and I am getting a bit of flak to be honest! Obviously, the documents are created "on-the-fly" so, without a lot of fiddly stuff, it's not a simple thing of "Oh, here's where the text runs off the page. I need to add a pagebreak there, then". I understand there might be a way that the fontsize for data in a cell is scaled according to the content therein...? Is this part of longtable or is it something else lower-down in the bowels of the Latex machinery?


title: Beamer template problem: flushright frame subtitle causes spurious extra slide (or worse!)

text: So here is a MWE that illustrates the problem.               \documentclass{beamer}     \defbeamertemplate{frametitle}{weird}{%       \insertframetitle\par%       \rule{\textwidth}{4pt}%       \flushright%       \insertframesubtitle\par%     }     \setbeamertemplate{frametitle}[weird]     \begin{document}     \begin{frame}     \frametitle{Here is the title}     %\framesubtitle{Here is the subtitle}     Here is the text     \pause     Here is more text     \end{frame}     \end{document}      This code fails with a:               ! LaTeX Error: Something's wrong--perhaps a missing \item.      Commenting out the `\pause` or `\flushright` or uncommenting the `\framesubtitle` allows it to compile. [Commenting out the `\pause` leads to a spurious empty page at the end.] So my guess is that this is a "wrong mode" problem when the subtitle is empty. But I don't know enough to fix it. Any clues? Or any hints on what to try in order to fix it?


title: Wrapping column text using multicolumn and tabularx

text: I have two tables I am typesetting above each other as follows.               \documentclass[a4paper,11pt]{article}     \usepackage{tabularx}     \usepackage[left=2cm, right=2cm, bmargin=1.5cm]{geometry}          \begin{document}     \begin{tabularx}{\textwidth}{| X | X | l | l | l | l | l | l |}     \hline        & Cost Category & Year 1 & Year 2 & Year 3 & Year 4 & Year 5 & Total (Y1-5) \\     \hline     \noalign{\vspace{0.5cm}}     \hline     \multicolumn{7}{|l|}{Some text that goes on and on and on and on and on and on and on and on and on and on} & $100\%$\\     \hline     \end{tabularx}     \end{document}      How can I get the text in the bottom table to word wrap rather than push the column over the right hand edge of the page? Basically, I would like it to take on whatever size the top table has already set for the first 7 columns.


title: TeX Live manager 2011 database corruption?

text: TeX Live 2011, up to date, on Windows XP. Example:               \listfiles     \documentclass{article}     \usepackage{fontspec}     \begin{document}     A     \end{document}      LuaTeX first error:               LaTeX Warning: You have requested, on input line 20, version                `2011/09/05' of package expl3,                but only version                `2011/04/09 v2222 L3 Experimental code bundle wrapper'                is available.          (c:/Programme/texlive/2011/texmf-dist/tex/latex/l3packages/xparse/xparse.sty     ! Undefined control sequence.     <argument> \ExplFileName           l.57 ...e}{\ExplFileVersion}{\ExplFileDescription}      * * * Ok, but now it get's weird, this output is from console window:               U:\>tlmgr version     tlmgr revision 23514 (2011-08-12 23:36:21 +0200)     tlmgr using installation: C:/Programme/texlive/2011     TeX Live (http://tug.org/texlive) version 2011               U:\>tlmgr remove expl3.sty     expl3.sty: package not present, cannot remove     tlmgr: no packages removed.          U:\>kpsewhich expl3.sty     c:/Programme/texlive/2011/texmf-dist/tex/latex/expl3/expl3.sty      So TeX Live 2011 is not aware of the fact that the to-be-deleted package still exists. As far as I know, the package and many others have been replaced, see here: http://comments.gmane.org/gmane.comp.tex.latex.latex3/2619 Any ideas?


title: \stepcounter increments by two, when used with listings

text: Users, my counter usually gets incremented by 1, when I use `\stepcounter{mycounter}` But surprisingly, it gets incremented by 2, when I use it together with listings:               \lstinputlisting[         title={\stepcounter{mycounter}\arabic{mycounter},         firstline=1, lastline=10, firstnumber=1     ]{mytextfile.txt}      What's wrong about that?   And how can I achieve the counter to be incremented by one?


title: row colour in tabular environment extending to width of page

text: Hi I have the following tabular environment:               \documentclass[12pt]{article}     \usepackage{booktabs}     \usepackage{setspace}     \onehalfspacing     \usepackage[english]{babel}     \usepackage{grffile}     \usepackage{fancyhdr}     \usepackage{epsfig}     \usepackage[options]{algorithm2e}     \usepackage{filecontents}% http://ctan.org/pkg/filecontents     \usepackage{listings}% http://ctan.org/pkg/listings     \usepackage{hyperref}     \pagenumbering{arabic}     \newcounter{qcounter}     \let\centering\relax     \usepackage{color, colortbl}     \definecolor{name}{system}{definition}     \definecolor{Gray}{gray}{0.9}     \definecolor{LightCyan}{rgb}{0.88,1,1}     \usepackage{caption}     \usepackage{tikz}     \usepackage{babel}     \usepackage{graphicx}     \usepackage{csquotes}     \usepackage{fancybox}     \MakeOuterQuote{"}     \usepackage[utf8]{inputenc}     \usepackage{amsmath, amsthm, amssymb}          \begin{document}          \begin{table}[H]     \begin{tabular}{l|l}     & Landmarks in the Human Genome Project \\     \hline     \rowcolor{LightCyan}     1953& Watson-Crick publish DNA structure \\     1975& F.Sanger, A.Maxam and W.Gilbert develop methods for sequencing DNA \\     \rowcolor{LightCyan}     1977& Bacteriophage $\Phi X -174$ sequenced: first complete genome sequenced \\     1980& US Supreme court rules genetically modified bacteria are pantentable \\     \rowcolor{LightCyan}     1981& Human mitochondrial DNA sequenced: $16569$ base pairs \\     1984& Epstein-Barr virus genome sequenced: 172,281 base pairs\\     \rowcolor{LightCyan}     1990& International Human Genome Project launched \\     1991& J. Craig Venter identifies sequences of DNA complementary to messenger RNA \\     \rowcolor{LightCyan}     1992& Complete low resolution linkage map of the human genome \\     1992& \textit{Caenorhabditis} sequencing project begins \\     \rowcolor{LightCyan}     1992& J. Craig Venter forms the Institute for Genome Research (TIGR) \\     1992& Wellcome Trust and UK Medical Research Council establish The Sanger Center for large-scale genomic sequencing  & & & & & &\\     \rowcolor{LightCyan}     1995& First complete sequence of bacterial genome, \textit{Haemophilus influenzae} by TIGR \\     1996& High resolution map of human genome\\     \rowcolor{LightCyan}     1996& Completion of yeast genome, first eukaryotic genome sequence \\     1996& Celera claims to finish sequencing human genome by 2001, Wellcome Trust respond by increasing funding to the Sanger Center\\     \rowcolor{LightCyan}     1998& \textit{Caenorhabdtis elegans} genome published  \\     1998& \textit{Drosophila melanogaster} genome published  \\     \rowcolor{LightCyan}     1999& Human Genome project says it will sequence human genome with 2 years \\     1999& Sequence of first human chromosome published \\     \rowcolor{LightCyan}     2001& Joint announcement of complete sequence of human genome\\     \hline     \end{tabular}     \end{table}          \end{document}      however, the row colour (in this case defined as light cyan) does not seemed to be constrained by the width of the table - it caries on past the margin. Is there something I am not taking into account here? Obviously this isn't something I would normally notice given that most tables I create are white background, but adding in the colour for certain rows has made me realise the background colour isn't constrained to the table environment.


title: scrartcl: Remove page number on title page

text: I'm writing the abstract for my bachelor thesis. Therefore I use LaTeX. Now I have the structure of my document, but it always prints me a page number on the page. It is only one page and instead of my title (abstract) und my abstract text there should be anything on the page. The command `\pagestyle{empty}` should remove all header & footer, but it doesn't work Here's my Script:               \documentclass[a4paper,12pt,headsepline,smallheadings]{scrartcl}          \usepackage[ngerman]{babel}     \usepackage[applemac]{inputenc}          \typearea{12}     \pagestyle{empty}          \title{Abstract}     \author{}     \date{}          \begin{document}          \maketitle          ...TEXT...          \end{document}


title: Installing SVJour on OSX / Mactex

text: I've to install the SVJour3 class. In the readme it says "Copy svjour3.cls and svglov3.clo to a place where LaTeX can find them." Where is this place on a Mac where I installed MacTex 2011 ?