title: Fatal format file error; stymied. fmtutil: infinite recursion

text: I'm using texlive / ConTeXt / Xetex, but I don't know which of those might be relevant to the problem. The summary is that when I run TeX, I get a "Fatal format file error; I'm stymied" message. Details follow... I'm running `texexec` using a Makefile. The command line executed from the Makefile is:               texexec --xtx --mode=linux,report,border --nomapfiles --verbose complete-book.tex      The output looks like this:               TeXExec | processing document 'complete-book.tex'     TeXExec | using search method 'kpsewhich'     TeXExec | no ctx file found     TeXExec | using search method 'kpsewhich'     TeXExec | tex processing method: context     TeXExec | TeX run 1     TeXExec | writing option file complete-book.top     TeXExec | using randomseed 170     TeXExec | tex engine: xetex     TeXExec | tex format: cont-en     TeXExec | fixing backend map path for dvipdfm     TeXExec | running: xetex -progname=context -fmt=cont-en -translate-file=natural.tcx --8bit -output-driver="xdvipdfmx -E -d 4 -V 5" complete-book.tex \emergencyend     This is XeTeXk, Version 3.141592-2.2-0.996 (Web2C 7.5.6)      %&-line parsing enabled.      (WARNING: translate-file "natural.tcx" ignored)     ---! /var/lib/texmf/web2c/pdftex/cont-en.fmt was written by pdftex     (Fatal format file error; I'm stymied)     TeXExec | runtime: 0.030342      ...      Looking at pages like http://www.karakas-online.de/mySGML/fatal-format-file- error.html, it sounds like maybe this is caused by the fact that I installed xetex later than the rest of the texlive system was installed, and that I could fix it by running `fmtutil`. **Am I right about running fmtutil to fix fatal format file errors, or does XeTeX require the use of some other utility?** When I run fmtutil:               sudo fmtutil --all      or               sudo fmtutil --byfmt cont-en      I get an infinite recursion error:               fmtutil: Infinite recursion detected, giving up!.       This was at the end of 60K of output, which I can make available if it helps. But the last part of the output is:               bodyfont : style mm (mm) defined     ) (/usr/share/texmf/tex/context/base/type-map.tex)     (/usr/share/texmf/tex/context/base/type-spe.tex)     (/usr/share/texmf/tex/context/base/type-akb.tex))          ConTeXt ver: 2007.01.12 15:56 MKII fmt: 2012.10.31 int: english/english           ) )     Beginning to dump on file cont-en.fmt      (format=cont-en 2012.10.31)     42595 strings of total length 701393     571219 memory locations dumped; current usage is 356&567724     39899 multiletter control sequences     \font\nullfont=nullfont     0 words of font info for 0 preloaded fonts     192 hyphenation exceptions     Hyphenation trie of length 60932 has 3094 ops out of 35111       194 for language 20       194 for language 19      [snip]...       224 for language 2       377 for language 1     No pages of output.     Transcript written on cont-en.log.     fmtutil: /root/.texlive2007/texmf-var/web2c/pdftex/cont-en.fmt installed.     fmtutil: Infinite recursion detected, giving up!.       I searched for that error, and found a mention of it here: http://us.generation-nt.com/answer/bug-560816-texlive-base-postinst-fails- fmtutil-sys-infinite-recursion-help-168924641.html But it didn't indicate a workaround. Any suggestions would be greatly appreciated. Versions:   * CentOS release 6.3 (Final). 64bit.   * texlive: installed the package texlive.x86_64 0:2007-57.el6_2   * context: ConTeXt ver: 2007.01.12 15:56 MKII fmt: 2012.10.31   * xetex: XeTeXk, Version 3.141592-2.2-0.996 (Web2C 7.5.6) All this was installed initially via               $ sudo yum install texlive-context       which installed texlive-context.x86_64 0:2007-57.el6_2 and its dependencies; then later I did               $ sudo yum install texlive-xetex      which installed texlive-xetex.x86_64 0:2007-57.el6_2 and its dependencies. ## Update To try to establish a minimal example, and determine whether it was a problem in our .tex document vs. our configuration, I created a file helloworld.tex:               \starttext     Hello world!     \stoptext      and ran xetex on it:               sudo xetex -progname=context -fmt=cont-en -translate-file=natural.tcx --8bit -output-driver="xdvipdfmx -E -d 4 -V 5" helloworld.tex \emergencyend      The result: again I got the Fatal file format error / stymied message. If I remove `-progname=context` but keep `-fmt=cont-en`, I still get the fatal file format error. If I remove `-fmt=cont-en` but keep `-progname=context`, I get the message "I can't find the format file `context.fmt'!" If I remove both, and use a helloworld.tex without ConTeXt macros, XeTeX enters extended mode, and after I type \end at the prompt, it successfully delivers a PDF. ## Update 2 Following suggestions, I deleted /root/.texlive2007, and ran `sudo fmtutil-sys --all`. But `fmtutil-sys` fails in the same way as `fmtutil`:               Infinite recursion detected, giving up!.      The log file, cont-en.log, is posted at: http://pastebin.com/BUPE5Rhz AFAICT the part that looks the most like "infinite recursion" (but not quite) is this section:               (/usr/share/texmf/tex/context/base/type-exa.tex     \@sl@\relativefontsize=\count208     \@sl@\typefaceencoding=\count209          (/usr/share/texmf/tex/context/base/type-exa.tex)     (/usr/share/texmf/tex/context/base/type-syn.tex)     (/usr/share/texmf/tex/context/base/type-enc.tex)     (/usr/share/texmf/tex/context/base/type-siz.tex)     (/usr/share/texmf/tex/context/base/type-map.tex)     (/usr/share/texmf/tex/context/base/type-spe.tex)     (/usr/share/texmf/tex/context/base/type-akb.tex)     (/usr/share/texmf/tex/context/base/type-exa.tex)     (/usr/share/texmf/tex/context/base/type-syn.tex)      and then it repeats that group of seven files eight times. Similar to how it was originally (but with a different directory for cont- en.fmt), the output ends with these three lines, which are not in the log file:               Transcript written on cont-en.log.     fmtutil: /var/lib/texmf/web2c/pdftex/cont-en.fmt installed.     fmtutil: Infinite recursion detected, giving up!.      At this point I'm probably going to reinstall Context/xetex/etc., directly from texlive instead of from the package repository. But I thought I'd post the above since it was requested/suggested. ## Final update I uninstalled the 2007 (mixed with 2010?) version of texlive that I'd gotten from the local package repo, and instead downloaded the latest stable texlive directly from their web site. The problem went away. Thanks again to all who made suggestions.


title: knitr & xcolor: incompatible color definition

text: I'm using knitr and RStudio to compile LaTeX. In my real project I'd like to use some options from the LaTeX package 'xcolor', but when I do include `\usepackage[options]xcolor`, I get the error message "Incompatible color definition on line xx" where "line xx" corresponds to knitrout blocks. I note that knitr emits `\usepackage[]{color}` to the .tex file, and if I change that to xcolor, all is well. But, I have a bigger project. Here's a minimal example .Rnw file in which I try to use a named color for url links:               \documentclass{article}     \usepackage[dvipsnames]{xcolor}     \usepackage[T1]{fontenc}     \usepackage{url}          \definecolor{Sepia}{named}{Sepia}          % hyperref setup:     \usepackage[colorlinks,pdfpagemode=UseOutlines,%     linkcolor=red,%     urlcolor=Sepia,%     plainpages=false,%     ]{hyperref}          \begin{document}          <<setup, cache=FALSE, include=FALSE>>=     library(knitr)     # Global chunk options     opts_chunk$set(keep.source=TRUE, fig.align='center')     @          A quick example. I like \texttt{knitr}: \url{http://yihui.name/knitr/}.          And now for some boring input and output.          <<quickexample>>=     sessionInfo()     x <- rnorm(100, 1, 0)     mean(x)     sd(x)          sessionInfo()     @          \end{document}      I've tried using the `\PassOptionsToPackage{dvipsnames}{xcolor}` workaround I've seen in other posts on xcolor, but to no avail. Although this minimal example does give me a .pdf with sepia coloured links, but in the bigger project, the reams of incompatible color warnings makes it hard to find other LaTeX errors that I need to fix. (So I'm after cleaner log files, I guess.)


title: Two block commands in \newenvironment

text: What is wrong with following document?               \documentclass{article}     \usepackage{xepersian}     \usepackage{verbatim}          \newenvironment{code}      {\begin{latin}\begin{verbatim}}      {\end{verbatim}\end{latin}}          \usepackage{enumitem}     \begin{document}     \begin{code}     hello world!     \end{code}     \end{document}      Error:               ! File ended while scanning use of \next.     <inserted text>                      \par      <*> untitled-4.tex      I also tried this:               \documentclass{article}     \usepackage{listings}     \usepackage{xepersian}     \newenvironment{code}      {\begin{latin}\begin{lstlisting}}      {\end{lstlisting}\end{latin}}          \begin{document}          \begin{code}     hello world!     This is a code     \end{code}          \end{document}      But the output is not what I expect.


title: pdflatex error in Inlage Editor - Command line compiler

text: I have installed MikTeX and Inlage LaTeX editor for intellisense LaTeX programming. To convert it to pdf when I click the convert icon, it displays me `pdflatex.exe not found`. I changed the path of the compiler, but it didn't work. Is there a command line compiler for generating pdf documents of LaTeX ?


title: acmsmall breaks line number alignments of algorithms

