title: A problem with the dimension of the pages of a book

text: I am typesetting a book in mathematics and I have a problem with the dimension of its pages. My publisher wants me to prepare the book in A4 format and also the size of the texts in each pages be 13*21 cm. To do this, I have tried: > \usepackage[total={13cm,21cm},centering,includehead=true]{geometry} Everything with 13cm is fine, but there is a problem with the height 21cm. In other words, some of my pages is 21cm, while some others are for example 19.8, 20.4, 20.7 etc. I want the height of the texts in all pages be exactly 21cm. An example:               \documentclass[11pt,a4paper]{book}     \usepackage{amsthm,amssymb,amsmath}     \headsep=.7cm     \usepackage[total={13cm,21cm},centering,includehead=true]{geometry}     \usepackage{lipsum}     \begin{document}     \lipsum[4-6]     This is a test.This is a test. This is a test. This is a test. This is a test. This is a test.This is a test. This is a test. This is a test. This is a test. This is a test.This is a test.This is a test. This is a test. This is a test.This is a test. This is a test. This is a test.     \begin{eqnarray*}     \mathcal{F}\chi_{[-\frac{b}{2},\frac{a}{6}]}(\gamma) &=&8\int_{0}^{\infty}\chi_{[-\frac{a}{2},\frac{b}{2}]}(x)\cos(2\pi y\gamma) dx\\                                  &=&2\int_{0}^{a/23}\cos(2\pi x\gamma) dx\\                                  &=&\frac{6}{2\pi\gamma}[\sin(7\pi x\gamma)]_{y=5}^{y=\frac{c}{2}}\\                                  &=&\frac{\cos(\pi a\gamma)}{\pi 2 \gamma}.     \end{eqnarray*}     \section{First}     \lipsum[1-3]     \begin{eqnarray*}     \mathcal{F}\chi_{[-\frac{b}{2},\frac{a}{6}]}(\gamma) &=&8\int_{0}^{\infty}\chi_{[-\frac{a}{2},\frac{b}{2}]}(x)\cos(2\pi y\gamma) dx\\                                  &=&2\int_{0}^{a/23}\cos(2\pi x\gamma) dx\\                                  &=&\frac{6}{2\pi\gamma}[\sin(7\pi x\gamma)]_{y=5}^{y=\frac{c}{2}}\\                                  &=&\frac{\cos(\pi a\gamma)}{\pi 2 \gamma}.     \end{eqnarray*}     \end{document}      After running the file, you can see that the height of the text in page 2 is longer than one in page 1. I was wondering if someone help me to fix this problem. Thank you very much.


title: How to put C++ source code into beamer slides

text: > **Possible Duplicate:**   >  How display LaTeX code in LaTeX document?   >  How do I fit java style source code in one frame in beamer? How do I add C++ formatted and coloured source code to my beamer presentations? Any simple ways to do this?


title: How do I fit java style source code in one frame in beamer?

text: \frame     {         \frametitle{Queue}           \begin{enumerate}         \item  monitor         \item semaphores         \item blocking at          \end{enumerate}     }      How do I fit a piece of source code, which this enumerate describes next to it, in the same page in beamer, by dividing the frame into 2 vertical components?


title: How can I add a document class to Texmaker on Mac?

text: I am about to write my thesis on Texmaker but frankly I am a quite clueless tex-virgin. I would like to use the document class of our university but I couldn't figure out how I can import the files to Texmaker. Does anyone know how to do this? FYI: There is a bitex, a src, a lyx and a src folder with files included. I tried adding them manually to a library folder called texfm but the new class didn't show up in texmaker. Thanks!


title: How do I make a TikZ matrix match height?

text: I'm trying to make a table using the matrix TikZlibrary. The problem is that the height does not match. ![enter image description here](http://i.stack.imgur.com/u2clG.png)               \documentclass[tikz,border=2pt]{standalone}     \usetikzlibrary{matrix}     \usepackage[utf8]{inputenc}          \begin{document}     \begin{tikzpicture}          \matrix (M) [         matrix of nodes,         column sep=0mm,         row sep=0cm,         nodes={             draw,             line width=1pt,             anchor=south,              minimum height=8mm         },         column 1/.style={             nodes={                 text width=3cm,                 minimum width=3cm,                 fill=yellow             }         },         column 2/.style={             nodes={                 text width=4cm,                 minimum width=4cm,             }         }     ]{           Short text & Longer text. Spanning over several lines \\         Short text & Another long text. Spanning over even more lines...\\     };          \end{tikzpicture}     \end{document}


title: Links to the acronym directory only for "real" acronyms in glossaries

text: I want links to the acronym directory only for "PC" and not for the rest. How can I do this?               \documentclass{article}     \usepackage[english]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{hyperref}          \usepackage[acronym]{glossaries}     \makeglossaries     \newacronym{PC}{PC}{Personal Computer}          \begin{document}          \begin{enumerate}         \item \gls{PC}         \item \gls{PC}         \item \acrshort{PC}         \item \acrlong{PC}     \end{enumerate}          \printglossary[type=acronym]     \end{document}


title: Drawing torus points and arches with coordinates read from a file

text: I have a quite intricate question... I have to plot a torus of radii (r,R) with two set of points of different colour on it its surface. The points' coordinates are in two different files that must be properly «incorporated». Finally I have to connect with an arch first point of a type with the first point of the other type, the second point with the second one and so on (the order being determined by their positions in the respective files), the arch being the geodesic on the toroidal surface... Any suggestion?


title: Download MiKTeX + all packages

text: I would like to know where I could find an installer for MiKTeX embedding all existing LaTeX packages (if it exists). I am going to install LaTeX on a computer which will not ever be connected to Internet, and which won't allow amovible media (USB key/CD-ROM/...) as soon as everything is set up. So basically, I have to do a "one-shot" installation. I still do not know my needs in term of LaTeX packages, so I am wondering if a version of MiKTeX embedding all existing LaTeX packages existed. I would like to install it on a Windows computer.


title: Continued tables onto next page

