title: Highlighting specific parts of a TikZ drawing

text: Friends, sometimes during an automata keynote, I have to present a string recognition step-by-step example. Please consider the following TikZ code:               \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [right=of q_0] {$q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}      which outputs the following automaton: ![Automaton 1](http://i.stack.imgur.com/2eGDe.png) So far so good. Then, for an example, I take a string and show how the execution will happen. Let's say I want to check `aab`: ![Image 1](http://i.stack.imgur.com/bwVEI.png) ![Image 2](http://i.stack.imgur.com/chb96.png) ![Image 3](http://i.stack.imgur.com/bnz7q.png) ![Image 4](http://i.stack.imgur.com/Z2prU.png) ![Image 5](http://i.stack.imgur.com/mPqUE.png) ![Image 6](http://i.stack.imgur.com/t2x41.png) ![Image 7](http://i.stack.imgur.com/Q5L31.png) ![Image 8](http://i.stack.imgur.com/GjtSa.png) I achieve these slides by manually highlighting the specific parts of my automaton. The full code is as follows:               \documentclass{beamer}          \usepackage{tikz}     \usetikzlibrary{automata,positioning}          \begin{document}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [right=of q_0] {$q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}          \end{frame}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,every initial by arrow/.style={draw=blue},/tikz/initial text=]         \node[state,initial,draw=blue] (q_0)   {\color{blue} $q_0$};         \node[state] (q_1) [right=of q_0] {$q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}          \end{frame}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [right=of q_0] {$q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge [draw=blue] node {\color{blue} a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}          \end{frame}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [draw=blue,right=of q_0] {\color{blue} $q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}          \end{frame}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [right=of q_0] {$q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [draw=blue,loop above] node {\color{blue} a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}          \end{frame}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [draw=blue,right=of q_0] {\color{blue} $q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}          \end{frame}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [right=of q_0] {$q_1$};         \node[state,accepting] (q_2) [right=of q_1] {$q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge [draw=blue] node {\color{blue} b} (q_2);     \end{tikzpicture}          \end{frame}          \begin{frame}{String recognition}          \begin{itemize}         \item \textbf{String:} \texttt{aab}     \end{itemize}          \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto,/tikz/initial text=]         \node[state,initial] (q_0)   {$q_0$};         \node[state] (q_1) [right=of q_0] {$q_1$};         \node[state,accepting,draw=blue] (q_2) [right=of q_1] {\color{blue} $q_2$};          \path[->]          (q_0) edge node {a} (q_1)         (q_1) edge [loop above] node {a} ()         (q_1) edge node {b} (q_2);     \end{tikzpicture}          \end{frame}          \end{document}        As you can see, the drawing is basically the same for every step, apart from the highlighting. I thought of creating a new command called `\myautomaton` which takes an integer as parameter, representing the current step. In the drawing definition itself, I tried to use the `\ifthenelse` command from the `xifthen` package to check if, e.g., state `q_0` should be highlighted. Unfortunately, I had some problems, as I tried to insert them like:               \node[state,initial\ifthenelse{#1=2}{,draw=blue}{} ] (q_0) {\ifthenelse{#1=2}{\color{blue}}{}$q_0$};       Anyway, I was wondering if there's any technique to highlight specific parts of a TikZ drawing without so much code repetition. Any ideas? * * * **UPDATE:** I'd like to say that all answers to this question are equally awesome! The accepted answer is the one that better suits my needs. Usually, my automata representations tend to become more and more complex. Besides, the string complexity also follows the model tendency. When I have several states and transitions, I find the `\automaton{}` approach better, as it gives me the flexibility of setting which highlight step I want based on a state number and not on the input string. That way, I can map all the possible highlights in my automaton and call them when needed. For conventional automata representations, all answers are feasible. Thanks to all the answerers.


title: How to (correctly) manage utf-8 in bibliographic references

text: users, I have a persistent problem when I try to construct bibliographic references using 'exotic' accents. An example is provided below, with the error message. I am aware that this is a known problem, but I don't understand what the core of the problem is (I just suppose that it has something to do with multibyte segmentation) and, anyway, I just found some hints at rather cryptic workarounds.   Anticipated thanks for enlightening me. * * *               \documentclass[11pt,a4paper]{article}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}          \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \usepackage[left=2.50cm, right=2.50cm, top=2.50cm, bottom=2.50cm]{geometry}          \usepackage[authoryear,round]{natbib}          \begin{document}          On this notion see the work of Búbür (2009).  \\\       On this notion see \cite{Búbür2009}.          \begin{thebibliography}{widestlabel}          \bibitem[\protect\citeauthoryear{Búbür}{Búbür}{2009}]{Búbür2009}     \newblock Búbür, Bub (2009).     \newblock A theory of everything plus something else.     \newblock \textit{Journal of Unfocusing} 12, pp.\ 22-39.               \end{thebibliography}          \end{document}      * * * pdflatex loudly complains as soon as it sees the first accented u:               ! Missing \endcsname inserted.     <to be read again>                         \IeC      l.21 ...year{Búbür}{Búbür}{2009}]{Búbür2009}          The control sequence marked <to be read again> should     not appear between \csname and \endcsname.          ! Improper alphabetic constant.     <to be read again>                         \IeC      l.21 ...year{Búbür}{Búbür}{2009}]{Búbür2009}      A one-character control sequence belongs after a ` mark. So I'm essentially inserting \0 here.


title: Nested macros and hyperlink problem

text: I am new to LaTeX and write a document with the use of the `hyperref` package. Here is this simple scenario which I do not understand. I have to use a macro like `\ccc` in `\hyperlink` but it causes 6 errors and I can not fix the problem:               \documentclass[a4paper,12pt,oneside]{book}     \usepackage{hyperref}     \begin{document}     \hypertarget{link:two}{targettwo}          \newcommand{\aaa}{link:one}     \newcommand{\ccc}{\renewcommand{\aaa}{link:two} \aaa}     \hyperlink{\ccc}{something} %no link produced, only text: "link:two" and 6 errors     \end{document}      * * *               log:     .     .     .     ! Use of \hyper@link@ doesn't match its definition.     \@ifnextchar ... \reserved@d =#1\def \reserved@a {                                                       #2}\def \reserved@b {#3}\f...     l.21 \hyperlink{\ccc}{aaa}                                %6 errors     If you say, e.g., `\def\a1{...}', then you must always     put `1' after `\a', since control sequence names are     made up of letters only. The macro here has not been     followed by the required stuff, so I'm ignoring it.          ! Argument of \@firstoftwo has an extra }.     <inserted text>                      \par      l.21 \hyperlink{\ccc}{aaa}                                %6 errors     I've run across a `}' that doesn't seem to match anything.     For example, `\def\a#1{...}' and `\a}' would produce     this error. If you simply proceed now, the `\par' that     I've just inserted will cause me to report a runaway     argument that might be the root of the problem. But if     your `}' was spurious, just type `2' and it will go away.          Runaway argument?     ! Paragraph ended before \@firstoftwo was complete.     <to be read again>                         \par      l.21 \hyperlink{\ccc}{aaa}                                %6 errors     I suspect you've forgotten a `}', causing me to apply this     control sequence to too much text. How can we recover?     My plan is to forget the whole thing and hope for the best.          ! Extra }, or forgotten \endgroup.     \hyper@link@ ...\Hy@safe@activestrue \edef \x {#3}                                                       \ifx \Hy@tempa \@empty \to...     l.21 \hyperlink{\ccc}{aaa}                                %6 errors     I've deleted a group-closing symbol because it seems to be     spurious, as in `$x}$'. But perhaps the } is legitimate and     you forgot something else, as in `\hbox{$x}'. In such cases     the way to recover is to insert both the forgotten and the     deleted material, e.g., by typing `I$}'.          Runaway argument?     {\let \reserved@d =*\def      ! Paragraph ended before \hyper@link was complete.     <to be read again>                         \par      l.21 \hyperlink{\ccc}{aaa}                                %6 errors     I suspect you've forgotten a `}', causing me to apply this     control sequence to too much text. How can we recover?     My plan is to forget the whole thing and hope for the best.          ! Too many }'s.     \x ...r@link {link}{\let \reserved@d =*\def \par }                                                       {\Hy@safe@activesfalse aaa}     l.21 \hyperlink{\ccc}{aaa}                                %6 errors     You've closed more groups than you opened.     Such booboos are generally harmless, so keep going.     .     .     .      I am Using TeXnicCenter with MikTeX 2.9.


title: Tikz: increase arrow head size

text: Given the Tikz example here http://www.texample.net/tikz/examples/double- arrows/ how do I increase the size of the arrow head? I'd like to make it way bigger but, after manipulating the code, I was only able to increase the angle of the arrow (up to 90 degrees).


title: Externalize TikZ with TeXstudio and MikTeX

text: I have the same problem as written here before, but the externalization doesn't work. I always get the following message:               tikz: Sorry, the system call 'pdflatex -halt-on-error -interact      I try to input some simulation result from Matlab via `matlab2tikz`. If I run my `.tex` file without externalization it works just fine, but if I write               \tikzexternalize[prefix=tikzfig/]      it does not work any more. Here is a part of my header:               \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \pgfplotsset{plot coordinates/math parser=false}     \usepackage{tikz}     \usepackage{tikzscale}     \usepgfplotslibrary{external}     \tikzexternalize[prefix=tikzfig/]      I also saw the answer here, but it still doesn't work. I am using Miktex and Texstudio. I am also compiling via `dvips` since I am using `psfrag`. The compile command is:               pdflatex -shell-escape name      where `name` is just the file name without file extension, here `.tex`.


title: French chapter numbers

text: > **This question led to a new feature in a package:**   >  `impnattypo` French typography recommends that chapters be numbered in uppercase roman numbers, except for chapter 1 which should be called "Chapitre premier", so it should be:   * Chapitre premier   * Chapitre II   * Chapitre III   * etc. Trying to implement that, I've come up so far with:               \usepackage{ifthen}                                                                  \renewcommand{\thechapter}{%                                                           \ifthenelse{\value{chapter}=1}{premier}{\Roman{chapter}}                           }                           However, when compiling with this, I get:               ! Use of \@chapter doesn't match its definition.     \new@ifnextchar ...served@d = #1\def \reserved@a {                                                       #2}\def \reserved@b {#3}\f...     l.1 \chapter{\`A la recherche de la r\'eponse}      Where is the problem?


title: \tableofcontents is undefined, toc file is empty, how to generate TOC?

