title: verbatim inside subfloat?

text: When I write the following               \subfloat[caption]{\label{fig:xxxx}\verb+xxxx+}      I get `\verb illegal in command argument`. Seems that isn't possible to define a `verbatim` environment inside a `\subfloat`. When I use `\subfloat[caption]{\label{fig:xxxx}\texttt{xxxx}}` it works, but I need multiple lines, so I have to use `verbatim` What alternatives do I have? Maybe another package?


title: References are positioned under the chapter/section number in HTML using tex4ht

text: I am converting documents to (X)HTML using `tex4ht`. The program works well, but the only thing that doesn't is the references. I included a table of contents and made links using the `hyperref` package. However, when I use the links from the ToC or ref to labels (placed directly under the title), they come out wrong. If I use the article `documentclass`, it doesn't show any section title at all, it just starts with the text. If I use the report `documentclass` it shows the title, but not: 'Chapter #'. Minimal code is:               \documentclass{report}          \usepackage{hyperref}          \begin{document}          \tableofcontents          \chapter{The first chapter}     \label{chap1}     Some text          \chapter{The second chapter}     Some text and \ref{chap1}.          \end{document}      I then used the `MiKTeX` version of `tex4ht`. However, I have tried on MacTeX and this gives the same result. How can I show the full titles when using links?


title: \dot over \vec over : amsmath bug/feature?

text: I was trying to typeset the time derivative of `\vec{r}_\alpha`, and naively, I put it as an argument to `\dot`. This does not work: the arrow is not on `r` anymore. Here is a minimal example:               \documentclass{article}     \usepackage{amsmath}     \begin{document}     \[     \dot{\vec{r}_\alpha}     \]     \end{document}      Note that there is a better way to typeset it (and it works): `\dot{\vec{r}}_\alpha`. I am asking out of curiosity.


title: Are commands defined by \newcommand[.][.]{.} robust?

