title: Difference between renewing commands before and after \begin{document}

text: I was wondering what could be reasons for differences when I redefine control sequences in the preamble or after `\begin{document}`? For example, this code typesets **abcd** when compiled by any of `pdflatex`, `htlatex`, and `mk4ht oolatex`.               \documentclass{article}     \begin{document}     \renewcommand\b{b}     a\b cd     \end{document}      But if `\renewcommand\b{b}` is moved to the preamble, `pdflatex` and `htlatex` will still output **abcd** , while `mk4ht oolatex` will now output **ac̱d**. That is, instead of `b`, `\b` will expand to the standard sub-macron (`0x331`).               \documentclass{article}     \renewcommand\b{b}     \begin{document}     a\b cd     \end{document}      I assume the missing `b` in these examples is not due to a bug in `mk4ht oolatex`.


title: How to display Arabic numerals with \ref but Roman numerals otherwise?

text: To show all chapter numbers as Roman numerals, I’m using               \renewcommand\thechapter{\Roman{chapter}}      The fourth chapter, for instance, is therefore “Chapter IV” everywhere. Is it possible to show the numbers as Arabic numerals _only_ when referencing to chapters using `\ref{...}`? Using the example above, `\ref{chapter-four}` would result in “Chapter 4” instead of “Chapter IV.”


title: Inline Math in Display Mode

text: I know how to have inline math typeset as in display mode in LaTeX, i.e summations with the index below the sigma, but I'm trying to learn ConTeXt and cannot figure out how to do it. Any thoughts? Is there a way to do it in ConTeXt?


title: Does TeXShop for Mac have key bindings?

text: There's a Macro's and Key Binding option in the Preferences Menu, but the only way to utilize these macros is to click through the menus. How do I get the good ol' classic `Ctrl`+`B` -> `\textbf{}` behaviour that I am so accustomed to? Do I really have to write my own `KeyEquivalents.plist`file? Say it ain't so. Example: I have written a block of text and want to mark that entire passage and make it bold. I know I can select Bold from the Macros menu, but is there a keyboard shortcut for this?


title: How can I use Helvetica Light or Neue in moderncv?

text: I have gotten Helvetica working in Xavier Danaux's moderncv by placing in the following lines in banking.sty to typeset my cv.tex file. I'm using texShop on OSX.               \usepackage[scaled]{helvet}     \renewcommand\familydefault{\sfdefault}      \usepackage[T1]{fontenc}      I even tried               \usepackage{fontspec}     \setmainfont{Helvetica}      to access my system fonts (Helvetica, Hel Neue and Hel Light are installed in my OS X) however I get he following error:               LaTeX Font Warning: Some font shapes were not available, defaults substituted.      I checked my fc-list in terminal and Helvetica Light and Neue are there. Any suggestions or pointers?


title: Upper case in chapter title? (Follow Up)

text: As for my thesis, I asked today here but I still cannot use it because there are other packages and commands I need to modify the tables of contents. So here is the full minimum working template. I just want to make the chapter title in tocs to be All capital letters like "IV. TEST". Sorry for the long one.                %!TEX TS-program = pdflatex      \documentclass[fontsize=12pt]{report}      \usepackage{mathptmx}     \usepackage{graphicx}     \usepackage[svgnames]{xcolor}     \usepackage{amssymb}     \usepackage{tocloft}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{indentfirst}     \usepackage[showframe,paperwidth=8.5in,paperheight=11in,top=1in,textwidth=5.8in,bottom=1in,left=1.25in,right=1.25in,footskip=0.3in]{geometry}% This is the page layout.     \usepackage{titling}     \usepackage{setspace}     \usepackage{afterpage}          \newif\ifintoc          \newcommand*{\PrintChapterTocHeadline}     {\hbox to \linewidth{\textbf{Chapter}\hfill\textbf{Page}}\bigskip             \SetupNextPageOne}          \newcommand*{\SetupNextPageOne}     {\afterpage {\ifintoc\PrintChapterTocHeadline\fi}}          \addtocontents{toc}{\protect\PrintChapterTocHeadline}          \newif\ifinlof          \newcommand*{\PrintChapterLofHeadline}         {\hbox to \linewidth{\textbf{Figure}\hfill\textbf{Page}}\bigskip          \SetupNextPage}          \newcommand*{\SetupNextPage}         {\afterpage {\ifinlof\PrintChapterLofHeadline\fi}}          \addtocontents{lof}{\protect\PrintChapterLofHeadline}               \renewcommand{\contentsname}{\fontsize{16pt}{18pt}\selectfont {\centerline{TABLE OF CONTENTS}}}     \renewcommand{\listfigurename}{\fontsize{16pt}{18pt}\selectfont {\centerline{LIST OF FIGURES}}}     \renewcommand{\cftchapfont}{\bfseries\MakeUppercase}     \makeatletter     \renewcommand*\l@chapter{\@dottedtocline{0}{1em}{2.3em}}     \renewcommand*\l@section{\@dottedtocline{1}{3.3em}{2.3em}}     \renewcommand*\l@subsection{\@dottedtocline{2}{5.6em}{2.3em}}     \renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}     \makeatother     \usepackage[pdftex,colorlinks,bookmarksnumbered,citecolor=blue,linkcolor=magenta,menucolor=black,pdftoolbar=false,urlcolor=DeepSkyBlue,pdftitle={Comprehensive Exam},pdfauthor={Thein Htay Oo},pdfsubject={Physics},pdfstartview=Fit,pdfdisplaydoctitle=true,pdfpagelayout=SinglePage]{hyperref}               \usepackage{titlesec}     \makeatletter     \def\ttl@mkchap@i#1#2#3#4#5#6#7{%           \ttl@assign\@tempskipa#3\relax\beforetitleunit           \vspace{-\@tempskipa}%<<<<<< REMOVE THE * AFTER \vspace           \global\@afterindenttrue           \ifcase#5 \global\@afterindentfalse\fi           \ttl@assign\@tempskipb#4\relax\aftertitleunit           \ttl@topmode{\@tempskipb}{%               \ttl@select{#6}{#1}{#2}{#7}}%           \ttl@finmarks  % Outside the box!           \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}}     \makeatother        \usepackage{etoolbox}          \makeatletter     \pretocmd{\@sect}{\singlespacing}{}{}     \pretocmd{\@ssect}{\singlespacing}{}{}     \apptocmd{\@sect}{\doublespacing}{}{}     \apptocmd{\@ssect}{\doublespacing}{}{}     \makeatother               \renewcommand{\thechapter}{\Roman{chapter}}     \renewcommand \thesection{\arabic{chapter}.\arabic{section}}     \renewcommand \thesubsection{\arabic{chapter}.\arabic{section}.\arabic{subsection}}                  \renewcommand{\familydefault}{\rmdefault}      \titleformat*{\section}{\singlespacing\fontsize{14}{18}\bfseries\rmfamily}       \titleformat*{\subsection}{\singlespacing\fontsize{12}{14}\bfseries\rmfamily}                \titleformat{\chapter}[display] {\singlespacing\rmfamily\fontsize{16pt}{19pt}\bfseries}         {\MakeUppercase{\chaptertitlename\ \thechapter}\filcenter}{10pt}{\centering\uppercase}         {\fontsize{14pt}{16pt}\filcenter}              \titlespacing*{\chapter}{0pt}{0pt}{30pt}                    \doublespacing               \renewcommand\thefigure{\arabic{chapter}.\arabic{figure}}               \begin{document}     \pagenumbering{Roman}     \begin{center}     \topskip0pt     \vspace*{\fill}        ype dedication here, if any. Otherwise, delete this page.     \vspace*{\fill}     \end{center}     \pagebreak     \restoregeometry               \begingroup\intoctrue     \setlength{\cftbeforetoctitleskip}{-2.5em}     \tableofcontents     \endgroup          \begingroup\inloftrue     \newpage     \setlength{\cftbeforeloftitleskip}{-2.5em}     \listoffigures     \endgroup          \restoregeometry     \newpage          \setcounter{page}{1}     \pagenumbering{arabic}          \chapter{test}     \section{Test}     \section{Test}     \chapter{Test}     \section{Test}     \begin{figure}     \caption{ms expected.}     \end{figure}     \begin{figure}     \caption{ms expected.}     \end{figure}     \begin{figure}     \caption{ms expected.}     \end{figure}     \chapter{Test}     \section{Test}     \section{Test}     \section{Test}     \chapter{test}     \section{Test}     \section{Test}     \chapter{Test}     \section{Test}     \chapter{Test}     \section{Test}     \chapter{Test}     \section{Test}     \chapter{Test}     \section{Test}     \chapter{Test}     \section{Test}     \end{document}


title: How to insert characters with special meaning into a document

text: I was trying to add the symbol ^ in the document and getting error. How could I do that               \documentclass{article}     \begin{document}     Hello world     \^     \end{document}      I need to add \,$... to document


title: Glitch in 'Cool text highlighting'

