title: Sharing parameters between a command and an environment

text: (This question is related to Using \total of totcount package in section title) I'd like to keep track of the papers I review, and I have written a code (MWE shown below). The code keeps the count of papers from different journals and then also calculates total and pending journal and conference papers, as shown in the screenshot after the code.               \documentclass[11pt,landscape]{article}          \usepackage[margin=.5in,top=0.75in]{geometry}     \usepackage{booktabs}     \usepackage[table,dvipsnames]{xcolor}     \definecolor{AleeRed}{rgb}{0.5,0,0}     \usepackage[colorlinks=true,                 linkcolor=AleeRed,                 pdfborder={0 0 0}]{hyperref}     \usepackage{etoolbox}          \usepackage{totcount}     \newtotcounter{TPWRD}\newtotcounter{TPWRDpending}     \newtotcounter{TPWRS}\newtotcounter{TPWRSpending}     \newtotcounter{APEC}\newtotcounter{APECpending}          \newcommand{\duedate}[2]{\stepcounter{#2}\color{magenta} Due: #1}          \let\oldsubsection\subsection     \renewcommand{\subsection}[3]{%         \oldsubsection{#1%         ~\texorpdfstring{(\protect\total{#2})}{}%         \ifnumcomp{\totvalue{#3}}{=}{0}%             {}%             {~\texorpdfstring{\fbox{Pending:~\protect\total{#3}}}{}}}%         }          \newcounter{reversedummy}     \newcounter{reversecounter}     \newenvironment{articlelist}[1]{%  Don't show counter for the first row, which is the title row             \setcounter{reversedummy}{0}             \begin{center}\small             \rowcolors{2}{white}{gray!35}             \begin{tabular}{%                 c<{\ifnumcomp{\value{reversedummy}}{=}{0}%          Show decreasing counter                     {}%                                             Don't show counter for the title row                     %                                               Calculate the reverse counter as total-i+1                     {\defcounter{reversecounter}{\totvalue{#1}-\value{reversedummy}+1}\arabic{reversecounter}}%                     \stepcounter{#1}\stepcounter{reversedummy}}%    Increment total papers, i                 p{3.8cm} p{12cm} m{3.5cm} p{3.4cm}}             \toprule             No & ID & Title & My Decision (Date) & Decision (Date) \\             \midrule         }         {   \bottomrule             \end{tabular}             \end{center}         }          \begin{document}          % Prepare counters     \newcounter{JournalsTotal}\defcounter{JournalsTotal}{\totvalue{TPWRD} + \totvalue{TPWRS}}     \newcounter{JPendingsTotal}\defcounter{JPendingsTotal}{\totvalue{TPWRDpending} + \totvalue{TPWRSpending}}     \newcounter{ConferencesTotal}\defcounter{ConferencesTotal}{\totvalue{APEC}}     \newcounter{CPendingsTotal}\defcounter{CPendingsTotal}{\totvalue{APECpending}}     \newcounter{PapersTotal}\defcounter{PapersTotal}{\value{JournalsTotal} + \value{ConferencesTotal}}     \newcounter{PendingsTotal}\defcounter{PendingsTotal}{\value{JPendingsTotal} + \value{CPendingsTotal}}          \begin{center}     \textbf{\Large Reviewed Papers}\\     Last Updated \today; Last Count \thePapersTotal; Pending \thePendingsTotal.      \end{center}               \tableofcontents          \section{Journals (\theJournalsTotal)}     \subsection{IEEE Transactions on Power Delivery}{TPWRD}{TPWRDpending}     \begin{articlelist}{TPWRD}         &         TPWRD-000-2011 &         Pizza delivery vs. power delivery: top 10 differences you always missed &         \duedate{3-May-2012}{TPWRDpending} &         \\         &         TPWRD-001-2011.R1 &         Recent advances in the IEEE website &         Reject (24-Mar-2012) &         Reject (22-Apr-2012)         \\     \end{articlelist}          \subsection{IEEE Transactions on Power Systems}{TPWRS}{TPWRSpending}     \begin{articlelist}{TPWRS}         &         TPWRS-001-2012 &         How to have your own DYI power system &         \duedate{18-May-2012}{TPWRSpending} &         \\         &         TPWRS-002-2011.R1 &         How power corrupts any system, including power system itself &         Revise (15-Mar-2012) &         Revise (12-Apr-2012)         \\     \end{articlelist}               \section{Conferences (\theConferencesTotal)}     \subsection{APEC 2012}{APEC}{APECpending}     \begin{articlelist}{APEC}         &         APEC-000 &         Divide and conquer: How to produce two conferences out of one &         Accept (23-Aug-2011) &         \\     \end{articlelist}          \addtocounter{TPWRD}{-1}     \addtocounter{TPWRS}{-1}     \addtocounter{APEC}{-1}          \end{document}      ![Screenshot](http://i.stack.imgur.com/ftToe.png) The code does what I need it to do, but there are two things I don't like about my code:   * I have to manually include the "pending" counter when I call `\duedate`.   * I have to manually decrement the counters at the very end of the code. Perhaps I can use `\NewDocumentEnvironment` and include `\addtocounter{#1}{-1}` in the end part of environment definition to solve the second problem. But I don't know how I can solve the first. The "pending" counter information is already passed to `\begin{articlelist}`. Is there any way to modify `\duedate` so it can use the parameters of `\begin{articlelist}`? I also welcome any suggestions for improving the code.


title: \frenchspacing not setting the space factor codes correctly?

text: When I type `\showthe\frenchspacing`, I get the following output:               > \frenchspacing=macro:     ->\sfcode `\.1006\sfcode `\?1005\sfcode `\!1004\sfcode `\:1003\sfcode `\;1002\sfcode `\,1001 . Shouldn't all of those numbers be exactly 1000? I've also checked each of the space factor codes individually with `showthe\sfcode.` etc. and gotten the same incorrect values. When `\frenchspacing` is not in effect, the six space factor codes are exactly correct: 3000 for `.`, `?`, and `!`; 2000 for `:`; 1500 for `;`; and 1250 for `,`. I'm using pdfTeX, Version 3.1415926-1.40.9 (MiKTeX 2.7) (preloaded format=latex 2010.12.14).


title: How to make really wide tables narrower

text: Is there a way to fix extremely wide tables? I have the following table:               \begin{tabular}{lllll}                 \toprule                     &  Manual Tests & Randoop 2.5 Minutes With GUI Code &  Randoop 2.5 Minutes Without GUI Code &  Randoop 5 Minutes Without GUI Code \\ \midrule         \% Covered Instructions &  \textbf{82.40\%} &  21.25\% &  21.30\% &  \textbf{22.10\%} \\ \bottomrule         \end{tabular}      And it looks like so: ![look](http://i.stack.imgur.com/4UbM2.png) Is there a way to make the cells slimmer? If relevant I am using `scrreprt`.


title: Modern CV usage problem in latex

text: I am using the ModernCV class for creating a resumé in LaTeX. I found three styles provided by Miktex for this purpose. My question is: how is the section header created in the document? All I see is a colored box followed by the given section text, but I can't find anything in the class or style regarding the above colored box. I found the below line in the file `moderncv.cls` but it doesn't have any information about colored box.               % makes a cv section     % usage: \section{<title>}     \newcommand*{\section}[1]{}     % starred variant, which is identical but defined to allow its use (e.g. for natbib compatibility, who uses \section*{} for the bibliography header)     \RequirePackage{suffix}     \AtBeginDocument{\WithSuffix\newcommand\section*{\section}}


title: Minipage make different space between tables

text: I have the following problem. I use a minipage to show two table next to each other. As you can see in the figure the first two rows of the tables are okay, but the thrid has a problem with the distance. So what do I wrong with the code?               \begin{table}[!h]     \begin{minipage}[b]{0.45\linewidth}     \centering     \begin{tabular}{|c|p{2cm}|p{2.5cm}|}     \hline Algorithm & Avg. Error & Avg. Adjusted Error \\     \hline KNN & x & x \\     \hline WKNN & x & x \\     \hline MAP & x & x \\     \hline MMSE & x & x \\     \hline      \end{tabular}     \captionof{table}{Table gives an overview about the average positioning errors for each algorithm used in the first test.}     \label{tab:overallerror}     \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.45\linewidth}     \centering     \begin{tabular}{|c|p{2cm}|p{1.5cm}|}     \hline Floor &~\# Training samples &~\# Test samples \\      \hline  0 & 6 & 6 \\      \hline  1 & 6 & 6 \\      \hline  2 & 7 & 6 \\      \hline  3 & 7 & 6 \\      \hline  4 & 7 & 6 \\      \hline  5 & 8 & 6 \\      \hline  6 & 4 & 4 \\      \hline      \end{tabular}      \captionof{table}{Overview about recorded training and test samples at each floor.}     \label{tab:testtrainingsamples}     \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.45\linewidth}     \centering     \begin{tabular}{|c|p{2cm}|p{2.5cm}|}     \hline Algorithm & Avg. Error & Avg. Adjusted Error \\     \hline KNN & x & x \\     \hline WKNN & x & x \\     \hline MAP & x & x \\     \hline MMSE & x & x \\     \hline      \end{tabular}     \captionof{table}{Table gives an overview about the average positioning errors for each algorithm used in the second test.}     \label{tab:overallerror_second}     \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.45\linewidth}     \centering     \begin{tabular}{|c|p{2cm}|p{1.5cm}|}     \hline Floor &~\# Training samples &~\# Test samples \\      \hline 0 & 19 & 7 \\      \hline 1 & 4 & 3 \\      \hline 2 & 4 & 3 \\      \hline 3 & 4 & 3 \\      \hline 4 & 4 & 3 \\      \hline 5 & 4 & 3 \\      \hline 6 & 4 & 2 \\      \hline      \end{tabular}      \captionof{table}{Table shows the number of training and test data recorded for each floor. }     \label{tab:dataovereachfloor_secondrun}     \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.45\linewidth}     \centering     \begin{tabular}{|c|p{2cm}|p{2.5cm}|}     \hline Algorithm & Avg. Error & Avg. Adjusted Error \\     \hline KNN & x & x \\     \hline WKNN & x & x \\     \hline MAP & x & x \\     \hline MMSE & x & x \\     \hline      \end{tabular}     \captionof{table}{Table gives an overview about the average positioning errors for each algorithm used in the second test.}     \label{tab:overallerror_third}     \end{minipage}     \hspace{0.5cm}     \begin{minipage}[b]{0.45\linewidth}     \centering     \begin{tabular}{|c|p{2cm}|p{1.5cm}|}     \hline Floor &~\# Training samples &~\# Test samples \\      \hline 0 & 6 & 2 \\      \hline 1 & 6 & 2 \\      \hline 2 & 6 & 2 \\      \hline 3 & 6 & 2 \\      \hline 4 & 6 & 2 \\      \hline 5 & 6 & 2 \\      \hline 6 & 4 & 2 \\      \hline      \end{tabular}      \captionof{table}{Table shows the number of training and test data recorded for each floor. }     \label{tab:dataovereachfloor_thirdrun}     \end{minipage}     \end{table}      ![1](http://i.stack.imgur.com/4NxCg.png)


title: Fillbetween library has different effect based on plot contents

text: I'm trying to get fillbetween to fill the area of two graphs in two seperate plots: ![http://i.imgur.com/Qnnvjjc.png](http://i.stack.imgur.com/7W4II.png) I've set the same domain for both fillings, but it seems to be filling different domains. (quite frankly I'm not even sure what it does) Am I doing something wrong or is this a bug? I'd like to mention that excluding `geometry` somehow seems to make the filling more "accurate" (but it's still off miles).               \documentclass{article}     \usepackage{pgfplots}     \usepackage{tikz}     \usepackage{geometry} % try commenting this     \usepackage{hyperref}     \usepackage{hypcap}     \pgfplotsset{compat=newest}     \usepgfplotslibrary{fillbetween}     \usetikzlibrary{intersections}     \usetikzlibrary{shadows}          \pgfmathdeclarefunction{normal}{2}{%       \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%     }     %     \makeatletter     \pgfmathdeclarefunction{erf}{1}{%       \begingroup         \pgfmathparse{#1 > 0 ? 1 : -1}%         \edef\sign{\pgfmathresult}%         \pgfmathparse{abs(#1)}%         \edef\x{\pgfmathresult}%         \pgfmathparse{1/(1+0.3275911*\x)}%         \edef\t{\pgfmathresult}%         \pgfmathparse{%           1 - (((((1.061405429*\t -1.453152027)*\t) + 1.421413741)*\t            -0.284496736)*\t + 0.254829592)*\t*exp(-(\x*\x))}%         \edef\y{\pgfmathresult}%         \pgfmathparse{(\sign)*\y}%         \pgfmath@smuggleone\pgfmathresult%       \endgroup     }     \pgfmathdeclarefunction{qnorm}{4}{       \begingroup         \pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}         \pgfmathparse{#1}         \edef\p{\pgfmathresult}         \pgfmathparse{#2}         \edef\mu{\pgfmathresult}         \pgfmathparse{#3}         \edef\sigma{\pgfmathresult}         %         \pgfmathparse{\sigma < 0 ? 1 : 0}                    \edef\sigma@neg{\pgfmathresult}         \pgfmathparse{\sigma == 0 ? 1 : 0}                   \edef\sigma@zero{\pgfmathresult}         %         \pgfmathparse{\p - .5}                           \edef\q{\pgfmathresult}         %         \pgfmathparse{abs(\q) <= .425 ? 1 : 0}               \edef\q@i{\pgfmathresult}                        %         \pgfmathparse{                                 \q@i ?                                     .180625 - \q * \q                          :                                  sqrt(-ln(min(\p,(1-\p))))                                 }         \edef\r@{\pgfmathresult}        %          \pgfmathparse{\q@i ?            \r@          :            (\r@ <= 5 ?               \r@ - 1.6 %           :              \r@ - 5           )}         \edef\r{\pgfmathresult}         \pgfmathparse{\q@i ?          (\q * (((((((\r * 2509.0809287301226727 +                            33430.575583588128105) * \r + 67265.770927008700853) * \r +                          45921.953931549871457) * \r + 13731.693765509461125) * \r +                        1971.5909503065514427) * \r + 133.14166789178437745) * \r +                      3.387132872796366608)                 / (((((((\r * 5226.495278852854561 +                          28729.085735721942674) * \r + 39307.89580009271061) * \r +                        21213.794301586595867) * \r + 5394.1960214247511077) * \r +                      687.1870074920579083) * \r + 42.313330701600911252) * \r + 1.))                                         : ( \r@ <= 5 ?                                               ((((((((\r * 7.7454501427834140764e-4 +     %                            .0227238449892691845833) * \r + .24178072517745061177) *     %                          \r + 1.27045825245236838258) * \r +                        %                         3.64784832476320460504) * \r + 5.7694972214606914055) *     %                       \r + 4.6303378461565452959) * \r +                        %                      1.42343711074968357734)                                %                     / (((((((\r *                                       %                              1.05075007164441684324e-9 + 5.475938084995344946e-4) *     %                             \r + .0151986665636164571966) * \r +                    %                            .14810397642748007459) * \r + .68976733498510000455) *       %                          \r + 1.6763848301838038494) * \r +                     %                         2.05319162663775882187) * \r + 1))                      %                                             :                                                    ((((((((\r * 2.01033439929228813265e-7 +                            2.71155556874348757815e-5) * \r +                           .0012426609473880784386) * \r + .026532189526576123093) *                         \r + .29656057182850489123) * \r +                        1.7848265399172913358) * \r + 5.4637849111641143699) *                      \r + 6.6579046435011037772)                     / (((((((\r *                              2.04426310338993978564e-15 + 1.4215117583164458887e-7)*                             \r + 1.8463183175100546818e-5) * \r +                            7.868691311456132591e-4) * \r + .0148753612908506148525)                          * \r + .13692988092273580531) * \r +                         .59983220655588793769) * \r + 1.))                         )                      }         \edef\val{\pgfmathresult}         \pgfmathparse{\q@i ? \val :         (\q > 0 ? \val : -\val)}                    %         \edef\@tmp{\pgfmathresult}         \pgfmathparse{\p > 1 ? sqrt(-1) :           (\p < 0 ? sqrt(-1) :             \sigma@neg ? sqrt(-1) :             %              (\sigma@zero ? \mu :               %                (#4 ? \mu+\sigma*\@tmp :                                   \mu-\sigma*\@tmp)              %               )            )         }         \pgfmath@smuggleone\pgfmathresult       \endgroup     }     \makeatother     \pgfmathdeclarefunction{skew}{3}{%             \pgfmathparse{(exp(-((x-#1)^2)/(2*(#2)^2))*((erf((#3*(x-#1))/(sqrt(2)*#2)))+1))/(sqrt(2*pi)*#2)}%     }     \begin{document}          \newcommand{\samplesize}{52} % SET sample size globally          \newcommand*\quantile{.95}\relax     \newcommand*\mean{8}\relax     \newcommand*\sd{3.416969}\relax     \newcommand*\lowertail{1}\relax               \pgfmathsetmacro\qqq{qnorm(\quantile,\mean,\sd,\lowertail)}          \begin{figure}[ht]     \capstart     \begin{center}     \begin{tabular}{c}     \begin{tikzpicture}     \begin{axis}[           hide y axis,           axis lines*=center,            axis on top,           no markers,            domain=0:21,            samples=4*\samplesize-7,           xlabel=\empty,            ylabel=\empty,           every axis x label/.style={at=(current axis.right of origin),anchor=west},           every axis y label/.style={at=(current axis.above origin),anchor=south},           width=.8\linewidth,           height=.3\linewidth,           xmin = 0, xmax=21,           xtick=, ytick=\empty,           enlargelimits=false,            clip=false       ]       \addplot [name path=normaal,very thick,cyan!85!black!50] {normal(\mean,\sd)};       \path[name path=axis] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);       \addplot[red!30,draw=red!80!black]   fill between[of=normaal and axis,soft clip={domain=\qqq:\pgfkeysvalueof{/pgfplots/xmax}}];     \end{axis}     \end{tikzpicture} \\     \begin{tikzpicture}     \begin{axis}[           hide y axis,           axis lines*=center,            axis on top,           no markers,            domain=0:21,            samples=4*\samplesize-7,           xlabel=\empty,            ylabel=\empty,           every axis x label/.style={at=(current axis.right of origin),anchor=west},           every axis y label/.style={at=(current axis.above origin),anchor=south},           width=.8\linewidth,           height=.3\linewidth,           xmin = 0, xmax=21,           xtick=, ytick=\empty,           enlargelimits=false,            clip=false       ]       \addplot [name path=skew,very thick,green!85!black!50] {skew(19,4,-6)};       \path[name path=axis] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);       \addplot[red!30,draw=red!80!black]   fill between[of=skew and axis,soft clip={domain=\qqq:\pgfkeysvalueof{/pgfplots/xmax}}];     \end{axis}     \end{tikzpicture}     \end{tabular}     \caption{De statistische power is de kans dat je een effect vindt als het er ook echt is}\label{fig:power}     \end{center}     \end{figure}          \end{document}


title: How to disable Emacs+AUCTex formating for a particular chapter

text: Emacs+AUCTeX formats automatically the titles (section, part, ...) by increasing the font and changing the color. I would like to disable this behavior for one (and only one) chapter. This chapter is used to print the name of the (mini) table of contents and I don't want it to be emphasized.


title: Where and how to enable '--shell-escape' or '--enable-write18' of pdflatex.exe in LaTeXTools of Sublime Text?

text: I know how to deal with the problem with the older version of LaTeXTools. But recently LaTeXTools has been updated, which turn out to deprive me of knowing what to do. I use Windows+MikTex, by the way.


title: \today month as text

text: I have this code:               \documentclass{article}     \usepackage[a5paper]{geometry}     \usepackage[ddmmyyyy]{datetime}     \renewcommand{\dateseparator}{.}     \begin{document}     \today     \end{document}      Prints: ![enter image description here](http://i.stack.imgur.com/7NAWU.png) How can I make it print this: 07 May, 2013


title: Bibtex fails without citations... (test for citations? or invisible dummy cite)

text: I have a LaTeX folder where I use the same makefile and preamble for building either a part of the report or the entire report. This is achieved by a hack in the makefile where I substitute the file I want to compile into the preamble (this part works fairly well). But, whenever I build a document without citations, BibTeX fails, and LaTeX writes a warning saying `Empty 'thebibliography' environment on input line 5.`. I can avoid this problem by doing a `\nocite{DummyCite}` and having an entry for dummy cite in my .bib file. However, that's a rather nasty hack, and looks ugly when I have citations. Is there any way I can figure out if there are citations? Can I do an `\ifthenelse` against the citation counter? How do I find out what the name of the citation counter is?


title: Using \thanks and \footnote without without numbering/mark and line

text: I want to use `\thanks` and `\footnote` without any numbering/mark with my title. Is there a way to do it? I use:               \documentclass[letterpaper,twocolumn,10pt]{article}      after Alan Munn's answer it works for the numbering or mark, but what about the line just above the footnote?


title: How to trim the space in the contents page?

text: I hope to remove some vertical space between the top of the content page and the word "Contents" so as to put a bit more lines in the page. I am using the "titletoc" package. Are there any way to customize this spacing by using any command in the titletoc package?


title: How to dynamically number theorems?

text: I am writing an introduction. I want to reference theorems and so on which come later. I want to do something like the following. `\newtheorem*{thmcustom}[1]{Theorem #1}` Then `\begin{thmcustom}[3.2.1] .. \end{thmcustom}` would print out **Thereom** 3.2.1:... (In general I would have a `\ref{thm:whatever}` as opposed to the 3.2.1, but anyway.) Of course, this doesn't work. Is there a way which I can do this? (I have a hideous hack of doing `\newtheorem*{thmA}{Theorem \ref{thm:thmA}}` for each theorem I want to reference.               \documentclass[a4paper,10pt]{article}     \usepackage{amsthm}     \newtheorem{theorem}{Theorem}     \newtheorem*{thmA}{Theorem \ref{thm:thmA}}          \begin{document}     The same theorem which comes later:     \begin{thmA}     This is a theorem.     \end{thmA}          The original statement of the theorem.     \begin{theorem}     \label{thm:thmA}     This is a theorem.     \end{theorem}     \end{document}      This is awful! So anything will be better...)


title: how to write vertical vectors in plain TeX

text: I would like to right a column vector in plain TeX without using the `\matrix` command (it seems too wide otherwise). How can I do it?


title: Floatingtable, always "Underfull \hbox (badness 10000)"

text: What LaTeX is trying to do with this:               \documentclass{article}     \usepackage{floatflt}     \begin{document}          \begin{floatingtable}[r]{     \begin{tabular}{cc}     0 & 1 \\     1 & 0     \end{tabular}}     \end{floatingtable}          This is MWE.          \end{document}      I got `Underfull \hbox (badness 10000) in paragraph at lines 9--10` and message disappears if I add `\raggedright` after `\begin{document}`. It does not make any difference if I add more words to "This is MWE." -paragraph or add few paragraphs more.


title: How to change the unusual font size of Table of Contents?

text: Below picture shows my table of contents The title size (the word, Contents) is very big, maybe `Huge`. I never set it as `Huge` and I searched the whole LaTeX file, there is no the word "huge" at all. And the number is start with 0, for example "0.1 Introduction", not the normal "1 Introduction" Below is the only code related with ToC               \usepackage[subfigure]{tocloft}     .     .     .     \setcounter{tocdepth}{2}     \tableofcontents      What problem it can be? PS: I tried to use `\usepackage{xpatch}`, but this one does not work I use report                \documentclass[a4paper,leqno,twoside]{report}      Thanks everyone! I changed report to article, the problem is gone! ![enter image description here](http://i.stack.imgur.com/Ixjq0.png)


title: How to manage the list of abbreviations for periodicals?

text: I cite a lot of articles of the same magazine of different years. So I would like to make an abbreviation of this magazine to put in footnotes and in the list of abbreviations. I mean one shorthand for the all years of the same magazine with only the first year of edition indicated in the list of abbreviations. Like this: > ## Abbreviations > > EP - Name of the magazine, 1970- The articles have no author's name. For the bib-entries I've made a `xref`, like domwass advised.               \documentclass[12pt]{report}           \usepackage{fontspec}          \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage[babel=false]{csquotes}     \usepackage{polyglossia}     \setdefaultlanguage{french}     \setotherlanguages{german,english,greek,polish,russian}          \usepackage[style=verbose-ibid,citepages=suppress]{biblatex}          \bibliography{master2}          \begin{document}          @Article{Episkepsis1971:36,     title = {La Commission préparatoire },     date = {1971},     number = {36},     pages = {2},     xref = {Episkepsis}     }          @Article{Episkepsis1971:36_2,     title = {Communique de la Commission },     date = {1971},     number = {36},     pages = {8--9},     xref = {Episkepsis}     }          @Article{Episkepsis1972:54,     title = {La première Conférence},     date = {1972},     number = {54},     pages = {2--5},     xref = {Episkepsis}     }          @Collection{Episkepsis,     journal = {Episkepsis},     date = {1970/},     shorthand = {EP},     keywords = {primary},     }               \printbibheading     \printbibliography[keyword=primary,heading=subbibliography,title={Les sources principaux}]     \printbibliography[notkeyword={primary},heading=subbibliography,title={Les sources secondaires}]          \end{document}      But when I make `\printshorthands` I get in the list of abbreviations all articles with the same abbriviation like this: > ## Abbreviations > > EP - 1970-. And it has no abbr. in footnotes (Just number of magazine and the year) and in bibliography. Also I'd like to make a space between an abbreviation and it's explanation a little bit more wide. Could somebody help me?


title: Is it possible to add hooks to the three main logical divisions in memoir?

text: I want to prepare a style based on memoir that executes code immediately before and after `frontmatter`, `mainmatter`, and `backmatter` (§6.1, pg.71). Without hooks, I have to insert the code in the Latex document, rather than the style file where it belongs. Should I use `renewcommand`? For reference, the discussion on heading hooks is on page 353 of the memoir manual (§18.25)


title: Define exceptions from global pgfplotsset settings

text: I am using the following code in the preamble to set the position of my axis labels:               \pgfplotsset{         every axis y label/.style={at={(-0.1,0.5)},rotate=90}     }      I have roughly 10 plots, where this settings is correct and what I actually want. But for a single other plot I would like to set the position differently. Is is possible to set a specific option to ignore the global setting and define a local exception? Something like:               \begin{tikzpicture}     \begin{axis}[%     overwrite axis y label/.style={at={(-0.2,0.5)},rotate=90}     \end{axis}     \addplot[...]     \end{tikzpicture}%


title: Hide section numbers, but keep numbering

text: How do I hide section number in section heading ? I can't just use `\section*{xxxx}`, because I want subsections numbered correctly. I also tried :               \section*{xxxx}       \stepcounter{xxxx}      Which hides section number and keeps subsection numbers. Unfortunately this solution also hides section in table of contents, which is undesirable. Next attempt was :               \chapter{}     \section*{xxxx}     \addtocounter{section}{1}      However this made numbering of subsections continue on and on instead of reseting at new section. So what can I do to make it behave as normal, just not showing section numbers ? Thanks!


title: Problem with PGFPlots and Tikz fading library with disappearance of nodes near coords and irregular fades

text: It seems like whenever I turn on Fading from Tikz Fading library, the nodes near coords parameter to the axis environment is not processed by PGFPlots correctly. I am attaching the code and the image I get. (While some may argue that fading the bar graph represents no additional information, it helps me to divert attention of audience to the part where there is no fading). In the following code, the red and yellow graphs have fading enabled while blue and green plots have fading disabled. Secondly, the fade option seems to be such that the fading does not happen for each bar in the bar chart, but a group of bars are being faded (for example, the red plot). Is there a way I can get the fades for each bar and also get nodes near coords?               \documentclass[12pt]{article}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage[margin=1cm]{geometry}     \usepackage{pgfplots}     \usetikzlibrary{patterns,fadings}          \begin{filecontents*}{Total_Histogram.dat}     0.00000000e+00 2.00000000e+00      5.00000000e-01 0.00000000e+00      1.00000000e+00 3.00000000e+00      1.50000000e+00 3.00000000e+00      2.00000000e+00 4.00000000e+00      2.50000000e+00 1.00000000e+00      3.00000000e+00 2.00000000e+00      3.50000000e+00 1.00000000e+00      4.00000000e+00 2.00000000e+00      4.50000000e+00 2.00000000e+00      5.00000000e+00 3.00000000e+00      5.50000000e+00 5.00000000e+00      6.00000000e+00 3.00000000e+00      6.50000000e+00 4.00000000e+00      7.00000000e+00 7.00000000e+00      7.50000000e+00 5.00000000e+00      8.00000000e+00 4.00000000e+00      8.50000000e+00 0.00000000e+00      9.00000000e+00 2.00000000e+00      9.50000000e+00 2.00000000e+00      1.00000000e+01 1.00000000e+00      1.05000000e+01 0.00000000e+00      1.10000000e+01 3.00000000e+00      1.15000000e+01 2.00000000e+00      1.20000000e+01 0.00000000e+00      1.25000000e+01 0.00000000e+00      1.30000000e+01 1.00000000e+00      1.35000000e+01 0.00000000e+00      1.40000000e+01 0.00000000e+00      1.45000000e+01 0.00000000e+00      1.50000000e+01 0.00000000e+00     \end{filecontents*}          \begin{document}     \pagestyle{empty}          \begin{tikzpicture}         \centering         \begin{axis}         [         width=\textwidth,         ybar,         ymin=0,         xtick=data,         xticklabel style={rotate=45},         legend columns=-1,         nodes near coords,         every node near coord/.append style={         rotate=30,         xshift=1mm,         inner sep=1pt,         color=gray         },         ytick={0,1,2,3,4,5,6,7},         ymajorgrids,         major grid style={thick,white},         axis on top,         tick pos=left,         xlabel=Total Points in Quiz-1,         ylabel=Number of Students,         x label style={at={(axis description cs:0.5,-0.05)},anchor=north},         title={\bf Performance of students in Quiz-1}         ]                  \addplot+[path fading=east,color=red!30,draw=black,forget plot] table [y index=1,x index=0,skip coords between index={5}{31}]{Total_Histogram.dat};             \addplot+[path fading=south,color=yellow!30,draw=black,forget plot] table [y index=1,x index=0,skip coords between index={0}{5},skip coords between index={11}{31}]{Total_Histogram.dat};             \addplot+[color=blue!30,draw=black,forget plot] table [y index=1,x index=0,skip coords between index={0}{11},skip coords between index={17}{31}]{Total_Histogram.dat};             \addplot+[color=green!30,draw=black] table [y index=1,x index=0,skip coords between index={0}{17}]{Total_Histogram.dat};                  \node [fill=red!30,,decoration={random steps,segment length=6pt,amplitude=2pt},decorate] at (axis cs:0.65,3.75) {Attention};             \node [fill=yellow!30] at (axis cs:3.5,3.75) {C,D grades};             \node [fill=blue!30] at (axis cs:7,7.35) {B grade};             \node [fill=green!30] at (axis cs:11,3.75) {A,S grades};             \draw [->,blue,ultra thick] (axis cs:5.9,0) -- (axis cs:5.9,6.5) node [anchor=north east,draw=gray,xshift=-1.5mm]{Average=5.9};             \draw [<->,gray,ultra thick]    (axis cs:-0.1,5.4) -- (axis cs:5.8,5.4) node [anchor=north,midway]{28 Students};             \draw [<->,gray,ultra thick]    (axis cs:6.0,5.4) -- (axis cs:15,5.4) node [anchor=north,midway]{34 Students};         \end{axis}          \end{tikzpicture}          \end{document}      ![Incorrect fading and disappearance of nodes near coords in pgfplots](http://i.stack.imgur.com/VByup.png)


title: print the chapter number as name in class file latex

text: I am using a Duke University LaTeX template for master thesis, the template print chapter headers as follows: > Chapter 1 > > chapter name but I want to print it as follows > Chapter one: chapter name I use old style which prints the word "Chapter", any suggestions will be welcomed                %-------------------------------------------------------------------------      % Chapter format:      %-------------------------------------------------------------------------      \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne                          \refstepcounter{chapter}%                                  % Done with frontmatter?                                  \if@frontmatter                                      \@frontmatterfalse                                       \pagenumbering{arabic}                                       \setcounter{page}{1}                                  \fi                          \typeout{\@chapapp\space\thechapter.}%                          \addcontentsline{toc}{chapter}%                                    {\protect\numberline{\thechapter}#1}%                     \else                       \addcontentsline{toc}{chapter}{#1}%                     \fi                     \chaptermark{#1}%                     \addtocontents{lof}{\protect\addvspace{10\p@}}%                     \addtocontents{lot}{\protect\addvspace{10\p@}}%                     \@makechapterhead{#2}%                     \@afterheading                           \normalbaselines                           \@textspace  % double-spaced chapter text      }      % Format for normal chapters (and appendicies)      \ifthenelse{\boolean{oldstyle}}{ }      {%      \def\@makechapterhead#1{%      \vspace*{1in} % Leave space at top of page        {         \parindent \z@ \raggedright \normalfont           \if@inappendix           % Include the word 'Appendix'           \makebox[\textwidth][r]{\Huge\bfseries \@chapapp\space\thechapter}            \else           % Don't include the word 'Chapter'           \makebox[\textwidth][r]{\Huge\bfseries \thechapter}            \fi         \par\nobreak         \vskip 10\p@     \interlinepenalty\@M      % Title format      \parbox{\textwidth}{ \flushright{%       \normalbaselines \LARGE  #1  \par\nobreak }}     \vskip 40\p@        }%        \vspace*{50\p@}%        }           }


title: Problem with viewing interactive PDF content on Mac

text: I use packages such as `popupmenu` and `fancytooltips` on a Windows system using PDFLaTeX to create some interactive PDF texts to be posted online. The resulting documents behave as expected when viewed from a browser in Windows system. But when I view them on a Mac Machine none of the interactivity works. I know that the viewer should be Adobe as most other PDF viewers do not have the necessary support. But I am not sure what else I could be missing. Edit 1 Here are two files where I try to use `fancytooltip` package File 1 (This is saved as mathtipsdemo.tex and compiled)               \documentclass{article}     \usepackage{xcolor}     \usepackage{amsmath}     \usepackage{framed}     \usepackage[createtips]{fancytooltips}     \colorlet{shadecolor}{yellow!50}     \newsavebox\mybox     \begin{document}     \savebox\mybox{%     \Huge$\displaystyle M= \begin{bmatrix}     \alpha & \beta   \\     \gamma & \delta  \\     \end{bmatrix}$%     }     \keytip{M}     \noindent\begin{minipage}{\wd\mybox}     \begin{shaded}     \usebox\mybox     \end{shaded}     \end{minipage}     \end{document}      File 2, this is compiled separately from File 1. Then the PDF output is viewed.               \documentclass{article}     \usepackage{amsmath}     \usepackage{xcolor}     \usepackage{comment}     \usepackage{xr-hyper}     \usepackage[filename=mathtipsdemo,mouseover,noextratext]{fancytooltips}     \begin{document}      Instructions: Hover on the formula.           Consider the matrix \tooltip{$M= \begin{bmatrix}      \alpha & \beta   \\      \gamma & \delta  \\      \end{bmatrix}$}{M}.      \end{document}      I process this with PDFLaTeX on Windows. It works as expected when viewed from a Windows machine. But when viewed from a Mac machine it produces odd results. I placed the output PDF file on this site. Edit 2 Here is perhaps a somewhat similar problem report on Adobe Reader forum.


title: How can I make tightpage work with this plot?

text: I want to plot something similar to this: pgfplots: Multiple (shifted) stacked plots in one diagram with the addition of the kind of groupings presented here: How can I mix an "ybar" and an "ybar stacked" with pgfplots? I merged the two like this, and got the kind of plot that I was after, except that I cannot make tightpage work properly:               \documentclass{article}     \usepackage{pgfplots, pgfplotstable}     \usepackage[tightpage,active]{preview}          \newcounter{groupcount}     \pgfplotsset{         draw group line/.style n args={5}{             after end axis/.append code={                 \setcounter{groupcount}{0}                 \pgfplotstableforeachcolumnelement{#1}\of\datatable\as\cell{%                     \def\temp{#2}                     \ifx\temp\cell                         \ifnum\thegroupcount=0                             \stepcounter{groupcount}                             \pgfplotstablegetelem{\pgfplotstablerow}{X}\of\datatable                             \coordinate [yshift=#4] (startgroup) at (axis cs:\pgfplotsretval,0);                         \else                             \pgfplotstablegetelem{\pgfplotstablerow}{X}\of\datatable                             \coordinate [yshift=#4] (endgroup) at (axis cs:\pgfplotsretval,0);                         \fi                     \else                         \ifnum\thegroupcount=1                             \setcounter{groupcount}{0}                             \draw [                                 shorten >=-#5,                                 shorten <=-#5                             ] (startgroup) -- node [anchor=base, yshift=0.5ex] {#3} (endgroup);                         \fi                     \fi                 }                 \ifnum\thegroupcount=1                             \setcounter{groupcount}{0}                             \draw [                                 shorten >=-#5,                                 shorten <=-#5                             ] (startgroup) -- node [anchor=base, yshift=0.5ex] {#3} (endgroup);                 \fi             }         }     }          \makeatletter     \newcommand\resetstackedplots{     \makeatletter     \pgfplots@stacked@isfirstplottrue     \makeatother     \addplot [forget plot,draw=none] table [x=X, y=Zeroes] {\datatable};     }     \makeatother          \pgfplotstableread{     X   Gp  C1  C2  Name        Zn      Pb  Cu  Fe  Cr  Zeroes     1   1A  0.2 3   Duracem     47.2    12  13  11  15  0     2   1A  0.2 3   Technocem   39      11  15  25  14  0     3   1A  0.2 3   Alipre      28      13  25  11  16  0     5   1A  0.2 8   Duracem     16.2    12  11  16  17  0     6   1A  0.2 8   Technocem   15      15  17  22  19  0     8   1A  0.5 3   Duracem     89      17  16  23  24  0     9   1A  0.5 3   Technocem   96      19  12  15  11  0     10  1A  0.5 3   Alipre      49.6    20  12  17  21  0     12  1A  0.5 8   Duracem     22.9    12  14  17  20  0     13  1A  0.5 8   Technocem   15.1    11  19  21  26  0     15  2A  0.2 3   Duracem     105     10  21  17  27  0     16  2A  0.2 3   Technocem   83      17  23  26  13  0     17  2A  0.2 3   Alipre      47      20  14  29  16  0     19  2A  0.2 8   Duracem     19.5    21  16  28  23  0     20  2A  0.2 8   Technocem   24.4    8   18  19  20  0     }\datatable          \begin{document}     \begin{preview}     \begin{tikzpicture}          \begin{axis}[         axis lines*=left, ymajorgrids,         width=25cm, height=6cm,         ymin=0,         ybar stacked,         bar width=8pt,         xtick=data,         xticklabels from table={\datatable}{Name},         xticklabel style={rotate=90,xshift=-10ex,anchor=mid east},         draw group line={C2}{3}{3\,\%}{-10ex}{4pt},         draw group line={C2}{8}{8\,\%}{-10ex}{4pt},         draw group line={C1}{0.2}{0.2\,\%}{-7ex}{5pt},         draw group line={C1}{0.5}{0.5\,\%}{-7ex}{5pt},         draw group line={Gp}{1A}{1A}{-4ex}{7pt},         draw group line={Gp}{2A}{2A}{-4ex}{7pt},         after end axis/.append code={             \path [anchor=base east, yshift=0.5ex]                 (rel axis cs:0,0) node [yshift=-10ex] {Conc 1}                 (rel axis cs:0,0) node [yshift=-7ex] {Conc 2}                 (rel axis cs:0,0) node [yshift=-4ex] {Group};         }     ]          \addplot +[xshift=-.2cm] table [x=X, y=Zn] {\datatable};% \addlegendentry{Zn}     \addplot +[xshift=-.2cm] table [x=X, y=Pb] {\datatable};% \addlegendentry{Pb}          \resetstackedplots          \addplot +[xshift=.2cm]table [x=X, y=Cu] {\datatable};% \addlegendentry{Zn}     \addplot +[xshift=.2cm]table [x=X, y=Fe] {\datatable};% \addlegendentry{Pb}     \addplot +[xshift=.2cm]table [x=X, y=Cr] {\datatable};% \addlegendentry{Zn}          \end{axis}     \end{tikzpicture}          \end{preview}     \end{document}       The above code generates the below output, and the figure is cut. It should extend further both to the right and up. ![Output from the above code](http://i.stack.imgur.com/ZpTLW.png) How can I make tightpage work in the above example? I do not understand why it cuts out parts of the figure. If I reduce the size of the figure, there is unnecessary white space around the figure instead. I want to produce a free- standing picture, with the borders just outside of the figure without unnecessary white space around it. In all my previous plots, I have used something like this without problems:               \pgfplotsset{width=15cm,compat=1.3} %use to get tight spacing of labels to tickmarks.     %Not enabled by default because it affects the spacing.     \usepackage[tightpage,active]{preview}          \begin{document}     \begin{preview}     \begin{tikzpicture}     \begin{axis}     % the plot here     \end{axis}     \end{tikzpicture}     \end{preview}     \end{document}      I then set the size of my plot after "width" (or height). For some reason, tightpage did not work this time.


title: a4paper, where should I declare it? In document class or geometry?

text: I currently have an `article` document class and I previously changed it to include printing on A4 paper:               \documentclass[12pt, a4paper]{article}      However, I had to change my margins to meet my university requirements and the answer I received used A4 in the `geometry` package too.               \geometry{a4paper,margin=15mm,bindingoffset=25mm,heightrounded,}      Partially practical and partially theoretical, is there any difference to using either declaration and/or is there an effect by using both?


title: "Shell escape not enabled" error, even though write18 is enabled

text: I have enabled `write18` by telling TeXlipse to call `pdfLaTeX` using the `\--enable-write18` option. However, this does not seem to work properly. The code               \documentclass{scrartcl}          \usepackage{tikz}     \usepackage{gnuplottex}          \begin{document}          \verb|\ifeof18|:      \ifeof18         true     \else         false     \fi          \verb|\pdfshellescape|:     \ifnum\pdfshellescape=1         true     \else         false     \fi          \begin{gnuplot}         plot sin(x), cos(x)     \end{gnuplot}          \begin{tikzpicture}         \draw[domain = -pi : pi] plot function{sin(x)};     \end{tikzpicture}          \end{document}      produces the output ![\\ifeof18: flase, \\pdfshellescape: true](http://i.stack.imgur.com/4ufXf.png) so `write18` seems to indeed be enabled, however instead of producing plots it gives me the errors               pdflatex.exe> Package pgf Warning: Plot data file `document.pgf-plot.table' not found.          pdflatex.exe> Package gnuplottex Warning: Shell escape not enabled.     pdflatex.exe> (gnuplottex)                You'll need to convert the graphs yourself..          pdflatex.exe> Package gnuplottex Warning: Please convert document-gnuplottex-fig1.gnuplot manually.      What did I do wrong and how can I fix this? * * * PS: gnuplot is installed and calling it from the command line works fine. * * * **Edit:** I found the following occurences of `runsystem` in the log file:               runsystem(touch w18-test-20145301175.tex)...executed.          runsystem(rm -f w18-test-20145301175.tex)...executed.          runsystem(gnuplot document.pgf-plot.gnuplot)...executed.


title: Option cmyk for xcolor package does not produce a CMYK PDF

text: I am trying to produce a CMYK PDF file to pass onto a printshop. When I use the [cmyk] option for the xcolor package, the colours in the resulting PDF do look muted and less vibrant as is the case with the CMYK colorspace. For example,               \documentclass{minimal}     \usepackage[cmyk]{xcolor}     \begin{document}     \textcolor{blue}{\fontsize{24}{28}\selectfont A}     \end{document}      when processed by pdflatex produces a PDF file that appears onscreen like a muted, darkish CMYK colorspace document, but when I run ImageMagick's `identify` command on the PDF using               identify -verbose cmyk.pdf | grep Colorspace      I get               Colorspace: RGB      Surely the PDF uses only one of CMYK or RGB for colour. How can I reliably tell which? Also, if it is indeed an RGB PDF why does it appear so different from the version I get if the line               \usepackage[cmyk]{xcolor}      is replaced by               \usepackage[rgb]{xcolor}      Thanks in advance.


title: Simulating directly typed text with \input

text: I currently have the following code written in Plain TeX:               \loadtoks\END     int main(void)     {         printf("Hello World! %!@#$%&*&^\n");     }     \END          {\tt\the\toks0}     \bye      The macro `\loadtoks` is something that I wrote myself. It sets the catcode of every ASCII character to 12 so that specials are now just regular characters, and then it scans ahead looking for the given \END token. As it scans, it appends every token that it finds to the \toks0 register. One could also do `\loadtoks+Hello World+`, for example, and in that case the end-marker would be `+`. It's a bit more complex than that internally, but that's basically the gist of it. Now, what I need to do is something like:               \loadtoks\END     \input file.txt     \END          {\tt\the\toks0}     \bye      Of course this simply typesets the words "\input file.txt", as opposed to reading in the file. But naturally what I need for it to do is to actually read in the file, and to behave as if the file's contents had actually been typed into the TeX source file directly (as in the first example). I've been scratching my head over this for a while now, but I can't seem to figure it out. Note I know about LaTeX's \verb, but I'm using strictly Plain TeX, and I'm curious to figure out a solution in terms of only TeX's plain and primitive macros.


title: Multiple consecutive \par's equivalent to just one?

text: I think the answer to this question should be positive but I just couldn't find it answered elsewhere: Are multiple consecutive `\par`'s the same as a single `\par`? For example, is `\par\par` the same as just `\par`? More generally, since an empty line is equivalent to a `\par`: **Is any finite sequence of consecutive`\par`'s and empty lines (or any mixture of them) equivalent to a single `\par` (or a single empty line)?** I know this question might seem trivial, but I do want to know it for defining macros. Any help appreciated!


title: SF298 package giving undefined control sequence error

text: I am trying to use the SF298 package for latex and it gives an undefined control sequence error. The error is as follows:               ! Undefined control sequence.     \ExecuteOptions ...eserved@a \CurrentOption \@nil     l.104 \ExecuteOptions{config,nofloatlongboxes}      The test latex file I am using is as follows:               \documentclass[titlepage]{article}     \usepackage{sf298}          \title{Test Title}     \author{author}          \ReportDate{10--06--1996}     \ReportType{Final}     \DatesCovered{1 June 1996 --- 31 May 1999}     \Title{Final Report Title}     \ContractNumber{DACA99--99--C--9999}     \Author{Uthor, Joe, A., and Ditor, Jane, E.}     \PerformingOrg{Test}     \SponsoringAgency{Test2}     \Abstract{Abstract}     \SubjectTerms{keywords; associated words; other words}     \AbstractLimitation{UU}     \ResponsiblePerson{Mr.\ Joe A. Uthor}     \RPTelephone{(412) 555--9999}          \begin{document}       \maketitle            \MakeRptDocPage            \section{Introduction}     % section 1.1       \subsection{History}       % subsection 1.1.1            \section{Introduction}     % section 2.1       \subsection{Usage}         % subsection 2.1.1          \end{document}      [David Carlisle] the example can be reduced to               \begin{filecontents}{zz.sty}            \usepackage{totpages}          \DeclareOption{config}{\def\sf@config{Y}}               \ExecuteOptions{config}     \end{filecontents}          \documentclass[titlepage]{article}     \usepackage{zz}          \stop      On the face of it, seems to be a bug in `totpages` or one of the packages it loads.


title: Superscripts after fs - spacing

text: When certain characters in superscripts follow certain letters ("f" at least) they collide. I'm using a numeric superscripted citation style, but the problem is more general that that as the following MWE demonstrates:               \documentclass{article}     \begin{document}     f$^6$ f$^1$ y$^6$          f\,$^6$ f\,$^1$ y\,$^6$     \end{document}      In the first line, all but the first example look right; in the second line even `f$^6$` looks rather wide, the other superscripts are floating off into the middle distance. This probably applies to `\footnote`s (with letters) as well, I just don't happen to have a combination that demonstrates that. Can it really be right that for certain combinations I have to add a manual correction (`\kern0.05em` looks about right)? Or is there a more general solution? ![output of above code](http://i.stack.imgur.com/FKO8A.png)


title: Defining (optional) data in a class

text: I'm trying to learn how to write latex classes and am using my resume as a toy example. I am trying to separate style from content as much as possible so I am trying to define data fields such as `\name` `\address` `\university`, similar to those that I have seen in `\maketitle`. Some of the fields of each of these are to be optional. I have a working example but since this is my first attempt at writing a latex class, I wanted to ask how I _should_ be defining the class's metadata. My attempt so far is like so (optional second line for the address):               \RequirePackage{xkeyval} % for keyval          \newif\ifAddressLineTwo\AddressLineTwofalse     \newcommand{\@address@firstline}{}     \newcommand{\@address@secondline}{}     \newcommand{\@address@town}{}     \newcommand{\@address@postcode}{}          \define@key{address}{first_line}[none]{%       \renewcommand{\@address@firstline}{#1}%     }     \define@key{address}{second_line}[none]{%       \AddressLineTwotrue       \renewcommand{\@address@secondline}{#1}%     }     \define@key{address}{town}[none]{%       \renewcommand{\@address@town}{#1}%     }     \define@key{address}{postcode}[none]{%       \renewcommand{\@address@postcode}{#1}%     }     \newcommand\address[2][]{%     \setkeys{address}{#2}%     }                \newcommand{\makeCV}{%     \@address@firstline\\%     \ifAddressLineTwo     \@address@secondline\\%     \fi     \@address@town\\%     \@address@postcode%     }      This works okay for me, I can type               \address     {       first_line= my road       %second_line=my county,       town=my city,        postcode=my post code     }     \makeCV      but it the class seems a little verbose? In particular, having to define all those `\newcommand{...}{}` and all the various `\newif` 's seems a little verbose. My question is how should I be doing this task properly?


title: AucTeX - Turning inline mode into displaymath and vice versa

text: Usually, when redacting math stuff, I deal many times with the following situation : I have written some formula in a displaymath environment and, when compiling, realize it should look better inline ; then maybe return to the displaymath environment if inline is not satifying. So I have something like               The presheaf     \begin{displaymath}         F \colon C \to \mathsf{Set}     \end{displaymath}     is a sheaf.      When compiling, I realize I would prefer it inline. So I switch to               The presheaf $F \colon C \to \mathsf{Set}$ is a sheaf.      But it requires me to : erase the `\begin{...}` and the line break before it, insert a `$` instead, erase the `\end{...}` and the line break after it, and insert a `$` instead. Kind of long for such a current operation, especially when I change it to the way it was just after that. Is there some key binding in AucTeX mode to turn a selected displaymath formula into a inline one, and vice versa ? Like a `C-u C-c C-e` (which changes the innermost environment). * * * **Edit.** I realize this is more a Emacs questions than a *TeX one, but I couldn't think of a better stackexchange to ask it.


title: How to draw a polygon using tkz-euclide

text: This is an image I want to draw. ![enter image description here](http://i.stack.imgur.com/7r1oc.png) And this is what I got so far. ![enter image description here](http://i.stack.imgur.com/5VNFR.png)               \documentclass{article}     \usepackage{tkz-euclide}     \usetkzobj{all}          \begin{document}                \begin{tikzpicture}             \tkzDefPoint(0,0){A}             \tkzDefPoint(2,0){B}             \tkzDefPoint(2,5){C}             \tkzDefPoint(0,4){D}             \tkzDrawPolygon[fill=gray!10](A,B,C,D)             \tkzLabelPoints(A)[anchor=east]{$A$}             \tkzLabelPoints(B)[anchor=west]{$B$}             \tkzLabelPoints(C)[anchor=south]{$C$}             \tkzLabelPoints(D)[anchor=east]{$D$}             \tkzMarkRightAngle(D,A,B)             \tkzLabelSegment[above](A,C){$1$\,cm}             \tkzLabelSegment[left=4pt](B,A){$x$\,cm}             \tkzLabelSegment[right](C,B){$y$\,cm}           \end{tikzpicture}          \end{document}      What am I doing wrong? I appreciate your help.


title: Text in Tikz Graph

text: I've been using Tikz and created the following graph with that code :               \documentclass{article}       \usepackage{tikz}       \usepackage{amssymb}     \usetikzlibrary{arrows}       \begin{document}       \begin{center}     \begin{tikzpicture}         \draw [fill=white!60!white,opacity=1] (-2.99,5.98) -- (2.99,5.98) -- (0,0) -- cycle;         \draw [fill=white!30!white,opacity=1,] (0,6) circle (2.99cm and 0.6cm) node [above] {$A_T$};         \draw [fill=blue!60!white,opacity=1] (-1.49,2.98) -- (1.49,2.98) node [left=1cm, below = 1.5 cm] {\color{blue} $V_0$} -- (0,0) -- cycle;         \draw [fill=blue!30!white,opacity=1,] (0,3) circle (1.49cm and 0.3cm);         \draw (0,0) -- (0,3) [line width = 1.3pt] node [left, below = 1cm] {$h_0$};         \draw (0,3) -- (-1.49, 3) [line width = 1.3pt] node [right = 1cm, above] {$r_0$};         \draw (3mm,6mm) arc [start angle=50, end angle=126, radius = 5mm, line width = 2pt] node [above = 6pt, right] {$\theta$};     \end{tikzpicture}     \end{center}     \end{document}      ![enter image description here](http://i.stack.imgur.com/z0LC7.jpg) I'm really not good at using it and it could be terribly coded. What I've been trying to do is change the text and make it larger so that it's readible. Also I've been trying to position the text for h_0 in the middle and left but it only takes one argument into account. What am I doing wrong? Could anyone please help me with editing the text? Thanks


title: Beamer: same colour in the upper part

text: this code will create two kinds of colours in the upper part of each frame. How can I have only one colour, namely the deep blue? The code:               \documentclass[xcolor=dvipsnames,11pt,mathserif]{beamer}      \usetheme{Berlin}          % main theme     %\usecolortheme{lily}      % outer colour     \usecolortheme{rose}       % inner colour     \useoutertheme{infolines}               \author{PSK}      \title{Presentation}           \begin{document}               \begin{frame}     \titlepage     \end{frame}          \section{Part I}     \begin{frame}{1st Frame}      In this presentation ...     \end{frame}          \end{document}


title: Making one column which is too wide for a page in two pages

text: I am writing a book using latex, with pages of tables to make the horizontal and vertical alignment of the text and equations strict and precise. However there is a column (on every page) which is too wide for a page, so I plan to split this column into two pages, so that when we put the two pages together, they just show up as one page (margin is not a problem). The problem is: How can I make one column in a table span two pages? The layout of the book is set in this way to acquire both the advantage of small book dimensions (portable) yet having large pages. So I split every "large" page into two side-by-side pages as the layout. The background is described so that the situation can be well understood. Other forms of solutions are welcomed (e.g. not using tables but preserving the features of the layout, or even better), but sadly rotating the tables or resizing the pages are not practical here. Thanks very much!


title: need to put a figure above another figure in beamer

text: In beamer I created a slide like ![enter image description here](http://i.stack.imgur.com/Eq7xD.png) using code               \documentclass[slidestop,compress,mathserif]{beamer}     \usepackage[latin1]{inputenc}     \usepackage{verbatim}     \usepackage{graphicx}     \usetheme{Boadilla}     \usecolortheme{beaver} %{beetle}%{crane}      \usepackage{textpos}     \usepackage{tikz}          \title[Madgraph Vs Phantom]{Introduction to Pile-Up}     \author[Ramkrishna Sharma]{Ramkrishna Sharma}     \institute[]{University of Delhi}     \date{August 24, 2014}          \setbeamertemplate{footline}[slide number]     \setbeamertemplate{frametitle}[default][center]     \begin{document}         \begin{frame}\frametitle{Mass of Two tagged Jet }              \includegraphics[width=12cm,height=8cm]{Massesjj.pdf}         \end{frame}          \end{document}      Now, I need to put another figure on the figure displayed in the figure. and it should appear when I press enter. Also I need to put an arrow to from figure to point a point in the figure which is already there. As shown in figure below:![enter image description here](http://i.stack.imgur.com/GjErn.png) The Black box should be replaced by another figure in next click. Please suggest what should I do.


title: Line-spacing in a cell of table

text: I'd like to change the line space of sentence in a cell of table. It is not line-breaked, but over-flowed since the sentence is quite long in the cell. My code example is below. The line space is quite larger than cell space, which looks so bad. Is there any way to make it narrow, only affecting in the cell? Thanks in advance. ps. Since I use \arraystretch which make cell-line small, line-space in the cell looks more bigger than cell-space.               \documentclass[10pt]{article}     \usepackage{booktabs,ctable,threeparttable}     \begin{document}         \renewcommand{\arraystretch}{0.75}         \begin{table}[t]           \caption{Test}           \begin{threeparttable}              \begin{tabularx}{\textwidth}{c l X}                                                                  \FL                No. & Code  & Name                                \ML[0.08em]                01  & 01XXX & Agriculture, forestry and fishing   \NN                02  & 05XXX & Manufacture of Electronic Components, Computer,                               Radio, Television and Communication Equipment and Apparatuses                                                                  \NN                03  & 06XXX & Nursing                             \LL              \end{tabularx}              \label{tab:test}            \end{threeparttable}         \end{table}     \end{document}      # Addtion. This is how my table look. ![enter image description here](http://i.stack.imgur.com/dqQuQ.png)


title: Customized 'gradient' background in Beamer

text: I found the following slide made using LaTeX, and I'd like to replicate it: ![enter image description here](http://i.stack.imgur.com/Cj1JR.png) Specifically, how can I replicate the background? It looks like a transition from a silvery color, to white and gradually back to the original color. **I'd also like to disable themes somehow, and just write directly onto the slides.** * * * Note: obviously the LaTeX code is not available/published. **In addition, the background should not cover the entire slide, but have borders as shown in the image.**


title: Declaring a math operator with cursor placement, e.g. expected value

text: I'd like to declare a new math operator `\ev` for representing the expected value, in the form: E<.> so that it looks like the following but with an argument `\DeclareMathOperator{\ev}{\mathrm{E}\left<\right>}` Is there a way of declaring a math operator to take an argument so that I can call it using `\ev{.}` or would a TeXShop macro be more appropriate that prints: `\mathrm{E}\left`*`<\right>` where the cursor would be placed at *?


title: adding blank page before chapter and after chapter latex

text: The blank page between every chapter disappeared and I tried to use `\clearpage`, `clear double page`, but it didn't work. Also in one of question here, it was said to use the following command:               \let\oldchapter\chapter \renewcommand{\chapter}{\clearpage\mbox{}\clearpage\oldchapter}      This adds a double page. How do I add a single blank page??               \documentclass[a4paper, %      12pt,      twoside,     openright,     cleardoublepage=empty,           alternativ: cleardoublepage=plain (mit Seitenzahl)     numbers=noenddot,      appendixprefix,      BCOR1.5cm,     bibliography=totoc     ]{scrbook}


title: Use part of text stored in a variable

text: Is there a way to take only part of the text from a variable? My specific use case is with the `envlab` package: I want the `\returnaddress` command to omit the last two lines of the `\fromaddress` variable (from `letter.cls`). Something like:               \documentclass[10pt]{letter}     \usepackage[businessenvelope]{envlab}          \renewcommand{\returnaddress}{     %string processing magic such that the output is     %22 Goat Town\\State of Goats     }          \address{22 Goat Town\\State of Goats\\me@privateemail\\1-900-IDENTITYTHEFT}          \makelabels % this command prints envelope labels on the final page of the document          \begin{document}          \begin{letter}{Addressee}     This is my letter.     \end{letter}     \end{document}      I'm working in xelatex.


title: Problem with margins in documentclass article and package graphicx

text: I noticed that using the documentclass `article` and the package `graphicx` changes the displayed margins. Is that problem known and is it possible to avoid it?


title: What "font sets" can I access using packages?

text: I roughly know how fonts work in LaTeX but right know, I don't want to mess with the details. What I do want to do is to use: `\usepackage{[lmodern|palatino|times|...]}` to get matching sets of fonts. What "font sets" -- like Times for text, Helvetica for captions and Courier for code -- are available this way? A pre-existing list would be nice but I suppose we could also maintain one here if none exists yet.


title: pgfplots: externalization and legend referencing

text: There are some issues when using the pgfplots option `legend to name` together with externalization. When I disable externalization, everything works fine. When I enable externalization, I get an error               ! Undefined control sequence.           l.1 ...every legend to name picture/.try]\pgfplots@legend@to@name       and my document wont compile. Without the `legend to name` option, externalization works fine on the other hand. I am using version 1.5 of pgfplots according to `\pgfplotsversion`. A short example follows.               \documentclass{report}          % begin of externalization     \usepackage{pgfplots}     \usetikzlibrary{external}     \usepgfplotslibrary{external}     \tikzset{external/force remake}     \tikzexternalize     % end of externalization          \begin{document}          % example from manual, page 166     \pgfplotsset{footnotesize,samples=10}     \begin{center}% note that \centering uses less vspace...     \begin{tikzpicture}     \begin{axis}[     legend columns=-1,     legend entries={$(x+0)^k$;,$(x+1)^k$;,$(x+2)^k$;,$(x+3)^k$},     legend to name=named, % critical line     title={$k=1$}]     \addplot {x};     \addplot {x+1};     \addplot {x+2};     \addplot {x+3};     \end{axis}     \end{tikzpicture}     %     \begin{tikzpicture}     \begin{axis}[title={$k=2$}]     \addplot {x^2};     \addplot {(x+1)^2};     \addplot {(x+2)^2};     \addplot {(x+3)^2};     \end{axis}     \end{tikzpicture}     %     \begin{tikzpicture}     \begin{axis}[title={$k=3$}]     \addplot {x^3};     \addplot {(x+1)^3};     \addplot {(x+2)^3};     \addplot {(x+3)^3};     \end{axis}     \end{tikzpicture}     \\     \ref{named}     \end{center}     % end of example          \end{document}      Am I missing something?


title: How to draw a shaded sphere?

text: Andrew Stacey pointed out that the Rosetta Code entry "Draw a Sphere" doesn't have a TikZ entry yet. Is there a way to draw a "properly" shaded sphere using TikZ? The `ball` shading would seem an obvious choice, but it uses a circular highlight, which is not what it would look like in reality. So: is there a way to make a sphere that would resemble a white, matte (i.e. non-shiny) ball that is illuminated by a single white light source? This would mainly require getting a non-circular, correctly oriented highlight, I believe. Both Yori's and Altermundus' answer already do a great job at using a "softer" highlight, which looks more believable, but Altermundus' highlight is still circular, and while Yoris' is elliptic, it's not oriented correctly, I think. Compare a circle with the `ball` shading to the example made with Perl 6: ![](http://i.stack.imgur.com/vr3HT.png)               \documentclass{article}          \usepackage{tikz}          \begin{document}          \begin{minipage}{2.5cm}\centering     \scriptsize That's not a sphere.          \tikz{         \fill [black] (-1,-1) rectangle (1,1);         \shade [ball color=white] (0,0) circle [radius=1cm];     }     \end{minipage}%     %     \begin{minipage}{2.5cm}\centering     \scriptsize \emph{That's} a sphere.          \includegraphics[width=2cm]{Sphere-perl6.png}     \end{minipage}     \end{document}


title: How to prevent adding subscript from italicizing the text thereafter?

text: When I try to add subscript(I write O_L and O_R to denote left and right ) in my text all the text after that becomes italicized. Any ideas what might be causing this?


title: Longtables and caption: spacing problem

text: I have been using the `\longtable` environment and I have an issue with the captions.   All captions appear at the bottom of each part of the table, which is the result I wanted. However, there is a quite annoying wrinkle: only the caption at the bottom of the last part of the table is too close to the table border, and I cannot figure out how to control the spacing within `\longtable`. This is the code I have been using:               \begin{document}     \begin{center}     \scriptsize      \begin{longtable}{|p{2cm}|p{4cm}|p{8cm}|}\hline\hline      \multicolumn{1}{|p{2cm}|}{\textbf{Text1}} &      \multicolumn{1}{p{4cm}|}{\textbf{Text2}} &      \multicolumn{1}{p{8cm}|}{\textbf{Text3}}\\ \hline      \endfirsthead          \multicolumn{3}{p{3cm}}     {{\bfseries \tablename\ \thetable{} -- continued from previous page}}\\       \hline\multicolumn{1}{|p{2cm}|}{\textbf{Text1}} &      \multicolumn{1}{p{4cm}|}{\textbf{Text2}} &      \multicolumn{1}{p{8cm}|}{\textbf{Text3}}\\\hline      \endhead          \hline \multicolumn{3}{|r|}{{Continued on next page}} \\ \hline     \caption[Caption]{Caption}\label{label-caption}      \endfoot     \caption[Caption]{Caption}\label{label-caption}      \endlastfoot          \end{longtable}     \end{center}     \end{document}      Any advice is more than welcome! Thanks. I.


title: How to detect whether a command enters math mode behind the scene?

text: Commenting out the `%\usepackage{hyperref}` in the following code snippet will produce some warnings. Using `\usepackage{hyperref}` and `\section{}` to detect whether a command enters math mode may not be applicable for branching logic, such as `\ifthenelse{}{}`.               \documentclass{article}     %\usepackage{hyperref}     \newcommand{\blackbox}{Do you know there is H$_2$O in this black box?}     \begin{document}     \section{\blackbox}     \end{document}      Is there a command, namely `\ContainsMathMode{args}`, to output a boolean value that represent whether or not the argument `args` enters math mode internally?


palatino-Bold, palatino-Roman, palatino-Italic belongs to which package? The `palatino` and `mathpazo` are not well enouugh for me, is there anyone who can help me?


title: How to jump exactly where I click in the toc (the toc links are generated with {hyperref})?

text: I am working on a book that has 6 levels of headings to be shown in the toc: parts, chapters, sections, subsections, subsubsections and paragraphs. To refer to those headings in the toc I am using `hyperref` with the option `linktocpage`. Now, when I click the part and chapter links in the resulting toc, I jump exactly where I supposed to, i.e. to the beginning of the corresponding part or chapter heading. However, when I click anything of section-paragraph range, I go to the beginning of the text right below the corresponding heading, rather than to the beginning of the heading itself, which is hidden in this case above the upper border of the screen. It does not matter where I click: in the toc, parttoc, minitoc, or in the navigation pane of either Acrobat or Evince --- the behaviour is just the same. I wonder if anything can be done about it, as I find this behaviour quite confusing. I am using pdfLaTeX on Suse Linux Desktop 11SP2 with the following preamble:               \documentclass{book}     \frenchspacing     \usepackage[warn]{mathtext}     \usepackage[T2A]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[english,russian]{babel}     \usepackage{indentfirst}     \usepackage{minitoc}     \setcounter{secnumdepth}{-2}     \setcounter{tocdepth}{4}     \usepackage[unicode]{hyperref}     \hypersetup{linktocpage,                     pdfborder = {0 0 0}                 }     \includeonly{01,02}          \begin{document}          \noindent          \frontmatter          \doparttoc     \dominitoc     \tableofcontents          \mainmatter          \part[Документы МСФО с номенклатурой IAS]{Документы МСФО \\с номенклатурой\\ IAS}     \parttoc          \include{01}     \include{02}     \include{03}     ...


title: New line for footnote without blank space

text: Writing texts I found it visually more appealing to type footnotes in a new line, because it enhances the readability of the document. The problem is that it leads to a blank character in the output. Could there anything be done about this problem? So what I write looks like this:               asdf asdf asdf asdf.     \footnote{bla bla bla}     asdf asdf asdf      Note: I am aware that the problem doesnt occur when I place a `%` following the last character (or punctuation) in the previous line. To me that doesnt seem elegant.


title: Line break after header of theorem environment followed by multicols body causes header-body overlap

text: I use TeXLive 2011. I use ntheorem and multicol. In a theorem environment, I want the theorem header to be separated from the body by a line break such that the `multicols`-environment get's that and starts its second column at the same height as the first in the body. This is roughly where the problem came from – in combination with a list from enumitem: ![version 1 – using indentbreak](http://i.stack.imgur.com/fpj6x.png) ![version 2 – using break](http://i.stack.imgur.com/tcwK6.png) However – while writing the question, I noticed it can be cut down to the following minimal code:               \documentclass{scrreprt}         \usepackage{             ntheorem,             multicol,         }          \usepakage{lipsum}          \makeatletter           \newtheoremstyle{indentbreak}             {\item[##1]}             {\item[\rlap{\vbox{\hbox{##3}\hbox{\strut}}}]}     \makeatother          \theoremstyle{indentbreak}     %\theoremstyle{break}     \newtheorem{indentbreaktheorem}{Theorem}          \begin{document}         \begin{indentbreaktheorem}[Talking a lot and a lot and a lot and lot and a lot and a lot and a lot.]             \begin{multicols}{2}                 \lipsum*[1]             \end{multicols}{2}         \end{indentbreaktheorem}     \end{document}      Which looks like this using the self-defined indentbreak environment: ![version 1 – using indentbreak](http://i.stack.imgur.com/7m8KC.png) The break environment yields a similar result (as above with the listings). How can I define a theorem style such that this issue is resolved? I want to stay with ntheorem, but I am also interested in solutions for amsthm.


title: Explaining differences between the folder texmf and texmf-texlive in Ubuntu

text: I have only downloaded a bibtex utility to export the bib entries that cited in the TeX documents. It contains `.dtx` and `.ins`, but the instructions is not really clear enough to install it into my system (Ubuntu 12.04). I have to locate `/usr/share` and find that there are two folders inside. They are `/usr/share/texmf/` and `/usr/share/texmf-texlive/`. I have ever installed additional packages in TeX, so I know the way to update TeX sysem. But in order to add a new utility, I don't know which one of them is better. Currently, I don't see the folder `utils` in both. Could you give me an advice to install the util bibexport please? Any suggestion always appreciates.


title: Remove small kink in tikz picture

text: I have made this graphic using tikz: ![enter image description here](http://i.stack.imgur.com/JKvhO.png) Sourcecode:               \documentclass[]{scrartcl}       \usepackage{tikz}        \usetikzlibrary{shapes, arrows, calc, positioning, fit, external}     \begin{document}          \begin{tikzpicture}[scale = 1.4, domain=-5:5, samples=49, text height=1.5ex, text depth=.25ex]]     \centering     \def\w0{0.7}     \def\z0{1.25}     \def\hype{\w0*sqrt(1 + (\x / \z0)^2)}          \fill[fill=red!10] (-5,0) -- plot(\x,{\hype}) -- plot[domain=5:-5](\x,{- \hype}) -- cycle;     \draw[color=red,very thick] plot (\x,{\hype});     \draw[color=red,very thick] plot (\x,{- \hype});          \draw[color=gray,dashed] plot (\x,{\x * \w0 / \z0});     \draw[color=gray,dashed] plot (\x,{-\x * \w0 / \z0});     \draw[color=black,thick,loosely dashdotted] (-5,0) -- (5,0);          \draw[dashed] (0, 0) -- (0, -2.5);     \draw[dashed] (\z0, 0) -- (\z0, -2.5);     \draw[<->, thick] (0, -2.3) -- (\z0, -2.3) node[midway,above]{$z_r$};          \draw[<->, thick] (0, -\w0) -- (0, \w0) node[midway,fill=white]{$w_0$};     \draw[<->, thick] (\z0, {-sqrt(2)*\w0}) -- (\z0, {sqrt(2)*\w0}) node[midway,fill=white]{$\sqrt{2}\,w_0$};          \node[draw,color=green,thick,circle,minimum size=1.5cm] at (-4.9, 2.8) {};     \end{tikzpicture}          \end{document}      The green circle is just there to mark the problem. How do I remove the kink? It is gone when I specify a low number of samples, but then the hyperbola looks crappy. The more samples, the more pronounced the kink is.


title: Brown paper strip on page 125 of The METAFONTbook

text: I've borrowed a copy of _The METAFONTbook_ from my school's library, and I'm wondering why there is a brown paper strip glued to page 125 between the text and the rings. I couldn't help but wonder if there might be a missing fold-out or something; does anyone have any clue what the strip might be for? I don't see any mention of it in that part of `mfbook.tex`, either...


title: Weekday captions with the TikZ library "calendar"

text: I use the TikZ library `calendar` to produce a week list. The code looks like this:               \documentclass{article}          \usepackage{pgf,tikz}     \usetikzlibrary{calendar}          \begin{document}         \tikz\calendar[dates=2011-02-01 to 2011-02-last,week list];     \end{document}      However, I want to add abbreviated captions for the weekdays (M, T, W, ...) in the first line of the week list:                M  T  W  T  F  S  S         1  2  3  4  5  6      7  8  9 10 11 12 13     14 15 16 17 18 19 20     21 22 23 24 25 26 27     28      I couldn't find any option to the `\calendar` macro which produces this effect. Is there any other solution to achieve my goal?


title: Using counters in macros to manage Beamer overlays

text: I have a very complex Tikz figure that is uncovered piece by piece during my presentation. While tweaking the presentation I decided to change the order of things being uncovered and due to the large amount of \onslide commands it is a pain to get it right. In order to help the situation I tried to create the following two macros:               \newcommand*{\BeamerCounter}[1]{%       \@ifundefined{c@#1}{%         \newcounter{#1}}{}}          \newcommand*{\BeamerNext}[2]{%       \@ifundefined{#1#2}{%         \stepcounter{#1}            \newcommand*{#1#2}{\the#1}}{}}      The idea is that at the top level of my document I would do something like:               \BeamerCounter{Fig}     \BeamerNext{Fig}{Part1}     \BeamerNext{Fig}{Part2}      So that in my figure I can use:               \onslide<\FigPart1>{ .. }     \onslide<\FigPart2>{ .. }     \onslide<\FigPart1, \FigPart2>{ .. }      Minimal (non)working example:               \documentclass{beamer}          \newcommand*{\BeamerCounter}[1]{%       \@ifundefined{c@#1}{%         \newcounter{#1}}{}}          \newcommand*{\BeamerNext}[2]{%       \@ifundefined{#1#2}{%         \stepcounter{#1}         \newcommand*{#1#2}{\the#1}}{}}          \BeamerCounter{Fig}     \BeamerNext{Fig}{Part1}     \BeamerNext{Fig}{Part2}          \begin{document}     \begin{frame}       \begin{itemize}         \item<FigPart1-> item1         \item<FigPart2-> item2       \end{itemize}     \end{frame}     \end{document}      Which yields the following errors:               t.tex:12: You can't use `\spacefactor' in vertical mode.     t.tex:12: leading text: \BeamerCounter{Fig}     t.tex:12: Missing $ inserted.     t.tex:12: leading text: \BeamerCounter{Fig}     t.tex:12: Missing \begin{document}.     t.tex:12: leading text: \BeamerCounter{Fig}     t.tex:13: You can't use `\spacefactor' in math mode.     t.tex:13: leading text: \BeamerNext{Fig}{Part1}     t.tex:13: Missing number, treated as zero.     t.tex:13: leading text: \BeamerNext{Fig}{Part1}     t.tex:13: Missing control sequence inserted.     t.tex:13: leading text: \BeamerNext{Fig}{Part1}     t.tex:13: You already have nine parameters.     t.tex:13: leading text: \BeamerNext{Fig}{Part1}     t.tex:13: You can't use `the letter F' after \the.     t.tex:13: leading text: \BeamerNext{Fig}{Part1}     t.tex:14: You can't use `\spacefactor' in math mode.     t.tex:14: leading text: \BeamerNext{Fig}{Part2}     t.tex:14: Missing number, treated as zero.     t.tex:14: leading text: \BeamerNext{Fig}{Part2}     t.tex:14: Missing control sequence inserted.     t.tex:14: leading text: \BeamerNext{Fig}{Part2}     t.tex:14: You already have nine parameters.     t.tex:14: leading text: \BeamerNext{Fig}{Part2}     t.tex:14: You can't use `the letter F' after \the.     t.tex:14: leading text: \BeamerNext{Fig}{Part2}     t.tex:15: Missing $ inserted.


title: Change font colour of bringhurst chapterstyle in memoir

text: I would like to change the colour of chapter titles in bringhurst chapterstyle. The following should work, but apparantly I have misunderstood something and am not able to get it to work, and would appreciate any pointers.               \documentclass[a4paper]{memoir}      \usepackage{color}          \begin{document}           \chapterstyle{bringhurst}     \renewcommand\chaptitlefont{}{\color{red}}          \chapter{test}           Some text here          \end{document}


title: Tabular in frame: get rid of horizontal spacing

text: I'm trying to surround a tabular with a thick frame:               \setlength\fboxrule{2pt}     \setlength{\fboxsep}{0pt}     \fcolorbox{black}{gray}{         \begin{tabular}{@{}p{2cm}|p{2cm}@{}}             A & B \\ \hline             C & D \         \end{tabular}     }      Although I set `\fboxsep` to `0pt` and use `@{}`, there is _still_ some horizontal margin between the frame and the tabular: ![](http://flyx.org/files/framedtabular.png) I want the horizontal line to reach the frame at both ends. How can I achieve that?


title: Multicol layout with consistent blank column

text: So I am looking to create a standardized test with math questions going down the left side of page with space for figuring on the right side of page. My goal is to get code that is clean, where I would not have to break the text for each page. Here is a sample image of what I am trying to do. If I were to use multicols environment, I would have to break the text every four questions and restart on each page. Is there an easier way to do this? Will a longtable work where I could fill the left cell with all the questions, and have the heading "USE THIS SPACE FOR FIGURING" on each page? Or maybe a absolute positioned node? ![enter image description here](http://i.stack.imgur.com/TxV9n.png) MWE:               \documentclass[letterpaper,twoside,openright]{memoir}     \usepackage{lipsum}     \usepackage{multicol}     \usepackage[bmargin=1in]{geometry}               %---------          Preamble     \newsavebox{\fmbox}     \newenvironment{fmpage}[1]     {\begin{lrbox}{\fmbox}\begin{minipage}{#1}}     {\end{minipage}\end{lrbox}\fbox{\usebox{\fmbox}}} %          \newcommand{\psechead}[1]                   {\vspace*{1in}                   {\noindent                   {\center                    {\textbf{#1}}}}}               %---------          Document     \begin{document}     \psechead{SECTION 2 \\ Time - 35 Minutes \\ 37 Questions \\}                    %---------          Directions          \begin{fmpage}{\textwidth}     \underline{\textbf{Directions:}} In this section there are four possible answers after each question. Choose which one is best. You may use the blank space at the right of the page for figuring problems.          \medskip          \underline{\textbf{Note:}} Figures are not drawn to scale.     \end{fmpage}          %---------          Questions          \end{document}


title: Adding notes to table of contents -- indentation

text: > **Possible Duplicate:**   >  Table of Contents with additional description of entries I'd like to add some notes for every chapter in the table of contents. Have a look at the following minimal compiling example for the idea.               \documentclass{article}     \usepackage{blindtext}          \newcommand{\summary}[1]{\addtocontents{toc}{\textit{#1}}}     \begin{document}     \tableofcontents          \section{First Section}     \summary{This is the introduction. It will make the reader want to continue reading.}          \subsection{Subsection 2.1}     \summary{Here we will explain in detail why this is scientificly important.}               \subsubsection{SubSubsection}     \summary{There are several elements of the argument. This is the first.}          \end{document}      This works great except that I would like to have the notes indented as much as the toc entry they belong to. How to do that?


title: AucTeX Emacs Compilation Problems

text: I installed emacs23 on my Ubuntu 13.10 64-bit system. I also downloaded the AucTeX tarball and installed it (`./configure` then `make` and finally `make install`). Now I get the LaTeX commands in the menu of emacs and the key- bindings also work well. But I am able to compile only in LaTeX mode. That is, to generate the pdf I have to go the directory and give `pdflatex` command in the terminal. Secondly, I tried the **Other** option in the compilation in emacs but pdflatex is not present as a command there. **I would like to run pdflatex directly instead of LaTeX compilation so that it modifies my pdf**. Secondly, I am not able to run XeLaTeX or LuaTeX in emacs as well. These are the compilation options available for me: ![enter image description here](http://i.stack.imgur.com/Pz4yT.png) Also, I tried a sample code, I am able to compile and get the pdf in the terminal using `latex` and `pdflatex` commands but emacs shows me some error. ![enter image description here](http://i.stack.imgur.com/8muKU.png) Here is the code which I ran:               \documentclass[12pt]{article}     \author{Subham Soni S.}     \date{\today}     \title{Installing a new Kernel(ver. 3.13.3) to the Existing Ubuntu Operating System}     \begin{document}     \maketitle     To replace the existing \textsl{kernel} with a new one, do the following:     \begin{enumerate}     \item Download the latest kernel from  \texttt{www.kernel.org}, the files will be compressed in tarball.     \end{enumerate}     \end{document}      The contents of my .emacs file are as follows:               (load "auctex.el" nil t t)     (load "preview-latex.el" nil t t)     (setq TeX-auto-save t)     (setq TeX-parse-self t)     (setq-default TeX-master nil)      I would like to make emacs a complete IDE for LaTeX. What do I need to do?


title: wrapfig position, margin settings

text: I find that the wrapfigure environment is very tricky. It depends on where you put it and if you add things to the top part you can make a good wrapfig bad. I would like to know if there is a way to tell the environment to put a particular figure to be in a particular part of a particular page. I have asked the question before wrapfig how to designate where the figure should come and of what size exactly but for reason people stopped answering, hence asking again... please delete if you give answer there :) also insbox **isn't** working ...


title: In Beamer, gray out \tableofcontents items already shown on previous frames

text: I've got a motivation slide preceding my table of contents slide. So when I show the audience the structure of the remainder of my talk I'd like the `\tableofcontents` to show the motivation slide in gray. The motivation slide is not in the same section environment as the toc slide (and all the following slides). Is there a way to do that?


title: Problem including PDF 1.6 files in XeTeX with MikTeX

text: Here's the MWE for my problem:               \documentclass[11pt]{article}     \usepackage{graphicx}     \usepackage{fontspec}     \setmainfont{Adobe Garamond}          \begin{document}     text     \begin{figure}       \centering     \includegraphics[width=0.5in]{file.pdf}       \end{figure}     \end{document}      I'm trying to compile this using xelatex, and am including file.pdf which is PDF 1.6. When I compile on Ubuntu using TeXLive 2009, I get a warning about the version of the PDF file:               ** WARNING ** Version of PDF file (1.6) is newer than version limit specification.      but the file compiles fine otherwise. However, on MikTeX (v 2.9 64 bit) on cygwin, I get the following message:               ** WARNING ** Version of PDF file (1.6) is newer than version limit specification.     ** WARNING ** No image converter available for converting file "file.pdf" to PDF format.     ** WARNING ** >> Please check if you have 'D' option in config file.     ** WARNING ** pdf: image inclusion failed for "file.pdf".      The versions of xelatex are essentially the same. Some googling indicated a problem with dvipdfmx, but I'm confused as to what this has to do with xelatex. Any help would be greatly appreciated.


title: Automatically framing (or drawing the bounding box of ) a PStricks non-text object

text: Is there a command or macro that can draw and automatically size the bounding rectangle of a `pstricks` object, for example a circle -- framing it tightly in effect, even when the object undergoes transformations such as rotations. For example,                    \documentclass[english, landscape, a4paper]{slides}          \usepackage{pstricks}              \begin{pspicture}(1,-1)(20,17)              \pscircle(5,5){2} % I'd like to draw the bounding box of this object         \end{pspicture}      Edit: the difficulty that I'm having is calculating the dimensions of the frame or bounding box.


title: Problem filling intersection using TikZ

text: I was trying to use TikZ to draw a figure, I want to fill the common area of four circles of which centers are at four points of a square, and the radios for the arc is 0.9772 of the length of square. I use the following code:               \begin{tikzpicture}[scale = 4]     \clip (-0.2, -0.2) rectangle (1.2,1.2);     \begin{scope}[even odd rule]     \clip (0.9772,0) arc (0:90:0.9772);     \clip (0.0228,1) arc (180:270:0.9772);     \fill [fill = green] (0,0) rectangle (1,1);     \end{scope}     \begin{scope}[even odd rule]     \clip (1,0.9772) arc (90:180:0.9772);     \clip (0,0.0228) arc (270:360:0.9772);     \fill [fill = green] (0,0) rectangle (1,1);     \end{scope}     \draw [very thick](0,0) rectangle (1,1);     \draw [very thin] (0.9772,0) arc (0:90:0.9772);     \draw [very thin] (1,0.9772) arc (90:180:0.9772);     \draw [very thin] (0.0228,1) arc (180:270:0.9772);     \draw [very thin] (0,0.0228) arc (270:360:0.9772);     \end{tikzpicture}      However, I got a weird drawing out like this: ![](http://i.stack.imgur.com/PnXTz.png) Why this does not work? I used the similar code generated a similar graph but with a smaller radius, the drawing was generated successfully as this: ![](http://i.stack.imgur.com/8rDTg.png) So can anyone help me out here?


title: Where is PATH modified to include /usr/texbin?

text: I've noticed that my PATH variable includes `/usr/texbin`, as it should, but I can't find any bash files that modified my PATH variable to include it. How did the TeXLive installation modify my PATH variable upon installation without modifying any bash files? I'm running Mac OS X 10.7, TexLive 2011. The only bash files I can find are:               ~/.profile,     /etc/bashrc,     /etc/profile.      None of these contain any modifications to PATH that include `/usr/texbin`. Can anyone educate me?


title: Subfigures in a columnwide figure in a two-column document

text: I am trying to put two figures next to each other in the top of a two-column document. I found the following code on the internet and it works:               \documentclass[10pt,prl,aps,showpacs,twocolumn,unsortedaddress]{revtex4-1}     \usepackage{subfigure}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{commath}     \usepackage{graphicx,bm}     \usepackage{verbatim}          \begin{document}          \begin{figure*}[t]     \setlength{\abovecaptionskip}{17.5 pt plus 4pt minus 2pt}     \mbox{     \subfigure{\includegraphics[scale=.95]{}}\,     \subfigure{\includegraphics[scale=.95]{}}     }     \vspace{-0.6 cm}     \caption{}     \label{}     \end{figure*}          \end{document}      However, I would also like to add captions a) and b) to the two subfigures. Simply inserting \caption into the subfigure environments does not work. Does anyone know how to solve this problem?


title: Clipped bars in a stacked bar chart with pgfplots

text: I want to reproduce the effect from here where the bars are clipped if they are too long. However, I am using a stacked barchart and `restrict y to domain*=0:<value>` does not work. How can I do this? Here is my code:               \begin{tikzpicture}     \pgfplotstableread{     x Order                               m0  m132  m3  m460  m6     0 gtx780-cublas-single 0.57615 0.627627 0.394365 0.811266 1.05492     1 gtx780-mult-single 0.141668 0.315022 0.145579 0.202026 0.253015     4 gtx780-cublas-double 3.784450 10.841200 5.527380 5.881210 8.342070     5 gtx780-mult-double 0.279953 0.918595 0.340272 0.471707 0.422749     8 k40-cublas-single 0.695936 0.831193 0.476254 1.05996 1.26672     9 k40-mult-single 0.193261 0.434555 0.195305 0.303927 0.338011     12 k40-cublas-double 1.004380 2.401120 1.314340 1.560650 2.067400     13 k40-mult-double 0.377453 1.200990 0.377581 0.598974 0.674917     }\datatable                    \begin{axis}[     x post scale=\linewidth/\axisdefaultwidth,     xlabel=Device-Kernel-Precision,     ylabel=Time {[}ms{]},     ymin=0,         % Start y axis at 0     ymax=5,     xmax=16,     xtick=data,     % Use as many tick labels as x coordinates     xticklabels from table={\datatable}{Order},  % Get the labels from the Label column of the \datatable     ybar stacked,     x tick label style={rotate=35,anchor=east},     legend style={at={(0.5,-0.6)},anchor=north,legend columns=-1},     ]          \addplot table [y expr={4 * \thisrow{m0}}, x=x] {\datatable};    % Plot the "First" column against the data index     \addplot table [y=m132, x=x] {\datatable};     \addplot table [y=m3, x=x] {\datatable};     \addplot table [y=m460, x=x] {\datatable};     \addplot table [y=m6, x=x] {\datatable};          \draw[blue] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},1.77394776117234) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},1.77394776117234) node [pos=0.9, below] {GTX780-double};     \draw[red] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},2.12873731340681) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},2.12873731340681) node [pos=0.87, above] {K40-double};          \legend{M0,M132,M3,M460,M6};     \end{axis}     \end{tikzpicture}      Thanks!


title: Problems with numbers in author field

text: I want to cite a book whose author name has numbers. The error is: > Package biblatex Error: Category '4' not declared. My package version is the current.                 @book{aci1966deflections,       title={Deflections of Reinforced Concrete Flexural Members},       author={ACI Committee 435},       year={1966},       publisher={{American Concrete Institute}}       }      Any suggestion to include this kind of reference? ## Update I think it is not the same problem which is linked for duplicating (Category 4 for Category 3). I did what the section 2.3.3 of the biblatex manual says, but it doesn't fix the problem. Meanwhile, there's another expression in the log file:               Package biblatex Warning: File 'Desarrollo.bbl' is wrong format version - expected 2.3       Biblatex version is:               biblatex-dm.cfg blx-compat.def    2013/11/25 v2.8a biblatex compatibility (PK/JW/AB)      What do you think is the problem here?