title: \caption works in one file but not another

text: Hi I'm trying to display an image with a caption; the parent file ( **CODE1** ) calls the chapter file ( **CODE2** ) and the .sty file ( **CODE3** ). Here is the the "chapter" file... call it **CODE1**               \chapter{Introduction}\label{ch:intro}          \section{figure testing}\label{ch:intro:firstsection}     \begin{figure}[h]     \centering         \includegraphics[width=0.8\textwidth]{glow}         \caption{Glow discharge at 0.1mm, 0.5mm,1mm and 3mm.}     \end{figure}     \end{document}      Here is the parent file that calls the "chapter" file in the command `\newchapter{chapter2}` -- **CODE2** --               \documentclass[12pt,letterpaper]{report}     \usepackage[masters,2committee]{cuthesis}     \usepackage{array}     \usepackage{graphicx}     \usepackage{cite}     \usepackage{float}     \usepackage{subfigure}     \usepackage{amsmath,amssymb}     \usepackage{rotating}     \usepackage{setspace}     \usepackage{longtable}     \usepackage{psfrag}     \usepackage{rotating}     \usepackage{epsfig}     \usepackage{multirow}     \usepackage{hyperref}        \usepackage[version=3]{mhchem}     \usepackage{lmodern}     \usepackage{verbatim}      \usepackage{color}         \usepackage{url}     \usepackage[hang,footnotesize,bf]{caption}     \usepackage{amsmath}      \usepackage{verbatim}       \usepackage[latin1]{inputenc}     \usepackage{calc}          \DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps}          \begin{document}         \dept{Mechanical Engineering}         \title{Ignition systems}         \author{xxxxxx}         \submitdate{2040} \copyrightyear{2012}         \supervisor{John Doe, Supervisor}         \supervisor{Jane Doe, Industrial Partner}         \firstcommittee{J. Doe}         \departmentchair{Steve Doe, Department Chair}               \newchapter{chapter2}          \end{document}      Here is the .sty file that I received for the template. -- **CODE3** --               %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % This LaTeX package is used to create theses and dissertations at     % the Carleton University.  It was was written by UNIVERSITY OF RHODE ISLAND     % and modified for use at Carleton University by Calvin Rans from the     % Department of Mechanical and Aerospace Engineering.  It has several     % options which are described below.  Multiple options can be included     % as a comma separated list.  See the examples section for common uses. Some further alterations were made on behalf of the Carleton University Library by Joshua Kilberg.     %     %     %     % Options:     %   manuscript,standard: this specifies which format of thesis you will     %     be creating.  Manuscript format has the references at the end of each     %     chapter, while standard format has one reference section for the     %     whole document.  standard is the default.     %     %   phd,masters: this specifies whether this is a PhD. dissertation     %     or a masters thesis.  masters is the default.     %   DUE TO NEW CHANGES TO THE CARLETON LIBRARY SYSTEM, KEEP MASTERS     %  SELECTED, EVEN IF YOU ARE GETTING A PHD          %   1committee, 2committee, 3committee,4committee,5committee: this is the number of people     %     on your committee (in addition to the department chair), which determines how many signature lines     %     are needed.  Remember that the chairman of the committee     %     does not sign the thesis.  1committee is the default.     %     %   sequential,nonsequential: this specifies whether you want numbering     %     of figures, equations, and tables reset to 1 at the beginning of     %     each chapter (nonsequential), or if you want the numbers to     %     be sequential throughout the whole document.  The default is     %     nonsequential for Manuscript format and sequential for     %     Standard format.     %     %     % Examples:     %   For a standard format masters thesis:     %     \usepackage{cuthesis}     %   CARLETON DOES NOT USE THE WORD DISSERTATION, SO STICK WITH MASTERS     %   For a manuscript format PhD. dissertation:     %     \usepackage[manuscript,phd]{cuthesis}     %     %   For a standard format PhD. dissertation with a four member committee:     %     \usepackage[phd,4committee]{cuthesis}     %     %     % Notes:     %   Portions of this package were derived from the chapterbib     %   package (Version 1.5 (09-OCT-1995) Donald Arseneau), therefore     %   you should be sure not to use that package with this one due     %   to inevitable conflicts.     %     %   You will also need the file cubiblio.bst for creating the     %   bibliography.     %     %   This package has been designed to comply with the library's     %   format guidelines using either a 10pt or 12pt font, which is     %   specified in the \documentclass line.     %     %   By default the department named on the title page is Mechanical     %   and Aerospace Engineering, but that can be changed by putting the     %   command:     %     \dept{My Department}     %   in the main .tex file before any of the chapters are included.     %     %   The acknowledgements, contributions, and dedication sections are not     %   required, but the abstract section is.     %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %          \@ifundefined{DeclareOption}{}{% LaTeX2e option     \ProvidesPackage{cuthesis}[2003/04/04 \space  v 1.2]          \DeclareOption{manuscript}{\def\@wantmanuscript{true}}     \DeclareOption{standard}{}          \DeclareOption{phd}{\def\@phddissertation{true}}     \DeclareOption{masters}{}          \DeclareOption{nocopy}{\def\@nolibraryrights{true}}     \DeclareOption{copy}{}          \DeclareOption{noleadpages}{\def\@noleadpages{true}}     \DeclareOption{leadpages}{}          \DeclareOption{norefbib}{\def\@norefbib{true}}     \DeclareOption{refbib}{}          \DeclareOption{noextrapages}{\def\@noleadpages{true}\def\@norefbib{true}}     \DeclareOption{extrapages}{}          \DeclareOption{nonsequential}{\def\@wantnonsequential{true}}     \DeclareOption{sequential}{\def\@wantsequential{true}}          \DeclareOption{4committee}{\def\@fourcommittee{true}}     \DeclareOption{5committee}{\def\@fivecommittee{true}}     \DeclareOption{3committee}{\def\@threecommittee{true}}     \DeclareOption{2committee}{\def\@twocommittee{true}}     \DeclareOption{1committee}{}          \ProcessOptions     }          \@ifundefined{@wantmanuscript}{       % standard       \@ifundefined{@wantnonsequential}{}{\def\@nonsequential{true}}     }{       % manuscript       \@ifundefined{@wantsequential}{\def\@nonsequential{true}}{}     }          \def\bibliocite#1{%       \if@filesw\immediate\write12{\string\citation{#1}}\fi}          \@ifundefined{@wantmanuscript}{          \@ifundefined{@extra@b@citeb}{     % this is for use without the cite package     \def\@citex[#1]#2{%       \let\@citea\@empty       \@cite{\@for\@citeb:=#2\do         {\@citea\def\@citea{,\penalty\@m\ }%          \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%          \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi          \if@filesw\immediate\write12{\string\citation{\@citeb}}\fi          \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%            \G@refundefinedtrue            \@latex@warning              {Citation `\@citeb' on page \thepage \space undefined}}%            {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}     }     {     % this is for use with the cite package     \def\@nocite#1{\xdef\@no@sparg{\@ignsp#1 \! }% remove *ALL* spaces      \if@filesw \immediate\write\@auxout {\string\citation {\@no@sparg}}\fi      \if@filesw \immediate\write12{\string\citation{\@no@sparg}}\fi}     }          }     {          % this section is basically chapterbib          \newenvironment{cbunit}%     {\global\advance\c@inputfile\@ne \xdef\the@ipfilectr{@-\the\c@inputfile}%       \immediate\write\@auxout{\string\gdef\string\@extra@binfo{\@exele@b@citeb}}}%     {\gdef\the@ipfilectr{}%       \immediate\write\@auxout{\string\gdef\string\@extra@binfo{\@exele@b@citeb}}%       }          \let\cb@include\include     \def\include#1{\clearpage \cbunit \xdef\@currentipfile{#1}%       \cb@include{#1}%     \refsforcb%     \global\let\@currentipfile\@savedjobname\endcbunit}          \newcommand\cbinput[1]{\cbunit \xdef\@currentipfile{#1}%       \input{#1}\global\let\@currentipfile\@savedjobname\endcbunit}          \@ifundefined{@extra@binfo}{%       \def\bibcite#1#2{\global\@namedef{b@#1\@extra@binfo}{#2}}%     }{}          \@ifundefined{@exele@b@citeb}{%      \def\@citex[#1]#2{%        \let\@citea\@empty%        \@cite{\@for\@citeb:=#2\do%          {\@citea\let\@citea\citepunct%           \edef\@citeb{\expandafter\@iden\@citeb}%           \ifnum0=\value{mychapcitecount}%           \if@filesw\immediate\write\@auxout{\string\bibstyle{cubiblio}}\fi%           \if@filesw\immediate\write\@auxout{\string\bibdata{\@reffile}}\fi%           \setcounter{mychapcitecount}{1}%           \fi%           \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi%           \if@filesw\immediate\write12{\string\citation{\@citeb}}\fi%           \@ifundefined{b@\@citeb \@exele@b@citeb}{\mbox{\reset@font\bf ?}%              \@warning{Citation `\@citeb' in file `\@currentipfile'                  on page \thepage \space undefined}\G@refundefinedtrue}%           {\hbox{\citeform{\csname b@\@citeb \@exele@b@citeb\endcsname}}}}}{#1}}     }{}% 2nd arg of \@ifundefined{@exele@b@citeb}          \def\@iden#1{#1}          \@ifundefined{citeform}{\let\citeform=\relax}{}     \@ifundefined{citepunct}{\def\citepunct{,\penalty\@m\ }}{}          \xdef\@savedjobname{\jobname}% save root file name as a macro     \let\@currentipfile\@savedjobname     \gdef\the@ipfilectr{}     \def\@exele@b@citeb{\the@ipfilectr}     \newcount\c@inputfile \global\c@inputfile=0          \gdef\@extra@binfo{}  % in case .aux files are left from old run.          \@ifundefined{reset@font}{\let\reset@font\relax}{}     \@ifundefined{G@refundefinedtrue}{\let\G@refundefinedtrue\relax}{}          \let\cb@bibliographystyle\bibliographystyle     \def\cb@roottest{2\ifx\the@ipfilectr\@empty 1\else2\fi}          \def\bibliographystyle#1{\if\cb@roottest\cb@bibliographystyle{#1}\fi}          \def\bibliography#1{\if\cb@roottest%        \if@filesw\immediate\write\@auxout{\string\bibdata{#1}}\fi%        \fi \@input{\@currentipfile.bbl}}          \@ifundefined{PackageWarning}{\def\cb@warning{\@warning}}%      {\def\cb@warning{\PackageWarning{chapterbib}}}          \let\@test@defiii\@testdef          \def\@testdef#1#2#3{%       \if#1b\relax\@test@defiii b{#2\@extra@binfo}{#3}%       \else \@test@defiii #1{#2}{#3}\fi%     }          \@ifundefined{bibname}{\def\bibname{Bibliography}}{}          % end of chapterbib section     }          \renewcommand\contentsname{Table of Contents}          \newcounter{myfigcount}     \newcounter{mytablecount}     \newcounter{myeqncount}     \newcounter{mychapcitecount}     \newcounter{mychaptercount}     \newcounter{myappendixcount}          \def\myusefigurespage{%       \gdef\@myusefigurespage{true}     }          \def\myusetablespage{%       \gdef\@myusetablespage{true}     }               \makeatletter          \setlength{\oddsidemargin}{.5in}     \setlength{\textwidth}{6.0in}     \setlength{\marginparsep}{.2in}     \setlength{\marginparwidth}{1in}          \setlength{\topmargin}{-0.3in}     \setlength{\headheight}{0.25in}     \setlength{\headsep}{0.25in}     \setlength{\textheight}{8.6in}     \setlength{\footskip}{.5in}          \brokenpenalty=10000          \renewcommand{\baselinestretch}{1.6}     \renewcommand{\arraystretch}{1.4} % 1.3 spacing for tables and arrays          \def\myps@plain{%       \let\@mkboth\@gobbletwo       \let\@oddfoot\@empty\let\@evenfoot\@empty       \def\@evenhead{\thepage\hfil\slshape\leftmark}%       \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%     }          \def\ele@chapapp{}          \def\@makechapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright \normalfont         \ifnum \c@secnumdepth >\m@ne             \Large\bfseries \@chapapp\space \thechapter             \par\nobreak             \vskip 20\p@         \fi         \interlinepenalty\@M         \LARGE \bfseries #1\par\nobreak         \vskip 40\p@       }}               \def\@makeschapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright         \normalfont         \interlinepenalty\@M         \LARGE \bfseries  #1\par\nobreak         \vskip 40\p@       }}          \def\cl@chapter{%       \setcounter{mychapcitecount}{0}%       \@ifundefined{@nonsequential}{%         \@elt{section}\@elt{footnote}%       }{%         \@elt{equation}\@elt{figure}\@elt{footnote}\@elt{section}\@elt{table}%       }}     \def\thefigure{%       \addtocounter{myfigcount}{\value{figure}}%       \@ifundefined{@nonsequential}{%         \@arabic\c@figure%       }{%         \thechapter.\@arabic\c@figure%       }}     \def\thetable{%       \addtocounter{mytablecount}{\value{table}}%       \@ifundefined{@nonsequential}{%         \@arabic\c@table%       }{%         \thechapter.\@arabic\c@table%       }}     \def\theequation{%       \@ifundefined{@nonsequential}{%         \@arabic\c@equation%       }{%         \thechapter.\arabic{equation}%       }}                    \long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize         \interlinepenalty\interfootnotelinepenalty         \splittopskip\footnotesep         \splitmaxdepth \dp\strutbox \floatingpenalty \@MM         \hsize\columnwidth \@parboxrestore        \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext         {\rule{\z@}{\footnotesep}\ignorespaces           #1\strut}}}          \def\thebibliography#1{\chapter*{List of References     \@mkboth{}{}}\list      {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin     \labelwidth      \advance\leftmargin\labelsep      \usecounter{enumi}}      \setlength{\baselineskip}{0.70\baselineskip}      \def\newblock{\hskip .11em plus .33em minus .07em}      \sloppy\clubpenalty4000\widowpenalty4000      \sfcode`\.=1000\relax}     \let\endthebibliography=\endlist          \def\thesisbib{\chapter*{Bibliography     \@mkboth{}{}}\trivlist      \setlength{\baselineskip}{0.70\baselineskip}      \def\newblock{\hskip .11em plus .33em minus .07em}      \sloppy\clubpenalty4000\widowpenalty4000      \sfcode`\.=1000\relax}     \let\endthesisbib=\endtrivlist          \def\dept#1{\gdef\@dept{#1}}     \def\supervisor#1{\gdef\@supervisor{#1}}     \def\firstcommittee#1{\gdef\@firstcommittee{#1}}     \def\secondcommittee#1{\gdef\@secondcommittee{#1}}     \def\thirdcommittee#1{\gdef\@thirdcommittee{#1}}     \def\fourthcommittee#1{\gdef\@fourthcommittee{#1}}     \def\departmentchair#1{\gdef\@departmentchair{#1}}     \def\copyrightyear#1{\gdef\@copyrightyear{#1}} % \author, \title in report     \def\@title{}\def\@author{}\def\@dept{Mechanical and Aerospace Engineering}     \def\@supervisor{} \def\@firstcommittee{} \def\@secondcommittee{}     \def\@thirdcommittee{} \def\@fourthcommittee{} \def\@departmentchair{}     \def\@copyrightyear{\number\the\year}     \def\submitdate#1{\gdef\submitdate{#1}}          \def\@reffile{references}          \def\reffile#1{%       \def\@reffile{#1}     }          \def\abstract#1{%       \def\@abstract{#1}     }          \def\acknowledgements#1{%       \def\@acknowledgements{#1}     }          \def\contributions#1{%       \def\@contributions{#1}     }          \def\dedication#1{%       \def\@dedication{#1}     }          \def\acronyms#1{%       \def\@acronyms{#1}     }          \def\symbols#1{%       \def\@symbols{#1}     }               \def\@bibliofileext{bib}     \def\@bibliofile{\jobname\@bibliofileext}          \def\@awork{%     \@ifundefined{@phddissertation}{       thesis     }{       dissertation     }}          % Print title page     \def\titlep{%         \thispagestyle{empty}%         \begin{center}             {\Large\bf\@title}\\             \mbox{}\\             \mbox{}\\             by\\             \mbox{}\\             \mbox{}\\             {\textbf{\@author}}\\         \end{center}         \mbox{}         \begin{center}             A \@ifundefined{@phddissertation}{           Thesis         }{            Dissertation         } submitted to \\         the Faculty of Graduate Studies and Research\\         in partial fulfilment of\\         the requirements for the degree of\\         \@ifundefined{@phddissertation}{         % CHAGE BELOW MASTER OF ARTS TO MASTER OF SCIENCE OR DOCTOR OF PHIL...      \textbf{Master of Arts}\\     }{      \textbf{Doctor of Philosophy}\\     }     \mbox{in}         \end{center}         \mbox{}        % \begin{center}            % Norman Paterson School of International Affairs         %\end{center}         \mbox{}         \begin{center}             \@dept\\             Carleton University\\             Ottawa, Ontario, Canada\\             \submitdate\\         \end{center}         \mbox{}         \begin{center}             Copyright \copyright\\             \@copyrightyear\ - \@author         \end{center}\clearpage}               \long\def\signature#1{%       \begin{minipage}[t]{4in}         \vspace{.4in}         \hbox{\hfil\shortstack{\vrule width 3in height 0.4pt \\#1}}       \end{minipage}}          \def\comprof{%     \begin{minipage}[t]{1.5in}       \begin{flushright}         \@ifundefined{@phddissertation}{           Thesis         }{            Dissertation         }         Committee\\         Supervisor       \end{flushright}     \end{minipage}}          % Print signature approval page     \def\signaturepage{%     \thispagestyle{plain}%     \begin{center}         The undersigned recommend to\\         the Faculty of Graduate Studies and Research\\         acceptance of the \@ifundefined{@phddissertation}{           Thesis         }{            Dissertation         }\\     \end{center}     \mbox{}     \begin{center}         {\large\bf\@title}     \end{center}     \mbox{}     \begin{center}         Submitted by \textbf{\@author}\\         in partial fulfilment of the requirements for the degree of\\             \@ifundefined{@phddissertation}{      \textbf{\bf{Master of Science}}\\     }{      \textbf{\bf{Doctor of Philosophy}}\\     }     \end{center}     \vfill     \begin{center}       \begin{tabular}{rl}           & \signature{\@supervisor}\\         \@ifundefined{@twocommittee}{}         {           & \signature\@firstcommittee\\         }         \@ifundefined{@threecommittee}{}         {           & \signature\@firstcommittee\\           & \signature\@secondcommittee\\         }         \@ifundefined{@fourcommittee}{}         {           & \signature\@firstcommittee\\           & \signature\@secondcommittee\\           & \signature\@thirdcommittee\\         }         \@ifundefined{@fivecommittee}{}         {           & \signature\@firstcommittee\\           & \signature\@secondcommittee\\           & \signature\@thirdcommittee\\           & \signature\@fourthcommittee\\         }          & \signature{\@departmentchair}     \\     \end{tabular}     \end{center}     \vfill     \begin{center}{       Carleton University\\       \@copyrightyear}     \end{center}}          \def\startingpages{%       \setcounter{page}{0}       \pagestyle{plain}       \pagenumbering{roman}       \titlep      % \signaturepage       \immediate\openout12=\@bibliofile.aux       \immediate\write12{\string\bibstyle{cubiblio}}       \immediate\write12{\string\bibdata{\@reffile}}       \@ifundefined{@abstract}{}{         \doourabstract{\@abstract}       }       \@ifundefined{@dedication}{}{         \doourdedication{\@dedication}       }       \@ifundefined{@acknowledgements}{}{         \doouracknowledgements{\@acknowledgements}       }       \@ifundefined{@contributions}{}{         \doourcontributions{\@contributions}       }       \contentspages       \@ifundefined{@acronyms}{}{         \doouracronyms{\@acronyms}       }       \@ifundefined{@symbols}{}{         \dooursymbols{\@symbols}       }       \pagenumbering{arabic}       \pagestyle{myheadings}     }          \def\doourabstract#1{%       \sloppy       \chapter*{Abstract}       \addcontentsline{toc}{chapter}{Abstract}       \@ifundefined{@phddissertation}{         \thispagestyle{plain}         %\thispagestyle{empty}         \pagestyle{plain}       }{         \thispagestyle{plain}         \pagestyle{plain}       }       \input{#1}       \newpage       \pagestyle{plain}     }          \def\doouracknowledgements#1{%       \chapter*{Acknowledgments}       \addcontentsline{toc}{chapter}{Acknowledgments}       \input{#1}     }          \def\doourdedication#1{%       \newpage       \thispagestyle{plain}       \include{#1}     }          \def\doourcontributions#1{%       \chapter*{Contributions}       \addcontentsline{toc}{chapter}{Contributions}       \input{#1}     }          \def\doouracronyms#1{%       \chapter*{List of Acronyms}       \addcontentsline{toc}{chapter}{List of Acronyms}       \input{#1}       \newpage     }          \def\dooursymbols#1{%       \chapter*{List of Symbols}       \addcontentsline{toc}{chapter}{List of Symbols}       \input{#1}       \newpage     }          \def\contentspages{\newpage       \addcontentsline{toc}{chapter}{Table of Contents}       \tableofcontents       \newpage           \@ifundefined{@myusetablespage}{}{         {\addvspace{10pt}         \let\saveaddvspace=\addvspace         \def\addvspace##1{}         \addcontentsline{toc}{chapter}{List of Tables}         \listoftables         \let\addvspace=\saveaddvspace}       \newpage       }       \@ifundefined{@myusefigurespage}{}{         {\addvspace{10pt}         \let\saveaddvspace=\addvspace         \def\addvspace##1{}         \addcontentsline{toc}{chapter}{List of Figures}         \listoffigures         \let\addvspace=\saveaddvspace}       \newpage       }     }          \def\newchapter#1{%       \ifnum0=\value{mychaptercount}         \@ifundefined{@noleadpages}{           \startingpages         }{}         \setcounter{mychaptercount}{1}       \fi       \include{#1}     }          \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne                              \refstepcounter{chapter}%                              \typeout{\@chapapp\space\thechapter.}%                              \addcontentsline{toc}{chapter}%                                        {\ele@chapapp\space \protect\numberline{\thechapter}#1}%                         \else                           \addcontentsline{toc}{chapter}{#1}%                         \fi                         \chaptermark{#1}%                         \addtocontents{lof}{\protect\addvspace{10\p@}}%                         \addtocontents{lot}{\protect\addvspace{10\p@}}%                         \if@twocolumn                           \@topnewpage[\@makechapterhead{#2}]%                         \else                           \@makechapterhead{#2}%                           \@afterheading                         \fi}               \def\newappendix#1{%       \ifnum0=\value{myappendixcount}         \startappendix         \setcounter{myappendixcount}{1}       \fi       \include{#1}     }          \def\startappendix{%       \def\ele@chapapp{Appendix}       \@ifundefined{@wantmanuscript}{         \addcontentsline{toc}{chapter}{List of References}          \bibliographystyle{cubiblio}         \@ifundefined{@norefbib}{           \bibliography{\@reffile}         }{}         \newpage       }{}            \appendix       % This causes latex to number equations, tables, figures with       % A-1, A-2, ...     %  \renewcommand{\theequation}{\Alph{chapter}.\arabic{equation}}     %  \renewcommand{\thetable}{\Alph{chapter}.\arabic{table}}     %  \renewcommand{\thefigure}{\Alph{chapter}.\arabic{figure}}     }          % used for manuscript form chapter references     \def\refsforcb{%       \@ifundefined{@wantmanuscript}{       }{         \ifnum0=\value{mychapcitecount}           \relax         \else           \newpage           \addcontentsline{toc}{section}{List of References}     %      \addcontentsline{toc}{chapter}{List of References}           \bibliography{\@reffile}           \bibliographystyle{cubiblio}           \newpage         \fi       }     }          \def\biblio{%       \ifnum0=\value{myappendixcount}         \startappendix       \fi       \ifnum0=\value{myfigcount}         \relax       \else         \if@filesw\immediate\write\@auxout{\string\myusefigurespage}\fi       \fi       \ifnum0=\value{mytablecount}         \relax       \else         \if@filesw\immediate\write\@auxout{\string\myusetablespage}\fi       \fi       \addcontentsline{toc}{chapter}{Bibliography}       \@input{\@bibliofile.bbl}     }          \def\bibliox{\bibliography{\@reffile}}          \@ifundefined{@norefbib}{       \let\@enddocumenthook\biblio     }{       \let\@enddocumenthook\bibliox     }      Here is the error I recieve when trying to compile CODE2...               ./chapter2.tex:21: Undefined control sequence.     \@calc@post@scan ...st@scan \else \def \calc@next                                                        {\calc@error #1}\fi \fi \f...     l.21    \caption{                    Glow discharge at 0.1mm, 0.5mm,1mm and 3mm.}      Any idea why I'm getting this error??


