title: How to format subsection title (without packages)?

text: I'd like to change the format for `\subsection{}` **without using special packages**. On `report.cls` we find its definition               \newcommand\subsection{\@startsection{subsection}{2}{\z@}%                                          {-3.25ex\@plus -1ex \@minus -.2ex}%                                          {1.5ex \@plus .2ex}%                                          {\normalfont\large\bfseries}}      But I'd like to use different fonts for the counter and for the title. For example, for the `\section{}` command I'm using               {\fontsectionnumber{\color{black!50}\thesection.}\hspace{.5em}{\fontsection\MakeUppercase{#1}}}       How to do the same for `\subsection`? * * * **Edit:** here is the adapted code for `\section{}`.               \newcommand\section{\global\@topnum\z@                           \@afterindenttrue                           \secdef\@section\@ssection}     \def\@section[#1]#2{\ifnum \c@secnumdepth >\z@                            \if@mainmatter                              \refstepcounter{section}%                              \typeout{\thesection}%                              \addcontentsline{toc}{section}%                              {\protect{\color{black!30} %                              {\fontsectionnumbertoc\numberline{\thesection.}}} {\normalfont #1} \hspace{1em} %                              {\fontheadernumber\thepage}\hfil}%                            \else                              \addcontentsline{toc}{section}{#1}%                            \fi                         \else                           \addcontentsline{toc}{section}{#1}%                         \fi                         \sectionmark{#1}%                         \addtocontents{lof}{\protect\addvspace{10\p@}}%                         \addtocontents{lot}{\protect\addvspace{10\p@}}%     %                    \if@twocolumn     %                      \@topnewpage[\@makechapterhead{#2}]%     %                    \else                           \@makesectionhead{#2}%                           \@afterheading                         }     \def\@makesectionhead#1{%       \vskip 5mm       {\parindent \z@ \raggedright          \ifnum \c@secnumdepth >\m@ne           %\if@mainmatter             {\fontsectionnumber{\color{black!50}\thesection.}\hspace{.5em}{\fontsection\MakeUppercase{#1}}}              %\newline\nobreak     %        \vskip 0\p@           %\fi         \fi         \interlinepenalty\@M     %    \large\MakeUppercase{#1} \par\nobreak         \vskip 2mm %2.3ex \@plus.2ex       }}


title: How can I make a numbering as for theorems and lemmas for postulate?

text: We write               \begin{theorem}     the theorem     \end{theorem}      for theorems, lemmas, corollaries and so on. For reasons of content I want to do the same for postulates. How?


title: How to fix the math-spacing when a lot of \phantom, \mathrlap, etc. are used?

text: > **This question led to a new package:**   >  `underoverlap` ## Introduction Based on this question and then this question, I'm trying to perfect the `\overunderbrace` macro. Right now, I'm trying to get the spacing right. ## Minimal Working Example               \documentclass[varwidth=20cm,margin=3mm]{standalone}          \usepackage{mathtools}     \usepackage{xcolor}          \makeatletter     \def\overunderbrace#1#2#3{%         \begingroup%         \let\overunderbrace@sup\empty%         \let\overunderbrace@sub\empty%         \ignorespaces%         \@ifnextchar^{%             \@overunderbracesup{#1}{#2}{#3}%         }{%             \ignorespaces%             \@ifnextchar_%                 {\@overunderbracesub{#1}{#2}{#3}}%                 {\@overunderbrace   {#1}{#2}{#3}}%         }%     }          \def\@overunderbracesup#1#2#3^#4{%         \def\overunderbrace@sup{#4}%         \ignorespaces%         \@ifnextchar_%             {\@overunderbracesub{#1}{#2}{#3}}%             {\@overunderbrace   {#1}{#2}{#3}}%     }          \def\@overunderbracesub#1#2#3_#4{%         \def\overunderbrace@sub{#4}%         \ignorespaces%         \@ifnextchar^%             {\@overunderbracesup{#1}{#2}{#3}}%             {\@overunderbrace   {#1}{#2}{#3}}%     }          \def\@overunderbrace#1#2#3{%         \mathrlap{\overbrace{\textcolor{red}{#1#2}}^{\mathclap{\overunderbrace@sup}}}%         #1%         \mathrlap{\underbrace{\textcolor{green}{#2#3}}_{\mathclap{\overunderbrace@sub}}}%         #2%         #3%         \endgroup%     }     \makeatother          \newcommand{\config}[2]{\left\langle\,#1, #2\,\right\rangle}          \begin{document}         $$             \config{F\vphantom{F'}}{p}             \longrightarrow             \config{F'}{p}             \longrightarrow             \config{F'}{p'}             \longrightarrow             \cdots         $$         $$             \overbrace                 {\config{F\vphantom{F'}}{p}\longrightarrow\config{F'}{p}}^{test}             \longrightarrow             \config{F'}{p'}             \longrightarrow             \cdots         $$         $$             \overunderbrace                 {\config{F\vphantom{F'}}{p}\longrightarrow}                 {\config{F'}{p}}                 {\longrightarrow\config{F'}{p'}}                 ^{\text{environmental}}                 _{\text{local}}             \longrightarrow             \cdots         $$     \end{document}      ![enter image description here](http://i.stack.imgur.com/qj6ad.png) As you can see, the braces are horizontally misaligned to the content. ### Note The `\@overunderbrace` code here may seem (unnecessarily) more complicated than the code from the answer I based it on, but that's because I'm trying to set up a repeating pattern, so we can get more than just two overlapping braces. The way to do that seems to be to:   * set [brace 1] with [phantom+rlap arguments 1+2]   * set [argument 1]   * set [brace 2 with [phantom+rlap arguments 2+3]   * set [argument 2]   * etc... ## Diagnosis To diagnose the problem, I replaced `\phantom` with `\textcolor` in the following code:               \def\@overunderbrace#1#2#3{%         \mathrlap{\overbrace{\textcolor{red}{#1#2}}^{\mathclap{\overunderbrace@sup}}}%         #1%         \mathrlap{\underbrace{\textcolor{green}{#2#3}}_{\mathclap{\overunderbrace@sub}}}%         #2%         #3%         \endgroup%     }      ![enter image description here](http://i.stack.imgur.com/AScLZ.png) The black output is identical to the previous image. The red (green) content is the placement that the over(under)brace is based on. It occurred to me that TeX determines spacing between math 'atoms' based on their respective types (ord, bin, rel, etc.). And I'm messing with this process by reordering the segments, `\phantom`ing and `\mathrlap`ing them. ## Attempted Solution So I augmented the formal parameters, making sure they always encounter the same 'environment' (to the best of my ability):               \def\@overunderbrace#1#2#3{%         \@@overunderbrace%             {\mathord{}#1\vphantom{#2}}%             {\vphantom{\mathord{}#1}#2\vphantom{#3\mathord{}}}%             {\vphantom{#2}#3\mathord{}}%     }          \def\@@overunderbrace#1#2#3{%         ... the old \@overunderbrace ...     }      ![enter image description here](http://i.stack.imgur.com/BBBpk.png) For comparison, I added the same formula without any braces, and then with only the overbrace (from the TeX command). As you see, no color is visible anymore (except for the rulers I added manually), so the printed content is aligned with its phantom images. This solution is usable, but as you can see by the comparison, the spacing is still not right. Possibly because it's now using some 'inter-atom' glue twice in a row. This is the point where I give up and ask for help. **Question:** How can I get perfect spacing in a setup like this?


title: How to insert tikzpicture in beamer?

text: I want to run this slide in `beamer`. I tried lot of things but always getting the errors for package clashes.               \documentclass{beamer}          \usetheme{AnnArbor}     \usecolortheme{beaver}          \setbeamercolor*{palette tertiary}{use=structure,fg=black,bg=blue}          \mode<presentation>     \usepackage{setspace}     \usepackage{nicefrac}     \usepackage{xcolor}     \usepackage{float}     \usepackage{breqn}     \usepackage{tikz}     \usepackage{indentfirst}     \usepackage{bibentry}      \usepackage{color}     \usetikzlibrary{matrix}     \usepackage{apacite}     \usepackage{color}     \usepackage{graphicx}     \usepackage{comment}     \usepackage{hyperref}     \usepackage {xcolor}     \usepackage{graphicx,epsfig,setspace,subfig,url,amsmath}     \usepackage{indentfirst}     \usepackage{listings}     \usepackage{array}     \usepackage{multirow}     \usepackage{multicol}     \usepackage{enumerate}     \usepackage[english]{babel}     \usepackage{booktabs}     \usepackage{etex}     \usepackage[all]{xypic}     \usepackage{color}     \usepackage[english]{babel}     \usepackage{enumerate}     \usepackage[utf8]{inputenc}     \usepackage{times}     \usepackage[T1]{fontenc}     \usepackage{bm}     \renewcommand{\familydefault}{\sfdefault}          % New packages               %\setbeamertemplate{itemize item}{\scriptsize\raise1.25pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}     \setbeamertemplate{itemize subitem}{\tiny\raise1.5pt\hbox{\donotcoloroutermaths$\blacktriangleright$}}     % Or whatever. Note that the encoding and the font should match. If T1     % does not look nice, try deleting the line with the fontenc.          \begin{frame}         \begin{figure}[H]         \tikzset{           basic/.style  = {draw, text width=2cm, drop shadow,  rectangle},           root/.style   = {basic, thin, align=center,                        fill=gray!45 , text width=7em},           level 2/.style = {basic, thin,align=center, fill=gray!30,                        text width=7em},           level 3/.style = {basic, thin, align=left, fill=gray!20, text width=7em, node distance = 40pt}         }         \begin{tikzpicture}[           level 1/.style={sibling distance=40mm},           edge from parent/.style={->,draw},           >=latex]              % root of the the initial tree, level 1         \node[root] {BRD1 ($\alpha_{..},\beta_{..}$)}         % The first level, as children of the initial tree           child {node[level 2] (c1) {$(\alpha_{..},\beta_{i.})$}}           child {node[level 2] (c2) {$ (\alpha_{.j},\beta_{..})$}}           child {node[level 2] (c3) { $(\alpha_{..},\beta_{.j})$}}           child {node[level 2] (c4) { $(\alpha_{i.},\beta_{..})$}};              % The second level, relatively positioned nodes         \begin{scope}[every node/.style={level 3}]         \node [below of = c1, xshift=20pt] (c11) { $(\alpha_{i.},\beta_{i.})$};         \node [below of = c11 ] (c12) {BRD9 $(\alpha_{.j},\beta_{i.})$};         %\node [below of = c12] (c13) {$(\alpha_{..},\beta_{i.})$};              \node [below of = c2, xshift=20pt] (c21) { $(\alpha_{.j},\beta_{.j})$};         \node [below of = c21 ] (c22) {BRD9 $(\alpha_{.j},\beta_{i.})$};              \node [below of = c3, xshift=20pt] (c31) { $(\alpha_{.j},\beta_{.j})$};         \node [below of = c31 ] (c32) {BRD8 $(\alpha_{i.},\beta_{.j})$};              \node [below of = c4, xshift=20pt] (c41) { $(\alpha_{i.},\beta_{i.})$};         \node [below of = c41 ] (c42) { $(\alpha_{i.},\beta_{.j})$};              %\node [below of = c2, yshift=-15pt, xshift=10pt] (c21) {Membership driven Re-Keying};         %\node [below of = c21] (c22) {Time driven Re-Keying};              %\node [below of = c3, xshift=15pt] (c31) {Ring-based Cooperation};         %\node [below of = c31] (c32) {Hierarchical Cooperation};         %\node [below of = c32] (c33) {Broadcast Cooperation};         \end{scope}              % lines from each level 1 node to every one of its "children"         \foreach \value in {1,2}           \draw[->] (c1.195) |- (c1\value.west);              \foreach \value in {1,2}           \draw[->] (c2.195) |- (c2\value.west);              \foreach \value in {1,2}           \draw[->] (c3.195) |- (c3\value.west);         \foreach \value in {1,2}           \draw[->] (c4.195) |- (c4\value.west);              \end{tikzpicture}\        %\caption{Schematic Presentation of BRD models~\citep{Jansen05} }          \end{figure}         \end{frame}     \end{document}


