title: What is the common order for variables, constants and numbers in math typesetting?

text: I am setting my documents in LaTeX and am satisfied with the appearance of the output. Besides this, I am always in doubt how I have to arrange variables, constants and numbers. Let's talk about the following example:               \begin{align*}     F &= \frac{\textrm{d}W^{'}_{\textrm{mag}}}{\textrm{d}x} \\     &= -\frac{N^2 I^2 \mu_0 a d}{8e^2}.     \end{align*}      Is there a rule which variable or constant should come first? Is it better to place points (like `\cdot`) between those variables? Do I order the symbols alphabetically and how do I deal with capital letters?


title: Sub and superscript on the left

text: I want to do something like this:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \begin{align*}        Hom_{K\cap {}_a^bK}       \end{align*}     \end{document}      But there seems that the `_a^b` is on the `\cap` and not attached to the `K`. How might I do this right?


title: approximation symbol with a letter under it

text: How to write the (approximation iniquity) with a letter under it on latex?   ![enter image description here](http://i.stack.imgur.com/gd5UJ.png)


title: What's special about \def\\ vs. \def\mksp?

text: In the following definitions, `\\` captures a space token but `\mksp` does not.               \documentclass{article}     \begin{document}     {\def\\{\global\let\sp= } \\ }     {\def\mksp{\global\let\spx= } \mksp }     \show\sp     \show\spx     \end{document}      When run, the output indicates that `\sp` is a space token but `\spx` is `}`.               > \sp=blank space  .     l.5 \show\sp          ?     > \spx=end-group character }.     l.6 \show\spx      Why is the `\\` special? Where does Knuth discuss this in the TeXbook?


title: Why renew section make \ref comand to section labels do not work?

