title: Make tikz picture floating

text: I'm inserting a tikz picture in my section headings with `\titleformat` (see this question) and I would like it to not affect the spaces in the headings. Right now, what I do is that I compensate the introduction of the picture with a negative vspace:               \titleformat{name=\section,page=odd}[display]       {\newpage\secstyle} % format       {\large\makedate{\thesection}~\chaphead} % label       {10pt} %sep       {\vspace{-5mm}\filcenter\textls[-50]} %before       [\monthtab{\chaphead}{\arabic{chapter}}\vspace{-1.2cm}] % after      `\monthtab` is the macro that inserts the picture to the right of the page. Is there a way to make it so that the picture inserted by `\monthtab` does not affect the spacing at all, making it float in the page? Here are some examples. First, a section without a tab: ![section without a tab](http://i.stack.imgur.com/0cBwa.png) Then, a section with a tab and nothing to prevent the vertical space: ![section with a tab, no vspace](http://i.stack.imgur.com/Akq7y.png) Finally, when I add a negative `\vspace` to fix it (call that the target): ![section with a tab and vspace](http://i.stack.imgur.com/8wCj3.png) And here is a "minimal" example to reproduce the issue:               \documentclass[paper=6.14in:9.21in,pagesize=pdftex,10pt,DIV=15]{scrbook}     \usepackage{titlesec}     \usepackage{tikz}     \usepackage{microtype}          \newcommand{\monthtab}[2]{       \begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3*{#2}cm,xshift=-0.5cm] at (current page.north east) {           \tikz\shade[shading=axis,bottom color=white,top color=gray!50,shading angle=-90]              (0,0) rectangle (1cm,3cm) node[rotate=90,pos=0.5] {\Large\scshape #1};         };       \end{tikzpicture}     }          \newcommand{\secstyle}{\scshape\Huge}          % Tune section headings     \renewcommand\thesection{\arabic{section}}     \titleformat{name=\section,page=even}[display]       {\newpage\secstyle} % format       {} % label       {10pt} %sep       {\vspace{-5mm}\filcenter\textls[-35]} %before     \titleformat{name=\section,page=odd}[display]       {\newpage\secstyle} % format       {} % label       {10pt} %sep       {\vspace{-5mm}\filcenter\textls[-50]} %before       [\monthtab{Chapname}{\arabic{chapter}}] % after     \titlespacing{\section}{0pt}{*}{*-2}          \begin{document}          \chapter{Janvier}     \section{This is a test section}          \begin{center}     Some text here     \end{center}          \section{This is another section}          \begin{center}     Some text here     \end{center}          \end{document}      I'm having a hard time making it shorter than this... Compare pages 2 and 3:   * on page 2, the text almost touches the title;   * on page 3, the tab to the right adds a space after the title.


title: How to retain figures only with captions in their original positions

text: The publisher of our book has requested us to modify the source of the book so that only figures with their captions remain retaining their original positions in the document as if the rest of the document (i.e. paragraphs, chapter and section headers, tables etc) was still there. So, it's like everything should be made white except figures and their captions. Is this possible? If so, how could this be achieved?


title: How do I write a macro having comma-separated and variable number of arguments?

text: I want to write a macro in LaTeX2e that can pass `\textcolor`, which is embedded in another macro, the values of the colour model gray, rgb, or cmyk. The number of arguments specified implies the colour model to be used; 1 argument for gray, 3 for the rgb, and 4 for the cmyk model. I was able to write a macro that does what I want, but with the arguments in the standard manner in braces. This is the code I was able to write by modifying the answers here.               \makeatletter       \def\setmycolour#1{%       \@ifnextchar\bgroup%           {\docolour{#1}}           {\dogray{#1}}       }       \def\dogray#1{This is gray hue #1.}       \def\docolour#1#2#3{%       \@ifnextchar\bgroup%           {\docmyk{#1}{#2}{#3}}           {\dorgb{#1}{#2}{#3}}       }       \def\dorgb#1#2#3{This is rgb colour #1,#2,#3.}       \def\docmyk#1#2#3#4{This is cmyk colour #1,#2,#3,#4.}       \makeatother      I use the macro as               \setmycolour{0.85}\\     \setmycolour{1}{0}{0}\\     \setmycolour{1}{0}{0}{0}\\      I want to use the macro, for example, as `\setmycolour{1,0,0}` or `\setmycolour{0.85}`. How do I parse the arguments in the macro definition to do this? Is the above code the best way to get the effect I want?


title: Biblatex-mla gives me a \smartcite error

text: Using:   `Biblatex 1.4a`   `Biblatex-mla 0.95` Biblatex set up as follows:   `\usepackage[style=mla,autocite=footnote,backref=true,backend=biber]{biblatex}` When I run XeLaTeX (`XeTeX, Version 3.1415926-2.2-0.9997.4`), I get an error on my first run:   `! Package biblatex Error: Command '\smartcite' undefined.` The .tex file compiles fine using `biblatex-chicago`, and my polyglossia and csquotes declarations are fine:               \usepackage{polyglossia}     \setmainlanguage[variant=british]{english}        I'm not using `\smartcite` anywhere in my document (only `\autocite`), so I'm wondering if it's a compatibility issue. Any ideas as to what might be going wrong?


title: Change the vertical spacing option "tight" in shorttoc

text: I'm generating a short table of contents using the shorttoc-package.               \documentclass{scrartcl}     \usepackage[tight]{shorttoc}          \begin{document}          \shorttoc{Shorttoc}{1}     \tableofcontents          \section{Sec1}     \subsection{Subs1}     \section{Sec2}     \subsection{Subs2}     \section{Sec3}     \subsection{Subs3}          \end{document}      The package documentation states, that the option `tight` should reduce the vertical spacing between the entries in the shorttoc, but in my example it doesn't. I suspect, this is due to this part of shorttoc.sty?               \newif\if@tightshtoc \@tightshtocfalse     \def\shorttableofcontents#1#2{\bgroup\c@tocdepth=#2\@restonecolfalse       \if@tightshtoc          \parsep\z@       \fi      What do I have to do to resize the vertical spacing?


title: Calculating position in tikz