text: I am formatting an article with one of the ACM journal formats: acmsmall. However, when I look at algorithms, I noticed that the lines of my algorithm lost their indentation. This problem does not occur in article class. I have prepared a minimal example to demostrate the issue.               \documentclass{acmsmall}     %\documentclass{article}          \usepackage{algorithm}     \usepackage[noend]{algpseudocode}           \begin{document}         \begin{algorithm}             \caption{MyAlgorithm}             \begin{algorithmic}[1]                 \State $A \gets X$                 \State $A \gets Y$                 \State $A \gets Z$                 \State $A \gets X$                 \State $A \gets Y$                 \State $A \gets Z$                 \State $A \gets X$                 \State $A \gets Y$                 \State $A \gets Z$                 \State $A \gets X$                 \State $A \gets Y$                 \State $A \gets Z$             \end{algorithmic}         \end{algorithm}     \end{document}      I have attached the screenshots of both acmsmall and article. As you can see, after line 10, the indentation of acmsmall is broken. How can I fix the problem? ![acmsmall](http://i.stack.imgur.com/8RHmv.jpg) ![article](http://i.stack.imgur.com/PqtJ3.jpg)


title: \settowidth in preamble wrong with fontspec+lualatex w/ MWE

text: I am getting some strange behaviour using luaLaTeX and a rather simple command definition. I am using TeXLive 2012, Linux x86_64. When `\settowidth` is used in the preamble to compute the width of some characters in the following example, the width is terribly underestimated, and when that width is used to negatively indent some text, it does not line up. If the `\settowidth` operating is moved inside the document environment, the calculation is just fine. Here is a minimum working example:               \documentclass[12pt]{article}       \usepackage{lipsum}       \usepackage{fontspec}          \newdimen\arrowwidth     \settowidth{\arrowwidth}{$\rightarrow$\ }     \newcommand{\note}[1]{\noindent\hskip-\arrowwidth{$\rightarrow$\ }{#1}}          \begin{document}     \lipsum[1]     %\settowidth{\arrowwidth}{$\rightarrow$\ }     \note{HELLO WORLD!}          \lipsum[2-2]          \end{document}      If you uncomment the line above the `\note{HELLO WORLD}`, everything works as expected. Changing the `12pt` option also changes the issue somewhat drastically. The `→` character isn't the problem. You can substitute roman text for the right arrow and it will still give problems. Does anyone have any idea what causes this? Can anyone else reproduce it?


title: Author-year citation with self-generated Natbib-Style, Lyx

text: I have generated a bib-style for Lyx using the terminal (bib.bst) and am using it in Lyx 2.0.3 with JabRef, natbib and author-year citation. Everything works great, only now in citations I don't get only the author's last but also the first names, which is far too long. Is there a way to change this? Thanks a lot, I'm not very experienced and would be glad about help! (sorry, not even sure whether that's bibtex or biblatex. A friend helped me there.)


title: Font problem in PDF Output since updating LyX

text: First time poster, long time reader! I recently updated `LyX` from version 2.0.4 to 2.0.6. The `LaTeX` compiler is `MikTeX 2.9`, and the default output is `pdflatex`. Since updating `Lyx` though, the output of the PDF is not "as nice" as it used to be, and I've been searching Google and StackExchange for a solution but to no avail! I'll attach two pictures of the same document, one compiled before the update and one compiled after, the difference in font is quite noticeable. Here are screen shots of the same document at the same position: Before Update: ![enter image description here](http://i.stack.imgur.com/4X39j.png) After Update: ![enter image description here](http://i.stack.imgur.com/nGROp.png) Before the update it is clear that the fonts were a lot less "blurred". If you guys need the PDFs I can email them to you for closer inspection. I just can't for the life of me figure out what happened during the update, I made sure the document settings were preserved! Thanks very much in advance, any assistance would be greatly appreciated.


title: Footnote with url in caption?

text: I try to put a url as a reference in a caption of a figure. But it seem to give all kinds of errors like:               ! Argument of \@caption has an extra }.     ! Paragraph ended before \contentsline was complete.      Is there a way to make this work?               \begin{figure}[]         \centering         \includegraphics[width=0.65\textwidth]{image}         \caption{              \footnote{\url{test.com}}                     }         \label{fig:label1}     \end{figure}


title: How to make bend lines/arrows with TikZ?

text: I've been testing out TikZ lately, but I'm still quite new to it. What I want to do is to create a line to indicate that a parameter belongs to a part of the drawing. For example "This surface that I'm pointing at has temperature T". What I've seen used sometimes is to have a line or arrow with a small S-bend on the middle. I think this is a good idea as it's easy to see that the line doesn't have anything to do with the body you're drawing. Unfortunatley I had some problems finding a picutre explaining what I'm thinking of. The arrow specifying Pθ on this picture was the best I could find allthough it's not completly the same. Is there any easy way to do something like this in TikZ? I have no idea what it would be called...


title: Distributive arrows in xypic

text: I am trying to draw "distributive arrows" in `xypic`, but I can't make it look nice. Here is a MWE:               \xymatrix{a\ar @/^1.4pc/[r]  \ar @/^1.4pc/[rrr]  &( b &+& c)}      Does anyone know how to do this well?


title: Table does not break properly between tables

text: Table overdraw footer, when I expect that this should be break on new page after fifth line (after this text 'Uuuuuuuuuu ttt ppppppp') Here is the generated PDF: http://web-engineering.com.ua/mtest3.pdf And code:               \documentclass[a4paper,oneside]{book}     \usepackage[paper=a4paper, left=1.5cm, right=1cm, top=1.7cm, bottom=2.5cm]{geometry}     \usepackage{ltablex}     \usepackage{calc}     \usepackage[utf8]{inputenc}     \usepackage{multirow}     \usepackage{color}     \usepackage{colortbl}     \usepackage{fancyhdr}          %\usepackage{mylayout}          %fancyhdr way     \pagestyle{fancy}     \setlength{\headheight}{1cm}     \definecolor{White}{rgb}{1, 1, 1}          \lhead{}     \chead{}     \rhead{}     \lfoot{\textbf{2001-2012 FOOTERT FOOTER FOOTER FOOTER}}     \cfoot{}     \rfoot{}          \makeatletter          \newcommand\nobreakcline[1]{\@nobreakcline#1\@nil}%     \def\@nobreakcline#1-#2\@nil{%       \omit       \@multicnt#1%       \advance\@multispan\m@ne       \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi       \@multicnt#2%       \advance\@multicnt-#1%       \advance\@multispan\@ne       \leaders\hrule\@height\arrayrulewidth\hfill\\*       \noalign{\vskip-\arrayrulewidth}}          %code takes from http://tex.stackexchange.com/questions/6350/how-to-disable-pagebreak-on-hline-in-longtable     %intended to fix issue #339     \def\nobreakhline{%       \noalign{\ifnum0=`}\fi         \penalty\@M         \futurelet\@let@token\LT@@nobreakhline     }     \def\LT@@nobreakhline{%       \ifx\@let@token\hline         \global\let\@gtempa\@gobble         \gdef\LT@sep{\penalty\@M\vskip\doublerulesep}       \else         \global\let\@gtempa\@empty         \gdef\LT@sep{\penalty\@M\vskip-\arrayrulewidth}       \fi            \ifnum0=`{\fi}%       \multispan\LT@cols          \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr       \noalign{\LT@sep}%       \multispan\LT@cols          \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr       \noalign{\penalty\@M}%       \@gtempa}          \makeatother          %For tables     \newdimen{\newtblsparewidth}     \newdimen{\newtblstarfactor}     \setlength{\extrarowheight}{5pt}     \definecolor{Blue}{rgb}{0,0,1}     \definecolor{White}{rgb}{1,1,1}     \arrayrulewidth=1pt          \setlength{\parskip}{1.7ex}          \begin{document}     Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text.      Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text.     Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text.      Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text. Here some text.      \subsection{Here some text. Here some text. h}     \begin{itemize}     \item Here some list item. here some list Item. here some list item. here some list     \end{itemize}          \hangindent=30pt     \hangafter=0     \noindent \texttt{Some bold text. Bold text BBBBBBBB}          \begin{itemize}     \item Another item. Another item. Anorther item. Naother Item. Another Item Another item. Naother Item. Another item. Another item. Another item. Another item item item just :     \end{itemize}          \hangindent=30pt     \hangafter=0     \noindent \texttt{Latex text content Latex. Page content Latex Page Content . some text Another text Latex text. This is LaTeX Dummy text. And another some }          \begin{itemize}     \item Some command and this is dummy latex text. Dont read this. Thsi is just a dummy     \end{itemize}          \hangindent=30pt     \hangafter=0     \noindent \texttt{Mail Latex. This is Lmeainingless text. This is medaningless text XXXXXXXX-XXXXXXXXXX-XXXXXX-XXX-XX n: Something meaningless . somethong foolish   }          \begin{itemize}     \item Senseless text. Don't read it. Thsi is text without meaning. Just for filling:     \end{itemize}          \hangindent=30pt     \hangafter=0     \noindent \texttt{Bold meaningless LaTexX Content here . YYY}          \begin{itemize}     \item Xxxxxxxxxxe MMM-cccccc gg ddddddd Latex ghff ghf fgfgfas fga afsg agsyyg gshf ghg  ghg hghghhg:     \end{itemize}          \hangindent=30pt     \hangafter=0     \noindent \texttt{XXXXXwer.exe COmhjehhebf ;lkslkhfhjf,fjf helpb, djksdjh /helele 'Vvvvvvvvvvvvvv}          \section{Section section section section section}     Wwwwwww w Iiiiiiiiii  00000   0.0           \texttt{mmmmmmm /O00000 <Rrrrrrrr Ppppppppp> [Oooooooo Ppppppppp]}          \textbf{Bbbbbb dddd iiii seeeeees -- ttttt aaa ttt swwwwwww aaa wwww eeee dddd:}          \setlength{\newtblsparewidth}{\linewidth-2\tabcolsep-2\tabcolsep-2\tabcolsep-2\tabcolsep}     \setlength{\newtblstarfactor}{\newtblsparewidth / \real{3}}     \begin{tabularx}{\linewidth}{l|X|X|}     \hline\noalign{\vskip-\arrayrulewidth}\endhead     \noalign{\vskip-\arrayrulewidth}\hline\endfoot     \nobreakhline          \multicolumn{1}{|>{\columncolor{Blue}\color{White}}m{0.15\newtblsparewidth}}{\centering OOOOOOO} &      \multicolumn{1}{|>{\columncolor{Blue}\color{White}}m{0.4\newtblsparewidth}}{\centering SSSsSssS} &      \multicolumn{1}{|>{\columncolor{Blue}\color{White}}m{0.45\newtblsparewidth}|}{\centering DDDDDDDDDDD} \\ *\nobreakhline          \multicolumn{1}{|m{0.15\newtblsparewidth}}{\multirow{4}{0.15\newtblsparewidth}{IIIIIIl OOOOOOO}} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{</ppppppp | /i> <Ppppppt.mmm>}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Iiiiiiii oo cccccccccs a ppppppp} \\ \cline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/a <Ppppppp.mmm>}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Aaaaaaaaaaaaaa iiiiiii -- Iiiiiiii a ppppppp on the nnnnnnn} \\ \cline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/j<u|m> <Ppppppp.mmm> [/t <Ttttttttt Liii>] [/g <Llllllle Ii>]}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Aaaaaaaaaa a apppppt -- m to all uuuuu, u to cuuuuuu usss} \\ \cline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{</Uuuuuuuu | /x> <Ppppppp.mss | PrrrrrrCorr>}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Uuuuuuuuuu ttt ppppppp} \\ \hline          \multicolumn{1}{|m{0.15\newtblsparewidth}}{\multirow{4}{0.15\newtblsparewidth}{Ddddddd Ooooooo}} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/qqqqq}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Qqqqq mmmm, no ussss n   dddddd} \\* \nobreakcline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/passive}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Uuuuuuuuuu oodo -- pppppppp bbb oooo} \\* \nobreakcline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/q[n|b|r|f]}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Sssssu uuui uuuuuce lllll: %} \\ \cline{2-3}     \newline     \textbf{n} -- Nn UI \newline     \textbf{b} -- Bbbbb UI \newline     \textbf{r} -- Rrrrrrr UI \newline     \textbf{f} -- Fuuu UI (ddddddd) \newline     }\\ \cline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/help}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Hhhh innnnnnnnnn} \\ \hline          \multicolumn{1}{|m{0.15\newtblsparewidth}}{\multirow{3}{0.15\newtblsparewidth}{Rrrrrrr Ooooooo}} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/norestart}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Dd nnn reeeeee aaaaa trr irrrttrytyty iy ctytytyt} \\ \cline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/ytytututututut}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Phfjdjhjd djhfj djhfljlkj kdjhfsd djfskjdh} \\ \cline{2-3}          \multicolumn{1}{|l}{} &      \multicolumn{1}{|m{0.4\newtblsparewidth}}{\textbf{/fjhkjhkdhkjh}} &      \multicolumn{1}{|m{0.45\newtblsparewidth}|}{Asjdjjh dkshkjdhfks sjdhfkjdh the jhghgdfhghjf} \\ \hline     \end{tabularx}          \end{document}


title: biblatex verbose style full author list on first use

text: When using the verbose citation style in biblatex, is there a way to have the first occurrence use the full author list and the subsequent abbreviated author lists use et al.? That is, for the first citation maxcitenames is not enforced or set to a large number.


title: Resize large images that exceed page margin whilst respecting existing scale

text: The solution posted here Scale (resize) large images (graphics) that exceed page margins works great. Just to summarise, Dave Jarvis suggested               \usepackage{graphicx}          % Determine if the image is too wide for the page.     \makeatletter     \def\ScaleIfNeeded{%       \ifdim\Gin@nat@width>\linewidth         \linewidth       \else         \Gin@nat@width       \fi     }     \makeatother          % Resize figures that are too wide for the page.     \let\oldincludegraphics\includegraphics     \renewcommand\includegraphics[2][]{%       \oldincludegraphics[width=\ScaleIfNeeded]{#2}     }      but unfortunately this breaks any scaling you apply in Lyx to an image. e.g. I have an image resized as so               \includegraphics[scale=0.5]{nicecats}      My scaling of 0.5 gets removed by the macro suggested in the solution above. I'm wondering if there is a way to have the macro apply any user specified scaling first and then check the width? Or perhaps check for any pre-specified scaling and if it exists do not resize. Many thanks.


title: Redefining \verb to be \url

text: How can I redefine `\verb!!` to translate into `\url{}`? I have to do this to fool Emacs highlighting so it thinks I have `\verb`, in the background I like `\url{}` wrapping capability.


title: Shifting the subcaption in subfigure

text: I have a subfigure in which I want to shift one of the figures to the left, but when I shift it the caption is in its place. what should I do? Here is what I have in latex:               \begin{figure*}[ht]     \hspace{-4cm}     \subfigure[1]{     \includegraphics[scale=1]{1.eps}     \label{fig:1}     }     \\     \subfigure[2]{     \hspace{-4cm}     \includegraphics[scale=1]{2.eps}     \label{fig:2}     }     \label{fig:fig}     \caption[fig:fig]{caption}     \end{figure*}      The problem is with figure 2


title: Hyperlinking theorems in smfart

text: **Edit:** The class `smfart` is one of several classes created by the Société Mathématique de France for typesetting mathematics. Here is its CTAN page, where it lies under `smflatex`, and here is the documentation. Briefly put, **the class`smfart`, when combined with `hyperref`, does not properly link to the theorem environment**. Here is a minimal working example:               \documentclass[english]{smfart}     \usepackage[francais,english]{babel}     \usepackage{smfthm}     \usepackage{hyperref}          \begin{document}     \mainmatter          \begin{theo}\label{thetheorem}     d     \end{theo}          Consider \ref{thetheorem}          \end{document}      I compile by running `pdflatex` on the file twice. The second time, you get the following error message:               pdfTeX warning (dest): name{smfthm.0.1} ha     s been referenced but does not exist, replaced by a fixed one      It is not difficult to check that the hyperlink which _should_ link to the theorem actually links to the very beginning of the document. What is going on here? Is there a known way to fix this?


title: Drawing ellipses with pict2e or the like

text: \usepackage{pict2e}          \usepackage{pstricks-add}          \usepackage{pst-node,pst-plot}          \psset{plotpoints=9,unit=3}      Somehow, acting on various people's advice, I've put the above lines of code above my `\begin{document}` line, and I'm not sure what the difference is between the contents of the three packages nor what that last command does but I've been able to draw some simple diagrams that I needed, involving lines and dots and circles and text at certain places. Now I'd like to draw an ellipse. I can specify the endpoints of the major and minor axes, and those are horizontal and vertical rather than at some odd angle, and I can also specify four points in a symmetrical pattern on the curve. Can that be done?


title: What is the '}{' character that appears in LyX modern CV example and how to re-produce it?

text: I'm using LyX 2.0.6 with MikTex 2.9 I came across these `}{` characters while trying to use the Modern CV example to create a CV. My question is: What are these and how can I insert one. I've noticed that the language tag must have two of these (i.e., `}{` `}{` ), computer tag must have three and the normal entry must have 5. Also document wouldn't render if one was missing from a certain tag. Note: currently I'm copying and pasting from other places in the document. Any help is highly appreciated. Many thanks in advance,


title: dcolumn with brackets

text: I am using dcolumn to align cells to the decimal point. But in case of brackets, I always got overfull errors in my main document. If I replicate a MWE with the full preamble, there are no more overfull errors anymore (TexStudio), but the problem is still visible with `\overfullrule=1mm` My question is the following: Which is the best way to achieve alignment to the decimal point if values in brackets are included? Ideally, the vertical space between the columns would be even, as in the first example, but without the overfull space. MWE:               \documentclass[a4paper, 12pt, headsepline, headings=small,]{scrreprt}     \overfullrule=1mm     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{amsmath, amssymb, mathtools}     \usepackage{mathptmx}     \usepackage[a4paper,showframe]{geometry}     \geometry{left=2cm,right=5cm,top=2cm,bottom=2cm}     \usepackage{booktabs}          \usepackage{dcolumn}     \newcolumntype{N}{D..{2.2}}      \newcolumntype{Z}{D..{1.2}}           \begin{document}               \begin{table}[t]     \caption{caption x}     %\setlength{\tabcolsep}{-1.5pt} % general space between cols (6pt standard)     \begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}ZNNNNN}     \toprule      & \multicolumn{1}{r}{Const term} & \multicolumn{1}{c}{$xcvb^e$} &      \multicolumn{1}{c}{$xcvb$} & \multicolumn{1}{c}{$xcvb$} & \multicolumn{1}{c}{$xcvb$} &      \multicolumn{1}{c}{$xcvb$ add a} \\     \midrule      \multicolumn{1}{l}{$xcvb^e$} & 4.12 & 4.12 & 4.12 & -8.97 & -8.97 & -12.98 \\     & (3.54) & (1.95) & (0.64) & (-0.73) & (-1.57) & \\[6pt]     \multicolumn{1}{l}{$xcvb$} & 0.02 & -0.27 & 0.88 & -0.04 & 0.13 & -12.98 \\     & (3.35) & (-0.12) & (-0.12) & (-0.12) & (-0.12) & \\[6pt]     \multicolumn{1}{l}{$xcvb$} & 0.03 & 0.46 & -0.00 & 0.99 & -0.00 & -12.98 \\     & (1.35) & (22.38) & (22.38) & (22.38) & (22.38) & \\[6pt]     \multicolumn{1}{l}{$xcvb$} & 0.07 & -0.03 & -0.00 & 0.01 & 0.93 & -12.98 \\     & (2.63) & (-0.55) & (41.45) & (88.34) & (88.88) & \\     \bottomrule     \end{tabular*}     \end{table}                    \end{document}      Thanks.


title: How to draw shape as 'curved arrows' with text (with tikz)

text: I would like to draw the figure below with Tikz. My research on the web to draw a curved arrow with text yielded nothing. ![Image with curved arrows](http://i.stack.imgur.com/5PHYy.png) On the other hand, I wonder how to direct the arrow to the left with the text not upside down.               \documentclass[tikz]{standalone}     \usetikzlibrary{arrows}     \usetikzlibrary{calc}     \usetikzlibrary{shapes}     \begin{document}         \begin{tikzpicture}[semithick,x=20mm, y=20mm]                  \node[single arrow, draw,single arrow tip angle=100, align=center] [rotate=0] at (0,0) {Test \\ test test};             \node[single arrow, draw,single arrow tip angle=100, align=center] [rotate=180] at (1,0) {Test \\ test test};              \end{tikzpicture}       \end{document}      Who can help me 1\. Draw shape "curved arrows" 2\. orient these arrows correctly


title: How to write multiple lines as watermark?... and images with transparency?

text: I want to write 2 or 3 lines in watermark               \usepackage{draftwatermark}     \SetWatermarkText{Mika Ike}     \SetWatermarkScale{0.25}     \SetWatermarkColor[gray]{0.88}      How can I write "Mika Ike" and under this line "mikaike@mikaike.mikaike" and a third lined with "At My house" ? Is it possible? And... to use a image but with a hight level os transparency to see that image softly at background.               \usepackage{draftwatermark}     \SetWatermarkText{\includegraphics{fig1.jpg}}     \SetWatermarkScale{0.25}     \SetWatermarkColor[gray]{0.88}      Do you think this is the best package for watermarks? or do you know other better than this?. Could you tell me about other packages.


title: How can I add "page # of ##" on my document?

text: I want to add a footer to my document displaying the current number out of total number of pages. How do I do that?


title: Double pagenumbering

text: I would the page x of x in the right side (foot) of each page. I have the following code:               \documentclass[a4paper]{article} %sætter dansk standard, a4 papir.     \usepackage{fancyhdr}     \pagestyle{fancy}     \lhead{Some name}     \rhead{Some title}     \usepackage{lastpage}     \rfoot{\thepage\ af \pageref{LastPage} }          \begin{document}     \title{A title}     \date{Some date}     \author{some name}          \maketitle          \newpage           hello world          \end{document}      I would like page X of Y on everypage (also title page). But when i compile the above it adds a pagenumber in the middel of the foot (as pr. standard article), but it also puts the page X of y in the right side. How can i fix this?


title: How can I get no header but still get "page x of y" in footer?

text: I'd like to get "page x of y" in a footer on each page, and the way I've found is to use:               \usepackage{fancyhdr}     \usepackage{lastpage}     \pagestyle{fancy}     \cfoot{Page \thepage\ of \pageref{LastPage}}      This works but has introduced a solid line at the top of each page and some headers. How do I get "page x of y" without any headers at all?


title: page numbers should be of the form 4/7

text: > **Possible Duplicate:**   >  How can I add "page # of ##" on my document? While submitting Test paper in LaTeX, I was asked to display page numbers as current page number out of total page numbers. I am using article class. For example it should look like: 1 out of 4, 2 out of 4, 3 out of 4 etc. or 1/4,2/4 etc. How to obtain it?


title: how do I add page numbes to a latex document

text: > **Possible Duplicate:**   >  How can I add "page # of ##" on my document?   >  How can I get no header but still get "page x of y" in footer? how do I add page numbers to a latex document? I want "Page x of n" format. I want a simple want to do this.


title: Double vertical bar notation

text: A common notation used for information divergence is `D(P||Q)`. I hope to get something like `D(S||Q)` where `S=||P||/2`. I wonder if it is possible to display it nicely ? In such a way that the middle double bar has the right height. I tried               $D \left( \frac{\|P\|}{2} \right| \left| Q \right)$      The above do not work as the middle bar are not of the same vertical height but its closest to what I hope to achieved. Using just `\|` instead of `\right| \left|` for the middle double bar results in a short middle double bar. Does anyone has a good idea on how to achieve that. Thanks Else, I could just create a new notation. * * * \-- Update -- I managed to find out how to do it with this useful operator `\middle`               $D \left( \frac{\|P\|}{2} \middle\| Q \right)$      Hope someone else may find this useful.


title: Defining Commands With Multiple Meaning

text: I have defined a new command in my source code:               \newcommand{\IN}{interface}      which prints out _interface_ , but there are times where I would like it to print _Interface_ (with a capital I) or _interfaces_ instead, how can I do this without defining 2 more new commands?


title: Listing package showing newline after the last line of code

text: I haven't been able to suppress this newline only with configuration. In the `listings` documentation it is said that the `showlines` option if set to `false` won't let the newline appears, but that is not working for me. How to make it work? ![enter image description here](http://i.stack.imgur.com/iaUuc.png) I can make it work by inserting latex comments inside the listing, but that is kind of annoying, specially if there is a option in the package to do it. **Update:** Minimum working example as requested:               \documentclass[10pt,a4paper]{book}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage{listings}     \usepackage{color}            % "listing" definitions ========================================     \definecolor{mygreen}{rgb}{0,0.6,0}     \definecolor{mygray}{rgb}{0.95,0.95,0.95}     \definecolor{mymauve}{rgb}{0.58,0,0.82}     \definecolor{pink}{rgb}{0.8, 0.55, 0.6}          \lstset{ %       backgroundcolor=\color{mygray},   % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}       basicstyle=\footnotesize,        % the size of the fonts that are used for the code       breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace       breaklines=true,                 % sets automatic line breaking       captionpos=b,                    % sets the caption-position to bottom       commentstyle=\color{mygray},       % comment style       deletekeywords={...},            % if you want to delete keywords from the given language       escapeinside={\%*}{*)},          % if you want to add LaTeX within your code       extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8       frame=single,                    % adds a frame around the code       keepspaces=true,                 % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)       keywordstyle=\color{blue}\bfseries,       % keyword style       language=Python,                 % the language of the code       morekeywords={*,...},            % if you want to add more keywords to the set       numbers=left,                    % where to put the line-numbers; possible values are (none, left, right)       numbersep=5pt,                   % how far the line-numbers are from the code       numberstyle=\color{black}, % the style that is used for the line-numbers       rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))       showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'       showlines=false,       showstringspaces=false,          % underline spaces within strings only       showtabs=false,                  % show tabs within strings adding particular underscores       stepnumber=1,                    % the step between two line-numbers. If it's 1, each line will be numbered       stringstyle=\color{mymauve},     % string literal style       tabsize=2,                       % sets default tabsize to 2 spaces       basicstyle=\footnotesize\ttfamily,       title=\lstname                   % show the filename of files included with \lstinputlisting; also try caption instead of title     }          \begin{document}            \begin{lstlisting}     {         "name": "create menu"     }       \end{lstlisting}          \end{document}


title: Why \ifnum\c@mpfootnote does not work inside tabular?

text: Why `\ifnum\c@mpfootnote` does not work inside tabular? Should not I get no footnote-rule? I am just puzzled!               \documentclass{article}     \begin{document}     \makeatletter     \long\def\@mpfootnotetext#1{%      \ifnum\c@mpfootnote=\@ne\let\footnoterule\relax\fi       \global\setbox\@mpfootins\vbox{%         \unvbox\@mpfootins         \reset@font\footnotesize         \hsize\columnwidth         \@parboxrestore         \protected@edef\@currentlabel              {\csname p@mpfootnote\endcsname\@thefnmark}%         \color@begingroup           \@makefntext{%             \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%         \color@endgroup}}     \makeatother     \noindent     \begin{minipage}{\textwidth}     \begin{tabular}{lp{.8\textwidth}}     1&2\footnote{1}\\     1&2\footnote{2}     \end{tabular}     \end{minipage}     \end{document}      A more simplified example:               \documentclass{article}     \begin{document}     \makeatletter     \long\def\@mpfootnotetext#1{%      \ifnum\c@mpfootnote=\@ne\let\footnoterule\relax\fi       \global\setbox\@mpfootins\vbox{%         \unvbox\@mpfootins         \reset@font\footnotesize         \hsize\columnwidth         \@parboxrestore         \protected@edef\@currentlabel              {\csname p@mpfootnote\endcsname\@thefnmark}%         \color@begingroup           \@makefntext{%             \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%         \color@endgroup}}     \makeatother     \noindent     \begin{minipage}{\textwidth}     \hbox{\footnote{1}}     \end{minipage}     \end{document}


title: charter font with mathastext and upright txgreeks

text: I would like charter font with upright math, both on greek and latin symbols. are txgreek upright and mathdesign-charter mutually incompatible? or is mathdesign's functionality voided by upright txgreeks?               \documentclass[12pt]{article}          \usepackage{lmodern}     \usepackage{charter} %% the main font, scaleable     %% not compatible?: \usepackage[charter]{mathdesign}     \usepackage{mathastext}     \usepackage[upright]{txgreeks}          \begin{document}          P G and L: $ P(G,L) = G\cdot\frac{1-\beta^L}{\beta^G - \beta^L} $          \end{document}      advice, as always, appreciated.


title: How can I cite three papers of different years, by one author? e.g. Smith(1990, 1995, 2001)

text: I'm pretty new to LaTeX and BibTeX so I apologise in advance if I'm missing information or this seems like it should be simple! I have three papers by one author which I would like to cite in the text such as " > as specified by Smith (1990, 1995, 2001) but have as three separate references in the bibliography. Is there a way to do this? I am using the `ametsoc` bibliography style at the moment, and can't seem to find a solution other than citing it as `[Smith(1990), Smith(1995, Smith(2001)]`.


title: Less whitespace and no indent at the same time using enumerate

text: I would like to ask the following: I would like to use the theorem environment in my latex code. I also have some definitions and examples and I would like to let these environments look the same. Therefore, I produced the code below. My problem is now, that I would like to display examples without indent, but when I do it as I did in the code below, I get a huge vertical whitespace between the word "Examples" and the first example. > > Is it possible to avoid the whitespace and at the same time to have no > indent? Thanks for the help!               \documentclass[a4paper]{scrartcl}     \usepackage[english]{babel}     \usepackage[latin1]{inputenc}     \usepackage{amsmath}     \usepackage{amsthm}     \usepackage{paralist}     \newtheoremstyle{dotless}{}{}{}{}{\bfseries}{}{\newline}{}     \theoremstyle{dotless}     \newtheorem{Definition}{Definition}     \newtheorem*{Examples*}{Examples}          \begin{document}          \begin{Definition}     Here comes a definition.     \end{Definition}          \begin{Examples*}     \     \begin{enumerate}[1)]       \item First example.       \item Second example.       \item Third example.     \end{enumerate}     \end{Examples*}          \end{document}      ![screenshot](http://i.stack.imgur.com/38zzb.png)


title: apalike bibliography style refer to with numbers

text: I am using the apalike bibliography style, since I want my references presented like [Fanty et al., 1993] to an article, and [Abut, 1990] to a book. It was working well in the beginning, but have suddently changed to numbers. How to change it back to the original style of apalike?


I would like to define a math operator `Homöo`, but when I try               \DeclareMathOperator{\Homoo}{Homöo}     \DeclareMathOperator{\Homoo}{Hom\"oo}      I get `Homo`. **How can I use German umlauts in DeclareMathOperator?** (If it's not possible at all: What should I do instead?)


title: Is there a more recent bibliography style file (.bst) for PNAS?

text: As per the PNAS author guidelines: > References should be cited in numerical order as they appear in text. > Because tables and figures will be inserted in the text where first cited, > references in these sections should be numbered accordingly. Include the > full title for each cited article. All authors (unless there are more than > five) should be named in the citation. If there are more than five, list the > first author's name followed by et al. Provide volume and issue numbers for > journal articles as applicable; provide DOI numbers if volume/issue numbers > are not available. Provide inclusive page ranges for journal articles and > book chapters. Provide date of access for online sources. Cite databases in > the text or as footnotes. > > Journal articles are cited as follows: > >   1. Neuhaus J-M, Sitcher L, Meins F, Jr, Boller T (1991) A short C-terminal > sequence is necessary and sufficient for the targeting of chitinases to the > plant vacuole. Proc Natl Acad Sci USA 88(22):10362-10366. > Because the journal only accepts `.bbl` files embedded within the main `.tex` file, they do not provide a bibliography style. But their bibliography style has changed over the years (use of colon to separate number/volume and page numbers, volume number not in bold etc.), and there doesn't seem to be any up- to-date bibliography style. Google led me to this and this packages (first one was obsoleted by the second one), but they do not match the PNAS bibliography style. Obviously, this is not the end of the world as I could fix the `.bbl` file manually, but I was wondering whether there is a more recent version. `bibtex` or `biblatex` solutions are both okay, as the `.bbl` will be added in the main `.tex` file anyway (correct me if I'm wrong on this one please). Worst-case scenario, how much work would be required to modify the bibliography styles, given that I have never done any work on bibliography styles?


title: Can cleveref be made to use the Oxford comma for multiple citations?

text: Simple question: Is there a simple way to get `cleveref` to use the Oxford comma?               \documentclass{article}     \usepackage[standard]{ntheorem}     \usepackage{cleveref}          \begin{document}          \begin{proposition}\label{thm:roses}       Roses are red.     \end{proposition}          \begin{proposition}\label{thm:violets}       Violets are blue.     \end{proposition}          \begin{proposition}       42.     \end{proposition}          \begin{proposition} \label{thm:orchids}       Orchids are orchid.     \end{proposition}          \begin{theorem}       There exist flowers in at least three different colors.     \end{theorem}     \begin{proof}       Immediate from \cref{thm:roses,thm:violets,thm:orchids}.     \end{proof}          \end{document}      ![Output](http://i.stack.imgur.com/TVzgu.png) Should say “propositions 1, 2, and 4.”


title: How to change format of Appendix page name?

text: This is a followup question to How to add cover pages to appendices? . This screenshot shows the school requirements. ![enter image description here](http://i.stack.imgur.com/WZbpN.png) This minimal example comes from Ruben's solution to the previous problem:               \documentclass[12pt,letterpaper,oneside]{book}     \usepackage[toc,page]{appendix}     \usepackage{lipsum}          \makeatletter     \def\@makeappendixhead#1{%     \null\vfill%     {\parindent \z@ \centering \normalfont         \ifnum \c@secnumdepth >\m@ne           \if@mainmatter             \MakeUppercase \@chapapp\space \thechapter             \par\nobreak             \vskip 20\p@           \fi         \fi         \interlinepenalty\@M         #1\par\nobreak         \vfill         \clearpage       }}     \g@addto@macro\appendices{\let\@makechapterhead\@makeappendixhead}     \makeatother          \begin{document}     \tableofcontents     \chapter{No Appendix}     \lipsum     \begin{appendices}     \chapter{One}     \lipsum     \end{appendices}     \end{document}       From Ruben's solution, the only thing missing is that the main APPENDICES heading (page 29 in screenshot) should be Uppercase and in normal size font (instead of huge and bold, as it is right now.) What I understand so far: The appendix package manual, page 7, shows this bit of code that seems to be formatting appendixpagename ,               \newcommand{\@chap@pppage}{%     \clear@ppage     \thispagestyle{plain}%     \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi     \null\vfil     \markboth{}{}%     {\centering     \interlinepenalty \@M     \normalfont     \Huge \bfseries \appendixpagename\par}%      This last line seems to do the formatting. It would seem that deleting the `\Huge` `\bfseries` and adding `\MakeUpperCase` should do it, but how do I wrap the code to add it to the tex document? Or perhaps this whole approach is wrong. Please advise!


title: Centering individual cells in booktabs

text: I would like to centre only the numbers in the following table. I have attempted some variations of the centering command, but they affect the entire table (I'm relatively new to Latex). ![enter image description here](http://i.stack.imgur.com/VEzuL.png) MWE:               \documentclass{article}     \usepackage{booktabs, threeparttable}     \usepackage{array}     \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}     \begin{document}     \begin{table}[htbp]     \begin{threeparttable}     \caption{Number of Credits per Course by Year}     \label{table:nc}     \begin{tabular}{@{}p{0.18\textwidth}*{6}{L{\dimexpr0.15\textwidth-2\tabcolsep\relax}}@{}}     \toprule     & \multicolumn{2}{c}{\bfseries Commerce Faculty} &     \multicolumn{2}{c}{\bfseries EBE Faculty} &     \multicolumn{2}{c}{\bfseries Science Faculty} \\     \cmidrule(l){2-3} \cmidrule(l){4-5}  \cmidrule(l){6-7}     & F, S, H Courses & W Courses & F, S, H Courses  & W Courses & F, S, H Courses & W  Courses   \\     \midrule     First-year & 18 & 36 & Variable & Variable & 18 & 36  \\     Second-year & 18 & 36 & Variable & Variable & 24 & 48 \\     Third-year & 18 & 36 & Variable & Variable & 36 & 72 \\     \bottomrule     \end{tabular}     \end{threeparttable}     \end{table}     \end{document}


title: Error while producing a boxplot with tikz

text: I was trying to reproduce an example saw in the manual of PGFPLOTS v1.9:               \documentclass[11pt,a4paper,twoside,openright]{report}          \usepackage{tikz}     \usepackage{algorithm}     \usepackage{algorithmic}     \usepackage[T1]{fontenc}      \usepackage[utf8]{inputenc}     \usepackage{color}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{array}      \usepackage{verbatim}     \usepackage{caption}     \usepackage{epstopdf}          \usepackage{caption}     \usepackage{subcaption}     \usepackage{tcolorbox}          \usepackage{pgfplots}          \pgfplotsset{compat=1.9}          \begin{document}      \begin{tikzpicture}     \begin{axis}[y=1cm]     \addplot+[     boxplot prepared={     lower whisker=42, lower quartile=45,     median=47,     upper quartile=47.5, upper whisker=48,     draw relative anchor=0.5, }, ]     table[row sep=\\,y index=0] { 40\\ 34\\ 56\\ };     \end{axis}     \end{tikzpicture}     \end{document}      However I'm getting the following error:               Package pgfkeys Error: I do not know the key '/tikz/boxplot prepared'       I updated texlive today and my log says               Package: tikz 2010/10/13 v2.10      Is the code too old for my version?


title: Do something on every second page

text: Does there exist a way to only print the main text in the document on every _second_ page while running some other code on the other pages? What I want is something that runs like in the below example:               \documentclass{memoir}     \usepackage{lipsum}          \begin{document}     \begin{atevenpages}       The content of this environment is supposed to be printed on even-numbered pages. On the other hand, even-numbered pages are supposed to contain none of the main text.     \end{atevenpages}          This is the main text, which is only to appear on odd-numbered pages.     \lipsum[1-22]     \end{document}


title: Updating words throughout document

text: In my job we deliver several of hundred physical assemblies per project - typically to offshore platforms in Nordsjøen - each one has a corresponding tag (and also other metadata such as item description and serial number). A typical tag for an assembly may be "42MV43523" and is unique and considered to be the "adress" of the equipment on an offshore platform. However, when writing all necessary technical documentation for the project, I often end up with hundreds of pages where I need tag references (with the full tag, not a (1) referring to some list). Although documents often are formatted the same, I need to   1. Put these tags into free text in several places (always the same places)   2. Put these tags into tables where descriptions comes on the same line, e.g.  |42Mv43523|Supplier name|Item Description| |42Mv43558|Supplier name|Item Description| (...) The problem is that updating these documents throughout becomes a heavy ad hoc job which takes up a lot of my time (between 10 - 20 hours a week). Also, quite often I need to send these documents in for temporary approval without the tag being decided which makes it even worse. What I am hoping for is to create one or two master documents where I can write the tags and corresponding metadata for each project, and where the tags and metadata can be updated throughout the document both in tables and in free text (for free text, metadata is not necessary). Hope this is sufficient information. This is a substantial problem for our company, and many others in the Norwegian oil industry.


title: Space after command with \write

text: I did not see this question yet, correct me if there is. It's not the usual problem of adding a space after a command. It's more specifically when writing to a file. For some reason the same method does not apply when using the `\write` command. **Minimal working example:**               \documentclass{article}          \newcommand\Insert{Insert}          \begin{document}          % write to pdf     \Insert stuff.\par % wrong method     \Insert\ stuff.\par   %     \Insert{} stuff.\par  % all valid methods     \Insert~stuff.\par    %          % open file to write to     \immediate\newwrite\file     \immediate\openout\file=filename.txt     \newcommand\writefile{\immediate\write\file}          % write the same to file     \writefile{\Insert stuff.}     \writefile{\Insert\ stuff.}     \writefile{\Insert{} stuff.}     \writefile{\Insert~stuff.}          % close file     \immediate\closeout\file               \end{document}      **Output pdf:** > Insertstuff.   >  Insert stuff.   >  Insert stuff.   >  Insert stuff. **Output filename.txt**               Insertstuff.     Insert\ stuff.     Insert{} stuff.     Insert\protect \unhbox \voidb@x \penalty \@M \ {}stuff.      Which is not quite what I need or expected.


title: How do I make an inline list respect margins without hyphenation?

text: I'm using the `enumitem` package to create inline lists in my resume. I currently have a snippet of code that looks like               \begin{description}         \item[Frameworks/Libraries:]         \begin{enumerate*}[itemjoin={{,}},label=]             \item Flask             \item Node.js             \item Google Chrome Extensions             \item jQuery             \item Swing/AWT             \item JUnit             \item iOS             \item Android             \item ScalaTest             \item pygame         \end{enumerate*}     \end{description}      However, this code will break the margin within JUnit, hyphenating it as "J-Unit." I don't want any words in my resume to be hyphenated, so I put `\usepackage[none]{hyphenat}` at the top, but then that makes my list run into the margin instead of continuing on the next line. Adding `\raggedright` makes the lines far too uneven to be presentable. How can I both ensure that my inline list respects the margins and doesn't hypenate? I would like the last list items that don't fit to be added to the next line.


title: Changing titles of chapters and parts from onehalfspaced to single spaced

text: Is there a simple solution for making the titlename of parts and chapters singlespaced but the text onehalfspaced without having to add `\SingleSpace` to every titlename. I have found a solution that works adequately for sections which is:               \renewcommand\secheadstyle{\setSpacing{0.95}\Large\bfseries\memRTLraggedright}      I need it not to overule any costumization with the ToC, the header etc. It should only impact the way titles of parts and sections asre displayed on the page, not in the ToC or in headers or anywhere else. Minimal functional doc:               \documentclass[12pt,a4paper,onecolumn,twoside,final]{memoir}     \usepackage[english]{babel}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage{newcent}     \usepackage[utf8x]{inputenc}     \usepackage[textwidth=14cm,textheight=22cm]{geometry}           \chapterstyle{hangnum}     \OnehalfSpacing          \begin{document}          \chapter{A Long title of the chapter, that breaks the line and should be single  spaced instead of onehalfspaced}     Text that is onehalfspaced just like it should be. Nothing like a piece of text that is like it should be. Text that is onehalfspaced just like it should be. Nothing like a piece of text that is like it should be. Text that is onehalfspaced just like it should be. Nothing like a piece of text that is like it should be.     \section{A Long section title of the chapter, with the same problem as the title}          \end{document}


title: Tips for using the different packages in a good way

text: This is not a specific question, but the answer will help all those who are new users of LaTex (like me). I would appreciate the guidelines/expert opinion from expert users concerning the order in which packages should be included to avoid errors. Does the order matter or not?


title: \settolength issue

text: I want a horizontal length to have the same length as the word "physique". This is what I have tried:               \documentclass{article}          \usepackage[latin1]{inputenc}      \usepackage[T1]{fontenc}      \usepackage[francais]{babel}          \newlength{\longueurperso}     \setlength{\longueurperso}{30pt}          \newlength{\motphysique}     \settolength{\motphysique}{physique}          \begin{document}     Bonjour!           Voici un espace horizontal de \hspace{\longueurperso} 30 points.           La \hspace{\motphysique} est une science pure.     \end{document}      When I compile, here is what I get: ![enter image description here](http://i.stack.imgur.com/z6MtT.png) What's wrong? I tried to put the lines               \newlength{\motphysique}     \settolength{\motphysique}{physique}      after the `\begin{document}` and it's not working better.


title: Wrong A4 measurements?

text: I noticed that the paper size invoked by `a4paper` is not working right in my examples:               \documentclass[a4paper,11pt,oneside]{article}     \begin{document}     Test     \end{document}      I checked with Preview.app and it tells me the paper size is 21.59 cm × 27.94 cm. A4 should be 21.0 cm × 29.7 cm. When I use `\usepackage[a4paper]{geometry}` I notice a different size of the paper (it gets narrower) and Preview.app says: 21.01 cm × 29.71 cm, which seems right.   I can reproduce this exact behavior with every class: `article`, `book` etc., `scrartcl`, `scrreprt`, etc., `g-brief2` except `memoir` which gives me 21.01 cm x 29.71 cm Is there something wrong or am I missing something?


title: How I change the text width in the "Frontmatter" part?

text: I am using Elsevier document class (`elsart`) but I changed the page margins and also text width, but the text in "frontmatter" part remained unchanged. How can I change the margin or text width in that part? My code:               \documentclass{elsart}          %for changing the margins and text wiidth     \oddsidemargin = 0cm     \topmargin = 0cm     \textheight = 25cm     \textwidth = 16cm          \begin{document}     \begin{frontmatter}            \title{}            \begin{abstract}       ....       \end{abstract}            \begin{keyword}       ....       \end{keyword}          \end{frontmatter}          \section{}          \end{document}      I want to edit the Abstract, Key words and Title "frontmatter" part.


title: enumerate environment and graphics

text: If I have an item in an `enumerate` environment, which only contains a figure (or table etc), the bullet point of the enumerations alignment goes weird. For example:               \begin{enumerate}[(a)]     \item         Dummy item     \item     \begin{enumerate}[(i)]         \item             \begin{center}                 \begin{tabular}{ |  p{4.5cm}  | c | c |}                     \hline                     Col & More col & Even more col  \\                      \hline                     one & two & three  \\                     \hline                      \end{tabular}             \end{center}     \end{enumerate}     \end{enumerate}      Makes the bullet points misalign, ie. (b)(i) and (a) are not aligned. If I add some text before the figure, it goes back to normal. For example,               \begin{enumerate}[(a)]     \item         Dummy item     \item     \begin{enumerate}[(i)]         \item              Dummy text to make it align nicely.             \begin{center}                 \begin{tabular}{ |  p{4.5cm}  | c | c |}                     \hline                     Col & More col & Even more col  \\                      \hline                     one & two & three  \\                     \hline                      \end{tabular}             \end{center}     \end{enumerate}     \end{enumerate}      So, is there any way of adding a line of "invisible" text or something along those lines to fix this layout issue?


title: How do I color just labels for specific components in the tikz circuits library?

text: I follow a convention in which I make voltages blue and currents red. Making the current direction red is pretty simple. I just add "color=red" to the options for the specific current direction. But what about the text? The PGF manual suggests changing the style, like so:               \begin{tikzpicture}[circuit ee IEC,every info/.style=red]     \node [resistor,info=$3\Omega$] {};     \end{tikzpicture}      The trouble with this is that it makes ALL the info labels red. I just want the current direction labels to be red. Here is my minimal working example:               \documentclass{standalone}          \usepackage{amsmath}          \usepackage{tikz}     \usetikzlibrary{arrows,circuits.ee.IEC,positioning}          \begin{document}          \begin{tikzpicture}[circuit ee IEC,x=2cm,y=1.5cm,     small circuit symbols,     set inductor graphic=var inductor IEC graphic,     set diode graphic=var diode IEC graphic]          \foreach \contact/\x in {0/0,2/3}     {     \node [contact] (upper contact \contact) at (\x,4) {};     }     \node [coordinate] (upper right limit) at (6,4) {};     \node [coordinate] (lower right limit) at (6,0) {};          \draw (upper contact 0) to[current direction={near start,color=red,text=red,info=$\text{I}_2$},resistor={info={$\text{R}_1$}}] (upper contact 2);          \end{tikzpicture}          \end{document}      I tried adding "text=red", after I saw it in this example, but that does not work.


title: Need help with enumerated list with display math

text: I have an enumerated list from a Proposition and would like to put this into display math style (so the subscripts on the union and intersection symbols are below not beside those symbols) and keep the numbering to the left. Here is what I currently have:               \documentclass[12pt,a4paper,oneside]{report}     \usepackage[left=2.00cm,right=2.00cm,top=2.45cm,bottom=2.5cm]{geometry}     \usepackage{amsmath,amssymb,amscd,amstext}     \usepackage{color,epsfig,fancyhdr,fleqn,latexsym,multicols,slashed}     \usepackage[thmmarks]{ntheorem}     \usepackage{tikz, subfigure}     \usepackage{verbatim}          \theoremstyle{marginbreak}     \theoremheaderfont{\normalfont\bfseries}\theorembodyfont{\slshape}     \theoremsymbol{\ensuremath{\diamondsuit}}     \theoremseparator{:}     \newtheorem{Proposition}{Proposition}          \begin{document}     \begin{Proposition}     Let $\mathcal{A} \eqdef \{A_{\alpha}|\alpha \in \Delta\}$ be an indexed family of sets. Then     \begin{enumerate}     \item $\bigcap_{\alpha \in \Delta} \, A_\alpha \subseteq A_{\beta}$ for each $\beta \in \Delta.$     \item $A_\beta \subseteq \bigcup_{\alpha \in  \Delta} \, A_{\alpha}$ for each $\beta \in \Delta.$     \end{enumerate}     \end{Proposition}     \end{document}      Thanks.


title: 3-dimensional histogram in pgfplots

text: I have a simple 3d histogram ![enter image description here](http://i.stack.imgur.com/91xGl.png) which I want to import into pgfplots, e.g. using matlab2tikz or by hand. PGFplots does not offer 3d histograms. Is there an easy way to do this?


title: drawing UML class diagram does not work proper with tikz-uml /pgfsetlayers

text: i'm stuck and have no glue whats the problem. I'd like to draw a UML class diagram with tkz-uml package. Sadly my result is not how it should be. I try to get the example running, using following code:               \documentclass[12pt,a4paper,article,oneside]{memoir}          %% Package     \usepackage[utf8]{inputenc}      \usepackage[backend=biber,bibencoding=utf8,sorting=nyt,language=ngerman, style=alphabetic]{biblatex}     \usepackage[breaklinks=true]{hyperref}     \usepackage[german]{babel}     \usepackage{tikz}     \usepackage{tikzscale}     \usepackage{tikz-uml}     \usepackage{graphicx}     \usepackage{subfloat}     \usepackage{eurosym}     \usepackage{bbding}     \usepackage{listings}      \usepackage{epstopdf}     \usepackage{pgfgantt}     \usepackage{wrapfig}     \usepackage{mathtools}     \usepackage{amsmath}               %% TiKz Stuff %%%     \usetikzlibrary{calc, decorations.pathmorphing,decorations.pathreplacing, fadings, shadings, shapes, arrows, positioning,patterns,automata}     \pgfdeclarelayer{background}     \pgfdeclarelayer{foreground}     \pgfsetlayers{background,main,foreground}               \begin{document}          \begin{tikzpicture}          \begin{umlpackage}{p}     \begin{umlpackage}{sp1}     \umlclass[template=T]{A}{n : uint \\ t : float}{}     \umlclass[y=-3]{B}{  d : double}{  \umlvirt{setB(b : B) : void} \\ getB() : B}     \end{umlpackage}     \begin{umlpackage}[x=10,y=-6]{sp2}     \umlinterface{C}{  n : uint \\ s : string}{}     \end{umlpackage}     \umlclass[x=2,y=-10]{D}{  n : uint  }{}     \end{umlpackage}          \umlassoc[geometry=-|-, arg1=tata, mult1=*, pos1=0.3, arg2=toto, mult2=1, pos2=2.9, align2=left]{C}{B}     \umlunicompo[geometry=-|, arg=titi, mult=*, pos=1.7, stereo=vector]{D}{C}     \umlimport[geometry=|-, anchors=90 and 50, name=import]{sp2}{sp1}     \umlaggreg[arg=tutu, mult=1, pos=0.8, angle1=30, angle2=60, loopsize=2cm]{D}{D}     \umlinherit[geometry=-|]{D}{B}     \umlnote[x=2.5,y=-6, width=3cm]{B}{Kommentar zu classe B}     \umlnote[x=7.5,y=-2]{import-2}{blubber die blub}          \end{tikzpicture}          \end{document}      The output looks like this: ![LaTex output](http://i.stack.imgur.com/m5h7S.png) But it should look similar to this example: ![enter image description here](http://i.stack.imgur.com/iwK9T.png) Somebody a constructive idea? Thanks!


title: A question on cross-reference

text: Suppose I have several sections in my document. How may I cross-reference to a section so that it is updated if I make more sections?


title: How can I make the caption of each sub figure like

text: I have 6 figures, two classes, and want them to be arranged as               Figure 1-C1    Figure 2-C2          (a)               (c)          Figure 3-C1    Figure 4-C2          (b)               (d)          Figure 5-C1    Figure 6-C2          (c)               (e)      Well, I just want to put each class of figures in one column and the caption of them is one followed by another. Not to number them in a horizontal direction.               \documentclass[12pt, a4paper,twoside]{memoir}         \usepackage{graphicx}     \usepackage{float}            % added on 19112013     \usepackage{colortbl,hhline}  % added on 20112013 for tabular          \begin{document}     \begin{figure}[H]           \centering           \subbottom[QMF 02DB2A]{\includegraphics[width=7cm]{chap3/qmf02db3a.jpg}\label{fig319:a}}    \quad           \subbottom[IQ 02DB2A]{\includegraphics[width=7cm]{chap3/iq02db3a.jpg}\label{fig319:d}}\\                  \subbottom[QMF 04DB1A]{\includegraphics[width=7cm]{chap3/qmf04db1a.jpg}\label{fig319:b}}    \quad           \subbottom[IQ 04DBA]{\includegraphics[width=7cm]{chap3/iq04db1a.jpg}\label{fig319:e}}\\                  \subbottom[QMF 04DB3A]{\includegraphics[width=7cm]{chap3/qmf04db3a.jpg}\label{fig319:c}}    \quad           \subbottom[IQ 04DB3A]{\includegraphics[width=7cm]{chap3/iq04db3a.jpg}\label{fig319:f}}         \caption{Temporary Caption}         \label{fig319}         \end{figure}          \end{document}


title: Font size in moderncv

text: How can I change the title font size (First name, Family Name) in a resume written using `moderncv` package?


title: Replacing Leading Minus Signs in Environment

text: In this question concerning negative signs and the alignment of entries in matrix environments, Heiko Oberdiek gave a great answer in which he uses a user-defined command called `\matminus` instead of the usual `-`. How can I define a matrix environment that will automatically perform this replacement of leading negative signs for me? Thanks for the help! **Edit:** I have adapted the code provided by Heiko Oberdiek and egreg, and created a package that defines a set of alternate matrix environments (spmatrix, sbmatrix, sBmatrix, svmatrix, and sVmatrix). These environments function analogously to their counterparts without the 's', but reduce the length of the minus signs within them to achieve better alignment of the entries within each column. The project is hosted here. Here is a picture that shows the difference between the regular and reduced minus matrix environments: ![enter image description here](http://i.stack.imgur.com/rodFO.png)


title: Difficulties implementing Equations

text: I am trying to write this equations in TeXnic Center, but so far, I am not very successful. The equations I want to write are here: http://www.mathworks.com/help/vision/ref/vision.opticalflow-class.html \- Horn&Schunk method.               The Horn-Schunk method, by assuming that the optical flow is smooth over the entire image, computes an estimate of the velocity field, that minimizes this equation:     \begin{flushleft}              \[     E = \int \!\!\! \int ($I_x$u + $I_y$v + $I_t$)^2 dxdy + \alpha \int \!\!\! \int (\frac{\partial \textit{u}}{\partial x}^2 + \frac{\partial \textit{u}}{\partial y}^2 + \frac{\partial \textit{v}}{\partial x}^2 + \frac{\partial \textit{v}}{\partial y}^2)dxdy         \]     \end{flushleft}          where \alpha is the smoothness term of the velocity field,          \[         \frac{\partial \textit{u}}{\partial x}     \]      and           \[         \frac{\partial \textit{v}}{\partial x}       \]      are the spatial derivatives of the optical velocity component \textit{u}. The \alpha regularization parameter controls the strength of the smoothness constraint and is usually selected heuristically. The Horn-Schunck method minimizes the previous equation to obtain the velocity field, [u v], for each pixel in the image, which is given by the following equations:              \[             \stackrel u{k+1}{x,y} = \stackrel u{-k}{x,y} - \frac{$I_x$[$I_x$\stackrel u{-k}{x,y} + $I_y$\stackrel v{-k}{x,y} + $I_t$]}{\alpha^2 + $I_x$^2 + $I_y$^2         \]              \[             \stackrel v{k+1}{x,y} = \stackrel v{-k}{x,y} - \frac{$I_y$[$I_x$\stackrel u{-k}{x,y} + $I_y$\stackrel v{-k}{x,y} + $I_t$]}{\alpha^2 + $I_x$^2 + $I_y$^2         \]      I am newbie in LateX, and when I compile, it doesn't puts out the expected result. Also, when I write \alpha, afterwards, the text gets formatted in a different way (see picture attached). Can someone help me? ![enter image description here](http://i.stack.imgur.com/Kl8zw.png)


title: Is there a \newcommand manager program?

text: I type my latex document with gedit.   I use a lot of macro to facilitates typesettings.   I put all of them just after the `begin{document}` tag.   For a homework question says, I use at least 20 macros.   For example, in a question involving sequence               \newcommand{\xn}{x_n}     \newcommand{\yn}{y_n}     \newcommand{\xns}{\left\{ \xn \right\}}     \newcommand{\yns}{\left\{ \yn \right\}}      The problem is I never remember which one I created before.   Also, it's distracting, when writing a sentence, to always go back to the top of the document to create the macro I need.   It breaks my thinking follows. I was wondering, what people do to facilitate that.   In an Eclipse IDE world, when writting code, I can use a function without defining it, then ask Eclipse to generate the body of the function.   Is there some kind of program which helps to manage `\newcommand`? The answer doesn't have to be limited to gedit. I know I can externalize macros in a `command.tex` file say.   I do this for general purpose macros, like probability notation, parenthesing,...   It is really macros specific to a question which are hard to manage.   It's not practical to define a general set of macro `command_homework.tex`.   The macros must be created on a question by question basis.   For example, in a question on sequence `\xn` is `x_n`, while for a question on limit it is `\frac{x}{n}`.


title: Sweave: run a bat file in Windows 7

text: When I run a RNW file inside RStudio compilation is working. But when I try to run the same RNW file through a BAT file, compilation is not working. I am a Win 7 user, using MixTex... Actually my aim is to work on a LaTeX editor like TeXMaker and compile a RNW files through a BAT file. After compilation I would like to get a PDF file... On Rstudio I create a file named "main.Rnw" then I simply press on "Compile PDF" then I get a nice PDF output. But on texmaker I created the same "main.Rnw" but when I create my a "run.bat" file on the same directory, nothing is working. My "run.bat" contains: > Sweave main.Rnw I don't find a solution to my issue... * * * My "main.Rnw" code:               \documentclass[12pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage{graphicx}     \usepackage{lipsum} % for lorem ipsum text     \begin{document}     \title{Test sweave}     \maketitle          %fake text     \lipsum[1]          %just a boxplot text     <<fig=TRUE>>=     test <- c(-10,8,6,4,2,0,2,4,6,8,10)     boxplot(test)     @          %fake text     \lipsum[2]          \end{document}      ![enter image description here](http://i.stack.imgur.com/7HPDp.png)


title: Could TeX typeset note text between two lines of the body?

text: How to typsetting the note text like               There is body blahblah blahblah I need a note here and then blah blah                                                       The note about word     blahblah blahblah blahblah blahblah blahblah blahblah blahblah blah     where the note is inserted in, and it could be break     blahblah blahblah blahblah blahblah blahblah blahblah blahblah blah           ? See picture below for more detail. ![enter image description here](http://i.stack.imgur.com/57Q99.png)


title: \includegraphics{\input{|shell command}}

text: I want define a command "\foo" which outputs the result of a shell command, such as:               \newcommand{\foo}[1]{\input{|"#1"}}      This works, except if I'm trying to use this command in the context of \includegraphics:               \includegraphics{\foo{command attr1 attr2}}      where _command_ is a shell command which outputs a filename. For example, with command: "echo im" and im.png an image on the same directory, I get this error:               ! Undefined control sequence.     \filename@simple ...#2\\}\fi \edef \filename@base                                                        {#1}     l.14 \includegraphics{\foo{echo im}}


title: Is it possible to let captions wrap a bit around includegraphics within figures?

text: Is it possible to place the caption a bit around includegraphics within the figure (to save some space?). As it may be misunderstood what I want, I try to explain it exemplary: ![](http://i.stack.imgur.com/7CdtI.png) Currently the minimal example looks like this and uses minipage. I didn't know how to align without the ugly `\vspace`:               \documentclass{article}     \usepackage[caption=false]{subfig}     \usepackage{lipsum}          \begin{document}     \begin{figure}       \centering       \subfloat[][]{\rule{0.49\textwidth}{5cm}}\hfill       \subfloat[][]{\rule{0.49\textwidth}{5cm}}\\       \begin{minipage}{0.49\textwidth}         \vspace{-7.70cm}         \subfloat[][]{\rule{0.49\textwidth}{2cm}}\hfill         \subfloat[][]{\rule{0.49\textwidth}{2cm}}       \end{minipage}\hfill\subfloat[][]{\rule{0.49\textwidth}{5cm}}       \caption{\protect\lipsum*[2]}     \end{figure}     \end{document}      Which is rendered to: ![minimal example](http://i.stack.imgur.com/P7C6F.png)


title: Table numbering and listing in table of appendices instead of TOC

text: I am using a list of appendices based on this thread: Appendix in scrreprt - Separate table of appendices but mentioned in original TOC This works perfectly fine. But I realized I don't intend to use subsections in the appendix, but only tables instead (my appendix is 99% tables). The following structure illustrates this:               A. 1st appendix chapter     Table A.1     Table A.2 etc.      B. 2nd appendix chapter     Table B.1     Table B.2 etc.      Also my appendix tables are still in the original Table of contents atm. With the above structure, they had to be listed only in the List of Appendices, ideally listed optionally (I don't know if it looks good to list all the tables there. Maybe only the chapters would be fine too) Finally, if I use any tables in the appendix, suddenly all of my tables' labelfonts (also in other parts of the document, simply all of them) have a dot after them, like the following example shows (see also MWE):                **Table 1.**      The Table shows the following...      Here is the complete MWE, with the list of appendices from the above link:               \documentclass[a4paper, 12pt, headsepline, smallheadings, listof=totoc]{scrreprt}     \usepackage{booktabs}     \usepackage[labelfont={normalsize,bf}, textfont=small,    labelsep=newline,singlelinecheck=false,format=plain,indention=2cm]{caption}     \KOMAoption{captions}{tableheading}     \setcapindent{0em}     \usepackage{chngcntr}     \counterwithout{table}{chapter}               \newcommand\appendicesname{Appendices}     \newcommand\listofloaname{List of \appendicesname}     \newcommand*{\listofappendices}{\listoftoc{loa}}     \setuptoc{loa}{totoc}          \makeatletter     \g@addto@macro\appendix{%     \let\oldaddcontentsline\addcontentsline     \newcommand\hackedaddcontentsline[3]{\oldaddcontentsline{loa}{#2}{#3}}     \let\oldpart\part     \renewcommand*\part[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldpart{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldchapter\chapter     \renewcommand*\chapter[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldchapter{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldsection\section     \renewcommand*\section[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldsection{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldsubsection\subsection     \renewcommand*\subsection[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldsubsection{#1}%     \let\addcontentsline\oldaddcontentsline%     }     \let\oldsubsubsection\subsubsection     \renewcommand*\subsubsection[1]{%     \let\addcontentsline\hackedaddcontentsline%     \oldsubsubsection{#1}%     \let\addcontentsline\oldaddcontentsline%     }     }     \makeatother          \begin{document}          \listoftables     \tableofcontents          \chapter{1st chapter}          \begin{table}[h]     \centering     \caption[Table caption (1)]{The Table shows the following...}      {\normalsize     \begin{tabular}{lccccc}     \toprule     A & B & C & D & E \\     \midrule       1 & 2 & 3 & 4 & 5 \\     \bottomrule     \end{tabular}     }     \end{table}     \chapter{2nd chapter}               \listofappendices     \appendix          \chapter{1st appendix chapter}          \begin{table}[h]     \centering     \caption[Table caption (2)]{The Table shows the following...}      {\normalsize     \begin{tabular}{lccccc}     \toprule     A & B & C & D & E \\     \midrule       1 & 2 & 3 & 4 & 5 \\     \bottomrule     \end{tabular}     }     \end{table}          \chapter{2nd appendix chapter}          \begin{table}[h]     \centering     \caption[Table caption (3)]{The Table shows the following...}      {\normalsize     \begin{tabular}{lccccc}     \toprule     A & B & C & D & E \\     \midrule       1 & 2 & 3 & 4 & 5 \\     \bottomrule     \end{tabular}     }     \end{table}          \end{document}       As you can see, the current numbering is wrong, and the tables are listed in the TOC instead of the list of appendices. And there is this unwanted dot after the table labelfonts. Also if you got a better idea how to organize this, let me know. In the case of many tables, I think subsections in the appendix are a little bit too much of segmentation. But I am open to suggestions. Thanks for any help!


title: How to escape backslash in rangeprefix?

text: I want to escape backslash to be used as a `rangeprefix` as follows. The current MWE does not work as expected because it still imports all codes rather than the codes sandwiched by `document` environment.               \documentclass{article}          \usepackage{filecontents}     \begin{filecontents*}{xxx.xxx}     \documentclass{article}     \usepackage{mwe}     \begin{document}     \lipsum[1]     \end{document}     \end{filecontents*}               \usepackage{listings}          \lstset     {         includerangemarker=false,         rangeprefix=\textbackslash,         rangesuffix=\{document\},            linerange=begin-end,     }             \begin{document}         \lstinputlisting{xxx.xxx}     \end{document}


title: Automatically bold first sentence of a floats caption

text: How to bold automatically the first sentence of the float caption and second sentence is normal?               \begin{figure}[t]     \centering     \caption{First sentence. Second sentence.}     \end{figure}      Output should be: **Figure 1. First sentence.** Second sentence.


title: Number wrong in the Table of content

text: I have a problem with the ToC numbering in the following example:               \documentclass[12pt,english]{report}     \usepackage{setspace}\onehalfspacing     \usepackage{titlesec, blindtext, color}     \usepackage[]{tocbibind}     \usepackage{tocloft}      \renewcommand{\cftdot}{} % remove dots of table of content     \renewcommand{\cfttoctitlefont}{\hfil\bf}      \titleformat{\chapter}[hang]{\centering\normalfont\large\bfseries}{}{0pt}{\large}     \renewcommand\thesection{\arabic{section}}     \setlength{\cftchapnumwidth}{0pt}     \renewcommand\thechapter{}     \titlespacing*{\chapter}{10pt}{0pt}{10pt}     \begin{document}     \pagenumbering{roman}     \addtocontents{toc}{\protect\setlength{\cftbeforechapskip}{-0.5em}}%               \addcontentsline{toc}{chapter}{AUTHOR'S  DECLARATION}          \clearpage     \addcontentsline{toc}{chapter}{ABSTRACT}     \include{abstract}     \clearpage     \chapter*{ACKNOWLEDGEMENTS}%     \addcontentsline{toc}{chapter}{ACKNOWLEDGEMENTS}          \clearpage     \tableofcontents          \clearpage     \listoffigures     \addcontentsline{toc}{chapter}{LIST OF ABBRAVIATIONS}          \clearpage     %\addtocontents{toc}{\protect\setlength{\cftbeforechapskip}{1em plus 1pt}}%          \chapter[CHAPTER ONE INTRODUCTION]{CHAPTER ONE\\INTRODUCTION}     \pagenumbering{arabic}     sfsdfsf     sfsdfsf     \section{first section}     This is section one in chapter one.     \section{second section }     This is section two  in chapter one.          \chapter[CHAPTER TWO RELATED WORK]{CHAPTER TWO \\RELATED WORD}     \section{first section}     This is section one in chapter TWO.     \section{second section }     This is section two  in chapter TWO.     \end{document}


title: fancy text boxes like in Redhat documentation or mercurial book

text: I would like to have framed texts with an Icon on the side like the ones here http://www.centos.org/docs/5/html/5.5/Release_Notes/ar01s06.html or http://hgbook.red-bean.com/read/collaborating-with-other-people.html these text boxes are helping to emphsize text, and hg book has really nice frames around code ! which are nicer than the simple code frames I use now. So far I found The mdframed package as a candidate for that, but the question is how do I insert the tiny image in the side, and define internal margin ? Can someone give a code snippet ? ** Also, another question, I love Latex, but I am thinking the following: Since I want to publish my book online, it does make sense just to download the code of the hgbook, and learn the syntax of that XML ? would latex give me more advandages ?


title: How to plot "$f(x,y) = x^2 + y^2$ on $(0,0) \times (1,1)$?

text: Hello Friends Thanks for your time. Please help in plotting $f(x,y) = x^2 + y^2$ on a unit square with TikZ. Thanks.


title: Error with \footnote{\bibentry{foo}} when using beamer

text: I am making a beamer presentation and having the following problem: When I use `\footnote{\bibentry{foo}}` to cite an article, I get the following error message:               Undefined Control Sequence}      And the footnote does not appear right. I have used this in other beamer presentation before, though I'm not sure what is going wrong in my case. I typed               \usepackage{bibentry}     \nobibliography*      before my title slide (which is before `\begin{document}`) and I also typed               \begin{frame}     \titlepage     \bibliographystyle{amsplain}     \nobibliography{diss_def}     \end{frame}      Immediately after `\begin{document}` Any suggestions on what could be wrong?? Or other suggestions for citing in beamer?


title: Strange character changes (Xe(La)TeX or pdf(La)TeX, it's irrelevant)

text: A friend of mine uses pdfLaTeX for her university notes just like me. She uses the inputenc package, since on her Windows that allows characters with diacritics such as è or ò to by correctly typesetted without having to type `e or `o instead. I don't use inputenc since on my Mac that generates "Keyboard character not set up for use with LaTeX" or something like that. So the first question is: why this difference? And the second question is: why does it happen that if she sends me a tex document I see √® instead of "è" and √≤ instead of "ò"? And finally, with pdfTeX that typesets to the original characters with diacritics: why? Shouldn't it typeset to what is typed as happens with XeTeX?


title: How to place two ctables side by side

text: _`ctable`_ , not a regular `table`/`tabular`. How can I get two narrow ctables to go side by side? I want them to be subtables of a larger table, just two independent tables side by side. I've tried using a table, minipage, subfig—I keep getting the error `not in outer par mode`.


title: Natbib style for the National Library of Medicine (NLM)

text: Is there a standard natbib bibliographic style which maps to the National Library of Medicine (NLM) style guide? If not what are my possible natbib solutions?


title: Defining a command to generate a sequence

text: I'm trying to define a command to make a list of subscripted `\varphi` characters. Let's call it `\phiseq`. I want to be able to use `\phiseq{1,2,3}` in the body of my document to expand to `$\varphi_1,\varphi_2,\varphi_3$`. Any ideas? I've tried several experiments with `\@for`, but none of them have worked.


title: Rendering PDF graphics without aliasing

text: I am using MATLAB to generate .eps vector graphics, editing them in Adobe Illustrator, and then saving them as a PDF. When I view the image through Adobe Acrobat, it is covered with cross-hatched white lines (an aliasing problem). These can be hidden, however, by de- selecting `Edit->Preferences...->Page Display->Rendering->Smooth line art`. However, when I import the PDF into my LaTeX document, the aliasing again appears in the compiled version. Is there a way to tell LaTeX the same thing that I told Adobe Acrobat (that is, do not render the pdf with "smooth line art")?


title: Simple pendulum phase space plot with pgfplots: looking for a clever parameterization

text: I want to produce a nice phase space plot of the simple pendulum for a course I'm teaching. Essentially, this boils down to plotting `y^2/2 = cos(x) + e` for different values of `e` (the energy). If I solve for `y` and plot the resulting expression, then the curve appears broken near `y=0`. Solving for `x` and plotting the inverse function only moves the problem to `x=0`. Here's a MWE (for `e = -0.5`):               \documentclass{article}          \usepackage{pgfplots}          \begin{document}          \begin{tikzpicture}      \begin{axis}       \addplot[domain=-1:1,samples=100] ({ acos(x^2/2+0.5)}, x);       \addplot[domain=-1:1,samples=100] ({-acos(x^2/2+0.5)}, x);      \end{axis}     \end{tikzpicture}          \begin{tikzpicture}      \begin{axis}       \addplot[domain=-60:60,samples=100] { sqrt(2*(cos(x)-0.5))};       \addplot[domain=-60:60,samples=100] {-sqrt(2*(cos(x)-0.5))};      \end{axis}     \end{tikzpicture}          \end{document}      I'm guessing there exists a clever parameterization for the curve that eliminates the problem, but so far have been unable to find it.


title: Problem with figures/images locating themselves after paragraph

text: My images/figures won't fit under the paragraph they jump over it, code:                   \paragraph{Flowdiagram for produktets livscyklus\\}             \begin{figure}[h!]                 \center                 \includegraphics[width=1.2\textwidth]{FlowdiagramProdukt.png}%                 \caption{På dette billede ser vi flowdiagram for vores produkts livscyklus}             \end{figure}         \paragraph{MEKA (Materiale, Energi, Kemikalier, Andet)\\}                  \begin{figure}[h!]                 \center                 \includegraphics[width=1.1\textwidth]{tabel.png}%                 \caption{På dette billede ser vi vores om MEKA}             \end{figure}


title: Maintaining structure Workbook style

text: \--Revised-- I am looking at a math workbook for teenagers. This one has the following structure: > 1.Main Chapter > > 1.1 Subchapter > > 1.11 Task 1 > > a) problem 1 b) problem 2 c) problem 3 > > d) problem 4 e) problem 5 > > 1.12 Task 2 > > etc. ... Many of the math problems are very small and the natural thing would be to have them on line, horizontally. However an expression is often broken and aligned at the equal sign. Not unlike an equation (but not). Secondly, when the line that contain the structure breaks, the item indicators also align, presuming the use of an enumerated list. How can I reasonably assume this is done? Does it have to be a forced method, as a table, or can it be a flexible one, like inline? PS.: I would have tagged this under the lacking {structure}. Hence the broad tags.


title: Looking for suggestions: what should I learn next?

text: After a few years of trial, error, and usenet messages, I know just about all the LaTeX I really _need_. And my needs are modest. Most of my documents use the same template (`tufte-latex`), with the same set of packages; occasionally I need to learn something new for a specific purpose, but in general I've got a nice stable skill set. You can probably see where this is going: I'm starting to get bored and starting to feel stagnant. Since I have what I need, the question is: what do I want? And that's my question. I want to expand my TeX skills, but without a real need directing me, I'm not sure where to start. Is there a package, TeX variant, or something that's worth learning just because it's cool? (And yes, I know I can browse CTAN at my leisure. I'm asking you what corners of the LaTeX kingdom you particularly enjoy playing in.)


title: Overlay multiline text in the image in beamer

text: I have a image in a beamer and I want to overlay a table on that image. How can I achieve that ? I have a figure that I created in powerpoint which is as follows: ![enter image description here](http://i.stack.imgur.com/64kpk.png) In the above figure, the statistical parameters such as `RMSE` and `NSE` are added later. Is it possible to add similar thing in latex beamer ? I want to show the text first on the upper panel and then on the bottom panel. Thanks.


title: How to put a row in a table with no column division but the rest of the table to have divisions

text: I want to make a table where it is completely gridded up apart from the line subscript where I want to have just lines above and below but no other lines. I am trying this code but it doesn't give me what I want.               \begin{table}[!ht]     \centering     \caption*{Common Notation}     \begin{tabular}{|l|l|l|}     \hline     {\bf Symbol} & {\bf  Description} & {\bf Units} \\ \hline     $\alpha$ & Thermal expansion coefficient & $^\circ$C$^{-1}$ \\ \hline     $\kappa$ & Thermal diffusivity &  m$^2$/s \\ \hline     $\eta$ & Dynamic viscosity & Pa s \\ \hline     $\nu$ & Kinematic viscosity & m$^2$/s \\ \hline     C$_{p}$ & Specific Heat Capacity & J/kg$^\circ$C \\ \hline     $\rho$ & Density & kg/m$^3$ \\ \hline     T & Temperature & $^\circ$C \\ \hline     k & Thermal conductivity & W/m$^\circ$C \\ \hline     v & Velocity & m/yr \\ \hline     $\Delta$T=T$_h$-T$_\infty$ & Temperature Difference & $^\circ$C \\ \hline     $\eta$$^*$=$\eta$$_h$-$\eta$$_\infty$ & Viscosity Contrast & Pa s \\ \hline     U & Speed & m/s \\ \hline     y$_T$ & Thermal boundary layer & m \\ \hline     l$_c$ & Plume height after about 2 hours & m \\ \hline     $\tau$$_c$ & Diffusion time & s \\ \hline     $\tau$ & Time the plume first emerges & s \\ \hline     g & Gravitational acceleration & m/s$^2$ \\ \hline     D & Plume Diameter & m \\ \hline     H & Height of the tank &\\ \hline     P & Pressure & Pa \\     \end{tabular}         \begin{tabular}{|l|} subscript \\          \end{tabular}         \begin{tabular}{|l|l|l|}     h & Heater  & \\ \hline     $\infty$ & Ambient & \\ \hline     b & Buoyancy & \\ \hline         \end{tabular}     \label{corn}     \end{table}      Any help would be greatly appreciated. Many Thanks!


title: Undefined control sequence while using bib file for References

text: I'm using TexMaker, if it helps. I also have TeXnicCenter and TexWorks. The tex file is the following:               \documentclass[11pt]{book}       \begin{document}       (...)       \bibliographystyle{unrst}       \bibliography{C:\filelocation\bibfile}       \end{document}      This produces an 'Undefined control sequence' error... How could I fix it? Any help will be appreciated!


title: Problem with aligning using compactlist in tabularx

text: I've created a table with the tabularx package. Within the cells I use compactitem to create a list. First I had a problem with the leftmargin. To solve this I've used `\setlength{\leftmargini}{0pt}`. But now I've got the problem, that when there's a line break, the sentence starts right below the bullet point without no indentation. Can anybody help me with this problem? There are probably other things that could have been done better, but that's my first experience with TeX ever :)               \makeatletter     \def\MPT{\@minipagetrue}     \makeatother     \begin{tabularx}{\textwidth}{|>{\centering\arraybackslash}l|X|X|X|}   %vier Spalten     \hline     \rowcolor[gray]{0.75}     \textbf{} & \textbf{Herkömmlicher Festpreis} & \textbf{Time \& Material} & \textbf{Agiler Festpreis} \\ \hline\hline     \centering\multirow{2}{*}{\begin{sideways}\parbox{40mm}{Kunde}\end{sideways}}     &     -     &     --     &     ++     \\     \cline{2-4}     &     \setlength{\leftmargini}{0pt}     \begin{compactitem}     \setlength{\itemsep}{-1\parsep}     \MPT     \item Budgetsicherheit ist nicht gegeben, der Preis basiert nur auf Schätzwert um wieviel der ursprüngliche Festpreis überschritten wird     \item Risiko der Budgetsicherheit ist zwar geteilt, aber meist stärker auf Kundenseite     \vspace{-0.5cm}     \end{compactitem}     &     \setlength{\leftmargini}{0pt}     \begin{compactitem}     \setlength{\itemsep}{-1\parsep}     \MPT     \item Kunde kann die Aufwände im Detail im Budgetrahmen steuern     \item Hoher Kontrollaufwand um Qualität sicherzustellen     \item Das gesamte Risiko der Budgetsicherheit liegt auf Kundenseite     \item Gesamtkosten sind für Auftraggeber theoretisch unbegrenzt     \vspace{-0.5cm}     \end{compactitem}     &     \setlength{\leftmargini}{0pt}     \begin{compactitem}     \setlength{\itemsep}{-1\parsep}     \MPT     \item Kunde legt gemeinsam mit Lieferant den Budgetrahmen und Riskshare fest     \item Qualität bleibt während des Projekts nachvollziehbar     \item Kunde kann Aufwände im Budgetrahmen steuern     \vspace{-0.5cm}     \end{compactitem}     \\ \hline     \end{tabularx}


title: Small cross and small upside down cross symbols

text: I need a **cross symbol** , similar to \dagger, but optimally less fancy, smaller (not as long vertical line below the crossing) and without having to load a special symbol package (besides amsmath). The letter "t" without the bottom curve would do. I also need **the cross upside down** (for mathematical and not religious reasons...). If I use sth. like `\newcommand{\rotatedCross}{\ensuremath{\rotatebox[origin=c]{180}{\ensuremath{\dagger}}}}%`, I get error messages if I use `\rotatedCross` inside other complex commands (`use of \complexCommand doesn't match its definition`). So the same cross upside down as own symbol (or a simpler solution than rotatebox) would be perfect.