title: Please help me with a tabular problem

text: ![enter image description here](http://i.stack.imgur.com/yubKL.png) The above table is from C. Bonatto and E. Bica: Fundamental parameters of M 52 and NGC 3960               \documentclass[a4paper,oneside,12pt]{report}     \begin{document}     \begin{small}     %\begin{sidewaystable}[h]     \begin{table}[htp]     %\restylefloat{table}      \centering\small\setlength\tabcolsep{3pt}          %\centering \footnotesize\setlength{\tabcolsep}{0.5pt}     %\toprule     \hspace*{0cm}\begin{tabular}{l@{\hspace{3pt}} *{15}{c}}          %\begin{tabular}{l@{\hspace{1pt}} *{12}{c}}     \hline     \hline          %\bfseries cluster&     \multicolumn{6}{c}{\bfseries previous study}&     \multicolumn{6}{c}{\bfseries present study}\\                   \hline     clusters & $RA_{J2000}$ &$DEc_{J2000}$& $r_{core}$& $r_{lim}$ & $\log(age)$&E$(B-V)$&d&$RA_{J2000}$&$DEc_{J2000}$& $r_{core}$& $r_{lim}$ &$\log(age)$&E$(B-V)$&d\\               &        &(hms)&(dms)& (arcmin)&(arcmin)&(year)&(mag)&(Kpc)&(hms)&(dms)&(arcmin)&(arcmin)& (year)&(mag)&(Kpc)\\              \hline     \bfseries Berkeley 53              &$20 55 56$&$+51 02.8$& $2.5\pm0.1$&$\simeq 20$&$9.09\pm0.02$&$1.52\pm0.01$&$3.1\pm0.1$              &              &               & $4.19\pm0.28$ &$20\pm1.6$ &$9.10\pm0.05$  &$1.39\pm0.42$&$3240\pm440$\\     \hline     \hline     %\toprule     \end{tabular}\hspace*{0cm}     \caption{astrophysical parameters obtained from ischrone fitting}\label{tab:comber}     %\end{sidewaystable}     \end{table}     \end{small}     \end{document}      ![enter image description here](http://i.stack.imgur.com/EpfH2.png) I want table like in the picture.


title: Hide header of table of contents in LaTeX?

text: I am using LaTeX to make a document and I want to hide the header and footer on the page that contains the table of contents. How can i do this? I am new to LaTeX, I already searched for an answer but have not found anything useful for me. This is the code that I use:               \documentclass{report}     \usepackage{textcomp}     \usepackage[hidelinks]{hyperref}     \usepackage{tocloft} % the tocloft package lets you redefine the Table of Contents (ToC)       \renewcommand\cftchappresnum{Chapter } % prefix "Chapter " to chapter number in ToC       \cftsetindents{chapter}{0em}{8em}      % set amount of indenting       \cftsetindents{section}{2em}{6em}     % Macros to redefine numbering of appendix sections (and to     %   reset numbering when not in per-chapter area appendix)     \newcommand\normalsecnums{%         \renewcommand\thesection{\thechapter.\arabic{section}}}     \let\origchapter\chapter     \renewcommand{\chapter}[1]{\normalsecnums         \origchapter{#1}}     \newcommand\appsecnums{%   % execute this command before entering appendix area         \setcounter{section}{0}         \renewcommand\thesection{\appendixname~\Alph{section}}}     \usepackage[lmargin=2cm,rmargin=2.5cm,tmargin=2cm,bmargin=2cm]{geometry}     \usepackage{fancyhdr, lastpage}     \pagestyle{fancy}         \fancyhead[L]{Company name\\ Version 1.0}         \fancyhead[R]{Date: \today\\ Page: \thepage\ of \pageref{LastPage}}          \fancypagestyle{plain}{         \fancyhf{}         \fancyhead[L]{Company name\ Version 1.0}         \fancyhead[R]{Date: \today\\ Page: \thepage\ of \pageref{LastPage}}         }          \begin{document}          \begin{titlepage}     \begin{center}     \vspace*{\fill}         \Large \textbf{Document Title}              \section*{Author:}         MyName     \vspace*{\fill}     \end{center}          \end{titlepage}               \newpage     \begin{titlepage}         \tableofcontents     \end{titlepage}


title: Extra code for \tableofcontents (renew)

text: I want my `\tableofcontents` command to include these two commands at the beginning: `\pagestyle{headings}` and `\pdfbookmark[0]{Table of Contents}{contents}` I tried using the `etoolbox` package, and I came with something like this (inspired in Redefine \tableofcontents to start a new page after the ToC):               \gappto\tableofcontents{\pagestyle{headings}\pdfbookmark[0]{Table of Contents}{contents}}      Here is my MWE:               \documentclass[twoside]{scrbook}          \usepackage{etoolbox}     \usepackage[pdfpagelabels,hyperindex,hyperfigures]{hyperref}     \usepackage{kantlipsum}          \appto\frontmatter{\pagestyle{empty}} % Don't use page numbering in the frontmatter                                             \appto\mainmatter{\pagestyle{headings}} % Use page numbering in the mainmatter          \gappto\tableofcontents{\pagestyle{headings}\pdfbookmark[0]{Table of Contents}{contents}}          \begin{document}          \frontmatter         \addchap*{Publications}         \kant         \addchap*{Acknowledgments}              \tableofcontents         \listoffigures          \mainmatter %Just dummy text to fill the TOC         \chapter{hola}         \kant         \chapter{hola2}         \kant         \chapter{hola3}         \kant         \chapter{hola4}         \kant         \chapter{hola5}         \kant         \chapter{hola6}         \kant         \chapter{hola7}         \section{adas}         \section{adasdas}         \subsection{dasdsdfasdfasdf}         \kant             \chapter{hola2}         \kant         \chapter{hola3}         \kant         \chapter{hola4}         \kant         \chapter{hola5}         \kant         \chapter{hola6}         \kant         \chapter{hola7}         \section{adas}         \section{adasdas}         \subsection{dasdsdfasdfasdf}             \chapter{hola}         \kant         \chapter{hola2}         \kant         \chapter{hola3}         \kant         \chapter{hola4}         \kant         \chapter{hola5}         \kant         \chapter{hola6}         \kant         \chapter{hola7}         \section{adas}         \section{adasdas}         \subsection{dasdsdfasdfasdf}         \kant             \chapter{hola2}         \kant         \chapter{hola3}         \kant         \chapter{hola4}         \kant         \chapter{hola5}         \kant         \chapter{hola6}         \kant         \chapter{hola7}         \section{adas}         \section{adasdas}         \subsection{dasdsdfasdfasdf}          \end{document}      If you run it you'll notice a couple of things:   1. The command `\pagestyle{headings}` seems to be semi-working in the TOC: I do get the page numbers, but I'm missing the heading on the _verso_ page.   2. The pdf bookmark to the TOC actually points to the _verso_ page instead of the _recto_ one. **Extrabonus** : Since I'm issuing the `\pagestyle{empty}` at the beginning of `\frontmatter`, I get all pages without headings or page numbers. However, since I'm using a couple of `\addchap*{}`, these two pages ---since, after all, are chapter pages--- do keep their numeration. I've been dealing with it by simply typing `\thispagestyle{empty}` at the beginning of each one, but I'm not sure if there is a better way to do this.


title: Node frame in background and node label in foreground

text: I would like to highlight a text with a node where the node frame would appear in background and where the node label would appear in foreground (the text itself being in the middle of both). For now, I managed to work with a solution that split the node frame and the node label in two distinct code, one take place before the text and the other one after the text (thus having a default depth determined by the position in the code). But, I am not really happy with this solution because you split in two constructs that are semantically linked to each other. So, I wonder if there is a simple way to force the node frame and the node label to be, respectively, in background and foreground. Here is a stripped down example of my current code:               \documentclass[10pt,a4paper]{beamer}     \usepackage{tikz}          \begin{document}           \begin{frame}        \frametitle{Example}             \onslide<2->{%          \tikz[overlay]{%            \node[rectangle,draw,thick,text centered,rounded corners,                 minimum height=1.35cm,minimum width=10.5cm,fill=blue!35]            at (5.85,-1.5) {};          }        }        \vfill             \begin{itemize}        \item Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi          vitae pharetra nisl. Class aptent taciti sociosqu ad litora          torquent per conubia nostra, per inceptos himenaeos.        \vfill             \item Donec ullamcorper bibendum sem. Nulla venenatis non augue ac          cursus. Pellentesque nec nisl ut ligula pellentesque porttitor eu          rutrum lectus.        \vfill             \item Sed lacinia augue sit amet tempus lobortis. Suspendisse          varius, libero ac consectetur varius, nisi est aliquam arcu, id          varius nisl dolor sit amet odio.        \end{itemize}        \vfill             \onslide<2->{%          \tikz[overlay]{%            \node at (5.85,5.45) {\Huge\bfseries Lorem Ipsum};          }        }      \end{frame}     \end{document}      ![First Slide](http://i.stack.imgur.com/0K2nt.png) ![Second Slide](http://i.stack.imgur.com/P1sKw.png)


title: Strange error related to theorem name (XeTeX)

text: Trying to have a theorem with `[name=Dominio e codominio dell'operatore $D^{\vct{q}}$,label=thm:oss:DomCodomDq]` gives the following error: ![The error on the TeXShop console](http://i.stack.imgur.com/cnw36.png) The error is given by the following MWE:               \documentclass[a4paper]{report}       \usepackage{amsmath,amssymb,thmtools}       \newtheorem{oss}{Osservazione}       \begin{document}       \begin{oss}[name=Dominio e codominio dell'operatore $D^{\overrightarrow{q}}$,label=thm:oss:DomCodomDq]       \end{oss}       \end{document}      where `\vct` has been replaced by its primitive name `\overrightarrow`. The error is apparently related to `\vct`, as removing that removes the error. What does that mean and how do I solve it?


title: Help creating solid cylinders along a path in Tikz for crystal lattice diagram

text: I am trying to draw a diagram using Tikz that will show the crystalline lattice structure of diamond. It should look like the following illustration (reference). ![enter image description here](http://i.stack.imgur.com/gzLoz.png) I have managed to figure out the locations of each of the carbon atoms. I defined each of those locations as a coordinate (A, B, ... Q) and I managed to draw the atoms, but I don't like the look of the lines that show which atoms are connected. My problem is that the lines are not distinct enough from one another. Instead of plain lines I would like to draw three dimensional cylinders that connect the atoms together as I think that would make the image look much better. I have no idea how to get Tikz to do this, however. Here's what I've got so far. Anybody have an idea? ![enter image description here](http://i.stack.imgur.com/sTOOK.png)               \documentclass[10pt]{article}     \usepackage{tikz}     \begin{document}     \pagestyle{empty}          \begin{tikzpicture}[scale = 1]          %points on cube          \coordinate (A) at (0,0,0);     \coordinate (B) at (0,0,4);     \coordinate (D) at (0,4,0);     \coordinate (C) at (0,4,4);     \coordinate (E) at (4,0,0);     \coordinate (F) at (4,0,4);     \coordinate (H) at (4,4,0);     \coordinate (G) at (4,4,4);          %center of faces          \coordinate (I) at (0,2,2); %center of face ABCD     \coordinate (J) at (4,2,2); %center of face EFGH     \coordinate (K) at (2,4,2); %center of face DCGH     \coordinate (L) at (2,0,2); %center of face ABFE     \coordinate (M) at (2,2,4); %center of face CBGF     \coordinate (N) at (2,2,0); %center of face DAEH          %connectors          \coordinate (O) at (1,1,3);     \coordinate (P) at (1,3,1);     \coordinate (Q) at (3,1,1);     \coordinate (R) at (3,3,3);     %place non-atom cube corners     \shadedraw [ball color= gray] (A) circle (0.1cm);     \shadedraw [ball color= gray] (C) circle (0.1cm);     \shadedraw [ball color= gray] (F) circle (0.1cm);     \shadedraw [ball color= gray] (H) circle (0.1cm);     \shadedraw [ball color= black] (B) circle (0.25cm);     \shadedraw [ball color= black] (D) circle (0.25cm);     \shadedraw [ball color= black] (E) circle (0.25cm);     \shadedraw [ball color= black] (G) circle (0.25cm);     %draw the center of each face     \shadedraw [ball color= red] (I) circle (0.25cm);     \shadedraw [ball color= red] (J) circle (0.25cm);     \shadedraw [ball color= red] (K) circle (0.25cm);     \shadedraw [ball color= red] (L) circle (0.25cm);     \shadedraw [ball color= red] (M) circle (0.25cm);     \shadedraw [ball color= red] (N) circle (0.25cm);     %connectors     \shadedraw [ball color= blue] (O) circle (0.25cm);     \shadedraw [ball color= blue] (P) circle (0.25cm);     \shadedraw [ball color= blue] (Q) circle (0.25cm);     \shadedraw [ball color= blue] (R) circle (0.25cm);     %draw cube     \draw [dashed] (A) -- (B);     \draw [dashed] (B) -- (C);     \draw [dashed] (C) -- (D);     \draw [dashed] (D) -- (A);     \draw [dashed] (E) -- (F);     \draw [dashed] (F) -- (G);     \draw [dashed] (G) -- (H);     \draw [dashed] (H) -- (E);     \draw [dashed] (A) -- (E);     \draw [dashed] (B) -- (F);     \draw [dashed] (C) -- (G);     \draw [dashed] (D) -- (H);     %connections from faces to O     \draw [very thick] (B) -- (O);     \draw [very thick] (I) -- (O);     \draw [very thick] (M) -- (O);     \draw [very thick] (L) -- (O);     %connections from faces to P     \draw [very thick] (N) -- (P);     \draw [very thick] (I) -- (P);     \draw [very thick] (D) -- (P);     \draw [very thick] (K) -- (P);     %connections from faces to Q     \draw [very thick] (E) -- (Q);     \draw [very thick] (J) -- (Q);     \draw [very thick] (N) -- (Q);     \draw [very thick] (L) -- (Q);     %connections from faces to R     \draw [very thick] (G) -- (R);     \draw [very thick] (M) -- (R);     \draw [very thick] (J) -- (R);     \draw [very thick] (K) -- (R);     \end{tikzpicture}     \end{document}


title: Target only some footnotes with para footmisc

text: I have four small footnotes. I want the first two to appear in separate lines, and the last ones to appear together in the same line. When I try `\usepackage[para]{footmisc}`, they all appear in a single line. MWE:               \documentclass{article}     \usepackage[para]{footmisc}     \begin{document}     Some text.\footnote{FN1.\\}     Some text.\footnote{FN2.\\}     Some text.\footnote{FN3.}     Some text.\footnote{FN4.}     \end{document}      This shows (note the spaces before `2` and `3`):               1 FT1.       2 FT2.       3 FT3.   4 FT4.      What I need instead:               1 FT1.     2 FT2.     3 FT3.    4 FT4.


title: Converting RMarkdown to LaTeX without additional packages

text: I'm wanting to convert a markdown document into LaTeX for inclusion in my thesis. Unfortunately, the output of my command,               pandoc -f markdown -t latex --standalone  msim-eg.md > msimeg.tex       results in output that requires a large number of preamble items that I do not want in my final document:               \documentclass[]{article}     \usepackage{amssymb,amsmath}     \usepackage{ifxetex,ifluatex}     \ifxetex       \usepackage{fontspec,xltxtra,xunicode}       \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}     \else       \ifluatex         \usepackage{fontspec}         \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}       \else         \usepackage[utf8]{inputenc}       \fi     \fi     \usepackage{color}     \usepackage{fancyvrb}     \DefineShortVerb[commandchars=\\\{\}]{\|}     \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}     % Add ',fontsize=\small' for more characters per line     \newenvironment{Shaded}{}{}     \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}     \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}     \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}     \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}     \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}     \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}     \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}     \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}     \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}     \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}     \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}     \newcommand{\RegionMarkerTok}[1]{{#1}}     \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}     \newcommand{\NormalTok}[1]{{#1}}     \usepackage{graphicx}     % We will generate all images so they have a width \maxwidth. This means     % that they will get their normal width if they fit onto the page, but     % are scaled down if they would overflow the margins.     \makeatletter     \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth     \else\Gin@nat@width\fi}     \makeatother     \let\Oldincludegraphics\includegraphics     \renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}     \ifxetex       \usepackage[setpagesize=false, % page size defined by xetex                   unicode=false, % unicode breaks when used with xetex                   xetex,                   colorlinks=true,                   linkcolor=blue]{hyperref}     \else       \usepackage[unicode=true,                   colorlinks=true,                   linkcolor=blue]{hyperref}     \fi     \hypersetup{breaklinks=true, pdfborder={0 0 0}}     \setlength{\parindent}{0pt}     \setlength{\parskip}{6pt plus 2pt minus 1pt}     \setlength{\emergencystretch}{3em}  % prevent overfull lines     \setcounter{secnumdepth}{0}      How can I get pandoc to export without needing all these preamble items? (Without the standalone flag the output is the same and clearly requires a big preamble. E.g:               \begin{Shaded}     \begin{Highlighting}[]     \CommentTok{# Read in the data in long form (normaly read.table() used)}     \NormalTok{c.names <- }\KeywordTok{c}\NormalTok{(}\StringTok{"id"}\NormalTok{, }\StringTok{"age"}\NormalTok{, }\StringTok{"sex"}\NormalTok{)}     \NormalTok{USd <- }\KeywordTok{c}\NormalTok{(}\DecValTok{1}\NormalTok{, }\DecValTok{59}\NormalTok{, }\StringTok{"m"}\NormalTok{, }\DecValTok{2}\NormalTok{, }\DecValTok{54}\NormalTok{, }\StringTok{"m"}\NormalTok{, }\DecValTok{3}\NormalTok{, }\DecValTok{35}\NormalTok{, }\StringTok{"m"}\NormalTok{, }\DecValTok{4}\NormalTok{, }\DecValTok{73}\NormalTok{, }\StringTok{"f"}\NormalTok{, }\DecValTok{5}\NormalTok{, }\DecValTok{49}\NormalTok{, }\StringTok{"f"}\NormalTok{)}     \NormalTok{USd <- }\KeywordTok{matrix}\NormalTok{(USd, }\DataTypeTok{nrow =} \DecValTok{5}\NormalTok{, }\DataTypeTok{byrow =} \NormalTok{T)  }\CommentTok{# Convert long data into matrix, by row}     \NormalTok{USd <- }\KeywordTok{data.frame}\NormalTok{(USd)  }\CommentTok{# Convert this into a dataframe}     \KeywordTok{names}\NormalTok{(USd) <- c.names  }\CommentTok{# Add correct column names}     \NormalTok{USd$age <- }\KeywordTok{as.numeric}\NormalTok{(}\KeywordTok{levels}\NormalTok{(USd$age)[USd$age])  }\CommentTok{# Age is a numeric variable}          \NormalTok{USd  }\CommentTok{# Show the data frame in R}     \end{Highlighting}     \end{Shaded}     \begin{verbatim}     ##   id age sex     ## 1  1  59   m     ## 2  2  54   m     ## 3  3  35   m     ## 4  4  73   f     ## 5  5  49   f     \end{verbatim}     \subsubsection{Geographical data}          \begin{Shaded}     \begin{Highlighting}[]     \CommentTok{# Read in the data in long form (normaly read.table() used)}     \NormalTok{category.labels <- }\KeywordTok{c}\NormalTok{(}\StringTok{"16-49"}\NormalTok{, }\StringTok{"50+"} \CommentTok{# Age constraint }                  \NormalTok{,}\StringTok{"m"}\NormalTok{, }\StringTok{"f"} \CommentTok{# Sex constraint}                  \CommentTok{#,"bicycle", "bus", "car.d", "car.p", "walk" # Mode constraint}                  \NormalTok{)}     \NormalTok{all.msim <- }\KeywordTok{c}\NormalTok{(  }\DecValTok{8}\NormalTok{, }\DecValTok{4}\NormalTok{,    }\DecValTok{6}\NormalTok{, }\DecValTok{6}\NormalTok{,   }\CommentTok{#0.001, 1, 8, 1, 0.001, # Car dominated}                     \DecValTok{2}\NormalTok{, }\DecValTok{8}\NormalTok{,    }\DecValTok{4}\NormalTok{, }\DecValTok{6}\NormalTok{,   }\CommentTok{#0.001, 3, 5, 1, 1, # Elderly}                     \DecValTok{7}\NormalTok{, }\DecValTok{4}\NormalTok{,    }\DecValTok{3}\NormalTok{, }\DecValTok{8}\NormalTok{,   }\CommentTok{#1, 2, 5, 2, 1, # Female dominated}                     \DecValTok{5}\NormalTok{, }\DecValTok{4}\NormalTok{,    }\DecValTok{7}\NormalTok{, }\DecValTok{2}\NormalTok{,   }\CommentTok{#2, 1, 3, 1, 2, # Male dominated}                     \DecValTok{7}\NormalTok{, }\DecValTok{3}\NormalTok{,    }\DecValTok{6}\NormalTok{, }\DecValTok{4}    \CommentTok{#,   7, 0.001, 2, 0.001, 1  # Many cyclists, young}                     \NormalTok{)}     \NormalTok{all.msim <- }\KeywordTok{matrix}\NormalTok{(all.msim, }\DataTypeTok{nrow =} \DecValTok{5}\NormalTok{, }\DataTypeTok{byrow =} \NormalTok{T) }\CommentTok{# Convert long data into matrix, by row}     \NormalTok{all.msim <- }\KeywordTok{data.frame}\NormalTok{(all.msim) }\CommentTok{# Convert this into a dataframe}     \KeywordTok{names}\NormalTok{(all.msim) <- category.labels }\CommentTok{# Add correct column names}     \NormalTok{all.msim }\CommentTok{# Show the data frame in R}     \end{Highlighting}      ) Surely there's an easy way to remove this mess.


title: How do I create a table that meets the following specifications?

text: Following this question: I want to create an environment for a table with the following specifications: The left column is a vertically centered rotated text, saying Övning. The right column contains paragraphs of text, so I want an empty line for each paragraph (as if I'm using `\usepackage[parfill]{parskip}`) and `\\\` to just give me a line break. The previous question fixed the paragraph issue but broke the centering for the left column. Also, if I use line breaks Here's my environment now:               \usepackage{array}     \usepackage{rotating}          \newcolumntype{P}[1]{>{%       \parskip=0.5\baselineskip%       \advance\parskip by 0pt plus 2pt        \setlength{\parfillskip}{30pt plus 1fil}}p{#1}}          \newenvironment{exercise}[1]     {         \begin{tabular}{m{0.05\textwidth}|P{0.85\textwidth}}   # using m in the second column gives back the vertical centering         \rotatebox{90}{\textbf{Övning}} & \textbf{#1}     }     {\end{tabular}     \bigskip     }      I can use it like so:               \begin{exercise}{5.7}     Övningen finns under Warmup-1 $\rightarrow$ makes10.          Du är given två heltal, \texttt{a} och \texttt{b} som parametrar. Skriv en funktion som returnerar \texttt{True} om ett av talen är 10 eller om summan av dem är 10.          \texttt{makes10(9, 10)} $\rightarrow$ \texttt{True}          \texttt{makes10(9, 9)}  $\rightarrow$ \texttt{False}          \texttt{makes10(1, 9)}  $\rightarrow$ \texttt{True}     \end{exercise}      This produces the following result![enter image description here](http://i.stack.imgur.com/gjtYO.png): However, if I introduce line breaks, like so:               \texttt{makes10(9, 10)} $\rightarrow$ \texttt{True} \\     \texttt{makes10(9, 9)}  $\rightarrow$ \texttt{False} \\     \texttt{makes10(1, 9)}  $\rightarrow$ \texttt{True} \\      Then it breaks my table: ![enter image description here](http://i.stack.imgur.com/Gnc8n.png) So, I want to be able to use line/paragraph breaks in the right column as usual and I want the text in the vertical column to be centered. I'm using xelatex with polyglossia (this caused an issue in the previous question).


title: Unicode characters in LaTeX, getting errors

text: I am trying to include Unicode charters in LaTeX but I am getting error. These are the characters ,`മല + ആയിരുന്നു = മലയായിരുന്നു` . I need to include               \documentclass[12pt]{ociamthesis}      \usepackage[utf8]{inputenc}      I am getting following error:               Type H <return> for immediate help.     ...     l.27 മ     ല + ആയിരുന്നു : മലയായിരുന...     Your command was ignored.     Type I <command> <return> to replace it with another command,     or <return> to continue without it.     ! Package inputenc Error: Unicode char \u8:ല not set up for use with LaTeX.      I use this font Editor: Texmaker 3.2 Any Clues?


title: How can I number paragraphs without higher level counters?

text: How can I redefine the paragraph counter such that instead of revealing all superior counters, it only reveals the paragraph counter. I assume this is possible with `titlesec`. **I would like to have each paragraph numbered like §1, §2, §3, etc.** See minimal example below:               \documentclass[12pt]{article}     \usepackage{fontspec}          \newcounter{paragraphstep}     \newcommand{\paracount}{%             \stepcounter{paragraphstep}%             \theparagraphstep}             \setcounter{secnumdepth}{6}          \begin{document}          \paragraph{}\label{Personal Statement}     San Francisco is a city in California. See paragraph \ref{Personal Statement}.          \end{document}      This question is related to:   * How can I get the section.subsection number without the chapter number?   * numbering of \paragraph command


title: Writing Biblical Hebrew texts with different coloring for consonants, vowel and accent signs

text: I have got the following problem: I am using Biblical Hebrew texts written in XeTeX but I would like to color consonants as well as vowel and accent signs differently. I have read Coloring combining characters without changing color of a base character, but the ways suggested to have it done seem too laborious. So, is there a more straight forward way to assign - more or less permanently - each unicode sign (or maybe an entire consecutive unicode sign range) an inidvidual color? For instance, as in the linked example, I would like all consonants to appear in black, all vowels signs in red and all accent signs in blue.


title: Numbering problem with footnotes in epigraph

text: I am having some difficulty with the numbering of a couple of footnotes in an epigraph. Using `\footnotemark` and `\footnotetext`, both the footnotes are given the same number although the contents are correct. Using `\footnotemark[1]` doesn't help either. I am using the `epigraph` package. MWE:               \documentclass[a4paper,11pt]{article}     \usepackage[T1]{fontenc}     \usepackage{epigraph}     \usepackage[sc]{mathpazo}     \setlength{\epigraphrule}{0pt}     \setlength{\epigraphwidth}{.9\textwidth}     \renewcommand{\epigraphflush}{center}     \renewcommand{\sourceflush}{flushright}     \renewcommand{\textflush}{flushleft}     \setlength{\afterepigraphskip}{.2\baselineskip}          \begin{document}     \section{Introduction}     \begin{epigraphs}     \qitem{Epigraph one blah blah blah?\footnotemark Blah blah\footnotemark blah}%       {---\textsc{Author A}}     \qitem{Epigraph two blah blah}%     {---\textsc{Author B}}     \end{epigraphs}     \footnotetext{one}     \footnotetext{two}     \noindent Blah blah blah\footnote{three}. Blah blah Blah.     \end{document}


title: Repeating the watermark in the background

text: How to insert watermark repeatedly in the background only in the titlepage in an inclined fashion. Here is the MWE:               \documentclass{article}     \usepackage{background}     \usepackage{lipsum}          \backgroundsetup{%       scale=1,              angle=0,                opacity=.6,           color =black,         contents={\begin{tikzpicture}[remember picture,overlay]             \node at ([yshift=11pt,xshift=5pt]current page.center) {\includegraphics[width=5cm]{example-image-a}};             \end{tikzpicture}}     }     \begin{document}     \lipsum[1-50]     \end{document}      The code where I wish to implement this:               \documentclass[12pt]{book}     \usepackage{graphicx}     \usepackage{background}          \newlength{\drop}          \backgroundsetup{%       scale=1,       %% change accordingly       angle=0,       %% change accordingly       opacity=.6,    %% change accordingly       contents={\begin{tikzpicture}[remember picture,overlay]             \node at ([yshift=11pt,xshift=5pt]current page.center) {\includegraphics[width=5cm]{logo}};    %% yshift and xshift for example only         \end{tikzpicture}}     }          \begin{document}     \begin{titlepage}     \drop=0.1\textheight     \centering     \vspace*{\baselineskip}     \rule{\textwidth}{1.6pt}\vspace*{-\baselineskip}\vspace*{2pt}     \rule{\textwidth}{0.4pt}\\[\baselineskip]     {\LARGE\bfseries JAVA\\[0.3\baselineskip] {\Large Core Concepts}}\\[0.2\baselineskip]         \rule{\textwidth}{0.4pt}\vspace*{-\baselineskip}\vspace{3.2pt}         \rule{\textwidth}{1.6pt}\\[\baselineskip]         {\Large\bfseries BY \\[2mm]SUBHAM SONI}\\[\baselineskip]         \includegraphics{logo}\\[1.2cm]         {\Large\scshape May 27, 2014}     \end{titlepage}     \end{document}       The logo: ![enter image description here](http://i.stack.imgur.com/dGwYR.png) The way bookmark to be filled: ![enter image description here](http://i.stack.imgur.com/kBDzH.png)


title: Table paragraph spacing

text: In the preamble of my document, I'm using `\usepackage[parfill]{parskip}` to make a new line between each paragraph. But when I try to write paragraphs inside a table:               \begin{tabular}{l|p{0.85\textwidth}}     aaa & Paragraph 1          Paragraph 2     \end{tabular}      the paragraph skip is ignored, and it doesn't even give me an indentation: ![enter image description here](http://i.stack.imgur.com/kzS93.png) My tables have long texts in them so the paragraph skip is really desirable for reading. Also, this breaks the newline `\\\` for me. As far as I understand, \tabular redefines \par to be empty but the solution proposed seemed a bit too advanced for my needs. I tried with `\endgraf` after each paragraph without any result. I'm using xelatex. Any help? Edit: The above code is my minimum test case. I would like to use the paragraphs in the following environment:               \usepackage{polyglossia}     \setmainlanguage{swedish}          \usepackage{array}     \usepackage{rotating}          \newenvironment{exercise}[1]     {         \begin{tabular}{m{0.05\textwidth}|P{0.85\textwidth}}         \rotatebox{90}{\textbf{Övning}} & \textbf{#1}     }     {\end{tabular}     \bigskip     }


title: How can I use blockquote with \documentclass moderncv

text: I'm trying to use `\blockquote` (from the `csquotes` package) in a `moderncv` document, but the output does not look as it should (the quote is not indented and the string "csq@block" is prefixed to the quote). Here is a MWE:               \documentclass{moderncv}        \usepackage{csquotes}     \name{John}{Doe}     \begin{document}     \blockquote{Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.}     \end{document}      The output is this: ![](http://i.stack.imgur.com/cCvTp.png) Is this an incompatibility between the two packages, and if so, which one is causing the problem? And is there a workaround for this?


title: Troubles with installing vanilla

text: Thank you very much for your helpful guidance in "How to install Vanilla". I reached till "finalizing your installation" but when I enter "which tex" it shows /usr/bin/tex instead of /opt/texbin/tex, which I expected, although I rebooted the computer. Being an absolute beginner to Ubuntu, I have really no idea what to do now. Could you give me some advice, because I can't repeat creating this symbolic link, as it already exists. Thank you very much in advance. I'd appreciate every helpful comment very much!


title: use lining figures in references

text: I use lowercase/old style figures in most of my document, but want to use uppercase/lining figures in references (as they're "proper nouns" I think). I'm using the following at the moment:               \newcommand*{\myref}[1]{\liningfigures{\ref{#1}}}      (`\liningfigures` comes from `fontaxes` with `libertine` fonts) but that means that I have to use `\myref{id}` all over the place. I was wondering what to use so that I can just use `\ref` as normal. Hum, while looking for the right terms I found out how to do it. Will post my answer below… if anyone has a better way to do it, feel free to contribute!


title: LaTeX typeset multiple comparisons

text: I originally asked this question on Stack Overflow, but was advised to also ask here... So, here goes! I'm teaching an applied stats course and was wondering whether anyone can advise me on how to display multiple comparisons in the context of ANOVA. I.e. Tukey's HSD. For example, if you have four treatments then we will often want to summarise the information from pairwise comparisons like this (solid lines, not dashed, and not so much vertical space):               D B C A F E     -----   ---       -----      which indicates that D is significantly different from A, F & E; D, B, C do not differ significantly from each other etc. In other words, we have a line connecting treatments which do not differ significantly. Something like this would work, but there must be a better way of doing this:               \begin{tabular}{cccccc}     \cline{2-4}      D & B & C & A & F & E\tabularnewline     \hline       &  &  &  &  & \tabularnewline     \end{tabular}      Also a table doesn't work nicely in more complex situations. How do they typeset this in most stats texts?


title: Implementing full-page Screen-Only & Print-Only in PDF

text: I am interested in displaying some things (e.g.: title page) in full color on screen, while having the same object/page display in a black and white friendly form when printed. According to this SO question, there is built-in functionality in the PDF specification for Screen-Only objects and Screen-And-Print objects. There may also be a way to add a layer on top of the B&W page that only displays the full color page on screen via the PDF 1.5 _Optional Content Groups_ feature. Similarly, this question demonstrates the selective printing of text via `ocg-p`. But it is not clear how I can use this package in the way that I need to. My scenario is compounded by the fact that my color page text is white on a dark background. ### MWE: This code presents the way I am currently switching back and forth between color and b&w. I change the `printincolor` bool variable to make the change.               \documentclass[11pt]{article}          \usepackage[demo]{graphicx}     \usepackage{etoolbox}          \providebool{printincolor}     % Will set color title page and section headings     \setbool{printincolor}{false}          % Setup color if needed     \ifbool{printincolor}{%     \usepackage[pagecolor=none]{pagecolor}%     \definecolor{MyBlue}{HTML}{1b3667}%     \usepackage{afterpage}}{}          \begin{document}          % Begin Title Page     {      \thispagestyle{empty}       \ifbool{printincolor}{%       \pagecolor{MyBlue}%       \afterpage{\nopagecolor}}{}       \begin{center}       {\ifbool{printincolor}{\color{white}\sffamily}{\sffamily}%  Set text color white or leave [default] black       \ifbool{printincolor}{\includegraphics[width=1.5in]{logo-gold}}{\includegraphics{logo-blue}}% put logo gold or blue       \\ \vskip 1in       \begin{huge}             \textbf{Title}             \vskip 0.1ex\rule{0.5\textwidth}{0.8pt}\vskip 1ex             Subtitle             \\             \end{huge}       \vfill\vfill       \begin{large}            Authors:\\       John Doe and Jane Doe\\       \end{large}       }       \end{center}     }          \end{document}      **How can I layer (or otherwise display) two versions of the title page in a way that color displays on screen, but black and white is printed?**


title: Landscaped longtable doesn't allow appendix title on same page

text: My landscaped longtables leave the appendix title page and are placed on the next page. Now the appendix title page is empty, apart from the one-line title. What can I do about it?


title: Modifying apacite reference style: Comma after booktitle

text: I am using a customized apacite style for my bibliography. The reference guide of a journal demands a comma instead of a period after the book title. Any idea how to define the comma in the .bst file? I think it must be somewhere in the `FUNCTION {book}` section. I have already managed to delete the period by deleting `add.period$` here:                { format.authors                          start.new.block       format.year.check                       output.dot.new.block       format.btitle.vol.edition.editor.trans       format.type.number                      connect.with.space.check       add.period$     }      A sample reference should look like this: Coleman, J.S. (1990). _Power and the Structure of Society_ , New York: W.W. Norton & Company.


title: listings range end markers in comments with texcl

text: I'm trying to using the `listings` package to generate nice listings of some Lisp-style code (where line comments begin with a `;`). I'd like to keep the code compilable, and so put the range markers inside of a comment. However, characters go missing (or not enough are removed, depending on your perspective) once comment syntax is enabled, and when the `texcl` option is enabled with comments, `listings` doesn't seem to find the end of range marker at all! Here's an example of the problem, and the code that creates it: ![enter image description here](http://i.stack.imgur.com/uGn9L.png)               \documentclass{article}          \usepackage{listings}          \begin{document}          \lstset{%       basicstyle=\ttfamily\small,%       rangeprefix=MARK\ ,%       includerangemarker=false,%     }          $-$texcl, $-$comment     \begin{lstlisting}[linerange=startx-endx]     ;; Some commentary before the marker     ;;MARK startx     a line to include     ;; a comment line to include $x^2$     ;;MARK endx     ;; Stuff after the range marker     \end{lstlisting}          $+$texcl, $-$comment     \lstset{texcl=true}     \begin{lstlisting}[linerange=startx-endx]     ;; Some commentary before the marker     ;;MARK startx     a line to include     ;; a comment line to include $x^2$     ;;MARK endx     ;; Stuff after the range marker     \end{lstlisting}          $-$texcl, $+$comment     \lstset{texcl=false,comment=[l];}     \begin{lstlisting}[linerange=startx-endx]     ;; Some commentary before the marker     ;;MARK startx     a line to include     ;; a comment line to include $x^2$     ;;MARK endx     ;; Stuff after the range marker     \end{lstlisting}          $+$texcl, $+$comment     \lstset{texcl=true,comment=[l];}     \begin{lstlisting}[linerange=startx-endx]     ;; Some commentary before the marker     ;;MARK startx     a line to include     ;; a comment line to include $x^2$     ;;MARK endx     ;; Stuff after the range marker     \end{lstlisting}          \end{document}


title: How to pass a macro as a value for a key?

text: I want to pass a macro to a `showgrid` key. The macro can be redefined later. Its possible values are `top`, `bottom`, `false`, `true`. The following MWE produces a blank page. How to fix it?               \documentclass[border=12pt,pstricks]{standalone}     \usepackage{pstricks}          \def\status{true}          \begin{document}          \begin{pspicture}[showgrid=\status](3,3)     \end{pspicture}          \end{document}


title: Full width image in beamer?

text: I have a beamer presentation with a custom style which creates a red bar along the bottom of each slide. When I change the geometry and then revert it with restoregeometry, the red bar is now shifted to the right. The aim is just to have the picture full width.               \documentclass{beamer}        \mode<presentation>      {     \usetheme{myslides}      }          \begin{document}          \begin{frame}[fragile]     \frametitle{}          \begin{center}     \huge Introduction?     \end{center}     \end{frame}          \newgeometry{margin=0pt}          \begin{frame}[fragile, plain]     \frametitle{}     \includegraphics[width=\paperwidth, width=\paperwidth]{picture}     \end{frame}          \restoregeometry     \begin{frame}[fragile]     \frametitle{}     \begin{center}     \huge Next slide?     \end{center}     \end{frame}     \end{document}      How can I restore back to exactly the state it was in before the newgeometry command? My question seems related to beamer: frame without decorations, with custom margin as well where there is a similar problem with \restoregeometry in one of the answers.


title: amsbook theorem numbering

text: I want theorems to be labeled of the form Part.Chapter.Section.number so I tried               \renewcommand{\thesection}{\Roman{part}.\thechapter.\arabic{section}}      \newtheorem{book}{Theorem}[section]     \newtheorem{AddProp}[book]{Additive Property of Equality}     \begin{AddProp} Testing \end{AddProp}      But does what I want, but as a side effect it also changes the sections, is there a way to only change the theorem numbering?


title: Testing lines read from external file

text: I am trying to read some data from an external file and perform specific actions based on the contents of a given line. Below is my attempt to test a read line using `\ifx` - it does not work. I've also tried using `\ifthenelse` from the `ifthen` package and some of the generic tests from `etoolbox`. As all my attempts has failed, I now have two questions:   1. How do I perform a test to see if data read from an external file matches a specified sting?    2. How should I debug to work out why my test fails? Based on the typeset output from the MWE below, `Line with bar` read from the external file does seem to match `\linetomatch`? As the `\usepackage` statements in the preambel indicates, I would like the code to work with both LuaLaTeX and pdfLaTeX (opening the file with `io.open` in a `\directlua` block works and I can do the testing with Lua in LuaLaTeX. However, I would prefer a version working in pdfLaTeX too).               \documentclass{article}     \usepackage{fontspec}     %\usepackage[T1]{fontenc}     %\usepackage[utf8]{inputenc}          \usepackage{filecontents}     \begin{filecontents*}{datafile.txt}     Line with foo     Line with bar     Line with baz     \end{filecontents*}          \makeatletter     \newread\myread     \def\loaddata#1{%         \edef\linetomatch{Line with bar}%         \openin\myread=#1         \@whilesw\unless\ifeof\myread\fi{%             \readline\myread to \dataline%             \noindent"\linetomatch"             \ifx\dataline\linetomatch\relax                 equals              \else                 does not equal             \fi             "\dataline"\par         }%         \closein\myread     }%     \makeatother          \begin{document}          \loaddata{datafile.txt}          \end{document}


title: Print arguments of a macro in a random order

text: I have the following (simplified) LaTeX code that simply prints all its arguments.               \newcommand{\mm}[4]{#1 #2 #3 #4}      Now, I would like the arguments to be printed in a **random order** , e.g., `#2 #1 #4 #3`. Is this possible? If yes, how?


title: Deleted Main.bib using filecontents while trying to enter citation involving mathematical treatment

text: Ok. I feel pretty stupid but I was trying to find a solution to using mathematics in bibliography. I ended up using the following example in this forum that used filecontents. Help with math symbols in BibTeX The following is what I used right before defining documentclass and database.bib was my main bibliography file in the same folder.               \RequirePackage{filecontents}        % loading package filecontents     % writing file \jobname.bib, for example mb-bibtex.bib.     \begin{filecontents*}{\database.bib}     @ARTICLE{UCH86,     AUTHOR =            {Uchida, I. and Nishina, T. and Mugikura, Y. and Itaya, K.},     TITLE =             {Gas electrode reactions in molten carbonate media. Part I. Exchange current density of oxygen reduction in $(Li+K)CO_3$ eutectic at $650^{\circ}$ C},     JOURNAL =       {J of Electroanal. Chem.},     VOLUME =            {206},     YEAR =              {1986},     PAGES =             {229--239}     }     \end{filecontents*}      Unfortunately, database.bib was my most updated bibliography file and it seems to me that putting the above filecontents section before my main .tex (as below) and executing my .tex file wiped out contents of my database.bib leaving just one entry. Is there any way to recover the wiped out file?               \documentclass[12pt]{report}     \usepackage{graphicx,xcolor}     \usepackage{footnote}     \makesavenoteenv{table}     \usepackage[abs]{overpic}     \usepackage{caption}     \usepackage{subcaption}     \usepackage[centertags]{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{newlfont}     \usepackage[version = 3]{mhchem}     \usepackage{rotating}     \usepackage{mathptmx}     \usepackage{textcomp}     \usepackage{booktabs}     \usepackage{nomentbl}     \usepackage{thesisdef}     \usepackage{xthesis} %DAL Thesis Style     \usepackage{xtocinc} %Include Table of Contents as the first entry in TOC     \usepackage{appendix}     \usepackage[numbers]{natbib}     \usepackage{array}     \newcolumntype{L}{>{\centering\arraybackslash}m{3cm}}     \newcolumntype{S}{>{\centering\arraybackslash}m{1.8cm}}     \makenomenclature     \begin{document}          stuff          \bibliographystyle{plainnat}     \bibliography{\database} %%% ... Good for using one single database...     \end{document}


title: Theorem style 'bodyfont' not respected

text: The two theorem styles below which differ at `bodyfont` style, give the same font style. Can someone help on this?               \documentclass[12pt,a4paper]{report}     \usepackage{amsthm}     \usepackage{thmtools}     \usepackage{amsfonts,color,graphicx,xcolor}     \usepackage[english]{babel}     \declaretheoremstyle[         headfont=\bfseries,         notebraces={(}{)},         bodyfont=\normalfont\scshape,         headpunct={},         postheadspace=\newline,         postheadhook={\textcolor{red}{\rule[2.0ex]{\linewidth}{0.8pt}}\\},         spacebelow=\parsep,         spaceabove=\parsep,         mdframed={             backgroundcolor=cyan!20,                 linecolor=red!30,                 innertopmargin=6pt,                 roundcorner=5pt,                 innerbottommargin=6pt,                 skipbelow=\parsep,                 skipbelow=\parsep }     ]{myexamplestyle}          % example environment - thmtools     \declaretheorem[         style=myexamplestyle,         name=EEEEE,         numberwithin=section         %qed=$\Box$     ]{EE}          \declaretheoremstyle[         headfont=\bfseries,         notebraces={(}{)},         bodyfont=\normalfont\itshape,         headpunct={},         postheadspace=\newline,         postheadhook={\textcolor{cyan}{\rule[2.0ex]{\linewidth}{0.8pt}}\\},         spacebelow=\parsep,         spaceabove=\parsep,         mdframed={             backgroundcolor=green!20,                 linecolor=magenta!30,                 innertopmargin=6pt,                 roundcorner=5pt,                 innerbottommargin=6pt,                 skipbelow=\parsep,                 skipbelow=\parsep }     ]{myexamplestyle}          % example environment - thmtools     \declaretheorem[         style=myexamplestyle,         name=DDDDDD,         numberwithin=chapter     ]{DD}     \begin{document}     \begin{EE}     Some text.     \end{EE}          \begin{DD}     The other text     \end{DD}     \end{document}


title: Babel Error: Undefined Control Sequence

text: I'm running into a bizarre issue with the Babel package that I haven't seen before and would love some help figuring out a solution. First, I'll give an example of something that does compile correctly (using pdftex) on my computer:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage[hebrew, english]{babel}     \usepackage[T1]{fontenc}     \begin{document}     Document Text.     \end{document}      However, when I remove the word `hebrew`, it no longer compiles and gives me the following error (taken from the log file):               ! Undefined control sequence.     \bbl@set@language ...ge {\languagename }}\bbl@for                                                        \bbl@tempa \BabelContentsF...     l.6 \begin{document}          ?      ! Emergency stop.     \bbl@set@language ...ge {\languagename }}\bbl@for                                                        \bbl@tempa \BabelContentsF...     l.6 \begin{document}          End of file on the terminal!      I have noticed that the same error occurs when using Arabic and English. I just recently updated to TeX Live 2013; I also just updated all my packages. After running into this issue, I reinstalled all babel packages with the TeX Live Utility and tried to compile the document again with no luck. I also just recently installed GNU Aspell with a bunch of dictionaries, including Arabic, Hebrew, and English. I can't imagine that would cause this issue, but I thought I'd mention it. Also, I am on a Mac. Here is output from `\listfiles` for the english document:               ! Undefined control sequence.     \bbl@set@language ...ge {\languagename }}\bbl@for                                                        \bbl@tempa \BabelContentsF...     l.6 \begin{document}          ? r     OK, entering \nonstopmode...     [1          {/usr/local/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]     (./FIT2.aux)           *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)     inputenc.sty    2008/03/30 v1.1d Input encoding file         utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc        t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc       omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc        babel.sty    2005/11/23 v3.8h The Babel package      english.ldf    2005/03/30 v3.3o English support from the babel system      fontenc.sty        t1enc.def    2005/09/27 v1.99g Standard LaTeX file      ***********           )


title: How to compile the source code of TeX

text: I am more and more interested in the system TeX (and LaTeX) and I want to study it more deeply. I am not telling that I want to learn how to use it, but **I want to understand its mechanism now**. The first thing that I can imagine is to download its source code Plain Tex. But _**...the current TeX software is written in WEB, a mixture of documentation written in TeX and a Pascal subset in order to ensure portability..._** (Wikipedia) I am an amateur C programmer with a little experience of Win32 API, and I always use Microsoft Visual Studio to do programming. I have totally no idea what to do next with the souce code above, for example, compile it and get outputs (on Windows and on Linux), use the outputs to compile a .tex file and get the output. Can some expert(s) talk and explain a little about this beautiful sytem, or, at least, tutorials about how to build it, please?


title: How to typeset moon phase symbols?

text: I would like to add moon phase symbols to a document of mine but could not find a visually pleasing way to do this. Does anyone know how to typeset aesthetic moon phase symbols?


title: listing presentations in CV with bibtex?

text: Has anyone used bibtex to include a list of seminars/presentations given in a CV (kind of like a list of publications). If so, which bibtex entry do you use (`@inproceedings`, `@unpublished`...?) and which style file? I intend to use the `multibib` package to keep this section formatting separate from the list of publications, so I hope to avoid conflicts between the two sections.


title: Why are my \include files ignored?

text: I am trying to use the \include command to import chapters into Latex. For some reason, Latex is completely ignoring files in the \include command. If I replace \include with \input they are included fine, why might this be? FOr information I am using TeXnicCenter on windows. It fails for both Latex and pdflatex.               \documentclass[10pt,twoside,openright]{report}           \begin{document}          % Ignored     \include{./integrated_linear_generator_models.tex}          % Works     \input{./integrated_linear_generator_models.tex}          \end{document}


title: Inserting a blank left starting page in a Koma-script book

text: I am finishing my dissertation, and I'm using the Koma-script `scrbook` class. My text starts on a right page, which is exactly what I want, but for printing I need to add a completely blank, unnumbered left page to the beginning of the file. Using `\clearpage` or `\newpage`, however, produces two blank pages, the first one starting on a right page. Of course I could use the resulting file and manually remove the first blank page in Acrobat, but I would really prefer to get it right at compilation, to minimize the risk of mistakes in printing. I'm including a mwe below.               \documentclass{scrbook}          \usepackage{lipsum}          \begin{document}          \frontmatter          \lipsum          \mainmatter          \chapter{Test}          \lipsum          \end{document}


title: Axis specific subgrid devision using \psgrid

text: If I want to devide a grid into subgrids using PSTricks, I use the command `\psgrid` with the option `subgriddiv=<integer>`. This, however, sets the number of subgrids to the same on both axis; is it possible to get a different subdivision for each axis?


title: siunitx - What is the best way to write "million"?

text: Is this a good way to write "million"? How do you do it? Initially I used the scientific notation of the value but of course this got silly fast. **What do you do in this case?** ## Picture ![enter image description here](http://i.stack.imgur.com/3IlfL.png) ## MWE               \documentclass{scrartcl}          \usepackage{         lmodern,         amsmath     }     \usepackage{         siunitx,         eurosym     }          \DeclareSIUnit{\million}{\text{million}}     \DeclareSIUnit{\EUR}{\text{\euro}}               \begin{document}     \begin{itemize}         \item What I wrote before \SI{3.5e6}{\EUR}         \item Now: \SI{3.5}{\million\EUR}     \end{itemize}     \end{document}


title: TikZ Function Number Too Big

text: I want to draw two beta distributions comparing a prior and posterior distribution but it seems that the coefficients are too large for LaTeX? How do I fix it without changing the function? It has a few errors including `Dimension too large` and `Number too big`.               \documentclass[10pt]{article}       \usepackage{pgf,tikz}       \usetikzlibrary{arrows}       \pagestyle{empty}       \begin{document}       \definecolor{qqccqq}{rgb}{0,0.8,0}       \definecolor{qqttcc}{rgb}{0,0.2,0.8}       \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=8.333333333333332cm,y=1.0cm]       \draw[->,color=black] (-0.1,0) -- (1.1,0);       \foreach \x in {,0.2,0.4,0.6,0.8,1}       \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};       \draw[color=black] (1.04,0.04) node [anchor=south west] { $\theta$};       \draw[->,color=black] (0,-0.5) -- (0,5.5);         \foreach \y in {,1,2,3,4,5}         \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};       \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};       \clip(-0.1,-0.5) rectangle (1.1,5.5);       \draw[dash pattern=on 1pt off 1pt,color=qqttcc, smooth,samples=100,domain=8.000000000003847E-7:0.9999990727280006] plot(\x,{3682570000*(1-(\x))^(10.67)*(\x)^(21.49)});       \draw[color=qqccqq, smooth,samples=100,domain=8.000000000003847E-7:0.9999990727280006] plot(\x,{2120.93*(1-(\x))^(2.67)*(\x)^(9.49)});       \draw (0.49,4.17) node[anchor=north west] {$g(\theta|D)$};       \draw (0.89,3.23) node[anchor=north west] {$g(\theta)$};       \end{tikzpicture}       \end{document}


title: Counter not working as expected in pgfplot

text: Using pgfplot (for the first time), I try to create a chart with horizontal bars, sort of. See the figure. ![enter image description here](http://i.stack.imgur.com/EN023.png) I know how to do it, but because the code is quite verbose and I have lots of data I've factored out the repetitive parts in a macro called `\labeledRange{beginpos}{endpos}{label}`. I have also used a counter (`vertposition`) to get rid of manually specifying the vertical position (as I want it to increment for each range). However, the counter doesn't behave as I expect when used in a `\node` command in the code below. On the figure above, the labels `LABEL1` and `LABEL 2` should be near the blue and red bar respectively. How can I get this to work? (And, as a tiny other problem, how can I get rid of the 'pin' line?)               \documentclass{article}     \usepackage{pgfplots}          \begin{document}          %\labeledRange{start}{end}{label}     \newcounter{vertposition}     \newcommand{\labeledRange}[3]{       \addplot coordinates {(#1,\arabic{vertposition}) (#2,\arabic{vertposition})};       \node[coordinate, pin=right:{#3}]                at (axis cs:#2,\arabic{vertposition}) {};       \stepcounter{vertposition}       }          \begin{figure}[ht]       \centering       \begin{tikzpicture}         \begin{axis}[xmin=0,xmax=100] %,ytick=\empty]                %using my macro -> label position is wrong           \labeledRange{10}{20}{LABEL 1}           \labeledRange{60}{70}{LABEL 2}                %without macro -> works fine           \addplot coordinates {(20,3) (50,3)};           \node[coordinate, pin=right:{LABEL 3}]                at (axis cs:50,3) {};              \end{axis}            \end{tikzpicture}     \end{figure}          \end{document}


title: \dimexpr \numexpr & calc package

text: Why doesn't this work? I use Windows, TeX Live 2012 and pdfLaTeX               \documentclass{article}          \usepackage{calc}          \newlength{\perclenght}          \setlength{\perclenght}{%                           \dimexpr%                           ((((336pt*675pt)*(100-7.5))/100)/\textwidth)-\textheight%                           \relax%                           }%          \begin{document}     \the\perclenght     \end{document}


title: What is the easiest way to plot a function and its tangent lines at the turning points?

text: I want to plot graphs like this and embed them as `Tikz` or `Pstricks` code in my handouts. I know that there are software such as `Ipe`, `LaTeXDraw` etc. But none of them can satisfy me. Because `Ipe` doesn't give me code and `LaTeXDraw` doesn't give smooth curves. **What is the easiest way to plot graphs like this?**   Please keep in mind that the smoothness of the curve is very important to me. ![enter image description here](http://i.stack.imgur.com/LHTcw.png)


title: Automatically enumerate for two columns and longtable

text: I’m in the middle of creating a test that has several pages. The example below illustrates its structure.               \documentclass[a4paper,9pt]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath, amsfonts, amssymb}     \renewcommand{\rmdefault}{ptm}          \usepackage{longtable}     \usepackage[left=0.5cm, right=0.5cm, top=0.5cm, bottom=0.5cm]{geometry}          % For answer key     \usepackage{color}     \newcommand{\B}[1]{ \noindent{\setlength{\fboxsep}{1pt}\colorbox{black}{\color{white}\textbf{#1}}}}          \begin{document}     \begin{center}       \textbf{Test}\\     \end{center}     Names ………………………………………… id …………………………          \begin{longtable}{p{19cm}|p{1cm}}     \textbf{1.} Question about  &   \textbf{1.} \\     a)  Answer 1    &   a)  \\     b)  Answer 2    &   b)  \\     c)  Answer 3    &   c)  \\     d)  Answer 4 &  d)  \\     \textbf{2.} Question is &   \textbf{2.} \\     a)  Answer 1    &   a)  \\     b)  Answer 2    &   b)  \\     c)  Answer 3    &   c)  \\     d)  Answer 4 &  d)  \\     \textbf{3.} Question be &   \textbf{3.} \\     a)  Calculate 1     &   $\ldots$    \\     b)  Calculate 2 &   $\ldots$    \\     c)  Calculate 3 &   $\ldots$    \\     d)  Calculate 4 &   $\ldots$    \\          \end{longtable}     \end{document}      Is it possible to automatically enumerate questions instead of writing e.g. `\textbf{1.}`? Sometimes I need to delete a question and I have to adjust the numbers manually. The same problem concerns to answers in the right column. My second question is probably little challenging. I create an answer key that looks almost identical as the test. For example for Q1 and Q3 we have ( `\B` is defined in the preamble)               \textbf{1.} Question about  &   \textbf{1.} \\     a)  Answer 1    &   \B{a)}  \\     b)  Answer 2    &   b)  \\     c)  Answer 3    &   c)  \\     d)  Answer 4 &  d)  \\     \textbf{3.} Question be &   \textbf{3.} \\     a)  Calculate 1     &   \B{1.2} \\     b)  Calculate 2 &   \B{2.2} \\     c)  Calculate 3 &   \B{3.2} \\     d)  Calculate 4 &   \B{1}   \\      I would like to create only the template key but with possibility to switch to the test: `\B{a)} --> a)` and `\B{1.2} --> $\ldots$` if in the preamble I change something. I would appreciate any suggestions.


title: Svmono hack. How to change font size in Springer Verlag Class?

text: I am writing my Ph.D. thesis with `svmono` class of Springer-Verlag, but the default size is `10pt` and seems to me too difficult to read. I would like to change to `11pt` or `12pt`. This two option are blocked, so for first i have commented the two line               %\DeclareOption{11pt}{\OptionNotUsed}          %\DeclareOption{12pt}{\OptionNotUsed}        but seems that this is not sufficient. What i have to do? Here is the class definition


title: What does 'double spacing' mean?

text: I think I know the meanings of `\baselineskip`, `\lineskip` and `\lineskiplimit` in TeX, I also know `\baselineskip`, `\baselinestretch`, `\linespread` and the second argument of `\fontsize` in LaTeX. However, I get confused when I meet the phrase 'double spacing' and `setspace` package. The question is, which dimension is doubled? Is it `\baselineskip`, or the skip between bottom and top of the two lines (something like `\lineskip`), or some dimension else? I read the article about leading in Wikipedia. It seems that the original meaning of `leading` is `\lineskip`. In Bringhurst's book ( _The Elements Of Typographic Style_ ), `\baselineskip` is called a basic leading, total leading, while `\lineskip` is the added leading, but they are never doubled. In LaTeX, the basic total leading is the second argument of `\fontsize`, which is set to `\baselineskip`. For example, normal font size is 10pt with 12pt of `\baselineskip`. So, does double spacing mean `\linespread{2}`? Or it implies a 10pt + 2x(12pt-2pt) = 14pt of TeX's `\baselineskip`, say, `\linespread{1.16667}`? Microsoft Word tells me it should be the former. 'Double' line spacing means `\linespread{2}` in LaTeX. ![single spacing VS double spacing in MS Word](http://i.stack.imgur.com/HkIV3.png) (In word, font size 10pt, single spacing gets 12pt baseline skip; double spacing gets 24pt) `setspace.sty` tells me both are wrong. `\doublespacing` is defined as `\setstretch{1.667}`. (The value is slightly changed to fit different `\baselinespace`) That is to say, 'double spacing' means the baseline skip is double length of _font size_. (1.667x12pt = 20pt = 2x10pt.) Why? ![single spacing VS double spacing with setspace](http://i.stack.imgur.com/sAqVr.png) (Using `setspace`, font size 10pt, `\singlespacing` gets 12pt baseline skip; `\doublespacing` gets 20pt) The more I read, the more confused I get. Can anyone help me to clarify the concept?


title: Why the \doublespacing command in LaTeX actually produce 1.6 times spacing? (Compared to Pages '09 4.2, 12pt, Times New Roman)

text: > **Possible Duplicate:**   >  What does ‘double spacing’ mean? Why the `\doublespacing` command in LaTeX actually produce 1.6 times spacing? (Compared to Pages '09 4.2, 12pt, Times New Roman) I am writing an MLA format paper, which requires doublespace 12pt TNR layout. I am using LaTeX to produce my paper, and I find that my lines in paper are more condensed compared to other students' papers, which are typed by What- You-See-Is-What-You-Get word processors (i.e. Microsoft Word, Apple Pages, etc.) After experiments, I find that LaTeX produces approximately 1.6 times spacing, under the standard of Pages. The command I used in LaTeX are:               \usepackage{setspace}     \doublespacing


title: multiple equations with same number

text: I can't seem to make this work. I want the matrix and the second equation with the same equation number.               \begin{equation}     \begin{aligned}     [{\bf Z}] &=\begin{bmatrix}     R_1+j\omega L_1 & -j\omega M \\     j\omega M & -R_2-j\omega L_2     \end{bmatrix} \\     k &=\frac{M}{\sqrt{L_1L_2}}     \end{aligned}        \end{equation}


title: correct the hyphenation

text: How to correct the hyphenation in my paper that is entirely wrong? For example, in my paper, there are wrong hyphenations like _result-s_ , _s-mall_ , _s-pace_ , etc. How can I fix this problem. I don't use any package yet. ![enter image description here](http://i.stack.imgur.com/NfwS2.jpg) Sample Code:               \usepackage[english]{babel}      An alternative way is to add:               \righthyphenmin=3


title: Large negative spaces

text: I know about `\\!` which creates a thin negative space but is there any native command for large negative spaces (like `quad` or `qquad` for positive spaces) ?


title: Table float sits at the bottom, while leaving an empty space in the middle of the page

text: I have trouble arranging the floats on the pages. See for example the screenshot below: Why is it happening like this? there is only this much text in this particular subsection, so why doesn't latex put the table behind the text and start the next subsection? ![screenshot](http://i.stack.imgur.com/Xk0wl.png) table is not restricted to any width.               \begin{table}     \caption{Effect of biofilm density on the drag and oscillation behavior. The     para\-meters used in the simulation are: $L/d=4.5$,  $U_{0}=\SI{0.4}{\meter\per\second}$      ($Re_{D}=133$).\label{tab:Effect-of-biofilm-density}}     \begin{tabular*}{0.8\textwidth}{@{\extracolsep{\fill}}cccc>{\centering}p{0.15\textwidth}}     \toprule      Density (\si{\kilogram\per\cubic\meter}) & $C_{D}$ (-) & Oscillation Frequency (\si{\hertz}) & Amplitude (\si{\micro\meter}) & Strouhal Number (-)\tabularnewline     \midrule      \num{950} & \num{1.2838} & 199.6 & 169 & 0.1662\tabularnewline     \num{1000} & \num{1.2913} & 199.0 & 181 & 0.1658\tabularnewline     \num{1100} & \num{1.2950} & 196.9 & 177 & 0.1639\tabularnewline     \num{1200} & \num{1.2988} & 195.2 & 182 & 0.1625\tabularnewline     \bottomrule     \end{tabular*}     \end{table}      Here is my preambles:               \usepackage{mathptmx}     \renewcommand*{\rmdefault}{ppl}     \renewcommand*{\sfdefault}{ppl}     \newcommand\hmmax{0} % default 3               %\usepackage{floatrow}      \usepackage{xcolor}     \definecolor{darkred}{rgb}{0.667,0.118,0.004}     \definecolor{codebg}{rgb}{0.95,0.95,0.95}     \definecolor{lgreen}{HTML}{b8b60b}          \usepackage[tocgraduated]{tocstyle}      \usetocstyle{nopagecolumn}                \usepackage{prettyref}     \newrefformat{eq}{Equation~\textup{(\ref{#1})}}     \newrefformat{chap}{Chapter~\ref{#1}}     \newrefformat{sec}{Section~\ref{#1}}     \newrefformat{sub}{Section~\ref{#1}}     \newrefformat{tab}{Table~\ref{#1}}     \newrefformat{fig}{Figure~\ref{#1}}               % schönerer Blocksatz!!     \usepackage{microtype}               \@ifpackageloaded{nomencl}{     \renewcommand{\nomname}{List of Notations}     \renewcommand*{\pagedeclaration}[1]{\unskip\dotfill\hyperpage{#1}}     }{}          %\setlength{\nomitemsep}{-\parsep}               %todo notes     \usepackage[colorinlistoftodos]{todonotes}     \newcommand{\todog}[1]{\todo[color=lgreen]{#1}}     \newcommand{\todor}[1]{\todo[color=red!40]{#1}}     \newcommand{\todob}[1]{\todo[color=blue!40]{#1}}     %/todo notes          \usepackage[]{titlesec}     \titleformat{\chapter}[display]{\scshape\small}{\filleft\rmfamily\fontsize{72pt}{10pt}\selectfont\textcolor{darkred}\thechapter}{1ex}{\rmfamily\Huge\itshape\filleft}[\vspace{2ex}]               \usepackage{booktabs}          %mass transfer paper     \usepackage{siunitx}      \sisetup{inter-unit-product={}\cdot{},number-unit-product = \;}     %end mass transfer paper               %show vectors in bold     \usepackage{bm}     \DeclareRobustCommand\vec[1]{%       \ifcat\noexpand#1\relax         \expandafter\bm       \else         \expandafter\mathbf       \fi{#1}}     %end renew commands               \usepackage[indention={.5cm},font={small,rm},format={plain},labelfont={rm,bf,up},textfont={rm,up}]{caption}          %-------center everything----------[     \usepackage{ifthen}          \renewenvironment{figure}[1][]{%      \ifthenelse{\equal{#1}{}}{%        \@float{figure}      }{%        \@float{figure}[#1]%      }%      \centering     }{%      \end@float     }               \renewenvironment{table}[1][]{%      \ifthenelse{\equal{#1}{}}{%        \@float{table}      }{%        \@float{table}[#1]%      }%      \centering     }{%      \end@float     }     %]----------centering-------------     \@ifpackageloaded{nomencl}{     \renewcommand{\nomname}{List of Symbols}     \renewcommand{\nomgroup}[1]{%     \ifthenelse{\equal{#1}{A}}{\item[\textbf{Roman Symbols}]}{%     \ifthenelse{\equal{#1}{G}}{\item[\textbf{Greek Symbols}]}{%     \ifthenelse{\equal{#1}{C}}{\item[\textbf{Abbreviations}]}{%     \ifthenelse{\equal{#1}{S}}{\item[\textbf{Subscripts}]}{%     \ifthenelse{\equal{#1}{T}}{\item[\textbf{Superscripts}]}{     \ifthenelse{\equal{#1}{Z}}{\item[\textbf{Mathematical Symbols}]}     {}     }% matches mathematical symbols     }% matches Subscripts     }% matches Superscripts     }% matches Abbreviations     }% matches Greek Symbols     }% matches Roman Symbols     }{}               % for correct jump positions whe clicking on a link to a float     %\usepackage[figure]{hypcap}          \definecolor{chaptercolor}{rgb}{.176,0,.367}          \addtokomafont{chapter}{\color{darkred}}     \addtokomafont{part}{\color{darkred}}     \addtokomafont{section}{\rmfamily\itshape}     \addtokomafont{subsection}{\rmfamily\itshape}     \addtokomafont{paragraph}{\normalfont\upshape\rmfamily\itshape}                              \renewcommand*{\addparttocentry}[2]{%       \addcontentsline{toc}{part}{\partname\nobreakspace \protect\numberline{#1}#2}%     }               \usepackage{verbatim} % Mostly for the comment environment.     \newenvironment{mylisting}     {\begin{list}{}{\setlength{\leftmargin}{1em}}\item\scriptsize\bfseries}     {\end{list}}     \newenvironment{mytinylisting}     {\begin{list}{}{\setlength{\leftmargin}{1em}}\item\tiny\bfseries}     {\end{list}}               \usepackage{bigints}     \usepackage[font=small]{idxlayout}               %ornament     \usepackage{fourier-orns}     \newcommand*\myhrulefill{%        \leavevmode\leaders\hrule depth-2pt height 2.4pt\hfill\kern0pt}     \newcommand\niceending[1]{%       \begin{center}%         \LARGE -------------------- \hspace{0.2cm} #1 \hspace{0.2cm} --------------------%       \end{center}}     \newcommand*\nicesectionending{\niceending{\decofourright\decofourleft}}     \newcommand*\nicesubsectionending{\niceending{\aldinesmall}}     %/ornament               \usepackage{tikz}          \newenvironment{elaboration}{%         \par         \begin{tikzpicture}         \node[rectangle,minimum width=0.9\textwidth] (m)         \bgroup\begin{minipage}{0.85\textwidth}%     }{%         \end{minipage}\egroup;         \draw[dashed] (m.south west) rectangle (m.north east);         \end{tikzpicture}     }               \usepackage[section]{placeins}          \clubpenalty = 10000     \widowpenalty = 10000      and here is the minimal working example:               %% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \documentclass[12pt,oneside,english,titlepage, a4paper, fontsize=12pt]{scrbook}     \usepackage{mathpazo}     \usepackage{helvet}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \usepackage[a4paper]{geometry}     \geometry{verbose,tmargin=2.5cm,bmargin=3.5cm,lmargin=2.5cm,rmargin=2.5cm}     \pagestyle{plain}     \setcounter{secnumdepth}{3}     \usepackage{color}     \usepackage{babel}     \usepackage{array}     \usepackage{booktabs}     \usepackage{setspace}     \onehalfspacing               \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     %% Because html converters don't know tabularnewline     \providecommand{\tabularnewline}{\\}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     \input{preambles/common.sty}     \usepackage{blindtext}          \makeatother          \begin{document}          \section{This is a title}          \blindtext          \begin{table}     \caption{Effect of biofilm density on the drag and oscillation behavior. The     para\-meters used in the simulation are: $L/d=4.5$,  $U_{0}=\SI{0.4}{\meter\per\second}$      ($Re_{D}=133$).\label{tab:Effect-of-biofilm-density-1}}     \begin{tabular*}{0.8\textwidth}{@{\extracolsep{\fill}}cccc>{\centering}p{0.15\textwidth}}     \toprule      Density (\si{\kilogram\per\cubic\meter}) & $C_{D}$ (-) & Oscillation Frequency (\si{\hertz}) & Amplitude (\si{\micro\meter}) & Strouhal Number (-)\tabularnewline     \midrule      \num{950} & \num{1.2838} & 199.6 & 169 & 0.1662\tabularnewline     \num{1000} & \num{1.2913} & 199.0 & 181 & 0.1658\tabularnewline     \num{1100} & \num{1.2950} & 196.9 & 177 & 0.1639\tabularnewline     \num{1200} & \num{1.2988} & 195.2 & 182 & 0.1625\tabularnewline     \bottomrule     \end{tabular*}     \end{table}                    \section{This is another title}          \blindtext     \end{document}


title: Behavior of starred section in beamer

text: In a LaTeX article, `\section*` behaves like this:               \documentclass[12pt]{article} \begin{document}     \section*{Not numbered} \thesection % --> 0     \section{Numbered} \thesection % --> 1     \end{document}      However, with beamer the following happens:               \documentclass[12pt]{beamer} \begin{document}     \section*{Not numbered} \frame{\thesection}  % --> 1     \section{Numbered} \frame{\thesection} % --> 2     \end{document}      Why is this? Could I correct this behaviour? Now, what I actually need is a command `\secnr` for beamer that will print nothing when in a starred section and the correct -viz. documentclass article- numbering in unstarred sections. So that would require:   1. Fixing the numbering misbehavious in beamer   2. An `if` to test "if current section is starred ..."  A solution to either (or both) of these problems would be very welcome.


title: How to insert hebrew In backround (with Tikz) in Lyx

text: I try to do a background with a text on the top right corner of the page (with borders and page number) I succeeded in creating it but I want to insert a hebrew text (it renders english the way I typed it), I tried to put it in the ERT or outside, with verious commends I found but didn't succeed I added my code and the preamble below (I use the "culmus" package to type hebrew and it works). Thank You.                   Preamble:          \usepackage{culmus}             %not to write if using Lyx, there is an installation                                                              %in the link http://wiki.lyx.org/Windows/Hebrew but                                     % I must mention it stoped working for me when I                                                   %  updated to the last version of Lyx and MikTex,                                        % but works fine on version 2.6         \usepackage[final]{pdfpages}         \usepackage{changepage}         \usepackage{tikz}         \usepackage{lastpage}     \date{}     \usepackage[placement=top,angle=0,color=black,scale=4,hshift=60,vshift=-5]{background}     \usepackage[a4paper,top=3cm,bottom=0.5cm,right=2cm,left=2cm,heightrounded]          {geometry}          \domcument class{article}     %not to write if using Lyx          ERT:                  \usetikzlibrary{calc}         \usetikzlibrary{backgrounds}         \backgroundsetup{contents={\begin{tikzpicture}[overlay,remember picture]         \draw [xshift=4mm,color=black,line width=1pt,rounded corners=7pt]($ (current page.north west) + (0.3cm,-0.3cm) $) rectangle ($ (current page.south east) + (-0.3cm,0.3cm) $);         \end{tikzpicture}          \begin{tikzpicture}[overlay]         \draw[color=black] (0,-2.5) rectangle (-1.3,-0.7);          \draw[color=black] (-0.9,-1.1) node {\large\thepage};         \draw[color=black] (-0.4,-2.1) node {\large\pageref{LastPage}};         \draw[color=black] (-0.2,-0.9) -- (-1.1,-2.3);         \draw[color=black] ($ (current page.north east) + (-4.5cm,-0.7cm) $) node {I originally wanted to put the text here};         \end{tikzpicture}},placement=center,angle=0,opacity=1,scale=1,position =current page.north west }         \pagestyle{empty}     and of ERT     \begin{document}   %not to write if using Lyx     some text     \end{document}     %not to write if using Lyx     ERT: \newpage      the last ERT (`\newpage`) needed for the page to render for some reason


title: How to center the titleframe in Hannover theme (beamer)?

text: I am using the Hannover theme in beamer and I am using the title frame as plain               \documentclass{beamer}     \mode<presentation>     {       \usetheme{Hannover}%{CambridgeUS}%       \setbeamercovered{transparent}     }          \title[Title]{Centering Title frame}     \author[Gopi]{Gopi}          \begin{document}     \begin{frame}[plain]         \titlepage         \begin{figure}         \begin{center}             \includegraphics[scale=0.3]{logo}         \end{center}         \end{figure}     \end{frame}     \end{document}      ![picture of frame title not centered](http://i.imgur.com/CZtzu.png) ![picture of frame title without "plain" not centered](http://i.imgur.com/tMCDL.png) Because it was not obvious on the first picture (white on white, I have added the same picture without the option "plain" on the frame). My point is that I would like that with the option plain the frame forget about the hannover theme and centers the whole frame. I tried to put a \hspace{-xpt} before the frame but it did not seem to work.


title: Problem putting answers in a macro

text: I want to put the `\begin{sol}` and `\end{sol}` from the answers package in a macro like               \newcommand{\assignment}[2]     {     \item #1     \begin{sol} #2 \end{sol}     }          ###          \assignment{question}{answer}      It's just that answers use a verbatim environment that makes it miss the `\end{sol}` if it isn't written in the 'main' function. Is there any way to use the `\expandafter`,`\csname` or such commands to let it just print the `\begin{sol} #2 \end{sol}` and then expand it after it has been printed in the main document?


title: Makking appendices doesn’t work

text: I’m writing my thesis, and I seeming to be having a problem with the appendix. Here’s an MWE of my code:               \documentclass{report}          \usepackage[portuguese]{babel}     \usepackage{hyperref}     \usepackage{appendix}          \begin{document}          \begin{appendices}          \chapter{My first appendix}          My first appendix sentence.          \end{appendices}          \end{document}       When I run this document with WinEdit, I get an error: ![enter image description here](http://i.stack.imgur.com/dUsTg.png) How can I fix this problem?


title: h- and v- phantom a tikzpicture

text: I try to hide a tikzpicture : Depending on a boolean, I want to see or not the tikzpicures of a document (show them on display, but hide them on paper) in order to students draw them. The hidden tikzpicture as to leave its blank space. `\vpanthom` or `\hphantom` don't work.


title: Horizontally centering three images on the middle one

text: Often, in the title page of a beamer presentation, I have to show three logos and some of them are not square images. I would like for the middle one to be centered horizontally and the other two to "fill" the rest of the space to the left and to the right, respectively. Latex insists in centering the whole group of three images. How can I change this behavior?                                 -------------------     --------          |                 |         --------------     |      |          |  this image is  |         |            |     |      |          | centered on the |         |            |     --------          |      slide      |         --------------                       -------------------


title: alpha-style citation callout without year

text: I'm writing a draft and I'm not quite happy with the bibliography style. My code looks like this:               \documentclass[12pt,a4paper]{report}     \usepackage[latin1]{inputenc}     \usepackage{cite}               \begin{document}     \cite{ABC}          \bibliographystyle{alpha}     \bibliography{bibliography.bib}     \end{document}      After compiling the documnt has output [ABC10], where 2010 is the year the paper was published. But I'd like to drop the year in the text, so that it looks like [ABC]. How could I do that? edit: ABC are the initials of the three authors.


title: Description of a chapter in a page

text: I would like to decorate my headlines (section, subsection, etc.) by adding foreach a chapter a description area. This picture is a screenshot document where the headline has the formating, layout and color I want.![enter image description here](http://i.stack.imgur.com/fWT60.png) How I can achieve this? Any help would be much appreciated.


title: Writing long email address in a footnote

text: I am writing a `twocolumn` document. But the problem is the author's email is split in to two lines with a hyphen. How can I remove the hyphen from the email? **MWE**               \documentclass[twocolumn]{article}     \usepackage{lipsum}     \title{Something}     \author{Author\thanks{department name, institute name with details- abcdefghijklmnopqr@xyz.com}}          \begin{document}     \maketitle     \end{document}          \maketitle     \lipsum[2-5]     \end{document}      **Screenshot** ![](http://i.stack.imgur.com/FmP3i.png)


title: multiple indexing

text: > **Possible Duplicate:**   >  How can I have 2 or more distinct indexes in LaTeX? I would like to have 3 index sections: one for the biological species, second for chemicals and the third for other contents). The question   1. is should i have a single index with together two as appendix?   2. is it possible to have 3 index categories. In any case, i would like to have an example file with usage.


title: How to properly subscript in a superscripted fraction?

text: the title says it all. It attached a MWE to display the different relative sizes of a subscript within a normal fraction and a superscripted fraction. As you can see, in the superscripted fraction the subscripted letters have the same size as the other letters. How can I change them to be smaller?                 \documentclass[a4paper]{article}       \usepackage{amsmath}       \begin{document}         $e^\frac{E_{A}}{k_{B} T}$         $\frac{E_{A}}{k_{B} T}$       \end{document}


title: post_linebreak_filter and glyph analysis

text: When calling a function with a `post_linebreak_filter` callback, the nodelist only contains nodes of type 0 (hlist), 10 (glue) and 12 (penalty), whereas when using a `pre_linebreak_filter` callback, type 37 (glyph) nodes are also sent. Is there a way to analyze glyph nodes of a paragraph after the paragraph has been rendered (in order to insert PDF annotations)?


title: What, if anything, is the advantage of \bigskip and friends over \vspace?

text: What are the advantages to using `\bigskip`, `\medskip`, and `\smallskip` instead of just using `\vspace{somelength}`?


title: Custom Tikz arrowhead with bar before triangle 45

text: How do I make a custom arrowhead in Tikz having a perpendicular bar before a triangle 45? I would also like to adapt this solution to a bar before a square, open square, etc. For example, imagine arrow coming from (0,0) to (10,0), then the arrowhead would be a filled triangle roughly (9,1) -- (10, 0) -- (9, -1). I want to add a bar, which is a filled rectangle roughly (8.5,1) -- (8.6, 1) -- (8.6, -1) -- (8.5, -1). I guess I can use `pgfdeclarearrow` to declar a bar somehow and then `pgfarrowsdeclarecombine*` to combine it with existing arrows?


title: error message in beamer

text: I am making slides for a presentation on beamer and everything was going perfect. However, all of a sudden I cannot compile and I get the following error messsage: "! Text line contains an invalid character. l.1" Please help, my presentation is in 5 days!!! Everything was fine until my computer made a an automatic windows update


title: External inline filters, markdown, latex, beamer, and standards

text: I read Converting Markdown to LaTeX, in LaTeX and a couple of related posts. They are about a year old. is there now a quasi-standard package that enables generic filter plugins, allowed if \write18 is enabled? I mean               \begin{filter}{pandoc -o tex}        ...     \end{filter}      filter should be standard unix filtering from stdin to stdout, and preferably without slow temporary files or preprocessing. given such a filter package, if it defined               \newenvironment{md}{\begin{filter}{pandoc -o tex}}{\end{filter}}     \newenvironment{mdframe}[2]{\begin{frame}[#1]{#2} \begin{md}}{\end{md}}      then the emacs auctex maintainers may support this eventually, too. (actually, this is why I think this could/should be part of the standard filter.sty .) it does not seem a good idea for amateurs to hack their own versions for something that solves a class of fairly common problems and goes deep into the OS/latex interface. having this designed by the pros and having it standard would be a blessing. is this in the cards?