text: I'm astonished how good and informational this site is. However, I was unable to find an answer to the following problem: **Background:** I'm working on a book for IOS-press, and my first chapter is built with the class IOS-Book-Article. It has bunch of definitions required by publisher, but it forbids making a TOC. I need it for checking and draft working, also for my co-authors. **Problem:** I'm unable to run pdflatex on my tex document, because it says \tableofcontents is undefined. Also the toc file is 0 size. **The error message:**               ! Undefined control sequence.     l.20 \tableofcontents      **My TEX source:**               \documentclass[secfloat,final]{IOS-Book-Article}     % our definitions and macros     \input{macros.tex}     \makeindex     \begin{document}     \tableofcontents     ..... the rest of doc      **Question:** How to make table of contents in this document class? I need only draft version, nothing fancy, only sections/sub/subsub and chapters, with page numbers for revision. **My investigation:** The class can be found on IOS Author Corner, but I give here only an url (it's too long to copy): http://www.iospress.nl/authco/iospressbookarticle-latex.zip (direct url, sorry). I've found that in this class there are some defs for:               % Block preparation of contents:     \def\addcontentsline#1#2#3{}     \long\def\addtocontents#1#2{}      which I commented out, but it don't help. There is no \tableofcontents definition inside this class. I've copied one found in default book.cls class, but it didn't work, saying that some variables are empty and then set to 0. Nevertheless, I was unable to got anything similar to toc and I'm too beginner to make my own class. Please, how to manage to do this?


title: How to add additional rights to use PDF documents?

text: I am unable to change the preferences of the Adobe Reader 9.0 (I am using Ubuntu 11.04 Natty Narhal). The preferences are blocked, and when I try to change anything the following message appears: "Only available when document rights are enabled". I would like to insert new buttons on the toolbar, deactivate the "Open documents in tabs" and change the pagelayout to double page. So far, I have been unable to make those changes and any changes to the Adobe Reader Preferences because they are blocked and the sentence above appears whenever I try to change anything.


title: Pretty List of Figures and List of Tables

text: I am new here, but not new to LaTeX. My question concerns the topic discussed in this thread: Pretty Table of Contents. The topic is about how to make a pretty Table of Contens. My question is now, what do I need to do in order to apply the same pretty layout style of the TOC on the LOF and LOT? How can I override the `pretty TOC layout` on `LOF` and `LOT`? * * * For your information:   * I have copied my minimal working example from `Gonzalo Medina` in the linked post and modified it a little bit.   * I use the `memoir` class for my minimal working example.   * I have added a `Part TOC` (just to see if it looks good etc.). However, in my opinion a `Part TOC` is only good-looking if it can stay on the same page as the part text. Otherwise, it does not look good, and then one has to consider to put the `Part TOC` on the following page. By the way, I do not remember if someone in the community already did post something about making a `Part TOC`. In this case: Here you are! :-)   * My minimal working example uses different colours in the `TOC` and `Part TOC` (same colours in both TOCs of course) to make it easier to see what the different code blocks do in the preamble under the `Pretty TOC` code section.   * Be careful when using the `hyperref` package with the `\hypersetup` command! If `colorlinks` is set to `true`, then the (red) colour in the chapter text in the `TOC` disappears.   * Also, be aware about the fact that you then need to colour your URLs manually if you want your URLs to be something else than black when using the `\url{}` command!     * [SOLUTION] regarding the URLs is to apply the `\renewcommand{\UrlFont}{\color{cyan}}` (or the colour you would like...) AFTER the `\hypersetup` code block in the preamble! If doing so, this will solve the 'lack of URL colour' problem, allowing to use the `\url` command as you are used to.  * * * And here is my minimal working example:               \documentclass[a4paper,11pt,twoside,openright]{memoir}     \usepackage{fixltx2e}          \usepackage[english]{babel}          \usepackage[T1]{fontenc}     \usepackage{ae,aecompl}     \usepackage[utf8]{inputenx}          \usepackage{float}     \usepackage{graphicx}          \setlrmargins{*}{*}{1}     \setulmargins{*}{*}{1}     \checkandfixthelayout[nearest]          \usepackage{color}     \usepackage{xcolor}          \usepackage{mdframed}        \usepackage{mathtools}     \usepackage{hyphenat}       % I use it to prevent hyphenation of table of contents items     \usepackage{refcount}     \usepackage{tikz}     \usetikzlibrary{calc}     %%% Do not include titletoc here - do it at the end of the "Pretty TOC" (very important!)     % WHY? Because then in the Part TOC, the next part will be displayed in the very end of that Part TOC! Of course, this will not happen in the very last Part TOC because there is no part after that...     % \usepackage{titletoc}                            %%% Pretty TOC     %%%%% adapted from http://tex.stackexchange.com/questions/35825/pretty-table-of-contents/35835     % a modification of the leftbar environment defined by the framed package     % will be used to place a vertical colored bar separating the page number and the     % title in chapter entries     \renewenvironment{leftbar}{%       \def\FrameCommand{\textcolor{green}{\vrule width 1.5pt depth 0pt}\hspace*{15pt}}%       \MakeFramed{\advance\hsize-\width\FrameRestore}}%      {\endMakeFramed}          \makeatletter          % a command to circle the part numbers     \newcommand\Circle[1]{\tikz[overlay,remember picture]        \node[draw=blue,circle, text width=18pt,line width=1pt,align=center] {#1};}          % redefinitions for part entries     \renewcommand\cftpartfont{\Large\sffamily\bfseries}     \renewcommand\partnumberline[1]{%         \hbox to \textwidth{\hss\Circle{\textcolor{red}{#1}}\hss}%       \vskip 3.5ex\color{cyan}}          \renewcommand*{\l@part}[2]{%       \ifnum \c@tocdepth >-2\relax         \cftpartbreak         \begingroup           {\interlinepenalty\@M            \leavevmode            \settowidth{\@tempdima}{\cftpartfont\cftpartname}%            \addtolength{\@tempdima}{\cftpartnumwidth}%            \let\@cftbsnum \cftpartpresnum            \let\@cftasnum \cftpartaftersnum            \let\@cftasnumb \cftpartaftersnumb            \advance\memRTLleftskip\@tempdima \null\nobreak\hskip -\memRTLleftskip            \centering{\cftpartfont#1}\par%            }           \nobreak             \global\@nobreaktrue             \everypar{\global\@nobreakfalse\everypar{}}%         \endgroup       \fi}               % redefinitions for chapter entries     \renewcommand\chapternumberline[1]{\mbox{\small\@chapapp~#1}\par\noindent\Large}     \renewcommand\cftchapterfont{\sffamily}     \cftsetindents{chapter}{0pt}{0em}     \renewcommand\cftchapterpagefont{\large\sffamily\bfseries\color{blue}}          \newcommand*{\l@mychap}[3]{%       \def\@chapapp{\large\color{cyan}#3}       \vskip1ex%       \par\noindent\begin{minipage}{\textwidth}%       \parbox{4.5em}{%         \hfill{\cftchapterpagefont#2}%       }\hspace*{1.5em}%       \parbox{\dimexpr\textwidth-4.5em-15pt\relax}{%         \leftbar\cftchapterfont{\color{red}#1}\hspace{1sp}\endleftbar%       }%       \end{minipage}\par%     }     \renewcommand*{\l@chapter}[2]{%       \l@mychap{#1}{#2}{\chaptername}%     }     \renewcommand*{\l@appendix}[2]{%       \l@mychap{#1}{#2}{\appendixname}%     }          % redefinitions for section entries     \renewcommand\cftsectionfont{\sffamily\color{black}}     \renewcommand\cftsectionpagefont{\sffamily\itshape\color{blue}}     \renewcommand\cftsectionleader{\nobreak}     \renewcommand\cftsectiondotsep{\cftnodots}     \renewcommand\cftsectionafterpnum{\hspace*{\fill}}     \setlength\cftsectionnumwidth{12em}     \cftsetindents{section}{6em}{3em}     \renewcommand\cftsectionformatpnum[1]{%       \hskip1em\hbox to \@pnumwidth{{\cftsectionpagefont #1\hfill}}}          % redefinitions for subsection entries     \renewcommand\cftsubsectionfont{\sffamily\color{black}}     \renewcommand\cftsubsectionpagefont{\sffamily\itshape\color{blue}}     \renewcommand\cftsubsectionleader{\nobreak}     \renewcommand\cftsubsectiondotsep{\cftnodots}     \renewcommand\cftsubsectionafterpnum{\hspace*{\fill}}     \setlength\cftsubsectionnumwidth{12em}     \cftsetindents{subsection}{9em}{3em}     \renewcommand\cftsubsectionformatpnum[1]{%       \hskip1em\hbox to \@pnumwidth{{\cftsubsectionpagefont #1\hfill}}}     \makeatother          %%%% End of Pretty ToC          \settocdepth{subsection}     \setsecnumdepth{subsection}          % include after the change above (very important!)     \usepackage{titletoc}          \makeatletter     \def\@endpart{     %       \vfil       \textcolor{red}{\hrule height 1.5 pt}     \setcounter{tocdepth}{0}              \startcontents[parts]         \printcontents[parts]{}{0}{}          \textcolor{red}{\hrule height 1.5 pt}       \par\bigskip       \vfil\newpage                   \if@twoside                    \if@openright                     \null                     \thispagestyle{empty}%                     \newpage                    \fi                   \fi                   \if@tempswa                     \twocolumn                   \fi}     \makeatother     %%%          % be careful with the hyperref package; if colorlinks = true, then the (red) color in the chapter text in the TOC and  disappears!      \usepackage{varioref,hyperref}     \hypersetup{         bookmarks=true,                 % show bookmarks bar?         unicode=false,                  % non-Latin characters in Acrobat’s bookmarks         pdftoolbar=true,                % show Acrobat’s toolbar?         pdfmenubar=true,                % show Acrobat’s menu?         pdffitwindow=true ,             % window fit to page when opened         pdfstartview={FitH},            % fits the width of the page to the window         pdftitle={},                    % title         pdfauthor={},   % author         pdfsubject={},      % subject of the document         pdfnewwindow=true,              % links in new window         colorlinks=false,                   % false: boxed links; true: colored links         linkcolor=black,                % color of internal links (change box color with linkbordercolor)         citecolor=black,                % color of links to bibliography         filecolor=black,                % color of file links         %urlcolor=cyan              % color of external links     }          \renewcommand{\UrlFont}{\color{cyan}}   % must come after \hypersetup code block!          \begin{document}          \frontmatter              \tableofcontents*         \cleardoublepage         \listoffigures         \cleardoublepage         \listoftables         \cleardoublepage          \chapter{Foreword}     Be careful about the URLs. Because the colorlinks is set to false (in the hypersetup in the preamble), this is how the URL will look like: \newline          \url{http://tex.stackexchange.com/questions/169068} \newline          \noindent     If you would like to have the URLs in a specific colour, you have to manually colour code them: \newline          {\color{cyan}{\url{http://tex.stackexchange.com/questions/169068}}} \newline          \noindent     However, If you do not care about the chapter text colour in the TOC (if you want it black, which is standard), then the colorlinks can be set to true, which then should colour code the URLs automatically.               \mainmatter          \part{Designing with \TeX\ and \LaTeX}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \chapter{Beginning to learn design with \TeX}     \section{Another test section}     \section{Another test section}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \subsection{A test subsection}     \section{Another test section}     \subsection{A test subsection}     \subsection{A test subsection with a long title spanning more than one line in the table of contents}     \section{Another test section}     \section{Another test section}     \section{Another test section}                    \chapter{Beginning to learn design with \LaTeX}     \section{A test section with a long title spanning more than one line in the table of contents}     \subsection{A test subsection}     \subsection{Another test subsection}     \section{A test section}     \phantomsection     \addcontentsline{toc}{section}{Test unnumbered section}     \section*{Test unnumbered section}     \subsection{A test subsection}     \section{Another test section}     \subsection{A test subsection}     \subsection{A test subsection}     \section{Another test section}     \section{Another test section}               \newpage\setcounter{page}{123}% just for the example          \part{Designing with HTML}          \chapter{Beginning to learn design with HTML and some other text to span more than one line}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \section{Another test section}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \section{Another test section}     \subsection{A test subsection}     \section{Another test section with a long title spanning more than one line in the table of contents}     \subsection{A test subsection}     \section{Another test section}                    \chapter{Beginning to learn design with HTML and some other text to span more than one line}      \section{Another test section}     \section{Another test section}     \subsection{A test subsection}     \subsection{A test subsection with a long title spanning more than one line in the table of contents}     \section{Another test section}     \section{Another test section}     \subsection{A test subsection}                    \appendix          \chapter{Test Appendix}     \section{Another test section}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \begin{figure}[H]         \caption[(short) caption that goes to the LOF.]{(long) caption that goes below the figure}     \end{figure}          \section{Another test section with a long title spanning more than one line in the table of contents}     \section{Another test section}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \begin{table}[H]         \caption[(short) caption that goes to the LOT.]{(long) caption that goes below the figure}     \end{table}          \subsection{A test subsection}     \section{Another test section}     \section{Another test section}          \end{document}      And this is how some of it looks like: * * * ![TOC](http://i.stack.imgur.com/6GqGr.png) * * * ![TOC](http://i.stack.imgur.com/OGI0L.png) * * * ![LOF](http://i.stack.imgur.com/5nH2v.png) * * * ![LOT](http://i.stack.imgur.com/tSxT0.png) * * * ![How the URLs get affected](http://i.stack.imgur.com/YC42o.png) * * * ![Part TOC](http://i.stack.imgur.com/xCQaM.png) * * * ![Part TOC](http://i.stack.imgur.com/iRnGv.png) * * *