text: I'm trying to do calculation to be used in tikz. Here is my current code:               \def\monthtabpos#1%       {\ifthenelse{#1<7}          {\dimexpr \numexpr -3*#1 \relax cm}          {\dimexpr \numexpr -3*(#1-6) \relax cm}       }                  \newcommand{\monthtab}[2]{       \shorthandoff{;}       \begin{tikzpicture}[remember picture,overlay]         \node[yshift=\monthtabpos{#2},xshift=-0.5cm] at (current page.north east) {           \tikz\shade[shading=axis,bottom color=white,top color=gray!50,shading angle=-90]              (0,0) rectangle (1cm,3cm) node[rotate=90,pos=0.5] {\Large\scshape #1};         };       \end{tikzpicture}     }      The idea is that `\monthtabpos` calculates the vertical position of the picture. This code is then called from `\titleformat` to position a tab for sections:               % Tune section headings     \renewcommand\thesection{\arabic{section}}     \titleformat{name=\section,page=even}[display]       {\newpage\secstyle} % format       {\large\makedate{\thesection}~\chaphead} % label       {10pt} %sep       {\vspace{-5mm}\filcenter\textls[-35]} %before     \titleformat{name=\section,page=odd}[display]       {\newpage\secstyle} % format       {\large\makedate{\thesection}~\chaphead} % label       {10pt} %sep       {\vspace{-5mm}\filcenter\textls[-35]} %before       [\monthtab{\chaphead}{\arabic{chapter}}] % after     \titlespacing{\section}{0pt}{*}{*-2}      When I build this code, I get:               LaTeX Warning: Unsynchronized `section' title on page 7.          ! Argument of \XC@definec@lor has an extra }.     <inserted text>                      \par      l.2 \dvday{Créé à son image}      Note that if I replace `yshift=\monthtabpos{#2}` with `yshift=-3*{#2}cm`, it works fine (except I don't get the effect I want when `#2 > 6`), and that I have checked that `\monthtabpos` returns the expected string. I have also tried defining a local macro in tikz with:               \newcommand{\monthtab}[2]{       \shorthandoff{;}       \begin{tikzpicture}[remember picture,overlay]         \node let \tabpos = (\monthtabpos{#2}) in           [yshift=\tabpos,xshift=-0.5cm] at (current page.north east) {           \tikz\shade[shading=axis,bottom color=white,top color=gray!50,shading angle=-90]              (0,0) rectangle (1cm,3cm) node[rotate=90,pos=0.5] {\Large\scshape #1};         };       \end{tikzpicture}     }      and it doesn't help. Note that this does work (but is really ugly I think):               \newcommand{\monthtab}[2]{       \shorthandoff{;}       \ifthenelse{#2<7}{       \begin{tikzpicture}[remember picture,overlay]         \node[yshift=-3*{#2}cm,xshift=-0.5cm] at (current page.north east) {           \tikz\shade[shading=axis,bottom color=white,top color=gray!50,shading angle=-90]              (0,0) rectangle (1cm,3cm) node[rotate=90,pos=0.5] {\Large\scshape #1};         };       \end{tikzpicture}       }       {       \begin{tikzpicture}[remember picture,overlay]         \node[yshift=18cm-3*{#2}cm,xshift=-0.5cm] at (current page.north east) {           \tikz\shade[shading=axis,bottom color=white,top color=gray!50,shading angle=-90]              (0,0) rectangle (1cm,3cm) node[rotate=90,pos=0.5] {\Large\scshape #1};         };       \end{tikzpicture}       }     }


title: What is the M4-based text format used in the TUG Interviews book?

text: The files used to prepare the TUG interviews book, Tex People: Interviews from the world of Tex, contains examples such as http://dw2.tug.org/ivbook/trunk/levien.m4, which begins               dnl $Id: rahtz.m4 265 2009-05-17 13:40:50Z dwalden $     define([[_date]],[[2009-05-16]])dnl     define([[_intervieweename]],[[Raph Levien]])dnl     define([[_intervieweeinitials]],[[RL[[]]_tinyspace()]])dnl     dnl     define([[_interviewername]],[[Karl Berry]])dnl     define([[_interviewerinitials]],[[KB]])dnl     dnl     define([[_interviewerbname]],[[Dave Crossland]])dnl     define([[_interviewerbinitials]],[[DC]])dnl          _header(levien.jpg,[[Raph Levien is a programmer with a special interest     in graphics applied to type.  He is also a typeface designer.  He holds     several patents and is a past maintainer of Ghostscript.]])      and ends:               _texonly(\bigskip)     _par _noindent Last, this is a screenshot of _link(http://fontforge.sf.net,     FontForge), which I used to put all the shapes together into a font, and     produce _Tone and OpenType font files.          _texonly(\medskip)     _noindent     _imageonly(levien-fontforge.png,width=.86\hsize)          _quotationstop          _footer      It is reminiscent of some hybrid of Gnu M4 and Texinfo -- what is it?


![enter image description here](http://i.stack.imgur.com/1NQEo.gif) `Karl` is a list of randomly generated nodes by `\curvepnodes` using parametric points in RPN (I don't know how to use `rand` in algebraic expression). The number of elements of the list is `\Karlnodecount + 1` or `plotpoints`. In the documentation, I only see `\psnline` to connect the list with a straight line segment between two consecutive nodes. To close the path, I invoke `\closepath` inside `\pscustom`.   * Unfortunately, the closing line segment does not look smooth.   * Instead of using a straight line segment, I want to use a curved one. Using `\psparametricplot[plotstyle=curve]` does help a bit but the closing segment is still problematic. ![enter image description here](http://i.stack.imgur.com/B6kZ5.png)               \documentclass[pstricks]{standalone}     \usepackage{pst-plot,pst-node}     \psset     {         fillstyle=solid,         fillcolor=gray,         linearc=2pt,     }     \begin{document}     \begin{pspicture}(-3,-3)(3,3)     \curvepnodes[plotpoints=40]{0}{360}{/R rand 1001 mod 1000 div 1.5 add def R t cos mul  R t sin mul}{Karl}     \pscustom     {         \psnline(0,\Karlnodecount){Karl}         \closepath     }     \end{pspicture}     \end{document}      I also tried using `\multido` and `\curveto` but `\curveto` needs 3 points per invocation (two of them are control points of a bezier curve). How to draw a closed smooth curve from a list of nodes?


title: Polish letters 'ą' and 'ę' encoding

text: I have a strange problem with font encoding(?). `pdflatex` changes the Polish letters 'ą' and 'ę' to '1.39a' or '1.39e'. I use the following packages:               \usepackage{polski}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}      I did not modify (no updates, no new installations) my LaTeX distribution (TeXlive), but a few days earlier everything was fine. What is going on?


title: what's wrong with my ctable?

text: I can't seem to pinpoint the problem with the table below and would appreciate some help. Something simple I am sure, but I can't see it...               \documentclass{article}      \usepackage{ctable}          \begin{document}          \ctable[     caption = Summary of model characteristics.,     label = tab:modelSummary,     doinside=\scriptsize,     pos=h     ]{lllllll}{     \tnote{For UK grid.}     \tnote[b]{ENTEC emissions are used for shipping.}     \tnote[c]{Based on analysis of extracted `baseline' air-masses.}     }{                  \FL     model    & type       & boundary           & meteorology & chemistry    & grid\tmark   & emissions\tmark[b] \NN          &            & conditions         &             & (km)         &              &  \ML     aea     & Eulerian   & STOCHEM            & WRF3        & CB05         & 12           & NAEI/EMEP \NN     aqum    & Eulerian   & GEMS/MACC          & UM          & UKCA/RAQ     & ?            & NAEI/EMEP \NN          &            &                    &             &              &              & ENTEC \NN     emep    & Eulerian   & EMEP-unified       & WRF3.1.1    & EMEP-unified & 5            & NAEI/EMEP \NN     hert    & Eulerian   & GEMS               & WRF3.2.1    & CB05         & 18           & TNO \NN     kcl     & Eulerian   & STOCHEM            & WRF3.1      & CB05         & 9            & NAEI/EMEP \NN     name    & Eulerian   & Mace Head\tnote[c] & UM          & STOCHEM      & $\approx$10? & NAEI/EMEP \NN          &            &                    &             &              &              & ENTEC \NN     osrm    & Lagrangian & ?                  & NAME (UM)   & STOCHEM      & 10           & NAEI/EMEP \NN          &            &                    &             &              &              & ENTEC \NN     ptm     & Lagrangian & Mace Head?         & UM          & MCM3.1       & $\approx$10? & NAEI/EMEP \NN          &            &                    &             &              &              & GEIA \NN     wrfchem & Eulerian   & ?                  & ?           & ?         & ?          & ? \LL     }               \end{document}      Gives:               Misplaced alignment tab character &.     \\tnote ...uperscript {\normalfont \textit {#1}}}&                                                       #2\NN \fi      l.31 }


title: Compiler error: "Missing $ inserted"

text: I have got the following equation in Latex. During compilation, the compiler complains about "Missing $ inserted". Unfortunately I am not able to find any error. Any ideas?               \begin{dmath} \frac{d^2\boldsymbol{cv}(\boldsymbol{x})}{dt^2}=\frac{d}{dt} \left \{ \frac{d\boldsymbol{cv}(\boldsymbol{x})}{dt} \right \}=\frac{d}{dt} \left \[ N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta}) \right \]=\frac{\partial }{\partial x}\left \[ N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta}) \right \]\dot{\boldsymbol{x}}=\frac{\partial }{\partial x}\left \[ N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta}) \right \]\left \{ \begin{bmatrix}     N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta})\\      -J^{-1}\boldsymbol{\omega }\times J \boldsymbol{\omega}     \end{bmatrix}+\begin{bmatrix}     0_{3 \times 3} & 0_{3 \times 3}\\      J^{-1} & J^{-1}     \end{bmatrix}\begin{bmatrix}\boldsymbol{T}_d \\ \boldsymbol{T }_c\end{bmatrix} \right \}=     \frac{\partial }{\partial x}\left \[ N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta}) \right \]\left \{ \begin{bmatrix}     N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta})\\      -J^{-1}\boldsymbol{\omega }\times J \boldsymbol{\omega}     \end{bmatrix}+\begin{bmatrix}     0_{3 \times 3} & 0_{3 \times 3}\\      J^{-1} & J^{-1}     \end{bmatrix}\begin{bmatrix}\boldsymbol{T}_d \\ \boldsymbol{T }_c\end{bmatrix} \right \}=\frac{\partial }{\partial x}\left \[ N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta}) \right \] \begin{bmatrix}     N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta})\\      -J^{-1}\boldsymbol{\omega }\times J \boldsymbol{\omega}     \end{bmatrix}+\frac{\partial }{\partial x}\left \[ N(\boldsymbol{\theta})\boldsymbol{\omega}+nM(\boldsymbol{\theta}) \right \] \begin{bmatrix}     0_{3 \times 3} & 0_{3 \times 3}\\      J^{-1} & J^{-1}     \end{bmatrix}\begin{bmatrix}\boldsymbol{T}_d \\ \boldsymbol{T }_c\end{bmatrix} \end{dmath}


title: How can I add vertical space to a beamercolorbox to make it align with another one?

text: I'm doing beamer slides in the 16:9 aspect ratio, so I want to use a more horizontal flow than I was when I had 4:3 slides. For example, I'd like to place a theorem and its proof side-to-side rather than the proof below the theorem. As in:               \documentclass[aspectratio=169]{beamer}     \usepackage{tikz}     \usetheme{Rochester}     \begin{document}          \begin{frame}{There is no largest prime number}     \begin{columns}     \begin{column}[t]{0.45\textwidth}     \begin{theorem}      There are infinitely many primes.     \end{theorem}     \end{column}     \begin{column}[t]{0.45\textwidth}     \begin{proof}      Suppose $p$ were the largest prime number.        Let $q$ be the product of the first $p$ numbers.        Then $q+1$ is not divisible by any of them.        Thus it is prime, but is bigger than $p$.        This is a contradiction.     \end{proof}     \end{column}     \end{columns}     \end{frame}     \end{document}      Here is the result: ![sample output](http://i.stack.imgur.com/oOAtW.png) As you can see, the theorem box is a lot shorter than the proof box and the effect is kind of ugly. Is there a nice way to add vertical space to the shorter one to make it the same height as the longer one?


title: Weird compilation error

text: Why is it that               \[       f\langle s,t \rangle = \sum_\substack{v,w \in E \\ v \in S, w \in T}}f(v,w) \\         \]      compiles for me, despite the extra `}`, but               \[       f\langle s,t \rangle = \sum_\substack{v,w \in E \\ v \in S, w \in T}f(v,w) \\         \]      does not? Edit: amsmath 2000/07/18 v2.13, pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX) (format=pdflatex 2013.3.3)


title: Tikz fill double line with pattern not with color

text: I'd like to fill the inner of a double line path with different patterns: hatch, random dots, Poisson discs, grid. Consider following hexagon, where I would like to fill the inner of the edges.               \documentclass[tikz]{standalone}     \usetikzlibrary{calc}          \begin{document}     \begin{tikzpicture}     \def\h{2}     \def\l{1}     \def\t{0.1} % thickness     \def\strokewidth{0.01cm}          \coordinate (A) at (0,0);     \coordinate (B) at ($(A) + (-30:\l)$);     \coordinate (C) at ($(B) + (0,-\h)$);     \coordinate (D) at ($(C) + (-150:\l)$);     \coordinate (E) at ($(D) + (150:\l)$);     \coordinate (F) at ($(E) + (0,\h)$);     \coordinate (A1) at ($(A) + (0,\h/2)$);     \coordinate (B1) at ($(B) + (30:\l/2)$);     \coordinate (C1) at ($(C) + (-30:\l/2)$);     \coordinate (D1) at ($(D) + (0,-\h/2)$);     \coordinate (E1) at ($(E) + (-150:\l/2)$);     \coordinate (F1) at ($(F) + (+150:\l/2)$);     \draw[line width=\strokewidth, double=none, double distance=\t*1cm-2*\strokewidth]           (A) -- (B) -- (C) -- (D) -- (E) -- (F) -- cycle           (A) -- (A1)           (B) -- (B1)           (C) -- (C1)           (D) -- (D1)           (E) -- (E1)           (F) -- (F1)           ;     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/Cyhbe.png) I know that tikz documentation states, that the double line is achieved by drawing two solid lines above each other with different line thickness. So this means a more complicated solution is probably required. Relevant question could be Making the filling / gap between double border lines transparent


title: Split one label into many and append with a, b, c, etc

text: I am making one table into two (or more) and would like them to have the same label _number_ for these two tables, but append them with an "a" or "b" to differentiate them. Also, I would like to be able to refer to them in the text by just the number, not as number.a and number.b. And I would like to retain LaTeX's assume table numbering. For example, a table that LaTeX would later number as 8 is too big to fit on one page, so I split it up manually and want it to be automatically labeled 8a and 8b and referred to as 8 in the text. Does this exist? I am sure that I'm searching the wrong keywords, again. The back story is that I create tables with scripts in R. I looked for a widetable package here yesterday and there are some good solutions, but not for the scripts I already have (although I'd like to later add them). Plus it sounds like a good skill to have. Thanks!


title: Using hyph-utf8 with plain TeX

text: I want to use the UTF-8 hyphenation patterns (for Croatian) with plain TeX (pdftex). I've read the documentation on the hyph-utf8 package but I haven't found it very useful. There's mention of a `\uselanguage{langname}` command but I don't know where to put it. When I tried putting the command in the text file I'm trying to process, an e-TeX error occurs saying `language hr is undefined` (also tried with other languages, like US English, and none of them is recognised; also tried full language names like croatian, etc.). When I try to use the command during format generation, the error "command is undefined" occurs. I've tried directly including the `loadhyph-hr.tex` file (found in hyph-utf8 package) in the `.tex` file I use to create a format, that failed too. Does anyone know how to make this work? _**EDIT_** : This is what my format-generating file (`F.tex`) looks like now:               \let\keptdump\dump \let\dump\relax         \input pdfetex.ini     \let\enc=u     \input csplain.ini     \let\dump\keptdump \let\keptdump=\undefined     \dump      where `csplain.ini` is a file in encTeX with the following content:               \input csfonts  % re-defines primitive \font     \input plain    % format Plain     \restorefont    % original meaning of primitive \font     \input il2code  % extra codes for czech / slovak letters in ISO-8859-2 encoding     \input hyphen.lan  % czech / slovak hyphenation pattern (may be others too)     \input plaina4  % \hsize and \vsize for A4     \everyjob=\expandafter{\the\everyjob        \message{The format: csplain <Sep. 2005>.}        \message{The cs-fonts are preloaded and A4 size implicitly defined.}}     \ifx\enc\undefined \else \input csenc-\enc.tex \fi % re-encoding using encTeX     \ifx\xprncode\undefined \else %% The encTeX is detected        \count255=128               % All codes > 128 are printable:         \loop \xprncode\count255=1 \advance\count255 by 1        \ifnum \count255<256 \repeat     \fi          \ifx\pdfoutput\undefined \else % added in Feb. 2005        \def\tmpa{\pdfcsplain}        \expandafter\def\expandafter\tmpb\expandafter{\csname\jobname\endcsname}        \ifx\tmpa\tmpb %% PDFTeX with PDF output           \message {jobname=pdfcsplain, PDF output initialised.}           \openin0=pdftexconfig.tex           \ifeof0 \message{WARNING: pdftexconfig.tex does not exist.                             I set \string\pdfoutput=1 only.}%           \else \closein0 \input pdftexconfig.tex           \fi           \pdfoutput=1        \else           \message {jobname=csplain with pdftex, DVI output initialised.}           \pdfoutput=0           \let\oripdfoutput=\pdfoutput \let\pdfoutput=\undefined        \fi        \let\tmpa=\undefined \let\tmpb=\undefined     \fi          \dump      I haven't changed anything in this file, but I have modified files `csfonts` and `csenc-u`.


title: How to make {multicols}{2} the same as \twocolumn ?

text: Using `\begin{multicols}{2}` gives me unexpected results. It seems like if I write 8 lines, then it divides by 2, then puts 4 lines in the left column and then the other 4 in the right column (see example 1). What I really want is the layout that `\twocolumn` gives (see example 2). Only when the first column is entire filled then let text overflow to next column. How do I make `\begin{multicols}{2}` to copy the text flowing behavior of `\twocolumn`? **{multicols}{2}** :               example 1     # = text          -----HEADER------     ####### | #######     ####### | #######     ####### | #######     ####### | #######                         -----FOOTER------      **\twocolumn** :               example 2     # = text          -----HEADER------     ####### |     ####### |     ####### |     ####### |     ####### |     ####### |     ####### |     ####### |     -----FOOTER------


title: Section symbol \S not rendering sans-serif in cmbright?

text: Is the section symbol `\S` supported in cmbright? If not, how can I get a sans-serif section symbol? The MWE gives me a serif version.               \documentclass{article}     \usepackage{cmbright}          \begin{document}     The section character \S\ is not rendering sans-serif.     \end{document}


title: TeX Nested Loops With \iftoggle

text: This forum has helped me understand how to use nested loops in TeX, but now I am having trouble using `\iftoggle` (from the `etoolbox` package) with loops. My goal is to have a toggle that can keep track of an "even" or "odd" state as the loops are progressing, where the state is updated by the code inside the loops. However, the example shown below does not work as I expect, as the toggle seems to get set to "even" every time it gets back out into the outer loop. Why does this happen, and how can I prevent it / what is a better way to achieve this functionality?               \documentclass{book}     \usepackage{etoolbox}     \begin{document}     \newcount\X     \newcount\Y          \newtoggle{even}     \toggletrue{even}          \loop     \Y = 0     \advance \X by 1     {%       \loop       \advance \Y by 1       \message{\the\X,\the\Y}       \iftoggle{even}{%         \message{EVEN}%         \togglefalse{even}%       }{%         \message{ODD}%         \toggletrue{even}%       }%       \ifnum \Y < 3       \repeat     }%     \ifnum \X < 6     \repeat     \end{document}      Output (notice the repeated `EVEN`s):               1,1 EVEN 1,2 ODD 1,3 EVEN 2,1 EVEN 2,2 ODD 2,3 EVEN 3,1 EVEN 3,2 ODD 3,3 EVEN 4,1 EVEN 4,2 ODD 4,3 EVEN 5,1 EVEN 5,2 ODD 5,3 EVEN 6,1 EVEN 6,2 ODD 6,3 EVEN


title: How do I get the \cancel (strikeout) in Plain TeX?

text: I've searched both online and in the TexBook, but can not find a command or package. Note, I am pretty new to TeX / LaTeX, but am currently trying to figure out how to do things in Plain TeX. Edit: Thanks for all the answers, but I realized that my question was ambiguous because I used the word "strikeout" which is commonly associated with the horizontal line. I am actually looking for the diagonal strikeout, like the one here, except for Plain TeX. How to strike through obliquely, e.g. to indicate cancellation? Also, I am looking for a solution that works in Math mode.


title: .avi movie in latex using multimedia package

text: I am trying to display a movie (avi format) using the multimedia package which I came to know of from Beamer's documentation. I am using this in the preable:               \usepackage{multimedia}      I am using this for one of my frames:               \begin{frame}{First Frame}     You can see the video below:     \movie[width=3cm,height=2cm,poster]{}{myvideo.avi}     \end{frame}      But no video is seen in the PDF. I am working on writelatex.com. Any help would be appreciated. Thanks, Rohit.


title: Automatically add braces after _ and ^ in math mode with Aquamacs

text: In Texshop there is a very useful tool. When I type `_` or `^` in math mode, the braces appear automatically. Is there an analogous tool in Aquamacs?


title: What are good working practices for VCS with LaTeX documents?

text: I am interested in using a VCS to track changes as I write short LaTeX documents in my daily research. Essentially, I use LaTeX as a whiteboard for developing ideas, and then I have documents to present at weekly meetings with my research advisor. I have some experience with the basic DVCS operations, but I'm having trouble determining good working practices for my setting. Most of the online sources that I've read refer exclusively to longer-lived programming projects. Does anyone have suggestions of good working practices in my use case? Some specific questions:   * How often should I commit? When I'm developing an idea, it's not always clear where the various units of work are. For example, unlike programming, it's not easy to divide into API vs. UI or commit as functions are changed.   * Should I use something like versioned Mercurial patch queues to track the evolution of an idea, and use standard commits when it's clear that an idea is here to stay?   * I often have several files that reside in a single repository, but are more or less independent. For example, these may be two different approaches to the same problem. How should I handle this? Branches? Multiple patch queues? Subrepositories? Different repositories altogether?


title: How do I get different colors for math and for text?

text: I want to include something in my LaTeX article that will make all mathematical formulae appear in black, while all text (including everything inside `\text{}`s in the middle of mathematical formulae) appear in red. Ideally I would like this to be something I could include in the preamble or in a `.cls` file or something like that. What would be the quickest way to do that?


title: Adding nodes to specific positions and without circles around them(but only labels)

text: Based on a previously asked question by me I already have the following code:               \documentclass [11pt,a4paper] {article}     \usepackage[usenames,dvipsnames,svgnames,table]{xcolor}     \usepackage{amsmath,tikz}     \usepackage[margin=1cm]{geometry}     \usepackage{collcell}     \usetikzlibrary{patterns,matrix,arrows}     \begin{document}     \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=3cm,       thick,main node/.style={circle,fill=RoyalBlue!90!green!80,draw,font=\sffamily\Large\bfseries}]       \node[main node] [label=above:Cause](1) {Y};       \node[main node] [label=above:Effect](2) [right of=1] {$X$};       \node[main node] [](3)[above=1] {$N_X$};       \node[main node] [](4)[above=2] {$N_Y$};            \path[every node/.style={font=\sffamily\small}]         (1)edge [right] node[below right] {$\varphi$} (2);       \path[every node/.style={font=\sffamily\small, color=orange}]         (2)edge[bend right,color=orange]node[above] {$\varphi^{-1}$} (1);       \path[every node/.style={font=\sffamily\small, color=orange}]         (3)edge[color=red]node[below] {id} (1);       \path[every node/.style={font=\sffamily\small, color=orange}]         (4)edge[color=blue]node[below] {} (2);     \end{tikzpicture}     \end{document}      However I want to be able to add two nodes without borders as depicted in the following diagram to my diagram: ![enter image description here](http://i.stack.imgur.com/mO1Uf.jpg) As you probably figured it by now, I don't know why but my code puts the circles above each other though I positioned them(3 and 4) relative to two different nodes(1 and 2). and also I don't know how to make the circles disappear and to only keep labels. I have to add that I am happy with the connections between nodes 1 and 2 and the colors of them. I only need the new connections and nodes.


title: British hyphenation with either xelatex or lualatex

text: For several reasons, I am working on a source file that should be compilable by either `xelatex` or `lualatex`. I would like British hyphenation for the text and am using `csquotes` and `biblatex` with `british` options. On the XeTeX mailing list two things were mentioned: (a) Use `polyglossia`, not `babel` with `xelatex`; (b) `polyglossia` is incompatible with `lualatex` at present; use `babel` instead. I show below a sample file with my question and my present setup.               \documentclass[12pt,a4paper]{memoir}     %     \usepackage{fontspec}         \setmainfont{Minion Pro}         \setsansfont{Myriad Pro}     %     % We want to compile with either xelatex or lualatex     % The former requires polyglossia for british hyphenation     % The latter requires bable for british hyphenation     %     % Ideally something like (unsure if this is correct)     %     % \ifxetex     %       \usepackage{polyglossia}     %       \setmainlanguage[variant=british]{english}     %     % \ifluatex     %       usepackage[british]{babel}     %     % should work but I do not know the correct syntax for it.     %     % My workaround is:     %     \makeatletter       \language=\l@british     \makeatother     %     % which works but is inelegant in a *LaTeX source file.     %        \usepackage[backend=biber,babel=none,date=iso8601,urldate=iso8601,language=british,refsection=chapter,sorting=none,style=numeric-comp,hyperref=auto]{biblatex}     \usepackage[english=british]{csquotes}     \begin{document}       Try some hyphenation, some \enquote{quotations}, and some references to see if everything works.     \end{document}      Any suggestions to make hyphenation and other language features like date work consistently across both `xelatex` and `lualatex` is most welcome.


title: Remove the dots next to Chapter in memoir

text: I am new to latex and I am using memoir package to generate the TOC. I need to remove the highlighted part in the below TOC image. I just want it as `CHAPTER` and want to remove the dots and the page number. This is the code in my .sty file ---               %%%% Do the ToC     \let\oldtoc\tableofcontents     \renewcommand{\tableofcontents}{\clearpage\pagestyle{toc}\oldtoc}           \renewcommand{\contentsname}{TABLE OF CONTENTS}      \renewcommand{\listfigurename}{LIST OF FIGURES}      \renewcommand{\listtablename}{LIST OF TABLES}      \renewcommand*{\tocheadstart}{\vspace*{-\topfiddle}}      \renewcommand*{\aftertoctitle}{\thispagestyle{plain}%      \par\nobreak \mbox{}\hfill{\normalfont Page}\par\nobreak}      \renewcommand*{\cftchapterfont}{\normalfont}      \renewcommand*{\cftchapterpagefont}{\normalfont}      \renewcommand*{\cftchapterleader}{      % \cftchapterfont\cftdotfill{\cftchapterdotsep}}      \renewcommand*{\cftchapterdotsep}{\cftdotsep}      %\renewcommand*{\cftchaptername}{CHAPTER~}      %%% no extra space before the entry      \setlength{\cftbeforechapterskip}{0pt plus 0pt}      %% no extra 'chapter' space in LoF/LoT      \renewcommand*{\insertchapterspace}{}      Can you please help me out with this? ![enter image description here](http://i.stack.imgur.com/bWDqb.png)


title: Conversion pt to mm or cm

text: Is there any way how to convert `pt` to `mm` or `cm` in plain TeX?


title: Beamer: how to change the mini frames coloring

text: I want to do the following changes to the mini frames coloring: All previous frames almost the same solid color as the background so that the squares are barely visible. The current frame and all future frames the color of the foreground.                   \documentclass{beamer}         \usetheme{Frankfurt}         \usecolortheme{dove}         \setbeamercolor{section in head/foot}{fg=white, bg=black}     \definecolor{dark-gray}{gray}{0.10} %color for the navigation squares                   \makeatletter     \setbeamertemplate{mini frame}     {%       \begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}         \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\beamer@boxsize}{\the\beamer@boxsize}}         \pgfusepath{fill,stroke}       \end{pgfpicture}%     }     \setbeamertemplate{mini frame in current subsection}     {%       \begin{pgfpicture}{0pt}{0pt}{.1cm}{.1cm}         \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\the\beamer@boxsize}{\the\beamer@boxsize}}         \pgfsetfillcolor{dark-gray}         \pgfusepath{fill}       \end{pgfpicture}%     }          \def\slideentry#1#2#3#4#5#6{%       %section number, subsection number, slide number, first/last frame, page number, part number       \ifnum#6=\c@part\ifnum#2>0\ifnum#3>0%         \ifbeamer@compress%           \advance\beamer@xpos by1\relax%         \else%           \beamer@xpos=#3\relax%           \beamer@ypos=#2\relax%         \fi%       \hbox to 2pt{%         \beamer@tempdim=-\beamer@vboxoffset%         \advance\beamer@tempdim by-\beamer@boxsize%         \multiply\beamer@tempdim by\beamer@ypos%         \advance\beamer@tempdim by -.05cm%         \raise\beamer@tempdim\hbox{%           \beamer@tempdim=\beamer@boxsize%           \multiply\beamer@tempdim by\beamer@xpos%           \advance\beamer@tempdim by -\beamer@boxsize%           \advance\beamer@tempdim by 1pt%           \kern\beamer@tempdim           \global\beamer@section@min@dim\beamer@tempdim           \hbox{\beamer@link(#4){%               \usebeamerfont{mini frame}%               \ifnum\c@section=#1%                 \ifnum\c@subsection<#2%                   \usebeamercolor[fg]{mini frame}%                   \ifnum\c@subsectionslide=#3%                     \usebeamertemplate{mini frame}%\beamer@minislidehilight%                   \else%                     \usebeamertemplate{mini frame in current subsection}%\beamer@minisliderowhilight%                   \fi%                 \else%                   \usebeamercolor{mini frame}%                   \color{fg!50!bg}%                   \usebeamertemplate{mini frame in other subsection}%\beamer@minislide%                 \fi%               \else%                 \usebeamercolor{mini frame}%                 \color{fg!50!bg}%                 \usebeamertemplate{mini frame in other subsection}%\beamer@minislide%               \fi%             }}}\hskip-10cm plus 1fil%       }\fi\fi%       \else%       \fakeslideentry{#1}{#2}{#3}{#4}{#5}{#6}%       \fi\ignorespaces       }               \setbeamertemplate{footline}     {       \leavevmode%       \hbox{%       \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{section in head/foot}%         \usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}       \end{beamercolorbox}%       \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{section in head/foot}%         \usebeamerfont{title in head/foot}\insertshorttitle       \end{beamercolorbox}%       \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{section in head/foot}%         \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}         \insertframenumber{} / \inserttotalframenumber\hspace*{2ex}        \end{beamercolorbox}}%       \vskip0pt%     }     \makeatother              \begin{document}                  \section{Introduction}                 \subsection{Introduction}                        \begin{frame}{Frame}                         1                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         2                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         3                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         4                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         5                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         6                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         7                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         8                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         9                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         10                     \end{frame}                                   \section{Introduction}                 \subsection{Introduction}                        \begin{frame}{Frame}                         11                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         12                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         13                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         14                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         15                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         16                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         17                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         18                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         19                     \end{frame}                      \subsection{Introduction}                        \begin{frame}{Frame}                         20                     \end{frame}              \end{document}      This is an update to a question I posted earlier: Beamer: how to change the mini frames from circles to rectangles, but since it was answered and I suspect that the answer to the updated question is going to differ from the original question I posted this as a new question.


title: Setting font family for the whole document

text: This looks like the basic question but it seems like the hardest thing to me. I need to set the whole document's font style as follows : > Font Family: _Times New Roman_ or _GoudyOlSt BT_ > > Font Size: _11pt_ I am doing something like below but have no effect at all :               \fontencoding{T1}     \fontfamily{garamond}     \fontseries{m}     \fontshape{it}     \fontsize{11}{14}     \selectfont      Also, that would be nice to see the available font-family styles if possible. I would really appreciate if someone direct me to right way.


title: How to set font to Arial throughout the entire document?

text: In preamble, I have:               \renewcommand{\familydefault}{\sfdefault}     \usepackage{arial}      but it doesn't work. How do I set my font to Arial throughout the entire document? **UPDATE:** In short, both answers work. It really depends on the environment. If using LaTeX and don't mind using a cloned font then choose Herbert's answer. If using XeLaTex and want to use the authentic font then choose Leo's.


title: How can I take this image on the same line as my text?

text: **Problem** I have a sentence in my document that is all on one line. I also have a logo (as a .eps file) that is about the same height as the text. I would like to have the logo on the same line as the text, as if it were a kind of bullet- point. **Notes** I am making a poster using a template, where figures have been defined in some weird (to me at least) way. **Minimal working example**               \documentclass[landscape,a0b,final]{a0poster}     \usepackage{graphicx}          % POSTER DEFINITION     \newenvironment{poster}{     \begin{center}     \begin{minipage}[c]{0.95\textwidth}}     {\end{minipage}      \end{center}}          % FIGURE DEFINITION     \newcommand{\myfig}[3][0]{     \begin{center}     \vspace{1.5cm}     \includegraphics[width=#3\hsize,angle=#1]{#2}     \nobreak\medskip     \end{center}}          \begin{document}     \begin{poster}          \vspace{2cm}     \myfig[0]{Time.eps}{0.01}     \large{Here is some text. Here is some more text. Here is some more text. Here is some more text. Here is some more text. Here is some more text. Here is some more text. Here is some more text. Here is some more text. Here is some more text.}          \end{poster}     \end{document}


title: Adding the author photo along with the name in the title page

text: Friends, I'm trying to add a photo along with each author name in a `beamer` title page. Please consider the following code:               \documentclass[10pt]{beamer}          \usepackage[T1]{fontenc}     \usepackage[latin1]{inputenc}          \usepackage{graphicx}          \newcommand{\theauthor}[1]{%     \includegraphics[scale=.3]{#1}     }%          \title{A dinner with us}     \author[Alice and Bob]{\theauthor{alice} and \theauthor{bob}}          \begin{document}          \begin{frame}     \titlepage     \end{frame}          \end{document}      which gives me the following output: ![Screenshot](http://i.stack.imgur.com/xHoma.png) I tried to add the name below the photo, but I had no luck. At first, I thought about using a `tabular` environment, but I could not make it work. I'll probably get rid of the "and" word and put both author blocks aligned, let's say: ![Alignment](http://i.stack.imgur.com/ETS9K.png) Any suggestion on how could I achieve this? I know this might be a very easy question, but it puzzles me. `:-)`


title: Numbers in Newcommand

text: I have some thousands of special text lines specifically numbered.               001001=aaaaaaaa     001002=bbbbbbbb     001003=cccccccc          002001=dddddddd     002002=mmmmmmmm     002003=jjjjjjjj          003001=uuuuuuuu     003002=iiiiiiii     003003=vvvvvvvv      etc. In my Latex file I want to insert that specific assigned text with a simple number entry such as `001001` or perhaps `\001001` , which in return will show `aaaaaaaa` once compiled. How can I do this? Please note that I've already studied following Q&A's but still couldn't come up with a good result, not could I use `\catcode`. I use `xetex` and `polyglossia` if that makes difference.   * Definining commands/abbreviations that contain numbers   * \newcommand gives errors in math mode (with or without arguments)


title: minipage right margin

text: I want to start a minipage, with the regular left-indentation, but to have its right margin adjusted with regular page right margin. An example of discrepancy:               \documentclass{article}     \usepackage[english]{babel}     \usepackage{blindtext}     \begin{document}         \noindent\emph{Here is the regular text:}         \par\smallskip\noindent         \blindtext              \par\medskip              \noindent\emph{And here is the minipage:}         \par\smallskip              \begin{minipage}{\textwidth}             \blindtext         \end{minipage}     \end{document}


title: How to get width of equation

text: If I want to know the width of a text I use               \settowidth{\MyLength}{bla}.       Is there something similar for equations? More specifically I have               \begin{align}     a & b & c & d\\     c & d & c & d     \end{align}      and I would like to have the width of this `align` section. How can I get this?


title: How to use \leadsto in LaTeX2e?

text: I tried to draw an arrow with the command               \leadsto      But I get the following exception:               ! LaTeX Error: Command \leadsto not provided in base LaTeX2e.      So how can I draw such an arrow? I tried to import `latexsym` But then I get this error:               ! Missing $ inserted.     <inserted text>                      $     l.56 ...ecognition, gestures recognition. \leadsto                                                        Multimodal input system & \\          ?


title: \chaptertitle from titleps ignored after redefinition of \chapter macro

text: The following MWE shows that, if the `\chapter` macro is redefined as in a previous question of mine: Prepend different stuffs to starred and unstarred \chapter commands, the `\chaptertitle` macro from the `titleps` (or in `titlesec`?) package is ignored with e.g. `\tableofcontents`, `\listoffigures` and `\listoftables` commands (but is not ignored with ordinary chapters).               \documentclass{book}     \usepackage{lipsum}     \usepackage{xparse,xpatch}     \usepackage{titleps}     \usepackage{tocvsec2}     %     \makeatletter%     % Hack to be sure \resetsecnumdepth* from tocvsec2 behaves well     \@ifpackagelater{tocvsec2}{2014/03/10}{%     }{%       \renewcommand\resetsecnumdepth{%         \@ifstar{%           \setcounter{secnumdepth}{\value{max@secnumdepth}}%           \edef\stack@secnumdepth{\the\c@secnumdepth\relax}%         }{%           \ifx\stack@secnumdepth\@empty%           \PackageWarning{tocvsec2}{There is no previous value for secnumdepth}%           \else%           \afterassignment\gobble@secnumdepth%           \expandafter\c@secnumdepth\expandafter\numexpr\stack@secnumdepth\@nil%           \fi%         }%       }%     }%     \makeatother%     \let\ORIchapter\chapter%     \RenewDocumentCommand\chapter{som}{%       \IfBooleanTF{#1}         {          \setsecnumdepth{none}%         }         {%          \resetsecnumdepth*         }       \IfNoValueTF{#2}         {\ORIchapter{#3}}         {\ORIchapter[#2]{#3}}%     }     % we don't want \chapter* for \tableofcontents and similar lists     \xpatchcmd{\tableofcontents}{\chapter}{\ORIchapter}{}{}     \xpatchcmd{\listoffigures}{\chapter}{\ORIchapter}{}{}     \xpatchcmd{\listoftables}{\chapter}{\ORIchapter}{}{}     % populate the stack     \AtBeginDocument{\setsecnumdepth{none}}     %     \newpagestyle{liminary}[]{%       \sethead[\thepage]%       []%       [\chaptertitle]%       {%         \sectiontitle%       }%       {}%       {\thepage}%       \headrule%     }%     %     \pagestyle{liminary}     \begin{document}     \tableofcontents     \listoffigures     \listoftables     \chapter{A 1st chapter}     \lipsum[1-10]     \section{A 1st section of the 1st chapter}     \lipsum[1-10]     \end{document}      If the lines:               \xpatchcmd{\listoffigures}{\chapter}{\ORIchapter}{}{}     \xpatchcmd{\listoftables}{\chapter}{\ORIchapter}{}{}      are commented, the corresponding `\chaptertitle` are not ignored (maybe with side effects I didn't notice) but if the line:               \xpatchcmd{\tableofcontents}{\chapter}{\ORIchapter}{}{}      is commented, a "TeX capacity exceeded" error arises:               ! TeX capacity exceeded, sorry [input stack size=5000].     \@nameuse #1->\csname #1                             \endcsname      l.62 \tableofcontents          !  ==> Fatal error occurred, no output PDF file produced!      Maybe it could be helpful to notice that, with or without:               \xpatchcmd{\printglossary}{\chapter}{\ORIchapter}{}{}      the `\printglossary` command behaves well w.r.t. `\chaptertitle`, as shown by the following MWE:               \documentclass{book}     \usepackage{lipsum}     \usepackage{xparse,xpatch}     \usepackage{titleps}     \usepackage{tocvsec2}     \usepackage{glossaries}     \makeglossaries     \newglossaryentry{bar}{%       name={bar},       description={bar}     }     %     \makeatletter%     % Hack to be sure \resetsecnumdepth* from tocvsec2 behaves well     \@ifpackagelater{tocvsec2}{2014/03/10}{%     }{%       \renewcommand\resetsecnumdepth{%         \@ifstar{%           \setcounter{secnumdepth}{\value{max@secnumdepth}}%           \edef\stack@secnumdepth{\the\c@secnumdepth\relax}%         }{%           \ifx\stack@secnumdepth\@empty%           \PackageWarning{tocvsec2}{There is no previous value for secnumdepth}%           \else%           \afterassignment\gobble@secnumdepth%           \expandafter\c@secnumdepth\expandafter\numexpr\stack@secnumdepth\@nil%           \fi%         }%       }%     }%     \makeatother%     \let\ORIchapter\chapter%     \RenewDocumentCommand\chapter{som}{%       \IfBooleanTF{#1}         {          \setsecnumdepth{none}%         }         {%          \resetsecnumdepth*         }       \IfNoValueTF{#2}         {\ORIchapter{#3}}         {\ORIchapter[#2]{#3}}%     }     % we don't want \chapter* for \tableofcontents and similar lists     \xpatchcmd{\tableofcontents}{\chapter}{\ORIchapter}{}{}     \xpatchcmd{\listoffigures}{\chapter}{\ORIchapter}{}{}     \xpatchcmd{\listoftables}{\chapter}{\ORIchapter}{}{}     \xpatchcmd{\printglossary}{\chapter}{\ORIchapter}{}{}     % populate the stack     \AtBeginDocument{\setsecnumdepth{none}}     %     \newpagestyle{liminary}[]{%       \sethead[\thepage]%       []%       [\chaptertitle]%       {%         \sectiontitle%       }%       {}%       {\thepage}%       \headrule%     }%     %     \pagestyle{liminary}     \glsaddall     \begin{document}     \printglossary     \tableofcontents     \listoffigures     \listoftables     \chapter{A 1st chapter}     \lipsum[1-10]     \section{A 1st section of the 1st chapter}     \lipsum[1-10]     \end{document}      Hence my question: is it possible to adjust the redefinition of the `\chapter` macro as in a previous question of mine: Prepend different stuffs to starred and unstarred \chapter commands in order `\chaptertitle` from `titleps` package is not ignored for commands like `\tableofcontents`, `\listoffigures` and `\listoftables`?


title: Widecheck over two \hat

text: I need to write a formula with a `\widecheck` over two `\hat`. The equation is the following:               \documentclass[a4paper,11pt]{article}     \usepackage{amsmath}      \usepackage{amsfonts,amssymb,mathabx}          \begin{document}     \begin{equation}     \tilde{A}^\mu_\Lambda = \widehat{\widehat{G}\cdot\widehat{j^\mu_\Lambda}}.     \end{equation}     \end{document}      If I write this code I obtain a lot of errors (undefined control sequence, missing number treated as zero, illegal unit of measure (pt inserted), etc...). If I use `\widehat` instead of `\widecheck`, the result is the same. I have problems also writing               \widecheck{\hat{G} \cdot j}      because the result is not correct (G is translated to the right and overwrites j). How can I write the `\widecheck`?


title: Long lines don't wrap when characters are input by number

text: Why doesn't the following long line wrap and how to force it to?               \documentclass[a4paper]{article}     \usepackage{polyglossia}     \setmainlanguage{english}     \setotherlanguage{arabic}          \newfontfamily\arabicfont[Script=Arabic, Scale=1]{Tahoma}          \begin{document}     This is a very long line that normally needs to be wrapped:     \\     \textarabic{\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64474\char64475\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381\char64380\char64381}          Same thing with a space filled character line like this one:     \\     \textarabic{\char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64474 \char64475 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381 \char64380 \char64381}     \end{document}


title: ! I can't find file `pgfutil-common-lists.tex'. \input pgfutil-common-lists.tex

text: I've recently run into the following error message that I have no idea on how to resolve: > >     ! I can't find file `pgfutil-common-lists.tex'. \input pgfutil-common- > lists.tex >   It occurs when I use the `pgfplots` package. It showed up all of a sudden yesterday (even though previously it compiled fine with the `pgfplots` package) and I haven't done any changes to it. I've never had to input the `pgf-common-lists.tex` file before for it to work. I am currently using MiKTeX with Texmaker on Windows 7. My latex files compile fine on other computers. I have seen a similar problem answered here (I can't find file `pgfutil- common-lists.tex') but I am on a Windows 7 machine and cannot follow the instructions given in the answer. New error after I included the above file: > >     ! I can't find file `pgfmathfunctions.integerarithmetics.code.tex' >   Solved: reinstalled miktex.


title: Sideways figure always rotates clockwise

text: I have a full page image I am displaying via               \usepackage{rotating}     ...          \begin{sidewaysfigure}[counterclockwise]             \centering         \includegraphics[width=.9\textwidth]{visualizer}         \caption[Quaternion visualizer GUI]{Quaternion visualizer GUI}         \label{fig:QuatViz}     \end{sidewaysfigure}          \afterpage{\clearpage}      I would like to rotate it CCW, but in spite of me specifying the counterclockwise argument, it rotates it clockwise. I've tried omitting the counter-clockwise argument (since from what I understand CCW is default), changing the image size and a few other things. This is the only sideways figure in my document. The clear page is so that the figure and all of the ones following it don't get pushed to the end of the chapter. What am I doing wrong? Thanks


title: poor man's condensed with pdflatex

text: I am looking for a solution to create "poor man's condensed" with pdflatex. Here I found an answer that works with XeTeX, however it uses package `fontspec`, but I need something for pdflatex. And as in the referenced question, wrapping the condensed stuff with, say, `\scalebox{0.9}[1]` is not an option as I need the condensed text to allow linebreaking ... In case it helps: I am using the `mycrotype`package anyway and from reading its documentation I understand that it uses ad hoc condensing and widening per line behind the scenes, so I guess _something_ should be possible somehow.               \documentclass{article}     \def\textcondensed#1{\scalebox[0.9]{1}{#1}} % This is almost fine, except line breaking          \begin{document}     This is just some normal text, but the latin phrase     \textcondensed{lorem ipsum dolor sit amet}     that it contains is typeset in condesed.     \end{document}


title: Error trying to compile tikzpicture code

text: Some of my tikzpicture code won't compile anymore. The following code used to compile (2 years ago), but now I get               "ABD: EveryShipout initializing macros     ! Package pgf Error: No shape named B is known.          ! Package pgf Error: No shape named B is known.          See the pgf package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.15 \WE(B){A}"      I have installed the latest pgf package, but it doesn't make a difference. Here is the code.               \documentclass[12pt]{article}     \usepackage[pdftex]{graphicx}     \usepackage {amssymb,amsmath,amsfonts,amsthm,verbatim,pgfpict2e}     \usepackage{tikz,tkz-berge}           \begin{document}               \begin{tikzpicture}[scale=1.4]     \GraphInit[vstyle=Dijkstra]     \tikzset{node distance = 5.25cm}     \tikzstyle{EdgeStyle}= [thick]     \Vertices*{square}{E,D,C,B}     \tikzset{node distance = 2.75cm}     \WE(B){A}     \SO(B){G}     \WE(G){F}     \tikzset{node distance = 3cm}     \SOEA(B){H}          \Edge[label=$20$](A)(B)     \Edge[label=$70$](B)(C)     \Edge[label=$40$](A)(F)     \Edge[label=$30$](F)(G)     \Edge[label=$30$](G)(H)     \Edge[label=$20$](B)(H)     \Edge[label=$50$](H)(D)     \Edge[label=$70$](F)(E)     \Edge[label=$50$](E)(D)     \Edge[label=$50$](G)(D)     \Edge[label=$70$](C)(D)     \end{tikzpicture}       \end{document}


title: O'Reilly template

text: I don't know for you, but on my side, I'm a big fan of the O'Reilly book presentation. I was wondering if some of you know where I could find a LaTeX template with the same presentation ?


title: Baseless triangle node in Tikz

text: I am currently trying to draw a node shaped like a "baseless" triangle or angle bracket shape for a Wigmore chart (a chart representing argumentation at trial). In the example below, I'd ideally like to remove the right-hand edge of the triangle beside node 7 (to show an attack, rather than support). ![Example Wigmore chart](http://i.stack.imgur.com/6f1ss.jpg) I've looked at the pgf manual, section 75.5, that describes defining new node shapes, but I'm finding it extremely complicated. Is there a simpler way, such as a package or working example I've missed?


title: Strikeout formula inside eqnarray?

text: I want to strikeout a part of my paper. In particular, this one:               When bla bla $s$ bla bla $v$, bla bla $\boldsymbol{x}_{v}$, bla bla, the equation is:     \begin{eqnarray}     \displaystyle p_{v,s} & = & \displaystyle v+s = \nonumber\\     & = & \displaystyle  v^{2} - s^{3}. \label{eqn:pvs}     \end{eqnarray}      I've tried with `\cancel` but this only works with the first part of the text:               \cancel{When bla bla $s$ bla bla $v$, bla bla $\boldsymbol{x}_{v}$, bla bla, the equation is:}      and I get error when I use it on `eqnarray`. I've also tried `\sout` but the result was the same. **Additions** This is what I get when I use `\sout` on the text part. I would like that also the equation is stricken out! ![enter image description here](http://i.stack.imgur.com/L1BgO.png)


title: Special Currency Character

text: I have the problem, that I need to insert the NIS (New Israeli Shekel) Symbol into a otherwise english document with math formulas. The Symbol itself is in testmode. How can I manage to get the symbol? It can be a hack as well...


title: How to \label and get recognised?

text: This issue actually frustrates me for a while, but prior for finding the solution, I would like to know why this happens. In a nutshell: _My TeXStudio does recognise ALL my_ `\label`, _but the output does not recognise some labels._ ## Problem I am writing my notes on Physics, however, sometimes I got warnings of:               LaTeX Warning: Reference `eq:pointcd' on page 196 undefined on input line 985.      This is just for example, I have other examples in the document that does not have `\label` recognised. There are also some weird situation where I have the same format of putting `\label`, but got recognised by the compiler. ## MWE               \documentclass[12pt,a4paper,headinclude,openright]{scrbook}     \usepackage{amsmath}     \usepackage{amssymb}     % ------------here comes the problem part------------     \usepackage[listings,theorems,skins,breakable]{tcolorbox}     \tcbuselibrary{breakable}     %======================== Ch.4 boxes =========================     \tcbset{exercisestyle04/.style={arc=0.5mm,coltitle=black,fonttitle=\sffamily\bfseries,colback=color04!50!,colframe=color04}}          \newtcolorbox[auto counter,number within=chapter,list inside=eg]%     {exercise04}[2][]{exercisestyle04,     title={Exercise ~\thetcbcounter: #2}}          \tcbuselibrary{theorems}     \usepackage[amsthm,thmmarks,hyperref]{ntheorem}     % theorem      \usepackage{regexpatch}     \makeatletter     \xpatchcmd*{\thm@@thmline@name}{2.3em}{5em}{}{}      \xpatchcmd*{\thm@@thmline@noname}{2.3em}{5em}{}{}     \makeatother     \makeatletter     \renewtheoremstyle{plain}%     {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2 \theorem@separator]}%     {\item[\hskip\labelsep \theorem@headerfont ##1\ ##2\ \sffamily{##3}  \theorem@separator]}     \makeatother     \theoremstyle{plain}     \theorembodyfont{\normalfont\sffamily}     \theoremheaderfont{\bfseries}     \newtheorem{theorem}{Theorem}[section]     % ------------here ends the problem part------------     \begin{document}     \begin{equation}     \rho\left(\mathbf{r}\right)\;=\;\sum_{k=1}^{N}\: q_k \delta\left(\mathbf{r}\;-\;\mathbf{r}_k\right)     \label{eq:pointcd}     \end{equation}     However, one should alert for the unphysical divergence in other quantities associated with \eqref{eq:pointcd}.     \end{document}      ## In your answer... I am not specifying you of how to answer this question, this section is just my suspects on the issue. For example,   1. ~~The pdf compiler is faulty? (I use Acrobat XI and with`PdfLaTeX` as compiler and using `DVI -> PS -> PDF chain` in TeXStudio)~~   2. ~~My compiling procedures has done wrongly?~~   3. ~~My format is done wrong _(although I fairly think so because I changed my format according to many sources but no luck)_.~~   4. ~~TeXStudio is faulty? _(Just a suspect, but did happened with other IDEs before and I am using ver. 2.8.0)_~~   5. _I haven't read the manual carefully?_ (smile) _It turns out some code has obstructed the PdfLaTeX to recognise some_ `\label`. ## Update While I was omitting the parts that I have some idea why it happens, however, it is neither of the five above.   1. While I deleted some of the `\frontmatter`, by delete a section (see MWE above) become fine to recognise the referencing.   2. I suspect the part is obstructing the compiler to recognise some `\label`. ## Solution See Mico's answer, but I would like to append that it was actually because of               5. I haven't read the manual carefully


title: Getting `tables` R package to print a text file that I can import into my .tex file

text: I'm trying to write some R code that takes data from my (evolving) experiment, makes a summary statistics table, and inputs it into the .tex document that I'm writing. I want to avoid copy-pasting. I want to avoid sweave because I don't have the badwidth to learn it right now, and because my code is complicated and takes a long time to run. What I want is a table like I can get with the `tables` package in R, exported to a text file that I can then import into the .tex document using the `\input{}` command. Here is some simple R code that doesn't work like I'd like it to:               1> fac = c(rep("a",10),rep("b",10),rep("c",10))     1> var = c(rnorm(10,mean=4,sd = 5),rnorm(10,mean=2,sd = 10),rnorm(10,mean=3,sd = 1))     1> d = data.frame(fac,var)     1> library(tables)     1> sumstats = with(d, tabular(var*(fac+1)~mean+sd))     1> latex(sumstats)     \begin{tabular}{llcc}     \hline      & fac & mean & \multicolumn{1}{c}{sd} \\      \hline     var & a  & $-0.1415$ & $\phantom{0}7.241$ \\      & b  & $\phantom{-}0.3324$ & $14.704$ \\      & c  & $\phantom{-}3.1590$ & $\phantom{0}1.118$ \\      & All  & $\phantom{-}1.1166$ & $\phantom{0}9.271$ \\     \hline      \end{tabular}     1> write.table.tabular(latex(sumstats),file='sumstats.txt')     \begin{tabular}{llcc}     \hline      & fac & mean & \multicolumn{1}{c}{sd} \\      \hline     var & a  & $-0.1415$ & $\phantom{0}7.241$ \\      & b  & $\phantom{-}0.3324$ & $14.704$ \\      & c  & $\phantom{-}3.1590$ & $\phantom{0}1.118$ \\      & All  & $\phantom{-}1.1166$ & $\phantom{0}9.271$ \\     \hline      \end{tabular}     1> read.table('sumstats.txt')                 V1     1 character(0)      Is there a way to get R to write a summary statistics table that had been formatted for latex, that avoids the need to dive into sweave?


title: How to remove the extra vertical lines in a table

text: There are two vertical lines on top of my table that are not supposed to be there. It looks something like this: | |                  Table 1: Title      This is the beginning of my code:               \renewcommand{\arraystretch}{1.2}     \begin{table}[h!]                  \centering                      \begin{tabular}{|p{.5in}|C{1.2in}|C{1.4in}|C{1.2in}|} \\                      \multicolumn{4}{c}{\textbf{Table 7: Efficiency Analysis}} \\                      \hline \hline      How do I remove those two vertical lines?


title: Diagonal tabular cell questions

text: My MWE is adapted from How to diagonally divide a table cell … properly?. Two questions:   1. I add an empiric rule of `0.71\baselineskip`, but why `0.71`?   2. Why `c=...` is not centered as the text below is? **Edit** One ca see a simplified and corrected version here : Optional argument problem ![output](http://i.stack.imgur.com/tkWAM.png)               \documentclass[10pt,french]{article}     \usepackage[T1]{fontenc}     \usepackage{babel}     \usepackage{array}     \usepackage{calc}     \usepackage{tikz,fourier}          \newcommand\diag[5]{%       \multicolumn{1}{|m{#2}|}{\hskip-\tabcolsep       $\vcenter{\begin{tikzpicture}[baseline=0,anchor=south west,outer sep=0]       \path[use as bounding box] (0,0) rectangle (#2+2\tabcolsep,\baselineskip);       \node[minimum width={#2+2\tabcolsep-\pgflinewidth},             minimum  height=\baselineskip+#3-\pgflinewidth] (box) {};       \draw[line cap=round] (box.north west) -- (box.south east);       \node[anchor=south west,align=left,inner sep=#1] at (box.south west) {#4};       \node[anchor=north east,align=right,inner sep=#1] at (box.north east) {#5};      \end{tikzpicture}}\rule{0pt}{.71\baselineskip+#3-\pgflinewidth}$\hskip-\tabcolsep}}          \begin{document}     \begin{tabular}{%         |>{\centering\arraybackslash}m{4.5cm}         |*{4}{>{\centering\arraybackslash}m{2.5em}|}}\hline     \diag{\tabcolsep}{4.5cm}{3.4em}{Coefficient\\ de frottement $c$}{Vitesse $V$\\ (en km/h)}&50&90&110&20\\ \hline     $c=0,8$\newline route s\`eche, bitume neuf &&&&\\ \hline     $c=0,7$\newline route s\`eche, bitume moyen &&&&\\ \hline     $c=0,8$\newline route mouill\'ee, bitume moyen &&&&\\ \hline     \end{tabular}     \end{document}


title: Adding \paragraph sections inside abstract package's onecolabstract environment

text: I am having trouble using `\paragraph{}` inside the `onecolabstract` environment. The desired goal would look something like this:               \documentclass[twocolumn]{article}     \usepackage{lipsum}     \usepackage{abstract}     \title{Minimal Example}     \author{DocBuckets}     \begin{document}     \twocolumn[         \maketitle         \begin{onecolabstract}             \textbf{Background} Abstract background text...                  \textbf{Methods and Results} Abstract methods text...                  \textbf{Conclusions} Abstract conclusions text...         \end{onecolabstract}     ]     \section{Introduction}     \lipsum[1]     \section{Methods}     \lipsum[2]     \end{document}      But I want to use `\paragraph{Background}`, `\paragraph{Methods and Results}`, etc. instead of the `\textbf{}` alternatives I use in the minimal example. When I try this, I get all sorts of errors. Perhaps relatedly, I also got errors when trying to use the `\lipsum[1]` method to generate abstract paragraphs in the minimal example I give. I suspect the problem is the same for `\lipsum` and `\paragraph` in `onecolabstract`. Is there something I can do to make this work?


title: Pie Chart with text outside pie

text: I'm able to draw pie chart using tex code mentioned below:               \documentclass[landscape,a3paper,11pt]{article}     \usepackage{pstricks-add}     \usepackage{pgfplots, pgfplotstable}     \begin{document}     \begin{center}     \begin{pspicture}(-5,-4)(4,4)     \psset{unit=1.2}     \psChart[userColor={black!10,black!40},chartSep=10pt,chartNodeI=0.5,shadow,shadowsize=3pt]{10,90}{}{3}     \bfseries     \rput(psChartI1){Above 10 \%}     \rput(psChartI2){Below 90 \%}     \end{pspicture}     \end{center}     \end{document}      I want to move text inside pie chart to outside (as highlighted in RED color) can you please suggest? ![enter image description here](http://i.stack.imgur.com/HeNvF.png)


title: Place a document at the end but evaluate it at the beginning

text: I would like to collect certain `\newcommand`s in an appendix, so that each one can have a section explaining itself. However, if I put this appendix at the end of the file, then I can't call the commands in the middle of my text because they won't be defined yet. Is there any way to force LaTeX to scan a file and execute only the command definitions in it?


title: What is the command for a sum symbol superimposed on an integral sign?

text: I want to express a sum over all discrete states and an integral over all continuum states. Usually, the sign for this is a `$\sum$` superimposed on an `$\int$`. Is there a command to make this symbol? If not, can it be made by combining the sum and integral symbols in some way?


title: tikz Join line segments of different thickness with miter

text: Reading "tikz Multi-segment Line of Varying Thickness" provides a good explanation to join segments, but it seems that the rounded corner transition is the only way to do this nicely? I would like to join segments of different thickness with a nice sharp miter, getting similar results in the case of these two: Lines of the same thickness have a nice miter:               \draw [very thick] (0.45,-0.2) to (0.45,0.17) to (0.75,-0.17) to (0.75,0.2);      But if I try to join a thick line to a thin line, there is an artifact:               \draw [very thick] (1.3,0.2) to (1,0) to (1.3,-0.2);     \draw (1,0) to (1.3,-0.2) to (1.3,0.2) to (1,0);          ![nice miter same thickness, but nasty joints between two](http://i.stack.imgur.com/7vMJe.png) The resulting mitre would appear thus (except not edited by hand): ![desired mitre](http://i.stack.imgur.com/bxshV.png)


title: How to create conditionals in a document class for latex?

text: I am trying to write a document class `highschool.cls` for the high school research papers in our school based on the `book.cls` in order to make the format of the papers standardized. I am trying to define a signature page with heading ``CERTIFICATION'' such that the following text appears on the page. ![enter image description here](http://i.stack.imgur.com/MsMSx.png) To achieve this, I made the following definitions on LaTeX class `highschool.cls`.               \NeedsTeXFormat{LaTeX2e}[1995/12/01]     \ProvidesClass{highschool}                           [2012/08/22 v0.1e              Standard LaTeX document class]          \newcommand\@ptsize{}     \newif\if@surnamea  \@surnameafalse     \newif\if@surnameb  \@surnamebfalse     \newif\if@surnamec  \@surnamecfalse     \newif\if@firstnamea    \@firstnameafalse     \newif\if@firstnameb    \@firstnamebfalse     \newif\if@firstnamec    \@firstnamecfalse     \newif\if@midinitiala    \@midinitialafalse     \newif\if@midinitialb    \@midinitialbfalse     \newif\if@midinitialc    \@midinitialcfalse          \setlength\paperheight {11in}%     \setlength\paperwidth  {8.5in}%     \setlength\textwidth   {6in}%          \def\defenseDate#1{\gdef\@defensedate{#1}}     \def\surnamea#1{\gdef\@surnamea{#1}}     \def\firstnamea#1{\gdef\@firstnamea{#1}}     \def\midinitiala#1{\gdef\@midinitiala{#1}}     \def\surnameb#1{\gdef\@surnameb{#1}}     \def\firstnameb#1{\gdef\@firstnameb{#1}}     \def\midinitialb#1{\gdef\@midinitialb{#1}}     \def\surnamec#1{\gdef\@surnamec{#1}}     \def\firstnamec#1{\gdef\@firstnamec{#1}}     \def\midinitialc#1{\gdef\@midinitialc{#1}}          \if@compatibility       \renewcommand\@ptsize{0}     \else \DeclareOption{10pt}{\renewcommand\@ptsize{0}} \fi     \DeclareOption{11pt}{\renewcommand\@ptsize{1}}     \DeclareOption{12pt}{\renewcommand\@ptsize{2}}     \ExecuteOptions{12pt,oneside,final,openright}      \ProcessOptions     \input{bk1\@ptsize.clo}          \def\signaturep{ %% signature page..        \topmargin 0in \headsep 0in        \begin{center}        \textbf{CERTIFICATION}\\[6pt]        \end{center}        This is to certify that this research paper entitled,        \textbf{``{\uppercase\expandafter{\@title}}''} and submitted by       \textbf{\uppercase\expandafter{\@firstnamea} \uppercase\expandafter{\@midinitiala}. \uppercase\expandafter{\@surnamea}}, \textbf{\uppercase\expandafter{\@firstnameb} \uppercase\expandafter{\@midinitialb}. \uppercase\expandafter{\@surnameb}}, and \textbf{\uppercase\expandafter{\@firstnamec} \uppercase\expandafter{\@midinitialc}. \uppercase\expandafter{\@surnamec}}         to fulfill part of the requirements for        the course Science and Technology Research II was successfully        defended and approved on \expandafter{\@defensedate}.     }%% signature page          \def\prelim{%%prelim page     \typeout{Making SMCT preliminary headings...}%        \pagestyle{plain}        \pagenumbering{roman}        \signaturep \newpage        \baselineskip=20pt     } %%prelim          \endinput      In my source TeX file, I would type something like               \documentclass{highschool}          \defenseDate{18 August 2012}     \title{This is the Title of the Paper}     \surnamea{Author}     \firstnamea{First}     \midinitiala{N}     \surnameb{Author}     \firstnameb{Second}     \midinitialb{N}     \surnamec{Author}     \firstnamec{Third}     \midinitialc{N}          \begin{document}     \prelim %% Prints Preliminary chapters          \end{document}      What I want to achieve is that   * when there are no `\surnameb,\firstnameb,\midinitialb,\surnamec,\firstnamec,` and `\midinitialc` declared, I get the following text: ![enter image description here](http://i.stack.imgur.com/MZsl9.png)   * when there are no `\surnamec,\firstnamec,` and `\midinitialc` declared, I get the following text: ![enter image description here](http://i.stack.imgur.com/HUFB3.png)   * and when all are declared, I get the text: ![enter image description here](http://i.stack.imgur.com/WQMfq.png) Is it possible to do this? If it is, how do I do it?


title: How do I centre my title properly

text: The title "NAME" seems to be shifted slightly to the right when I use this code, is there a fix to this?               \documentclass[11pt]{res} %Sets the default text size to 11pt and class to article.          %------------------------Dimensions--------------------------------------------          \begin{document}      %These two pieces of code tell LaTeX that everything that goes in between these tags is what you want displayed as your actual document.     \centerline{{\Huge \sc NAME} }  %Makes whatever text you put in parenthesis move to the center          %Prevents the following text from being indented     %This is the same as a return in Latex     \centerline{124 derp Ave\textbullet \hspace{5pt}  Somewhere,Somewhere \textbullet \hspace{5pt}6125 396 448}      \centerline{random8@hotmail.com}      \end{document}


title: Enumerated sorted list with datatool

text: How can I adapt a sorted list so that it becomes an enumerated sorted list? Here is the sorted list I currently have.               \documentclass{report}     \usepackage{enumitem}     \usepackage{datatool}          \newcommand{\sortitem}[2]{%     \DTLnewrow{list}%     \DTLnewdbentry{list}{label}{#1}%     \DTLnewdbentry{list}{description}{#2}%     }          \newenvironment{sortedlist}{%     \DTLifdbexists{list}{\DTLcleardb{list}}{\DTLnewdb{list}}%     }{%     \DTLsort{label}{list}%     \begin{description}%     \DTLforeach*{list}{\theLabel=label,\theDesc=description}{%     \item[\theLabel] \theDesc }%     \end{description}%     }          \section*{Analysis.}     \begin{sortedlist}     \sortitem{Elementary Analysis--The Theory of Calculus}{Ross}     \sortitem{Analysis of Functions of a Single Variable}{Baggett}     \sortitem{Advanced Calculus and Real Analysis}{Craw}     \end{sortitem}          \end{document}      I would like for this list to be an enumerated list as well. Is that possible, and if so how?


title: Script to delete a command and associated curly braces from source in TeXShop?

text: When I'm editing the source in TeXShop, I often find that I want to remove emphasis from a word or phrase. But deleting the `\emph` from the beginning of the word and the `{}` surrounding it is a bit more annoying than I would like it to be. I suppose what I'm looking for is a script that I can execute at the start of a command (like `\emph`) that will scan left-to-right and delete everything except for the text between the curly braces (i.e., that will delete the "\emph", the "{", and the "}") Something that would take me from               This is \emph{emphasized} text       to               This is emphasized text       In the code itself.


title: Cannot find a mathematical symbol (similar to \cong)

text: I am looking for a mathematical symbol that I have seen in some papers. It looks very similar to the `\cong` symbol, but is flipped vertically. In other words, what I am looking for is an equal sign underlined by a tilde. I have seen `\eqsim`, but this is not what I am looking for. Any help would be greatly appreciated.


title: Legend marker in pgfplot bar chart

text: I spent the last hours trying to solve this issue. I hope you can help me, sorry if the answer appears clearly somewhere else, I was not able to find it. I would like to adjust the marker/symbol in the legend for the first plot. I tried with the following (making them green and blue):               \documentclass[12pt]{article}     \usepackage{pgfplots}     \begin{document}          \begin{tikzpicture}     \pgfplotstableread{ % Read the data into a table macro     Label   First Second        1    5      56.1         2     22        56.5         3     5         44.3        4    5  42.0        }\datatablet     \begin{axis}[     xbar,     ]     \addplot [fill=black]           table [y=Label, x=First] {\datatablet};       \addplot [fill=black!20!white]  table  [y=Label, x=Second]  {\datatablet};      \addlegendimage{area legend,fill=green}\addlegendentry{TEST}       \addlegendimage{area legend, fill=blue} \addlegendentry{TEST2}         \end{axis}     \end{tikzpicture}              \end{document}      which gives me thefollowing output.. ![enter image description here](http://i.stack.imgur.com/johfD.png) what am I doing wrong? Thanks for your help, Ilkay.


title: Number line and hatching

text: How to draw number line and hatching with TikZ like the following? ![enter image description here](http://i.stack.imgur.com/myedD.png)


title: Why does fitting fail in TikZ in the second image?

text: I have a document with two tikz pictures, both use the _fit_ library. As long as I only have one picture everything works fine:               \documentclass[a4paper]{article}     \usepackage[english]{babel}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}         \usetikzlibrary{fit}         \node(n){x};         \node [fit=(n),draw]{};     \end{tikzpicture}     \end{document}      As soon as I add a second picture:               \documentclass[a4paper]{article}     \usepackage[english]{babel}     \usepackage{tikz}          \begin{document}     \begin{tikzpicture}         \usetikzlibrary{fit}         \node(n){x};         \node [fit=(n),draw]{};     \end{tikzpicture}     \begin{tikzpicture}         \usetikzlibrary{fit}         \node(n){x};         \node [fit=(n),draw]{};     \end{tikzpicture}     \end{document}      I get the following error > Package pgfkeys Error: I do not know the key '/tikz/fit' and I am going to > ignore it. Perhaps you misspelled it. Why is the pgfkey suddenly missing in the second picture and what can I do to fix it?


title: Passing argument to \ifnum

text: `\ifnum` works fine it it's got two straight numbers. However, when calculation is involved, I get bunch of `! Missing = inserted for \ifnum.` errors. Is there any way to solve that problem?               \newcommand{\axes}[1]{     \ifnum\ifnum#1>180 1\else\ifnum#1>-180 0\else1\fi\fi =1       blah;     \fi}          \axes{200}; % fine     \def\anga{20.5};     \axes{180+\anga}; % not fine


title: Adjust Format of List of Algorithms

text: I'm using an existing LaTeX template for a thesis and am trying to match the List of Algorithms to the List of Figures. I have already applied some formatting changes, but there are a few attributes that I am having trouble manipulating. Here is a sample of the LoF: * * * ![LoF](http://i.stack.imgur.com/Y21cB.png) * * * And here is a sample of the LoA: * * * ![enter image description here](http://i.stack.imgur.com/GpHpY.png) * * * There are three attributes that I still need to edit in the LoA:   * The algorithm number needs to be flush with the column heading    * The indentation after the algorithm number needs to be reduced slightly    * The spacing between the dot separation needs to be reduced in the LoA After much googline, I was able to find a couple attributes Ideally, I would like to know where the source code is located that produces the LoA so that I can view it myself and any documentation associated with the construction of the LOA, but I am also interested in knowing how to edit these three specific attributes. * * * **EDIT** I'm working on a minimal working example, but the template is a bit convoluted. Here is the main .tex file:               \documentclass[oneside, 12pt]{memoir}     \usepackage{verbatim}     \usepackage[labelsep=period, font=singlespacing, skip=12pt, format=hang,     justification=RaggedRight, singlelinecheck=false]{caption}     \usepackage[T1]{fontenc}     \usepackage{times}     \usepackage{indentfirst}     \usepackage{thesis}     \usepackage{layouts}     \usepackage{array}     \usepackage{caption}     \usepackage{subcaption}     \usepackage{subfig}     \usepackage{algorithmic}     \usepackage{algorithm}     \usepackage{multirow}     \usepackage{amsmath}     \usepackage{tocloft}          \floatname{algorithm}{\textnormal{Algorithm}}     \renewcommand{\thealgorithm}{\textnormal{\arabic{algorithm}.} }          \renewcommand{\listalgorithmname}{LIST OF ALGORITHMS\\     \thispagestyle{plain}%     \par\nobreak {\normalfont ALGORITHM \hfill PAGE}\par\nobreak     }                    \begin{document}               \listoffigures     \clearpage     \pagebreak     \listofalgorithms     \clearpage     \pagebreak          \pagestyle{plain}          \mainmatter     \counterwithout{figure}{chapter}     %\counterwithout{table}{chapter}     \addtocontents{toc}{\noindent CHAPTER \par}     \setulmarginsandblock{0.75in}{1.25in}{*}          \begin{figure}[t]     \centering     \begin{subequations}     \begin{equation} \label{eq:tf}     tf(t, d) = \frac{| t \in d |}{| words \in d |}     \end{equation}     \vspace{\linespace}     \begin{equation} \label{eq:idf}     idf(t, D) = \log \frac{|D|}{|\{d \in D : t \in d\}|}     \end{equation}     \vspace{\linespace}     \begin{equation} \label{eq:tfidf}     tfidf(t, d, D) = tf(t, d) \times idf(t, D)     \end{equation}     \end{subequations}     \caption{Formula for calculating the TF-IDF}     \label{fig:tfidf}     \vspace{\linespace}     \end{figure}          \begin{algorithm}[t]     \caption{Building a C4.5 Decision Tree}     \label{alg:C4.5}     \begin{algorithmic}[1]          \STATE Check for base cases     \FORALL{$a$ $\in$ attributes}     \STATE Find the normalized information gain ratio from splitting on $a$     \ENDFOR     \STATE Let $a\_best$ be the attribute with the highest normalized information     gain     \STATE Create a decision $node$ that splits on $a\_best$     \STATE Recurse on the sublists obtained by splitting on $a\_best$, and add those     nodes as children of $node$          \end{algorithmic}     \end{algorithm}               \end{document}      Here is the .sty file that contains many custom layout commands: Link The .sty file is particularly full of random bits and peices, but I'll try to simplify them as much as I can (edits should occur in real-time via Dropbox). * * * **EDIT 2** Through much googline, I was able redefine a couple commands in the LoA: `thealgorithm` and `listofalgorithmname`. I think my main issue is that _I have no idea where these commands are documented, declared, or used in the first place_ , so I have no idea how I can redefine other commands. **Where are these commands declared?**


title: Expanding an argument of code added by \g@addto@macro

text: I would like to have the following (it's a part of a large code block):               \def\C{foobar}     \def\A{}     \g@addto@macro\A{\B{\C}}      Now `\show\A` outputs `\B{\C}` I would like to modify the 3rd line so that `\show\A` outputs `\B{foobar}` I believe that some trick with `\expandafter` should help, but I'm not familiar with it. (Note: `expl3` would surely help here, but I'd like to avoid it.) Full MWE:               \documentclass{article}          \begin{document}     \makeatletter          \def\C{foobar}     \def\A{}     \g@addto@macro\A{\B{\C}}          \show\A          \makeatother     \end{document}


title: how to put a figure on the side of text?

text: I have a figure which does not occupy a lot of horizontal space, and I want to put text on its left side. Is there a way to put a figure environment such that the text naturally flows on the left, instead of the figure environment blocking all horizontal space? EDIT: thanks for the reference to wrapfig! wrapfig helps, but I can't seem to get it at the top of the page, and the wrapfigure environment does not accept any such parameter. The PDF file for the package does not mention that. any idea how to place the figure at top? (I would use the [t] flag normally with a figure environment.)


title: Highlight keywords in math mode?

text: I am using Emacs+Auctex. I need additional highlighting in math mode. How can I force Emacs to highlight braces and some commands (like \quad) inside math mode with different color?


title: Checking if a string contains # with its original catcode

text: At comp.text.tex the following scheme was suggested for testing if a string contains the parameter character with catcode 6.               \def\endcheck{\endcheck}     \def\second#1#2{#2}     \def\gobbletocheck#1\endcheck#2#3{#2}     \def\checkhash#1{\docheckhash#1\endcheck}      \def\docheckhash#1{%       \ifx#1\endcheck          \expandafter\second        \else          \ifx#1##%            \expandafter\expandafter\expandafter\gobbletocheck          \else            \expandafter\expandafter\expandafter\docheckhash          \fi       \fi      }       This can be called as               \checkhash{abc#def}{YES}{NO}      \checkhash{abcdef}{YES}{NO}       Obviously, as suggested by its author, this test fails if the string to test contains brace groups with the first two tokens identical, e.g.,               \checkhash{ab{cc}def}{YES}{NO}      Please can anyone suggest a better test? Please note that the catcode of the hash character must be 6, not 12. An expandable solution will be beautiful but not a necessity.


title: Annotate items at the margins beside each item

text: Is there a way to add annotations to the margins beside items of an enumeration? Consider for example the following pseudo-code:               \documentclass{article}          \usepackage{enumerate}     \begin{document}     \begin{enumerate}[a)}     \specialitem[First annotation] First item %% "First annotation" should appear on the margin beside the first item     \specialitem[second annotation] Second item %% %% "First annotation" should appear on the margin beside the first item     \end{document}      If so, how can I adjust it, such that the annotations are aligned to the top, center or bottom of the item and appear on the left or on the right margin beside the item? Note that I want for each item an individual (small) text on the margin, not something auto-generated. The automatic enumeration "[a)]" in my case should not be affected by this, the note on the margin should be additional to the automatic enumeration!


title: How to use biblatex-gost with XeLaTeX?

text: I'm trying to make use of `biblatex-gost` package with XeLaTeX -- but it gives error:               \documentclass{article}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{DejaVu Sans}     \setsansfont{DejaVu Sans}     \setmonofont{DejaVu Sans Mono}          % Russian/English document:     \usepackage{xecyr}     \newfontfamily\cyrillicfont{DejaVu Sans}     \setmainlanguage{russian}     \setotherlanguage[variant=american]{english}          % bibliography:     \usepackage[     backend=biber,     style=gost-authoryear,     ]{biblatex}     \addbibresource{BooksOnMetals.bib}          \begin{document}          \texttt{footcite}: \footcite{__1979}          \texttt{textcite}: \textcite{__2009}          % bibliography:     \printbibliography[heading=bibintoc]          \end{document}      Gives:               (/home/boris/.local/lib/texmf/tex/latex/biblatex-gost/biblatex-gost.def)     ! Undefined control sequence.     <argument> ...stmedialanguage {\bbl@main@language                                                        }\newcommand *{\select@med...     l.324    \newcommand*{\select@medialanguage}{}}      The same code works fine if I replace `gost-authoryear` with `authoryear`. Bib file:               @book{__1979,             title = {Физика твердого тела (комплект из 2 книг)},             abstract = {Настоящая книга - подробный курс физики твердого тела, составленный авторами, в течение многих лет читающими курс лекций по этому предмету в Корнеллском университете (США). Книга написана с большим педагогическим мастерством, тщательно продуманы выбор и расположение материала, иллюстрации, задачи. Она представляет собой ценное пособие для читателей с различным кругом интересов и разной степенью подготовки; при этом путеводной нитью могут служить приводимые авторами рекомендации о последовательности чтения глав.       Книга адресована студентам, аспирантам, изучающим и ведущим физику твердого тела.},             publisher = {Мир},             author = {Ашкрофт, Н. and Мермин, Н.},             translator = {Михайлов, Александр},             year = {1979}     },          @book{__2009,             edition = {2},             title = {Основы теории металлов},             isbn = {978-5-9221-1097-6},             abstract = {Изложена современная теория нормальных и сверхпроводящих металлов без использования сложных математических методов. Помимо описания классических свойств, серьезное внимание уделено актуальным проблемам: квантовым интерференционным эффектам, локализации электронов случайным потенциалом, нелинейным явлениям, взаимному влиянию сверхпроводимости и магнетизма и др. Необходимо знакомство с квантовой механикой и статистикой.            Для студентов и аспирантов физических специальностей вузов, а также научно-технических работников в области физики твердого тела.},             publisher = {ФИЗМАТЛИТ},             author = {Абрикосов, А. А.},             year = {2009}     }      I read `biblatex-gost` documentation. It says nothing about the XeLaTeX. I read the code the author provides -- it uses `babel` and `latex`. The doc actually doesn't comliles on my box. But anyway it is not using XeLaTeX. Requirements to use `biblatex-gost` are:   * Biber 1.5   * biblatex 2.5 Current version on `biblatex-gost` is 0.8. I have it all. **Edit** : It turns out that biblatex doesn't support polyglossia. But plain `authoryear` works. Might also be working with a patched `gost-authoryear`.