text: An example.               \documentclass{article}     \renewcommand{\section}[1]{\medskip \addtocounter{section}{1}\raggedright \textbf{\Roman{section}. \ #1}\medskip}          \begin{document}     \section{First Section}          In \ref{secsec} happens nothing.          \section{Second Section}     \label{secsec}     \end{document}      Instead of reading "In 1.1 happens nothing." it reads "In happens nothing." Why?


> **Possible Duplicate:**   >  Simple Author, affiliation and email example fails in RevTex4-1 I am using revtex for APS and the first author does not have an affiliation. How do I get it to not type a "1" after her name? If I write this:               \author{NameA}     \affiliation{}     \author{NameB}     \affiliation{X University)      I get a superscript "1" after nameA and then a "1" listed below it with no text. If I delete the affiliation line for her:               \author{NameA}     \author{NameB}     \affiliation{X University)      It gives both authors the same affiliation. What do I do? Thanks!


title: Embedding a WMV file in a beamer presentation under Mac OS X

text: In brief, I have created a `beamer` presentation that contains an embedded WMV file. Acrobat Reader, however, does not recognise the format of the file under Mac OS, and refuses to play it under Windows. Any suggestions on how to resolve this would be appreciated. To describe the problem in more detail, I recently used the following LaTeX source to create a `beamer` presentation that embeds a WMV file.               \documentclass[]{beamer}          \usepackage{movie15}     \usepackage{hyperref}     \usepackage{graphicx}          \title{A Tiny Movie Example}     \author{Beamer Author}     \date{Sept 10, 2011}          \begin{document}          \begin{frame}       \frametitle{Sample Movie Clip}       \begin{figure}[ht]         \includemovie[poster,text={\includegraphics[width=8cm, height=6cm]           {bbb-splash-thumb.png}},autoplay,mouse=true]{8cm}{6cm}           {bbb.wmv}       \end{figure}     \end{frame}          \end{document}      While I had no problem compiling it, I did have a problem presenting it since Adobe Acrobat Reader required to download an additional media player (under Mac OS) in order to play the media file embedded in the PDF file. Under Windows, it got as far as the Windows Media screen, and stopped right there. When I attempted to download the plug-in that would allow me to play the WMV file on the Mac, I received the following notification stating that the third- party media player required to play the selected media file in my Adobe PDF document isn't available for my system. http://www.adobe.com/special/acrobat/nomediaplayer.html To circumvent this problem, I ended up downloading flip4mac, thinking that it will resolve my issue. Acrobat Reader, however, did not recognize the plug-in for QuickTime that allows it to display WMV files. When I posted a message on the forum for Adobe Reader about this, the reply that I received is as follows:               Putting it bluntly, you shouldn't be embedding WMVs in PDF files anymore -     it's called "legacy media" and it's been discontinued for security reasons.     You can't author it in Acrobat X, and playback is disabled in all current     versions of Acrobat and Adobe Reader unless the user changes their security     options. Authors should be using Rich Media annotations, which embed FLV or     H.264 video and play cross-platform via an internal copy of Flash Player.          The weblink fired by Reader when it encounters legacy media for which the OS has     no registered handler understands that you're on a Mac - and as there are no     primary players for WMV files on OS X, that's what it tells you. Adobe does not     link to third-party add-ons for other software, and even with those installed it     will continue to complain unless the add-on has changed the file type     associations, so that WMV files +automatically+ open in Quicktime.      As I have no idea about Rich Media annotations, or H.264 video for that matter, can somebody please provide me with an example of how this is done under `beamer`?


title: amsthm: how to reduce the vertical spacing between theorem and proof?

text: I'm using the amsthm package to layout theorems and their proofs. How can I reduce the vertical spacing between the last line of the theorem statement and the first line of the proof? BTW, I tried achieving this by fiddling with the third parameter to               \newtheoremstyle{mystyle}{4ex}{-4ex}{}{}{\bfseries}{.}{3ex}{}      ...but even negative values (as illustrated above) failed to bring the first line of the proof closer than a certain fixed distance of about 2.5 line heights. A related question: how can I prevent pagebreaks between the theorem and the proof? I would like to ensure that at least two lines from the theorem statement precede the first line of a proof on a page. (One may fairly assume that there is no text interposed between the last line of the theorem statement and the first line of the proof.)


title: Using the commands \pgfmathparse and \pgfmathresult

text: How do I use the commands `\pgfmathparse {tan (pi/3 r)} \pgfmathresult` to draw the green line in the figure below?               \begin{tikzpicture}[>=latex,scale=2]     \draw circle (1);     \draw[->] (-1.2,0) -- (1.2,0) coordinate (x);     \draw[->] (0,-1.2) -- (0,1.2);          \fill[fill=green!25] (0,0) -- (.2,0) arc (0:60:.2) -- cycle;     \draw (0,0) -- (60:1);     \draw[<-,red,line width=1pt] (60:1) -- (60:1 |- x);     \draw (0,0) -- (60:2);     %tangent     \draw[<-,green,line width=1pt] (60:2) -- (1,0);     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/7FtiX.png)


title: Through enumeration

text: I would like to have problems be consecutively numbered throughout a book, irrespective of the chapters and sections where they appear. E.g.               Chapter 1     [Text]     1. Some problem     Section 1     2. Some problem     [Text]     Section 2     3. Some problem     Etc      What's the easiest way to do this?


title: Disable parenthesis in ieee style biblatex

text: MWE:               \documentclass{article}     \usepackage[english]{babel}     \usepackage{csquotes}     \usepackage[style=ieee,backend=biber,sortcites]{biblatex}     \addbibresource{ref.bib}          \begin{document}     Refs. \cites{Yang10,Yang09}\\     \end{document}      The output is `[(1),(2)]`. How to remove parenthesis here? I see the output is [1, 2] in `numeric-comp` but I don't see in `ieee.cbx` where this parenthesis is added.


title: 3 * 2 figures in one page

text: I have to place six figures in one page. There are three lines and two columns. Each figure have a subcaption. For this 3 * 2 figure, it has a caption too. Thanks in advance. I try this. But it does work. So I have not add caption yet.               \begin{figure}[H]         \centering         \subfloat[]{             \begin{minipage}{\linewidth}                 \includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{1.eps}          \includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{2.eps}                  \end{minipage}}          \subfloat[]{             \begin{minipage}{\linewidth}                 \includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{3.eps}         \includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{4.eps}              \end{minipage}}          \subfloat[]{             \begin{minipage}{\linewidth}                 \includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{5.eps}          \includegraphics[width=0.5\linewidth, height = 0.2\textheight, keepaspectratio=true]{6.eps}          \label{fig mmmf d}             \end{minipage}}       \end{figure}


title: Formatting for glossaries

text: I am new so please go easy :-). I am using the `\glossaries` package to make my acronym page. I have defined only acronyms. What I want is to make the description of the acronym in a separate column and left aligned. The `style=super` option does this but it seems to shrink the column so it does not take up the pagewidth. Please see attached document. The other problem is that it is being spread over two pages. i think the culprit is `\baselineskip=22pt plus1pt`. I was told this is to get the document double spaced, I am a novice to latex. Is there another option for this? my MWE is below and the output attached. Thanks               documentclass[a4paper,12pt]{report}           \usepackage[nopostdot,  style=super, nonumberlist, toc]{glossaries}          \makeglossaries           \begin{document}     \baselineskip=22pt plus1pt          \printglossary[title={List of Abbreviations}]          \newpage          \gls{ngml}          \newacronym{ngml}{$\eta$g/mL}{nanogram per millilitre}          \end{document}      ![Page 1](http://i.stack.imgur.com/EmUzE.jpg) ![Page 2](http://i.stack.imgur.com/8cCBt.jpg)


title: Argument of setkeys

text: My motivation bases on the package `listings` (also my package `mdframed`). The package allows to define a style via `\lstset{foo}{options}`. Now I want to create a macro to expand the style `foo`. For example `\Apptolstset{foo}{more options}`. I created the followings example.               \documentclass{article}     \usepackage{filecontents}     \begin{filecontents}{testpackage.sty}     \ProvidesPackage{testpackage}     \RequirePackage{etoolbox,kvoptions}     \SetupKeyvalOptions{family=test,prefix=test@}     \DeclareStringOption[\bfseries]{font}     \DeclareStringOption[\normalsize]{size}     \ProcessKeyvalOptions*\relax     \newcommand\testsetup{\setkeys{test}}          \define@key{test}{loadstyle}{%       \ifcsundef{test@style@#1}{}%             {\expandafter\testsetup\expandafter{\csname test@style@#1\endcsname}}%     }     \newrobustcmd*\teststyle[2]{%       \csdef{test@style@#1}{#2}%     }          \newrobustcmd*\apptodefinestyle[2]{%      \ifcsundef{test@style@#1}%        {}%        {\csappto{test@style@#1}{,#2}}%     }               \newrobustcmd*\testresult[1]{{\test@font\test@size #1}}     \end{filecontents}     \usepackage{testpackage}     \begin{document}     Hello World!     \testresult{Hello World!}          \teststyle{new}{font=\bfseries\itshape}     \apptodefinestyle{new}{size=\Large}     \testsetup{loadstyle=new}          \testresult{Hello World!}          \end{document}      The error of this example is:               ! Missing \endcsname inserted.     <to be read again>     \protect     l.35 \testsetup{loadstyle=new}     The control sequence marked <to be read again> should     not appear between \csname and \endcsname.      If I use the combination               \define@key{test}{loadstyle}{%       \ifcsundef{test@style@#1}{}%             {\csuse{test@style@#1}}%     }     \newrobustcmd*\teststyle[2]{%       \csdef{test@style@#1}{\testsetup{#2}}%     }      everything will work. But with this combination I don't know how to define the command `\apptoteststyle` which should be expand the current style. I hope the question is clear.


title: BibLaTeX backref links to wrong page using hyperref

text: I'm trying to use the backref option of BibLaTeX for back-referencing, but the pages in the bibliography link to the wrong pages (even though the pages listed are correct). The link appears to be systematically about 12 pages early (corresponding to the length of the frontmatter). Backref should be able to correctly link to a given page number, because the frontmatter is numbered with roman numerals whereas the mainmatter is numbered with arabic numerals, so the page numbers are unique (and I'm using the `plainpages=false` option of hyperref, as suggested here: Why does backref refer to wrong page?). I tried to come up with a MWE, but I wasn't able to reproduce the error with a smaller example. Here's a fairly full example (I had to remove the comments to make it fit). Contents of Thesis.tex:               \documentclass[11pt, a4paper, oneside]{Thesis}          \graphicspath{{./Figures/}}          \hypersetup{urlcolor=blue, colorlinks=true, plainpages=false}     \title{\ttitle}          \usepackage[style=authoryear-comp,citetracker=true,natbib=true,hyperref=true,backend=biber,maxbibnames=99,maxcitenames=2,firstinits=true,uniquename=init,parentracker=true,backref=true,backrefstyle=three]{biblatex}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @misc{A01,       author = {Author, A. and Buthor, B. and Cuthor, C.},       year = {2001},       title = {Alpha},     }     @misc{A02,       author = {Duthor, D. and Euthor, E. and Futhor, F.},       year = {2010},       title = {Beta},     }     \end{filecontents}          \addbibresource{\jobname.bib}          \DeclareNameAlias{sortname}{last-first}          \renewbibmacro{in:}{}          \AtEveryBibitem{       \clearfield{month}{}       \clearlist{language}{}       }          \let\citealp\cite     \let\cite\textcite          \setlength\bibitemsep{0.5ex}     \setlength\bibnamesep{1.2ex}          \renewbibmacro*{volume+number+eid}{       \setunit*{\addcomma\space}       \textit{\printfield{volume}}       \textit{\printfield{number}}       \printfield{eid}}       \DeclareFieldFormat[article]{number}{(#1)}          \DefineBibliographyStrings{english}{     backrefpage={cited on p\adddot},     backrefpages={cited on pp\adddot}     }          \DeclareFieldFormat{pages}{#1}          \DeclareFieldFormat[article]{title}{#1}     \DeclareFieldFormat[incollection]{title}{#1}     \DeclareFieldFormat[unpublished]{title}{#1}          \setcounter{biburllcpenalty}{7000}     \setcounter{biburlucpenalty}{8000}          \AtEveryCitekey{       \ifciteseen{}{\defcounter{maxnames}{6}\clearfield{namehash}}}          \AtBeginBibliography{       \renewcommand*{\finalnamedelim}{         \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}         \addspace\&\space}     }          \let\origparencite\parencite     \renewrobustcmd{\parencite}{       \AtNextCite{       \renewcommand*{\finalnamedelim}{         \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}         \addspace\&\space}       }       \origparencite     }          \makeatletter     \renewbibmacro*{cite}{       \iffieldundef{shorthand}         {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}            {\printtext[bibhyperref]{               \DeclareFieldAlias{bibhyperref}{default}               \usebibmacro{cite:label}               \setunit{\addspace}               \usebibmacro{cite:labelyear+extrayear}}               \usebibmacro{cite:reinit}}            {\iffieldequals{namehash}{\cbx@lasthash}               {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND                            \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}                  {\setunit{\addcomma}                   \usebibmacro{cite:extrayear}}                  {\setunit{\compcitedelim}                   \usebibmacro{cite:labelyear+extrayear}                   \savefield{labelyear}{\cbx@lastyear}}}               {\printtext[bibhyperref]{                  \DeclareFieldAlias{bibhyperref}{default}                  \printnames{labelname}                  \setunit{\nameyeardelim}                  \usebibmacro{cite:labelyear+extrayear}}                  \savefield{namehash}{\cbx@lasthash}                  \savefield{labelyear}{\cbx@lastyear}}}}         {\usebibmacro{cite:shorthand}          \usebibmacro{cite:reinit}}       \setunit{\multicitedelim}}          \renewbibmacro*{textcite}{       \iffieldequals{namehash}{\cbx@lasthash}         {\iffieldundef{shorthand}            {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND                         \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}               {\setunit{\addcomma}                \usebibmacro{cite:extrayear}}               {\setunit{\compcitedelim}                \usebibmacro{cite:labelyear+extrayear}                \savefield{labelyear}{\cbx@lastyear}}}            {\setunit{\compcitedelim}             \usebibmacro{cite:shorthand}             \global\undef\cbx@lastyear}}         {\ifnameundef{labelname}            {\printtext[bibhyperref]{               \DeclareFieldAlias{bibhyperref}{default}               \iffieldundef{shorthand}                 {\usebibmacro{cite:label}                  \setunit{                    \global\booltrue{cbx:parens}                    \addspace\bibopenparen}                  \ifnumequal{\value{citecount}}{1}                    {\usebibmacro{prenote}}                    {}                  \usebibmacro{cite:labelyear+extrayear}}                 {\usebibmacro{cite:shorthand}}               \ifthenelse{\iffieldundef{postnote}\AND                           \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}                 {\bibcloseparen                  \global\boolfalse{cbx:parens}}                 {}}}            {\printtext[bibhyperref]{               \DeclareFieldAlias{bibhyperref}{default}               \printnames{labelname}               \setunit{                 \global\booltrue{cbx:parens}                 \addspace\bibopenparen}               \ifnumequal{\value{citecount}}{1}                 {\usebibmacro{prenote}}                 {}               \iffieldundef{shorthand}                 {\iffieldundef{labelyear}                    {\usebibmacro{cite:label}}                    {\usebibmacro{cite:labelyear+extrayear}}                  \savefield{labelyear}{\cbx@lastyear}}                 {\usebibmacro{cite:shorthand}                  \global\undef\cbx@lastyear}               \ifthenelse{\iffieldundef{postnote}\AND                           \(\value{multicitetotal}=0\AND\value{citetotal}=1\)}                 {\bibcloseparen                  \global\boolfalse{cbx:parens}}                 {}}               \savefield{namehash}{\cbx@lasthash}}}       \setunit{         \ifbool{cbx:parens}           {\bibcloseparen\global\boolfalse{cbx:parens}}           {}         \multicitedelim}}          \makeatother          \usepackage{units}     \usepackage{titlesec}     \usepackage{tabu}      \usepackage{threeparttablex}     \usepackage{rotating}     \usepackage{lscape}     \usepackage{multirow}     \usepackage{afterpage}     \usepackage{hyperref}          \setcounter{secnumdepth}{4}     \setcounter{tocdepth}{4}          \usepackage[]{graphicx}     \usepackage[]{color}          \makeatletter     \def\maxwidth{       \ifdim\Gin@nat@width>\linewidth         \linewidth       \else         \Gin@nat@width       \fi     }     \makeatother          \definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}     \newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}     \newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}     \newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}     \newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}     \newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}     \newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}     \newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}     \newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}     \newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}          \usepackage{framed}     \makeatletter     \newenvironment{kframe}{      \def\at@end@of@kframe{}      \ifinner\ifhmode       \def\at@end@of@kframe{\end{minipage}}       \begin{minipage}{\columnwidth}      \fi\fi      \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep      \colorbox{shadecolor}{##1}\hskip-\fboxsep          \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}      \MakeFramed {\advance\hsize-\width        \@totalleftmargin\z@ \linewidth\hsize        \@setminipage}}      {\par\unskip\endMakeFramed      \at@end@of@kframe}     \makeatother          \definecolor{shadecolor}{rgb}{.97, .97, .97}     \definecolor{messagecolor}{rgb}{0, 0, 0}     \definecolor{warningcolor}{rgb}{1, 0, 1}     \definecolor{errorcolor}{rgb}{1, 0, 0}     \newenvironment{knitrout}{}{}          \usepackage{alltt}     \IfFileExists{upquote.sty}{\usepackage{upquote}}{}          \begin{document}          \frontmatter          \setstretch{1.3}          \fancyhead{}     \rhead{\thepage}     \lhead{}          \pagestyle{fancy}          \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}          \hypersetup{pdftitle={\ttitle}}     \hypersetup{pdfsubject=\subjectname}     \hypersetup{pdfauthor=\authornames}     \hypersetup{pdfkeywords=\keywordnames}          \begin{titlepage}     \begin{center}          \textsc{\LARGE \univname}\\[1.5cm]     \textsc{\Large Doctoral Thesis}\\[0.5cm]          \HRule \\[0.4cm]     {\huge \bfseries \ttitle}\\[0.4cm]     \HRule \\[1.5cm]          \begin{minipage}{0.4\textwidth}     \begin{flushleft} \large     \emph{Author:}\\     \href{http://www.google.com}{\authornames}     \end{flushleft}     \end{minipage}     \begin{minipage}{0.4\textwidth}     \begin{flushright} \large     \emph{Supervisor:} \\     \href{http://www.google.com}{\supname}     \end{flushright}     \end{minipage}\\[3cm]          \large \textit{A thesis submitted in fulfillment of the requirements\\ for the degree of \degreename}\\[0.3cm]     \textit{in the}\\[0.4cm]     \groupname \\ of the\\\deptname\\[2cm]          {\large \today}\\[4cm]          \vfill     \end{center}          \end{titlepage}          \Declaration{          \addtocontents{toc}{\vspace{1em}}          I, \authornames, declare that this thesis titled, `\ttitle' and the work presented in it are my own. I confirm that:          \begin{itemize}      \item[\tiny{$\blacksquare$}] This work was done wholly or mainly while in candidature for a research degree at this University.\\     \end{itemize}          Signed:\\     \rule[1em]{25em}{0.5pt}          Date:\\     \rule[1em]{25em}{0.5pt}     }          \clearpage          \pagestyle{empty}          \null\vfill          \textit{``Quote''}          \begin{flushright}     Author     \end{flushright}          \vfill\vfill\vfill\vfill\vfill\vfill\null          \clearpage          \addtotoc{Abstract}          \abstract{\addtocontents{toc}{\vspace{1em}}          The Thesis Abstract is written here     }          \clearpage          \setstretch{1.3}          \acknowledgments{\addtocontents{toc}{\vspace{1em}}          Acknowledments text.          }     \clearpage          \pagestyle{fancy}          \lhead{\emph{Contents}}     \tableofcontents          \lhead{\emph{List of Figures}}     \listoffigures          \lhead{\emph{List of Tables}}     \listoftables          \clearpage          \setstretch{1.5}          \lhead{\emph{Abbreviations}}     \listofsymbols{ll}     {     \textbf{Acronym} & \textbf{W}hat (it) \textbf{S}tands \textbf{F}or \\     }          \clearpage          \lhead{\emph{Physical Constants}}          \listofconstants{lrcl}     {     Speed of Light & $c$ & $=$ & $2.997\ 924\ 58\times10^{8}\ \mbox{ms}^{-\mbox{s}}$ (exact)\\      Constant Name & Symbol & = & Constant Value (with units) \\     }          \clearpage          \lhead{\emph{Symbols}}          \listofnomenclature{lll}     {     $a$ & distance & m \\     $P$ & power & W (Js$^{-1}$) \\          & & \\          $\omega$ & angular frequency & rads$^{-1}$ \\     }          \setstretch{1.3}          \pagestyle{empty}          \dedicatory{Dedication text.}          \addtocontents{toc}{\vspace{2em}}          \mainmatter          \pagestyle{fancy}          \section{Introduction}     Test 1 \citep{A01}.          \clearpage     Test 2 \citep{A02}.          \addtocontents{toc}{\vspace{2em}}          \appendix          \addtocontents{toc}{\vspace{2em}}          \backmatter          \label{Bibliography}     \lhead{\emph{Bibliography}}     \printbibliography     \end{document}      Contents of Thesis.cls:               \NeedsTeXFormat{LaTeX2e}[1996/12/01]     \ProvidesClass{Thesis}                   [2007/22/02 v1.0        LaTeX document class]     \def\baseclass{book}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}     \def\@checkoptions#1#2{       \edef\@curroptions{\@ptionlist{\@currname.\@currext}}       \@tempswafalse       \@tfor\@this:=#2\do{         \@expandtwoargs\in@{,\@this,}{,\@curroptions,}         \ifin@ \@tempswatrue \@break@tfor \fi}       \let\@this\@empty       \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi     }     \@checkoptions{11pt}{{10pt}{11pt}{12pt}}     \PassOptionsToClass{a4paper}{\baseclass}     \ProcessOptions\relax     \LoadClass{\baseclass}     \newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}          \newcommand\Declaration[1]{     \btypeout{Declaration of Authorship}     \addtotoc{Declaration of Authorship}     \thispagestyle{plain}     \null\vfil     \begin{center}{\huge\bf Declaration of Authorship\par}\end{center}     {\normalsize #1}     \vfil\vfil\null     }          \newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}     \def\today{\ifcase\month\or       January\or February\or March\or April\or May\or June\or       July\or August\or September\or October\or November\or December\fi       \space \number\year}     \usepackage{setspace}     \onehalfspacing     \setlength{\parindent}{0pt}     \setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}     \usepackage{vmargin}          \RequirePackage[utf8]{inputenc}          \setmarginsrb  { 1.5in}                             { 0.6in}                             { 1.0in}                             { 0.8in}                             {  20pt}                             {0.25in}                             {   9pt}                             { 0.3in}     \raggedbottom     \setlength{\topskip}{1\topskip \@plus 5\p@}     \doublehyphendemerits=10000     \brokenpenalty=10000     \widowpenalty=9999     \clubpenalty=9999     \interfootnotelinepenalty=9999     \usepackage{fancyhdr}     \lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}     \rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}     \chead{}\lfoot{}\rfoot{}\cfoot{}     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}}     \renewcommand{\sectionmark}[1]{}     \renewcommand{\subsectionmark}[1]{}     \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else     \hbox{}     \thispagestyle{empty}     \newpage     \if@twocolumn\hbox{}\newpage\fi\fi\fi}     \usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}     \theoremstyle{plain}     \newtheorem{example}{Example}[chapter]     \newtheorem{theorem}{Theorem}[chapter]     \newtheorem{corollary}[theorem]{Corollary}     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{proposition}[theorem]{Proposition}     \newtheorem{axiom}[theorem]{Axiom}     \theoremstyle{definition}     \newtheorem{definition}[theorem]{Definition}     \theoremstyle{remark}     \newtheorem{remark}[theorem]{Remark}     \usepackage[centerlast,small,sc]{caption}     \setlength{\captionmargin}{20pt}     \newcommand{\fref}[1]{Figure~\ref{#1}}     \newcommand{\tref}[1]{Table~\ref{#1}}     \newcommand{\eref}[1]{Equation~\ref{#1}}     \newcommand{\cref}[1]{Chapter~\ref{#1}}     \newcommand{\sref}[1]{Section~\ref{#1}}     \newcommand{\aref}[1]{Appendix~\ref{#1}}     \renewcommand{\topfraction}{0.85}     \renewcommand{\bottomfraction}{.85}     \renewcommand{\textfraction}{0.1}     \renewcommand{\dbltopfraction}{.85}     \renewcommand{\floatpagefraction}{0.75}     \renewcommand{\dblfloatpagefraction}{.75}     \setcounter{topnumber}{9}     \setcounter{bottomnumber}{9}     \setcounter{totalnumber}{20}     \setcounter{dbltopnumber}{9}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage[scriptsize]{subfigure}     \usepackage{booktabs}     \usepackage{rotating}     \usepackage{listings}     \usepackage{lstpatch}     \lstset{captionpos=b,             frame=tb,             basicstyle=\scriptsize\ttfamily,             showstringspaces=false,             keepspaces=true}     \lstdefinestyle{matlab} {             language=Matlab,             keywordstyle=\color{blue},             commentstyle=\color[rgb]{0.13,0.55,0.13}\em,             stringstyle=\color[rgb]{0.7,0,0} }     \usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,        bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,        colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red},        pdfstartview={FitV},unicode,breaklinks=true]{hyperref}     \pdfstringdefDisableCommands{        \let\\\space     }     \newcommand*{\supervisor}[1]{\def\supname{#1}}     \newcommand*{\thesistitle}[1]{\def\ttitle{#1}}     \newcommand*{\examiner}[1]{\def\examname{#1}}     \newcommand*{\degree}[1]{\def\degreename{#1}}     \newcommand*{\authors}[1]{\def\authornames{#1}}     \newcommand*{\addresses}[1]{\def\addressnames{#1}}     \newcommand*{\university}[1]{\def\univname{#1}}     \newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}}     \newcommand*{\department}[1]{\def\deptname{#1}}     \newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}}     \newcommand*{\group}[1]{\def\groupname{#1}}     \newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}}     \newcommand*{\faculty}[1]{\def\facname{#1}}     \newcommand*{\FACULTY}[1]{\def\FACNAME{#1}}     \newcommand*{\subject}[1]{\def\subjectname{#1}}     \newcommand*{\keywords}[1]{\def\keywordnames{#1}}          \thesistitle{Thesis Title}     \supervisor{Dr. Faculty \textsc{Name}}      \examiner{}     \degree{Doctor of Philosophy}     \authors{My \textsc{Name}}     \addresses{}     \subject{}     \keywords{}     \university{\texorpdfstring{\href{http://www.iub.edu}                     {University}}                     {University}}      \UNIVERSITY{\texorpdfstring{\href{http://www.iub.edu}                     {UNIVERSITY}}                     {UNIVERSITY}}     \department{\texorpdfstring{\href{http://psych.indiana.edu/index.php}                     {Department}}                     {Department}}     \DEPARTMENT{\texorpdfstring{\href{http://psych.indiana.edu/index.php}                     {DEPARTMENT}}                     {DEPARTMENTS}}     \group{\texorpdfstring{\href{http://psych.indiana.edu/clinical.php}                     {Research group}}                     {Research group}}            \GROUP{\texorpdfstring{\href{http://psych.indiana.edu/clinical.php}                     {RESEARCH GROUP}}                     {RESEARCH GROUP}}     \faculty{\texorpdfstring{\href{http://psych.indiana.edu/faculty/batesj.php}                     {Faculty}}                     {Faculty}}     \FACULTY{\texorpdfstring{\href{http://psych.indiana.edu/faculty/batesj.php}                     {FACULTY)}}                     {FACULTY}}          \renewcommand\maketitle{       \btypeout{Title Page}       \hypersetup{pdftitle={\@title}}       \hypersetup{pdfsubject=\subjectname}       \hypersetup{pdfauthor=\authornames}       \hypersetup{pdfkeywords=\keywordnames}       \thispagestyle{empty}       \begin{titlepage}         \let\footnotesize\small         \let\footnoterule\relax         \let \footnote \thanks         \setcounter{footnote}{0}         \null\vfil         \vskip 60\p@         \begin{center}           \setlength{\parskip}{0pt}           {\large\textbf{\UNIVNAME}\par}           \vfill           {\huge \bf \@title \par}           \vfill           {\LARGE by \par}           \smallskip           {\LARGE \authornames \par}           \vfill           {\large A thesis submitted in partial fulfillment for the \par}           {\large degree of \degreename \par}           \bigskip           \bigskip           {\large in the \par}           {\large \facname \par}           {\large \deptname \par}            \bigskip           \bigskip           \bigskip           {\Large \@date \par}           \bigskip         \end{center}         \par         \@thanks         \vfil\null       \end{titlepage}       \setcounter{footnote}{0}       \global\let\thanks\relax       \global\let\maketitle\relax       \global\let\@thanks\@empty       \global\let\@author\@empty       \global\let\@date\@empty       \global\let\@title\@empty       \global\let\title\relax       \global\let\author\relax       \global\let\date\relax       \global\let\and\relax       \cleardoublepage     }     \newenvironment{abstract}     {       \btypeout{Abstract Page}       \thispagestyle{empty}       \null\vfil       \begin{center}         \setlength{\parskip}{0pt}         {\normalsize \UNIVNAME \par}         \bigskip         {\huge{\textit{Abstract}} \par}         \bigskip         {\normalsize \facname \par}         {\normalsize \deptname \par}         \bigskip         {\normalsize \degreename\par}         \bigskip         {\normalsize\bf \@title \par}         \medskip         {\normalsize by \authornames \par}         \bigskip       \end{center}     }     {       \vfil\vfil\vfil\null       \cleardoublepage     }     \addtocounter{secnumdepth}{1}     \setcounter{tocdepth}{6}     \newcounter{dummy}     \newcommand\addtotoc[1]{     \refstepcounter{dummy}     \addcontentsline{toc}{chapter}{#1}}     \renewcommand\tableofcontents{     \btypeout{Table of Contents}     \begin{spacing}{1}{         \setlength{\parskip}{1pt}         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\contentsname             \@mkboth{                \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}         \@starttoc{toc}         \if@restonecol\twocolumn\fi        \cleardoublepage     }\end{spacing}     }     \renewcommand\listoffigures{     \btypeout{List of Figures}     \addtotoc{List of Figures}     \begin{spacing}{1}{         \setlength{\parskip}{1pt}         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\listfigurename           \@mkboth{\MakeUppercase\listfigurename}                   {\MakeUppercase\listfigurename}}         \@starttoc{lof}         \if@restonecol\twocolumn\fi         \cleardoublepage     }\end{spacing}     }     \renewcommand\listoftables{     \btypeout{List of Tables}     \addtotoc{List of Tables}     \begin{spacing}{1}{         \setlength{\parskip}{1pt}         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\listtablename           \@mkboth{               \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}         \@starttoc{lot}         \if@restonecol\twocolumn\fi         \cleardoublepage     }\end{spacing}     }     \newcommand\listsymbolname{Abbreviations}     \usepackage{longtable}     \newcommand\listofsymbols[2]{     \btypeout{\listsymbolname}     \addtotoc{\listsymbolname}         \chapter*{\listsymbolname           \@mkboth{               \MakeUppercase\listsymbolname}{\MakeUppercase\listsymbolname}}     \begin{longtable}[c]{#1}#2\end{longtable}\par         \cleardoublepage     }     \newcommand\listconstants{Physical Constants}     \usepackage{longtable}     \newcommand\listofconstants[2]{     \btypeout{\listconstants}     \addtotoc{\listconstants}         \chapter*{\listconstants           \@mkboth{               \MakeUppercase\listconstants}{\MakeUppercase\listconstants}}     \begin{longtable}[c]{#1}#2\end{longtable}\par         \cleardoublepage     }     \newcommand\listnomenclature{Symbols}     \usepackage{longtable}     \newcommand\listofnomenclature[2]{     \btypeout{\listnomenclature}     \addtotoc{\listnomenclature}         \chapter*{\listnomenclature           \@mkboth{               \MakeUppercase\listnomenclature}{\MakeUppercase\listnomenclature}}     \begin{longtable}[c]{#1}#2\end{longtable}\par         \cleardoublepage     }     \newcommand\acknowledgments[1]{     \btypeout{Acknowledgments}     \addtotoc{Acknowledgments}     \thispagestyle{plain}     \begin{center}{\huge{\textit{Acknowledgments}} \par}\end{center}     {\normalsize #1}     \vfil\vfil\null          }     \newcommand\dedicatory[1]{     \btypeout{Dedicatory}     \thispagestyle{plain}     \null\vfil     \vskip 60\p@     \begin{center}{\Large \sl #1}\end{center}     \vfil\null     \cleardoublepage     }     \renewcommand\backmatter{       \if@openright         \cleardoublepage       \else         \clearpage       \fi       \addtotoc{\bibname}       \btypeout{\bibname}       \@mainmatterfalse}     \endinput      To run, you may need lstpatch.sty, which can be downloaded from here: http://www.atscire.de/download/lstpatch.sty Bonus points: How can I remove the extra space after the opening parenthesis in each of the parenthetical citations?


title: Standard paragraph following subparagraph

text: I'm a newbie using LyX and was wondering why when I put a standard paragraph after a *subparagraph it always renders the first standard paragraph after the *subparagraph on the same line?


title: Do spaces in \cite make a difference?

text: I just found the hard way that it matters. For example,               \cite{aref, bref}      is different from               \cite{aref,bref}      Notice the space after the comma in first one. If it does matter, this looks real silly to me. I just need to verify if this is the case. Just to add, I am using **Miktex** and **Texmaker** This is how it's looking now:               \cite{jiang2006research,datta2006distributed,bandyopadhyay2006clustering}      Before it was:               \cite{jiang2006research, datta2006distributed, bandyopadhyay2006clustering}      Here is a full example of code which fails:               \documentclass[twoside,11pt]{article}          \usepackage{jair, theapa, rawfonts}          \begin{document}          \begin{abstract}     Abstracts will go here.          \end{abstract}          \section{Introduction}     \label{Introduction}          \subsection{Thesis Background}          As expected, most of the work involved combination of the disciplines of \textit{Data Mining} and \textit{Computer Networks} \cite{jiang2006research, datta2006distributed, bandyopadhyay2006clustering}.          \vskip 0.2in     \bibliographystyle{theapa}     \bibliography{refs}               \end{document}      refs.bib looks as follows:               @article{bandyopadhyay2006clustering,       title={Clustering distributed data streams in peer-to-peer environments},       author={Bandyopadhyay, S. and Giannella, C. and Maulik, U. and Kargupta, H. and Liu, K. and Datta, S.},       journal={Information Sciences},       volume={176},       number={14},       pages={1952--1985},       year={2006},       publisher={Elsevier}     }               @article{datta2006distributed,       title={Distributed data mining in peer-to-peer networks},       author={Datta, S. and Bhaduri, K. and Giannella, C. and Wolff, R. and Kargupta, H.},       journal={Internet Computing, IEEE},       volume={10},       number={4},       pages={18--26},       year={2006},       publisher={IEEE}     }          @article{jiang2006research,       title={Research issues in data stream association rule mining},       author={Jiang, N. and Gruenwald, L.},       journal={ACM Sigmod Record},       volume={35},       number={1},       pages={14--19},       year={2006},       publisher={ACM}     }               @book{datta2008probabilistic,       title={Probabilistic approximate algorithms for distributed data mining in peer-to-peer networks},       author={Datta, S.},       year={2008},       publisher={ProQuest}     }


title: Compile only the theorems

text: Is there a way (package or anything) to compile only the theorems in a tex- document. With theorems I mean the lemmas, propositions and theorems defined in the theorem-environment of the amsthm package. I would like to have a list of the results to see the underlying structure better.


title: Typesetting Math and Text Commands

text: In your opinion, what is the best way to place things like symbols next to names, if some symbols are meant for text and you have to be in mathmode to use the exponent functionality? What is the command for that specific `cross` at the end of the name? I checked and found `\Cross` of the marvosym package, but it was much more **bold** and shorter to my eyes then the one below. Also a slightly better title would be appreciated if someone thinks of one. ![names](http://i.stack.imgur.com/krbFf.png)


title: problem with mdframed commands

text: I was trying to highlight some text as shown in this post, but I'm having problems. the following works for me               \documentclass{article}          \usepackage{xcolor}     \usepackage{mdframed}     \usepackage{lipsum}          \begin{document}     \begin{mdframed}[backgroundcolor=gray!20, linecolor=white]     \lipsum[1]     \end{mdframed}     \end{document}      but when I try to use his exact same code               \documentclass{article}          \usepackage{xcolor}     % for colour     \usepackage{lipsum}     % for sample text     \usepackage{ntheorem}   % for theorem-like environments     \usepackage{mdframed}   % for framing          \theoremstyle{break}     \theoremheaderfont{\bfseries}     \newmdtheoremenv[%     linecolor=gray,leftmargin=60,%     rightmargin=40,     backgroundcolor=gray!40,%     innertopmargin=0pt,%     ntheorem]{myprop}{Proposition}[section]          \begin{document}          \section{mdframed for the win}     \begin{myprop}     \lipsum[1]     \end{myprop}          \end{document}      I get an error `"Undefined control sequence. l.10 \newmdtheoremenv"`.Do you know what could be the problem? I'm kind of new with latex and I have no clue.


title: Distinguish \nameref references in print version

text: I used the `\nameref` command to reference to names of captions etc. I also used the option `colorlinks=true` so I have colored references which can be distinguished form "normal" text. In my print version of the document I colored the links to black. Now I'd like to set them to _italic_ or surround them with apostrophes or something like that. I already tried to renew the `\nameref` command, but I didn't get it to work               \renewcommand{\nameref}{\emph{\nameref{#1}}}      I allways get an error message, which says: "LaTeX Error: \namref undefined." Any ideas?


title: Strange temporary compilation error

text: I get a very weird "error" just momentarily when I compile my document but when the compilation is finished it disappears and I have no errors or warnings. As you can see the "error" is huge and it keep going as there is a scrolling bar. This started happening the time that I used the `\usepackage{steinmetz}` and its command `\phase{}`. If I delete them then everything is ok. Why is this happenning and how can I fix it? A MWE which has that problem when compiled:               \documentclass[12pt]{article}     \usepackage[top=0.7in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}          \setlength{\parindent}{0cm}          \usepackage{xltxtra}     \usepackage{xgreek}     \setmainfont[Mapping=tex-text]{GFSArtemisia.otf}     \setsansfont[Mapping=tex-text]{GFSArtemisia.otf}          \setmainfont[       Ligatures=TeX,       Extension=.otf,       UprightFont=*,       BoldFont=*Bold,       ItalicFont=*It,       BoldItalicFont=*BoldIt,     ]{GFSArtemisia}          \usepackage[fleqn]{amsmath}     \usepackage{unicode-math}          \usepackage{steinmetz}          \everymath{\displaystyle}          \newcommand{\3}{\vspace{0.3cm}}          \newcommand{\1}{\vspace{1cm}}          \newcommand{\rr}     {     \hrule          \vspace{0.3cm}     }          \begin{document}          $Y=|Y|\cdot e^{j\phi}=|Y|\phase{\phi}$          \end{document}      ![enter image description here](http://i.stack.imgur.com/AFwrM.png) I don't know if this helps but these are the settings of my Texmaker: ![enter image description here](http://i.stack.imgur.com/PbeE1.png) After using the solution proposed by Ulrike Fischer all this "scary" warning disappears and in its place appears the following. It is of the same nature which means that it appears during compilation and disappears after the compilation is complete. What is that? ![enter image description here](http://i.stack.imgur.com/GUZ93.png)


title: How to include image in background

text: When inserting a figure into a TeX document is there an easy way to make it appear behind the text?


title: Chapter without pagebreak? (In twocolumn document.)

text: I've googled, and I read a lot about how not having a pagebreak before a new `chapter` is bad style. I've read about how one could use sections instead. I've read about how _changing_ whether a chapter begins on a new page or not within a document is even worse, from a style standpoint. However, if I still **have** to do it somehow, typographic style be damned, _and I have to do it in a`twocolumn` document_... Background: I am translating a set of gaming rulebooks into a single `scrbook`, with each original rulebook represented by a `part` in my `scrbook`. Layout of the rulebooks is relatively uniform, with fancy chapter headings beginning on a new page each. The exception to this is the first rulebook / `part`, which has very short chapters, sometimes several on a single page, but following the same numbering scheme as the more elaborate chapters in the other rulebooks / `part`s. I could typeset that first book seperately, using sections instead of chapters, and `include` the resulting PDF. That way, I would lose the common TOC / LOT / index, which would be unfortunate. I could wing it by redefining header formats for the first part, to make sections "look" like chapters and subsections look like sections and subsubsections... and so on. Pretty heavy-handed. **Edit:** The solution in Start new chapter on same page (using `etoolbox` to patch the `clearpage` / `cleardoublepage` out of the definition of `\chapter`) does not work for a `twocolumn` document, yielding "Float(s) lost" errors. (I hadn't mentioned the `twocolumn` detail before as I did not think it would make a difference.) User _lockstep_ asked for a seperate question; instead, I vote for re-opening this (edited) one. * * * **tl;dr:** **Is there a way to tell LaTeX not to put a pagebreak for`\chapter` _in a`twocolumn` document_?**


title: Centering text in tables problems with colortabs

text: I am trying to produce a basic color table as shown below               \documentclass{article}      \usepackage{booktabs}      \usepackage[dvipsnames*,svgnames]{xcolor}      \usepackage{colortbl}      \usepackage{array}      \begin{document}          \begin{table}     \centering     \setlength{\aboverulesep}{0pt}     \setlength{\belowrulesep}{0pt}     \setlength{\extrarowheight}{.75ex}     \begin{tabular}{|>{\columncolor{LightSteelBlue}}c| c | c | c|}     \toprule      \rowcolor{LightSteelBlue}  & {Mann} & {Kvinne} & {Totalt} \\       \rowcolor{LightSteelBlue}  &        &          &        \\ \midrule      \O nsker        &      &        &        \\       Ballbinge       &      &        &        \\ \midrule      \O nsker ikke   &      &        &        \\       Ballbinge       &      &        &        \\ \midrule      Totalt          &      &        &        \\                       &      &        &        \\       \bottomrule     \end{tabular}     \end{table}     \end{document}      Now I wanted to center the text in the first row, and column, inside their boxes. My first thought was to use `\multirow`s, alas this produces some very ugly results. The text is hidden behind the colors. What is the proper way to create the table above, with centered text? (Any other comments about how to improve the looks of the table are also welcome)


title: Graphic size in slides

text: I'm doing a slide presentation with LaTeX, and some slides show only graphics. I created those graphics using R. But in those slides, the graphic size is too big and a part of the graphic does not appear in the slide, like it's been cropped. Is there any command in LaTeX that can make the graphic smaller in the slide?


title: Text is not centered

text: The issue is that the text is not getting centered even after issueing `\centering`. The following picture depicts it :   ![enter image description here](http://i.stack.imgur.com/tEyaM.png)   The code:               \documentclass[12pt]{book}     \usepackage{wedn}     \usepackage[T1]{fontenc}     \usepackage{geometry}     \begin{document}     \begin{titlepage}     {\newgeometry{margin=1in, centering}     \noindent \rule{\textwidth}{2pt}     {\LARGE\centering\bfseries MATERIAL SCIENCE \par}     \noindent \rule{\textwidth}{2pt}     {\wedn\large\centering {Department of Physics\par Pondicherry Engineering College}}     }     \end{titlepage}     \restoregeometry     \end{document}


title: Table column width "fill to margin"

text: I kind of would expect tables to be able to "fill to margin", instead of choosing a number and iteratively rebuilding the document until it is the right size. For example, I want this 2-column table to have the first column as wide as it needs to be, and the 2nd column to "fill to margin":               \begin{tabular}{ l p{5cm} }      Of course, that's not gonna do it (2nd column will be `5cm`), is there anyway to "fill to margin"?


title: Splitting parameters in a macro

text: I have a macro like this:               \newcommand{\listanimals}[1]{         Animals in the farm: #1.     }      So using `\listanimals{pig / sheep / cow / duck / goat}` will print: > Animals in the farm: pig / sheep / cow / duck / goat. I want to know, can I have other macros display only certain information within that parameter? For example:               \listfirsttwoanimals{pig / sheep / cow / duck / goat}      > First two animals: pig / sheep.               \listanimalsafterfirsttwo{pig / sheep / cow / duck / goat}      > Animals after the first two: cow / duck / goat.


title: error in mathematical expression

text: I type in the code shown below for a displayed formula. However the output is not what it should be. Can you tell me what is the mistake over here?               $$ \frac{(1-a)\frac{$q_{f}$}{{$q_{n}$}^a}}{$p_{n}$} \cdot $q_{f}$ \cdot $\Delta p$ $$


title: Which fonts to use with pinyin?

text: I have a document which contains some pinyin. I find that many fonts I tried, however, don't contain all of the tone marks. I have set up the following test file which shows all of the possible letters used within pinyin which contain tone marks:               \documentclass{article}     \usepackage{xeCJK}     \usepackage{fontspec}     \setmainfont{Minion Pro}     \setCJKmainfont{Adobe Song Std}     \begin{document}         \begin{enumerate}             \item ā ē ī ō ū ǖ Ā Ē Ī Ō Ū Ǖ             \item á é í ó ú ǘ Á É Í Ó Ú Ǘ             \item ǎ ě ǐ ǒ ǔ ǚ Ǎ Ě Ǐ Ǒ Ǔ Ǚ             \item à è ì ò ù ǜ À È Ì Ò Ù Ǜ             \item a e i o u ü A E I O U Ü         \end{enumerate}     \end{document}      When I build the file, quite a number of letters are missing. When I view the file, I see many boxes. Yet `xelatex` does not tell me any errors.   * What font settings should I consider which will look great and have all of the letters I need?   * As `xelatex` did not display any errors, does that mean the PDF is fine, but my PDF reader has a problem?


title: Tikz Externalize: How to remove PDF filename from figure

text: I have coded graphics in a LaTeX report using TikZ and have externalized them. When the generated PDF files for the graphics are included in the PDF of the report, the filename of each figure is included in each graphic. How can I ensure that the filename does not appear? I am have included the TikZ externalize library using `\usetikzlibrary{external}` and am wrapping each TikZ picture using `\beginpgfgraphicnamed{filename}` and `\endpgfgraphicnamed{filename}`, where filename is the name of the graphic file created. For example:               \begin{figure}[!h]       \centering       \beginpgfgraphicnamed{causaldiagram}       \begin{tikzpicture}             ... tikz code here            \end{tikzpicture}       \endpgfgraphicnamed{causaldiagram}       \caption{Causal diagram example.}       \label{fig:causal_diagram_example}     \end{figure}


title: Flush what's following \hfill to the next line if it doesn't fit

text: I'm using `\hfill` to flush some text to the end of the line. However, when the stuff preceding `\hfill` takes up most of the line, the text at the end is broken over to the next line. What I am want is this: When the stuff preceding `\hfill` doesn't leave enough space at the end of the line for the text following `\hfill`, that text should in its _entirety_ flush to the _end_ of the next line. A MWE:               \documentclass{article}     \begin{document}     \hrule % show the margins     \rule{28em}{.2ex} \hfill S o m e t h i n g     \end{document}      ![enter image description here](http://i.stack.imgur.com/yvoeE.png)


title: dvi to pdf error: unknown token SDict, Interpretting PS code failed

text: How to clear this error, i cant produce dvi to pdf:               ** WARNING ** Unknown token "SDict"     ** WARNING ** Interpreting PS code failed!!! Output might be broken!!!     ** WARNING ** Interpreting special command ps: (ps:) failed.     ** WARNING ** >> at page="1" position="(72, 720)" (in PDF)     ** WARNING ** >> xxx "ps:SDict begin /product where{pop product(Distiller)search{p..."     ** WARNING ** >> Reading special command stopped around >>begin /product where{pop product(Distiller)search{pop pop po...<<


title: How to prevent hyperref package from changing layout (line spacing)?

text: I have a boolean in my LaTeX paper that I use to create a custom author version (including a copyright box and clickable links and references). For the author version, I include the `\hyperref` package (in the other case, I use `\nohyperref`, following my earlier question http://tex.stackexchange.com/a/53316/2090). However, I noticed that, when including `hyperref`, my layout changes slightly (I blame it on line spacing, but not 100% sure) with the end result that the last lines of my paper get pushed to a new page. Is there any way to NOT have hyperref influence the layout (line spacing)? Or counteract upon it in an easy way? The hyperref options I am currently using are below. But even disabling these gives the same result.               \hypersetup{         pdfborder={0 0 0},         colorlinks=true, linkcolor=blue, urlcolor=blue, citecolor=blue,         pdfpagemode=UseNone}


title: Question about beamer - Head shaded with CambridgeUS

text: Related to my previous question about beamer, now I have another one:   * How to change the color on the head shaded from the light gray to the light green. ![Head shaded](http://i.stack.imgur.com/M41jD.jpg)


title: Automatically numbering constants

text: I would like to somehow use LaTeX to automatically number constants. ### Some background As a mathematician, in my daily work there are a lot of throw-away constants which are not extremely important in the discourse. So I will sometimes write inequalities like               \[ f(x) \leq c_1 g(x) \leq c_2 (g'(x) + h(x)^2 -3) \leq c_3 \int h(x)^2 \]      Since the constants themselves tend not to be important, to conserve alphabets, I call them all 'c' with a subscript. Now, it is a bit of a hassle to   1. keep track manually which numbers I've used up to a given point in the paper, especially if I am working on a large document   2. renumber the constants if I modified an argument. Say if I remove the middle inequality from the example above, for aesthetic purposes it'd much better to have `\[ f(x) \leq c_1 g(x) \leq c_2 \int h(x)^2 \]` instead of `c_3` in the last term. But then I'd have to go back through the document to renumber _all_ the constants.  Now sometimes I can solve the problem using the convention that 'c' with no subscripts stands for a constant that can change from line to line. But often that is not feasible (suppose I do need to refer to individual of those constants and verify that they are indeed 'constant' enough for my purpose). ### What I'd like Now I am aware of the `newcounter` command to define a new counter. I even know how to use it to automatically increment the counter. So I can define a command that prints `c_\thecounter` and increments the counter so I get a running list of constants. So that solves half the problem. The other half of the problem that I don't know how to deal with is how to _refer_ to a constant defined previously. Naively using `label` and `ref`, of course, doesn't work. (I actually don't quite understand the inner workings of those two commands; so an explanation of why they don't work will also be helpful.) As an illustration of what I'd like, it'd be great to have a pair of commands `\newconstant` and `\oldconstant` which can be used like this               % Create some new constants     \[ f(x) \leq \newconstant g(X) \leq \newconstant h(x) \]     % Create a new constant with a label     \[ m \geq \newconstant[cnst:m] m' \]     % Refer to an already defined constant     The constant $\oldconstant{cnst:m}$ defined above is actually 1.       Which will display something like               f(x) <= c_1 g(x) <= c_2 h(x)     m >= c_3 m'     The constant c_3 defined above is actually 1      What I know how to do is to define, say               \newcounter{cnstcnt}     \newcommand{\newconstant}{\ensuremath{c_\thecnstcnt}\addtocounter{cnstcnt}{1}}      and this will print the running list. > Is there already a package that does this? If not is there a way to get the > behaviour I described? (Especially the ability to refer back to a previous > constant.)


title: Numbering of equations in chemfig

text: This might be a stupid question, but how do I number my equations in `chemfig`? I've drawn this rather complicated equation in `chemfig`, but I have no idea how to number it. I was hoping to have it numbered as one of my equations, since I already have a few that are. Throwing it between `\begin{equation} \end{equation}` hasn't worked, the thing won't compile. I think I can put it in a figure, but that's got a different numbering system. EDIT:posted failed test instead of correct version.               \documentclass{article}     \usepackage{chemfig}     \begin{document}     \schemestart     $^{232}$Th      \arrow(a--b){->[n,$\gamma$][\tiny 7.34 $\pm$ 0.21 b][][]}[0,1]$^{233}$Th     \arrow(--c){->[$\beta ^{-}$][\tiny 22 min][][]}[0,0.9] $^{233}$Pa     \arrow(--d){->[n,$\gamma$][\tiny 38.34 $\pm$ 1.78 b][][]}[-30,1]$^{234}$Pa     \arrow(--e){->[$\beta ^{-}$][\tiny 6.7 h][][]}[0,0.9] $^{234}$U     \arrow(@c--f){->[$\beta ^{-}$][\tiny 27 d][][]}[30,1] $^{233}$U     \schemestop     \end{document}


title: tikz: double lines are shifted

text: In the following example the double line is shifted a bit to the right:               \documentclass[12pt]{article}     \usepackage{tikz}     \begin{document}     \begin{tabular}{ll}     \tikz[baseline=-0.5ex]\draw[thick](0,0)--(3ex,0);&test\\     \tikz[baseline=-0.5ex]\draw[thick,double](0,0)--(3ex,0);&test\\      \end{tabular}     \end{document}      ![enter image description here](http://i.stack.imgur.com/ihbYW.png) Looks like a bug to me, but how can I correct it? # Addition The shift gets larger with larger double distance values.


title: strange warning when using newtxmath and siunitx packages together

text: I've just noticed that I'm compiling my documents I get something similar to the following warning:               LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <5.5> not available     (Font)              size <5> substituted on input line 6.      I'm not worrying too much as it's "just" a warning. My MWE is as follows:               \documentclass{article}          \usepackage{siunitx}     \usepackage{newtxmath}          \begin{document}     hello world     \end{document}      I was originally using the `memoir` package and not the Computer Modern fonts and still getting a similar error message about CM fonts. Which is why I originally noticed it. Hacked down my list of packages a lot and this is all that seem to be needed to show the behaviour. The order doesn't seem to matter, and the warning always points to the `\begin{document}`—I presume some code from one of the packages is running there? Just had more of a read through the scroll back, and see a number of similar warnings for different fonts.


title: How to remove the header in the Index's pages

text: I used `fancy` to customize the header. As usual, there is no header in the Index's pages, but after my customizing, there is a header in them. So how can I remove those header? Since the index page is quite long so I decide to post my customization only. Here is my customization:               \usepackage{fancyhdr}     \pagestyle{fancy}     \renewcommand{\headrulewidth}{0pt}      \fancyhead{}      \fancyhead[RO]{\slshape CÁC BÀI GIẢNG VỀ TOÁN CHO MIRELLA}      \fancyhead[LE]{\slshape \leftmark}      And here is the result: ![enter image description here](http://i.stack.imgur.com/hFR0O.png)


title: Use font Times LT (Linotype) in LaTeX

text: I've searched for an answer to the following question, but I have not found a precise answer (or at least not an answer that worked for me). So this is it. I do have the original Times font (in Type 1 format) from Linotype, font name TimesLT. I would like to use them in LaTeX. I use PCTeX and I installed the fonts using the Font List dialog box. I tried to use the package times, and similarly to use                 \renewcommand{\rmdefault}{ptm}      Nonetheless, the fonts used are actually the substitute Nimbus. I guess that the problem is in the 'LT' suffix in the font name, but I have no idea on how to change it. I am not particularly expert in Tex (nor in programming in general), so the more detailed the answers the more appreciated they would be.


title: Question about beamer - Cambria font with CambridgeUS

text: Related to my previous question about beamer, now I have another one:   * How to set Cambria font for mathematical equations and Times New Roman or Arial font for regular text


title: Rotated column titles in tabular

text: I'd like to create a chart where the column titles are rotated, as per this toy example: ![enter image description here](http://i.stack.imgur.com/F7Zyh.png) I used the `rotating` package to generate the above. It has certain shortcomings: the rotate command doesn't leave space for the titles, so I have to manually space things to prevent overlaps. The turn command, by contrast, creates too much space, where each column is the width of the entire rotated column title. There is also no easy way to have long titles be split into multiple lines. _Is there a package for creating tables of this sort, or at least one that would relieve some of the manual placing and spacing that goes into creating such a table?_ * * * This question is more to make sure I don't miss any easy way of doing what I want than seeking help on manually doing it, but the code for above is included anyways:               \begin{tabular}{r|ccc}     &     \begin{rotate}{60} Property 1 \end{rotate} &     \begin{rotate}{60} Property 2 \end{rotate} &     \begin{rotate}{60} Property 3 \end{rotate} \\ \hline     System 1        &       &       &  X    \\      System 2        & X     & X     &  X    \\     System 3        & X &   &  X    \\ \hline     \end{tabular}


title: zooming with mouse over

text: I am looking for existing codes for magnifying pre-defined portions of text in PDF the output of LaTeX. The applications is for accessibility for the visually impaired, so from users' point of view minimizing number of clicks and mouse movements is essential. From content providers' point of view simplicity of coding is important. A feature like the one MathJax has is desirable: set magnification factor, activate by mouse over, deactivate by mouse away, or similar settings. I am aware of the following Hover and ZoomBox. Any pointer is appreciated.


title: Ledmac \pagelinesep and Makeindex

text: I'm doing multiple indices for a document, using `Ledmac` with the `Memoir` class. By default, page and line numbers (produced using `\edindex[]{}`) are separated by a dash. I actually would like a colon instead. `Ledmac` documentation specifies that : > The page & linenumber combination is written as `page\pagelinesep line`, > where the default definition is `\newcommand{\pagelinesep}{-}` so that an > item on page 3, line 5 will be noted as being at 3-5. You can renew > \pagelinesep to get a different separator (but it just so happens that - is > the default separator used by the MakeIndex program) So, I've tried with :               \renewcommand*{\pagelinesep}{:}      or with :               \renewcommand{\thepageline}{%         \thepage : \lineref{\edindexlab\thelabidx}      But, if, in both cases, the entries are correctly written in the .idx file, `Makeindex`rejects them, speaking of : `-- Illegal Arabic digit: position 3 in 60:741.` Also, I can't add space, or more than one characters, or I get : `Illegal space within numerals in second argument` I think the problem is with Makeindex rules, rather than Ledmac. Has anyone an idea ? [Edit :] Here is a MWE               \documentclass{memoir}      \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{ledmac}     \makeindex[names]          \renewcommand*{\pagelinesep}{:}          \begin{document}     \beginnumbering     \pstart     Here is my numbered text.\edindex[names]{text@Text}     \pend     \endnumbering     \printindex[names]     \end{document}      If I suppress `\renewcommand*{\pagelinesep}{:}`, everything works fine after the two `pdflatex` compilations, the `makeindex` one, and the last `pdflatex` compilation. Otherwise, I get the error I mentioned.


title: fancyhdr - how to disable auto section number and still show section name in header

text: \documentclass[fleqn,12pt,a4paper]{article}     %\RequirePackage{Kaumudi_Package}     \usepackage{fancyhdr}     \pagestyle{fancy}     \begin{document}     \section{section-1}      \newpage     \section{section-2}     \end{document}      In the above MWE, section name is placed in the page header which is great. However it also places a number in front of each section. I want to disable the number in front of the section. I managed to do that with `\section*{}` but that takes it off of the header as well. How can I disable the number in front of section and also show the name of the section in the header


title: Citations with no bibliograhy at the end in RevTex4-1 (or at least bibliography on a separate page)?

text: I am trying to suppress the printing of the bibliography at the end of my RevTex4-1 document, however, I would like to keep the citations in the text. While invoking the `\nobibliography` command in the bibentry package as described in this answer works for, say, article style, it does not seem to work for revtex. If I compile the MWE below with pdflatex, it outputs a multiply defined citation warning and a pdf containing a bibliography! MWE1:               \documentclass[twocolumn,noshowpacs,noshowkeys,prb,aps,longbibliography]{revtex4-1}%     \pdfoutput=1     \usepackage{bibentry}          \begin{document}     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     \bibliographystyle{apsrev}     \nobibliography{testref}     \end{document}       The test.bib file is as follows:               @book{test,     title="Test book title",     author="Test Author",     year={2014},      publisher={TestPubs},     }      and the output is: ![enter image description here](http://i.stack.imgur.com/UdpLp.png) Now, while I would prefer to find an answer to the question above (since using bibentry seems to be neater), if there is none, I would be happy to just move the bibliography to a separate page. However, neither `\newpage` nor `\pagebreak` seem to work. `\clearpage` doesn't preserve the column balance on the page where it's invoke: i.e., this: MWE2               \documentclass[twocolumn,noshowpacs,noshowkeys,prb,aps,longbibliography]{revtex4-1}%     \pdfoutput=1     \usepackage{bibentry}          \begin{document}     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     This is a test \cite{test}.     \clearpage     \bibliographystyle{apsrev}     \bibliography{testref}     \end{document}       results in the following output on the first page: ![enter image description here](http://i.stack.imgur.com/0M8C9.png) Sorry for the long post. **UPDATE** As I said in my comment, MWE1 works fine in RevTex4 instead of RevTex4-1 when `\bibliographystyle{apsrev}` line is commented out. There seems to be an incompatibility between bibentry and apsrev4-1 (the native bibliography style for RevTex4-1), per this link. So, since I don't know a workaround, and since my document looks fine in RevTex4, I'll just use that.


title: Framezoom artifact when image is centered

text: When using the `framezoom` command, while centering the image;\               \documentclass{beamer}          \mode<presentation>{\usetheme{Warsaw}}          \begin{document}          \begin{frame}          \begin{center}          \framezoom<2><3>[border](3.5cm, 1.5cm)(1cm, 1cm)          \pgfimage[height=5cm]{example-image}          \end{center}          \end{frame}          \end{document}      The image will be centered and the border will be positioned as if the center is 0. But the zoom actually zooms on the part of the picture as if 0 is at the left of your slide. So in short the border and zoom no longer match. My question is: Can i use framezoom with a border while centering my image


title: Why hyperref doesn't like commands set via \let in section titles?

text: `pdflatex` returns on below document               \documentclass[a4paper]{article}     \usepackage{hyperref}     \let\code\texttt     \begin{document}     \section{\texttt{first}}     \section{\code{second}}     \end{document}      following error:               ! Argument of \@sect has an extra }.     <inserted text>                      \par      l.6     \section{\code{second}}      I like semantic command naming, thus I use my own short commands instead of `\texttt` and such, Moreover, unless I introduce some new parts in them, I prefer to use `\let`, which is more efficient than `\def`/`\newcommand` (which works fine in this case). ## Question Why hyperref doesn't like commands set via `\let` in section titles? ### Supplementary question If there is anything wrong with               \let\code\texttt      then how it should be fixed?


title: Defining color in minipage makes it too big for the current page

text: If I uncomment the first line of the `minipage`, the `minipage` is then too big to fit on the page. What's happening here?               \documentclass{article}     \usepackage{xcolor}     \usepackage{lipsum}     \pagestyle{empty}     \begin{document}          \noindent%     \fbox{%     \begin{minipage}           [t][\dimexpr\textheight-2\fboxrule-2\fboxsep\relax]              {\dimexpr\linewidth-2\fboxrule-2\fboxsep\relax}     %    \color{blue}              \lipsum[1-2]          \end{minipage}}          \lipsum[1-2]          \end{document}


title: How to disable the TeX primitive $$?

text: I would like to disable the LaTeX`$$` command (since I wrote things like `$equation1$$equation2$` for some reasons and I cannot merge the two equations) Is it feasible? Is there a command to "remove" a specific command so that when `latex` run , it will no more consider `$$` as a command? * * * I get from the lateX compiler :               Display math should end with $$.     <to be read again> \endgroup      The `$' that I just saw supposedly matches a previous `$$'. So I shall assume      that you typed `$$' both times.      This is an error from the compiler . OK Latex is maybe clever enough ( apparently not ) to understand that this is a block of two equations $equation1$$equation2$ but I want to remove ALL errors and Warning before submitting my paper . However the idea to substitute ${}$ to $$ is very simple and efficient since I never use $$ for math environement in my latex source . Nervertheless the questions remains to know if some lateX commands or primitives could be disabled ?


title: textpos for all pages - environment usage

text: I'm trying to put some text on topleft for every page of my appendix. I use textpos but it adds the text only one page. I thought I might use an environment and put the appendix between this environment but it didnt work, resulting just one page with the text I want. I want APPENDIX text in all of my appendix pages. How can I do it?               \setlength{\TPHorizModule}{30mm}     \setlength{\TPVertModule}{40mm}     \textblockorigin{0mm}{18mm}     % start everything near the top-left corner     \setlength{\parindent}{0pt}          \newenvironment{band}{          \pagestyle{fancy}     \rhead{}          \begin{textblock}{3}(0,0)     \textbf{APPENDIX A}     \end{textblock}          \begin{textblock}{3}(0,1)     \textbf{APPE\\NDIX}     \end{textblock}     }


title: how to extend header over the page margins?

text: I have defined the page margins and header as appears in the codes bellow, but I want the header to cover the page margin width too, in the pages after page 2 (all pages except the first page). I searched over the net but did not find any solution to it. ![enter image description here](http://i.stack.imgur.com/MLILa.png) ![enter image description here](http://i.stack.imgur.com/iKlXA.png)               \documentclass[standalone]{article}          \usepackage{marginnote}     \usepackage{fancyhdr}     \usepackage[pages=some]{background}     \usepackage{geometry}          \geometry{a4paper,               total=          {210mm,297mm},               left=            37.5mm,               right=           12.5mm,               top=             25mm,               bottom=          25mm,               bindingoffset=   0mm}          \pagestyle{fancy}          \lhead{\Huge \bf Title1}     \rhead{\Large \bf Title2}          \begin{document}          \noindent Some text here.Some text here.Some text here.     \reversemarginpar\marginpar{\raggedleft {\large \bf Subtitle} \\*[-.8pc]}     \\Some text here.Some text here.Some text here.          \end{document}


title: How to get accented unicode characters that can be copy-pasted?

text: The aim is to generate the .pdf with accented characters (the .tex file has mixed macro and unicode input), in a way that the .pdf text can be copy- pasted. An example:               \documentclass{article}          \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{tgpagella}          \begin{document}          Unicode input: ā ī ū ṃ ṅ ñ          Macro input: \=a \={\i} \=u \d{m} \.n \~n          \end{document}      Compiling with `pdflatex`, the above will visually produce the desired characters, but when you select and copy-paste them from the .pdf, you get               Unicode input: a  ̄ u m n ñ      ̄ı ̄ .  ̇     Macro input: a  ̄ u m n ñ      **Edit:**   Ulrike's answer explains what `pdflatex` is doing here.


title: Numbering slides within a frame

text: In trying to answer this question, I encounter the following problem. Consider the example below. I have three slides in Frame 1 which I want to print consecutively on three pages in a handout, and number them `1(a)`, `1(b)`, and `1(c)`. Following Martin Scharrer's comment in this answer, I define a counter `slideinframe` that has the same value as `\beamer@slideinframe`, which keeps track of the current slide number within a frame. The problem is when I use the counter in the body text, it produces the correct number; however, when used in the footline, the number is not correct. What's wrong here?               \documentclass[handout]{beamer}     \usetheme{Madrid}          % Define counter "slideinframe"     \makeatletter     \def\c@slideinframe{\beamer@slideinframe}     \makeatother          % Define new template style "frame renumbering"     \defbeamertemplate*{footline}{frame renumbering}     {       \leavevmode%       \hbox{%       \begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%         \usebeamerfont{date in head/foot}         \insertframenumber(\alph{slideinframe}) / \inserttotalframenumber\hspace*{2ex}        \end{beamercolorbox}}%       \vskip0pt%     }          \begin{document}          \begin{frame}{Frame 1}     This is frame \insertframenumber, slide (\alph{slideinframe})     \begin{itemize}       \item<1| handout:1> Handout 1       \item<2| handout:2> Handout 2       \item<3| handout:3> Handout 3     \end{itemize}     \end{frame}          \end{document}      ![enter image description here](http://i.stack.imgur.com/uIUYy.gif)


title: Filling a path without thinning the line

text: Consider the following MWE:               \documentclass{standalone}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}        \path[draw] (1,0) circle (1) (1.7,1.2);        \path[draw] (.5,-1) circle (1) (0.5,-2.2);        \path[clip] (.5,-1) circle (1) (0.5,-2.2);        \path[clip] (1,0) circle (1) (1.7,1.2);        \path[fill=white] (.5,-1) circle (1) (0.5,-2.2);     %  \path[draw] (1,0) circle (1) (1.7,1.2);     %  \path[draw] (.5,-1) circle (1) (0.5,-2.2);  add the commented lines to get the desired output     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/YU7TY.jpg) Is it possible to take the line width into account when filling the clipped region so that the border of the filled area is not thinner but keeps the original width? To achieve this result I do redraw both circles after the filling, but that sounds like a suboptimal solution to me.


title: How to make the equations at the center

text: (I'm using LyX). When I'm writing multiline equations, with `\aligned` the align of the equations is right, how can I make it to be center? For example: Here how it looks when I writing at math mode: ![enter image description here](http://i.stack.imgur.com/zhrJN.jpg) And this is what happens what I get out from it: ![enter image description here](http://i.stack.imgur.com/CClXj.jpg) How can I make that it will be centered? Thank you!


title: How to continue a piece of text so it is aligned with the last line of an inline multiline box?

text: Is there a way to have the continuation of a piece of text aligned with the last line of a multiline environment, such as `array`? For example, I would like to define the command               \newcommand{\setst}[2]{\{#1 \mid #2\}}      for the standard set comprehension notation from mathematics. As long as the second argument fits nicely on one line, the above works fine. However, it breaks down for multiline arguments. For example, I would like to write something like               \documentclass{article}     \usepackage{amsmath}          \newcommand{\setst}[2]{\{#1 \mid #2\}}          \begin{document}     \begin{equation*}     S_1 \cap (S_2 \cup S_3)     =     \setst{x}{\begin{array}[t]{@{}l@{}}               x \in S_1 \land {} \\               (x \in S_2 \lor x \in S_3)               \end{array}}     \end{equation*}     \end{document}      ![enter image description here](http://i.stack.imgur.com/S5sQQ.png) As shown above, this prints the `\}` on the same line as the `=`. Instead, I would like the output to look like ![enter image description here](http://i.stack.imgur.com/ywlGj.png) That is, the `\}` should appear at the end of the last line of the second argument to `\setst`. Is there a way to do this without manually expanding the definition of `\setst`? # Revised question Herbert's solution works excellently for many situations, but does not work well for similar constructs that may be nested. Consider, for example,               \documentclass{article}     \usepackage{amsmath}          \newcommand{\setstHerbert}[2]{\{#1 \mid \begin{array}[t]{@{}l@{}}#2\}\end{array}}          \begin{document}     \begin{equation*}     S_1 \cap (S_2 \cup S_3)     =     \setstHerbert{x}{x \in S_1 \land {} \\                      x \in \setstHerbert{y}{y \in S_2 \lor {} \\                                             y \in S_3}}     \end{equation*}     \end{document}      ![enter image description here](http://i.stack.imgur.com/4hCyh.png) To be typeset correctly, the outermost `\}` should be on the same line as `y \in S_3` and the inner `\}`. Is there some way to write a command that will allow nesting and still place the `\}`s on the appropriate lines? (I agree that nested set comprehensions are perhaps typographically questionable, but I'll be using these ideas to create an "isomorphic" command for pi-calculus parallel compositions, e.g. `(\nu x)(P | Q)` where `Q` may itself contain a pi-calculus parallel composition. For parallel compositions, nesting is not typographically questionable.)


title: Should I make my include file into a package?

text: I wrote an include file to allow me to draw certain diagrams (that have various different parameters) conveniently, by just calling macros within a tikzpicture. This file is now at about 1500 lines, although a fair amount of that is notes I wrote (in the form of TeX comments) on the various macros in case I come back later and need to remember quickly how they work. Or I suppose, in case someone else wants to use it. Anyway, I include this file in the preamble of my document just using the `\input` control sequence. But I know that the "standard" way of making reusable code is to create something called a "package". What extra work (if any) is involved in making this include file into a package, and how will I benefit (if at all)?


title: Cyrillic in glossary/acronym entry

text: I want to define acronyms and terms in Bulgarian. Unfortunately, when I do so, LaTeX gives a whole lot of errors and do not compile. Anything to help?               \documentclass[a4paper,10pt]{article}     \usepackage{ucs}     \usepackage[cp1251]{inputenc}     \usepackage[english,bulgarian]{babel}     \inputencoding{cp1251}     \usepackage[makeindex,acronym]{glossaries}     \usepackage[dvipdfm,unicode]{hyperref}     \hypersetup{colorlinks=true, linkcolor=black}     \makeglossaries     \newacronym{SVN}{SVN}{Apache Subversion Control}     %\newacronym{БДЖ}{БДЖ}{Българска държавна железница}     \begin{document}     \gls{SVN}     %\gls{БДЖ}     \pagenumbering{arabic}     \glossarystyle{altlistgroup}     \glsaddall     \printglossaries     \end{document}      When you remove the ''%'' from the comments you will see what am I talking about (I have commented the entry and citation of the Bulgarian acronym)


title: How can I get the explanation borders with pmatrix?

text: I have asked this question in chat. How can I add the explanation borders to the below matrix?               \begin{align*}      C_{D_{1\succ 2}, \mathrm{increasing}}    &= \underbrace{\begin{pmatrix} 1   &   -1  &   1 & -1  &   1   &   -1 &    1 & -1  \\ \end{pmatrix}}_{1\times 8\text{ matrix}}  \\      A_{D_{1\succ 2}, \mathrm{increasing}}    &=      \underbrace{\begin{pmatrix}      1   &   0   &   1   &   0   &   1   &   0   &   1   &   0   \\      0   &   1   &   0   &   1   &   0   &   1   &   0   &   1   \\      1   &   1   &   0   &   0   &   1   &   1   &   0   &   0   \\      0   &   0   &   1   &   1   &   0   &   0   &   1   &   1   \\      1   &   1   &   1   &   1   &   0   &   0   &   0   &   0   \\      1   &   1   &   1   &   1   &   0   &   0   &   0   &   0   \\      0   &   0   &   0   &   0   &   1   &   1   &   1   &   1   \\      \end{pmatrix}}_{7\times 8 \text{ matrix}}.      \end{align*}      I want this kind of $p_1, p_2, ...$ borders to the matrix above. I have been able to add them with blockarray and block here but now I need to add them to the existing pmatrix data-structure. How can I get it with the pmatrix? ![enter image description here](http://i.stack.imgur.com/DGkio.png)


title: How draw part of ring or broken ring in TikZ?

text: I'm trying to draw something like this using `TikZ`: ![enter image description here](http://i.stack.imgur.com/1zelT.png) It could be one ring which is broken or it could be different parts of different rings. The text should be also bent (not as shown on the `paint` picture:) I want to do it with some `TikZ` built in functions, objects. Is there a way to do it?


title: Optional argument problem

text: This example works but if I try to put an optional argument changing               \newcommand\TBLdiag[5]{%      in               \newcommand\TBLdiag[5][\tabcolsep]{%      it does not work anymore. Of course I call `\TBLdiag` with only four arguments then.               \documentclass[10pt,french]{article}     \usepackage[T1]{fontenc}     \usepackage{babel}     \usepackage[locale=FR]{siunitx}     \usepackage{array}     \usepackage{calc}     \usepackage{tikz,fourier,ragged2e}          \newcommand\TBLdiag[5]{%         \multicolumn{1}{|m{#2}|}{%         \hskip-\tabcolsep         \begin{tikzpicture}[baseline=0,anchor=south west,outer sep=0]             \path[use as bounding box] (0,0)                 rectangle (#2+2\tabcolsep,\baselineskip);             \node[minimum width={#2+2\tabcolsep-\pgflinewidth},                 minimum  height=\baselineskip+#3-\pgflinewidth]                 (box) {};             \draw[line cap=round]                 (box.north west) -- (box.south east);             \node[anchor=south west,align=left,inner sep=#1]                 at (box.south west) {#4};             \node[anchor=north east,align=right,inner sep=#1]                 at (box.north east) {#5};             \end{tikzpicture}%         \rule{0pt}{\baselineskip+#3-\pgflinewidth}%         \vspace{-.3\baselineskip}%\hskip-\tabcolsep         }     }          \begin{document}     \begin{tabular}{%         |>{\Centering}m{4.5cm}         |*{4}{>{\Centering}m{2.5em}|}}\hline          \TBLdiag{\tabcolsep}{4.5cm}{3.4em}{Coefficient\\ de frottement $c$}{Vitesse $V$\\ (en km/h)}&50&90&110&130\\ \hline     $c=\num{0,8}$\newline route s\`eche, bitume neuf &&&&\\ \hline     $c=\num{0,7}$\newline route s\`eche, bitume moyen &&&&\\ \hline     $c=\num{0,3}$\newline route mouill\'ee, bitume moyen &&&&\\ \hline     \end{tabular}          \end{document}      Thanks to `Steven B. Segletes` there is a minimal example that works / doesn't works :               \documentclass{article}     \usepackage{array}          \newcommand\TBLdiag[2]{% WORKS     %\newcommand\TBLdiag[2][]{% DOESN'T WORK          \multicolumn{1}{|m{3.4em}|}{X} }          \begin{document}     \begin{tabular}{|l|c|c|c|c|}\hline     \TBLdiag{0pt}{4.5cm}&50&90&110&130\\ \hline% WORKS     %\TBLdiag[0pt]{4.5cm}&50&90&110&130\\ \hline% DOESN'T WORK     \end{tabular}     \end{document}


title: Beamer and Pause : displaying a picture and in the meantime some text

text: I wrote the following code :               \begin{columns}         \begin{column}{.48\textwidth}                 \begin{block}{Context} \vspace{+0.05cm}                 \begin{itemize}                     \item Bob \pause                     \item Bob2 \pause                 \end{itemize}                 \end{block}         \end{column}         \hfill%         \begin{column}{.48\textwidth}                 \begin{figure}                 \centering                 \includegraphics[scale=0.18]{myPic.jpg}                  \caption{myPic title}                 \end{figure}         \end{column}     \end{columns}      I don't manage to display at first Bob AND in the meantime the entire figure myPic (picture+caption). First of all, using pause make the picture not hidden, and the caption is only read at the 3th step. I also tried to use                onslide<1>      for the figure but it didn't worked. Please also note that I am using :               \setbeamercovered{transparent}      To sum up, here are the steps I would like to obtain if possible. > Step 1: Bob and the entire figure (picture+caption) are displayed > > Step 2: Step 1 remains on screen + Bob2 is displayed Thank you in advance for your help.


title: There is no line here to end (figure)

text: I am having problems with:               \begin{figure}[h]       \centering       \includegraphics[scale=0.7]{img1}       \caption{Elaboraci\'on propia en base a la ECH2011.}     \end{figure}      I get the error:                 Latex error: There is no line here to end       See Latex manual or Latex Companion for explication       Type H return for inmediatly help       ...       1.51 \begin        {figure}[h]      This is my preamble:               \documentclass[10pt, a4paper, spanish]{report}     \usepackage[spanish]{babel}     \usepackage{ucs}     \usepackage[utf8x]{inputenc}     \usepackage{graphicx}     \usepackage{tabulary}     \usepackage{slashbox}     \usepackage{colortbl}     \usepackage{float}     \usepackage{multirow}      \setlength{\baselineskip}{20pt}     \setlength{\parindent}{0pt}     \addtolength{\topmargin}{-0.5in}     \addtolength{\textheight}{0.75in}     \addtolength{\oddsidemargin}{-0.5in}     \addtolength{\textwidth}{1in}     \renewcommand{\baselinestretch}{1.5}     \setcounter{secnumdepth}{2}     \begin{document}      I don't know what is the problem here.


title: \LR for long text

text: How can I use Left to Right command, \LR, for long text in a right to left document. It should exist some think like \begin{something} \end{something} but I cannot found it! My problem is in the bibliography section that use Eng.               \documentclass[ucs]{beamer}          \mode<presentation>     {       \usetheme{Marburg}       \setbeamercovered{transparent}     }          \setbeamerfont*{frametitle}{size=\normalsize,series=\bfseries}     \setbeamertemplate{navigation symbols}{}          \usepackage[persian, english]{babel}     \usepackage{fontspec}          \setmainfont[Script=Arabic,Numbers=Arabic]{XB Zar}     \setsansfont[Script=Arabic,Numbers=Arabic]{XB Zar}          \usepackage{tikz}     \usetikzlibrary{arrows}          \tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]          \AtBeginSubsection[]     {       \begin{frame}<beamer>{Outline}     \tableofcontents[currentsection,currentsubsection]       \end{frame}     }          \begin{document}     \selectlanguage{persian}     \input{translator-basic-dictionary-Persian.dict}     \input{translator-bibliography-dictionary-Persian.dict}     \input{translator-environment-dictionary-Persian.dict}     \input{translator-months-dictionary-Persian.dict}     \input{translator-numbers-dictionary-Persian.dict}     \input{translator-theorem-dictionary-Persian.dict}          \begin{frame}{نمایه}       \tableofcontents          \end{frame}          \section{مقدمه}          \appendix     \section<presentation>*{\appendixname}     \subsection<presentation>*{منابع}          \begin{frame}[allowframebreaks]       \frametitle<presentation>{For Further Reading}          \begin{thebibliography}{10}          \selectlanguage{english}          \beamertemplatearticlebibitems          \bibitem{MR94561}     Author1, Author2.     \newblock Title of article.     \newblock {\em Math. Systems Theory}, 29(3):271--291, 2001.          \end{thebibliography}     \end{frame}          \end{document}


title: Creating API document

text: Is there a Latex reference on how one should go about creating an API document? I've done some searching and mostly what I've found is using an existing API document (like a Java doc) and creating a Latex document from that. What I would like to do is to create an API document from scratch in Latex, I just can't find a guide on how to go about this. My API is for a web service, in which I want to list the JSON messages which client will user to interact with the service and responses.


title: Creating left to right and right to left dictionaries using Glossaries package

text: I want to produce two bilingual dictionaries Arabic-English and English- Arabic. I've found this discussion which seems of some interest for my needs... So I build this file, based on it               \documentclass[twocolumn]{article}     \usepackage{fontspec}     \usepackage{polyglossia}          \newcommand*{\glossaryname}{Dictionary}          \usepackage[nonumberlist,nopostdot,xindy]{glossaries}          \newcommand{\dictentry}[3][\dictlabel]{%      \def\dictlabel{#2}%      \newglossaryentry{#1}{name=#3,description={#2}}%      \glsadd{#1}%     }          \makeglossaries          \setmainlanguage{english}     \setotherlanguage[locale=mashriq]{arabic}     \setmainfont[Ligatures=TeX]{Linux Libertine O}     \newfontfamily\arabicfont[Script=Arabic,Scale=1.3,Mapping=arabicdigits]{Traditional Arabic}               \newglossarystyle{RLsuper}{%      \glossarystyle{super}% base this style on 'super'       \renewenvironment{theglossary}%         {\tablehead{}\tabletail{}%          \begin{supertabular}{lr}}% adjust column specifiers         {\end{supertabular}}%       % switch name and description columns:       \renewcommand*{\glossaryentryfield}[5]{%         \glsentryitem{##1}\glstarget{##1}{##3} & ##2\\}%     }               \begin{document}     %%% ENTRIES %%%%%%%%%%%     \dictentry{on}{\textarabic{هو}}%     \dictentry{ja}{\textarabic{انا}}%     \dictentry{pies}{\textarabic{كلب}}%     \dictentry{Dice}{\textarabic{زهرة نرد}}%     \dictentry{Commutative laws}{\textarabic{قوانين إبدالية}}%     \dictentry{Maximum likelihood estimate}{\textarabic{مقدر الاحتمال الأعظم}}%          \RTLdblcol     \printglossary[style=RLsuper]%          \end{document}      which gave on the first compilation a good pdf file (what I can't add to discussion because I don't know how!)... But when I copy this file and create another file which is strictly the same, for a second try, the compilation gave me a blank pdf file... An empty file... So my questions are:   1. What happens between the two compilations?   2. I want to create two dictionaries, one sorted in Arabic order, and the same dictionary but sorted in the English alphabet order, how can I do this?   3. For long entries like "Maximum likelihood estimate", can I split the glossary output in two lines (produced by macros like this, based on something like `\begin{tabular} m{2.5cm}m{2.5cm}} \end{tabular}` for example...   4. A question which seems simple, but of interest for me... How can I insert things like rules for example between the entries... exactly `\hrule\hrule`...  I can't try it because it doesn't compile! More generally, where are stocked the entries after sorting? How can I do small changes on it directly?


title: Find a figure environment which could ragged the text into.

text: I tried the `wragfig` package and `picins` package, but none of them could ragged the text into the figure. Does anybody know how to achieve the result: ![](http://i.stack.imgur.com/yNtNX.jpg)


title: How to customize beamer's color

text: I'm trying to replicate the following colour scheme in `beamer`, but am having difficulty in doing so: ![enter image description here](http://i.stack.imgur.com/WwUkg.jpg)               \documentclass[xcolor={dvipsnames}]{beamer}     \usetheme{CambridgeUS}          \setbeamercolor*{structure}{bg=PineGreen!20,fg=PineGreen}          \setbeamercolor*{palette primary}{use=structure,fg=white,bg=structure.fg}     \setbeamercolor*{palette secondary}{use=structure,fg=white,bg=structure.fg!75}     \setbeamercolor*{palette tertiary}{use=structure,fg=white,bg=structure.fg!50!black}     \setbeamercolor*{palette quaternary}{fg=white,bg=black}          \setbeamercolor{section in toc}{fg=black,bg=white}     \setbeamercolor{alerted text}{use=structure,fg=structure.fg!50!black!80!black}          \setbeamercolor{titlelike}{parent=palette primary,fg=structure.fg!50!black}     \setbeamercolor{frametitle}{bg=gray!10!white,fg=PineGreen}          \setbeamercolor*{titlelike}{parent=palette primary}          \author{The Author}     \title{Work Culture}     \begin{document}     \begin{frame}     \titlepage     \end{frame}          \begin{frame}     \frametitle{Test title}     \framesubtitle{Test subtitle}     test text     \end{frame}          \end{document}