title: Where can I get a list of macros beginning with \var

text: I use macros like `\varphi` or `\vartheta` quite often, and I've recently discovered, there is also a `\varnothing` which is a bit like the `\emptyset`. My question is: How or where can I get a list of symbols beginning with `\var*` And in general, is there a way, I can get XeLaTeX print out commands that are defined?


title: Vertical alignment of nested table

text: I have two tables nested inside of a larger table. One of the nested tables is taller than the other, and I'd like to have the two tables line up together at the bottom. I've tried inserting `[b]` in the outer table, and I've tried declaring the outer table's column containing the shorter inner table as `b{0.25\textwidth}` instead of `l`. Neither of these worked. I'm pretty new to LaTeX, so maybe there's something basic that I'm missing. Here is a minimal version of what I'm working with:               \documentclass{article}     \usepackage{array}     \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}     \begin{document}          \begin{tabular*}{0.5\textwidth}{@{\extracolsep{\fill}}ll}     A & B \\      \begin{tabular}{rC{5em}}     aaa & 1 \\      bbb & 2 \\     ccc & 3 \\          ddd & 4 \\      eee & 5 \\      fff & 6 \\      \end{tabular} &     \begin{tabular}[b]{rC{5em}}     ddd & 4 \\      eee & 5 \\      fff & 6 \\      \end{tabular} \\      \end{tabular*}          \end{document}      This is what my code is giving me: ![http://i.stack.imgur.com/wiB17.png](http://i.stack.imgur.com/jHHfO.png) But I'd like to have something like this: ![http://i.stack.imgur.com/C7EY6.png](http://i.stack.imgur.com/dNtzR.png)


title: How to use downloaded fonts with XeTeX on Ubuntu

text: I am wanting to use the Fontin font in my XeTeX document. What steps should I do for dowloading the font (should I choose TTF or OpenType) and where should it be stored (on Ubuntu)? How can XeTeX find this font? I am using TexLive 2011 installed in a custom location (/somepath/texlive/2011)


title: Texmaker bibliography issues

text: I am having issues with trying to compile a bibliography using TexMaker (I'm very new to LaTex). I have found multiple Google hits with the same error message as I've been having all day               The top-level auxiliary file:..... I found no \bibdata command-"      and I found a walkthrough using `biblatex` from Cambridge University http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/biblatex.html but I still can't compile the bibliography for some reason. This is my MWE:               %test1.tex     \documentclass{article}           \usepackage{biblatex}      \bibliography{refs}           \begin{document}      Hello\cite{KandR}     \printbibliography      \end{document}       The `refs.bib` is as follows.               %refs.bib          @BOOK       {KandR,        AUTHOR  = "Kernighan, Brian W. and Ritchie, Dennis M.",        TITLE   = "{The C Programming Language Second Edition}",        PUBLISHER = "Prentice-Hall, Inc.",        YEAR = 1988       }      I perform `PDFLatex -> Bibtex -> PDFLatex -> PDFLatex`. During the first `PDFLatex` I get the following error message.               No "backend" specified, using Biber backend.     Citation 'KandR' on page 1 undefined     Empty bibliography     >There were undefined references.     Please (re)run Biber on the file:(biblatex) test1(biblatex) and rerun LaTeX afterwards.      and the error message associated with `BibTex`               Process started     This is BibTeX, Version 0.99d (MiKTeX 2.9) The top-level auxiliary file: test1.aux I     found no \citation commands---while reading file test1.aux I found no \bibdata command---     while reading file test1.aux I found no \bibstyle command---while reading file test1.aux     (There were 3 error messages)     Process exited normally      Am I missing something?


title: Add pdf/excel to appendix

text: I have a large (1 page high, 5 pages wide, in landscape) excel sheet and I want to add it to the appendices of my thesis. Is there a way to convert this to a latex tabular or can I export the excel to pdf and add the pdf content to my appendices? I have tried using the pdfpages but then the page numbering and page header are missing (and there was no margin between the left side of the page and the table). What's the best best way to do this? Also, if somebody knows a way to make a landscape longtable across multiple pages together with resizebox, so that the table height is scaled to page height and table width is spanning across multiple pages, then let me know. It seems like this is impossible for LaTeX and the only way to create this effect is with `\tiny` to scale the content.


title: Using \foreach of the forarray package to draw a path in TikZ

text: I want to create a graph of values I defined in an array using `\draw`with TikZ. I am having troubles including the part of the draw-command generated by an `\ForEach` -loop (forarray-package), which works fine on its own. Problem is at l.16 "! Package tikz Error: Giving up on this path. Did you forget a semicolon?."               \documentclass[12pt,a4paper]{article}           \usepackage{forarray}     \usepackage{tikz}           \begin{document}          \DefineArrayVar{leist}{@}{,}{0,1,2,3,4,5,6,7,8,9,10}{,}{8,7,8,9,7,6,9,9,8,9,9}          \newcommand{\coord}[1]{ --  (#1,\csname leist@#1\endcsname)}          \ForEach{,}{\coord{\thislevelitem}}{1,2,3,4,5,6,7,8,9,10};          \begin{tikzpicture}          \draw (0,0) \ForEach{,}{\coord{\thislevelitem}}{1,2,3,4,5,6,7,8,9,10};          \end{tikzpicture}          \end{document}


title: Pgfplots remove darker borders on marks

text: Hi is possible remove the darker borders on marks indicated from the arrow ? Thanks ![enter image description here](http://i.stack.imgur.com/XCf3m.jpg)               \documentclass[a4paper,12pt]{article}     \usepackage{pgfplots,pgfplotstable}        % Grafici     \pgfplotsset{/pgf/number format/use comma,compat=newest,%                 width=12cm,%                 height=9cm%                 }               %*********************************************************************************     % Impostazioni Pgfplots     %*********************************************************************************          \pgfplotstableread{     X Y     0.05 0.17     0.05 0.041     0.05 0.023     0.1 0.332     0.1 0.089     0.1 0.041     0.15 0.5     0.15 0.132     0.15 0.06     }\tableA          \pgfplotstablecreatecol[linear regression]     {regression}     {\tableA}          \xdef\slope{\pgfplotstableregressiona} %<-- might be handy occasionally     \xdef\intercept{\pgfplotstableregressionb}          \begin{document}     \begin{figure}     \centering     \begin{tikzpicture}     \begin{axis}[/pgf/number format/fixed,     legend pos=outer north east,     grid=major,     xmin=0, xmax=0.2,     ymin=0, ymax=0.6,     point meta min={0},     point meta max={0.2},     yticklabel shift=2pt,     xticklabel shift=2pt,     legend pos=north west,     legend cell align=left,     minor tick num=4,     xticklabel style={text height=1.5ex},     xtick={0,0.05,...,0.3},     minor xtick={%     0.01,0.02,0.03,0.04,%     0.06,0.07,0.08,0.09,%     0.11,0.12,0.13,0.14,%     0.16,0.17,0.18,0.19},%     extra x ticks={0,0.05,...,0.3},     extra x tick style={         xticklabel pos=right,         xticklabel style={text depth=0pt}     },     extra y ticks={0,0.1,...,0.7},     extra y tick style={         yticklabel pos=right     },     tick style={thin,black},     xlabel=\large $m$,     ylabel=\large $\Delta l$,     colorbar horizontal,     colorbar style={         /pgf/number format/fixed,         xticklabel shift=2pt,         xtick={0,0.05,...,0.3},         xticklabel style={text height=1.5ex}     },     axis line style={draw=none}, after end axis/.append code={\draw (rel axis cs:0,0) rectangle (rel axis cs:1,1);},     colormap={new}{color(0cm)=(violet);color(1cm)=(blue);color(2cm)=(cyan);color(3cm)=(green);color(4cm)=(yellow);color(5cm)=(orange);color(6cm)=(red)}     ]     \addplot [point meta=explicit,         scatter,         mark=*,         draw=none]         table[meta=X] {\tableA};          \addplot [mesh,point meta=x,domain=0.025:0.175,very thick,samples=10] {\slope*x+\intercept};     \addlegendentry{%     $\pgfmathprintnumber{\pgfplotstableregressiona} \cdot x     \pgfmathprintnumber[print sign]{\pgfplotstableregressionb}$}     \end{axis}     \end{tikzpicture}     \end{figure}     \end{document}


title: Wedge Power symbol

text: I want the upper index to appear on slightly right and below the topmost part of wedge symbol. But `\[ bigwedge^k V \]` gives me the `k` at the top. How do I do this? I want this in the definition of exterior power of a vector space.


title: Symbol about not orthogonality in LaTeX

text: I found this post, which explains orthogonal and not orthogonal symbols. I was able quickly to find the orthogonal symbols as `\perp`, `\upvdash` etc., but not able to find a top line which strikes the sign from the top left to bottom right. One idea is to combine to symbols e.g., use one of the aboves and add the line in top of it. However I don't know how to do it.


title: Trouble Putting Figure in \resizebox

text: I would like to create an array of `tikzpictures` on a beamer slide by beginning a `figure` environment and creating four `subfloats` inside it (using the `subfigure` package). Strangely, this exact process worked twice on two slides before the one I am currently working on, but failed when I did it the third time. I have been breaking my head over it, but cannot seem to find what the problem is. Here is a minimum working example that still manages to produce the error:               \documentclass[11pt]{beamer}     \begin{document}     \resizebox{10cm}{!}{\begin{figure}\end{figure}}     \end{document}      And here is the error itself:               ! LaTeX Error: Something's wrong--perhaps a missing \item.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.11 ...zebox{10cm}{!}{\begin{figure}\end{figure}}


title: Texmaker + Ubuntu 12.04

text: I want to setup latex environment on Ubuntu 12.04 64bit Machine. As I am making a backup system for Windows 7 machine. I have installed the latest version of Texmaker 3.3.4. Now I want to know which latex distribution to install for making PDF files. I seen few like XeLaTeX, TeX Live etc. Can you suggest the LaTeX distribution for Ubuntu which is very well maintained and up to date? I have used MiKTeX 2.9 for Windows and found it very good. **So In a nutshell I am looking for an Ubuntu (Linux) alternative to MiKTeX.**


title: How to use alternate table coloring with wrapping column?

text: I am working on table in which the last column is wrapped with a command `\Addbreakable`. I need to color alternate rows as well. But I can do either `\Addbrekable` or coloring alternate rows. ## Note:   * This is a follow up to How to wrap text in a table when there are no spaces at which to break the line? Below is my sample example.               \documentclass{article}     \usepackage{graphicx}     \usepackage[framemethod=TikZ]{mdframed}     \usepackage[margin=1.2cm]{geometry}     \usepackage{framed}     \usepackage{tikz}     \usepackage[T1]{fontenc}     \usepackage{hyphenat}     \usepackage{xstring}     \usepackage{forloop}     \usepackage{collcell}     \usepackage[table]{xcolor}     \definecolor{Gray}{gray}{0.9}          \definecolor{LightCyan}{rgb}{0.88,1,1}     \newsavebox\MyBreakChar%     \sbox\MyBreakChar{}% char to display the break after non char     \newsavebox\MySpaceBreakChar%     \sbox\MySpaceBreakChar{-}% char to display the break after space     \makeatletter%     \newcommand*{\BreakableChar}[1][\MyBreakChar]{%        \leavevmode%        \prw@zbreak%        \discretionary{\usebox#1}{}{}%        \prw@zbreak%        }%             \newcounter{index}%        \newcommand{\AddBreakableChars}[1]{%        \StrLen{#1 }[\stringLength]%        \forloop[1]{index}{1}{\value{index}<\stringLength}{%        \StrChar{#1}{\value{index}}[\currentLetter]%        \IfStrEq{\currentLetter}{]}        {\currentLetter\BreakableChar[\MyBreakChar]}%             {\currentLetter}%         }%       }%            \begin{document}       \textbf{Manual Solution:}        \newline       \begin{mdframed}[roundcorner=10pt,leftmargin=1, rightmargin=1,    linecolor=yellow,outerlinewidth=.5, innerleftmargin=8, innertopmargin=8,innerbottommargin=8, everyline = true]        %\begin{tabular}{>{\rule{0pt}{.5cm}}>{\arraybackslash}p{8cm}c|>  {\arraybackslash}p{1cm}c|>{\arraybackslash}p{1cm}c|>{\arraybackslash}p{1cm}c|>{\arraybackslash}p{2cm}c}             \rowcolors{2}{gray!25}{white}       \begin{tabular}{p{2cm}p{2cm}p{6cm}p{2cm}p{2cm}}        \rowcolor{yellow}         Col1 & Col2 & Col3 & Col4 & Col5\\         test & data & data & data &\AddBreakableChars{[1][7][3][8][5][9][7][8][9][89][100]}\\         test & data & data & data &\AddBreakableChars{[1][7][3][8][5][9][7][8][9][89][100]}\\             \end{tabular}        \end{mdframed}        \vspace{1mm}         \begin{mdframed}[roundcorner=10pt,leftmargin=1.0, rightmargin=1.0, linecolor=red,outerlinewidth=.5, innerleftmargin=8, innertopmargin=8,innerbottommargin=8]              \centering      \rowcolors{2}{green}{white}      \begin{tabular}{>{\rule{0pt}{.5cm}}>{\arraybackslash}p{2.25 cm}>{\arraybackslash}p{2.25cm}c>{\arraybackslash}p{8cm}c>{\arraybackslash}p{2cm}c}      \rowcolor{yellow} \textbf{Col1} &\textbf{Col2} &\textbf{Col3} &\textbf{Col4} &\textbf{Col5}\\      \hline      ERBB3  &  TT2292239&  TQWT  &  Grammar. a grammatical unit of one or more words that expresses an independent statement, question, request, command, exclamation, etc.  & \AddBreakableChars{[1][2][3][4][5][6][7][8][9][10][11][12][13][14]}      \\        &  TT2296336&  CQWG  &  Grammar. a grammatical unit of one or more words that expresses an independent statement, question, request, command, exclamation, etc.  & \AddBreakableChars{[1][2][3][4][5][6][7][8][9][10][11][12][13][14]}      \\      \end{tabular}      \end{mdframed}      \end{document}      Please help me out of this problem. I have tried many methods but nothing seems to be working fine.


title: How to spread a marginpar note in more than one page?

text: I'm using the standard class `book` with a lot of `marginpar` notes and few footnotes also; until here all is fine. My problem starts when I have very large margin notes that barely fit on one page, using the `letterpaper` size. However, I have been testing to use a different class, and then I saw that for a smaller page size many notes are cut. And then my question is if there is a trick or package that extends a `marginpar` note to 2 or more pages?


title: Showcase of optical illusions made with TeX/LaTeX/LuaTeX/ConTeXt

text: Optical illusions are fun, so I thought it would be a good idea to have a list of optical illusions designed using MetaPost, or PGF/TikZ, or PS-Tricks, or Asymptote. Each entry should display one optical illusion and the code necessary to produce it.


title: Memoir class and Bibtex

text: I have biblio.bib:               @article{XX,     title={{Title}},     author={Author},     journal={Journal Title},     volume=1,     number=11,     pages={1-2},     year=1666     }       And myfile.tex               \documentclass[oneside]{memoir}        \usepackage{natbib}      \begin{document}             ...        \cite{XX}        ...            \bibliography{biblio}        \bibliographystyle{acm}           \end{document}             I get the error:               ERROR: Class memoir Error: Font command \sc is not supported.          --- TeX said ---          See the memoir class documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.4 {\sc              Author}.     --- HELP ---     From the .log file...          Use \textsc, or \scshape{...}, or the oldfontcommands option      What might I be doing wrong?


title: Defining New ShortCuts in TexStudio

text: 1. This is not about new macros like `\newcommand`, `\def` and others.   2. This is not about autocompletion like using `.cwl` (in TexStudio)   3. This is **also not** about using shortcuts for predefined commands that are listed in the shortcuts sections. It is more closely related to the 3. Though. I want to define shortcuts for commands that are not listed there. e.g. When I type `Ctrl` \+ `Shift` \+ `B`, I want               \begin{bmatrix} \end{bmatrix}      to be inserted just like `Ctrl`\+ `Enter` inserts `\\`.


title: How to create three column document with visible dividers?

text: I added **\threecolumn** but it doesn't work. What command will change the document layout to three column format with dividers visible like the following illustration?               ---------HEADER---------     ###### | ###### | ######     ###### | ###### | ######     ###### | ###### | ######     ###### | ###### | ######     ###### | ###### | ######     ###### | ###### | ######     ---------FOOTER---------


title: How to upload my packages or document classes to CTAN?

text: I have created a simple yet useful document class. I am interested in uploading this to CTAN so it can be available in TeX distribution out of the box. As a result, I no longer need to setup `texmf` if it is already in the TeX distribution. I have questions:   1. What is the policy or rule or protocol to upload packages or document classes?   2. Should I create a manual for them?


title: Tikz - change object border line type - combining solid and dashed line

text: I would like to help with improving next Feynman picture. A few guys helped me with location ellipse in the irregular shaped object (question 74335). The TikZ code is:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{intersections, calc}          \begin{document}         \begin{figure}[hb!]             \centering                 \begin{tikzpicture}                   \coordinate (dS) at (1.5,0.5);                   \shade [name path=teleso,ball color=gray!10!brown,opacity=0.50,line width=1,draw=black]                          plot [smooth cycle] coordinates                          { (0,0) (1,-1) (3,0) (2.5,2) (3,3) (3,4) (2,5) (-1,3) };                   \draw (3,4) node[right]{$S_a$};                         \draw (0,0) node[below]{$S_b$};                   % ploska dS                         \shade[bottom color=gray!10!brown,opacity=0.50, shading angle=60](dS)                          node[below, text=black]{$dS$} rectangle +(0.5,0.5);                   \draw [->] (dS) ++ (0.25,0.25) -- +(30:0.5) node[right]{$\vec{n}$};                   \draw [->] (dS) ++ (0.25,0.25) -- +(60:0.7) node[right]{$\vec{C}$};                   % text                   \draw [fill=black] (2,4) circle (0.05) node[above, black]{$V_1$};                   \draw [fill=black] (1,0.5) circle (0.05) node[above, black]{$V_2$};                   % line - division of object                                \path [name path=line1](-1.5,3) -- (3,2);                   % Intersections                   \path [name intersections={of=teleso and line1, name=cross}];                   % ellipse                    \coordinate (A) at (cross-1);                   \coordinate (B) at (cross-2);                   \fill [color=cyan, opacity=0.25] let \p1=(A),\p2=(B),                         \n1={atan2(\y2-\y1,\x2-\x1)},\n2={veclen(\y2-\y1,\x2-\x1)} in                         [rotate=90-\n1] ($ (A)!0.5!(B) $) ellipse (\n2/2 and 0.7cm);                   % vectors                    \draw [->] let \p1=(A),\p2=(B),                         \n1= {atan2(\y2-\y1,\x2-\x1)} in                         ($ (A)!0.5!(B) $) -- +(360-\n1:1)  node[right]{$\vec{n}_1$};  % relative                    \draw [->, dashed] let \p1=(A),\p2=(B),                         \n1= {atan2(\y2-\y1,\x2-\x1)} in                          ($ (A)!0.5!(B) $) -- +(180-\n1:1) node[right]{$\vec{n}_2$};   % relative                                 \end{tikzpicture}          \end{figure}     \end{document}      ## Questions   1. In line with command `\shade[bottom color=gray!10!brown,opacity=0.50, shading angle=60](dS) node[below, text=black]{$dS$} rectangle +(0.5,0.5);` node has defined text colour with `text = black`, but as you can see, the text "dS" in the picture is not black.   2. Furthermore, I would like to imply three-dimensional character of the object using boundary lines of the ellipse. One part must be drawn with a solid line, and the second part (rear body) shall be dashed. Ellipse is drawn by the the `\fill` command.   3. How can I better specify the text position (The text "Sa" is too stuck on an object) ## Output ![Feynmann](http://i.stack.imgur.com/gE0AE.png)


title: Plain text for cut and pasting, ligatures for viewing (or, disabling ligatures)

text: One reason I switched to Xelatex was that I was interested in being able to create fully unicode documents (I'm a linguist, and often have linguistic symbols as well as Arabic text in my documents) that could be cut and pasted (for example, if I need to change the document to a word file for a journal, or if I want to cut and paste part of a paper into another paper). One problem I have is that ligatures often do not transfer well, and in general I'd prefer to be able to cut and paste the individual characters (the underlying text). Simply removing all of the commands from the original text file isn't an option either, as I often use Arabxetex for transliterating Arabic. Is there some way to instruct Xelatex to create a PDF that displays the ligatures, but when someone selects the text to cut and paste, they select a non-ligatured underlying text? I know this is possible with PDFs that have been OCRed, i.e. to have an image of the text overlying an actual text. Failing this, is it possible to disable ligatures? (Crossposted with comp.text.tex)


title: How to add unicode (devanagari) text to a LaTeX document without using XeTeX or LuaTeX?

text: I am using an online LaTeX compiler(scribtex) so I dont have the luxury of using XeTeX and other LaTeX compilers. I tried to include unicode text into my document using the following syntax:               \documentclass[11pt]{article}     \usepackage[utf8]{inputenc}          \begin{document}          \section{Introduction}          song वो पहली बार जब हम मिले     \end{document}      But I get errors like the following on compiling:               Package inputenc Error: Unicode char \u8:प not set up for use with LaTeX.      Any ideas, on how to fix this?


title: Hide image in PDF, reveal with mouseover

text: Is there a way to load a hidden image into a pdf output document that will show up when the user moves the cursor over a relevant piece of text? E.g., a pdf file generated by tex contains > **this arbitrary block of text** and when you move your cursor over it, a picture appears near the cursor.


title: Circuitikz different ground symbol

text: Is it possible to make circuitikz draw a different ground symbol? I would like to have a ground symbol with only one horizontal line. Thanks.


title: Is there a subsitute for subequations?

text: Is there substitute for the `subequations` environment? For instance, we can use `align` instead of the `equations` environment. What is the complement of `subequations` that would yield the same numbering convention? I looked through post on `subequations` trying to see if there was a suggestion about a possible different environment, but I didn't find anything which doesn't mean it doesn't exist; I just couldn't find it. **Edit:** To avoid confusion, I am aware of nesting `align` inside `subequations`. However, I am trying to avoid the `subequations` environment all together. This is because I am trying to trouble shoot something and `align` plays nicer with `hyperref` compared to `equations`. Therefore, I want to isolate out the use of `subequations` (maybe this environment plays nice with `hyperref` but I need to test something).


title: LaTeX accessibility

text: Does anyone know of any LaTeX modules that makes the pdf output generated by pdflatex Americans with Disabilities Act of 1990 (ADA)/Section 508 compliant? Specifics:   * With regard to math. One simple solution is to embed the latex equation as an alt tag. Simpler, and IMO better than translating to MathML.   * With regard to graphics. I use dot to generate the graphics. A simple solution here is to embed the .dot file as an alt tag for the figure. Is there any way to generate alt tags with pdflatex?


title: Why am I getting a "perhaps a missing \item" error in my custom epigraph environment?

text: I have tried to customised a new environment for epigraphs in a book. This page should have no fancy headers or anything alike. It should only have a list of one or more epigraphs. To that end I am using the epigraph package and I have defined the following in the .cls file:               \RequirePackage{epigraph}         \setlength{\epigraphwidth}{0.56\textwidth}         \let\oldqitem\qitem         \renewcommand{\qitem}[3]{\oldqitem{\textit{#1}}{\textit{#2}\\\textsc{#3}}}          \newenvironment{epigpage}[1][10]{%begin         \thispagestyle{empty}         \phantomsection         \vspace*{#1\@line} %default 10         \begin{epigraphs}\begin{flushright}     }{%end         \end{flushright}\end{epigraphs}         \vspace{\fill}         \blankpage     }      The renew command for `\qitem` is done to distinguish between the book name and the authors name. Then I simply start a new empty page and begin the usual epigraphs environment. Finally, in the .tex file what I do is the following:               \begin{epigpage}         \qitem{``My favourite quote.''}{My favourite book}{My favourite authors}     \end{epigpage}      The problem is that when compiling I get the following error:               LaTeX Error: Something's wrong--perhaps a missing \item.     ￼l.8    \qitem            {``My favourite quote.''}{My favourite book}{My favourite authors}      Can anyone help with this?


title: Natbib Chronological Parenthetical Citations

text: I'm using the `natbib` package along with the `chicago` bibliography style, however when creating a parenthetical citation in-text, the citations are ordered alphabetically instead of chronologically. Is there any package options that I would be able to use in order to achieve a parenthetical citation that is ordered chronologically? Here is my preamble for reference:               \documentclass[11pt,a4paper]{article}     \usepackage[left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm]{geometry}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage[stable]{footmisc}     \usepackage{amsmath}     \usepackage{graphicx}     \usepackage{xcolor}     \usepackage{microtype}     \usepackage[authoryear, round, sort&compress]{natbib}     \usepackage[colorinlistoftodos]{todonotes}     \usepackage{setspace}     \usepackage[colorlinks=true]{hyperref}      Here is a MWE:               \documentclass{article}     \usepackage[english]{babel}     \usepackage[utf8]{inputenc}     \usepackage[stable]{footmisc}     \usepackage[authoryear, round, sort&compress]{natbib}     \usepackage[colorlinks=true]{hyperref}          \begin{document}     \citep{cite1,cite2}     \bibliographystyle{chicago}     \bibliography{firstpaper}     \end{document}


title: Problem drawing diagram with XY-Pic

text: How I can draw the following diagram with XY-Pic : ![enter image description here](http://i.stack.imgur.com/XBFlT.png) Thank you in advance.


title: Why does horizontal space after ampersand becomes less?

text: Why does the space after the equals sign becomes less if I use the lower code, i.e., if I put ampersand after equals sign?               \begin{align*}     A&=B     \end{align*}          \begin{align*}     A=&B     \end{align*}


title: Beamer Handouts: 4 on 1 w/ adjusted positions, but page numbering incorrect

text: I need to make Beamer handouts (either 4 on 1 or 8 on 1). Below is my MWE. I think the usual 4 on 1 has too much space between slides, with the slides too close to the margins (printing the handouts sometimes cuts off part of the slides). So I've included in my MWE a lot of code that I pulled from other questions on this site. **The page numbering is incorrect.** It was correct the first time I typeset it, but when I added more slides, things went crazy. How do I fix the page numbering?               \documentclass[12pt, handout]{beamer}          \usepackage{etex}     \usepackage{amsmath,amssymb,amsfonts,amsthm}     \usepackage{graphics}     \usepackage{color}     \usepackage{framed}     \usepackage{amsthm, array}     \usepackage{yhmath}     \usepackage{cancel}     \usepackage{shadethm}     \usepackage{booktabs}     \usepackage{tikz}     \usepackage{pgfplots}     \usetikzlibrary{calc,through,arrows,shadows,backgrounds,mindmap,calendar}     \RequirePackage{latexsym, verbatim, xspace, setspace}     \RequirePackage{tikz, pgflibraryplotmarks}          %%%%%%%%%%%%%%%%%%%%     % PRESENTATIONS     %     %     % Background color     %\setbeamercolor{normal text}{bg=red!20!yellow!25!}     %     %     % END OF PRESENTATION COMMANDS     %%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%%%%%%%%     %% HANDOUTS     %     %     \usepackage{pgffor}          \makeatletter     \def\strokeifnotempty{%     \expandafter\ifvoid\csname pgfpages@box@\the\pgf@cpn\endcsname     \let\@next=\relax     \else     \let\@next=\pgfstroke     \fi     \@next%     }     \makeatother          \mode<handout>     {       \usepackage{pgf}       \usepackage{pgfpages}          % 4 pages per sheet of paper     \pgfpagesdeclarelayout{4 on 1 new}%[letterpaper, border shrink=12mm, landscape]     {       \edef\pgfpageoptionheight{\the\paperheight}        \edef\pgfpageoptionwidth{\the\paperwidth}       \edef\pgfpageoptionborder{0pt}     }     {     \pgfpagesphysicalpageoptions{     logical pages=4,      physical height=\pgfpageoptionheight,      physical width=\pgfpageoptionwidth}     \pgfpageslogicalpageoptions{1}{border code=\pgfsetlinewidth{1.1pt}     \strokeifnotempty,      border shrink=\pgfpageoptionborder,      resized width=.5\pgfphysicalwidth,      resized height=.5\pgfphysicalheight,      center = \pgfpoint{.25\pgfphysicalwidth + 10mm}{.75\pgfphysicalheight - 10mm}     }     \pgfpageslogicalpageoptions{2}{border code=\pgfsetlinewidth{1.1pt}\strokeifnotempty,      border shrink=\pgfpageoptionborder,      resized width=.5\pgfphysicalwidth,      resized height=.5\pgfphysicalheight,      center = \pgfpoint{.75\pgfphysicalwidth - 10mm}{.75\pgfphysicalheight - 10mm}     }     \pgfpageslogicalpageoptions{3}{border code=\pgfsetlinewidth{1.1pt}\strokeifnotempty,      border shrink=\pgfpageoptionborder,      resized width=.5\pgfphysicalwidth,      resized height=.5\pgfphysicalheight,      center = \pgfpoint{.25\pgfphysicalwidth + 10mm}{.25\pgfphysicalheight + 10mm}     }     \pgfpageslogicalpageoptions{4}{border code=\pgfsetlinewidth{1.1pt}\strokeifnotempty,      border shrink=\pgfpageoptionborder,      resized width=.5\pgfphysicalwidth,      resized height=.5\pgfphysicalheight,      center = \pgfpoint{.75\pgfphysicalwidth - 10mm}{.25\pgfphysicalheight + 10mm}     }     }          \IfFileExists{\jobname.aux}{\pgfpagesuselayout{4 on 1 new}[letterpaper,      border shrink=12mm, landscape] \nofiles}{}     }          % Make a border around frames     \setbeamertemplate{background canvas}{ \tikz \draw[semithick]          (current page.north west)          rectangle          (current page.south east); }          %Page numbering for handouts     \defbeamertemplate{footline}{centered page number}     {%         \hspace*{\fill}%         \usebeamercolor[fg]{page number in head/foot}%         \usebeamerfont{page number in head/foot}%         {\color{black} \scriptsize \insertpagenumber \,/\,\inserttotalframenumber}%         \hspace*{\fill}\vskip2pt%     }     \setbeamertemplate{footline}[centered page number]     %     %     % END OF HANDOUT COMMANDS     %%%%%%%%%%%%%%%%%%%%%%%          \frenchspacing          \title{Title}     \subtitle{Subtitle}     \author{Author}     \date{Date}          \begin{document}     %%%%%%%%%%%%%%%%%%%%     % Title Page     \begin{frame}[t]     \titlepage     \end{frame}     %%%%%%%%%%%%%%%%%%%%     \begin{frame}     %     Here's a slide.     \end{frame}     %%%%%%%%%%%%%%%%%%%%     \begin{frame}     %     Here's a slide.     \end{frame}     %%%%%%%%%%%%%%%%%%%%     \end{document}      ![enter image description here](http://i.stack.imgur.com/9GLcg.jpg)


title: Change alignment locally inside a tabular cell

text: I want to align some specific cells inside a `LaTeX` table. I tried using `center enviroment` inside cell, but it didn't work-`Error: Undefined Control Sequence \begin{center}`. I also tried with `\centering` which produces no errors, however it doesn't do the job. My MWE is the following               \documentclass[11pt,a4paper]{article}     \usepackage[english,greek]{babel}     \usepackage[iso-8859-7]{inputenc}     \usepackage{kerkis}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{amsfonts}     \usepackage{amsthm}     \usepackage{units}     \usepackage{array}     \begin{document}     \begin{table}[H]     \begin{center}     \begin{tabular}{l r r r}     \hline     {} & {\centering \textbf{Ενέργεια}} & {\centering \textbf{Ενέργεια}} & {\centering     \textbf{Μέσος Αριθμός}}\\     {\textbf{Αέριο}} & {\centering \textbf{Διέγερσης}} & {\centering \textbf{Ιονισμού}} &     {\centering \textbf{Παραγωγής Ζεύγους}}\\     {} & {\centering $[eV]$} & {\centering $[eV]$} & {}\\     \hline     {} & {} & {} & {} \\     {$Ar$} & {$11.6$} & {$15.8$} & {$26$} \\     {$CO_2$} & {$10.0$} & {$13.7$} & {$33$} \\     {$CH_4$} & {$12.6$} & {$14.5$} & {$28$} \\     {$Kr$} & {$10.0$} & {$14.0$} & {$24$} \\     {$Xe$} & {$8.4$} & {$12.1$} & {$22$} \\     \hline     \end{tabular}     \caption{Μέσος αριθμός παραγωγής ζεύγους για διάφορα αέρια}     \label{tab:Excitation-Ionization}     \end{center}     \end{table}     \end{document}


title: Cyrillic \MakeUppercase

text: `\MakeUppercase` does not capitalize Cyrillic fonts. I am trying to create a custom document class which would write the section titles in upper case. For this purpose I use the solution provided in this answer. However, it turned out that the `\MakeUppercase` command capitalizes the Latin letters only. All the Cyrillic letters are left intact. It looks like this: > FIRST SECTION - Первый раздел This is true not only for the section headings, but for a regular text also. So the command:               \MakeUppercase{English text. Русский текст.}      produces the following output: > ENGLISH TEXT. Русский текст. What could be the reason for such behaviour and how can I solve this issue? Note: I use **pdflatex** to compile the document. * * * Here is the simplest working example to start with:               \documentclass{letter}     \usepackage[utf8]{inputenc}     \usepackage[russian]{babel}     \begin{document}     \MakeUppercase{English Text. Русский текст.}     \end{document}


title: How create a paper of x,y dimensions size?

text: How can I create a paper of A1 size on latex? Or a x,y (in centimeters) dimensions paper? In \documentclass looks like there isn't this option. I need use the `\documentclass{standalone}` package too (to print out some formulas). I would like create a paper with dimensions of x and y centimeters. Could be a paper of A1 size (Wikipedia) too, I think will works fine to me. I have fond this link but I can't change the `\documentclass`. **For other users interested** How to generate a standalone equation (formula) using latex without background and with a specified dimension? With these code below (Bayes_theorem.tex)               \documentclass{standalone}          \usepackage[left=0cm,top=0cm,right=0cm,nohead,nofoot]{geometry}     \usepackage{varwidth}     \usepackage[utf8x]{inputenc}     \usepackage[T1]{fontenc}          \usepackage{amsmath, amssymb, graphics, setspace}     \newcommand{\mathsym}[1]{{}}     \newcommand{\unicode}[1]{{}}     \newcounter{mathematicapage}          \geometry{     paperwidth=12cm,     paperheight=30cm,     margin=0cm     }     \begin{document}\sloppy     \begin{equation*}     \resizebox{1.0 \textwidth}{!}      {     $       P\left(H_h|E_e\right)=\frac{P\left(E_e|H_h\right)P\left(H_h\right)}{P\left(E_e\right)}     $     }     \end{equation*}          \end{document}      , run: > $pdflatex Bayes_theorem.tex then > $convert -geometry 4800x -density 4000 Bayes_theorem.pdf -quality 90 > Bayes_theorem.png And this beatifull formula without background will appear: ![Bayes_theorem](http://i.stack.imgur.com/TUmdY.png) This was possible with the help of several community users helping me in this question itself and these others 1, 2. Thanks so much.


title: How do I enter Unicode characters in TeX?

text: I need to write a few Unicode characters (e.g. `Л`) into a text without using e.g. XeTeX, LuaTeX or `inputenc`oding with UTF-8 (please assume as little as possible about the typesetting system). I have read other questions regarding this problem, but did not find an answer without XeTeX/LuaTeX/UTF-8/... (therefore the explicit TeX in the question). **EDIT** (because it is way too long for a comment and comments do not provide code markup): Egreg's answer works perfect with TeXlive 2011 (as expected for an answer of egreg and for TeXlive; +1 for that). Also as expected, with "Old-TeX" (SWP5.5 @ http://www.mackichan.com, which is the recent version) it does not work. Additionally it is necessary to install the cyrillic and lh packages and to change the code to               \documentclass{article}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage[T2A,T1]{fontenc}     \begin{document}     {\fontencoding{T2A}\selectfont\CYRL\cyra\CYRT\cyre\CYRK\CYRS}%     \end{document}      (There _must_ be an empty line before `\documentclass`, which SE does not show.) Then the document does compile even with SWP, but `Л` still is not shown. The reason (as found by Ulrike Fischer) for this is that the needed `tfm` font file (`larm1000.mf`) cannot be generated by the "Old-TeX". When generating it with TeXlive and copying it to SWP, it is still not used. Thus: With the current version of SWP it is not possible. :-( Nevertheless, it is possible to do this:               \documentclass{article}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \usepackage[T2A,T1]{fontenc}          \def\cylatex{%     %TCIMACRO{LaTeX}%     %BeginExpansion     {\fontencoding{T2A}\selectfont\CYRL\cyra\CYRT\cyre\CYRK\CYRS}%     %EndExpansion     }          \begin{document}          Text\cylatex{}Text          \end{document}      (There _must_ be an empty line before `\documentclass` again, which SE does not show.) When compiled with modern LaTeX, it writes `TextЛаТеКСText` (I'm not sure about `КС` for X - anyone speaking a language using cyrillic signs here to help?), and when compiled with SWP it writes `TextLaTeXText` (which is better than having just `TextText`). Caveat: When the document is opened with SWP and saved, the definition will be changed to               \def\cylatex{LaTeX}      therefore the main document may never be saved by SWP (using subdocuments and editing those is possible). Placing the               \def\cylatex{%     %TCIMACRO     ...     }      into a style file will result in SWP reading the `{\fontencoding{T2A}\selectfont\CYRL\cyra\CYRT\cyre\CYRK\CYRS}` part and again creating an error instead of `ЛаТеКС` or `LaTeX`.


title: Unicode “undefined control sequence” in XeLaTeX

text: I have got a TeXLive 2011 on an Apple Time Machine and TeXShop on my local MacBook.   When I try to typeset the XeLaTeX template from TeXShop, I get “undefined control sequence” for some of the Unicode text. The relevant section of the template goes as follows:               %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode          \documentclass[12pt]{scrartcl}     \usepackage{geometry}     \geometry{a4paper}          \usepackage{fontspec,xltxtra,xunicode}     \defaultfontfeatures{Mapping=tex-text}     \setromanfont[Mapping=tex-text]{Hoefler Text}     \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}     \setmonofont[Scale=MatchLowercase]{Andale Mono}          \begin{document}          \newfontfamily{\A}{Geeza Pro}     \newfontfamily{\H}[Scale=0.9]{Lucida Grande}     \newfontfamily{\J}[Scale=0.85]{Osaka}          Here are some multilingual Unicode fonts: this is Arabic text: {\A السلام عليكم},     this is Hebrew: {\H שלום},      and here's some Japanese: {\J 今日は}.          \end{document}        When I typeset this, I get:               ./Untitled.tex:44: Undefined control sequence.     l.44 ...s: this is Arabic text: {\A \UTF                                             {0627}\UTF{0644}\UTF{0633}\UTF{0644}...      Strangely, this occurs only for the Arabic and Hebrew texts, however, if I comment these out and leave only the Japanese section, the document is typeset without any errors and correct output. At first, I thought that something was not passed correctly via the shell, but both bash and tcsh (used by TeXShop) return upon a `locale`:               LANG="de_DE.UTF-8"     LC_COLLATE="de_DE.UTF-8"     LC_CTYPE="de_DE.UTF-8"     LC_MESSAGES="de_DE.UTF-8"     LC_MONETARY="de_DE.UTF-8"     LC_NUMERIC="de_DE.UTF-8"     LC_TIME="de_DE.UTF-8"     LC_ALL=      I even tried adding `setenv LC_CTYPE en_US.UTF-8` (cf. this) to the XeLaTeX engine for TeXShop but that did not help, either. This is the Log I get with the posted example. I hope that you have any ideas concerning this problem.   Thank you in advance.


title: Standalone package advanced conversion options inside LaTeX source file

text: I want to use the conversion options of the `standalone` package to produce a PNG image file from a LaTeX source file. The package documentation lists two tables with options for conversion. The _normal_ options are usable inside the `convert` class options, the _advanced_ options are usable inside ... that's the question now. From the documentation examples and experiments I know that they are usable within a `standalone.cfg` file. But, my question is, if I could use them inside my source files directly somehow. Here is a MWE of something I tried:               \documentclass[convert={density=600,size=400x400,outext=.png},crop,border=0mm]{standalone}     \usepackage{tikz}          % The following options are ignored at this place.     % It works if this is put inside a 'standalone.cfg' file     \standaloneconfig{convert={command={\convertexe\space -density \density\space       \infile\space       \ifx\size\empty\else -resize \size\fi\space       -quality 100\space       -define png:format=png32\space       -define png:compression-filter=4\space       \outfile}}}          \begin{document}     \begin{tikzpicture}     \shadedraw [shading=ball] (0,0) circle (2cm);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/3dhkK.png)   * Putting the options inside the `\standaloneconfig` macro of the given MWE is ignored.   * Putting the options inside the class options (I tried several things) leads to compilation errors. Is there a solution where and how to put the options inside my source file or am I forced to use the `standalone.cfg` file? I would consider to have all options in one file a very desirable feature. Maybe, I'm just applying things wrong? **Update:** Since nobody answered or commented my question the last two days, I guess it's not possible to use the advanced conversion options inside the source file (?). I would appreciate any comment ... can't imagine nobody tried this before ...


title: list the cases in text

text: I would like to list some cases which are needed to be consider in text. I didn't find a standard way to do this. There is "case" for math mode, but that is not what I want. Look the following picture: ![With Space](http://i.stack.imgur.com/P7Xar.png) I use `\\ \\` ( 2 new lines ) and `\textbf` to get the above result. But I doubt the space is too large ( larger then the space before `\begin{Theorem}` ). I also use ![Without Space](http://i.stack.imgur.com/cDpSa.png) but it looks like no space is not good neither. Is there a standard way to do this, otherwise, what's the best space for it?


title: How do I make a counter start with 1?

text: I defined a counter like this:               \newcounter{my_steps}[subsubsection]      and I would like to make it start with 1 instead of 0 after each subsubsection. How?


title: Slicing surfaces in solides3d

text: Is it possible to slice surfaces (`psSurface` mind you) in `pst-solides3d`? It is quite impressive to see the slicing mechanism on other solides (as described in the manual) but I have stumbled upon an error this is as far as I've come               \documentclass{standalone}     \usepackage{pst-solides3d}     \begin{document}     \begin{pspicture}(-6,-6)(6,6)     \psset{viewpoint=50 20 30 rtp2xyz,lightsrc=viewpoint,Decran=40,solidmemory}     \psSurface[         incolor=gray,         ngrid=.25 .25,         action=none,         plansepare={[0 0 1 1]},         name=silla     ](-2,-2)(2,2){x y mul}     \psSolid[object=load,load=silla0]     \composeSolid     \end{pspicture}     \end{document}      The error that is spewed out is the following > (ps2pdf) Error: /rangecheck in -putinterval- I guess my question could be summed up to   * Am I doing this wrong? or   * Is it not possible to cut a surface the way I'm trying to My final goal is to generate an image similar to the one below where the red lines represent the sliced portions of the surface ![enter image description here](http://i.stack.imgur.com/dhSVt.png)


title: Change color scheme for example box in beamer

text: I've already slightly adopted the colorscheme of my Frankfurt themed beamer class with:               % Define my settings     \definecolor{mygreen}{cmyk}{0.82,0.11,1,0.25}     \setbeamertemplate{blocks}[rounded][shadow=false]     \addtobeamertemplate{block begin}{\pgfsetfillopacity{0.8}}{\pgfsetfillopacity{1}}     \setbeamercolor{structure}{fg=mygreen}      Due to the settings of the structure-color to "mygreen" also the color for the block is set to green similar to the exampleblock. Thus I want to change the color of the exampleblock to blue (like the default non_modified block in Frankfurt) or yellow (like in color scheme crane ![enter image description here](http://i.stack.imgur.com/oaweM.png) I tried: `\setbeamercolor{exampleblock}{fg=blue}` which has no effect :( Any suggestions?


title: How to have a cross out rectangle in tikz?

text: I have the following tikz style                 \tikzset{actor/.style={ rectangle, minimum size=6mm, very thick,         draw=red!50!black!50, top color=white, bottom         color=red!50!black!20 }     }      and I would like to have an other style which is the same but with a cross out in the rectangle. How can I achieve this ?


title: beamercolorbox option rounded - modify strength

text: I am using the `beamer` class the its environment `beamercolorbox` with the option `rounded`. Is there also a way to change the 'strength' of the rounded corners? To my mind, the rounded corners are barely visible... Is there a way to round off the edge a bit more?


title: Polynomial division code

text: I would like to give me an example of how to use the `polynom` package. More specifically, I want to write down on my latex editor the following polynomial division (source): ![enter image description here](http://i.stack.imgur.com/N4Tjx.png) Thanks in advance.


title: Unrecognised \thesection, \thesubsection, \topmargin, \headstep and \headheight

text: I am using LaTeX for first time. However, I am writing a report based on someone else's. I have noticed that TeXStudio does not recognise:               \thesection     \thesubsection     \topmargin     \headstep     \headheight      They appear to be highlighted in orange and a small reading saying "Unrecognized command" appears when the cursor is placed over them. Hence, I am pretty much limited to do not modify the format of my heads and foots when using `fancyhdr`. The following is one part of the document:               \documentclass[a4paper,12pt]{report}     \usepackage[utf8]{inputenc}          \usepackage[english]{babel}     \usepackage{amsmath,amsthm}     \usepackage{amsfonts}     \usepackage{graphicx}     \usepackage{float}     \usepackage{fullpage}     \usepackage{fancyhdr}     \usepackage{booktabs}     \usepackage{parskip}     \usepackage[font=small, labelfont=bf]{caption}          \renewcommand*\thesection{\arabic{section}.0}     \renewcommand*\thesubsection{\arabic{section}.\arabic{subsection}}          \pagestyle{fancyplain}     \setlength{\topmargin}{0pt}     \setlength{\headsep}{15pt}     \setlength{\headheight}{11pt}          \begin{document}     \input{./titlepage.tex}          \lhead{Whatever I want as the head}     \rhead{\rightmark}     \lfoot{Whatever I want as the foot}     \rfoot{\thepage}     \cfoot{}      This, however, produces well numbered sections and subsections (1.0, 2.0, 3.0, 3.1, 3.2, etc) and the right head as the title of the section. The problem is that I cannot change the the length of the head and foots, as any value inserted in `\headheight` does not produce any change at all. Any idea about what am I doing wrong?


title: Make several pages of source code into 1 column within a twocolumn book format

text: I have a               \documentclass[11pt, 12pt, oneside, twocolumn, fleqn, leqno]{book}      which was given to us by our professor. My problem is, he want us to put the LaTex Code inside the pdf document that will be passed to him as the output. So I have tried:               \begin{landscape}     \begin{widetext}     \begin{lstlisting}[label=Preface,caption=Latex Code]     Latex code goes here     \end{lstlisting}     \end{widetext}     \end{landscape}      Now I have two problems in this scenario. 1.) I cannot seem to put the excess words of the latex code into a new landscape page and then the other one is 2.) the widetext function doesn't seem to work here.


title: How to reset the space between the label and the content of the item

text: As described above, I need to enlarge the space between the label and the content of the item of the section of Table of content (`\l@part` to be exact). and I typed the command `\setlength\labelsep{10em}`; but it does't work. See below, I want to enlarge the space marked in red rectangle ![the space marked in red rectangle](http://i.stack.imgur.com/7HeD3.jpg) ![enter image description here](http://i.stack.imgur.com/7HeD3.jpg) The `.cls` file corresponding to the format of the above output               \renewcommand*\l@part[2]{%            \ifnum \c@tocdepth >-2\relax              \addpenalty{-\@highpenalty}%              \addvspace{2.25em \@plus\p@}%              \setlength\@tempdima{3em}%              \begingroup                \parindent \z@ \rightskip \@pnumwidth                \parfillskip -\@pnumwidth                {\leavevmode                 \large \bfseries #1                 \leaders\hbox{$\m@th\mkern 1.5mu\cdot\mkern 1.5mu$}                 \hfil \hb@xt@\@pnumwidth{\hss #2}}\par                 \nobreak                   \global\@nobreaktrue                   \everypar{\global\@nobreakfalse\everypar{}}%              \endgroup       \fi}      # A minimal example is provided:               \documentclass[10pt]{report}          \usepackage{minitoc,lipsum}          \begin{document}          \tableofcontents          \part{I want to enlarge the space between the label and the content}          \chapter{Introduction}          \section{Just a sample section}          \lipsum[2]          \subsection{Explain}          \lipsum[3-8]          \section{Second}          \lipsum[9]          \chapter{Manual}          section{dddddn}          \subsection{cccExplain}          \end{document}


title: DejaVu Serif Condensed: Matching math font using PdfLaTeX

text: I like the DejaVu Serif Condensed font as text font, but I did not find an appropriate math font for it. To overcome this, I thought about two possible solutions:   * Finding an existing math font that looks good combined with DejaVu Serif Condensed   * Using the `\SetMathAlphabet` command to use DejaVu Serif as math alphabet. I'm really interested in this second point. Does this work and would it make sens? Or will this mess up with the math symbols (that have to come from another font)? Up to now I did not manage to make this second point working, following the solution shown in here. Any suggestions? So, here is a minimal example:               \documentclass{article}          \usepackage[english]{babel}       \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}          \usepackage[scaled=.85]{DejaVuSerifCondensed}     \usepackage[scaled=.85]{DejaVuSansCondensed}          % Math letters in Times font     \DeclareMathVersion{mathtimes}     \SetSymbolFont{letters}{mathtimes}{OML}{txmi}{m}{it}     \newcommand\timesmath{\mathversion{mathtimes}}          % Math letters in DejaVu font     \DeclareMathVersion{mathdeja}     \SetSymbolFont{letters}{mathdeja}{OML}{dejavu}{m}{it}     \newcommand\dejamath{\mathversion{mathdeja}}          \parindent 0pt          \begin{document}            Some text written in DejaVu Serif Condensed. And the math is as default in CM.       \[         \frac{a}{b} + c \cdot d = \sum \int E \, .       \]       Now I can change the math alphabet with        \verb|\timesmath|             \timesmath       and the result is       \[         \frac{a}{b} + c \cdot d = \sum \int E \, .       \]       Now I would like to do the same, but with the DejaVu Serif font, but if I do this the same       way, the command \verb|\dejamath|       does not work, as \verb|dejavu| is obviously not the correct name for the font shape.       \dejamath       \[         \frac{a}{b} + c \cdot d = \sum \int E \, .       \]            My question is now, how do I get the correct font shape (equivalent to \verb|txmi|) for       DejaVu; and does it make sense after all to use such a font in this way. One problem is, that       DejaVu produces quite big letters (that is why I used the \verb|scaled=.85| option).          \end{document}


title: Remove horizontal line from parrun

text: The `parrun` package places a horizontal line between its two blocks of text (`fframe` and `sframe`). There’s an example in this answer: How to use the parrun package. How can I suppress this line? The blank space between the text blocks is sufficient for my purposes.


title: Wrong vertical spacing under roots

text: I have no clue why the left root is way too high compared to the right one, whilst they are identical. Is there a way to set the vertical spacing under the root ? Tried _\vphantom_ , but this didn't do anything.               \documentclass{article}     \usepackage{amsmath}     \usepackage{amssymb}     \begin{document}     $\displaystyle\mathcal{E}(x_{0},\frac{b}{a}\cdot\sqrt{a^2-x_{0}^2})$ en $\mathcal{C}     (x_{0},\sqrt{a^2-x_{0}^2})$.     \end{document}


title: How to finish this diagram with some tiny rectangle

text: I already have some tikz code which is a frame structure stand for wireless network hidden problem               \documentclass{standalone}      \usepackage{tikz}     \usepackage{pgfplots}     \usepackage{array}     \usetikzlibrary{arrows}     \begin{document}     \thispagestyle{empty}     \begin{tikzpicture}[scale=0.5]     \draw (0,-1)--(12,-1);     \node at (0.5,-2) {\tiny RF};     \draw [fill=gray] (0,-1) rectangle (.25em,0.125/4);     \draw (0 1,-1.25)--(1,-1.25);     \node at (0.5,0.05) {\tiny A};     \draw (0,0)--(0,-2);     \node at (1.5,0.05) {\tiny B};     \draw (1,0)--(1,-2);     \node at (2.5,0.05) {\tiny C};     \draw (2,0)--(2,-2);     \node at (3.5,0.05) {\tiny D};     \draw (3,0)--(3,-2);     \node at (4.5,0.05) {\tiny E};     \draw (4,0)--(4,-2);     \node at (5.5,0.05) {\tiny F};     \draw (5,0)--(5,-2);     \node at (6.5,0.05) {\tiny G};     \draw (6,0)--(6,-2);     \node at (7.5,0.05) {\tiny H};     \draw (7,0)--(7,-2);     \node at (8.5,0.05) {\tiny I};     \draw (8,0)--(8,-2);     \node at (9.5,0.05) {\tiny J};     \draw (9,0)--(9,-2);     \node at (10.5,0.05) {\tiny K};     \draw (10,0)--(10,-2);     \node at (11.5,0.05) {\tiny L};     \draw (11,0)--(11,-2);     \draw (12,0)--(12,-2);     \end{tikzpicture}     \end{document}      now I want to fill with some tiny rectangles like the first in my figure RF"A", and followed by RF B, C, D... etc are all the same I'll try \draw [fill=gray] (0,-1) rectangle (.25em,0.125/4); this code below and change the coordinates. but the result is not I want. Please help me! is that clear?


title: Vertical alignment of multiple consecutive tables

text: The aim is to align multiple (often quite large) consecutive captioned tables within respective chapters, for example: chap 1, table 1.1, table 1.2, table 1.3 --- chap 2, table 2.1, table 2.2... There is no text between the tables. The tables are in the usual table format (see the MWE) which I would like to keep, if possible. Here are two pictures from the following MWE. The first shows a chapter, some random text, and the normal distance I wanted to achieve after each new chapter in the document labelled as 'target distance'. ![target distance](http://i.stack.imgur.com/bLJH0.png) The second picture shows that the distance between chapters and tables is bigger than the normal one: ![enter image description here](http://i.stack.imgur.com/951Zo.png) Here is the MWE:                   \documentclass[a4paper, 12pt, headsepline, smallheadings,]{scrreprt}     \usepackage{booktabs}     \usepackage[labelfont={small,bf}, textfont=small, labelsep=colon,singlelinecheck=false,format=plain, parindent=1em]{caption}     \usepackage[a4paper]{geometry}     \renewcommand*{\chapterheadstartvskip}{\vspace{-1.8\baselineskip}}     \raggedbottom          \begin{document}     \chapter{B}     Some text to show the target distance from a chapter headline          \chapter{A}     \begin{table}[h]     \caption{Description}     \begin{tabular}{lccccc}     \toprule     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &      ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &      ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &      ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &      ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     \bottomrule     \end{tabular}      \end{table}     \begin{table}[h]     \caption{Description}     \begin{tabular}{lccccc}     \toprule     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &      ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &      ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     ABCDE &      ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE  \\     \bottomrule     \end{tabular}     \end{table}           \begin{table}[h]     \caption{Description}     {\scriptsize     \begin{tabular}{lccccc}     \toprule     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     ABCDE & ABCDE & ABCDE & ABCDE & ABCDE & ABCDE \\     \bottomrule     \end{tabular}     }     \end{table}          \end{document}      Best regards, Tom.


title: Getting pdfLaTeX ro run on new install (Mac OS X Lion)

text: New laptop, and attempting to set up TeXShop . I downloaded MacTeX, and attempted to install (using install-tl), but Terminal said I did not have permission. Found instructions to enable root user, placed the MacTeX in a Shared folder, logged in as root user and ran install-tl. Install seemed successful, but when I log back into my user account, pdfLaTeX does not run. Following message comes up: > /usr/texbin/pdflatex does not exist. Perhaps TeXLive was not installed or > was removed during a system upgrade. If so, go to the TeXShop web site and > follow the instructions to (re)install TeXLive. Another possibility is that > a tool path is incorrectly configured in TeXShop preferences. This can > happen if you are using the fink teTeX distribution. Not sure what I'm doing wrong, and likely something silly. Any help would be appreciated!


title: Beamer tables like block structure look-and-feel

text: I am trying to define a type of table similar to the look-and-feel of beamer blocks. I tried the following (using the `tabu` for tables), but with no luck.               \newenvironment<>{tabvarblock}[2][.9\textwidth]{%     %\setlength{\textwidth}{#1}     \begin{actionenv}#3%         \def\insertblocktitle{#2}         \begin{tabu}to#1{\insertblocktitle}%         \usebeamertemplate{block begin}}     {\end{tabu}%     \usebeamertemplate{block end}%     \end{actionenv}}      The use of the new structure would be, something like               \begin{tabvarblock}[0.5\textwidth]{X[m]X[m]}     A & B \NN     C & D \NN     \end{tabvarblock}      I also tried to use the solution in Example of fancy table using TikZ package. It worked, however the look-and-feel is not exactly the same.


title: Answer keys in ConTeXt

text: I'm currently working on a textbook. It contains numerous exercises and I'd like it to contain an answer key at the end of the book. The answer key should have the same structure as the book, that is all the chapter/section titles and correct exercise numbers. I can't figure out how to deal with a few issues in ConTeXt. Here is my minimal example using `\definelist`:               \definelist[Answers]     \setuplist[Answers][criterium=all,pagenumber=no]     \defineenumeration[Exercise][alternative=top,inbetween={\blank[nowhite]},text=Task,way=bychapter]          \def\Task{\dosingleempty\doTask}     \long\def\doTask[#1]#2{         \startExercise             #2             \writetolist[Answers]{}{\getnumber[Exercise] #1}         \stopExercise         }          \starttext          \chapter{First chapter}          Some text     \Task[Answer 1]{Content here}     \Task[Answer 2]{Text goes here}          \chapter{Second chapter}          \Task{Question three without answer}     \Task[Answer 4]{Number four}          \completelist[Answers]          \stoptext      Issues:   1. Why does `\getnumber[Exercise]` not work? (Answers without question numbers make no sense.)   2. How to include chapter and section titles/numbers where appropriate in the answer key? (To make the structure and navigation clear and to prevent ambiguity.)   3. How to deal with questions that don't have an answer in the key?   4. [optional] How to include page numbers of the actual content that the answers are referring to in the header/footer of the answer key (e.g. Answers pp. 76-100)? Edit: scanned answer key ![illustration to point 2](http://i.stack.imgur.com/x79Wb.jpg)