title: How to show similar display of codes of different programming languages in LaTeX

text: I am very new to LaTeX and I am writing my thesis. In a chapter, I want to show my codes, which are in Mathematica. ![enter image description here](http://i.stack.imgur.com/WugdV.png) I use the `listings` package as follows:               \documentclass{article}       \usepackage{listings}       \begin{document}       \lstset{language=Mathematica}            \begin{lstlisting}       Do[i^j,{i,1,10},{j,1,10}]       \end{lstlisting}            \end{document}      However, the output is much different to what the code looks like in the Mathematica IDE (even if I use other languages in `\lstset{language=<name>}`): ![enter image description here](http://i.stack.imgur.com/jqN0q.png) I read some questions on the site but, in some of them, the font or color of the codes were not the same. Could you please help me to display something like the picture below in LaTeX? If it is important, I am using the BiDi package.


title: How can I start using resume templates with LaTeX?

text: I am trying to write my resume using Latex, to have a better document and attract more interest from the recruiters. Internet is full of places with lots of templates and walk-troughs to build it up. But, I am having a nightmare with all the stuff about packages, extensions, modes etc. For instance, if I use this template in the compilation time the system tells me that I need to have installed Xetex, in order to use a library. But I have it installed already! (at least Ubuntu Sw Centre told that). I need a briefly introduction of how libraries works in Tex, and an explanation how to use the different versions of Tex (e.g. europass, cvtex, etc). Could anyone help me?


title: how to write maximize over multiple conditions

text: All, I know how to write an equation if I am maximizing over one condition. For example,               $\max_{0 \leq x \leq 1} f(x)$      But I an not sure how to write it if I have to maximize the function over two conditions and I would like the second condition to appear below the first condition. Any help is appreciated.


title: \flushleft with p{} option in tabular

text: If I have defined `tabular` alignment with the `p{}` option,               \begin{tabular}{p{.3\textwidth}p{.7\textwidth}}     ...(contents)...     \end{tabular}      Is there a way to specify that I want it `\flushleft` without wrapping the contents of each cell in a `\parbox` or `minipage` environment? It might be trouble in the example above, but I have dozens of cells, so is not a very feasible solution (unless I program something with Emacs Lisp).


title: MSc thesis presentation

text: I have completed my MSc Thesis and now I want to create a presentation slide. I have got a good physics template which from Cambridge university. The pdf link is http://www.damtp.cam.ac.uk/research/gr/workshops/PASCOS/2011/presentations/Amin- pascos2011.pdf. Can you please give me the Latex or source file or similar presentations beamer/


title: How can I place numbers into marks of a plot?

text: I have the following plot ![enter image description here](http://i.stack.imgur.com/d1Amq.png) with this latex-source:               \documentclass{minimal}     \usepackage{tikz}     \usetikzlibrary{plotmarks}          %%%<     \usepackage{verbatim}     \usepackage[active,tightpage]{preview}     \PreviewEnvironment{tikzpicture}     \setlength\PreviewBorder{5pt}%     %%%>          % The data files, written on the first run.     \begin{filecontents}{function.data}     # n     m     1 1     1 2     2 1     1 3     2 2     3 1     1 4     2 3     3 2     4 1     1 5     2 4     3 3     4 2     5 1     \end{filecontents}          \begin{document}     \begin{tikzpicture}[y=.5cm, x=.5cm,font=\sffamily]         %axis         \draw (0,0) -- coordinate (x axis mid) (5,0);             \draw (0,0) -- coordinate (y axis mid) (0,5);             %ticks             \foreach \x in {0,...,5}                 \draw (\x,1pt) -- (\x,-3pt)                 node[anchor=north] {\x};             \foreach \y in {0,...,5}                 \draw (1pt,\y) -- (-3pt,\y)                      node[anchor=east] {\y};          %labels               \node[below=0.8cm] at (x axis mid) {n};         \node[rotate=90, above=0.8cm] at (y axis mid) {m};              %plots         \draw plot[mark=square*]             file {function.data};                %legend         \begin{scope}[shift={(4,4)}]          \draw (0,0) --              plot[mark=square*, mark options={fill=black}] (0.25,0) -- (0.5,0)             node[right]{f(m, n)};         \end{scope}     \end{tikzpicture}     \end{document}      Now I would like to place numbers into the marks or replace the marks by numbers. How is this possible?


title: Writing macros on file defined at compilation time

text: This is a follow-up to this question. I have a LaTeX3 code that reads a file formatted as follows:                <numberA> "<nameA>"      <numberB> "<nameB>"      <numberC> "<nameC>"      ...      and defines `\nameA` as `numberA`, `\nameB` as `numberB`, etc. Here is the code:                \documentclass{article}           \begin{filecontents*}{myinput.txt}         0.45 "wingTaperRatio"         12.0 "wingSpanMT"         10.2 "wingAreaMTSquared"      \end{filecontents*}           \usepackage{xparse}      \ExplSyntaxOn      \ior_new:N \l_ago_read_s           \iow_new:N \l_ago_write_s % I want to write on file as well           \tl_new:N \l_ago_read_tl      \NewDocumentCommand{\parseInput}{ m }        {         \ior_open:Nn \l_ago_read_s { #1 }              \iow_open:Nn \l_ago_write_s { mydefs.tex } % write this file!              \group_begin: \tex_endlinechar:D \c_minus_one         \bool_until_do:nn { \ior_if_eof_p:N \l_ago_read_s }           {            \ior_to:NN \l_ago_read_s \l_ago_read_tl            \tl_if_empty:NF \l_ago_read_tl            { \exp_after:wN \ago_process_line:w \l_ago_read_tl \q_stop }                 % \iow_now:Nx \l_ago_write_s  ???                }         \group_end:         \ior_close:N \l_ago_read_s         \iow_close:N \l_ago_write_s        }           \cs_new:Npn \ago_process_line:w #1 ~ " #2 " \q_stop        {         \cs_gset:cpn { #2 } { #1 }        }           \ExplSyntaxOff           \begin{document}           \parseInput{myinput.txt}           \wingTaperRatio, \wingSpanMT, \wingAreaMTSquared.           \end{document}      The question is: How the above code has to be modified in order to have all the definitions in `mydefs.tex` as follow?                \def\wingTaperRatio{0.45}      \def\wingSpanMT{12.0}      \def\wingAreaMTSquared{10.2}


title: \showbox and log file

text: I want to parse the output of the `\showbox` command externally. Is it possible to let `\showbox` write to another file than the .log file? If not, is it possible to temporarily change the name of the .log file?


title: Referring to specific sections in org-mode latex

text: I'm currently writing a report in org-mode. I have a couple of sections which have the same names, with the section names appearing both as a subsection of the background section, and as a section in themselves. The following example should show the issue that I'm coming across. In the document below, I want to refer to the two sections with duplicate names in the introduction. To refer to a section the `[[Section Name]]` syntax is used. A brief description of the usage is found in the org manual.               #+TITLE: Musings about Sections     #+AUTHOR: R. Chapter     #+OPTIONS:   H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t     #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc     #+INFOJS_OPT: view:nil toc:t ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js     #+LATEX_CLASS: article     #+LATEX_CLASS_OPTIONS: [a4paper,11pt]     * Introduction     In section [[The Use of Sections]], we speak about how sections are used. In section     [[How Sections Work]] we briefly introduce the implementation of sections. In     section [[How Sections Work]] we go into more detail about the inner workings of sections.     * Background     ** The Use of Sections     ** How Sections Work     * How Sections Work      Exporting this file to latex results in the first section with the duplicate name being referenced twice, where in fact the first section reference to "How Sections Work" should be to `sec-2-2`, and the second to `sec-3`.               \title{Musings about Sections}     \author{R. Chapter}     \date{\today}     \begin{document}          \maketitle          \section{Introduction}     \label{sec-1}          In section \ref{sec-2-1}, we speak about how sections are used. In section     \ref{sec-2-2} we briefly introduce the implementation of sections. In     section \ref{sec-2-2} we go into more detail about the inner workings of sections.     \section{Background}     \label{sec-2}     \subsection{The Use of Sections}     \label{sec-2-1}     \subsection{How Sections Work}     \label{sec-2-2}     \section{How Sections Work}     \label{sec-3}      Is there any way that I can refer to a specific section from within org-mode, given that I don't know what section reference it will be given when I export it?


title: Set biblatex smartand to small caps

text: I want to apply small caps to the final name delimiter using BibLaTeX. I tried the following               \documentclass{article}          \usepackage[spanish,es-minimal]{babel}     \usepackage[style=american]{csquotes}     \usepackage[style=authoryear-comp,backend=bibtex]{biblatex}          \AtBeginBibliography{%       \def\ifmknamesc{%         \ifboolexpr{ test {\ifcurrentname{labelname}}           or test {\ifcurrentname{author}}           or ( test {\ifnameundef{author}} and test {\ifcurrentname{editor}} ) }}          \renewcommand*{\mkbibnamefirst}[1]{\ifmknamesc{\textsc{#1}}{#1}}     \renewcommand*{\mkbibnamelast}[1]{\ifmknamesc{\textsc{#1}}{#1}}     \renewcommand*{\finalnamedelim}{\ifmknamesc{%       \addspace\textsc{\bibstring{and}}\space}{\addspace\bibstring{and}\space}}     }          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @InCollection{BarFoo82,       author    = {Mark Bar and John Foo},       title     = {Testing smallcaps and smartand},       booktitle = {Biblatex configuration},       editor    = {Tom Barfoo},       publisher = {Latex},       address   = {Knuth Place},       year      = {1982}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \nocite{*}          \begin{document}          \printbibliography          \end{document}      But since I'm writing in Spanish this is not working probably because the `smartand` counter is being used. **Edit:** Looking into the BibLaTeX `spanish.lbx` file, I found that one can add small caps changing the last two definitions there so that they become:               \gdef\lbx@es@smartand@e#1&{\endgroup \textsc{e}\nobreakspace}     \gdef\lbx@es@smartand@y#1&{\endgroup \textsc{y}\nobreakspace}      However, I would like to do this from the preamble of my document rather than modifying the `spanish.lbx` file itself. I tried putting the above lines between `\makeatother` and `\makeatother` but nothing changed. So how can I do it from the preamble?


title: Sidecaptions next to sidewaystables

text: I'd like to place a caption left/right next to my table which is rotated by 90 degrees. So the caption should be next (e.g. bottom right) to the table and both, the caption and the table should be rotated. I use \begin{sidewaystable} for the actual rotation of the table, but how can that be combined with a sidecaption? This sidecaption should only be an exception, all other table should have their caption top of the table (caption=tableheading)               \documentclass[caption=tableheading]{scrreprt}            \usepackage{rotating}          %%%%%%%%%%%%%%%     \begin{document}          \begin{sidewaystable}[htbp]         \caption{This is the Table caption that should appear next to the table}         \begin{center}     \begin{tabular}{ |c|c|c| }       \hline      cell1 & cell2 & cell3 \\       cell4 & cell5 & cell6 \\       cell7 & cell8 & cell9 \\       \hline     \end{tabular}     \end{center}     \end{sidewaystable}          \end{document}


title: Biblatex: cite an article published in several installments (multiple years and volumes)

text: I am using BibLaTeX with the `verbose-ibid` style and have customized it in accord with the specifications for my thesis. I now come to an article that was published in several installments over a period of 2 years, but always in the same journal and with the same title. I want to know how I can represent this to BibLaTeX and get an appropriate bibliography entry and citations. Let us say that the installments are:   * vol. 43 (1937), pp. 1-23   * vol. 43 (1937), pp. 390-417   * vol. 44 (1937), pp. 244-280   * vol. 45 (1938), pp. 17-43   * vol. 45 (1938), pp. 117-130 Note that this journal published two volumes per year. The bibliography entry may be the most complex part. It should look something like this: > J. Doe, _Insights on the history of plumbing,_ in _Plumbatica_ 43 (1937), > pp. 1-23, pp. 390-417, 44 (1937), pp. 244-280, 45 (1938), pp. 17-43, pp. > 117-130. I am flexible about the details of this: it would be acceptable to repeat the volume and year thus: > J. Doe, _Insights on the history of plumbing,_ in _Plumbatica_ 43 (1937), > pp. 1-23, 43 (1937), pp. 390-417, 44 (1937), pp. 244-280, 45 (1938), pp. > 17-43, 45 (1938), pp. 117-130. Because there is only such item in the bibliography, I would be perfectly happy with a manual solution that involved sticking everything after the first page range (1-23) into a special field that would be glommed on to the end of the bibliography entry. Perhaps I could just stick `\ppno~1--23, \ppno~390-- 417, 44 (1937), \ppno~244--280, 45 (1938), \ppno~17--43, \ppno~117--130` in the `Pages` field. The other problem is the citations. When I first introduce this source, I will list it with other sources on the same subject, and so I will have something very much like the bibliography entry, since this is a verbose style. Then I will proceed to cite passages from it. Each citation must have the correct volume and year. The thought occurred to me of using 5 entries in the bib file, one for each installment. However, I don't want 5 different entries in the bibliography, and with the verbose-ibid style, citations after the first would be shortened as if each installment were an independent source. **Edit:** here is the requested MWE. The results are acceptable, although they are occasionally a bit too verbose (see below). My question was really about best practices. If the best practice in this case is to abuse the pages field, I suppose it's answered.               \documentclass[12pt]{article}     \usepackage[style=verbose-ibid]{biblatex}     \usepackage[colorlinks=true]{hyperref}     \usepackage{filecontents}     \usepackage[nopar]{lipsum}          \begin{filecontents}{\jobname.bib}     @article{ref1,         title = {Insights on the history of plumbing},         author = {Doe, J.},         journal = {Plumbatica},         volume = {43},         pages = {\ppno~1--23, \ppno~390--417, 44 (1937), \ppno~244--280, 45 (1938), \ppno~17--43, \ppno~117--130},         year = {1937}}     @article{ref2,         title = {The rise and fall of asbestos piping},         author = {Newman, D.},         journal = {Annals of Plumbing},         volume = {35},         pages = {289--299},         year = {1965}}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \section{Title}          \lipsum[4]\footcites{ref1}{ref2}          \lipsum[1]\footcite[44 (1937), \ppno~250-256]{ref1}     \lipsum[5]\footcite[44 (1937), \pno~254]{ref1}          \lipsum[9]\footcite[297]{ref2}     \lipsum[2]\footcite[43 (1937) \ppno~15-18]{ref1}          \lipsum[6]\footcite[43 (1937) \ppno~15-18]{ref1}          \printbibliography     \end{document}      ![formatted example 1](http://i.imgur.com/k7yyPsc.png) In these citations, which appear on the first page, footnote 3 would ideally not repeat the volume and year, but would just have "Ibid., p. 254." However, I recognize that the ideal may not be worth the effort it would take to achieve. ![formatted example 2](http://i.imgur.com/fVKU44C.png) This is from page 2. In this case, I don't understand why footnote 5 does not just read "Ibid.", because the location passed to footcite is identical.


title: Customize a single book citation with bibtex

text: I'm using LaTeX from some years now and it comes the time to write some Theology papers. So, I'm working with a specific book that I'd like to cite differently inside my document. The first time I quote a passage, the book reference appears in the footnote as : Hans Urs von Balthasar. La dramatique divine. Trad. par Robert Givord et Camille Dumont. T. III - L’action. Namur : Culture et vérité, 1990, p.295. I know this is in French, but it's not very hard to understand what I'd like to do (so I hope!). You notice this is Volume III (T.III) of a 4 volume collection. And in this paper I will quote all the 4 volumes. The second time I quote this book, I get the following in the footnote : Idem, La dramatique divine, p.321 Notice that I don't get the volume reference anymore! This is not acceptable for me just because in this example I now it's in page 321 but I don't know from what volume. So, my question is : Is is possible to cite this specific book collection differently inside LaTeX? I'd like something like the following style in the footnote EVERY SINGLE TIME I quote theses books : DD.III.p.321 To cite for example the 3rd volume (III) from the book (Dramatique Divine) on page 321. If I'm going to cite volume II, I'd get this : DD.II.p.205 And so on… I hope this is clear… I've upload a single page edited PDF example here showing the results I'm expecting : http://goo.gl/xwMBwV Thanks in advance ! L.


title: Bibtex with "ociamthesis" class and Bibliography style "ormsv080"

text: I am writing my thesis using `ociamthesis` class and bibliography style `ormsv080`. I have a large number of citations and when I am compiling the master file which looks as following, I am not getting any citations. For all the citations, I am getting following error:               Citation `Gerchak1994' on page 3 undefined      If I run one of the chapters as a stand alone file, it works. The `.bib` file is in the same folder as the master file and chapter files. Please suggest a solution to the problem. Here is the master file:               %\documentclass[12pt]{ociamthesis}   % default square logo      \documentclass[12pt,squarelogo]{ociamthesis} % use old belt crest logo     %\documentclass[12pt,shieldcrest]{ociamthesis} % use older shield crest logo          %load any additional packages     \usepackage{hyperref}     \usepackage{amssymb}     \usepackage{natbib}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{setspace}     \usepackage{pdflscape}      \usepackage{graphviz}     \usepackage{caption}     \usepackage{bigstrut}     \usepackage{epstopdf}     \usepackage{graphicx}     \usepackage{caption}     %\usepackage{subcaption}     \usepackage{subfigure}          \bibpunct[, ]{(}{)}{,}{a}{}{,}%      \def\bibfont{\small}%      \def\bibsep{\smallskipamount}%      \def\bibhang{24pt}%      \def\newblock{\ }%      \def\BIBand{and}%               \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{amsthm}     \usepackage{natbib}     \usepackage{graphicx}     \usepackage{caption}     %\usepackage{subcaption}     \usepackage[margin=1in]{geometry}     \usepackage{verbatim}   % useful for program listings     \usepackage{color}      % use if color is used in text     \usepackage{subfigure}  % use for side-by-side figures     \usepackage{hyperref}   % use for hypertext links, including those to external documents and URLs     \usepackage{setspace}     \onehalfspacing          \setlength{\parskip}{10pt}     \setlength{\parindent}{0pt}          \newtheorem{Thm}{PROPOSITION}               \newtheorem{theos}{Theorem}          \newtheorem{hypos}{HYPOTHESIS}          %input macros (i.e. write your own macros file called mymacros.tex      %and uncomment the next line)     %\include{mymacros}          \title{}     %your thesis title,              %note \\[1ex] is a line break in the title          \author{}             %your name     \college{}  %your college          %\renewcommand{\submittedtext}{change the default text here if needed}     \degree{}     %the degree     \degreedate{}         %the degree date          %end the preamble and start the document     \begin{document}          %this baselineskip gives sufficient line spacing for an examiner to easily     %markup the thesis with comments     \baselineskip=18pt plus1pt          %set the number of sectioning levels that get number and appear in the contents     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}               \maketitle                  % create a title page from the preamble info     \include{dedication}        % include a dedication.tex file     \include{acknowlegements}   % include an acknowledgements.tex file     %\include{abstract}          % include the abstract          \begin{romanpages}          % start roman page numbering     \tableofcontents            % generate and include a table of contents     \listoffigures              % generate and include a list of figures     \listoftables     \end{romanpages}            % end roman page numbering          %now include the files of latex for each of the chapters etc          \include{Chapter1}     \include{Chapter2}     \include{Chapter3}     \include{Chapter4}     \include{Chapter5}               %now enable appendix numbering format and include any appendices     \appendix     \include{appendix1}     \include{appendix2}     \include{appendix3}          %next line adds the Bibliography to the contents page     \addcontentsline{toc}{chapter}{Bibliography}     %uncomment next line to change bibliography name to references     %\renewcommand{\bibname}{References}          \bibliographystyle{ormsv080}  %use the plain bibliography style     \bibliography{REF_SHELFSPACE}        %use a bibtex bibliography file refs.bib          \end{document}


title: Folded Paper Shape TikZ

text: I am trying to find a shape like a paper title folded at top and with some lines, emulating a ruled paper to use in other `tikz` picture. I have already seen some, and I do think they are done with `tikz` but I couldn't find the code. it could be like defining a new shape or just a command. ![enter image description here](http://i.stack.imgur.com/lJnYR.png) EDIT:               \documentclass{article}          \usepackage{tikz}          % taken from manual     \makeatletter     \pgfdeclareshape{document}{     \inheritsavedanchors[from=rectangle] % this is nearly a rectangle     \inheritanchorborder[from=rectangle]     \inheritanchor[from=rectangle]{center}     \inheritanchor[from=rectangle]{north}     \inheritanchor[from=rectangle]{south}     \inheritanchor[from=rectangle]{west}     \inheritanchor[from=rectangle]{east}     % ... and possibly more     \backgroundpath{% this is new     % store lower right in xa/ya and upper right in xb/yb     \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y     \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y     % compute corner of ‘‘flipped page’’     \pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter     \pgf@yc=\pgf@yb \advance\pgf@yc by-5pt     % construct main path     \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}     \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}     \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}     \pgfpathclose     % add little corner     \pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}     \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}     \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}     }     }     \makeatother               \begin{document}          \tikzstyle{doc}=[%     draw,     thick,     align=center,     color=black,     shape=document,     minimum width=20mm,     minimum height=15mm,     ]          \begin{tikzpicture}     \node [doc] {Test};     \end{tikzpicture}     \end{document}


title: File ended while scanning use of \url using Bibtex.

text: I have a problem with one of my bibtex items and I'm scratching my head to figure out what is wrong. I've narrowed it down to the specific reference, and in partiuclar the specific URL latex is having trouble compiling. It is the following:                   url = {http://www.opengroup.org/jericho/Jericho%20Forum%20Identity%20Commandments%20v1.0.pdf},      Usually this error occurs due to unbalanced paranthesis, but that is not the case here. What is problematic about this particular URL?


title: different sized page numbers due to \usepackage{helvet}?

text: I am at the end of finishing my thesis and after printing it out for final corrections I recognized that the sizes of the page numbers differ sometimes. For example page "10" and page "11". Especially when printing it out it seems to be even worse. Here is a "minimal" example.               \documentclass[paper=a4 , twoside=false, 11pt, numbers=noenddot, bibliography=totoc, listof=totoc]{scrreprt}          \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}     \usepackage[ngerman,USenglish]{babel}          \usepackage{helvet}     \renewcommand{\familydefault}{cmss}          \usepackage{type1ec}          \usepackage{fancyhdr}     \lfoot[\fancyplain{}{}]{\fancyplain{}{}}     \rfoot[\fancyplain{}{}]{\fancyplain{}{}}     \cfoot[\fancyplain{}{\footnotesize\thepage}]{\fancyplain{}{\footnotesize\thepage}}     \lhead[\fancyplain{}{\footnotesize\nouppercase\leftmark}]{\fancyplain{}{}}     \chead{}     \rhead[\fancyplain{}{}]{\fancyplain{}{\footnotesize\nouppercase\sc\leftmark}}               \begin{document}          \pagestyle{plain}          \chapter*{Abstract}          \pagenumbering{Roman}          \tableofcontents     \newpage          \newcounter{romancount}     \setcounter{romancount}{\value{page}}          \setcounter{page}{1}     \pagenumbering{arabic}          \pagestyle{fancy}          \chapter{Introduction}     \chapter{Theoretical Background}     \chapter{Measurements}     \chapter{Results}          \clearpage     text     \clearpage     text     \clearpage     text     \clearpage     text     \clearpage     text     \clearpage     text     \clearpage          \chapter{Conclusion and Outlook}          \newpage     \pagenumbering{Roman}     \setcounter{page}{\value{romancount}}          \listoffigures     \clearpage          \listoftables     \clearpage          \addchap{List of Abbreviations}                 %adds a chapter without numerating it     \markboth{List of Abbreviations}{}          %add the name of the chapter to headings          \end{document}      any ideas?


title: How to generate n points on a circumference and connect all of them while having constraints on the image size?

text: I have to generate a circle that has n points on the circumference that have to be connected with all possible cords. I drew the required picture using Geogebra and tried exporting it as a normal `png`. However the quality of the png file was not good enough, thus I decided to export the image as an eps file. If I include the `eps` in my file the picture is displayed, but as I resize it, the lines become either too wide or, the indices of the points become so small that the picture is not useful. So I tried to export the image in terms of PGF/TikZ code. But I had the same problem. I cannot predict how big the image will be, thus after exporting I have to resize it. So my question is what should I do ? Is there an easier way to draw such circle? What can I do about the image size, so I will not need to resize the image every time ?


title: Texmaker pdflatex compile error with libertine font after updating Texlive 2012

text: After updating the texlive 2012 in Ubuntu 12.04 by               # tlmgr update --all      I found `pdflatex` (within Texmaker) cannot compile a TeX file with the Libertine font               \usepackage{libertine}                        % libertine     \usepackage[T1]{fontenc}     \usepackage[libertine]{newtxmath}          However, in Terminal the tex file can be compiled by the command               $ pdflatex  thesis.tex      I even uninstalled and reinstalled Texmaker, the problem still persists.


title: multipage tables with ctable package

text: Does anybody know if it is possible to have a multipage table with the package `ctable` (I know that it is possible with `longtable`)? My code is the following:                \documentclass{article}         \usepackage[utf8]{inputenc}         \usepackage[T1]{fontenc}         \usepackage{lmodern}         \usepackage[english]{babel}         \usepackage[babel]{csquotes}         \usepackage{array}         \usepackage{booktabs}         \usepackage{caption}         \usepackage{subfig}         \usepackage{rotating}         \usepackage{ctable}              \begin{document}         \ctable[         caption = Data Definitions and Sources,         label = data,         sideways         ]         {>{\bfseries}l p{0.3\columnwidth} c  c  p{0.3\columnwidth}}         {         }         { \FL         ....         }         \end{document}


title: Emoji Characters

text: I'm trying to display Emoji Characters inside my XeLaTeX Document. It seems to work for some glyphs like the numbers and pound sign but not for all. Here is a MWE:               \documentclass{scrartcl}      \usepackage{fontspec}          \setmainfont{Apple Color Emoji} % The emoji Font           \begin{document}     \char"0030{}  %Works     \char"1F60D{} % Doesent Work should out put SMILEY FACE WITH HEART SHAPED EYES     \end{document}      What is the reason for this strange behavior and is there a way to include Emojis in XeLaTeX? Edit: ![selected emjoi](http://i.imgur.com/pX5tE.png) It seems the Character is there. It is selectable but not visible. I can copy&paste it.


title: mathtools: tagging with words and a number in align

text: How does one tag an equation with both words and numbers?               \documentclass{article}     \usepackage{mathtools}     \newenvironment{Dequation}     {%                                                                                \def\tagform@##1{%                                                                         \maketag@@@{\makebox[0pt][r]{(\ignorespaces##1\unskip\@@italiccorr)}}}%                \ignorespaces                                                                          }     {%                                                                                \def\tagform@##1{\maketag@@@{(\ignorespaces##1\unskip\@@italiccorr)}}%                   \ignorespacesafterend                                                                  }     \makeatother     \begin{document}     \begin{Dequation}     \begin{align*}     3 &= 3\\     4 &= 4\\     6 &= 6\tag{since $x_0 = 0$}\label{six}     \end{align*}     \end{Dequation}     \end{document}      So I want to reference my equation, but I want the reference to be `equation (1)`. Therefore, it would seem strange if the equation wasn't numbered if someone was looking for that reference.


title: How to tell LyX to put every sentence on its own line?

text: I'm planning to write my master thesis using LyX. In order to keep track of recent changes, I want to export the LyX source files to normal LaTeX source files and put these in a Git repository. In the LaTeX source files, I want each sentence to be on its own line so that I can track changes of my text in a more fine-grained way. Is there maybe a macro or a command with which I can tell LyX to put each sentence on its own line in the exported LaTeX source files? If not, is there a way to write my own macro which can achieve that? Thank you very much in advance!


title: Are bitmap fonts too fuzzy or is it just me?

text: ![Latex Font](http://i.stack.imgur.com/hXFmX.png) The above text was rendered with LaTeX. The text below was rendered in Libre Office. ![Libre Office Font](http://i.stack.imgur.com/3CbW4.png) You can see that there is a big difference in clarity, I think. Is it just me? How can I get LaTeX to produce documents with the same clarity as Libre Office? As far as I know, the reason for this difference is that LaTeX uses bitmap fonts, and applications like Libre Office use outline fonts. Is that right?


title: Article inside report

text: I need to place an article inside a document created with the `report` class. That means, I need a LaTeX document inside my report, where it is multicolumn'ed and the references are set in the multicolumn'ed article. How can this be achieved? I figured out that I can make it multicolumned by               \begin{multicols}{3}     \end{multicols}      But I can not figure out how to do the same with the references. And how can I insert figures in only one column (I know they're very small pictures)?


title: Problem with \acs from acronym package: No link in list of acronyms

text: It appears that when using the `acronym` package, a link including the page number is only created in the list of acronyms when using `\acf`, but not with `\acs` nor `\acl`. This is a problem in the following case where I'd like to introduce an acronym like this:               \acs{TMS}, which was originally introduced as abbreviation for \acl{TMS}, can be used to ...      Is there a way to make `\acs` or `\acl` produce a link to this line in the list of acronyms? **Minimal Example**               \documentclass{scrartcl}          \usepackage[printonlyused, withpage]{acronym}     \renewcommand{\bflabel}[1]{\normalfont{\normalsize{#1}}\hfill}          \begin{document}          \section{Body}          \acs{TMS}, which was originally introduced as abbreviation for \acl{TMS}, can be used to ...          The \acf{AWL} works.          \section{Somewhere else...}          \begin{acronym}[abc]       \acro{TMS}{This Means Nothing} % has no page number in list of acronyms :(       \acro{AWL}{Acronym With Link}     \end{acronym}          \end{document}


title: Continuous reading mode in TexWorks built-in pdf viewer?

text: I recently downloaded TeX Live 2013 to use LaTeX on my Windows 7 machine. I like the interface of the TeXworks editor that came with it because it is similar to TeXShop that I like a lot when I am using my office Mac, so I wanted something similar for my (Windows) home machine. It works great except that I cannot use its built-in PDF viewer in a continuous scroll mode. As I scroll down, at the end of each page it stops, and needs an extra scroll to jump to the next page, without the ability of showing the bottom of the previous page and the top of the new page at the same time. I could use another PDF viewer like acrobat but I think they do not support sync between the TeX document that created it so that I ctrl+click one to jump to the corresponding paragraph in the other, which is a big convenience that I don't want to give up either. Is there a way to configure TeX Live/TeXworks in a way to have continuous pdf view mode?


title: Can I make documentclass{book} look more like a book?

text: I am fairly new to LaTeX and am trying to write a book. Being a newbie I plumped for `\documentclass{book}` because that seemed like the obvious choice but I can't get it to look like a book. I'm fairly certain the person who wrote it didn't take the time to look in a book to see what a book looks like because no book I've ever seen looks like this. I am almost at the point where I'm going to design my own document class but I would like you guys to talk me out of it. I'm fairly certain the deficiencies can be fixed, but I don't have the experience to know how to do it. **List of things it does right:**   * the basic structure with chapters starting at chapter 1 to chapter n works fine.   * the basic formatting of paragraphs and margins on double pages is fine.   * I can have end matter: Glossary, Notes, Appendix, Bibliography, Index.   * I would like to have more than one index (index of place names and a general index) and this may be possible but I have not looked at this yet.   * I can include maps and diagrams in the text, but there is a problem (see below)   * the control sequence \maketitle makes a default title page, but it does not work well (see below)   * the control sequence \tableofcontents makes a table of contents but it does not work well (see below)   * page numbers do not appear on the first page of prelims/chapters (expected behaviour)   * there are headers and footers available but they could work better (see below) **List of things it doesn't do, or doesn't do well enough:**   * `\maketitle` gives me only one title page but proper books have two title pages, the half-title and the title page. neither of these has the date on it, so I have to design two new title pages.   * the title pages should function as double pages so that I can put the colophon on title-verso.   * the headers and footers on prelims (the sections that go before chapter 1) are poorly controlled   * headers and numbers appear on blank pages between sections. a blank page should be blank.   * if `\tableofcontents` is included, headers in prelims or un-numbered chapters all say CONTENTS   * page numbering should be in roman for prelims and then arabic from chapter 1, but the numbers should be consecutive and chapter 1 does not start at page 1.   * I would like to have a short form of the book title and a short form of the chapter title in the header, title on verso pages and chapter on recto pages, but have been unable to discover the functionality for assigning these short forms to a command that affects the headers. I have looked at a number of alternatives.   * I tried creating my own title page but was unable to find a way of having whitespace at the top of the page. neither `\par` nor `\vspace` nor `\\\\[length]` work unless there is already something there. The Wiki suggested placing a small dot there, but there is (IMHO) no part of the phrase, "professional typesetting" that requires placing on pages things we hope the reader will not see.   * I tried both `fancyhdr` and `titleps`, both of which worked up to a point but as soon as I put the `\tableofcontents` in my document the headers and footers in prelims went haywire. I have not been able to find the functionality to do internal referencing. I would like to be able to refer to my maps by saying, "please see the map of the Syrian desert on page 36," or something like that, and have LaTeX provide the number of the page where the map actually is. This would require tagging the map in some way and I'm sure this is going to be possible but I have not been able to locate the command. **So, these are my questions:**   * is there some other document class I should be using? I only know standard classes so there might already be a class that does what I want so if possible I would prefer not to reinvent the wheel.   * are there already packages that can fix the problems with the book class that I identified above?   * is there a specific answer to my question about controlling whitespace?   * is there a specific answer to my question about multiple indexes. is this possible, are you able to recommend a package?   * is there a specific answer to my question about tagging my maps?   * is there a way to find out what `\tableofcontents` is coded to do so that I can figure out why it messes up the headers and footers?   * are there packages other than the two I mentioned for getting headers and footers the way I want? If it makes any difference I am on Windows-XP using MiKTeX with TexStudio as my editor.


title: Package trackchanges: problem with UTF8

text: the package `trackchanges` doesn't seem to work with utf8 encoding. Did somebody encounter the same problem? Does anybody have a solution ? **Minimal example** :               \documentclass[12pt]{article}     \usepackage[utf8]{inputenc}      \usepackage{trackchanges}     \begin{document}         text \remove{öäü}     \end{document}      The compilation error :                ! Argument of \UTFviii@two@octets has an extra }.     <inserted text>     \par     l.6 text \remove{öäü}     I've run across a `}' that doesn't seem to match anything.      Wit oau instead of öäü, it works of course.


title: How to change the apacite citation style to list only "first author et al." for entries with three or more authors

text: I need to change the format of my bibliography in order to have one author or at maximum two authors. I use `bibtex` and the `\bibliographystyle{apacite}`. Sometimes the citations are reported as "first author et al.", but the majority of times the citations are very long with up to five or six authors. I overrode the default `apacite.bst` by creating a new `myapacite.bst`. Then, I modified the lines of the function `authors.reflist.apa6` from #7 to #2. Finally, I copied this file both inside the directory of `main.tex` and inside the directory `/usr/share/texlive/texmf-dist/bibtex/bst/apacite` (Ubuntu 14.04) and I updated the database with `sudo -H mktexlsr`. As last thing, I changed my bibliography style               \usepackage{apacite}     \bibliographystyle{myapacite}      Unfortunately, I does not work. I searched a lot without finding a solution. What I missing?


title: How can I improve the look of my table? (no white space, nice font size, and not going off the end of page)

text: I just want a nice plot but I try different things and sometimes it goes of the page, or there is white space (like now). I would like adequate spacing between lines and varying font heights. Here is my code:                   %\renewcommand{\tabcolsep}{3pt}     \begin{table}       \centering         \begin{longtabu}{|p{0.2\textwidth} | p{0.1\textwidth}| p{0.1\textwidth}| p{0.1\textwidth}| p{0.1\textwidth}| p{0.1\textwidth}|}          & \bfseries{AVISO} & \bfseries{CU} & \bfseries{GSFC} & \bfseries{NOAA} & \bfseries{CSIRO}  \\         \midrule         \bfseries{Minimum Ocean depth} & 0\,m & 120\,m & 120\,m & 0\,m & 0\,m \\         \bfseries{SSHA outlier removal} & - & 2\,m & - & 1\,m & - \\         \bfseries{Along track / box-gridded} & box-gridded & Along track & Along track & box-gridded & box-gridded \\         \bfseries{Box resolution} & $3^{\circ}$x$1^{\circ}$ & - & - & $3^{\circ}$x$1^{\circ}$ & $1^{\circ}$x$1^{\circ}$ \\         \bfseries{Time range of average} & per cycle & per cycle & per cycle & per cycle & monthly \\         \bfseries{Weighting} & area weighted, inclination weighted & inclination weighted & inclination weighted & area weighted & area weighted \\          \bottomrule          \end{longtabu}          \caption{caption here}     \end{table}      I also tried using `\usepackage{tabularx}` with no luck, I guess I am missing something but I'm not sure what....


title: Remove year, brackets and dot from @onlinesource in footnote

text: This is my MWE:               % !TEX encoding = UTF-8 Unicode     % !BIB TS-program = biber          \documentclass[a4paper,12pt]{article}          \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[english,german]{babel}     \usepackage{csquotes}               \usepackage[citestyle=verbose-ibid,bibstyle=authoryear,sorting=nyt,backend=biber,]{biblatex}          \urlstyle{rm}          \usepackage{filecontents}          \begin{filecontents}{literatur.bib}         @online{blk,           url = {http://www.blk-bonn.de/papers/forum-bildung/band06.pdf},           date-added = {2014-02-09 12:34:08 +0000},           date-modified = {2014-02-09 13:32:07 +0000},               urldate = {2014-02-04}         }          @article{test1,         Author = {Shen Ain and Brian W. Kernighan},         Date-Modified = {2014-02-04 20:18:03 +0000},         Journal = {Operations Research},         Title = {An Effective Heuristic Algorithm for the Travelling-Salesman Problem},         Volume = {21},         Year = {1973}}     \end{filecontents}          \addbibresource{literatur.bib}          \begin{document}          Here is a cite for online \footcite{blk}          And here is a cite for article \footcite{test1}          \end{document}      this gives me: ![enter image description here](http://i.stack.imgur.com/v0V7c.png) Now, I remove the "URL:" in front of the URL:               \DeclareFieldFormat{url}{\url{#1}}      and change the text for the date url from "(Besucht am xx.xx.xxx)" to "aus dem Internet entnommen am" with:               \DeclareFieldFormat{urldate}{aus dem Internet entnommen am #1}      Now I have: ![enter image description here](http://i.stack.imgur.com/76XuC.png) And Now, I want to remove the year, the brackets around the year and the dot _only_ from '@online', but I have no idea how to achieve this...


title: input files in different directories

text: I have following example directory structure.               ArticlesWritten     -       ArticleA     -   -       FileOnlyInArticleA.tex     -   -       Introduction.tex     -   -       main.tex     -   -       MainAsChapter.tex     -   -       RelatedWork.tex     -   -     -       ArticleB     -           FileOnlyInArticleB.tex     -           Introduction.tex     -           main.tex     -           MainAsChapter.tex     -           RelatedWork.tex     -     thesisFiles         FileOnlyInThesis.tex         Introduction.tex         main.tex         RelatedWork.tex      ArticleA , ArticleB is article document class while thesis is book document class. main.tex is main file for directories. I input other files from this main file. They work normal as individually. I am trying to include ArticleA and ArticleB to thesis. I added MainAsChapter.tex to ArticleA and ArticleB. MainAsChapter.tex does not contain any latex document commands except inputs. When I try to input following command in thesis/main.               \input{Introduction}     \input{RelatedWork}     \input{FileOnlyInThesis}     \input{../ArticlesWritten/ArticleA/MainAsChapter}      last line works but input commands in ArticleA/MainAsChapter are interpreted as coming from thesis directory. It include Introduction and RelatedWork files from thesis directory and can not find for example FileOnlyInArticleA. If I use               \input{../ArticlesWritten/ArticleA/MainAsChapter}      I get following error ! LaTeX Error: File `FileOnlyInArticleA.tex' not found. If I use               \import{../ArticlesWritten/ArticleA/}{MainAsChapter}      I do not get any error but input commands in MainAsChapter include Introduction, RelatedWork from MainInThesis. So I get following output.               Introduction Thesis     Related Work Thesis     FileOnlyInThesis     Introduction Thesis     Related Work Thesis     FileOnlyInArticleA      Second Introduction and RelatedWork should come from ArticleA. Manual of import mentions that > Depending on on how your TEX system is configured, if a file with the same > name as the import file exists in the current directory or in the TEXINPUTS > path, that other file will be read in preference to one in the import > directory. Correct Usage is               \import*{../ArticlesWritten/ArticleA/}{MainAsChapter}      This gives me , expected output of               Introduction Thesis     Related Work Thesis     FileOnlyInThesis     Introduction ArticleA     Related Work ArticleA      FileOnlyInArticleA


title: How can I mimic Griffiths' electrodynamics textbook?

text: This is such a beautiful textbook; very dear to me. I think it has a great font - which I know is Times New Roman. But somehow, I can't even get close to it. One of the main obstacles is making the font thicker somehow. Anyways, here is a sample page. If anyone can translate it into TeX, I'd be impressed. ![enter image description here](http://i.stack.imgur.com/gLubH.png) P.S. The main issue is to somehow make the Times New Roman font a little thicker. Here is my attempt - is there any way to make this look a little less corny?: ![enter image description here](http://i.stack.imgur.com/bapK4.png)


title: Pagebreak in left column (Friggeri CV): There's no line here to end

text: I am using Friggeri's CV Template and was wondering whether it would be possible to make a pagebreak or columnbreak to write something in the left column in the second page. I have tried \pagebreak, \newpage, \columnbreak... I have tried \vfill and \leavevmode before and still nothing... I always get the error:                There's no line here to end.      I would also want to write things in the left column in subsequent pages, and at different heights, so a plus would be not only make the columnbreak, but select the vertical position in the page... Using the same friggeri-cv.cls (I have only changed all the Helvetica fonts to Arial and added backend=biber to the \RequirePackage{biblatex} line), here is a MWE:               %!TEX TS-program = xelatex     \documentclass[]{friggeri-cv}     \listfiles     \addbibresource{bibliography.bib}          \usepackage{lipsum}          \begin{document}     \header{name}{surname}            {occupation}          % In the aside, each new line forces a line break     \begin{aside}       \section{about}         aaa         bbb         ccc         ddd     \end{aside}          \section{summary}     \lipsum     \lipsum          \end{document}      The objective would be to add another section in the left column at the top of the 2nd page, and yet another section in that column at the bottom of the 3rd page... Any help would be appreciated! Many thanks! **EDIT:** Following up with this, I have made a footer, but it spans only the length of the right column. Any idea on how to make it span the whole length of the page? Or better yet, to do so only in the last page? Or even better, to leave the footer as is, and create another footer for the left column that only appears in the last page? A MWE as the one above, but including the footer, would be:               %!TEX TS-program = xelatex     \documentclass[]{friggeri-cv}     \listfiles     \addbibresource{bibliography.bib}          \usepackage{lipsum}               %%%%%%%%%%     % Footer %     %%%%%%%%%%     \usepackage{fancyhdr,lastpage}     \pagestyle{fancy}     \fancyhf{} % sets both header and footer to nothing     \renewcommand{\headrulewidth}{0pt}     \setlength{\footskip}{50pt}     \fancyfoot[L]{\textbf{Name Surname}}     \fancyfoot[C]{\textit{Occupation}}     \fancyfoot[R]{\thepage\ of \pageref{LastPage}}     %%%%%%%%%%%               \begin{document}     \header{name}{surname}            {occupation}          % In the aside, each new line forces a line break     \begin{aside}       \section{about}         aaa         bbb         ccc         ddd     \end{aside}          \section{summary}     \lipsum     \lipsum          \end{document}


title: Variant of DocStrip's \file that doesn't add .tex extension

text: For a class I want to upload on CTAN, several files are generated thanks to `DocStrip`'s utility:               \generate{\file{⟨output⟩}{\from{⟨input⟩}{⟨optionlist⟩}}}      Quoting Heiko Oberdiek in What path provide in a .dtx file (located in source/ folder) to reach files located in doc/ folder?: > Unhappily docstrip (TeX) cannot easily generate file names without > extension, because the default extension .tex kicks in[.] For `⟨output⟩` supposed to be extension-less, this is a piece of pain: before sending to CTAN, one has to not forget to rename generated files from `⟨output⟩.tex` to `⟨output⟩`. Common files concerned are for `⟨output⟩ = README` but, in my use case, `⟨output⟩ = latexmkrc` files are concerned as well. Because of this CTAN requirement (`.tex` extension of `README.tex` files not welcome), wouldn't it be possible for `DocStrip` program to provide a star variant of `\file` such that, if `⟨output⟩` does contain any extension:               \generate{\file*{⟨output⟩}{\from{⟨input⟩}{⟨optionlist⟩}}}      generates a file named `⟨output⟩`, and not `⟨output⟩.tex`?


title: Package for creating seal impressions?

text: I have an official letter and I thought about a nice seal impression. So my question is, if there is a package in latex with which I can create a nice fancy seal impression? So somehow a old-school cool looking seal impression at the end of the letter with my signature.


title: Reference to the name of subequations

text: I have a formulation that consists of several subequations that I would like to refer to as a formulation and as individual equation in my article. Right now I have this:               \usepackage{hyperref}       \begin{subequations}     MySubequation     \begin{align}         a = b \label{eq:1a}\\         a = c \label{eq:2b}\\     \end{align}     \end{subequations}      I would like to refer to this formulation in text as "MySubequation" and hyperlink it to the formulation. However, if I use \ref{MySubequation} it only shows the counter number for the formulation. Is there any way I can reference to a set of subequations as a name?


title: Chapter title formatting

text: I'm working in memoir class and would like to format my chapter headings like this:![](http://i.stack.imgur.com/Quu2K.png) The author's name and years of birth-death are at the top, then a horizontal line the length of the above details, then the title, followed by an optional subtitle.


title: Biber.exe infected by Trojan BackDoor.Generic18.ALDX

text: My antirus software AVG 2014 just detected that there seem to be a Trojan in the biber.exe program which was last updated on June 6, 2014 and is in the package miktex-biber-bin. Has anybody else had the same problem?


title: array and loop to set frametitle, subsection, and text

text: In the example below, I store text into three variables (`\subTa`, `\subTb`, `\subTc`), and then use these variables to set the subsection, set the frametitle, and display text on each slide, all using `\only` as shown in the example below.               \documentclass[pdf]{beamer}     \begin{document}          \def\subTa{$1^{st}$ Step}     \def\subTb{$2^{nd}$ Step}     \def\subTc{$3^{rd}$ Step}          \section{Solution}     \begin{frame}         \only<+>{\subsection{\subTa}}         \only<+>{\subsection{\subTb}}         \only<+>{\subsection{\subTc}}         \frametitle{\insertsection...\only<1>{\subTa}\only<2>{\subTb}\only<3>{\subTc}}         \only<1>{\subTa:}         \only<2>{\subTb:}         \only<3>{\subTc:}         \begin{align*}             \uncover<1->{2x-c&=2}             \uncover<2->{\\ 2x&=2+c}             \uncover<3->{\\ x&=1+0.5c}         \end{align*}     \end{frame}     \end{document}      Is there a way to do this where the text I stored in the three variables is stored in an array (something like `\def\subTarray{{"$1^{st}$ Step","$2^{nd}$ Step,"$3^{rd}$ Step"}}`), and then the subsection, frametitle, and text is set by looping through the array? Separate loops will be needed for at least the text and the frametitle/subsections, but using a single array would be desirable. If it is not possible to have one array for all three parts (frametitle, subsection, and text), examples of how to use an array and loop for the parts individually would also be appreciated. I tried solutions to similar questions (pgf-tikz-how-to-store-strings-in- array, loop-for-includegraphics, and this array-indexing-does-not-work-for- the-node-label), and I could get the text part to work using an array, but not in a loop. And I did not have much luck with the frametitle or subsections.


title: PDF document not being properly imported/rendered

text: I am currently writing a LaTeX document template that is read and then exported to a `.tex` file, with the revised data. Two PDF documents need to be appended to the end of the Generated pdf document, resulting in one longer pdf file. I am using the `pdfpages` package, and I cannot get the pdf documents to be rendered at the end of the document. Below is the relevant code, thank you in advance for any advice you can give!               \usepackage[final]{pdfpages}     \includepdf{\verb~{//FileServ1/CMP$/Nav_CMP/Cal Checklist/20432_241.pdf}~}      I omitted most of the code, but I can post the rest if it is needed.


title: Make gif-animation faster with animate

text: I have a series of PNG figures that I use to make an animation in a `beamer` presentation. The animation works fine except that the frame rate is very slow, like 1 per second. I would like to make it faster, but how?


title: Short version of \emph and non standard code

text: The question regarding short version of `\emph` yielded brand new options for me and I should add impressive ones. However, the method suggested there results with non-standard code on the one hand but more readable on the other. I have two follow up questions:   1. What is the most dangerous things one should have in mind when practicing something like this?   2. More generally, what are the pros and cons of such code fragments?


title: Aligned, hanging indents in non-monospaced code

text: I want to typeset a piece of code containing line breaks. New lines should indent to a specified point in the previous line. Here is a monospaced example to illustrate what I mean. Notice how 'case' and 'of' line up below, as well as 'let' and 'in':               swap : forall a, b. Tuple a b -> Tuple b a     swap a b x = case x                  of tuple a b y z. let x' = tuple b a z y                                    in x'      The code I want to typeset is not monospaced, so I can't just use a verbatim environment to get what I want. The actual LaTeX of the first line, for instance, is               \mathsf{swap} : \forall\alpha,\beta.\;\mathsf{Tuple}\;\alpha\;\beta\to\mathsf{Tuple}\;\beta\;\alpha      How can I align some text to a specific point in the previous line?


title: Problem with expansion of \BODY

text: In the following MWE, the command `\testStringNotEmpty` tests if the argument is empty. This test is robust in the sense that the argument can contain a command or an environment... The environment `monenv` willy display "Empty" if the body (which i capture in \BODY) is empty, and "not empty" in the other case. My problem is that if the body of `monenv` is the command `\macom` which expands to "empty", then it has a different behaviour than the one i expected. This is probably because one should sort of completely expand `\BODY` before to call `\testStringNotEmpty`, and my attempt with the \expandafter does not seem to work...               \documentclass{article}     \usepackage{environ}         \makeatletter         \newcommand{\testStringNotEmpty}[1]{%           \ifnum\pdfstrcmp{\unexpanded{#1}}{}=\z@             \expandafter\@secondoftwo           \else             \expandafter\@firstoftwo             \fi         }     \makeatother          \NewEnviron{monenv}%     {%     \expandafter\testStringNotEmpty\expandafter{\BODY}%     {Environment = NOT empty}%     {Environment = Empty}%     }     \newcommand{\macom}{}          \begin{document}          \begin{monenv}     \end{monenv}          \begin{monenv}     \macom     \end{monenv}          \begin{monenv}     \macom     \macom     \end{monenv}               \end{document}      **EDIT** : Using the solution of egreg to expand `\BODY` in the environment `monenv`, i encounter now some problems if the content of `monenv` is more complicated (and reflect now my actual code). So, i redefine `monenv` according to egreg's solution. I define the following command :               \newcommand{\hint}[1]{%     \testStringNotEmpty{#1}{hint : #1}{}}       and i test it with :               \begin{monenv}     \hint{}     \end{monenv}          \begin{monenv}     \hint{}     \hint{}     \end{monenv}      which gives me "empty" for the first one (as expected) and "NOT empty" for the second one, which i don't want...


title: How to get a better spacing in nested multicols environments?

text: The following code produces an output that has badly-spaced contents. My objective is to write an exercise with multiple choice questions. Each option may have a figure. ![enter image description here](http://i.stack.imgur.com/IaLKZ.png) The red arrows indicate the badly-spaced parts.               \documentclass[demo]{article}     \usepackage[a4paper,margin=20mm]{geometry}     \usepackage{graphicx}     \usepackage{multicol}     \columnsep=10pt     \usepackage{enumerate}          \def\question{%     Which is the correct statement about a quadratic function?}          \def\option{%     When $D<0$, the graph has 2 $x$-intercepts as shown in the figure below.          \begin{center}             \includegraphics[width=0.8\linewidth]{foo}     \end{center}}%          \begin{document}     \begin{multicols}{2}[\section*{Exercise}]     \begin{enumerate}[1.]     % Question 1     \item \question         \begin{multicols}{2}         \begin{enumerate}[a.]             \item \option             \item \option             \item \option             \item \option             \item \option            \end{enumerate}         \end{multicols}      % Question 2     \item \question         \begin{multicols}{2}         \begin{enumerate}[a.]             \item \option             \item \option             \item \option             \item \option             \item \option            \end{enumerate}         \end{multicols}     % Question 3     \item \question         \begin{multicols}{2}         \begin{enumerate}[a.]             \item \option             \item \option             \item \option             \item \option             \item \option            \end{enumerate}         \end{multicols}      % Question 4     \item \question         \begin{multicols}{2}         \begin{enumerate}[a.]             \item \option             \item \option             \item \option             \item \option             \item \option            \end{enumerate}         \end{multicols}     \end{enumerate}     \end{multicols}     \end{document}      How to get a better spacing in nested `multicols` environments? I also noticed the spacing gets weird in both text mode and math mode. If this problem is not easy to fix, is there another way to accomplish my objective, i.e., creating a multiple-choice exercise with the same layout as shown above?


title: Method for LaTeX to ignore special characters in a phrase

text: Is there an easy way for Latex to ignore all special characters in a given phrase? For example, I had to copy several links which contained the symbol _ . I know that it is possible to put `\` in front of every special character, to ignore it. But I was wondering if there is a command of the form `\ignore{^&%$###___}` that outputs exactly '`^&%$###___`' in the pdf document? Thank you.


title: dynamic clipping plane with TikZ

text: i have a problem with TikZ. I'd like to draw a dynamic clipping-plane. the top of the red area is dynamic, the blue one should be the same high/level but much larger dimension... to seperate optical from the red area. some ideas? **Update** I added another picture to make my point clear. the blue square should fit perfect on top of the red frustum. it should be dynamic, so if i change the hight of the frustum, the blue square will move as well. My problem is that the height of the red frustum is a part of the ray from the viewpoint to the bottom. if it possible to give a parameter for height wich fit in the perspektive and the ray, that would solve the problem as well i think.               \begin{tikzpicture}[scale=1]     \usetikzlibrary{calc}             %%% Parameter %%%             \pgfmathsetmacro{\frameHeight}{8}             \pgfmathsetmacro{\frameWidth}{0.92}             \pgfmathsetmacro{\frameDepth}{0.87}             \pgfmathsetmacro{\viewpointDepth}{0.5}             \pgfmathsetmacro{\viewpointCentering}{0.5}             \pgfmathsetmacro{\projectionHeight}{0.36}             \pgfmathsetmacro{\projectionWidth}{0.96}             \pgfmathsetmacro{\projectionDepth}{0.07}                 % Fluchtpunkte             \coordinate (F1) at (30:50cm);             \coordinate (F2) at (150:50cm);                 % Eckpunkte             \coordinate (P1) at (0cm,0cm);                  % v U             \coordinate (P2) at (0cm,\frameHeight);     % v O             \coordinate (P3) at ($(F1)!\frameDepth!(P1)$);  % h U             \coordinate (P4) at ($(F1)!\frameDepth!(P2)$);  % h O             \coordinate (P5) at ($(F2)!\frameWidth!(P1)$);               \coordinate (P6) at ($(F2)!\frameWidth!(P2)$);             \coordinate (P7) at (intersection cs: first line={(P5) -- (F1)}, second line={(P3) -- (F2)});             \coordinate (P8) at (intersection cs: first line={(P6) -- (F1)}, second line={(P4) -- (F2)});             \coordinate (P9) at ($(P2)!\viewpointDepth!(P4)$);             \coordinate (P10) at (intersection cs: first line={(P9) -- (F2)}, second line={(P6) -- (P8)});                 % Sichtfeld             \coordinate (A) at ($(P5)!\projectionWidth!(P1)$);             \coordinate (B) at ($(P1)!\projectionWidth!(P5)$);             \coordinate (C) at ($(A)!\projectionDepth!(F1)$);                \coordinate (D) at (intersection cs: first line={(C) -- (F2)}, second line={(B) -- (F1)});               \coordinate (V) at ($(P9)!\viewpointCentering!(P10)$);                 % Nutzfläche Schnitt             \coordinate (E) at ($(A)!\projectionHeight!(V)$);             \coordinate (F) at (intersection cs: first line={(E) -- (F2)}, second line={(V) -- (B)});             \coordinate (G) at (intersection cs: first line={(E) -- (F1)}, second line={(V) -- (C)});             \coordinate (H) at (intersection cs: first line={(F) -- (F1)}, second line={(V) -- (D)});                 % nutz Sichtfeld Ebene             \coordinate (P11) at ($(E)$); %({(E)--(F2)}:2);             \coordinate (P12) at ($(F)$);             \coordinate (P13) at ($(G)$);             \coordinate (P14) at ($(H)$);                 % real Sichtfeld Ebene             \coordinate (P15) at (0, -1);             \coordinate (P16) at ($(P15)!0.115!(F2)$);             \coordinate (P17) at ($(F1)!0.835!(P15)$);             \coordinate (P18) at (intersection cs: first line={(P16) -- (F1)}, second line={(P17) -- (F2)});             %Linien             \draw[rounded corners, draw=black!80, fill=yellow!80, opacity=0.5] (P15) -- (P16) -- (P18) -- (P17)  -- cycle;                 % Tiefe / Verlauf             \begin{scope}[opacity=0.2]             \shade[top color=gray!70,bottom color=gray!5] (P1) -- (P3) -- (P7) -- (P5);             \shade[right color=gray!70,left color=gray!5] (P5) -- (P6) -- (P8) -- (P7);             \shade[left color=gray!70,right color=gray!5] (P7) -- (P3) -- (P4) -- (P8);             \end{scope}                 % Sichtfeld der Kamera             \fill [red!80, opacity=0.4] (A) -- (B) -- (D) -- (C);             \begin{scope}[thin, dashed, red]%thick, dashed, fill=red!80, opacity=1]                 \draw (A) -- (V);                 \draw (B) -- (V);                 \draw (C) -- (V);                 \draw (D) -- (V);             \end{scope}             \begin{scope}[red]                 \draw (A) -- (E);                 \draw (B) -- (F);                 \draw (D) -- (H);                 \draw (C) -- (G);             \end{scope}             \draw [thin, red] (A) -- (B) -- (D) -- (C) -- (A);             \draw [thin, red] (E) -- (F) -- (H) -- (G) -- (E);             %\draw [thick, red!80] (             \begin{scope}[red!80, opacity=0.1]                 \fill (A) -- (B) -- (F) -- (E);                 \fill (C) -- (A) -- (E) -- (G);                 \fill (D) -- (C) -- (G) -- (H);                 \fill (B) -- (D) -- (H) -- (F);             \end{scope}             \draw[rounded corners, draw=black!80, fill=blue!80, opacity=0.5] (P11) -- (P12) -- (P14) -- (P13) -- cycle;                 % Frame             \begin{scope}[thin, opacity=0.6]                 \draw (P1) -- (P3) -- (P4) -- (P2) -- (P1) ;                 \draw (P1) -- (P5) -- (P6) -- (P2) -- (P1) ;                 \draw (P2) -- (P6) -- (P8) -- (P4) -- (P2) ;                 \draw (P3) -- (P7) -- (P8) -- (P4) -- (P3) ;                 \draw (P1) -- (P5) -- (P7) -- (P3) -- (P1) ;             \end{scope}             \draw[thin,dashed] (P9) -- (P10);             % Verbindungspunkte             \foreach \i in {1,2,...,10}                 {                  \shade[shading=ball, ball color=black!80] (P\i) circle (0.05em) node[above right] {}; %\tiny \i};                 }             \foreach \i in {A, B,...,H}                 {                 \shade[shading=ball, ball color=red] (\i) circle (0.05em) node[above right] {}; %\tiny \i};                 }             %Beschriftung             %\draw[fill=red] (V) circle (0.25em) node[above right] {\tiny Viewpoint};             \shade[shading=ball, ball color=red] (V) circle (0.25em) node[above right] {\tiny Betrachtungspunkt};             \draw[] (4.75,0.8) to[out=90,in=-90] (0.75,2);             \draw (4.75,0.5) node[] {\footnotesize nutzbares Sichtfeld};             \draw[] (-5.5,4.3) to[out=90,in=-90] (-0.5,4.5);             \draw (-5.5,4) node[] {\footnotesize unterer Schwellwert};             \draw[] (-5.5,0.8) to[out=90,in=-90] (-3,1.4);             \draw (-5.5,0.5) node[] {\footnotesize oberer Schwellwert};     \end{tikzpicture}      ![enter image description here](http://i.stack.imgur.com/Mz7G5.png) ![enter image description here](http://i.stack.imgur.com/2CNvs.png)


title: How to edit the LaTeX path in LyX on Windows (x64)

text: I was using MiKTeX 2.9 (x64) on my Win 7 machine for some time with TeXnicCenter. Now I tried to install LyX on the same PC. The problem I get is Lyx does find neither `latex.exe` nor sees all the other files in `\bin` folder of MiKTeX. I read Lyx had problem with x64 bit MiKTeX, so I removed every "MiKTeX 2.9 x64" in Windows path **and** in "Lyx->Tools->Preferences- PATH prefix" and just leave 32-bit version in it. When I do: "latex.exe" in cmd, I get the correct version:               This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9)      I also tried to reconfigure LyX (Tools->Reconfigure), but always get this error:               The system reconfiguration has failed.     Default textclass is used but LyX may not be able to work properly.     Please reconfigure again if needed.      I also tried to reinstall `LyX-2-0.5-Installer-3.exe` and tried even with `LyX-2-0.5-Bundle-3.exe`. Both installations seems to finish with no error. I also tried to log off and log on, recheck all the PATHs, but nothing seems to help. When I try to export (File->Export...) I see a popup window with no output formats. I also tried to add a new environment variable "miktexdir", but that did not do any change whatsoever. Also tried to run as Administrator, no help. What am I doing wrong, what is the solution?


title: acronym does not hyphenate in text

text: I am using the latest version of `acronym` (`acronym 2010/09/08 v1.36`) with Lualatex (Version `beta-0.70.2-2012060719`) and have a long acronym consisting of six words which is not hyphenated correctly. The package `showhyphens` shows that the first of the words in the text has no hyphenation options although it is hyphenated correctly in the list of abbreviations. LaTeX-Community.org: acronym package and hyphenation shows a solution and GoLaTeX: hyphenation mit Package acronym (German) another but, unfortunately, both of them do not work for me. Is there any other solution or has anyone encountered (and solved) a similar problem? Edit: I have prepared a MWE. It is, however, a rather elusive bug. I have therefore stripped down the text to a point where I could not remove any more packages/text because the overfull hbox would not show. I hope it helps clarifying my problem, though.               \documentclass[DIV=calc,fontsize=12pt,titlepage=false]{scrartcl}          \usepackage{showhyphens}     \usepackage{fontspec}     \usepackage{microtype}     \newfontfeature{Microtype}{protrusion=default;expansion=false}     \setmainfont[Microtype]{Linux Libertine O}     \usepackage[ngerman,british]{babel}          \usepackage[smaller,printonlyused,withpage]{acronym}     \usepackage{bookmark}     \usepackage{booktabs}          \begin{document}     \hyphenation{Mi-ni-a-tur-netz-wer-ke}     Invertebrate neurons are larger than their vertebrate counterparts, which makes it easier to handle them.     This text is part of an interdisciplinary project: \ac{MIMU}.     \section*{List of abbreviations}     \begin{acronym}[MIMU]     \acro{MIMU}{Miniaturnetzwerke aus Insektenneuronen in multilateralen Umgebungen}     \end{acronym}     \end{document}      The MWE gives me the following output for text and abbreviation list:   * 1: Overfull hbox in the text    * 2: The very same word (Miniaturnetzwerke) is correctly hyphenated ![enter image description here](http://i.stack.imgur.com/jxFzJ.png) ![enter image description here](http://i.stack.imgur.com/ZRlHJ.png)


title: TeXmaker citation

text: I'm using a Mac and I have a problem with my TeXmaker. Everything works great with TeXmaker but I'm having problems with citations. My TeXmaker is linked with Mendeley software and I can see all of my citation keys in TeXmaker but whenever I want to cite something, my citation list doesn't show anything. Take for example, in my friend's PC whenever they want to cite, they write the first letter of citation key, TeXmaker brings the whole name, but in my Mac it doesn't work. I've updated all of my packages. Please help me.


title: Environment with delayed expansion

text: I'm trying to define an environment `test` that stores its contents unexpanded in a macro `\testcontents`. For example, the code               \newcommand{\cmd}{bad}          \begin{test}     \cmd     \end{test}          \renewcommand{\cmd}{okay}          \testcontents      should print out "okay". How would I define such an environment? I know that the environ package could be used to store the contents after expansion, but I need them unexpanded.