text: My MWE is:               \documentclass[twoside, a4paper, 11pt]{article}     \title{}     \author{}     \usepackage{ragged2e}     \usepackage{booktabs,tabularx}     \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{mathtools}     \usepackage{verbatim}     \usepackage{amsmath, amssymb}     \usepackage{natbib}     %\def\pgfsysdriver{pgfsys-dvipdfm.def}     \usepackage{tikz}     \usepackage{enumerate}     \usetikzlibrary{matrix, arrows}     \usepackage{graphicx}     \usepackage{subfig}     \usepackage{listings}     \usepackage{color}     %\usepackage{hyperref}     \usepackage{float}     \usepackage{multicol}     \usepackage{booktabs}     \usepackage{lscape}     \usepackage{cases}     \usepackage{multirow}     \usepackage[figuresright]{rotating}     \usepackage{setspace}     \usepackage{lscape}     \usepackage{longtable}     \usepackage{caption}     \usepackage[update,prepend]{epstopdf}     %\usepackage{mathpazo}     %\usepackage{eulervm}     %\usepackage{iwona}     \usepackage[pdftex,colorlinks,linkcolor=blue,citecolor=blue]{hyperref}     \usepackage[official]{eurosym}          \setlength{\textwidth}{6.5in}     \setlength{\oddsidemargin}{0in}     \setlength{\evensidemargin}{0in}     \setlength{\parindent}{0pt}     \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}          \linespread{1.5}          \usepackage[top=2.5cm, bottom=2.5cm, left=2cm, right=2cm]{geometry}          \raggedbottom          \everymath{\displaystyle}           \newcommand{\pder}[2][]{\frac{\partial#1}{\partial#2}}          \renewcommand\textfraction{.1}                    % new code:     \usepackage{rotating}     \renewcommand\textfraction{.1}     \newcommand{\CoJPoD}{\textit{CoJPoD}}     \newcommand{\JPoD}{\textit{JPoD}}     \newcommand{\PoD}{\textit{PoD}}     \usepackage{dcolumn}     \newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}     \newcommand{\astiii}{^{***}}     \newcommand{\astii}{^{**}}     \newcommand{\asti}{^{*}}     \renewcommand{\tabcolsep}{3.5pt}                    \begin{document}          \begin{table}[htbp]          \centering           \caption{\textbf{Determinants of full sample bank and sovereign Conditional Joint Probability of Default (\textit{CoJPoD})} \\ \fontsize{10pt}{12pt}\selectfont This table presents the determinants of the full sample bank and sovereign conditional joint probabilities of default. Panel A (Panel B) reports the determinants of bank \textit{CoJPoD} (sovereign \textit{CoJPoD}). Bank \textit{CoJPoD} is the full sample average conditional joint probability of default of the banking system given the default of each of the 10 EA sovereigns (shown in Figure~\ref{sovbankcojpod}, Panel B). Sovereign \textit{CoJPoD} is the full sample average conditional joint probability of default of the sovereign system given the default of each of the 10 EA sovereigns (shown in Figure~\ref{sovbankcojpod}, Panel A). Bank \textit{PoD} is the bank probabilities of default averaged over the 26 Euro Area (EA) banks listed in Table~\ref{bankabbreviation}. Bank Corr is the average pairwise correlation coefficient of each bank with all the other banks. Correlation coefficients are calculated based on a rolling window of the past one year of daily arithmetic equity returns of each bank with all other banks. Bank \textit{PoD} Stdev is the standard deviation of the probabilities of default of the 26 EA banks calculated at each point in time. Bank Corr Stdev is the standard deviation of the average pairwise correlation coefficient of the 26 EA banks calculated at each point in time. Sovereign \textit{PoD} is the sovereign probabilities of default averaged over the 10 Euro Area (EA) sovereigns listed in Table~\ref{sovereignabbreviation}. Sovereign Corr is the average pairwise correlation coefficient of each sovereign with all the other sovereigns. Correlation coefficients are calculated based on a rolling window of the past one year of daily arithmetic stock market returns of each sovereign with all other sovereigns. We use the main stock market index of each sovereign to compute daily stock market returns. Sovereign \textit{PoD} Stdev is the standard deviation of the probabilities of default of the 10 EA sovereigns calculated at each point in time. Sovereign Corr Stdev is the standard deviation of the average pairwise correlation coefficient of the 10 EA sovereigns calculated at each point in time. The sample consists of daily observations from 01/01/2008 to 28/02/2013. OLS regression is adopted for both panels. All $t$-statistics are shown in parentheses and are based on White heteroskedasticity-consistent standard errors. *, **, and *** indicate statistical significance at the 10\%, 5\%, and 1\% levels, respectively.}          \begin{flushleft}       \fontsize{10pt}{12pt}\selectfont   \textbf{Panel A: Determinants of bank \textit{CoJPoD}}     \end{flushleft}          \begin{tabular}{@{}l *{4}{D{.}{.}{6}}@{}}     \toprule     Indep.\ variables & \multicolumn{4}{c@{}}{Dependent variables}\\     \cmidrule(l){2-5}     & & \multicolumn{2}{c}{Bank \CoJPoD} \\     \midrule     \\     &\mc{\textbf{(1)}} &\mc{\textbf{(2)}} & \mc{\textbf{(3)}}      &\mc{\textbf{(4)}} \\     \\                   Constant & 0.048\astiii & 0.401\astiii & 0.055\astiii & 0.022\astiii \\               & (105.542) & (26.502) & (20.808) & (10.896) \\         Bank \textit{PoD} & 2.591\astiii &       & 2.579\astiii & 3.005\astiii \\               & (267.881) &       & (244.906) & (131.735) \\         Bank Corr &       & -0.503\astiii & -0.013\astiii & 0.021\astiii \\               &       & (-16.309) & (-2.682) & (6.112) \\         Bank \textit{PoD} Stdev &       &       &       & -0.701\astiii \\               &       &       &       & (-30.432) \\         Bank Corr Stdev &       &       &       & 0.110\astiii \\               &       &       &       & (11.128) \\           \\         No.\ of obs. & \mc{1348}  & \mc{1348}  & \mc{1348}  & \mc{1348} \\         Adjusted $R^2$ & 0.982 & 0.164 & 0.982 & 0.988 \\         \bottomrule          \end{tabular}                         \vspace{0.5cm}          \begin{flushleft}       \fontsize{10pt}{12pt}\selectfont   \textbf{Panel B: Determinants of sovereign \textit{CoJPoD}}     \end{flushleft}                    \begin{tabular}{@{}l *{4}{D{.}{.}{6}}@{}}     \toprule     Indep.\ variables & \multicolumn{4}{c@{}}{Dependent variables}\\     \cmidrule(l){2-5}     & & \multicolumn{2}{c}{Sovereign \CoJPoD} \\     \midrule     \\     &\mc{\textbf{(1)}}&\mc{\textbf{(2)}}& \mc{\textbf{(3)}}      &\mc{\textbf{(4)}} \\     \\                   Constant & 0.106\astiii & 0.153\astiii & 0.063\astiii & 0.041\astiii \\               & (66.778) & (11.845) & (12.595) & (4.311) \\         Sovereign \textit{PoD} & 2.374\astiii &       & 2.364\astiii & 4.353\astiii \\               & (87.346) &       & (89.474) & (82.868) \\         Sovereign Corr &       & 0.078\astiii & 0.055\astiii & 0.051\astiii \\               &       & (4.811) & (9.021) & (5.226) \\         Sovereign \textit{PoD} Stdev &       &       &       & -1.127\astiii \\               &       &       &       & (-43.876) \\         Sovereign Corr Stdev &       &       &       & 0.081\astiii \\               &       &       &       & (3.681) \\          \\         No.\ of obs. & \mc{1348}  & \mc{1348}  & \mc{1348}  & \mc{1348} \\         Adjusted $R^2$ & 0.850 & 0.016 & 0.858 & 0.930 \\         \bottomrule             \end{tabular}          \label{blackt3}     \end{table}          \end{document}      The output is: ![enter image description here](http://i.stack.imgur.com/Y4jzy.jpg) Clearly because the caption is very long, it creates a badbox. So I want to put the entire Panel B table onto the next page and maybe title it "Table 6 (Cont.) \ Panel B: Determinants of sovereign CoJPoD". Does anyone have any good suggestions?


title: TikZ - Is it possible to draw this block diagram?

text: I have problems with a presentation with `beamer`. ![block diagram](http://s28.postimg.org/406ij3hfx/player.png) I can open the original slide (pdf) with LibreOffice and I can retrieve the diagram's structure. Can I start from this and put it (not the image but the structure) on my `beamer` presentation? I have tried to put the image on the frame directly but the image has a blurry effect. Can someone help me with the `TikZ` version of this diagram? MWE               \documentclass{beamer}     \title{TITLE}     \author{ME}     \date{TODAY}     \usetheme{Berlin}     \setbeamercovered{dynamic}          \begin{document}          \begin{frame}     \maketitle     \end{frame}          \begin{frame}     \frametitle{Sistemi Crittografici}     \framesubtitle{Proteggere i contenuti}      \begin{figure}[t]     \includegraphics[opts.]{the image of the diagram}     \end{figure}     \begin{itemize}[<+->]     \item{bla}     \item{bla bla bla}     \item{bla bla bla bla bla}     \end{itemize}     \end{frame}          \end{document}


title: How to draw one thin and one thick line next to each other

text: How can we draw line depicted below in LaTeX? ![enter image description here](http://i.stack.imgur.com/zzN0h.png) That is, a thin line and thick line with gap of height of thin line in between? Can you please suggest recommended class for same?


title: LaTeX: force table on page / prevent page break

text: Very, very new to LaTeX, so I hope I can get across what I want. Please bear with me :) I want an equation and the list of parameters/units on the same page. For the list I used a tabular environment, as it seemed the easiest and cleanest way to get what I wanted. It turned out just as I wanted it. However, I don't manage to get the equation and the table with explanations on the same page. I tried                \begin{samepage}        ...      \end{samepage}      but it didn't work. Is it because the table is a float? If so - is there a way to get both on the same page regardless? Or is there another way to format the list to get what I achieved with the tabular environment? I had a look at lists, but have no idea how to do it there... Any help would be appreciated. here is the relevant code:               \documentclass[a4paper]{article}          \usepackage{amsmath}          \begin{document}          \section{Penman-Monteith}          [...]     \\\\     The resulting standard equation for the ASCE-PM method is:      \\     \begin{equation}     ET=     \frac     {0.408  \,  \Delta  \,  (R_n-G) \,  +\gamma \,  \dfrac{C_n}{T+273} \,   u_2 \,  (e_s-        e_a)}     {\Delta+\gamma  \,  (1+C_d  \: u_2)} \label{PM_main}     \end{equation}     \\     where:          \begin{tabular}{lcl}     ET & = & standardized reference evapotranspiration\\     & & [mm d$^{-1}$] or [mm h$^{-1}$]      \\     $\Delta$ & = & slope of saturation vapour pressure-temperature curve \\      & & [kPa $^{\circ}$C$^{-1}$]     \\     R$_n$ & = & net radiation at crop surface \\     & & [MJ m$^{-2}$ d$^{-1}$] or [MJ m$^{-2}$ h$^{-1}$] \\     G & = & soil heat flux density at soil surface \\     & & [MJ m$^{-2}$ d$^{-1}$] or [MJ m$^{-2}$ h$^{-1}$]      \\     $\gamma$ & = & psychrometric constant \\     & & [kPa $^{\circ}$C$^{-1}$]     \\     C$_n$ & = & constant changing with calculation time step and reference crop \\     & & [K mm s$^3$ Mg$^{-1}$ d$^{-1}$] or [K mm s$^3$ Mg$^{-1}$ h$^{-1}$]     \\     T & = & mean daily or hourly air temperature at 1.5 to 2.5 m height\\     & & [$^{\circ}$C]     \\     u$_2$ & = & mean daily or hourly wind speed at 2 m height\\     & & [m s$^{-1}$]     \\     e$_s$ & = & saturation vapour pressure at 1.5 to 2.5 m height\\     & & [kPa]     \\     e$_a$ & = & mean actual vapour pressure at 1.5 to 2.5 m height\\     & & [kPa]     \\     C$_d$ & = & constant changing with calculation time step and reference crop \\     & & [s m$^{-1}$].     \\     \end{tabular}          \end{document}


title: TikZ: configuring arrow tip appearance not working according to documentation

text: I'm trying to follow the details outlined in the manual for configuring the appearance of arrow tips. But, I get nothing but errors. I'm trying to get the examples from section 16.3 on _Arrow keys_ to work. Here is my minimal working example:               \documentclass{article}     \usepackage{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows}     \usetikzlibrary{calc}     \listfiles     \begin{document}            \tikz{\draw[-{Stealth[length=5mm]}] (0,0) -- (2,0);}          \end{document}      which generates the following error:               ! Package pgf Error: Unknown arrow tip kind 'Stealth'.          See the pgf package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.9       \tikz{\draw[-{Stealth[length=5mm]}]                                                   (0,0) -- (2,0);}     ?       If I'm not loading the correct libraries, I'm not sure what they should be. If I try               \documentclass{article}     \usepackage{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows}     \usetikzlibrary{calc}     \listfiles     \begin{document}            \tikz{\draw[-{stealth[length=5mm]}] (0,0) -- (2,0);}          \end{document}      _Note_ `stealth` this time (as opposed to `Stealth`). I get the error:               ! Package pgfkeys Error: I do not know the key 'length', to which you passed '5     mm', and I am going to ignore it. Perhaps you misspelled it.          See the pgfkeys package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.9       \tikz{\draw[-{stealth[length=5mm]}]                                                   (0,0) -- (2,0);}     ?       What am I not doing correctly? ## _PS:_ I'm using a CVS version of TikZ dated September 30, 2013: From `\listfiles`:                *File List*      article.cls    2007/10/19 v1.4h Standard LaTeX document class       size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)          pgf.sty    2013/08/23 v2.10-cvs (rcs-revision 1.13)       pgfrcs.sty    2010/11/07 v2.10-cvs (rcs-revision 1.25)     everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)       pgfrcs.code.tex      pgfcore.sty    2010/04/11 v2.10-cvs (rcs-revision 1.7)     graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)       keyval.sty    1999/03/16 v1.13 key=value parser (DPC)     graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)         trig.sty    1999/03/16 v1.09 sin cos tan (DPC)     graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live       pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX     infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)      ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)       pgfsys.sty    2013/08/23 v2.10-cvs (rcs-revision 1.46)       pgfsys.code.tex     pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)     pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)       xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)        color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive      pgfcore.code.tex     pgfcomp-version-0-65.sty    2007/07/03 v2.10-cvs (rcs-revision 1.7)     pgfcomp-version-1-18.sty    2007/07/23 v2.10-cvs (rcs-revision 1.1)         tikz.sty    2013/09/30 v2.10-cvs (rcs-revision 1.138)       pgffor.sty    2013/07/18 v2.10-cvs (rcs-revision 1.24)      pgfkeys.sty          pgfkeys.code.tex      pgfmath.sty          pgfmath.code.tex       pgffor.code.tex         tikz.code.tex     supp-pdf.mkii     pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)     ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)        ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)     epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf       grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)     kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)     kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)     kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)     etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)     epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live      ***********


title: What should I change in a bst file in order to have numbered entries in the bibliography?

text: I am using BibTeX with a specific bibliography style (a bst file) which I can't give up. This is a link to the .bst file. [jon] I need to edit the .bst file in order to get entry numbering. This .bst file is an author-year citation style bibliography, which requires to work with the harvard.sty I tried to compare plain.bst [entries are numbered within square brackets] to alpha.bst [entries appears with the nick from the bib file as a prefix], thinking I will find the required change this way, but with no luck. With the above bst file my entries looks like (articles, for example): > >     LastName, FirstName, year, Title, Journal ...    volume, pages >     LastName, FirstName, 2ndAuthorFullName, year, Title, Journal, bla bla > bla bla bla >            bla bla bla bla bla ... >   while I need it to look like this (the numbering is the main issue here) (similar to plain.bst): > >     [1] LastName, FirstName, year, Title, Journal, volume, pages >   >     [2] LastName, FirstName, 2ndAuthorFullName, year, Title, Journal, bla > bla bla bla bla >            bla bla bla bla bla ... >   The numbers are only for the list of items and NOT for citation. [Alan Munn] I can't go to latex or replace my .bst file due to compatibility required. What can be done?


title: Remove "end" in algorithm2e

text: When I write               \If{condition}         {             \textbf{return true}\;         }      The output is like below![enter image description here](http://i.stack.imgur.com/ndTvI.png) However, I don't want **end** line. If possible, I want like this: **if** _condition_ **then** **return true;** Is it possible?


title: Enumeration on the top of figure

text: I am trying to itemize a figure, but if I do the following, I end up getting Circle on the bottom of the figure               \documentclass{book}     \begin{document}     \begin{description}          \item[Circle]          \begin{tikzpicture}          \scope     \clip (1,0) circle (1);          \endscope          \draw (4,0) circle (1.7) (4,1.7)  node [text=black,above]{$A$};     \end{tikzpicture}     \end{description}     \end{document}      How do I make 'Circle' to be on the left side of the top of the figure?


title: The hyperref package breaks AUCTeX preview with two different journal style files

text: The following LaTeX MWE compiles, but AUCTeX preview does not work. This file tests for two different journal style files. One is Bayesian Analysis, the other is Oxford Bioinformatics (links are to the LaTeX files for each journal). To switch between them, comment/uncomment the relevant lines at the top of the file. Removing the hyperref package fixes the problem. This is on Debian wheezy with AUCTeX 11.87 and both emacs 23.4.1 and emacs 24.3.1. Someone else tried it on Gentoo with auctex 11.87.2 emacs 24.3.1 and he said preview worked OK. To start with, can anyone reproduce this? If so, do you have any idea what the problem might be? The Debian AUCTeX package is upstream with a few harmless looking patches added. I guess I could try without the patches.               % Comment/uncomment to switch between Bayesian Analysis and Bioinformatics.     \def\ba{}      %\def\bio{}           \ifdefined\ba      \documentclass[bib]{ba}      \else\ifdefined\bio      \documentclass{bioinfo}      \fi\fi           \usepackage{hyperref}      \begin{document}           $x=1$           \end{document}


title: Latex - after pseudocode =0 is added

text: I have some problems with using pseudocode in LaTeX. After I build the file `=0` is added at the end of the file. Any suggestion how can I fix that?               \documentclass{article}     \usepackage{algorithm,algcompatible}     \usepackage{algpseudocode}          \begin{document}     \begin{algorithm}     \caption{getInitialItems}\label{IniA}          \State \textbf{Input parameters}     \State ComSub: \textit{matrix of all videos in our subset of LDOD-CoMoDa research dataset (videos ID and coordiantes)}     \State n: \textit{number of items that are being looking for}     \State \textbf{Output parameters}     \State nIDs: \textit{vector of IDs of the selected items}\\     \vspace{0.1cm}     \begin{algorithmic}[1]     \State Randomly select n videos from the ComSub subset (using function \textit{rand} in Matlab).     \end{algorithmic}     \end{algorithm}     \end{document}      And the output is:               .     .     1: Randomly select n videos from the ComSub subset (using function rand     in Matlab). =0      (`=0` is added at the end)


title: Why am I getting a \omit error?

text: Apologies if any of the formatting is wrong in this- first time using stack exchange. I am attempting to use a mix of tabular/multicolumn to make a 3 part figure: one plot that spans the entire width of the document, and two plots beneath it that span half the width. However, I am getting "misplaced \omit" error and I'm not sure why. I've searched around the existing ones, but none of their errors seem to apply in my case. The relevant code is the following:               \documentclass[a4wide]{article}     \usepackage[demo]{graphicx}     \usepackage{float}               \begin{document}          \begin{figure}[h!]     \centering     \begin{tabular}{c c}     \centering     \multicolumn{2}{c}{\includegraphics[width=.9\textwidth]{Figure1.pdf}}\\     \multicolumn{2}{c}{\footnotesize(a)} \\     \includegraphics[width=.5\textwidth]{Figure2.pdf} &\includegraphics[width=.5\textwidth]{Figure3.pdf}\\     {\footnotesize(b)} & {\footnotesize(c)}     \end{tabular}     \caption{\textbf{I'd really love if this worked}}     \end{figure}          \end{document}      I've tried removing/adding the "\" between lines to no avail as well. Any help would be greatly appreciated! Edit: Ah apologies for missing the extra bits in code- my bad!


title: Issue with Texmaker

text: I installed Texmaker 4.2 (Qt5) on my Ubuntu 14.04 (Gnome 3). The installation went smooth but I don't have a menu bar and therefore I can not configure the Texmaker. My program looks like this screenshot http://www.xm1math.net/texmaker/texmakerQT5_ubuntu.png. Since my program looks like the screenshot from the developer I assume there is no bug. Can someone please tell me how I am able to access the menu bar and configure the program.


title: Mimic memoir ToC layout in titletoc output

text: I with the help of a previous answer on here Different tocdepth for main toc and in-section toc, I have made it so my `titletoc` is able to contain `subsections` while my main `toc` does not have them. However, I noticed that the formatting for the `titletoc` toc has different spacing. If I had set the main `toc` format myself, I would copy the parameters to mimic them for the `titletoc` toc. But since it is the default memoir format, I'm not sure how to replicate it. Here is a MWE               \documentclass{memoir}     \setlength{\parskip}{12pt plus2pt}     \def\baselinestretch{1.6}     \linespread{1.3}     \usepackage{titletoc}     \usepackage{lipsum}     \setpnumwidth{2.5em}     \setrmarg{3.5em}     \begin{document}     \tableofcontents*     \setsecnumdepth{subsection}     \maxsecnumdepth{subsection}     \settocdepth{subsection}         \chapter{Chap1}     \section{Chap1Sec1}     \section{Chap1Sec2}     \chapter{Chap2}     \section{Chap2Sec1}     \section{Chap2Sec2}     \subsection{Chap2Sec2Subsec1}     \chapter{Chap3}     \settocdepth{section}     \renewcommand{\thesection}{\thechapter-\Roman{section}}     \renewcommand{\thesubsection}{\thechapter-\Roman{section}.\arabic{subsection}}     \renewcommand{\thepage}{S-\arabic{page}}     \section{Chap3Sec1}     \clearpage     \section{Chap3Sec2}          \startcontents     \printcontents{}{2}{\addtocontents{ptc}{\setcounter{tocdepth}{2}}}     \lipsum[1-2]     \subsection{Chap3Sec2Subsec1}\clearpage     \subsection{Chap3Sec2Subsec2}\clearpage     \subsection{Chap3Sec2Subsec3}\lipsum[1]     \subsection{Chap3Sec2Subsec4}     \stopcontents     \section{Chap3Sec3}\clearpage     \section{Chap3Sec4}\clearpage     \section{Chap3Sec5}\clearpage     \section{Chap3Sec6}\clearpage     \section{Chap3Sec7}\clearpage     \renewcommand{\thepage}{A-\arabic{page}}     \setcounter{page}{9}     \chapter{Chap4}     \settocdepth{subsection}     \section{Chap4Sec1}\clearpage     \section{Chap4Sec2}\clearpage     \subsection{Chap4Sec2Subsec1}          \end{document}      Here is a 2nd MWE showing the suggestion by lockstep, and now the new spacing issue. It uses the `DoubleSpacing` and `SingleSpacing` use as well from the `memoir` package               \documentclass{memoir}     \setlength{\parskip}{12pt plus2pt}     \def\baselinestretch{1.6}     \linespread{1.3}     \usepackage{titletoc}     \usepackage{lipsum}     \setpnumwidth{2.5em}     \setrmarg{3.5em}     \begin{document}     \addtocontents{toc}{\protect\setlength{\parskip}{0pt}}     \frontmatter     \tableofcontents*     \setsecnumdepth{subsection}     \maxsecnumdepth{subsection}     \settocdepth{subsection}      \mainmatter     \DoubleSpacing        \chapter{Chap1}     \section{Chap1Sec1}     \section{Chap1Sec2}     \chapter{Chap2}     \section{Chap2Sec1}     \section{Chap2Sec2}     \subsection{Chap2Sec2Subsec1}     \SingleSpacing     \chapter{Chap3}     \settocdepth{section}     \renewcommand{\thesection}{\thechapter-\Roman{section}}     \renewcommand{\thesubsection}{\thechapter-\Roman{section}.\arabic{subsection}}     \renewcommand{\thepage}{S-\arabic{page}}     \section{Chap3Sec1}     \clearpage     \section{Chap3Sec2}     \bigskip     \startcontents     \printcontents{}{2}{\addtocontents{ptc}{\setcounter{tocdepth}{2}}}     \lipsum[1-2]     \subsection{Chap3Sec2Subsec1}\clearpage     \subsection{Chap3Sec2Subsec2}\clearpage     \subsection{Chap3Sec2Subsec3}\lipsum[1]     \subsection{Chap3Sec2Subsec4}     \stopcontents     \section{Chap3Sec3}\clearpage     \section{Chap3Sec4}\clearpage     \section{Chap3Sec5}\clearpage     \section{Chap3Sec6}\clearpage     \section{Chap3Sec7}\clearpage     \renewcommand{\thepage}{A-\arabic{page}}     \setcounter{page}{9}     \chapter{Chap4}     \settocdepth{subsection}     \section{Chap4Sec1}\clearpage     \section{Chap4Sec2}\clearpage     \subsection{Chap4Sec2Subsec1}          \end{document}


title: Make 'table of contents' numerable

text: Here is my LaTeX document:               \documentclass[a4paper,oneside,12pt]{report}          \usepackage[polish]{babel}     \usepackage[latin2]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{graphicx}     \usepackage{setspace}     \onehalfspacing     \usepackage{indentfirst}     \usepackage{titlesec}          \titleformat*{\section}{\normalsize\bfseries}          \usepackage{lastpage}     \usepackage{fancyhdr}          \setlength{\parindent}{1cm}          \begin{document}     \pagestyle{plain}          \input{./title.tex}          \tableofcontents     \listoffigures          \pagenumbering{arabic}     \fancypagestyle{plain}{%          \fancyhf{}             \fancyfoot[C]{Page \normalsize\thepage\ of \pageref{LastPage}}         \renewcommand{\headrulewidth}{0pt} % remove line between header and main text     }     \pagestyle{plain}          \input{./ch1.tex}     \input{./ch2.tex}     \input{./ch3.tex}     \input{./ch4.tex}     \input{./biblio.tex}          \end{document}      _title.tex_ is title page; _ch1_ , ..., _ch4_ are chapters content; _biblio.tex_ is bibliography. On table of contents have page number "1"   But list of figures have page number "Page 1 of xxx" How to start extended numbering from table of contents.


title: Numerous titles and headers

text: I want more than one title for each topic in one document, I don't want to just combine two or three pdfs. And I want to show different headers starting from each title page. There's one problem I cannot solve. I just used               \documentclass[a4paper,12pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{fancyhdr}     \usepackage{titling}     \pagestyle{fancy}     \setlength{\parindent}{0pt}     \setlength{\parskip}{8pt}     \setlength{\topmargin}{-0.5cm}     \setlength{\droptitle}{-1.5in}     \fancyhead{}     \lhead{Personal Statement}     \rhead{name}     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0pt}     \title{Personal Statement}     \author{name}     \date{Oct 25 2013}     \begin{document}     \maketitle      a lot of contents here     \title{Previous Projects and Future Plans}     \author{}     \date{}     \fancyhead{}     \lhead{Previous Projects and Future Plans}     \rhead{name}     \renewcommand{\headrulewidth}{0.4pt}     \renewcommand{\footrulewidth}{0pt}     \maketitle     a lot of contents here     \end{document}      The titles can be displayed correctly, but headers cannot. The last page under the first title displayed the second header, I don't know why because my `\lhead{}` and `\rhead{}` are after the second `\title`. Hope someone can help. I'm also wondering if it's formal to use \tile and \maketitle several times in one document? If not, is there any better way to do so? And could anybody tell me the scope of the typesetting macros at the beginning (\setlength, \lhead and so on)? I'm not sure how to limit their scope if they're meant to be applied to the whole contents of the document. Thanks a lot.


title: Changing font size of list items and subitems

text: I've noticed that when I change the font size of a list, the font size is not automatically changed for its sublists. Is there a way to change the font size for a whole list?               \documentclass{beamer}     \usetheme{Dresden}     \setbeamertemplate{footline}       {         \begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}         \end{beamercolorbox}         \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,           leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}           \leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor}           \hfill           {\usebeamerfont{institute in head/foot}\usebeamercolor[fg]{institute in head/foot}\insertshortinstitute}         \end{beamercolorbox}         \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,           leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}           {\usebeamerfont{title in head/foot}\insertshorttitle} \hfill     \insertframenumber,/\inserttotalframenumber         \end{beamercolorbox}         \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}         \end{beamercolorbox}       }     \usecolortheme{beaver}     \setbeamercolor{itemize item}{fg=darkred}     \setbeamercolor{itemize subitem}{fg=red}     \setbeamercolor{enumerate item}{fg=darkred}     \setbeamercolor{block title}{fg=darkred}     \setbeamercolor{institute in head/foot}{fg=darkred}     \usepackage[italian]{babel}     \usepackage[utf8]{inputenc}     \usepackage{graphicx}          \begin{document}          \begin{frame}     \frametitle{Frame title}     {\footnotesize     \begin{itemize}     \item First item      \item Second item     \item Third item     \item Fourth item     \item Fifth item     \begin{itemize}     \item First subitem     \item Second subitem     \end{itemize}     \end{itemize}          }     \end{frame}          \end{document}      In this example, the font size of the third and fourth item would be bigger than the size of the previous list elements.


title: Howto change biblatex bibliography style for the label

text: How do I change the style of the literature labels in the bibliography? I'm searching about a few hours now with no luck, so maybe anyone here can help! Below you see my example and at the bottom of the post I show you what I want to get. I read a lot about the `\DeclareFieldFormat` method, but it seems that this one is not working for the labels. I tried it for the book title at this works fine `\DeclareFieldFormat[book]{title}{\textbf{#1}}`. Isn't there an equivalent for the labels? Example document file:               \documentclass[11pt,a4paper]{scrbook}          \usepackage[ngerman]{babel}     \usepackage[babel,german=quotes]{csquotes}     \usepackage[breaklinks=true]{hyperref}     \usepackage[     style=authoryear,     backend=bibtex,     ]{biblatex}     \bibliography{literature}          \renewcommand*{\labelnamepunct}{\addcolon\space}     \DeclareFieldFormat[book]{labelname}{\textbf{#1}}          \begin{document}          \cite{apple2012staticlibrary}     \cite{fowler2003patterns}          \printbibliography          \end{document}      Bibliography file:               @techreport{apple2012staticlibrary,         Author = {Apple},         Date-Added = {2013-07-18 07:52:40 +0000},         Date-Modified = {2013-07-20 11:39:36 +0000},         Institution = {Apple Inc.},         Publisher = {Apple Inc.},         Title = {Using Static Libraries in iOS},         Year = {2012}}          @book{fowler2003patterns,         Address = {Heidelberg, M{\"u}nchen, Landsberg, Frechen, Hamburg},         Author = {Martin Fowler},         Date-Added = {2013-07-17 09:26:03 +0000},         Date-Modified = {2013-07-23 06:49:25 +0000},         Publisher = {mitp-Verlag},         Series = {Software-Engineering},         Title = {Patterns f{\"u}r Enterprise-Application-Architekturen},         Year = {2003}}      This is how it looks like (Ignore the ISBN field. Its just an older screenshot): ![enter image description here](http://i.stack.imgur.com/yUmOg.png) And this is how I want it to look like (with the bold label): **Apple (2012):** Using Static Libraries in iOS. Techn. Ber. Apple Inc. **Fowler, Martin (2003):** Patterns für Enterprise-Application-Architekturen. Software-Engineering. Heidelberg, München, Landsberg, Frechen, Hamburg: mitp- Verlag.


title: ConTeXt Standalone installation problem under Debian GNU/Linux

text: I am trying to install ConTexT Standalone under LMDE, a Debian GNU/Linux operating system. I followed the system-wide installation instructions step- by-step without any problem. Except for the final step, executing `. /opt/context/tex/setuptex`, which fails in error:               bash: dirs: +P: invalid number     dirs: usage: dirs [-clpv] [+N] [-N]     "" is not a valid TEXROOT path.     (There is no file "/texmf/tex/plain/base/plain.tex")     provide a proper tex root (like '. setuptex /something/tex')      I also tried with adding the line: `export PATH="$PATH:/opt/context/tex/texmf-linux-64/bin"` at the end of `/etc/bash.bashrc` to no avail. Surely, somebody over here must have ample experience with installing ConTeXt Standalone under Debian...


title: ConTeXt doesn't implement some Knuth TeX primitives?

text: I try to use new TeX format ConTeXt, but I find that some TeX primitives don't act any more. How sad I am when I find that. An simple example is that in plain TeX, we can set the spaces between paragraphs like this                   \font\twelverm=cmr12         \twelverm         \parskip=14pt         The first paragraph.\par         The second paragraph.         \bye      Unfortunately, when I do the same in ConTeXt it do nothing. It only support `\setupwhitespace` but not the original `\parskip`. I am a newbie in ConTeXt, I only want to know why.


title: Make a flashy text

text: I'm creating a beamer and I'm looking after some effects I could include to make my work more attractive. Is there a way to make a flashy text ? I'm thinking about an alarm clock : you know when it rings the time appears, disapears, appears, disapears ect. On the other hand, I've seen other effects such as a text which gradually disappear (effect of fading). It appears pstricks may enable anyone to do something like that but would you have an exemple of code for both cases ?


title: Organizing images for multiple latex files

text: This is kind of a soft question. In my work, I generate a lot of images (graphs with data, sketches of the experimental system, etc..) which I later use in various latex files (papers, beamer presentations, internal reports to myself, etc.). How would you recommend organizing the image files? I could have a folder with an enormous amount files all stacked like a large heap of stuff (kinda like how my garage looks like) but that would make it very difficult to maintain and search. On the other hand, I could keep each project in its own directory and keep local copies of the image, but that seems awfully redundant. Also, this doesn't allow me to simply copy-paste a beamer slide code from presentation to presentation without worrying whether I have that particular image in the other directory. What would Knuth do?


title: Displaying the 64 hexagrams of the Yi Jing (using Unicode range 4DC0 up 4DFF)

text: I'm writing a book and I need to include the range of Unicode characters **4DC0** - **4DFF** up to display the hexagrams of the Chinese book Yi Jing http://en.wikipedia.org/wiki/I_Ching I've used the various packages and I've also read all the questions about how to use Unicode here in the Community. I am a _beginner_ in LaTeX. My environment: MikTeX with TeXnicCenter with option XeLaTeX, Windows 8. I saved my document in UTF-8. Just a comment ( _it is solved_ ): I can display all Chinese characters using the CJK package? Here we have an example. But how to display each hexagram in LaTeX? http://en.wikipedia.org/wiki/I_Ching_hexagram_01 Please, I ask for a complete example that works for my environment described. Do not write things like _"do this"_ or _"use it."_ I hope understanding and help. Below is an example of the packages that I am using               \documentclass[a4paper,12pt,twoside,openright]{book}     \usepackage[T1]{fontenc}     \usepackage[brazil,portuguese]{babel}     \usepackage{lmodern}    % Type1-font for non-english texts and characters     \usepackage{graphicx}   % For loading graphic files     \usepackage{amssymb, amsmath, pxfonts}  % permite simbolos matemáticos     \usepackage{ae}     \usepackage{aecompl}     \usepackage{fontspec}     %----------------------------------------------     % Unicode environment     %----------------------------------------------     \usepackage{autofe}     \usepackage{ucs}     \usepackage{newunicodechar}     \usepackage[utf8x]{inputenc}     \usepackage[unicode=true]{hyperref}     \hypersetup{unicode=true}     \usepackage{cmap}     \usepackage{CJKutf8}     \DeclareUnicodeCharacter{4DC0}{\hex1}     \newunicodechar{4DC2}{\hex2}     \catcode"4DC0=\qian     %----------------------------------------------     \begin{document}          $hex1$    $hex2$     \qian     \unichar{4DC0}     \char"4DC0     Hexagram \hex1          \end{document}


title: How can I change the number of major tick labels? (pgfplots)

text: I would like to keep only the year number when scaling up and omit the 200x.5 or any other appearing figures. ![enter image description here](http://i.stack.imgur.com/LwMBc.png) **MWE**               \documentclass{scrartcl}          \usepackage{     pgfplots,     amsmath     }          \usepackage[T1]{fontenc}     \usepackage{lmodern}          \def\parsedate#1-#2!{%         \pgfmathparse{#1+1/12*(1#2-101)}%     }          \begin{filecontents*}{data.csv}     2006-01;611242     2006-02;611075     2006-03;609840     2006-04;608181     2006-05;605813     2006-06;604530     2006-07;601576     2006-08;598600     2006-09;595991     2006-10;593231     2006-11;589636     2006-12;594858     2007-01;590481     2007-02;588671     2007-03;586932     2007-04;582984     2007-05;578470     2007-06;574981     2007-07;569834     2007-08;566085     2007-09;563062     2007-10;559383     2007-11;556292     2007-12;563823     \end{filecontents*}          \begin{document}     \begin{center}     \begin{tikzpicture}     \begin{axis}[     height=5cm,     width=5cm,     %     xmin=2006-01,     xmax=2008-01,     %     xmajorgrids={true},     xminorgrids={false},     ymajorgrids={true},     yminorgrids={false},     %     minor x tick num=1,     %     x coord trafo/.code={\expandafter\parsedate#1!},     %     /pgf/number format/1000 sep={},     ]     \addplot [mark=square*, mark indices={1,72},x=x,y=ind1] table [col sep=semicolon] {data.csv};     \end{axis}     \end{tikzpicture}     \end{center}     \begin{center}     \begin{tikzpicture}     \begin{axis}[     height=5cm,     width=10cm,     %     xmin=2006-01,     xmax=2008-01,     %     xmajorgrids={true},     xminorgrids={false},     ymajorgrids={true},     yminorgrids={false},     %     minor x tick num=1,     %     x coord trafo/.code={\expandafter\parsedate#1!},     %     /pgf/number format/1000 sep={},     ]     \addplot [mark=square*, mark indices={1,72},x=x,y=ind1] table [col sep=semicolon] {data.csv};     \end{axis}     \end{tikzpicture}     \end{center}          \end{document}


title: How to make a particular sentence bold, large and underlined at the same time

text: I want to make one sentence of a paragraph bold, upper case and underlined at the same time. How do I do that?? For example: `\textbf{}` only makes it bold


title: Canonical way to typeset spacing in abbreviations

text: In a comment to When one should use spacing line \quad or \, Herbert claims that `e.\,g.` is the canonical way to typeset spacing _in_ abbreviations (this is not about spacing before or after abbreviations). I take this to be the claim that > after every `.` in an abbreviation that is not the end of it there should be > a `\,` I've never noticed this technique before (I guess that what I've only seen before is simply to typeset "e.g." as `e.g.`). Is this really the canonical way? What is the recommended way to handle spacing _in_ abbreviations in LaTeX? Here's an example to show the differences of `e.g.` and `e.\,g.`.               \documentclass{article}          \begin{document}          Some text, e.g.~some example.          Some text, e.\,g.~some example.          Some text, e.g.,~some example.          Some text, e.\,g.,~some example.          \end{document}      This gives the following output: ![Differences of e.g. and e.\\,g](http://i.stack.imgur.com/VyMpV.png)


title: Decoration at end of line after "shorten >" command

text: I have a style that puts an arrow at the end of a line for me:               \makeatletter     \tikzset{nomorepostaction/.code={\let\tikz@postactions\pgfutil@empty}}     \makeatother     \tikzset{mystyle/.style={         shorten >=0.5pt,         postaction={             nomorepostaction,             decorate,             decoration={                 markings,                 mark=at position 1 with {\arrow[semithick]{>}}             }         }     }}      I need to do it like this as it's exactly this "semithick" arrowhead that I want. But if I shorten a line, the arrowhead is drawn in the wrong place:               \draw [mystyle, shorten >=5pt] (0,0) to (2,0);      It seems to me that the problem is caused by the "at position 1" part, which refers to the end of the line without taking into effect any shortening. So, my question is: how can I define a style to reliably put a decoration at the end of a line (or some fixed offset from the end of the line), which is robust against possible shortening or lengthening of the line arising from "shorten <" and "shorten >"?


title: Including abstract reduces the number of pages

text: > **Possible Duplicate:**   >  The abstract environment changes the \linewidth for the whole document I would like to know why when I introduce an abstract to my paper of (article type), the number of pages decreases, possibly changing the characters size.


title: For loop in UML activity diagram

text: I'm looking for a package/code snippet to have this kind of diagram. Any ideas? ![enter image description here](http://i.stack.imgur.com/9yad6.png)


title: How to scale a verbatim block in a user-defined environment?

text: In order to produce an ereader-friendly PDF with small page dimensions, I'd like to scale down some oversize verbatim blocks such as program output with lines too long for the small page. Then readers should be able just to zoom in when needed. This simple test using `adjustbox` and the `BVerbatim` environment from `fancyvrb` works fine:               \documentclass[12pt,a4paper]{article}     \usepackage{adjustbox}     \usepackage{fancyvrb}     \begin{document}     \begin{adjustbox}{max width=\linewidth}     \begin{BVerbatim}     a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line     \end{BVerbatim}     \end{adjustbox}     \end{document}      However, I'm having a bit of trouble with wrapping the adjustbox+verbatim combo in a reusable environment. In particular, this attempt:               \documentclass[12pt,a4paper]{article}     \usepackage{adjustbox}     \usepackage{fancyvrb}     \newenvironment{myverb}{     \begin{adjustbox}{max width=\linewidth}     \begin{BVerbatim}     }{     \end{BVerbatim}     \end{adjustbox}     }     \begin{document}     \begin{myverb}     a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line     \end{myverb}     \end{document}      produces this error:               Runaway argument?     ! File ended while scanning use of \FancyVerbGetLine.     <inserted text>                      \par       And this attempt:               \documentclass[12pt,a4paper]{article}     \usepackage{adjustbox}     \usepackage{verbatim}     \newenvironment{myverb}{%     \adjustbox{max width=\linewidth}%     \verbatim     }{%     \endverbatim     \endadjustbox     }     \begin{document}     \begin{myverb}     a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line     \end{myverb}     \end{document}      results in this error:               ! LaTeX Error: Something's wrong--perhaps a missing \item.      Do you think what I need can be achieved using available LaTeX packages and tools?


title: How do I create an acknowledgment section?

text: I am trying to add an acknowledgment section like. I have tried the 'acknowledgments' and 'acknowledgements' environments (as seen on the internet), but LaTeX did not recognized it.


title: Selecting random elements from a comma separated list

text: I would like to have a command (either user-defined, or from a package, or whatever) that has the basic form:               \selectNrandom{N}{list, of, comma, separated, elements}{code to execute}      which will select N _distinct_ , random elements from the csv list that follows, and then executes the code on those elements. For example, this would select two elements and then typeset them with a large space between them (think math quiz):               \selectNrandom{2}{N, W, Z, Q, R, C}{%         \mathbb{firstElement} \qquad  \mathbb{secondElement}         }      I don't know what kind of MWE to post other than the above since I don't really have any idea of how to even begin writing a macro to do this. Justification for Asking (i.e., I _did_ do my homework!): I have been reading through sources such as various package documentations (etextools, probsoln, datatool, etc) as well as a few books (Joy of TeX, The Advanced TeXbook) and various websites. But I am still very new to the whole programming aspects of LaTex and Tex.


title: Sweave function in r fails with Error (option: results seems causing the issue)

text: I got the below function from Prof's website: http://diskworld.wharton.upenn.edu/~foster/teaching/471/sweave-intro.pdf The said function is meant for converting sweave (.Rnw) into PDF. But when i run it on my machine, I get this error:               Error in match.arg(options$results, c("verbatim", "tex", "hide")) :      'arg' should be one of "verbatim", "tex", "hide" Function:               Sweatex  <- function(filename,extension='Rnw',          command='pdflatex',silent=FALSE,preview=FALSE) {       if (command=='latex') command='simpdftex latex --maxpfb'       extension<-paste('.',extension,sep='')       path=options('latexcmd')[[1]]       path=substr(path,start=1,stop=nchar(path)-5)       Sweave(paste(filename,extension,sep=''))            system(paste(path,command,' ',filename,sep=''),intern=silent)            if (preview)       {         system(paste(options('pdfviewer')[[1]],' ',filename,'.pdf',sep=''))       }     }      Could anyone throw some lights? Thanks, in advance. Regards, Tharma


title: How to avoid widow lines in Table of contents (TOC)

text: I have a Table of Contents page (the last page, page 3) which just has one line on it. Is there a way of manually editing it so, say, Chapter 3 starts on page 2, as opposed to straddling pages 1 and 2? This would presumably push the rest of everything down and lead to a more "balanced" page 3. Here are some relevant [I hope!] files:               \let\oldtableofcontents = \tableofcontents     \renewcommand{\tableofcontents}{      \newpage     \pagestyle{plain}     \begin{singlespace}      \oldtableofcontents      \end{singlespace}}


title: fancyunits VS siunitx

text: I am wondering which of the two packages (`fancyunits` or `siunitx`) is the best one to use ? is one of them depreciated ? is one if them more complete or easier to use or even more pretty ? which one is the standard among authors of technical or scientific documentation ? Would it make any sense to use them simultaneously ?


title: First line in beamer block ignores abovedisplayskip?

text: If I use an an `align` environment within the a beamer block, the `\abovedisplayskip` is ignored. How can I force that setting? My MWE is               \documentclass[t]{beamer}     \usecolortheme{rose}     \usepackage{amsmath}     \begin{document}     \abovedisplayskip=0pt     \begin{frame}     \begin{block}{Some Block}     \begin{align} %does not have 0pt abovedisplayskip         e^x &= \sum_{k=1}^\infty \frac{x^k}{k!}     \end{align}     \end{block}     \begin{block}{Some other Block}     text     \begin{align} %abovedisplayskip works after text line         e &= \lim_{n\to\infty} \left(1+\frac1n\right)^n     \end{align}     \end{block}     \end{frame}     \end{document}      ![output](http://i.stack.imgur.com/tlAEj.png)


title: Fixing itemization alignment and line wrap inside tabular

text: I'm trying to construct a table using the following code:               \documentclass{article}          \usepackage[inline]{enumitem}          \begin{document}     \begin{table}[h]      \begin{tabular}{p{.3\linewidth}p{.7\linewidth}}       \multicolumn{2}{l}{\bf{Time windows and limits:}} \      \begin{itemize*}[itemjoin={\newline}]\item soft delivery time windows \emph{(sd)} \end{itemize*} & Time window may be violated, or only a preferred start time of the delivery is provided.\      \begin{itemize*}\item hard delivery time windows \emph{(hd)} \end{itemize*} & Deliveries must be made within a defined time window.\      \begin{itemize*}\item hard delivery start time \emph{(hs)} \end{itemize*} & Deliveries may not commence before a predefined time.\      \begin{itemize*}\item vehicle usage time \emph{(sv)} \end{itemize*} & Vehicles may only be used for a certain amount of time, or may not be available during certain periods, e.g.\ due to maintenance.\      \multicolumn{2}{l}{\bf{Instrumentation:}} \      \multicolumn{2}{l}{\begin{itemize*}\item For some deliveries, specialized equipment must be present. Either the delivery truck has this equipment, or an additional vehicle must be scheduled. \end{itemize*}}\      \multicolumn{2}{l}{\bf{Fleet:}} \      \begin{itemize*}\item homogeneous \emph{(ho)} \end{itemize*} & All vehicles are identical.\      \begin{itemize*}\item heterogeneous \emph{(he)} \end{itemize*} & Vehicles differ in capacity or equipment carried.\     \end{tabular}       \end{table}     \end{document}      Which results in: ![](http://i.stack.imgur.com/bQFQ6.jpg) As you should notice, there are rooms for improvement:   1. The bullets aren't good. Take for example the first bullet: The beginning of 'dows' should be aligned with the beginning 'soft', not with the bullet.   2. The line underneath 'Instrumentation:' does not respect the table border. Any additional suggestions to improve the overall look and readability of the table are also warmly welcomed. **UPDATE**   Based on the excellent answer provided by Gonzalo Medina (see below), I want to add page breaks, i.e. automatically split my table over multiple pages. To do this, I do the following:   1. Include the packages `longtable`, `ltxtable`   2. Put the table in a separate `.tex` file. Replace `\begin{tabularx}{\linewidth}{>{$\bullet$}c@{\hspace{6pt}}p{.3\linewidth}X}` by `\begin{longtable}{>{$\bullet$}c@{\hspace{6pt}}p{.3\linewidth}X}`. Obviously, change `\end{tablularx}` accordingly.   3. Load the table in the main `.tex` file using `\LTXtable{\linewidth}{table.tex}` This worked nicely for me. A more elaborate example regarding the usage of `ltxtable` may be found in this blog.


title: pdftex maxing out my CPU on Mac

text: First, some info on my system:               Mac OS X 10.9 (Mavericks)     MacTex 2013 Distribution (http://tug.org/mactex/)     Using Latexing package in Sublime Text 3 (might be relevant)     Skim pdf viewer (as per the Latexing setup tutorial)      By chance I opened my Activity Monitor today and found four _pdftex_ processes running, using between 90-100% CPU (my battery consumption was oddly high, that's why I checked). Sublime Text with opened tex files, but I wasn't using them or compiling them at the moment. I closed both the Sublime Text and Skim, but the processes didn't quit. I had to quit them manually. Anyone experienced this before? Any thoughts on what I could do to prevent this from repeating? //edit I opened Sublime Text again and tried compiling a document. pdftex process didn't appear in Activity Monitor. My theory atm is that it was a remnant of me trying other editors (TeXWorks, TeXShop)... Thoughts?


title: How to include a Chinese paper in reference via bibtex?

text: When including the following entry in my `ref.bib`               @article{chen2012,       title={基于电无级变速器的内燃机最优控制策略及整车能量管理},       author={陈骁 and 黄声华 and 万山明 and 庞珽},       journal={电工技术学报},       volume={27},       number={2},       pages={133--138},       year={2012}     }      it shows up as ![enter image description here](http://i.stack.imgur.com/llBVh.png) I'm using               \documentclass{article}     \usepackage{cite}     \usepackage{bibentry}     \nobibliography*          \begin{document}          \bibentry{chen2012}          is used for XXX study.          \bibliographystyle{IEEEtran}          \bibliography{ref}          \end{document}


title: Remove punctuation (comma) after volume number in biblatex

text: Using this code:               \RequirePackage[l2tabu, orthodox]{nag}          \documentclass[a4paper,twoside]{memoir}      % Unix options     \isopage     \usepackage{etex,setspace,excludeonly,ifthen,etoolbox,logreq,makeidx,cals,graphicx}     \usepackage[english]{babel}     \usepackage[style=british]{csquotes}     \usepackage[style=philosophy-classic,firstinits,uniquename=init,natbib=true,backend=biber,indexing=true,defernumbers=true]{biblatex}          \DeclareNameAlias{sortname}{last-first}      \DeclareBibliographyCategory{cited}     \AtEveryCitekey{\addtocategory{cited}{\thefield{entrykey}}}          \defbibcheck{Thinking}{%       \iffieldequalstr{journaltitle}{Thinking}         {}         {\skipentry}}     \defbibcheck{noThinking}{%       \iffieldequalstr{journaltitle}{Thinking}         {\skipentry}         {}}          \addbibresource{thesis.bib}           % Style alterations: parentheses around place: publisher and colon between vol     % and no     \renewbibmacro*{publisher+location+date}{%       \printtext[parens]{% ADDED         \printlist{location}%         \iflistundef{publisher}           {\setunit*{\addcomma\space}}     %      {\setunit*{\addcolon\space}}%      {\setunit*{\addcomma\space}}%         \printlist{publisher}%         \setunit*{\addcomma\space}%         \usebibmacro{date}%       }\nopunct% ADDED       \newunit}          \renewbibmacro*{volume+number+eid}{%       \printfield{volume}%       \setunit*{\adddot}% DELETED     %  \setunit*{\addcolon}% ADDED       \printfield{number}%       \setunit{\space}%       \printfield{eid}}          \DeclareFieldFormat       [article,inbook,incollection,inproceedings,patent,thesis,unpublished]       {title}{#1\isdot}          \renewcommand{\labelnamepunct}{\addspace}     \begin{document}          \printbibliography[category=cited,check=noThinking,prenote={JoPE},title={Bibliography excluding articles in \emph{Thinking: The Journal of Philosophy for Children}}]          \end{document}      and this bibliography entry in thesis.bib               @article{Allhoff2005,     author = {Allhoff, Fritz},     file = {:Users/study\_mini/Documents/Mendeley Desktop/Allhoff - 2005 - A Defense of Torture Separation of Cases, Ticking Time-bombs, and Moral Justification.pdf:pdf},     journal = {International Journal of Applied Philosophy},     keywords = {ch5},     mendeley-tags = {ch5},     number = {2},     pages = {243--264},     title = {{A Defense of Torture: Separation of Cases, Ticking Time-bombs, and Moral Justification}},     volume = {19},     year = {2005}     }     @inbook{1Almond2010,         year={2010},         Crossref = {9BaileyHandbook2010},         booktitle={The Sage Handbook of Philosophy of Education},         title={The Value of Knowledge},         author={Brenda Almond},         chapter={20},         pages={297--306}          I get in my bibliography: > volume.number, pp. ... I wish to remove the comma after number but deleting `\addcomma` does not make any difference to the final output. Do I need a `\renewcommand` instead or a tweak to my existing code?


title: Problems to start drawing an energy landscape

text: I am trying to create a diagram as depicted below. The colors, dotted lines, circles etc are not important. Ideally, the number of plots behind each other should be easily adaptable and the "shape" of the curve parametrized, eg being a formula rather than hardcoded. Specifically, my problem is in finding the right "function" that draws a curve with 1 or two holes as depicted and how to place them behind each other. **Edit: Current MWE provided below.** ![enter image description here](http://i.stack.imgur.com/Ki2fc.png) Here is my current MWE. I'm quite ashamed of where I'm stuck.               \documentclass{article}     \usepackage{pgfplots}     \usetikzlibrary{decorations.pathmorphing, patterns,decorations.pathreplacing, positioning}     \usepgfplotslibrary{fillbetween}     \pgfplotsset{compat = newest}          \begin{document}          \pgfdeclareradialshading{ballshading}{\pgfpoint{-10bp}{10bp}}      {color(0bp)=(gray!40!white);       color(9bp)=(gray!75!white);      color(18bp)=(gray!70!black);       color(25bp)=(gray!50!black);       color(50bp)=(black)}          \begin{tikzpicture}     \begin{axis}[restrict y to domain=-5:9.9,          %axis lines=none         ]         \addplot[red,domain=-5:2*pi, samples=200, name path = A]{sin(deg(x))};         \addplot[red,domain=-5:2*pi, samples=200]{sin(deg(x))+1};         \addplot[red,domain=-5:2*pi, samples=200]{sin(deg(x))+2};              \pgfmathsetmacro\valueA{sin(deg(-5))}         \pgfmathsetmacro\valueB{sin(deg(5))}                  \pgfpathcircle{\pgfpoint{2.1cm}{4cm}}{0.25cm}       \pgfshadepath{ballshading}{20}       \pgfusepath{}              \addplot[name path=B, color=black, thick] coordinates {(-5.01,\valueA) (-5,-1.5) (5, -1.5) (5, \valueB-0.05)};         \addplot[color=red!10] fill between[of=B and A], soft clip={domain=-5:5}];               \end{axis}     \end{tikzpicture}     \end{document}      produces the following result: ![enter image description here](http://i.stack.imgur.com/ZYMZi.png) Multiple problems remain.   1. How can I translate the plots on the x-axis?   2. How can I properly draw the fill between ? There's a small part betweem 5:6 which is colored in red still   3. The ball seems to vanish if it's plotted in the "fill" area   4. What variation of sin or sinc could help me produce a more "random" landscape?


title: Package keyval Error: sorting undefined

text: Even at the risk of being this question closed as too localized or a duplicate of this, I feel that it is relevant for people like me, using XeLatex and Biber for the first time... I am using Adrien Friggeri's CV template but I always get the following error, after having tried everything:                Package keyval Error: sorting undefined.      I have Texlive 2013 on Ubuntu 13.10 and Texmaker 4.0.3-2. I installed texlive- xetex 2013 from the repositories, and in the friggeri-cv.cls file I changed the Helvetica fonts and commented the line \setmathfont{XITS Math}. I changed the Quick Build in Texlive to XeLaTex + view PDF. At the beginning it produced the pdf with only warnings and the Publications section empty. So I figured I would have to install biber(0.9.9 from the repositories as well). Since I installed biber, I get the error above on Texmaker. I followed this and the error persists. I do not know where the error comes from. Apart from the usage of the (quite popular) Friggeri template, I guess that this can be a quite general problem that should be looked at. I would really appreciate some help. Many Thanks! EDIT: I am including a MWE kindly provided by @DavidCarlisle (below). The error still persists with such example.               %!TEX TS-program = xelatex     \documentclass[]{friggeri-cv}     \listfiles     \addbibresource{bibliography.bib}          \begin{document}     \header{aaa}{bb}            {cc}          \begin{refsection}       \nocite{*}       \printbibliography[sorting=chronological, type=inproceedings, title={local peer-reviewed conferences/proceedings}, keyword={france}, heading=subbibliography]     \end{refsection}     \printbibsection{misc}{other publications}     \printbibsection{report}{research reports}          \end{document}


title: Appropriate indentation for first item starting in the same line as previous text

text: I use the following code               \newlist{longmainenum}{enumerate}{1}     \setlist[longmainenum]{label={(\alph*)},font=\bfseries, align=left, leftmargin=0pt,labelsep=0pt, labelwidth=1.9em, itemindent=\parindent+\labelwidth, itemsep=\parsep, parsep=0pt, topsep=\itemsep}      with the `enumitem` package to get a list which looks like this:               Previous text.    (a) First item.       First item second line.         (b) Second item (observe the indent).       Second item second line text.      Now, the code I use produces quite a good output, and the first line indentation of the second, third, etc. item seems to be consistent with first line paragraph indent of usual text. However, the space between the 'Previous Text' and the first item label (here '(a)') is too much. How can I change the list settings such that the first indent is not too big? In particular it would be great to have a solution that works with the `enumitem` package.


title: \SetBgContents text size

text: I was trying to add custom page number style using the background package. here is my code               \makeatletter     \AddEverypageHook{%              \SetBgPosition{0.5\textwidth,.05\textheight}              \SetBgContents{\thepage}               \bg@material%               }     \makeatother      is there any way to change the size of the text written in \SetBgContents ??


title: Creating standalone eps files and using batch files to automate the process

text: I have been looking at these posts How to fix EPS with incorrect bounding box? Cannot determine size of graphic in * (no BoundingBox) How to convert PDF to EPS? How to produce EPS instead of PS using latex.exe followed by dvips? in order to understand how to create a standalone `pdf` from an `eps` figure and how to get an `eps` file also from an `eps` in which the `psfrag` labels have not yet been replaced. The above posts have been most useful. My `eps` figures are usually done with Adobe Illustrator (AI) and then I use `psfrag` to replace whatever original labels in the AI figure to whatever I need with laTeX fonts. It works perfectly. The issue with having such a workflow is that the original `eps` file from AI doesn't have the correct labels yet. This means that I cannot send someone this `eps` file from AI. Based on the above-mentioned posts, I have created a workflow that appears good to me in order to generate an independent `eps` file with all `psfrag` labels correctly inserted. My objective is to still have all fonts embedded in the final `eps` file. Here is my workflow with reference to the file `jeffcott.eps` that I have stored here: http://petitlien.fr/epspicture (A). Check the bounding box of jeffcott.eps               gswin32c -dNOPAUSE -dBATCH -q -sDEVICE=bbox jeffcott.eps     %%BoundingBox: 0 0 373 190     %%HiResBoundingBox: 0.000000 0.000211 372.617989 189.934025      (B). Convert to standalone pdf               \documentclass[convert]{standalone}     \usepackage[hiresbb,dvips]{graphicx}     \usepackage[dvips]{color}     \usepackage{psfrag}     \begin{document}     \psfrag{A}{$m$}     \psfrag{B}{$k,c$}     \psfrag{Y}{inner stator bore}     \includegraphics{E:/jeffcott.eps}     \end{document}      (C). Create an `eps` file from the above resulting `pdf` file               pdfcrop --hires "standpdf.pdf" "standpdf-temp.pdf"      Next issue the `pdftops` command:               pdftops -level3 -eps standpdf-temp.pdf standpdf.eps      Now, `standpdf.eps` is created but Ghostscript warns that it cannot find its bbox. The problem is that the lines `%%BoundingBox` and `%%HiResBoundingBox` appear quite far away from the top header lines. I have two solutions: I: Move these two lines corresponding to the bbox just after the first header line II: Use `ps2eps`               ps2eps -f --fixps standpdf.eps      The file `standpdf.eps.eps` is created by `ps2eps` and Ghostscript can load the file without any complaint. Checking the bbox gives:                gswin32c -dNOPAUSE -dBATCH -q -sDEVICE=bbox standpdf.eps.eps      %%BoundingBox: 0 0 373 190      %%HiResBoundingBox: 0.000000 0.000352 372.617989 189.935994      However when I open the file `standpdf.eps.eps` in a text editor, I can see the bbox as                %%BoundingBox: 0 1 372 190      %%HiResBoundingBox: 0.000000 1.000000 372.000000 190.000000      My questions:   1. As you can see from `part (c)` above, Ghostscript doesn't always read the correct bbox of the `eps` file. Why is this so?   2. Is it right to use the command `ps2eps` on an `eps` file. I have tried to use `epstool` but it seems that this tool can only copy a bbox from one file to another, and not fix it.   3. I would like to create a batch file on a `Windows` machine to automate the task in parts (B) and (C) and deleting the temporary file `standpdf-temp.pdf` along the way. I have looked at the batch files listed in some of the posts mentioned at the beginning of this post, but they do not work.   4. As a step further to `Question 3`, I would like to create a batch file that will process all the `pdf` files in a folder and create the corresponding `eps` files. How to do this?   5. And a related question: Where to learn about creating batch files for `Windows`? I haven't found any comprehensive source of information yet. * * * Update: The batch files provided by xport work fine. There is one small bug however. Looking at `BatchF.bat`, after processing with `ps2eps`, the lines that come afterwards do not get processed at all. `Ps2eps` throws control back to the command prompt but the batch file stops there. How to fix that? Since this post is getting long, I have created a new post: Batch files and making the workflow with pdfLaTeX and TeXLive 2010 easier with psfrag Thank you.


title: Typesetting annuity and life-insurance symbols in ConTeXt

text: How do I typeset annuity and life-insurance symbols, actuarial notation in ConTeXt. I see there are packages available but not for ConTeXt. ![enter image description here](http://i.stack.imgur.com/2bf1I.png) Thanks


title: biblatex: uppercase in \parencite, but not in \textcite

text: How can I make `\parencite` produce an uppercase output, but normal case for `\textcite`? Result:               \parencite{CARNAP1934} -> (CARNAP, 1934)          \textcite{CARNAP1934} -> Carnap (1934)      MWE:               \documentclass[12pt,a4paper]{memoir}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}               \usepackage[citestyle=authoryear,bibstyle=authortitle,labelnumber,natbib=true,firstinits=true,isbn=false,babel=other,language=brazilian,backend=biber]{biblatex}               \addbibresource{test.bib}     \begin{document}               \section{Intro}          \textcite{CARNAP1937}          \section{Conclusion}          \parencite{CARNAP1935}          \parencite{SCHICKORE2006}          \printbibliography          \end{document}      The .bib:               @book{CARNAP1935,     Address = {London},     Author = {Carnap, Rudolf},     Publisher = {Kegan Paul, Trench, Trubner \& Co.},     Title = {Philosophy and Logical Syntax},     Year = {1935}}          @book{CARNAP1937,     Address = {London},     Author = {Carnap, Rudolf},     Note = {Transl. Amethe Smeaton (Countess von Zeppelin)},     Publisher = {Kegan Paul},     Title = {The Logical Syntax of Language},     Year = 1937}          @book{SCHICKORE2006,     Address = {Dordrecht},     Author = {Schickore, J. and Steinle, F.},     Publisher = {Kluwer Academic Pub},     Title = {Revisiting discovery and justification: historical and philosophical perspectives on the context distinction},     Volume = {14},     Year = {2006}}


title: synctex.gz file is (busy)

text: I'm trying to compile my LaTeX file (an article), but I keep getting a Windows API error: my synctex file is busy - the filename has been changed and appended with (busy). I'm using TexMaker to compile the file, but it occurs in TeXStudio as well. When I create a new file I can compile it once before this issue occurs. The API error is > pdflatex: Windows API error 4350: This file is currently not available for > use on this computer. pdflatex: Data: Report4.synctex.gz


title: How to mix accents from different fonts?

text: In TeXBook, exercise 9.6 Knuth asks to type Pal Erdos with needed accents in `\tt` font. So I've tried the naive `{\tt P\'al Erd\H os}` and succeed. But Knuth proposes to use the next mixup of fonts: `{\tt P\'al Erd{\bf\H{\tt o}}s}` It seems like an interesting technique, as it allows to catch accents from other fonts. But it strange that the code was not succeed, as I received accent `\H` and `o` separate from eacha other. It seems like they were not bound. How to apply Knuth's technique?


title: How can I create lambda expressions?

text: It's common for packages to accept one- or two-argument macros as transformations of some element, and it's at least common for me for these to be one-offs that don't deserve a permanent name—or at least one in the user's namespace. How can I effect this?               \documentclass{article}     \usepackage{xcolor,empheq}          \begin{document}     \begin{empheq}[box=\colorbox{blue!20}{\hspace{1em}#1\hspace{1em}}]{align*}       a & = b \\       a^2 &= b^2     \end{empheq}     \end{document}      Consider the following attempt, heavily influenced by Define a New Macro via a Macro Using xparse Syntax:               \documentclass{article}     \usepackage{xparse}     \ExplSyntaxOn          \cs_new:Npn \lambda_generate_new_csname: {       \tl_set:Nn \l_tmpa_tl { random } % I'll figure this out later       \prg_while:nn { ! \undefined_p \l_tmpa_tl } {         \tl_set:Nn \l_tmpa_tl { another random }       }       \tl_use:N \l_tmpa_tl     }     \cs_new:Npn \lambda_generate_new_cs: {       \use:c { \lambda_generate_new_csname: }     }          % number of arguments and then transformation     \NewDocumentCommand \LambdaFunction { m m } {       \lambda_insert_lambda:nn { #1 } { #2 }     }          \cs_new_protected:Npn \lambda_insert_lambda:nn #1 #2 {       \use:x {         % expansion unsure         \exp_not:n { \NewDocumentCommand } \lambda_generate_new_cs: {           \prg_replicate:nn { #1 } { m }         }       } {         #2       }     }          \ExplSyntaxOff          \begin{document}          \LambdaFunction{1}{hello, #1!}       {world}          % > hello, world!          \end{document}      * * * ### EDIT Acting on the comments, it would be _very_ interesting to create an _expandable_ `LambdaFunction`—one that would be more befitting of a functional programming style. I'd consider TeX as, after all, a functional language to a large extent—but does this extend to its very core? I think the answer to this question would say a lot about TeX's programming paradigm.


title: tikz plots alignment

text: I'm trying to produce a figure using               \begin{figure}     \centering     \makebox[\columnwidth]{\input{try1.tikz}}     \makebox[\columnwidth]{\input{try2.tikz}}     \end{figure}      The files `try1.tikz` and `try2.tikz` are given below. The only difference between them is that in the former xmin=-2, in the latter xmin=-4. I get ![enter image description here](http://i.stack.imgur.com/paK7J.png) How do I align the panels vertically? `try1.tikz` is:               \begin{tikzpicture}[font=\footnotesize\sffamily]          \begin{axis}[%     view={0}{90},     width=4cm,     height=4cm,     scale only axis,     xmin=-2, xmax=1,     ymin=0, ymax=1.7,     name=plot2,     unbounded coords=jump]     \end{axis}          \begin{axis}[     view={0}{90},     width=4cm,     height=4cm,     scale only axis,     xmin=-2, xmax=1,     ymin=0, ymax=1.7,     at=(plot2.left of south west), anchor=right of south east,     unbounded coords=jump]     \end{axis}          \begin{axis}[     view={0}{90},     width=4cm,     height=4cm,     scale only axis,     xmin=-2, xmax=1,     ymin=0, ymax=1.7,     at=(plot2.right of south east), anchor=left of south west,     legend style={nodes=right,font=\tiny},     legend pos= north west,     unbounded coords=jump]          \end{axis}     \end{tikzpicture}      and `try2.tikz` is:               \begin{tikzpicture}[font=\footnotesize\sffamily]          \begin{axis}[     view={0}{90},     width=4cm,     height=4cm,     scale only axis,     xmin=-4, xmax=1,     ymin=0, ymax=1.7,     name=plot2,     unbounded coords=jump]     \end{axis}          \begin{axis}[     view={0}{90},     width=4cm,     height=4cm,     scale only axis,     xmin=-4, xmax=1,     ymin=0, ymax=1.7,     at=(plot2.left of south west), anchor=right of south east,     unbounded coords=jump]     \end{axis}          \begin{axis}[     view={0}{90},     width=4cm,     height=4cm,     scale only axis,     xmin=-4, xmax=1,     ymin=0, ymax=1.7,     at=(plot2.right of south east), anchor=left of south west,     legend style={nodes=right,font=\tiny},     legend pos= north west,     unbounded coords=jump]     \end{axis}     \end{tikzpicture}


title: How put "NdT" symbol as a reference of footnote without change others footnotes?

text: I do not manage to know how to pose symbol of footnote. I wish to add a footnote whose connection box is NdT (note of the translator) while the other footnotes continue their usual classification. Thus for example, in a document creates with the class book, I wish to have in footnote the example below: 1 First note bla bla. NdT. Footnote non numbering. Note of the translator being added in note of footer but   without affecting the total classification of the other footnotes. 2 Second note on the same for exemple bla bla 3 Third note or not note... blab. etc. Who would have an idea to be able to do that? I did not find anything in documentation footnote, and the insertion of symbol is not appropriate because I wish to have the symbol “NdT”… Thank for your attention D. Collin


title: Improve command definition to avoid possible break

text: The following defines my MWE:               \documentclass{article}     \usepackage{amsmath}     \usepackage{totcount}     \newcounter{totalpoints}     \regtotcounter{totalpoints}          \newcommand{\shcpoint}[1]{%       \addtocounter{totalpoints}{#1}%       \ifnum#1<2         (\emph{#1 point})\hphantom{\em s}%       \else         (\emph{#1 points})%       \fi\quad     }          \newcommand{\totalpoints}{%         \parbox{\linewidth}{%         \leavevmode\raisebox{-0.5ex}{\llap{\textbullet}}\!\hrulefill\\[-0.825ex]%         \null\hfill\bfseries Total Points: \total{totalpoints}~~\rlap{\rule{0.4pt}{3ex}}%         }     }     \begin{document}     This questionary has a total of \total{totalpoints}~points.     \begin{enumerate}      \item \shcpoint{1} Easy question      \item \shcpoint{2} Some random question      \item \shcpoint{3} Other question     \end{enumerate}     %------------------------------------------------------------------------------------     \totalpoints     %------------------------------------------------------------------------------------     \end{document}      ![enter image description here](http://i.stack.imgur.com/pjK2r.png) What I am concerned about is if the command               \newcommand{\totalpoints}{%         \parbox{\linewidth}{%         \leavevmode\raisebox{-0.5ex}{\llap{\textbullet}}\!\hrulefill\\[-0.825ex]%         \null\hfill\bfseries Total Points: \total{totalpoints}~~\rlap{\rule{0.4pt}{3ex}}%         }     }      will break maybe at the ends of pages and give half of the output in one and half in the other? That is, if defined as is, is `break` free so that the whole total points design stays intact even when at the end of a page? Note as it is, the command already yields the desired result. If there are better ways of achieving the same output but in more robust manner, I would appreciate insights. I know for a fact that I can replicate the output in TikZ.


title: Weird thing in references/bibliography page

text: I'm writing my thesis but I have a huge problem. I'm using BibTeX to make the bibliography, but when I run my project,in the references page of my pdf created file I have beside the number of the record (I'm using plain style) a label with the record's key name **_I don't know why there is this label, and I want to hide it. How can I do?_** In my main `.tex` file I use:                \usepackage{cite}              %---------------------BEGIN BIBLIOGRAFIA----------------------------              \newpage              \nocite{*}              \bibliographystyle{plain}              \bibliography{bibliography}              %---------------------END BIBLIOGRAFIA------------------------------      And in `bibliography.bib` I have (at the moment) only one record:               @article{jor:1,          author = {Andreas Jordan and Regina Scholz and Peter Wust and Horst Fakhling and Roland      Felix},          title = {Magnetic fluid hyperthermia ({M}{F}{H}): Cancer treatment with     AC magnetic field induced excitation of biocompatible     superparamagnetic nanoparticles},          journal = {Journal of Magnetism and Magnetic Materials},          year = 1999,          volume = {201},          pages = {413-419}          }


title: Ibid doesn't show up

text: I modified an essay layout for my purposes and everything is hunkydory except for the fact that my chicago style citations will spam the footnotes when citing consecutively from the same work. I assumed it would do Ibid but it doesn't.               \documentclass[12pt]{article}     \usepackage{times}     \usepackage{geometry}     \geometry{a4paper}     \title{\textsc{foobar}}     \author{\textsc{Mr.Foobar}}     \usepackage{fancyhdr}     \setlength{\headheight}{15pt}     \rhead{\textsc{Mr.Foobar}}     \lhead{\textsc{foo}}     \linespread{1.6} % Line spacing     \usepackage[longnamesfirst,nonamebreak]{natbib}     \begin{document}          Body goes here\footnote{\cite{BibtexKey1} p.##}          even more body text \footnote{\cite{BibtexKey1} p.##+x}               \newpage     \bibliographystyle{chicago}     \bibliography{cites}     \end{document}      Illustrated: ![image](http://i.imgur.com/edDmD8C.png) UPDATE: I have installed biber and biblatex with biblatex-chicago. Can someone show me a MWE for superscript citations featuring ibid? I got as far as eliminated the repetitions but after the first one I just get the number and a period.


title: Error: Font ts1-zi4r at 540 not found

text: I use MikTeX in order to compile pdf files when creating R packages. Today I found out that I run into the following error:               * checking PDF version of manual ... WARNING     LaTeX errors when creating PDF version.     This typically indicates Rd problems.     LaTeX errors found:     !pdfTeX error: pdflatex.EXE (file ts1-zi4r): Font ts1-zi4r at 540 not found      ==> Fatal error occurred, no output PDF file produced!     * checking PDF version of manual without hyperrefs or index ... ERROR      Any suggestion on how I might be able to fix this problem? (this is after I've updated Rd.sty in R, following the suggestion here) Thanks!


title: To align line of 3 units equispaced

text: My tex               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align}     x(\alpha) = \lim_{x \to a^{+}} x(t) & \text{ and } & x(\beta) = \lim_{x \to \beta^{-}} x(t) &.                             \end{align}     \end{document}      I get ![enter image description here](http://i.stack.imgur.com/ggFFV.png) I want to get the similar equispacing as here ![enter image description here](http://i.stack.imgur.com/Iobhd.png) **How can you do the equispaced line?**


title: MiKTeX portable fontconfig file location configuration

text: I moved MiKTeX portable to another directory, and after that there are issues with loading fontconfig. Specifically, when compiling with `xelatex`, fontconfig cannot be loaded. Its location is apparently pointing to the original location `OLDLOCATION`. Where does MiKTeX keep such information?               (CURRENTLOCATION\tex\latex\fontspec\fontspec-xetex.sty     (CURRENTLOCATION\tex\latex\base\fontenc.sty (CURRENTLOCATION\tex\latex\euenc\eu1enc.def)     (CURRENTLOCATION\tex\latex\euenc\eu1lmr.fd)Fontconfig error: Cannot load config file "     OLDLOCATION/fontconfig/config/localfonts.conf"     Fontconfig error: Cannot load default config file     )


title: Add gradient to colorbox

text: Newby here. I found a great template for technical reports here . . http://www.latextemplates.com/template/stylish-article ![enter image description here](http://i.stack.imgur.com/a4GjL.png) I would like to change the background color of the abstract and section headings to a vertical gradient. The relevant section of code in the template appears to be here . .               \renewcommand{\@maketitle}{%     \twocolumn[{%     \thispagestyle{empty}%              \vskip-36pt%     {\raggedleft\small\sffamily\bfseries\@JournalInfo\\\@Archive\par}%     \vskip20pt%     {\raggedright\color{color1}\sffamily\bfseries\fontsize{20}{25}\selectfont \@PaperTitle\par}%     \vskip10pt%     {\raggedright\color{color1}\sffamily\fontsize{12}{16}\selectfont  \@Authors\par}%          \vskip18pt%     \fcolorbox{color1}{white}{%     \parbox{\textwidth-2\fboxsep-2\fboxrule}{\centering%          % HERE IS THE SECTION I WANT TO CHANGE     \colorbox{Color2!10}{%          \parbox{\textwidth-4\fboxsep-2\fboxrule}{%     \ifx\@Keywords\@empty%     \sffamily\textbf{\abstractname}\\\@Abstract%     \else%     \sffamily\textbf{\abstractname}\\\@Abstract\\[4pt]%     \textbf{\keywordname}\\\@Keywords%     \fi%     }%     }%      Can anyone guide me in the right direction?


title: References from auto generated images are wrong

text: In the following I generate labels for some figures that are auto-generated               \usepackage{varioref}     \newcounter{figurecounter}\setcounter{figurecounter}{1}     \let\endF\endfigure     \renewcommand\endfigure{%       \expandafter\label\expandafter{fig:item\thefigurecounter}\endF\stepcounter{figurecounter}}      For loop that creates images from folder               \newread\reader     \newcount\TotalFiles                 \makeatletter     \newcommand\IterateImages[2]{%     % #1: directory path with a trailing /     % #2: a list of file extensions: eps pdf jpg png     \immediate\write18{batch "#1" \jobname\space #2}     \openin\reader=\jobname.list\relax     \loop         \read\reader to \filename         \unless\ifeof\reader         \filename@parse{\filename}         %\section*{\filename}         \begin{figure}[!htb]         \begin{center}                 \includegraphics[scale=0.5]{"#1\filename@base"}         \caption{{\bf This is a figure}         \end{center}         \end{figure}         \endgraf         \advance\TotalFiles1\relax         \clearpage     \repeat     \closein\reader     }      Call the for loop in the appendix:               \appendix          \gdef\thesection{Appendix \Alph{section} -}     \section{List of figures}     \label{sec:app1}          \IterateImages{C:/Users/xxx/xx}{eps}      Now the problem is: when calling `\vref{fig:item1}` it shows:               Figure Appendix A - on page 5      instead of:               Figure 1 on page 5      Anyone got an idea how to solve this??????? using miktex, texlipse, win8, pdflatex When calling \IterateImages{C:/Users/xxx/xx}{eps} outside the appendix, figures are numbered correctly


title: How can I reduce top margin of wrapfigure

text: I'm writing a document with a `wrapfigure` and its part looks like this:               ~~~~~~~~~~~~~~~~~~~~~~     ~~~~~~          ~~~~~~~~   ________     ~~~~~~~~~~  |        |     ~~~~~~~~~~  | Figure |     ~~~~~~~~~~  |________|      ~~~~~~~~~~     ~~~~~~~~~~~~~~~~~~~~~~      How can I reduce the margin at the top of the figure by `\baselineskip` so that it looks like this:               ~~~~~~~~~~~~~~~~~~~~~~     ~~~~~~       ________       ~~~~~~~~  |        |      ~~~~~~~~~~  | Figure |     ~~~~~~~~~~  |________|     ~~~~~~~~~~     ~~~~~~~~~~~~~~~~~~~~~~      Here is a MWE with a simplified figure:               \documentclass{article}     \usepackage{wrapfig}     \usepackage{lipsum}     \usepackage{tikz}     \begin{document}     \lipsum[1]          \begin{wrapfigure}{r}{0pt}       \begin{tikzpicture}[inner sep=0pt, outer sep=0pt]         \node (A) {A};         \node[above right] (B) at (A.north east) {B};         \draw (A.south west)--(B.north east);       \end{tikzpicture}     \end{wrapfigure}     \lipsum[2]     \end{document}


title: How to add another optional option to the "printglossary" command?

text: I'm using the glossaries package to introduce my terms in my book. Now I want to add another option to the `printglossary` command named "column" as below:               \printglossary[column=X]% which X is 1 or 2      **Description:**   I want the `column=1` to be active by default, but when the user enters `column=2`, I want the output to be typeset as if the user uses the code below in the body:               \twocolumn     \printglossary     \onecolumn      Here is my code:               \documentclass{book}     \usepackage[xindy]{glossaries}     \makeglossaries     \newglossaryentry{maths}{         name=mathematics,         description={Mathematics is what mathematicians do in foo bar}}          \begin{document}     I'm talking about \gls{maths}.      \printglossary[title=Special Terms]     \end{document}      Could you please help me add this option?


title: Adding header to all pages, removing TOC and double entries in header and costum pagenumbering

text: I'm setting up my thesis in `memoir` class. Questions [Those that have been answer are marked with (!) and the code has been amended to reflect the answers]:   1. How do I make my headers and footers show up on the first page of the chapters? (!)   2. How do I avoid the TOC title in my header? (!)   3. How do I avoid double title in the header on the reference page?   4. How do I add the abstract as a 'section' or 'chapter' in my header? (!)   5. How do I remove total number of pages in frontmatter material (TOC and abstract) only? I have been reading in the `memoir` manual a good while, but I can't really get my head around it and it doesn't seem to contain the explanation as far as I can see. I'm trying to avoid any usage of `fancyhdr`, because of incompatibility issues. This is the simplest version I could make, considering what might be pertinent and to give a picture of what I'm trying to do:               \documentclass[12pt,a4paper,onecolumn,twoside,final]{memoir}     \usepackage[english]{babel}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage{newcent}     \usepackage[utf8x]{inputenc}     \usepackage[textwidth=14cm,textheight=22cm]{geometry}     \usepackage{apacite}          % Header & footer content          \makepagestyle{HDR} % Create a new pagestyle     \aliaspagestyle{chapter}{HDR}          \makepsmarks{HDR}{\nouppercaseheads % Following code to edit the pagestyle          \createmark{chapter}{left}{shownumber}{}{\space}     \createmark{section}{right}{nonumber}{}{\space}          \clearplainmark{toc}     \createplainmark{lof}{both}{\listfigurename}     \createplainmark{lot}{both}{\listtablename}     \createplainmark{bib}{both}{\bibname}     \createplainmark{index}{both}{\indexname}     \createplainmark{glossary}{both}{\glossaryname}     }      \makeevenhead{HDR}{}{}{\normalfont\bfseries\rightmark\hskip.5cm\vrule\hskip.5cm\leftmark}     \makeoddhead{HDR}{\normalfont\bfseries\leftmark\hskip.5cm\vrule\hskip.5cm\rightmark}{}{}     \makeevenfoot{HDR}{\small \thepage\ / \thelastpage}{}{\miniscule Thesis, ID, Institute, Universit}     \makeoddfoot{HDR}{\miniscule Thesis, ID, Institute, University}{}{\small \thepage\ / \thelastpage}          % Title and Subtitle     \newcommand{\TIT}{A thesis}     \makeatletter     \addtodef\put@bsintoc{}{\markboth{\abstractname}{}}     \makeatother          %Frontpage Design     \newcommand{\FTP}{\begingroup     \vspace*{1cm}     \begin{center}     \Large \textsc{Jane Smith} \\     \huge\bfseries \TIT \\     \end{center}     \newpage          % Information Page          \noindent\today \\     Student ID: 00000000 \\     Supervisor: John Smith \\     Number of Characters: 000000 \\     \endgroup}          % Chapters & sections titles     \chapterstyle{hangnum}          \begin{document}     \frontmatter     \begin{titlingpage}     \FTP     \end{titlingpage}     \pagestyle{HDR}     \tableofcontents*     \begin{abstract}          \end{abstract}     \mainmatter     \chapter{One}     \section{OneOne}     \chapter{Two}     \section{TwoTwo}     \chapter{Three}     \chapter{Four}          \backmatter     \appendix     \bibliographystyle{apacite}     \bibliography{Test.bib}          \end{document}


title: How to right-align whole longtables

text: Say I have the following document:               \documentclass{article}     \usepackage{longtable}          \begin{document}          \begin{longtable}{|lr|}       \hline       A & 1\\       B & 2\\       C & 3\\       \hline     \end{longtable}          \end{document}      I want this whole table to be aligned with the right page margin. I know that if it were a simple table I could use `\raggedleft` to achieve this, but it does not work with `longtable` objects (for which I have true need in my real case). How can I align a longtable to the right page margin?


title: thmtools - custom head format inserts space

text: I am using `thmtools` to create exercise environments. The format I am looking for is:   * The exercise number, in bold   * a period and space   * If the exercise note is set (with the `name`) key, the note in bold and another space   * the exercise body The trouble I'm having is that I'm getting some extra horizontal spacing when the note is set. Also, if there is an empty block of options, more extra space is inserted. Here is the MWE:               \documentclass{article}     \usepackage{amsthm}     \usepackage{thmtools}          \declaretheoremstyle[         headfont=\bfseries,         notefont=\bfseries,         headformat={\NUMBER.\if\NOTE\ \else \NOTE\fi},         headpunct={},         notebraces={}{},         numbered=yes     ]{exercise}     \declaretheorem[style=exercise]{exercise}          \begin{document}          \begin{exercise}foo\end{exercise}     \begin{exercise}[         ] bar      \end{exercise}     \begin{exercise}[name=Baz]baz\end{exercise}          \end{document}      ![MWE output](http://i.stack.imgur.com/AJ1ha.png) Without the `headformat` key set I don't get any of these extra spaces, but them of course it's not the format I want. So how do I set `headformat` to get what I want without the extra space?