title: How to avoid geometry affecting the first page?

text: > **Possible Duplicate:**   >  Remove margins for title page I'm using the package `geometry` to set the margins of my report, according to my needs (with a particularly wide right margin). However, it seems that it affects the front page as well, that is, the title of the report is not centered anymore in its page. How can I avoid this?


title: Positioning of equations

text: How would I shift my whole set of equations/calculations at the left, to be aligned with "Example"? ![enter image description here](http://i.stack.imgur.com/0JEWN.jpg)                   \documentclass[11pt,a4paper]{report}     \usepackage{amsmath,amsfonts,amssymb,amsthm,epsfig,epstopdf,titling,url,array}     \usepackage{parskip}               \theoremstyle{plain}     \newtheorem{thm}{Theorem}[chapter] % reset theorem numbering for each chapter     \newtheorem{lem}[thm]{Lemma}     \newtheorem{prop}[thm]{Proposition}     \newtheorem*{cor}{Corollary}          \theoremstyle{definition}     \newtheorem{defn}[thm]{Definition} % definition numbers are dependent on theorem numbers     \newtheorem{exmp}[thm]{Example} % same for example numbers     \newtheorem{conj}[thm]{Conjecture}          \theoremstyle{remark}     \newtheorem*{rem}{Remark}     \newtheorem*{note}{Note}               \title{My Thesis Title}     \author{My Name}     \date{\today}     \renewcommand\labelenumi{(\theenumi)}     \renewcommand\theenumi{\roman{enumi}}     \setlength{\parindent}{1em}          \begin{document}          \chapter{Addition}          \begin{exmp}      Here is an example.     \begin{align} \nonumber     (a+b)^3 &= (a+b)^2(a+b)\\ \nonumber     &=(a^2+2ab+b^2)(a+b)\\ \nonumber     &=(a^3+2a^2b+ab^2) + (a^2b+2ab^2+b^3)\\ \nonumber     &=a^3+3a^2b+3ab^2+b^3 \nonumber     \end{align}     \end{exmp}     \end{document}


title: Scan a cell of a table with lines

text: Is there any way in latex to scan a cell of a table with horizontal, vertical, diogonal with lines? I want similar thing as in below figure. Thanks. ![table](http://i.stack.imgur.com/4pWSL.png)


title: Typesetting unit-less numbers and number-less units

text: I am using the `siunitx` package to typeset my numbers, but sometimes I find situations in which I have numbers without units (when the units are not nearby) and units without numbers. E.g.:               The bird can fly 40 to 50 km per hour.          The data in the table above uses kg.      What is the prefered way to typeset these?               The bird can fly $40$ to $\SI{50}{\kilo\meter\per\hour}$.          The bird can fly \num{40} to \SI{50}{\kilo\meter\per\hour}.          The bird can fly \SI{40}{} to \SI{50}{\kilo\meter\per\hour}.          The data in the table above uses kg.          The data in the table above uses \SI{}{\kilo\gram}.      If find achieving visual consistency and correctness in the output is more important than having consistent, context-intelligent code.


title: Subfloat caption width requirements and alignment problems

text: I'm having problems with conflicting width requirements for subcaptions on subfloats that are horizontal versus vertical. I've spent considerable time searching here and more broadly, poring over the `subfig` package documentation, etc, and I figured out that the problem is with the widths. For the subfloats that are arranged horizontally, the subcaptions need to be 3 inches wide; for the subfloats that are arranged vertically, the subcaptions need to be 5 inches wide. If I specify a 3in subcaption width, the subcaptions for the 5in images look awful. If I specify anything over a 3in subcaption width, the subcaptions for the 3in images are offset to the right and run off the page. When I was not specifying caption widths at all, the subfloat subcaptions became very narrow and weird. I'm not sure how to resolve this; both subfloat arrangements need to be included in the same document. I realize that a custom environment might be in order, but don't have the first idea of how to construct something for this purpose. Here is the example MWE (to the best of my ability, it's a first try...)               \documentclass[11pt]{article}     \usepackage{tabulary}     \usepackage{ctable}     \usepackage{epsfig}     \usepackage{graphicx}     \usepackage{caption}     \usepackage{multirow}     \usepackage{amssymb}     \usepackage{subfig}          \captionsetup[subfloat]{     nearskip=20pt,     width=3in     }          \captionsetup{     format=hang,     width=5.5in,     }          \begin{document}          \title{Title}     \author{Me}     \date{\today}     \maketitle          Vertically arranged images:          \begin{figure}[htbp]     \begin{center}     \subfloat[Calibration image on the front of the view guide.]{\label{fig:vizcardfront}}\includegraphics[width=5in]{figures/viewcardfront.jpg}     \subfloat[Data submission form on the back of the view guide.]{\label{fig:vizcardback}}\includegraphics[width=5in]{figures/viewcardback.jpg}     \caption{The visibility monitoring view guide.}     \label{fig:viewcard}     \end{center}     \end{figure}          Horizontally arranged images:          \begin{figure}[htpb]     \begin{center}     \subfloat[A plantcam at a monitoring plot.]{\label{fig:plantcam}}{\includegraphics[width=3in]{figures/plantcam.jpg}}     \hfill     \subfloat[A HOBO$\textsuperscript{\textregistered}$ data logger for air and soil data.]{\label{fig:logger}}{\includegraphics[width=3in]{figures/logger.jpg}}     \caption{Automatic data collection instruments.}     \label{fig:autodata}     \end{center}     \end{figure}          \end{document}      Any assistance will be very much appreciated!


title: Scaling arrows in TikZ

text: I followed the link to sourceforge.net from Is it possible to change the size of an arrowhead in TikZ/PGF?. The last comment by left by Till Tantau led me to believe that I could implement code where I change the arrow size. So, I updated my TikZ packages from CVS. Then I tried to rescale the arrows. This is what I tried               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}       \coordinate (A) at (0,0);       \coordinate (B) at (3in,0);       \draw[arrows=-{stealth[width=1cm,length=1cm]}] (A) -- (B);     \end{tikzpicture}     \end{document}      But the code neither raises any errors nor does it seem to have any effect. Has anyone else tried to resize their arrows using the most recent CVS TikZ package? **UPDATE** I'm trying to follow the documentation in section 16.3 on `Arrow keys`. In fact, if I try to follow the example in the manual a bit more strictly, using `Stealth` instead of `stealth` I get an error message.


title: Table notes next to a table

text: Does anyone have a simple solution for using tables with notes (as in threeparttable's `\tnote`) in a way that lists the table notes on the right of the table, instead of underneath it? I have a table where such a layout would use the available space in an optimal fashion.


title: Cover Image and First Page Overlap

text: I'm extremely new to LaTeX and learning on my own, so I apologize if this is an obvious question. In my document, I'm using a pdf image as the first cover page, and additional pages after that. I found out how to include a cover image from previous questions here, but the cover is overlapping the first page - acting like a background behind the text. Images and text on the first page are superimposed over the cover. I'm constructing the document by having a main file and then \include-ing each section, including the cover page. The "cover" section is the following:               \thispagestyle{empty}     \begin{textblock*}{400mm}(0mm,0mm)     \includegraphics[width=\paperwidth]{coverimage.pdf}     \end{textblock*}      And this is the document info I'm using:               \documentclass[]{memoir}     \usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}     \usepackage{tabulary}     \usepackage{graphicx}     \usepackage{multirow}     \usepackage{multicol}     \usepackage{lipsum}     \usepackage{wrapfig}     \usepackage{charter}     \usepackage[absolute]{textpos}      I've tried not using include and just putting the cover image command on the "main" document but that doesn't work either. How can I fix this, and what am I doing wrong?


title: Force References Heading to Uppercase when calling \bibliography{bib filename}

text: Using `\bibliography{filename}` when I have               \documentclass[10pt,letterpaper,twocolumn]{article}      And               \bibliographystyle{plain}      before I call: `\bibliography{filename}` I get the heading "References" in bold. How do I force this heading to show up as 12pt upper case "REFERENCES" ?


title: "pgf Error: No shape named i-0 is known", but only upon 2nd run

text: ## Update 2012-01-31:   * This seems to be a version (and/or OS specific) problem. It breaks on my latest TeXLive2011 on a Mac, but I can get it to run on my PC version of MiKTeX 2.8, and @MarcvanDongen reports that it runs fine on a recently updated TeXLive on ubuntu.   * Also works fine with TeXLive2010 on Mac. * * * The MWE below runs fine the first time, but upon the 2nd run only I get the error message normally the result of the case when there are no intersections: > ./MyFigure.tex:49: Package pgf Error: No shape named i-0 is known. I am using the `usetikzlibrary{intersections}` to compute the intersection and don't see why this should have anything to do with any auxiliary files, especially since the intersection is computed just fine upon the first run. The MWE example below reproduces this error. It repeatedly includes `MyFigure.tex` which standalone yields: ![enter image description here](http://i.stack.imgur.com/EdzCK.png) ## Magical Fixes: However, there are several seemingly unrelated things that seem to _magically_ fix (or at least defer) this error, including:   1. Decreasing the `\NumberOfIterations` below `35`. Interestingly, in my actual usage I needed 42 instances to reproduce the problem, but somehow this number has shrunk when putting this into a MWE.  @JosephWright suggested that this has to do with the number of pages changing between runs. Interestingly, the second page of the TOC starts when `\NumberOfIterations` is set to `34`, and this case works fine.   2. Eliminating the Watermark by commenting `\def\AddWatermark{}` (Tested up to 1000).   3. Eliminate the phantom x-axis by commenting `\def\AddPhantomXAxis{}`.  In my actual usage I draw a phantom (i.e., `draw=none`) x-axis to name the path in case the axis was not named previously. I realize in this case I do not need it (since my graph draws the x-axis and names it), but if I eliminate this phantom axis by commenting `\def\AddPhantomXAxis{}`, then this compiles just fine (Tested up to 1000).   4. If I suppress the Table of Contents then things work just fine (Tested up to 1000). Comment out the line `\def\AddTOC{}` to test this.    5. It seems that just redefining the `\chapter` macro to be identical to `\section`, then things also work. However, if `\def\UseStandardChapter{}` is commented, the problem occurs at 42 iterations (exactly where the second page of the TOC would start). To simplify testing and hopefully help to get to the bottom of this problem I have provided several switches at the top:               \def\NumberOfIterations{35}% ok if this is 34 or less          % Commenting out any one of these results in the file being generated     \def\AddWatermark{}%       if commented works fine (tested to 1000)     \def\AddPhantomXAxis{}%    if commented works fine (tested to 1000)     \def\AddTOC{}%             if commented works fine (tested to 1000)     \def\UseStandardChapter{}% if commented, problem occurs at 42 (exactly where the second page of the TOC would start).      ## Notes:   * I am using TeXLive2011 on a Mac. Have been able to reproduce the exact problem with an a version updated as of 2012-01-27.   * Ensure that you remove the .aux files at beginning of first run, and ensure that you run it twice.   * In my real usage I am clearing the `name path globals` at the end of each picture via the solution from Is there a way to clear paths previously defined with name path global in TikZ. It appears to not be necessary in this case, and is commented out in the MWE . However, just in case someone thinks that the problem is related to that I did not delete it.   * The `\ShowIntersectionWithXAxisPath` is adapted from Intersections in PGFplots ## Question: Since this appears to be a bug, I am looking for a workaround that does not require me to eliminate the TOC, watermark, or phantom axis. ## Code:               % First run is always fine (tested with \NumberOfIterations=500).     % But, 2nd run errors with: Package pgf Error: No shape named i-0 is known.     \def\NumberOfIterations{35}% ok if this is 34 or less          % Commenting out any one of these results in the file being generated     \def\AddWatermark{}%       if commented works fine (tested to 1000)     \def\AddPhantomXAxis{}%    if commented works fine (tested to 1000)     \def\AddTOC{}%             if commented works fine (tested to 1000)     \def\UseStandardChapter{}% if commented, problem occurs at 42 (exactly where the second page of the TOC would start).          \documentclass{book}          \ifdefined\UseStandardChapter     \else         \renewcommand\chapter[1]{\section{#1}}     \fi          \usepackage{standalone}     \usepackage{pgfplots}     \usetikzlibrary{intersections}          \ifdefined\AddWatermark%% Problem on 2nd run if this is used         \usepackage[all,center]{background}%         \SetBgContents{\textsc{DRAFT}}%         \SetBgOpacity{0.2}%     \fi          %% Does not appear to be needed to reproduce problem     %% http://tex.stackexchange.com/questions/21421/is-there-a-way-to-clear-paths-previously-defined-with-name-path-global-in-tikz     %     %\makeatletter%     %\tikzset{%     %  clear global paths/.style={%     %    execute at end picture=\clear@global@paths,%     %    name path global/.append code={%     %      \ifx\global@paths\pgfutil@empty%     %      \gdef\global@paths{##1}%     %      \else%     %      \xdef\global@paths{\global@paths,##1}%     %      \fi%     %    }%     %  },%     %  clear global paths now/.code={%     %    \expandafter\global\expandafter\let\csname tikz@intersect@path@name@#1\endcsname=\relax%     %  }%     %}%     %\let\global@paths=\pgfutil@empty%     %\def\clear@global@paths{%     %  \edef\@temp{\noexpand\pgfkeys{/tikz/clear global paths now/.list={\global@paths}}}%     %  \@temp%     %  \global\let\global@paths=\pgfutil@empty%     %  \global\let\tikz@intersect@namedpaths=\pgfutil@empty%     %}%     %\makeatother%          %%-----------------------------------------------------     \usepackage{filecontents}     \begin{filecontents}{MyFigure.tex}     \documentclass{article}     \usepackage{standalone}     \usepackage{pgfplots}     \usetikzlibrary{intersections}          \begin{document}          \ifdefined\AddPhantomXAxis         \newcommand*{\DrawPhantomXAxis}{%% Problem on 2nd run if this is used             % Draw a non-visible x-axis so that it can be              % used to determine intersections with x-axis             \draw [mark=none, draw=none, name path=XAxisPath]%                 (current axis.left of origin) --%                 (current axis.right of origin);%         }%     \else% Do absolutely nothing.         \newcommand*{\DrawPhantomXAxis}{}%     \fi%               \newcommand*{\ShowIntersectionWithXAxisPath}[2]{         \DrawPhantomXAxis{}% in case graphs did not have an x axis drawn         \fill              [name intersections={of=#1 and XAxisPath, name=i, total=\t}]              [brown, opacity=1, every node/.style={black, opacity=1}]              \foreach \s in {1,...,\t}{(i-\s) circle (3pt)                 node [above left, red] {#2}};     }               \pgfmathdeclarefunction{GivenF}{1}{\pgfmathparse{exp(#1)-10^9}}     \begin{tikzpicture}          \begin{axis}[xmin=0.0, xmax=25, ymin=-1E9, ymax=1E9, xlabel=$x$, ylabel=$y$]           % Draw x-axis     \addplot [name path global=XAxisPath, gray,thin] coordinates{(0.0,0.0) (25,0.0)};          % Graph Function     \addplot[domain=0.0:21.42, samples=50, ultra thick, blue, name path global=GraphCurve]         ({x},{GivenF(x)})         node [left,yshift=-3.5ex,blue] {$y = e^x -10^9$};          \ShowIntersectionWithXAxisPath{GraphCurve}{$x \approx 20.723$}     \end{axis}      \end{tikzpicture}     \end{document}          \end{filecontents}     %-----------------------------------------------------          \begin{document}     \ifdefined\AddTOC         \pagenumbering{roman}         \tableofcontents         \pagenumbering{arabic}         \clearpage     \fi%          \chapter{First Chapter}     \foreach \x in {1,...,\NumberOfIterations}{         \section{Section \x}         \input{MyFigure.tex}     }     \end{document}


title: latex default settings paper, font, size, page numbering

text: I'm having a hard time grasping the structure of my "TeX" installation ... it is Tex Live 2010. I'm a european user - so some default settings are included ... but I need the most general, most uncustomized, most geniue, maybe most US version of LaTeX. Why does it make no difference: `\documentclass[a4paper]{article}` and `\documentclass{article}` on my system? Why do I get `\thispagestyle{empty}` still a page number at the bottom center for my title page? Thanks.


title: Tufte-Handout and Fancyhdr: How to make thumb-index?

text: I'm writing a small booklet for my med school, so that when I'm in the clinic I can have all the most important informations about something in a couple of pages. This is why I found tufte-handout perfect for it. Now to make the thing even more easy to go trough, i was thinking to add a Section-thumb (like a black box with the section number or name on it) on the right. I found different posts, but I didn't make it work with tufte. I tried to use fancyhdr, but it didn't work...Can someone help me?


title: Pagination by issue in biblatex-apa

text: Another `biblatex-apa` question here. It seems it has not been asked before. The APA 6th edition prescribes that when formatting journals (and other periodical references), the issue number is included (in parenthesis) after the volume number when the journal is paginated by issue. Otherwise (if the journal is continuously paginated), it is not included (see p. 198 of the 6th edition of the APA Publication Manual). It seems that, by default, `version 6.0` of `biblatex-apa` formats a journal following the continuous pagination format. How can I specify that a particular entry is paginated by issue, and, hence, the issue number should be printed? `bibliography.bib`:               @article{myers,     author = {Scott W. Myers and Michael Ballweg and John L. Wedberg},     title = {Assessing the impact of {European} corn borer on corn grown for silage},     url = {http://www.uwex.edu/ces/crops/uwforage/ECB.htm},     urldate = {2013-07-09},     journaltitle = {Focus on Forage},     volume = {3},     issue = {4},     organization = {University of Wisconsin Wisconsin Team Forage},     keywords = {jared},     }      `sample.tex`:               \documentclass{article}          \usepackage[american]{babel}     \usepackage{csquotes}     \usepackage[style=apa, backend=biber]{biblatex}     \DeclareLanguageMapping{american}{american-apa}     \addbibresource{bibliography.bib}          \begin{document}          \nocite{*}     \printbibliography          \end{document}


title: Subcaption Package Error

text: I'm having an issue compiling with the subcaption package. I'm starting to write my thesis, and I originally started a chapter with a separate document. This compiled fine and had the following pre-amble               \documentclass[11pt,a4paper]{article}     \usepackage{fullpage,graphicx,amsmath,verbatim,float,caption,subcaption}     \numberwithin{equation}{section}     \numberwithin{figure}{section}          \begin{document}      I then moved to a template for a thesis, (full template is here http://www.sunilpatel.co.uk/thesis-template/ ) I copied across the chapter I have completed into the chapter1.tex file as specified. I also copied across my \usepackage line to give the following preamble in the thesis document:               %% ----------------------------------------------------------------     %% Thesis.tex -- MAIN FILE (the one that you compile with LaTeX)     %% ----------------------------------------------------------------           % Set up the document     \documentclass[a4paper, 11pt, oneside]{Thesis}  % Use the "Thesis" style, based on the            ECS Thesis style by Steve Gunn     \graphicspath{{Figures/}}  % Location of the graphics files (set up for graphics to be     in PDF format)          % Include any extra LaTeX packages required     \usepackage[square, numbers, comma, sort&compress]{natbib}  % Use the "Natbib" style    for the references in the Bibliography     \usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments     \usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths     \usepackage{fullpage,graphicx,amsmath,float,caption,subcaption}     \hypersetup{urlcolor=blue, colorlinks=true}  % Colours hyperlinks in blue, but this can   be distracting if there are many links.      When I compile the Thesis.tex file it now has three errors for each of the figures I'm trying to use   1. ! Use of \@subfloat doesn't match its definition.   2. ! Missing number, treated as zero.   3. ! Illegal unit of measure (pt inserted). An example of the code for one of my figures is as follows:               \begin{figure}[!h]         \centering         \begin{subfigure}[b]{0.3\textwidth}             \includegraphics[scale=0.35]{figure1}             \caption{figure1 caption}             \label{fig: figure1 }         \end{subfigure}         \hspace{20mm}         \begin{subfigure}[b]{0.3\textwidth}             \includegraphics[scale=0.35]{figure2}             \caption{figure2 caption}             \label{fig: figure2 }         \end{subfigure}         \caption{Caption}     \end{figure}      If I remove the subfigure package then the file will compile, but the formatting is all screwed up. I'm guessing there are conflicting packages, but i can't find which one it is. I'm pretty new to latex and just learning the ropes, so if it something silly then I apologise in advance. Thanks in advance for any help John


title: How to register my own packages or classes in a separate drive to TeX Live installation?

text: I create my own documentclasses and packages in some directory of `tex\latex`. The directory `tex\latex` itself might be in any other directory in any drive. I can register the packages/classes to Miktex as already posted in my answer here. Putting the documentclass or packages in a dedicated directory in a separate drive is practically useful to avoid data loss when the system crashes. But how to do this for TeX Live? * * * Based on Ulrike's answer I do the following steps and it works. ## Step 1 Open `C:\texlive\2010\texmf\web2c\texmf.cnf` to see how `TEXMFLOCAL` is defined.               % .... other settings before this line have been removed for simplicity.      %     % A place for local additions to a "standard" texmf tree.     % This tree is not used for local configuration maintained by     % texconfig, it uses TEXMFCONFIG below.     TEXMFLOCAL = $SELFAUTOPARENT/../texmf-local     %     % .... other settings after this line have been removed for simplicity.       ## Step 2 Open `C:\texlive\2010\texmf.cnf` and modify it as follows.               % (Public domain.)     % This texmf.cnf file should contain only your personal changes from the     % original texmf.cnf (for example, as chosen in the installer).     %     % That is, if you need to make changes to texmf.cnf, put your custom     % settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than     % the distributed file (which is .../texlive/YYYY/texmf/web2c/texmf.cnf).     % And include *only* your changed values, not a copy of the whole thing!     %     OSFONTDIR = $SystemRoot/fonts//     %============== Below this row is my modification ====================     %     % My custom packages and classes are     % in E:/A/My LaTeX/MyLibrary/tex/latex/misc.     %     TEXMFLOCAL = $SELFAUTOPARENT/../texmf-local,E:/A/My LaTeX/MyLibrary     %     %     % It is wrong if you do like below     % TEXMFLOCAL = $SELFAUTOPARENT/../texmf-local,E:/A/My LaTeX/MyLibrary/tex/latex/misc     % or     %TEXMFLOCAL = $SELFAUTOPARENT/../texmf-local,E:/A/My LaTeX/MyLibrary% comments      Packages and classes must be in some subdirectory of `tex\latex`. In my example above, they are in `E:/A/My LaTeX/MyLibrary/tex/latex/misc` directory. I am not sure spaces in the path still work in OS other than Windows. ## Step 3 Invoke `texhash` as follows. ![enter image description here](http://i.stack.imgur.com/pq2wE.png) ## Step 4 Done. Congratulation. Old comments below this question should be removed because they might be no longer relevant to this final edit.


title: Vertical centering of text within a table

text: I have a table defined as:               \begin{table}         \begin{center}             \setlength{\extrarowheight}{3.0pt}             \begin{tabular}{ | c | p{12.5cm} |}                 \hline                 \textbf{Item 1} & Long description of item 1 \\                 \hline                 % ... (etc)             \end{tabular}         \end{center}     \end{table}      I want the text in the first column to be both vertically and horizontally aligned. Given the code above, the text is only horizontally aligned. I have tried fixing this by changing the column alignment/width specifier from 'c' to 'm{2.5cm}', but to no avail. How do I make the column centered both horizontally and vertically?


title: How to re-name warning messages when running pdftex

text: I'm looking for a quick and dirty solution to this, however bad practice it is. I have a bunch of warnings produced, and I can see from my outputted documentation that they're not actually 'bad'. So I'd like to, instead of giving me its normal warning message, spit out a different message. Is it possible to go from this: `pdfTeX warning (ext4): destination with the same identifier...` to this: `Uhoh: Something bad has happened, but don't worry`? Possibly using a command like `\renewcommand{\GenericWarning}...`


title: LyX: Equation number overlaps equation

text: Using LyX 2.0.1, using the book (KOMA-script) class with the "Number Equations by Section" module, I have a long equation (in an equation array) that is overlapped by the equation number: ![enter image description here](http://i.stack.imgur.com/7F06G.png) Is there a way in LyX to specify the equation number be moved down to not overlap? If not, what are some commands that I can play with to fix this using the pre-amble. I would like to avoid using in-line latex code (i.e. ERT in LyX). The equation in question is:               \begin{eqnarray}     \tau_{0}^{-} & = & \frac{m_{x}+m_{y}-\sqrt{1-r_{H}}\left|m_{x}-m_{y}\right|}{2e^{2}n_{s}\rho_{\text{xx}}}\\     \tau_{vv}^{-} & = & \frac{24\tau_{0}^{-}\sqrt{1-r_{H}}m_{x}m_{y}\left(m_{x}+m_{y}\right)\left|m_{x}-m_{y}\right|}{\left(10m_{x}m_{y}+3m_{x}^{2}+3m_{y}^{2}\right)\left(m_{x}^{2}-2m_{x}m_{y}+m_{y}^{2}-\left|m_{x}-m_{y}\right|\sqrt{1-r_{H}}\left(m_{x}+m_{y}\right)\right)}.     \end{eqnarray}


title: Why is the file size/compilation-time of a beamer presentation increased if the `handout` option is removed?

text: I did a _beamer_ presentation recently and was annoyed by   1. The increase in file size when the `handout` option is _not_ given.   2. The increase in time it took to run `pdflatex` I think these two problems are related. While I agree that some increase in both file size and compile time is necessary, the below experiment shows that something is going wrong. Effectively, the resulting pdf files contain _the exact same content_. As a demonstration I create `n` beamer blocks containing a small picture. ~~This has about the effect of having logos in the heading (they are included on every slide).~~ **EDIT:** as pointed out, blocks are different in that they require costly rendering options. What can be done to overcome this inconvenient problem? * * * ## handout option, boadilla theme (1 page):   * compile time (user): **1.6s**   * file size: 38369 KiB ## no handout option, boadilla theme (50 pages)   * compile time (user): **1.183m** !!   * file size: 230133 KiB ## no handout option, default theme (50 pages)   * compile time (user): **5.6s**   * file size: 136877 KiB ## no handout option, no blocks (50 pages) (instead using `\pause`)   * compile time (user): **3.3s** (boadilla, default theme **2.9s** )   * file size: 101033 KiB ## Additional note: included image has size `2815 KiB`. This may account for `140750 KiB` or 61.2 % of the _no handout_ file size if included separately. But apprently, this should not be done. This is the minimal example:               \documentclass[]{beamer} % pdflatex runs longer, resulting in a much larger file     %\documentclass[handout]{beamer}     \usepackage{lmodern}% http://ctan.org/pkg/lm     \usepackage{pgffor}     \mode<presentation>     \usetheme{Boadilla} % this seems to be the main bottle neck. Shadings and rounded corners      \author[se]{sebastian}     \title[atitle]{A title}          \begin{document}     \def\nitems{50}     \begin{frame}       \foreach \i in {1,...,\nitems}       {       \begin{block}{t\i}<\i-> % blocks require a lot of processing time         \includegraphics[height=1mm]{2815-kb.pdf}       \end{block}       }     \end{frame}     \end{document}      Note: The file `2815-kb.pdf` does not contain any bitmap.


title: How to write two *unaligned* multi-line braces on both sides

text: I have a theorem which is about some 4 conditions, 3 of which are equivalent in one case, and some other three are equivalent in some other case, hence I would like to typeset something like this:               \begin{align*}        equivalent if B -{ condition (1) \                                 { condition (2) \\     }-  equivalent if A                         { condition (3) \\     }                           condition (4) \      }     \end{align*}      I can do one brace or the other, or both if one's scope extended the other or was disjoint from the other's. But what can I do in this case? Is it possible without hacking too much? What about non-mathmode alternatives?


title: LuaLaTeX sees a font while fc-list doesn't

text: I've got a fresh Arch Linux box with fresh full TeX Live installed. The installation seems to include `cm-unicode` fonts and `lualatex` seems to find them correctly, but when I run `fc-list` the output contains only a couple of system fonts. How can I get the list of available fonts? Is there any way to fix `fc-list` or should I use another utility?


title: How to typeset this in LaTeX

text: I would like to typeset the following matrix: ![enter image description here](http://i.stack.imgur.com/23oF7.jpg) However, I don't know how to achieve the braces and the dots leading to the matrix entry.


title: newpx package introduces blank/space after footnote

text: The following code produces an error:               \documentclass{article}          \usepackage{newpxtext}          \begin{document}     Text\footnote{foo}:     Next text\footnotemark.     \footnotetext{bar} <= there is a space here, before the colon. It shouldn't be there!     \end{document}      Including this in the preamble after the newpxtext package solves it.               \renewcommand{\thefootnote}{\arabic{footnote}}      This solves it too:               \usepackage[defaultsups]{newpxtext}      However, both solutions do not incorporate the `newpx` superscript fonts. Does anybody know why this happens? I like the `newpx` packages, but the footnote superscripts get borked by it. Am I doing something wrong? Are there newer Palatino font packages that include the improved scaling, metrics, etc. the `newpx` packages have that the `pxfonts` package does not?


title: Non-linear curve fitting with gnuplot

text: I am trying to use `gnuplot` with `pgfplots` in TexShop, following on from an example by Martin H in the comments here. I can get the data points in OK, and plot them but the fit (red line) does not seem to work. The blue line shows the expected fit. Can anyone see what I'm doing wrong though? The result is shown below: ![enter image description here](http://i.stack.imgur.com/36V4H.png) Thanks               \documentclass[11pt]{article}     \usepackage{pgfplots}          \begin{filecontents}{test.dat}     2   12     5   55     10  96     20  135     50  144     100 147     200 147     500 146     \end{filecontents}               \begin{document}          \begin{figure}[h!t]     \centering     \begin{tikzpicture}          \begin{axis}[         xmode=log,         ymode=linear,         axis x line*=bottom,         axis y line*=left,     tick label style={font=\small},     grid=both,     tick align=outside,          tickpos=left,     xlabel= {[ACh]} (nM),     ylabel=Response (mm),         xmin=0.1, xmax=1000,         ymin=0, ymax=160,         width=0.8\textwidth,         height=0.6\textwidth,     ]          \addplot[only marks] file {test.dat};     % Now call gnuplot to fit this data     % The key is the raw gnuplot option     % which allows to write a gnuplot script file     \addplot+[raw gnuplot, draw=red, mark=none, smooth] gnuplot {     f(x)=Ymax/(1+(EC50/x)^nH);     % let gnuplot fit, using column 1 and 2 of the data file     % using the following initial guesses     Ymax=150;     nH=2;     EC50=60;          fit f(x) 'test.dat' using 1:2 via Ymax,EC50,nH;          % Next, plot the function and specify plot range          % The range should be approx. the same as the test.dat x range          plot [x=0.1:1000] f(x);        };                 % Below is the correct line using the equation: {Ymax/(1+(EC50/[A])^nH)}     \addplot[draw=blue, domain=0.1:1000, smooth] {147.5/(1+(6.75/x)^1.95)};          \end{axis}     \end{tikzpicture}          \end{figure}          \end{document}


title: Problem with natbib installation on Windows 8

text: I am using Texstudio following it's installation from `ProTeXt-3.1.3-060313.exe` ona Windows 8 machine. For some reason, when I tried to install `natbib`, by following the instructions at http://www.ctan.org/tex-archive/macros/latex/contrib/natbib/, when I try to latex `natbib.ins` I get an error               Could not start Latex: Latex:     latex.ex -crc -interaction= nonstopmode "bibentry".tex.      followed by               Log file not found!      Why is this not working? A separate yet related question: I also tried to install natbib from the MikTex package manager, but there I hit a problem in that for all the repositories I tried the plus sign for installation is always greyed out for `natbib` (and most packages for that matter). Why is that?


title: Final linebreak in lstlisting, and linebreak in captions (with IEEEtran)

text: Using:   * lstlisting in two columns   * How to add line break to caption without using caption package ... I got to the following MWE:               % \documentclass[12pt,a4paper]{article}     \documentclass[12pt,a4paper,onecolumn]{IEEEtran}          \usepackage{listings}          \begin{document}          \noindent\begin{minipage}{.45\textwidth}     \begin{lstlisting}[basicstyle=\ttfamily,caption={[short]This is first line \\\hspace{\textwidth} This is second line},frame=tlrb]          function Something() {       doOneThing() ;       doAnotherThing() ;       doThirdThing() ;       if (something(wrong)) {         repeat();       }     }          \end{lstlisting}     \end{minipage}\hfill     \begin{minipage}{.45\textwidth}     \begin{lstlisting}[basicstyle=\scriptsize\ttfamily,caption=code 2,frame=tlrb]{Name}          function SomethingElse() {       doAnotherThing() ;       doOneThing() ;       doThirdThing() ;       if (something(wrong)) {         repeat();       }     }          \end{lstlisting}     \end{minipage}          \end{document}      ... which gets me this: ![test.pdf](http://i.stack.imgur.com/MdA3W.png)   * How do I get the multiline caption for Listing 1 to align properly above the listing box (note, this is a problem only with `IEEEtran`, not with regular `article` class)?   * How do I get a blank line (linebreak) added at the _end_ of the listing (just like the single line whitespace at start of listing is preserved?)


title: Running latex (pdf) interactively in AucTeX

text: When I am Running latex interactively, as I like, emacs is opening a new buffer-window with output from the LaTeX compiling process. Fine! -- I like to see the processing outut. BUT I am used to that this buffer (window) always view the last line of the process output. Is there a `.emacs` "trick" for this to happen? Best Regards


title: Sequence empty right after setting

text: \documentclass{article}     \usepackage{expl3,xparse}     \ExplSyntaxOn     \ProvideDocumentCommand \Union { O{\cup} O{,} m }     {       \typeout{#3}       \seq_set_split:Nnn \l_lmpa_seq { #2 } { #3 }       \seq_show:N \l_tmpa_seq       \seq_use:Nn \l_tmpa_seq { #1 }     }          \begin{document}     $\Union{a,b,c}$     \end{document}      gives in the console               a,b,c     The sequence \l_tmpa_seq is empty     > .     <recently read> }          l.13 $\Union{a,b,c}                        $      with no (visible) printed output. I can't for the life of me figure out what is going awry. I've also tried the analogous `clist` implementation to no avail…


title: Add legend to the curve from \draw

text: I am a new user to PGFPlots so I have the following question: I draw a ellipse in TikZ and I want to add a legend for it. However, I found the `\addlegendentry` is only for `\addplot`. Then, how can I add a legend for my curve?               \tikzsetnextfilename{1a}     \begin{tikzpicture}     \begin{axis}[      xlabel = $\dfrac{M}{M_{bend}}$,      ylabel = $\dfrac{P}{P_{burst}}$,       xmin=0,xmax=1.2,       ymin=0,ymax=1.2,      ymajorgrids=true,      xmajorgrids=true,      grid style=dashed,      label style={font=\tiny},      tick label style={font=\tiny},      legend style={font=\small},      legend cell align=left,      legend pos=north east       ]      \addplot+[color=red,      line width=0.3mm]       (axis cs:0,0)        ellipse [       x radius=0.950052, y radius=0.945021];     \addlegendentry{Analytical results}      \end{axis}     \end{tikzpicture}      I read about the customized legend from Customize legend position in PGFplots axis environment, but I have no idea about how to put this in an axis environment.


title: Bibliography showing "and" instead of "&"

text: I'm using `natbib` and the `apj` style file, and when the bibliography compiles it shows "and" in the author list (and in journal abbreviations) instead of "&". How do I change that so it shows "&"?


title: Vertical space inside a TikZ node

text: I am trying to insert some vertical space inside a node (So it will be filled later).               \node [draw,rounded corners,minimum height=5cm] (node1) {\underline{Case 1}};      This is giving this: ![enter image description here](http://i.stack.imgur.com/sgJ4N.png) However, I want **Case 1** to be at the top of the node. Can any one help please. Thanks in advance.


title: Trouble with mupad export to eps

text: I have exported a graphic to eps format from Matlab/mupad after replacing axis latin labels with greek symbols within mupad itself. After calling the eps doc in LaTeX, and using dvi, I see that the exporter has replaced greek with latin in the graphic. I have verified this replacement by opening the graphic eps doc and see no symbol font specification for those axis labels. Feebly trying to repair, I have experimented editing the eps doc. But, dvi seems to have trouble finding the symbol font. Just inserting the two commands:               /Symbol findfont     pop      into the otherwise functioning eps graphic throws dvi into a loop. psfrag does not seem to gain access to characters in a graphic. Any advice ?


title: How do I apply nodes near coords to a single bar / to a single plot?

text: After reading the pretty population pyramid question, I was inspired to "Tufte-ify" the graph to remove redunancy and clutter (and to become more familiar with `pgfplots`). I modified the code from leonardo cedar's answer to the population pyramid question. For learning purposes, I decided to highlight one data point that I thought was interesting. With one exception, the proportion of females is larger than males beginning with the 25-29 year age group. Using an idea taken from here. I highlighted the male and female bars and added the percentage of each gender. The result is shown below; overall, I'm pleased with the result but not with the way I obtained it. I have four questions. If I should split them into separate posts, please let me know. 1) How can I automatically associate the precentage with the chosen bar? In my MWE, the position of the two percentages at the of each red bar is hard coded, using               \node [color=white] at (\xcenter+3.8cm,-6.05cm) {\scriptsize 4.34\%};  % Females     \node [color=white] at (\xcenter-3.65cm,-6.05cm) {\scriptsize 3.87\%}; % Males      Leonardo's code had:               nodes near coords = {\pgfmathprintnumber\pgfplotspointmeta\%},     every node near coord/.append style={rotate = 0, anchor = east, font=\scriptsize, color=black},      which placed the percentage for every bar (for the males, in this case). I know I can change the anchor to `west` to get the percentages plotted inside the bar. Can I change this to plot the precent for just one bar? Or is there another way? 2) Is there a way to automatically determine the height of the graph area occupied by the bars? I hard coded a thin black line at 0% on the x-axis to provide a visual center dividing males and females. I played around with the coordinates to position it. I would like to determine the height programmatically. (In this case, the black line does not extend all the way to the top because it would cover the uppermost data point. I'm not worried about that overall.) 3) Is it possible to bold the y tick label for just the chosen data point, in this case the 25-29 year olds? I have no idea where to begin. 4) How can I shift the x- and y-axes closer to the bars? I have no idea where to begin. **MWE**. Other suggestions for improvement are welcome:               \documentclass[10pt]{article}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \usepackage{filecontents}          \pgfplotsset{%         discard if not/.style 2 args={             x filter/.code={                 \edef\tempa{\thisrow{#1}}                 \edef\tempb{#2}                 \ifx\tempa\tempb                 \else                     \def\pgfmathresult{inf}                 \fi             }         }     }              \begin{document}          \begin{filecontents}{data.csv}     {age},{male},{female}     +100,0,4     95--99,3,6     90--94,10,16     85--89,43,57     80--84,103,111     75--79,175,224     70--74,274,322     65--69,421,427     60--64,514,524     55--59,578,606     50--54,732,785     45--49,885,911     40--44,1044,1120     35--39,1192,1289     30--34,1315,1306     25--29,1214,1362     20--24,1360,1336     15--19,1471,1406     10--14,1495,1446     5--9,1375,1351     0--4,1325,1257     \end{filecontents}          \pgfplotstableread[col sep=comma, header=true]{data.csv}{\datatable}          \begin{center}     \begin{tikzpicture}     \edef\xcenter{0cm}% from John Kormylo's answer           \pgfplotsset{major grid style={thin, white}}           \begin{axis}[ %Female         name=popaxis,         scale only axis,         xbar,         /pgf/bar shift=0pt,         xmin=0,         xmax=5,         width=0.5*\textwidth,          height= 0.5*\textheight,         y dir = reverse,         xticklabel= {\pgfmathprintnumber\tick\%},         axis x line=left,         axis y line=none,         enlarge x limits = {value=0.15,upper},         axis line style={white},         clip=false,         xmajorticks=true,         every x tick/.style={color={white}},         grid=major,         axis on top     ]     \addplot[white,fill=black!30] table[y expr =\coordindex, x expr={\thisrow{female}/31395*100}, col sep=comma] {data.csv};%total pop = 31395      \addplot[white,fill=red!50!black, discard if not ={male}{1214}] table[y expr =\coordindex, x expr={\thisrow{female}/31395*100}, col sep=comma] {data.csv};           \pgfplotstablegetrowsof{\datatable}     \pgfmathsetmacro{\lastrow}{\pgfplotsretval}       \node[xshift=-3cm,yshift=7cm,align=center] at (axis cs:0,\lastrow) {Male};      \node[xshift= 3cm,yshift=7cm,align=center] at (axis cs:0,\lastrow) {Female};      \node[xshift= -8.5cm,yshift=7cm,align=left] at (axis cs:0,\lastrow) {Age Group\\(years)};           % hard-coded precentage for females 25-29.     \node [color=white] at (\xcenter+3.8cm,-6.05cm) {\scriptsize 4.34\%};     \end{axis}     %     \begin{axis}[ % Male     at={(popaxis.north west)},anchor=north east,          scale only axis,         xbar,         /pgf/bar shift=0pt,         xmin = 0,         xmax = 5,         width=0.5*\textwidth,         height= 0.5*\textheight,         x dir=reverse,         y dir=reverse,     %    Leonardo's code that print's all precentages for males. I just want one.     %    nodes near coords = {\pgfmathprintnumber\pgfplotspointmeta\%},     %    every node near coord/.append style={rotate = 0, anchor = west, font=\scriptsize, color=black},         xticklabel= {\pgfmathprintnumber\tick\%},         axis x line=left,         axis y line*=left,         ytick = data,         yticklabels from table = {\datatable}{age},         ytick align=center,         ytick pos=left,         enlarge x limits = {value=0.15,upper},         axis line style={white},         every x tick/.style={color=white},         every y tick/.style={color=white},         xmajorgrids=true,         axis on top     ]     \addplot[white,fill=black!30] table[y expr =\coordindex, x expr={\thisrow{male}/31395*100}, col sep=comma] {data.csv};     \addplot+[white,fill=red!50!black, discard if not = {male}{1214}] table[y expr =\coordindex, x expr={\thisrow{male}/31395*100}, col sep=comma] {data.csv};      % Hard coded precentage for males, 25-29.     \node [color=white] at (\xcenter-3.65cm,-6.05cm) {\scriptsize 3.87\%};     \end{axis}          % Hard-coded center axis     \draw [color=black, line width=0.1pt] (0,0.63) -- (0,8.6cm);     \end{tikzpicture}     \end{center}     \end{document}      Here is the resulting graph: Population Pyramid Plot


title: TikZ: Node placement best practices in an already cramped figure

text: How can I place more nodes in an already cramped figure? Here is intended outcome: ![enter image description here](http://i.stack.imgur.com/fwpqW.jpg) Here is my current figure: ![enter image description here](http://i.stack.imgur.com/MS7nm.png) I am looking to add the velocity vector notation and the time notations `(t_f < t_m)` both greater and less than. How can I add the remaining nodes in an already crowded figure? If you need to see the code, I can post it as well.               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{intersections, calc, arrows, decorations.markings, backgrounds}     \tikzset{       invclip/.style={         clip,         insert path={             (-520pt, -520pt) rectangle (520pt, 520pt)           }         }       }       \begin{document}       \begin{tikzpicture}[scale = 1.75,         every label/.append style = {font = \small},         dot/.style = {outer sep = +0pt, inner sep = +0pt,           shape = circle, draw = black, label = {#1}},         dot/.default =,         small dot/.style = {minimum size = 2.5pt, dot = {#1}},         small dot/.default =,         big dot/.style = {minimum size = 5pt, dot = {#1}},         big dot/.default =,         line join = round, line cap = round, >=triangle 45         ]           \pgfmathsetmacro{\e}{0.2768}       \pgfmathsetmacro{\etilde}{0.6789}       \pgfmathsetmacro{\a}{1.36}       \pgfmathsetmacro{\b}{\a * sqrt(1 - \e^2)}        \pgfmathsetmacro{\btilde}{\a * sqrt(1 - (\etilde)^2)}       \pgfmathsetmacro{\c}{sqrt(\a^2 - \b^2)}       \pgfmathsetmacro{\ctilde}{sqrt(\a^2 - (\btilde)^2)}       \pgfmathsetmacro{\angle}{88.23}            \draw[dashed, rotate = \angle] (-\a + \ctilde, 0) -- (\a + \ctilde, 0);       \draw[dashed] (-\a - \c, 0) -- (\a - \c, 0);            \node[font = \scriptsize, fill = orange, big dot = {below: \(F\)}] (F)       at (0, 0) {};       \node[font = \scriptsize, fill = white, big dot = {below: \(F^*\)}] (FS)       at (-2 * \c cm, 0) {};            \path[name path global = ecc2768] (-\c, 0) ellipse[x radius = \a cm,       y radius = \b cm];            \draw[red, name path = r2] (0, 0) circle[radius = 1.523679cm];       \draw[blue, name path = r1] (0, 0) circle[radius = 1cm];       \draw[name intersections = {of = ecc2768 and r1}] (F) -- (intersection-1)       node[fill, big dot = {right: \(P_1\)}] (P1) {};       \draw[name intersections = {of = ecc2768 and r2}] (F) -- (intersection-1)       node[fill, big dot = {above left: \(P_2\)}] (P2) {};       \draw[draw = none] (P1) -- (F) node[font = \scriptsize, pos = .5,       fill = white, inner sep = 0cm] {\(r_1\)};       \draw[draw = none] (P2) -- (F) node[font = \scriptsize, pos = .5,       fill = white, inner sep = 0cm] {\(r_2\)};       \draw (P1) -- (P2) node[font = \scriptsize, fill = white, inner sep = 0cm,       pos = .5] {\(c\)};            \begin{pgfinterruptboundingbox}         \begin{pgfonlayer}{background}           \begin{scope}[decoration = {markings,               mark = at position 0.7 with {\arrow{latex reversed}}             }]             \path[invclip] (0, 0) -- ($(0,0)!100cm!(P1)$) -- (0cm, 100cm) --              ($(0,0)!100cm!(P2)$) -- (0, 0);                  \draw[name path global = ecc2768, postaction = decorate] (-\c, 0)             ellipse [x radius = \a cm, y radius = \b cm];           \end{scope}         \end{pgfonlayer}       \end{pgfinterruptboundingbox}            \draw let         \p0 = (F),         \p1 = (P1),         \p2 = (P2),         \n1 = {atan2(\x1 - \x0, \y1 - \y0)},         \n2 = {atan2(\x2 - \x0, \y2 - \y0)},         \n3 = {.35cm},         \n4 = {(\n1 + \n2) / 2}       in (F) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]       node[font = \scriptsize, fill = white, inner sep = 0cm] at       ([shift = (F)] \n4:.5cm) {\pgfmathparse{\n2 - \n1}%         $\pgfmathprintnumber{\pgfmathresult}^{\circ}$       };            \path[name path = aux1] (P1) circle[radius = 1bp];            \draw[name intersections = {of = ecc2768 and aux1}, latex-]       ($(intersection-2)!.75cm!(intersection-1)$) -- (P1);            \path[name path = aux2] (P2) circle[radius = 1bp];            \draw[name intersections = {of = ecc2768 and aux2}, -latex]       (P2) -- ($(intersection-1)!.75cm!(intersection-2)$);            \begin{pgfinterruptboundingbox}         \begin{pgfonlayer}{background}           \begin{scope}[decoration = {markings,               mark = at position 0.5 with {\arrow{latex reversed}}             }]             \path[name path global = ecc6789unrotated] (\ctilde, 0) ellipse                 (\a cm and \btilde cm);             \path[invclip] (0, 0) -- ($(0,0)!100cm!(P1)$) -- (0cm, 100cm) --              ($(0,0)!100cm!(P2)$) -- (0, 0);                  \draw [name intersections = {of = r1 and ecc6789unrotated},             postaction = decorate] (intersection-2) let               \p0 = (F),               \p1 = (P1),               \p2 = (intersection-2),               \n1 = {atan2(\x1 - \x0, \y1 - \y0)},               \n2 = {atan2(\x2 - \x0, \y2 - \y0)},               \n3 = {\n1 - \n2}             in \pgfextra{\xdef\myangle{\n3}} [rotate = \n3,             name path global = ecc6789rotated] (\ctilde, 0) ellipse             [x radius = \a cm, y radius = \btilde cm];             % \node at (0,3) {The angle of rotation is: \pgfmathparse{\myangle}             % $\pgfmathprintnumber{\pgfmathresult}^\circ$};           \end{scope}         \end{pgfonlayer}       \end{pgfinterruptboundingbox}            \begin{scope}[rotate around = {\myangle: (0, 0)}]         \node[font = \scriptsize, fill = white, big dot = {left: \(\tilde{F}^*\)}]         (FST) at (2 * \ctilde cm, 0) {};       \end{scope}            \draw[name intersections = {of = ecc6789rotated and aux1}, -latex] (P1) --       ($(intersection-2)!.75cm!(intersection-1)$);       \draw[name intersections = {of = ecc6789rotated and aux2}, -latex] (P2) --       ($(intersection-1)!.75cm!(intersection-2)$);            \begin{pgfinterruptboundingbox}         % To prevent the clipping path from making our picture larger         \begin{pgfonlayer}{background}           \begin{scope}[decoration = {markings,               mark = at position 0.2 with {\arrow{latex}},             }]             \path[clip] (0, 0) -- ($(0,0)!100cm!(P1)$) -- (0cm, 100cm) --              ($(0,0)!100cm!(P2)$) -- (0, 0);                  \draw [orange, postaction = decorate] (-\c, 0) ellipse             [x radius = \a cm, y radius = \b cm];           \end{scope}         \end{pgfonlayer}       \end{pgfinterruptboundingbox}            \begin{pgfinterruptboundingbox}         % To prevent the clipping path from making our picture larger         \begin{pgfonlayer}{background}           \begin{scope}[decoration = {markings,               mark = at position 0 with {\arrow{latex}},             }]             \path[clip] (0, 0) -- ($(0,0)!100cm!(P1)$) -- (0cm, 100cm) --              ($(0,0)!100cm!(P2)$) -- (0, 0);                  \draw [name intersections = {of = r1 and ecc6789unrotated},             postaction = decorate, PineGreen] (intersection-2)              let               \p0 = (F),               \p1 = (P1),               \p2 = (intersection-2),               \n1 = {atan2(\x1 - \x0, \y1 - \y0)},               \n2 = {atan2(\x2 - \x0, \y2 - \y0)},               \n3 = {\n1 - \n2}             in \pgfextra{\xdef\myangle{\n3}} [rotate = \n3,             name path global = ecc6789rotated] (\ctilde, 0) ellipse             [x radius = \a cm, y radius = \btilde cm];           \end{scope}         \end{pgfonlayer}       \end{pgfinterruptboundingbox}       \end{tikzpicture}     \end{document}


title: How, in ConTeXt, can I get body text to align flush to the outside?

text: I'm using ConTeXt Mk IV, and I'd like the text in a two-page document to line up like so:               +--------+--------+     +        +        +     + xxx    +    xx  +     + xxxx   +   xxx  +     + xx     +        +     +        +   xxx  +     + xxx    +  xxxx  +     + xx     +  xxxx  +     +        +        +     +--------+--------+      I tried               \setuppagenumbering[alternative=twosided]     \setupalign[flushouter]     \starttext         page 1 (should align flush right)         \page[yes]         page 2 (should align flush left)     \stoptext      but that doesn't work. None of [flush]inner/outer/left/right does. This despite the fact that in setuphead[subject],               align=flushouter      _does_ do the expected & desired thing. Is there a magic word I've missed? Cheers, Sietse


title: Adding notes to Table of Contents

text: How could I add a note ... or a footnote at the beginning of the Table of Contents, something like 'Chapters with * can be skipped on a first reading'...?


title: How can I arrange 3 equations in boxes with arrows like this picture?

text: Can any one tell me how to make a figure exactly like this picture, with 2 arrows etc. ![this picture](http://i.stack.imgur.com/8iCE1.jpg) This is my unsuccessful attempt:               \begin{figure}[ht]     \centering     \begin{minipage}[b]{0.35\linewidth}     \begin{lstlisting}[language=C, frame=single,     xleftmargin=5.0ex,basicstyle=\footnotesize\ttfamily,     numbers=left,stepnumber=0, morekeywords={assert} ]     x=x+y;     if(x!=1){       x=2;        if(z) x++;      }     \end{lstlisting}     \end{minipage}     \begin{minipage}[b]{0.35\linewidth}     \begin{lstlisting}[mathescape % to use mathmode inside listing     ,language=C, frame=single,     xleftmargin=5.0ex,basicstyle=\footnotesize\ttfamily,     numbers=left,stepnumber=0, morekeywords={assert} ]     x$_1$=x$_0$+y$_0$;     if(x$_1$!=1){       x$_2$=2;        if(z$_0$) x$_3$=x$_2$+1;      }     \end{lstlisting}     \end{minipage}     \fbox{     \begin{minipage}[b]{0.4\linewidth}     \begin{align*}     x_1 &= x_0 + y_0 \wedge     \\ x_2 &= ((x_1 \neq 1)?2:x_1) \wedge     \\ x_3 &= ((x_1 \neq 1 \wedge z_0)?x_2+1:x_2)      \end{align*}     \end{minipage}     }     \end{figure}      Thank you.


title: Is it possible to use both hyperxmp and xmpincl in LaTeX?

text: I am trying to add other xmp metadata to a pdf file which is not covered by hyperxmp. I tried to use both hyperxmp and xmpincl. Building the project in TeXnicCenter produces no errors, so I am thinking including and using both packages is okay. But when I extract the xmp file through a java code, the only xmp metadata stored in the xmp file is those created with hyperxmp. Am I doing something wrong, or it is really not possible to use both packages?


title: Resize figures that are too high or too wide in LyX?

text: I would like to know how to define a preamble in Lyx to resize the width and the height if the figure is too wide or high. I've already tried this:               \usepackage{graphicx}          % Determine if the image is too wide for the page.     \makeatletter     \def\ScaleIfNeeded{%       \ifdim\Gin@nat@width>\linewidth         \linewidth       \else         \Gin@nat@width       \fi     }     \makeatother          % Resize figures that are too wide for the page.     \let\oldincludegraphics\includegraphics     \renewcommand\includegraphics[2][]{%       \oldincludegraphics[width=\ScaleIfNeeded]{#2}     }      However, the problem is that the images that are too high continue to be too high, how could I adjust in the preamble both width and height?


title: Wrong reference using \input twice for the same file

text: I have a short piece of text with an image that I need to use more than once in my document. The rational solution I came up with is to put the text in a file and call the file when needed, something like this:               \documentclass[a4paper,twoside]{report}          \usepackage{lipsum}     \usepackage[pdftex]{graphicx}          \begin{document}          \chapter{First}     \lipsum[1]     \input{test}          \chapter{Second}     \lipsum[1]     \input{test}          \end{document}      where in the file `test.tex` there is the reusable piece:               The image id is: \ref{image}          \begin{figure}[h!]     \centering     \includegraphics[scale=0.9]{randomimage}     \caption{A random caption.}     \label{image}     \end{figure}      Problem is: the first `\ref` is wrong, as can be seen in the following image: ![The wrong ref](http://i.stack.imgur.com/5P9y1.png) Now, I know this could be solved copying and pasting the text any time I need it... but it has obvious shortcomings and I would like to avoid it


title: Font change does not work

text: As the title says I wanted to change the font of my document with e.g.               \usepackage[T1]{fontenc}     \newcommand{\changefont}[3]{     \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}     \changefont{phv}{b}{sl}      but it does not work. There is no change. The font stays the same. I tried different ones already. Here is my code:               \documentclass{book}     \usepackage{geometry}     \geometry{left=4cm,right=3cm, top=2cm, bottom=2cm}      \usepackage[pagestyles]{titlesec}     \titlespacing*{\chapter}{0pt}{-30pt}{20pt}     \titleformat{\chapter}[display]{\color{headercolor}\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}          \titleformat{\section}     {\color{headercolor}\normalfont\Large\bfseries}{\thesection}{1em}{}          \titleformat{\subsection}     {\color{headercolor}\normalfont\Large\bfseries}{\thesubsection}{1em}{}          \titleformat{\subsubsection}     {\color{headercolor}\normalfont\large\bfseries}{\thesubsubsection}{1em}{}          \titleformat{\paragraph}     {\color{headercolor}\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}          \usepackage[T1]{fontenc}     \newcommand{\changefont}[3]{     \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}     \changefont{phv}{b}{sl}          \usepackage[ngerman]{babel}     \usepackage{mathptmx}     \usepackage{helvet}     \usepackage{wallpaper}     \usepackage{color}     \usepackage[final]{pdfpages}      %,bookmarksopenlevel={1}     %\usepackage[hidelinks,bookmarks=true,bookmarksopen=true,bookmarksnumbered=true,colorlinks=true,linkcolor=black,]{hyperref}     \usepackage[hidelinks,bookmarksopen=false,     hypertexnames=TRUE,pdfpagelabels=true]{hyperref}[2011/02/05]%colorlinks,linkcolor=black,     \hypersetup{        pdftitle={},     %  pdfauthor={},       pdfsubject={satistics book},        pdfkeywords={},        }          \usepackage{xcolor,bookmark}     \usepackage{scrextend}     \usepackage{titlepic}     \usepackage{shorttoc}     \usepackage{courier}     \usepackage{type1cm}              \usepackage{zref-abspage}     \usepackage{makeidx}             \usepackage{graphicx}             \usepackage{multicol}             \usepackage[bottom]{footmisc}     \usepackage{tocstyle}     \usetocstyle{allwithdot}      %\usepackage{thmbox}     \usepackage{shadethm}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{marginnote}     %\usetocstyle{KOMAlike}     \usepackage{wrapfig}     \usepackage{paralist}     \usepackage{amssymb}     \usepackage[framemethod=tikz]{mdframed}     \usepackage{ulem}     \usepackage{fancyhdr}     %\usepackage{sectsty}     \usepackage{booktabs}     \makeindex                \listfiles          \newmdenv[backgroundcolor=textbeispiel,linecolor=blue,roundcorner=10pt,outerlinewidth=1pt,skipbelow=2pt, skipabove=6pt]{myframedenv}%innerlinecolor=green,innerlinewidth=1pt,middlelinewidth=2pt,middlelinecolor=yellow          \newtheoremstyle{mystyle}       {}{}{}{}%       {\bfseries}{:}{.5em}{}%          \newtheoremstyle{mystyle2}       {}{}{}{}%       {\bfseries}{}{.5em}{}%          \theoremstyle{mystyle}          \newmdtheoremenv[hidealllines=true,backgroundcolor=shadethmcolor,skipabove=\topsep,     skipbelow=\topsep]{beispiel}{Beispiel}          \newmdtheoremenv[hidealllines=true,     backgroundcolor=shadethmcolor2,skipabove=0pt,     skipbelow=0pt]{formel}{Formel}               \theoremstyle{mystyle2}          \newmdtheoremenv[hidealllines=true,     backgroundcolor=aufgaben,skipabove=0pt,     skipbelow=0pt]{aufgabe}{Aufgabe}               \newmdtheoremenv[hidealllines=true,     backgroundcolor=loesung,skipabove=0pt,     skipbelow=0pt]{loesung}{L\"osung}          \definecolor{dunkelgruen}{rgb}{0.8,0.87843,0.8}     \definecolor{hellgruen}{rgb}{0.90196,0.941176,0.90196}     \definecolor{aufgaben}{rgb}{0.9333,0.93333,0.933333}     \definecolor{headercolor}{rgb}{0.6941,0.6745,0.4863}          \newpagestyle{mystyle}{     \headrule \sethead[\thepage][][\color{red} \chaptertitlename\ \thechapter. \chaptertitle]     {\color{red} \thesection\ \sectiontitle}{}{\thepage}}          \setlength{\headheight}{24pt}%          \begin{document}     \frontmatter          \setlength{\marginparwidth}{3cm}     \marginparsep = 0.4cm     \pagestyle{plain}     \pagenumbering{Roman}          \makeatletter     \let\stdl@part\l@part     \renewcommand*{\l@part}[2]{%       \stdl@part{\textcolor{headercolor}{#1}}{\textcolor{headercolor}{#2}}}     \let\stdl@chapter\l@chapter     \renewcommand*{\l@chapter}[2]{%       \stdl@chapter{\textcolor{headercolor}{#1}}{\textcolor{headercolor}{#2}}}     \makeatother          \setcounter{tocdepth}{4}     \setcounter{secnumdepth}{4}     \shorttableofcontents{Inhalts\"ubersicht}{1}     \bookmark[page=15,rellevel=1,keeplevel,view={XYZ},color=red]{Inhalts\"ubersicht}     \bookmark[page=17,rellevel=1,keeplevel,view={XYZ},color=red]{Inhaltsverzeichnis}     \tableofcontents     \clearpage     \pagenumbering{arabic}       %          %\pagestyle{mystyle}     \mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \pagestyle{fancy}     \fancyhf{}     %\fancyhead[L]{\parbox{0.7\textwidth}{\textbf{ \textcolor{headercolor}\leftmark\textcolor{headercolor}{\rightmark}}}}     %\fancyhead[L]{ \textcolor{headercolor}{\rightmark}}%\thesection%\textcolor{headercolor}\text{ }\leftmark \text{ }               \fancyhead[L]{\hspace{2mm}\textcolor{headercolor}{\leftmark}\text{ }\textcolor{headercolor}{\rightmark}\hfill\textcolor{headercolor}{\thepage}\hspace{4mm}}     \renewcommand{\headrule}{\vspace{-\headheight}\textcolor{headercolor}{\vrule height \headheight width 2pt\relax\rule{\textwidth-8pt}{2pt}\vrule height \headheight width 2pt\relax}}          %\include{part1}      %\include{chapter1}     %\include{chapter2}     %\include{part2}     %\include{chapter3}     %\include{chapter4}     %\include{chapter5}     %\include{chapter6}     \backmatter          \appendix           \include{appendix}          \listoffigures     \newpage     \listoftables     \backmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\include{glossary}     %\include{solutions}     \cleardoublepage     \phantomsection     \addcontentsline{toc}{part}{Index}     \printindex          \cleardoublepage     \phantomsection     \addcontentsline{toc}{part}{the author}     %\includepdf{author}     %\includepdf{back}     \end{document}      I have given you so much code, because I do not know where my mistake is?


title: To clearly separate block inside a chapter

text: I get many times things that are somehow related to the main topic and should be separated by blue background, for instance. I do at the moment only               \documentclass{article}     \newtheorem{theorem}{Theorem}     \newtheorem{question}[theorem]{Question}     \begin{document}     \begin{question}     Lorem ipsum?     \end{question}     \end{document}      I get like this ![enter image description here](http://i.stack.imgur.com/GJa4f.png) where the question -environment only adds the question mark to the front. I think there is some problem because the environment should be numbered, first of all. **How can you make distinguish the question environment better?**


title: Converting a list of words to a table

text: I would like to convert a list of terms like : A, B, C, D, E, F to a table like: | A | B | C | | D | E | F | or | A | C | E | | B | D | F | but without having to rewrite my table each time, as inserting items or moving/deleting some is really hard with big tables. Does any package exists to help doing that ? EDIT: By using a mix of all of what you provided, here is a version which has alignement problems - without the center block, the vertical version is slightly moved on the right, but this is intended to be centered in my document - with the center block, the horizontal version is not centered. However here it is :               \documentclass{book}     \RequirePackage{etoolbox}%          \newcounter{argcolumns}     \newcounter{argtargetcolumns}          \newcommand{\mylisttable}[3][h]{       \setcounter{argcolumns}{0}       \setcounter{argtargetcolumns}{#2}       \def\mytable{}       \def\mylist{}       \forcsvlist{\listadd\mylist}{#3}            \def\parser ##1{%         \ifnumequal{\value{argcolumns}}{\value{argtargetcolumns}-1}{%           \setcounter{argcolumns}{0}%           \expandafter\def\expandafter\mytable\expandafter{%             \mytable ##1 \cr%           }%         }{%           \stepcounter{argcolumns}%           \expandafter\def\expandafter\mytable\expandafter{%             \mytable ##1 & %           }%         }%       }%            \forlistloop{\parser}{\mylist}%       \begin{center}         \ifx #1v \expandafter\valign\else\expandafter\halign\fi{& \hbox spread 0.1em{\hfil\strut##\hfil}\crcr           \mytable%           \whileboolexpr{%             not (test {\ifnumequal{\value{argcolumns}}{0}}) and %             test {\ifnumless{\value{argcolumns}}{\value{argtargetcolumns}-1}}           }%           {%             & \stepcounter{argcolumns}%           }\setcounter{argcolumns}{0}\cr         }       \end{center}     }          \begin{document}          \mylisttable[h]{4}{aaaaaaaaa,b,caaaa,daaaaaaaaaaaa,e,faaaaaaaaaa,g,h}     \mylisttable[h]{2}{a,b,c,d,e,f,g,h}     \mylisttable[v]{2}{a,b,c,d,e,f,g,h}     \mylisttable[v]{2}{a,b,c,d,e,f,g,h}     \mylisttable[h]{2}{a,b,c,d,e,f,g,h}     \end{document}


title: Draw a triangle with horizontal lines with PSTricks

text: Is there an easy way to draw a triangle like the one on the picture with PSTricks? Maybe a method for calculating the position of the outer line for specific height? ![Example Image](http://i.stack.imgur.com/iVsTS.png) I'm using the environment in this dummy-example:               \documentclass[letterpaper,dvips]{article}          \usepackage[utf8]{inputenc}     \usepackage{textcomp}          \usepackage{pst-all}     \usepackage{pst-eps}          \usepackage{color}          \begin{document}          \pagestyle{empty}     \begin{TeXtoEPS}     \fontfamily{phv}\selectfont     \psset{xunit=1cm,yunit=1cm,runit=1cm}     \begin{pspicture}(10,10)               \end{pspicture}          \end{TeXtoEPS}          \end{document}


title: pdflatexmk doesn't run makeglossaries for glossaries package (TeXShop, OSX)

text: I'm trying to get the following document to work with a single run of pdflatexmk: (I've included my entire preamble to be sure)               % !TEX TS-program = pdflatexmk     \documentclass[12pt,a4paper,bibliography=totoc,listof=totoc]{scrartcl}     \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}     \usepackage[applemac]{inputenc}     \usepackage[right]{eurosym}     \usepackage{microtype}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{graphics}      \usepackage{hyperref}     \usepackage[     backend=biber,     style=authoryear-ibid,     sortlocale=de_DE,     natbib=true,     maxcitenames=2,     maxbibnames=100,     url=false,      doi=true,     eprint=false,     hyperref=true     ]{biblatex}     \bibliography{literature}      \usepackage{fancyhdr}     \usepackage[autostyle,german=guillemets,german=quotes]{csquotes}     \usepackage{setspace}     \onehalfspacing     \linespread{1.2}     \usepackage[xindy,toc,acronym,nomain]{glossaries}     \usepackage{geometry}     \geometry{a4paper, top=25mm, left=50mm, right=15mm, bottom=20mm,     headsep=12.7mm, footskip=12.7mm}     \pagestyle{fancy}      \fancypagestyle{plain}{\fancyhf{}\fancyhead[R]{\thepage}}     \fancyhf{}     \fancyhead[L]{}      \fancyhead[C]{}      \fancyhead[R]{\thepage}      \fancyfoot[C]{}     \renewcommand{\thefigure}{\arabic{figure}}     \makeglossaries     \renewcommand*\glspostdescription{\dotfill}          \begin{document}     \printglossaries     \newpage     \newacronym{gi}{GI}{The General Inquirer}     bla bla bla \gls{gi} bla bla bla      \end{document}      The entire console-output for the pdflatexmk run can be found here since it's quite lenghty: http://pastebin.com/y1aKpt8c


title: Font selection for mathematical documents

text: I am currently making a skeleton for my thesis. Since it will be in physics, it has to deal with a lot of mathematics. I think there are two ways of making it right.   1. Choose a font for text and a different for math which clearly differs from each other. The math font should support upright Greek, italic Greek, (almost) every symbol from the `amssymb` package. The math font should be clearly another because otherwise it looks improvised.    2. Choose the same font for everything (which is what I prefer). Of course like before, the font must support everything we need!  But I remember that there were some issues with the font selection and I can't really find a satisfying answer to the question: Which is the best font for mathematical LaTeX documents (if we want ONE font)? My approach before: I use the MinionPro font. I decided that because I read (and I really can't find where) some time ago that it is the only font that supports e.g. upright Greek and does not replace anything with another font because something is missing. Is this still valid, am I missing something, what opinions are out there?


title: Font Setup for an Academic Thesis, no Computer Modern Wanted

text: I want to help a friend to set up a template for his thesis. So far I used the `lmodern` package for almost everything. But I think that the readability of computer modern on a screen is not really good (printed it is good). In addition `lmodern` or cm look very common because almost everyone uses it. What font setup (math/text) would you recommend to spice a document up a little (it is still a academic thesis). It will be written in **German** and will contain a fair amount of **math** and **listings** too. It should look good on a screen too. I once read that **Lucida Bright** is a great font regarding my demands. But it is **not free**. I also read that the The **LaTeX Companion** is written with Lucida Bright. It is important that the math font contains **upright** and **italic greek letters**. Listing to start:               \documentclass[]{article}          \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[english]{babel}          \usepackage{blindtext}          \begin{document}          \section{Test Title}     \blindtext          \begin{description}     \item[serif] Test Test     \item[sans serif] \textsf{Test Test}     \item[typewriter] \texttt{Test Test}     \item[math] $a^2+b^2= c^2$     \end{description}          \end{document}      Output with `\usepackage{lmodern}` ![enter image description here](http://i.stack.imgur.com/TFSAe.png) Output with `\usepackage[sc]{mathpazo}` ![enter image description here](http://i.stack.imgur.com/CdqPS.png)


title: Use images for drawing an arrow

text: Is it possible to draw arrows (preferential with TikZ) with two images: One for the line and one for the tip? I would like to realize something like this: ![enter image description here](http://i.stack.imgur.com/QF7ew.png)


title: How to add notes spaces with beamer

text: I'm currently preparing a small presentation with `beamer`. No problems so far. Except that I'm looking for the best manner to get notes space (1/2 slides) like it's possible to do with Powerpoint or such tools. So that I can print my slides and add custom notes on the right. (i.e something better than `\frame[plain]{}` after each slide) About the look if I wasn't clear enough : ![Slides with notes](http://i.stack.imgur.com/uV1pf.jpg)


title: Magnifying part of a picture similar to TikZ spy library

text: Suppose I have a `.png` or `.jpg` file. Let's say this one: ![Tux to be magnified](http://i.stack.imgur.com/aVGcn.png) I would like to zoom in on the tip of Tux's beak. TikZ for example provides a very nice library that allows for zooming with a spyglass like style on TikZ pictures. How can I do the same for the above application?


title: biblatex citation styles

text: I'm using the `biblatex-chicago` package to get my references in the author- year format, but I'm struggling with the citation styles. I'm using `\autocite{cite key}` modified using `\renewcommand*{\nameyeardelim}{\addcomma\addspace}` to be able to have a citation in parenthesis after providing a data figure (e.g. "increased by 5% (UNESCO, 2012)"). But I would also like to use `\textcite{cite key}` to cite a paper in the fashion 'according to Nash (1950)". Instead, I'm getting 'according to Nash1950" (the cite key in bold letters). Is `\textcite` not compatible with `biblatex-chicago`? This citation style is supposed to look like Nash (1950). I've tried removing `-chicago` and running again, or using the `harvard` style. I also found a bibliography style (a .bst file) specific to the economics field that is a customized way to achieve citations in the format Nash (1950) so I tried using `\bibliographystyle{econ_aer.bst}` but that didn't work either. Please help MWE:               \documentclass{article}          \usepackage[backend=biber]{biblatex-chicago}     \renewcommand*{\nameyeardelim}{\addcomma\addspace}     \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @misc{UNESCO2001,       author = {UNESCO.},       year = {2001},       title = {Alpha},     }          @misc{Nash1950,       author = {Nash, D.},       year = {1950},       title = {Game Theory},     }          \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          According to \textcite{Nash1950}. data figure \autocite{UNESCO2001}.          \printbibliography          \end{document}


title: When to use a regular .initial key or a .store in key?

text: The excellent `pgfkeys` package provides, among others, two kinds of keys: regular "value-centric" keys that can be declared with `/.initial`, and "macro-centric" keys are declared with `/.store in`. Here is an example declaration of two keys:               \newcommand*{\mystoragemacro}{}     \pgfkeys{       my vkey/.initial = <initial value>,       my mkey/.store in = \mystoragemacro,       my mkey = <initial value>}      Setting the two types of keys is done as usual:               \pgfkeys{my vkey = <value>, my mkey = <value>}      However, code that retrieves the values stored in these keys works differently depending on the type of key. For `.initial` keys, the value is retrieved with `\pgfkeysvalueof` (e.g., `\pgfkeysvalueof{my vkey}`); for `.store in` keys, the value is always available in the storage macro (e.g., `\mystoragemacro`). **Question:** What are the advantages and disadvantages of these two kinds of keys? When should I use a `.initial` key, and when should I use a `.store in` key? As a concrete instance of my question, why did Ryan Reich use `.store in` keys in his `\myparbox` example, instead of using `.initial` keys?


title: Two-sided document: reverse page margins for hardcopy

text: ## Background Wrote a manual in LyX. The PDF is two-sided. Using KOMA Script v2. The pages are 8.5" x 11". ## Problem The spacing on the margins is not printer-friendly, it is reversed: ![Image](http://i.stack.imgur.com/0RRWx.png) Since this page is an even-numbered page (4), the print shop said that the extra space must be on the right-hand side. The extra space (for binding) is currently on the left-hand side (of even pages). ## Question How can the margins be swapped so that the larger space is on the right (for even page numbers) while maintaining the same total margin space? ## Ideas   * Tried adding a blank page to the beginning of the manual.   * `\KOMAoptions{BCOR=3cm}\recalctypearea` The latter results in the margins having been flipped around, but with different spacing. Thank you!


title: After switching to TeX Live from MiKTeX, Kile's live preview feature doesn't work anymore

text: A few days ago I switched from MiKTeX to TeX Live in order to make both my Mac and Windows computer be on the same platform. I've been ripping my hair out trying to figure out why Kile suddenly decided to stop working. To be clear, the regular compile function works perfectly. But the single most alluring feature of Kile, the live preview feature, does not work. On the "Log and Messages" screen, this is what shows up:               [LivePreview-PDFLaTeX] test.tex => test.pdf (pdflatex)     [LivePreview-PDFLaTeX] finished with exit code 1     Cannot open log file; did you run LaTeX?      This is what shows up on the "Output" screen:               *****     *****     LivePreview-PDFLaTeX output:      *****     cd "F:/"     *****     pdflatex -synctex=1 -interaction=nonstopmode -output-directory=C:/Users/Kevin/AppData/Roaming/.kde/share/apps/kile/livepreview/preview-p0caaa/ test.tex     *****     This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/W32TeX)      restricted \write18 enabled.     entering extended mode     ! I can't find file `test.tex'.     <*> test.tex          (Press Enter to retry, or Control-Z to exit)     Please type another input file name     ! Emergency stop.     <*> test.tex          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on "C:/Users/Kevin/AppData/Roaming/.kde/share/apps/kile     /livepreview/preview-p0caaa//texput.log".      So, do any of you have any idea why Kile is having problems?


title: Adding PDF pages with \includegraphics using a loop

text: I need to include PDF pages with `\includegraphics`. I know there is the package `\usepackage{pdfpages}`. So this is what I have:               \begin{picture}(0,0)(75,272.5)     \put(0,0){\frame{\includegraphics[page=i]{pdf_file_name}}}     \end{picture}      I need those dimensions so that the PDF page covers the whole page it is included. Now I want to add every page in a row of that PDF file. How can I create a loop which does that for me? Is there a key for the last page of the file? I have no idea about using `\while` `\for` or `\if` in this case. If you have any further documentation about it that would great. Example:               \for i=1 to i=last_page_of_pdf_file     {     \begin{picture}(0,0)(75,272.5)     \put(0,0){\frame{\includegraphics[page=i]{pdf_file_name}}}     \end{picture}     \newpage     }      I asked somthing similar using `\includepdf`. - Link


title: Putting math inside a verbatim environment without altering the formatting

text: In a verbatim code listing, I want to use inline math in comments with the same formatting that I get for inline math in body text. I can use a math environment, but the spacing is weird. In this example, there is a lot of space inside the angle brackets and after the comma.               \documentclass{article}     \usepackage{fancyvrb}     \begin{document}          \begin{Verbatim}[commandchars=\\\{\},codes={\catcode`^=7}]     # visit each \(\langle x, y \rangle \in s^2\)     for x in s:       for y in s:         foo(x, y)     \end{Verbatim}          \end{document}      Is there a way to get normal spacing? Related: How do I use mathematical symbols in verbatim mode?


title: Want to make the Poster?

text: I want to make the poster for Mathematics Games in same writing format ![enter image description here](http://i.stack.imgur.com/MdrwU.jpg)


title: Defining my own proof environment?

text: How would I define a `proof` environment that is basically used with               \begin{proof}     some proof here     \end{proof}      and it would be equivalent to:               \paragraph{Proof:} some proof here     \hfill \box      ?


title: How to make double cline in tables?

text: I want to draw a double `cline` in a table where the first column is `multirow` With double `\hline` I can draw a full double horizontal line but double `\cline{i-j}` seems to have the same effect with single `\cline`. Is there any other special command to do that? Thank you


title: Table numbering in unnumbered chapters (e.g. \chapter*)

text: I've tried to google this in about a dozen different ways, but didn't find anything. I have an introduction chapter that uses \chapter*. The numbering of the subsections is fine - they're still numbered as 0.X, which is exactly what I want. However, tables and figures are numbered without an initial 0.X, so I simply get Table 1, etc. I would like the Tables to be numbered starting with "Table 0.1" in the introduction. I also have an appendix which is also produced unnumbered (or lettered). The code from the (dissertation) style file I'm using is shown below. I would like here to have the Tables labelled A.1 or A.2. Currently I get "Table .1" and "Table .2" instead.               \newcount\chap@or@app\chap@or@app=1          \def\appendixname{Appendix}          \def\appendix{\clearpage         \typeout{Appendix.}         \short@page                 % <- 9/13/96 (MAL)             \markboth{}{}\pagestyle{myheadings} % <- The appendix must              \thispagestyle{plain}           % <- be numbered.         \vspace*{\fill}         \centerline{\large\bf Appendix}         \vspace*{\fill}              \addcontentsline{toc}{chapter}{Appendix}  % <-              \setcounter{chapter}{0}         \setcounter{section}{0}         \def\@chapapp{\appendixname}         \chap@or@app=2        %\def\thechapter{\Alph{chapter}} % Commented out 15 Aug 02   cwm                         % as a partial solution to                         % the problem of labeling                         % one appendix as Appendix A.         }


title: Do I need a new version of

text: I would like to put a graph side by side in my document. I believe I need to use the following: `\usepackage{subcaption}`. But I am getting an error message stating > subcaption.sty not found Anyone know why that might be? I am using TeXnicCenter 1.0 stable release candidate 1, copyright 1999-2008. That is what I see when I click on "About" under "Help" in the software. I'm far from an expert at this. Any direction would be appreciated.


title: Short horizontal line at the bottom of the first page using \documentclass{article}

text: Usually, when one uses `\documentclass{amsart}`, a short horizontal line appears on the first page in the lower left hand corner. If one includes information such as keywords and MSC, this information usually appears below that line. Is there a way to make LaTeX draw this line automatically when using `\documentclass{article}`?


title: Using a thesis template: Listing my publications by referencing a .bib file

text: I'm relatively new to Latex and new to Stack exchange. I am using the `ucthesis` template (University of California) on ShareLatex.com and am currently filling out a CV within the thesis document. I am having trouble getting my publications to list at the end of my CV. I have a file called `my_pubs.bib` containing my publications in typical latex form. The hints I have found online are based on writing a CV as its own separate document, as opposed to a CV within a global ucthesis template. I think this may be a cause of my confusion. In my case so far, I have used the command in a root file called `dissertation.tex`:               \usepackage{bibentry}      so that in my `vitae.tex` file I use:               \nobibliography{my_pubs}     \bibliographystyle{plain}     \begin{vitaesection}{Selected Publications}     \begin{itemize}     \item [2013] \bibentry{lee2013modeling}     \vspace{0.3cm}     \end{itemize}     \end{vitaesection}     }     \end{vitae}      When I compile, I don't see the reference cited. Other parts of the CV have a similar itemized form that compiles without a hitch. Any ideas as to what might be going wrong? Thank you so much!


title: Autosegmental Representation with pst-asr

text: I am using Texmaker and MiKTeX to try and produce an autosegmental representation such as the one in this image: ![hwari](http://i.imgur.com/5HmSGbP.png) The following code is given in John Frampton's pst-asr user's guide:               \asr[xgap=2em,syB=2.5em] hwari|     \@(1,sy){L}         \-[xed=true,xedratio=.4](1,ts)\-[style=dotted](2,ts)     \@(2,sy){H}         \-(2,sy)(2,ts)     \@(4,sy){L}         \-(4,ts)     \endasr      No matter how I build the PDF document, the result is similar to this (i.e. not the autosegmental representation above): ![hwari2](http://i.imgur.com/UXQeWEW.png) I am very new to this, so it is likely I am making a simple error. Any assistance would be greatly appreciated. See also the full code of my document:               \documentclass[10pt,a4paper]{article}     \usepackage{pst-asr}     \begin{document}     \asr[xgap=2em,syB=2.5em] hwari|     \@(1,sy){L}         \-[xed=true,xedratio=.4](1,ts)\-[style=dotted](2,ts)     \@(2,sy){H}         \-(2,sy)(2,ts)     \@(4,sy){L}         \-(4,ts)     \endasr     \end{document}      Thank you.


title: Translating a package

text: I am translating a calendar package (mcal.sty) from Portuguese into Indonesian, here.               \documentclass[border=4.9mm, bahasa, multi={tikzpicture}]{standalone}     \title{2014}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[bahasa]{babel}     \usepackage{translator}     \deftranslation[to=bahasa]{Enero}{Januari}     \deftranslation[to=bahasa]{Febrero}{Februari}     \deftranslation[to=bahasa]{Marzo}{Maret}     \deftranslation[to=bahasa]{Abril}{April}     \deftranslation[to=bahasa]{Mayo}{Mei}     \deftranslation[to=bahasa]{Junio}{Juni}     \deftranslation[to=bahasa]{Julio}{Juli}     \deftranslation[to=bahasa]{Agosto}{Agustus}     \deftranslation[to=bahasa]{Septiembre}{September}     \deftranslation[to=bahasa]{Octubre}{Oktober}     \deftranslation[to=bahasa]{Noviembre}{November}     \deftranslation[to=bahasa]{Diciembre}{Desember}          \deftranslation[to=bahasa]{Lunes}{Senin}     \deftranslation[to=bahasa]{Martes}{Selasa}     \deftranslation[to=bahasa]{Miércoles}{Rabu}     \deftranslation[to=bahasa]{Jueves}{Kamis}     \deftranslation[to=bahasa]{Viernes}{Jumat}     \deftranslation[to=bahasa]{Sábado}{Sabtu}     \deftranslation[to=bahasa]{Domingo}{Minggu}     \PassOptionsToPackage{bahasa}{translator}          \usepackage{mcal}          \begin{document}     \estilodetexto% To set up \sffamily, \bfseries…     \thisyear{2014}% The year the calendar is about.     \colordelosfestivos{red}% The color of holidays.     \remaincolor{white}% The color under the top rectangle (where the title and the previous and next calendar are)     \resubcolor{white}% The color under the names of the week     \mooncounter=2% To set the first moon of the year (0,1,2,3)     \enero[7,14,21,28]{7}% The months …     \febrero[7,14,21,28]{1,2,3,7,9,25}     \marzo[7,14,21,28]{1,2,3,7,9,25}     \abril[7,14,21,28]{1,2,3,7,9,25}     \mayo[7,14,21,28]{1,2,3,7,9,25}     \junio[7,14,21,28]{1,2,3,7,9,25}     \julio[7,14,21,28]{1,2,3,7,9,25}     \agosto[7,14,21,28]{1,2,3,7,9,25}     \septiembre[7,14,21,28]{1,2,3,7,9,25}     \octubre[7,14,21,28]{1,2,3,7,9,25}     \noviembre[7,14,21,28]{1,2,3,7,9,25}     \diciembre[4,12,19,27]{6,8,25,31}          \end{document}      What is wrong? Please show me the correct codes and results.


title: Textsuperscript does not work with letters

text: An attempt to write 8th `8\textsuperscript{th}` resulted in the same text 8th while the same environment worked well with numbers `8\textsuperscript{8}` and produced correct view with subscript. Why does textsuperscript not work with letters? P.S. Math mode is not used due to inattractive font view MWE               \documentclass[11pt,notitlepage,oneside,openany,a5paper]{book}      \usepackage{geometry}       \geometry{a5paper}     \begin{document}     8\textsuperscript{th}     \\     8\textsuperscript{1}     \end{document}      ![letters were ignored, while numbers are not](http://i.stack.imgur.com/GHyoN.png)


title: prevent break after \poemtitle

text: This MWE shows that LaTeX can put a break after the title of a poem (written with the `\poemtitle` command of the `verse` package). Can someone advice me a way to prevent this behaviour?               \documentclass{article}      \usepackage{verse}     \usepackage{lipsum}     \begin{document}     text          \lipsum[2-6]     \poemtitle{Poem title}     \begin{verse}     first\\     second     \end{verse}     text     \end{document}


title: nag [l2tabu] and \phantomsubcaption

text: The `nag` package used with the `l2tabu` option complains when `\label` is used in a float without following a `\caption`. Unfortunately, it does not understand that a `\phantomsubcaption`, from the `subcaption` package, should count. An example:               \RequirePackage[l2tabu]{nag}     \documentclass{article}     \usepackage{caption,subcaption}     \begin{document}     \begin{figure}       {\fbox{(a) FIGURE} \phantomsubcaption\label{lblA}}       \hfill       {\fbox{(b) OTHER FIGURE} \phantomsubcaption\label{lblB}}       \caption{A caption with subfigures \subref{lblA} and \subref{lblB}.}     \end{figure}     \end{document}      This generates complaints of the form > Package nag Warning: \label in float, but not after \caption on input line > 7. The answer to a previous question about `nag` and `subcaption` can be used in this case too; redeclaring `\phantomsubcaption` and adding `\@nameuse{nag@hascaptiontrue}` fixes up the problems:               \renewcommand*\phantomsubcaption{%       \caption@iftype         {\setcaptionsubtype*\phantomcaption\@nameuse{nag@hascaptiontrue}}%         {\caption@Error{\noexpand\phantomsubcaption outside float}}}%      Are there dangers in this approach? Is there a better way? Does a later version of `subcaption` than v1.1-62 have this fixed? EDIT: Sorry if my MWE was unclear. I'm using `\phantomsubcaption` because the subcaption labels, (a), (b), and so on, are in the figures themselves. The text in the MWE is not the subcaption of the figure, but a standin for the figure itself; I want no subcaption (hence `\phantomsubcaption`).


title: Customize \tcblower appearance in tcolorbox

text: I'm using boxes made with tcolorbox in my beamer presentation, using the beamer skin provided by the package. When the box is split in two parts with the \tcblower command, the lower part looks "disconnected" from the upper, while I'd like to hide the graphical difference. Here is a code sample:               \documentclass{beamer}     \usepackage{tcolorbox}     \tcbuselibrary{skins}           \begin{document}     \begin{frame}     \begin{tcolorbox}[width=2cm,skin=beamer,boxrule=0pt,after=]        test        \tcblower        test     \end{tcolorbox}     \begin{tcolorbox}[width=2cm,skin=beamer,boxrule=0pt,before=]        test             test     \end{tcolorbox}      \end{frame}     \end{document}      I'd like the first box to look exactly like the second, but at the same time I'd like to keep the ability to specify different properties for the two parts like different alignment, font size, etc. What I want is to hide the separation between the two parts just from a graphical point of view. I searched the docs but can't seems to find any clue about this.


title: Custom border for glossary and index pages

text: I'm preparing a technical book in Latex using KOMA script `srcbook` class and I would like to add a gray border ONLY to glossary and index pages. The idea is to make them easy to find when the book is closed, like in the sample below: ![index page](http://i.stack.imgur.com/h91oQ.png) I have seen similar solutions using `fancyhdr` or `tikz` but (1) I don't know if they can be applied directly without screwing KOMA, and (2) I've found no way to limit the border only to index/glossary pages and I'm sure there must be an obvious way to do both things. UPDATE: I found a solution (see below) using the `eso-pic` and `ifthen` packages to draw the border and the `etoolbox` to patch the `theindex` environment and control where it appears.


title: How can I insert an entire input stream (up to EOF) into an output stream?

text: I am trying to automate the generation of a text version of my resume. I'd like to incorporate a note to any potential human readers (most plain text resumes are, to my understanding, simply scanned by data mining programs). However, doing this within `expl3` itself is tedious—there's only so many times you can see `\c_space_tl` before it loses its individuality and personal character. I'd like to simple set up a means to grab the entire contents of an external file by path and shove it into the stream I'm writing. What is the most straightforward way to do this? I've a setup that looks like so:               \documentclass{article}     \usepackage{expl3}     \ExplSyntaxOn          \tl_const:Nn \g_resume_preamble_path_tl { preamble.txt }     \tl_const:Nn \g_resume_textout_path_tl { resume.out.txt }          \ior_new:N \g_resume_preamble_ior     \ior_open:Nn \g_resume_preamble_ior { \g_resume_preamble_path_tl }     \iow_new:N \g_resume_textout_iow     \iow_open:Nn \g_resume_textout_iow { \g_resume_textout_path_tl }          \begin{document}     ducks     \end{document}


title: Changing color and fonts of itemize

text: How can I change the font and color of a particular command in a LaTeX document? For example I want all the text that follows the `\item` tag to be gray and the font should be different from the rest of the document , which i can specify ...


title: Is there any way to use mac fonts in texlive distribution of LaTeX on ubuntu?

text: I want to try more fonts in my moderncv latex file and what font is suitable. I've already import Windows fonts into my Ubuntu OS and got the fonts work well with my tex file. So can I import the mac fonts and use it in my tex file as well?


title: Template compiling - biber, pdflatex, makeindex required to run in order

text: I'm using a template called Legrand Orange Book from http://www.latextemplates.com It compiles fine with `TeXShop` (part of the `MacTeX` distribution), but I'm not sure I'm doing it exactly right. I have to compile it several times to get the index and bibliography (I'm assuming that's expected behaviour). What method should I be using (if any, besides using the compile button) to ensure it compiles correctly (i.e., how do I know for certain how many times to run compile)? The instructions in the template say:               % Compiling this template:     % This template uses biber for its bibliography and makeindex for its index.     % This means that to update the bibliography and index in this template you     % will need to run the following sequence of commands in the template     % directory:     %     % 1) pdflatex main     % 2) makeindex main.idx -s StyleInd.ist     % 3) biber main     % 4) pdflatex main      And I see the following references in the template, so I assume `TeXShop` is calling the necessary programs internally(?):               % Bibliography     \usepackage[style=alphabetic,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}     \addbibresource{bibliography.bib} % BibTeX bibliography file     \defbibheading{bibempty}{}          % Index     \usepackage{calc} % For simpler calculation - used for spacing the index letter headings correctly     \usepackage{makeidx} % Required to make an index     \makeindex % Tells LaTeX to create the files required for indexing


title: Subfiles will not work ERROR: Missing \endcsname inserted

text: I downloaded this template (https://github.com/tlatsas/thesis-latex-template) for my thesis. The template uses subfiles, but when i try to run a pdf on the subfile chapter1.tex i get the following error-message from Auctex:               ERROR: Missing \endcsname inserted.          --- TeX said ---     <to be read again>                         \protect      l.34 \let              \old@document@subfiles\document     --- HELP ---     From the .log file...          The control sequence marked <to be read again> should     not appear between \csname and \endcsname.      What might be the cause of the error?


title: Author affiliations and date formatting

text: I am using `amsart`. But I do not want the author affiliations to be in small- caps which seems to be the default style in `amsart`. Instead I want them to be _italics_ and **8pt**. Also I want the date to be printed at the end of the document, after the references. Help.