text: This question is from the comments at the foot of Abbreviations for AM, PM (small caps) for use within \textbf. Readers will get the remaining gist from there. With               \newcommand\cmd[2][0]{\def\y{#1}}     \edef\x{\cmd{1}}      I get               {\edef}          \cmd ->\@protected@testopt \cmd \\cmd {0}          \@protected@testopt #1->\ifx \protect \@typeset@protect \expandafter \@testopt     \else \@x@protect #1\fi     #1<-\cmd     {\ifx}     {true}     {\expandafter}     {\else}          \@testopt #1#2->\kernel@ifnextchar [{#1}{#1[{#2}]}     #1<-\\cmd     #2<-0          \kernel@ifnextchar #1#2#3->\let \reserved@d =#1\def \reserved@a {#2}\def \reser     ved@b {#3}\futurelet \@let@token \@ifnch     #1<-[     #2<-\\cmd     #3<-\\cmd [{0}]          \reserved@a #11#2{->\expandafter \def \expandafter \\cmd \reserved@b #11{     ! Argument of \reserved@a has an extra }.     <inserted text>                     \par     <to be read again>                        }     l.3103 \edef\x{\cmd{1}}          ? x      Is that robustness? See also Is there a robust \renewcommand replacement?.


title: author year style with biblatex

text: I have asked about a specific referencing style and was recommended to use biblatex. I was given a nice answer author order in plainnat but then I would like to make minor changes:   1. The "et al." just in citing, but in references I want full author list for a paper   2. bold volume number   3. delete the "In:" preceding the journal name I would like to know if I can add simple things to the code of the answer :               \documentclass{article}          \usepackage[style=authoryear-comp,firstinits=true]{biblatex}          \DeclareNameAlias{sortname}{last-first}          \renewcommand*{\multinamedelim}{\addcomma\space}     \renewcommand*{\finalnamedelim}{\addcomma\space}          \addbibresource{mybibfile.bib}          \nocite{*}          \begin{document}          \printbibliography          \end{document}


title: Spacing between superscript and left parenthesis

text: I'm wondering why Latex adds an extra space between a superscript and the left parenthesis as in this case               \documentclass{article}     \usepackage{amsmath}     \let\originalleft\left     \let\originalright\right     \renewcommand{\left}{\mathopen{}\mathclose\bgroup\originalleft}     \renewcommand{\right}{\aftergroup\egroup\originalright}     \begin{document}       $\mathscr{P}^{N}\left(\mathscr{K}\right)$     \end{document}      The formula is showed with an unwanted space between the superscript N and the left parenthesis. I've tried the solution drafted in Spacing around \left and \right , however it doesn't work in this case. Any idea? Cheers Guillermo


title: Hyperref and toc problem

text: I'm writing a book (then, document class=book) and the document adds itself the chapters, sections etc, using `\tableofcontents` I get the error: `argument of contentsline has an extra }` I've already added a phantom section, deleted the old files (aux, toc) and it didn't work. I really don't know what else can I do. And I don't think it's necessary to write my code here. There's nothing special; I just made some modifications about the book layout (headers, footers, definition and theorem boxes). Thanks. PS: I compile using PDFLaTeX.


title: Two 'maketitle's in article

text: I'm writing a report with two parts using the `article` class.               \documentclass[a4paper,11pt]{article}     \usepackage[T1]{fontenc}          \usepackage[english]{babel}     \usepackage{amsmath,amsfonts,amsthm}     \usepackage[pdftex]{graphicx}        \usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}     \usepackage{sectsty}     \allsectionsfont{\centering \normalfont\scshape}     \usepackage{fancyhdr}          \title{\huge Title1 \\}     \author{\normalfont                 \normalsize         Author\\                        \normalsize         Supervisors: Prof. X}     \date{}          \begin{document}          \part{Heisenberg Picture}          \maketitle          \section{Section 1}               \clearpage          \part{Schroedinger Picture}          %\maketitle2          \section{Section 1}          \end{document}      I need two parts titled say, `\part{Heisenberg Picture}` and `\part{Schroedinger Picture}`. These parts correspond to `Title 1`,`Supervisor X` and `Title 2`,`Supervisor Y` respectively. How can I redefine the `\maketitle` command to do this? (If it's too complicated, is there an easier method?)


title: Text Underlining and Display Equation Clash in ClassicalThesis/LyX

text: I am unable to underline text (underbar in LyX speak, `\uline{text}` in LaTeX) in the same document in which a display equation (display formula in LyX speak, `\\[ a=b+c \\]` in LaTeX) or pdflatex.exe locks up (Checked in Windows Task Manager). pdflatex.exe is the conversion program in MiKteX called when viewing/exporting the output as .pdf. Very strange! Does anyone else has the same problem? Can anyone else replicate the above clash in their `ClassicThesis` class or is it my 'software combination'? Is there a 'work around'? From my testings this clash does not occur with other equation types, text styles, or document classes. I spent hours identifying it by trial and error, because no error messages were displayed (just locks up pdflatex.exe doing something). I don't have any software problems otherwise. I've tried different math package settings and obvious stuff. Of course I want to underline prose and use display equations in `ClassicThesis`. I am not underlining equations.


title: Error when compiling from Notepad++, but not PowerShell

text: I am currently writing my thesis using an existing template. I am using Notepad++ with `NppExec` to quickly save and compile everything. This had been working properly for a while, but recently I started getting an error sometimes (but not every time). In this template, a counter called `\thechapter` is used to keep track of the current chapter. The error I am getting is that `\thechapter` is undefined when I try to use the `\renewcommand{\thechapter}{6}` command. I do not get this error if I compile from Windows PowerShell. If the information is necessary, I have added `pstool` to the set of packages used, and am compiling with `pdflatex filename --shell-escape` to replace fonts in the figures with the same used in text. The same command is used in NppExec and PowerShell. One works and one sometimes doesn't. Is there a reason for this?


title: Aligning multiple equation environments with cases

text: I have some code that works but I wish to align the environments according to the descriptions. I've tried various combinations of `align`, `equation` and `cases`, but can't seem to find a functional solution.               \begin{equation}       \textit{Initial conditions} \qquad \begin{cases}       C\left(X,0\right) = S\left(X,0\right) = 0\\       C\left(0,T\right) = 1       \end{cases}       \label{eq:dimensionless_initcond}     \end{equation}     \begin{equation}       \textit{Continuous injection} \qquad  C\left(0,T\right) = 1 \label{eq:dimensionless_continuous}     \end{equation}     \begin{equation}       \textit{Finite injection} \qquad C\left(0,T\right) = \begin{cases}       1 \text{ for } 0 < T < T_0\\       0 \text{ for } T_0 < T < \infty       \end{cases}       \label{eq:dimensionless_finite}     \end{equation}      Optimal case would be to have the environments such that both descriptions and equations are left aligned as seen in my badly done `mspaint` picture here: ![optimal case](http://i.stack.imgur.com/Jo7hj.png)


title: Restricting the background color to an ovalbox

text: The snippet               \documentclass[png,convert={density=600}]{standalone}     \usepackage{times,fancybox,varwidth,color}     \pagecolor{cyan}     \cornersize{1}          \begin{document}     \ovalbox{\large Hello}     \end{document}      generates the png image ![Hello](http://i.stack.imgur.com/GaCHR.png) with the help of `pdflatex -shell-escape question`. How do I make the background fill just the ovalbox (while the ovalbox appears with no boundary)?


title: TikZ path decorated with coil or snake

text: A recurrent question on the forum is... How to draw a decorated path without a straight segment at the end? Usually the path described are straight lines (See post1, post2 or post3), but there are also solutions for semi circle paths (see post4). I'm interested in drawing a general path, decorated with a coil and a snake (with an entire number of wave length). I found an interesting solution for snake decoration HERE, however, no clue for coil decoration is given. **Question** How could a general path be decorated with a coil? constrained to have an entire number of wave length. * * * ## Update It has been pointed out by percusse different problems in the definition of my question. So, I'll be less aggressive... **Question v.2.0** Assume that we have a sufficiently smooth path (without vertices or abrupt changes). Additionally, we want the end-points of the path to be centred on the amplitude of the coil. If possible, instead of giving a "wave length" for the coil, we'd like to control the number of turns. How would such a construction be defined?


title: mtpro2 and tikzmark conflict

text: The `\tikzmark` command (as in here) does not work within the `\PARENS` command provided by the `mtpro2` package. Here is a MWE (requiring at least two runs):               \documentclass{article}          \usepackage[lite,subscriptcorrection,slantedGreek,nofontinfo]{mtpro2}     \usepackage{tikz}          \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}          \begin{document}     $$\PARENS{\tikzmark{a}1}$$ %With PARENS          $$\tikzmark{b}(1)$$ %Without PARENS          \tikz[overlay,remember picture] {     \draw (a) circle (1cm); %With PARENS - ends up at the bottom left corner of page     \draw (b) circle (1cm); %Without PARENS - works fine     }     \end{document}      Would appreciate any explanations and/or remedies. Thanks


title: Header paragraph, alignment and column sizing in longtable

text: How can I add a heading paragraph below the title and before the toprule on the table below? When I use \multicolumn and add a paragraph, it doesn't seem to work. I used \table and \tabular before and could put the paragraph before the \tabular command, but I now need to use a longtable as I'm aligning decimals with siunitx, so I can't put the table in a box. How can I fit the table into the page width below and specify column widths to improve the layout? I would like to equally space out the AAA, BBB, CCC, DDD columns, but have a space between the four groups to make it easier to read. When I use the \footnotesize macro, it affects the title and the paragraph of text also, does it? Also, the size of the text in the last paragraph seems to be reduced due to the \footnotesize macro.               \documentclass[oneside,12pt]{article}          %tables     \usepackage{booktabs}     \usepackage{longtable}     \usepackage{siunitx} %align numbers by decimal point     \usepackage{lipsum}     \begin{document}          \sisetup{table-format = -1.2}          \setlength{\tabcolsep}{2pt}     \lipsum[1]     \footnotesize{     \begin{longtable}{     l      S[table-format = <1.3]     S[table-format = <1.3]     S[table-format = <1.3]@{\hskip 0.2cm}     S[table-format = <1.3]     S[table-format = <1.3]     S[table-format = <1.3] @{\hskip 0.2cm}     S[table-format = <1.3]     S[table-format = <1.3]     S[table-format = <1.3]@{\hskip 0.2cm}     S[table-format = <1.3]     S[table-format = <1.3]     S[table-format = <1.3]}          \caption[Table title]{Table title} \label{treeSummary} \\              \multicolumn{13}{s}{\lipsum[1]}  \\          \toprule     & \multicolumn{6}{c}{First Group}                                 & \multicolumn{6}{c}{Second Group} \\     & \multicolumn{3}{c}{AB}  & \multicolumn{3}{c}{CD} & \multicolumn{3}{c}{EF} & \multicolumn{3}{c}{GH}\\     \midrule      & \multicolumn{1}{c}{AAA} & \multicolumn{1}{c}{AAA} & \multicolumn{1}{c}{AAA}  & \multicolumn{1}{c}{BBB} & \multicolumn{1}{c}{BBB} & \multicolumn{1}{c}{BBB} & \multicolumn{1}{c}{CCC} & \multicolumn{1}{c}{CCC} & \multicolumn{1}{c}{CCC} & \multicolumn{1}{c}{DDD} & \multicolumn{1}{c}{DDD} &  \multicolumn{1}{c}{DDD}      \\          One         &    2.72  &     1.11  &     0.163 &     1.03  &     1.70   &    0.087 &     0.18  &     0.11  &     {$<$}0.001     &    0.47  &     1.14  &     0.063 \\     Two         &    1.65  &     2.62  &     0.084 &     1.37  &     1.38  &     0.095 &     0.11  &     0.14  &     0.124 &     0.54  &     0.58  &     0.174 \\     Three           &    2.39  &     1.57  &     0.331 &     1.77  &     1.95  &     0.007 &     0.83  &     0.24  &     {$<$}0.001     &    1.18  &     1.07  &     0.004 \\     Four        &    1.05  &     {--}   &       {--}   &     2.72  &     2.99  &     0.144 &     0.07  &     {--}   &    {--}      &     1.67  &     1.40   &   {$<$}0.009 \\     \noalign{\vskip 5pt}        Sum     &    0.660 &     0.004 &           &     {$<$}0.001 &    0.245 &           &     {$<$}0.001 &    {$<$}0.001 &          &    {$<$}0.001 &     0.010 &        \\          \bottomrule     \end{longtable}     }     \lipsum[1]     \end{document}


title: Understanding differences between newtheorem and newenvironment

text: The difficulty that I am having is that I make a newtheorem:               \newtheorem{definition}[theorem]{Definition}      It however seems to act nearly the same as with newenvironment:               \newenvironment{definition}[1][Definition]{\begin{trivlist}     \item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}      so why would I use one over the other? as far as the manipulating them goes, I find resources for `newtheorem` with all sorts of combinations of arguments i.e.:               \newtheorem{theorem}{Theorem}[section]     \newtheorem{lemma}[theorem]{Lemma}     \newtheorem{proposition}[theorem]{Proposition}     \newtheorem{corollary}[theorem]{Corollary}      which looks similar to the `newenvironment` setup except that we have an [1] in front of [Definition] in `newenvironment` which I am guessing is taking in an argument and thus could be expanded to several. Also there seems to be a bunch of stuff defined in the 3'rd item of newenvironment where - `\begin{trivlist}\item[\hskip \labelsep {\bfseries #1}]{\end{trivlist}` is defined. Are `newtheorem`s arguments already defined in the system or something and not expandable to multiple arguments - is that one of the differences? Anyways I am just trying to figure out when to use `newtheorem` and when to use `newenvironment`


title: Switching math fonts and back to normal fails in figures?

text: For my current document I want to use a normal serif font for the main text. Most diagrams from other sources and myself are with sans serif fonts (TeX Gyre Heros). Now I want to use `pgfplots` to create figures using these fonts but keep the math in the main text in the normal font. Something similar has been achieved with `sansmath` here but this does not switch to completely different font, as I am trying here. I thought with `unicode-math` I can switch back and forth easily but the switching back part fails. My MWE looks as follows:               \documentclass{article}          \usepackage{pgfplots}     \usepackage{fontspec}     \usepackage{unicode-math}     \setmathfont{Latin Modern Math}          \begin{document}          \begin{figure}         \sffamily         \setmathfont{TeX Gyre Heros}           \setmathfont[range=\mathit/{latin, Latin, greek, Greek}]{texgyreheros-italic.otf}          \begin{tikzpicture}             \begin{axis}                 \addplot [blue] coordinates { (0,0) (1,2) };             \end{axis}             \node at (4, 1) { $\Delta T_{\mathrm S}$};             \node at (2, 5) {normal sans serif text};         \end{tikzpicture}         \rmfamily         \setmathfont{Latin Modern Math}       \caption{Some caption text.}     \end{figure}          Normal text in Latin Modern Roman here but math fails unless the next line is used.     %\setmathfont{Latin Modern Math}      \begin{equation}     a^2 + b^2 = c^2     \end{equation}          \end{document}      and gives the following output: ![enter image description here](http://i.stack.imgur.com/Co8MT.png) Thank you for any hints, why the switching back fails and comments in general how this might be improved.


title: Beamer: display previous graphics (in an overlay) in a lighter color

text: With Inkscape ( _software to create vector images_ ) I created a file with several layers. Thanks to a very useful script ( _beamerscape_ ), these layers are then saved as separate PDF files. Next, using _overlay_ , the layers step- by-step appear as overlaying graphics in the presentation, like this:               \documentclass{beamer}          \usepackage[absolute,overlay]{textpos}     \textblockorigin{0mm}{0mm}          \begin{document}          \begin{frame}[t]{Some title...}     Some text...     \transdissolve<3,5,7>          % Layer "1<1-2,8>"     \pgfdeclareimage[width=\paperwidth]{Layer1}{Figures/Layer1}     \begin{textblock}{1}(0,0)     \pgfuseimage<1-2,8>{Layer1}     \end{textblock}          % Layer "2<2-4,8>"     \pgfdeclareimage[width=\paperwidth]{Layer2}{Figures/Layer2}     \begin{textblock}{1}(0,0)     \pgfuseimage<2-4,8>{Layer2}     \end{textblock}          % Layer "3<4-6,8>"     \pgfdeclareimage[width=\paperwidth]{Layer3}{Figures/Layer3}     \begin{textblock}{1}(0,0)     \pgfuseimage<4-6,8>{Layer3}     \end{textblock}          % Layer "4<6-7,8>"     \pgfdeclareimage[width=\paperwidth]{Layer4}{Figures/Layer4}     \begin{textblock}{1}(0,0)     \pgfuseimage<6-7,8>{Layer4}     \end{textblock}          \end{frame}          \end{document}      As you can see, the first layer only appears in steps 1 and 2 (the _transdissolve_ effect isn't necessary of course). What I would like is that in step 2, so **after** step 1, this first layer is displayed in a lighter color (so a little transparent, like the `\uncover` command can do with for instance lists or equations). Likewise, the second layer should appear in step 2 just as it is, and then in step 3 and 4 (or perhaps only step 4) fade to a lighter color. As example for the graphics, imagine layer 1 as a full circle, and layer 2 as a part of this full circle. When layer 2 overlaps layer 1 (as would be the case in step 2 in this example), you won't notice the transition to step 2 because this "part of a circle" is just displayed on top of the complete circle. It is, by the way, not a solution to display layer 1 just in step 1 (and then display only layer 2 in step 2) -- I really want to display the full circle, layer 1, in a lighter color in step 2, with layer 2 (part of the circle) on top of it.


title: Introducing a blank area in the header with a0poster

text: I'm writing a poster with `a0poster` and have to make the poster according to the conference instruction. In the header, left of the title, I have to leave some space so that the organizing committee can insert information, but I couldn't do it. Below is the code I'm using. How can I modify it to introduce the space? Thanks for your help.               \documentclass[portrait,a0b,final]{a0poster}     \usepackage{epsfig}     \usepackage{pstricks,pst-grad}     \usepackage{amsmath,amsthm,amssymb,epsfig,multirow}     \usepackage[brazil]{babel}     \usepackage{alltt}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{mathpazo}     \usepackage[divps]{psfrag}     \usepackage{multicol}     \usepackage{maybemath}     \newcommand{\nx}{\ensuremath{\mbox{\boldmath$x$}}}     \newcommand{\nX}{{\bf X}}     \newcommand{\vbeta}{\ensuremath{\mbox{\boldmath$\beta$}}}     \newcommand{\vtheta}{\ensuremath{\mbox{\boldmath$\theta$}}}     \newcommand{\tr}{\ensuremath{{\mbox{\it{\tiny T}}}}}     \newcommand{\R}{\ensuremath{I\!\!R}}          % Definition of some variables and colors     \setlength{\columnsep}{4cm}     \setlength{\columnseprule}{0.2mm}     \setlength{\parindent}{0.0cm}          %%%  Background     \newcommand{\background}[3]{         \newrgbcolor{cgradbegin}{#1}         \newrgbcolor{cgradend}{#2}         \psframe[framearc=0.1,fillstyle=gradient,gradend=cgradend,       gradbegin=cgradbegin,gradmidpoint=#3](0.,0.)(1.\textwidth,-1.\textheight)     }          %%%  Poster     \newenvironment{poster}{       \begin{center}       \begin{minipage}[c]{0.98\textwidth}     }{       \end{minipage}       \end{center}     }          %%%  pcolumn     \newenvironment{pcolumn}[1]{       \begin{minipage}{#1\textwidth}       \begin{center}     }{       \end{center}       \end{minipage}     }          %%%  box     \newcommand{\pbox}[4]{     \psshadowbox[#3]{     \begin{minipage}[t][#2][t]{#1}     #4     \end{minipage}     }}          \begin{document}          \background{1. 1. 1.}{1. 1. 1.}{0.5}     \vspace*{5.5cm}     \newrgbcolor{white}{1. 1. 1.}          \definecolor{darkgreen}{cmyk}{0.9,0,0.9,0}          \definecolor{whitegreen}{cmyk}{0.3,0,0.3,0}          \begin{poster}          %%% Header     \begin{center}     \begin{pcolumn}{0.99}          \pbox{0.95\textwidth}{}{linewidth=2mm,framearc=0.3,linecolor=darkgreen,fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,gradmidpoint=1.0,framesep=1em}{          %%% Unisiegel     \begin{minipage}[c][9cm][c]{0.1\textwidth}       \begin{center}         \scalebox{1.0}{\includegraphics{LogoUSP.EPS}}       \end{center}     \end{minipage}     %%% Title     \begin{minipage}[c][9cm][c]{0.78\textwidth}       \begin{center}           {\sc \begin{LARGE}\textbf{TITLE}\end{LARGE}}\\[10mm]         {\Large Author1$^{1}$, Author2$^{1}$ and Author3$^{1}$\\[7.5mm]         $^{1\,}$University\\[7.5mm] e-mail1; e-mail2; e-mail3}       \end{center}     \end{minipage}     %%% GK-Logo     \begin{minipage}[c][9cm][c]{0.1\textwidth}       \begin{center}         \scalebox{0.6}{\includegraphics{LogoIBS.EPS}}       \end{center}     \end{minipage}          }     \end{pcolumn}     \end{center}          \vspace*{4.5cm}          \begin{multicols}{3}     \baselineskip 32pt          \begin{center}\pbox{.8\columnwidth}{}     {linewidth=2mm,framearc=0.1,linecolor=darkgreen,fillstyle=gradient,gradangle=0,gradbegin=white,gradend=whitegreen,gradmidpoint=1.0,framesep=1em}     {\begin{center}\begin{Large}\textbf{Introduction}\end{Large}\end{center}}\end{center}\vspace{1.0cm}     \begin{itemize}     \item 1.     \item 2.     \item 3.     \end{itemize}          \end{multicols}     \end{poster}     \end{document}


title: How do one reset the section numbers in beamer?

text: I want to reset the section numbers when a part in beamer starts. So I tried:               \setcounter{section}{0}      That does not work. So after searching I found this:               \makeatletter     \numberwithin{section}{part}     \AtBeginPart{\beamer@tocsectionnumber=0\relax}     \makeatother      at Easier support for numbering sections within parts It worked once or twice then I started cleaning up and now it can't get to work anymore. I tried to move it into the document and to the preamble. I also change the numbering and title of the part, but I don't know if that would influence it. An MWE:               \documentclass{beamer}          \setbeamerfont{block title}{size={}}     \setbeamercolor{titlelike}{parent=structure,bg=white}          \usetheme[]{Frankfurt}          \setbeamertemplate{navigation symbols}{}               \AtBeginSection[]{\begin{frame}\frametitle{Agenda}\tableofcontents[currentsection,hideallsubsections]\end{frame}}          \AtBeginDocument{\renewcommand*{\partname}{Theme}}               \begin{document}     \makeatletter     \numberwithin{section}{part}     \AtBeginPart{\beamer@tocsectionnumber=0\relax}     \makeatother               \AtBeginPart{\frame{\partpage}}          \setcounter{part}{2}     \setcounter{section}{0}     \part{1st}     \section{First}     \begin{frame}     First     \end{frame}          \setcounter{part}{3}     \setcounter{section}{0}     \part{2nd}     \section{First}     \begin{frame}     First     \end{frame}          \end{document}


title: How can I randomize a text itemization in ConTeXt?

text: I've defined my item groups as:               \defineitemgroup[institm]      \setupitemgroup[institm][1][text][symbol=2, indentnext=no, ]      And               \startinstitm     {\bf Contributors }          \item Foo Pty Ltd {\sc nsw}     \item Bar Pty Ltd {\sc vic}     \stopinstitm      This produces a very lovely "block" of text. However, the "random" command does not seem to be working in version: `2012.05.30 11:26` Is it worth the effort of moving away from TeXlive to get the random command working?


title: Which packages should be loaded after hyperref instead of before?

text: The `hyperref` documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors. However, there are exceptions, for instance the `amsrefs` user's guide notes that `amsrefs` has to be loaded _after_ `hyperref`. To avoid problems when adding hypertext functionality: do you know further such exceptions?


title: Error using hyperref, cleveref and \newtheorem: no counter defined

text: Here's my problem: I'm writing some mathematics lecture notes. I needed some different theorem types, such as propositions, lemmas, plus observations, examples and definitions whose numbering depends on theorems. Plus, I'm Italian, and wanted custom output labels for those. So I declared them as follows (found that solution probably here on StackExchange, even if I can't find the question right now).               \theoremstyle{plain}     \newtheorem{thm}{Teorema}[chapter]          \theoremstyle{definition}     \newtheorem{defn}[thm]{Definizione}     \newtheorem{exmp}[thm]{Esempio}     \newtheorem{obs}[thm]{Osservazione}     \newtheorem{prop}[thm]{Proposizione}     \newtheorem{lemmy}[thm]{Lemma}      However, right now, I get some problems with their numbering when using both the `hyperref` and `cleveref` packages. I want to use those to refer to a Proposition or such made somewhere before, such that I can be automatically redirected to where it is written by clicking on it, but with the link label automatically presenting the theorem type (Lemma, Osservazione and such), and eventually changing automatically if I decide to rename Lemma to, say, Short Theorem. I made a short example:               \documentclass[twoside]{book}     \usepackage{amsthm}     \usepackage{cleveref}     \usepackage{hyperref}           \usepackage{mathtools}          \theoremstyle{plain}     \newtheorem{thm}{Teorema}[chapter]          \theoremstyle{definition}     \newtheorem{lemma}[thm]{Lemma}          \begin{document}     \chapter{Chapter}     \begin{lemma}     \label{foo}Proposition here     \end{lemma}          As stated in \hyperref[foo]{ \cref*{foo}}          \end{document}      Even if I replace `\cref` with `\ref` here, not actually using `cleveref`, I get the error anyway, so it depends just on the packages declaration. The error I get is the following:               ! LaTeX Error: No counter 'l' defined      If I replace "lemma" with "observation" I get the same error with counter 'o', and so on. Practically, it sees the first letter of the name of the theorem type I have declared as the counter, or something similar. Has anyone got any clue on how to get rid of this conflict?


title: Are subcaption, cleveref and hyperref compatible?

text: I tried with this MWE:               \documentclass{article}          \usepackage{caption,subcaption}     \usepackage{cleveref}     \usepackage{hyperref}          \begin{document}          See \cref{subfig1}, \ref{subfig1}          \begin{figure}      \subcaptionbox{Subfigure\label{subfig1}}       {A FIGURE}     \caption{Figure}     \label{fig1}     \end{figure}          \end{document}      Without `hyperref`, all is nice, with `hyperref` I get ?? for the `\cref` instance. I tried installing the latest versions of all three packages, nothing changed apparently.


title: {tabular} styled like blocks in beamer.cls based upon booktabs.sty markup

text: # `beamer` tables In Table looking like a block, two methods are shown to give tables a look similar to the `block` environment in the `beamer` class. Both require that header and content rows are split: the former is put into the argument of `\begin{block}`, the latter makes the content of that environment. The slightly adapted code is repeated below for convenience.               \documentclass[xcolor=table]{beamer}       \usetheme{Berlin}       \setbeamertemplate{blocks}[rounded][shadow=true]     \usepackage{tikz}          % reuse table markup     \mode<article>{       \usepackage{booktabs}     }     \mode<presentation>{       \definecolor{TableHeader}{RGB}{38,38,134}       \definecolor{TableBody}{RGB}{233,233,243}       \newcommand{\midrule}{\rowcolor{TableBody}}% ≈ \hline       \newcommand{\toprule}{\rowcolor{TableHeader}}% ≈ \firsthline       \newcommand{\bottomrule}{}% ≈ \lasthline     }          \begin{document}          %% zebra-striped tables     \rowcolors{1}{}{yellow}          \begin{frame}[t]{Problem: mismatched \texttt{tabular} and \texttt{block} style}     \begin{center}     \begin{tabular}{*2{p{0.45\textwidth}}}     % Header row:       \toprule       Left Header Cell & Right Header Cell \\        \midrule     % Content rows:       \begin{itemize}\item a \item b\end{itemize} &       \begin{enumerate}\item c \item d \end{enumerate} \\       e & \alert{f} \\        \bottomrule     \end{tabular}     \end{center}     \begin{block}{Block caption}       Block contents     \end{block}     \end{frame}          \begin{frame}[t]{Method 1: split \texttt{tabular}}     \begin{block}{% Header row:     \begin{center}     \begin{tabular}{*2{p{0.45\textwidth}}}       \toprule       Left Header Cell & Right Header Cell \\    % don’t put \midrule or \hline here     \end{tabular}     \end{center}%     }     % Content rows:     \begin{center}     \begin{tabular}{*2{p{0.45\textwidth}}}       \midrule       \begin{itemize}\item a \item b\end{itemize} &       \begin{enumerate}\item c \item d \end{enumerate} \\       e & \alert{f} \\        \bottomrule     \end{tabular}     \end{center}     \end{block}     \end{frame}          \begin{frame}[t]{Method 2: aligned TikZ blocks}     \tikzset{blocknode/.style={inner sep=2,text width=0.5\textwidth,below right}}     \begin{block}{\tikz{% Header row:       \node[blocknode] {Left Header Cell};        \node[blocknode] at (0.5\textwidth,0) {Right Header Cell};     }}% Content rows:     \begin{tikzpicture}       \node[blocknode] {\begin{itemize}\item a\item b\end{itemize}};       \node[blocknode] at (0.5\textwidth,0) {\begin{enumerate}\item c\item d\end{enumerate}};       \node[blocknode] at (0,-2) {e};       \node[blocknode] at (0.5\textwidth,-2) {\alert{f}};     \end{tikzpicture}     \end{block}     \end{frame}          \end{document}      # Implicit table markup Common tables often use horizontal lines either generated by `\\*hline` or by `\\*rule` if one uses the `booktabs` package like one should. Usually the header row is bordered by two rules, sometimes the header contains severals rows. At the bottom there maybe is a footer row to indicate sums or similar which is also surrounded by horizontal lines. There hardly ever is another line necessary in tables that are simple enough to appear in screen presentations.               % vertically structured table     \begin{tabular}{…}     \firsthline     Header rows \\     \hline     Content rows \\     \hline     Footer rows \\     \lasthline     \end{tabular}     % … with booktabs.sty     \begin{tabular}{…}     \toprule     Header rows \\     \midrule     Content rows \\     \midrule     Footer rows \\     \bottomrule     \end{tabular}      # Questions In dual-use (`\mode` switch) documents that shall be used for generating a presentation and a print handout (but also in general):   1. Can one reuse this implicit table markup to get tables just look like blocks without actually wrapping each one inside another environment?      1. `block` (after being split up)     2. `tikzpicture`   2. Should one better introduce semantic markup for tabular structures? **Complication 1:** Sum rows should also get a different background color and – depending on theme – rounded corners at the bottom left and right. **Complication 2:** Zebra striping (`\rowcolors`) and manual row highlighting (either `\hline`/`midrule` or `\rowcolor`) should work. So the TikZ solution is probably out.


title: Using xypic to draw a Hasse diagram

text: I'd like to use xypic to draw a Hasse diagram similar to this one: ![enter image description here](http://i.stack.imgur.com/Zlbnf.png) which was generated with the following code:               \documentclass{article}     \usepackage[all]{xy}     \begin{document}     \[     \xymatrix{     s_{2,0} \ar@{-}[d] \ar@{-}[drrr] & &     s_{2,1} \ar@{-}[dl] \ar@{-}[dr] & &     s_{2,2} \ar@{-}[dlll] \ar@{-}[d] \\     s_{1,0} \ar@{-}[drr] &     s_{1,1} \ar@{-}[dr] &&     s_{1,2} \ar@{-}[dl] &     s_{1,3} \ar@{-}[dll] \\     & & s_{0} & & }     \]     \end{document}      The only problem is that there's too much space between the second and third entries of the second row. I'm using five columns, obviously, because I have an odd number of entries on the first and third rows. Is there any way to close that gap? In the diagram above, it isn't a big deal, but that diagram was just my first attempt at getting the code right. Here's the actual diagram: ![enter image description here](http://i.stack.imgur.com/MqCjG.png) _Yikes!_ It doesn't even fit on the page! (That's the page border on the right, as shown in my PDF viewer.) It was generated using the same code as the above, except with an extra command to generate the ordered triples. Here's an example of the kind of thing I'm looking to do: ![enter image description here](http://i.stack.imgur.com/ByTG7.png) Note the equal space between the four entries of the second row. This diagram is from a great discussion on using TikZ to draw Hasse diagrams, but I'd prefer to use xypic. For some reason, TikZ doesn't want to cooperate with my installation. I tried to make my diagram with the following code, using the TikZ example as a model:               \documentclass{article}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}[scale=.7]     \node (20) at (-3,2) {$s_{2,0}$};     \node (21) at (0,2)  {$s_{2,1}$};     \node (20) at (3,2)  {$s_{2,2}$};     \node (10) at (-3,0) {$s_{1,0}$};     \node (11) at (-1,0) {$s_{1,1}$};     \node (12) at (1,0)  {$s_{1,2}$};     \node (13) at (3,0)  {$s_{1,3}$};     \node (00) at (0,-2) {$s_{0}$};     \draw (00) -- (10) -- (20) -- (12) -- (00) --(11) -- (22) -- (13) --(00);     \draw (10) -- (21) -- (13);     \end{tikzpicture}     \end{document}      But no luck when compiling:               ! Undefined control sequence.     l.1837 \pgfdeclareplotmark                               {ball}      Perhaps the LaTeX installation on my ancient OpenBSD server is out of date, but upgrading it is a daunting proposition, so I'd prefer to use xypic if possible.


title: why aren't the \left and \right before my parentheses changing their size?

text: I am working on a document, and in only one case have the `\left` and `\right` before my parentheses seemed to do anything. For example, I have this equation: `\begin{equation} \mathbb{E}(RS_{nd}) = (1-F(p_k + g^*(\tau, k\tau)))^{k-1}\left(\left(\left(1-PR[S]\right)+PR[S]\left(1-F\left(\hat{p}_k\right)\right)\right)\left(p_k-c\right)\right) \end{equation}` and it produces this output ![enter image description here](http://i.stack.imgur.com/jkFHp.jpg) Why aren't the parenthesis displayed in different sizes? I am sorry for the long equation -- it seems to be mostly a problem in my longer equations. All the parentheses seem to match up with each other. Any ideas? T


title: Making chart grids be finer grained

text: For the MWE below:               \documentclass{report}     \usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage[T1]{fontenc}     \usepackage{tikz,pgf}               \usepackage{pgfplots}     \usepackage{slashbox}     \usepackage{bchart}               \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%         decorations.pathreplacing,decorations.pathmorphing,shapes,%         matrix,shapes.symbols,automata}          \begin{document}          \begin{figure}[H]     \begin{tikzpicture}     \begin{axis}[%     scaled y ticks = true,     width=1*\textwidth,     height=8cm,     xlabel={Query},     ylabel={Elapsed Time (in seconds)},     xmajorgrids,     ymajorgrids,     zmajorgrids,     enlarge x limits=0,     scaled x ticks = true]     \addplot [     color=red,     solid,     line width=1.0pt     ]     coordinates{     (0,10)     (1,4)     (2,5)     };     \end{axis}     \end{tikzpicture}     \caption{Blah}     \end{figure}          \end{document}      How can I make the grids finer grained ?


title: table alignment question

text: I have a table that currently looks like this: ![enter image description here](http://i.stack.imgur.com/CFrTc.png) Code               \begin{table}[H]     \caption{Muuntajan nimellisarvot ja ylajannitepuolelta mitatut arvot}     \centering     \begin{tabular}{llr}     \toprule          Nimellisarvot & Tyhjakayntikoe & Oikosulkukoe \\     \midrule     $S_N=\SI{1000}{\kV\A}$ & $U_0=U_{N1}$ & $U_k=\SI{360}{\V}$ \\     $U_{N1}=\SI{6000}{V}$ & $I_0=\SI{1.67}{\ampere}$ & $I_k=I_{N1}$ \\     $U_{N2}=\SI{400}{\volt}$ & $P_0=\SI{1550}{\watt}$ & $P_k=\SI{8200}{\W}$ \\     $f_N=\SI{50}{\hertz}$ & &  \\     \bottomrule     \end{tabular}     \end{table}      How can i align my expressions neatly. I want the "equals" sign to be centered


title: How to properly display translated strings defined in a dictionary in both section titles and bookmarks?

text: From section titles and bookmarks point of view, translated strings from `translator` package behave differently, depending if they are defined directly within the `.tex` file or in a dictionary: in the latter case, both section title and bookmark just display the key of the translated string instead of the translation. ## Case _okay both_ in section title and in bookmark In the following MCE, a translated string _directly defined_ within the `.tex` file is used in a section title _via the`\translatelet` macro_:               \documentclass[english]{article}     \usepackage{translator}     \usepackage{babel}     \usepackage{hyperref}     %     \deftranslation[to=English]{key-from-document}{translation from document}     %     \translatelet\MacroFromDocument{key-from-document}     %     \begin{document}     \section{\MacroFromDocument}     Indirect (macro) use of \verb|\translate| (from document).     \end{document}      This case is   * okay in section title,   * okay in bookmark, as the translation "translation from document" appears in both of them ## Case _okay_ in section title but _not okay_ in bookmark In the following MCE, a translated string _directly defined_ within the `.tex` file is used in a section title _directly with_ `\translate`:               \documentclass[english]{article}     \usepackage{translator}     \usepackage{babel}     \usepackage{hyperref}     %     \deftranslation[to=English]{key-from-document}{translation from document}     %     \begin{document}     \section{\translate{key-from-document}}     Direct use of \verb|\translate| (from document).     \end{document}      This case is:   * okay in section title: the translation "translation from document" appears in it,   * _not_ okay in bookmark: the translation is replaced by the key "key-from-document". ## Case _not okay_ both in section title and in bookmark In the following MCE, a translated string _defined in a dictionary_ is used in a section title _via the`\translatelet` macro_ and _directly with_ `\translate`:               \begin{filecontents}{mydictionary.dict}     \ProvidesDictionary{mydictionary}{English}     \deftranslation{key-from-dictionary}{translation from dictionary}     \end{filecontents}     %     \documentclass[english]{article}     \usepackage{translator}     \usepackage{babel}     \usepackage{hyperref}     %     \deftranslation[to=English]{key-from-document}{translation from document}     \translatelet\MacroFromDictionary{key-from-dictionary}     %     \begin{document}     \section{\MacroFromDictionary}     Indirect (macro) use of \verb|\translate| (from dictionary).     \section{\translate{key-from-dictionary}}     Direct use of \verb|\translate| (from dictionary).     \end{document}      This case is:   * _not_ okay in section titles: the translation is replaced by the key "key-from-document",   * _not_ okay in bookmarks: the translation is replaced by the key "key-from-document". All the wrong cases are related to the hyperref warning: "Token not allowed in a PDF string (PDFDocEncoding): [...] removing `\translate ' on input line [...]" but I can't figure out how to solve it.


title: moderncv modify right margin or length of cvitem

text: I am trying to edit my resume, and I have trouble managing the spacing on the cvitem. I'd like it to be of a shorter length, more specifically I want the line ending to be less than the other elements. ![enter image description here](http://i.stack.imgur.com/8hO9W.png) Here I have an itemize inside the cvitem. Basically I want the entire cvitem to be of shorter length. I tried modifying some of the moderncv classes, but to no avail. Help appreciated. Thanks! EDIT: The code here                   \documentclass[12pt,a4paper,sans]{moderncv}              \usepackage{verbatim}              % moderncv themes         \moderncvtheme[blue]{banking}                 % optional argument are 'blue' (default), 'orange', 'red', 'green', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)         %\moderncvtheme[green]{classic}                % idem              % character encoding         \usepackage[utf8]{inputenc}                   % replace by the encoding you are using              % adjust the page margins         \usepackage[scale=0.93]{geometry}         .....         \begin{document}         ....         \cvitem{Projects}{\begin{itemize}          \item \textbf{Porting packages to Image Packaging System in OpenSolaris} \newline{} Sun Microsystems Internship. Ported applications such as Parcellite, VLC to the IPS in OpenSolaris. Published in Fibonacci, Vol 1, SF-FOSS, IIITM, Gwalior, India \end{itemize}}         \end{document}


title: \ref with tight box surrounding the reference

text: How can I make the colored box around a reference appear completely tight? MWE:               \documentclass[a4paper,twoside,openright,final,12pt]{book}     \usepackage{etex}     \usepackage[english]{babel}     \usepackage[cp1250]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{charter}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[framed, thmmarks]{ntheorem}     \usepackage{hyperref}         \hypersetup{bookmarksopen=true,pdfpagelayout=TwoPageRight}     \usepackage[top=2.4cm, bottom=2cm, left=2cm, right=2cm]{geometry}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \theoremheaderfont{\bf \large}  %%     \theoremseparator{:}            %%     \theorembodyfont{\normalfont\it}%%     \theoremstyle{plain}            %%     \newtheorem{envThm}{Theorem}    %%     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          \begin{document}         \thispagestyle{empty}         \begin{envThm}\label{thm1}~\\             {\rm\textbf{a)}} Bla bla bla.\\             {\rm\textbf{b)}} Bla bla bla.\\             {\rm\textbf{c)}} Bla bla bla.         \end{envThm}               bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla \ref{thm1} bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla \hyperref[thm1]{\ref*{thm1}.b)} bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla \hyperref[thm1]{\ref*{thm1}.a)} bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla $bla bla bla \overset{\scriptscriptstyle\hyperref[thm1]{\ref*{thm1}.b)}}{=} bla bla bla$ bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla     \end{document}       Instead of ![enter image description here](http://i.stack.imgur.com/oxp5P.jpg), I wish to have ![enter image description here](http://i.stack.imgur.com/Fds8q.jpg). And if I later conclude that this is too tight, but I still want it to be tight, just not completely, how do I regulate tightness?


title: How do I cite author in LaTeX?

text: How do I cite authors in LaTeX? I tried using `natbib` package ---- `doc.tex` ----               ...     \usepackage{natbib}     ...     \citeauthor{736184}     ...      ---- `doc.bib` ----               @inproceedings{736184,          author = {Broder, Andrei Z.},     ...      but all I get is **(author?)** (in bold).


title: Issue wrapping a titlesec titleformat in a newcommand

text: I have a long document where I change the style of subsection headings in different parts of the document. I'm using titlesec with the explict option as it is necessary for the way I'm formatting chapter headings. I'd like to define new commands in the preamble so that I can change subsection formatting by inserting a new command for the section. I sort of having it working but I can't add a #1 to pull in the subsection label without causing an "illegal parameter number in definition of \resumestyle" error. If was to put the \titleformat line right in the document and add the #1 reference it would pull in the title label and format it the way I want. This must be a conflict with \newcommand but I can't figure it out. The following code is a test case that demonstrates what I'm trying to do, but as written it does not pull in the subsection label. Any help would be appreciated. Thanks.               \documentclass{report}     \usepackage[parfill]{parskip}     \usepackage[explicit]{titlesec}     \newcommand{\resumestyle}{\titleformat{\subsection}{\large\scshape\raggedright}{}{0em}{}[\titlerule]}          \begin{document}          \tableofcontents          \chapter{Introduction}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.               \chapter{Main Body}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \section{A Section}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \subsection{A Subsection}     Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \section{Another Section}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \resumestyle          \subsection{Another Subsection}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \chapter{Conclusion}          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.          \end{document}


title: How to replace all $ $ by \( \)?

text: I want to replace all TeXish math `$ $` in a tex file by LaTeXish `\\( \\)` and also `$$ $$` by `\\[ \\]`. How can I do this cleverly? Please beware that in TikZ environment, one can not replace `$ $` by `\\( \\)`.


title: How can I automatically highlight SuperCollider symbols and environment variables?

text: > **This question led to a new package:** `sclang-prettifier` I've been poring over the `listings` manual, trying to figure out how to get some very specific types of formatting for the SuperCollider language. I need to highlight words where the opening delimiter is `\` and the closing delimiter is any non-alphanumeric character. **Background:** SC has a normal string type, delimited by double quotes -- that's easy. It also has a Symbol type, in single quotes (also easy) -- _but_ Symbols that consist only of alphanumeric characters (and underscore) may also be written with a preceding backslash: `'symbol'` and `\symbol` are equivalent. Note that the answer to How to highlight all identifiers starting by '@'? does not apply because the closing delimiter may be _any_ non-alphanum (frequently a comma or closing paren, in which case it would be ugly to force a space before it). If `listings` won't do it, what alternatives do I have? I also looked at the `minted` manual, but that was even more confusing. Some sample SuperCollider code:               p.clear;          ~grains.addSpec(\tfreq, [1, 40, \exp]);     ~grains.addSpec(\overlap, [0.1, 10, \exp]);     ~grains.addSpec(\pos, [0, b.duration]);  // 3.43 is nice!     ~grains.addSpec(\rate, [0.5, 2, \exp]);     ~grains = { |tfreq = 25, overlap = 6, pan = 0, amp = 0.2, pos = 3.43,        rate = 1|        var trig = Impulse.ar(tfreq);        TGrains.ar(2, trig, b, rate, pos, overlap / tfreq, pan, amp)     };     ~grains.play;      `\exp`, `\tfreq`, `\overlap`, `\pos` and `\rate` need to be highlighted as Symbols. Ideally, environment variables (e.g. `~grains`) would also be highlighted in a different color (same rule but with a different opening delimiter). I have another question, which I will ask separately...


title: Option clash for package placeins

text: I am using following set of packages for my LaTeX file but I am getting following error.               ! LaTeX Error: Option clash for package placeins.     See the LaTeX manual or LaTeX Companion for explanation.     Type H <return> for immediate help.     ... \begin`      The packages which I am using are               \documentclass[twocolumn]{svjour3}          % twocolumn      \smartqed  % flush right qed marks, e.g. at end of proof      \usepackage{graphicx, subfigure}      \usepackage{amsmath}      \usepackage{subfig}      \sloppy      \usepackage{placeins}      \usepackage{textcomp}      \usepackage[linesnumbered,ruled,vlined]{algorithm2e}      \usepackage{algorithmicx}      \usepackage{algpseudocode}      \usepackage{tabularx}      \usepackage[section]{placeins}      Which two packages are in conflict?


title: Can not plot x^4, sqrt(x) or x^3 + 5x^2 using pgf/tikz

text: I have recently started using LateX, and I am beginning to use pgf/tikz to create plots. But I have encountered some problems with the functions stated above. I can plot the function f(x)=x^3, but when I try to add 5*x^2 to the function, it gives an error when compiled. The same happens, when i try to plot x^4 and sqrt(x). An exampe if this:               \documentclass{article}     \usepackage{pgfplots}     \usepackage{pgf,tikz}                \usetikzlibrary{arrows}     \usepackage{tikz}     \usepackage [hmargin=2cm,vmargin=3cm]{geometry}     \begin{document}     \definecolor{ttqqqq}{rgb}{0.2,0,0}     \definecolor{wqwqwq}{rgb}{0.38,0.38,0.38}     \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.5923130274930888cm,y=1.0cm]     \draw[->,color=black] (-2.09,0) -- (7.96,0);     \foreach \x in {-2,-1,1,2,3,4,5,6,7}     \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};     \draw[->,color=black] (0,-4.76) -- (0,9.28);     \foreach \y in {-4,-2,2,4,6,8}     \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};     \draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};     \clip(-2.09,-4.76) rectangle (7.96,9.28);     \draw[smooth,samples=100, domain=-2:8] plot(\x,{(\x)^(3)+2*(\x)^2});     \end{tikzpicture}     \end{document}      When compiled it gives an error, but when I put a minus in front if (\x)^3, so the function is -(\x)^3+2*(\x}^2, it plots the function perfectly fine. Is there anyone who has an explanation for this?


title: "Allowing line break at ',' in inline math mode" breaks citations

text: In answering another question allowing line break at ',' in inline math mode, Stefan Kottwitz suggested two excellent ways to allow line breaks in inline math mode after `,`. One way was to use the `\allowbreak` command after the comma, and the other way was to globally redefine `,` so that line breaks are allowed. I used the second approach, and was really fond of it, until I noted that the command `\cite{}` no longer works as expected: If I cited more than one reference, it showed `[?]` instead of the correct citation. Here's an example:               \documentclass{article}          %----------Redefining `,` ------------------%     \makeatletter     \def\old@comma{,}     \catcode`\,=13     \def,{%       \ifmmode%         \old@comma\discretionary{}{}{}%       \else%         \old@comma%       \fi%     }     \makeatother     %-------------------------------------------%          \begin{document}          \cite{A,B}          \begin{thebibliography}{A}     \bibitem{A} ABC     \bibitem{B} DEF     \end{thebibliography}          \end{document}      What is wrong with redefining `,`? How to correct it?


title: How is \onslide supposed to behave with the plus operator?

text: I'm writing a presentation, using the `beamer` document class, with a long sequence of overlays. Since I know I will have to insert new slides in the middle of the sequence, I'm trying to use the plus operator in the overlay specifications. If I try to specify `\onslide<+-+>{<text>}`, however, I would expect the _text_ to be on two subsequent slides. That's at least what happens when I use numbers instead of the plus sign. With this syntax, anyway, the `<text>` is only displayed on one single slide. What's the expected behaviour of such a syntax? How could I obtain the result I expected?


title: Tikz: connecting two vectors from the focus of an ellipse to the edge

text: I would like to draw 2 vectors from the focus to the an arbitrary point on the ellipse (not necessarily arbitrary but if I can see how to do that, I can pick my locations afterwards). The solid circle is the focus and the other is the empty focus which I am not considering.               \documentclass{article}     \usepackage{tikz}     \begin{document}       \begin{tikzpicture}         \begin{scope}[rotate around = {-20:(0, 0)}]           \pgfmathsetmacro{\a}{2}           \pgfmathsetmacro{\b}{1.5}           \pgfmathsetmacro{\c}{sqrt(\a^2 - \b^2)}           \draw (-3, 0) -- (3, 0);           \filldraw[white] (-\c, 0) circle (.05cm); %empty focus           \draw (-\c, 0) circle (.05cm); %empty focus           \filldraw[black] (\c, 0) circle (.05cm); %focus           \draw plot[domain = -99:99] ({\a * cos(\x)}, {\b * sin(\x)});           \draw plot[domain = -99:99] ({-\a * cos(\x)}, {\b * sin(\x)});         \end{scope}       \end{tikzpicture}     \end{document}


title: Path terminating on a node with draw double

text: I have a node which I draw with a double line. If I now draw a path that connects to this node, the path does not stop at the outer border of my node, but exactly in the middle between the two lines. Is there any way to fix this behavior such that the paths correctly ends at the other-most line that I have drawn?               \documentclass{standalone}     \usepackage{tikz}     \begin{document}     \begin{tikzpicture}     \node[line width=1mm, draw, double, double distance=1cm, circle, minimum width=4cm] (circ) at (0,0) {};     \draw[line width=1mm] (circ) -- (7,0);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/jZ0aE.jpg)


title: Footnote references in Beamer

text: I would like to add full reference in the footnote, in Beamer. I am using MiKTeX 2.9 with TeXNicCenter 2.0 Alpha 3 build 1118. I know about this question Place bibliography items at bottom of frame. I tried to do what is recommended in the chosen answer http://tex.stackexchange.com/a/6015/35656. Instead of obtaining the desired output, the footnote contained only the id of the reference. I looked more on tex.SE, and found this closed question \footfullcite does NOT give the full citation (biblatex, beamer). I saw in a comment to the question that, when using MikTex, I should add "backend=bibtex" to the options. This didn't help me. I keep receiving the biblatex error "patching footnotes failed". I paste below the code.               \documentclass{beamer}     %\usepackage[style=authortitle,backend=bibtex]{biblatex}     \usepackage[backend=bibtex]{biblatex}     \bibliography{foo}     \begin{document}     \begin{frame}     Here is text \footfullcite{ref01}. % this writes ref01 in footnote          Here is text \fullcite{ref01}. % this writes ref01 in place     \end{frame}     \end{document}


title: Trying to change fancyhdr

text: so far that's my code:               \pagestyle{fancy}     \renewcommand{\chaptermark}[1]{\markboth{#1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}     \fancyhf{}     \fancyhead[LE,RO]{\nouppercase{\thepage}}     \fancyhead[LO]{\sc \nouppercase{\rightmark}}     \fancyhead[RE]{\rm \nouppercase{\leftmark}}      What it produces is the page number in the left hand top corner and the chaptername in the top right hand corner including a ruler on every second page. How can I change this that it also displays a "Chapter 1. Text" where chapter is italic and text is roman? Tried some stuff but it never changed how I wanted it to be. Thanks for your help!!


title: Passing value to \bibleverse

text: Please help me to find out, how to pass a value to a command, which has additional arguments enclosed in (...).               \usepackage{bibleref}     \usepackage{xstring}          \begin{document}     \bibleverse{Gen}(9:9)     \bibleverse{Gen}(\StrBehind{Gen 9:9}{Gen })     \end{document}      This gives an error:               ! Paragraph ended before \@bibleverse was complete.


title: Size of \baselineskip for \\ if font size is \footnotesize?

text: \documentclass{article}     \usepackage[english]{babel}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{tikz}     \usetikzlibrary{positioning}          \begin{document}     \begin{tikzpicture}     \tikzstyle{every node}=[font=\footnotesize]          \node[anchor=north west, inner sep=0, rectangle, red, draw, minimum width=0.5cm](A) {%     \begin{minipage}[t]{0.5cm}%     x\\     x     \end{minipage}};          \node[inner sep=0, rectangle, blue, draw, minimum width=0.5cm, anchor=north west](B) at (0.5cm, -\baselineskip) {%     \begin{minipage}[t]{0.5cm}%     x\\     x     \end{minipage}};          \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/LQwdh.png) How can I align the two rectangles that it looks like... ![enter image description here](http://i.stack.imgur.com/FcL6k.png) You get this result if \tikzstyle{every node}=[font=\footnotesize] is commented out. The problem is that I need a smaller font size. I have tried to set the shift to -\footnotesep but no success.


title: How to write two dot above a letter?

text: the two dots above a letter represents two derivative of varible t. My method:               \documentclass[UTF8]{ctexart}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{epstopdf}     \usepackage{inputenc}     \begin{equation}     \"{o}     \mathaccent{o}      \end{equation}      However,the latex says in the math enviroment ,I must use the `\mathaccent` .SoI replace the `\"` to \mathaccent.but,it shows the warning information: `Missing number, treated as zero` I am a starter,I want to know how to revise it?Can someone help me?Thanks sincerely!!


title: Drawing this diagram in Tikz

text: ![enter image description here](http://i.stack.imgur.com/wYSja.png) I'm trying to draw above image. What I've got so far is: ![enter image description here](http://i.stack.imgur.com/Z92A6.png) Not very close. I'm struggling in leveling outer box and first box and also drawing arrows. I'm not sure when I'm anchoring to north, why would there be so much mis-match. Code is below:               \begin{figure}     \centering     \begin{tikzpicture}[scale=2]       \node [draw=black,rotate=90,anchor=north,minimum width=3cm,minimum height=0.75cm] (io) {I/O interface};       \node [draw=black,minimum width=3cm,minimum height=0.75cm, right =1cm of io] (io2) {SSD System};       \node [draw=black,minimum width=3cm,minimum height=0.75cm, below =0.32cm of io2] (io3) {Fuzzy Logic ACC};       \draw[red,thick,dotted] ($(io2.north west)+(-0.1,0.22)$)  rectangle ($(io3.south east)+(0.1,-0.22)$);     \end{tikzpicture}     \end{figure}       Any help, suggestions or ideas would be appreciated. Thank you! EDIT: With Kevin's answer I'm able to make good progress, this is what I've got so far. I got somewhat arrows drawn, now I need to figure out how to make text and put labels beside I/O interface. :![enter image description here](http://i.stack.imgur.com/zzd3y.png)


title: How to redefine @ and . to obfuscate email addresses?

text: I am writing a small package containing macros I intend to use regularly. Among those macros, I have `\mailto` with the following definition:               \@ifpackageloaded{hyperref}{%       \def\mailto#1{%         \href{mailto:#1}{\nolinkurl{#1}}%       }%     }{%       \def\maitlo#1{%         \url{#1}%       }%     }      What I want to do is redefine `@` and `.` to active characters, so that `xxx@yyy.zzz` is turned into `xxx<at>yyy<dot>zzz`. I've tried the following:               \def\mailto#1{%       \begingroup         \catcode`@=13         \catcode`.=13         \def@{$\langle$at$\rangle$}         \def.{$\langle$dot$\rangle$}         \url{#1}       \endgroup     }      But I get a:               ! Undefined control sequence.     \mailto ...e `@=\active \catcode `.=\active \def@                                                        {$\langle $at$\rangle $} \...     l.XXX \mailto{xxx@yyy.zzz}      Why?


title: Alignments in bussproofs package

text: I'm using `bussproofs` and would like my premises always to be left-aligned with the beginning of the inference line. So far when I have a single premise inference, I can only get the premise centered on the inference line, as in:               \documentclass{article}     \usepackage{bussproofs}     \begin{document}     \begin{prooftree} \AxiomC{$\neg A$} \UnaryInfC{$\neg A \lor \neg B$} \end{prooftree}     \end{document}      Is it possible to get the premise be left aligned with the line?


title: texdoc doesn’t search at $TEXMFHOME

text: I built a little private package and I want `texdoc` to find its manual. So I moved the documentation to `<TEXMFHOME>/doc/twindex.pdf` (i.e. `~/Library/texmf/doc/twindex.pdf` on my Mac). But if I call               texdoc twindex      it doesn’t find the package. If I ask `kpsewhich` with               kpsewhich -format "TeX system documentation" twindex.pdf      it finds the right file (`/Users/Tobi/Library/texmf/doc/twindex.pdf`) I thought that `texdoc` looks at `$TEXMFHOME` too, am I wrong with that? How can I configure it to search there too? ## Update Belonging to Andrey’s (and Phil’s) answer I tried to use a category but it doesn’t work. `kpsewhich` finds the file at               /Users/Tobi/Library/texmf/doc/latex/twindex/twindex.pdf      I also had a look at `$TEXDOCS` and it contains my `texmf` folder. But if I compare it with `$PATH`, there is a difference. In the latter the paths are separated by `:` instead of `,` may this the problem? ## Update 2 The `TEXDOCS` varaiable contains my user texmf folder (line 3):               Tobis-Mac:~ Tobi$ kpsewhich --var-value TEXDOCS     {/Users/Tobi/Library/texlive/2011/texmf-config,     /Users/Tobi/Library/texlive/2011/texmf-var,     /Users/Tobi/Library/texmf,     !!/usr/local/texlive/2011/texmf-config,     !!/usr/local/texlive/2011/texmf-var,     !!/usr/local/texlive/2011/texmf,     !!/usr/local/texlive/2011/../texmf-local,     !!/usr/local/texlive/2011/texmf-dist}/doc//      ## Update 3 To debug `texdoc` I tried `texdoc --debug=texdocs twindex` while twindex.pdf is saved at `$TEXMFHOME/doc/latex/twindex/twindex.pdf` _and_ additionally at `$TEXMFHOME/tex/latex /tw/twindex/twindex.pdf` and `$TEXMFHOME/twindex.pdf` my home path is `$TEXMFOME` = `/Users/Tobi/Library/texmf`               Tobis-Mac:texmf Tobi$ texdoc --debug=texdocs twindex     texdoc debug-version: /usr/local/texlive/2011/texmf/scripts/texdoc/texdoclib.tlu version 0.83     texdoc debug-texdocs: texdocs[8] = /Users/Tobi/Library/texlive/2011/texmf-config/doc (index_mandatory=false, recursion_allowed=true)     texdoc debug-texdocs: texdocs[7] = /Users/Tobi/Library/texlive/2011/texmf-var/doc (index_mandatory=false, recursion_allowed=true)     texdoc debug-texdocs: texdocs[6] = /Users/Tobi/Library/texmf/doc (index_mandatory=false, recursion_allowed=true)     texdoc debug-texdocs: texdocs[6] using index: /Users/Tobi/Library/texmf (shift=doc/)     texdoc debug-texdocs: texdocs[5] = /usr/local/texlive/2011/texmf-config/doc (index_mandatory=true, recursion_allowed=true)     texdoc debug-texdocs: texdocs[4] = /usr/local/texlive/2011/texmf-var/doc (index_mandatory=true, recursion_allowed=true)     texdoc debug-texdocs: texdocs[3] = /usr/local/texlive/2011/texmf/doc (index_mandatory=true, recursion_allowed=true)     texdoc debug-texdocs: texdocs[3] using index: /usr/local/texlive/2011/texmf (shift=doc/)     texdoc debug-texdocs: texdocs[2] = /usr/local/texlive/2011/../texmf-local/doc (index_mandatory=true, recursion_allowed=true)     texdoc debug-texdocs: texdocs[1] = /usr/local/texlive/2011/texmf-dist/doc (index_mandatory=true, recursion_allowed=true)     texdoc debug-texdocs: texdocs[1] using index: /usr/local/texlive/2011/texmf-dist (shift=doc/)     Sorry, no documentation found for twindex.     If you are unsure about the name, try searching CTAN's TeX catalogue at     http://ctan.org/search.html#byDescription.      Everything seems ok. As far as I can see `texdoc` searches `/Users/Tobi/Library/texmf/doc` recursive which includes the `twindex` path … I have to correct myself, `twindex is not found at`$TEXMFHOME/twindex.pdf` too. If I call `ls -R` in `texmf` the list contains all three places of `twindex.pdf`. Whats wrong with my system?


title: Problem with installing Wolfram Mathematica fonts in TeX Live

text: I've been trying to install the Wolfram Mathematica fonts in my installation of TeX Live 2011, running under OS X Lion. I used a mangled version of these instructions. I placed the files in `/usr/local/texlive/2011basic/texmf- local/`, and didn't muck around with Ghostscript; I don't use it. Then I add `\usepackage{wrisym}` to the pre-amble of my document, and I was hoping that that would be enough to install the fonts. This seems to have helped somewhat. Before I'd moved any font files around, I was getting the error               \!pdfTeXerror: pdflatex (file Math1Bold.pfa): cannot open Type 1 font file for reading          ==> Fatal error occurred, no output PDF file produced!          A fatal error occured, log file is in foobar.log      I'm guessing that means that it can't find the font file for `Math1Bold`, the first font it looks for, which makes sense, because I hadn't installed any font files at this point. However, when I had moved all of the font files into place, as per the above instructions, I was getting the error:               \!pdfTeX error: pdflatex (file Math5Mono-Bold.pfa): cannot open Type 1 font file for reading          ==> Fatal error occurred, no output PDF file produced!          A fatal error occured, log file is in foobar.log      Presumably this means that there's something wrong with this `.pfa` file. I've had a look at it, but I can't see anything that's obviously wrong. I've downloaded the file several times to ensure I didn't just have a corrupted version of this particular file, but no joy there. Does anybody have any suggestions for how I can get `Math5Mono-Bold` (and any other problem files that crop up) working, or at least make my TeX installation forget it's there so that I can make PDFs and use the Mathematica fonts? * * * ## Notes I know there might be a way of using XeTeX or LuaTeX to configure the fonts, but I've never used either of them before, and this TeX.se question makes it sound like there might not be much point in trying. This is a minimal _not_ -working example that triggers the second error message above:               \documentclass{article}          \usepackage{wrisym,amsmath}          \begin{document}          Foo bar. %     \begin{equation*}         2+2=5.     \end{equation*}          \end{document}      I've uploaded the log from this example here: http://cl.ly/0k0P2L051v290e3m1m28.


title: I need help with a banner in LaTeX

text: I just wanted to make this banner in LaTeX. ![Banner](http://i.stack.imgur.com/UYE9X.png) But I am not so good to LaTeX yet. So I have tried my best. Here is what I have managed yet:               \documentclass[11pt]{memoir}     \usepackage{tikz}     \pagestyle{empty}     \usepackage{geometry}     \geometry{paperwidth=512pt, paperheight=128pt}     \definecolor{rot}{HTML}{c54544}     \pagecolor{rot}     \begin{document}          \begin{tikzpicture}     \fill[white] (0,0) circle (1);     \fill[white] (0,0) -- (1,0) -- (0,1) -- cycle;     \end{tikzpicture}          \end{document}      What still misses is:   * placing the circle   * place the sunbeams   * place the text   * (use a filter - I think it's the photoshop "smudge stick") %not so important. For me it's enough if anyone could help me make this banner - with or without filter :) Kind regards and thank you very much in advance! That would help me a lot to get better using LaTeX and especially tikz!


title: How do we install additional fonts for xepersian on MiKTeX 2.9 Win XP/Win 7

text: I want to install several fonts such as IranNastaliq Niloofar and several others. How is this done?


title: TikZ node placement and arrow drawing

text: I just started using TikZ and try to get a process control drawn by TikZ. It looks wonderful, but I am a real beginner. I use the simple flow chart as base and came to this result: ![current situation](http://i.stack.imgur.com/7q1tI.png) I use shapes (blue nodes) and lines together with "fit" to draw the dashed container around "Resources" and "Sensors" (complete code below). I am not satisfied with this for four reasons:   1. I'd like to place the left box in between of the two middle ones (see red rectangle)   2. Drawing an arrow from "Processing" to "Planning" is drawn right in the middle through "Sensors" and "Resources". Also, the arrow pointing to the dashed container should just be _inside_ the container, not pointing to the egde   3. I'd like to label the dashed container (see small rectangle just below "Planning")   4. See the code, but the spacing of the rectangle is now done with a minimum height and width, because without it, the fit is too tight. However, it's not a real scalable solution, so I need to adjust the width/height every time I want to fit a rectangle around several nodes ![improved situation](http://i.stack.imgur.com/Xztj3.png) This is my source code:               \tikzstyle{b} = [rectangle, draw, fill=blue!20, node distance=3cm, text width=6em, text centered, rounded corners, minimum height=4em, thick]     \tikzstyle{c} = [rectangle, draw, minimum height=15em, minimum width=10em, dashed]     \tikzstyle{l} = [draw, -latex',thick]          \begin{tikzpicture}[auto]         \node [b] (planning) {Planning};         \node [b, below of=planning] (resources) {Resources};         \node [b, below of=resources] (sensors) {Sensors};         \node [b, left of=resources, node distance=4cm] (information) {Information system};         \node [b, below of=sensors] (processing) {Processing};              \node[c,fit=(resources) (sensors)] (container) {};              \path [l] (planning) -- (resources);         \path [l] (resources) -- (sensors);         \path [l] (sensors) -- (processing);              \path [l] (information) |- (planning);         \path [l] (information) |- (processing);     \end{tikzpicture}      Can someone point me in the right direction to solve my problems?


title: tikz-cd: error stating I can only use specific letters for \arrow command, even when I use the correct letters

text: I am having trouble beginning to use the tike-cd package for commutative diagrams. Whenever I use the \arrow or \ar command for an arrow, I come up with the errors: "! Package tikz-cd Error: Arrow direction argument must only contain the letters u, d, l, r.See the tikz-cd package documentation for explanation". "! Package pgfkeys Error: I do not know the key '/tikz/r' and am going to ignore it. Perhaps you misspelled it.See the pgfkeys package documentation for explanation." I have looked over the documentation for tikz-cd, and that was of no help, and I don't understand the second error; I tried to look up pgfkeys for help, and tried to import it into the document but still come up with the same error. Am I wrong to assume all the packages I need in the preamble to use tikz-cd is just tikz-cd? An example of a document that does not compile ,and returns this specific error, is:               \documentclass[11]{article}          \usepackage{tikz-cd}          \begin{document}          \begin{tikzcd}     A \arrow[r] & B     \end{tikzcd}          \end{document}      I am using texmaker. Originally thought I had miktext (I have always used this on my windows machines), but found I haven't installed it. Solution: Installed an updated version of MacTex and used Tex Live Utilities as @egreg recommended.


title: Inserting table and figure vertically in a full page

text: I have a table with large number of columns and few rows. I need to insert this table vertically in one single page. How to do. I need to do the same with a figure also, wherein I need to insert a figure in a single page


title: plot within a plot: zoom into a plot so that the magnified part is framed by axis with ticks and tick labels

text: I want to zoom into a plot much like it is possible by using the `spy` library but I want the spy-in node to contain its own ticks and tick labels with a finer grid than the original plot. To clarify what I mean I prepared the following picture by editing a picture that was produced with `pgfplots` and the `spy` library with the program Inkscape: ![enter image description here](http://i.stack.imgur.com/iemFz.png) Here is the code for the "`pgfplots` and `spy`"-part of the picture:               \documentclass{standalone}             \usepackage{pgfplots}        \pgfplotsset{width=10cm,compat=newest}     \usepgfplotslibrary{units}     \usetikzlibrary{spy,backgrounds}     \usepackage{pgfplotstable}          \pgfplotstableread{     0.0    1.0     0.0   -0.5     }\datatable          \begin{document}          \begin{tikzpicture} [spy using outlines={rectangle, magnification=2, size=0.5cm, connect spies}]     \begin{axis}[       xlabel={Energy},       ylabel={Intensity},       x unit={eV}     ]     \addplot +[mark=none] table [x index=0, y index=1] {\datatable};     \addplot +[mark=none] {0.1*x^2};          \begin{scope}         \spy[black,size=2cm] on (4.25,1.65) in node [fill=none] at (5,5.5);     \end{scope}          \end{axis}     \end{tikzpicture}          \end{document}      I'm not sure whether this is possible using the `spy` library or not. Maybe another approach is needed to achieve this.


title: \if(username == foo) ... \else .. \fi?

text: I think the pseudo code in the title says it all: How can TeX (or LaTeX) find out the $USER who is running `pdflatex`? I'm collaborating want the output to look very slightly different when I run `latex` as opposed to when my collaborator does.


title: Two abstracts needed in apa6

text: I am supposed to write a manuscript based on `apa6`. Unfortunately I am located in Germany, so my professor wants to have 2 (!) abstracts - one in English ("Abstract" - as implemented in `apa6` already) and an additional one, called "Zusammenfassung" (literal translation into German). Does anybody have an idea how to get this done? I really don't want to manually insert a page...


title: Error with xcolor package

text: I would like to write the chapters' titles in my LaTeX document in an other color, so I imported the following package:               \usepackage[dvipsnames]{xcolor}      But when I try this:               \chapter{\color{Maroon} My Title}      I get the following error:               Package xcolor Error: undefined color MAROON.      Is there any other package that must be declared to make this works? I use: `\documentclass{report}` and yes I use pdftex.


title: Can the PostScript language be used to fully replace TeX?

text: > THE POSTSCRIPT® LANGUAGE is a simple interpretive programming language with > powerful graphics capabilities. > > ... Because of the importance of text in most applications, the PostScript > language provides special capabilities for organizing sets of characters as > fonts and for painting characters efficiently. Can the PostScript Language be used to fully replace TeX?


title: Rotating caption with image using a custom float

text: How do you rotate a caption with the image in a custom float? I've tried the savebox and rotcaption methods outlined in this topic. My image rotates 90 degrees but my caption stays untouched and remains underneath the picture when it should rotate along with the image. Here is the code.               \documentclass{report}          \usepackage{caption}     \usepackage{float}     \usepackage{graphicx}     \usepackage{rotate}          \floatstyle{plain}     \floatname{example}{Example}     \newfloat{example}{h}{lop}          \begin{document}          \newsavebox{\myimage}          \begin{example}         \centering         \savebox{\myimage}{\rule{100pt}{150pt}}%         \rotatebox{90}{%             \begin{minipage}{\wd\myimage}                 \includegraphics{picture1.jpg}                 \caption{Here is the caption for this picture}             \end{minipage}}     \end{example}          \end{document}


title: Defining a variable in terms of another variable

text: This is a very elementary question, I hope it is still OK to ask it here. I'd like to do the following                   \documentclass{article}         \usepackage{tikz}              \begin{tikzpicture}              \def \x {2}         \def \y {\x + 2}              \foreach \s in {\x,...,\y}         {         % Do things         }              \end{tikzpicture}      This gives me the error                   ! Illegal unit of measure (pt inserted).         <to be read again>                            +         1.12 }      Why is this not possible?


title: BibTex and \includeonly command

text: I have a document of this form               ....          \includeonly{main}          \begin{document}              \include{main}             \include{supp}             \bibliographystyle{plain}        \bibliography{bibfile}          \end{document}           I need LaTeX to read supp.aux for cross-referencing, but do not want BibTex to read supp.aux. In other words, I do not want to list .bib entries used in supp.tex to be included in the current document. Is there a way to direct BibTex to only look at main.aux and not supp.aux?


title: How do I change the text color for a part of an equation after a pause in beamer?

text: I want this in the same frame, not a different frame. Here is an example of what I'd like:               \documentclass[mathserif]{beamer}     \usetheme{Copenhagen}     \usepackage{color,xcolor,ucs}     \usepackage{beamerthemesplit}     \usepackage{graphicx}     \usepackage{amsmath,amsfonts,amssymb,setspace,mathtools}     \begin{document}     \section{Introduction}     \frame{\frametitle{NPDE}     \begin{itemize}         \pause       \item item 1 here         \pause       \item item 2 here         \pause       \begin{equation*}               \frac{\partial u}{\partial t}= {\color{red}u(n,t)}u(n+1,t) -u(n,t)u(n-1,t)       \end{equation*}       %then I want this on the next click:       \pause         \begin{equation}             \notag             \frac{\partial u}{\partial t}=u(n,t){\color{red}u(n+1,t)}-u(n,t)u(n-1,t)       \end{equation}     \end{itemize}     }     \end{document}


title: Using shadows in TikZ 3.0 graphs

text: I have problems using the new graph drawing features in TikZ 3.0 with shadows.               \documentclass{scrartcl}          \usepackage{tikz}     \usetikzlibrary{shadows,graphs,graphdrawing}     \usegdlibrary{force}     \tikzstyle{vertex}=[draw, circle, fill=white, circular drop shadow]     \tikzstyle{edge}=[draw,thick]          \begin{document}     \tikz       \graph[spring layout, horizontal=a to b] {         a[vertex] --[edge] b[vertex];       };     \tikz       \graph {         a[vertex] --[edge] b[vertex];       };     \end{document}      When using `spring layout` (I assume that this problem occurs with all layout algorithms) edges are behind the shadows. Without a layout algorithm the edges are above the shadows of vertices. How can this be solved, so that edges are always above the shadow? ![Output](http://i.stack.imgur.com/HOFSZ.png)


title: Section's heading in small caps

text: I am using TeXmaker and I am trying to format the section's title. I tried something I had found on the internet but it was clashing with another package. How can I set all section's heading to be written in small caps ? This is the preamble of my document               \documentclass[11pt,a4paper,twoside,twocolumn]{article}     \usepackage{ucs}     \usepackage[utf8x]{inputenc}     \usepackage[francais]{babel}     \usepackage[T1]{fontenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{units}     \usepackage{multicol}     \usepackage{textcomp}     \usepackage{multirow}     \usepackage{booktabs}     \usepackage[authoryear]{natbib}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \usepackage{lmodern}     \usepackage{tabularx}     \usepackage{caption}      \captionsetup[table]{skip=10pt}     \setlength{\bibsep}{0pt}     \setlength{\columnsep}{30pt}          \renewcommand{\section}{\smallcaps}          \addto\captionsfrench{\renewcommand{\tablename}{\textsc{Tableau}}}          \bibliographystyle{test}


title: How to include crossrefs in bib files generated by biber --output-format=bibtex

text: # The Question How can I ensure that cross-referenced entries are included in a `.bib` file generated by `biber` for a document in case the document does not cite the cross-referenced entries themselves but only entries referring to them? To be clear, I don't want the cross-referenced entries to appear separately in the list of references but I need them in the`.bib` file so that complete data is available for the entries I do cite. # Background Consider the following document which uses a regular database of bibliography entries (included here as `orig.bib`):               \documentclass{article}     \usepackage[backend=biber]{biblatex}       \bibliography{orig}     \usepackage{filecontents}     \begin{filecontents}{orig.bib}     @bookinbook{author-bk1,       crossref = {author-bigbk},       title = {Originally a Separate Book},       pages = {345--789}}          @suppbook{author-essays-intro,       crossref = {author-essays},       title = {Introduction},       pages = {1--8}}          @incollection{author-essay,       crossref = {editor-collection},       title = {My Essay},       pages = {8-34},       author = {Author, Bit Busy}}          @book{author-bigbk,       author = {Author, Prolific},       title = {Collected Works},       year = 1453,       publisher = {Printers 'R Us},       address = {Milky Way}}          @book{author-essays,       title = {Essays},       author = {Author, Busy},       year = 1578,       publisher = {We Print 4U},       address = {Alpha Centauri}}          @book{editor-collection,       editor = {Editor, Fair},       booktitle = {Collection of People's Thoughts},       year = 1679,       publisher = {Great Collections in Print},       address = {Earth}}     \end{filecontents}          \begin{document}          \autocites{author-bk1,author-essays-intro,author-essay}          \printbibliography          \end{document}      As expected, this produces the following: ![Complete reference list](http://i.stack.imgur.com/A2Lnm.png) # The Promise Now suppose that I want to generate a `.bib` file containing just those entries needed for this particular document. (Obviously this would be pointless with this example since `orig.bib` contains nothing else, but that's not typically the case, of course.) Turning to `biber`'s manual, I find this: > **3.1.1 The output_format option** > > Biber is able to output ... BibTeX .bib files. .bib output is possible in > tool mode, when you are converting an entire datasource file independently > of any particular document (see section 3.12). It is also useful when you > want, instead of a .bbl, a new .bib file containing only the cited entries > from a document so that you can, for example, send a minimally complete > package for typesetting to someone. To do this, you would, after the first > LaTeX run, call Biber like this: >   >   >     biber --output_format=bibtex test.bcf >   > > This would result in a new .bib file called test_biber.bib containing all > cited entries in test.tex, in citation order, formatted according to the > various ouput_* options. So I try this:               biber --output_format=bibtex prawf3.bcf      # The Problem My attempt creates `prawf3_biber.bib`:               @BOOKINBOOK{author-bk1,       CROSSREF = {author-bigbk},       PAGES    = {345--789},       TITLE    = {Originally a Separate Book},     }          @SUPPBOOK{author-essays-intro,       CROSSREF = {author-essays},       PAGES    = {1--8},       TITLE    = {Introduction},     }          @INCOLLECTION{author-essay,       AUTHOR   = {Author, Bit Busy},       CROSSREF = {editor-collection},       PAGES    = {8-34},       TITLE    = {My Essay},     }      which is obviously not what you would hope for since using this `.bib` file will clearly not yield the required results. That is:               \documentclass{article}     \usepackage[backend=biber]{biblatex}       \bibliography{prawf3_biber}          \begin{document}          \autocites{author-bk1,author-essays-intro,author-essay}          \printbibliography          \end{document}      will encounter problems when `biber` is run:               INFO - Found 3 citekeys in bib section 0     INFO - Processing section 0     INFO - Looking for bibtex format file 'prawf3_biber.bib' for section 0     INFO - Found BibTeX data source 'prawf3_biber.bib'     WARN - I didn't find a database entry for crossref 'author-bigbk' in entry 'author-bk1' - ignoring (section 0)     WARN - I didn't find a database entry for crossref 'author-essays' in entry 'author-essays-intro' - ignoring (section 0)     WARN - I didn't find a database entry for crossref 'editor-collection' in entry 'author-essay' - ignoring (section 0)      which is obviously only to be expected given that the cross-referenced entries are not there. `biber`'s manual does discuss using crossref data when in `tool` mode but that seems to apply only when converting an entire datasource. So if I wanted to apply that to `orig.bib`, I could do that and then I could extract the (now complete) entries into `prawf3_biber.bib` using the above command. [At least, I assume I could - I haven't tested.] # The Question Revisited But how can I ensure the entries in the generated `.bib` file are completed with data from the cross-referenced entries _without_ converting the original `.bib` file and _without_ citing the cross-referenced entries in the document?


title: How to create hanging bullet?

text: How can I create 'hanging bullet' ( **bullet in margin** ) followed with text. I would like to put it in `\newcommand` but I'm not managing to do it. I tried this:               \newcommand{\question}[2]{\\[0.5cm]\hspace{-4.5cm}\bullet\textbf{#1}\\[0.2cm]\hspace{5mm}\text{#2}\\}


title: Is having a strong background in plain TeX a prerequisite to learn how to work with PSTricks or PostScript internal details?

text: Question has been elaborated in the title.


title: Triangle node with adjustable height

text: I'm trying to draw AVL trees with TikZ, what I need is: Binary tree with simple circle nodes, and adjustable height triangle (or rectangle) nodes for subtrees, both containing only single characters. Here's a picture: ![enter image description here](http://i.stack.imgur.com/S0Lf7.gif) I tried with rectangle and regular polygon, but they seem to be unaffected by aspect ratio... Is there an easy way of drawing something like this in TikZ?


title: Is there a simpler way to obtain the reference points enclosed by \rput frame?

text: Is there a simpler way to obtain the reference nodes shown as dots below? ![enter image description here](http://i.stack.imgur.com/OYPqI.png)               \documentclass[dvips,dvipsnames,rgb]{article}          \usepackage{pstricks,pst-node,graphicx}          \psset{framesep=0pt,linewidth=0.1pt}          \SpecialCoor          \newsavebox\mybox          \newenvironment{MyFrameBox}[4][8]{%BEGIN         \def\labeling##1##2{\qdisk(##1){0.2pt}\uput{#3}[##2](##1){\scalebox{#4}{##1}}}%         \def\scaling{%             \scalebox{#1}{%                 \rnode[B]{B}{\rnode[c]{c}{\rnode[t]{t}{%                 \rnode[tl]{tl}{\rnode[l]{l}{\rnode[Bl]{Bl}{%                 \rnode[bl]{bl}{\rnode[b]{b}{\rnode[br]{br}{%                 \rnode[Br]{Br}{\rnode[r]{r}{\rnode[tr]{tr}{%                 \psframebox[linecolor=lightgray]{#2}}}}}}}}}}}}}%                        \labeling{B}{135}\labeling{c}{45}%                 \labeling{t}{90}\labeling{tl}{180}%                 \labeling{l}{135}\labeling{Bl}{180}%                 \labeling{bl}{-90}\labeling{b}{-90}%                 \labeling{br}{-90}\labeling{Br}{0}%                 \labeling{r}{0}\labeling{tr}{0}%                 \psline[linecolor=lightgray](Bl)(Br)%                 \usebox{\mybox}}}         \begin{lrbox}{\mybox}\ignorespaces}{%END         \end{lrbox}\scaling\ignorespacesafterend}          \begin{document}     \begin{MyFrameBox}[10]{\color{red}\rm\"Age}{0.5pt}{0.1}     \psset{arrowscale=0.25,arrows=<->}     \ncline[linecolor=blue]{t}{r}     \end{MyFrameBox}     \end{document}


title: What's a good typewriter template?

text: I'm searching for a template which makes a document look like it's written with a real typewriter. Ideally, this means it's not only in mono-spaced font, but the hyphenation is adjusted accordingly. Also, some randomness would be nice (e.g. some characters more bold than others), so that it looks more natural.


title: Adding numberless chapters to the table of contents

text: How do I include a chapter reference within the table of contents _without_ giving it a chapter number? I am using the report document class. Normally, I would create a chapter as follows:               \chapter{Some Chapter}      but this results in the chapter being given a number. Currently I am using               \chapter*{Some Chapter}      which gets rid of the number, but then it is absent from the table of contents.


title: How to add dedication chapter to TOC?

text: How do I to add a chapter-name to this dedication and to add it to TOC, please?               \newenvironment{dedication}       {\clearpage           % we want a new page        \thispagestyle{empty}% no header and footer        \vspace*{\stretch{1}}% some space at the top         \slshape             % the text is in italics        \raggedleft          % flush to the right margin       }       {\par % end the paragraph        \vspace{\stretch{3}} % space at bottom is three times that at the top        \clearpage           % finish off the page       }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{dedication}     ABC \\ DEF     \end{dedication}      I'm using report class. Thanks a lot!


title: Displaying table of content?

text: > **Possible Duplicate:**   >  Adding numberless chapters to the table of contents I'm currently writing my report and I wasn't able to create my table of content properly. The fact is that I only use things like chapter*{...} because the text "Chapter X" bothers me, it takes a lot of place and currently isn't usefull in my report. So how can I write my tables of contents with my chapters even if they have a * ?


title: Bibtex: How to start numbering citations from only a specific page?

text: In my thesis, I am using `\bibliographystyle{IEEEtran}` so that the references will be ordered in the order of their appearance. In my Acknowledgements (which comes well before the introduction chapter), I need to cite some journal. Hence the first citation in the introduction chapter will not start from '1'! I need bibtex to start numbering only from the introduction chapter. Any help to resolve this issue?


title: Latex Alignment

text: So I got help for my LaTeX problem. I am in need of a little more help to get this example to look perfect. I want to perfectly align everything in the words section of each of my equations. I would be happy to get some assistance. Here's the code to the part I need help with:               \section{Applying the Steps}          \noindent {\bf Example:} Simplify \(x+3-2x+(4+2)^2+3x\)          \begin{multialign}           \item          & x+3+(4+2)^2+3x  &&   \\          & = x+3x+3+(4+2)^2 & \text{Rearrange the terms}          && \\          & = 4x + 3 + (4+2)^2 & \text{Addition(for $x$)}          && \\          & = 4x + 3 + (6)^2 & \text{Parentheses}          && \\          & = 4x + 3 + 36 & \text{Exponent}          && \\          & = 4x + 39 & \text{Addition} &&          \end{multialign}          \noindent {\bf Example:} Simplify \(3x-5(4+3)^2-3x+8x\)          \begin{multialign}          \item \nonumber          & 3x-5(4+3)^2-3x+8x &&  \\          &= 3x-3x+8x-5(4+3)^2 & \text{Rearrange the terms}          && \\          &= 0+8x-5(4+3)^2 & \text{Subtraction (for $x$)}           && \\          &= 8x - 5(4+3)^2 &           \text{Addition (for $x$)}          && \\          & = 8x - 5(7)^2 & \text{Parentheses}          && \\          & = 8x - 5(49) & \text{Exponent}          && \\          & = 8x - 245 & \text{Multiplication} && \\          \end{multialign}      Here's a picture of how the portion I need help with looks like. ![enter image description here](http://i.stack.imgur.com/KnM1S.png)