title: Crop package in a document with TikZ graphics

text: My Problem Briefly I've created an address book for my son's kindergarten using XeLaTeX. I used TikZ for creating the headers and footers and some other graphics. The book is in DIN A6 format. The printer asked me for crop marks since she will be printing the pages in a larger format and then cutting them down to DIN A6. When I use the `crop` package (e.g., with `[cam,a5,center]`) the TikZ graphics, which are positioned with coordinates, are misplaced since their coordinates then apply to the physical page size specified in the crop package options. I am using Texmaker and MiKTeX 2.9 on Windows 7. One Possible Solution: I could "simply" adjust the coordinates of all the TikZ graphics to reflect the size of the pre-cropped physical page (DIN A5) so that they will be where they need to be on the DIN A6 page once it is cropped. As the document hast 252 pages, this would be quite a lot of work, however. And I would rather not because I may also want to produce a digital version of the address book. My Question: Is there a way to set up the crop package or my preamble such that the TikZ graphics' coordinates remain based on the DIN A6 page specification even when I am using an additional, larger physical page specification for cropping purposes? Here is the preamble and the code of the example images (the one difference in the two images being the `crop` package):               \documentclass[10pt,twoside,openright,a6paper]{scrbook}          \usepackage[xetex]{graphicx}     \usepackage[no-math]{fontspec}     \usepackage{xunicode}% provides unicode character macros      \defaultfontfeatures{Mapping=tex-text}     \usepackage{xunicode}          \setmainfont[]{DINNeuzeitGroteskStd-Light}     \setsansfont[]{DINNeuzeitGroteskStd-BdCond}          \usepackage{polyglossia}          \usepackage{microtype}          \setdefaultlanguage[spelling=new,babelshorthands=true]{german}          \usepackage[german]{translator}          \usepackage[top=1.2cm,inner=.5cm,outer=.5cm,bottom=1.2cm]{geometry}          \usepackage[cam,a5,center]{crop} %IN THE OTHER VERSION OF THE PDF FILE THIS PACKAGE IS OFF.          \usepackage{color}          \usepackage{setspace}          \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyfoot[LE]{\begin{tikzpicture}[remember picture,overlay]     \node [xshift=-1mm,yshift=-1mm] at (current page.south west)     [text width=10mm,text depth=1.2ex,text height=4mm,fill=violet!100,above right,text=white,align=center]     {\mbox{\hspace{.08cm}}\textsf{\thepage}};     \end{tikzpicture}}          \fancyfoot[RO]{\begin{tikzpicture}[remember picture,overlay]     \node [xshift=94mm,yshift=-1mm] at (current page.south west)     [text width=9mm,text depth=1.2ex,text height=4mm,fill=violet!100,above right,text=white,align=center]     {\textsf{\thepage}};     \end{tikzpicture}}          \fancyhead{} % clear all header fields          \fancyfoot[C]{}     \renewcommand{\headrulewidth}{0pt}          \usepackage{tocstyle}     \newtocstyle[allwithdot][]{mytocstyle}{\settocfeature[-1]{entryhook}{\normalsize}}     \usetocstyle{mytocstyle}     \settocstylefeature[0]{entryvskip}{2pt}          \makeatletter     \renewcommand*\l@chapter{\bprot@dottedtocline{1}{1.4em}{2.3em}}% no indentation     \renewcommand{\@pnumwidth}{1.6em}     \renewcommand{\@tocrmarg}{4em}     \makeatother          \usepackage{float}          \usepackage{tabularx}     \usepackage{booktabs}          \usepackage{rotating}          \usepackage{ragged2e}          \usepackage{array}     \usepackage{colortbl}     \usepackage{color}     \usepackage{tikz}     \usetikzlibrary{shapes}     \usepackage{amsmath,amssymb}     \usepackage{verbatim}     \usepgflibrary{arrows}     \usetikzlibrary{automata}     \usetikzlibrary{arrows,decorations.pathmorphing,decorations.text,backgrounds,positioning,fit,petri,intersections,shapes.multipart}                \usepackage{multirow}          \usepackage[small,raggedright]{titlesec}     \titlespacing*{\chapter}{0pt}{0cm}{1cm}     \titleformat*{\chapter}{\color{violet}\bf\sf}     \titleformat*{\section}{\color{violet}\bf\sf}          \setkomafont{caption}{\footnotesize}          \usetikzlibrary{automata}     \usetikzlibrary{arrows,decorations.pathmorphing,decorations.text,backgrounds,positioning,fit,petri,intersections,shapes.multipart,calendar}          \usepackage[labelformat=empty]{caption}     \captionsetup{margin={1cm,1cm},justification=centering}               \usepackage[hyperfootnotes=false]{hyperref}          \hyphenation{Na-tur-wis-sen-schaften}          \usepackage{pbox}          \usepackage[autostyle,german=guillemets]{csquotes}          \newcommand{\longpage}{\enlargethispage{\baselineskip}}     \newcommand{\shortpage}{\enlargethispage{-\baselineskip}}          \usepackage{marvosym}          \urlstyle{same}          \begin{document}          \chapter*{Child's Name}     \addcontentsline{toc}{chapter}{\textnormal{Child's Name}}     \thispagestyle{fancy}          \begin{tikzpicture}[remember picture,overlay]     \node [xshift=61mm,yshift=140.5mm] at (current page.south west)     [text width=42mm,text depth=.7ex,text height=1.5cm,fill=violet!100,above right,text=white]     {\hfill{}\textsf{Child's Name}\mbox{\hspace{.45cm}}};     \end{tikzpicture}               \noindent     Text Text Text . . .          \vfill          \noindent     Address Information          \end{document}      Using the crop package: ![without crop](http://i.stack.imgur.com/68m5O.png) Not using the crop package: ![using crop](http://i.stack.imgur.com/8i7E0.png)


title: (Semantically) correct string concatenation symbol?

text: I'm wondering about what's the "correct" symbol to use when typesetting standard string concatenation (I've seen How do I typeset the concatenation of strings properly? btw, but it deals with a non-standard variant of concatenation, which I'm not interested in). Should one use `||` directly or `\parallel`? Or maybe something else completely? I'm not able to make up my mind about the first two. `||` seems to be what I'm after usually, but sometimes it feels like it leaves too little space between the concatenated words. Conversely, `\parallel` also seems to work sometimes, but often leaves too much space between words. So, which one to chose if I were to do this "correctly"?


title: Documenting on code revisions

text: I have made modifications to a few files of a C++ program. I would like to document on these changes in a nice LaTeX report, by showing exactly what I modified and explaining why I did so. Since there are quite a lot of lines of code that have changed, it is not really an option to go through all of them manually, copy and paste relevant bits and add commentary. My questions are:   * How would you go about making such a document, preferably with colors or some markup to clearly show differences?   * Would you show the code versions side by side, or rather show a kind of diff log?   * Where would you add commentary? I am thinking of using the terminal git diff color output as a basis, somehow getting LaTeX to typeset this and adding in my comments.


title: ConTeXt: How to create nice-looking fractions

text: # Background Looking to create vulgar fractions in the current font such those in Unicode. LaTeX has the _nicefrac_ package that provides, as the name implies, fractions where the dividing line is a "nice looking" slash, rather than a horizontal line. # Question How do you produce a vulgar fraction in ConTeXt?


title: Using titlesec in beamerarticle with a modified section command

text: This is further to the solution provided to my previous question about allocating short and long titles correctly to the beamer and article output of a **beamerarticle**. The solution provided there works fine; however it creates a further problem because I am also using the **titlesec** package to modify section title formatting in the article. **titlesec** is designed for `\section` and, having used the solution in the previous question I am now using a customized command `\Section`. Any idea how to make **titlesec** "understand" `\Section`? Additions to code for the minimal working example in the previous question:               \mode<article>{       \usepackage[compact]{titlesec}     }          \only<article>{      \titleformat{\section}      {\normalfont\Large\bfseries}{\thesection}{1em}{}      \titlespacing{\section}{0pt}{2em}{0.5em}     }


title: Dotted line in ToC despite \cftsetpnumwidth

text: Using the package `tocloft` I have a problem with the dotted line in my ToC. For I'm using roman page numbering I have numbers of about XXVIII or something like that which is too wide for the obviously pre-set `\pnumwidth`. It flows of my right margin which looks quite unaesthetic. So to get the numbering ragged right I put the numbers into a box with `\cftsetpnumwidth{}`. Now the problem is that the dotted line stops when reaching that box (which I know is quite obvious). But can I somehow get the dots until the number starts? Something like setting the pagenumbering raggedright with another command without using a numberbox? If anybody knows a solution for that problem I would be very happy to hear! Thanks in advance! In the following my minimal example:               \documentclass[listof=totocnumbered,9pt,a4paper,ngerman]{scrartcl} % Verzeichnisse im IV aufgeführt mit Nr.          \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage[ngerman]{babel}     \usepackage{extsizes}     \usepackage[a4paper,left=3cm,right=2.5cm,top=2cm,bottom=2cm]{geometry}     \usepackage[titles]{tocloft} % Formatierung der Vezeichnisse          \cftsetpnumwidth{1.0cm}          \renewcommand{\cftsecdotsep}{\cftdotsep}     \renewcommand{\cftsecleader}{\normalfont\cftdotfill{\cftsecdotsep}}          \begin{document}     \makeatletter     \renewcommand{\cftdotsep}{0.5} % Einstellung der Punktabstände im VZ     \makeatother          \tableofcontents % Inhaltsverzeichnis          \newpage     \newcommand*{\thesectionwas}{}     \let\thesectionwas\thesection     \renewcommand{\thesection}{\Roman{section}}     \setcounter{section}{0}          \section{Abkürzungsverzeichnis}          \newpage     \makeatletter     \renewcommand{\cftdotsep}{0.5}     \makeatother     \listoffigures % Abb-VZ          \newpage     \makeatletter     \renewcommand{\cftdotsep}{0.5}     \makeatother     \listoftables % Tab-VZ     \newpage          \renewcommand{\thesection}{\Roman{section}}     \setcounter{section}{3}     \pagenumbering{Roman}     \setcounter{page}{31}          \begin{appendix}     \refstepcounter{section}     \section{bla}     \section{blabla}     \end{appendix}          \end{document}


title: "Undefined control sequence" problem in memoir class?

text: I use `memoir` class and want to customize the table-of-contents and chapters style. When I use `\renewcommand*\l@chapter[2]` I get this error after the _second compilation_ :               Undefined control sequence.     \chapternumberline ... \@tempdima {\@chapapp@head     \@cftbsnum #1\@cftasnum \h...     l.2 ...pter}{\chapternumberline {1}Chapter One}{3}      My code:               \documentclass{memoir}      \usepackage{xcolor}     \usepackage[framemethod=tikz]{mdframed}      \usepackage{titletoc}     \usepackage{etoolbox}               \definecolor{secnum}{RGB}{13,151,225}     \definecolor{ptcbackground}{RGB}{212,237,252}     \definecolor{ptctitle}{RGB}{0,177,235}          \makeatletter     \renewcommand*\l@chapter[2]{%       \ifnum \c@tocdepth >\m@ne         \addpenalty{-\@highpenalty}%         \vskip 2.0em \@plus\p@         \setlength\@tempdima{1.5em}%         \begingroup           \parindent \z@ \rightskip \@pnumwidth           \parfillskip -\@pnumwidth           \leavevmode           \advance\leftskip\@tempdima           \hskip -\leftskip           \colorbox{ptctitle}{\strut%             \makebox[\dimexpr\textwidth-2\fboxsep-7pt\relax][l]{%               \color{white}\bfseries\sffamily#1%               \nobreak\hfill\nobreak\hb@xt@\@pnumwidth{\hss #2}}}\par\smallskip           \penalty\@highpenalty         \endgroup       \fi}     \makeatother          \begin{document}          \tableofcontents          \chapter{Chapter One}     \section{Section One One}     \subsection{Section One Two}          \chapter{Chapter Two}     \section{Section Two One}          \end{document}      In `book` class, however, it works with no error!


title: oneside option gives error

text: I'm writing my thesis and I have a problem: if I put `twoside` in the options I obtain no error. I need to print `oneside` so I put the option `oneside` but I obtained hundreds errors. This is my code:               \documentclass[a4paper,12pt,oneside,final]{tesi}     \usepackage{textcomp}     \usepackage{times}     \usepackage[english]{babel} %English     \usepackage[latin1]{inputenc} %ITALIANO     \usepackage[T1]{fontenc}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{mathrsfs}     \usepackage{latexsym}     \usepackage{amssymb}     \usepackage{makeidx}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{cite}     \usepackage[toc,page]{appendix}     \usepackage{rotating}     \usepackage{xcolor}     \usepackage{subfigure}     \usepackage{amsthm}     \usepackage{float}               \input{inc-commands.tex}          \input{inc-formattazione.tex}          \makeindex          \theoremstyle{plain}      \newtheorem{thm}{Theorem}[section]      \newtheorem{cor}[thm]{Corollario}      \newtheorem{lem}[thm]{Lemma}      \newtheorem{prop}[thm]{Proposizione}           \theoremstyle{definition}      \newtheorem{defn}{Definizione}[chapter]           \theoremstyle{remark}      \newtheorem{oss}{Osservazione}      %===========================================================================================     \begin{document}     \singlespacing     \input{inc-frontespizio.tex}          \onehalfspacing     \pagestyle{empty}     \tableofcontents     \pagestyle{empty}     \cleardoublepage          \doublespacing     \pagestyle{headings}               %-----------------------------------------------------------------------------     \input{testo-tesi.tex}     %-----------------------------------------------------------------------------          \cleardoublepage     \pagestyle{plain}     \singlespacing     \listoffigures\addcontentsline{toc}{chapter}{List of Figures}          \listoftables\addcontentsline{toc}{chapter}{List of Tables}     \begin{appendices}     %\appendix % Cue to tell LaTeX that the following 'chapters' are Appendices     % Appendix A     \input{./Appendices/AppendixA}  % Appendix Title     % Appendix B     \input{./Appendices/AppendixB} % Appendix Title     \end{appendices}     \begin{thebibliography}{100}      \addcontentsline{toc}{chapter}{Bibliography}           \end{thebibliography}           \end{document}      this is the thesis class:               %%      %% This file was generated from file(s) of the LaTeX base system.     %% --------------------------------------------------------------     %%      %% It may be distributed and/or modified under the     %% conditions of the LaTeX Project Public License, either version 1.3     %% of this license or (at your option) any later version.     %% The latest version of this license is in     %%    http://www.latex-project.org/lppl.txt     %% and version 1.3 or later is part of all distributions of LaTeX     %% version 2003/12/01 or later.     %%      %% This file has the LPPL maintenance status "maintained".     %%      %% This file may only be distributed together with a copy of the LaTeX     %% base system. You may however distribute the LaTeX base system without     %% such generated files.     %%      %% The list of all files belonging to the LaTeX base distribution is     %% given in the file `manifest.txt'. See also `legal.txt' for additional     %% information.     %%      %% The list of derived (unpacked) files belonging to the distribution     %% and covered by LPPL is defined by the unpacking scripts (with     %% extension .ins) which are part of the distribution.     %% \CharacterTable     %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z     %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z     %%   Digits        \0\1\2\3\4\5\6\7\8\9     %%   Exclamation   \!     Double quote  \"     Hash (number) \#     %%   Dollar        \$     Percent       \%     Ampersand     \&     %%   Acute accent  \'     Left paren    \(     Right paren   \)     %%   Asterisk      \*     Plus          \+     Comma         \,     %%   Minus         \-     Point         \.     Solidus       \/     %%   Colon         \:     Semicolon     \;     Less than     \<     %%   Equals        \=     Greater than  \>     Question mark \?     %%   Commercial at \@     Left bracket  \[     Backslash     \\     %%   Right bracket \]     Circumflex    \^     Underscore    \_     %%   Grave accent  \`     Left brace    \{     Vertical bar  \|     %%   Right brace   \}     Tilde         \~}     \NeedsTeXFormat{LaTeX2e}[1995/12/01]     \ProvidesClass{tesi}                   [2007/11/24        Standard LaTeX document class]     \newcommand\@ptsize{}     \newif\if@restonecol     \newif\if@titlepage     \@titlepagetrue     \newif\if@openright     \newif\if@mainmatter \@mainmattertrue     \if@compatibility\else     \DeclareOption{a4paper}        {\setlength\paperheight {297mm}%         \setlength\paperwidth  {210mm}}     \DeclareOption{a5paper}        {\setlength\paperheight {210mm}%         \setlength\paperwidth  {148mm}}     \DeclareOption{b5paper}        {\setlength\paperheight {250mm}%         \setlength\paperwidth  {176mm}}     \DeclareOption{letterpaper}        {\setlength\paperheight {11in}%         \setlength\paperwidth  {8.5in}}     \DeclareOption{legalpaper}        {\setlength\paperheight {14in}%         \setlength\paperwidth  {8.5in}}     \DeclareOption{executivepaper}        {\setlength\paperheight {10.5in}%         \setlength\paperwidth  {7.25in}}     \DeclareOption{landscape}        {\setlength\@tempdima   {\paperheight}%         \setlength\paperheight {\paperwidth}%         \setlength\paperwidth  {\@tempdima}}     \fi     \if@compatibility       \renewcommand\@ptsize{0}     \else     \DeclareOption{10pt}{\renewcommand\@ptsize{0}}     \fi     \DeclareOption{11pt}{\renewcommand\@ptsize{1}}     \DeclareOption{12pt}{\renewcommand\@ptsize{2}}     \if@compatibility\else     \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}     \fi     \DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}     \DeclareOption{draft}{\setlength\overfullrule{5pt}}     \if@compatibility\else     \DeclareOption{final}{\setlength\overfullrule{0pt}}     \fi     \DeclareOption{titlepage}{\@titlepagetrue}     \if@compatibility\else     \DeclareOption{notitlepage}{\@titlepagefalse}     \fi     \if@compatibility     \@openrighttrue     \else     \DeclareOption{openright}{\@openrighttrue}     \DeclareOption{openany}{\@openrightfalse}     \fi     \if@compatibility\else     \DeclareOption{onecolumn}{\@twocolumnfalse}     \fi     \DeclareOption{twocolumn}{\@twocolumntrue}     \DeclareOption{leqno}{\input{leqno.clo}}     \DeclareOption{fleqn}{\input{fleqn.clo}}     \DeclareOption{openbib}{%       \AtEndOfPackage{%        \renewcommand\@openbib@code{%           \advance\leftmargin\bibindent           \itemindent -\bibindent           \listparindent \itemindent           \parsep \z@           }%        \renewcommand\newblock{\par}}%     }     \ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright}     \ProcessOptions     \input{bk1\@ptsize.clo}     \setlength\lineskip{1\p@}     \setlength\normallineskip{1\p@}     \renewcommand\baselinestretch{}     \setlength\parskip{0\p@ \@plus \p@}     \@lowpenalty   51     \@medpenalty  151     \@highpenalty 301     \setcounter{topnumber}{2}     \renewcommand\topfraction{.7}     \setcounter{bottomnumber}{1}     \renewcommand\bottomfraction{.3}     \setcounter{totalnumber}{3}     \renewcommand\textfraction{.2}     \renewcommand\floatpagefraction{.5}     \setcounter{dbltopnumber}{2}     \renewcommand\dbltopfraction{.7}     \renewcommand\dblfloatpagefraction{.5}     \if@twoside       \def\ps@headings{%           \let\@oddfoot\@empty\let\@evenfoot\@empty           \def\@evenhead{\thepage\hfil\slshape\leftmark}%           \def\@oddhead{{\slshape\leftmark}\hfil\thepage}%           \let\@mkboth\markboth         \def\chaptermark##1{%           \markboth {\MakeUppercase{%             \ifnum \c@secnumdepth >\m@ne               \if@mainmatter                 CAP. \thechapter. \ %               \fi             \fi             ##1}}{}}%         \def\sectionmark##1{%           \markright {{%             \ifnum \c@secnumdepth >\m@ne               \if@mainmatter                 CAP. \thechapter. \ %               \fi             ##1}}}}     \else       \def\ps@headings{%         \let\@oddfoot\@empty         \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%         \let\@mkboth\markboth         \def\chaptermark##1{%           \markright {\MakeUppercase{%             \ifnum \c@secnumdepth >\m@ne               \if@mainmatter                  CAP. \thechapter. \ %               \fi             \fi             ##1}}}}     \fi     \def\ps@myheadings{%         \let\@oddfoot\@empty\let\@evenfoot\@empty         \def\@evenhead{\thepage\hfil\slshape\leftmark}%         \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%         \let\@mkboth\@gobbletwo         \let\chaptermark\@gobble         \let\sectionmark\@gobble         }       \if@titlepage       \newcommand\maketitle{\begin{titlepage}%       \let\footnotesize\small       \let\footnoterule\relax       \let \footnote \thanks       \null\vfil       \vskip 60\p@       \begin{center}%         {\LARGE \@title \par}%         \vskip 3em%         {\large          \lineskip .75em%           \begin{tabular}[t]{c}%             \@author           \end{tabular}\par}%           \vskip 1.5em%         {\large \@date \par}%       % Set date in \large size.       \end{center}\par       \@thanks       \vfil\null       \end{titlepage}%       \setcounter{footnote}{0}%       \global\let\thanks\relax       \global\let\maketitle\relax       \global\let\@thanks\@empty       \global\let\@author\@empty       \global\let\@date\@empty       \global\let\@title\@empty       \global\let\title\relax       \global\let\author\relax       \global\let\date\relax       \global\let\and\relax     }     \else     \newcommand\maketitle{\par       \begingroup         \renewcommand\thefootnote{\@fnsymbol\c@footnote}%         \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%         \long\def\@makefntext##1{\parindent 1em\noindent                 \hb@xt@1.8em{%                     \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%         \if@twocolumn           \ifnum \col@number=\@ne             \@maketitle           \else             \twocolumn[\@maketitle]%           \fi         \else           \newpage           \global\@topnum\z@   % Prevents figures from going at top of page.           \@maketitle         \fi         \thispagestyle{plain}\@thanks       \endgroup       \setcounter{footnote}{0}%       \global\let\thanks\relax       \global\let\maketitle\relax       \global\let\@maketitle\relax       \global\let\@thanks\@empty       \global\let\@author\@empty       \global\let\@date\@empty       \global\let\@title\@empty       \global\let\title\relax       \global\let\author\relax       \global\let\date\relax       \global\let\and\relax     }     \def\@maketitle{%       \newpage       \null       \vskip 2em%       \begin{center}%       \let \footnote \thanks         {\LARGE \@title \par}%         \vskip 1.5em%         {\large           \lineskip .5em%           \begin{tabular}[t]{c}%             \@author           \end{tabular}\par}%         \vskip 1em%         {\large \@date}%       \end{center}%       \par       \vskip 1.5em}     \fi     \newcommand*\chaptermark[1]{}     \setcounter{secnumdepth}{2}     \newcounter {part}     \newcounter {chapter}     \newcounter {section}[chapter]     \newcounter {subsection}[section]     \newcounter {subsubsection}[subsection]     \newcounter {paragraph}[subsubsection]     \newcounter {subparagraph}[paragraph]     \renewcommand \thepart {\@Roman\c@part}     \renewcommand \thechapter {\@arabic\c@chapter}     \renewcommand \thesection {\thechapter.\@arabic\c@section}     \renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}     \renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}     \renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}     \renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}     \newcommand\@chapapp{\chaptername}     \newcommand\frontmatter{%         \cleardoublepage       \@mainmatterfalse       \pagenumbering{roman}}     \newcommand\mainmatter{%         \cleardoublepage       \@mainmattertrue       \pagenumbering{arabic}}     \newcommand\backmatter{%       \if@openright         \cleardoublepage       \else         \clearpage       \fi       \@mainmatterfalse}     \newcommand\part{%       \if@openright         \cleardoublepage       \else         \clearpage       \fi       \thispagestyle{plain}%       \if@twocolumn         \onecolumn         \@tempswatrue       \else         \@tempswafalse       \fi       \null\vfil       \secdef\@part\@spart}          \def\@part[#1]#2{%         \ifnum \c@secnumdepth >-2\relax           \refstepcounter{part}%           \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%         \else           \addcontentsline{toc}{part}{#1}%         \fi         \markboth{}{}%         {\centering          \interlinepenalty \@M          \normalfont          \ifnum \c@secnumdepth >-2\relax            \huge\bfseries \partname\nobreakspace\thepart            \par            \vskip 20\p@          \fi          \Huge \bfseries #2\par}%         \@endpart}     \def\@spart#1{%         {\centering          \interlinepenalty \@M          \normalfont          \Huge \bfseries #1\par}%         \@endpart}     \def\@endpart{\vfil\newpage                   \if@twoside                    \if@openright                     \null                     \thispagestyle{empty}%                     \newpage                    \fi                   \fi                   \if@tempswa                     \twocolumn                   \fi}     \newcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi                         \thispagestyle{plain}%                         \global\@topnum\z@                         \@afterindentfalse                         \secdef\@chapter\@schapter}     \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne                            \if@mainmatter                              \refstepcounter{chapter}%                              \typeout{\@chapapp\space\thechapter.}%                              \addcontentsline{toc}{chapter}%                                        {\protect\numberline{\thechapter}#1}%                            \else                              \addcontentsline{toc}{chapter}{#1}%                            \fi                         \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\@makechapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright \normalfont         \ifnum \c@secnumdepth >\m@ne           \if@mainmatter             \huge\bfseries \@chapapp\space \thechapter             \par\nobreak             \vskip 20\p@           \fi         \fi         \interlinepenalty\@M         \Huge \bfseries #1\par\nobreak         \vskip 40\p@       }}     \def\@schapter#1{\if@twocolumn                        \@topnewpage[\@makeschapterhead{#1}]%                      \else                        \@makeschapterhead{#1}%                        \@afterheading                      \fi}     \def\@makeschapterhead#1{%       \vspace*{50\p@}%       {\parindent \z@ \raggedright         \normalfont         \interlinepenalty\@M         \Huge \bfseries  #1\par\nobreak         \vskip 40\p@       }}     \newcommand\section{\@startsection {section}{1}{\z@}%                                        {-3.5ex \@plus -1ex \@minus -.2ex}%                                        {2.3ex \@plus.2ex}%                                        {\normalfont\Large\bfseries}}     \newcommand\subsection{\@startsection{subsection}{2}{\z@}%                                          {-3.25ex\@plus -1ex \@minus -.2ex}%                                          {1.5ex \@plus .2ex}%                                          {\normalfont\large\bfseries}}     \newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%                                          {-3.25ex\@plus -1ex \@minus -.2ex}%                                          {1.5ex \@plus .2ex}%                                          {\normalfont\normalsize\bfseries}}     \newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%                                         {3.25ex \@plus1ex \@minus.2ex}%                                         {-1em}%                                         {\normalfont\normalsize\bfseries}}     \newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%                                            {3.25ex \@plus1ex \@minus .2ex}%                                            {-1em}%                                           {\normalfont\normalsize\bfseries}}     \if@twocolumn       \setlength\leftmargini  {2em}     \else       \setlength\leftmargini  {2.5em}     \fi     \leftmargin  \leftmargini     \setlength\leftmarginii  {2.2em}     \setlength\leftmarginiii {1.87em}     \setlength\leftmarginiv  {1.7em}     \if@twocolumn       \setlength\leftmarginv  {.5em}       \setlength\leftmarginvi {.5em}     \else       \setlength\leftmarginv  {1em}       \setlength\leftmarginvi {1em}     \fi     \setlength  \labelsep  {.5em}     \setlength  \labelwidth{\leftmargini}     \addtolength\labelwidth{-\labelsep}     \@beginparpenalty -\@lowpenalty     \@endparpenalty   -\@lowpenalty     \@itempenalty     -\@lowpenalty     \renewcommand\theenumi{\@arabic\c@enumi}     \renewcommand\theenumii{\@alph\c@enumii}     \renewcommand\theenumiii{\@roman\c@enumiii}     \renewcommand\theenumiv{\@Alph\c@enumiv}     \newcommand\labelenumi{\theenumi.}     \newcommand\labelenumii{(\theenumii)}     \newcommand\labelenumiii{\theenumiii.}     \newcommand\labelenumiv{\theenumiv.}     \renewcommand\p@enumii{\theenumi}     \renewcommand\p@enumiii{\theenumi(\theenumii)}     \renewcommand\p@enumiv{\p@enumiii\theenumiii}     \newcommand\labelitemi{\textbullet}     \newcommand\labelitemii{\normalfont\bfseries \textendash}     \newcommand\labelitemiii{\textasteriskcentered}     \newcommand\labelitemiv{\textperiodcentered}     \newenvironment{description}                    {\list{}{\labelwidth\z@ \itemindent-\leftmargin                             \let\makelabel\descriptionlabel}}                    {\endlist}     \newcommand*\descriptionlabel[1]{\hspace\labelsep                                     \normalfont\bfseries #1}     \newenvironment{verse}                    {\let\\\@centercr                     \list{}{\itemsep      \z@                             \itemindent   -1.5em%                             \listparindent\itemindent                             \rightmargin  \leftmargin                             \advance\leftmargin 1.5em}%                     \item\relax}                    {\endlist}     \newenvironment{quotation}                    {\list{}{\listparindent 1.5em%                             \itemindent    \listparindent                             \rightmargin   \leftmargin                             \parsep        \z@ \@plus\p@}%                     \item\relax}                    {\endlist}     \newenvironment{quote}                    {\list{}{\rightmargin\leftmargin}%                     \item\relax}                    {\endlist}     \if@compatibility     \newenvironment{titlepage}         {%           \cleardoublepage           \if@twocolumn             \@restonecoltrue\onecolumn           \else             \@restonecolfalse\newpage           \fi           \thispagestyle{empty}%           \setcounter{page}\z@         }%         {\if@restonecol\twocolumn \else \newpage \fi         }     \else     \newenvironment{titlepage}         {%           \cleardoublepage           \if@twocolumn             \@restonecoltrue\onecolumn           \else             \@restonecolfalse\newpage           \fi           \thispagestyle{empty}%           \setcounter{page}\@ne         }%         {\if@restonecol\twocolumn \else \newpage \fi          \if@twoside\else             \setcounter{page}\@ne          \fi         }     \fi     \newcommand\appendix{\par       \setcounter{chapter}{0}%       \setcounter{section}{0}%       \gdef\@chapapp{\appendixname}%       \gdef\thechapter{\@Alph\c@chapter}}     \setlength\arraycolsep{5\p@}     \setlength\tabcolsep{6\p@}     \setlength\arrayrulewidth{.4\p@}     \setlength\doublerulesep{2\p@}     \setlength\tabbingsep{\labelsep}     \skip\@mpfootins = \skip\footins     \setlength\fboxsep{3\p@}     \setlength\fboxrule{.4\p@}     \@addtoreset {equation}{chapter}     \renewcommand\theequation       {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}     \newcounter{figure}[chapter]     \renewcommand \thefigure          {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure }     \def\fps@figure{tbp}     \def\ftype@figure{1}     \def\ext@figure{lof}     \def\fnum@figure{\figurename\nobreakspace\thefigure}     \newenvironment{figure}                    {\@float{figure}}                    {\end@float}     \newenvironment{figure*}                    {\@dblfloat{figure}}                    {\end@dblfloat}     \newcounter{table}[chapter]     \renewcommand \thetable          {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}     \def\fps@table{tbp}     \def\ftype@table{2}     \def\ext@table{lot}     \def\fnum@table{\tablename\nobreakspace\thetable}     \newenvironment{table}                    {\@float{table}}                    {\end@float}     \newenvironment{table*}                    {\@dblfloat{table}}                    {\end@dblfloat}     \newlength\abovecaptionskip     \newlength\belowcaptionskip     \setlength\abovecaptionskip{10\p@}     \setlength\belowcaptionskip{0\p@}     \long\def\@makecaption#1#2{%       \vskip\abovecaptionskip       \sbox\@tempboxa{#1: #2}%       \ifdim \wd\@tempboxa >\hsize         #1: #2\par       \else         \global \@minipagefalse         \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%       \fi       \vskip\belowcaptionskip}     \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}     \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}     \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}     \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}     \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}     \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}     \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}     \DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}     \DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}     \newcommand\@pnumwidth{1.55em}     \newcommand\@tocrmarg{2.55em}     \newcommand\@dotsep{4.5}     \setcounter{tocdepth}{2}     \newcommand\tableofcontents{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\contentsname             \@mkboth{%                \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%         \@starttoc{toc}%         \if@restonecol\twocolumn\fi         }     \newcommand*\l@part[2]{%       \ifnum \c@tocdepth >-2\relax         \addpenalty{-\@highpenalty}%         \addvspace{2.25em \@plus\p@}%         \setlength\@tempdima{3em}%         \begingroup           \parindent \z@ \rightskip \@pnumwidth           \parfillskip -\@pnumwidth           {\leavevmode            \large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par            \nobreak              \global\@nobreaktrue              \everypar{\global\@nobreakfalse\everypar{}}%         \endgroup       \fi}     \newcommand*\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           #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par           \penalty\@highpenalty         \endgroup       \fi}     \newcommand*\l@section{\@dottedtocline{1}{1.5em}{2.3em}}     \newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}     \newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}     \newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}     \newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}     \newcommand\listoffigures{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\listfigurename}%           \@mkboth{\MakeUppercase\listfigurename}%                   {\MakeUppercase\listfigurename}%         \@starttoc{lof}%         \if@restonecol\twocolumn\fi         }     \newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}     \newcommand\listoftables{%         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\listtablename}%           \@mkboth{%               \MakeUppercase\listtablename}%              {\MakeUppercase\listtablename}%         \@starttoc{lot}%         \if@restonecol\twocolumn\fi         }     \let\l@table\l@figure     \newdimen\bibindent     \setlength\bibindent{1.5em}     \newenvironment{thebibliography}[1]          {\chapter*{\bibname}%           \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%           \list{\@biblabel{\@arabic\c@enumiv}}%                {\settowidth\labelwidth{\@biblabel{#1}}%                 \leftmargin\labelwidth                 \advance\leftmargin\labelsep                 \@openbib@code                 \usecounter{enumiv}%                 \let\p@enumiv\@empty                 \renewcommand\theenumiv{\@arabic\c@enumiv}}%           \sloppy           \clubpenalty4000           \@clubpenalty \clubpenalty           \widowpenalty4000%           \sfcode`\.\@m}          {\def\@noitemerr            {\@latex@warning{Empty `thebibliography' environment}}%           \endlist}     \newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}     \let\@openbib@code\@empty     \newenvironment{theindex}                    {\if@twocolumn                       \@restonecolfalse                     \else                       \@restonecoltrue                     \fi                     \twocolumn[\@makeschapterhead{\indexname}]%                     \@mkboth{\MakeUppercase\indexname}%                             {\MakeUppercase\indexname}%                     \thispagestyle{plain}\parindent\z@                     \parskip\z@ \@plus .3\p@\relax                     \columnseprule \z@                     \columnsep 35\p@                     \let\item\@idxitem}                    {\if@restonecol\onecolumn\else\clearpage\fi}     \newcommand\@idxitem{\par\hangindent 40\p@}     \newcommand\subitem{\@idxitem \hspace*{20\p@}}     \newcommand\subsubitem{\@idxitem \hspace*{30\p@}}     \newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}     \renewcommand\footnoterule{%       \kern-3\p@       \hrule\@width.4\columnwidth       \kern2.6\p@}     \@addtoreset{footnote}{chapter}     \newcommand\@makefntext[1]{%         \parindent 1em%         \noindent         \hb@xt@1.8em{\hss\@makefnmark}#1}     \newcommand\contentsname{Contents}     \newcommand\listfigurename{List of Figures}     \newcommand\listtablename{List of Tables}     \newcommand\bibname{Bibliography}     \newcommand\indexname{Index}     \newcommand\figurename{Figure}     \newcommand\tablename{Table}     \newcommand\partname{Part}     \newcommand\chaptername{Chapter}     \newcommand\appendixname{Appendix}     \def\today{\ifcase\month\or       January\or February\or March\or April\or May\or June\or       July\or August\or September\or October\or November\or December\fi       \space\number\day, \number\year}     \setlength\columnsep{10\p@}     \setlength\columnseprule{0\p@}     \pagestyle{headings}     \pagenumbering{arabic}     \if@twoside     \else       \raggedbottom     \fi     \if@twocolumn       \twocolumn       \sloppy       \flushbottom     \else       \onecolumn     \fi     \endinput     %%     %% End of file `book.cls'.


title: How to define macro for drawing axis labels in tikz picture?

text: I want to draw a macro for typeseting axis tick marks and labels. However, the following               \newcommand\obrPopisX[2][below]{\foreach \x/\xtext in {#2}          \draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[#1] {$\xtext$};}      does not produce good results of the optional parameter is "above" - the labels are too close, since they are attached to the point 2pt below the axis. As a partial workaround I can have               \newcommand\obrPopisX[2][below]{\foreach \x/\xtext in {#2}        {\draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt);       \draw [shift={(\x,0)}] (0,0) node[#1] {$\xtext$};};}      but this sets labels relatively to the point on the axis, not the end of the tickmark. I wish to define macro, which sets the labels relatively to the whole line, i.e. behaves like               \draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node ...;      or like               \draw[shift={(0,\y)}] (-2pt,0pt) -- (2pt,0pt) node  ....;      depending on the fact if the keyword "above" is one of the optional parameters of the macro obrPopisX. Any idea? Probably I want to attach the label to the whole line rather than to the end point of the line. Thank you.


title: Custom "human" shape for tikz

text: A question with a large mea culpa. I've tried thinking about how I would add this shape and I've come up completely empty. Not strong enough with Tex to even give it a shot. I'm trying to put together a visual aid of people numbers in a particular area, so I imagine using something like               \begin{tikzpicture}[every node/.style={human,draw,fill=black}]     \node (sci) {scientist};     \node [right=1mm of sci] (sol) {gurus};     \node [right=1mm of sol] (joe) {workers};     \end{tikzpicture}      My question is: Is there simple shape that already exists (its not in the shapes library) that does something similar. _or_ is this easily coded as a new shape in which case could some kind soul post it as an example _or_ is there a simple way to combine two existing shapes into a new one (A basic version I'd be happy with would be a long-ish down ward pointing isoceles triangle with a circle on top). Image of what I'm sort of after below. Thanks ![enter image description here](http://i.stack.imgur.com/49N5y.png) As a worst case I could use lots of `\includegraphics` commands in nodes but that is likely to be the most manual approach and would prefer something else if a solution exists. * * * Update: Really tough to pick the answer for this one. I picked the one I went with in a hurry but there is a lot of material there for alternative ways to make this work. I'd really like to thank all three responders for their help. Now if only I could get a shape definition too ... :-)


title: Enumerate environment without vertical space in tabular

text: I am trying to typeset a hierarchical proof structure as defined by Leslie Lamport in How to Write a Proof. ![enter image description here](http://i.stack.imgur.com/uSGzH.png) In particular, I am trying to typeset the portion               Assume:  1. $r \in \mathbf{Q}$              2. $r^2 = 2$     Prove:   False      by putting an `enumerate` in a `tabular`. My current best attempt is               \documentclass{article}          \begin{document}          \begin{tabular}{lp{10cm}}     \scshape Assume: &     \begin{enumerate}     \item $r \in \mathbf{Q}$     \item $r^2 = 2$     \end{enumerate}     \\     \scshape Prove: &     False     \end{tabular}          \end{document}      ![enter image description here](http://i.stack.imgur.com/o9aJJ.png) As you can see, there is some rather ugly extra vertical space before and after the `enumerate` environment. How do I get rid of this extra vertical space?


title: \newenvironment fails with special listings environment

text: I want to use the `showexpl`, but define a new environment with predefined settings. But all I get is an emergency stop.               \documentclass{scrbook}     \RequirePackage{showexpl}     \lstdefinestyle{demoLatexStyle}{         basicstyle=\small\ttfamily, % Standardschrift         numbers=none,               % Ort der Zeilennummern         frame=none,     }     \begin{document}     \newenvironment{showdemo}[1][]{\LTXexample[style=demoLatexStyle,#1]}{\endLTXexample}          \begin{LTXexample}[style=demoLatexStyle]     \LaTeX{} \LaTeX{}     \end{LTXexample}          \begin{showdemo}         \LaTeX{} \LaTeX{}     \end{showdemo}          \end{document}      > \openout3 = `testdemo.tmp'. Package Listings Warning: Text dropped after > begin of listing on input line 24. ! Emergency stop. < _> testdemo.tex *_ * > (job aborted, no legal \end found) Any hint what I am doing wrong?


title: Producing "chandrabindu-halanth" symbol in devanagari

text: ![enter image description here](http://i.stack.imgur.com/3fJCO.png) Can the above image be produced using the `devanagari` package. To produce it I used the `skt` package but I am curious to know if this image (that is the chandrabindu along with the halanth) can be producing in the `devanagari` package. This symbol very often is used in the "Rudram: Namakam-Camakam" mantra.


title: \cline is in tables too thin (when using coloured cells)

text: I'm having an issue where `\cline` appears to be drawn under the fill for table colours. ### With `\hline` ![enter image description here](http://i.stack.imgur.com/7xrMy.png) ### With `\cline`   (to remove the line above the cell I want blank) ![enter image description here](http://i.stack.imgur.com/Sdkul.png) The line is still there, only very very thin. This doesn't always display or print. Is there anything simple I can do to fix this? Here's the source for my example:               \documentclass{article}          \usepackage[table]{xcolor}          %odd/eaven colours for tables     \rowcolors{2}{gray!10}{white}          %to change cells of the title row      \newcommand{\titlecol}{\cellcolor{gray!30}}          \begin{document}          \begin{table}[!ht]     \centering     \begin{tabular}{|l| c c | c c |}     \cline{2-5}     %\hline     \rowcolor{white} %first cell is excluded from the table     \multicolumn{1}{c|}{} & \multicolumn{2}{c|}{\titlecol Title1} & \multicolumn{2}{c|}{\titlecol Title2} \\     \hline     A & 0 & 1 & 2 & 3 \\     B & 0 & 1 & 2 & 3 \\     C & 0 & 1 & 2 & 3 \\     D & 0 & 1 & 2 & 3 \\     \hline     \end{tabular}     \caption{Caption.}     \label{mytable}     \end{table}          \end{document}


title: Creating a Table without a caption

text: I'm using LyX and would like to suppress any caption under a Table. How can I do that?


**How do I make label (node) to appear in front of markers in pgfplots?** For example in:               \documentclass{standalone}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{axis}     \addplot coordinates {         (1, 1)     }  node[pos=0.5]{\color{green}{LABEL}};     \end{axis}     \end{tikzpicture}     \end{document}      Note that "LABEL" appears behind the plot marker: ![dotlabel](http://i.stack.imgur.com/TLRR8.png) It might be a good default (or inherited from TikZ) but how do I change this behavior? (Preferably something that still allows using the `...} node[]{...};`-syntax.)


title: Place four algorithms (algorithm2e) in a subfigure and arrange them in two rows and two columns

text: I want to arrange four algorithms set with the `algorithm2e` package in two rows and two columns, as shown in the figure below. I've tried the `subfigure` package and have also read several related questions and answers, but have so far been unable to produce an output as shown below.               |------------------|       |-------------------|     |                  |       |                   |     |                  |       |                   |     |                  |       |                   |     |                  |       |                   |     |------------------|       |-------------------|          (a) ...                       (b) ...          |------------------|       |-------------------|     |                  |       |                   |     |                  |       |                   |     |                  |       |                   |     |                  |       |                   |     |------------------|       |-------------------|          (c) ...                       (d) ...                            Figure 1: ...


title: sidewaysfigure: how to suppress rotation in pdf output

text: I am using `sidewaysfigure` from the `rotating` package.   The orientation of the figure is as desired for the double-page layout.   In the `pdf` (generated through Latex->PS->PDF), the page is rotated so that when viewing the file, the reader can see the figure in its correct orientation. However, when I want to print the document the page is not rotated when using duplex printing. Instead, I get a shrunken page which is rotated by 90 degrees. **EDIT**   Here is a minimal working example that illustrates my problem:               \documentclass[11pt,a4paper,twoside]{book}     \usepackage{rotating}     \usepackage{tikz} % this is just included to generate a "figure"          \begin{document}          This is just a test to show a rotated second page which won't print right in duplex mode.          \begin{sidewaysfigure}     \begin{center}     \begin{tikzpicture}         \draw[thick,dashed,rounded corners] (12.25,1.5) rectangle (15.58,4.0);     \end{tikzpicture}     \caption{This is my sideways figure}     \end{center}     \end{sidewaysfigure}          \end{document}      The second page will be rotated counterclockwise (as expected), but will also be printed in this orientation: ![rotated second page](http://i.stack.imgur.com/ATqgW.png) **EDIT 2: Question** How do I suppress the rotation of the page (not of the figure though) in the pdf-document that is created by Latex?   That way, I would not have to worry about any printer settings.


title: Writing a software book with LaTex - General Advise

text: I am a so new to Tex and I am trying to learn now. I decided to write a so simple software **_(ASP.NET 4.0)_** book for myself to learn it with a real example. So, I have the following structure for now :               \documentclass[a4paper, 12pt]{book}     \usepackage{listings}     \usepackage[utf8]{inputenc} %this will support Turkish chars          \begin{document}          \section*{Getting Started With Something}          \subsection*{Headings in the `article' Document Style}          \end{document}      So, it is so basic as you can see. So far, I only figured out :   * How to begin and end a document   * How to set sections and subsections w/o numbers   * how to get to a new page So, How can I define chapters? Also, first off all I would like to have a **CONTENTS** section which will displays the chapters, sections, subsections and their page numbers. What is the best way of doing that?


title: Special characters in Kile

text: I'm using kile for creating my .tex files. I have a problem with the special characters (accented letters, arrows, greek letters). I try to use the shortcuts in the left, but when I click on the letters, nothing happens. Normally when you put the mouse over the symbols it shows the respective command as well, but this is not showing neither. Any idea?


title: Can the extended register pool be used for \newinsert?

text: After reading egreg's answer to No room for a new \dimen I got this question: The etex package switches to the extended register pool, when the normal one for a register type is exhausted. For a `\newinsert` one `\count`, `\dimen`, `\skip`, and `\box` each are needed, and they should have the same "number". `\reserveinserts{...}` can reserve some inserts and force the use of `\count`, `\dimen`, `\skip`, and `\box` registers into the extended register pool. Is it possible to redefine `\newinsert` to use `\count`, `\dimen`, `\skip`, and `\box` registers from the extended register pool? (And: why not or how?) This would increase the number of possible inserts (whether by morefloats, bigfoot/manyfoot, or manually) by a factor (!) of about 100 (starting `\et@xins` at 32768 and allocating insertions 32767, 32766,...).


title: Center text node

text: I currently have the following TikZ code:               \documentclass{scrbook}          \usepackage{tikz}          \begin{document}               \tikzset{          tlstartyear/.style={              name=tlstartyear,              above=5pt,              inner xsep=0pt,              anchor=base west,          }          }                \tikz{          \fill [blue] (0,0)             ++(3em,0pt)             node [tlstartyear] {Some text}             node {$\bullet$};     }               \end{document}      which (thanks to Jake) produces: ![not centered](http://i.stack.imgur.com/cwE24.png) How can I center the text with the node? I've tried playing with `align=center`, `align=flush center`, `right` and `left`, without success...


title: How to vanish \relax inserted by TeX itself

text: TeX inserts `\relax` when it suddenly finds `\else` or `\fi` while expanding a conditional (eg, looking for a number). _TeX by Topic_ says much. But how do you get rid of the `\relax` in a situation like the following fictitious example? eTeX's `\dimexpr` and `\numexpr` do vanish `\relax` but perhaps not in a situation like the following.               \edef\x{%       \ifnum0=0\fi\ifnum\z@=\z@         \expandafter\@firstoftwo\else           \expandafter\@secondoftwo\fi{x}{y}%     }       * * * **(Edited in from 'answer')** Martin, The `\@empty` may linger even in full expansion contexts: `\noexpand` makes expandable commands recoverable `\relax`. Moreover, at least 1/2 of the time one is not interested in full expansion or printing, but in a one- or two-step expansion. The outcome may even be immediately detokenized. So any extra `\@empty` or `\space` intended as an 'artificial' stopper will linger in the definition in situations where a non-expandable token is found before the artificial stopper. The following illustrates the point of Bruno, which I had been aware of:               \def\test@cond#1\fi{%       #1\noexpand\@empty         \expandafter\@firstoftwo\else         \expandafter\@secondoftwo\fi{x}{y}%     }     \edef\x{\test@cond\ifnum\z@=\z@\fi}     \edef\x{\test@cond\if xx\fi}     \edef\x{\test@cond\ifnum0=0\fi}      I have found a tricky solution involving `\iffirstisspace` macro, and `\romannumeral` too offers a way out.


title: Count words difference between newest and old .tex file on SVN commit

text: I use latex for writing papers and I would like to bring more control over my progress - in other words - count lines and words. But I always forget to check how many words I have before I start modifying a file. I am using SVN to store latex files so I thought that maybe somebody wrote a script or a command line program that would inform me on commit what is a different between old and new version of a file.


title: How can I fix this bug in answers package?

text: I have just updated the answers package. I copy simple example               \documentclass[12pt,a4paper]{article}     \usepackage{answers}     \Newassociation{sol}{Solution}{ans}     \newtheorem{ex}{Exercise}      \begin{document}     \Opensolutionfile{ans}[ans1]     \section{Problems}      \begin{ex}     First exercise      \begin{sol}      First solution.      \end{sol}      \end{ex}      \begin{ex}      Second exercise      \begin{sol}      Second solution.      \end{sol}      \end{ex}      \Closesolutionfile{ans}      \section{Solutions}      \input{ans1}      \end{document}      When I compile, I got ![enter image description here](http://i.stack.imgur.com/NS3yk.jpg) How can I fix this error?


title: keeping the last line of one paragraph with the first line of the next paragraph or list in a \raggedbottom context

text: I often introduce new text with the last line of a paragraph, terminated by a colon. Perhaps the text before and after is ordinary text (between pages 1 and 2 in the example), or the text thereafter is a list (between pages 3 and 4 in the example), or the first paragraph is within a list with the next one being in a nested list (between pages 5 and 6 in the example). **I would like to keep the last line of the first paragraph with the subsequent paragraph because that last line is often of an introductory nature. How can I do this?** (I know about `\Needspace`, but I don't know how to use it for a solution here.) I believe this question makes most sense in a `\raggedbottom`-context; this is also where I need this resolved. Here is an example:               \documentclass{memoir}     \usepackage{lipsum}     \raggedbottom          \begin{document}          \lipsum[1-4]     Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text:          Some filler text. Some filler text.          \newpage          \lipsum[1-4]     Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text:          \begin{itemize}     \item Some text.     \item Some text.     \item Some text.     \end{itemize}          \newpage          \begin{itemize}     \item \lipsum[1-4]     \item Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Some filler text. Now a nested list:         \begin{itemize}         \item Some text.         \item Some text.         \item Some text.         \end{itemize}     \end{itemize}          \end{document}      Here I would specifically like the last lines of pages 1, 3, and 5 kept together with the first lines of pages 2, 4, and 6, respectively. `\nopagebreak` works in the first case, but not in the two list cases.


title: problem with kile installation in fedora 13 + texlive

text: I recently started using fedora with kde and I want to install kile. But, the version of TeX Live in the official repositories is TeX Live 2007 and I want a more complete and recent version. I tried adding the repository for fedora 13 found here but it does not work says it is not an rpm package. Has anyone with fedora 13 been able to install kile 2.1 beta 4 with a version of texlive 2009 or 2010? When I installed kile from the official repositories it also installed texlive2007 as a dependency, and I can not install kile compiling configured to use texlive 2009.


title: How to remove name while including image in LaTeX?

text: I am including an image in R and found the name of the image file appearing with the image:                 name<-c("A.pdf","B.pdf","C.pdf","D.pdf")       <<echo=FALSE,results=tex>>=       for (i in 1:4)       {                cat(paste("\\includegraphics[trim=0cm 10cm 0cm 5cm, clip=true,%                               width=.7\\linewidth]{pdf_repository/",name[i],".pdf}",sep=""),"\n")       }       @      I found the names of image files: `A.pdf`, `B.pdf`, `C.pdf`, `D.pdf` also appear with the images. How can I remove them?


title: How to do \newcommand{\filepath}[1]{\verb!#1!}?

text: I want to define a command `\filepath` so that I can use `\filepath{foo_bar.cpp}` and it is printed in monospaced font. Also, why does this not work? I get strange errors:               \newcommand{\filepath}[1]{\verb!#1!}


title: Type my own font style onto my computer!

text: How can I use plain TeX & `metafont` to attain my own font-style, i.e. I want to type the words I write by my hand.


title: Drawing a tree with text on the edge concisely using TikZ

text: I am new to TikZ and am trying to draw a tree with text only on the edge (action/line). I have managed to do it as seen below but I was hoping there was a more concise/legible way. ![Image produced](http://i.stack.imgur.com/rPNdN.png)               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{trees}          \begin{document}          \begin{figure}     \begin{center}          \tikzstyle{level 1}=[level distance=1cm, sibling distance=2.5cm]     \tikzstyle{level 2}=[level distance=1cm, sibling distance=2.5cm]     \tikzstyle{level 3}=[level distance=1cm, sibling distance=1cm]     \tikzstyle{level 4}=[level distance=1cm, sibling distance=2cm]          \tikzstyle{circleNode}=[circle,draw]     \tikzstyle{dotNode} = [circle, minimum width=3pt,fill, inner sep=0pt]          \begin{tikzpicture}     \node [dotNode] {}     child{             node [dotNode] {}         child{             node [dotNode] {}             child{                 node [dotNode] {}                                 child{                                     node [dotNode] {}                                     child{                                         node [dotNode] {}                                         child{                                             node [dotNode] {}                                             child{                                                 node [dotNode] {}                                                 child{                                                     node [dotNode] {}                                                     child{                                                         node [dotNode] {}                                                         edge from parent                                                         node[left]{j}                                                     }                                                     edge from parent                                                     node[left]{$\tau$*}                                                 }                                                 edge from parent                                                 node[left]{b}                                             }                                             edge from parent                                             node[left]{$\tau$*}                                         }                                         edge from parent                                         node[left]{b}                                     }                                     child{                                         node [dotNode] {}                                         child{                                             node [dotNode] {}                                             child{                                                 node [dotNode] {}                                                 child{                                                     node [dotNode] {}                                                     child{                                                         node [dotNode] {}                                                         edge from parent                                                         node[right]{k}                                                     }                                                     edge from parent                                                     node[right]{$\tau$*}                                                 }                                                 edge from parent                                                 node[right]{b}                                             }                                             edge from parent                                             node[right]{$\tau$*}                                         }                                         edge from parent                                         node[right]{b}                                     }                                     edge from parent                                     node[left]{$\tau$*}                                 }                 edge from parent                 node[left]{a}             }                         edge from parent                         node[left]{$\tau$*}         }                 edge from parent                 node[left]{a}     };          \end{tikzpicture}     \end{center}          \end{document}


title: Regarding sizing of delimiters

text: I'm currently writing my dissertation in civil engineering using LaTeX. I think LaTeX is really good. I have been slowly distancing myself now from Microsoft Word. LaTeX is good for me since my paper (nonlinear structural dynamics) may eventually contain more than a thousand equations. I just have one problem now. Consider the following fraction with delimiter.               \left( \frac{a}{b} \right)      So far, there is really no problem with that fraction. The delimiters automatically resize. Now, consider the following "complex" fraction with delimiters:               \left( \frac{\dfrac{a}{b}}{\dfrac{c}{d}} \right)      Again, there is no problem with this "complex" fraction, since the delimiters automatically resize. Now, here's the problem. Consider the following "complex" fraction with delimiters:               \left( \frac{a}{\dfrac{c}{d}} \right)      The result of this is that the delimiters resize, but there is extra "vertical white space" within the region of the numerator. This is because the numerator is just a "variable" while the denominator is another fraction in "displaystyle" font size. Thus, they have different "sizes". I intentionally wanted the font size in the denominator to be bigger since I'm trying to show equations in display mode. (If the denominator was in textstyle fontsize, then there would be less "vertical white space" in the numerator, but the problem is still there. I really want the denominator to be in displaystyle font size.) What I would want, if possible, is that the delimiter would resize but only up to the "actual size" of the complex fraction. In MathType, this problem is solved using the "fence alignment" command in the "Format" menu, where the delimiters resize exactly up to the size of the complex fraction. Sometimes, the manual sizing commands \big, ... \Bigg commands can help, but when I have a "complex-complex-complex" fraction, even the biggest \Bigg command doesn't help anymore. Output of the code samples: ![delimiters](http://i.stack.imgur.com/Ada75.png) I have been seeking help from the Internet, but I haven't found a solution yet.


title: Updating to Beta Builds of ConTeXt / LuaTeX from tlcontrib breaks MacTeX

text: [What follows is my question, re-written with better information and condensed.] I might be missing something really simple and I might be overcomplicating something really easy. ## To Be Extremely Brief Prior to updating a fresh MacTeX install (with up-to-date packages installed from one of the main repositories), ConTeXt worked will, even in MK IV, except that I couldn't get font selection to work. It seamed to ignore it or show garbage (Palatino). So I updated with the tlcontrib packages using `tlmgr` and now, even after doing what I can to rebuild hashes/--generate (`mtxtools`) etc, luatools always returns `MTXrun | unknown script 'base.lua' or 'mtx- base.lua'`. **Question 1:** What's wrong? **Question 1 MK II:** :) Is there something called `mtx-base.lua` or `base.lua`, or is this some script not getting a variable name and just putting `base` in there, because that's the constant... or something? Anyway, I cannot find either file, so I'm in the same boat as luatools.lua. :) ## To Be Kind of Brief   1. I installed MacTeX 2010 fresh, after a failed attempt at using updated ConTeXt files. (resolved from an In an earlier question)   2. I updated all packages using the normal trees.   3. I changed my TEXMFHOME variable in /usr/local/texlive/2010/texmf.cnf to `~/src/texmf-trms`, which is where I keep my custom modules/templates/packages. (This is normally within our github source control, but hasn't been yet.) and moved the content from the old directory to the new.   4. I was beating my head against the wall, trying to make font selection work using `typescriptfile`/`typescript` as well as simplefont. The closest I could get was with simplefont and Palatino spewing garbage text into the PDF. While it's not the main topic of this post, if it's helpful, typing `sudo mtxrun --script fonts --list --name --pattern=*' always resulted in`zsh: no matches found: --pattern=*`.   5. I decided to try http://tlcontrib with tlmgr using: sudo tlmgr --repository http://tlcontrib.metatex.org/2010 update -all   6. I `sudo texconfig rehash`ed (seemed okay), `sudo mtxrun --generate` (seemed okay). Then I `sudo luatools --generate` and got something that ended with `MTXrun | unknown script 'base.lua' or 'mtx-base.lua'`   7. Just typing `luatools` results in: `MTXrun | unknown script 'base.lua' or 'mtx-base.lua'`   8. As per my attempt to solve this and some reading on the Interweb, I tried editing the two texmfcnf.lua files that I found (in `/usr/texlive/2010/` and /usr/texlive/2010/texmf/web2c`) with: return { content = { TEXMFCACHE = '~/Library/texlive/2010/texmf-var', TEXMFHOME = '~/src/texmf-trms', }, TEXMFCACHE = '~/Library/texlive/2010/texmf- var', } This had no effect and, quite probably, has nothing to do with anything, as someone has helpfully pointed out. ## Outputs From Some Commands That I Tried ### Compile a document with `luatools`:               MTXrun | warning: no format found, forcing remake (commandline driven)     MTXrun | running command: luatools --generate     MTXrun | unknown script 'base.lua' or 'mtx-base.lua'          MTXrun | running command: luatools --make --compile cont-en     MTXrun | unknown script 'base.lua' or 'mtx-base.lua'          MTXrun | error, no format found with name: cont-en, aborting     MTXrun | total runtime: 0.321      ### Output from `sudo luatex --generate --verbose`:               MTXrun | resolvers: variable 'SELFAUTOLOC' set to     '/usr/local/texlive/2010/bin/x86_64-darwin'     MTXrun | resolvers: variable 'SELFAUTODIR' set to '/usr/local/texlive/2010/bin'     MTXrun | resolvers: variable 'SELFAUTOPARENT' set to '/usr/local/texlive/2010'     MTXrun | resolvers: variable 'TEXMFCNF' set to ''     MTXrun | resolvers: variable 'TEXMF' set to ''     MTXrun | resolvers: variable 'TEXOS' set to 'bin'     MTXrun | resolvers     MTXrun | resolvers: loading configuration file     '/usr/local/texlive/2010/texmfcnf.lua'     MTXrun | resolvers     MTXrun | resolvers: loading configuration file     '/usr/local/texlive/2010/texmf/web2c/texmfcnf.lua'     MTXrun | resolvers     MTXrun | resolvers: locating list of '/Users/andrew/src/texmf-trms' (runtime)     MTXrun | resolvers: handler 'tree:////Users/andrew/src/texmf-trms' ->     'locators' -> 'path=/Users/andrew/src/texmf-trms | noscheme=false |     query= | scheme=tree | original=tree:////Users/andrew/src/texmf-trms |     fragment= | authority='     MTXrun | resolvers: hash 'tree:////Users/andrew/src/texmf-trms' appended     MTXrun | resolvers: skipping list of     '/usr/local/texlive/2010/texmf-project' (cached)     MTXrun | resolvers: skipping list of     '/usr/local/texlive/2010/texmf-fonts' (cached)     MTXrun | resolvers: skipping list of     '/usr/local/texlive/2010/texmf-local' (cached)     MTXrun | resolvers: skipping list of     '/usr/local/texlive/2010/texmf-context' (cached)     MTXrun | resolvers: locating list of '/usr/local/texlive/2010/texmf' (cached)     MTXrun | resolvers: tex locator '/usr/local/texlive/2010/texmf' found     MTXrun | resolvers: hash '/usr/local/texlive/2010/texmf' appended     MTXrun | resolvers: locating list of     '/usr/local/texlive/2010/texmf-dist' (cached)     MTXrun | resolvers: tex locator '/usr/local/texlive/2010/texmf-dist' found     MTXrun | resolvers: hash '/usr/local/texlive/2010/texmf-dist' appended     MTXrun | resolvers     MTXrun | resolvers: handler 'tree:////Users/andrew/src/texmf-trms' ->     'hashers' -> 'path=/Users/andrew/src/texmf-trms | noscheme=false |     query= | scheme=tree | original=tree:////Users/andrew/src/texmf-trms |     fragment= | authority='     MTXrun | resolvers: scanning path '/Users/andrew/src/texmf-trms'     MTXrun | resolvers: 596 files found on 114 directories with 62     uppercase remappings     MTXrun | resolvers: loading 'files' for     '/usr/local/texlive/2010/texmf' from     '/Users/andrew/Library/texlive/2010/texmf-var/luatex-cache/context/210a81d6dcb1059dc80fab3f5470ab7a/trees/1240e363db2f4c53de58379d2b0c6f6b'     MTXrun | resolvers: loading 'files' for     '/usr/local/texlive/2010/texmf-dist' from     '/Users/andrew/Library/texlive/2010/texmf-var/luatex-cache/context/210a81d6dcb1059dc80fab3f5470ab7a/trees/26993469c6208234eef0d0acf8456c4d'     MTXrun | resolvers: using suffix based filetype 'lua'     MTXrun | resolvers: using suffix based filetype 'lua'     MTXrun | resolvers: remembering file 'mtx-base.lua'     MTXrun | resolvers: using suffix based filetype 'lua'     MTXrun | unknown script 'base.lua' or 'mtx-base.lua'


title: Accanthis font simple usage

text: I am using the Latex Font catalog: http://www.tug.dk/FontCatalogue/ I can set some of the fonts, however I cannot set a lot that I want. For example, I can set "Carolmin" effectively in a document. (See below example).               \documentclass{article}          \usepackage{carolmin}     \usepackage[T1]{fontenc}          \begin{document}          \cminfamily          In the beginning was the Word, and the Word was with God, and the Word was God.          \end{document}      However, I cannot get "Accanthis" to work, which is the font I really want to use. This is frustrating especially since the "example" file provided on the font catalog website does not compile after a bit of effort. Here is my (non-working) accanthis.tex example. I have an accanthis.sty file in the same directory. I downloaded the accanthis.sty file by typing the filename into Google, then deleting the html tags on the document that came up.               \documentclass{article}          \usepackage[T1]{fontenc}     \usepackage{accanthis}          \begin{document}          {\accanthis Hello there!}          \end{document}      I hope you can provide some feedback here!


title: create section without printing it

text: I am working on my own recipe collection. I want to add sections to the TOC and maybe have them in the running head but I do not want them to be printed to the body of the page at all. Each page shall only display a recipe. The typical commands `\section` or `\addsec` do not have such functionality. The always print the section title to the body. Is there such a command or is it necessary to create that on my own?


title: problem with footnote in tcolorbox (math mode)

text: I have problem with footnote in `tcolorbox`, footnote mark on math mode is numbering with arabic while in the footnote area is numbering with alphabet. This is an example to show you what I mean,               \documentclass[a4paper,12pt]{article}     \usepackage{lipsum}     \usepackage[most]{tcolorbox}          \begin{document}              \begin{tcolorbox}[breakable]             \lipsum[1]\footnote{Footnote from main box}              \begin{align*}             f(x) = mx + b\footnotemark         \end{align*}         \footnotetext{test footnote equation from main box}         \tcblower             \lipsum[1]\footnote{Footnote from lower box}                  \begin{align*}                 f(x) = mx + b\text{\footnotemark}             \end{align*}             \footnotetext{test footnote equation from lower box}         \end{tcolorbox}              \lipsum[1]\footnote{Footnote from main page}              \begin{align*}             f(x) = mx + b\footnotemark         \end{align*}         \footnotetext{test footnote equation from main page}     \end{document}      Also, the footnote won't increased automatically.


title: How to write an arara rule for knitr

text: I've been trying to write a rule for invoking `knitr` via `arara`, but I don't seem to know what I'm doing, apparently. The `arara` manual explains how to define custom rules. To do so, it is necessary to include the path to be searched for the custom rules inside of the config file. So, my `araraconfig.yaml` file includes:               !config     paths:     - /path/to/custom/arara/rules      Now, since `knitr` reads `.Rnw` files but, by default, `arara` is set up to handle only `.tex`, `.dtx`, and `.ltx` files, it is necessary to add support for the `.Rnw` file, too. As such, my `araraconfig.yaml` file also includes:               filetypes:     - extension: tex     - extension: dtx     - extension: ltx     - extension: Rnw       pattern: ^(\\s)*%\\s+       Finally, I've written `knitr.yaml` (which is in `/path/to/custom/arara/rules`), which is:               !config     identifier: knitr     name: knitr     command: <arara> Rscript -e "library(knitr); knit('"@{getBasename(file)}".Rnw')"      since `knitr` can be invoked from the command line via `Rscript -e "library(knitr); knit('myfile.Rnw')"`. Now, say I have the following MWE, `myfile.Rnw`:               % arara: knitr     % arara: pdflatex     % arara: pdflatex          \documentclass{article}          \begin{document}          A graph about cars (Figure~\ref{fig:cars}).          <<cars, echo=FALSE, message=FALSE, fig.cap="Car graph", fig.lp="fig:">>=     library(ggplot2)     CarPlot <- ggplot() +       stat_summary(data = mtcars,                    aes(x = factor(gear),                        y = mpg                        ),                    fun.y = "mean",                    geom = "bar"                    )     CarPlot     @          \end{document}      If I invoke `arara myfile` from the command line, I get: > I didn't find any directives in 'myfile.Rnw', and so didn't do anything. Is > that what you really wanted? Alternatively, if I invoke `arara myfile.Rnw`, I get: > I'm sorry, but the file 'myfile.Rnw [.tex, .dtx, .ltx, .Rnw]' does not > exist. Note that when you provide only the basename (i.e, the filename > without the extension) or with an unknown extension, arara will try to look > for files ending with the predefined extensions [.tex, .dtx, .ltx, .Rnw] in > that order. You can override the order, the search pattern or even add > support for new extensions through the configuration file. Please refer to > the arara manual to learn more about this feature. This latter message is also the message that I get when `arara` is invoked from within TeXShop. Since I would ultimately like to develop a workflow with `knitr` and `arara` from within TeXShop, I would like a rule for `knitr` that works when `arara myfile.Rnw` is invoked. I'm not entirely sure why specifying the extension makes a difference here, and I'm also not sure why, when the extension isn't specified, no directives are found in the file since there are, in fact, directives contained in `myfile.Rnw`. Thus, I suppose my question is ultimately how do I write an `arara` rule for `knitr` that will work when `arara myfile.Rnw` is invoked ( _i.e._ , when the command is invoked with the file extension). (Though any insight about the different behavior depending on whether the file extension is specified or not as well as any insight about the inability of `arara` to find directives in the former case would also be greatly appreciated.) * * * **Note** : I assume that `% arara: pdflatex` will break once the `knitr` issue is figured out since the `arara` rule for `pdflatex` is defined as `<arara> pdflatex @{action} @{draft} @{shell} @{synctex} @{options} "@{file}"`, and I think `@{file}` returns the file extension as well as the file name, so I assume I will need to write a new rule for invoking `pdflatex` using `"@{getBasename(file)}"`. However, one step at a time ... * * * ## Update: Paulo started helping me with a bit of troubleshooting in the chat room. (Paulo's help starts about here.) With his help, there has been a bit of progress. First, it seems that there is an error in the `arara` manual. `^(\\\s)*%\\\s+` in the `araraconfig.yaml` file should really be `^(\s)*%\s+`. Second, it seems that the rule should have a set of arguments, even if that set is empty. So the `knitr.yaml` file should be:               !config     identifier: knitr     name: knitr     command: <arara> Rscript -e "library(knitr); knit('"@{getBasename(file)}".Rnw')"     arguments: [] # note this addition      With these changes, calling `arara myfile` will work ( **sort of** ). (Note that calling `arara myfile.Rnw` results in the same error noted above.) `arara` runs and says: > >     Running knitr... SUCCESS >   However, there is _no_ `.tex` file that gets written to the directory, which is what should be the result of processing a `.Rnw` file with `knitr`. Specifically, if one calls `Rscript -e "library(knitr); knit('myfile.Rnw')"` from the command line, the result is a `.tex` file. But the result from this 'successful' `arara` run is nothing ... I'm not sure where to go from here. Here's the log file from running `arara --log myfile`.               07 May 2014 19:48:19.360 INFO  Arara - Welcome to arara!     07 May 2014 19:48:19.372 INFO  Arara - Processing file 'myfile.Rnw', please wait.     07 May 2014 19:48:19.373 INFO  DirectiveExtractor - Reading directives from myfile.Rnw.     07 May 2014 19:48:19.374 TRACE DirectiveExtractor - Directive found in line 1 with knitr.     07 May 2014 19:48:19.378 INFO  DirectiveParser - Parsing directives.     07 May 2014 19:48:19.381 INFO  TaskDeployer - Deploying tasks into commands.     07 May 2014 19:48:19.381 TRACE TaskDeployer - Task 'knitr' found in '/Users/adamliter/Dropbox/Local-texmf/arara/rules'.     07 May 2014 19:48:19.427 INFO  CommandTrigger - Ready to run commands.     07 May 2014 19:48:19.427 INFO  CommandTrigger - Running 'knitr'.     07 May 2014 19:48:19.427 TRACE CommandTrigger - Command: Rscript -e "library(knitr); knit('"myfile".Rnw')"     07 May 2014 19:48:19.628 TRACE CommandTrigger - Output logging:     07 May 2014 19:48:19.628 TRACE CommandTrigger - [1] "library(knitr); knit('myfile.Rnw')"          07 May 2014 19:48:19.629 INFO  CommandTrigger - 'knitr' was successfully executed.     07 May 2014 19:48:19.629 INFO  CommandTrigger - All commands were successfully executed.     07 May 2014 19:48:19.629 INFO  Arara - Done.      It seems that there might still be hope. And, if possible, I would still really like a setup that works when `arara myfile.Rnw` is called, not just `arara myfile`.


title: Print glossaries EXCLUDING certain types

text: How can I exclude the 'main' glossary from the printglossaries macro, since I want to be able to use one format for the main glossary, and a different one for the remaining. IE I would like to be able to do something like this:               %Print the main glossary     \glossarystyle{altlist}     \printglossary[type=main]          %Print the remaining glossaries     \glossarystyle{list}     \printglossaries      Therefore, in the above, the command `\printglossaries` should print the remaining glossaries EXCLUDING the main glossary (ie, for example, acronyms, nomenclature, symbols and user defined glossaries) I also have a 'hidden' glossary, which I use for some internal document nomenclatures, which I don't want printed at all. At the moment, in the above, the main glossary is duplicated.


title: Why not put a space between commands and parameters?

text: I hope this is just a matter of taste, but is there any reason not to separate a command from its first parameter with a space? (Or multiple parameters with intervening spaces for that matter.)               \chapter{Introduction}     \chapter {Introduction}          \setcounter{chapter}{2}     \setcounter {chapter} {2}      I like the second ones better. This makes prose more readable to me. I was wondering if this can get me into trouble, though.


title: Troubles with \centerline for center a line of text in a two column document

text: I'm composing a two column document with the `scrartcl`class. I need to emphasize few sentences along the text with an special typographic highlight. I was trying with the `\centerline`command but it centres my text between both columns or something else. In fact I want to create a new command for that in this way: `\newcommand{\resalte}[1]{\textbf{\textsf{\large #1}}}` I want to add in the definition the `\centerline` for An MWE could be:               \documentclass[10pt,letterpaper,DIV=13,titlepage=false,twocolumn=on]{scrartcl}     %\usepackage[DIV=14]{typearea}     \usepackage[spanish,activeacute,mexico]{babel}     \usepackage[english=british,french=quotes,german=quotes,spanish=mexican]{csquotes}     \usepackage{ucs}     \usepackage{hyperref}     \hypersetup{         bookmarks=true,         % show bookmarks bar?         unicode=true,           % non-Latin characters in Acrobat’s bookmarks         pdftoolbar=true,        % show Acrobat’s toolbar?         pdfmenubar=true,        % show Acrobat’s menu?         pdffitwindow=false,     % window fit to page when opened         %pdfstartview={FitH},   % fits the width of the page to the window         pdftitle={Document title},    % title         pdfauthor={Lev Bronstein},     % author         pdfsubject={Study},   % subject of the document         pdfcreator={Listopad},   % creator of the document         pdfproducer={Me}, % producer of the document         %pdfkeywords={keyword1} {key2} {key3}, % list of keywords         pdfnewwindow=true,      % links in new window         colorlinks=true,       % false: boxed links; true: colored links         linkcolor=teal,          % color of internal links (change box color with linkbordercolor)         citecolor=green,        % color of links to bibliography         filecolor=red,      % color of file links         urlcolor=blue,           % color of external links         anchorcolor=magenta, % color for anchor texto         filecolor=cyan, % color for urls which open local files         menucolor=orange, % color for acrobat menu items         runcolor=violet, % color for run links (launch annotations)     }     \usepackage{url}     \usepackage{fontspec}      \defaultfontfeatures{Mapping=tex-text}     \usepackage{xunicode}     \usepackage{xltxtra}     \setmainfont{Warnock Pro}      \setsansfont{Myriad Pro}      \setmonofont{Consolas}          %\renewcommand{\familydefault}{\sfdefault}      \pagestyle{plain}          \usepackage[usenames,dvipsnames,x11names,table]{xcolor}     \usepackage[per-mode=symbol]{siunitx}     \sisetup{     %output-decimal-marker = {,},     detect-weight= true,      range-units = brackets,     list-final-separator = { \translate{and} },     list-pair-separator = { \translate{and} },     range-phrase = { \translate{to (numerical range)} },     }     \usepackage{array}     \usepackage{makeidx}     \usepackage{graphicx}     %\usepackage[grid=true,gridcolor=cyan,subgridcolor=orange,gridunit=pt]{eso-pic}% dibuja la reticula de las paginas          \usepackage{scrpage2}     \pagestyle{scrheadings}     \ohead{\textbf{Encabezado}     \ihead{\texttt{http://aradenatoria.net}}          \usepackage[stable,bottom]{footmisc}     \raggedbottom     \clubpenalty=10000     \widowpenalty=10000     %\setlength{\parskip}{3pt plus 2pt minus 2pt}     \setlength{\columnsep}{30pt}          \parskip0.4\baselineskip          \newcommand{\resalte}[1]{\textbf{\textsf{\large #1}}}          \begin{document}          \titlehead{GAR}     \subject{Documento}     \title{Programa}     \subtitle{1938}     \author{Me}     \date{\today}     \publishers{Listopad}     \maketitle          \tableofcontents           \section{The first section}          \noindent Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eu ante egestas, eleifend urna non, volutpat tellus. Quisque ut sodales ligula. Phasellus dapibus dapibus ipsum sed vehicula. In imperdiet urna magna, id tincidunt purus dignissim quis. Aliquam non ligula auctor, auctor nisl in, hendrerit nulla. Aenean blandit ligula in sapien luctus, ut bibendum lectus pellentesque. Maecenas sit amet dui ipsum. Mauris metus ipsum, porta ac purus non, euismod venenatis lacus. Mauris rhoncus tortor nisl, a tincidunt justo ullamcorper sed. Donec tellus quam, aliquam ac ligula ac, tempus lacinia ligula. Phasellus vel lorem nisl. Aenean nunc tortor, blandit eget magna ut, eleifend facilisis risus. Morbi sed nulla nec nulla convallis vulputate eget id mauris. Ut laoreet laoreet odio eu convallis.            \resalte{Sed in tellus sollicitudin, imperdiet velit suscipit, sodales tortor.}          Donec id libero in sem vehicula elementum. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus molestie ultricies tortor, vitae tempor massa placerat et. Cras varius dictum dui sit amet vehicula. Ut venenatis mauris sit amet purus lobortis, vel mollis dui convallis. Phasellus euismod eu urna laoreet pulvinar. Ut neque nunc, vulputate in tincidunt id, convallis sed turpis. Etiam sagittis volutpat felis molestie venenatis. In non ultrices tellus. Vestibulum ultrices dolor eu sapien fermentum, id ultricies erat gravida. Proin nec tempor augue, vitae cursus ipsum. Nunc non nibh sit amet nisl pretium ullamcorper condimentum sit amet lorem. Integer vitae iaculis nibh, in fringilla lorem. Nam malesuada nunc elit, id convallis justo luctus vitae. Aenean sed ullamcorper turpis. Cras est nisl, dictum id felis non, lobortis aliquam diam.          Nullam accumsan odio nibh, sed blandit orci auctor id. Morbi a eros a velit pharetra tincidunt. Praesent consequat sem quis ipsum commodo, et placerat mi vulputate. Duis sed commodo augue. In aliquam placerat nunc non imperdiet. Donec id elit non ligula mattis consectetur nec in lectus. Donec turpis erat, tincidunt at posuere vel, posuere nec odio. Integer ipsum sapien, fermentum in eleifend at, vestibulum dictum turpis. Duis scelerisque aliquam sagittis. Quisque volutpat et nisl sed auctor.          Aliquam elit felis, condimentum vitae nulla ut, egestas egestas risus. Cras lacinia neque fermentum orci sollicitudin faucibus. Morbi non nunc porta, ornare libero quis, suscipit orci. Nunc adipiscing sem tellus, id adipiscing tellus blandit in. Vivamus mattis nulla mi, at malesuada orci ullamcorper id. Aenean volutpat suscipit elementum. Nunc orci mauris, consequat in commodo id, posuere id justo. In lacus sapien, volutpat sit amet nulla ac, vulputate sollicitudin dolor. Pellentesque iaculis nisi sit amet libero tristique adipiscing. Aliquam erat volutpat.          Aenean eu consequat tellus, quis posuere nunc. Duis tempus tristique lorem. Duis non tincidunt neque. Donec ac iaculis sem. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Integer ac quam lobortis, gravida eros vitae, convallis leo. Ut vel nisi eu nisl luctus bibendum. Nulla molestie tincidunt fringilla. Morbi sapien nulla, tincidunt id lorem a, luctus imperdiet erat.          Ut vestibulum consectetur ultrices. In ut mauris arcu. Donec posuere sollicitudin nibh quis lacinia. Nam nunc dui, congue sed ligula vitae, mollis mollis magna. Suspendisse potenti. Fusce nec libero at enim gravida accumsan id sed nibh. Quisque sed tincidunt magna, hendrerit tempus nunc. Nunc non sodales sem, at tincidunt massa. Etiam non varius lectus. Morbi at mi libero.          \section{Another section}          \noindent Curabitur ut neque non enim pulvinar facilisis. Aenean eget adipiscing sapien, eu sagittis urna. Suspendisse potenti. Nam sollicitudin posuere commodo. Phasellus risus dolor, laoreet tincidunt justo cursus, ornare scelerisque augue. Proin egestas quam vel neque ullamcorper mollis. Morbi augue neque, laoreet scelerisque nisl eu, venenatis porttitor dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec vel porttitor nisl, et fringilla massa. Suspendisse egestas, risus id eleifend condimentum, justo dui congue eros, id iaculis nibh nunc vel lorem. Sed sed nibh sed tellus laoreet porttitor ut nec justo. Aliquam egestas gravida imperdiet. Sed id mauris pulvinar, congue nunc a, pretium augue. Praesent eros dui, convallis sed arcu id, ultricies imperdiet lacus. Aliquam adipiscing urna quis ante commodo, eu gravida ligula volutpat. Aenean id nisi sit amet dolor porta volutpat.          Nam volutpat mauris ac eros hendrerit accumsan et id nulla. Nam ullamcorper nibh et est suscipit condimentum. Donec eu pellentesque arcu, quis pulvinar elit. Praesent neque libero, ullamcorper ut lacinia eu, ultricies nec ante. Nunc pharetra viverra tellus in suscipit. Maecenas orci ante, mattis sit amet tincidunt sit amet, rhoncus at felis. Cras ut massa quis tortor pellentesque commodo nec non magna. Nam blandit sapien quis enim iaculis faucibus. Aliquam at tincidunt augue.          Aliquam vestibulum sodales tristique. Integer sit amet orci diam. Mauris vitae ultrices nisi. Fusce placerat, ante sed fringilla vulputate, felis mi ullamcorper eros, at vehicula arcu nulla eget quam. Sed pulvinar lacus cursus ligula scelerisque lacinia. Donec quis lorem feugiat, eleifend massa a, auctor libero. Etiam ac augue egestas, mollis odio eget, dictum nisl. Mauris consequat euismod est, a ultricies nisl gravida a. Nunc rutrum id dui eu euismod. Aenean lobortis pellentesque risus, eget semper orci semper a. In massa massa, tincidunt molestie blandit a, fermentum auctor nisl. Donec placerat dignissim lorem ac vulputate. Pellentesque sed velit volutpat, adipiscing nisi sit amet, sollicitudin dui. In elementum id ligula sit amet varius. Donec nec elit tristique justo pharetra malesuada. Cras non egestas diam.          Nulla ante augue, mollis quis nisl nec, adipiscing ultricies massa. Donec dapibus erat vestibulum, lobortis est et, faucibus leo. Quisque justo dolor, scelerisque sed faucibus et, rhoncus ac augue. Nulla lobortis, mauris quis congue bibendum, libero orci bibendum urna, vel bibendum risus diam sit amet eros. Cras dictum ipsum placerat nunc dictum elementum. Nullam quis ultrices eros, a rutrum augue. Integer venenatis massa vel tellus pellentesque porta ut id odio. Curabitur ipsum odio, commodo vel nisi sed, pulvinar euismod velit. Cras rhoncus, turpis eu tristique aliquet, est nisi auctor dolor, vitae ornare risus libero nec sapien. Donec placerat et tellus in rhoncus. Sed gravida tempus tempus. Praesent a dictum risus. Nunc eget sem vitae libero vulputate dictum lacinia ac felis. Morbi sagittis enim a feugiat luctus. Curabitur aliquam justo turpis, vel malesuada tellus lacinia vel.          \end{document}      I can use the `center`environment, but I try to automatize the task instead to create a `center` environment manually eighty times. I've tried with `\centering`and `\centerline` but with not good results. Any suggestions or ideas?


title: How to cite data?

text: Data can be cited. Citeable data has fully persistent DOI's that link to recognised data repositories. This ensures that the data used in scientific publications can be obtained and re-used in the future. Is there any specific way to cite data using the bibtex file format (using either bibtex or biber), apart from `@misc`?