title: Wrapfig w/ Non-Ugly Page Breaks

text: I have written a modified `wrapfig` package, I was a little tired of having ugly page breaks when a `wrapfig` object coincides with the end of the page. It works by putting the content into a box, measures the height, and then uses the `needspace` package to enforce minimum space requirements, pretty simple. **Here is the code:**               %-----------------------------------------------------     %Ensures no ugly page breaks by      %first measuring the minimum amount of space required     %Using a savebox.     %-----------------------------------------------------     \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{adpwrapfig}[2013/07/28 ADP's Wrapfig Class]          %Requirements.     \RequirePackage{wrapfig,calc,needspace,etoolbox,ifthen}          %Objects in this class.     \newlength{\@@wf@ht}%     \newsavebox{\@@wf@savebox}%     \newcounter{@@wf@cnt}          %Create a boolean switch, for the case when the user specifies     %the number of lines, and,      \newbool{@@wf@alwaysspace}\booltrue{@@wf@alwaysspace}           %Backup existing definitions.     \let\@wf\wrapfigure\let\@endwf\endwrapfigure          %-----------------------------------------------------     %Redefine the wrapfigure environment.     %-----------------------------------------------------     \renewenvironment{wrapfigure}[3][-1]{%         \setcounter{@@wf@cnt}{#1}\def\@inpA{#2}\def\@inpB{#3}%              %Process the box.         \begin{lrbox}{\@@wf@savebox}%             \minipage{\@inpB}%     }{  %<<<<<<BODY CONTENT             \endminipage%         \end{lrbox}%              %Determine the required height         \settoheight{\@@wf@ht}{\usebox{\@@wf@savebox}}%              %Min Required Vertical Space.         \def\@wf@ns{\Needspace{\dimexpr\@@wf@ht+\intextsep\relax}}              %Enforce the required height         \ifthenelse{\the@@wf@cnt<1}{\@wf@ns}{\ifbool{@@wf@alwaysspace}{\@wf@ns}{}}%              %Now execute the existing environment         \ifthenelse{\the@@wf@cnt>0}%             {\@wf[\the@@wf@cnt]{\@inpA}{\@inpB}} %TRUE, When Lines are Specified             {\@wf{\@inpA}{\@inpB}}               %FALSE, When Not.                 \usebox{\@@wf@savebox}%         \@endwf%     }      The Difference is quite clear with the following MWE:               \documentclass[a5paper]{article}     \usepackage[margin=1in]{geometry}          \usepackage[demo]{graphicx}     \usepackage{lipsum,caption}          \usepackage{wrapfig}    %Standard     \usepackage{adpwrapfig} %Modified          \begin{document}         \lipsum[1-2]              \begin{wrapfigure}{l}{0.5\linewidth}             \includegraphics[width=\linewidth,height=2.95in]{demo}             \captionof{figure}{This is my caption for this use of this figure}         \end{wrapfigure}         \lipsum[1-10]          \end{document}      Which creates the following two different outputs if the package is used or not. **Standard Output** (Carries paragraph wrapping over to next page) ![Before](http://i.stack.imgur.com/gaHDS.png) **New Output:** (Does not produce the error) ![After](http://i.stack.imgur.com/4lkfk.png) My question is, I would like to remove the use of minipages, in favor of a box primative, however, I cant seem to get it to work in context. Can someone offer some suggestions? Cheers. **UPDATE:** Based on David Carlisle's Solution to my initial question, and, suggestion by Barbara Beeton, an update is as follows. In summary, A hook was patched into the `needspace` package to determine if a page break would follow, and in that situation, the contents get retracted by `\intextsep` to achieve top alignment.               %-----------------------------------------------------     %Ensures no ugly page breaks by      %first measuring the minimum amount of space required     %Using a savebox.     %-----------------------------------------------------     \NeedsTeXFormat{LaTeX2e}     \ProvidesPackage{adpwrapfig}[2013/07/28 ADP's Wrapfig Class]          %Requirements.     \RequirePackage{wrapfig}     \RequirePackage{calc,needspace,etoolbox,ifthen,caption}          %Objects in this class.     \newsavebox{\@@wf@savebox}          %Box to save.     \newlength{\@@wf@ht}                %Height     \newlength{\@@wf@wd}                %Width     \newcounter{@@wf@cnt}               %Linecount if specified     \newcommand{\@@wf@capprop}{0.95}    %Caption Proportion     \newbool{@@wf@break}                %For needspace page break hook          %Create a boolean switch, for the case when the user specifies     %the number of lines, and, @@wf@bre@kreq     \newbool{@@wf@alwaysspace}\booltrue{@@wf@alwaysspace}          %Backup existing definitions.     \let\@wf\wrapfigure\let\@endwf\endwrapfigure          %Patch the neespace commands.     \patchcmd{\@sneedsp@}{\break}{\booltrue{@@wf@break} \break}{}{}     \patchcmd{\@needsp@}{\break}{\booltrue{@@wf@break} \break}{}{}          %-----------------------------------------------------     %Redefine the wrapfigure environment.     %-----------------------------------------------------     \renewenvironment{wrapfigure}[3][-1]{%         \setcounter{@@wf@cnt}{#1}%         \def\@inpA{#2}%         \setlength{\@@wf@wd}{#3}     %Process the box.         \setbox\@@wf@savebox\vbox\bgroup\bgroup%             \setlength\hsize\@@wf@wd             \textwidth\hsize             \linewidth\hsize             \@parboxrestore             \@minipagerestore             \@setminipage             \captionsetup{width=\@@wf@capprop\linewidth}     }{  %<<<<<<BODY CONTENT             \par\egroup\egroup%         \@@wf@ht\ht\@@wf@savebox%              %Command to enforce the required height         \def\@ns{\Needspace{\dimexpr\@@wf@ht+\intextsep\relax}}              %Two conditions on whether to enforce         \ifthenelse{\the@@wf@cnt<1}{\@ns}{}%         \ifbool{@@wf@alwaysspace}{\@ns}{}%              %Start with not requiring pagebreak.         %needspace has been patched to set this to true if          %it intends to enforce a break.         \boolfalse{@@wf@break}               %Now execute the existing environment         \par\ifthenelse{\the@@wf@cnt>0}%             {\@wf[\the@@wf@cnt]{\@inpA}{\@@wf@wd}} %TRUE, When Lines are Specified             {\@wf{\@inpA}{\@@wf@wd}}               %FALSE, When Not.                 %Resolve the hook made by needspace, retracting by intxtsep                 %Retrace                         \ifbool{@@wf@break}{\vspace*{-\intextsep}}{}                 %Execute                 \usebox{\@@wf@savebox}%                         %Tighten                         \ifbool{@@wf@break}{\vspace*{-2\intextsep}}{\vspace*{-\intextsep}}%         \@endwf%     }          \endinput     %Tada.      ![Update](http://i.stack.imgur.com/HRuer.png)


title: Background color in inline code listings with linebreak

text: I want to highlight code inline with a gray background. Preferably with `listings`. This question is related to Colored background in inline listings. But as my MWE shows it doesn't work with line breaks. Is there a way to fix this? I also tried the soul package, but this produces a lot of errors (comments in MWE):               \documentclass{article}          \usepackage{listings}     \usepackage{xcolor}     \usepackage{soul}          \lstdefinestyle{ShellCmd}{         language=bash,         basicstyle=\small\ttfamily,         backgroundcolor=\color{gray!10},         linewidth=0.9\linewidth,         breaklines=true     }     \def\ownstrut{\vrule height5.5pt depth0.8pt width0pt}          \newcommand\shellcmd[1]{\colorbox{gray!10}{\lstinline[style=ShellCmd,mathescape]`#1`}}     %\newcommand\shelltwo[1]{\hl{\lstinline[style=ShellCmd,mathescape]`#1`}} % this produces error          \begin{document}          \shellcmd{command}, some text \shellcmd{a very long command which should not destroy the whole layout when a line break occurs! Maybe it is possible to make even three or more lines}, and here it continues.      %\shelltwo{a very long command which should not destroy the whole layout when a line break occurs! Maybe it is possible to make even three or more lines}          \end{document}


title: subsection font size in table of content, beamer

text: Is there any possibility to change the font size of the subsections, shown in the table of content? Using the beamer class?


title: fontspec: what does Renderer=Basic do?

text: I'm writing a document using LuaLaTeX on Windows, using Arial (please do not comment on that) as its main font with:               \usepackage{fontspec}     \defaultfontfeatures{Ligatures=TeX}     \setmainfont[Renderer=Basic]{Arial}      To keep the usual TeX substitutions I used `Ligatures=TeX`, but this does not work unless using `Renderer=Basic` additionally.


title: The difference between $\alpha _1$ and $\alpha_1$

text: Many people would edit my `$\alpha _1$` into `$\alpha_1$`, do you know whether there are any reasons for the default space? Which is better? Since I generate the .tex by Mathematica, the spaces are generated by default. That's why they are there in the first place. here I asked in Mathematica.SE


title: referring terms in the glossary

text: I am using LaTeX to write my thesis. To define new terms and its definition, I have used the glossary as separate chapter at the end of thesis. I use `\gls` command to refer the terms defined in the glossary. **I have a question related to referring the terms in glossary:** Should I refer terms defined in the glossary per chapter in the whole thesis? **OR** Should I refer the terms only once in the whole thesis? The problem with the latter approach is that if reviewers skip the chapter, where I refer the terms, they will never understand the terms and its meaning properly. Can you please advise me on the proper place of referring the terms defined in the glossary?


title: How to draw a not fully-connected elliptic arrow using TikZ?

text: I want to draw an arrow like this: ![enter image description here](http://i.stack.imgur.com/JLgmy.png) I found this question which is kind of similar, but it relies on that the circle is fully drawn. What I want to do is to draw an ellipsis which has a small gap in it and an arrow on one of the edges. It would also be cool if the gap was created by actually not drawing the line - not by drawing some white on top of the ellipsis.


title: Differentiate reference based on type (problem with argument expansion)

text: Since I use unnumbered sections, I'd like to have a variation of `\autoref` that uses names instead of numbers in the case of sectioning, but keeps its usual behaviour for other environments. I've come up with this naive piece of code, but I don't get it to work.               \documentclass{article}     \usepackage{xstring, hyperref, nameref}     \setcounter{secnumdepth}{-1}     \makeatletter     \newcommand{\KSautoref}[1]{         \edef\KS@RefType{\expandafter\@fourthoffive\csname r@#1\endcsname}         \newif\ifKSSectioning\KSSectioningfalse         \IfBeginWith{\KS@RefType}{chapter}{\KSSectioningtrue}{}         \IfBeginWith{\KS@RefType}{section}{\KSSectioningtrue}{}         \IfBeginWith{\KS@RefType}{subsection}{\KSSectioningtrue}{}         \IfBeginWith{\KS@RefType}{subsubsection}{\KSSectioningtrue}{}         \IfBeginWith{\KS@RefType}{paragraph}{\KSSectioningtrue}{}         \IfBeginWith{\KS@RefType}{subparagraph}{\KSSectioningtrue}{}         \ifKSSectioning\chaptername\nameref{#1}\else\autoref{#1}\fi     }     \makeatother     \begin{document}     \section{Test} \label{test}     See \KSautoref{test}.     \end{document}      When I try to compile this, I get the following error:               ! Argument of \@fourthoffive has an extra }.     <inserted text>                     \par     l.19 See \KSautoref{test}                              .     ?      Using `\tracingall` I get this additional information:               {\edef}     {\expandafter}     {\csname}          \@fourthoffive #1#2#3#4#5->#4     #1<-\r@test      How can I get `\r@test` to expand as well, so that it's not used as just the first argument? If there is a package that provides the functionality, I'd rather use that, but still I'd like to know the bit about expansion...


title: Chapter heading using report class

text: How do I "translate" the following from memoir class to report class? I'm currently writing a dissertation in report class and it would be great if I could use this chapter heading:               \documentclass{memoir}     \usepackage{tikz, blindtext}     \makechapterstyle{box}{       \renewcommand*{\printchaptername}{}       \renewcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries}       \renewcommand*{\printchapternum}{         \flushright         \begin{tikzpicture}           \draw[fill,color=black] (0,0) rectangle (2cm,2cm);           \draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter };         \end{tikzpicture}       }       \renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries}       \renewcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont##1}     }     \chapterstyle{box}     \begin{document}     \chapter{Introduction}          \end{document}      ![It looks like this](http://i.stack.imgur.com/G31b8.png)


title: Short diagonal arrows inside commutative diagram

text: I need to use the `xy` maths package (because I need to make it into a PNG file for Wordpress and mathurl.com accepts the `xy` template) to make a commutative diagram in which there are diagonal 4 shorter arrows inside the diagram, directed inward. The best I can do is               \usepackage[all]{xy}     \xymatrix{Y' \ar[r]^{g'}     \ar[d]_{f'} & X' \ar[d]^{f} \\     Y \ar[r]_{g} & X      \\     %     \ar@{=>}"1,2"*++++\frm{};"2,1"*++\frm{}}      So I can only get one arrow, which needs to be higher up to the right.


title: scrlttr2: Increasing the headline space on the 2nd page

text: How can I increase the space between the headline and the following text on the second page of the `scrlttr2` document?               \documentclass[ngerman,12pt]{scrlttr2}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[]{babel}     \usepackage[]{blindtext}          \setkomavar{fromname}{Max Mustermann}     \setkomavar{fromaddress}{Bacherstr.\ 16 }          \pagestyle{myheadings}          \setkomavar{nexthead}{%     \vbox to 50pt {\vfil     \hbox to 3cm{\rule{1cm}{1cm}}%     \vfil     }     }          \begin{document}     \begin{letter}{Unternehmen}     \opening{Sehr geehrte Damen und Herren,}          \blindtext[4]          \closing{Mit freundlichen Grüßen,}          \end{letter}     \end{document}      ![enter image description here](http://i.stack.imgur.com/vMLm5.png)


title: Synctex and Environments

text: Synctex makes it possible to jump between your LaTeX code and the compiled PDF, which is absolutely great, if you have larger documents. However it is my impression that when you use environments, Synctex jumps only to the environment rather than the precise location you want to jump. This does not matter, if your environments are small, but it is very annoying, if your environments are large. Is there any way around this problem, e.g. changing the implementation of the environment or reconfiguring synctex etc.? This questions is a result of discussion Comment Multi-line Text on Counter Condition, because the result of this dicussion is an environment that typically includes large quantities of text. This question might be similar to SyncTeX functionality in TeXShop and TeXworks, but I am not specifically interested in TeXShop.


title: How to type Telugu in LaTeX and genrate PDF using MiKTeX

text: So far I have been using LaTeX for writing English documents. My favourite editor is TeXlipse in Eclipse. I am also comfortable with TeXnicCenter. My operating system is Windows. But now my intention is to write some short stories in Telugu. I want to write in my fav word processing tool LaTeX. How can do that? Please suggest me with some basic example. It will be great appreciation.


title: Rescaling the colors in a colormap and the axes

text: I have cerated a file (workfile.dat) at the following format:               <x1> >y1> <z>     <x1> >y2> <z>     <x1> >y3> <z>          <x2> >y1> <z>     <x2> >y2> <z>     <x2> >y3> <z>          etc.      I have created a surf pgf: ![picture](http://i.stack.imgur.com/CHWCV.png) using the following code:               \begin{tikzpicture}      \begin{axis}[view={0}{90},colormap/cool]       \addplot3[surf] table [row sep=newline] {./workfile.dat};      \end{axis}     \end{tikzpicture}      i would like that where the value of `<z>` is null that it would be white and not like in the above picture. I would like it to look like something like this: ![expected picture](http://i.stack.imgur.com/MMna5.png) This mean that the x-axis is represented by decimal format with two digits after the point and the y-axis is from 0 to 1 (instead of 0 to 400). In addition i would like to know if it is possible in tikz pgf to use LogNorm for the color bar like in matplotlib. **EDIT** here is an example of what i did:               \documentclass[a4paper,10pt]{article}     \usepackage{pgfplots}          \begin{document}      \begin{tikzpicture}       \begin{axis}[view={0}{90},                    colormap/cool,                    y filter/.code=\pgfmathparse{\pgfmathresult/400}]        \addplot3[surf] table [row sep=newline] {./workfile.dat};       \end{axis}      \end{tikzpicture}     \end{document}      and this is the output i get: ![Output](http://i.stack.imgur.com/sB8wr.png) The blue lines seems to be correct, but i cant explain the gray background at the places where = 0. **EDIT 2** new example: file data workfile.dat               1 1 0     1 2 0          2 1 0     2 2 1      output ![file](http://i.stack.imgur.com/fauGK.png) code:               \documentclass[a4paper,10pt]{article}     \usepackage{pgfplots}     \begin{document}          \begin{tikzpicture}      \begin{axis}[view={0}{90},                  colormap/cool,         ]       \addplot3[surf] table [row sep=newline] {./workfile_2.dat};      \end{axis}     \end{tikzpicture}     \end{document}      As you can see, only one element in the input data have the value "1", but nether the less, the all area is blue.


title: problem with texpad editor and the package answers

text: I don’t know why the command \input don’t work in the package answers. If I use \include it’s OK but it’s not good because some things don’t work correctly. Only under TexPad editor.


title: Making tikz draw go almost all the way

text: I have by looking at examples at this site got quite far with tikz but not all the way. I know this might be considered a bad question -- but since I got this far by looking at similar question this is probably the best we can do when it comes to tikz -- but here comes what I have now:               \documentclass{memoir}     \usepackage{tikz}     \usetikzlibrary{matrix,positioning}          \begin{document}     \begin{figure}     \begin{tikzpicture}          \matrix(Person) [matrix of nodes,                       matrix/.style={rows={1}{fill=gray}},                      label=above:Person,                       column 1/.style={nodes={text width=1cm, align=center}},                      column 2/.style={nodes={text width=2cm}},                      column 3/.style={nodes={text width=2.5cm}},                      column 4/.style={nodes={text width=2cm}},                      column 5/.style={nodes={text width=2cm, align=center}}                       ] {         id & name       & address       & birth date & occupation.id \\         1  & Mary Smith & Main street 1 & 1970-04-17 & 1 \\         2  & John Doe   & Highway 2     & 1972-07-24 & 1 \\          3  & Clara Doe  & Highway 2     & 1995-11-11 & 2 \\};          \matrix(Child) [matrix of nodes,                      label=above:Child,                      nodes={text width=2cm, align=center},                      right=1 cm of Person] {         Person.id & Person.id \\          2 & 3                 \\                               \\};          \matrix(Occupation) [matrix of nodes,                           label=above:Occupation,                           below=1.25cm of Person,                          nodes={text width=2.5cm},                          column 1/.style={nodes={text width=1cm, align=center}}] {         id & title     & location \\         1  & secretary & Enterprises ltd \\         2  & student   & School \\};          \draw[thick](Person-1-1.north west)--(Person-1-5.north east);     \draw(Person-1-1.south west)--(Person-1-5.south east);     \draw[thick](Person-4-1.south west)--(Person-4-5.south east);          \draw[thick](Child-1-1.north west)--(Child-1-2.north east);     \draw(Child-1-1.south west)--(Child-1-2.south east);     \draw[thick](Child-2-1.south west)--(Child-2-2.south east);          \draw[thick](Occupation-1-1.north west)--(Occupation-1-3.north east);     \draw(Occupation-1-1.south west)--(Occupation-1-3.south east);     \draw[thick](Occupation-3-1.south west)--(Occupation-3-3.south east);          \draw[<->] (Child-1-1.north)--++(0,1.5)-|(Person-1-1.north);     \draw[<->] (Child-1-2.north)--++(0,1.75)-|(Person-1-1.north);     \draw[<->] (Occupation-1-1.north)--++(0,1)-|(Person-4-5.south);     \end{tikzpicture}     \end{figure}          \end{document}      ![enter image description here](http://i.stack.imgur.com/kjcfm.png) I posted all of it cause it\s not that much and perhaps you while fixing what I can't fix also can show other better ways of doing what I have done -- both so I can learn and other people stumbling on this page also can learn. Now, my problem is that I don't think it's clear enough what is table and what is not table. I think if the arrows didn't actually touch the table lines then perhaps it would become more clear. But I haven't so far managed to understand how to fix that...


title: How to reduce margins inside the equation environment?

text: do you know a way to reduce margins inside the equation environment to be sure that a very long equation fits in a line (I have already reduced the fontsize of the equation)? Thanks here my code:               \documentclass[11 pt,a4paper,oneside,openany, notitlepage]{article}     \input epsf     \usepackage{amsmath, amssymb, graphics}     \newcommand{\mathsym}[1]{{}}     \newcommand{\unicode}[1]{{}}     \newcounter{mathematicapage}     \usepackage{amsthm}     \usepackage{amsfonts}     \marginparwidth 0pt     \oddsidemargin 0pt     \evensidemargin 0pt     \marginparsep 0pt     \linespread{1.5}     \topmargin 0pt     \textwidth 6.5in     \textheight 8.5 in          \begin{document}     {\tiny     \begin{equation}     \begin{pmatrix}     \max\{0,\frac{1}{T}\sum_{t=1}^{T}\hat{H}_{l,t,R}^{(1)}(x_t,n;\theta)\hat{\mathbb{P}}_{x_t,n,T}-\frac{1}{T}\sum_{t=1}^{T}\hat{\mathbb{P}}_{1,x_t,n,T}\}-\sum_{x \in \mathcal{X}}^{}(\max\{0,H_{l,t}^{(1)}(x,n;\theta)\mathbb{P}(X_t=x,N_t=n)-\mathbb{P}(G_{\cdot j,t}=g_{\bullet}^{(1)},X_t=x,N_t=n)\})\\     \max\{0,\frac{1}{T}\sum_{t=1}^{T}\hat{\mathbb{P}}_{1,x_t,n,T}-\frac{1}{T}\sum_{t=1}^{T}\hat{H}_{u,t,R}^{(1)}(x_t,n;\theta)\mathbb{P}_{x_t,n,T}\}-\sum_{x \in \mathcal{X}}^{}(\max\{0,\mathbb{P}(G_{\cdot j,t}=g_{\bullet}^{(1)},X_t=x,N_t=n)-H_{u,t}^{(1)}(x,n;\theta)\mathbb{P}(X_t=x,N=n)\})\\     \vdots\\     \max\{0,\frac{1}{T}\sum_{t=1}^{T}\hat{H}_{l,t,R}^{(2^{n-1})}(x_t,n;\theta)\hat{\mathbb{P}}_{x_t,n,T}-\hat{\mathbb{P}}_{2^{n-1},x_t,n,T}\}-\sum_{x \in \mathcal{X}}^{}(\max\{0,H_{l,t}^{(2^{n-1})}(x,n;\theta)\mathbb{P}(X_t=x,N_t=n)-\mathbb{P}(G_{\cdot j,t}=g_{\bullet}^{(2^{n-1})},X_t=x,N_t=n)\})\\     \max\{0,\frac{1}{T}\sum_{t=1}^{T}\hat{\mathbb{P}}_{2^{n-1},x_t,n,T}-\frac{1}{T}\sum_{t=1}^{T}\hat{H}_{u,t,R}^{(2^{n-1})}(x_t,n;\theta)\hat{\mathbb{P}}_{x_t,n,T}\}-\sum_{x \in \mathcal{X}}^{}(\max\{0,\mathbb{P}(G_{\cdot j,t}=g_{\bullet}^{(2^{n-1})},X_t=x,N_t=n)-H_{u,t}^{(2^{n-1})}(x,n;\theta)\mathbb{P}(X_t=x,N_t=n)\})\\     \end{pmatrix}\\     \end{equation}     }     \end{document}


title: How is the longbibliography option used in revtex?

text: I would like my bibliography to display article titles. The documentation says to use the `longbibliography` option, but it won't compile, so obviously I am doing something wrong. My doc looks like this:               \documentclass[prl,twocolumn,10pt,aps]{revtex4-1}     \usepackage{amssymb}     \usepackage{amsmath}     \begin{document}     ...bla bla bla     \bibliography{rextextext}          \end{document}      Changing `\bibliography` to `\longbibliography` fails. Am I putting this in the wrong place?


title: Table of code listings

text: I'm using the listings package to put a box around some source code in a document and also to provide some syntax hilighting. Is there an easy way that I could create a table of contents which just listed the code listings? I have already used the figure listing for actual figures and I would rather not mix figures and code listings. Is there perhaps a way I could build two distinct figures collections?


title: Wrong subsections numbering

text: I have a weird problem. My subsections are numbered like this: > Chapter 1: Subsection 1.0.1 Subsection 1.0.2 Subsection 1.0.3 > > Chapter 2: Subsection 2.0.4 Subsection 2.0.5 > > ... > > Chapter X: Subsection X.0. I have no idea how to start fixing this error. The only warning I get is:               Chapter1.tex(1): Underfull \vbox (badness 10000) has occurred while \output is    activepdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been       already used, duplicate ignored     Chapter1.tex(26): destination with the same identifier (name{page.2}) has been already used, duplicate ignored      but I doubt it has anything to do with the problem. Appreciate any ideas.


title: Sweave generating invalid LaTeX

text: I've encountered a problem when I'm using Sweave to convert an .Rnw file into a .tex file. Sweave is replacing three options from hyperref's `\hypersetup` block with the value `NA`. This is the section in the .Rnw file               \hypersetup{     baseurl={.},     %bookmarks=true,         % show bookmarks bar?     unicode=false,          % non-Latin characters in Acrobat’s bookmarks     pdftoolbar=true,        % show Acrobat’s toolbar?     pdfmenubar=true,        % show Acrobat’s menu?     pdffitwindow=false,     % window fit to page when opened     pdfstartview={FitH},    % fits the width of the page to the window      The resulting LaTeX for the same section comes out as:               \hypersetup{     baseurl={.},     %bookmarks=true,         % show bookmarks bar?     NA     NA     NA     pdffitwindow=false,     % window fit to page when opened     pdfstartview={FitH},    % fits the width of the page to the window      As far as I can tell the rest of the document is fine. Removing the offending sections allows the compilation of the LaTeX. I'm running R 2.13.1. Has anyone else encountered this problem? Alternatively, could anyone suggest what Sweave finds objectionable about those three options in particular?


title: apa6e and biblatex-apa

text: Using apa6e with biblatex-apa for the references creates a reference page with the title in bold, and this is not APA. Is there a way to change the format of the title of this section?


title: How arrange two tables, one besides the other

text: I'm doing a report using LaTeX. I have not too much experience here, and need to solve this issue. It is a simple question: How can I arrange two tables, one beside the other in LaTeX? For example:               [Table1] [Table2]


title: How to remove margin header in biblatex

text: I started using biblatex for manuscript writing, since removing url and doi information from Mendeley .bib files seemed like a strenuous task. Questions and answers here have been a great help to get me started. However, I am struggling to remove the top margin header for the `\printbibliography`, which is automatically added with a following preamble command:               \usepackage[     backend = bibtex,         citestyle=authoryear,doi=false,url=false,isbn=false,natbib=true,maxbibnames=99,         maxcitenames=2,         firstinits      ]{biblatex}      The only way I managed to remove the margin header was by forcing some white space into the bibliography title and adding a References section.               \section*{References}     \printbibliography[title= \vspace{0.8cm}]      However, this introduces some horizontal white space between "References" title and the reference list. I am sure that there is a proper way doing this, but as a LaTeX beginner, I am having a hard time understanding the Biblatex manual. Could someone tell me how to remove bibliography top margin header, please?


title: Problem with TOC

text: I am having an odd behavior of the contents - The Chapteps/sections keep getting incremental values , like in the attached pictures. Also, I would like it to be Chapter 1 1.1 .... 1.2 .... rather than it is now I am using               ![\setcounter{totalnumber}{10}     \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}          \usepackage{blindtext}][1]      ![enter image description here](http://i.stack.imgur.com/BfNzb.png) ![enter image description here](http://i.stack.imgur.com/gtFh3.png)


title: how to reload pdf and preserve same position file (in emacs)?

text: I would like to view pdf files in emacs, and when I reload them from disk I want to be at, more or less, the same position in the new file as I was in the old one. I am viewing these with the bundled "DocView" (is there something better?) Maybe there is a solution combining bookmarks and DocView? aside: I decided to make this a TeX question because there it lots of emacs support here, and it's really the only time I find myself obsessively compiling, reloading and viewing pdfs - and I expect I'm not the only one!


title: How to change font size in Bibliography using BibTex with apacite package

text: I am using BibTex for my references with the style package apacite. Within the document I am using the font size 12pt, but would like to use only 11pt fontsize for the references. Sorry, but my document guidelines ask for this. I know it has been discussed in some threads, but all the proposed solutions didn't work in my case. I am using Tex Live 2012. Here a short code example:                  \documentclass[12pt,a4paper,headings=normal]{scrartcl}        \usepackage{apacite}        \begin{document}        \section{Assignment}        In this short paper, an analytical overview on the structure of two         scientific papers \cite{Kaplanidou2010, Humphreys2011} is provided.        The analytical focus is taken on research paradigms, research types,        research designs and methods of the mentioned articles.       \bibliographystyle{apacite}       \bibliography{Biblio_Perso}       \end{document}      Here is the content of the file Biblio_Perso.bib:               @article{Humphreys2011,     title={{Who cares where I play? Linking reputation with the golfing capital     and the implication for golf destinations}},     author={Humphreys, C.},     journal={Journal of Sport \& Tourism},     volume={16},     number={2},     pages={105--128},     year={2011},     publisher={Taylor \& Francis}     }               @article{Kaplanidou2010,     title={Predicting behavioral intentions of active event sport tourists: The         case of a small-scale recurring sports event},     author={Kyriaki Kaplanidou and Gibson, H.J.},     journal={Journal of Sport \& Tourism},     volume={15},     number={2},     pages={163--179},     year={2010},     publisher={Taylor \& Francis}     }      Thanks in advance for any help. Yours!


title: How to test whether next token on input stream is catcode 10

text: Why doesn't the following code work? From a failed, now fixed, SO answer of mine:               \documentclass{article}          \usepackage{expl3}     \ExplSyntaxOn     \newcommand\latinabbrev[1]{       \peek_meaning:NTF . {% Same as \@ifnextchar         #1\@}       { \peek_charcode:NTF a {% Check whether next char has same catcode as \'a, i.e., is a letter           #1.\@ }         {#1.\@}}}     \ExplSyntaxOff          %Omit final dot from each def.     \def\cf{\latinabbrev{cf}}          \begin{document}       Knuth, \cf The TeXbook.     \end{document}      This code should check the next character to see if it is a dot (so the code shouldn't insert another dot, and it should space the coming dot as if it at the end of a sentence), or catcode 10 (then it should insert a dot and a space), or something else (then it should insert a dot). Although the other two branches seem to work, the `\peek_charcode:NTF` never seems to take its true branch, e.g., in the `\cf T` case. Why not?


title: How to "stamp" the same text on each page of a document

text: I want to have drafting information appear on each page of document. I have seen something similar in the Kluwer document class where it defines `\@oddfoot` and `\@evenfoot` for a lot of possibilities. Is there an easier way than this? Is there a way to do it without overwriting existing headers?


title: Overflow boxes caused by references

text: > **Possible Duplicate:**   >  Line breaking (or hyphenation?) of references in apalike I have downloaded styles for my BibTeX, which is called "apalike". The problem is that when I use `\cite` then references are not using `\linebreak` in a proper place and they cause reference problem. I am not sure how to ensure that the `\linebreak` will be always in the correct place UPDATE: It is indeed a duplicate, the answer from the other question helped in my case.


title: Change view-command in Emacs and AUCTeX (pdf mode)

text: My version of Emacs and AUCTeX[1] uses               TeX-evince-sync-view      for viewing pdf. This command is not working for some reason. Evince is launched but Emacs freezes and I have an error               Couldn't find the Evince instance for file XXX      I don't have the time to debug it and, moreover, I don't need the `sync` feature. So, I'm trying to view `pdf` in a old-fashioned (simple) way (without `sync`). I tried this code (which used to work several years ago):               (setq TeX-view-program-list '(("Evince" "evince --page-index=%(outpage) %o")))     (setq TeX-view-program-selection '((output-pdf "Evince")))      But there is no change in Emacs. (I still have the problematic command               TeX-evince-sync-view      as default command.) I tried to do the same but with the graphical interface (`Tools>customize AUCTeX>Tex Command>TeX view>Tex-view-program-selection` selecting "just" Evince) but no change. How can I set Evince without `sync` as the default command for viewing `pdf`? [1]Emacs 23.4.1 and AUCTeX 11.85-1 but I have the same problem with `emacs- snapshot 24.3.50.1`.


title: Vertically center text and image in one line

text: I need to place an icon and text behind each other on one line. The icon is higher than a single text line, and would like to have the icon and text center aligned. How do I do that?


title: Can super/sub-scripts bind more tightly than macro expansion?

text: By "bind more tightly" I refer to the order in which operations are carried out by default. Experimenting shows that if `\ab` is `ab` and `\cd` is `cd` then `\ab^\cd` is `ab^cd`. I would like it to be `{ab}^{cd}`. Of course, I can do this by defining `\ab` to `{ab}` and `\cd` to `{cd}` but that's not always an acceptable solution; for example, if `\cd` is actually `c^d` then `\cd_2` is `c^d_2` but if `\cd` is `{c^d}` then `\cd_2` is `{c^d}_2`. Indeed, if `\cd` is `c^d` then with the current precedence, `\ab^\cd` produces a complaint about double superscripts but changing the precedence would make it `{ab}^{c^d}` which is fine. (NB I've tried to present the simplest case that I can; the actual macros that I'm using are considerably more complicated and introducing braces into these macros is much more problematic than in the simplistic case above. In particular, they are recursively defined and so introducing new braces at the outside actually introduces new braces at several inconvenient spots inside as well.)


title: Spotcolor bleeds into the surrounding

text: > **This question led to a new package:**   >  `xspotcolor` I have a problem using `spotcolor` package. When using the package for redefining headers, titles, `\emph` etc. the color bleeds into the surrounding. The behaviour is quite different than the behaviour of `xcolor` package. I am _guessing_ that this is a package problem. I have contacted the author and he is unable to help as he is out of LaTeX business for years. Since this is really a small package, is it possible that someone has a peek into it and (in case there is a mistake) corrects it? MWE:               \documentclass[a4paper]{article}          \usepackage{spotcolor}     \usepackage{xcolor}          \NewSpotColorSpace{PANTONE}     \AddSpotColor{PANTONE} {PANTONE3035PC} {PANTONE\SpotSpace 3035\SpotSpace PC} {1 0 0.05 0.72}          % Redefinition of \emph command          \begin{document}          \SetPageColorSpace{PANTONE}          \makeatletter     \DeclareRobustCommand\em{%       \@nomath\em       \SpotColor{PANTONE3035PC}{1}       \ifdim \fontdimen\@ne\font >\z@         \upshape       \else         \itshape       \fi}     \makeatother          The \emph{Pantone colour} spills outside of \slash emph command.          \makeatletter     \DeclareRobustCommand\em{%       \@nomath\em       \color{red}       \ifdim \fontdimen\@ne\font >\z@         \upshape       \else         \itshape       \fi}     \makeatother          The \emph{normal red} does not.          \end{document}


title: Which "bold" style is recommended for matrix notation?

text: I am wondering which "bold"-style is the "appropriate" or "official" way for matrix notation. E.g., let's say the matrix "A." `\textbf{A}` would result in a more italics representation compared`\textbf{A}` etc.   * `\boldsymbol{A}`   * `\textbf{A}`   * `\pmb{A}`   * `\boldmath{A}`


title: Automatically spacing sequences of relations and binary operators

text: In some cases it is common to use the same symbol to refer to a mathematical relation and to instances of the relation. For example, `>` as the relation of being greater than and `x>y` for the instance saying that `x` is greater than `y`. You can manipulate relations for example               >' = > \cup \{(x,y)\}      Normally, TeX automatically adds (the right) amount of space around math relations and binary operators. However, the spacing must be adjusted manually in scenarios like the example above, for example:               {>'} = {>} \cup \{(x,y)\}     \mathord{>}' = \mathord{>} \cup \{(x,y)\}      I wonder if there are ways to handle situations like the one above automatically (beside the solutions above or defining commands for the relations, e.g., `\newcommand{\greater}{\mathord{>}}`, and then               \greater' = \greater \cup \{(x,y)\}


title: Different vertical position of summation limits in consecutive \sum

text: When I use different summation indices in a double sum the limits are not vertically aligend, for instance:               \begin{equation}     \Delta K_T^i = \sum_{t=1}^{T}\sum_{k=1}^{m}{\Delta K_t^{i,k}} = \sum_{t=1}^{T} {\Delta K_t^k}     \end{equation}      and               \begin{equation}     \Delta K_T^k =\sum_{t=1}^{T}\sum_{i = 1}^{n}{\Delta K_t^{i, k}} = \sum_{t=1}^{T}{\Delta K_t^i}     \end{equation}      The limits below the summation symbol are misaligned vertically while the superscripts seem ok. Also the misalignment is bigger in the first example than in the second one. If I use the same letter as subscript index the alignment works as expected.               \begin{equation}     \Delta K_T^i = \sum_{t=1}^{T}\sum_{t=1}^{m}{\Delta K_t^{i,t}}      \end{equation}      I use the following packages, could any of these be the cause, or is this a bug/feature that could be handled in any way? I am using MikTex 2.9               \documentclass[a4paper,twoside,10pt]{article}     \usepackage[swedish]{babel}      \usepackage[T1]{fontenc}     \usepackage[ansinew]{inputenc}     \usepackage{lmodern}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{amsfonts}


title: Fresh install texlive 2012 @ Ubuntu 12.04: tlmgr nowhere to be found

text: I know this subject has come up quite a few times so far (with different distro's of texlive). See for instance: Missing tlmgr texlive 2012   tlmgr: TeX Live 2011 is frozen forever   Texlive installation is missing tlmgr, how to fix?   http://the-praise-of-insects.blogspot.com/2011/08/tlmgr-not-available-for- ubuntu.html   http://forums.fedoraforum.org/showthread.php?t=260451 None of them provided a solution that worked for me. The last link implies that the Ubuntu developers decided not to include tlmgr in the texlive distribution. I installed texlive afresh via the following instructions: http://askubuntu.com/questions/160676/problems-installing-tex- live-2012-on-12-04 My texlive distro apparently lives here: `$ whereis texlive: /usr/share/texlive` Any clue where to find tlmgr or how to activate it without reinstalling the texlive distribution all over again?


title: How to forward search to a character when editing using Vim?

text: We can forward search to a line in a tex file opened in Vim by setting the following in a pdf viewer (I'm using okular):               gvim --servername GVIM --remote +%l %f      But can we go straight to the character we click at? I tried to play around with this bit `+%l`, which represents the commands to enter when opening the file equivalent to `:{line number}` that makes vim jump to a line, to change it to something like `+%l%c` but could not find both the command in vim to jump to a column and the variable representation of column number in okular. My guess is that it doesn't have column numbers defined but still would like to know if there's any way to forward search to a character.


title: How to create *local* labels/refs in LaTeX?

text: # Concise question: Is there any way to limit the scope in which a `\label` is visible to a `\ref`? # Motivation: My current goal is to create a rather large document, containing many exercises and their associated proofs/solutions.   * I'd like to be able to refer to any proof that I've completed before the current one. (i.e., if I've proved it, I wanna be able to use it!)   * I'd like to be able to accumulate observations _within the context of a proof_ and subsequently refer to them later in that proof. However, those observations (or assumptions, or introductions, etc.) don't need to be visible outside of that proof. For example, in the following image of a sample Structured Derivation, I'd like to be able to label assumption #5 something like `\label{x_is_nonneg}`. But if I do that _without_ any special packages or TeX-hackery, I'm unable to use "`x_is_nonneg`" as a label for any other object for the rest of the document, right? Which is too bad, because I'll often want to make very context-specific assertions, and it would be nice if I didn't have to name them something like `\label{exer:8:asmp:5}`. ![a proof demonstrating local references](http://i.stack.imgur.com/cX2Vg.gif)


title: How can I separate an fl ligature in Libertine?

text: I am having trouble to understand the ligatures behaviour of the Linux Libertine font. I want to use all ligatures that are possible to have (`Ligatures={TeX}`) but would like to disable single cases. I would have expected that `babel` would do that for me. When playing around with this, I found out that I am able to get three different fl ligatures but not a real space between those two letters. What is happening here? Am I doing something wrong? Or shouldn't I separate that two letter completely, even when they belong to different word parts. See here what happens for the German word "Auflage": **Edit:** I insert all mentioned solutions, too. They are differing in the distance between f and l but all are still collisioning. The line break possibilities are differing, too. **Edit 2:** I switched from `\\` to blank lines between the different cases due to this post. Now it shows the actual hyphenation possibilities for each case in the first picture.               % arara: lualatex     \documentclass[ngerman]{article}          \usepackage[final]{microtype}     \usepackage{fontspec}     \usepackage{luatextra}     \defaultfontfeatures{%         ,Ligatures={TeX}         ,Scale=MatchLowercase     }     \setmainfont[Mapping=tex-text]{Linux Libertine O}      \usepackage{showhyphens}     \usepackage{babel}          \begin{document}     Auflage          Auf{l}age          Auf"-lage          Auf\/lage          Auf"|lage          {\addfontfeatures{Ligatures=NoCommon}Auflage}     \end{document}      ![enter image description here](http://i.stack.imgur.com/cHmtF.png) Without `showhyphens` the missing separation is more visible. ![enter image description here](http://i.stack.imgur.com/bx5A6.png)


title: Changing \cite to a new pattern?

text: My function `\cite{}` returns "[Author(s) Data]" like "[Ross and Bell 2001]". I want to define a new function `\citea{}` to return "Author (data)", like "Ross and Bell (2001)". I'm trying to manipulate the return of `\cite`, but it doesn't work.


title: current font family using fontspec

text: I'm trying to emulate the behaviour of a [pdf]LaTeX package that provides commands `\lstyle`, `\ostyle`, `\tstyle`, and `\pstyle` to activate lining, oldstyle, tabular and proportional figures, respectively. But they are _context-dependent_ so that, for example, `\lstyle` might be Proportional,Lining or Monospaced,Lining, depending on the current features. With traditional font selection commands I can use `\f@family` to determine which family is current. Is there some way of doing this using `fontspec`? The cautionary note in the documentation for `\addfontfeatures` suggests otherwise.


title: CircuiTikz - Removing the Arrow on the Sinusoidal Voltage Source

text: Is there a way to remove the arrow on the Voltage Source shown below: I create the Signal Generator using:               (0,2) to [sV=$Signal\:Generator$] (0,8)      The arrow Only Appears when the text is inserted. ![Sinusoidal Voltage Source showing Undesired Arrow](http://i.imgur.com/tQ4FTPb.png) Thank you.


title: Connected balloons

text: I'm trying to make a poster in the format of comics. Apart for the fact that `tikZ` does not work in an amazing way with beamerposter, my idea was to create a sort of comics, with interconnected balloons. Note that I do not want the single-line connected nodes that usually can be easily reproduced with `tikZ`. Here the connections are with double lines. Fundamentally, I'm able to draw such a shape, but then I really cannot write in the single square. Any help or tips? ![enter image description here](http://i.stack.imgur.com/lbDWx.jpg) The code I'm using is very simple               \documentclass[final,hyperref={pdfpagelabels=false}]{beamer}          \usepackage[english]{babel}          \usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}          \usepackage{tikz}          \newlength{\columnheight}          \setlength{\columnheight}{105cm}          \begin{document}          \begin{tikzpicture}           \draw[line width=0.5ex,rounded corners = 1ex, fill=white, font={peppe}] (0,0) --(0,14)--(20,14)--(20,6.9)--(30,6.9)--(30,14)--(50,14)--(50,0)--(30,0)--(30,6.3)--(20,6.3)--(20,0)--(0,0);           \end{tikzpicture}     \end{document}


title: using subfig (side-by-side) figures

text: I used the package subfig for my first time, I got this error: ! LaTeX Error: File `figures/Rnefft1310' not found. ! LaTeX Error: File`figures/imt1310' not found. However, I am sure the file is there as eps. What is wrong? Am I using the wrong code for subfig? here is what I wrote:               \begin{figure}     \centering     \subfloat[]{\includegraphics[width=3.1in]{figures/Rnefft1310}}      \subfloat[]{\includegraphics[width=3.1in]{figures/imt1310}}     \caption{Real and imaginary part of effective index }      \label{fig:EcUND}      \end{figure}


title: Lyx 2.1, Book(standard class), need to implement openany

text: Major problem. I have a 384 page book which is due to go to the publisher in 3 days. It is slightly too long and I need to get rid of a few pages. This could be achieved by using "openany" to remove blank pages between chapters. Having scoured the forums I can't find any way of implementing this without it crashing when I try and print the pdf. I am not a Lyx expert, so would hugely appreciate idiot proof instructions about how to accomplish this.


title: How to modify the equivalent of \thefigure for listings?

text: In my appendix I have figures and listings. The figures are now labeled very well (see this question). Now I have the same issue with listings: in the appendix it is labeled as A.1, but in my text only as 1. What is the corresponding command to `\thefigure` I have to redefine for a listing?


title: Emulate \hfill in LaTeX equations?

text: I have a set of equations, where each line consists of a formula and an explanation (info about indices). Now, let's say the structure looks like this:               \newcommand{\lw}{\linewidth}     \begin{align*}         &\framebox[0.4\lw]{Formula 1} & \framebox[0.3\lw]{Info 1}& \\         &\framebox[0.7\lw]{Formula 1} & \framebox[0.1\lw]{Info 1}& \\         &\framebox[0.5\lw]{Formula 1} & \framebox[0.2\lw]{Info 1}&     \end{align*}      This results in two columns of widths `0.7\lw` and `0.3\lw`, so the equation will be too wide for the page: ![output of the example code \(too wide\)](http://i.stack.imgur.com/qfapK.png) Yet, no single line is wider than `0.8\lw`, so there is enough space if the two columns could "slide into each other", like this: ![desired output](http://i.stack.imgur.com/6mPsp.png) In essence, I need some equiv. of `\hfill` between the two parts - but `\hfill` does not work here... My question is whether there is a way to do this, i.e. to create a flexible space that would keep the left and right aligns. Note that the first align would typically be somewhere inside the formula, not in front of it.


title: Include a line break in algorithmic while maintaining indentation

text: I have this code:               \DeclareCaptionFormat{algor}{%       \hrulefill\par\offinterlineskip\vskip1pt%         \textbf{#1#2}#3\offinterlineskip\hrulefill}     \DeclareCaptionStyle{algori}{singlelinecheck=off,format=algor,labelsep=space}     \captionsetup[algorithm]{style=algori}          \begin{document}         \section{Struttura dati}         \begin{floatleft}             \captionof{algorithm}{Leggi file .gpx}\label{getgpx}             \begin{algorithmic}[1]                       \State $speed \gets computeSpeed(\linebreak gpx.track(i).segment(j).delta\_s(q), \linebreak gpx.track(i).segment(j).delta\_t(q));$                 \end{algorithmic}         \end{floatleft}     \end{document}      This is how code is shown: ![](http://i.stack.imgur.com/yvyEV.png) I want the lines `gpx.track....delta_s(q),`, `gpx.track....delta_t(q),` and `);` to be indented exactly as the beginning of line `27` is. I've tried using the `\indent` command but the indentation space is not the same as in the rest of the document and the final result is chaotic.


title: How to delete the 'triangle' on an arrow using the Vaucanson-g package

text: I'm using the `vaucanson-g` package and I have the following now:               \MediumPicture\VCDraw{          \begin{VCPicture}{(5,-0)(3,-3)}            \ChgEdgeNodeSep{6}          \StateVar[v]{(0,-5)}{A}          \StateVar[w]{(4,-2)}{B}          \StateVar[u]{(8,-5)}{C}          \LoopNW{B}{ }            \EdgeL{B}{C}{ }           \EdgeR{B}{A}{ }           \end{VCPicture} }      However, I do not want the 'triangles' on the arrows; I want to delete them so I have the line only. To be very precise: if `->` symbolizes an arrow, I do not want the `>` at the end of the arrow, that is, I only want a _line_ `-`. So I basically want to get rid of the `>` symbols in each of my arrows. How do I get this done? It should be fairly easy I guess, but I've been searching for half an hour in the `vaucanson-g` manual but I still haven't figured it out.


title: Unbreakable end of paragraph

text: I have a heading and paragraph and I dont want to be separated by pagebreak. So when they should be separated, they both should end up on the next page. Is `\\*` the right command, because it wont work on my text (I am converting some text from MS Word and you have there "Keep With Next" command which does what we want).


title: Latex error during make

text: `make -C doc html latexpdf` yields this:               Package hyperref Message: Driver (autodetected): hpdftex.          (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/hypcap.sty))     (/usr/share/texlive/texmf-dist/tex/latex/multirow/multirow.sty)     Writing index file Arakoon.idx     (./Arakoon.aux)     Runaway argument?     {{1.10.3}{9}{Client side support\relax }{subsection.1.10.     ! File ended while scanning use of \@newl@bel.     <inserted text>                     \par     l.113 \begin{document}          ?      any ideas?


title: Redefine environment to be a synonym for another

text: I have a document with many `description` environments. I would like to change all these `description` environments to `LaTeXdescription` environments, without manually changing all the occurrences of `description`. Is there a way to tell LaTeX that I want the `description` environment to be just a synonym for `LaTeXdescription`?


title: condense non-numbered bibliography into one line

text: What I am trying to do is basically the same as (almost) answered here: http://tex.stackexchange.com/a/5574/39336 The difference is that I am using a different `bibstyle`. This `bibstyle` creates the `thebibliography` that I copied into this MWE:               \documentclass{scrreprt}     \usepackage[utf8]{inputenc}     \usepackage{xcolor}     \usepackage[colorlinks=true,citecolor=blue,]{hyperref}     \usepackage{natbib}     \bibpunct{(}{)}{;}{a}{,}{,}     \setlength{\bibsep}{0.0cm}          \begin{document}          Let us cite \citet{Author:1976} \citep[but also][]{Someone:2000}.          \begin{thebibliography}{93}     \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi          \bibitem[{Author {et~al.}(1976)Author, Other, \&       Yetanother}]{Author:1976}     Author, F., Other, S., \& Yetanother, T. 1976, Obscure Journal, 25, 314          \bibitem[{Someone {et~al.}(2000)Someone, Someother, \& Thirdone}]{Someone:2000}     Someone, F., Someother, S., \& Thirdone, T. 2000, Otherjournal, 321, 42     \end{thebibliography}          \end{document}      This gives a bibliography like > Author, F., Other, S., & Yetanother, T. 1976, Obscure Journal, 25, 314   >  Someone, F., Someother, S., & Thirdone, T. 2000, Otherjournal, 321, 42 But I'd like to get a bullet-separated list without line breaks (probably using `paralist` package, similar to the enumerated list from the link above) like: > Author, F., Other, S., & Yetanother, T. 1976, Obscure Journal, 25, 314 • > Someone, F., Someother, S., & Thirdone, T. 2000, Otherjournal, 321, 42 while still having the hyperlinks working. Any ideas?


title: Two different layouts using fancyhdr

text: I would like to set two different layouts (namely headers) for my document. The document is two column dictionary. First part will be introduction with chapters and sections and the second part the dictionary itself where the headers are made from the first and the last headword on the page. I dont know how to set the first layout with chapter in header and than how to change it to different layout. Here is the code:               \documentclass[twocolumn]{book}     \usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}     \usepackage{fancyhdr}     \usepackage[icelandic, czech, english]{babel}     \usepackage[utf8x, utf8]{inputenc}     \newcommand{\entry}[2]{\hangpara{2em}{1}\textsf{\textbf{#1}}\ #2\markboth{#1}{#1}\par}\nopagebreak[4]     \pagestyle{fancy}     \newcommand*{\dictchar}[1]{\centerline{\LARGE\textbf{#1}}\par}     \fancyhf{}     \fancyhead[LE,RO]{\textsf{\textbf{\rightmark\ -- \leftmark}}}     \fancyhead[LO,RE]{\textsf{\textbf{\thepage}}}     \usepackage{fix2col}     \begin{document}\maketitle     \thispagestyle{plain}     \chapter*{1. First chapter}     \section*{1.1 First section}     ...


title: XeLaTeX ttf font support

text: Watertank is some ttf font that I got from one of those cheap fonts CDs. I know it is installed in my system because I can use it in other programs; but when I use it in XeLaTeX (which works with other Windows fonts) XeLaTeX complains. The command is               \newfontface\hmathscr{Watertank}      And the message is: * * * > (C:\ProgramsToo\MiKTeX\tex\latex\oberdiek\rerunfilecheck.sty)))Running > miktex-makemf.exe... miktex-makemf: The Watertank source file could not be > found. > > Running hbf2gf.exe... > > hbf2gf (CJK ver. 4.8.0) > > Couldn't find `Waterta.cfg' > > miktex-maketfm: No creation rule for font Watertank. > > ! Font \zf@basefont=Watertank at 10.0pt not loadable: Metric (TFM) file or > inst alled font not found. \scan_stop: l.23 \newfontface\hmathscr{Watertank} * * * If I try to use the file name (by giving Watertank.ttf), I get the following error message * * * > xelatex.exe: Broken pipe * * * I tried refreshing the font cache, with fc-cache -fv, it does not work either. I tried with -output-driver=xdvipdfmx, with -output-driver=xdv2pdf, with --no- pdf * * * > MiKTeX-XeTeX 2.9.3971 (0.9997.4) (MiKTeX 2.9) Do I have to "prepare" the font besides installing it? **EDIT 1:** (Thanks Will Robertson) Running "xetex -no-pdf s.tex" on               \font\1="Watertank"\1 hello     \bye      gives the same message as before. Running "xetex -no-pdf s.tex" on               \font\1="[Watertank.ttf]"\1 hello     \bye      produces the xdv file. The subsequent "xdvipdfmx -vv s.xdv" crashes on Windows 7 but leaves the following message > DVI Comment: XeTeX output 2011.01.16:1738 s.xdv -> s.pdf > [1<C:/Windows/Fonts/Watertank.ttf@9.96pt fontmap: > [C:/Windows/Fonts/Watertank.ttf]/H/65536/0/0 -> C:/Windows/Fonts/Watert > ank.ttf(Identity-H) > > pdf_font>> Input encoding "Identity-H" requires at least 2 bytes. pdf_font>> > The -m <00> option will be assumed for "C:/Windows/Fonts/Watertank.ttf". What is the -m option?


title: Installation of pgf

text: I was working with an old version of Tikz. It appeared I could not use some features, probably because I had an outdated version. So I tried to reinstall a new version of pgf. I downloaded it and tried as best as possible to get it installed... No result. The instructions are a shame. Even worse: in the process of doing so my old tikz does not even work anymore. It says 'I can't find file pgfutil-common.tex'. I probably did something wrong. Can somebody please tell me - in detail and in extremely simple terms - what to do? Even if I now run '\usepackage{Tikz}' it doesn't work. I have a TexShop. In some map in my library I have a map called 'Tex'. I think I did something wrong by changing things in this map. * * * Sorry for my incomplete information.   * I'm working on a Mac operating system.   * In the map 'TeX' where I believe my tex is installed there is a file called 'TeX Distribution Helper', if I click on it it says 'Choose a system wide TeX distribution'; then I have two options, either gwTeX or TeXLive-2007. So far I've _always_ been using the TeXLive-2007 option I believe - until yesterday, for some reason I changed it to gwTeX. I think I perhaps screwed up by changing this to gwTeX (from that moment I think the Tikz package didn't work anymore). I've now re-set this to 'TeXLive-2007', and the Tikz works again - that is, if I put `\usepackage{tikz}` in my tex-file I do not get error messages, and I can use the "basic" commands in TikZ, they work and without errors. _However_ , I still cannot use most of the TikZ libraries and so on (for instance, if I put `\usetikzlibrary{shadows}`, I get the message `'I can't find the file pgflibrarytikzshadows.code.tex'`). Remarkably, `\usetikzlibrary{arrows}` _does_ work.


title: Different chapters, different layout

text: On request, I have two different layouts for chapters for a book. The first one is exclusive to the Chapter 1 and the other one is for the others. The layout affect how the sections, definitions and paragraphs are displayed. I have the code to handle this in a little class file. This is a MWE:               \documentclass[12pt,letterpaper]{book}          \usepackage{amsmath,amsfonts,amssymb,amsthm}     \usepackage{thmtools}     \usepackage{ifthen,calc}     \usepackage{blindtext}          \parindent=0mm          \newtheorem{teo}{Theorem}[section]     \newtheorem{axi}{Axiom}     \newtheorem{lem}{Lemma}          \newcounter{definition}     \declaretheoremstyle[%       spaceabove=6pt,%       spacebelow=6pt,%       headfont=\normalfont\bf,%       notefont=\normalfont\bf,       notebraces={{}{}},       bodyfont=\itshape,       headpunct={.}]{defistyle}      \declaretheorem[         name={Definition},         numberlike=definition,         style=defistyle]{defi}          \renewcommand\thesection         {\arabic{chapter}.\arabic{section}}     \makeatletter     \renewcommand\@seccntformat[1]{         {\csname the#1\endcsname}.\hspace{0.5em}}     \renewcommand\section{\@startsection         {section}{1}{0mm}                         {6pt}                                     {1pt}                                     {\bfseries}}                               \renewcommand\paragraph{\@startsection         {paragraph}{3}{0cm}                      {6pt}                                    {1pt}                                    {\bfseries}}                         \makeatother          \makeatletter     \newcommand{\capi}[1]{         \chapter{#1}         \ifthenelse{\value{chapter}=2}{             \renewcommand\section{\@startsection             {section}{1}{0mm}                            {0pt}                                        {1pt}                                        {\Large}}                                    \@addtoreset{definition}{section}             \renewcommand{\thedefi}{\thesection.\arabic{definition}}                     }{}}     \makeatother          \begin{document}     \capi{Some preliminaries}     \blindtext          \section{the first thing}     \blindtext[1]          \begin{defi}     The thing $1$ is real number. If $x$ is real then $x+1$ is real.     \end{defi}          \blindtext          \capi{Cool stuff}     \blindtext          \section{Complex things}     bla bla bla          \begin{defi}     We say that a number $x$ is complex if it is not really a number.     \end{defi}          \blindtext     \end{document}      As you can see, my actual way to handle the different style for each chapter is not so elegant. I have the book splitted in several files, one per chapter. When I'm reviewing the book I'm select the chapters I want to see via the `\includeonly` command. The problem is that in order to get the proper look of the sections, paragraphs and definitions I always have to include the chapter 2. Also, I'll would like to avoid to define a new command to the chapters. My question is: is there a way to improve this?


title: How to change QED sign for theorem classes

text: I'm writing an article which contains some quite long proofs, some of which include claims with proofs of their own. I dealt with that by adding a claim environment using `\newtheorem`, but there's a slight inconvenience that arose from that: when I write a proof of a claim, then after `\end{proof}` a QED symbol is shown much like at the end of the proof of the main theorem, which can be confusing when the claim is in the middle of the proof as it seems like the proof is done while it's actually not, and at the end of the proof, when suddenly there's two QED signs. I dealt with that by putting a               \renewcommand{\qedsymbol}{$\square$ (claim)}      line before the end of the proof. However, I imagine it could be rather tedious when writing long-ish documents with many claims. So, is there any way to do that for all claims at once? I would also welcome suggestions as to how to do it “the right way” if I'm doing something terribly wrong.


title: Center one equation of many in align?

text: I have the following `align` enviroment:               \documentclass[12pt]{memoir}     \usepackage{amsmath}     \begin{document}     Here we see     \begin{align}     \text{cat} &= \text{dog}\\     \text{dog} &= cute     \intertext{and if we remove}     \text{dog}\\     \intertext{we get}     \text{cat} &= cute     \end{align}     \end{document}      Which creates: ![An unaligned equation](http://i.stack.imgur.com/0Vu8S.png) How do I center equation 3 while keeping everything else aligned? I can get close by putting in an `&` in the real equation, but it's still not perfectly centered.


title: Using LaTeXmk with mylatexformat

text: I looked at many posts about the use of `latexmk`, but wasn't able to find what to write in order to satisfy my requirements. Yet I'm sure it is possible, but my skills in Perl amounts to about nothing. What I would like to do with a file, say `mymainfile.tex`:   1. make a format file including the static part of the preamble, named `mymainfile-xelatex.fmt` if I use `xelatex`, and store it in the `fmt/ subdirectory` of the directory that contains `mymainfile.tex` (I can do that just with `mylatexformat`)   2. regenerate the format if the (static part of the) preamble has changed (loading new packages, defining new commands or modifying existing commands).    3. Compiling `mymainfile.tex` with the customised format file. The difficulty for me is point 2), and possibly point 1) — that is, not having to write a first macro to make the format, and the launching `latexmk`, but preferably that everything be done from `latexmk`. Moreover I prefer not to write the static part of the preamble in a separate file, but keep it in mymainfile.tex as usual, and use the \endofdump command from the mylatexformat package I use MiKTeX 2.9 on WinEdt 7.


title: Basic geometric shapes, sections, shading

text: Two questions really ... (fishing for lots of opinions here)   1. Is there a definitive guide that most folks agree is the best place to come up to speed on how to make pictures in the tikz world, and   2. in particular, how one would use it (assuming it's not self-evident) to make images like the ones below? (Assuming that tikz is the best way to go other than just inserting eps images in LaTeX) ![enter image description here](http://i.stack.imgur.com/HnF2n.jpg)


title: How to make a list of used custom macros

text: I used to have a separate file where I store my custom macros. It is nothing more than a huge list of `\newcommands` and `\NewDocumentCommands`. Now, I have a little note that I would like to share with a buddy of mine. I would like to send him a selfcontained LaTeX file, where all the custom macros that I use in the this particular note are included in the header. I don't like to copy-paste **all** the macros in the header, because I use only a small number of them. Is there a better way than to scan manually through my note and include the macros one by one? For a better understanding here a MWE:               \documentclass{article}          \usepackage{filecontents}          \begin{filecontents*}{macros.tex}         \newcommand{\macroA}{A}         \newcommand{\macroB}{B}         \newcommand{\macroC}{C}         \newcommand{\macroD}{D}     \end{filecontents*}          \begin{document}         \input{macros.tex}         \macroA and \macroD     \end{document}      I would like to generate the following list:   * `\macroA`   * `\macroD`


title: What is this math font and how do I access it?

text: I'm reading a paper that uses a font that looks like this for equations: ![enter image description here](http://i.stack.imgur.com/eWOp1.png) It looks a bit like Times New Roman. In my file, I use `\usepackage{newtxtext,newtxmath}` and get the following really ugly looking result: ![enter image description here](http://i.stack.imgur.com/q3WuM.png) So I'm wondering what the difference is. I know in the first one the subscripts aren't italicized and I can easily change that in mine, but i still want to use the particular font in the model example.


title: Center text in color box

text: I wanto to center a text in a colorbox which is scaled horicontal over the complete site. ![enter image description here](http://i.stack.imgur.com/aChtJ.png) How is this possible?               \documentclass[     ]{scrreprt}          \usepackage[     ]{scrpage2}          \usepackage[ngerman]{babel}                 %% Deutsches Sprachpaket     \usepackage[utf8]{inputenc}                 %% Eingabezeichensatz UTF-8     \usepackage[T1]{fontenc}                    %% Kodierung für Umlaute     \usepackage[ngerman]{translator}            %% Für Abkürzungsverzeichnis benötigt     \usepackage{lmodern}                        %% Moderne Version von Computer Modern     \usepackage{setspace}                       %% Zeileabstand anpassen     \usepackage{xcolor}                         %% Definieren von Farben          \begin{document}          \chapter{}     \definecolor{lightgray}{gray}{0.5}     \newcommand \colbox [1]{\par\noindent\colorbox{gray}{\begin{minipage}{\textwidth}{ {#1}} \hfill \end{minipage}}}          \colbox{TEXT}          \end{document}      Moreover I want to avoid the overfull hbox.


I'm writing a package which, among other things, gives abbreviations for `\mathbb`, as follows:               \newcommand{\A}{\mathbb A}     \def\B{\mathbb B}     \def\C{\mathbb C}     \newcommand{\D}{\mathbb D}     \newcommand{\E}{\mathbb E}     \newcommand{\F}{\mathbb F}     \def\G{\mathbb G}     \def\H{\mathbb H}     \newcommand{\I}{\mathbb I}     \newcommand{\J}{\mathbb J}     \newcommand{\K}{\mathbb K}     \def\L{\mathbb L}     \def\M{\mathbb M}     \newcommand{\N}{\mathbb N}     \def\O{\mathbb O}     \def\P{\mathbb P}     \newcommand{\Q}{\mathbb Q}     \newcommand{\R}{\mathbb R}     \def\S{\mathbb S}     \def\T{\mathbb T}     \def\U{\mathbb U}     \newcommand{\V}{\mathbb V}     \newcommand{\W}{\mathbb W}     \newcommand{\X}{\mathbb X}     \newcommand{\Y}{\mathbb Y}     \newcommand{\Z}{\mathbb Z}     \DeclareSymbolFont{bbold}{U}{bbold}{m}{n}     \DeclareSymbolFontAlphabet{\bb}{bbold}      The reason for the `\def`-`\newcommand` oscillation is that I have seen some of those commands are not always defined, so choosing `\newcommand` would give problems in some cases while `\renewcommand` would in others, while `\def` bypasses this by not checking if the commands are defined or not. The strange thing which this question is about is that removing the braces from the `\def`s (e.g. in `\def\B{\mathbb B}` removing those around `\mathbb B`, and similarly from all the other `\def` commands) seems to cause problems. For example, removing them all except those of `\B` and `\C` causes:               ./mworks.sty:844: LaTeX Error: \mathbb allowed only in math mode.          See LaTeX manual or LaTeX Companion for explanation.     Type G <return> for immediate help.      ...          1.844 \newcommand{\I}{\mathbb                                    I}     ?      Why does that happen?


title: Output graphics code Error

text: \documentclass[pstricks,border=12pt,12pt]{standalone}     \usepackage{amsmath}     \usepackage{pst-plot,pst-node}     \psset{algebraic,plotpoints=100,labelsep=3pt}          \def\f[#1,#2]{2*2^(-2.5*(#1-#2)^2)}          \begin{document}     \begin{pspicture}[showgrid=false](-3,0)(3.5,3)         \psaxes[axesstyle=frame,tickstyle=bottom,ticks=x,ticksize=0 4pt,xsubticks=5,xsubticksize=.5,labels=none](0,0)(-3,0)(3,3)         \uput[d](-1,0){$\omega_{\text{nl}}$}         \uput[d](1.5,0){$\omega_{\text{lin}}$}         \uput[d](0,0){\tiny Frequency}         \psline{<-}(0,2)(1,2)         \psset{linecolor=gray}         \psline[linestyle=dashed](0,0)(0,3)          \psplot[linecolor=red,linestyle=dashed]{-3}{1}{\f[x,-1]}         \psplot[linecolor=red]{-.5}{3}{\f[x,1.5]}         \pcline{<->}(*-1.5 {\f[x,-1]})(*-.5 {\f[x,-1]})\nbput{$\Gamma_{\text{nl}}$}         \pcline{<->}(*1 {\f[x,1.5]})(*2 {\f[x,1.5]})\nbput{$\Gamma_{\text{lin}}$}     \end{pspicture}     \end{document}      I have requested someone to draw a graph and he did this by the code I have shown. I am trying to run this in my Latex file but it is not working. What can I do? Moreover, Can you give any tips so i can draw graph by using LaTeX code. ![enter image description here](http://i.stack.imgur.com/W9r3K.png) EDIT: ![enter image description here](http://i.stack.imgur.com/QKcYe.jpg)


title: Datatool (datagidx) index with special characters

text: When I define multiple terms that contain an underscore and begin with the same string ex_ 1, ex_ 2 (as shown in the example below) I get the following error: > ! TeX capacity exceeded, sorry [input stack size=5000]. \expandafter l.30 > \end{frame} However, when I define the term e2 using the commented out line below (e2_ 2) it compiles fine. If I just remove the escaped underscores (see below) that works as well. Can someone tell me how to work around this?               \documentclass[16pt,pdftex]{beamer}     \usepackage[T1]{fontenc}          \makeatletter     % beamer doesn't define \@idxitem, but it's used by the     % \printterms "index" style, so define it:     \newcommand\@idxitem{\par\hangindent40pt}     \makeatother          \usepackage{datagidx}          \newgidx{index}{Index}     \DTLgidxSetDefaultDB{index}          % this fails:      \newterm[label=e1]{ex\_ 1}      \newterm[label=e2]{ex\_ 2}          % this works     %\newterm[label=e1]{ex\_ 1}     %\newterm[label=e2]{e2\_ 2}          % this works     %\newterm[label=e1]{ex 1}     %\newterm[label=e2]{ex 2}     \begin{document}          \begin{frame}     \frametitle{example}     \gls{e1}     \gls{e2}     \end{frame}          \begin{frame}[allowframebreaks]     \frametitle{Index}     \printterms[style=index]     \end{frame}     \end{document}


title: Beamer - Dresden theme: miniframes appeareance and frame number insertion

text: I am writing a presentation in Beamer using the Dresden theme. From a theme preview I saw that white circles are supposed to appear on the top bar below the section titles of my presentation (to indicate the number of _slides_ in each _frame_ , I guess). The problem is that they do not appear when I compile my script. Do I have to specify a particular command in order to obtain that? Moreover, how do I add numbering of the slide progression (with respect to the total amount of slides in the presentation)? For instance, say that I want them to appear in the lower right corner of each slide.


title: How can I make sizes of different symbols equal?

text: I have an equation like this               \begin{gather}     n_i(t-1)= \sum_{j \in S} v_{ij}(t) \\     n_j(t)= \sum_{i \in S} v_{ij}(t) \\     \forall_{t\in T_0} \sum_{i \in S} n_i(t)=N     \end{gather}      The third part of it looks bad because `\forall` symbol is much smaller than `\sum` symbol. How can I meke it bigger? I want the `\forall` symbol to have size of `\sum` symbol. I would prefer not to change equation code. I would prefer some changes in preamble. ![](http://i.stack.imgur.com/9UZrQ.jpg) Also, is it possible to have `t\in T_0` part below the `\forall` symbol like when using `\sum` symbol?


title: How to set a counter like this?

text: I want to set a counter like picture ![enter image description here](http://i.stack.imgur.com/NVpte.gif) I only can do               \documentclass[a4paper, 12pt]{article}     \usepackage{fouriernc}     \usepackage{amsmath}\usepackage[thmmarks,standard,thref]{ntheorem}     \pagestyle{empty}          \theoremseparator{.}     \theorembodyfont{\upshape}     %\theorembodyfont{\normalfont}     \newtheorem{pro}{Problem}     \begin{document}     \begin{pro}     This is a Problem.      \end{pro}     \begin{pro}     This is a Problem.      \end{pro}     \begin{pro}     This is a Problem. \end{pro}     \begin{pro}     This is a Problem.     \end{pro}     \begin{pro}     This is a Problem.     \end{pro}     \begin{pro}     This is a Problem.     \end{pro}     \end{document}       How to set a counter like this picture?


title: Macro with an array and a customisable number of columns (from 2 to 5)

text: I would like to automate the use of the following arrays. In the first one, the only arguments which change are `\verb!\eqDef!`, the commands tested, and `A \eqDef B`, the visual test. **My problem is that I would like one solution which also allows to use 1, 2, 3 or 4 commands tested ?** In the second array, the commands tested are `\verb!\eqDef!`, `\verb!\eqTest!`, `\verb!\eqVerif!` and `\verb!\eqId!`, and the visual tests are `A \eqDef B`, `A \eqTest B`, `A \eqVerif B` and `A \eqId B`. I give one file with the commands proposed in my examples. ## One command tested --> Two columns               \[         \renewcommand{\arraystretch}{1.2}%         \begin{array}{llll}              \textbf{Style}            & \verb!\eqDef!             \\ \hline             \verb!\displaystyle!      & \displaystyle      A \eqDef B             \\             \verb!\textstyle!         & \textstyle         A \eqDef B             \\             \verb!\scriptstyle!       & \scriptstyle       A \eqDef B             \\             \verb!\scriptscriptstyle! & \scriptscriptstyle A \eqDef B         \end{array}     \]      ## Four commands tested --> Five columns               \[         \renewcommand{\arraystretch}{1.2}%         \begin{array}{lllll}              \textbf{Style}             & \verb!\eqDef!                   & \verb!\eqTest!             & \verb!\eqVerif!                 & \verb!\eqId!             \\ \hline             \verb!\displaystyle!             & \displaystyle      A \eqDef B   & \displaystyle      A \eqTest B             & \displaystyle      A \eqVerif B & \displaystyle      A \eqId B             \\             \verb!\textstyle!             & \textstyle         A \eqDef B   & \textstyle         A \eqTest B             & \textstyle         A \eqVerif B & \textstyle         A \eqId B             \\             \verb!\scriptstyle!             & \scriptstyle       A \eqDef B   & \scriptstyle       A \eqTest B             & \scriptstyle       A \eqVerif B & \scriptstyle       A \eqId B             \\             \verb!\scriptscriptstyle!             & \scriptscriptstyle A \eqDef B   & \scriptscriptstyle A \eqTest B             & \scriptscriptstyle A \eqVerif B & \scriptscriptstyle A \eqId B         \end{array}     \]      ## One functionnal code               % Source : http://tex.stackexchange.com/questions/35404/is-there-a-wider-equal-sign          \documentclass{scrartcl}         \usepackage{amsmath}         \usepackage{mathtools}              \usepackage{graphicx}              \makeatletter             \newcommand{\@@eqLikeDef}[3]{%                 \ensuremath{\overset{\mathclap{\text{\scalebox{#1}{#2}}}}{#3}}%             }             \newcommand*{\@eqLikeDef}[2]{                 \mathchoice                     {% \displaystyle                         \@@eqLikeDef{0.7}{#1}{#2}                     }                     {% \textstyle                         \@@eqLikeDef{0.7}{#1}{#2}                     }                     {% \scriptstyle                         \@@eqLikeDef{0.6}{#1}{#2}                     }                     {% \scriptscriptstyle                         \@@eqLikeDef{0.5}{#1}{#2}                     }             }                  \newcommand*{\eqDef}{\@eqLikeDef{Def}{=}}             \newcommand*{\eqTest}{\@eqLikeDef{Test}{=}}             \newcommand*{\eqVerif}{\@eqLikeDef{?}{=}}             \newcommand*{\eqId}{\@eqLikeDef{Id}{=}}         \makeatother          \begin{document}          \section{Equality Signs}          \[         \renewcommand{\arraystretch}{1.2}%         \begin{array}{lllll}              \textbf{Style}             & \verb!\eqDef!                   & \verb!\eqTest!             & \verb!\eqVerif!                 & \verb!\eqId!             \\ \hline             \verb!\displaystyle!             & \displaystyle      A \eqDef B   & \displaystyle      A \eqTest B             & \displaystyle      A \eqVerif B & \displaystyle      A \eqId B             \\             \verb!\textstyle!             & \textstyle         A \eqDef B   & \textstyle         A \eqTest B             & \textstyle         A \eqVerif B & \textstyle         A \eqId B             \\             \verb!\scriptstyle!             & \scriptstyle       A \eqDef B   & \scriptstyle       A \eqTest B             & \scriptstyle       A \eqVerif B & \scriptstyle       A \eqId B             \\             \verb!\scriptscriptstyle!             & \scriptscriptstyle A \eqDef B   & \scriptscriptstyle A \eqTest B             & \scriptscriptstyle A \eqVerif B & \scriptscriptstyle A \eqId B         \end{array}     \]          \end{document}


title: How can I change behaviour of enumitem?

text: Document 1:               \documentclass[12pt,a4paper]{mwrep}     \usepackage{enumitem}     \begin{document}     List of items:     \begin{itemize}     \item Item one,     \item Item two,     \item Item three     \end{itemize}     \end{document}          Document 2:               \documentclass[12pt,a4paper]{mwrep}     \begin{document}     List of items:     \begin{itemize}     \item Item one,     \item Item two,     \item Item three     \end{itemize}     \end{document}      Those documents look different because of `\usepackage{enumitem}` line. I want to use this package (for `\setlist[itemize]{label=--}`) but I don't want it to change spacing of my lists. How can it be done? I found on my own that using `\begin{itemize}[topsep=0pt]` will do what I want. I don't want to add this parameter to every occurence of `\begin{itemize}` in my document. How can I use `\renewcommand` to do what I need?


title: How can I add line feed after itemize?

text: How can I add line feed after `itemize`? Some vertical spacing would be even better, I think.   My document:               \documentclass[12pt,a4paper]{mwrep}     \usepackage{enumitem}     \setlist[itemize]{label=--}     \setlist[itemize]{topsep=0pt}     \begin{document}     List of items:     \begin{itemize}     \item Item one,     \item Item two,     \item Item three     \end{itemize}     That was the list of items.     \end{document}      I want it to look like this:               \documentclass[12pt,a4paper]{mwrep}     \usepackage{enumitem}     \setlist[itemize]{label=--}     \setlist[itemize]{topsep=0pt}     \begin{document}     List of items:     \begin{itemize}     \item Item one,     \item Item two,     \item Item three     \end{itemize}~\\     That was the list of items.     \end{document}      Space generated by `~\\` is a little to big for me.   What do I need to change in preamble to get effect like this? Is vertical spacing in this case better than line feed?


title: xdvi/ghostscript error on inserting a png into a LaTeX file

text: I'm trying to include a .png picture into my LaTeX .dvi file. I use Emacs on Debian, if that is of any importance. I do this by               \usepackage{graphicx}     \graphicspath{{./dia/}}      and then               \includegraphics[bb = 0 0 100 100]{student.png}      Then I process with C-c C-f (see below) and do not (what I can see) run into any problems. For some reason the [2] is shown in red -- if this is an indication of an error, it is probably unrelated as the png image should appear later on. Then I view with C-c C-v. xdvi displays the document with no errors. But, when I browse down to the page where the image should appear, ghostscript gives the error below, and the image is not shown. As ghostscript is probably what causes the error, this is the ghostscript stuff I have according to aptitude search ghostscript. (What does A mean?)               i A ghostscript     i A ghostscript-cups     i   ghostscript-doc     i   ghostscript-x      What do you think?               [?17;0;127cincal@VLAN-3434:~/dvk/x/first_try$latex \\nonstopmode\\input first.tex     This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)     entering extended mode     LaTeX2e <2009/09/24>     Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh     yphenation, swedish, loaded.          (./first.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls     Document Class: article 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texmf-texlive/tex/latex/base/size12.clo))     (/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty     (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)     (/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty     (/usr/share/texmf-texlive/tex/latex/graphics/trig.sty)     (/etc/texmf/tex/latex/config/graphics.cfg)     (/usr/share/texmf-texlive/tex/latex/graphics/dvips.def)))     (/usr/share/texmf-texlive/tex/generic/babel/babel.sty     (/usr/share/texmf-texlive/tex/generic/babel/swedish.ldf     (/usr/share/texmf-texlive/tex/generic/babel/babel.def)))     (/usr/share/texmf-texlive/tex/latex/base/fontenc.sty     (/usr/share/texmf-texlive/tex/latex/base/t1enc.def))     (/usr/share/texmf-texlive/tex/latex/base/inputenc.sty     (/usr/share/texmf-texlive/tex/latex/base/utf8.def     (/usr/share/texmf-texlive/tex/latex/base/t1enc.dfu)     (/usr/share/texmf-texlive/tex/latex/base/ot1enc.dfu)     (/usr/share/texmf-texlive/tex/latex/base/omsenc.dfu))) (./first.aux) [1]     [2] [3] [4] [5] [6] <./dia/student.png> [7] [8] (./first.aux) )     Output written on first.dvi (8 pages, 20016 bytes).     Transcript written on first.log.     [?17;0;127cincal@VLAN-3434:~/dvk/x/first_try$xdvi /home/incal/dvk/x/first_try/first.dvi&     [1] 3936     [?17;0;127cincal@VLAN-3434:~/dvk/x/first_try$gs: Error: /syntaxerror in (binary token, type=137)     gs: Operand stack:     gs:      gs: Execution stack:     gs:    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--     gs:    2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fals     gs: e   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop     gs:    1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--        gs: %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--      gs:   2   %stopped_push   --nostringval--   --nostringval--   %loop_continue   --nost     gs: ringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1769      gs:   1   3   %oparray_pop   --nostringval--   --nostringval--   false   1   %stopped     gs: _push   --nostringval--   1878   1   5   %oparray_pop   1877   1   5   %oparray_p     gs: op   1861   1   5   %oparray_pop   1755   1   5   %oparray_pop   --nostringval--      gs:   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval-     gs: -   2   %stopped_push     gs: Dictionary stack:     gs:    --dict:1157/1684(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--   --dict:23/     gs: 250(L)--   --dict:42/200(L)--     gs: Current allocation mode is local      Alright, thanks for you answers. I saved the file as `.eps` with no problems from Dia. I didn't have auctex, so **C-c C-t C-p** didn't do anything, so I downloaded auctex and got it to work. I noticed there were different effects when editing, e.g. subsection captions were in big yellow letters. Also, flyspell- mode was suddenly on by default. The checker gave more detailed information, although I miss the old **C-c C-f** shortcut. There is no shortcut stated in the menu - do you know the name of that command, so I can at least run it with **M-x** (and bind it to **C-c C-f** )? But there were no new errors on the graphics stuff. In the default mode, the view command is:               xdvi first.dvi      This works, but the picture is still not visible. In PDF mode, the view command is:               xpdf -remote first -raise first.pdf      This does not do anything when run from Emacs. When I run it from bash, it says there is no `first.pdf`. (The LaTeX file is `first.tex`) However, this works (views the file including the EPS image)               pdflatex first.tex; evince first.pdf      I guess I could run it from Emacs every time and simply ignore the view stuff. **New edit:** Ok, it worked yesterday, but for some reason it stopped to. That's what you get when you "solve" problems without knowing why or how... The `pdflatex` would give me a new error message every time, and, as I googled them, I had to add a lot of stuff, so now it looks like:               \usepackage{graphicx}     \usepackage{epstopdf}     \graphicspath{{./dia/}}     \epstopdfsetup{suffix=}     ...     \includegraphics{student}      The command I use now is               pdflatex --shell-escape first.tex      I added the flag because it complains that it wasn't enabled. The file is `first.tex` and the eps file is `./dia/student.eps` This is the relevant part of compilation output. Yes, I googled the error messages. If you would help me on this, I would be very happy.               [Loading MPS to PDF converter (version 2006.09.02).]     )Error: /syntaxerror in (binary token, type=137)     Operand stack:          Execution stack:        %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push     Dictionary stack:        --dict:1160/1684(ro)(G)--   --dict:0/20(G)--   --dict:70/200(L)--     Current allocation mode is local     GPL Ghostscript 8.71: Unrecoverable error, exit code 1     epstopdf ($Id: epstopdf.pl 17496 2010-03-18 17:57:31Z karl $) 2.15     !!! Error: Writing to gs failed, error code 1


title: combining two diagrams with tikz and scale judiciously

text: I have the following code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing,calc}          \begin{document}     \usetikzlibrary{decorations.pathmorphing,calc}     \begin{tikzpicture}     % Define some reference points      % The figure is drawn a bit bigger, and then clipped to the following dimensions:     \coordinate (clipping area) at (10, 7);     \clip (0,0) rectangle (clipping area);          % Next reference points are relative to the lower left corner of the clipping area     \coordinate (water level) at (0, 6);     \coordinate (bottom)      at (5, 1.3);     % (bottom of the pit)     \coordinate (ground1)     at (0, 5);       % (left shore)     \coordinate (ground2)     at (10, 5);      % (right shore)          % Coordinates of the bigger area really drawn     \coordinate (lower left)  at ([xshift=-5mm, yshift=-5mm] 0,0);     \coordinate (upper right) at ([xshift=5mm,  yshift=5mm] clipping area);          % Draw the water and ripples     \draw [draw=blue!80!black, decoration={bumps, mirror, segment length=6mm}, decorate,          bottom color=cyan!60!black, top color=blue!20!white]        (lower left) rectangle (water level-|upper right);          % draw horizontal dashed line     \draw[dashed](0,4) -- (10,4);     \draw[dashed](0,3.6) -- (10,3.6);          % Draw the ground     \draw [draw=brown!30!black, fill=brown]        (lower left) -- (lower left|-ground1)  --       (ground1) .. controls ($(ground1)!.3!(bottom)$) and (bottom-|ground1) ..       (bottom) .. controls (bottom-|ground2) and ($(ground2)!.3!(bottom)$) ..        (ground2) -- (ground2-|upper right) -- (lower left-|upper right) -- cycle;          \end{tikzpicture}     \end{document}      which generates the left hand diagram of the figure below: ![enter image description here](http://i.stack.imgur.com/FUHu0.png) My next task is to generate the right hand diagram and scale it so that the horizontal lines match on both figures (shown as a rectangular region in second figure). The main problem I have with generating this is that the first diagram is cropped and I fail to find a consistent way of scaling the second diagram. The second diagram shown is a simple example. The actual diagram I wish to insert is given by the following code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing,calc}          \begin{document}     \begin{tikzpicture}     [x = 2mm, y = 7mm,transition/.style = {rectangle, draw = black!50}] % define rectangular region     \draw [>=stealth, ->,thick](0,0) -- (0,-10); % draw xaxis for the diagram     \draw [>=stealth, ->,thick](0,0) -- (42,0); % draw yaxis     \foreach \x in {0,4,10,20} { \draw(\x,-2mm)--(\x,2mm) node[above]{\x};} % temperatures for graph     \draw[transition] (0,-6) rectangle (40,-2); % draw the rectangular region     \draw [thick] (0,-4) -- (41,-4); % define the thermocline     \draw[dashed] (4,0) -- (4,-10); % draw line at 4 degC     \draw (4,-10) .. controls (4,-4)  and (18,-4) .. (18,0); % draw temperature profile i.e. curved line     \end{tikzpicture}     \end{document}


title: How to create a shade box that covers the whole footnotes area?

text: I would like to shade the whole footnote area (bottom of the page). Does anyone know, if it can be done ? Edit : Using the answer provided, the text direction commands \setRL and \setLR, from the Bidi package, get ignored. Here is an example :               %!TEX TS-program = xelatex     %!TEX encoding = UTF-8 Unicode     \documentclass[a4paper,12pt]{article}     \TeXXeTstate=1               \usepackage{framed}     \usepackage{xunicode}     \usepackage{xltxtra}     \usepackage{polyglossia}     \usepackage{bidi}     \usepackage{fontspec}     \usepackage{color}          \defaultfontfeatures{Scale=MatchLowercase}     \setmainfont{Times New Roman}     \newfontfamily{\sbl}[Script=Hebrew]{SBLHebrew}     \setmainlanguage{english}     \setotherlanguage[numerals=hebrew]{hebrew}               %colored footnotes          \def\colorftns#1{%     \nointerlineskip\hbox{\fboxsep0pt \colorbox{yellow}{\box#1}}}     \let\oldfootnoterule\footnoterule      \def\footnoterule{\oldfootnoterule\let\unvbox\colorftns}          \begin{document}     \setRL     \H     h e b r e w t e x t   \setLR\footnote{a b c d e f} \setRL     \end{document}


title: Deciding Which Glyphs to Use in Font Encoding

text: I wanted to use one of my favorite fonts, Crimson, while still maintaining full support from the `microtype` package. Since XeTeX and LuaTeX are not fully supported by the `microtype` package (as of version 2.5, beta 08, "adjustment of interword spacing and of kerning only works with pdfTeX (≥ 1.40)"), I was forced to convert the Crimson font files from the `OTF` format to the Type 1 format used by (pdf)TeX. In the process of using `otftotfm` to convert the font files to Type1 format, I encountered some concerns that I would like to address.   * When I converted the `OTF` files to the Type 1 format using `T1` encoding, `otftotfm` displayed the following warning. `$ sudo otftotfm -e ec -fcalt -fdlig -ffrac -fkern -fonum -fordn -fpnum -fsinf -fsmcp -fsubs -fsups -fzero --vendor sebastiankosch Crimson-Roman.otf T1-- Crimson--Roman`               ...     otftotfm: warning: not enough room in encoding, ignoring 8 glyphs     otftotfm: (This encoding doesn’t have room for all the glyphs used by the     otftotfm: font, so these have been left out:     otftotfm:   T_h f_f_b f_f_h f_f_j f_f_k f_h f_j f_k.     otftotfm: To select specific glyphs, add them to the input encoding.)     ...      I know that pdfTeX limits the number of glyphs in a given font to 256, and that the purpose of the font encoding is to determine the character to use in each of the 256 positions. But I would like to use the ligatures that `otftotfm` left out. How can I include these additional ligatures in the font without any side effects? If this is not possible, which glyphs are safe to move to another font without affecting things like hyphenation? How can I accomplish this?   * If I want to include old-style numerals and other symbols (e.g. Cyrillic alphabet), do I have to create a separate font for this purpose?   * Why is there an 8-bit, 256 glyph limit for a given font in pdfTeX? This limit seems silly and totally arbitrary --- why does this limitation still exist?