title: Receiving the message error "{" immediately follows a field part---line"

text: I use bibtex and my bib file looks like               @article{Bohm,       title = {Discussion of Experimental Proof for the Paradox of Einstein, Rosen, and Podolsky},       author = {Bohm, D. and Aharonov, Y.},       journal = {Phys. Rev.},       volume = {108},       issue = {4},       pages = {1070--1076},       year = {1957},       month = {Nov},       doi = {10.1103/PhysRev.108.1070},       note = {\url{http://link.aps.org/doi/10.1103/PhysRev.108.1070}},       publisher = {American Physical Society}     }          @article{Cerf,       title = {Simulating Maximal Quantum Entanglement without Communication},       author = {Cerf, N. J. and Gisin, N. and Massar, S. and Popescu, S.},       journal = {Phys. Rev. Lett.},       volume = {94},       issue = {22},       pages = {2204031--2204034},       year = {2005},       month = {Jun},       doi = {10.1103/PhysRevLett.94.220403},       note = {\url{http://link.aps.org/doi/10.1103/PhysRevLett.94.220403}},       publisher = {American Physical Society}     }      The problem is that when I compile my bib file, I get > This is BibTeX, Version 0.99d (TeX Live 2012) > > The top-level auxiliary file: title.aux > > The style file: unsrt.bst > > Database file #1: title.bib > > "{" immediately follows a field part---line 28 of file title.bib :   >  note = :   >  {\url{http://link.aps.org/doi/10.1103/PhysRevLett.94.220403}} > > I'm skipping whatever remains of this entry (There was 1 error message) And this error is always for the `Cerf` reference (the second I gave you)... Since I have lots of these references (like `Bohm`) that look all the same to me, I don't understand why I get this error nor how to solution it... **Edit** : here is a MWE               \documentclass[a4paper,titlepage]{article}     \usepackage{hyperref}            \hypersetup{         colorlinks,         citecolor=blue,         filecolor=blue,         linkcolor=blue,         urlcolor=blue,                   pdfborder = {0 0 0},                 linktocpage     }     \usepackage{url}          \begin{document}          \section{The EPR-paradox}     I cite this \cite{Bohm} and that \cite{Cerf}          \bibliographystyle{unsrt}     \bibliography{title}          \end{document}      Where the title.bib is the bib file given above.


title: How can I remap "`" in vim-latex?

text: I'm using vim-latex and I would like to use another key (tab, for example) instead of "`", since typing the latter is difficult here (shift + ´ + ´). How can I do this?


title: Prevent a line from being the last line on a page

text: I want to prevent a certain line from being the last line on a page. If necessary, I want whitespace to get automatically inserted before it so that it gets pushed to the beginning of the next page. Normally, using `\nopagebreak` would solve this. However, I also want that line to be pushed to the beginning of the next page, even if there is a blank line after it (from the `\` or `\vspace{\baselineskip}` command) on the first page. (And unfortunately, `\nopagebreak` doesn't seem to work for this...)               \documentclass{article}          \begin{document}     Text.          \vspace{41\baselineskip}     More text.          \vspace{\baselineskip}     \textbf{I don't want this line to be the last line of the page.}          \vspace{\baselineskip}     \nobreak     Even more text.     \end{document}


title: Can I use patchcmd to modify definitions in book.cls?

text: Below are the commands for `\paragraph` and `\subparagraph` in `book.cls`.               \newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%                                                 {3.25ex \@plus1ex \@minus.2ex}%                                         {-1em}%                                         {\normalfont\normalsize\bfseries}}     \newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%                                             {3.25ex \@plus1ex \@minus .2ex}%                                            {-1em}%                                           {\normalfont\normalsize\bfseries}}      I want subparagraph numbers to be at the left margin, and I want the first paragraph after the titles to be unindented. I rely on a description of the syntax for `\@startsection` here. An approach which works, but which I hope not to resort to in the long run, is to modify the definitions directly in `book.cls`, say, to:               \newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%                                                 {-3.25ex \@plus-1ex \@minus -.2ex}%                                         {1.5ex \@plus .2ex}%                                         {\normalfont\normalsize\bfseries}}     \newcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%                                             {-3.25ex \@plus-1ex \@minus -.2ex}%                                            {1.5ex \@plus .2ex}%                                           {\normalfont\normalsize\bfseries}}      Could the same changes be made on a temporary basis, without tinkering with `book.cls`, using `patchcmd` ? Below is pasted the requisite MWE which shows or doesn't show the effect, depending on whether I have modified `book.cls`.               \documentclass{book}     \usepackage{lipsum}\usepackage[margin=0.5in]{geometry}     \setcounter{secnumdepth}{6}     \begin{document}     \chapter{A chapter}     \section{A section}\lipsum[2]     \subsection{A subsection}\lipsum[2]     \subsubsection{A subsubsection}\lipsum[2]     \paragraph{A paragraph}\lipsum[2]     \subparagraph{A subparagraph}\lipsum[2]     \end{document}


title: biblatex: how to make \fullcite a clickable link

text: I am using `biblatex` to cite articles with full reference in the text, and therefore have no references section. The `biblatex` setup that I use is the following               \documentclass{article}     \usepackage{filecontents}          \begin{filecontents}{bibliography.bib}         @article{reference,         author = {F Author and S Author},          journal = {Obsc. J.},         title = {Article Title},         pages = {13},         volume = {400},         year = {2013},         month = {Oct},         doi = {10.1111/123},         URL = {http://dx.doi.org/10.1111/123}}     \end{filecontents}          \usepackage[maxnames=1,backend=bibtex,doi=false,isbn=false,url=false,firstinits=true,uniquename=false,useprefix=true]{biblatex}     \addbibresource{bibliography.bib}     \DeclareFieldFormat[article]{number}{\mkbibparens{#1}}     \DeclareFieldFormat[article]{year}{\mkbibparens{#1}}     \DeclareFieldFormat{journaltitle}{\mkbibemph{#1}} % italic journal title      \DeclareFieldFormat{pages}{#1}     \renewbibmacro{in:}{} % remove "in:"     \renewcommand{\newunitpunct}{, }     \renewcommand{\newblockpunct}{, }     % remove first name     \DeclareNameFormat{first-last}{\usebibmacro{name:last}{#1}{#3}{#5}{#7}\usebibmacro{name:andothers}}     \AtEveryCitekey{\clearfield{title}} % remove title               \begin{document}     Cite the article \fullcite{reference}.     \end{document}      This way, a reference cited with `\fullcite` gives something like "Author et al., _Obsc. J._ 400 (2013), 13". So far so good, but now I would like to make the citation (or at least the first author if thats easier) a hyperlink leading to the URL of the article (each article entry in the bib-file has a URL entry and/or a DOI). Is there a way to do this? Edit: something similar is used in the reference section of some Journals, see e.g. this open access article.


title: How to creat a macro from a code Maple to TeX?

text: I copy a code from Maple and past it into LaTeX. For example, the equation of the line in geometry 3D is               \begin{equation*}     \begin{cases}     x =-1 + 5t,\\     y = 3+t,\\     z =-3 + t      \end{cases}     \end{equation*}      The code in Maple is `[-1+5*t, 3+t, -3+t]`.   I want to make a macro. How do I do that? I tried               \newcommand{\droit}[3]{\displaystyle\Delta: \begin{cases}     {#1},\\     {#2},\\     {#3}.     \end{cases}}                      \begin{equation*}     \droit{x =t + 1}{y = 2t - 2}{3t + 1}     \end{equation*}


title: Problem using coordinate returned by macro for drawing line

text: Why does this MNWE (Minimal Non-Working Example) fail?               \documentclass{article}     \usepackage{tikz}     \begin{document}     \newcommand\mypoint{(1pt,0pt)}     \begin{tikzpicture}         \node [draw,circle] at \mypoint {};         \draw (0,0) to \mypoint;     \end{tikzpicture}     \end{document}      Clearly `\mypoint` defines a perfectly good coordinate, since the node creation is executed perfectly well, as can be verified by commenting out the `\draw` command. But an error is obtained when using it to draw a line. What's going on? How can I fix it? This dumb MNWE is boiled down from a more realistic scenario: the key thing is that I need to be able to draw a line to a point returned by a macro.


title: How can I specify a short form author name in a Bibtex entry?

text: I'm preparing a paper for a publication, one of my references is an information package put out by the CDC. It has no listed author. The author tag they suggest using looks like this: > Centers for Disease Control and Prevention (CDC) but the AMA-like citation style used by the journal's style file interprets this as: > [for Disease Control and (CDC), 2010] That is, it thinks it's a paper by for Disease Control, Centers and (CDC), Prevention. I tried the shortauthor tag, but it doesn't change the outcome under this template. Any suggestions?


title: XeLaTex: -- sign

text: I use following code:               \begin{center}     \begin{tabular}[]{llcl}     \hline     \rowcolor[gray]{.9}\textbf{Parameter} & \textbf{Description} \\\hline     -c, --create & Do something\\\hline     \end{tabular}     \end{center}      So after I created the PDF document, the "--" is converted to: > -create Is there any possibility to fix that, because I need both "-".


title: Help! Paragraph ended before \align* was complete

text: \begin{align*}         &A = \pi r^2 \\         {\therefore}\          &V = \int_{-3}^2 \pi (6 - x - x^2)^2\ dx \\         &=\pi \int_{-3}^2 (36-6x-6x+x^2+x^3-6x^2+x^3+x^4)\ dx \\         &=\pi \int_{-3}^2 (36-12x-11x^2+2x^3+x^4)\ dx \\         &=\pi \left[36x - 6x^2 - \frac{11x^3}{3} + \frac{x^4}{2} + \frac{x^5}{5} \right]_{-3}^2 \\         &=\pi \left[{\frac{625}{6} \right] \\         &= \frac{625 \pi}{6} units^3  \\         \end{align*}          \section{Question 3}         \textbf{(a)} Solve the differential equation:\\         \begin{align*}         &\frac{dy}{dx} = \frac{6x}{y^2(3-x^2)}\\         &{\therefore}\ \frac{dy}{dx} y^2 = \frac{6x}{3-x^2} \\         &{\therefore}\ dy \times y^2 = \frac{6x \times dx}{3-x^2} \\         &{\therefore}\ \int y^2 \time dy = \int \frac{6x}{3-x^2) dx \\         \text{Let $u=3-x^2$} \\         {\therefore}\ \frac{du}{dx} = -2x \\         &{\therefore}\ \left[\frac{y^3}{3} = 6 \int \frac{x}{u} \frac{du}{dx}\ dx \\         &=6 \int \frac{1}{u} \frac{-1}{2}\ du \\         &=-3 \ln(|3-x^2|) + c \\         &{\therefore\} y = \sqrt[3]{-9 \ln(|3-x^2|)} + c \\         \end{align*}


title: How to lock a static text in the margin in ConTeXt?

text: Even though I have a some manuals at hand I can't seem to find a solution for my problem. Within an invoice I created with ConTeXt (MkIV) I have placed a short paragraph in the right margin. This paragraph is not be changed and I would love to have it locked at a certain vertical distance. But whenever I add new lines to my main text (in the text field) this paragraph in the margin moves down. I can fix it again by adjusting "[line=x]" but I wonder if this could be locked? Here is how I wrote my paragraph: `\inright[style=normal,line=7]{Text in paragraph.}` Any help is much appreciated.


title: Fancy headings with newgeometry

text: I'm working on a document consisting of several pages of text and a series of full-page figures. Since the figures are larger than the normal text width, I've used the `geometry` package's `\newgeometry` command to change the margins on the pages they're on. So far, so good. The problem arises when I try to give the document fancy headers and footers with the `fancyhdr` package. My fancy page styles (unlike LaTeX's default page styles) don't adjust to the `\newgeometry`: the header moves to respect the new left margin, but doesn't change its width to reach the right margin. The following example should show what I mean. The first page, with a fancy page style but no `\newgeometry` is fine. The second page invokes `\newgeometry` and the fancy page style has not adjusted. The third page has the same `\newgeometry` but uses a non-fancy page style; note that the header in this case does extend all the way to the right margin.               \documentclass{article}     \usepackage{geometry}     \usepackage{fancyhdr}     \usepackage{lipsum}     \pagestyle{fancy}         \lhead{Fancy page style}    \chead{}            \rhead{}         \lfoot{}                    \cfoot{}            \rfoot{\thepage}         \renewcommand{\headrulewidth}{0.4pt}         \renewcommand{\footrulewidth}{0.4pt}          \begin{document}     \lipsum[1-5]     \clearpage          \newgeometry{left=1.5cm, right=1.5cm}     \lipsum[1-5]     \clearpage          \thispagestyle{headings}     \lipsum[1-5]     \end{document}      I've tried everything I can think of, including defining my fancy page style after the `\newgeometry` declaration, but the behaviour is still the same. Is there any way I can put fancy headers on a page with altered margins?


title: Beamer crashes with babel Turkish package

text: I just started to learn beamer and noticed that the problem in \usepackage[turkish]{babel} and \includegraphics inconcistency question applies for beamer and `\shorthandoff{=}` solution does not work. Has anyone have another solution? Thanks.               \documentclass{beamer}     \mode<presentation>     \usepackage[utf8]{inputenc}     \usepackage[turkish]{babel}     \usepackage{graphicx}          \begin{document}     \begin{frame}         \begin{figure}         \centering         \shorthandoff{=}         \includegraphics[scale=0.3]{resimler/stmornek2.png}         \shorthandon{=}         \end{figure}     \end{frame}     \end{document}


title: Template for cheat sheet

text: I have been working with LaTeX for a couple of years but I don't know anything about pure TeX. I find this LaTeX cheat sheet useful to remember some commands. So I'd like to have a LaTeX template for writing down my commands on different subjects with such cheat sheet model. Do you know where I can find such template or how to create a new one from scratch with TeX?


title: Disable TEXMFHOME for testing?

text: I'd like to be able to temporarily ignore my "home" texmf tree (in MacTeX `/Users/will/Library/texmf`) for testing purposes; e.g., to test some code and ensure only TeX Live-installed packages are found. Is this easily possible?


title: saving computed number registers for access outside body of "let" operation

text: Section 14.15 of the PGF manual (pp 150-) describes the `let` operation. On pg 152 (first example) it is applied to saving coordinate (tuple values) to point registers `p1` and `p2` using the `coordinate` function to enable accessing computed coordinates outside the body of the `let` operation. It seems to me that it should be possible to save and reuse number registers in a similar fashion, but that does not appear to be the case. See proposed code below. I want to use the computed length `\n1` as the length of the subrectangle `DATASET`, but this does not seem possible within the constraints of this syntax. Ideas? Workarounds?               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows, positioning, calc}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{5em}%     \begin{document}     \begin{tikzpicture}[auto]       \tikzstyle{file} = [ellipse, rounded corners, minimum height=1em, minimum width=1em, align=center, draw]       \tikzstyle{block} = [rectangle, rounded corners, minimum height=2em, minimum width=15em, align=center, draw]       \node [block, minimum height=10em] (DB){\textbf{Database}};       % Set coordinate points for sub-rectangles       % See pg 420 of 2.10 PGF manual for anchors       % 'let' is defined on pg 150 in Section 14.15 (The Let Operation)       \path       let       \p1 = ($(DB.east)$),       \p2 = ($(DB.west)$),       \n1 = {veclen(\x1-\x2,\y1-\y2)/2}       in       coordinate(p1) at (\p1)       coordinate(p2) at (\p2)       %number(n1) at (\n1) % illustrative syntax       ;       % Use n1 for 'minimum width' instead of 2em       \node [block, draw, minimum width=2em] (DATASET) at ($(DB.north)!2/7!(DB.south)$) {Dataset};     \end{tikzpicture}     \end{document}


title: writing text below a word in mathrm in mathmode

text: I would like that the part `{0 \neq w \in \mathcal{H}_{k-t}}` appear strictly below `sup` in the following `\\[ \mathrm{ sup }_{0 \neq w \in \mathcal{H}_{k-t}} \\] ` thanks


title: Beamer + subfigure numbering

text: When using beamer with the subfigure package, the subfigure labels (a), (b) etc. are not reset at the beginning of a new figure. Example:                   \documentclass{beamer}         \usepackage{subfigure}           \begin{document}                   \begin{frame}             \begin{figure}[htbp]                 \centering                 \subfigure[Text 1]{Testing subfigure}                      \subfigure[Text 2]{Testing subfiguare even more}                   \end{figure}         \end{frame}              \begin{frame}             \begin{figure}[htbp]                 \centering                 \subfigure[Text 1]{Testing subfigure}                      \subfigure[Text 2]{Testing subfiguare even more}                   \end{figure}         \end{frame}              \end{document}      How can I fix this?


title: Lyx: first chapter line indented

text: In Lyx, how can I make sure that the first line of each Chapter is indented? I'm writing a "report" document, if that matters.


title: How to automatically provide a blank space after a question based on the solution size?

text: I want to generate a problem booklet that provides a more accurate space after each question. As I always make the solution as general as possible, I think I can use the size of my solution for the size of the associated blank space. I don't want to use `\examspace` with hard-coded dimension as follows. How to implement my idea?               \documentclass[preview,border=12pt,varwidth]{standalone}          \usepackage{mathtools}     \usepackage{exsheets}          \SetupExSheets     {         question/name=Question,         solution/name=Answer,         solution/print=true,     }          \begin{document}          \begin{question}     Solve $2(x-1) - \frac{2}{3}(3-2x) = 1 - 2(2-3x)$.     \examspace{10\baselineskip}     \end{question}          \begin{solution}     \begin{gather*}     2(x-1) - \frac{2}{3}(3-2x) = 1 - 2(2-3x) \\     \intertext{multiply both sides by 3}     3\times\left(2(x-1) - \frac{2}{3}(3-2x)\right) = 3\times\left(1 - 2(2-3x)\right) \\     6(x-1) - 2(3-2x) = 3 - 6(2-3x) \\     6x - 6 -6 +4x = 3 -12 +18x \\     10x -12 = -9 + 18x\\     10x -18x = -9 +12\\     -8x = 3\\     x = \frac{3}{-8}\\     x = -\frac{3}{8}     \end{gather*}     \end{solution}          \end{document}      ![enter image description here](http://i.stack.imgur.com/5Cqzh.png)


title: How to add labels to polar plot / polar comb in polaraxis and show FULL coordinates?

text: In pgfplots, I am trying to:   1. for a first figure:     * label 12 polar plots plotted on the bases of 12 tables (values given in cartesian coordinates) without showing a legend but adding a label directly on the different graphs without entering manually the coordinates of each nodes, (this for polar plots).   2. for a second figure:     * label each branch of a "polar comb" (for a same table of value this time, see picture below), in the middle of the branch, rotating with the branch, at the right coordinate     * plot not only the distance of each point (see picture below, above the asterisk) but also the angle with respect to the x axis. For this second plot, here the latex code:               \begin{tikzpicture}          \begin{polaraxis}[nodes near coords, width=4\textwidth,     xmin=-1,xmax=45.01, ymin=12, ymax=15,     title=Displacement 12N,     grid=both,     minor x tick num={4},      minor y tick num={1},     legend entries={     $F=12N$,     },     legend style={     at={(0.5,-0.05)},     anchor=north,     %legend columns=4,     %cells={anchor=west},     rounded corners=2pt,     }]          \addplot+[polar comb ,data cs=cart, mark size=1, mark=asterisk] table {b20_h0.3_L50_mod2_F12_mod2.tex};          \node[label={\rotatebox{0}{\textcolor{blue}{$0^{\circ}$}}},mark=none,inner sep=0pt] at (axis cs:0,13) {};          \node[label={\rotatebox{2.5}{\textcolor{blue}{$1^{\circ}$}}},mark=none,inner sep=0pt] at (axis cs:2.5,13) {};          \node[label={\rotatebox{3.5}{\textcolor{blue}{$2^{\circ}$}}},mark=none,inner sep=0pt] at (axis cs:3.5,13) {};          \node[label={\rotatebox{4.4}{\textcolor{blue}{$3^{\circ}$}}},mark=none,inner sep=0pt] at (axis cs:4.4,13) {};          \node[label={\rotatebox{5.8}{\textcolor{blue}{$4^{\circ}$}}},mark=none,inner sep=0pt] at (axis cs:5.8,13) {};          %etc.... many times          \end{polaraxis}     \end{tikzpicture}      Here an illustration of what the polar comb plot looks like with manual labelling (long...) and with the missing angle coordinate (only the distances..). ![enter image description here](http://i.stack.imgur.com/JwQsv.jpg) Thank you in advance!! After using Jake's code with working example, here the result in my code as a copy: ![enter image description here](http://i.stack.imgur.com/zJyT2.jpg) Following Jake's remark, I put the code with the bugs here and some values to manipulate, I have the feeling it is related to the cartesian-polar conversion               \centering     \begin{tikzpicture}     \begin{polaraxis}[     visualization depends on=rawx \as \pgfplotspointrawx,     nodes near coords,     every node near coord/.style={         rotate=\pgfplotspointrawx,         append after command={             node [                 anchor=south,                 rotate=\pgfplotspointrawx,                 shift={(axis direction cs:0,(12.75-\pgfplotspointmeta))}             ] {$\pgfmathprintnumber{\pgfplotspointrawx}^\circ$}         }     },     width=4\textwidth,     xmin=0,xmax=45.01, ymin=12, ymax=15,     title=Displacement 12N,     grid=both,     minor x tick num={4},      minor y tick num={1},     legend entries={     $F=12N$,     },     legend style={     at={(0.5,-0.05)},     anchor=north,     rounded corners=2pt,     }]     \addplot+[polar comb ,data cs=cart, mark size=1, mark=asterisk] table {     13.8893888888889    0     13.8875152609215    0.256057893044211     13.8818942709919    0.512013162090311     13.8725256030249    0.767763280177719     13.8594087369111    1.02320591422122     13.8425429585071    1.27823902144993     13.8219273735841    1.53276094524909     %etc...     };          \end{polaraxis}     \end{tikzpicture}      Thank you very much in advance


title: How to add a logo in every page, without any margin?

text: I want to use a little pdf picture as a logo in every page of my file, exactly in the top of every page, no margin on top, no margin on left and right side, how to make it? I use below simple settings, but obviously there are margins...               \usepackage{fancyhdr}     \setlength{\headheight}{55.2pt}     \setlength{\headwidth}{\textwidth}     \fancyhead[C]{\includegraphics[height=1.53in]{logo.pdf}}     \pagestyle{fancyplain}


title: pgfplotstable will not generate table

text: I have some data from a table that I would like to tableize with `pgfplotstable`. After many hours of going through the `pgfplotstable` 1.10 manual and basicly copying the example code with my data. Are the date and time formats a problem? I am just looking to handle those as strings. Is that a problem for the read routines? I created a small subset of the data without date/time colums with the same results. Even specifying only one column, "bikes", changes nothing. It continually complains about: > ! Paragraph ended before \pgfkeys@addpath was complete. I've spent several hours pulling out my thinning hair over this. Could someone please take a look at my relatively simple example and make suggestions. I am trying to learn `pgfplots`/`pgfplotstable` and I've hit a wall. Do I have a package conflict? Any and all help is greatly appreciated. My code is below:               \documentclass[12pt]{article}     \usepackage[landscape,letterpaper,left=0.5in,             right=0.5in,top=0.8in,bottom=0.75in]{geometry}     \usepackage{booktabs}     \usepackage{multirow}     \usepackage{pgfplotstable,pgfcalendar}     \usepgfplotslibrary{dateplot}          \usepackage{filecontents}     \pgfplotsset{compat=1.10}          \begin{filecontents}{bikesummary.dat}     date    bike     dist speed time    maxs  cada  heart heartmax massbr massar dmass     3/10/14 Yel-11   12.5 11.1  1:07:07 22.2   0.0    0.0   0.0      0.0  218.0  0.0     4/23/14 Fuji     16.5 14.0  1:11:20 29.7   0.0    0.0   0.0    219.2  218.8  0.4     5/18/14 8000SHX  21.0  9.2  2:15:14 32.5   0.0    0.0   0.0    219.0  217.2  1.8     5/24/14 Yel-11   24.2 10.1  2:23:39 30.5   0.0    0.0   0.0    219.0  216.6  2.4     5/29/14 YFoil77  23.4 15.5  1:28:38 33.2  75.0    0.0   0.0    219.6  217.2  2.4     5/30/14 Y-22     21.1 10.5  2:02:17 27.0   0.0    0.0   0.0    219.6  218.8  0.8     6/01/14 YFoil77  23.9 15.3. 1:33:41 31.7  78.0    0.0   0.0    219.2  217.8  1.4     6/05/14 Fuji     32.3 13.6  2:21:14 35.2   0.0  102.0 102.0    218.0  217.0  1.0     6/17/14 YFoil77  23.8 15.2  1:33:29 36.9  76.0  156.0 174.0    218.4  217.2  1.2     6/22/14 YFoil77  27.0 15.5  1:44:41 35.2  78.0  154.0 175.0    217.0  215.6  1.4     6/27/14 Y-22     34.0 10.1  3:17:13 31.1   0.0    0.0   0.0    218.0  215.0  3.0     6/29/14 Fuji     20.0 15.1  1:19:49 34.8   0.0    0.0   0.0    218.8  217.0  1.8     7/09/14 YFoil77  35.3 15.0  2:21:27 35.2  74.0    0.0   0.0    217.4  215.6  1.8     7/12/14 Fuji     36.5 14.4  2:29:51 34.8   0.0   86.0  86.0    217.4  216.0  1.4     7/17/14 YFoil77  33.2 15.3  2:10:14 34.8  76.0   84.0 165.0    220.0  217.2  2.8     7/23/14 YFoil77  25.4 15.7  1:37:00 32.4  80.0  150.0 177.0    218.2  218.0  0.2     7/25/14 YFoil77  17.4 16.2  1:08:14 33.5  81.0  110.0 169.0    220.6  218.4  2.2     7/31/14 YFoil77  38.7 14.8  2:36:22 36.1  78.0  145.0 171.0    219.4  216.8  2.6     \end{filecontents}          \pgfplotstableread{bikesummary.dat}\sumdata          \begin{document}     % Print the table     \pgfplotstabletypeset[columns={bike,dist,speed},       % Booktabs rules       every head row/.style={before row=\toprule,after row=\midrule},       every last row/.style={after row=[3ex]\bottomrule},       % Set header name       columns/bike/.style={string type,column name=Bike},            % Format numbers and titles       columns/dist/.style={column name=Distance,fixed,precision=1,                            fixed zerofill,dec sep align},       columns/speed/.style={column name=Speed,fixed,precision=1,                             fixed zerofill,dec sep align}     ]\sumdata     \end{document}


title: Remove title and name from sidebar yet keep them in the bottom part of the presentation

text: I need to write a **beamer** presentation for my upcoming thesis defense and chose the **Palo Alto** style. My problem with the Palo Alto style is, that my name and the title of the presentation should not appear in the sidebar, yet appear in the footer of the presentation. (Therefore short and long name/title don't work since providing an empty short name/title would also leave the footer empty). Is there an option / (if not, workaround) for suppressing author and title in the sidebar only? Thanks in advance, any input is appreciated :)


title: How to reduce spacing between titles of chapters?

text: I want to reduce spacing between titles of chapters. What changing should I do in the following example?               \documentclass[12pt]{report}     \usepackage[dvipdfm]{graphicx}     \usepackage{amsfonts}     \usepackage{amscd,amsmath,latexsym,makeidx,tocbibind}     \usepackage{amssymb,amsthm,amsfonts}     \usepackage{color}     \usepackage{setspace}     \usepackage{palatino,lettrine}     \newtheorem{theorem}{Theorem}[section]     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{proposition}[theorem]{Proposition}     \newtheorem{corollary}[theorem]{Corollary}     \newtheorem{definition}[theorem]{Definition}     \newenvironment{definition-new}{\begin{definition} \em}{\end{definition}}     \newtheorem{remark}[theorem]{Remark}     \newenvironment{remark-new}{\begin{remark} \em}{\end{remark}}     \newtheorem{example}[theorem]{Example}     \newenvironment{example-new}{\begin{example} \em}{\end{example}}     \newtheorem{exercise}[theorem]{Exercise}     \newtheorem{notation}[theorem]{Notation}     \newenvironment{notation-new}{\begin{notatio} \em}{\end{notatio}}     \newtheorem{agreement}[theorem]{Agreement}     \newenvironment{agreement-new}{\begin{agreement} \em}{\end{agreement}}     \def\theequation{\arabic{chapter}.\arabic{section}.\arabic{equation}}     \makeatletter \@addtoreset{equation}{section} \makeatother     \def\thefigure{\arabic{chapter}.\arabic{section}.\arabic{figure}}     \makeatletter \@addtoreset{figure}{section} \makeatother     \pagestyle{plain}     \usepackage[english]{babel}     \usepackage{blindtext}     \makeatletter     \renewcommand{\paragraph}{\@startsection{paragraph}{4}{0ex}%      {-3.25ex plus -1ex minus -0.2ex}%     {1.5ex plus 0.2ex}%     {\normalfont\normalsize\bfseries}}     \makeatother     \stepcounter{secnumdepth}     \stepcounter{tocdepth}     \linespread{1.8}     \addtolength{\textwidth}{2cm}     \addtolength{\hoffset}{-.5cm}     \addtolength{\voffset}{-.3cm}     \addtolength{\textheight}{3cm}     \addtolength{\marginparwidth}{.3cm}     \stepcounter{secnumdepth}     \stepcounter{tocdepth}     \begin{document}               \chapter{Mathematical Modeling for Malaria Transmission and Chemical Control with Human         Related Activities}          \chapter{Mathematical Modeling for Malaria Transmission and Biological Control with Human Related Activities}          \end{document}


title: How to draw stacked /vastellated bar charts

text: i want to draw a chart like this (Chart / Image taken from here): ![enter image description here](http://i.stack.imgur.com/RNa0u.png) First of all: How is this type of diagram called? By searching "stacked bar chart" in google, I cannot find charts like this. My second question is if it is possible to dras such a chart with pgfplots (not necessarily identical to the chart given above). Thanks in advance!


title: Why does latex think it's tomorrow already?

text: Strange problem here:               Brandon@forge ~/Dropbox/research.local/oil     $ date     Tue, Nov 27, 2012  6:14:23 PM          Brandon@forge ~/Dropbox/research.local/oil     $ cat <<EOF | pdflatex     \documentclass{article}     \begin{document}     \today     \end{document}     EOF      gives me a document whose content reads "November 28, 2012".   Now, I imagine this has something to do with locale or time zone – but why would that be different inside of TeX than at the command line? Worth mentioning: I'm running Cygwin on Windows 7 and TeX Live 2012.


title: breqn not playing well with cleveref (or vice versa)

text: This is a little different from Cleveref and breqn packages don't play nice together, and may not have a simple answer. I was experimenting with breqn, and found some of my tagged equations were mislabeled by cleveref:               \documentclass{article}     \usepackage{breqn}     \usepackage{cleveref}          \begin{document}          \begin{dmath}\label{first}       a = b + c     \end{dmath}     This is \cref{first}.          \begin{dmath}[number = {$\star$}]\label{second}       a = b + c     \end{dmath}     This is \cref{second}.          \end{document}      ![The result](http://i.imgur.com/jv8g93k.png) I presume this is because cleveref doesn't patch whatever mechanism breqn is using for creating equation tags via `[number = {...}]`. Is there an easy workaround? If not, it would preclude me from going further with breqn, which would be a pity.


title: Vertical line from top margin of page to current positon

text: I'm struggling with this really simple (vanilla plainTeX) trick, which I'm not able to crack... How does one draw a vertical (i.e. perpendicular to the horizon) line that leads from the top (or top margin or as topmost as possible) of the current page to the current position (specifically the position of text at the time where the macro solving this problem is called)? P. S. It may have unclear but the current position is meant including both the horizontal and vertical position. I. e.               Here I \myruler am...          Another paragraph...      would produce sth like                      |            |            |            |            |     Here I | am...          Another paragraph...


title: itemize without pagebreak

text: I have the following structure of my lists (commonly):               .....          Here is the list:      * item1      * item2          ....      I would like to make my list inseverable (the list with its 'caption' won't be divided by pages)


title: Custom font family with siunitx

text: I'm trying to set some relatively large tables in my document. I used fontspec to create a new font family, which I use only to set tables. Specifically, I'm using the Bell Centennial font to set my tables. I've defined the font family with:               \newfontfamily\bellcentennial[         Path = fonts/BC/ ,         Extension = .otf ,         UprightFont = *-Address ,         BoldFont = *-NameNum     ]{BellCentennialStd}      My problem is, I have no idea how to setup siunitx to use the `\bellcentennial` font family. Using `detect-family` just gives me the standard math roman font. This should be an acceptable MWE:               \documentclass{article}     \usepackage{fontspec}     \usepackage{siunitx}          \newfontfamily\bellcentennial[         Path = fonts/BC/ ,         Extension = .otf ,         UprightFont = *-Address ,         BoldFont = *-NameNum     ]{BellCentennialStd}          \begin{document}     \begin{table}         \centering     \begingroup         \bellcentennial         \fontsize{6pt}{6pt}         \selectfont         \begin{tabular}{r S S}             \multicolumn{1}{c}{\textbf{Label}} & \multicolumn{2}{c}{\textbf{Numbers}} \\             Foo & 1.2 & 3.4 \\             Bar & 5.6 & 7.8 \\             Baz & 9.0 & 12.34 \\             Qux & 56.789 & 0.0 \\         \end{tabular}     \endgroup         \caption{The most wonderous of tables.}         \label{tab:tableytabletable}     \end{table}     \end{document}     \end{table}      Of course, unless you have the Bell Centennial fonts and use the same folder structure as I do, you are going to have to redefine the definition of the `\bellcentennial` font family to work locally. I'm sure I'm missing something obvious with setting up siunitx but I'm unsure of where to start looking.


title: Defect of measuring into the count of alphabet width

text: ## Question: Why in the example below I get (with CM at 10pt) `\alphabet=342.93138pt` and `\myalphabetwidth=342.6536pt` why I have this difference between the two measures? What is the more correct?               \documentclass{book}          \RequirePackage{xparse}     \RequirePackage{siunitx}     \RequirePackage{environ}     \RequirePackage{booktabs}          % **********************************************************     \ExplSyntaxOn     % **********************************************************          \bool_new:N \g_has_run_bool     \tl_new:N \l_aw_text_tl     \int_new:N \l_aw_tot_int     \int_new:N \g_aw_tot_alph_int     \int_new:N \g_wid_space_int     \int_new:N \g_space_int     \fp_new:N \g_rat_space_int     \fp_new:N \g_aw_avg_width_fp     \dim_new:N \myalphabetwidth     \dim_new:N \mytextwidth     \input{\jobname.aux}     \tl_const:Nx \c_aw_the_alphabet_tl {abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.;?()!' \token_to_str:N :}          % this can be changed to an evironment or renamed or whatever     \NewDocumentCommand {\avgwidthstart} {}       {         \aw_avg_width:w       }          \NewDocumentCommand {\avgwidthend}{}{}          % Here is the environment version, using just "text" as a name is probably a bad idea.     \NewEnviron{textcount}     {       \expandafter\avgwidthstart\BODY\avgwidthend     }          \cs_new:Npn \aw_avg_width:w #1 \avgwidthend       {         % if first run, then generate variables to be used         \bool_if:NF \g_has_run_bool           {             \tl_map_inline:Nn \c_aw_the_alphabet_tl             {               \int_new:c {g_##1_int}               \fp_new:c {g_rat_##1_fp}               \fp_new:c {g_wid_##1_fp}             }           }         \tl_set:Nn \l_aw_text_tl {#1}              % this can be used rather than the preceding line to take capital          % letters into account, but is Slooooooow         %\tl_set:Nx \l_aw_text_tl {\tl_expandable_lowercase:n {#1}}              \int_set:Nn \l_aw_tot_int {\tl_count:N \l_aw_text_tl}         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_get_counts:n         \deal_with_spaces:n {#1}         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_calc_ratios:n         \tl_map_function:NN \c_aw_the_alphabet_tl \aw_calc_avg_width:n         \fp_gset_eq:NN \g_aw_avg_width_fp \l_tmpa_fp         \fp_zero:N \l_tmpa_fp              % the dimension \myalphabetwidth gives the width of the alphabet based on your character freq,         % can be accessed by \the\myalphabetwidth         \dim_gset:Nn \myalphabetwidth {\fp_to_dim:n {\fp_eval:n {61*\g_aw_avg_width_fp}}}              % the dimension \mytextwidth gives the recommended \textwidth based on 66 chars per line.         % can be accessed by \the\mytextwidth         \dim_gset:Nn \mytextwidth {\fp_to_dim:n {\fp_eval:n {66*\g_aw_avg_width_fp}}}         \protected@write\@mainaux{}{\mytextwidth=\the\mytextwidth}         \bool_gset_true:N \g_has_run_bool              % and lastly print the content         #1       }          \cs_new:Npn \aw_get_counts:n #1       {         % make a temporary token list from the document body          \tl_set_eq:NN \l_tmpb_tl \l_aw_text_tl         % remove all occurrences of the character         \tl_remove_all:Nn \l_tmpb_tl {#1}         % add to appropriate int the number of occurrences of that character in current block         \int_set:Nn \l_tmpa_int {\int_eval:n{\l_aw_tot_int -\tl_count:N \l_tmpb_tl}}         % add to appropriate int the number of occurrences of that character in current block         \int_gadd:cn {g_#1_int} {\l_tmpa_int}         % add this to the total         \int_gadd:Nn \g_aw_tot_alph_int {\l_tmpa_int}       }          \cs_new:Npn \deal_with_spaces:n #1       {         \tl_set:Nn \l_tmpa_tl {#1}         % rescan body with spaces as characters         \tl_set_rescan:Nnn \l_tmpb_tl {\char_set_catcode_letter:N \ }{#1}         % find number of new characters introduced.  add to number of spaces and alph chars         \int_set:Nn \l_tmpa_int {\tl_count:N \l_tmpb_tl -\tl_count:N \l_tmpa_tl}         \int_gadd:Nn \g_space_int {\l_tmpa_int}         \int_gadd:Nn \g_aw_tot_alph_int {\l_tmpa_int}         % since this comes after the rest of chars are dealt with, tot_alph is final total         \fp_set:Nn \g_rat_space_fp {\g_space_int/\g_aw_tot_alph_int}         % get width of space and use it.  obviously space is stretchable, so i'll assume         % that the expansions and contractions cancel one another over large text.  is this         % a terrible assumption???         \hbox_set:Nn \l_tmpa_box {\ }         \fp_gset:Nn \g_wid_space_fp {\dim_to_fp:n {\box_wd:N \l_tmpa_box}}         \fp_add:Nn \l_tmpa_fp {\g_wid_space_fp*\g_rat_space_fp}       }          \cs_new:Npn \aw_calc_ratios:n #1       {         % divide number of occurrences of char by total alphabetic chars         \fp_gset:cn {g_rat_#1_fp}{{\int_use:c {g_#1_int}}/\g_aw_tot_alph_int}       }          \cs_new:Npn \aw_calc_avg_width:n #1       {         % only need to find char widths once         \bool_if:NF \g_has_run_bool           {             % find width of char box             \hbox_set:Nn \l_tmpa_box {#1}             \fp_gset:cn {g_wid_#1_fp}{\dim_to_fp:n {\box_wd:N \l_tmpa_box}}           }         % multiply it by char frequency and add to avg width         \fp_add:Nn \l_tmpa_fp {{\fp_use:c {g_wid_#1_fp}}*{\fp_use:c {g_rat_#1_fp}}}       }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % This part is just for fun. Delete it and the showtable command from the document if     % it isn't wanted         \newlength{\alphabet}%         \settowidth{\alphabet}{\normalfont abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.;?()!':}%     \tl_new:N \l_aw_tab_rows_tl     \seq_new:N \g_aw_theor_rats_seq     \seq_new:N \g_aw_the_alphabet_seq          \seq_gset_split:Nnn \g_aw_theor_rats_seq {,}     {0.0651738,0.0124248,0.0217339,0.0349835,0.1041442,0.0197881,0.0158610,0.0492888,0.0558094,0.0009033,0.0050529,0.0331490,0.0202124,0.0564513,0.0596302,0.0137645,0.0008606,0.0497563,0.0515760,0.0729357,0.0225134,0.0082903,0.0171272,0.0013692,0.0145984,0.0007836,0.1918182}          \NewDocumentCommand {\showtable}{}         {           \clearpage           \aw_make_table:         }          \cs_generate_variant:Nn \seq_set_split:Nnn {NnV}     \cs_new:Npn \aw_make_table:         {           \thispagestyle{empty}           \seq_set_split:NnV \g_aw_the_alphabet_seq {} \c_aw_the_alphabet_tl           %takes corresponding letter/theoretical ratio pairs from sequences and applies function           \seq_mapthread_function:NNN \g_aw_the_alphabet_seq \g_aw_theor_rats_seq \aw_generate_row:nn           \begin{table}[h]           \centering           \sisetup{round-mode = places,round-precision = 5,output-decimal-marker={,},table-format = 3.5}           \begin{tabular}{llll}             \toprule             {Average\,\texttt{\textbackslash textwidth}}&{Average\,character\,width}&{Average\,alphabet\,width}&{Alphabet\,width}\\             \midrule             \the\mytextwidth&\fp_eval:n {round(\g_aw_avg_width_fp,5)}pt&\the\myalphabetwidth&\the\alphabet\\             \bottomrule           \end{tabular}\par           \end{table}           \vfil           \begin{center}             Total\,characters\,=\,\fp_eval:n {\g_aw_tot_alph_int}           \end{center}           \[%             \mathrm{Total\,line\,type}=\frac{\fp_eval:n {\g_aw_tot_alph_int}\cdot \fp_eval:n {round(\g_aw_avg_width_fp,5)}\mathrm{pt}}{\fp_eval:n {\g_aw_tot_alph_int*{round(\g_aw_avg_width_fp,5)}/({\g_aw_tot_alph_int}/66)}\mathrm{pt}}=\fp_eval:n {\g_aw_tot_alph_int/66}           \]           \vfil           \begin{table}[h]           \centering           \sisetup{round-mode = places,round-precision = 5,output-decimal-marker={,},table-format = 3.5}           \begin{tabular}{cSSS}             \toprule             {Letter}&{Actual}&{Theoretical}&{Difference}\\             \midrule             spaces&\fp_eval:n {\g_rat_space_fp*100}\%&19.18182\%&\fp_eval:n {{\g_rat_space_fp*100-19.18182}}\%\\             \tl_use:N \l_aw_tab_rows_tl             \bottomrule           \end{tabular}\par           \end{table}         }          \cs_new:Npn \aw_generate_row:nn #1#2         {           \tl_put_right:Nn \l_aw_tab_rows_tl {#1&}           \tl_put_right:Nx \l_aw_tab_rows_tl {\fp_eval:n {100*{\fp_use:c {g_rat_#1_fp}}}\%&}           \tl_put_right:Nn \l_aw_tab_rows_tl {\fp_eval:n{100*{#2}}\%&}           \tl_put_right:Nx \l_aw_tab_rows_tl {\fp_eval:n {{\fp_use:c {g_rat_#1_fp}*100-\fp_eval:n {#2}*100}}\%}           \tl_put_right:Nn \l_aw_tab_rows_tl {\\}         }          % **********************************************************     \ExplSyntaxOff     % **********************************************************               \begin{document}          \avgwidthstart     abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,.;?()!':%     \avgwidthend          \the\myalphabetwidth          \the\alphabet          \end{document}      * * * ## Update: I don't want total width of a particular string. My example is only a way to test the macro. I have try to compare the two measures of the same string to check the performance of the macro, that is for the calculation of the character frequencies into the document (on the normal text of the document) and than get the average alphabet width and use it to set the `\textwidth`. Because you have say: _"I don't understand the question."_ I try to re-explain it: **My question is:** There is a way to say at the macro: if you found some certain characters add at the total count of the width, the inter-letter kerns for those characters? Where the value are taken from the metric of the used font. For example, the first `\hbox` (that you have show me, that is the `\alphabet`) take into the count the inter-letter kerns there is a way to put that, also into the final count of the macro?


title: natbib, hyperref and citation inside a float figure

text: I use Lyx and MikTeX 2.9 to write my thesis based on book KOMA-script. Right at the finish I have an error at pdflatex run:               Extra }, or forgotten \ endgroup.          <argument> ... \IeC {\c s}i dreapta D=2.9\relax }}                                                   \hyper@linkend      l.25 ...apta D=2.9\relax }}{32}{figure.caption.25}          I've deleted a group-closing symbol because it seems to be     spurious, as in `$x}$'. But perhaps the } is legitimate and     you forgot something else, as in `\hbox{$x}'. In such cases     the way to recover is to insert both the forgotten and the     deleted material, e.g., by typing `I$}'.      Here is my code:               \documentclass[romanian]{article}     \usepackage[]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{babel}     \usepackage{float}     \usepackage[unicode=true,pdfusetitle,       bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,       breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]      {hyperref}          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \usepackage{type1ec}     \usepackage[T1]{fontenc}     \usepackage{ucs}     \usepackage{hyperref}     \makeatletter     \newcommand\bibstyle@comma{\bibpunct(),a,,}     \newcommand\bibstyle@semicolon{\bibpunct();a,,}     \makeatother     \pretocmd\citet{\citestyle{comma}}\relax\relax     \pretocmd\Citet{\citestyle{comma}}\relax\relax     \pretocmd\citep{\citestyle{semicolon}}\relax\relax     \pretocmd\Citep{\citestyle{semicolon}}\relax\relax          \makeatother          \begin{document}     \begin{figure}[H]     \begin{centering}     aaaa     \par\end{centering}          \caption{Suprafete fractale Brown-iene obinute cu funcia \emph{r.surf.fractal}     \cite{Wood1996} din GRASS GIS: stanga - D=2.1, centru D=2.5 si dreapta     D=2.9}     \end{figure}               \bibliographystyle{chicago}     \phantomsection\addcontentsline{toc}{section}{\refname}\bibliography{D:/JURNALE/a}          \end{document}      The bib entry is:               @phdthesis{Wood1996,     author = {Wood, Jo},     booktitle = {Advances in cancer research},     file = {:D$\backslash$:/JURNALE/Bettuzzi\_2009.pdf:pdf},     issn = {0065-230X},     month = jan,     pmid = {19878769},     school = {University of Leicester},     title = {{The geomorphological characterisation of digital elevation models}},     volume = {104},     year = {1996}     }      and the a.bib file. I use a modification of chicago bibtex style. While the code contains a lot of optimisation, the error was in when i added the code               \newcommand\bibstyle@comma{\bibpunct(),a,,}     \newcommand\bibstyle@semicolon{\bibpunct();a,,}     \makeatother     \pretocmd\citet{\citestyle{comma}}\relax\relax     \pretocmd\Citet{\citestyle{comma}}\relax\relax     \pretocmd\citep{\citestyle{semicolon}}\relax\relax     \pretocmd\Citep{\citestyle{semicolon}}\relax\relax      This is required for me to obtain coma and colon separated citations. The error is localized in relation to some citations included in float figure captions. I read it on the web that some times natbib and hyperref does not like each other, and indeed when I comment the code above the document compile. Any clue regarding this issue would help! Thanks in advance! Mihai


title: Acronym wrapped at end of page causes page number and header of next page to have same hyperlink

text: A bit of a confusing title perhaps, so let me explain. I'm using the packages `glossaries`, `hyperref` and `fancyhdr`. Acronyms defined with `glossaries` have a hyperlink to their definition. However when the acronym is wrapped at the end of a page and continues on the next, the page number of the first, and the header of the next page get the same hyperlink as the acronym. I've made a simple document that will reproduce the problem. I noticed that the page number is not affected in this example. I'll have to test further to find out what else I need to include in the example to reproduce that part.               \documentclass[a4paper]{report}          \usepackage{fancyhdr}     \usepackage{hyperref}     \usepackage[acronym,nomain]{glossaries}          \makeglossaries          \newacronym{dolor}{DA}{Dolor At}          \begin{document}          \pagestyle{fancy}          \printglossaries          \chapter{Chapter}          \section{Section}          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent viverra eleifend mi, eget adipiscing velit. Aenean mauris diam, viverra vestibulum aliquam id, malesuada ut purus. Ut laoreet commodo turpis, et ullamcorper arcu aliquam eu. In egestas, augue vel malesuada aliquam, purus sem luctus felis, et aliquet metus neque id ligula. Etiam interdum vehicula rhoncus. Cras posuere lectus vel erat semper aliquet. Morbi erat orci, aliquet ut mauris non, dapibus porttitor eros. Sed odio leo, tincidunt id urna sit amet, suscipit rhoncus sem. Aenean vel sapien lacus. Donec tincidunt dui non porttitor dignissim. Praesent dignissim suscipit elementum. Aliquam quis convallis dolor. Pellentesque hendrerit suscipit augue eget tempor.          Cras feugiat nisl nec euismod vestibulum. Cras placerat leo at leo iaculis, non facilisis purus congue. Donec ut mollis eros. Cras ac dolor dolor. Duis vel porta arcu, et consectetur nisi. Sed pellentesque purus quam, et sollicitudin felis eleifend non. Donec eget nisi quis dui sagittis faucibus ut non ipsum. Ut non pretium ligula.          Nullam pellentesque risus augue, rhoncus luctus leo blandit in. Cras tincidunt eros sed gravida consequat. Donec gravida ligula id venenatis varius. Vestibulum mollis scelerisque diam, non lobortis lorem tristique in. Integer tempus fermentum lacus, nec sollicitudin sem aliquam et. Cras id porta tortor. Integer consequat nisl dui, et sodales quam accumsan in.          Vestibulum vitae leo vel urna gravida congue a id magna. Pellentesque sit amet purus leo. Suspendisse viverra placerat neque, quis mollis sem fermentum et. Vivamus at pharetra dui. Phasellus scelerisque molestie diam vel vehicula. Mauris vel ligula in eros mattis aliquet. Praesent nec elit lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vitae nunc ut metus accumsan fringilla. Nunc porta tempus quam, sit amet molestie metus accumsan nec. Duis vitae metus sit amet est luctus aliquet. Aliquam quis lacus nisi. Phasellus quam mi, porta vel molestie id, ornare non lorem.          Praesent quis nibh at est dignissim ullamcorper. Curabitur viverra porttitor lacinia. Mauris dapibus a nulla vel euismod. Donec ut urna congue, ultrices velit quis, blandit lorem. Mauris vel leo porttitor, ornare ligula quis, interdum leo. Curabitur et dolor purus. Donec pellentesque nisl congue, commodo \gls{dolor}, volutpat sem. Suspendisse sollicitudin dapibus ligula, in vestibulum nulla ornare vitae. Proin tempus pretium lectus sed pretium. Nulla hendrerit lectus sed risus ornare, et aliquet tortor dignissim. Ut tempor justo nec nisi posuere, sed pharetra erat ullamcorper. Praesent consectetur feugiat vehicula. Aenean sed turpis sed mauris iaculis adipiscing eget eget nulla. Maecenas sed euismod lectus. Etiam ut lacus neque.          \end{document}      This is how the compiled example looks like: ![Example](http://i.imgur.com/7zkT6UR.png)


title: Accessing randomly selected problems via the probsoln package

text: I have two datasets, each containing problems dealing with a specific topic. These problems are stored in external files (again, one file per topic) and loaded into the datasets in a random order. I need to generate a document that has this basic format: Quiz 1   * Question 1: Display the first question listed in topic1 dataset   * Question 2: Display the first question listed in topic2 dataset Quiz 2   * Question 1: Display the second question listed in topic1 dataset   * Question 2: Display the second question listed in topic2 dataset Continue... I've poured over the documentation, and I suspect I don't understand it fully. The only examples seem to focus on displaying all the questions in one dataset at a time. The only other option seems to be to know ahead of time what the labels are for each question, but that doesn't help since the questions were loaded in a random order. Any help you can give would be greatly appreciated. And if this question has already been addressed, a gentle nudge to the right place would be wonderful.


title: Objective: To separate text column from figures column in every page

text: I don't know if this has been asked before. But so far nothing has come up with my search. In some books, the figures are placed at the outer side of the page like in the picture below. ![enter image description here](http://i.stack.imgur.com/Xt20L.png) Is this achievable in TeX/LaTeX? That is how does one set up the page so that all text will appear in a 'text column' and the figures appear in a 'figures column' in every page?


title: Throw warning based on distance from the bottom

text: Is there a way to specify a warning in `LaTeX` which is thrown if and only if a specified text is not at the bottom (or near the bottom) of the page? Use-case: manual column-breaking is needed due to some package shortcoming, the warning is there to warn the user if the column break has moved upwards or downwards on the page. related: Two columns in twocolumn mode


title: Three different styles of heading

text: I'm wanting to adapt the following macro(s) to provide three different options of style heading. At the moment, if offers two, one if the section is normal (numbered) and another for section* (un-numbered). I want a second un-numbered option (which will have an margin image (with a second, different icon to people.pdf) instead). I've remarked-out (%) the two lines with `ssection` in them (i.e. the inadequate definition and the corresponding line in the sample document), because that produces an error. I understand that it can't be done simply by adding a third definition, because there's an `ifstar` statement with only two options, not three. Thus I'm unsure how to proceed. Existing macro outputs thus: ![](http://cl.ly/082k1i2w0e2t/sidebar-images.pdf) (I'd also be interested to know if there is a way of adapting a subsequent `titlebar@@@` definitions by building on one of the other ones…but perhaps that warrants a separate question?)               \documentclass{report}     \usepackage{graphicx}     \usepackage[nopar]{lipsum}     \usepackage[noadjust]{marginnote}          \usepackage{titlesec}     \usepackage{tikz}\usetikzlibrary{shapes.misc}     \makeatletter          %   number section bar           \newcommand\titlebar@{%sections     \tikz[baseline,trim left=3.1cm,trim right=3.0cm] {         \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);         \node [             fill=black!100!white,             anchor= base east,             rounded rectangle,             minimum height=3.75ex] at (3cm,0.01) {             \color{white}\textbf{T\thesection}                 };     }}          %   section bar, icon 1      \newcommand\titlebar@@{%osections     \tikz[baseline,trim left=3.1cm,trim right=3.15cm] {         \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);         }     \marginpar{\vskip-1.9cm\hspace{-14cm}     \includegraphics[width=\marginparwidth]     {people.pdf}    }         }          %   section bar, icon 2      \newcommand\titlebar@@@{%ssections     \tikz[baseline,trim left=3.1cm,trim right=3.15cm] {         \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);         }     \marginpar{\vskip-1.9cm\hspace{-14cm}     \includegraphics[width=\marginparwidth]{people.pdf}}}          %   make title commands     \newcommand\titlebar{\@ifstar\titlebar@@\titlebar@}     \titleformat{\section}{\large\bfseries}{\titlebar}{0.1cm}{}     \renewcommand*{\thesection}{\arabic{section}}     \newcommand{\osection}[1]{\section*{\titlebar*#1}}     %   \newcommand{\ssection}[1]{\section*{\titlebar*#1}}     \makeatother                              \begin{document}       \chapter{test}     \osection{person}         \lipsum[1]     \section{another}     \lipsum[1]       %\ssection{another}     \lipsum[1]       \end{document}


title: Can't compile with most recent version of TeX Live (2013)

text: I have used a tex template for my CV for years. But I recently migrated everything to a new Mac running OS 10.8.4 and the document will no longer compile. I have confirmed that the file compiles fine on OS 10.7.5. I'm working with the latest MacTex distribution on both computers. The error generated is:               ! Incomplete \iffalse; all text was ignored after line 113.      Line 113 is the first usage:               /ressubheading      in this block:               \documentclass[letterpaper,10pt]{article}     \newlength{\outerbordwidth}     \pagestyle{empty}     \raggedbottom     \raggedright     \usepackage[svgnames]{xcolor}     \usepackage{hyperref}     \usepackage{framed}     \usepackage{tocloft}     \usepackage{textcomp}     \usepackage{hanging}     \usepackage{geometry}     \usepackage{url}     \usepackage{hyperref}     \usepackage{lastpage}     \usepackage{fancyhdr}     \usepackage{color,soul}     \usepackage{framed}               % settings for hyperlinks     \hypersetup{         bookmarks=true,         % show bookmarks bar?         unicode=false,          % non-Latin characters in AcrobatÕs bookmarks         pdftoolbar=true,        % show AcrobatÕs toolbar?         pdfmenubar=true,        % show AcrobatÕs menu?         pdffitwindow=false,     % window fit to page when opened         pdfstartview={FitH},    % fits the width of the page to the window         pdftitle={My Title},    % title         pdfauthor={Me},     % author         pdfsubject={Subject},   % subject of the document         pdfcreator={Creator},   % creator of the document         pdfproducer={Producer}, % producer of the document         pdfkeywords={keywords}, % list of keywords         pdfnewwindow=true,      % links in new window         colorlinks=true,       % false: boxed links; true: colored links         linkcolor=red,          % color of internal links         citecolor=green,        % color of links to bibliography         filecolor=magenta,      % color of file links         urlcolor=blue           % color of external links     }               %-----------------------------------------------------------     %Edit these values as you see fit          \setlength{\outerbordwidth}{2.5pt}  % Width of border outside of title bars     \definecolor{shadecolor}{gray}{0.75}  % Outer background color of title bars (0 = black, 1 = white)     \definecolor{shadecolorB}{gray}{0.9}  % Inner background color of title bars               %-----------------------------------------------------------     %Margin setup          \setlength{\evensidemargin}{-0.25in}     \setlength{\headheight}{0in}     \setlength{\headsep}{0in}     \setlength{\oddsidemargin}{-0.25in}     \setlength{\paperheight}{11in}     \setlength{\paperwidth}{8.5in}     \setlength{\tabcolsep}{0in}     \setlength{\textheight}{9.0in}     \setlength{\textwidth}{7in}     \setlength{\topmargin}{-0.3in}     \setlength{\topskip}{0in}     \setlength{\voffset}{0.1in}               %-----------------------------------------------------------     %Custom commands     \newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}     \newcommand{\resheading}[1]{\vspace{8pt}       \parbox{\textwidth}{\setlength{\FrameSep}{\outerbordwidth}         \begin{shaded}     \setlength{\fboxsep}{0pt}\framebox[\textwidth][l]{\setlength{\fboxsep}   {4pt}\fcolorbox{shadecolorB}{shadecolorB}{\textbf{\sffamily{\mbox{~}\makebox[6.762in][l]{\large #1} \vphantom{p\^{E}}}}}}         \end{shaded}       }\vspace{-7pt}     }     \newcommand{\ressubheading}[4]{     \begin{tabular*}{6.5in}{l@{\cftdotfill{\cftsecdotsep}\extracolsep{\fill}}r}         \textbf{#1} & #2 \\         \textit{#3} & \textit{#4} \\     \end{tabular*}\vspace{-6pt}}          %-----------------------------------------------------------               \begin{document}          %%%%%%%%%%%%%%%%%%footer settings     \pagestyle{fancy}     \fancyhf{} % clear all header and footer fields     \fancyfoot[L]{\footnotesize \hspace{0.5in}J. A. Smith}     \fancyfoot[C]{\footnotesize \textit{Curriculum Vitae}}     \fancyfoot[R]{\footnotesize Page \thepage\ of 1 \hspace{0.5in}}     \renewcommand{\headrulewidth}{0pt}     \renewcommand{\footrulewidth}{0pt}     %%%%%%%%%%%%%%%%%%end footer settings          \begin{tabular*}{7in}{l@{\extracolsep{\fill}}r}     \textbf{\Large Joeseph A. Smith}\\     Assistant Professor -- Department of Biological Sciences\\     Curator of Mammals -- Museum of Natural Science\\     \url{http://www.foo.edu/Smith} & \href{mailto:Smith@xxx.edu}{\nolinkurl{Smith@xxx.edu}}     \end{tabular*}     \\          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \resheading{Education}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{itemize}         \item             \ressubheading{University of Foo}{Foo}{Ph.D. Ecology \& Evolutionary Biology}{2010}             \begin{itemize}                 \resitem{Dissertation Title: blah blah}         \end{itemize}              \item         \ressubheading{Boo State University}{Boo}{B.S. Biology}{2000}     \end{itemize}               \end{document}          It's hard to believe this a problem with the code (even though that's what the error suggests), given that it compiles fine on the earlier OS, but I am not very experienced at customizing tex docs. Thanks in advance for any help!


title: setspace.sty not found

text: I'm trying to do double-spacing using the `setspace` package, but I'm getting a `setspace.sty` not found error. My code looks like this:               \documentclass{article}     \usepackage{setspace}          \begin{document}     \doublespacing     body     \end{document}       Is this wrong? Is the `setspace` package out of date? Is it possible it is not installed on my system? I'm the Emacs LaTeX package (TeX Live I think it is called?)


title: How to make listings code correct copyable from PDF and with hyperlink

text: If I generate listings code with line numbers and copy the result from the PDF I can not use it again as tex code. First the line numbers are included which they should not, second spaces are included which should not appear. For example with this code:               \documentclass{scrbook}          \usepackage{listings}          \lstdefinestyle{demostyle}{         basicstyle=\small\ttfamily,         numbers=left,         stepnumber=1,         frame=single,     }          \begin{document}     \begin{lstlisting}[style=demostyle]     \textbf{\textit{foobar}}     \textit{\sffamily foobar}}     \end{lstlisting}     \end{document}      you get this result:               1    \ textbf {\ textit { foobar }}     2    \ textit {\ sffamily   foobar }}      Here I found a solution in How to make listings code indentation remain unchanged when copied from pdf?.               \lstset{columns=flexible}     \lstset{keepspaces=true}     \makeatletter     \def\lst@outputspace{{\ifx\lst@bkgcolor\empty\color{white}\else\lst@bkgcolor\fi\lst@visiblespace}}     \makeatother      However it is not clear to me how reader-safe the solution is. It works for me in PDF-XChange. However, the line numbers are still copyable. Can this be solved as well? Besides this problem - is it possible to add a link to the PDF which copies the code to the clipboard? The code should not be in a file, it shall be part of the PDF but nevertheless linked with a hyperlink as a file to download. EDIT (embedfile does not what I expect)               \documentclass{scrbook}     \usepackage{embedfile}     \usepackage{filecontents}          \begin{filecontents*}{democode}     \so{letterspacing}, \\     \ul{underlining},   \\     \st{overstriking}   \\     and \hl{highlighting}.      \end{filecontents*}          \begin{document}     Any Text.          \embedfile[]{democode.tex}     \embedfilesetup{view}     \end{document}      Basically the code compiles but nothing further is visible. From the doc I do not understand how this package shall be used anyway. Especially I do not know how to link or view the embedded files. EDIT2 (attachfile) I also tested the package attachfile. It links to a file, but the link is not text, but an annotation which is almost invisible. Tested with:               \textattachfile{democode.tex}{source code}


title: How to change chapter created by \printindex to section?

text: I wonder if there is a solution to the following problem: I wanted to create an index with the package `makeidx` and the `scrartcl` document class. `\printindex` creates a chapter called "Index". But all I wanted to have is a section (!) called "Index". (I cant find anything in the `makeidx` doc about this.) How can this be done? Any ideas?               \documentclass[]{scrartcl}          \usepackage{makeidx}          \makeindex          \begin{document}              This is a test\index{test} text.              \printindex % prints out a chapter but i want a section to be printed.          \end{document}


title: Get biblatex-chicago working

text: I'm writing an essay and I need to have superscript citations in either Chicago or MLA style. After a bit of searching (and a false start with `natbib`) this question seemed to indicate that Chicago with `biblatex` and `biblatex-chicago` would work. However I'll be darned if I can figured out the documentation for the two. The `biblatex-chicago` doesn't seem to have an example of how to set it up, and I got conflict messages when I tried to load `biblatex` then `biblatex-chicago` so I went for the simplest option, which was to use \usepackage[style=chicago-notes]{biblatex} as follows:               \documentclass[12pt,letterpaper]{article}     \usepackage[style=chicago-notes]{biblatex}     \addbibresource{test.bib}          \begin{document}     ``The adherence of England to a military system, inherited from the last century, can only be explained by her insular position and the security from invasion afforded by a powerful navy.'' --Emory Upton \cite[268]{Upton}     \printbibliography     \end{document}      In test.bib I have:               @book{Upton,       title={The armies of Asia and Europe: embracing official reports on the armies of Japan, China, India, Persia, Italy, Russia, Austria, Germany, France, and England.},       author={Upton, Emory},       year={1878},       publisher={Griffin \& co.}     }      I then get the error:               [...]     Package biblatex Info: Redefining '\fullcite'. ! LaTeX Error:     \lbx@fromlang undefined.      Can someone point out what I'm doing wrong? I've tried to make a minimal example, but I can't get things to work. I'm on TeXLive 2011. If you can't figure this out I'll also take answers that will get me either MLA or Chicago style with superscript citations that let me specify page number at the time of citation, since I'm going to be making dozens of citations to 2 or 3 books. Note I made an even more minimal example:               \documentclass[12pt,letterpaper]{article}     \usepackage[style=chicago-notes]{biblatex}          \begin{document}     \end{document}      How on earth am I messing this up? According to TeXStudio the error is at > chicago-notes.cbx line 2493: \lbx@fromlang undefined. > \renewcommand*{\lbx@fromlang} Thank you for your help. Output of \listfiles                *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)     biblatex.sty    2011/07/29 v1.6 programmable bibliographies     etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX         etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)       logreq.sty    2010/08/04 v1.0 xml request logger       logreq.def    2010/08/04 v1.0 logreq spec v1.0       ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)          url.sty    2006/04/12  ver 3.3  Verb mode for urls, etc.     blx-compat.def    2011/07/29 v1.6 biblatex generic compatibility     biblatex.def    2011/07/29 v1.6 biblatex generic definitions     chicago-notes.bbx    2011/03/17 v 1.3 biblatex bibliography style     chicago-notes.cbx    2011/03/17 v 1.3 biblatex citation style     biblatex.cfg          english.lbx    2011/07/29 v1.6 biblatex localization


title: single line - no indentation break before and after

text: What's the easiest way to have a line not indented and with a break before and after? Example: > Following the list of ingredients: > >   * carrots >   * ... > The Latex-Code would be:               Following the list of ingredients:          \begin{enumerate}         \item carrots         \item ...     \end{enumerate}      By default the line would be indented and without preceeding line break. Any suggestions for a short-macro to have single lines? I sometimes use               \ \\ Following the list of ingredients:


title: Using predefined constants with TikZ

text: I can't seem to get definitions of constants working in TikZ. I looked at this related question question and that too did not work for me. This example works, but not if the swap the `\coordinate` definition:               \documentclass{article}     \usepackage{pgfplots}     \usepackage{ifthen}          \newcommand{\PI}{3.14}          \newcommand{\ValueOf}[1]{%         \ifthenelse{\equal{#1}{PIE}}{3.14159}{}%         \ifthenelse{\equal{#1}{E}}{2.78}{}%     }          \begin{document}              Value of -PIE is -\ValueOf{PIE}.\par         Value of E is \ValueOf{E}.              \begin{tikzpicture}              \coordinate (PointA)  at (-\PI,-1);             % Only this works         %\coordinate (PointA) at (-\ValueOf{PIE},-1);          %\coordinate (PointA) at (\pgfextra{\pgfmathparse{-\ValueOf{PIE}}},-1);               \draw (PointA) circle (1);          \end{tikzpicture}     \end{document}      In case it is related, the package versions I have are: **pgfplots 2010/07/14 Version 1.4**   **pgf 2008/01/15 v2.00 (rcs-revision 1.12)**


title: How to get a list of all the labels in a LaTeX document in WinEdt

text: I am writing a large document using LaTeX and WinEdt. I have labeled each chapter, section and so on. I would like to print out a list of just the labels (so that I don't duplicate one later on, and so that I have it handy in order to write `\ref`s). Is there a way to do this?


title: First row in second table created is blacked out

text: I am a LATEX/R/Sweave newbie and am encountering an issue while creating a report. The issue is that as shown in the figure below the first heading in the second table is blacked out. ![Blacked out tables](http://i.imgur.com/NkZtUq7.png) I am able to replicate the issue with the below code:               \documentclass[xcolor=table,professionalfonts,a4paper,11pt]{article}     \usepackage[margin=1.0in]{geometry}     \usepackage{graphicx}     \usepackage{booktabs}     \usepackage{multicol}     \usepackage[skip=12pt]{caption}     \usepackage{colortbl, xcolor}     \usepackage{helvet}     \usepackage[noae]{Sweave}          \begin{document}          <<echo=FALSE, results=tex>>=     # Data     tabulatedVal <- data.frame(     Statistics = c("Annualized Return (%)", "Standard Deviation (%)", "Skewness", "Kurtosis", "Sharpe Ratio", "Maximum Drawdown", "Percent of losing months", "Worst Monthly Return", "Worst Yearly Return"),     Value =c(0.09, 6.77, 0.11, 3.18, 1.34, 5.20, 31.84, -4.09, -0.33))          #Table 1        createdXTable <- xtable(tabulatedVal, digits = 2)     rws <- seq(1, nrow(tabulatedVal), by=2)     col <- rep("\\rowcolor{blue!10}", length(rws))     print(createdXTable, booktabs=TRUE, add.to.row=list(pos=as.list(rws), command=col), include.rownames=FALSE, size="\\small")               # Table 2     createdXTable <- xtable(tabulatedVal, digits = 2)     rws <- seq(1, nrow(tabulatedVal), by=2)     print(createdXTable, booktabs=TRUE, add.to.row=list(pos=as.list(rws), command=col), include.rownames=FALSE, size="\\small")     @               \end{document}      The .tex file being generated is as follows:               \documentclass[xcolor=table,professionalfonts,a4paper,11pt]{article}     \usepackage[margin=1.0in]{geometry}     \usepackage{graphicx}     \usepackage{booktabs}     \usepackage{multicol}     \usepackage[skip=12pt]{caption}     \usepackage{colortbl, xcolor}     \usepackage{helvet}     \usepackage[noae]{Sweave}          \begin{document}          % latex table generated in R 3.0.1 by xtable 1.7-1 package     % Mon Apr 14 20:29:43 2014     \begin{table}[ht]     \centering     {\small     \begin{tabular}{lr}       \toprule     Statistics & Value \\        \midrule     Annualized Return (\%) & 0.09 \\         \rowcolor{blue!10}Standard Deviation (\%) & 6.77 \\        Skewness & 0.11 \\         \rowcolor{blue!10}Kurtosis & 3.18 \\        Sharpe Ratio & 1.34 \\         \rowcolor{blue!10}Maximum Drawdown & 5.20 \\        Percent of losing months & 31.84 \\         \rowcolor{blue!10}Worst Monthly Return & -4.09 \\        Worst Yearly Return & -0.33 \\         \rowcolor{blue!10} \bottomrule     \end{tabular}     }     \end{table}% latex table generated in R 3.0.1 by xtable 1.7-1 package     % Mon Apr 14 20:29:43 2014     \begin{table}[ht]     \centering     {\small     \begin{tabular}{lr}       \toprule     Statistics & Value \\        \midrule     Annualized Return (\%) & 0.09 \\         \rowcolor{blue!10}Standard Deviation (\%) & 6.77 \\        Skewness & 0.11 \\         \rowcolor{blue!10}Kurtosis & 3.18 \\        Sharpe Ratio & 1.34 \\         \rowcolor{blue!10}Maximum Drawdown & 5.20 \\        Percent of losing months & 31.84 \\         \rowcolor{blue!10}Worst Monthly Return & -4.09 \\        Worst Yearly Return & -0.33 \\         \rowcolor{blue!10} \bottomrule     \end{tabular}     }     \end{table}          \end{document}      Any help is appreciated. Thanks


title: Redefining the section command, keeping the starred definition

text: Currently, I'm working with a document based on the standard `book.cls`. I redefined the section command (unstarred) to get a more fancy heading. But while doing this, I ran into some walls.               \renewcommand{\section}{\secdef\@section\@ssection}     \newcommand{\@section}[2][?]{...}      Well obviously, I've redefined the unstarred version with `\@section`, and together with `\secdef` I fixed bugs in the ToC (strange doublings) and tried to keep the definition of the starred version. To make it short, it doesn't work... here is the output:               ! Undefined control sequence.     \reserved@a *->\@ssection      Does anybody know how to handle it? Even `\let` doesn't help here...


title: Simplest way to typeset entire document in sans serif (Helvetica)

text: How do I typeset an entire document in Helvetica/sans serif without littering the document with font changes for every heading/paragraph, etc.? Like this but with the paragraphs all in Helvetica. For example, I've seen documents typeset in Computer Modern and then switched to Palatino, but can I do the same with Helvetica with a few commands at the beginning? (And please don't tell me to use a serif font for body copy / paragraphs. I know. I'm trying to use latex to typeset my resume to look like the one I've created in a word processor, which is hard to maintain but looks good. I'm hoping latex will let me do more advanced formatting/layout, separating content from form.)


title: How to use  \sffamily for the whole document

text: > **Possible Duplicate:**   >  Simplest way to typeset entire document in sans serif (Helvetica) How to use `\sffamily` for the whole document?


title: How do I switch all fonts in a document to a sans-serif family?

text: > **Possible Duplicate:**   >  Simplest way to typeset entire document in sans serif (Helvetica) I use document class `article` and included               \usepackage{helvet}      I now begin my document with               \begin{document}       \sf     % select sans-serif family       % ... text here ...      Most text is indeed _sans-serif_. But fur example the **footnotes** and `{\bf bold text}` is not. Let me summarize a test document:               \documentclass[12pt,english]{article}     \usepackage{helvet}     \begin{document}       \sf  % select sans-serif family       \title{Document title is sans-serif, fine}       \maketitle            Normal Text is sans-serif, too.  % sans-serif, ok.            {\bf This bold text should be sans-serif, too.} % bold, but roman!!!     \end{document}


title: LaTeX3 Property lists and expansion

text: So, I'm trying to pass the "date" value associated with the current environment to a property list defined by a macro. It doesn't seem to work and I'm not sure why. Here's a MWE:               \documentclass{article}     \usepackage{expl3,xparse}     \ExplSyntaxOn          \tl_new:N \l_thedate_tl          \NewDocumentEnvironment{Day}{m}{       \tl_set:Nn \l_thedate_tl {#1}       \begin{center}         \textbf{#1}       \end{center}       Begin:\\     }{     \\     End.     }          \NewDocumentCommand{\writeentry}{mm}{       \prop_new:c {g_#1_prop}       \prop_gput:cnn {g_#1_prop} {key} {#1}       \prop_gput:cnn {g_#1_prop} {value} {#2}       \prop_gput:cnn {g_#1_prop} {date} {\tl_to_str:N \l_thedate_tl}       #1 \hspace{2em} #2     }          \NewDocumentCommand{\getdate}{m}{       \prop_get:cn {g_#1_prop} {date}     }     \NewDocumentCommand{\getvalue}{m}{       \prop_get:cn {g_#1_prop}{value}     }     \ExplSyntaxOff     \begin{document}          \begin{Day}{14 April}       \writeentry{foo}{Something}            \writeentry{bar}{Something else}     \end{Day}          Get Value: \getvalue{foo} \hspace{2em}     Get Date: \getdate{foo}     \end{document}      As you can see, the `\getdate` function doesn't print anything. But as I understand it, it should print the value that `\l_thedate_tl` had when the property list was set. What am I doing wrong?


title: Chapter subtitle

text: I want a chapter subtitle (half the size of the font of the chapter title) within the rulers of the chapter title. The subtitle must not appear in the Table of Contents. I have this               \makechapterstyle{mychapterstyle}{%         \renewcommand{\chapnamefont}{\LARGE\sffamily\bfseries}%         \renewcommand{\chapnumfont}{\LARGE\sffamily\bfseries}%         \renewcommand{\chaptitlefont}{\Huge\sffamily\bfseries}%         \renewcommand{\printchaptertitle}[1]  {%             \chaptitlefont\hrule height 0.5pt \vspace{1em}%             {##1}\vspace{1em}\hrule height 0.5pt%             }%          \renewcommand{\printchapternum}{%             \chapnumfont\thechapter%             }%     }     \chapterstyle{mychapterstyle}     \setsecheadstyle{\Large\sffamily\bfseries}     \setsubsecheadstyle{\large\sffamily\bfseries}     \setsubsubsecheadstyle{\normalfont\sffamily\bfseries}     \setparaheadstyle{\normalfont\sffamily}     \makeevenhead{headings}{\thepage}{}{\small\slshape\leftmark}     \makeoddhead{headings}{\small\slshape\rightmark}{}{\thepage}      Can someone help?


title: Aquamacs Preview doesn't work

text: I've been using `aquamacs` 2.4 on my osx 10.7.5. After it crashed with my font change operation, the preview menu bar disappeared and doen't appear again after rerunning the program. Although I reinstalled the `aquamacs` package, the problem was not fixed. Could anybody help me on this problem?


title: Redefine \subref after redefinition of \ref

text: I have redefined `\ref` like this:               \renewcommand{\ref}[1]{\autoref{#1}}      so that I get "Figure nn" automatically by default. However, this makes `\subref` (from package `subcaption`) behave incorrectly. How can `\subref` be redefined to get its correct behavior while keeping the redefined behavior of `\ref`?


title: How to draw a tree with fixed node distances?

text: I am trying to build on the filesystem tree example. I have a similar requirement to display a hierarchical tree, but I'm struggling to get the tree layout right. In the example, the link between a node and its child always extends from the center of the parent node. I have managed to change the design in a way that all vertical lines start at a fixed distance from the left edge of the parent node so that all vertical lines are aligned, no matter what the size of the parent node is. However, the child nodes themselves still appear to be positioned in relation to the center of the parent node, making the tree look rather untidy. How can I change this so that the nodes are aligned as well? ![enter image description here](http://i.stack.imgur.com/S4HjO.png)               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{trees}     \begin{document}     \tikzstyle{every node}=[draw=black,thick,anchor=west]     \begin{tikzpicture}[%       grow via three points={one child at (0.5,-0.7) and       two children at (0.5,-0.7) and (0.5,-1.4)},       edge from parent path={([xshift=2ex]\tikzparentnode.south west) |- (\tikzchildnode.west)}]       \node{root}         child { node {shrt}           child { node {looonger}              child { node {veryveryverylong} }           }           child [missing] {}                           child [missing] {}                           child { node {looonger} }           child { node {veryveryverylong}              child { node {shrt} }             child { node {looonger} }             child { node {veryveryverylong} }           }         }         child [missing] {}                       child [missing] {}                       child [missing] {}                       child [missing] {}                       child [missing] {}                       child [missing] {}                       child [missing] {}                       child [missing] {}                       child { node {veryveryverylong}            child { node {shrt} }           child { node {looonger} }         };     \end{tikzpicture}     \end{document}


title: Add whitespace around a box

text: I want to put some text in a box like `\fcolorbox{red}{gray}{text}` but such that moreover, the box is surrounded by an (non visible) space. So that if i put to such boxes near each other, there will be a small space between them. An such that if i put two such boxes in a `\frac{}{}` there will be some space between them and the fraction line. What would be the shortest way to do it ?


title: Solutions to problem sheets

text: For writing problem sheets I have a customized theorem environment called `pr` for the problem and a specialcomment called `solution` for the solution. See example below. Now my question is, if it is possible to get _automatically_ the following: First page(s): Problem sheet without solutions   next page(s): Problem sheet with solution below each problem I would strongly prefer solutions which don't use a special documentclass like `exam`.               \documentclass[a4paper, 11pt]{article}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amsmath} %     \usepackage{nccmath}     \usepackage{amsfonts} %     \usepackage{enumerate}     \usepackage[amsmath]{ntheorem}%          \makeatletter     \newtheoremstyle{mystyle}%       {\item[\rlap{\vbox{\hbox{\hskip\labelsep \theorem@headerfont%               ##1\ ##2\theorem@separator}\hbox{\strut}}}]}%}       {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\theorem@separator]%         \hfill{\normalfont(##3)}\newline}       \theorembodyfont{\normalfont}       \theoremindent0cm     \makeatother     \theoremstyle{mystyle}          \newtheorem{pr}{Problem}          \usepackage{comment}     \specialcomment{solution}{\noindent\small Solution: }{\\\normalfont \normalsize}          %\excludecomment{solution}               \begin{document}          \begin{pr}        Problem     \end{pr}          \begin{solution}        Solution     \end{solution}          \begin{pr}        Problem     \end{pr}          \begin{solution}        Solution     \end{solution}               \end{document}


title: How to keep alignment consistent with non-LaTeX contents?

text: I am using "almost LaTeX" from the JetPack plugin for my WordPress blog where I post course work. How do I get the generated formulae to _centre_ on the line so the equals sign lines up with the normal text that I have typed? to see what I mean please check this blog entry. here are a the two offending pieces of LaTeX for the last two equations of the equations:               $latex = \large{\dfrac{1}{62,000}} $      and               \left(\large{\dfrac{10,000}{62,000,000}}\right) 100\% $      thanks for your time :)


title: Why isn't dvips finding my Type 1 fonts?

text: I've installed Cygwin on two Windows 7 machines. Both of them have the Adobe basic 35 fonts installed in the system as Type 1 fonts. Yet when I run a file that uses, say, Palatino through dvips, the resulting PostScript output uses Palatino-Roman on one machine and URWPalladioL-Roma on the other. I created the dvi file by giving the following input to LaTeX:               \documentclass{article}     \usepackage{palatino}     \title{Testing}     \begin{document}     This text should come out in Palatino.     \end{document}      It doesn't get much simpler than that. What's a good strategy for figuring out why dvips finds the Adobe fonts on one machine and not on the other?


title: Missing font shapes

text: I have a problem with missing font shapes. I'm working on lecture notes and made some corrections to a very large latex document, so I did not set up everything by myself. Now I encoutered the problem that certain math symbols in sections and subsections were replaced with a black square. The document uses hvmath.sty and tools.sty. The header file looks like this (with only a single section inside the document):               \documentclass[a4paper,12pt,pointlessnumbers,twoside,final]{scrbook}     %\documentclass[a4paper,12pt,pointlessnumbers,oneside,draft]{scrbook}     %\documentclass[a4paper,12pt,pointlessnumbers,twoside,draft]{scrbook}          %Draft als Hintergrund     %\usepackage[light,first,timestamp]{draftcopy}          \usepackage[outline,none,landscape,bottom]{draftcopy}     \draftcopyName{\today}{100}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[intlimits]{amsmath}     \usepackage{amsxtra}     \usepackage{amssymb}     \usepackage{mathrsfs}     %labels werden angezeigt     \usepackage{showkeys}     \usepackage{graphicx}     \usepackage{dsfont}     \usepackage{multirow}     %\usepackage{bbding}     % fuer alte grafiken     \usepackage{epsfig}     % Boldface-math environment in all headings     \usepackage{hvmath}     \usepackage{pstricks-add}     \usepackage{pst-all}          \usepackage{subfigure}     %\usepackage[varumlaut]{yfonts}          \usepackage{tools}     \usepackage{psfrag}     \usepackage{pstricks-add}          \usepackage{scalefnt}     \usepackage{tikz}     \tikzset{>=stealth}     \tikzset{       big arrow/.style={         decoration={markings,mark=at position 1 with {\arrow[scale=3,#1]{>}}},         postaction={decorate},         shorten >=0.4pt},       big arrow/.default=black}     \tikzset{       big arrow2/.style={         decoration={markings,mark=at position 1 with {\arrow[scale=2,#1]{>}}},         postaction={decorate},         shorten >=0.4pt},       big arrow2/.default=black}     \usetikzlibrary{intersections, decorations,circuits.ee.IEC, calc, decorations.markings, patterns}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}          % zur indexerstellung     \usepackage{index}     \makeindex          %%%%%%%%%%%%%% pssignpost definition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \makeatletter     \def\pssignpost[#1]#2#3{     \psframebox[framearc=0.5,framesep=.4,fillstyle=solid,fillcolor=lightgray]{\parbox{2.5cm}{\sf\bfseries\begin{tabular}{p{1.25cm}*{2}rr} #2 & #3\end{tabular}}}     \psline[#1](-1.8,-.64)(-1.8,.9)     \pstriangle[linecolor=black,fillstyle=solid,fillcolor=lightgray,gangle=90](-.4,.13)(1.9,-1.75)     \psframe[linecolor=lightgray,fillstyle=solid,fillcolor=lightgray](-.5,-.585)(-.25,.858)     }     \makeatother          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %Weniger Worttrennungen     \sloppy          \graphicspath{{Bilder/}}          \addtokomafont{captionlabel}{\sffamily\bfseries\small}     \addtokomafont{caption}{\small}     %kein Einzug/Absatz bei Bildunterschriften     \setcapindent{0em}     %Für verbesserten Seitenumbruch     \tolerance=270 \emergencystretch=30pt          % Boldface-math environment in al headings     \addtokomafont{sectioning}{\mathversion{hvmathbold}}          %%%%%%%%%%%%%% part definition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \renewcommand*{\partformat}{\thepart~}     \renewcommand*{\partpagestyle}{empty}               \makeatletter     \def\@part[#1]#2{%         \ifnum \c@secnumdepth >-2\relax           \refstepcounter{part}%           \@maybeautodot\thepart%           \addcontentsline{toc}{part}{\protect\numberline{\thepart}#1}%         \else           \addcontentsline{toc}{part}{#1}%         \fi         \partmark{#1}%         {%\@parskipfalse\@parskip@indent %auskommentiert, da fehlermeldung unter windows!         \centering          \interlinepenalty \@M          \normalfont\sectfont          \ifnum \c@secnumdepth >-2\relax            \size@partnumber\partformat            %\par            %\vskip 20\p@          \fi         \size@part #2\strut\par}%         \@endpart}     \makeatother     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}     \section{Relativistically invariant $\Delta$-functions}     \end{document}      When I compile it, the \Delta in the section is replaced with a black square and I get the following warning               LaTeX Font Warning: Font shape `OMX/phv/b/n' undefined     (Font)              using `OMX/cmex/m/n' instead on input line 121.      Does anybody know how to fix that? I


title: How can I translate keywords of algorithmic package?

text: How do I translate standard keywords of the `algorithmic` package like ( **if** , **then** ,...) to my language? If possible, I would like to do it without looking into source of `algorithmic` or `algorithm`.


title: Documentation of "%! TeX" codes

text: > **Possible Duplicate:**   >  When and why should I use %!TEX TS-program and %!TEX encoding? I want to create a list of "%! TeX" codes to a documentation file for my template and want it to be as complete, relevant and correct as possible and need a list of good on-line references that I can use as a basis and references. I only found a few samples at   * texworks TipsAndTricks   * teworks manual.pdf


title: Best practices for spacing regarding fractions and roots?

text: My problem is that I am about to write a longer mathematical text, and it will be filled with integrals. Integrals tend to be filled with pesky fractions, square roots and what not. Personally I feel like LaTeX is spacing things "wrongly" I prefer to have more space in my fractions, and a tad more space after the square roots. Look at the comparison below. The difference is small, but noticable. _How it normally looks_ ![enter image description here](http://i.stack.imgur.com/WmGhR.png) _How I prefer it to look_ ![enter image description here](http://i.stack.imgur.com/2gEYv.png) My question is that, I think doing these small fixes manually is bad. So my question is Should I avoid doing it? I mean is it "wrong"? And if not, is there a more automatic solution to this? (Right now I am merely putting in some space after the roots. like `\,` ) Here is a smaller MWE, I think the right side looks better than the left.               \documentclass[10pt,a4paper]{minimal}     \usepackage{mathtools}          \begin{document}          \begin{align*}     \int \frac{1+x^2}{1+x^4} \mathrm{d}x \qquad & \text{versus} \qquad \int \frac{\,1+x^2\,}{\,1+x^4\,}\, \mathrm{d}x\\     \int_1^\infty \frac{\mathrm{d}x}{x\sqrt{-1+\sqrt[n]{x}}} \qquad  & \text{versus} \qquad \int_1^\infty \frac{\mathrm{d}x}{\,x\sqrt{-1+\sqrt[n]{x}\,}\,}      \end{align*}          \end{document}


title: Boxed equation with empheq: adding text outside box

text: I'm trying to have a box around my align environment, so I do the following:               \usepackage{empheq}     \begin{empheq}[box=\fbox]{align}       equations     \end{empheq}      This works fine, but I would like to have above the box text as some kind of title for the box. So I try                \newcommand*\textfbox[2][Title]{          \begin{center}             \text{#2}          \end{center}          \fbox{#1}      }      And then replace `box=\fbox` with `box={\textfbox{the title that I want}}`. This does not work, it places the text next to the box and not above the box, so I have tried inserting `\par` or `\newline` but to no avail.


title: How to add custom C++ keywords to be recognized by Minted?

text: I have defined several structures and types in a `C++` project. I have to write some documentation for this code, and I use the minted package to typeset my code. I would like to be able to add some keywords to the `minted` database, so minted will also recognize these and give them the appropriate color. (I would like to have them colored in the same way a type, eg. `double` would be colored.)


title: Column background image

text: I have a two column frame (via wiki2beamer):               \documentclass{beamer}     \begin{document}          \begin{frame}     \frametitle{Background Test}          \begin{columns}              \column{0.3\textwidth}         \begin{itemize}             \item Left Column 1             \item Left Column 2         \end{itemize}              \column{0.7\textwidth}         \begin{itemize}             \item Right Column 1             \item Right Column 2         \end{itemize}          \end{columns}     \end{frame}     \end{document}      I'm trying to put a background image on one column. I've tried and failed with CTAN `adjustbox`, `background` & `wallpaper`. I'm shocked that `usebackgroundtemplate` appears to bind only to the page and has no other scope -- unless I'm mistaken (I'm new to LaTeX). Ideally, I'd like the background image to work with `\uncover` and `\only`.


title: Macros and environments that rely on the distinction between space and newline

text: In most cases, TeX does not distinguish between spaces and newlines. However, inside some macros and environments this distinction matters a lot. Time for a big list? Please edit the CW answer. This occurred when pondering about Forward-inverse search using SyncTeX with the precison of a single word; this "expert knowledge" is however also relevant for any tool that tries to preprocess (La)TeX code, such as `latexdiff`.


title: Customized citation keys with biblatex

text: I have what follows:               \documentclass{article}     \begin{filecontents*}{mybib.bib}     @ARTICLE{refconf,         author = {author},         title = {title},         keywords = {conference}}     @ARTICLE{refjour,         author = {author},         title = {title},         keywords = {journal}}     @ARTICLE{ref,         author = {author},         title = {title}}     \end{filecontents*}     \usepackage[style=numeric-comp,backend=biber]{biblatex}     \bibliography{mybib}     \defbibheading{bibempty}{}          \begin{document}     \cite{refjour}, \cite{refconf}, \cite{ref}     \subsection{Personal Conference references}     \printbibliography[keyword=conference,heading=bibempty]     \subsection{Personal Journal references}     \printbibliography[keyword=journal,heading=bibempty]     \subsection{Other references}     \printbibliography[heading=bibempty]     \end{document}      which is not too bad but I need to customize the labels such that `\cite{refjour}` yields [j.1] (j. for journal) in the main text as well as in the list of references, and that `\cite{refconf}` yields [c.1], and finally `\cite{ref}` yields [1].


title: custom function in pgf doesn't behave consistently

text: > **Possible Duplicate:**   >  Is plotting exponential graphs a known source of bugs in TikZ? I want to use a custom function in pgf plots and in text, like in this example:               \documentclass{standalone}      \usepackage{tikz,pgfplots}          \def\frho(#1){pow(#1,(1/\fKappa))}%          % \pgfmathdeclarefunction{rho}{1}{%     %   \pgfmathparse{pow(#1,(1/\fKappa))}%     % }          \begin{document}     \pgfmathsetmacro{\fKappa}{1.4}     \pgfmathparse{\frho(0.15)}$\rho(0.15) = \pgfmathresult$\\     \begin{tikzpicture}       \begin{axis}[name=upper,                     xmin=0,xmax=1,width=10cm,                     ymin=0,ymax=1,height=10cm,                     scale only axis,                     x dir=reverse,                     xlabel={$p$},                     ylabel={$\rho$}                     ]         \addplot[domain=0.001:1,samples=50,smooth] {\frho(x)};       \end{axis}     \end{tikzpicture}     \end{document}      The outcoming plot is correct, but the text result is not: the pdf says rho(0.15) = 3.84593. This happens with the `\def` variant as well as with the `\pgfmathdeclarefunction` variant. I don't think this might be caused by the limitations of `pow`, because one result is correct. How can I fix this?