title: Problem with a path between pgf 2.1 and pgf 3.0

text: \documentclass{standalone}     \usepackage{tikz}     \begin{document}              \begin{tikzpicture}[domain=0:2]           \path[fill=blue]  (0,0) -- plot function{x+1} -- (2,0);         \end{tikzpicture}         \begin{tikzpicture}[domain=0:2]           \path[fill=blue]  plot function{x+1} -- (2,0)-- (0,0);         \end{tikzpicture}          \end{document}      With pgf 2.1 the two pictures are identical but with pgf 3.0 I get ![enter image description here](http://i.stack.imgur.com/Ngk7u.png)


title: Create a font table for all available characters for a particular font

text: Similar to the question: Lualatex: Font table with examples I have several ornamental fonts and I'd like to create key maps. That is, I want to know what symbol the letter `a` maps to by having a nice table. The problem is, many of these fonts don't include all the characters and I don't know, _a priori_ , which ones are included. I'd rather not have a mess of empty boxes filling up the table. Is it possible to iterate through the _valid_ characters in a font and just display them? Any (Lua, Con, Xe, La, etc...)-Tex solution is welcome.


title: Safe installation of Texmaker Ubuntu 12.04

text: Is it safe to install Texmaker from Ubuntu Software Center? It is outdated and a newer version is available from the Texmaker projekt website, but I really do not want to install software from "outside the software center". The Texmaker in the software center is in the universe repo. Does somebody know if texmaker opens any ports or accesses internet if I just open the installed program?


title: Paragraph and subparagraph titles inherit color settings from TeX group *after* them

text: I'm getting some strange behaviour when using the color package at paragraph and subparagraph level. See the code snippet below:               \usepackage[usenames,dvips]{color}          \section{A}     {\color{Green} \itshape Hello.}          \subsection{B}     {\color{Green} \itshape Hello.}          \subsubsection{C}     {\color{Green} \itshape Hello.}          \paragraph{D}     {\color{Green} \itshape Hello.}          \subparagraph{E}     {\color{Green} \itshape Hello.}      The color switch is inside a group following the heading title, but is being incorrectly used within the header title at paragraph and subparagraph level. That is, D and E are shown in green as well as the 'Hello' text (but A, B and C aren't). Note that the `\itshape` switch does not have the same behaviour, so I suspect this is a bug/feature of the internals of the color package. Can anyone shed any light on this? Am I missing something? I'm using the TeX Live 2009 version as in the standard Ubuntu 10.04 Lucid package. **EDIT** : Just to be clear. I know that, in general, I can get round it using the non-switch equivalent \textcolor (but any alternatives as suggested by David Carlisle are still useful). I'm actually using this within a 'style' \newcommand definition, so I need the switch variant to colour multiple paragraphs. (There are lots of _design-level_ ways I can avoid the problem of course, like not using styles with colour; the question isn't about that!) I guess I'm primarily interested in whether such types of 'feature' are relatively common, limited to the specifics of using colours, etc. (and the general under-the-covers reasons why), so I can make informed decisions on what LaTeX constructs to use when, and which are likely to cause me more headaches than they're worth.


title: How to remove chapter indentation in table of contents

text: First post so please be gentle :) I'm relatively new to Latex but have managed to bumble my way through using package manuals and stack exchange. But now I'm stuck on something I'm not sure how to solve... I've added in a code section that removes 'chapter' from the headings and contents, but not the contents seem to have this weird indent. How do I get rid of this indent? Here is a picture: ![ToC problem](http://i.stack.imgur.com/0Lkpk.png) The preamble is as follows:               \documentclass[a4paper, 11pt, oneside]{book}     % Include any additional packages     \usepackage[left=3cm, right=3cm, bottom=3.5cm, top=3.5cm]{geometry}     \usepackage[font=footnotesize, center]{caption}                                             % Changes font size of figure captions to small     \usepackage[         backend=biber,         style=authoryear-comp,         natbib=true,         maxnames=2,         sorting=nyt,         sortcites=false,         block=space,         date=long,         url=false,          doi=false,         eprint=false,         isbn=false,         uniquename=false,         uniquelist=false,         terseinits=true,         firstinits=false         ]{biblatex}     \addbibresource{../../BibTex/library.bib}     %Put initials after names...     \DeclareNameAlias{sortname}{last-first}     \DeclareNameAlias{default}{last-first}         %Remove "and" before last name. However, this also removes "and" in a textcite...     \renewcommand*{\finalnamedelim}{\addcomma\space}     \usepackage{fancyhdr}       \usepackage{graphicx}        \usepackage{wrapfig}     \usepackage{sidecap}                                     \usepackage{subfig}      \usepackage[big,compact]{titlesec}     \usepackage[hidelinks]{hyperref}     \hypersetup{         pdftitle=Report,             pdfauthor=EL,             pdfkeywords=Thesis             }     \usepackage[printonlyused]{acronym} % Automates the generation of an acronyms list     \makeindex     \renewcommand{\baselinestretch}{1.5}% Set document line spacing to 1.5     \setlength{\parindent}{0in}     \renewcommand{\chaptername}{}     \renewcommand{\thechapter}{}     \newcommand{\comment}[1]{}


title: What are the different kinds of vertical spacing and horizontal spacing commands available?

text: @egreg gave a very nice and thorough answer to What are the different kinds of boxes in (La)TeX?. It seems it would be nice to have a similarly thorough answer to controlling spacing. I'm not thinking so much about               \vspace     \hspace     \\[<dim>]      and their starred variants because there is a very thorough answer about such spacing commands found at What commands are there for horizontal spacing? At least in terms of horizontal spacing. I'm thinking more along the lines of such things as               \llap     \rlap     \clap     \smash     \mathllap     \mathrlap     \mathclap      And the phantoms:               \phantom     \hphantom     \vphantom      And I'm sure I've forgotten a few. What would be nice in addition is to not only have some kind of an explanation of the uses and differences of these commands but also a pointer to where someone can find documentation for them. For example, I know I can do `texdoc mathtools` and find documentation for `\mathllap` etc. But I don't know where to find documentation for `\smash` and the various phantoms. **EDIT** # Sometime I don't always get the result I expect For example, `\phantom` doesn't always behave like I would like such as in this example,               \documentclass{article}     \usepackage{amsmath,amssymb}     \pagestyle{empty}     \begin{document}              \begin{align*}             y &= x - z\raisebox{0ex}[0pt][0pt]{\rule[-4ex]{0.1pt}{4ex}} \\               &= x \mathop{\phantom{-}} z\raisebox{0ex}[0pt][0pt]{\rule{0.1pt}{4ex}} \\               &= x \phantom{ - } z \\         \end{align*}         \hspace*{\fill}Or even worse:\hspace*{\fill}         \begin{align*}             y &= x - z\raisebox{0ex}[0pt][0pt]{\rule[-4ex]{0.1pt}{4ex}} \\               &\phantom{= x -} z\raisebox{0ex}[0pt][0pt]{\rule{0.1pt}{4ex}} \\         \end{align*}          \end{document}      ![enter image description here](http://i.stack.imgur.com/rqckD.png)


title: Use node name with arithmetic counter expression

text: I want to call a PSTricks macro with a node name which involves the result of an arithmetic expression with counters. Consider the following, not working example:               \documentclass{article}     \usepackage{pst-node}     \newcounter{mycnt}     \setcounter{mycnt}{2}     \def\nodename#1{%       A\numexpr\themycnt-#1\relax B}%     \begin{document}     \begin{pspicture}[showgrid](5,5)       \pnode(5,5){A1B}       \psdot(\nodename{1})     \end{pspicture}     \end{document}      The macro call `\nodename{1}` should evaluate to `A1B` inside the parenthesis of the PSTricks macro. But the above example doesn't work when compiled with `latex -> dvips -> ps2pdf`. It gives the Postscript error               Error: /undefined in 2-1\relax     Operand stack:        --dict:51/400(L)--   N@A\numexpr      which shows, that the `\numexpr` is not evaluated but passed verbatim to the Postscript file. Is it possible to define the macro `\nodename` in such a way, that it works in the above example? This must not affect, how the macro is used, but must work as `\psdot(\nodename{1})`. And the arithmetic expression involves counters.


title: Specify alignment per column in align equation

text: Using the following mwe i have not yet found a way to align the formulas correctly.               \documentclass{article}     \usepackage{mathtools}  % extends amsmath and fixes some of its quirks     \usepackage{amssymb}     \begin{document}               \begin{align}\label{eq:mergefunction_with_weighting}     \curlyvee(v, \omega) :=      l_1 \triangleright l_2 =      \left\{      \begin{aligned}            &l_1(v)               &                          &\text{wenn $v \in G_1 \setminus G_2$}\\     \omega(&l_1(v)) + (1-\omega)(&\hat{R}l_2(v) +\hat{t})   &\text{wenn $v \in G_1 \cap G_2$}\\            &                     &\hat{R}l_2(v) +\hat{t}    &\text{wenn $v \in G_2 \setminus G_1$}.      \end{aligned}     \right.     \end{align}               \end{document}      My output is currently like this: ![enter image description here](http://i.stack.imgur.com/50Si8.png) Everything is fine except the vertical and horizontal alignment/spacing within the `aligned` environment. But in that you can notice the following: - First `&` works fine. - The second `&` should be aligned to `\hat{R}` and without spacing between the `(` and the `\hat{R}` in the middle row - At the last `&`, the spacing in the middle row between `\hat(t))` and `wenn` should be larger. (I think this one would disappear as soon as the second `&` is fixed. So the requests i have sum up to the question: Whats the best and consistent way to approach placement issues like these?


title: Supress `\cleardoublepage` for _some_ chapters

text: I am using `book` environment. Between `\listoffigures`, `\listoftables`, `\printglossary[glossaryname]`s and appendices, I need a normal `\clearpage` between them (not a `\cleardoublepage`). I still need to define these as `chapter`s for document style consistensy and `\cleardoublepage` between normal `chapter`s.


title: Issue with mdframed package

text: `mdframed` package creates a beautiful box around the content. And it has the capability to break between pages as in the image below ![enter image description here](http://i.stack.imgur.com/x07GZ.png) ![second part](http://i.stack.imgur.com/poeEO.png) I have done the decoration of getting the concept 5 : algebraic identities on the box but when the box breaks on the page to carry some part of the content to the next page (as shown in the second image below) the beautiful header "Concept 5 : algebraic identities" blocks the content behind. My questions are there ways by which we can leave some space post the header or just remove the header in the broken part on the next page. Kindly help me.. apologies if something not clear. the code to get the required frames is               % Preview preamble          %% LyX 2.0.4 created this file.  For more info, see http://www.lyx.org/.     %% Do not edit unless you really know what you are doing.     \RequirePackage{fix-cm}     \documentclass[11pt,a4paper,english,oldfontcommands,openany]{memoir}     \usepackage[T1]{fontenc}     \usepackage[latin9]{inputenc}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \synctex=-1     \usepackage{wrapfig}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{fixltx2e}     \OnehalfSpacing          \makeatletter          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.     \pdfpageheight\paperheight     \pdfpagewidth\paperwidth               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.     \@ifundefined{lettrine}{\usepackage{lettrine}}{}      \theoremstyle{definition}       \newtheorem{example}{\protect\examplename}       \theoremstyle{definition}       \newtheorem{defn}{\protect\definitionname}     \theoremstyle{plain}     \newtheorem{thm}{\protect\theoremname}          \@ifundefined{date}{}{\date{}}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.          \usepackage[T1]{fontenc}     \usepackage{amsthm}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}          \usepackage{xcolor}     \usepackage[framemethod=tikz]{mdframed}     \usetikzlibrary{shadows,shadings}          \usepackage[a4paper]{geometry}     \geometry{     left=30mm, %% or inner=20mm     right=15mm, %% or outer=15mm     top=30mm, bottom=25mm,     headheight=\baselineskip,     headsep=7mm,     footskip=13mm     }     \usepackage{multicol}     \usepackage{polynom}     \usepackage{lettrine}     \usepackage{lipsum}     \usepackage{calc}     \usepackage{tikz}     \usetikzlibrary{shapes,snakes}     \usepackage{pgf}     \usepackage{graphicx}     \usetikzlibrary{arrows,mindmap}     \usepgflibrary{arrows}     %\usepackage[framemethod=TikZ]{mdframed}          \usepackage{cwpuzzle}     %\renewcommand{\secheadstyle}{\huge\bfseries}     %\chapterstyle{demo3}     \chapterstyle{verville}     %\chapterstyle{southhall}     %chapterstyle{thatcher}     %\chapterstyle{wilsondob}     %\chapterstyle{pedersen}     %\chapterstyle{bianchi}          \setsubsubsecindent{1cm}     \setaftersubsubsecskip{1cm}     \setsubsubsecheadstyle{\Large\itshape\raggedleft     \begin{tikzpicture}     \draw[overlay,remember picture,opacity=0.5] node [right,text width=15cm, rounded corners, fill=gray!30, inner sep=2ex]{};     \draw[thick,overlay,remember picture, gray!50] (0,-.1)--(12.8,-.1);     \draw[ultra thick,overlay,remember picture, gray!70] (0,-.2)--(12.8,-.2);     \draw[thick,overlay,remember picture, gray!40] (0,-.3)--(12.8,-.3);     \draw[ultra thick,overlay,remember picture,gray!70] (0,-.2) -- (-20,-.2);     \shade[yshift=6pt,ball color=gray,overlay] (0,-.2) circle (9pt);     \end{tikzpicture}     }          \setsubsecindent{0.4cm}     \setbeforesubsecskip{0.5cm}     \setaftersubsecskip{0.5cm}     \setsubsecheadstyle{\Large\scshape\raggedright     \begin{tikzpicture}     %\draw[overlay,remember picture,opacity=0.5] node [right,text width=12cm, rounded corners, fill=gray!50, inner sep=2ex]{};     \draw[yshift=-2pt,remember picture, line width=2pt, overlay, gray!30, rounded corners] (12,-.4) -- (0,-.4) -- (0,.8)  -- (12,.8) -- cycle;     \draw[thick,overlay,remember picture, gray!50] (0,-.1)--(12,-.1);     \draw[ultra thick,overlay,remember picture, gray!70] (0,-.2)--(20,-.2);     \draw[thick,overlay,remember picture, gray!40] (0,-.3)--(12,-.3);     \draw[ultra thick,overlay,remember picture,gray!70] (0,-.2) -- (-20,-.2);     \shade[ball color=gray!90,overlay] (0,-.2) circle (3pt);     \shade[ball color=gray!90,overlay] (12,-.2) circle (3pt);     \end{tikzpicture}     }          \setsecindent{0.4cm}     \setbeforesecskip{1.5cm}     \setaftersecskip{1cm}     \setsecheadstyle{\LARGE\scshape\raggedright\color{black}     \begin{tikzpicture}     \draw[yshift=6pt,overlay,remember picture,opacity=0.5] node [right,text width=15.5cm, rounded corners, fill=gray!30, inner sep=15pt]{};     \draw[yshift=-2pt,remember picture, line width=4pt, overlay, gray, rounded corners] (16,-.4) -- (-0.5,-.4) -- (-0.5,1)  -- (16,1) -- cycle;     \shade[overlay,ball color=gray] (16,0.2) circle (8pt);     \end{tikzpicture}     }          \setparaindent{1cm}     \setafterparaskip{1cm}     \setparaheadstyle{\Large\itshape\raggedright     \begin{tikzpicture}     \draw[overlay,remember picture,opacity=0.5] node [right,text width=0.4\textwidth, rounded corners, fill=gray!30, inner sep=2ex]{};     \draw[thick,overlay,remember picture, gray!50] (0,-.1)--(7.5,-.1);     \draw[ultra thick,overlay,remember picture, gray!70] (0,-.2)--(7.5,-.2);     \draw[thick,overlay,remember picture, gray!40] (0,-.3)--(7.5,-.3);     %\draw[ultra thick,overlay,remember picture,gray!70] (0,-.2) -- (-20,-.2);     \shade[yshift=6pt,ball color=gray,overlay] (0,-.2) circle (8pt);     \shade[ball color=gray,overlay](7.5,0) circle (8pt);     \end{tikzpicture}     }                    %%%%%%%% This is to get a Concept          \usepackage{lipsum}                                         %  this is the start of the code which is our interest           \newcounter{theorem}     \renewcommand\thetheorem{Concept ~\arabic{theorem}}     \makeatletter     \mdf@dolist{\mdf@do@stringoption}{%         {theoremtitle=={}}%     }     \renewrobustcmd\mdfcreateextratikz{%           \node[anchor=west,rounded corners,draw,thick,shading=axis,left color=gray!20,xshift=10cm,minimum height=.7cm,minimum width=2cm] at (P-|O)                    {~\mdf@frametitlefont{\thetheorem}%                       \ifdefempty{\mdf@theoremtitle}%                       {~}%                       {:~\mdf@theoremtitle~}%                   };     }     \makeatother     \mdfdefinestyle{theoremstyle}{%     outerlinewidth=1pt,     innerlinewidth=3pt,     roundcorner=5pt,     linecolor=black,     shadow=true,     tikzsetting={shading=axis,top color=gray!10},     innertopmargin=1.2\baselineskip,     skipabove={\dimexpr0.5\baselineskip+\topskip\relax},     needspace=3\baselineskip,     frametitlefont=\sffamily\bfseries,     settings={\global\stepcounter{theorem}},     }     \newenvironment{concept}[1][]     {\begin{mdframed}[style=theoremstyle,theoremtitle={#1}]     \relax}{     \end{mdframed}     }          \makeatother                     %  this is the end of the code which is of our interest                                    \usepackage{babel}       \providecommand{\definitionname}{Definition}       \providecommand{\examplename}{Example}     \providecommand{\theoremname}{Theorem}                  \begin{document}     \chapter{chapter one}     \begin{concept}     .... cotent that gets broken over pages     \end{concept}          \end{document}


title: Macro needed for automatic creation of labels

text: I'm asking for help with the creation of a label inside a command out of a given text. The given text contains spaces and an umlaut. See my MWE, which contains my question:               \documentclass[pagesize, english, fontsize=12pt, parskip=half]{scrartcl}     \usepackage[T1]{fontenc}\usepackage[utf8]{inputenc}     \usepackage{babel, xspace, tocbasic}                    \newcounter{Anl}     \newcommand{\Anlv}[1]{%       \refstepcounter{Anl}%       \textit{attachment \theAnl{}\xspace}%       \addtocontents{anl}{%         \mdseries{}Attachment \theAnl{}: #1\newline%{}{}%       }%     %  \label{ANL:#1}% REMOVE THE FIRST % AND YOU GET AN ERROR     }     \DeclareNewTOC[%     type=anlverz,%     types=anlverzes,%     nonfloat,%     name=Anlagen,%     listname={Attachments:}%     ]{anl}                    \begin{document}          Above you see a new command which I use to add attachments to my     texts. Often I need to refer to an attachment, e.g. see the Map of Özß     (\Anlv{Map of Özß, map scale 1:2500}).          I'd like to get a label automatically. But as soon as there are spaces     in the name (here: »Map of Özß, map scale 1:2500«) or an umlaut or an     »ß«, I get an error and no label.          Can anybody write a macro which constructs a usefull label out of the     given name of an attachment? Here in my example »Map of Özß, map scale     1:2500« simply the first word (»Map«) as a label (\verb"\label{ANL:Map}")     would be an improvement, but there may be more than one attachment     with a map. So the best solution for my example, if possible, were:     \verb"\label{ANL:Map-of-Oezss}", because you can replace an »Ö« with     »Oe« and an »ß« with »ss«.               \listoftoc{anl}          \end{document}


title: Is there a wider equal sign?

text: I have defined the _equal by definition_ sign: ![enter image description here](http://i.stack.imgur.com/FfGYs.gif) with this code: `\newcommand{\eqdef}{\overset{def}{=}}`. However, "def" extends over the edges of the equal sign. Is there a wider equal sign to use?


title: tex4ht incompatible with expdlist

text: I try to convert the below document with `htlatex` and no options and it spits this error on me:               ! LaTeX Error: Something's wrong--perhaps a missing \item.      There's no error if I remove the square brackets and their contents behind the description environment. There's another error, if I only include one item:               ! Missing number, treated as zero.     <to be read again>                         \c:\end:itm      l.7   \end{description}      Minimal example:               \documentclass{article}     \usepackage{expdlist}     \begin{document}                                                      \begin{description}[\breaklabel\setleftmargin{1ex}]         \item[test1]text1         \item[test2]text2       \end{description}     \end{document}


title: Print programs with automatically generated line numbers and tabbing

text: I have post a question several weeks ago: Print programs with its proper syntax, and I choose to use `tabbing` package at the moment. Now I really need to keep the tabbing and print a line number before each line. It will be great if this line number is automatically generated. Does anyone know how to do it? I guess one fundamental approach is to define my own highlighting and tabbing rules based on the syntax of my language. (I have seen an example somewhere, but I could not find it anymore...) Could anyone help?


title: How to keep ggplot font size constant when varying figure width

text: I have different figures across my document with different width. I set the the font size for all `ggplot`s globally with `theme_set(theme_bw() + theme(text=element_text(family="Palatino", size=20)))` but I want to set the figure width with the `knitr` option `out.width='` in the preamble of each figure chunk. The problem is this results in different effective font size to be typeset by `LaTeX`. The solution of course would be to manually set the font size differently for each chunk. I just wonder if there's a smarter solution (without using dev=`tikz`) so to: 1) Set the font size once and for all plots; 2) Maintain the possibility to set the width size locally for each figure. Please consider the following               \documentclass{article}     \usepackage{subfig}     \begin{document}          <<set-options, include=FALSE, cache=FALSE>>=     opts_chunk$set(fig.align='center', dev='pdf', cache=FALSE, message=FALSE, echo=FALSE, progress = TRUE, verbose = TRUE, warning=FALSE, error=FALSE)     library(ggplot2)     theme_set(theme_bw() + theme(text=element_text(family="Palatino", size=20)))     @                     <<<prepare-data,  include=FALSE>>=     data1.df <- data.frame(Plant = c("Plant1", "Plant1", "Plant1", "Plant2", "Plant2",          "Plant2"), Type = c(1, 2, 3, 1, 2, 3), Axis1 = c(0.2, -0.4, 0.8, -0.2, -0.7,          0.1), Axis2 = c(0.5, 0.3, -0.1, -0.3, -0.1, -0.8))          data2.df <- data.frame(Plant = c("Plant1", "Plant1", "Plant1", "Plant2", "Plant2",          "Plant2"), Type = c(1, 2, 3, 1, 2, 3), Axis1 = c(20, 40, 80, 20, 70,          0.1), Axis2 = c(50, 30, 10, 30, 10, 80))     @           <<Fig1, fig.cap='Large', fig.env='figure', message=FALSE, echo=FALSE, warning=FALSE, error=FALSE, out.width='.62\\textwidth'>>=               ggplot(data1.df, aes(x = Axis1, y = Axis2, shape = Plant, color = Type)) + geom_point(size = 5) +  annotate("text", x=0.4, y=0.0, label="Label", fontface="italic") + theme(legend.position="none")               @           <<Fig2, fig.cap='Small', subfig.cap=c("First","Second"), fig.env='figure*', message=FALSE, echo=FALSE, warning=FALSE, error=FALSE, out.width='.32\\textwidth'>>=               ggplot(data1.df, aes(x = Axis1, y = Axis2, shape = Plant, color = Type)) + geom_point(size = 5) +  annotate("text", x=0.4, y=0.0, label="Label", fontface="italic") + theme(legend.position="none")          ggplot(data2.df, aes(x = Axis1, y = Axis2, shape = Plant, color = Type)) + geom_point(size = 5) + theme(legend.position="none")               @           \end{document}


How to put the equation number at the end like below ![enter image description here](http://i.stack.imgur.com/xIYiv.gif)


title: Prevent Listings from breaking frames

text: Is there any way to prevent the `listings` package from leaving unsightly gaps in the frame when using `breaklines=true`. I'm just `\lstinputlisting` some code, placing it in a `shadowbox` frame and letting `listings` wrap the longer lines. This sometimes causes breaks in the frame (where a line has been split). I've seen other tex.stackexchange users encounter this problem when embedding maths (or other commands that use more than the expected line height); I'm not attempting anything as exotic. Is this a bug in Listings?


title: Rotate eps image without the whole page

text: I have a eps file printed out from a Simulink model using the Matlab command `print -deps`. However, the image is rotated +90 degrees to portrait. When I include it into my latex document, the whole page becomes rotated -90 degrees. My command is:               \begin{figure}[hbt]       \centering       \includegraphics[width=1\textwidth]{simulink_model.eps}       \caption{A Simulink Model}     \end{figure}      I tried to add `[angle=90]` but this turns the whole page by 120 degrees. I guess I could turn the eps source or manually turn the page back in latex. But is there a way to insert a eps file like this one and tell latex to leave the page orientation alone?


title: How to write a modified limit operator?

text: I am trying to write an generalised limit operator, which look approximately like the standard \lim, except it has an additional symbol in front, connected by a hyphen (see example below). I would very much like this generalised limit to really look like the good old \lim; in particular, if I take limit over a variable x, then I would like the symbol x to be placed below. I almost managed to accomplish this by exploiting the old \lim, and adding the prefix:               > p \!\! - \!\! \lim_x       However, if I replace x by a longer string (say, several variables), I get too much whitespace. I tried grouping the limit into a single object, like below, but this leads to the variable being placed right of the limit symbol, not below:               > {p \!\! - \!\! \lim}_x       Could someone please advise me what is the best way of writing such a limit? Here is a minimal example and the output.               \documentclass{article}     \usepackage     \begin{document}          Naive example:      $$     p-\lim_{x} f(x), \qquad     p-\lim_{x_1,x_2,\dots,x_n} f(x_1,x_2,\dots,x_n)     $$          With \verb"\!" used for indentation, without grouping:      $$     p\!\!-\!\!\lim_{x} f(x), \qquad     p\!\!-\!\!\lim_{x_1,x_2,\dots,x_n} f(x_1,x_2,\dots,x_n)     $$          With \verb"\!" used for indentation, plus grouping  :      $$     {p\!\!-\!\!\lim}_{x} f(x), \qquad     \operatorname{p\!\!-\!\!\lim}\limits_{x_1,x_2,\dots,x_n} f(x_1,x_2,\dots,x_n)     $$          \end{document}      ![enter image description here](http://i.stack.imgur.com/Q9CnK.png)


title: LyX: change PDF viewer

text: In LyX, how can I set Ubuntu's document viewer (Evince) as the preferred PDF reader for the generated PDF files? All of a sudden it started using Okular, which I don't like all that much.


title: Help implementing this matrix

text: I'm trying to implement the matrix and vector below, the number of columns in the matrix is equal to the number of rows in the vector but it's not showing properly. The matrix is composed of three inner matrices: `diag(p1,p2)`, Identity and `diag(p3,p4)`. The identity in the middle is `NxN`! and the vector is `[1 1 x1 ....xN 1 1]^T`               \begin{align}     \begin{bmatrix}     p_1 & 0 & \ldots & \ldots & 0\\0 & p_2 & \ldots & \ddots & 0\\ \vdots & \vdots & \Huge{\mathbf{I}} & \ldots & 0\\0 & 0 & \ldots & p_3 & 0\\0 & 0 & \ldots & 0 & p_4      \end{bmatrix}\begin{bmatrix}1\\1\\d_1\\ \vdots\\d_N\\1\\1\\ \end{bmatrix}     \label{Eq:matrix}     \end{align}


title: Trouble loading .PNG in article class

text: I'm in the process of writing my thesis, and am having trouble getting any images to load in my document. I'm using the article class, as it required the least amount of editing to get it to look like what I am after. When I try to add a picture using `\includegraphics{picture}`, it compiles file but when I try to open the PDF it tells me "File Not Found". I tried changing the class to report and it compiled fine. The error I get is : > ! Package pdftex.def Error: File `G:/Documents/Windows 7/Documents/Spring > 2014/ Thesis/Thesis/WOpic.png' not found. but this is the correct location and the file exists. Here's the beginning of the document and what packages i'm using. Also, I'm using TexMaker for editing and compiling.               \documentclass[11pt]{report}     \usepackage{cite,titletoc,tocloft,afterpage,setspace,graphicx,fixltx2e}     \usepackage[margin=1.25in]{geometry}     \usepackage[nottoc]{tocbibind}     \usepackage[english]{babel}     \usepackage[version=3]{mhchem}      Any ideas as to what the issue could be?


title: Go from B5 to A4 format

text: How can I change my document to being A4 instead of B5 and still keep the same relative margins? I really like the current look, but need it to be A4. Below is an attempt on a MWE (I don't quite know what relates to the margins).               \documentclass[10pt,twoside,b5paper,showtrims]{memoir}          % Stock and paper layout     \showtrimsoff     \pagebv     \setlrmarginsandblock{26mm}{20mm}{*}     \setulmarginsandblock{35mm}{30mm}{*}     \setheadfoot{8mm}{10mm}     \setlength{\headsep}{7mm}     \setlength{\marginparwidth}{18mm}     \setlength{\marginparsep}{2mm}               \checkandfixthelayout                 % Check if errors!     \sideparmargin{outer}                 % Put sidemargins in outer position               % Chapterstyle     \makeatletter     \makechapterstyle{mychapterstyle}{         \chapterstyle{default}         \def\format{\normalfont\sffamily}              \setlength\beforechapskip{0mm}              \renewcommand*{\chapnamefont}{\format\LARGE}         \renewcommand*{\chapnumfont}{\format\fontsize{40}{40}\selectfont}         \renewcommand*{\chaptitlefont}{\format\fontsize{32}{32}\selectfont}                             \setlength\midchapskip{1ex}              \renewcommand*{\printchaptertitle}[1]{\raggedleft \chaptitlefont ##1}         \renewcommand*{\afterchaptertitle}{\vskip0.5\onelineskip \hrule \vskip1.3\onelineskip}          }     \makeatother     \chapterstyle{mychapterstyle}          % Header and footer     \def\hffont{\sffamily\small}     \makepagestyle{myruled}     \makeheadrule{myruled}{\textwidth}{\normalrulethickness}     \makeevenhead{myruled}{\hffont\thepage}{}{\hffont\leftmark}     \makeoddhead{myruled}{\hffont\rightmark}{}{\hffont\thepage}     \makeevenfoot{myruled}{}{}{}     \makeoddfoot{myruled}{}{}{}     \makepsmarks{myruled}{         \nouppercaseheads         \createmark{chapter}{both}{shownumber}{}{\space}         \createmark{section}{right}{shownumber}{}{\space}         \createplainmark{toc}{both}{\contentsname}         \createplainmark{lof}{both}{\listfigurename}         \createplainmark{lot}{both}{\listtablename}         \createplainmark{bib}{both}{\bibname}         \createplainmark{index}{both}{\indexname}         \createplainmark{glossary}{both}{\glossaryname}     }     \pagestyle{myruled}     \copypagestyle{cleared}{myruled}      % When \cleardoublepage, use myruled instead of empty     \makeevenhead{cleared}{\hffont\thepage}{}{} % Remove leftmark on cleared pages          \makeevenfoot{plain}{}{}{}            % No page number on plain even pages (chapter begin)     \makeoddfoot{plain}{}{}{}             % No page number on plain odd pages (chapter begin)          %          \begin{document}     %     \chapter{Discussion}     \chapter{Modelling}          \end{document}


title: Trouble setting background color using Standalone's convert command

text: I'm creating PNGs directly from LaTeX using the `xelatex`, the `standalone` document class and the `convert` option of `standalone`. I have ImageMagick installed, and it all works fine. The only issue is that the PNGs it's creating have a transparent background instead of the default white.               \documentclass[multi={minipage}, border=5, convert={true}]{standalone}          \usepackage{standalone}     \standaloneconfig{convert={convertexe={convert}}}     \pagestyle{empty}     \begin{document}     \begin{minipage}{500bp}     Some text     \end{minipage}     \end{document}      I'm using the `empty` pagestyle to make sure that there is no whitespace at the bottom of the pages. Does anyone know what could be causing the PNGs to be transparent? What is the syntax to manually set the background color?


title: Consistently specify function to be graphed with or without gnuplot

text: I would like to be able to specify a function and then graph that with with `pgfplot` only, or use `gnuplot` to compute the coordinates. As far as I know there are two main differences in how the functions are parsed:   1. `pgf` uses `^` and `gnuplot` uses `**` for exponentiation. This is easily fixed with the `translate gnuplot=true`, so is not a problem.   2. Another is that `pgf` uses degrees for trigonometric functions and `gnuplot` uses radians. Is there a way to adjust this also?  But, ignoring the possible problem with #2 above, is there a way to specify the function once and use `pgfplots` to graph it with or without `gnuplot`? So far, I have been specifying the `pgfplots` function as follows:               \pgfmathdeclarefunction{FunctionF}{1}{\pgfmathparse{(#1)^(3)}}%      But, when I want to `gnuplot` I have been defining it as follows:               \newcommand*{\FunctionFGnuplot}{(x)^3}%      Is there not a way I can specify the function once and use it both cases? Just to be clear I don't have an issue with the fact that the format of the `addplot` command is different between the two, just the specification of what the function is. Here is a MWE illustrating this:               \documentclass[border=5pt]{standalone}     \usepackage{pgfplots}          \newcommand*{\XAxisMin}{-1.0}     \newcommand*{\XAxisMax}{3.0}     \newcommand*{\YAxisMin}{-2.0}     \newcommand*{\YAxisMax}{10}          \newcommand*{\DomainMinF}{\XAxisMin}     \newcommand*{\DomainMaxF}{2.2}          \pgfkeys{/pgfplots/Axis Style/.style={         clip=false,% so that we can see labels placed outside         xmin=\XAxisMin, xmax=\XAxisMax,         ymin=\YAxisMin, ymax=\YAxisMax,          domain=\DomainMinF:\DomainMaxF,         width=6.5cm     }}          % Gnuplot options here  have no effect if not using GnuPlot     \pgfkeys{/pgfplots/Plot Style/.style={         translate gnuplot=true,% can use ‘^’ instead of ‘**’         id=foo,         mark=none,%         domain=\DomainMinF:\DomainMaxF,%         samples=50,%         ultra thick,     }}          \newcommand*{\AddLabel}[1]{\node [align = center] at (axis cs: 0.4,5) {#1};}%     %-----------------------------          % I would like to only have to specify the function here once     \pgfmathdeclarefunction{FunctionF}{1}{\pgfmathparse{(#1)^(3)}}%     \newcommand*{\FunctionFGnuplot}{(x)^3}%               \begin{document}     \begin{tikzpicture}     \begin{axis}[Axis Style]         \addplot [Plot Style, blue]             ({x},{FunctionF(x)});%         \AddLabel{1. without \\ Gnuplot}     \end{axis}     \end{tikzpicture}     \begin{tikzpicture}     \begin{axis}[Axis Style]         \addplot [Plot Style, red]             gnuplot% Use Gnuplot for Graph 2             {\FunctionFGnuplot};%         \AddLabel{2. with \\ Gnuplot}     \end{axis}     \end{tikzpicture}     \end{document}


title: table notes in English typography

text: I'm using the code given below:               \documentclass[11pt]{report}     \usepackage[english]{babel}     \usepackage{lipsum}     \begin{document}     \lipsum[1]\footnote{real footnote}     \begin{table}[!ht]\centering     \caption{Title}     \begin{minipage}[t]{\textwidth}     \centering\small     \begin{tabular}{ll}      A & B \\      name  & age \footnotemark \\      size & height \footnotemark  \\      \end{tabular}     \footnotetext[2]{table note}     \footnotetext[4]{table note}     \end{minipage}     \end{table}     \lipsum[1]     \end{document}      and I have three questions:   1. does this comply with English typographic rules?   2. if yes, why does `\footnotetext[2]{table note}` yield a `b` and `2` for the numbering?   3. should not I control the width of the minipage to have the table notes appear right under the table and not on the left as in the current version?


title: How to combine multiple rows with multiple columns with headings in one table?

text: I am struggling to create a table with three dimension to look up a fourth. Consider the following binomial table as an example               ##===##=================##===##     ||   ||        p        ||   ||     || n **-----+-----+-----** k ||     ||   || .1  | .25 | .5  ||   ||     ##===##=====*=====*=====##===##     ||   || ... | ... | ... || 1 ||     ||   **-----+-----+-----**---**     || 3 || ... | ... | ... || 2 ||     ||   **-----+-----+-----**---**     ||   || ... | ... | ... || 3 ||     ##===##=====*=====*==========##     ||   || ... | ... | ... || 1 ||     ||   **-----+-----+-----**---**     || 4 || ... | ... | ... || 2 ||     ||   **-----+-----+-----**---**     ||   || ... | ... | ... || 3 ||     ##===##=====*=====*==========##     ||   || ... | ... | ... || 1 ||     ||   **-----+-----+-----**---**     || 5 || ... | ... | ... || 2 ||     ||   **-----+-----+-----**---**     ||   || ... | ... | ... || 3 ||     ##===##=====*=====*=====##===##      Where `*` is a single line crossing a double line and `...` are the corresponding `b(n;p;k)`. I am just asking for a convenient way to format a table like this, there is no need to calculate the binomial probabilities or something like that since this is just an example.


title: How to reduce size of bibliography header

text: I want to reduce the amount of space that the title of my bibliography takes up. I've tried using negative vspace, albeit unsuccessfully. My current MWE is:               \documentclass[12pt,onecolumn,oneside,a4paper]{report}          \usepackage{lmodern}     \usepackage{pinlabel}         \usepackage[english]{babel}         \usepackage{graphicx}         \usepackage{nicefrac}         \usepackage{amssymb}         \usepackage[usenames,dvipsnames]{color}         \usepackage{nicefrac}        \usepackage{float}        \usepackage[small,justification=justified,singlelinecheck=false]{caption}        \usepackage[version=3]{mhchem}        \usepackage{multirow}       \usepackage{supertabular}        \usepackage{booktabs}      \usepackage{tabularx}      \usepackage{array}        \usepackage{bpchem}         \usepackage{setspace}          \usepackage[super,sort&compress,comma]{natbib}         \usepackage[left=3.0cm,top=3.5cm,right=3cm,bottom=3.0cm,head=0.5cm,foot=0.5cm]{geometry}         \usepackage{subfig}        \usepackage{balance}         \usepackage{hyperref}         \usepackage{chngcntr}        \usepackage{wrapfig}         \usepackage{chemscheme}          \usepackage[font={scriptsize}]{caption}         \usepackage{enumerate}         \usepackage{fancyhdr}          \begin{document}          \section{Introduction}     Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.\cite{Solovyev05}           \section{Middle}     Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.\cite{Forster60}          \section{Conclusion}     Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci veli.\cite{Shinoda10}          \renewcommand\bibname{References}     \scriptsize            \bibliography{Bibio}     \bibliographystyle{rsc}          \end{document}


title: TOC alignment in memoir

text: I'm trying to get chapters and sections to line up in a memoir ToC as:               Chapter one        Chapter title                        Section title                        Another section                        A third section          Chapter two        Second chapter title                         Another etc.      I really can't fathom the pseudo code on p.158 of the manual but I've tried setting widths for `\cftpartnumwidth` and `\cftchapternumwidth` but I can't get these boxes to work. My code:               % part     \cftpagenumbersoff{part}     \setlength{\cftpartnumwidth}{4.0cm}          % chapter     \setlength{\cftchapternumwidth}{4.0cm}     \renewcommand*{\cftchaptername}{Chapter\space}     \renewcommand*{\cftchapteraftersnum}{\hfill}     \renewcommand*{\chapternumberline}[1]{\cftchaptername \numtoname #1  \cftchapteraftersnum}          % section     \setlength{\cftsectionnumwidth}{4.0cm}      I can control the section title placement, but something is breaking the chapter title placement (I presume the renewal definition of `\cftchapteraftersnum`. Can anyone give me the spell? thanks ============================== UPDATE: I modified the code with Gonzalo's suggestion to:               \newlength\mylen     \settowidth\mylen{\bfseries\chaptername\hspace{3em}}          % part     \cftpagenumbersoff{part}     \addtolength\cftpartnumwidth{\mylen}          % chapter     \addtolength\cftchapternumwidth{\mylen}     \renewcommand\cftchapterpresnum{\chaptername~}           % section     \renewcommand\cftsectionindent{\dimexpr\mylen+1.5em\relax}      But it gives this: ![enter image description here](http://i.stack.imgur.com/xNqQC.png) The "Sections" are not lining up with the "Chapters"...


title: Automate derivative representation in TikZ

text: I am to begin to write some lecture notes for my students and I will have to do multiple diagrams like the one shown below to represent the simple notion of derivatives graphically. The problem I face is to find a way to automate the creation of such figures. For example, what am looking for is:   1. Define a function f(x) (in `TikZ` of course)   2. Declare the x-coordinates of two points, say x1 and x2. Now these two coordinates can be used to calculate their corresponding y coordinates and the distances shown in the triangle. Thus am looking for something like, `\derivative{x*x}{x1}{x2}`. I don't know how the domain can be incorporated but I guess that can be done later.               \documentclass[letterpaper]{article}     \usepackage{fullpage}     \usepackage{amsmath,amssymb,enumitem}     \usepackage[dvipsnames]{xcolor}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows}          \pdfpageheight\paperheight     \pdfpagewidth\paperwidth     \parindent0pt          \begin{document}     \begin{tikzpicture}[line cap=round,line join=round,>=stealth',x=1.0cm,y=1.0cm,domain=-0.5:2.25]     \draw[->,color=black] (-1,0) -- (4,0);     \foreach \x in {1,2,3}     \draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};     \draw[color=black] (4,0) node [right] { $x$};     \draw[->,color=black] (0,-1) -- (0,5);     \foreach \y in {1,2,3,4}     \draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};     \draw[color=black] (0,5) node [above] { $y$};     \draw[color=red,<->] plot[id=quad] function{x*x} node[right] {$f(x) =x^2$};     \fill[black] (0.5,0.25) circle (1.25pt);     \fill[black] (1.5,2.25) circle (1.25pt);     \draw (0.5,0.25)--(1.5,2.25)--(1.5,0.25)--cycle;     \draw[|-|,yshift=-0.25cm] (0.5,0.25)--(1.5,0.25);     \draw[yshift=-0.25cm](1,0.25) node[fill=white] {1};     \draw[|-|,xshift=0.25cm] (1.5,0.25)--(1.5,2.25);     \draw[xshift=0.25cm] (1.5,1.25) node [fill=white] {2};     \end{tikzpicture}     \end{document}      Image of the result: ![enter image description here](http://i.stack.imgur.com/bLUzC.png)


title: Beamer option definition

text: Hi I'm building from scratch a new beamer theme. I would like to define an option in the theme where I can define the conference name which can be used afterwards for the footline. Up to now I've done the following. In the main theme I've defined               \DeclareOptionBeamer{conference}{\PassOptionsToPackage{conference=#1}{beamerouterthememytheme}}      and in the `beameroutermytheme.sty` I've defined the following               \def\beamer@mytheme@conference{}     \DeclareOptionBeamer{conference}{\def\beamer@mytheme@conference{#1}}      In the footline I've done the following               \defbeamertemplate*{footline}{mytheme}[1]{     \begin{beamercolorbox}[ht=0.15\paperwidth,leftskip=.3cm,rightskip=.3cm,sep=0.1cm]{footlinecolor}     \usebeamerfont{section in head/foot}%     \insertshortauthor~-~\@date~-~\beamer@mytheme@conference \hfill      \insertframenumber{}/\inserttotalframenumber{}     \end{beamercolorbox}%     }      Unfortunately it does not work although I can't understand why. Any suggestion? As asked I try to provide a working example. Actually I hope it works as I've done definition for all inner,outer,color and main theme. In any case the file theme beamerthemeMytheme.sty sounds like               \mode<presentation>     \RequirePackage{pgf}     \DeclareOptionBeamer{conference}{\PassOptionsToPackage{conference=#1}{beamerouterthememytheme}}     \DeclareOptionBeamer{pageofpages}      {\PassOptionsToPackage{pageofpages=#1}      {beamerouterthememytheme}}     \ProcessOptionsBeamer     \useoutertheme{mytheme}     \mode     <all>      The file beameroutermytheme.sty sounds like               \mode<presentation>     \RequirePackage{pgf}          % efda colors     \definecolor{eblue}{rgb}{.258,.38,0.63}     \definecolor{e2blue}{rgb}{0.411,0.521,0.709}     % horizontal shading for footer     \pgfdeclarehorizontalshading{beamer@topshade}{\paperwidth}{%      color(0pt)=(eblue);      color(0.5\paperwidth)=(eblue!50);     color(\paperwidth)=(e2blue!50)}          % define the heigth of the footer     \newlength{\beamer@mytheme@headheight}     \setlength\beamer@mytheme@headheight{0.13\paperwidth}     %for date definition     \def\date#1{\def\@date{#1}}     % for page counting     \def\beamer@mytheme@pageofpages{of}      \DeclareOptionBeamer{pageofpages}     {\def\beamer@mytheme@pageofpages{#1}}      \ExecuteOptionsBeamer{pageofpages=of}      \ProcessOptionsBeamer     \def\beamer@mytheme@conference{}     \DeclareOptionBeamer{conference}{\def\beamer@mytheme@conference{#1}}     \defbeamertemplate*{footline}{mytheme}[1]     {%     \begin{pgfpicture}{0pt}{0pt}{\paperwidth}       {0.3\beamer@mytheme@headheight}        \pgfpathrectangle{\pgfpointorigin}{\pgfpoint{\paperwidth}         {0.3\beamer@mytheme@headheight}} \pgfusepath{clip}       \pgftext [ left , base ]{\pgfuseshading{beamer@topshade}}     \end{pgfpicture}     \vskip-0.3\beamer@mytheme@headheight     \begin{beamercolorbox}    [ht=0.3\beamer@mytheme@headheight,leftskip=.3cm,rightskip=.3cm,sep=0.1cm]{footlinecolor}     \usebeamerfont{section in head/foot}%     \insertshortauthor~-~\@date~-~\beamer@mytheme@conference \hfill      \insertframenumber{}\hskip1pt\beamer@mytheme@pageofpages{}     \hskip1pt\inserttotalframenumber{}     \end{beamercolorbox}%     }      Finally the example is the following               \documentclass[12pt]{beamer}     \usetheme[conference=Prova]{mytheme}     \title[Prova]{Prova}     \author[myself]{Io}     \date{\today}     \begin{document}     \begin{frame}{Prerequisites \& Goals}     \begin{block}{LaTeX}     \begin{itemize}     \item Obviously some basic LaTeX knowledge is necessary     \item Some more features will be provided here     \end{itemize}     \end{block}     \end{frame}     \end{document}


title: Set font size in pt in a listing

text: How can I set the `basicstyle` option to force the use of 9pt fonts in listings regardless of the default size of the document? Using 9pt fonts is a requirement of the guidelines that I am using, so I must be sure that it stays that way even if I change other font settings.


title: Why linebreaks break the line height within certain environments with size-changing macros?

text: Why linebreaks break the line height within certain environments with size- changing macros? I'm trying to understand what's the difference between these three approaches:   1. `\newenvironment`   2. between `{}` or `\begingroup`/`\endgroup`   3. inside a `minipage`               \documentclass{article}     \begin{document}     \thispagestyle{empty}     \section{With newenvironment}          \newenvironment{env}{\begin{center}\LARGE}{\end{center}}     \begin{env}       Text with\\linebreak     \end{env}          \section{With begin/endgroup}          \begin{center}     {\LARGE     Text with\\linebreak}     \end{center}          \begin{center}     \begingroup     \LARGE     Text with\\linebreak     \endgroup     \end{center}          \section{With minipage}          \begin{center}     \begin{minipage}{\textwidth}\centering       \LARGE       Text with\\linebreak     \end{minipage}     \end{center}          \end{document}      ![enter image description here](http://i.stack.imgur.com/bwqq3.png)


title: Removing footnotes from pdf bookmarks

text: I have                  \section{My Title\footnote{ My Footnote 1}\footnote{My Footnote 2}}      . Both pdfLatex and Latex automatically creates bookmarks from my section headers. That's what I want. But they also include the footnotes. So an example of bookmark is                  "My Title My foootnote 1 My Footnote 2"      . But I want only                  "My Title"      How do I achieve this?


title: LyX sync document settings of child documents with master especially concerning citation style

text: How can I make sure, that the document settings of a child document are compatible to the master document? Today I had a big hassle concerning citation: If I choose "citation style standard (numerical)" in the master document and "natbib" in the child document I get in the "insert citation window" (in the child document) the options that belong to natbib package (citet, citep, citeauthor etc.). Trying to render the document gives an error: "control sequence undefinded" (obviously, as the \citet is only defined in the natbib package, which I haven't included (in the master, at least)). Do I have to keep master and child settings in sync manually? Shouldn't the be possible to be done automatically or are there use cases where different settings are useful? I expect a behaviour just like LaTeX, where it is also possible to have subdocuments without any header. This problem: LyX BibTeX with child-documents not working was obviously caused by the same issue.


title: What does \flrow@restyle do?

text: For a long time, I had an issue when using the `floatrow` package together with the `twocolumn` option of the `article` class. I did solve the problem by trial and error but I'd like to understand what I did and if my workaround has some side effects. So, my question is: what does `\flrow@restyle` do and why is it redefining `\textwidth` to `\columnwidth`? @David Carlisle told me this in chat (and triggered this new question): > I would guess that after `\textwidth\columnwidth` latex tries to fit two > columns into `\textwidth` (because that's what it normally does) and finds > that they don't fit as `\textwidth` has been made only wide enough for one. > I suppose the question is, what was the package trying to do at that > point.....


title: Image row in Beamer

text: A presentation contains a huge amount of images. Therefor it would be nice if one can insert a row of images on the bottom of the slide. If the item apprears the corresponding image for instance is no longer grayscale. Is there a package to make a row of images in a beamer presentation? For instance I have a slide:               \begin{frame}      \begin{enumerate}[<+->]       \item Cat       \item Dog       \item Horse      \end{enumerate}     \end{frame}      The bottom of the frame should contain three images (cat, dog, horse). When the cat item appears the cat image appears at the bottom, the same effect for the dog and horse.


title: How to draw array (data structure) and show partition?

text: I'm doing a homework for algorithm class where I have to show what a particular array looks like at each step of the quick sort algorithm, in a manner similar to this image: (page from CLRS book). ![array image](http://i.stack.imgur.com/2OMh1.png) I would like to know how to draw an array that looks like the one in the book. In particular, I want to know how to (in order from most to least important)   * Draw an array.   * Put letter(s) above a node or a blank space.   * Draw the black bars that partition the array.   * Customize a cell with gray or light gray color.


title: How to add a newline in a table cell?

text: How can I put a new line (line break) within a table cell? I'm at a loss how to do this. I'm not using lyx or anything special, just MacTex and texmaker.


title: customizing section formatting using memoir class (color and numbering)

text: I see in memoir that **\section** is implemented like so:               \newcommand{\section}{%       \sechook%       \@startsection{section}{1}%  level 1           {\secindent}%            heading indent           {\beforesecskip}%        skip before the heading           {\aftersecskip}%         skip after the heading           {\normalfont\secheadstyle}} % font     \newcommand{\sechook}{}     \newcommand{\setsechook}[1]{\renewcommand{\sechook}{#1}}     \newlength{\secindent}     \newcommand{\setsecindent}[1]{\setlength{\secindent}{#1}}       \setsecindent{\z@}     \newskip\beforesecskip     \newcommand{\setbeforesecskip}[1]{\setlength{\beforesecskip}{#1}}       \setbeforesecskip{-3.5ex \@plus -1ex \@minus -.2ex}     \newskip\aftersecskip     \newcommand{\setaftersecskip}[1]{\setlength{\aftersecskip}{#1}}       \setaftersecskip{2.3ex \@plus .2ex}     \newcommand{\secheadstyle}{}     \newcommand{\setsecheadstyle}[1]{\renewcommand{\secheadstyle}{#1}}     %%%  \setsecheadstyle{\Large\bfseries\raggedright}       \setsecheadstyle{\Large\bfseries\memRTLraggedright}      I thought I'd try color'izing my section numbers, and first tried:               \renewcommand{\sechook}{\color{blue}}      This didn't work, since the scope of the blue was _everything_ after and including the section. Next I tried:               \setsecheadstyle{\color{blue}\Large\bfseries\memRTLraggedright}      This is better, but color'izes the section number and the section title. I can't see in the **\section** implementation above where the counter is, so I think I'm looking in the wrong place. Here's a MWE for my busted attempt:               \documentclass[openany]{memoir}     \usepackage{color}          \setsecheadstyle{\color{blue}\Large\bfseries\memRTLraggedright}          \begin{document}          \chapter{Foo}     \section{blah}     \section{stuff}     \subsection{more stuff}     \subsubsection{even more stuff}          \end{document}      This produces ![attempt at colorizing](http://i.stack.imgur.com/QpT7U.png) I also see that I've lost subsection and subsubsection numbers (which I had with the book class). So two questions:   * How can I get back my sub and subsub section numbers?    * How would one color just the section numbers (and subsection numbers once I get them back)?


title: tlmgr with Ubuntu TexLive

text: I installed `TexLive` through Software Center of Ubuntu. However it does not contain tlmgr which is quite useful to update the packages. Is it possible to use `tlmgr` with default `TexLive`? If yes, how can I only install tlmgr (without installing `TexLive 2011`)? I ran `install.pl` script in the downloadable `TexLive 2011` installer folder, but I could not find a way to install only `tlmgr`. Thanks.


title: Fraction with doubled line

text: Is there a way to make the fraction line look like the equality (=) sign, i.e., to have two parallel horizontal lines with a little gap in between? Many thanks!


title: In fancytooltips, how to have a set of aligned equations or matrix

text: The package `fancytooltips` allows for layers, where a rollover by mouse over a target brings up a box of comments. I want the target to contain extended mathematical objects such as aligned equations or matrices. To restate, this is somewhat similar to having a Base and an Exponent. Base is part of the main page and Exponent is the layer that shows up if you hover on Base. I want the Base to be a set of aligned equations or a matrix.


title: Where to get help for the package options?

text: OS: Windows 7 + SP1   TeX: MiKTeX 2.9   IDE: Kile 2.1 For getting help on usage of package options, I usually Google "foo options latex", where `foo` is the name of the package. I wanted to know whether the documentation is available on the host machine where my LaTeX is installed. I can see all the packages I am using in the MiKTeX package manager. But in the package manager I am not able to locate the help files associated with the packages (if at all they are present on my computer).


title: Small caps in section but not in ToC

text: With LaTeX, I would like to set all my section titles in small capitals but I need the `\textsc` to be 'cancelled' in my table of content. Is that possible somehow ? I currently do this :               \section[Introduction]{\textsc{Introduction}}      Is there a automatic way?


title: Help with verbatim-like environments

text: I am writing a script for LaTeX shallow parsing (assuming that there are no complicated definitions in the preamble). First of all I decided to check the document for in-line verbatims and comments, because they make TeX meta characters inactive. I have managed to parse document into three different types: `inlineVerbatim`, `inlineComment` and `Other`. However I am still wondering, are there any other in-line commands, that make any of the metacharacters `{}\\#^_$&%~` inactive or force to have different syntax meaning? Also it would be a big help if someone told me about enviroments with the same properties besides `verbatim`,`comment` and `listling`.


title: Command for text in math mode that does not become italicized inside theorem statements

text: This has probably been answered somewhere, but I can't find it from some searching. I sometimes want to write something like `Leb` for lebesgue measure, and I would like it to be non-italicized, so I usually use `\text{Leb}` in math mode, but this has the annoyance that it changes inside of an italicized (ams) theorem environment. I usually just hack this and write `\text{\emph{Leb}}` but clearly this is not ideal. Is there a replacement for `\text` that won't inherit this italicizing? Alternatively, is there a more clever hack, in which I can make my macro detect if its going to be italicized and then automatically put in the `\emph` hack? Clearly the first would be ideal, but the second would also be acceptable.


title: Change line style in pgfplots in the middle of a line

text: I have the following MWE graph:               \documentclass{memoir}     \usepackage{pgfplots}     \pgfplotsset{compat=1.10}     \begin{document}     \begin{tikzpicture}     \begin{axis}     \addplot coordinates {         (1000,1)         (1100,1.3589)         (1200,2.5248)         (1300,4.0476)         (1400,7.9426)         (1500,13.032)         (1600,18.165)         (1700,20.775)     };     \end{axis}     \end{tikzpicture}     \end{document}      I want to make the line turn into a dashed line after the 1400 point. This is similar to this question but I want to supply my own data. How can I change style in the middle of an addplot?


title: Should I use fix-cm?

text: I recently became aware of the existence of the `fix-cm` package. I've looked at the documentation in fixltx2e.pdf, but it's not clear to me exactly what the problem is that it fixes. Should I worry that I have been getting suboptimal glyphs all this time? Or should I only worry if the log contains something like:               LaTeX Font Warning: Size substitutions with differences     (Font)              up to 13.12pt have occurred.      or               LaTeX Font Warning: Font shape `OT1/cmr/m/n' in size <X> not available      ? Should I just always use it? Are there any downsides? Concern stems from this part of the documentation: > The appearance of the T1 and TS1 encoded CM fonts (aka ‘EC’) is made as > similar as possible to the traditional (OT1 encoded) ones. Particularly, a > number of broken or ugly design sizes are no longer used, the look of the > bold sans serif typeface at large sizes is considerably improved, and > mismatches between the text fonts and the corresponding math fonts are > avoided. Does this apply to the default situation with `pdflatex`, with Postscript Type 1 CM fonts embedded in the PDF? Can anyone provide an example of output with different appearance when using `fix-cm`? While searching for information, I discovered the package `anyfontsize`, which apparently allows arbitrary scaling for any font, not just Computer Modern. Does this accomplish the same thing as `fix-cm`, but more generally? The fixltx2e documentation is adamant that one must load `fix-cm` before `\documentclass` and use the command `\RequirePackage`, like so:               \RequirePackage{fix-cm}     \documentclass ...      and says not to do this for any other package. Meanwhile, `anyfontsize` is just loaded normally with `\usepackage{anyfontsize}`. If `anyfontsize` accomplishes the same thing, how come it doesn't need to be loaded first with `\RequirePackage`? Conversely, if the fix can be done in a normal package, why is `fix-cm` so stringent? Thanks for the suggestions for alternate font packages. Let's assume that I want to use Computer Modern, and I want to stick with the default version in TeX Live 2012 (which I believe is the Bluesky conversion of CM to Postscript Type 1), because I've heard that this is the highest-quality vectorization (at least if you don't need the new symbols in `lmodern`.) Discussion about this properly belongs to another question, like Why does Latin Modern make strange- appearing output? or Latin Modern vs cm-super?.


title: Different sizes of font available in table?

text: I have a table and it appears I only have two options when it comes to font size: large and small. There should be a medium option, correct? I get an error when I replace small or large with medium. The beginning of my table looks like this:               \begin{table*}[ht]     {\small     \hfill{}     \small     \begin{tabular}{|p{3.5cm}|p{8cm}|p{5cm}|}      How do I get a universal font size for the table that is not huge or too small to read?


title: Redefine \question command in exam class to wrap in an environment

text: I'd like to redefine the question command from the exam class to wrap each question in a new environment. That's the general description. What I'm trying to do is take a document that is written as an exam and reformat it to import into a flashcard program called Anki. The import tool looks for an environment called "note" and the "front" and "back" of the card can be mapped to the "field" environments. Here's an example of what I mean:               \documentclass{exam}          \newenvironment{note}{\paragraph{NOTE:}}{}     \newenvironment{field}{\paragraph{field:}}{}          \begin{document}     % An example of an exam         \begin{questions}             \question Are you there?                 \begin{choices}                     \choice No                     \CorrectChoice Yes                 \end{choices}                 \begin{solution}                     yes you are there                 \end{solution}             \question Cake or death?                 \begin{choices}                     \CorrectChoice Cake                     \choice Death                 \end{choices}                 \begin{solution}                     of course you want cake                 \end{solution}         \end{questions}          % I'd like to re-define the \question command to do this         \begin{note}             \begin{field}                 \begin{questions}                     \noprintanswers                     \question Are you there?                         \begin{choices}                             \choice No                             \CorrectChoice Yes                         \end{choices}                         \begin{solution}                             yes you are there                         \end{solution}                 \end{questions}             \end{field}             \begin{field}                 \begin{questions}                     \printanswers                     \question Are you there?                         \begin{choices}                             \choice No                             \CorrectChoice Yes                         \end{choices}                         \begin{solution}                             yes you are there                         \end{solution}                 \end{questions}             \end{field}         \end{note}         \begin{note}             \begin{field}                 \begin{questions}                     \noprintanswers                     \question Cake or death?                         \begin{choices}                             \CorrectChoice Cake                             \choice Death                         \end{choices}                         \begin{solution}                             of course you want cake                         \end{solution}                 \end{questions}             \end{field}             \begin{field}                 \begin{questions}                     \printanswers                     \question Cake or death?                         \begin{choices}                             \CorrectChoice Cake                             \choice Death                         \end{choices}                         \begin{solution}                             of course you want cake                         \end{solution}                 \end{questions}             \end{field}         \end{note}     \end{document}


title: Is there a TikZ equivalent to the PSTricks \ncdiag command?

text: The `pst-node` package provides the `\ncdiag` command, which allows you to connect two nodes with a diagonal line, but with an extra `arm` parameter which puts a bend in the line and allows the connections at each end to meet the node perpendicularly. Is there a simple way to get this effect in TikZ? Here's an example (compile with latex or xelatex).               \documentclass{article}     \usepackage{tikz}     \usepackage{pst-node}     \begin{document}          \rput(0,3){\rnode{A}{Foo}}     \rput(2,0){\rnode{B}{Bar}}     \ncdiag[angleA=-90,angleB=90,arm=5mm]{A}{B}     \hspace{2in}     \begin{tikzpicture}     \node at (0,0) (A) {Bar};     \node at (-2,3) (B) {Foo};     \draw[thick] (A) -- (B);     \end{tikzpicture}     \end{document}      ![output of code](http://i.stack.imgur.com/k6gdn.png)


title: pst-text with plain XeTeX

text: How, if possible, can I use `pst-text` with plain XeTeX? I have TeX Live 2011. When I try to run the minimal example:               \input pst-text          \pscharpath{TeXnik}     \bye      , I get a bunch of `** WARNING`'s, among them:               ** WARNING ** Failed to read converted PSTricks image file.      and               ** WARNING ** Interpreting special command PST: (ps:) failed.      Am I doing something wrong, or is it not supposed to work (this way), or is there some step I'm missing? I don't get any warnings or anything weird in the logfile, but I do to the terminal:               Ilmalaiva% xetex pikakoe.tex      This is XeTeX, Version 3.1415926-2.3-0.9997.5 (TeX Live 2011)      restricted \write18 enabled.     entering extended mode     (./pikakoe.tex     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/pst-text/pst-text.tex     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/pstricks/pstricks.tex     we are running tex and have to define some LaTeX commands ...     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/xkeyval/pst-xkey.tex     2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/xkeyval/xkeyval.tex     2008/08/13 v2.6a key=value parser (HA)     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/xkeyval/xkvtxhdr.tex     2005/02/22 v1.1 xkeyval TeX header (HA))     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/xkeyval/keyval.tex)))     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/pstricks/pst-fp.tex     `pst-fp' v0.05, 2010/01/17 (hv))     `PSTricks' v2.20  <2011/04/23> (tvz)     (/usr/local/texlive/2011basic/texmf-dist/tex/xetex/xetex-pstricks/pstricks.con     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/pstricks/config/xdvipdfmx.     cfg))     (/usr/local/texlive/2011basic/texmf-dist/tex/xetex/xetex-pstricks/pstricks.con     (/usr/local/texlive/2011basic/texmf-dist/tex/generic/pstricks/config/xdvipdfmx.     cfg     Using PSTricks configuration for XeTeX+xdvipdfmx     )))  v1.00, 2006/11/05(tvz,hv)) [1]     ** WARNING ** pdf_open: Not a PDF 1.[1-5] file.     ** WARNING ** Failed to include image file "/var/folders/2w/40kkgr916n34r23ts240d9bh0000gn/T//dvipdfmx.8Yyf2pkO"     ** WARNING ** >> Please check if     ** WARNING ** >>   rungs -q -dNOPAUSE -dBATCH -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=%v -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -sOutputFile='%o' '%i' -c quit     ** WARNING ** >>   %o = output filename, %i = input filename, %b = input filename without suffix     ** WARNING ** >> can really convert "/var/folders/2w/40kkgr916n34r23ts240d9bh0000gn/T//dvipdfmx.8Yyf2pkO" to PDF format image.     ** WARNING ** pdf: image inclusion failed for "/var/folders/2w/40kkgr916n34r23ts240d9bh0000gn/T//dvipdfmx.8Yyf2pkO".     ** WARNING ** Failed to read converted PSTricks image file.     ** WARNING ** Interpreting special command PST: (ps:) failed.     ** WARNING ** >> at page="1" position="(123.75, 759.927)" (in PDF)     ** WARNING ** >> xxx "PST: tx@Dict begin gsave STV /ArrowA { moveto } def /ArrowB { }"      )     Output written on pikakoe.pdf (1 page).     Transcript written on pikakoe.log.


title: longtable counter

text: please forgive me if this has already been answered, but i could not seem to find a resolution on any of the boards. i have a longtable that spans multiple pages. I would like to add a footnote at the end of the table that reads 1 of n (n being the number of pages that the longtable spans). I have attached a simple example below. In this example I would like to replace the footer "Continued on next page" with 1 of 1 or 1 of 2 (depending on the page). Any help would be greatly appreciated. thanks in advance.               \documentclass[12pt]{article}     \usepackage{longtable}          \begin{document}     \begin{center}     \begin{longtable}{|c|c|c|c|}     \caption{A simple longtable example}\\     \hline     \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth  entry} \\     \hline     \endfirsthead     \multicolumn{4}{c}%     {\tablename\ \thetable\ A simple longtable example} \\     \hline     \textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\     \hline     \endhead     \hline \multicolumn{4}{r}{\textit{Continued on next page}} \\     \endfoot     \hline     \endlastfoot     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\     \end{longtable}     \end{center}     \end{document}


title: Enumeration of footnotes wrong

text: I have a small table, where I need a footnote and after it a text with another footnote.   So I researched for it and found out, that I shall use `\footnotemark` in combination with `\footnotetext` in the table. But what shall I use after the table? I have tried `\footnotemark` and `\footnote`, but always the enumeration in the footnotes list is wrong. In the text stands for example 1 and 2 and in the list of footnotes 2 and 2. Also I tried to give numbers, but **I don't want to enumerate** all footnotes on myself.   Furthermore I set following options `plainpages=false, hyperfootnotes=false` for `hyperref`, because I get warnings like               name{Hfootnote.2} has been referenced but does not exist, replaced by a fixed one     pdfTeX warning (dest): name{Hfootnote.1} has been referenced but does not exist      and               destination with the same identifier (name{page.1}) has been already used, duplicate ignored     <to be read again>  \chapter      I used for the table the `tabular`.


I have the following files:               my_folder/        include/            mypackage.sty        main.tex      The package's name is 'mypackage'. Now, in `main.tex` I do               \usepackage{include/mypackage}      using the file path rather than the package name. This works, but warns me: > You have requested package `include/foo' but the package provides `foo' How do I avoid this **without** placing the document class file elsewhere?


title: Is there any harm in "known incorrect sRGB profile" warning from dvips?

text: This is what I get from `stderr` stream when compiling with `lualatex` under MikTex 2.9:               This is dvips(k) 5.993 Copyright 2013 Radical Eye Software (www.radicaleye.com)     ' TeX output 2014.06.27:1240' -> chart-autopp.ps     <d:/Program Files (x86)/MiKTeX 2.9/dvips/base/tex.pro>     <d:/Program Files (x86)/MiKTeX 2.9/dvips/misc/alt-rule.pro>     <d:/Program Files (x86)/MiKTeX 2.9/dvips/pstricks/pstricks.pro>     <d:/Program Files (x86)/MiKTeX 2.9/dvips/pstricks/pst-algparser.pro>     <d:/Program Files (x86)/MiKTeX 2.9/dvips/pst-tools/pst-tools.pro>     <d:/Program Files (x86)/MiKTeX 2.9/dvips/pstricks/pst-dots.pro>     <d:/Program Files (x86)/MiKTeX 2.9/dvips/pst-barcode/pst-barcode.pro>     <d:/Program Files (x86)/MiKTeX 2.9/dvips/base/special.pro>. [1]      libpng warning: iCCP: known incorrect sRGB profile     libpng warning: iCCP: known incorrect sRGB profile      Are these warnings indicating that something needs to be corrected, or they can be ignored? MWE:               \documentclass[border=10pt]{standalone}     \documentclass{article}     \usepackage{pst-barcode}     \usepackage[crop=off]{auto-pst-pdf}          \begin{document}          \begin{adjustbox}{valign=t}     \begin{pspicture}(1.02in,1.02in)         \psbarcode{http://localhost/Intranet/chart.aspx?id=10509110}{version=5}{qrcode}     \end{pspicture}     \end{adjustbox}          \end{document}


title: Put a slash through a word

text: I would like to write a word with a slash through it, using LaTeX (in text, not in math mode). That is, I want a line from the lower-left corner of the word through the upper-right. Is there a nice way to do this?


title: Disappearing bibliography

text: This is a bit related to my earlier post: Getting correct section numbering for Appendix in a large document I'm building a thesis with separate articles. I have a file main.tex and an introduction file intro.tex, and 2 articles article1.tex and article2.tex. I'm showing here below the main.tex with the intro and article 1 only:               \begin{document}     some codes for the first few pages     \include{intro}          some code for some intermediate pages          \begingroup          \renewcommand{\appendix}{%       \par       \setcounter{section}{0}%      \renewcommand{\thesection}{\thechapter.\Alph{section}}%     }          \include{article1}          \endgroup     \end{document}      In intro.tex, I have at the end:               \bibliography{lic}     \bibliographystyle{unsrt}      and in article1.tex, I have at the end:               \bibliography{mybibs1}     \bibliographystyle{unsrt}      The compilation is fine but I see that after article 1 in the pdf file, that the Bibliography lic appears instead of mybibibs1. Intro is followed by Bibliography lic as expected but to my surprise, I get Bibliiography lic also after article 1. And of course I'm getting [?] at every referencing throughout article 1. What's going wrong here?


title: Is there a BibTeX style that sorts references in reverse chronological order?

text: I am putting together a CV in latex, and I am trying to get my list of publications to display in reverse chronological order. I can use `\bibliographystyle{unsrt}` as a workaround, and just order the entries manually, but I would naturally prefer if BibTeX did that for me. Edit: Hmm... There seems to be no standard BibTeX style that does that, which is very surprising. I would expect that sorting publications in (reverse) chronological order is a common thing to do.


title: Methods for debugging package conflicts

text: ... that don't make me want to pull my (remaining) hair out. I'm preparing a long journal article with a wide array of necessary packages and a publisher-specific class file. In this specific case, I've recently added               \usepackage{algorithm}     \usepackage[noend]{algpseudocode}      When building the TeX file I'm now encountering a typical conflict error:                ("C:\Program Files\MiKTeX 2.9\tex\latex\algorithms\algorithm.sty"      Package: algorithm 2009/08/24 v0.1 Document Style `algorithm' - floating environment               ! LaTeX Error: Command \c@algorithm already defined.                    Or name \end... illegal, see p.192 of the manual.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.96 \floatname                    {algorithm}{\ALG@name}     Your command was ignored.     Type  I <command> <return>  to replace it with another command,     or  <return>  to continue without it.      The resulting PDF looks fine, including the new algorithms, but since I'm collaborating on the source with other parties—and since I'm the kind of person who has nightmares about unbalanced parentheses—I don't want to commit changes that introduce error messages. Aside from this specific case (which I assume is quite specialised, but which serves as a useful example), I'm wondering if there's any methods or helpful tips to debug conflicts like this? I have tried commenting out various packages to do a "binary search" on the problematic package, but then I encounter other errors or the build fails due to the necessary packages being omitted. I have tried building up the packages from an MWE but it is time consuming given the complexity of the document and not (yet) yielding any insights. This leads me to wonder if there's a better way ... how would a TeX expert approach the problem? For example, are there any hints to be had from the pdfTex .log file as to where `\c@algorithm` is already defined? Is there another method to trace where the definition is? Maybe the definition can be renamed before including the `algorithm` package? Maybe there's an online resource that offers a matrix of typical package conflicts? Or maybe there's some other general method to identify and resolve such conflicts? (Of course, there's a bunch of incompatibility questions already on this site, but I could not find any that address generic methods on how to _identify_ conflicts/incompatibilities.) * * * **EDIT:** Thanks to the comments below and David's help, I was able to fix the specific case, which relates to both the `elsart` class file I'm using and the `algorithm` package I've included defining a counter for algorithms. The method to identify this conflict was to go through the log file as David suggested to find where the `\c@algorithm` counter was registered. To resolve the problem, I added `\makeatletter\let\c@algorithm\relax\makeatother` before including the `algorithm` package. The question remains open as to generic methods (such as looking through the nested file inclusions in the log file) for identifying and resolving conflicts.


title: Name order in "elsarticle-num-names" bib style

text: With the following document class:               \documentclass[12pt]{report}      and the following bib file and style:               \bibliographystyle{elsarticle-harv}      `\bibliography{References}` or `\bibliography{IEEEfull,References}` and using the `natbib` package, I had some problems with my references; for example, some of them were shown as “?” in the body of the text. The problem got fixed by changing the style to the following:               \bibliographystyle{elsarticle-num-names}      Everything is perfect except for the order of the authors’ names. Thus, I have the following order:               First Name, Family Name, Title Vol (Number), (Year) Pages.      but I need to have Family names coming first so that I can have all the names alphabetically ordered. I am wondering if there are any changes that I can make to have this implemented based on the same document class (i.e., report) and bibliography style (i.e., elsarticle-num-names). I also tried other bibliography styles but no perfect fix. For example, based on:               \bibliographystyle{apalike}      Everything is fine but the URLs are not shown in the reference list. For example, everything related to the following item is shown except for the URL:               @ELECTRONIC{example,       author = {{Tex}},            month = {August},            year = {2013},            title = {{Description of a Reference Problem}},            note = {Accessed August 2011},            url = {http://tex.stackexchange.com},     }      Many thanks in advance, amiruw


title: subcaption/subfigure not centered, and caption too narrow

text: I'm using the `subcaption` package to make some subfigures with subcaptions (clearly), in a two column document, specifically the IEEE Transactions journal document class. There are a lot of figures, but some typical code for one of them is:               \begin{figure}             \centering             \begin{subfigure}[b]{0.3\textwidth}                     \includegraphics[height=65mm,clip=false]{figures/test_preds/s5_test_preds.pdf}                     \caption{Session 5 test data}             \end{subfigure}             ~                  \begin{subfigure}[b]{0.3\textwidth}                     \includegraphics[height=65mm,clip=false]{figures/test_preds/s32_test_preds.pdf}                     \caption{Session 32 test data}             \end{subfigure}                  \caption{Label predictions using cross-correlation-, GTW-, and LSTM-based classifiers}     \end{figure}      Which produces the example on the left. ![enter image description here](http://i.stack.imgur.com/wdjeh.png) So not only do the images end up skewed to the right of the current column despite the `\centering`, but the subcaption is prematurely given a line break. The figure on the right has the same centering issue. I should also mention that I'm only including `\usepackage{subcaption}`, as `subcaption` seems to subsume subfigure - Latex tells me I'm multiply defining subfigure if I `\usepackage` that as well. Due to lack of time I'm tempted to solve this using `\hspace` (urgh), but it wouldn't solve the premature line-breaking of the subcaptions.


title: box around theorem statement

text: Is there an easy way to put a box around a theorem in `LaTeX`? For example to state an important theorem. I tried using page 20 of the `ntheorem` documentation (http://ctan.mackichan.com/macros/latex/contrib/ntheorem/ntheorem.pdf), but I do not know how to use the package.


title: What's wrong with the table of contents?

text: My problem is that I can't create a table of contents for my document. I just use               \usepackage{tocloft}     ...       \newpage               \tableofcontents      but it's generating nothing but the word "Contents"! However TeXstudio, in the left sidebar, is showing all sections and stuff. ![enter image description here](http://i.stack.imgur.com/DKOW7.jpg) When I open the `.toc` file with `notepad++` there's only this string               \select@language {russian}      Example               \documentclass[14pt,a4paper]{extarticle}     \usepackage[T2A]{fontenc}     \usepackage[english,russian]{babel}     \usepackage[utf8]{inputenc}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{relsize}     \usepackage{listings}     \usepackage{tocloft}     \usepackage{tocvsec2}               \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm,bindingoffset=0cm]{geometry}     \lstset{       language=php,       numbers=none,       tabsize=3,       breaklines=true,       aboveskip=1ex,       belowskip=1ex,       basicstyle=\small\ttfamily,       framerule=0pt,       backgroundcolor=\color{gray!10},       columns=fullflexible,       showstringspaces=false     }          \begin{document}         \newpage             \tableofcontents     \newpage             \begin{center}                 \section*{Краткая характеристика}             \end{center}             В данной работе рассматривается создание и управление базой данных для веб-сайта. На примерах рассмотрена регистрация пользователей на сайте, осуществление восстановления логина/пароля пользователя, так же рассмотрены функции администратора сайта - добавление/удаление информации и объектов.                  Все формы созданы на языке гипертекстовой разметки HTML, для создания сценариев взаимодействия с базами данных используется язык PHP.                  Применяемая СУБД: MySQL.                  Для администрирования СУБД использовалось приложение PHPMyAdmin.          \end{document}


title: How to align table properly using tabularx

text: \subsection{Computed Results}            To prove the accuracy of the implementation there was a need to show that the answers that the application provides are within an acceptable range for the results. For this purpose a pre existing normal distribution implementation was used to calculate the error percentage of the computed answers. By looking at Error.java an example of the relative and absolute relative true error are shown, over three different data sets the following statistics could be extrapolated. Here are some of the error values      \begin{center}     \begin{tabularx}{\linewidth}{|p{1cm}|p{1cm}|p{1cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|}         X & \mu & \sigma & Area of P(x) & Computed Area & Abs True Err & Abs Relative True Err \\         $5$ & $1.5$& $4$ & $0.747507$ & $0.747053$ & $0.000454649$ & $0.00060822$ \\     \end{tabularx}     \end{center}      Given the example tex above, I can't get the columns to line up and for it to fit inside the document neatly, as shown here ![enter image description here](http://i.stack.imgur.com/yf9gQ.png)


title: Problem in .cls file

text: ! LaTeX Error: File `Thesis.cls' not found.      I am using Kile editor. If the above error appeared in the log file then how to correct it?


title: Fuse symbol with TikZ

text: I am using the `circuits.ee.IEC` library. However, I cannot find any fuse symbol like this: ![fuse symbol](http://i.stack.imgur.com/FaSO7.gif) How can I define such a symbol using `circuit declare symbol`? It should be just combining the resistor symbol and a line in some way, but I don't understand the syntax well enough to do this.


title: how to reduce the length of a block in a frame

text: I would like to reduce the length of a block in a frame because it is too long respect to the instance it contains. How is it possible?


title: Macro: Replace all occurrences of a word

text: I repeatedly use certain keywords such as `var` in my document which I highlight using `\src{var}`. This is cumbersome to type and gets annoying after a while. Repeatedly search-and-replacing `var` to `\src{var}` and then `\src{\src{var}}` to `\src{var}` also seems needlessly complicated. I want to tell LaTeX to replace all occurrences of `var` with `\src{var}`. I found `\def` that reduces the typing to `\var{}`, which is not much better. Something similar to the C preprocessor maybe: `#define var \src{var}`. I found the "Replacing all the dots"-example but failed to modify it to "Replacing all the vars". Thanks for the help.


title: referencing several tables in one reference

text: I need to reference several tables like Tables 1-3 or Tables 3.1 to 3.3 related with the section, I'm using the normal `\ref{table1,table2,table3}` to do what I want, but when I compile I get something like `???` Could someone tell me how to solve this little problem?


title: Any advanced example of layout designing with ConTeXt?

text: I'm looking for an advanced example of layout designing with ConTeXt? I've checked reference manual and few another docs from contextgarden, but they show only simple, elementary things. I'm interested in layouts that contains a lot of graphics and doesn't look like mathematical textbooks. And I need to know how to make them efficiently with ConTeXt. Seeing complete code of something that looks like magazine or cookbook would be great help in learning. For example, how to obtain master-page mechanism (applying of defined layouts to selected pages or selected parts of content) with ConTeXt? Or another, but similar question, I can change font like this:               \starttypescript [myface1]     \definetypeface [myface1] [rm] [serif] [bob] [default]     \definetypeface [myface1] [ss] [sans] [alice] [default]     \stoptypescript          \starttypescript [myface2]     \definetypeface [myface2] [rm] [serif] [bob2] [default]     \definetypeface [myface2] [ss] [sans] [alice2] [default]     \stoptypescript          {\switchtobodyfont[myface1,12pt]     bla bla     ...bla}          {\switchtobodyfont[myface2,10pt]     even more bla bla...     ...bla}      But can I select pages (odd, even, 11-26, or another combination) and make them to use defined typescript/typeface?


title: BibTeX Style for Electronic Letters Magazine

text: Does anyone know a BibTeX style (`bst`) suitable to be used in the Electronic Letters Magazine? I have the LaTeX template from here: http://digital- library.theiet.org/journals/el/author-guide, but not the BibTeX style. And I am not quite sure if the `IEEEtran` is suitable for that. Thanks


title: What are the benefits of vanilla texlive over texlive provided by Ubuntu repository?

text: This question presumes that vanilla texlive is superior and thus deserves to be installed despite the troubles over Ubuntu `apt-get`. What exactly are these benefits? I'm considering going back to texlive via `apt-get` due to some issues in Rstudio and knitr, but want to fully understand the trade-offs.


title: Remove "Appendix" title from Cover Page

text: I'm writing a report in latex and I included an appendix in my document. When I typeset, the title "Appendix" appears on a page by itself. I want this "Appendix" title to be on the same page as my appendix content. What should I do?               \documentclass[12pt, oneside]{report}     \usepackage[left=1in, top=1in, bottom=1in, right=1in]{geometry}     \geometry{letterpaper}     \usepackage{setspace}     \usepackage{graphicx}     \usepackage{indentfirst}     \usepackage{abstract}     \usepackage{biblatex}     \usepackage[toc,page]{appendix}          \begin{document}          \tableofcontents     \thispagestyle{empty}          \chapter{Introduction}          \newpage     \addcontentsline{toc}{chapter}{Bibliography}     \nocite{Lec2}     \printbibliography          \begin{appendices}     \chapter{stuff} \label{App: AppendixA}     \begin{figure}[h]     \centering     \includegraphics[scale=0.62]{stuff}     \end{figure}          \chapter{stuff} \label{App: AppendixB}     \begin{figure}[h]     \centering     \includegraphics[scale=0.75]{stuff}     \end{figure}     \end{appendices}          \end{document}


title: Simple minted \newenvironment

text: I'm trying to do a minted `\newenvironment` I looked at this post new- environment-with-minted, but I would like to know if there's a more simple way to do that, like               \newenvironment{matlabcode}             {\begin{minted}[mathescape,linenos=true]{matlab}}             {\end{minted}}      In that case, I get a `FancyVerbGetLine` error As I know, it seems that I should use \CustonVerbatimEnvironment


title: How do I forward a length from a command into a column specifier?

text: I'm using longtable where I want vertical bars separating cells, although not for the table headers. I have 8 columns (but show only 3 here as example) and want to re-use the same lengths on the main longtable as well as all multicolumn specifiers. In this example, I only use one heading in one table, but with multiple headings (first page, last page, the other pages), I'll have to specify the same column lengths over and over again. So what I have:               \documentclass[a4paper,10pt]{article}     \usepackage{longtable}     \usepackage{array}     \usepackage{ifthen}     \usepackage{xifthen}          \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}b{#1}}     \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}b{#1}}     \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}b{#1}}          \providecommand*\tablehead[2][]{\scriptsize\textbf{#2\ifthenelse{\isempty{#1}}{}{\textsuperscript#1}}}          \begin{document}          \begin{longtable}[l]{|@{}L{0.2\textwidth}@{}|@{}C{0.5\textwidth}@{}|@{}R{0.3\textwidth}@{}|}     \multicolumn{1}{@{}L{0.2\textwidth}@{}}{\tablehead[1]{First head}} &     \multicolumn{1}{@{}C{0.5\textwidth}}{\tablehead[2]{Second head}} &     \multicolumn{1}{@{}R{0.3\textwidth}}{\tablehead[3]{Last}} \\     \hline     \endfirsthead     \hline     \endlastfoot     1 & 2 & 3 \\     4 & 5 & 6 \\     \end{longtable}          \end{document}      I was thinking of defining the column widths once only in my command \mcw which defines the columns widths for column 1, 2 and 3. So, if I want to try lengths I'm comfortable with, I can change in one place only. My suggestion (which doesn't compile) is:               \documentclass[a4paper,10pt]{article}     \usepackage{longtable}     \usepackage{array}     \usepackage{ifthen}     \usepackage{xifthen}          \newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}b{#1}}     \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}b{#1}}     \newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}b{#1}}          \providecommand*\tablehead[2][]{\scriptsize\textbf{#2\ifthenelse{\isempty{#1}}{}{\textsuperscript#1}}}          \newcommand*{\mcw}[1]{% My column width     \ifthenelse{#1=1}{0.2\textwidth}{%     \ifthenelse{#1=2}{0.5\textwidth}{%     \ifthenelse{#1=3}{0.3\textwidth}{%     }}}}          \begin{document}          \begin{longtable}[l]{|@{}L{\mcw{1}}@{}|@{}C{\mcw{2}}@{}|@{}R{\mcw{3}}@{}|}     \multicolumn{1}{@{}L{\mcw{1}}@{}}{\tablehead[1]{First head}} &     \multicolumn{1}{@{}C{\mcw{2}}}{\tablehead[2]{Second head}} &     \multicolumn{1}{@{}R{\mcw{3}}}{\tablehead[3]{Last}} \\     \hline     \endfirsthead     \hline     \endlastfoot     1 & 2 & 3 \\     4 & 5 & 6 \\     \end{longtable}          \end{document}      What am I doing wrong? Can't a newcommand (mcw in this case) "return" a length and pass it as an argument into another command (L, C and R in this case)?


title: Vertical Alignment of Digits with MinionPro

text: First of all, thanks for your great help and support - I have been able to find answers to pretty much all my latex questions on here. For this one, however, I could not find a solution. I am currently facing problems with the vertical placement of numerical digits when using the MinionPro Font. As can be seen from the minimum working example and attached image below, latex correctly aligns the first digit with the text. However, some of the subsequent digits are set lower. I feel like it interrupts readability, especially on pages with lots of digits, the TOC and headers. How can I force latex to vertically align all digits the same way? Thanks a lot in advance! ![Example image showing the vertical alignment for digits in the mwe](http://i.stack.imgur.com/2nmco.png)               \documentclass[twoside,11pt,openright]{scrbook}     \usepackage{MinionPro}          \begin{document}           This tests vertical digit placement as regular text: 1.99 and in math context: $1.8$.          \end{document}


title: How to have automatic ordering of floats?

text: I tend to place my "float code" after the first call out (i.e., `\ref`) to the float. While I am drafting a document the first call out may change and I feel like I waste time finding the first call out and moving the float code to the correct place. Sometimes I also have float code that may or may not get used (e.g., a table that I am not sure I am going to include). What I would like to be able to do is define a `figures` environment and redefine `\ref` so that I can type something like:               \documentclass{article}     \begin{document}     This is a reference to figure~\ref{fig:D}.          This is a reference to figure~\ref{fig:A}.          This is a reference to figure~\ref{fig:C}.          This is a reference to figure~\ref{fig:C}.          \begin{figures}       \begin{figure}\caption{This is figure A.}\label{fig:A}\end{figure}       \begin{figure}\caption{This is figure B.}\label{fig:B}\end{figure}       \begin{figure}\caption{This is figure C.}\label{fig:C}\end{figure}       \begin{figure}\caption{This is figure D.}\label{fig:D}\end{figure}     \end{figures}     \end{document}      and have LaTeX realize that what I want is:               \documentclass{article}     \begin{document}     This is a reference to figure~\ref{fig:D}\begin{figure}\caption{This is figure D.}\label{fig:D}\end{figure}.          This is a reference to figure~\ref{fig:A}\begin{figure}\caption{This is figure A.}\label{fig:A}\end{figure}.          This is a reference to figure~\ref{fig:C}\begin{figure}\caption{This is figure C.}\label{fig:C}\end{figure}.          This is a reference to figure~\ref{fig:C}.     \end{document}