text: This answer provides a fantastic "ragged text highlight". Unfortunately I'm getting a weird glitch with it: ![enter image description here](http://i.stack.imgur.com/PAKAY.png) I have literally taken the source code from the link and replaced the material between `\begin{document}` and `\end{document}` with               {replacing} \highlight{$g$} {by} \highlight{$g^{-1}$},      The MWE is however long because the original code is long:               \documentclass{minimal}     \usepackage{soul}     \usepackage{tikz}     \usetikzlibrary{calc}     \usetikzlibrary{decorations.pathmorphing}          \makeatletter          \newcommand{\defhighlighter}[3][]{%       \tikzset{every highlighter/.style={color=#2, fill opacity=#3, #1}}%     }          \defhighlighter{yellow}{.5}          \newcommand{\highlight@DoHighlight}{       \fill [ decoration = {random steps, amplitude=1pt, segment length=15pt}             , outer sep = -15pt, inner sep = 0pt, decorate             , every highlighter, this highlighter ]             ($(begin highlight)+(0,8pt)$) rectangle ($(end highlight)+(0,-3pt)$) ;     }          \newcommand{\highlight@BeginHighlight}{       \coordinate (begin highlight) at (0,0) ;     }          \newcommand{\highlight@EndHighlight}{       \coordinate (end highlight) at (0,0) ;     }          \newdimen\highlight@previous     \newdimen\highlight@current          \DeclareRobustCommand*\highlight[1][]{%       \tikzset{this highlighter/.style={#1}}%       \SOUL@setup       %       \def\SOUL@preamble{%         \begin{tikzpicture}[overlay, remember picture]           \highlight@BeginHighlight           \highlight@EndHighlight         \end{tikzpicture}%       }%       %       \def\SOUL@postamble{%         \begin{tikzpicture}[overlay, remember picture]           \highlight@EndHighlight           \highlight@DoHighlight         \end{tikzpicture}%       }%       %       \def\SOUL@everyhyphen{%         \discretionary{%           \SOUL@setkern\SOUL@hyphkern           \SOUL@sethyphenchar           \tikz[overlay, remember picture] \highlight@EndHighlight ;%         }{%         }{%           \SOUL@setkern\SOUL@charkern         }%       }%       %       \def\SOUL@everyexhyphen##1{%         \SOUL@setkern\SOUL@hyphkern         \hbox{##1}%         \discretionary{%           \tikz[overlay, remember picture] \highlight@EndHighlight ;%         }{%         }{%           \SOUL@setkern\SOUL@charkern         }%       }%       %       \def\SOUL@everysyllable{%         \begin{tikzpicture}[overlay, remember picture]           \path let \p0 = (begin highlight), \p1 = (0,0) in \pgfextra             \global\highlight@previous=\y0             \global\highlight@current =\y1           \endpgfextra (0,0) ;           \ifdim\highlight@current < \highlight@previous             \highlight@DoHighlight             \highlight@BeginHighlight           \fi         \end{tikzpicture}%         \the\SOUL@syllable         \tikz[overlay, remember picture] \highlight@EndHighlight ;%       }%       \SOUL@     }     \makeatother          \begin{document}      {replacing} \highlight{$g$} {by} \highlight{$g^{-1}$},     \end{document}


title: Referencing Subfigure in Subfloat

