title: Wrong effect with border of title page

text: I want this effect: ![true effect](http://i.stack.imgur.com/uOSgk.png) But I have this wrong effect: ![wrong effect](http://i.stack.imgur.com/k5zFl.png) Here is my code:               \documentclass[11pt, a4paper, oneside]{Thesis} % Paper size, default font size and one-sided paper          \hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying          \title{\ttitle} % Defines the thesis title - don't touch this          \usepackage{tikz}     \usetikzlibrary{calc}          \begin{document}          \frontmatter % Use roman page numbering style (i, ii, iii, iv...) for the pre-content pages          \setstretch{1.3} % Line spacing of 1.3          % Define the page headers using the FancyHdr package and set up for one-sided printing     \fancyhead{} % Clears all page headers and footers     \rhead{\thepage} % Sets the right side header to show the page number     \lhead{} % Clears the left side page header          \pagestyle{fancy} % Finally, use the "fancy" page style to implement the FancyHdr headers          \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % New command to make the lines in the title page          % PDF meta-data     \hypersetup{pdftitle={\ttitle}}     \hypersetup{pdfsubject=\subjectname}     \hypersetup{pdfauthor=\authornames}     \hypersetup{pdfkeywords=\keywordnames}               %----------------------------------------------------------------------------------------     %   TITLE PAGE     %----------------------------------------------------------------------------------------          \begin{titlepage}          \begin{tikzpicture}[overlay,remember picture]         \draw [line width=3pt,rounded corners=7pt]             ($ (current page.north west) + (1cm,-1cm) $)             rectangle             ($ (current page.south east) + (-1cm,1cm) $);         \draw [xshift=4mm,dashed,line width=1pt,rounded corners=7pt]             ($ (current page.north west) + (.5cm,-.5cm) $)             rectangle             ($ (current page.south east) + (-.5cm,.5cm) $);         \draw [line width=1pt,rounded corners=7pt]             ($ (current page.north west) + (1.5cm,-1.5cm) $)             rectangle             ($ (current page.south east) + (-1.5cm,1.5cm) $);     \end{tikzpicture}          \begin{center}          \textsc{\LARGE \univname}\\[1.5cm] % University name     \textsc{\Large Doctoral Thesis}\\[0.5cm] % Thesis type          \HRule \\[0.4cm] % Horizontal line     {\huge \bfseries \ttitle}\\[0.4cm] % Thesis title     \HRule \\[1.5cm] % Horizontal line          \begin{minipage}{0.4\textwidth}     \begin{flushleft} \large     \emph{Author:}\\     \href{http://www.johnsmith.com}{\authornames} % Author name - remove the \href bracket to remove the link     \end{flushleft}     \end{minipage}     \begin{minipage}{0.4\textwidth}     \begin{flushright} \large     \emph{Supervisor:} \\     \href{http://www.jamessmith.com}{\supname} % Supervisor name - remove the \href bracket to remove the link       \end{flushright}     \end{minipage}\\[3cm]          \large \textit{A thesis submitted in fulfilment of the requirements\\ for the degree of \degreename}\\[0.3cm] % University requirement text     \textit{in the}\\[0.4cm]     \groupname\\\deptname\\[2cm] % Research group name and department name          {\large \today}\\[4cm] % Date     %\includegraphics{Logo} % University/department logo - uncomment to place it          \vfill     \end{center}          \end{titlepage}          \end{document}      And this is my class file:               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     % Thesis LaTeX Template - THESIS CLASS FILE     %     % This template has been downloaded from:     % http://www.latextemplates.com     %     % This class file defines the structure and design of the template.      %     % There is one part of this file that needs to be filled out - the variables     % dictating the document particulars such as the author name, university     % name, etc. You will find these in the commented "DOCUMENT VARIABLES"     % section below.     %     % The other two easily-editable sections are the margin sizes and abstract.     % These have both been commented for easy editing. Advanced LaTeX     % users will have no trouble editing the rest of the document to their liking.     %     % Original header:     %% This is file `Thesis.cls', based on 'ECSthesis.cls', by Steve R. Gunn     %% generated with the docstrip utility.     %%     %% Created by Steve R. Gunn, modified by Sunil Patel: www.sunilpatel.co.uk     %% Further modified by www.latextemplates.com     %     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \NeedsTeXFormat{LaTeX2e}[1996/12/01]     \ProvidesClass{Thesis}                   [2007/22/02 v1.0        LaTeX document class]     \def\baseclass{book}     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\baseclass}}     \def\@checkoptions#1#2{       \edef\@curroptions{\@ptionlist{\@currname.\@currext}}       \@tempswafalse       \@tfor\@this:=#2\do{         \@expandtwoargs\in@{,\@this,}{,\@curroptions,}         \ifin@ \@tempswatrue \@break@tfor \fi}       \let\@this\@empty       \if@tempswa \else \PassOptionsToClass{#1}{\baseclass}\fi     }     \@checkoptions{11pt}{{10pt}{11pt}{12pt}}     \PassOptionsToClass{a4paper}{\baseclass}     \ProcessOptions\relax     \LoadClass{\baseclass}     \newcommand\bhrule{\typeout{------------------------------------------------------------------------------}}          \newcommand\Declaration[1]{     \btypeout{Declaration of Authorship}     \addtotoc{Declaration of Authorship}     \thispagestyle{plain}     \null\vfil     %\vskip 60\p@     \begin{center}{\huge\bf Declaration of Authorship\par}\end{center}     %\vskip 60\p@     {\normalsize #1}     \vfil\vfil\null     %\cleardoublepage     }          \newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}     \def\today{\ifcase\month\or       January\or February\or March\or April\or May\or June\or       July\or August\or September\or October\or November\or December\fi       \space \number\year}     \usepackage{setspace}     \onehalfspacing     \setlength{\parindent}{0pt}     \setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}     \usepackage{vmargin}          \RequirePackage[utf8]{inputenc} % Allows the use of international characters (e.g. Umlauts)          %----------------------------------------------------------------------------------------     %   MARGINS     %----------------------------------------------------------------------------------------     \setmarginsrb  { 1.5in}  % left margin                             { 0.6in}  % top margin                             { 1.0in}  % right margin                             { 0.8in}  % bottom margin                             {  20pt}  % head height                             {0.25in}  % head sep                             {   9pt}  % foot height                             { 0.3in}  % foot sep     %----------------------------------------------------------------------------------------     \raggedbottom     \setlength{\topskip}{1\topskip \@plus 5\p@}     \doublehyphendemerits=10000       % No consecutive line hyphens.     \brokenpenalty=10000              % No broken words across columns/pages.     \widowpenalty=9999                % Almost no widows at bottom of page.     \clubpenalty=9999                 % Almost no orphans at top of page.     \interfootnotelinepenalty=9999    % Almost never break footnotes.     \usepackage{fancyhdr}     \lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}     \rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}     \chead{}\lfoot{}\rfoot{}\cfoot{}     \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\btypeout{\thechapter\space #1}\markboth{\@chapapp\ \thechapter\ #1}{\@chapapp\ \thechapter\ #1}}     \renewcommand{\sectionmark}[1]{}     \renewcommand{\subsectionmark}[1]{}     \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else     \hbox{}     \thispagestyle{empty}     \newpage     \if@twocolumn\hbox{}\newpage\fi\fi\fi}     \usepackage{amsmath,amsfonts,amssymb,amscd,amsthm,xspace}     \theoremstyle{plain}     \newtheorem{example}{Example}[chapter]     \newtheorem{theorem}{Theorem}[chapter]     \newtheorem{corollary}[theorem]{Corollary}     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{proposition}[theorem]{Proposition}     \newtheorem{axiom}[theorem]{Axiom}     \theoremstyle{definition}     \newtheorem{definition}[theorem]{Definition}     \theoremstyle{remark}     \newtheorem{remark}[theorem]{Remark}     \usepackage[centerlast,small,sc]{caption}     \setlength{\captionmargin}{20pt}     \newcommand{\fref}[1]{Figure~\ref{#1}}     \newcommand{\tref}[1]{Table~\ref{#1}}     \newcommand{\eref}[1]{Equation~\ref{#1}}     \newcommand{\cref}[1]{Chapter~\ref{#1}}     \newcommand{\sref}[1]{Section~\ref{#1}}     \newcommand{\aref}[1]{Appendix~\ref{#1}}     \renewcommand{\topfraction}{0.85}     \renewcommand{\bottomfraction}{.85}     \renewcommand{\textfraction}{0.1}     \renewcommand{\dbltopfraction}{.85}     \renewcommand{\floatpagefraction}{0.75}     \renewcommand{\dblfloatpagefraction}{.75}     \setcounter{topnumber}{9}     \setcounter{bottomnumber}{9}     \setcounter{totalnumber}{20}     \setcounter{dbltopnumber}{9}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{booktabs}     \usepackage{rotating}     \usepackage{listings}     \usepackage{lstpatch}     \lstset{captionpos=b,             frame=tb,             basicstyle=\scriptsize\ttfamily,             showstringspaces=false,             keepspaces=true}     \lstdefinestyle{matlab} {             language=Matlab,             keywordstyle=\color{blue},             commentstyle=\color[rgb]{0.13,0.55,0.13}\em,             stringstyle=\color[rgb]{0.7,0,0} }     \usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,        bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=false,        colorlinks,linkcolor={blue},citecolor={blue},urlcolor={red},        pdfstartview={FitV},unicode,breaklinks=true]{hyperref}     \pdfstringdefDisableCommands{        \let\\\space     }     \newcommand*{\supervisor}[1]{\def\supname{#1}}     \newcommand*{\thesistitle}[1]{\def\ttitle{#1}}     \newcommand*{\examiner}[1]{\def\examname{#1}}     \newcommand*{\degree}[1]{\def\degreename{#1}}     \newcommand*{\authors}[1]{\def\authornames{#1}}     \newcommand*{\addresses}[1]{\def\addressnames{#1}}     \newcommand*{\university}[1]{\def\univname{#1}}     \newcommand*{\UNIVERSITY}[1]{\def\UNIVNAME{#1}}     \newcommand*{\department}[1]{\def\deptname{#1}}     \newcommand*{\DEPARTMENT}[1]{\def\DEPTNAME{#1}}     \newcommand*{\group}[1]{\def\groupname{#1}}     \newcommand*{\GROUP}[1]{\def\GROUPNAME{#1}}     \newcommand*{\faculty}[1]{\def\facname{#1}}     \newcommand*{\FACULTY}[1]{\def\FACNAME{#1}}     \newcommand*{\subject}[1]{\def\subjectname{#1}}     \newcommand*{\keywords}[1]{\def\keywordnames{#1}}          %----------------------------------------------------------------------------------------     %   DOCUMENT VARIABLES     %   Fill in the lines below to update the thesis template     %   If you wish to cite each of the variables defined below, look at the     %   section above for the citation command e.g. \examiner{} below is     %   defined as \examname above so you cite it as \examname     %----------------------------------------------------------------------------------------          \thesistitle{Thesis Title} % Your thesis title - this is used in the title and abstract     %-------------------------------------------------       \supervisor{Dr. James \textsc{Smith}} % You supervisor's name - this is used in the title page     %-------------------------------------------------        \examiner{} % Your examiner's name - this is not currently used anywhere in the template, cite it with \examname if you want it     %-------------------------------------------------        \degree{Doctor of Philosophy} % Your degree name - this is currently used in the title page and abstract     %-------------------------------------------------        \authors{John \textsc{Smith}} % Your name - this is used in the title page and abstract     %-------------------------------------------------        \addresses{} % Your address - this is not currently used anywhere in the template, cite it with \addressnames if you want it     %-------------------------------------------------        \subject{} % Your subject area - this is not currently used anywhere in the template, cite it with \subjectname if you want it     %-------------------------------------------------        \keywords{} % Keywords for your thesis - this is not currently used anywhere in the template, cite it with \keywordnames if you want it     %-------------------------------------------------        \university{\texorpdfstring{\href{http://www.university.com} % Your university's URL                     {University Name}} % Your university's name - this is currently used in the title page                     {University Name}}     %-------------------------------------------------        \UNIVERSITY{\texorpdfstring{\href{University Web Site URL Here (include http://)} % Your university's URL                     {UNIVERSITY NAME (IN BLOCK CAPITALS)}} % Your university's name in capitals - this is currently used in the abstract page                     {UNIVERSITY NAME (IN BLOCK CAPITALS)}}     %-------------------------------------------------                     \department{\texorpdfstring{\href{Department or School Web Site URL Here (include http://)} % Your department's URL                     {Department or School Name}} % Your department's name - used in the title page and abstract                     {Department or School Name}}     %-------------------------------------------------                     \DEPARTMENT{\texorpdfstring{\href{Department or School Web Site URL Here (include http://)} % Your department's URL                     {DEPARTMENT OR SCHOOL NAME (IN BLOCK CAPITALS)}} % Your department's name in capitals - this is not currently used anywhere in the template, cite it with \DEPTNAME if you want it                     {DEPARTMENT OR SCHOOL NAME (IN BLOCK CAPITALS)}}     %-------------------------------------------------                     \group{\texorpdfstring{\href{Research Group Web Site URL Here (include http://)} % Your research group's URL                     {Research Group Name}} % Your research group's name - this is currently used in the title page                      {Research Group Name}}     %-------------------------------------------------                     \GROUP{\texorpdfstring{\href{Research Group Web Site URL Here (include http://)} % Your research group's URL                     {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}} % Your research group's name in capitals - this is not currently used anywhere in the template, cite it with \GROUPNAME if you want it                     {RESEARCH GROUP NAME (IN BLOCK CAPITALS)}}     %-------------------------------------------------                     \faculty{\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} % Your faculty's URL                     {Faculty Name}} % Your faculty's name - this is currently used in the abstract page                     {Faculty Name}}     %-------------------------------------------------                     \FACULTY{\texorpdfstring{\href{Faculty Web Site URL Here (include http://)} % Your faculty's URL                     {FACULTY NAME (IN BLOCK CAPITALS)}} % Your faculty's name in capitals - this is not currently used anywhere in the template, cite it with \FACNAME if you want it                     {FACULTY NAME (IN BLOCK CAPITALS)}}     %----------------------------------------------------------------------------------------              % The default title page, this is not used in this www.latextemplates.com version                 \renewcommand\maketitle{       \btypeout{Title Page}       \hypersetup{pdftitle={\@title}}       \hypersetup{pdfsubject=\subjectname}       \hypersetup{pdfauthor=\authornames}       \hypersetup{pdfkeywords=\keywordnames}       \thispagestyle{empty}       \begin{titlepage}         \let\footnotesize\small         \let\footnoterule\relax         \let \footnote \thanks         \setcounter{footnote}{0}         \null\vfil         \vskip 60\p@         \begin{center}           \setlength{\parskip}{0pt}           {\large\textbf{\UNIVNAME}\par}           \vfill           {\huge \bf \@title \par}           \vfill           {\LARGE by \par}           \smallskip           {\LARGE \authornames \par}           \vfill           {\large A thesis submitted in partial fulfillment for the \par}           {\large degree of \degreename \par}           \bigskip           \bigskip           {\large in the \par}           {\large \facname \par}           {\large \deptname \par}            \bigskip           \bigskip           \bigskip           {\Large \@date \par}           \bigskip         \end{center}         \par         \@thanks         \vfil\null       \end{titlepage}       \setcounter{footnote}{0}%       \global\let\thanks\relax       \global\let\maketitle\relax       \global\let\@thanks\@empty       \global\let\@author\@empty       \global\let\@date\@empty       \global\let\@title\@empty       \global\let\title\relax       \global\let\author\relax       \global\let\date\relax       \global\let\and\relax       \cleardoublepage     }     %----------------------------------------------------------------------------------------     %   ABSTRACT PAGE DESIGN     %----------------------------------------------------------------------------------------     \newenvironment{abstract}     {       \btypeout{Abstract Page}       \thispagestyle{empty}       \null\vfil       \begin{center}         \setlength{\parskip}{0pt}         {\normalsize \UNIVNAME \par} % University name in capitals         \bigskip         {\huge{\textit{Abstract}} \par}         \bigskip         {\normalsize \facname \par} % Faculty name         {\normalsize \deptname \par} % Department name         \bigskip         {\normalsize \degreename\par} % Degree name         \bigskip         {\normalsize\bf \@title \par} % Thesis title         \medskip         {\normalsize by \authornames \par} % Author name         \bigskip       \end{center}     }     %----------------------------------------------------------------------------------------     {       \vfil\vfil\vfil\null       \cleardoublepage     }     \addtocounter{secnumdepth}{1}     \setcounter{tocdepth}{6}     \newcounter{dummy}     \newcommand\addtotoc[1]{     \refstepcounter{dummy}     \addcontentsline{toc}{chapter}{#1}}     \renewcommand\tableofcontents{     \btypeout{Table of Contents}     \addtotoc{Contents}     \begin{spacing}{1}{         \setlength{\parskip}{1pt}         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\contentsname             \@mkboth{                \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}         \@starttoc{toc}         \if@restonecol\twocolumn\fi        \cleardoublepage     }\end{spacing}     }     \renewcommand\listoffigures{     \btypeout{List of Figures}     \addtotoc{List of Figures}     \begin{spacing}{1}{         \setlength{\parskip}{1pt}         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\listfigurename           \@mkboth{\MakeUppercase\listfigurename}                   {\MakeUppercase\listfigurename}}         \@starttoc{lof}         \if@restonecol\twocolumn\fi         \cleardoublepage     }\end{spacing}     }     \renewcommand\listoftables{     \btypeout{List of Tables}     \addtotoc{List of Tables}     \begin{spacing}{1}{         \setlength{\parskip}{1pt}         \if@twocolumn           \@restonecoltrue\onecolumn         \else           \@restonecolfalse         \fi         \chapter*{\listtablename           \@mkboth{               \MakeUppercase\listtablename}{\MakeUppercase\listtablename}}         \@starttoc{lot}         \if@restonecol\twocolumn\fi         \cleardoublepage     }\end{spacing}     }     \newcommand\listsymbolname{Abbreviations}     \usepackage{longtable}     \newcommand\listofsymbols[2]{     \btypeout{\listsymbolname}     \addtotoc{\listsymbolname}         \chapter*{\listsymbolname           \@mkboth{               \MakeUppercase\listsymbolname}{\MakeUppercase\listsymbolname}}     \begin{longtable}[c]{#1}#2\end{longtable}\par         \cleardoublepage     }     \newcommand\listconstants{Physical Constants}     \usepackage{longtable}     \newcommand\listofconstants[2]{     \btypeout{\listconstants}     \addtotoc{\listconstants}         \chapter*{\listconstants           \@mkboth{               \MakeUppercase\listconstants}{\MakeUppercase\listconstants}}     \begin{longtable}[c]{#1}#2\end{longtable}\par         \cleardoublepage     }     \newcommand\listnomenclature{Symbols}     \usepackage{longtable}     \newcommand\listofnomenclature[2]{     \btypeout{\listnomenclature}     \addtotoc{\listnomenclature}         \chapter*{\listnomenclature           \@mkboth{               \MakeUppercase\listnomenclature}{\MakeUppercase\listnomenclature}}     \begin{longtable}[c]{#1}#2\end{longtable}\par         \cleardoublepage     }     \newcommand\acknowledgements[1]{     \btypeout{Acknowledgements}     \addtotoc{Acknowledgements}     \thispagestyle{plain}     \begin{center}{\huge{\textit{Acknowledgements}} \par}\end{center}     {\normalsize #1}     \vfil\vfil\null          }     \newcommand\dedicatory[1]{     \btypeout{Dedicatory}     \thispagestyle{plain}     \null\vfil     \vskip 60\p@     \begin{center}{\Large \sl #1}\end{center}     \vfil\null     \cleardoublepage     }     \renewcommand\backmatter{       \if@openright         \cleardoublepage       \else         \clearpage       \fi       \addtotoc{\bibname}       \btypeout{\bibname}       \@mainmatterfalse}     \endinput


title: MikTeX cannot find the file

text: Why is it that MikTeX's XeTeX cannot find my file? ![enter image description here](http://i.stack.imgur.com/A5vj3.jpg) Dude, you're right there in the same directory as the file, why can't you see it?!


title: Customization of chapter entries in Table of Contents

text: I want to customize chapter entries in Table of Contents.               \documentclass[final]{book}          \title{Title}     \author{Author}     \date{}          \begin{document}          \maketitle     \tableofcontents          \chapter*{Chapter Title}     \addcontentsline{toc}{chapter}{Chapter Title}          \end{document}        1. By default, **chapter entries** in Table of Contents are bolded. I want to make them **not bolded**. For example, in other situations where I would like to use not bolded text in otherwise bolded environment, I would use \textnormal command. However, **I am not able to find a way to redefine chapter entry in ToC** to use that setting.   2. By default, subsections entries have dot leaders, but chapter entries does not. I would like to **add dot leaders to chapter entries** in ToC. I found tocloft package. It looks like it should be able to do both of those things, but I was not able to find suitable example in its documentation.


title: One column white space in double column?

text: I am writing in a double-column template (IEEE Conference Template). What has been bothering me is that once I have a figure/pseudocode/tikz in one column, sometimes it pushes the contents in the other column down, as if it wanted to occupy both columns. **What I get is something like this:** ![enter image description here](http://i.stack.imgur.com/Vem2q.png) **and this** ![enter image description here](http://i.stack.imgur.com/OfXT5.png) But in fact it only takes up one column. Sometimes I can solve this issue by moving the figure snippet around. But it is definitely a method by luck... What is the formal way of solving this issue? **My sincere apologies for not providing a MWE. I have tried very hard, but the problem never appears while creating a MWE!**


title: Misplaced \noalign error in table, but only when using include{}

text: I am using `xtable()` in `R` to create a LaTeX table that I import into a `.rnw` file via `\input{}`. As documented here, I am attempting to highlight rows conditional upon a certain value of one variable. The `R` side of my problem has been resolved. Now I am struggling with a LaTeX problem, which is why I am posting here. The following `R` code creates my table:                 wd <- "yourpath"       setwd(wd)     # create data frame       my.df=data.frame(a=c(1:10),b=letters[1:10],c=c(1,1,0,0,1,1,0,0,1,1))          # identify index of rows to highlight       row.i.1 <- which(my.df$c==1)          print(xtable(my.df),           only.contents=TRUE,           include.rownames=FALSE,           include.colnames=FALSE,           hline.after=NULL,           type="latex",           add.to.row=list(             pos=list(as.list(row.i.1))[[1]],             command=rep("\\rowcolor{green!20!white}",                         length(seq(from=1,to=length(row.i.1),by=1)))),           sanitize.text.function=identity,           file="testtbl.tex"      Here are the contents of `testtbl.tex`:               % latex table generated in R 3.0.1 by xtable 1.7-1 package     % Tue Nov 12 10:23:27 2013        1 & a & 1.00 \\         \rowcolor{green!20!white}  2 & b & 1.00 \\         \rowcolor{green!20!white}  3 & c & 0.00 \\          4 & d & 0.00 \\          5 & e & 1.00 \\         \rowcolor{green!20!white}  6 & f & 1.00 \\         \rowcolor{green!20!white}  7 & g & 0.00 \\          8 & h & 0.00 \\          9 & i & 1.00 \\         \rowcolor{green!20!white} 10 & j & 1.00 \\         \rowcolor{green!20!white}      The row highlighting is shifted down one row for some reason. A commenter on SO instructed me to change `pos=list(as.list(row.i.1))[[1]],` to `pos=list(as.list(row.i.1-1))[[1]],` (adding the `-1`), which gives the correct assignment:               % latex table generated in R 3.0.1 by xtable 1.7-1 package     % Tue Nov 12 10:26:16 2013       \rowcolor{green!20!white}  1 & a & 1.00 \\         \rowcolor{green!20!white}  2 & b & 1.00 \\          3 & c & 0.00 \\          4 & d & 0.00 \\         \rowcolor{green!20!white}  5 & e & 1.00 \\         \rowcolor{green!20!white}  6 & f & 1.00 \\          7 & g & 0.00 \\          8 & h & 0.00 \\         \rowcolor{green!20!white}  9 & i & 1.00 \\         \rowcolor{green!20!white} 10 & j & 1.00 \\      The problem now comes when I try to include this table in a `.rnw` file. (1) If I paste the table directly into my `.rnw` file, everything works:               \documentclass{article}     \usepackage{colortbl, xcolor}     \usepackage{booktabs}     \begin{document}     \begin{table}       \begin{tabular}{lll}       \toprule       var1 & var2 & var3 \\       \midrule     % latex table generated in R 3.0.1 by xtable 1.7-1 package     % Tue Nov 12 10:26:16 2013       \rowcolor{green!20!white}  1 & a & 1.00 \\         \rowcolor{green!20!white}  2 & b & 1.00 \\          3 & c & 0.00 \\          4 & d & 0.00 \\         \rowcolor{green!20!white}  5 & e & 1.00 \\         \rowcolor{green!20!white}  6 & f & 1.00 \\          7 & g & 0.00 \\          8 & h & 0.00 \\         \rowcolor{green!20!white}  9 & i & 1.00 \\         \rowcolor{green!20!white} 10 & j & 1.00 \\       \bottomrule       \end{tabular}     \end{table}     \end{document}      (2) However, if I try to import the table via `include`, which is what I need to do for reproducibility, I get the following error: `Error: testtbl.tex:3: Misplaced \noalign`               \documentclass{article}     \usepackage{colortbl, xcolor}     \usepackage{booktabs}     \begin{document}     \begin{table}       \begin{tabular}{lll}       \toprule       var1 & var2 & var3 \\       \midrule       \input{testtbl}       \bottomrule       \end{tabular}     \end{table}     \end{document}      (3) If I go back and use the original `xtable` code, `pos=list(as.list(row.i.1))[[1]]`, thus not subtracting 1, the `pdf` will compile, but my highlighting is shifted. So my question is: Why am I getting a `Misplaced \noalign` when grabbing my table contents via `include` (2) but not when copying and pasting the exact same content directly into the document (1). The fact that (3) will compile (but with incorrect highlighting) makes me think it has something to do with how I try to correct the shifted highlighting.


title: How can I adjust the size of my pgf plot and get rid of these colours

text: I am having too much trouble trying to get a nice looking plot that takes latex font with gnuplot so I am trying pgfplots again. The only trouble is that I cannot resize the plot, so that it fills half the page. I would also like the points to be smaller and don't know how to make it so. I would also like to not have to paste the data twice to get it to work. I cannot pull it from a file because pgplots seems to need titles and my file format has not the titles in it.               \documentclass{article}     \usepackage{pgfplots}     \usepackage{pgfplotstable}     \begin{document}               \begin{tikzpicture}[domain=0:18]     \begin{axis}[xlabel={Current $mA$}, ylabel={Voltage $mV$}]          \addplot[scatter, only marks, scatter src=\thisrow{Current},           error bars/.cd, y dir=both, x dir=both, y explicit, x explicit, error bar style={color=mapped color}]           table[x=Current,y=Voltage,x error=xerr,y error=yerr] {     Current Voltage xerr   yerr          13.9900 -1.80000 0.149900 0.197300      12.0200 -1.50000 0.130200 0.197750      9.99000 -1.30000 0.109900 0.198050      8.00000 -1.00000 0.0900000 0.198500      6.02000 -0.800000 0.0702000 0.198800      4.01000 -0.500000 0.0501000 0.199250      2.00000 -0.300000 0.0300000 0.199550      0.00000 0.00000 0.0100000 0.200000      -2.00000 0.300000 -0.0100000 0.200450      -4.00000 0.500000 -0.0300000 0.200750      -6.02000 0.800000 -0.0502000 0.201200      -8.00000 1.10000 -0.0700000 0.201650      -10.0000 1.30000 -0.0900000 0.201950      -12.0300 1.50000 -0.110300 0.202250      -13.9800 1.80000 -0.129800 0.202700      };        \addplot[no markers,color=blue,forget plot] table [x=Current, y={create col/linear regression={y=Voltage}}]{        Current Voltage xerr   yerr          13.9900 -1.80000 0.149900 0.197300      12.0200 -1.50000 0.130200 0.197750      9.99000 -1.30000 0.109900 0.198050      8.00000 -1.00000 0.0900000 0.198500      6.02000 -0.800000 0.0702000 0.198800      4.01000 -0.500000 0.0501000 0.199250      2.00000 -0.300000 0.0300000 0.199550      0.00000 0.00000 0.0100000 0.200000      -2.00000 0.300000 -0.0100000 0.200450      -4.00000 0.500000 -0.0300000 0.200750      -6.02000 0.800000 -0.0502000 0.201200      -8.00000 1.10000 -0.0700000 0.201650      -10.0000 1.30000 -0.0900000 0.201950      -12.0300 1.50000 -0.110300 0.202250      -13.9800 1.80000 -0.129800 0.202700      };           \end{axis}     \end{tikzpicture}     \end{document}      ![graph](http://i.stack.imgur.com/6PlGr.png) Update: When trying the method below: This is the file:               13.9600 -7.60000 0.149600 0.188600      12.0100 -6.50000 0.130100 0.190250      9.98000 -5.40000 0.109800 0.191900      7.99000 -4.30000 0.0899000 0.193550      6.01000 -3.30000 0.0701000 0.195050      4.00000 -2.20000 0.0500000 0.196700      2.00000 -1.10000 0.0300000 0.198350      0.00000 0.00000 0.0100000 0.200000      -2.00000 1.10000 -0.0100000 0.201650      -3.99000 2.20000 -0.0299000 0.203300      -6.01000 3.20000 -0.0501000 0.204800      -7.99000 4.30000 -0.0699000 0.206450      -9.99000 5.40000 -0.0899000 0.208100      -12.0000 6.40000 -0.110000 0.209600      -13.9700 7.50000 -0.129700 0.211250      ![graphoutcome](http://i.stack.imgur.com/KoWdO.png) ![enter image description here](http://i.stack.imgur.com/l4c8R.png)


title: How can I generate a list of appendices, separate from the table of contents (ToC)?

text: LaTeX's appendix environment formats sections differently and uses a different enumeration in the table of contents:               \begin{appendix}      \section{superuser}      \dots{}     ....      Shows up as        **A       superuser            11** in the `\tableofcontents`. Unfortunately, I have to use a different style: the appendix is not to show up in the table of contents, but in a separate listing right before the appendix. I see the following options to solve this:   * suppress output in tableofcontents and somehow recreate the part on a different page   * generate a custom listing of specified / the following section   * manually create a list with the same formatting as the table of contents I use `scrartcl` as document class.


title: Name of length for equation number indent if [leqno] is set

text: I got a weird phenomenon as shown in the picture below. The equation numbering is indented. ![enter image description here](http://i.stack.imgur.com/LsDUC.png) I tried the same thing in a fresh document and it produces the result I am looking for. For the other one, I wrap the `align` environment in a custom environment which inserts a glossary but does not tinker with any lengths. I was thinking of just setting the length which governs the left indent to a negative value. I just couldn't find its name.               % Working MWE     \documentclass[leqno]{scrartcl}          \usepackage[T1]{fontenc}     \usepackage{amsmath}     \usepackage{lipsum}     \setlength{\parindent}{0pt} %globales \noindent          \begin{document}          \section{Test test test}     \lipsum[1]     \begin{align}     f_{h,rech} = \frac{f_{h,prim}}{\eta_h}     \end{align}     \lipsum[1]          \end{document}      Custom environment definition is this:               \newenvironment{alignglos}%     {\stepcounter{alignglos}%         \renewcommand{\sym}[2][]{\glsadd[##1]{sym2:##2}\gls*[##1]{sym:##2}}%     }%     {%        \noindent         \glstocfalse                 \renewcommand{\glossarysection}[2][]{}%                 \vspace{-3em}                 \printglossary[type=symbols2,style=alignglos]                 \vspace{-2em}     }      I tried two things to solve this:   1.) Applied solution from this thread: Left numbered equation inside list environment   2.) `\setlength{\mathindent}{0pt}` **Update 1:** Indentation happens also outside my custom environment.   **Update 2:** The indented length equals exactly to `\parindent` which I have set to zero (`\setlength\parindent{0pt}`)   **Update 3:** Something I've overlooked. I'm using the `\appendix` command. Only happens after I used it. Before that everything is fine.


title: Test if a chapter has sections

text: Is there an easy way to test if a chapter has sections? The question is related to short tables of contents displayed at the beginning of each chapter and that would be empty when the current chapter has no sections.


title: Are comments safely hidden once the document is compiled?

text: This is kind of similar to some of the pdf to latex questions but from a different angle. I'm not looking for a complete LaTeX reconstruction method, I want to know if the comments are safely hidden. My scenario is that I would like to distribute a sample test to my students which includes the real test or some variation of it commented out---that way I can keep the same file from year to year without having to manage multiple documents. I'm pretty sure that what's commented out is dropped entirely from the compiled document but I'd like to be absolutely certain before I distribute such a pdf. Is there any way whatsoever to extract commented lines from the final pdf? If it makes any difference, I'll probably be using XeLaTeX.


title: Using BibTeX with LyX: errors in auto-generated .bbl

text: I've been puzzling with this for hours now and I can't solve it. I'm using LyX for my article and I made a BibTeX file with JabRef. I inserted the BibTeX bibliography into LyX, but when I try to compile, errors appear: Multiple "Missing $ inserted.", "Missing } inserted." and "Extra }, or forgotten \endgroup." The first error says:               Missing $ inserted.     \newblock http://www.nasa.gov/mission_                            pages/stereo/multimedia/deploy.html      They all refer to lines in the **auto-generated .bbl** file. The same problem occurs when I export LyX to LaTeX and compile it there (also with different encodings). I've read some things about BibTeX encoding, but I can't figure it out. I'll post some of the BibTeX below:               @INPROCEEDINGS{MSOptimizationEvaluation,       author = "Jens N. Kaftan and Andr{\'e} A. Bell and Til Aach",       title = "Mean Shift Segmentation Evaluation of Optimization Techniques",       booktitle = "Proceedings of the Third International Conference on Computer Vision Theory and Applications, VISAPP 2008",       year = "2008",       pages = "365-374",       address = "Funchal, Madeira - Portugal",       month = "January 22-25",       publisher = "INSTICC - Institute for Systems and Technologies of Information, Control and Communication"     }          @CONFERENCE{HDTV_AxiVision,       author = "Kawakita, M. and Kurita, T. and Kikuchi, H. and Inoue, S.",       title = "HDTV axi-vision camera",       booktitle = "Proc. of International Broadcasting Conference",       year = "2002",       pages = "397-404"     }          @ARTICLE{MarrPoggio,       author = "Marr, D. and Poggio, T.",       title = "A computational theory of human stereo vision",       journal = "Proceedings of the Royal Society of London. Series B, Biological Sciences",       year = "1979",       volume = "204",       pages = "301-328",       number = "1156",       issn = "0080-4649",       publisher = "JSTOR"     }          @MISC{jEDISON,       author = "Pangburn, Brian E. and Ayo, Jonathan P.",       title = "Koders - Source Code Search Engine",       howpublished = "http://www.koders.com/info.aspx?c=ProjectInfo\&pid=1ZLCBNBRKBWSX9KL1VF3ZA989H\&s=Region",       year = "2002",       timestamp = "2011.01.06"     }      Any ideas?


title: How does one change the math font size?

text: > **Possible Duplicate:**   >  how to scale math font only Similar to how to change math font only, is there a way to change the size of fonts in math formulas? **EDIT -- DUPLICATE OFhow to scale math font only**


How to vertically center `\begin{equation}...\end{equation}` in a table cell? ![alt text](http://i.stack.imgur.com/zqd5y.png) ## Minimal Code (I cannot minimize anymore)               \documentclass{article}     \usepackage{array,longtable,calc,amsmath}          \newcolumntype{A}[1]{%         >{\begin{minipage}{#1\linewidth-2\tabcolsep-1.5\arrayrulewidth}\vspace{\tabcolsep}}%         c%         <{\vspace{\tabcolsep}\end{minipage}}%     }          \begin{document}     \begin{longtable}{|*2{A{0.5}|}}     \hline     \begin{equation}       \sin x \cos x = y     \end{equation}     & \hrulefill \tabularnewline\hline     \end{longtable}     \end{document}


title: How to wrap text in line by adding spaces

text: I am writing one text which has some very long words but i don't need to split word in multiline using hyphen. I just want to add spaces to fit in the line as shown below.                      This is my first text for wrapping word            in a file. This text need   to       be            adjusted and acted based   on the table             which need to be  modified   and tested             basedonthethedata  which is given here.      How can i implement it?


title: Stretching text within a certain size box

text: I would like to stretch some text within a certain size box, say two inches (I'm not sure yet how large I want the box to be). I came across this example to stretch text across the entire page:               \documentclass{article}               \usepackage{soul}     \sodef\ugg{}{.4em plus 1fill}{1em plus 2 fill}{2em plus 2fill minus.1em}          \begin{document}               \noindent\ugg{one two three\\four five six}          \end{document}      I'm wondering how I might modify it for my purposes. Or should I use something else altogether? Thanks!


title: Why do LaTeX and pdflatex produce different margins?

text: I am working with TeXStudio on Windows. When I use latex + dvips + ps2pdf and pdflatex the margins in the resulting PDF file are different. Has anyone else encountered this? Is there a way to avoid this? * * * The code below produced different margins at the top of the page.               \documentclass[a4paper,12pt]{article}          \begin{document}     text          \end{document}


title: Options passed to a path inside insert path style

text: Is there a way to give to the `\path` (inside `mypath` style) the options given to the `\draw` and `\fill` commands (ideally, the path should be drawn and red then filled and blue) ?               \documentclass{standalone}     \usepackage{tikz}     \tikzset{%       mypath/.style = {%         insert path = {%           \pgfextra{%             \pgfinterruptpath               % This is the path that should receive the options               \path (0,0) rectangle (1,1);             \endpgfinterruptpath           }         }       }     }     \begin{document}     \begin{tikzpicture}       \draw[red,mypath];       \fill[blue,mypath];     \end{tikzpicture}     \end{document}


title: Embedding LaTeX for PDF generation

text: I'd like to use LaTeX as an document generation backend in my application (mainly because it is well known, feature rich and output is of very high quality). Let's assume the application creates a small set of documents with content generated (or calculated) from user input. Of course, I could require a working installation of TeX with the (relatively small) set of used packages on the installation target. Another option would be providing this during the installation process of the application itself. This would allow for feeding the generated LaTeX source to the latex command. This adds a large and perhaps unstable dependency to the (comparatively) small application. As TeX installations can easily exceed several hundred MB in size, I'd rather not like to bother users with this. What I'm looking for is a way of _embedding_ LaTeX in my application, specifically tailored to the used document class and packages in the generated documents, ideally without the need to kpathsea the required files. I _assume_ this has been done before, but I haven't managed to find any traces of this.


title: New commands for the equation environment

text: I'm trying to define a bra-ket command so that I can easily build things like:               \langle e^+ | \gamma^\mu | e^-\rangle      At the moment I have this:               \newcommand{\brak}[3]{     \langle #1 \| \gamma^{#2} \| #3 \rangle     }      but, when I have `\brak(e^+, \mu, e^-)` in an equation I get:               ⟨e−,μ,e+∥γ     ∥equation⟩      Any ideas?


title: Change the "language" of Pandoc

text: This is not directly a LaTeX question since I use Markdown to format my text but this subpart of "stack" seems the most correct place to ask my question. I generate my PDF with Pandoc from markdown using the command:               pandoc myDoc.md --chapters -o result.pdf      Where it generates chapters from my markdown. This is nice, however it calls the chapters "Chapter 1", "Chapter 2" and so on and so forth (See http://cl.ly/PfRJ ). For English documents this would be okay. However my documents are in Dutch. Is there any way I can change this? I think there is somewhere a template where it stores these things? But I can't seem to find it.


title: When might it be helpful to use implicit braces instead of explicit braces?

text: We've covered the question "When can one use implicit braces instead of explicit braces?"; this leads immediately in my mind to the question "Why would one want to?" (Remember, implicit braces are e.g. `\bgroup` and `\egroup` as defined by the code `\let\bgroup={ \let\egroup=}` in plain TeX.) I suppose this is basically the same as the question "When must one use implicit braces instead of explicit braces?"


title: How to do \scantokens inside \edef without triggering "Runaway definition"

text: I'm trying to find a way to use the e-TeX `\scantokens` command inside [the equivalent of] an `\edef` (well, actually an `\xdef`, but presumably this does not make any real difference since that's just the `\global` version of `\edef`). The reason I am doing this is that it seems to be needed to answer this question about hyperref and pdf outlines. The problem seems to be that `\scantokens` doesn't actually expand to the tokens scanned; it actually expands to nothing, but arranges for the next tokens to be read from a pseudo-file named " ", which is then treated almost exactly like a real file, including the check for "runaway" conditions. (See page 10 of the e-TeX manual.) There is one problem with this explanation, though: why would `\input` work, as it evidently does in the other question? Anyway, here's a fairly minimal example:               %&eplain          % make \scantokens pseudo-files show up with name " " in the output     \tracingscantokens=1          \edef\foo{\scantokens{Test}}      Which produces the output               Running `TeX' on `scantokens-in-edef-minimal' with ``pdftex  -interaction=nonstopmode "\input" "scantokens-in-edef-minimal"''     This is pdfTeX, Version 3.1415926-1.40.11 (MiKTeX 2.9)     entering extended mode     (e:\home\tex\scantokens-in-edef-minimal.tex ( )     Runaway definition?     ->Test      ! File ended while scanning definition of \foo.     <inserted text>                      }     l.6 \edef\foo{\scantokens{Test}                                    }     ! Too many }'s.     l.6 \edef\foo{\scantokens{Test}}          )     ! Emergency stop.     <*> \input scantokens-in-edef-minimal          !  ==> Fatal error occurred, no output PDF file produced!     Transcript written on scantokens-in-edef-minimal.log.          TeX exited abnormally with code 1 at Thu Jan 27 12:24:57      Is it perhaps possible to somehow do the expansion with macros and then do a `\def` instead of the `\edef`, so the expansion would be finished before the definition began, and the "runaway definition" condition avoided?


title: How to change the gap between arrow and text

text: \documentclass[fleqn,12pt,a4paper]{article}     \usepackage{chemarrow}     \newcommand\Ra{$\autorightarrow{\scriptsize{Text over arrow}}{} $}     \begin{document}     \Ra      \end{document}      As shown in the image, is it possible to change the gap between the arrow and the text over the arrow. Thanks for your help. ![enter image description here](http://i.stack.imgur.com/O9Iwm.jpg)


title: Biblatex: Convert doi-url into doi field

text: I use biblatex and would like my bibliography to only include a DOI field, whenever there is DOI information available. This involves two things:   1. Biblatex has to suppress the URL field whenever a DOI field is present. This can be done with the following code in the preamble. (This is a simplified version of Joseph Wright's answer here).               \renewbibmacro*{doi+eprint+url}{%       \iftoggle{bbx:doi}         {\printfield{doi}}         {}%     \newunit\newblock       \iftoggle{bbx:eprint}         {\usebibmacro{eprint}}         {}%     \newunit\newblock       \iftoggle{bbx:url}             {%           \iffieldundef{doi}     {\usebibmacro{url+urldate}}             {%               \clearfield{url}%               }%         }         {}}       So everytime a DOI field is present in the bibtex file, the URL field is cleared.   2. My bibtex file is exported from Zotero. Unfortunately Zotero does not provide DOI fields for all entry types (yet), so I often enter the DOI information into the URL field like http://dx.doi.org/10.1145/1364782.1364794. So my question is: Is it possible to have biblatex take the DOI information from the URL field, store it into the DOI field and write only that into the bibliography?  I guess one would have to modify the `\usebibmacro{url+urldate}` conditional: First, check whether the URL field contains "dx.doi.org/" (ideally one should allow for http and https). If it does, take everything after "dx.doi.org/", copy it into the DOI field (with `\restorefield`?) and `\printfield{doi}`. If it does not, i.e. if it is not a DOI-URL, `\usebibmacro{url+urldate}`. Is that possible?


title: How do you overcome the minimum cell size limit?

text: UPDATE: Answered by David Carlisle in the comments. I'm creating a table using tabular for which I'm using code to make all the columns the same width: `\newcolumntype{C}{>{\centering\arraybackslash}m{0.000000005cm}}` The smallest column I'm using doesn't contain any text and is used as a color index. As you can see, I seem to have hit some kind of minimum size limit on cell width and this making the whole table far too large for the page. Is there a way of ignoring the size limit? EDIT: My current file looks like this:               \documentclass[11pt]{amsart}     \usepackage{geometry}     \geometry{letterpaper}     \usepackage{graphicx}     \usepackage{natbib}     \bibpunct{(}{)}{;}{a}{,}{,}     \usepackage[latin1]{inputenc}     \usepackage{amssymb}     \usepackage{epstopdf}     \usepackage{multirow}     \usepackage{latexsym}     \usepackage{bm,array}     \usepackage{amsfonts}     \usepackage{amsmath}     \usepackage{color}     \usepackage{xcolor,colortbl}     \usepackage{lscape}          \begin{document}     \thispagestyle{empty}     \pagestyle{empty}          \newcolumntype{C}{>{\centering\arraybackslash}m{0.0000000000000000001cm}}          \definecolor{gray}{gray}{0.75}     \begin{landscape}          \begin{tabular}{| C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C | C | C C |}     \hline      && \multicolumn{6}{|c|}{\cellcolor{red}} & \multicolumn{12}{|c|}{} & \multicolumn{6}{|c|}{\cellcolor{orange}} & \multicolumn{12}{|c|}{} & \multicolumn{6}{|c|}{\cellcolor{yellow}} & \multicolumn{12}{|c|}{} & \multicolumn{6}{|c|}{\cellcolor{green}} & \multicolumn{12}{|c|}{} & \multicolumn{6}{|c|}{\cellcolor{blue}} & \multicolumn{12}{|c|}{} & \multicolumn{6}{|c|}{\cellcolor{black}} & \multicolumn{12}{|c|}{}\     \hline     \multicolumn{2}{|c|}{\tiny 1} & \multicolumn{9}{| l |}{\color{gray} \scriptsize Base x Multipliers} & \multicolumn{3}{|c|}{\color{gray} \scriptsize CO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize PO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize I} & \multicolumn{9}{| l |}{\color{gray} \scriptsize Base x Multipliers} & \multicolumn{3}{|c|}{\color{gray} \scriptsize CO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize PO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize I} & \multicolumn{9}{| l |}{\color{gray} \scriptsize Base x Multipliers} & \multicolumn{3}{|c|}{\color{gray} \scriptsize CO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize PO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize I} & \multicolumn{9}{| l |}{\color{gray} \scriptsize Base x Multipliers} & \multicolumn{3}{|c|}{\color{gray} \scriptsize CO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize PO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize I} & \multicolumn{9}{| l |}{\color{gray} \scriptsize Base x Multipliers} & \multicolumn{3}{|c|}{\color{gray} \scriptsize CO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize PO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize I} & \multicolumn{9}{| l |}{\color{gray} \scriptsize Base x Multipliers} & \multicolumn{3}{|c|}{\color{gray} \scriptsize CO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize PO} & \multicolumn{3}{|c|}{\color{gray} \scriptsize I}\     \hline      & & \cellcolor{red} & & &\cellcolor{orange}&& &\cellcolor{yellow}&&&\cellcolor{green}&& &\cellcolor{blue}&&&\cellcolor{black}&& & \cellcolor{red} & & &\cellcolor{orange}&& &\cellcolor{yellow}&&&\cellcolor{green}&& &\cellcolor{blue}&&&\cellcolor{black}&&  & \cellcolor{red} & & &\cellcolor{orange}&& &\cellcolor{yellow}&&&\cellcolor{green}&& &\cellcolor{blue}&&&\cellcolor{black}&&  & \cellcolor{red} & & &\cellcolor{orange}&& &\cellcolor{yellow}&&&\cellcolor{green}&& &\cellcolor{blue}&&&\cellcolor{black}&&  & \cellcolor{red} & & &\cellcolor{orange}&& &\cellcolor{yellow}&&&\cellcolor{green}&& &\cellcolor{blue}&&&\cellcolor{black}&&  & \cellcolor{red} & & &\cellcolor{orange}&& &\cellcolor{yellow}&&&\cellcolor{green}&& &\cellcolor{blue}&&&\cellcolor{black}&&  \      \hline     \end{tabular}          \end{landscape}          \end{document}      The whole table has 30 more rows but this is the minimum you need to understand the problem. There is one type of cell in the whole table that's just a single column and contains only a colour. Ideally, I want this to be half the size it's currently printing out as.


title: How to denote adjacent vertices?

text: ### Background I'm trying to write a rapport that relies on some rudimentary graph theory and as such I'd like to write a section explaining the basics of it. ### Trying to do I've run into a bit of a snag trying to adequately write out pairs of vertices that have an edge between them. Hopefully someone more knowledgeable in regards to TeX either knows of the command which I seek or of a way to create it: I mean to write vertices `u` and `v` (in math-mode) with a long line between them, approximately the distance of an em-dash. This line denotes an edge between the vertices. However I need to be able to also denote the lack of such an edge by being able to strike over said line (\not). Any and all help would be much appreciated! ### Tested I've tried               $u \not\textemdash v$      and               $u \not\textrm{---} v$     $u \not\textrm{\textemdash} v$      however neither works. The latter two are close but I'd need to be able to move the symbol generated by `\not` to the right by about half an em somehow.


title: entries in the toc from printindex

text: I want the entries in the `TOC` for the indices to align with the Chapter entries. I can do this with `\addcontents`. `\printindex` also puts an entry in the `TOC` but it is aligned with the section entries. So I want to:   1. change how `printindex` makes its entry into the `TOC` or    2. to eliminate `printindex` entry. MWE:               \documentclass{book}     \usepackage{multind}        % create the indices     \makeindex{names}                \makeindex{subject}     \newcommand{\Ndx}[1] { \index{names}{#1} }     % define the type of entry     \newcommand{\Sdx}[1] { \index{subject}{#1} }   % to the indices     \usepackage[headings]{fullpage}         % 8-1/2, 11 page with 1" margins     \usepackage{fancyhdr}     \pagestyle{fancy}     \begin{document}     \fancyhead{}     \fancyfoot{}     \renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}     \fancyhead[LE,RO]{\rightmark}     \fancyhead[RE,LO]{\thepage}     \tableofcontents        % put table of contents here          \chapter{\bf Logic, Plausibility, and Probability}     \label{Ch:Logic}     \section{Logical Arguments and Reasoning }     It is obvious that logical arguments are essential to the judicial system. The logic must be able to treat syllogisms\Sdx{syllogism} that range from deductive\Sdx{syllogism!deductive} to abductive\Sdx{syllogism!abductive}, that is from strong to weak syllogisms \Sdx{syllogism!weak}\Sdx{syllogism!strong} as illustrated in the table taken from Author \Ndx{Author}     \Ndx{Cohen}     \Sdx{Cohen on probability}     \clearpage     \addcontentsline{toc}{chapter}{Subject Index}     \printindex{subject}{Subject Index}     \addcontentsline{toc}{chapter}{Name Index}     \printindex{names}{Name Index}     \end{document}


title: Make a command start new line in a list if it is not currently at the end of another list

text: I am trying to typeset a structured proof as demonstrated by Leslie Lamport in his paper How to Write a 21st Century Proof. In particular, I am trying to typeset Figure 3 (shown below). ![enter image description here](http://i.stack.imgur.com/2ja5L.png) My code and the output is shown below.               \documentclass[12pt,letterpaper]{article}          \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{enumitem}          % LSP is short for Lamport Structured Proof     \newlist{lsp}{enumerate}{10}     \setlist[lsp]{label=\arabic*.}     \newcommand{\lspproof}{{\scshape Proof:\ \ }}     \newcommand{\lspqed}{Q.E.D.}          \newtheorem{corollary}{Corollary}          \begin{document}          \begin{corollary}     If $f'(x) > 0$ for all $x$ on an interval $I$,     then $f$ is increasing on $I$.     \end{corollary}          \begin{lsp}         \item It suffices to assume             \begin{lsp}             \item $a$ and $b$ are points in $I$             \item $a < b$             \end{lsp}         \lspproof By definition of an increasing function              \item There is some $x$ in $(a,b)$         with $\displaystyle f'(x) = \frac{f(b)-f(a)}{b-a}$.\\*         \lspproof By assumptions 1.1 and 1.2,         the hypothesis that $f$ is differentiable on $I$,         and the Mean Value Theorem.              \item $f'(x) > 0$ for all $x$ in $(a,b)$.\\*         \lspproof By the induction hypothesis of the corollary and assumption 1.1.              \item $\displaystyle \frac{f(b)-f(a)}{b-a} > 0$\\*         \lspproof By 2 and 3.              \item \lspqed\\*         \lspproof Assumption 1.2 implies $b - a > 0$,         so 4 implies $f(b) - f(a) > 0$,         which implies $f(b) > f(a)$.         By 1, this proves the corollary     \end{lsp}               \end{document}      ![enter image description here](http://i.stack.imgur.com/NNqNJ.png) While I am quite happy with the result, I find it a bit irritating that I have to manually tell LaTeX to start a new line using `\\*` before each `\lspproof`. **Questions:**   1. Is there a way to define `\lspproof` such that it will automatically start a new line when needed? Notice that I did not need to insert `\\*` before the "Proof:" in step 1 because the "Proof:" occurs after an enumerate environment.   2. Is there a way to slightly increase the vertical space between the "Proof." from `\lspproof` and the previous line?


title: Completely lost with BibTeX

text: I'm new to LaTeX, and have managed to transfer an essay I'd written in Word into LaTeX fairly satisfactorily, but I'm now trying to sort out the bibliography using BibTeX and I'm completely lost. I have a number of questions. Should I be using BibTeX or BibLaTeX? What do I need to put into my LaTeX document and where (i.e. in the preamble or where the bibliography should go)? I want to use a special bibliography style called `lsalike`. There are two files, one `.bst` and one `.sty` \- do I need both of these or just the `.bst` and where do I put them? (I'm using OS X/a MacBook and TeXShop.) How do I use this style in LaTeX? I believe the style will have small caps for the authors' names (though I can't confirm as I've not got it working yet!) - how do I turn this feature off? How do I get special symbols in BibTeX entries? (A number of the authors have 'foreign' characters in their names, as do some of the titles.) Sorry for so many questions and ones that have no doubt been answered before, but I could really do with some help!


title: Hidden reference to equation

text: How to make a hidden reference to an equation, such that `\mathtoolsset{showonlyrefs=true}` is overridden (assuming it is active)? Alternatively, how to switch off `showonlyrefs` temporarily (regardless of whether it be set or not)?


title: Highlight First Occurrence of a Particular Word

text: I'm writing a scientific paper, and in this paper, I present a series of new terms. The first time a new term is presented, I would like LaTeX to automatically highlight this - e.g. by using italics or small caps. Does such a package exist? Or if not, do any of you know an alternative way to accomplish the same?


title: Copy right of style files, e.g. Cambridge University Press's

text: Just started using LaTeX so pardon my ignorance here. I was wondering whether style files created for example by Cambridge University Press are free to be used for commercial purposes (a book, respectively) or whether you need a special permission of the publisher? Any help is very much appreciated, preferable with link to the source that provides this information :-)


title: skip a line aside a matrix

text: Well, This is what I tried to compile If you compile it the sequence of number will be next to the matrix, but I want it to be in other line. Do you know how to do that space? Thank you so much in advance.               \documentclass[]{book}     \usepackage{amssymb}          \begin{document}     \[     \beta= \left[ \begin{array}{c}        \beta_0      \\        \beta_1      \\        \vdots  \\        \beta_k        \end{array}         \right],     \textbf{\epsilon}= \left[ \begin{array}{c}                 \epsilon_1      \\                 \epsilon_2      \\                 \vdots  \\                 \epsilon_n\\                \end{array}         \right]         \]              1234          \end{document}


title: tikzpicture in minipage

text: Can I set the exact width to a tikzpicture? I thought so, with "width", but I tried this:               \colorbox{gray}{     \begin{minipage}{.33\textwidth}     adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk adfjk      \colorbox{yellow}{     \begin{tikzpicture}     \begin{axis}[width=\textwidth,ymax=3.5, ymin=-3.5]       \addplot[blue, domain=-5.8:5.8,samples=30] {sin((180/pi)*x)};     % ....     \end{axis}     \end{tikzpicture}     }     \end{minipage}     }      (-- sorry: I cannot post images--) but the yellow rectangle is smaller than \textwidth. I set it to \textwidth+1.3cm (seems to be a fixed margin) and does more or less what I expect, but is there a cleaner solution? Thanks


title: Macro for writing DOI with optional link text

text: The `doi` package has a neat `\doi` command, that transforms a doi string into `\href{http://dx.doi.org/<the doi>}{doi:<the doi>}`. The `uri` package has something similar with the help of the `url` package. I would like to have an extended version of that command that takes an arbitrary link text as an optional argument, like `\mydoi[Paper title]{doi}`. I tried that myself with the help of this, but the weird characters in DOIs destroy that. Take, e.g., the DOI `10.1002/(SICI)1097-0037(199712)30:4<263::AID- NET4>3.0.CO;2-H`. I checked manually that `\href{http://dx.doi.org/10.1002/(SICI)1097-0037(199712)30:4<263::AID- NET4>3.0.CO;2-H}{doi:10.1002/(SICI)1097-0037(199712)30:4\textless263::AID- NET4\textgreater3.0.CO;2-H}` works, I just want a macro that produces that sequence from, say `\mydoi{10.1002/(SICI)1097-0037(199712)30:4<263::AID- NET4>3.0.CO;2-H}`, or `\mydoi[Title]{10.1002/(SICI)1097-0037(199712)30:4<263::AID-NET4>3.0.CO;2-H}`.


title: How to create a mathematics LaTeX document

text: Ok, this is a complete newbie question: How does one create a methematics paper using LaTeX for a PDF? Specifically, I need help knowing:   * What to write the document in   * How to render the Latex   * How to convert into a PDF file Also, how do I get the "amsmath" add-on? My previous experience: I have written several papers using writelatex.com and sharelatex.com which allow collaboration on papers, and automatically render the latex + create PDF's of the finished product. I have a rough idea of how mathematical papers tend to be structured because of reading so many of them, but I have never published myself. Also, if relevant: I have Adobe Reader and use Windows on my computer. Optimally, is there software I could download for free that would give me these capabilities? Thanks in advance!


title: Adding arrows with values over an expression

text: I'm trying to add arrows to math expressions (especially within limits) to note that there's a value assigned to certain term when solving a limit. I've come across the cancel package and its command \cancelto{}{} but I have 2 problems with it: 1\. It strikes through the term like it's canceling it (obviously) 2\. It only goes upwards (right upwards but the right part doesn't bother me), whereas I might need it to go downwards when I'm showing a tendency in the denominator of a fraction. Searching here I found a custom command that sort of does the job (I modified it a little), and got it going, sadly it works half the time. The other half it just disarranges all the baselines of the other elements in te equation. I'll leave you the code of the commands (which again, is not mine to credit for) and an error that I'm having in hope someone can help me. I'm still learning Tikz so I'm unable to solve it myself although I suspect that there lies the answer to my problem. The code modified by me:               \usetikzlibrary{calc}          \newcommand*\canc[1]{%       \mathchoice         {\scriptstyle#1}         {\scriptstyle#1}         {\scriptscriptstyle#1}         {\scriptscriptstyle#1}     }          \newcommand*\dtendto[2][0]{%       \kern9pt%       \begin{tikzpicture}[baseline=(current bounding box.center).anchor=east]         \node[anchor=east] (a) {$#2$};         \draw[->, color = red] ($(a.south)$) -- ($(a.south)-(-4pt,8pt)$) node         at ($(a.south)-(-8pt,12pt)$) {$\canc{#1}$};     \end{tikzpicture}     }               \newcommand*\utendto[2][0]{%       \kern9pt%       \begin{tikzpicture}[baseline=(current bounding box.south).anchor=east]         \node[anchor=east] (a) {$#2$};         \draw[->, color = red] ($(a.north)$) -- ($(a.north)+(4pt,8pt)$) node         at ($(a.north)+(8pt,12pt)$) {$\canc{#1}$};     \end{tikzpicture}     }      The part where I'm having trouble (I've earlier parts in which this worked but surely a correct code would still work on those).               \lim_{x\to\infty} \frac{\bcancel{x^5}\cdot(\utendto[2]{2}     -\utendto[0]{\frac{3}{x^2}} +     \utendto[0]{\frac{2}{x^4}})}{\bcancel{x^5}\cdot\left(4 + \frac{5}{x}     -\frac{100}{x^5}\right)}      And a snapshot of how it displays, notice that what I'd like to happen is that the arrows are added on top, as if the equation didn't even know they are there. Now it seems it is responding to what I add trying to center the + and - signs (even the parenthesis if I use \left( and \right) ) distorting a normal look. ![ErrorImage](http://i.stack.imgur.com/rCo0a.png) And here's a photoshopped version of what i'd like it to look like: ![ExpectedImage](http://i.stack.imgur.com/KTLCE.png) Basically what I want is the equation to ignore the arrows and to be typeset just as if they weren't there (except of course for the vertical spacing not to be superposed with other lines or equations on top or bottom). I've managed to create a new command called \dtendto[]{} that does the same except that the arrow goes southeast instead of northeast but I think the solution is the same for both so as not to make the post longer I ommited it. Thanks in advance,


title: Alternative eqref command (generating a footnote)

text: Sometimes I think it is helpful to have a visual reference to a cited equation, besides its reference number. Let me give a (manual) example of what I'm talking about:               \begin{document}     (...)          \begin{equation}\label{1.1}       y=x     \end{equation}          <several pages later>          ... in equation \eqref{1.1}\footnote{y=x} ...     \end{document}      I'd like to create a command that makes this process automatically. Something like               \newcommand{\foo}[1]{\eqref{#1}\footnote{eqcont}}      where the 'eqcont' part is a call to the contents of the equation environment. However, I can't figure out a code to do this. Any suggestions?


title: Drawing a circuit structure in LaTeX

text: I want to create the following structure in `LaTeX`: ![image](http://i.stack.imgur.com/KoBxY.png) Unfortunately I couldn't find a similar example in the `pgf manual` using the same symbols. An answer just showing basically how to produce a structure like the image shows, meaning a bit of code from which I can deduce the rest, would be fine. **EDIT:** After taking a look at the `circuitikz` documentation, I came to the following result:               \documentclass{article}     \usepackage{circuitikz}          \begin{document}          \begin{tikzpicture}     \node [ocirc, label=left:1]       (1) at (0,3) {};     \node [ocirc, label=left:0]       (0) at (0,2) {};     \node [ocirc, label=left:{$x_1$}] (x) at (0,1) {};     \node [ocirc, label=left:{$\overline{x_1}$}] (nx) at (0,0) {};     \node [ocirc, label=right:{$y$}] (y) at (5,1.5) {};          \node [circ] (c1) at (4,2) {};     \node [circ] (c2) at (4,1) {};     \node [circ] (c3) at (4,1.5) {};          \draw (c3) to (y);     \draw (1) to[cspst] (4,3);     \draw (0) to[cspst] (c1);     \draw (x) to[cspst] (c2);     \draw (nx)to[cspst] (4,0);     \draw (4,3) to (4,0);     \end{tikzpicture}          \end{document}      Resulting in: ![result](http://i.stack.imgur.com/UvdoI.png) Now my more precise questions are:   * How can I draw lines with multiple `cspst` at a specific place?    * How to avoid the line begining in the `ocirc`?   * Is there a simpler way without using coordinates?


title: How to force LaTeX to print a table in an even-numbered page

text: Is there a way that I can force a table to be printed in an even-numbered page? One thing that comes to mind is to print a blank page before it if the table happens to be in an odd page but this makes the document very unprofessional and discontinuous.               \documentclass{article}     \usepackage{lipsum}     \begin{document}     \pagestyle{plain}          \lipsum[1-10]          \begin{center}         \begin{tabular}{|c|c|}         \hline test11 &  test12\\          \hline  test21&  test22\\          \hline          \end{tabular}      \end{center}          \end{document}


title: Generating .toc file without generating a ToC

text: **Problem** : I want to generate a `.toc` file without the table of contents actually being displayed anywhere in the text. **Background** : I want a short ToC at the beginning of my text, using `shorttoc`. Then, using `titletoc`, I want a detailed in chapter ToC at the beginning of each chapter. For these detailed in chapter ToC's I need `\setcounter{tocdepth}{4}` in order to have the detailed information being written to the `.toc`. Now, `shorttoc` doesn't create a `.toc` file on its own but you have to place `\tableofcontents` somewhere after `\shorttoc`. So just leaving `\tableofcontents` out doesn't solve the problem. **Possible solution** : Run (PDF)LaTeX first with `\tableofcontents` so that a `.toc` file is generated. Then comment it out and (PDF)LaTeX again. That works of course but it is not at all an elegant way of solving the problem. I suppose there should be some way of creating `.toc` without actually creating a ToC with `\tableofcontents`. Here is a MWE. It is not strictly speaking minimal, but the additional stuff shall make clear what the overall idea of the document is.               \documentclass{book}          \usepackage{titletoc,titlesec}     \usepackage{shorttoc}     \usepackage{lipsum}          \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{4}          \titlecontents{partsection}[2.3em]     {} {\contentslabel{2.3em}} {} {\titlerule*[1pc]{.}\contentspage}     \titlecontents{partsubsection}[5.5em]     {} {\contentslabel{3.2em}} {} {\titlerule*[1pc]{.}\contentspage}     \titlecontents{partsubsubsection}[9.6em]     {} {\contentslabel{4.1em}} {} {\titlerule*[1pc]{.}\contentspage}     \titlecontents{partparagraph}[8.5em]     {} {\contentslabel{0em}} {} {\titlerule*[1pc]{.}\contentspage}          \begin{document}          \frontmatter          \chapter*{Preface}     \addcontentsline{toc}{chapter}{Preface}     \lipsum[1]          \cleardoublepage          \shorttoc{Contents}{1}          \cleardoublepage          \tableofcontents          \mainmatter          \chapter{A chapter}     \startcontents[chapters]     \printcontents[chapters]{part}{1}{}     \section{Section}     \lipsum[1]     \subsection{A subsection}     \lipsum[3]     \subsection{A second subsection}     \subsubsection{SubSubsection}     \paragraph{Paragraph}     \lipsum[4]     \section{Section 2}     \lipsum     \chapter{Second chapter}     \startcontents[chapters]     \printcontents[chapters]{part}{1}{}     \section{Section}     \lipsum[2]     \section{Another section}     \lipsum     \end{document}      **PS** : A solution which does not require major changes of the current configuration would be preffered (I mean I would rather not like to use different packages to get the overall output I get with the above code).


title: Add templates to TeXworks

text: Using TeXworks 0.4.3 r.857 (MiKTeX 2.9) on Windows 7 I am trying to add an arbitrary folder containing a template so that it can be seen from TeXworks's `New from Template...` option. I can't figure out how to inform TeXworks as to where it should look. I understand I can add templates next to the built in ones that appear under `C:\Users\<user>\AppData\Local\MiKTeX\2.9\TeXworks\0.4\templates`. There are multiple files that go with this template, including a .sty class that I would like to keep in one place accessible to the user (probably through a SVN repo), so I don't like the idea of putting the templates in that hidden directory. I can tell MiKTeX to use an arbitrary root for packages, and would like to do the same for TeXworks and templates.


title: Question about seemingly random indentations after compiling

text: So I have been working on a large, 360+ page document, and after working on a few pages of tables, the tables have begun to indent with no apparent reason. Now I don't consider myself a nooby here, but I can't seem to find the reason behind this error. I always compile each page independently and then with the large file to ensure consistency. The tables looked great until today when I added 3 more pages of tables. To check my table code I compiled it separately from the large document, which came out perfect. I fear no amount of MWE will suffice to help with this problem. I have already suppressed indent globally. My question then is are there some well known mistakes in code that offset the typeset boxes after compilation? Is there an error check I can run? Is there some kind of delimiter I can use to isolate the typesetting on a particular page? Here are a couple images which show the tables compiled independently, and then in the large document. ![Compiled Independently](http://i.stack.imgur.com/QVIxU.png) ![Compiled in Large Document](http://i.stack.imgur.com/TdVV4.png) EDIT: So here is a MWE of the table working independently. In the photo above compiled independently I compiled it with my full preamble. This MWE doesn't include all the options that are seen in the full document.               \documentclass[letterpaper,twoside,openright]{memoir}          \usepackage[bmargin=1in]{geometry}          \usepackage{color, colortbl, longtable}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{booktabs}     \usepackage{multirow}     \usepackage{multicol}          \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}          \usepackage[framemethod=tikz]{mdframed}     \newmdenv[%         linecolor=black,         outerlinewidth=1pt         skipabove=0.5\baselineskip,         skipbelow=0.5\baselineskip,     ]{ansbox}          \newcounter{anskeycount}     \setcounter{anskeycount}{0}     \newcommand{\akc}{\small\stepcounter{anskeycount}\theanskeycount}          \begin{document}          \newpage     % \newgeometry{hmargin=.5in}     \begin{ansbox}[         userdefinedwidth=\textwidth,         backgroundcolor=black!20]              \centering \Huge          Lower Level ISEE -- Answer Key     \end{ansbox}               \setcounter{anskeycount}{0}     \noindent\begin{tabular}{r|*{17}{C{2.9mm}|}}           \hline     \rowcolor{black!15}     \multicolumn{1}{|r|}{\textbf{Section One}}                          &        \multicolumn{17}{c|}{\textbf{Part One - Synonyms}} \\      % \cline{1-18}     \cline{1-18}     Question \#     &        \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &       \akc \\     \cline{2-18}     Correct Answer  &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A \\     \cline{2-18}     Your Answer     & & & & & & & & & & & & & & & & &   \\[5pt]     \hline     \rowcolor{black!15}     \multicolumn{1}{|r|}{\textbf{Section One}}                                      &        \multicolumn{17}{c|}{\textbf{Part Two - Sentence Completions}} \\      \cline{1-18}     Question \#     &        \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &      \akc &       \akc \\     \cline{2-18}     Correct Answer  &        A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A &      A \\     \cline{2-18}     Your Answer     & & & & & & & & & & & & & & & & &   \\[5pt]     \hline     \multirow{2}{*}{\textbf{Scores}}                    &        \multicolumn{4}{c|}{\cellcolor{black!15}\textbf{Correct}}           &        \multicolumn{4}{c|}{\cellcolor{black!15}\textbf{Total}}             &        \multicolumn{3}{c}{}            &        \multicolumn{4}{c}{}    \\     \cline{2-9}                             &        \multicolumn{4}{c|}{}   &        \multicolumn{4}{c|}{34} &        \multicolumn{3}{c}{}    &        \multicolumn{4}{c}{}    \\     \cline{2-9}     \end{tabular}          \end{document}


title: What is the proper use of \@ (i.e., backslash-at)?

text: In this answer, `\@` is used **after** a period and before an `\xspace`, presumably to indicate that the **preceding** period (in "etc.") was not sentence-final. In these tips, `\@` is used **before** a period and after capital letters, to indicate that the preceding capital letters **are** sentence final. Since `\@` is rather difficult to search for online, I thought I'd try to ask here: what exactly does `\@` do, and how do you use it properly/consistently? For instance, how should you input the following farcical sentence? > Languages like JS, HTML, etc. were not used by King Henry III. **EDIT** : I'm accepting Barbara's answer below as it (and the comments on it) indicate the initial intent of `\@`: "the period which _follows_ is sentence- final". Its counterpart is `\ ` (slash-space), which says "the period which _precedes_ is sentence-medial". Egreg's answer explains in far more detail exactly how `\@` and `\spacefactor` work to _cause_ the effects seen by `\@` and `\ ` after lower- and upper-case letters and punctuation. Both are very helpful answers. Two correct answers to my made-up sentence above is               Languages like JS, HTML, etc.\ were not used by King Henry III\@.     Languages like JS, HTML, etc.\@ were not used by King Henry III\@.      The former is arguably "better style", while the latter demonstrably produces the correct result even if it seems less consistent about placement of `\@` versus periods. And a safe but slightly redundant answer blindly adds `\@` before every comma:               Languages like JS\@, HTML\@, etc.\ were not used by King Henry III\@.      This last one is amenable to macro-izing: `\def\acronym#1{\textbf{#1}\@\xspace}` (or whatever style you'd prefer), where the `\xspace` disappears if the next character is punctuation, and the `\@` ensures that subsequent punctuation thinks it follows a lowercase word and not an uppercase initial.


title: Hide "real" font name in PDF

text: Does anyone know how to change the font name listed in the "Document Properties" window of the PDF reader? For example, instead of `A030-Reg-8r`, which is an Arial clone, I'd like to have written `Arial`. I know that this is a bad idea but these are the requirements of my university. Here is a screenshot to illustrate what I'm talking about. ![screenshot](http://i.stack.imgur.com/NTgkT.jpg)


title: Prevent PGFplots from using 10^notation on y-axis

text: I want the y-axis labels to be labeled 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10,000, … PGFplots insists on keeping the `10^`-notation in the following minimal example.               \documentclass[border=5mm]{article}     \usepackage{pgfplots}     \begin{document}     \begin{tikzpicture}     \begin{loglogaxis}[y tick label style={/pgf/number format/fixed},     grid=both,     major grid style={black!50},xlabel={x},ylabel={y}]          \addplot[only marks, mark size=4pt,mark=triangle,fill,black] coordinates{     (0.000001, 13.5e3)     (0.0000024, 11.975e3)     (0.004, 4340)     (1 , 3840)     (10  , 2550)     (100 ,  2357)     (257, 2290)     (315, 2280)};          \end{loglogaxis}     \end{tikzpicture}     \end{document}


title: Why is TeXnicCenter breaking down with arara for smallest errors?

text: In the following MWE I put an extra space in front of `tikzpicture`. When running this with LuaLaTeX, I get 18 errors (not really part of the question, but why is that so sensitive, does matter at all and has such bad error messages???). When running it with `arara`, I get a complete breakdown of the process. I have to stop the two (why two?) `lualatex.exe` processes in my Windows Task Manager. This is really annoying. Is there something in `arara` or in TeXnicCenter or in LuaLaTeX?               % arara: lualatex: { shell: yes }          \documentclass[convert]{standalone}     \usepackage{tikz}          \begin{document}          \begin{ tikzpicture}             \draw (0,0) -- (1,1);     \end{tikzpicture}          \end{document}      * * * **Edit** when I stop the process of the first lualatex.exe, the building process continues showing me the one actual error. Then it starts the run and stops as before. When stopping the second process, `arara` writes `? FAILURE` and TeXnicCenter `Building process canceled by user.`


title: Pandoc caption for code blocks

text: Consider the following code block:               ~~~~{.Python .numberLines caption="test"}     def myfunction(var):       """ Oh how awesome this is. """       pass     ~~~~      The code gets formatted correctly in the Pdf, but the caption does not appear. I also want to reference to the code block - but how? Can somebody give me a working example?


title: Use of \hiderowcolors & \showrowcolors within LyX

text: Loading the xcolor package with the `[table]` option provides the command(s) `\rowcolors`(`*`) for alternate table row coloring. Any attempt, however, to use `\hiderowcolors` and `\showrowcolors` inside table rows within from LyX -- both in- and outisde a LyX table-float -- results in failing to compile a PDF. The error message is: `Undefined control sequence`. It seems that there is no discussion/question upon this on either LyX-Users' mailing list or tex.stackexchange itself. It certainly is preferable to resolve this in a clean way, i.e. with a correct usage of the above mentioned commands.


title: mathpazo and pxfonts: equal sign and \neq look different

text: consider the following (minimal) example: `               \documentclass{article}     \usepackage[T1]{fontenc}     \usepackage[sc,osf]{mathpazo}     \usepackage{pxfonts}     \begin{document}     $=$ $\ne$     \end{document}      ` Is there any way I can make the "not equal" sign look exactly like a struck equal sign? Currently it does not.


title: Table width error with multirow and longtable with consecutive `multicolumn`s?

text: I have this `longtable` table, where I want to locate two `multicolumn`s after each other. When I compile with the second `multicolumn` commented out, everything is fine (pic 1). But with two consecutive `multicolumn`s the width of the table is completely changed (pic 2). What's happening? My question might be a duplicate of Multicolumn width in longtable, but I don't see how the solution can be used in my problem... MWE:               \documentclass{article}          \usepackage[utf8]{inputenc}     \usepackage{fouriernc}     \usepackage{tabularx,booktabs,parskip}     \usepackage[text={9in,6in},showframe,landscape]{geometry}     \usepackage{setspace,url,multirow,longtable,array}     \usepackage{enumitem}     \setlist{nolistsep}     \renewcommand\labelitemi{--}     \newcolumntype{P}[1]{>{\raggedright}p{\dimexpr#1\textwidth-2\tabcolsep}}          \begin{document}     \begin{longtable}{P{0.05} P{0.05} P{0.3} P{0.3} P{0.15} P{0.15}}         \toprule         \multicolumn{2}{l}{Tema: } & \multicolumn{4}{l}{Geometri} \tabularnewline         % \multicolumn{2}{l}{Kompetansemål i K06: } & \multicolumn{4}{l}{Some text} \tabularnewline         \midrule         Uke & Time & Læringsmål for timen & Arbeidsmetoder & Uformell vurdering & Kjerneord/ begreper \tabularnewline          \midrule         \endfirsthead         %         \multicolumn{3}{c}%         {{\bfseries \tablename\ \thetable{} -- fortsatt fra forrige side}} \tabularnewline         \midrule Uke & Time & Læringsmål for timen & Arbeidsmetoder & Uformell vurdering & Kjerneord/begreper \tabularnewline \midrule         \endhead         %         \midrule \multicolumn{3}{|r|}{{Fortsetter på neste side}} \tabularnewline \midrule         \endfoot         %         \bottomrule         \endlastfoot         46 & 1 & Some stuff & Some more stuff & Utsjekk. & Katet, hypotenus, kvadrat         \tabularnewline         \bottomrule     \end{longtable}     \end{document}      Producing ![enter image description here](http://i.stack.imgur.com/IUWge.png) While without commenting out the second `multicolumn` the table is way outside the page borders: ![enter image description here](http://i.stack.imgur.com/PTr7W.png)


title: Bug in swedish-babel?

text: When I use the Swedish babel package, the header on the even sides of the table of contents is written "INNEHåLL" (note the lower-case å which should be an Å). If I use the English version, it correctly says CONTENTS. Is this a bug? I don't have a minimal example for this as it requires at least a page worth of chapters for the contents but here is a screenshot:![enter image description here](http://i.stack.imgur.com/q7aN7.png) **Edit:** If I use the book class I can get an empty page with this behavior. I managed to strip down all packages I'm using and it appears that the issue is caused by the fontspec package: \usepackage{fontspec,xltxtra,xunicode} **Edit 2:** I changed now to polyglossia. Here is my current preamble. The commented packages are probably the ones giving me trouble:               %!TEX TS-program = XeLaTeX     %!TEX encoding = UTF-8 Unicode          \documentclass[12pt]{book}     \usepackage{geometry}                     \geometry{a4paper}          %\usepackage{polyglossia}     \usepackage{fancyhdr}          \usepackage{enumerate}     \usepackage{amssymb}     \usepackage{unicode-math}          \usepackage{array}     \usepackage{rotating}          \usepackage{hyperref}          %\usepackage{fontspec}     \defaultfontfeatures{Mapping=tex-text}          \setmainfont{PT Sans}     \setmonofont[AutoFakeBold=1.4, AutoFakeSlant=0.2]{Inconsolata}          \usepackage[parfill]{parskip}          \usepackage{graphicx}     \DeclareGraphicsExtensions{.pdf,.png,.jpg}     \graphicspath{{ill/}}          \usepackage{listingsutf8}      **Edit 3** My solution so far was the following (can't self-answer yet): 1) Changed `babel` to `polyglossia`. 2) Deleted `fontspec` (included by `polyglossia`) and `amssymb` (incompatible with `polyglossia`). 3) Changed `listingsutf8` to `listings` and now using `unicode-math`


title: Get \ref for equations working like \cite for contiguous references

text: When referencing a list of equations like `see Eq.12, 13, 14 and 15` the `\cite` command behaviour, which allows a single list of references, should be preferred I think. Is there something equivalent for the `\ref` command that would allow `\ref{eq1,eq2,eq3}`?


title: Spurious horizontal space in the aligned environment

text: If you compile what's below, you'll observe a slight horizontal misalignment between the equations of `aligned` versus `align`. Is there a way to avoid that?               \documentclass[fleqn]{book}     \usepackage{amsmath}     \begin{document}     text     \begin{equation}     \begin{aligned}     &A\\     &B     \end{aligned}     \end{equation}     text     \begin{align}     &A\\     &B     \end{align}     text     \end{document}


title: tcolorbox Spanning Two Columns in {paracol} Environment

text: The paracol environment allows figures to span two columns by using an asterisk in the figure's environment declaration: `\begin{figure*} ... \end{figure*}`. I'm not familiar with the guts of why that works, and I was curious to know if there's something analogous for an environment derived from tcolorbox (like `\newtcolorbox{NewBox}[1][!htbp]{...float=#1}`). That is, in this example, can I get a NewBox that spans both paracol columns the way I wrongly assumed `\begin{NewBox*} ... \end{NewBox*}` would. PS The tag below is "parcolumns" because I don't have a high enough reputation to create the tag 'paracol' (in reference to this CTAN package: http://www.ctan.org/pkg/paracol)