text: I want to reference a subfigure like so:               \documentclass{article}     \usepackage[demo]{graphicx}     \usepackage{caption}     \usepackage{subcaption}          \begin{document}          \begin{figure}          \subfloat[A subcaption.]{\label{figure:subfigure1}\includegraphics[width=2cm]{logo}}          \caption{A caption.}          \label{figure:figure1}     \end{figure}          \noindent     Subfigure \ref{figure:subfigure1}, Figure \ref{figure:figure1}.          \end{document}      However, I am getting a "Reference undefined" warning and the output is: ![enter image description here](http://i.stack.imgur.com/wF0Go.png) When I am using               \usepackage{subfig}       instead of               \usepackage{caption}     \usepackage{subcaption}      the output is as expected (references are all found). What am I doing wrong? **Update** I checked the package versions. Indeed, they are old:               Package: subcaption 2008/08/31 v1.0b      Package: caption 2009/10/09 v3.1k caption kernel (AR)


title: Shiny button-like node style with TikZ

text: > **Possible Duplicate:**   >  Web buttons with WYSIWYM Would it be possible with TikZ to draw (3D) shiny button-like nodes as those appearing in the mindmap on page 44 of Lukas Doktor presentation "Diagram, graph, and mindmap software" showed at http://rvokal.fedorapeople.org/devconf/ldoktor-grafy.pdf ? It Seems that this implies defining a node as two imbeded round rectangles, and a third half one (simulating reflexion) ... Many thanks for any hint. Jean-Marc


title: How extend beamertemplate{background}?

text: I am writing a custom beamer theme. In one of my theme `.sty` files I am using:               \setbeamertemplate{background}{       \begin{tikzpicture}         \useasboundingbox (0,0) rectangle(\the\paperwidth,\the\paperheight);         \fill[color=greenCiti] (0,0) rectangle(\the\paperwidth,0.75);         \node at (0.7,9.2) {\includegraphics{logo-citi-small.png}};         \node at (1.0,0.375) {\includegraphics[width=1.5cm]{logo-univ.png}};         \node at (3.5,0.375) {\includegraphics[width=3.2cm]{logo-ra.png}};         \node at (11.6,0.36) {\includegraphics[width=2.5cm]{logo-insa.png}};       \end{tikzpicture}     }       Now I need to extend this property, in order to add a fourth image in the top right corner of my slides but only for one document using the theme and thus not in the theme file itself. I.e I want to add a fourth line such as:               \node at (6.6,5.2) {\includegraphics[width=2cm]{fig/logo-bull.png}};      How should I achieve this?


title: Using "and" instead of ampersand in natbib in-text citations ("\citet")

text: I am using `natbib` and a modified `\bibliographystyle` that approximates the APA style (downloaded from here: http://web.reed.edu/cis/help/latex/images/apa-good.bst.zip). The only problem is this: In APA, when multiple-author citations appear in parentheses, the author names should be connected with "&". However, when multiple-author citations appear outside of parentheses (e.g., at the beginning of a sentence), the author names should be connected with "and". This is something I have not managed to achieve. I know how to get into the .bst and make the global change from "&" to "and" (i.e., changing the `FUNCTION {format.lab.names}...`). This is not what I need, however. I was wondering whether anyone has any idea how this problem can be solved (without substituting `natbib` with another package).


title: Fitting text into a box over-a-pic

text: I am trying to fit a text into a box within an `overpic` environment. kongo09 had a similar question fit-text-into-given-box-by-adjusting-the-fontsize, and a highly workable solution was provided by Werner:               \documentclass{article}     \usepackage{environ}          \newdimen\fontdim     \newdimen\upperfontdim     \newdimen\lowerfontdim     \newif\ifmoreiterations     \fontdim12pt          \makeatletter     \NewEnviron{fitbox}[2]{% \begin{fitbox}{<width>}{<height>} stuff \end{fitbox}       \def\buildbox{%         \setbox0\vbox{\hbox{\minipage{#1}%           \fontsize{\fontdim}{1.2\fontdim}%           \selectfont%           \stuff%         \endminipage}}%         \dimen@\ht0         \advance\dimen@\dp0       }       \def\stuff{\BODY}% Store environment body       \buildbox       % Compute upper and lower bounds       \ifdim\dimen@>#2         \loop           \fontdim.5\fontdim % Reduce font size by half           \buildbox         \ifdim\dimen@>#2 \repeat         \lowerfontdim\fontdim         \upperfontdim2\fontdim         \fontdim1.5\fontdim       \else         \loop           \fontdim2\fontdim % Double font size           \buildbox         \ifdim\dimen@<#2 \repeat         \upperfontdim\fontdim         \lowerfontdim.5\fontdim         \fontdim.75\fontdim       \fi       % Now try to find the optimum size       \loop         %\message{Bounds: \the\lowerfontdim\space         %         \the\fontdim\space \the\upperfontdim^^J}         \buildbox         \ifdim\dimen@>#2           \moreiterationstrue           \upperfontdim\fontdim           \advance\fontdim\lowerfontdim           \fontdim.5\fontdim         \else           \advance\dimen@-#2           \ifdim\dimen@<10pt             \lowerfontdim\fontdim             \advance\fontdim\upperfontdim             \fontdim.5\fontdim             \dimen@\upperfontdim             \advance\dimen@-\lowerfontdim             \ifdim\dimen@<.2pt               \moreiterationsfalse             \else               \moreiterationstrue             \fi           \else             \moreiterationsfalse           \fi         \fi       \ifmoreiterations \repeat       \box0% Typeset content     }     \makeatother      The defined `fitbox` environment can, of course, be used inside an `overpic` environment. Appending               \usepackage[percent]{overpic}     \usepackage{lipsum}          \begin{document}     \begin{overpic}[width=.3\textwidth,grid,tics=10]{picfile}       \put(20,50) {% turns out not to be exactly the lower left         \begin{fitbox}{5cm}{1cm}% unhandy units - desired box size depends on picture size           \lipsum[1]%         \end{fitbox}%       }%     \end{overpic}     \end{document}      to the code above does basically what I want. However, neither is the (20,50) the bottom left corner, nor are 'cm', 'pts' etc. handy units. Would it be possible to modify the above code such that instead of width and height the coordinates of the upper right corner can be passed and that the (20,50) is the lower left?


title: Bibliography styles like authordate2 in biblatex or natbib?

text: I've tried using the `authordate2` style of bibtex which is really close of the styles I wanted for my dissertation but this package is really old. Trying with default styles the code worked well but with the `authordate2` style it says that `\cite{myref}` is an `Undefined control sequence`. So I discovered `biblatex` and with it the citation styles already had the parentheses. I just wanted to change the "and" by "&", put the "et al" in italics and to wrap the name and the year by a hyperlink. The bibliography style is a little more tricky but I believe someone more experienced in `biblatex` macros and stuff would know. I'd like to get citation and bibliography styles like these: Citation > (Lastname & Lastname2, year) > > (Lastname _et al_ , year; Lastname2 _et al_ , year; Lastname & Lastname2, > year) Bibliography > [Lastname & Lastname2, year] F.M. Lastname & F.M. Lastname2. (2003). **Paper > Title** . _Journal Name_ . 98(462):470–487. > > [Lastname _et al_ , year] F.M. Lastname, F.M. Lastname2 & F.M. Lastname3. > (2003). **Paper Title** . _Journal Name_ . 98(462):470–487. Here's a minimal example from what I did until now.               \documentclass{article}     \usepackage{hyperref}     \usepackage[brazil]{babel}     \usepackage{csquotes}     \usepackage[style=authoryear,backref=true,hyperref=true]{biblatex}          \begin{filecontents}{\jobname.bib}          @ARTICLE{citationA,      Author = {Fulano Tal de Rio de Janeiro and Fulano Tal de Sao Paulo },      Year = {2001},      Title = {Paper Title},      Journal = {Jornal A}     }          @ARTICLE{citationB,      Author = {Fulano Tal de Rio de Janeiro and Fulano Tal de Sao Paulo and Fulano Tal de Recife     },      Year = {2002},      Title = {Paper Title},      Journal = {Jornal B}     }          @ARTICLE{citationB2,      Author = {Fulano Tal de Rio de Janeiro and Fulano Tal de Sao Paulo and Fulano Tal de Recife         },      Year = {2002},      Title = {Paper Title},      Journal = {Jornal C}     }          @ARTICLE{citationC,      Author = {Fulano Tal de Recife},      Year = {2003},      Title = {Paper Title},      Journal = {Jornal D}     }          \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \cite{citationA}          \cite{citationB}          \cite{citationB2}          \cite{citationC}          \parencite{citationA,citationC}          \parencite{citationB2}          \nocite{*}     \printbibliography          \end{document}      PARTIAL SOLUTION               \documentclass{article}     \usepackage{hyperref}     \usepackage[brazil]{babel}     \usepackage{csquotes}     \usepackage[style=authoryear,maxnames=2,maxbibnames=3,backref=true,hyperref=true,dashed=false,firstinits=true]{biblatex}            \renewcommand*{\finalnamedelim}{\addspace\&\space}     \renewcommand*{\nameyeardelim}{\addcomma\space}          \renewbibmacro{in:}{}          \renewbibmacro*{name:andothers}{%       \ifboolexpr{         test {\ifnumequal{\value{listcount}}{\value{liststop}}}         and         test \ifmorenames         }         {\ifnumgreater{\value{liststop}}{1}            {\finalandcomma}            {}%          \andothersdelim\bibstring[\emph]{andothers}}         {}}          \renewbibmacro*{cite}{%       \printtext[bibhyperref]{%          \DeclareFieldAlias{bibhyperref}{default}%          \iffieldundef{shorthand}           {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}              {\usebibmacro{cite:label}%               \setunit{\addspace}}              {\printnames{labelname}%               \setunit{\nameyeardelim}}%            \usebibmacro{cite:labelyear+extrayear}}           {\usebibmacro{cite:shorthand}}}}          \DeclareCiteCommand{\textcite}%        {\boolfalse{cbx:parens}}       {\usebibmacro{citeindex}%        \printtext[bibhyperref]{%           \DeclareFieldAlias{bibhyperref}{default}%          \usebibmacro{textcite}%          \iffieldundef{postnote}%             {\ifbool{cbx:parens}               {\bibcloseparen\global\boolfalse{cbx:parens}}               {}}            {}}}       {\ifbool{cbx:parens}          {\bibcloseparen\global\boolfalse{cbx:parens}}          {}%        \multicitedelim}       {\iffieldundef{postnote}         {}         {\usebibmacro{textcite:postnote}}}          \DeclareFieldFormat[article]{title}{\textbf{#1}}          \renewcommand{\baselinestretch}{1.25}          \DeclareNameAlias{sortname}{first-last}          \addbibresource{jobname.bib}          \begin{document}          \cite{citationA}          \cite{citationB}          \cite{citationB2}          \cite{citationC}          \parencite{citationA,citationC}          \parencite{citationB2}          \nocite{*}          \printbibliography          \end{document}      Updated Output. ![OUTPUT](http://i.stack.imgur.com/yzMNM.png) Missing only the links in front like this figure. ![](http://i.stack.imgur.com/x9flu.png)


title: Misplaced alignment tab character &

text: I've been getting the error: 'Misplaced alignment tab character & ...' even in sentences where the &-character is not used. It says it in sentences where I am citing.               \documentclass{article}     \usepackage[round]{natbib}     \begin{document}          In the offshore industry this is different as no central organization is present like     the ICAO \citep{ChristouK2012}.     Some organizations try to fulfil such a central role at national level, trying to     provide information to other organizations in that country, such as the Oil and Gas UK.     They collect accident data, however mostly qualitatively, and provide this to other     companies in order for them to benchmark their accident reports to the numbers of Oil     and Gas UK \citep{OilGas}\footnote{Chapter 8 of the Oil and Gas UK report includes the     aim 'to make the UK the safest place to work in the worldwide oil and gas industry'.     Furthermore, it has been pointed out that the offshore sector in the UK is already much     safer and risk aware than the US. Interesting to see is that there is no intention at     this point to organize in such a way that the offshore industry would benefit globally,     but nationally. Despite the fact that contractors, subcontractors and personnel are     from every region of the globe.}. As no information with regard to the circumstances of     the accidents were provided, no lessons learned could be incorporated in policies of     other companies.\\          \end{document}      LaTeX says the following error: `Misplaced alignment tab character & ...e number of Oil and Gas UK\citep{OilGas}` I have two more of these errors but they are the same as this one.               @techreport{OilGas,     author = "{{O}il and {G}as {UK}}",     title = "{H}ealth and {S}afety {R}eport 2012",     institution = "{O}il and {G}as {UK}",     year = "2012"     }      This is the bibentry.


title: Error 'No bounding' box for PDF image

text: I have a LaTeX file which includes a PDF image file as follows               \begin{figure}[t]     \includegraphics[width=0.4\textwidth]{chapter1/figure/image.pdf}     \caption{...}     \label{aa:b}     \end{figure}      I can compile this without any problems using `pdflatex`. But when I include the package `hyperref` and a bunch of other packages, it gives me the following error:               File 'chapter1/figure/image.bb' not found. ...dth]{chapter1/figure/image.pdf}     Cannot determine the size of graphic in chapter1/figure/image.bb (no BoundingBox). ...dth]{chapter1/figure/image.pdf}


title: Fix ligature mapping of obscure old font with LuaLaTeX or XeLaTeX

text: I have an old font I purchased a while ago. It comes with various ligatures that I need to use. The font was not intended for use with LaTeX, and even though it is a high-quality Type-1 font, the support for ligatures is quite Byzantine: Various ligatures are mapped to various characters, so `#` is some ligature, and `$` is another, etc. It was designed to be hellish to type in. :-) I have no problem using it within LuaLaTeX or XeLaTeX, but the mapping of ligatures to irrelevant characters is a problem. It's not only difficult to type, but more importantly, I'm concerned that my text shall be buried in a useless format by intermixing it with these silly punctuation marks that just "look right" when set in a particular font. I am unable to change the font (it's copyrighted), and I cannot find an equivalent font that uses a more sophisticated approach to ligatures. Is there any reasonably civilized way to define my own ligature mapping in either LuaLaTeX or XeLaTeX, so that I could use the font as-is, type "normal" text, and have the LaTeX engine handle the remapping?


title: biblatex and pgfplots

text: I'm using pgfplots to plot some graph of data I stored in a file (a lot of data points). If i charge the bibtex package and I obtains the famous error:               TeX capacity exceeded, sorry [main memory size=300000].      Is there any kind of incompatibility between biblatex and pgfplots?


title: Change theorem counter in Springer template

text: I used Springer template for my book, more concrete I used svmono. Here is a MWE, that is the shortened version of my template file.                 \documentclass[graybox,envcountsec,sectrefs,vecarrow,envcountresetsect]{svmono}       \usepackage[utf8]{inputenc}       \usepackage[vietnam]{babel}       \usepackage{savesym}       \usepackage{mathptmx}       \savesymbol{hbar}       \usepackage{helvet}       \usepackage{courier}       \usepackage{type1cm}                  \usepackage{fouriernc}       \usepackage{esvect}          \let\remark\relax       \let\endremark\relax       \renewcommand{\thesection}{\arabic{section}.}       \renewcommand\definitionname{Định nghĩa}       \spnewtheorem*{remark}{Remark}{\itshape}{\rmfamily}       \renewcommand\remarkname{Chú ý}       \renewcommand\lemmaname{Bổ đề}       \begin{document}       \chapter{The direction of a segment}       \section{Some basics definition}       \begin{definition}       That is definition       \end{definition}       \begin{theorem}       This is theorem.        \end{theorem}       \begin{remark}       This is remark       \end{remark}       \begin{lemma}       this is lemma       \end{lemma}       \end{document}      I want to numbering the chapter like Chapter I, not chapter 1 as in this template did. I also want to numbering the theorem, definition, remark, lemma section-wise, i.e Theorem 2.1(the first theorem in section 2), the next enviroment(definition, lemma, ..) will be Defintion 2.2,..i.e use the same counter in a section for every enviroment(except the proof enviroment) ? But how can I change the template to get that ? Please help me.


title: Main Reference + Appendix with "Other Sources"

text: I need your help with references. I have 1 main reference section, and I want to include a second list of references as an appendix. For the main reference I use:               \newpage          \bibliographystyle{plainnat}          \bibliography{library}      The problem is that I don't know how to include the second list using a different bib file, and then calling the function `\nocite{*}` to show every sources inside the file. I have the appendix part workout. I need your help to design the function to call the second bibliography, and that does't interfere with the main reference:               \newpage          \appendix          \section{Other Sources} \label{app:ReferencesB}      In addition, I will prefer that the word `References` is not shown after `Other Sources`. Thank you so much!!


title: \lstlistoflistings title says "Table of Contents"

text: When I tried `\lstlistoflistings` to print the list of all my listing, the title says "Table of contents", and then it says chapter. Like if it was part of the TOC. I'm trying to get a list, like the one you get in algorithms or in figure list. I have search for a while. It is the first time I post, because most of the time, the answer is already found or the user manual provides some information. However, I haven't been able to solve it yet. I tried changing the name with                \renewcommand*{\lstlistlistingname}{List of Source Code Listing}      but it didn't work. Here is a screenshot of how it looks. I just would like it to say List of Listing (or Source Code) , and then don't have that CHAPTER caption. ![List of source code](https://dl.dropboxusercontent.com/u/9158832/list) Minimal Sample (the best I could) thesis.tex                  \documentclass{fiu}        \usepackage{listings}         \begin{document}          \begin{lstlisting}[caption={WiiMote (Initialize)}]         int x;         \end{lstlisting}         \begin{lstlisting}[caption={Sample}]         int y;        \end{lstlisting}         \lstlistoflistings         \end{document}       here is the class file               \NeedsTeXFormat{LaTeX2e}[1995/12/01]     \ProvidesClass{fiu}     [2011/07/29 v1.0       Florida International University dissertation class]     \newif\ifphd     \DeclareOption{phd}{\phdtrue}     \DeclareOption{master}{\phdfalse}     \ExecuteOptions{phd}     \newif\ifcornellheadings     \newif\ifhalfcornellheadings     \newif\ifsmallerheadings     \DeclareOption{latexheadings}{\cornellheadingsfalse \halfcornellheadingsfalse}     \DeclareOption{cornellheadings}{\cornellheadingstrue \halfcornellheadingsfalse}     \DeclareOption{halfcornellheadings}{\halfcornellheadingstrue \cornellheadingsfalse}     \DeclareOption{normalsizeheadings}{\smallerheadingsfalse}     \DeclareOption{smallerheadings}{\smallerheadingstrue}     \ExecuteOptions{halfcornellheadings}     \ExecuteOptions{smallerheadings}     \DeclareOption{10pt}{%      \iffinal%       \OptionNotUsed%       \ClassWarningNoLine{cornell}{Font size 10pt not allowed; using 12pt}%      \else%       \PassOptionsToClass{10pt}{report}%      \fi%     }     \DeclareOption{11pt}{%      \final%       \OptionNotUsed%       \ClassWarningNoLine{cornell}{Font size 11pt not allowed; using 12pt}%      \else%       \PassOptionsToClass{11pt}{report}%      \fi     }     \newcommand{\prelim@contents}[1]{}     \DeclareOption{tocprelim}{%       \renewcommand{\prelim@contents}[1]{\addcontentsline{toc}{section}{#1}}     }     \DeclareOption{draft}{%       \let\ifdraft\iftrue%       \let\iffinal\iffalse%       \PassOptionsToClass{final}{report}%     }     \DeclareOption{final}{%       \let\ifdraft\iffalse%       \let\iffinal\iftrue%       \PassOptionsToClass{final}{report}%     }     \DeclareOption{semifinal}{%       \let\ifdraft\iffalse%       \let\iffinal\iftrue%       \PassOptionsToClass{draft}{report}%     }     \DeclareOption*{%       \PassOptionsToClass{\CurrentOption}{report}%     }     \ExecuteOptions{final}     \ProcessOptions          \iffinal\LoadClass[12pt]{report}[1994/06/01]\else\LoadClass{report}[1994/06/01]\fi     \newif\ifpdf     \ifx\pdfoutput\undefined     \else       \ifx\pdfoutput\relax       \else         \ifcase\pdfoutput         \else           \pdftrue         \fi       \fi     \fi     \ifpdf       \setlength{\pdfpagewidth}{8.5in}       \setlength{\pdfpageheight}{11in}     \fi     \ifcornellheadings       \def\@makechapterhead#1{%         \begin{center}%           \MakeUppercase{\@chapapp\space \thechapter} \\           \MakeUppercase{\bfseries #1}         \end{center}%         }       \def\@makeschapterhead#1{%         \begin{center}%           \MakeUppercase{\bfseries #1}         \end{center}%         }     \fi     \ifhalfcornellheadings       \def\@makeschapterhead#1{%         \begin{center}%           \MakeUppercase{\bfseries #1}         \end{center}%         }       \def\@makechapterhead#1{%         \vspace*{50\p@}%         {\parindent \z@ \raggedright \normalfont           \ifnum \c@secnumdepth >\m@ne               \huge\bfseries \@chapapp\space \thechapter               \par\nobreak               \vskip 20\p@           \fi           \interlinepenalty\@M           \singlespacing \Huge \bfseries #1\par\nobreak           \vskip 40\p@         }}       \ifsmallerheadings         \def\@makechapterhead#1{%           {\parindent \z@ \raggedright \normalfont             \ifnum \c@secnumdepth >\m@ne                 \LARGE\bfseries \@chapapp\space \thechapter                 \par\nobreak             \fi             \interlinepenalty\@M             \singlespacing \LARGE \bfseries #1\par\nobreak           }}       \fi     \fi          \ifsmallerheadings     \renewcommand\section{\@startsection {section}{1}{\z@}%                                        {-3.5ex \@plus -1ex \@minus -.2ex}%                                        {2.3ex \@plus.2ex}%                                        {\normalfont\large\bfseries}}     \fi          % The FIU Graduate School wants footnotes to be \small.     \renewcommand{\footnotesize}{\small}     \renewcommand{\@makefntext}[1]{%       \parindent 1em%       \noindent       \footnotespacing       \hbox to 1.8em{\hss\@makefnmark}#1       \par\normalspacing     }     \renewcommand{\defaultscriptratio}{.75}     \renewcommand{\defaultscriptscriptratio}{.6}     \setlength\headsep{25\p@}     \if@twocolumn     \else     %  \setlength\topmargin{-0.4in}       \setlength\topmargin{-0.5in}       \setlength\headheight{0.16667in}       \setlength\headsep{0.33333in}     %  \setlength\textheight{8.8in}       \setlength\textheight{8.6in}     % Adjusting \footskip lets me change the height of the page numbers.     %  \setlength\footskip{0.5in}       \setlength\footskip{0.8in}     %  \setlength\oddsidemargin{.6in}       \setlength\oddsidemargin{.55in}     %  \setlength\evensidemargin{.6in}       \setlength\evensidemargin{.55in}     %  \setlength\textwidth{5.80in}       \setlength\textwidth{5.90in}       \setlength\marginparsep{0.1in}       \setlength\marginparwidth{0.8in}     \fi     \if@compatibility       \setlength\topmargin{0\p@}     \else     \fi     \newcommand{\ps@cornell}{%     \def\@oddhead{}     \def\@oddfoot{\hfil\thepage\hfil}%     \def\@evenhead{}%     \def\@evenfoot{\@oddfoot}%     \def\chaptermark##1{}%     \def\sectionmark##1{}%     }     \newcommand{\ps@oldcornell}{%     \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%     \def\@oddfoot{}%     \def\@evenhead{\thepage\hfil{\slshape\leftmark}}%     \def\@evenfoot{}%     \def\chaptermark##1{}%     \def\sectionmark##1{}%     }     \newcommand{\ps@cornellc}{%     \def\@oddhead{\hfil\thepage\hfil}%     \def\@oddfoot{}%     \def\@evenhead{\@oddhead}%     \def\@evenfoot{}%     \def\chaptermark##1{}%     \def\sectionmark##1{}%     }     \raggedbottom     \renewcommand{\contentsname}{Table of Contents}     \renewcommand{\l@figure}{\@dottedtocline{1}{1.5em}{2.6em}}     \let\l@table\l@figure          \renewcommand{\bibname}{BIBLIOGRAPHY}     % The FIU Graduate School insists that \bibname should not be in boldface.     % So I put it into {\rm   }.     \renewenvironment{thebibliography}[1]          {\chapter*{{\rm \bibname}             \@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%           \list{\@biblabel{\arabic{enumiv}}}%                {\settowidth\labelwidth{\@biblabel{#1}}%                 \leftmargin\labelwidth                 \advance\leftmargin\labelsep         \itemsep=12pt                 \@openbib@code                 \usecounter{enumiv}%                 \let\p@enumiv\@empty                 \renewcommand\theenumiv{\arabic{enumiv}}}%           \sloppy\clubpenalty4000\widowpenalty4000%           \sfcode`\.=\@m\relax           \addcontentsline{toc}{chapter}{\bibname}           \listspacing{bib}}          {\def\@noitemerr            {\@latex@warning{Empty `thebibliography' environment}}%           \normalspacing           \endlist}          \newcommand{\@titlesize}{\Large}     \newcommand{\@subtitlesize}{\large}     \newcommand{\@authorsize}{\normalsize} % No Pharaoh he.     \newcommand{\@conferralmonth}{January}     \newcommand{\@conferralyear}{1900}     \newcommand{\@defensedate}{January 1, 1900}     \newcommand{\@advisor}{Theadvisor}     %modified by Francisco to add comajor professor     \newcommand{\@advisortwo}{Thesecondadvisor}     \newcommand{\@memberone}{Thefirstcommitteemember}     \newcommand{\@membertwo}{Thesecondcommitteemember}     \newcommand{\@memberthree}{Thethirdcommitteemember}     \newcommand{\@degreefield}{Thedegreefield}     \newcommand{\@college}{Thecollege}     \newcommand{\@collegedean}{Dean Thecollegedean}     \newcommand{\@gradschooldean}{Dean Thegradschooldean}          \newcommand{\titlesize}[1]{\renewcommand{\@titlesize}{#1}}     \newcommand{\subtitlesize}[1]{\renewcommand{\@subtitlesize}{#1}}     \newcommand{\authorsize}[1]{\renewcommand{\@authorsize}{#1}}     \newcommand{\conferraldate}[2]{%       \renewcommand{\@conferralmonth}{#1}       \renewcommand{\@conferralyear}{#2}     }     \newcommand{\defensedate}[1]{\renewcommand{\@defensedate}{#1}}     \newcommand{\advisor}[1]{\renewcommand{\@advisor}{#1}}     \newcommand{\advisortwo}[1]{\renewcommand{\@advisortwo}{#1}}     \newcommand{\memberone}[1]{\renewcommand{\@memberone}{#1}}     \newcommand{\membertwo}[1]{\renewcommand{\@membertwo}{#1}}     \newcommand{\memberthree}[1]{\renewcommand{\@memberthree}{#1}}     \newcommand{\degreefield}[1]{\renewcommand{\@degreefield}{#1}}     \newcommand{\college}[1]{\renewcommand{\@college}{#1}}     \newcommand{\collegedean}[1]{\renewcommand{\@collegedean}{#1}}     \newcommand{\gradschooldean}[1]{\renewcommand{\@gradschooldean}{#1}}          \renewcommand{\maketitle}{       \begin{titlepage}         \begin{center}     %      \@subtitlesize           FLORIDA INTERNATIONAL UNIVERSITY \\           Miami, Florida         \end{center}         \vfill         \begin{center}%     %      \@titlesize     % FIU Grad School doesn't want the title in a larger font!     %\large           \expandafter\uppercase\expandafter{\@title}         \end{center}         \vfill         \begin{center}     %      \@subtitlesize           A dissertation submitted in partial           fulfillment of the \\           requirements for the degree of \\           DOCTOR OF PHILOSOPHY \\           in \\           COMPUTER SCIENCE \\           by \\           \@author \\         \end{center}         \vfill         \begin{center}           \@conferralyear         \end{center}       \end{titlepage}     }          \renewenvironment{titlepage}{%       \typeout{Title page}       \pagestyle{empty}       \doublespacing     }{%       \normalspacing\clearpage     }          % Needs to be generalized to allow different-sized committees!     % (So far it allows only committees of size 4.)     \newcommand{\makeapproval}[1]{       \clearpage       \thispagestyle{plain}       \singlespacing       \vskip 3\baselineskip       \par\noindent To: {\@collegedean} \\               \indent\ \@college       \vskip \baselineskip       % I'm crudely trying to stop latex from breaking words here:       \begin{sloppypar} \noindent       This dissertation, written by \@author, and entitled \@title,       having been \mbox{approved} in respect to style and intellectual content,       is referred to you for \mbox{judgment}.       \end{sloppypar}          \vskip 1\baselineskip          \par\noindent We have read this dissertation and recommend that it be approved.            \vskip 2\baselineskip       \begin{flushright}         % These give a small gap between signature lines and names,         % and keep the margins correct.         {\setlength{\baselineskip}{0.7\baselineskip}           \linespread{1.6}           \rule{3in}{0.5pt} \\           \@memberone \\[3\baselineskip]           \rule{3in}{0.5pt} \\           \@membertwo \\[3\baselineskip]           \rule{3in}{0.5pt} \\           \@memberthree \\[3\baselineskip]           \rule{3in}{0.5pt} \\           \@advisor, Co-Major Professor \\ [3\baselineskip]           \rule{3in}{0.5pt} \\           \@advisortwo, Co-Major Professor \\         \par}       \end{flushright}          \vskip 1\baselineskip     \par\noindent Date of Defense: {\@defensedate}          \vskip 1\baselineskip     \noindent The dissertation of \@author\ is approved.       \begin{flushright}         {\setlength{\baselineskip}{0.7\baselineskip}           \vskip 3\baselineskip           \rule{3in}{0.5pt} \\           \@collegedean \\[1ex]           \@college \\[3\baselineskip]           \rule{3in}{0.5pt} \\           \@gradschooldean \\[1ex]           University Graduate School         \par}       \end{flushright}          \begin{center}     \vskip 2.3\baselineskip     Florida International University, \@conferralyear     \end{center}          \normalspacing\clearpage     }          \newenvironment{copyrightpage}{%       \typeout{Copyright page}       \null\vfill       \begin{center}     }{%       \end{center}       \vfill\null       \newpage       \clearpage%     }          \newcommand{\makecopyright}{%       \begin{copyrightpage}       \copyright\ Copyright \@copyrightyear{} by \@copyrightholder \\       All rights reserved.       \end{copyrightpage}%     }     \newcommand{\@copyrightholder}{\@author}     \newcommand{\@copyrightyear}{\@conferralyear}          \newcommand{\copyrightholder}[1]{\renewcommand{\@copyrightholder}{#1}}     \newcommand{\copyrightyear}[1]{\renewcommand{\@copyrightyear}{#1}}          \newcommand{\makepublicdomain}{%       \begin{copyrightpage}       This document is in the public domain.       \end{copyrightpage}%     }               \newlength{\@abhdskip}%     \renewenvironment{abstract}{       \typeout{Abstract}       \setlength{\@abhdskip}{.6in}       \addtolength{\@abhdskip}{-\topmargin}       \addtolength{\@abhdskip}{-\headheight}       \addtolength{\@abhdskip}{-\headsep}       \addtolength{\@abhdskip}{-\baselineskip}       \begin{center}%         %\vspace*{\@abhdskip}%         \ifphd%           ABSTRACT OF THE DISSERTATION \\           {\def\\{\noexpand\\} \xdef\@abstracttitle{\@abstracttitle}}           \expandafter\uppercase\expandafter{\@abstracttitle} \\           by \\           \@author \\           Florida International University,\ \@conferralyear \\           Miami, Florida \\           Professor \@advisor, Co-Major Professor \\           Professor \@advisortwo, Co-Major Professor \\         \else           \normalsize \bfseries\selectfont           ABSTRACT         \fi%         %\vspace{0.5\baselineskip}       \end{center}%       %\pagestyle{empty}       %\thispagestyle{empty}     }{%       \clearpage     }          \newcommand{\@abstracttitle}{\@title}     \newcommand{\abstracttitle}[1]{\renewcommand{\@abstracttitle}{#1}}               \newenvironment{vita}{%       \typeout{Vita}       \prelim@contents{Vita}       \clearpage       \singlespacing       \addcontentsline{toc}{chapter}{VITA}       \begin{center}         VITA       \end{center}     %  \chapter*{Vita}     }{%       \normalspacing       \clearpage     }          \newenvironment{dedication}{%       \prelim@contents{Dedication}       \null\vfill       \begin{center}         DEDICATION \\     }{       \end{center}       \vfill\null       \clearpage     }          \newenvironment{acknowledgments}{%       \prelim@contents{Acknowledgments}       \null\vfill       \begin{center}         ACKNOWLEDGMENTS \\     }{       \end{center}       \vfill\null       \clearpage     }               \renewcommand\tableofcontents{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \begin{center}           TABLE OF CONTENTS \\[1.5ex]           CHAPTER \hfill{} PAGE         \end{center}         \vspace{-1em}         %\chapter*{\contentsname         %    \@mkboth{%         %       \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%         \@starttoc{toc}%         \if@restonecol\twocolumn\fi         }               \renewcommand*\l@chapter[2]{%       \ifnum \c@tocdepth >\m@ne         \addpenalty{-\@highpenalty}%         \vskip 1.0em \@plus\p@         \setlength\@tempdima{1.5em}%         \begingroup           \parindent \z@ \rightskip \@pnumwidth           \parfillskip -\@pnumwidth           \leavevmode %\bfseries           \advance\leftskip\@tempdima           \hskip -\leftskip     % These three lines cause a line of dots after each TOC entry:           #1\nobreak\            \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}           \hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par     %      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par           \penalty\@highpenalty         \endgroup       \fi}          % The . in the \numberline command gives a period at the end of chapter     % numbers in the Table of Contents     \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne                              \refstepcounter{chapter}%                              \typeout{\@chapapp\space\thechapter}%                              \addcontentsline{toc}{chapter}%                                        {\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}          \newcommand{\contentspage}{%       \listspacing{toc}       \label{toc}       \prelim@contents{\contentsname}       \tableofcontents       \normalspacing       \clearpage     }          % Format the List of Tables as the FIU Graduate School demands.     \renewcommand\listoftables{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \begin{center}           LIST OF TABLES \\[1.5ex]           TABLE \hfill{} PAGE         \end{center}         \vspace{-1em}         %\chapter*{\listtablename}%         %  \@mkboth{%         %      \MakeUppercase\listtablename}%         %     {\MakeUppercase\listtablename}%         \begingroup         \renewcommand\addvspace[1]{}         \setlength{\parskip}{\baselineskip}         \@starttoc{lot}%         \endgroup         \if@restonecol\twocolumn\fi         }          \newcommand{\tablelistpage}{%       \realsinglespacing       %\listspacing{tab}       \label{lot}       \prelim@contents{\listtablename}       \listoftables       \normalspacing       \clearpage     }          % Format the List of Figures as the FIU Graduate School demands.     \renewcommand\listoffigures{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \begin{center}           LIST OF FIGURES \\[1.5ex]           FIGURE \hfill{} PAGE         \end{center}         \vspace{-1em}         %\chapter*{\listfigurename}%         %  \@mkboth{\MakeUppercase\listfigurename}%         %          {\MakeUppercase\listfigurename}%         \begingroup         \renewcommand\addvspace[1]{}         \setlength{\parskip}{\baselineskip}         \@starttoc{lof}%         \endgroup         \if@restonecol\twocolumn\fi         }          \newcommand{\figurelistpage}{%       \realsinglespacing       %\listspacing{fig}       \label{lof}       \prelim@contents{\listfigurename}       \listoffigures       \normalspacing       \clearpage     }     \newcommand{\abbrlist}{%       \listspacing{abbr}       \prelim@contents{List of Abbreviations}       \chapter*{List of Abbreviations}     }          \newcommand{\symlist}{%       \listspacing{sym}       \prelim@contents{List of Symbols}       \chapter*{List of Symbols}     }          \newcommand{\preface}{%       \listspacing{pref}       \prelim@contents{Preface}       \chapter*{Preface}     }          \renewcommand\normalsize{%        \@setfontsize\normalsize\@xiipt{12}%        \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@        \abovedisplayshortskip \z@ \@plus3\p@        \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@        \def\@listi{\leftmargin\leftmargini                    \parsep 5\p@  \@plus2.5\p@ \@minus\p@                    \topsep 10\p@ \@plus4\p@   \@minus6\p@                    \itemsep \z@  \@plus2.5\p@ \@minus\p@}%        \belowdisplayskip \abovedisplayskip     }     \renewcommand\small{%        \@setfontsize\small\@xipt{11}%        \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@        \abovedisplayshortskip \z@ \@plus3\p@        \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@        \def\@listi{\leftmargin\leftmargini                    \topsep 9\p@ \@plus3\p@ \@minus5\p@                    \parsep 4.5\p@ \@plus2\p@ \@minus\p@                    \itemsep \z@  \@plus2\p@ \@minus\p@}%        \belowdisplayskip \abovedisplayskip     }     % Why is this here??? Earlier we set \footnotesize to \normalsize.     %\renewcommand\footnotesize{%     %   \@setfontsize\footnotesize\@xpt\@xpt     %   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@     %   \abovedisplayshortskip \z@ \@plus3\p@     %   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@     %   \def\@listi{\leftmargin\leftmargini     %               \topsep 6\p@ \@plus2\p@ \@minus2\p@     %               \parsep 3\p@ \@plus2\p@ \@minus\p@     %               \itemsep \parsep}%     %   \belowdisplayskip \abovedisplayskip     %}          \newcommand{\realsinglespacing}{%       \let\CS=\@currsize\renewcommand{\baselinestretch}{1.0}\CS}     \newcommand{\singlespacing}{%       \let\CS=\@currsize\renewcommand{\baselinestretch}{1.208333}\CS}     \newcommand{\singlespacingplus}{%       \let\CS=\@currsize\renewcommand{\baselinestretch}{1.5}\CS}     \newcommand{\doublespacing}{%       \let\CS=\@currsize\renewcommand{\baselinestretch}{2}\CS}     \newcommand{\realdoublespacing}{%       \let\CS=\@currsize\renewcommand{\baselinestretch}{2}\CS}     \newcommand{\normalspacing}{\doublespacing}     \newcommand{\footnotespacing}{\singlespacing}     \newcommand{\listspacing}[1]{\singlespacing} % extra arg is extensibility hook     \newcommand{\changespacing}[2]{%       \renewcommand{#1}{%         \let\CS=\@currsize\renewcommand{\baselinestretch}{#2}\CS}%     }     \ifdraft\changespacing{\normalspacing}{1}\fi     \newcommand{\changenormalspacing}[1]{\renewcommand{\normalspacing}{#1}}     \normalspacing          \def \@floatboxreset {%             \reset@font             \normalsize             \singlespacing             \@setminipage     }          \endinput


title: Table vs Plot: How to print table of values, with colors representing values

text: In an effort to collect knowledge that will ultimately allow me to answer this question, I am seeking a way to generate a table where numeric values are plotted as cell-filling colors. The color should represent the number.   N.B.: I am not trying to repost the question I mentioned above. Here I am asking for a way to approach merely a subset of that question. A rendering of my MWE below:   ![plot as a table](http://i.stack.imgur.com/krAhv.png) So far, I have been trying to achieve this using pgfplots (inspired by this answer), but there are some drawbacks in the measuring department:   I'd have to do all the math by hand, in order to make sure all rows and columns align nicely (see MWE). Additionally, styling tick labels with alternating styles will be tough, as a PGFplot is not entirely built to do that. And on top of that, adding meta-labels in order to group tick labels (see other question) is probably going to be impossible. In a nutshell, the approach I have so far (using PGFplots) is not ideal, since what I want is to draw a table. But then, tables don't have these powerful ways of representing numeric values as colors, a.f.a.i.k. MWE:               \documentclass{standalone}          \usepackage{filecontents}     \usepackage{pgfplots, pgfplotstable}          \begin{filecontents}{data.csv}     yitem,xitem,val     a,X,0.1     a,Z,0.3     b,Y,0.5     b,Z,0.6     c,Y,0.8     \end{filecontents}          \pgfplotstableread[col sep=comma]{data.csv}\datatable          \begin{document}          \begin{tikzpicture}     \begin{axis}[         xtick=data,         ytick=data,         unbounded coords=jump,         symbolic x coords={X,Y,Z},         symbolic y coords={a,b,c},         axis line style={draw=none},         tick style=transparent,         y tick label style={             inner sep=0,             font=\tiny,         },         x tick label style={             inner sep=0,             font=\tiny,             rotate=90,             anchor=east,         },         enlarge x limits={abs=1mm},         enlarge y limits={abs=1mm},         x=2mm,         y=2mm,     ]     \addplot[         mark=square*,         mark size=1mm,         only marks,         scatter,         mark options={outer sep=0},         scatter/use mapped color={fill=mapped color,draw opacity=0},         point meta=explicit,     ] table [         col sep=comma,         x=xitem,         y=yitem,         meta expr=\thisrow{val},     ] {\datatable};          \end{axis}     \end{tikzpicture}     \end{document}


title: Given a PS interpreter, can pstricks be converted to pgf?

text: When producing pdf directly, PostScript code cannot be used, which means that `pstricks` macros do not work. Now, it is still possible to include `pstricks` code using external tools (running LaTeX on files built from the document's preamble and the figure's contents), but not as seamlessly as we could want. My aim is to fix this, by implementing a PostScript interpreter in TeX. Before starting such a large project (the part of the PostScript standard that deals only with the programming structures is ~150 pages long), I would like to make sure that this will not be in vain. If I understand correctly, `pstricks` macros eventually insert the PostScript code as `\special` with a certain structure, so in principle I should be able to redefine that primitive to send PostScript special to my interpreter. The step that is not clear to me is how to go from there to actually producing graphics: presumably I would be using `pgf`. This leads me to a few related questions:   * Is it enough to simply hook into `\special`, or should I also change the `pstricks` macros that inserts spacing around figures, for instance?   * Is `pgf` powerful enough to express all elementary graphical operations of PostScript?   * Will I need a general purpose (e)ps to pdf converter?


title: Inserting noncrossing partions

text: I am trying to create non crossing partions in latex. That is to connect numbers with lines drawn below them. An example would be 1 2 3 4 5 │└┘││ └───┘ But the lines should be directly underneath the numbers and there does not need to be gaps.


title: Implementing indent in algorithm environment

text: I am using the algorithm environment in the `algorithm2e` package. What I want is to able to indent various portions. I tried `\indent` but that is doing me no good. Here is the MWE:               \documentclass[12pt,letterpaper]{article}     \usepackage{algorithm2e}     \begin{algorithm}[H]     \SetAlgoLined          \KwData{Executor class}     \KwResult{Executes Main.java}               \indent \textbf{Begin} Executor class              \indent call Main              \indent \textbf{End} Executor class          \end{algorithm}          \end{document}


title: How can I modify the Beamer footline in a way that doesn't change positioning of contents/sidebar?

text: I've started with the basic Berkeley theme in Beamer. I wanted to modify the footer to include the page numbers that are centered on the slide. However, the modified footline element seems to be "stacked" at the bottom of the slide, which shifts slide content up and cuts off the bottom corner of the sidebar. I want the slide to look exactly like the basic theme with just the page numbers pasted at the bottom, centered. I want the sidebar to extend all the way to the bottom of the slide. What do I have to modify to get this done? **Example code:**               \documentclass{beamer}     \usetheme[width=2.0cm]{Berkeley}          %% **this part modifies footline to include slide numbers**          \setbeamertemplate{footline}{%      \leavevmode%      \hbox{\begin{beamercolorbox}[wd=\paperwidth,ht=2.25ex,dp=1ex,center]{frame number}%      \vskip0pt        \usebeamerfont{footline}\usebeamercolor[fg]{footline}\insertframenumber/\inserttotalframenumber      \vskip0pt     \end{beamercolorbox}%     }%      \vskip0pt%     }          \usepackage[utf8]{inputenc}          \title{Sample title}     \author{Anonymous}     \institute{ShareLaTeX}     \date{2013}          \begin{document}          \frame{\titlepage}          \begin{frame}     \frametitle{Sample frame title}     This is a text in first frame. This is a text in first frame. This is a text in first frame.     \end{frame}          \end{document}      ![enter image description here](http://i.stack.imgur.com/kxlvl.png)


title: Moving underset text closer to main text

text: I have an arrow with some text directly underneath, using the command               \newcommand*{\tautrans}%       {\underset{\scriptstyle \tau^*}{\longrightarrow}}%      Since `\tau^*` is not close enough to `\longrightarrow`, I changed to               \newcommand*{\tautrans}%       {\underset{\scriptstyle \raisebox{.2em}{\ensuremath{\tau^*}}}{\longrightarrow}}%      Unfortunately, this changes the distance between lines, but not between `\tau^*` and `\longrightarrow`. So how can I move `\tau^*` a little bit up without moving anything else, so that `\tau^*` comes closer to `\longrightarrow`?


title: Cross-referencing alphabetically numbered list items

text: The webpage http://texblog.org/2012/03/21/cross-referencing-list-items/ teaches how to cross-reference items of a numbered list. But what if the list is alphabetically numbered? What can I do for cross-referencing items of such a list?


title: Dinbrief and Pagenumbers

text: My question concern the line numbers when using the `dinbrief` package. I want to have page numbers like `page 1 of 2` and so on. I tried also the `LastPage` package, but without success. The `dinbrief` package is quite old and seems not be maintained... but I love it. Question: How to get managed the page numbering? If you have any hints or optimizations, they will be appreciated.               % vim: ts=4 syntax=tex tenc=utf8 fenc=utf8     \NeedsTeXFormat{LaTeX2e}     \documentclass[10pt]{dinbrief}          \usepackage[a4paper, left=2.5cm, width=12.5cm, height=26cm, marginparwidth=5cm, marginparsep=.1ex]{geometry}          \usepackage{fontspec, xunicode, xltxtra}     \usepackage{polyglossia}     \usepackage{lipsum}     \usepackage{fancyhdr}     \usepackage{color}     \usepackage{setspace}          \usepackage[final,protrusion=true]{microtype}          \fancypagestyle{default}{%        \renewcommand{\headrulewidth}{0pt}%        \fancyhf{}%        \fancyfoot[C]{\footnotesize Seite \thepage\ von \pageref{lastpage}}%     }          \setmainfont[Numbers={OldStyle},Ligatures={Common}]{OfficinaSansITCStd}          \setmainlanguage{german}          \definecolor{markcolor}{cmyk}{0.8,.55,0,0.6}     \definecolor{black}{rgb}{.0,.0,.0}     \newcommand{\markkey}[1]{\color{markcolor}{\bfseries\ #1}\color{black}\hspace{1ex}}          \newcommand{\normalspacing}{\setstretch{1.5}}%     \newcommand{\bkbrk}{|\hspace{1ex}}          \backaddress{Vorname Nachname\hspace{2ex}\bkbrk\\Straße 1\hspace{2ex}\bkbrk\\11000 City}          \newcommand\marginalien{         \vspace{7em}         \scriptsize         \raggedleft         %\normalspacing         %\raggedright         Vorname Nachname\\         Straße 1\\         11000 City\\[1em]         \markkey{E-Mail}name@domain.com\\     }          \nobackaddressrule     \signature{Vorname Nachname}     %\place{City}     %\date{2007-10-11}     %\yourmail{}     %\sign{unsere zeichen, unsere Nachricht von}     %\phone{tel}     % \writer{Sachbearbeiter}     \centeraddress     \bottomtext{bottom text}     \nowindowrules     %\windowrules     % Faltmarkierungen     %\nowindowtics     \windowtics     % entsprechend DIN 676 von 1976     %\disabledraftstandard     % entsprechen DIN 676 vom 1991     \enabledraftstandard     %\setaddressllcorner{abstand vom linken rand}     %\setaddressllhpos{abstand vom linken rand}     %\setaddressvpos{abstand vom oberen rand}     %\addresshigh     \addressstd          \subject{\bfseries{Ein Subjekt}}          \begin{document}     \normalspacing     \begin{letter}{Company\\Street 1\\11000 City}     \pagestyle{default}     \marginpar{\marginalien}          \opening{Sehr geehrter Herr Mustermann,}          \lipsum[1]          \closing{Mit freundlichen Grüßen}          \end{letter}     \label{lastpage}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Ol0rb.png)


title: Chapter formatting

text: I use report document class and the thing is that I would like to remove Chapter x phrase, add chapter number before chapter title and remove blank place between chapter name and top of page. For example normally it is like:               top of page     blank place     blank place     Chapter 1     Title of chapter     content      It would be better to be like this:               top of page     1. Title of chapter     content


title: Remove 'Chapter' text from chapter headings and have chapter number on the same line as chapter title

text: > **Possible Duplicate:**   >  Chapter formatting Apologies if this is something simple, but I seem to be searching in the wrong place for an answer. I have a document of type `report`. It is currently generating my chapters as follows: Chapter 1 _Name of Chapter_ I just want it to be:   1. _Name of Chapter_ I had a few latex documents which used to generate it in the way I want using this command:               \renewcommand{\chaptermark}[1]{%       \markboth{#1}{}}      However it does not seem to be having any effect on my new document. What am I missing? I am using the latest MiKTeX 2.9 and Texmaker 3.5.2.


title: Change chapter heading format

text: > **Possible Duplicate:**   >  Chapter formatting Could someone help me with this problem with my document? Instead of generating the following:               % % % %          Chapter 2          Title          % % % %      I would like the following text:               % % % %          2 Title          % % % %


title: How to change footnote number style

text: I use old-style numerals as the default text font, but that also makes the footnote numbers old-style---which I don't want. How can change the footnote numbers to lining figures? I'm using LuaLaTeX and Adobe Garamond Pro.


title: CircuitTikZ — relative coordinate

text: Is it possible to use relative coordinate for bipoles ? For example to draw a conductor, we can use : `(0,0)-- ++(2,0)`, and I'd like to do the same with bipoles. Thanks !


title: Section bibliographies

text: What is the best way create a bibliography for separate sections within a document? I am using `biblatex`.


title: Appendix after bibliography

text: I am using `\includefile{}` to add a preliminary literature review to a thesis proposal. The specifications require that "Appendix" be printed in the upper right hand corner. I tried ending my proposal main like this:               \printbibliography     \rhead{Appendix}     \include{literatureReview}     \end{document}      But it doesn't work. The entire literatureReview file has the header "REFERENCES" in the upper left corner. The proposal main uses a plain page style, and the literatureReview currently has no sections in it. Does anyone know the proper way to do this? * * * EDIT: Here's a minimal compilable version: \documentclass{test}               \usepackage[american]{babel}     \usepackage[style=apa]{biblatex}     \usepackage{csquotes}     \usepackage{pdfpages}     \usepackage{fancyhdr}           \DeclareLanguageMapping{american}{american-apa}          \usepackage{hyperref}          \addbibresource{someBib}              %which contains:         %@Article{TakeuchiKoichi05,     %   author={Takeuchi Koichi and Inui Kentaro and Fujita Atsushi and Takeuchi Nao and Abe Shuya},     %   title={Construction of Compositional Lexical Database Based on {L}exical {C}onceptual {S}tructure},     %   journal={IPSJ SIG Notes},     %   publisher={Information Processing Society of {J}apan (IPSJ)},     %   year={2005},     %   month=sep,     %   volume={2005},     %   number={94},     %   pages={123-130},     %}          \title{A Title}     \author{Nathan Glenn}     \begin{document}     \begin{refsection}     \maketitle     %\begin{refsection}               Random citation: \parencite{TakeuchiKoichi05}.           \printbibliography     \end{refsection}     \clearpage     \markboth{Appendix}{}     \begin{refsection}     \include{literatureReview}     \end{refsection}     \end{document}      And here's the class file I used:               \NeedsTeXFormat{LaTeX2e}     \ProvidesClass{test}[2011/5/20 BYU Honors Thesis proposal]          \LoadClass[12pt]{article}          \usepackage[margin=1in]{geometry}          \usepackage{setspace}     \doublespace     \pagestyle{myheadings}     \thispagestyle{plain}     \setlength{\parindent}{30pt}          \global\let\@course\@empty     \renewcommand{\maketitle}{       \begin{flushright}         \@author\\         \ifx\@date\@empty           \today         \else           \@date\\         \fi       \end{flushright}            \begin{center}         \Large{\@title}\\An Honors Thesis Proposal         \vspace{6 pc}       \end{center}     }      literatureReview.tex has no preamble, and does not change the page styles in any way.


title: LaTeX minted package: numbering lines does not work

text: I'm having a problem with the minted package. When I try to add line numbering to the minted command, I get the following error:               ! Package keyval Error: stepnumber undefined.          See the keyval package documentation for explanation.     Type H <return> for immediate help.      ...     l.1 ...,numbers=left,firstnumber=1,stepnumber=1 ]      Minimal example:               \documentclass[12pt]{article}     \usepackage{minted}          \begin{document}          \inputminted[linenos=true]{java}{file_with_code}          \end{document}      Without the `lineos=true` property, it works fine. Does someone know how to fix that? The file_with_code contains just some lines of Java code, which is being highlighted absolutely correctly. Now when I just ignore the error and press Enter after I get the message in the command line, it proceeds and produced an output with numbered lines (beginning with 2, though). Here is the log file:               This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8) (preloaded format=pdflatex 2011.5.22)  29 MAY 2011 15:35     entering extended mode     **minex.tex     (C:\minimalexample\minex.tex     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge     rman, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french, russian, load     ed.     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\article.cls"     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\size12.clo"     File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)     )     \c@part=\count79     \c@section=\count80     \c@subsection=\count81     \c@subsubsection=\count82     \c@paragraph=\count83     \c@subparagraph=\count84     \c@figure=\count85     \c@table=\count86     \abovecaptionskip=\skip41     \belowcaptionskip=\skip42     \bibindent=\dimen102     )     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\minted\minted.sty"     Package: minted 2010/03/16 v1.7 Yet another Pygments shim for LaTeX          ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\keyval.sty"     Package: keyval 1999/03/16 v1.13 key=value parser (DPC)     \KV@toks@=\toks14     )     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\minted\fancyvrb.sty"     Package: fancyvrb 1996/10/05          Style option: `fancyvrb' v2.0-beta, with DG/SPQR fixes <1996/10/05> (tvz)     \FV@CodeLineNo=\count87     \FV@InFile=\read1     \FV@TabBox=\box26     \c@FancyVerbLine=\count88     \FV@OutFile=\write3     No file fancyvrb.rc.     ) ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\color.sty"     Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC)          ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\00miktex\color.cfg"     File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive     )     Package color Info: Driver file: pdftex.def on input line 130.          ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pdftex-def\pdftex.def"     File: pdftex.def 2010/02/14 v0.04n Graphics/color for pdfTeX     \Gread@gobject=\count89     ))     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\float\float.sty"     Package: float 2001/11/08 v1.3d Float enhancements (AL)     \c@float@type=\count90     \float@exts=\toks15     \float@box=\box27     \@float@everytoks=\toks16     \@floatcapt=\box28     )     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\ifthen.sty"     Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)     )     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\tools\calc.sty"     Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)     \calc@Acount=\count91     \calc@Bcount=\count92     \calc@Adimen=\dimen103     \calc@Bdimen=\dimen104     \calc@Askip=\skip43     \calc@Bskip=\skip44     LaTeX Info: Redefining \setlength on input line 76.     LaTeX Info: Redefining \addtolength on input line 77.     \calc@Ccount=\count93     \calc@Cskip=\skip45     )     ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\minted\ifplatform.sty"     Package: ifplatform 2007/11/18 v0.2 Testing for the operating system     runsystem(echo 'write18-test-2011529935'>"minex.w18")...executed.          \instream=\read2     runsystem(del "minex.w18")...executed.          )     \minted@bgbox=\box29     \minted@code=\write4     \@float@every@listing=\toks17     \c@listing=\count94     )     runsystem(del minex.aex)...executed.          runsystem(for ^%i in (pygmentize.exe pygmentize.bat pygmentize.cmd) do set >min     ex.aex <nul: /p x=^%~$PATH:i>>minex.aex)...executed.          \@appexistsfile=\read3     runsystem(del minex.aex)...executed.               file deleted     No file minex.aux.     LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.     LaTeX Font Info:    ... okay on input line 4.     ("C:\Program Files (x86)\MiKTeX 2.8\tex\context\base\supp-pdf.tex"     [Loading MPS to PDF converter (version 2006.09.02).]     \scratchcounter=\count95     \scratchdimen=\dimen105     \scratchbox=\box30     \nofMPsegments=\count96     \nofMParguments=\count97     \everyMPshowfont=\toks18     \MPscratchCnt=\count98     \MPscratchDim=\dimen106     \MPnumerator=\count99     \everyMPtoPDFconversion=\toks19     )     runsystem(pygmentize -S default -f latex > minex.pyg)...executed.           (C:\minimalexample\minex.pyg)     runsystem(pygmentize -l java -f latex -F tokenmerge            -P linenos -P "v     erboptions= " -o minex.out.pyg file_with_code)...executed.           (C:\minimalexample\minex.out.pyg          ! Package keyval Error: stepnumber undefined.          See the keyval package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.1 ...,numbers=left,firstnumber=1,stepnumber=1, ]          ?      LaTeX Font Info:    Font shape `OT1/cmtt/bx/n' in size <12> not available     (Font)              Font shape `OT1/cmtt/m/n' tried instead on input line 2.     )     runsystem(del minex.out.pyg)...executed.           [1          {C:/Users/amaurremi/AppData/Local/MiKTeX/2.8/pdftex/config/pdftex.map}]     (C:\minimalexample\minex.aux) )      Here is how much of TeX's memory you used:      1545 strings out of 495059      21205 string characters out of 3176779      72218 words of memory out of 3000000      4800 multiletter control sequences out of 15000+200000      4408 words of font info for 17 fonts, out of 3000000 for 9000      198 hyphenation exceptions out of 8191      28i,5n,21p,194b,248s stack positions out of 5000i,500n,10000p,200000b,50000s     <C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/p     ublic/amsfonts/cm/cmr12.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/publ     ic/amsfonts/cm/cmr6.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/public/a     msfonts/cm/cmtt12.pfb>     Output written on minex.pdf (1 page, 24857 bytes).     PDF statistics:      18 PDF objects out of 1000 (max. 8388607)      0 named destinations out of 1000 (max. 500000)      1 words of extra memory for PDF output out of 10000 (max. 10000000)


title: How to have titlesec like behaviour for a Koma Script

text: I am using `\documentclass{scrartcl}` which I believe is a Koma-Script type. I now wish to have each `\section{}` start in a new page, similar to what `\usepackage{titlesec}` offers, as shown on this question. How can I do so? Currently, I get this warning which is why I asked this question:               Class scrartcl Warning: Usage of package `titlesec' together     (scrartcl) with a KOMA-Script class is not recommended.      (scrartcl) I'd suggest to use the package only      (scrartcl) if you really need it, because it breaks several     (scrartcl) KOMA-Script features, i.e., option `headings' and     (scrartcl) the extended optional argument of the section     (scrartcl) commands .     (scrartcl) Nevertheless, using requested     (scrartcl) package `titlesec' on input line 7.


title: An environment which parses periods differently to redefine their behavior

text: I have a collection of documents that I want to read into a LaTeX environment. The problem is that these documents are not exactly formatted the way I would like. I would like to create an environment which for the duration of the environment changes the way LaTeX parses `.` at the end of a sentence. Essentially, I would like something which looks like:               \begin{mycontent}        random content.  more random content.  some more random content.     \end{mycontent}      and parses it as though I had written               \begin{mycontent}        random content.\formattingcommand  more random content.\formattingcommand  some more random content.\formattingcommand     \end{mycontent}      I don't have control over the content of the files getting passed to me, but I am guaranteed that the files are all structured the same. I could write a Perl script to handle this, and normally I would. But this is something that needs some kind of LaTeX wrapper that others can use without invoking Perl and works seamlessly for them. It would be nice if I could write something like the following:                \let\oldperiod{.}      \def.{\oldperiod\formattingcommand}%      But `.` is not a command. I've looked in the Knuth's `The TeXbook` in the section on sentences, but I don't see anything there I can immediately use. I suppose I could do something that changes the cat code for `.` for the duration of the environment, but I need the old period to show up within this new environment. I'm not really sure how to go this direction and would prefer not to. But, I'm willing to be flexible on this point (particularly if someone's got something really _cool_ to show.) **Edit 1** On the subject of catcodes: I've never really worked with catcodes before. So I'm kind of blind going down that alley on my own right now. **Edit 2** If I follow _JosephWright_ 's suggestion, I might worry that some other package I load might now have a clash in how an active period will be treated. Is there a reason the following code has not been suggested:               \documentclass{article}     \newcommand{\formattingcommand}{DEMO}     \newenvironment{mycontent}       {%         \let\normalperiod=.%         \catcode`\.=\active         \def.{\normalperiod\formattingcommand}%       }       {}     \begin{document}     \begin{mycontent}       random content.  more random content.  some more random content.     \end{mycontent}     \end{document}      I ask, because it would seem to me that this version should work, but when I try it I get an error:               ! Missing control sequence inserted.     <inserted text>                      \inaccessible      l.11 \begin{mycontent}          ?       **Edit 3** Based upon everyone's feedback below, would the following be safe?               \documentclass{article}     \newcommand{\formattingcommand}{DEMO}     \let\normalperiod=.%     \chardef\periodcatcode=\catcode`\.     \catcode`\.=\active     \newenvironment{mycontent}       {%         \catcode`\.=\active%         \def.{\normalperiod\formattingcommand}%       }       {}     \catcode`\.=\periodcatcode     \begin{document}     \begin{mycontent}       random content.  more random content.  some more random content.     \end{mycontent}     \end{document}      By safe I mean:   1. `\let` saves the correct version of period (period with the expected catcode): assuming I haven't done anything else wonky with catcodes earlier.   2. I've saved the current catcode before making it `\active`   3. I've made `.` have an `\active` cat code to ensure that solely within the scope of my environment it has the `\active` definition I'm giving it. In other words, my definition is local in scope and won't effect definitions outside of its scope.   4. I've restored the catcode of `.` to what it was before creating my new environment without having to second-guess what that might have been.   5. If other packages wish to redefined an _active_ `.`, my tinkering is invisible to them (assuming I'm not using any code related to those packaged within my environment).