title: Number mhchem reactions and create a \listofreactions

text: Is there a way to create an environment for reactions defined with mhchem that behaves similarly to equation in terms of numbering the reactions (including a \nonumber command)? Can I get a list of those reactions?               \documentclass{article}     \usepackage[version=3]{mhchem}          \newcounter{rxnum}          \newenvironment{reaction}{     \refstepcounter{rxnum}     \noindent     %???     }{     %???     \par\noindent     }          \begin{document}          \begin{reaction}      \ce{X + Y -> XY}     \end{reaction}          \begin{reaction}      \ce{XX + YY -> X2Y2} \\%<- newline just like in equation      \ce{A + B -> C}     \end{reaction}                 \end{document}      This is a two part question. The first part is about creating an environment that behaves similarly to equation, but for reactions defined in mhchem. I had a look in source2e in the definition of equation (around l. 293 in source2e) but couldn't quite figure out how to transfer that onto my new environment. The second part is about how to create a list of those reactions containing the reaction number, the page they occur on and optional a description that is only printed in the \listofreactions. For example: In the code I write               \begin{reaction}     \ce{X + Y ->XY}\descriptionforlist{XY formation reaction}\\     \ce{A +B -> C}     \ce{G + H -> J}\nonumber         \end{reaction}      Then in the list it should appear as **List of reaction**               R 1: XY formation reaction                6          R 2:                                      6


title: Copyright metadata into Adobe Reader using pdflatex

text: Ok, first of all I'm quite aware there are a couple of question that address this issue. More in specific:   1. How to add copyright information to PDF metadata   2. Eliminate/Edit PDF properties added by pdfLaTeX   3. Is there a poisonous interaction between memoir, hyperref, and hyperxmp? I tried using the `hyperxmp` package, as described this answer in question 1 , but I still didn't see the copyright property. All I got was a `PTEX.Fullbanner` with value `This is MikTeX 2.9.4535(1.40.13)`. Question 2 refers to many document properties, and although I have used them (more specifically, I'm using `\usepackage[pdfusetitle]{hyperref}`), I wasn't able to use the `pdfcopyright` property and the `hyperxmp` package with success (I just wasn't getting anything on the PDF properties, except for the same `PTEX.Fullbanner` with value `This is MikTeX 2.9.4535(1.40.13)` I ran the code presented in question 3 and I still do not get any copyright info in Adobe Reader. (Question 3 Code):               \documentclass{article}     \usepackage{lipsum}     \usepackage{hyperref}     \usepackage{hyperxmp}     \makeatletter       \AtEndDocument{\hyxmp@find@metadata\hyxmp@embed@packet}     \makeatother     \hypersetup{         pdfauthor={Brent Longborough},         pdftitle={O Hai},         pdfcopyright=Copyright © 2012 by Brent Longborough. All rights reserved.}     \begin{document}     \lipsum[1]     \end{document}      I have tried running `pdfLaTeX`, `XeLaTeX` and `LuaLaTeX`, but I still have this property empty in the PDF. I tried removing the `\AtEndDocument{\hyxmp@find@metadata\hyxmp@embed@packet}` and I still got nothing. Is there something I'm missing? Is this even possible with Adobe Reader? **Please note** I would like not to use any additional file than my .tex one. (That was the idea behind using the `hyperxmp` package **My specific code**               \documentclass{report}     \usepackage{lipsum}     \usepackage[pdfusetitle]{hyperref}     \usepackage{hyperxmp}     \title{Titulo}     \author{Autor}     \hypersetup{         pdfcopyright={\copyright Date by Aauthor.  All rights reserved.}%     }     \begin{document}     \lipsum[1]     \end{document}


title: error while using gnuplot in pgfplots

text: I am using pgfplots and tikz library for generating some figures. my problem is that I can not use gnuplot within pgfplots. I tried to compile the following code bu seemingly the gnuplot is not recognized.               \begin{tikzpicture}     \begin{axis}[view={0}{90}]      \addplot3[contour gnuplot] {x*y};       \end{axis} \end{tikzpicture}      Anyone knows which package I should include?


title: Displaying current chapter/section in your editor

text: I'm dreaming about a feature of a TeX editor (read: emacs, but for the sake of generality I'd be interested in answers about other editors, too) that displays the title of the current (read: the one that the cursor/point is in) chapter/section/subsection etc. (bonus points for displaying more than one level simultaneously, e.g. in the format "chapter:section" or whatever) somewhere (top of the screen/window/frame seems a natural choice for that). I read about the `which-func-mode` for emacs, but don't know (yet) how to make it work for LaTeX (and ConTeXt, for that matter). Does anybody know how to do it in emacs, so that I don't reinvent the wheel? Are there other editors which such capabilities?


title: Using microtype protrusion with XeTeX and Ubuntu

text: I believe I have all the correct versions of the software at hand and installed (v. 2.5 of microtype and .9998 of XeTeX) to get protrusion to work with XeTeX on my Ubuntu system but I keep getting an error when compiling. Here's the MWE:               \documentclass{book}     \usepackage[T1]{fontenc}     \usepackage{lipsum}     \usepackage[protrusion=true]{microtype}     \begin{document}     \mainmatter     \lipsum     \end{document}      But when I attempt to compile with `xelatex microtest.tex` I get:               This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/Debian)     restricted \write18 enabled.     entering extended mode     (./microtest.tex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation,     lo     aded.     (/usr/share/texlive/texmf-dist/tex/latex/base/book.cls     Document Class: book 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo))     (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty     (/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def))     (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.sty     (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)               ! LaTeX Error: File `microtype-xetex.def' not found.      I have microtype-xetex.def installed in /usr/share/texlive/texmf-dist- tex/latex/microtype:               pwd     /usr/share/texlive/texmf-dist/tex/latex/microtype     ls     letterspace.sty       mt-bch.cfg        mt-eus.cfg               mt-ppl.cfg     microtype.cfg         mt-blg.cfg        mt-LatinModernRoman.cfg  mt-ptm.cfg     microtype.lua         mt-CharisSIL.cfg  mt-msa.cfg               mt-ugm.cfg     microtype-luatex.def  mt-cmr.cfg        mt-msb.cfg               mt-zpeu.cfg     microtype-pdftex.def  mt-euf.cfg        mt-mvs.cfg     microtype.sty         mt-eur.cfg        mt-pad.cfg     microtype-xetex.def   mt-euroitc.cfg    mt-pmn.cfg      I've copied those files over to other spots but I keep getting the same error. Is there perhaps some kind of install script I was supposed to run or compile? All I did was copy the extracted files I downloaded to this directory (replacing the `microtype` files that were already there).


title: Missing } Inserted?

text: I wrote                   \begin{align}         $\lim_{x \to 2} f(x)$ &= $\lim_{x \to 2}\dfrac{2x^2-5x+2}{5x^2-7x-6}$\\                               &= $\lim_{x \to 2}\dfrac{(x-2)(2x-1)}{(x-2)(5x+3)}$\\         \end{align}      But apparently I have a missing } and I cannot find it. Help?


title: What sequence of documents should I read to know "all of" TeX and then LaTeX?

text: I know that there are a already number of questions on this site about good instructional (La)TeX materials for users at different levels. What I am interested in, though, is what set of documents will give me (in which reading order) as complete an understanding as possible of TeX and LaTeX. If one would like to know all, why bother with "intros" anyway ;-) I was gonna write that for TeX the best first document (and, in the sense described above, technically the only necessary one) should be "The TeXbook", but then there's e-TeX, which is not covered. And I don't know to what extent there is other, hidden advanced knowledge one can only learn only from various advanced tutorials or from looking at the source code. Let's, for simplicity, assume that I am excluding knowledge about LaTeX packages from this question. For those, the best way is to read the package documentation. One should skim the package documentation of certain frequently used packages (those one is using) anyways. Once one has an understanding of (e-)TeX, I have the same question for LaTeX 2e. One reason for asking this question is that I never cease to be amazed at what gems of obscure tricks there exist. There's gotta be a way of acquiring this knowledge in a most efficient way other than by "reading around randomly and perusing the source code".


title: How to plot just part of the function with pgfplots, gnuplot

text: I have the following code.               \begin{tikzpicture}      \begin{axis}[domain = -2:2              ,y domain = -2:2,view={0}{90}]           \addplot3[contour gnuplot={number=10},thick,domain=-2:2]     {0.5*exp(-0.2*abs(x)-0.2*abs(y))};      \end{axis}      \end{tikzpicture}      But I'd like it to plot just the area inside a circle x^2+y^2 < 1 Any Idea?


title: Long version of \edef, \xdef, \protected@edef

text: What is the long version of `\edef`, `\xdef`, `\protected@edef` ... Do they work when we add a `\long` in front of them, like for `\def` :               \long\def\macom{...}      \long\edef\macom{...}      \long\gdef\macom{...}      \long\xdef\macom{...}      \long\protected@edef\macom{...}


title: Compressing a list

text: I have an application, where I am using lists to store reference numbers of forms as shown below:               \alist(1,2,3,4,4a,8,9,10,23,23b,28)      As these lists get rather long, I would like to compress them as follows:               \alist(1-4,4a,8-10,23...)      Can someone offer a solution? Perhaps an internal LaTeX macro?


title: How can I define a custom listing environment?

text: I am trying to define an enviroment for a specific programming language, F#. Here's my code:               \definecolor{bluekeywords}{rgb}{0.13,0.13,1}     \definecolor{greencomments}{rgb}{0,0.5,0}     \definecolor{turqusnumbers}{rgb}{0.17,0.57,0.69}     \definecolor{redstrings}{rgb}{0.5,0,0}          \lstdefinelanguage{FSharp}         {morekeywords={let, new, match, with, rec, open, module, namespace, type, of, member, and, for, in, do, begin, end, fun, function, try, mutable, if, then, else},         keywordstyle=\color{bluekeywords},         sensitive=false,         morecomment=[l][\color{greencomments}]{///},         morecomment=[l][\color{greencomments}]{//},         morecomment=[s][\color{greencomments}]{{(*}{*)}},         morestring=[b]",         stringstyle=\color{redstrings}         }          \newenvironment{fslisting}       {         \lstset{             language=FSharp,             basicstyle=\ttfamily,             breaklines=true,             columns=fullflexible}         \begin{lstlisting}       }       {         \end{lstlisting}       }      Then I'm trying to use it as such:               \begin{fslisting}     type 'a Process = 'a Signal IObservable     \end{fslisting}      But it doesn't work. The output log says that the listing is not terminated - or is terminated by the document. So the rest of the document is also formatted as a listing, which is of course not the intention. What am I doing wrong here?


title: Beamer: how to skip only some `notes' frames

text: I'd like to hand out a printout of some slides, including some printed notes and a bit of space for handwriting. The following is (more or less) working:               \documentclass[handout,notes]{beamer}       \usepackage{pgfpages}            \pgfpagesuselayout{2 on 1}       \AtBeginSection[]{\frame{\Huge\insertsectionhead}}       \AtBeginNote{Notes:\par}            \makeatletter         \def\beamer@framenotesbegin{% at beginning of slide           \gdef\beamer@noteitems{}%           \gdef\beamer@notes{{}}% used to be totally empty.         }       \makeatother          \begin{document}       \section{1st section}       \frame{The first slide\note[item]{With a note}}       \frame{The second, and last, slide}     \end{document}      The `\makeatletter`...`\makeatother` fragment makes every _normal_ frame being followed by a _notes_ frame. With `pgfpages`, each frame and its note frame are printed on the same page. Finally, each section gets its own frame (`\AtBeginSection`). **But** I don't want the _section_ frame to be followed by a _notes_ frame, as is currently happening. I've unsucessfully tried to:   * Make `\makeatletter`...`\makeatother` check (with `\ifx`...?) whether it's being used from within a _normal_ frame, or not. The problem is that I don't know what condition could be used to tell if this is a normal page, a sectioning one, or whatever.   * Force, with `pgfpages`, a blank page; thus, the _section_ frame and the blank page will be printed on the same page. Some more details: I'm using org-mode within Emacs to write the slides. Also, I'm using Beamer's command `\AtBeginNote` to heavily customize the appearance of the _notes_ frames (thus, I can't simply drop the `\AtBeginNote` line). Any ideas? Many thanks in advance!


title: fit tabular width with multicolumns into text width latex

text: So i want to make the following table fit in my text width. The table is much longer than the text. Any propositions? Thanks in advance. Here is the table code (dont pay attention to the comments' lines with %)               \begin{table}[htbbp] \caption{Methods performance for     random model coefficients using 1000 simulations in a two level     factorial design}\label{Table 1}     {\tiny \centering     \begin{tabular}{@{}|@{}c|c|cc|cc|cc|cc|cc|cc@{}|@{}}     %\multicolumn{14}{c}{{\bf Table 1.} Methods performance for     %random model coefficients using 1000 }\\     %\multicolumn{14}{c}{simulations in a two level factorial design}\\     %\multicolumn{11}{c}{$ $} \\     \hline  \multicolumn{1}{|c|}{$ $}&     \multicolumn{1}{|c|}{$q$}&\multicolumn{2}{|c|}{SCAD(gcv)}&\multicolumn{2}{|c|}{SCAD$(\eta_\nu(\lambda))$}&\multicolumn{2}{|c|}{LASSO(gcv)}&\multicolumn{2}{|c|}     {LASSO$(\eta_\nu(\lambda))$}&\multicolumn{2}{|c|}{Hard(gcv)}&\multicolumn{2}{|c|}{Hard$(\eta_\nu(\lambda))$} \\     \hline {\bf Design}&{\bf Factors}& \mbox{Type I} & Type II &     \mbox{Type I} & Type II & \mbox{Type I} & Type II     & \mbox{Type I} & Type II & \mbox{Type I} & Type II & \mbox{Type I} & Type II \\     \hline $ 2^{5}$FD     &1&0.12&0.00&0.00&0.00&0.11&0.00&0.03&0.00&0.11&0.00&0.01&0.00\\     &2&0.11&0.00&0.01&0.00&0.10&0.00&0.02&0.00&0.10&0.00&0.01&0.00\\     &3&0.10&0.00&0.00&0.00&0.11&0.00&0.02&0.00&0.11&0.00&0.01&0.00\\     &4&0.11&0.00&0.00&0.00&0.10&0.00&0.01&0.00&0.10&0.00&0.01&0.00\\     \hline     \multicolumn{11}{c}{$ $} \\     \multicolumn{11}{c}{$ $} \\     \multicolumn{11}{c}{$ $} \\     \end{tabular}     \end{table}


title: Export/convert/externalize tikzpicture as LaTeX (picture) code?

text: I have seen "32.4 Externalizing Graphics" in the Tikz manual, which explains how Tikz images can easily be exported as PDF images using pdfLaTeX. However, I am persuaded I saw somewhere a way to export a Tikz picture to 'raw' (primitive?) Latex code in `picture` environment syntax (i.e. using `\put`, `\line`, etc.) - but I may have mixed this up with `dpic`/M4 Circuit macros :) In any case - if `tikz` images get 'compiled' to (La)Tex code as an intermediate step - is it somehow possible to export/externalize/convert Tikz picture code to (plain?) LaTeX code?


title: Equation numbering lost

text: I'm using equation numbering in a book at section level. Somehow, after chapter 10, equation numbers turn 0 and remain that. I'm not doing anything special before that. Any clue?


title: Beamer - in columns exposing picture in one column before and after text in other column

text: I'm doing a presentation in beamer, and I was wondering is it possible to, in two columns, make text first appear in left column, then on the second click I'd get a picture in the right column, and then I'd just continue with the text in the left column? The way I made it now is, that the picture in the right column will come after the text in the left column:               \begin{frame}     \frametitle{Prva probna valna funkcija}     Varijacionu metodu započinjemo sljedećom probnom valnom funkcijom\pause     \begin{columns}         \begin{column}{0.5\textwidth}         \begin{itemize}         \item\begin{equation*}         \varphi_1(x)=\left(\frac{b}{\sqrt{\pi}}\right)^{1/2}e^{-\frac{b^2}{2}x^2}         \end{equation*}         \pause         \item Očekivana vrijednost energije\pause         \begin{equation*}         E(b)=\langle\varphi_1|\hat{H}|\varphi_1\rangle,         \end{equation*}         \end{itemize}         \end{column}\pause         \begin{column}{0.5\textwidth}         \centerline{\includegraphics[width=0.9\textwidth]{valfun1.eps}}         \end{column}     \end{columns}     \end{frame}      And I'd like it to have the first equation shown first, then the picture on the right, and then some more text on the left... Thanks for any advice.


title: How to use bbding package?

text: I tried to use `bbding` package for the `enumitem` symbols. I have added to my code:               \usepackage{bbding}     ....     \begin{itemize}[label=\HandRight]      but I receive error               !pdfTeX error: /usr/local/texlive/2011/bin/i386-linux/pdflatex (file bbding10):      Font bbding10 at 600 not found      ==> Fatal error occurred, no output PDF file produced!      I have a complete version of `texlive` on Ubuntu. What other stuff is needed to put `bbding` in action? UPDATE: The question was updated by useful comments in answers. As `egreg` assisted to figure it out; the problem was connected to user permission, as `texlive` had been installed under root.


title: Numbering figures and tables by their section

text: I am having trouble formatting my list of figures and list of tables. Currently, my tex document is printing the list in the following manner: > 1 Foreign Key Constraint Problem Due to Improper Table Design. . . . 3 > > 2 Application Flow of Territory Maintenance Tool. . . . . . . . . . . . . 4 But I want to number figures by their sections: > 3.1.2 Foreign Key Constraint Problem Due to Improper Table Design


title: How to set up forward search: from .tex under Emacs to position .pdf under Okular

text: I edit .tex file under Emacs and view them with Okular. I have already set up the backward search: from .pdf to .tex by pressing Shift+Left click on the .pdf file. The related part of .emacs file is here:               (server-start)     (add-hook 'LaTeX-mode-hook 'TeX-PDF-mode)           (defun pdf-with-okular ()      (add-to-list 'TeX-output-view-style      (quote ("^pdf$" "." "okular %o %(outpage)"))))          (add-hook 'LaTeX-mode-hook 'pdf-with-okular t)     (setq TeX-view-program-list '(("Okular" "okular %o")))      (setq TeX-view-program-selection '((output-pdf "Okular") (output-dvi "Okular")))          (custom-set-variables      '(LaTeX-command "latex -synctex=1")      '(cua-mode t nil (cua-base))      '(show-paren-mode t))      However, I do not see how to make "forward" search work. Someone says when we position somewhere in the .tex file, press `C-c C-v`, we could go to the corresponding location of .pdf file. But here, when I press `C-c C-v` it opens another okular and we are always on the first page of the .pdf file. P.S. My whole .emacs.


title: Decimal separator and axis label centering with Tikz

text: The following code creates a `figure` with Tikz without the use of `pfgplots` (that I want to avoid here):               % compilation: pdflatex --jobname=Runge-f1 Runge.tex     \documentclass[12pt]{book}     \usepackage[utf8]{inputenc}     \usepackage{filecontents}     \usepackage{tikz}     \pgfrealjobname{Runge}          \begin{filecontents}{B6.dat}     -1  0     0   5     1   0     \end{filecontents}     \definecolor{rouge}{RGB}{233,55,77}          \def\xmin{-1.1}\def\xmax{1.1}\def\ymin{-.6}\def\ymax{5.6}          \begin{document}     \beginpgfgraphicnamed{Runge-f1}%     \footnotesize     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{tikzpicture}[>=latex,scale=1.4,x=4cm,y=1cm]     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%% background     \fill[rouge!10] (\xmin,\ymin) rectangle (\xmax,\ymax);     %%%% grid and labels     \begin{scope}     \clip (\xmin,\ymin) rectangle (\xmax,\ymax);     \foreach \x in {-1,-0.75,...,1} \draw[rouge!35] (\x,\ymin) -- (\x,\ymax);     \foreach \x in {-1,-0.75,...,1} \node[fill=rouge!10,inner sep=2pt,anchor=south,font=\tiny\color{rouge}] at (\x,-.5){$\mathsf\x$}; %%%%%% loop 1     \end{scope}     %%%% curve     \draw plot file{B6.dat};     %%%% external frame     \draw[line width=.6pt,rouge!50] (\xmin,\ymin) rectangle (\xmax,\ymax);     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \end{tikzpicture}     \endpgfgraphicnamed%     \end{document}        * how is it possible to have a comma as the decimal separator in loop 1?   * in loop 1, would it be possible to center the `$\x$` labels with respect to the grid by ignoring the negative sign `-` when present? ![enter image description here](http://i.stack.imgur.com/GCNN1.png)


title: What to do with this hyperref note on amsmath?

text: http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/ has this note copied below: > amsmath   >  -------------   >  The environments `equation` and `eqnarray` are not supported too well. For > example, there might be spacing problems (`eqnarray` isn't recommended > anyway, see CTAN:info/l2tabu/, the situation for `equation` is unclear, > because nobody is interested in investigating). Consider using the > environments that package `amsmath` provide, e.g. `gather` for `equation`. > The environment `equation` can even redefined to use gather: >   >   >     \usepackage{amsmath} >     \let\equation\gather >     \let\endequation\endgather` >   However, `gather` and `equation` environment have the spacing difference as in the answer by Will in align vs equation. Thus my question: In a document using both hyperref and amsmath, what is the best replacement for `equation`?


title: Babel - Romanian ' or \c

text: I want to use some shortcuts to produce special character in Romanian. One of them is to use the command `\c` but also I know that is possible to use the following character: `'` . example **`\c si`** or **`'si`** produce same word. How can I use **`'`** ? It is written that I used an old interface to call `babel`.


What font package do I use to get the vertical Russan/German style integral signs? (subject says all)


title: Hyperref marks lastpage as a reference

text: I am using the hyperref package, lastpage package and fancyhdr package. My problem is, that the number showing the amount of total pages (in the footer) is red and works like a link to the front page. I do not want it to be neither red or work as a link, though I want to link to the sections in my table of contents (which works perfectly). Please help! :-)               \documentclass[11pt, a4paper, oneside]{article}              \usepackage{lastpage}     \usepackage{fancyhdr}         \pagestyle{fancy}             \fancyhead[LO,LE]{Author}             \fancyhead[RO,RE]{Document title}             \fancyfoot[CO, CE]{Page \thepage\ of \pageref{LastPage}}     \usepackage{hyperref}     \hypersetup{         linktoc=section,         colorlinks=true     }               \begin{document}               \thispagestyle{empty}          \vspace*{3cm}     \noindent \rule{\linewidth}{3pt}     \vspace{0.2cm}     \begin{center}\textbf{\Huge{Title}}\end{center}     \vspace{0.5cm}     \rule{\linewidth}{3pt}          \vspace{3cm}          \newpage               \pagenumbering{roman}     \tableofcontents     \newpage     \pagenumbering{arabic}          \section{First section} \label{sec:1}               \section{Second section}          This is a reference to \nameref{sec:1}.               \end{document}


title: TikZ and tabular/multicol

text: I've just finished my first TikZ flowchart, and I have a couple of wished to improve it, but I can't seem to search my way to a solution. I would like do this in 2 colomns, with dashed a line between them. As you can see, theres one node, where the dashed line is intented to be. Is it possible to make a tabular or multicol, in a way where thats possible?               \documentclass{memoir}     \usepackage[latin1]{inputenc}     \usepackage[a4paper,vmargin={30mm,0mm},hmargin={0mm,0mm}]{geometry}     \usepackage{tikz}     \usetikzlibrary{shapes,arrows, shadows, calc}     \begin{document}     \pagestyle{empty}          \begin{center}     \tikzstyle{block} = [rectangle, draw, fill=gray!20,      text width=8em, text centered, minimum height=4em, drop shadow]     \tikzstyle{line} = [draw, -latex']     \tikzstyle{cloud} = [draw, rectangle, rounded corners,fill=white!20, node distance=2cm,     minimum height=2em, drop shadow]          \begin{tikzpicture}[node distance = 2cm]     \node [block, xshift=12em] (post) {\large Postmoderne};     \node [block, xshift=-12em] (modern) {\large Moderne};     \node [cloud, below of=modern, node distance=7em, fill=red!20] (auto) {Øget             \emph{control}};     \node [cloud, below of=auto] (active) {\emph{Active learning} og positive udviklingsspiral};     \node [cloud, below of=active] (effect) {Mere effektivitet og positive emotioner};     \node [cloud, below of=post, node distance=4em, fill=red!20] (sparring) {Sparringssamarbejde};     \node [cloud, below of=sparring, node distance=3em] (support) {Øget social support};     \node [cloud, below of=support, node distance=11em] (kom) {Bedre kommunikation og gensidig respekt};     \node [cloud, below of=modern, node distance=24em, xshift=12em, fill=green!20] (res) {Resiliens hos medarbejder og organisation};               \path [line] (sparring) -- (support);     \path [line] (auto) -- (active);     \path [line] (active) -- (effect);     \path [line] (support) -- (active);     \path [line] (active) -- (kom);     \path [line] (kom) -- (res);     \path [line] (effect) -- (res);                    \end{tikzpicture}     \end{center}          \end{document}


title: Is is possible to rotate text using nodes near coords?

text: I'm plotting a ybar, and nodes near coords is ugly. Is it possible to rotate the text above the bars by 90?               \begin{tikzpicture}     \begin{axis}[area legend,     legend pos=north west,     legend columns=4,     legend style={draw=none},     symbolic x coords={D,F,R,M,K,S,C},     major tick length=0cm,     xtick=data,     nodes near coords,     ybar,     bar width = 6pt,     ]     \addplot[area legend] %[ybar,,fill=blue]  fill=color1     coordinates {(D,0.78) (F,0.23) (R,0.93) (M,0.73) (K,0.00) (S,0.37) (C,0.36)};     \addplot[area legend] %[ybar,,fill=blue]     coordinates {(D,0.52) (F,0.62) (R,0.60) (M,0.56) (K,0.64) (S,0.166) (C,0.170)};     \addplot[area legend] %[ybar,,fill=blue]     coordinates {(D,0.635) (F,0.437) (R,0.744) (M,0.345) (K,0.48) (S,0.652) (C,0.955)};     \end{axis}     \end{tikzpicture}


title: lines within TOC

text: I want to insert two parallel lines before and after part titles in the TOC (see the picture below). Is there and easy way to do it? I'm using `\documentclass{book}`. How about inserting the lines before and after the section titles? ![enter image description here](http://i.stack.imgur.com/I979l.jpg)


title: includegraphics: How to check if PDF/PNG are transparent?

text: I am trying to generate PDF/A-1 compliant documents, in which transparency is not allowed. I would like to check, if included PDF and PNG images have transparency. Is there a TeX way to check this? Otherwise, what is the proper way to change the `\includegraphics` command to call external tools to check this? * * * Edit: External tools for checking transparency: For **PNGs** , `ImageMagik`'s `identify` does the job nicely. It displays `[s]rgba` when there is an alpha channel (otherwise it's `rgb`):               # identify -format '%[channels]' Transparent.png      srgba      Even better:               # identify -format %A Transparent.png      True      For **PDFs** , this is more complicated (see eg here): There are as graphical style attributes fill opacity (`/ca`) or stroke opacities (`/CA`) below a value of 1.0, or there is a soft mask (`\SMask`), or there is a transparency page group defined (`/S /Transparency`). `grep` expression:               grep -aE -e '/[Cc][Aa] +0?\.[0-9]' -e '/SMask' -e '/S /Transparency' *.pdf      I bet it is somehow possible to check with `gs`, but I did not find it so far.


title: Reference-able custom section numbering

text: I am writing some lecture notes from a class that I have on Monday, Wednesday, and Friday. What I would like to do is organize them by sections defined by the week and the day, e.g. 1M, 1W, 1F, 2M, 2W, 2F, 3M, and so on. Furthermore, when I reference a labeled theorem in that section, I would like it to show up as something like "Theorem 2F.1" or "Proposition 3M.7". (I'm imagining something like > `\section[1M]{January 6th, 2014: Applications of Nakayama's Lemma}` > > `\begin{theorem}\label{Nakayama} ... \end{theorem}` > > (...then, later...) > > `...Thus, it follows by \ref{Nakayama} that...` which would output "...Thus, it follows by Theorem 1M.1 that...") Is there any way to create a custom numbering scheme that is able to be referenced like this? What's the closest I can get to it?


title: Put text on top of text that has strikethrough - like one would edit an essay

text: I would like to obtain the same effect as in this question: Write text above other text But in those answers, it doesn't flow properly across multiple lines of text in the essay. If you strike too much out, the text runs off the page.


title: Error with pmatrix inside multline* inside minipage inside tabular

text: The following is a minimal example of code that gives me an `Argument of \multline* has an extra }` error.               \documentclass{article}     \usepackage{amsmath}        \begin{document}      \begin{tabular}{c}       \begin{minipage}{200pt}         \begin{multline*}         \begin{pmatrix}          a           &           \end{pmatrix}        \end{multline*}       \end{minipage}      \end{tabular}     \end{document}      Removing the `tabular` environment kills the error, removing the ampersand kills the error, and changing the `multline*` environment to `$$` kills the error. Is this a known limitation of the environments involved? Something related to having things too deeply nested?


title: Problem importing .tex to LYX - Bibliography and citations not showing properly on PDF

text: I am trying to import a `.tex` file to LyX which uses a BibTeX database to populate my bibliography and for citations. In LyX everything appears to be working normally, double clicking on the gray box "BibTeX Generated Bibliography" brings up my .bib database, and insert->citation shows the lists of sources correctly displayed. However, when I try to view the PDF, there is no bibliography printed and all citations show as [?]. Strange since it seems like the program recognizes the database and interpreted the original file/database just fine. Is there something I'm missing in the import/BibTeX process?


title: Changing the fontsize of selected column in table

text: I want to decrease the font-size of a selected column. I tried               \documentclass{article}     \usepackage{multirow,array}     \usepackage{booktabs}     \begin{document}          \begin{tabular}{rccl>{\tiny}c|>{\tiny}c}       \toprule       Name & Age & Sex & Average Grade & Subject & Grade \\       \midrule       \multirow{3}*{John} & \multirow{3}*{24} & \multirow{3}*{M} &          \multirow{3}*{A} &                     Maths & A \\                           &&&&Science & A \\                           &&&&Arts & A \\[.5\normalbaselineskip]       \multirow{3}*{Mary} & \multirow{3}*{22} & \multirow{3}*{F} &          \multirow{3}*{A} &                     Maths & A \\                           &&&&Science & A \\                           &&&&Arts & A \\       \bottomrule     \end{tabular}          \end{document}      That generates a table: ![enter image description here](http://i.stack.imgur.com/vpYQR.jpg) Is there a way to do it without changing the header of the table (1st row)?


title: How to add a 2d plot to a 3d axis drawing?

text: My task is quite simple. I want to add to my 3d axis drawing a 2d plot. My closes result is this:               \begin{tikzpicture}         \begin{axis}[                 axis equal,                 view={45}{30},                 compat=1.8,                 height=10.2cm,                 width=9cm,                 grid=major,                 grid style={dashed, gray!50},                 axis lines=middle,                 inner axis line style={=>},                 yticklabel style={inner ysep=0pt, anchor=south east, font=\tiny},                 ytick={-1,...,1},                 xticklabel style={inner xsep=0pt, anchor=north west, font=\tiny},                 xtick={-1,...,1},                 zticklabel style={inner ysep=0pt, anchor=south east, font=\tiny},                 ztick={-1,...,1},                 ymin=-2,                 ymax=2,                 xmin=-2,                 xmax=2,                 zmin=-2,                 zmax=2]             \addplot+[color=PlotColorOne, samples=30, domain=0:2*pi, thick, smooth, z=0] ({sin(deg(x))},{cos(deg(x))});         \end{axis}     \end{tikzpicture}      Which results in this: ![Output](http://i.stack.imgur.com/Qj2Tn.png) How is it possible to set z coordinate to 0?


title: "Flatten" macros prior to sharing LaTeX file

text: Is there a way/an existing tool to process a LaTeX source document such that for a given list of macro definitions (using `\newcommand`), calls to those macros are replaced by their expanded version? Imagined work-flow:               <program> source.tex macros.tex > output.tex      where               source.tex:          \documentclass{article}     \newcommand\Rbb{\mathbb{R}}     \newcommand\Cbb{\mathbb{C}}     \newcommand\jb[1]{\langle #1\rangle}     \begin{document}     On $\Rbb$ we define $\jb{x} = \sqrt{1 + x^2}$, while on $\Cbb$ we      define $\jb{x} = \sqrt{1 + |x|^2}$ where the square root is taken      for the real numbers.      \end{document}               macros.tex:          \newcommand\Rbb{\mathbb{R}}     \newcommand\Cbb{\mathbb{C}}     \newcommand\jb[1]{\langle #1\rangle}      And the desired output is:               output.tex:          \documentclass{article}     \newcommand\Rbb{\mathbb{R}}     \newcommand\Cbb{\mathbb{C}}     \newcommand\jb[1]{\langle #1\rangle}     \begin{document}     On $\mathbb{R}$ we define $\langle x\rangle = \sqrt{1 + x^2}$, while on $\mathbb{C}$ we      define $\langle x\rangle = \sqrt{1 + |x|^2}$ where the square root is taken      for the real numbers.      \end{document}      **Motivation** Sometimes my collaborators and I have conflicting items in the personal list of macros that we usually use. To make life easier on myself I would like to prepare my edits using my personal macros to make typing faster. But before merging I would like to flatten out all such macros so that they don't conflict with the ones used by my coauthors.


title: Lyx suddenly stopped working, completely lost

text: I've been using Lyx (on windows) to write my thesis and for some reason tonight it just stopped working. If i try opening a new file, no layouts are available. I am able to open my thesis file, but I can not compile it (PdfLatex...). Any tips on resolving this would be greatly appreciated. Update (this was the code that had to be changed as per the link in my comment - the 100 was previously a 65):               \edef\fmtversion{2005/12/01}       \iftrue       \def\reserved@a#1/#2/#3\@nil{%       \count@\year       \advance\count@-#1\relax       \multiply\count@ by 12\relax       \advance\count@\month       \advance\count@-#2\relax}       \expandafter\reserved@a\fmtversion\@nil       \ifnum\count@>100


title: How to interrupt a plot?

text: Please consider the following example code:               \documentclass{article}     \usepackage{pgfplotstable}          \pgfplotstableread{     1   19.178  26.027  8.219   6.849   39.726  1     2   54.795  21.918  4.110   6.849   12.329  1     3   28.767  16.438  6.849   8.219   39.726  1     4   63.014  2.740   2.740   8.219   28.767  2     5   90.411  1.370   6.849   0.000   1.370  2     6   15.068  2.740   16.438  8.219   57.534  2     7   67.123  0.000   0.000   1.000   32.877  3     8   72.603  6.849   5.479   5.000   15.068  3     9   56.164  12.329  6.849   4.110   20.548  3     10  50.685  4.110   8.219   1.370   35.616  3     }\datatable          \begin{document}          \begin{tikzpicture}     \begin{axis}     \addplot table[x index=0,y index=4] \datatable;     \end{axis}     \end{tikzpicture}          \end{document}      Producing ![enter image description here](http://i.stack.imgur.com/Lut47.png) What I want to do is to interrupt the plot, _without modifying the table_ (if possible), at desired locations to get something like this (I obtained the image by manually erasing some connecting lines): ![enter image description here](http://i.stack.imgur.com/ETE9g.png) Ideally, I'd like to do this with just one `\addplot`, but if that's not possible, any alternatives are welcome.


title: Combine many files in LyX

text: I have written dozens of exercises as LyX documents in separate files. Each of them has its own unique number. For example: 1013, 2053 etc. I would like to create a booklet with all the exercises, arranged by their exercise number. Is there a good way to combine them without inserting files manually one after the other? and also is there a way to arrange their order ascending by exercise number? Thanks in advance!


title: Differing hyphenation in xelatex and lualatex

text: > **Possible Duplicate:**   >  lualatex and line breaks after em-dashes I am working on a manuscript that can be compiled with either with `xelatex` or `lualatex`. The PDF output from `xelatex` looks better and is more tightly spaced but gives me lots of "black boxes" in `draft` mode. The output from `lualatex` appears fainter, is more loosely spaced, but seems better hyphenated, and suffers from fewer `overfull boxes`. I have stripped everything down to this MWE:               \documentclass[10pt,mdemyvopaper,draft]{memoir}          \usepackage[left=20mm,right=20mm,top=25mm,bottom=25mm]{geometry}          \usepackage[no-math]{fontspec}         \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}         \setmainfont[Numbers=OldStyle,BoldFont={* Semibold}]{Minion Pro}          \usepackage[british]{babel}          \begin{document}     Whether you are eight or eighty, whether you are in the thick of high school studies, or have retired from the workplace\textemdash and want to realize your schoolday dreams of reciting Shakespeare or mastering mathematics\textemdash this book is written for you.     \end{document}      I have included what I think is essential but nothing more to allow further investigation. The output from `xelatex` is ![enter image description here](http://i.stack.imgur.com/FcIwF.png) The output from `lualatex` is ![enter image description here](http://i.stack.imgur.com/hhQYd.png) How might I get the hyphenation performance of `lualatex` from `xelatex`? I am using a current, updated TeXLive 2012 installation.


title: Underfull \hbox and Underfull \vbox

text: I get the following couple of warnings when compiling my tex code. The `\hbox` warning is due to one of the articles I cite from my bibliography. What is the way to fix it?                Underfull \hbox (badness 1997) in paragraph at lines 151--153      []\OT1/cmr/m/n/10 Author X (year) Name of the article. Name of the journal      * * *               Underfull \vbox (badness 10000) has occurred while \output is active [15])     [16]


title: Text-wrapping and enumerated list in a table

text: I currently am trying to type a table in LaTeX, such that I need not only text-wrapping in one of the cells, but also an enumerated list in one cell. Here is what I have, but the table slides off the page at present:               \begin{table}[lh]     \begin{tabular}{|c||p{3cm}|p{9cm}|c|}     \hline     & \textbf{Root Position} & \textbf{First Inversion} & \textbf{Second Inversion} \\     \hline     \textbf{Major/minor triad} &          \begin{enumerate}         \item Double the Root         \item Double the $5^{th}$          \item Double the $3^{rd}$         \end{enumerate}     &  Double any pitches \textbf{except} tendency tones (\^{4}, \& \^{7})                          &  Double the $5^{th}$ \\     \hline      Diminished triad & Double the $3^{rd}$ & Double the $3^{rd}$ & Double the $5^{th}$ \\     \hline     \end{tabular}     \end{table}      How can I prevent the 'run-off' here? Thanks.


title: Image (figure) positioning

text: I got two cases with images I wish to use within a document. One is a logo, I would like to use it in the front page, at the top-right corner. How do I do that? The second are a drawings which I would like it to be (horizontally) centralized, and in between the paragraphs I have placed it. Point is at the final result, figures are positioned sometimes a paragraph or two later. How can I enforce them to be exactly where I want them?


title: Automatically creating a table from datatool using references in the text

text: This question is based on Peter Grill's answer to "Table including rows of a master table".. The function `\PrintDTLTable` takes an optional list of rowIDs (first row of the data file) as its first argument, and makes a table containing only those rows. The rowIDs are also used as labels. BibTeX is usually used so that it only lists those papers that are cited in the bibligraphy. I don't know how this mechanism works, but I was wondering if can be adapted to this situation. I.e., if I reference some rows by label in the text, then is there some way to automatically generate a table containing only the rows corresponding to the labels appearing in the text?               \documentclass{article}     \usepackage{array}     \usepackage{multirow}     \usepackage{datatool}     \usepackage{longtable}     \usepackage{etoolbox}     \usepackage{filecontents}     \newcommand{\colhead}[1]{\multicolumn{1}{>{\bfseries}l}{#1}}     \newcounter{tabenum}\setcounter{tabenum}{0}     \newcommand{\nextnuml}[1]{\refstepcounter{tabenum}\thetabenum.\label{#1}}          \begin{filecontents*}{foo.dat}       Hammer001,   Hammer,    1 ,  0 , 1 , 10 , 1 , \multirow{2}{2in}{light (add some words here to wrap around)}\\       Hammer002,   Hammer,    2 ,  0 , 1 , 10 , 1 , heavy       Hammer003,   Hammer,    3 ,  0 , 1 , 10 , 1 , really heavy       Longsword001,Longsword, 1 , -1 , 2 , 75 , 2 , one-handed       Longsword002,Longsword, 2 , -1 , 2 , 75 , 2 , two-handed       Longsword003,Longsword, 3 , -1 , 2 , 75 , 2 , three-handed     \end{filecontents*}          \newcommand{\PrintDTLTable}[2][]{%      % #1 = list of rowIDs      % #2 = database to search       \begin{longtable}{l l l l l l l l}         % & \colhead{Date} & \colhead{From} & \colhead{To} & \colhead{Email} & \colhead{Subject}\\\hlin         & \colhead{Label} & \colhead{Cost} & \colhead{Weight} & \colhead{PropA} & \colhead{PropB} & \colhead{PropC} & \colhead{Description}\\\hline         \DTLforeach         [\ifblank{#1}{\boolean{true}}{\DTLisSubString{#1}{\RowID}}]         {#2}{%           \RowID=RowID,%           \Label=Label,%           \Cost=Cost,%           \Weight=Weight,%           \PropA=PropA,%           \PropB=PropB,%           \PropC=PropC,%           \Description=Description%          }{%            \nextnuml{\RowID} & \Label &\Cost & \Weight & \PropA & \PropB & \PropC & \Description \\         }%         \end{longtable}     }%          \begin{document}     % \DTLsetseparator{&}% Define separator of the data     \DTLloaddb[noheader,keys={RowID,Label,Cost,Weight,PropA,PropB,PropC,Description}]{myDB}{foo.dat}          % \DTLdisplaydb{myDB}% Useful for debugging.          \PrintDTLTable[Hammer001,Hammer003,Longsword003]{myDB}     \PrintDTLTable{myDB}          This is a reference to ~\ref{Hammer003}.          \end{document}


title: Line through two points with offset in TikZ

text: I could not find a native command in TikZ allowing to draw a line going through two specified points where an offset can be controlled. So far, I'm using the `calc` extension to perform what I need but there may be something better:               \documentclass[12pt]{book}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{tikz}     \usetikzlibrary{calc}     \begin{document}     \begin{tikzpicture}     \coordinate (V1) at (0.5,2.25); % initial point 1     \coordinate (V2) at (1.5,3.25); % initial point 2     \coordinate (V3) at ($1.2*(V1)-0.2*(V2)$); % offset 1     \coordinate (V4) at ($-0.2*(V1)+1.2*(V2)$); % offset 2     \draw (V3)--(V4); % line with offset     \end{tikzpicture}     \end{document}


title: How can other programming languages and tools be used to create content for TeX documents?

text: When writing about programming languages or tools one often wants to include output from them in the document. Then it is useful if such output can be created as the document is compiled. For instance, if one describes a Lua function, then one may want the returned value of that function to be shown in the document. In this case it would be useful if the Lua function could be evaluated as the document is compiled so that the returned value is automatically included in the text. Another situation of when one wants to use functionality external to TeX and friends is when they are not fit to create or manipulate the content one wants in the document. For example, TeX and friends might not be ideal for analyzing data. These are two examples of when content for TeX documents are created by other programming languages and tools. How can such approaches be effectively implemented?


title: How can I create a Continued Figure Caption?

text: I have two figures with somehow the same caption with the following code:               \begin{figure}[!ht]\centering     \includegraphics[height=18cm]{pic1}     \caption{caption}     \end{figure}     \addtocounter{figure}{-1}     \begin{figure}[!ht]\centering     \includegraphics[height=18cm]{pic2}     \caption{(continued)}     \end{figure}      Is there a way to have only the first figure referenced in the list of figures?


title: Problem using "-" inside \textbf

text: I hope you can help me with this. I have the following in my code:               \textbf{Legendre–Fenchel transformation}      The problem is that the `-` doesn't show up after compilation. Instead it comes out as LegendreFenchel. How can I remedy this?


title: BibTeX, Natbib, and Algorithm2e

text: I'm trying to prepare a journal submission, and I'm having trouble getting natbib to play nicely.   1. When I include `natbib` in my document, it gives me the following error:              ! Undefined control sequence     \chapter ...ace{10\p@ }}\algocf@original@chapter          l.1 \begin{thebibliography}{17}      This isn't such a huge deal to me -- I'm fine working around it. The bigger problem that I have is...   2. When I disable `natbib`, the citation keys and references look horrible. For example, if I have the following `bibtex` entry              @article{Day06,         author = {T.E.~Day and J.T.~Napoli and P.C.~Kuo},         title = {Scheduling the Resident 80-Hour Work Week: An Operations Research Algorithm},         journal = {Current Surgery},         volume = {63},         number = {2},         month = {Mar.-Apr.},         year = {2006},         pages = {136-141}     }      whenever I use `\cite{Day06}` it produces [Day et al(2006)Day, Napoli, and Kuo] in my text, which looks awful. Even worse, the entry in the references section looks terrible, too: > [Day et al(2006)Day, Napoli, and Kuo] Day T, Napoli J, Kuo P (2006) > Scheduling the resident 80-hour work week: An operations research algorithm. > Current Surgery 63(2):136-141 I don't know why it's including the (horribly-mangled) key in the citation next to the author list. Any suggestions? Has anyone else dealt with this before? **Edited** to more accurately reflect the problem.


title: How to change the appearance of the display of the first use of an acronym? How to insert "short"?

text: How can I change the apperance of the display of the first use of an acronym? I want to change Compact Disc (CD) to Compact Disc (short CD) I tried               \defglsdisplayfirst[\acronymtype]{\glsentrylong{\glslabel} (short \glsentryshort{\glslabel})}      but this does not work with \glspl because it does not show the plural, if used.


title: PS file is not well included using latex->dvips chain

text: I'm trying to include given PostScript files in my document. However, I'm not really successful using the `latex -> dvips` chain as the image is not well included: ![latex dvips example](http://i.stack.imgur.com/XjEvc.png) However, the same file works fine when using `XeTeX`: ![xetex sample](http://i.stack.imgur.com/IPaLh.png) Used image: Get it here MWE:               \documentclass{article}     \usepackage{graphicx}          \begin{document}     % \fbox to visualize the dimensions       \fbox{\includegraphics[width=\textwidth]{Reflection_and_Refraction_2D.ps}}     \end{document}      **What do I have to do to get a proper ps-output file?** I would like to use XeTeX overall, but the output file has to be a PostScript file and pdf2ps does not seem to produce vector output.


title: How to get image and text on same page?

text: When i run the following code i get my output on two pages. On first page the text line and my image on page 2. How can i get my output on the same page that is text and image on the same page. Please help.               \documentclass[a4paper,12pt]{article}     \usepackage{graphicx}     \begin{document}     Hi...My first test image     \begin{figure}[h]     \centering     \includegraphics[width=1\textwidth]{fig10.pdf}     \caption{My first image}     \end{figure}          \end{document}


title: Strange latex compilation errors triggered by the number of lines on the page

text: I'm creating a paper using the class file supplied by the journal (mais.cls). The journal is Russian, so it has Russian title, Russian page titles etc. I have a .tex file containing only Latin characters that compiles without errors. When I add a single (English) word to the end of the text (increasing the number of lines, but not the number of pages) I suddenly receive many errors like this during the compilation.               ! LaTeX Error: Command \CYRE unavailable in encoding OT1.      The problem seems to be related to the page header on the even pages (excluding the title page). The page header is in Russian and is defined in the class style file. Somehow latex stops loving it depending on the number of lines on the page. I'm using the latest version of MikTeX 2.9 (and the problem was also manifesting itself in older version). The encodings are set like this:                \usepackage[cp1251]{inputenc}      \usepackage[english,russian]{babel}      \usepackage[T2A]{fontenc}      Why does this happen? Is the problem in the style of in latex? How to prevent the errors? I've uploaded the MWE (working/not working examples and the class style) with all logs and the resulting .pdf files to https://skydrive.live.com/redir?resid=E4ECA4072D08CEE5!2645 (archive: https://skydrive.live.com/redir?resid=E4ECA4072D08CEE5!2646)


title: Introductory pages in amsbook

text: Here is the preamble to my document, plus a little more.               \documentclass{amsbook}          \usepackage{amsmath}     \usepackage{amsfonts}%     \usepackage{amssymb}     \usepackage{graphicx}     \usepackage{mathtools}     \usepackage{pgfplots}% This uses tikz     \pgfplotsset{compat=newest}% use newest version          %Pour les accents françaises     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[frenchb]{babel}     \usepackage[autolanguage]{numprint}          \begin{document}          \title[Long Title]{Les Mathématiques}     \author{M. Abdel Guerroui}     \maketitle     \tableofcontents          \mainmatter          \chapter{Intégrales Correction Problème 1}      I'm having a little trouble adjusting to the amsbook style. Here's what I need:   1. To have no blank pages whatsoever.   2. To have the first page start at #1 and continue through the whole document, not restart at the first chapter.   3. To be able to put the title, author, and a photo on the very first page of the document.


title: catoptions destroys french active characters ! and :

text: A user of my `menukeys` package reported, that there’s an issue with the activ characters in french, i.e. `!`, `;`, `?` and `:`. I found out that it’s not a bug in `menukeys` but `catoptions` seems to interferre with `babel` here.               \documentclass{article}          \usepackage[french]{babel}     \RequirePackage{catoptions}          \begin{document}     \begin{itemize}         \item Test:         \item Test;         \item Test?         \item Test!     \end{itemize}     \end{document}      The above code gives ![without catoptions](http://i.stack.imgur.com/qRwHv.png) without `catoptions`, but ![with catoptions](http://i.stack.imgur.com/iOhvP.png) with `catoptions`. As you can see the `!` and the `:` seem to lose their activeness. So the question is: **How to restore the activeness of`!` and `:`?**


title: creating a fifo symbol with pgfdeclareshape

text: I'm compiling with:   * pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2011.7.8)   * pgf 2008/01/15 v2.10 (rcs-revision 1.12)   * tikz 2010/10/13 v2.10 (rcs-revision 1.76) I'm trying to create two new shapes for use with the PGF/TikZ environment for my final thesis in embedded engineering. The purpose with the symbols are a task diagram, which is kinda like a UML diagram. The first symbol, which I think could be a template for the second is a simple FIFO queue symbol.![Simple FIFO queue symbol](http://i.stack.imgur.com/P2cA1.png) ![FIFO queue with a semaphore](http://i.stack.imgur.com/HuQgy.png) These are figures from a previous course in embedded programming I've taken. So I'm free to create my own ones. But these seem to be the standard at my school, so I would like to not deviate too much. I've figured out by reading this answer ( What is the easiest way to draw 3D cube with TikZ? and thank you Matthew Leingang for that answer) that I could copy the rectangle shape and remove the west and east sides, like this:               \makeatletter     \pgfkeys{/pgf/.cd,       fifo offset x/.initial=20pt,       fifo offset y/.initial=20pt     }          \pgfdeclareshape{fifo}     {         \inheritsavedanchors[from=rectangle] % this is nearly a rectangle         \inheritanchorborder[from=rectangle]         \inheritanchor[from=rectangle]{north}         \inheritanchor[from=rectangle]{north west}         \inheritanchor[from=rectangle]{north east}         \inheritanchor[from=rectangle]{center}         \inheritanchor[from=rectangle]{west}         \inheritanchor[from=rectangle]{east}         \inheritanchor[from=rectangle]{mid}         \inheritanchor[from=rectangle]{mid west}         \inheritanchor[from=rectangle]{mid east}         \inheritanchor[from=rectangle]{base}         \inheritanchor[from=rectangle]{base west}         \inheritanchor[from=rectangle]{base east}         \inheritanchor[from=rectangle]{south}         \inheritanchor[from=rectangle]{south west}         \inheritanchor[from=rectangle]{south east}       \backgroundpath{         % store lower right in xa/ya and upper right in xb/yb         \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y         \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y         \pgfmathsetlength\pgfutil@tempdima{\pgfkeysvalueof{/pgf/fifo offset x}}%         \pgfmathsetlength\pgfutil@tempdimb{\pgfkeysvalueof{/pgf/fifo offset y}}%         \def\ppd@offset{\pgfpoint{\pgfutil@tempdima}{\pgfutil@tempdimb}}%         \pgfpathmoveto{\pgfqpoint{\pgf@xa}{\pgf@ya}}%         \pgfpathlineto{\pgfqpoint{\pgf@xb}{\pgf@ya}}%         \pgfpathclose%         \pgfpathmoveto{\pgfqpoint{\pgf@xb}{\pgf@yb}}%         \pgfpathlineto{\pgfqpoint{\pgf@xa}{\pgf@yb}}%         \pgfpathclose       }     }     \makeatother      That give me this: ![Rectangle without sides](http://i.stack.imgur.com/qp3t7.png) I could live with that, having the text in the center also opens for a lot more connection points for arrows to other nodes. But I still need to have a FIFO with a semaphore symbol and semaphore name. For the life of me, I can't crack that one. I'm thinking that I should do a multipart node so I'd have a field for both the queue name and the semaphore name. I tried to create the internal vertical lines, but only got as far as the first one, then the next ones crashed the compilation. I went about it by first defining the offset between them: By adding:               \pgfkeys{/pgf/.cd,     internal_displacement x/.initial=5pt,     internal_displacement y/.initial=5pt     }       Between the first \pgfkeys and \pgfdeclareshape and then I defined new x axis values for the vertical lines with:               \pgf@xc=\pgf@xb \advance\pgf@xc by-\pgfkeysvalueof{/pgf/internal_displacement x}%      and added the path:               \pgfpathmoveto{\pgfqpoint{\pgf@xc}{\pgf@ya}}     \pgfpathlineto{\pgfqpoint{\pgf@xc}{\pgf@yb}}     \pgfpathclose      this gave me this: ![FIFO with one vertical line](http://i.stack.imgur.com/ulmgL.png) NICE! right?!? But then I want to define some more vertical lines, so I add this right after I have declared \pgf@xc:               \pgf@xd=\pgf@xc \advance\pgf@xd by-\pgfkeysvalueof{/pgf/internal_displacement x}%     \pgf@xe=\pgf@xd \advance\pgf@xe by-\pgfkeysvalueof{/pgf/internal_displacement x}%     \pgf@xf=\pgf@xe \advance\pgf@xf by-\pgfkeysvalueof{/pgf/internal_displacement x}%      I'm thinking that this should shift the x value left by internal_displacement x, but instead I get a whole lot of errors along the likes of:               \pgf@sh@bg@fifo ...nternal_displacement x}\pgf@xe                                                    =\pgf@xd \advance \pgf@xe ...     l.10 ...idth=2cm,align=center] (fifo1)  {Node One};      I'm guessing internal_displacement x is cleared after being read the first time? This seems rather counter productive. There must be another way of doing this. So is there somebody who has an idea of:   1. getting the semaphore symbol added with a multipart node (so I'll have to text fields)    2. what I'm doing wrong in the vertical lines? I'm thinking if I could get this question nailed, I would not have trouble making the distance between the vertical and horizontal lines.


title: how to automatically convert \cases to \begin{cases} \end{cases}?

text: Is there some smart macro I could add in the preamble to handle this LaTeX auto-generated code? I use Maple's `latex()` command to convert results to LaTeX that I then compile using texlive in a separate document. Sometimes it generates the wrong LaTeX or broken LaTeX. Here is an example of one such case: ![Mathematica graphics](http://i.stack.imgur.com/plbLg.png) The above output is send to a latex file and wrapped inside `\begin{equation}` and `\end{equation}`. I picked `equation` environment to put the result inside, but I can change this if it helps in conversions. This is all done using an automated script. I do not use any of Maple style sheets or anything else. I simply just take the latex() output and process that using texlive standard setup. I have hundreds of such equations, so manually editing any broken Maple LaTeX output is not possible and since each time I re-run the script the edits will be lost. Is there a way to make a macro that will convert the above to use `\begin{cases}` with an enclosing `\end{cases}` using some smart replacement rule to make LaTeX and amsmath happy? Here is the error, and a MWE: ![Mathematica graphics](http://i.stack.imgur.com/MsPmS.png) MWE               \documentclass[11pt,notitlepage]{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     %smart renewcommand here? or \let?     \begin{document}          \begin{equation}     x-     \cases{-2\,\sqrt {-y \left( x \right) }&$y \left( x \right) \leq 0$\cr      2\,\sqrt {y \left( x \right) }&$0<y \left( x \right) $\cr}+{\it \_C1}=0_{{1}}     \end{equation}          \end{document}       and               pdflatex foo.tex          (/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsa.fd)     (/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsb.fd)          ! Package amsmath Error: Old form `\cases' should be \begin{cases}.          See the amsmath package documentation for explanation.     Type  H <return>  for immediate help.      ...                                                        l.9 \cases               {-2\,\sqrt {-y \left( x \right) }&$y \left( x \right) \leq 0$\cr     ?


title: How can I use "axis cs" of pgfplots with mathematical expression?

text: Inside the environment `axis` I can specify some points with `axis cs`. Up to now I am only able to use specific coordinates like `1,1`. But I want to know how to use a mathematical expression like `ln(3),2`. Here is an example:               \documentclass{scrartcl}     \usepackage[utf8]{inputenc}     \usepackage{pgfplots}     \pgfplotsset{compat=1.4}     \begin{document}     \begin{tikzpicture}     \begin{axis}[axis equal image,     width=10cm,     axis lines=middle,     axis line style={-latex},     xtick=\empty,     ytick=\empty,     ymin=-2.5, ymax=2.5,     xmin=-3.4,xmax=3.3,     clip =false,     xlabel={$x$},ylabel={$y$},     every axis x label/.append style={anchor=north},     every axis y label/.append style={anchor=east},     ]          \foreach \c in {-2,-1,-0.5,0.5,1,2}       \addplot[domain=-3:3,samples=200,restrict y to domain=-2:2]{ln(\c*x)};          %ln(1*3)1,098612289     \node[anchor=west] at (axis cs:3,1.099) {$c=1$};     %\node[anchor=west] at (axis cs:3,ln(3)) {$c=1$};     \end{axis}     \end{tikzpicture}     \end{document}      At the moment I am using:               %ln(1*3)1,098612289     \node[anchor=west] at (axis cs:3,1.099) {$c=1$};      but I would prefer a more automatic way               \node[anchor=west] at (axis cs:3,ln(3)) {$c=1$};


title: Visual table editor for linux

text: Is there any visual LaTeX-table editor for linux? I want something where I can load existing LaTeX-tables, modify them and save it in LaTeX.


title: How to refer to a figure created by tikzpicture in paper body?

text: I am relatively new with LaTeX. I created an image by               \begin{figure}     \begin{tikzpicture}     ....     \end{figure}     \end{tikzpicture}      I just don't know how to refer it in paper body by `\ref{compression}`, but this command displays the subsection number instead of the figure number.


title: Filling a full beamer slide with tikzDevice output from R

text: Q: What's the best way to fill an **entire** beamer slide with tikzDevice output (i.e., the `.tex` file output from the `tikz()` function in R's `tikzDevice` package)? I've included some undesirable examples below. In summary:   1. Example 1: Can see that the input .pdf looks sloppy.   2. Example 2: Can see that simply inputting the tikzDevice output leads to spilling out over the slide   3. Example 3: Can see that simply inputting the tikzDevice output designed to fill the text region works just fine. But this is not my goal. I want to fill the **entire** slide   4. Example 4: Can see that the `\resizebox{}` leads to spillage. I was surprised this didn't work   5. Example 5: Including the tikzDevice output within another `tikzpicture` environment. This actually works fine. But a `tikzpicture` environment within a `tikzpicture` environment? Seems hacky. There must be a better way.   6. Example 6: Well, there's no actual example here. I'm just hypothesizing that there are some minimal edits one can make directly to the tikzDevice output which will lead to the desired outcome. But I've mucked around and come up with nothing.  **R Code**               ################### Setup     library(tikzDevice)     beamer.parms = list(paperwidth   = 364.19536/72,  # converts `pt` to `in`                         paperheight  = 273.14662/72,                         textwidth    = 307.28987/72,                         textheight   = 269.14662/72,     x = rnorm(1000)          #################### PDF Plot     pdf(file = "./img/img0010a-eg.pdf",          width = beamer.parms$paperwidth,         height = beamer.parms$paperheight)     plot(x, main = "my title", las = 1, type = "n")     grid(lwd=2, lty="dashed", col="gray")     points(x)     dev.off()          ######################## TikZ image to fill full beamer slide     tikz("./img/img0010b-eg-full.tex",           width = beamer.parms$paperwidth,           height = beamer.parms$paperheight)     plot(x, main = "my title", las = 1, type = "n")     grid(lwd=2, lty="dashed", col="gray")     points(x)     dev.off()          ######################## TikZ image to fill text region of beamer slide     tikz("./img/img0010c-eg-text.tex",           width = beamer.parms$textwidth,           height = beamer.parms$textheight)     plot(x, main = "my title", las = 1, type = "n")     grid(lwd=2, lty="dashed", col="gray")     points(x)     dev.off()      **tikzDevice output (img0010b-eg-full.tex)**               \begin{tikzpicture}[x=1pt,y=1pt]     <coloring commands>       \begin{scope}         \path[clip] (  0.00,  0.00) rectangle (365.56,274.17);         <more coloring commands>         <drawing commands>       \end{scope}     \end{tikzpicture}      **LaTeX Code**               \documentclass{beamer}     \usepackage{tikz}     \begin{document}       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       \begin{frame}  % fills a full slide, put is ugly because of pdf input         \begin{tikzpicture}[remember picture,overlay]           \node[at=(current page.center)] {               \includegraphics[width=\paperwidth, height=\paperheight]{./img/img0010a-eg}                };         \end{tikzpicture}       \end{frame}       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       \begin{frame}  % spills off to the right         \input{./img/img0010b-eg-full.tex}       \end{frame}       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       \begin{frame}  % fills the text region of the slide. But goal is to fill ALL.         \input{./img/img0010c-eg-text.tex}       \end{frame}       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       \begin{frame}  % Surprised this didn't work. Spills off to the right.         \resizebox{\paperwidth}{\paperheight}{%          \input{./img/img0010b-eg-full.tex}       }%       \end{frame}       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%       \begin{frame}  % This works. But a tikzpicture environment inside of a                       % tikzpicture environment? This seems hacky. Must be a better                      % way.         \begin{tikzpicture}[remember picture,overlay]           \node[at=(current page.center)] {             \input{./img/img0010b-eg-full.tex}           };         \end{tikzpicture}       \end{frame}       %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \end{document}       **Resulting slides** ![pdf approach](http://i.stack.imgur.com/qm2FP.jpg) ![tikzdevice with spillage](http://i.stack.imgur.com/qY78C.jpg) ![tikzdevice over text region. no spillage](http://i.stack.imgur.com/XNs4I.jpg) ![tikzdevice with resizebox. spillage](http://i.stack.imgur.com/AhPSo.jpg) ![tikzdevice inside of a tikzpicture environment. no spillage](http://i.stack.imgur.com/vf0XC.jpg)


title: Choice between asparaitem, compactitem, and itemize

text: I am writing a conference paper (in `lncs`). I see people using different itemization styles: `asparaitem`, `compactitem`, and `itemize`. Because the spacing of these environments is somewhat different, I am wondering if there is some convention of choice. For instance, which should be used in the lowest level paragraph ... Could anyone clarify in which case which itemization style should be used?


title: What is the recommended font to use for a statistical table in an academic journal?

text: I am **brand new** to LaTex, and I am trying to create a report displaying statistical data, for an academic publication. The table is quite a large one, consisting of several nested columns, and is 23 cells wide in the data region (away from the titles etc). The publication is in A4 format, so the table has to fit into an A4 page (portrait format). I remember reading somewhere that Serif fonts should NOT be used for tabular data, so at least I know that I have to use a san serif font. However, this is my first foray into using LaTeX, and would appreciate some advice from the more seasoned pros in here. I would be very grateful if someone could recommend (best practise) font and font size to use for the column headers and cell data for such a table. I have attached the table I am trying to create, hopefully, that helps. ![Statistical Table](http://i.stack.imgur.com/IP8Ah.png)


title: conditional glossary style

text: I use glossaries to display a global symbol list but also local one for each equation. The first `userkey` is used to add the physical unit. But some smybols (like efficiencies or proportions) don't require a unit. I marked these with a dash. In the global list of symbols this looks fine (like the one at COP). ![enter image description here](http://i.stack.imgur.com/LDWJF.png) But for the local one (due to using a diffrent style) it looks kinda silly. ![enter image description here](http://i.stack.imgur.com/WVvBE.png) So my wish is to drop the `in -` if the `\glsuerkeyi` equals `-`. I have a command which is placed inside the glossarystyle to produce the entries :               %glossarystyle uses tabular      \newcommand{\itemss}[2]{\glstext*{#1} & #2 in \glsuseri*{#1}  \\}      So I guess this command needs to be renewed conditionally for each entry. I found this (How to check if a macro value is empty or will not create text with plain TeX conditionals?) helpful post. But I have quite a few things I'm not sure about:   a) Can the command even be renewed inside the glossaries environment and if yes can it be redefined for each entry?   b) I'm not sure which solution from the other post to apply. Since I got tokens, printed out text and I do not want to check for emtpy strings, and so on. I would really appreciate if you could point me in the right direction. **Edit:** I think i got it partially figured out. Using etoolboxes `\ifstrequal` might be a solution:               \newglossarystyle{tabx4col}{%     % put the glossary in a longtable environment:     \renewenvironment{theglossary}%     {\vspace{-1.7em}      \begin{longtable}{@{}p{0.15\textwidth}@{}p{0.1\textwidth}@{}p{0.60\textwidth}@{}p{0.15\textwidth}@{}}}%     {\end{longtable}}%     % Set the table's header:     \renewcommand*{\glossaryheader}{}%     % No heading between groups:     \renewcommand*{\glsgroupheading}[1]{}%     % Main (level 0) entries displayed in a row:     \ifstrequal{\glsentryuseri{##1}}{-}{          \renewcommand*{\glossaryentryfield}[5]{%     \glstarget{##1}{##2}% Name     & \glsentryuseri{##1}% Units     & ##3% Description     & ##5% Page list      \\% end of row     }%     }{     \renewcommand*{\glossaryentryfield}[5]{%     \glstarget{##1}{##2}% Name     &     & ##3% Description     & ##5% Page list      \\% end of row     }%     }     % Sub entries treated the same as level 0 entries:     %\renewcommand*{\glossarysubentryfield}[6]{%     %\glossaryentryfield{##2}{##3}{##5}{##6}}%     %% Nothing between groups:     %\renewcommand*{\glsgroupskip}{}%     }      I'm not sure if `\glsentryuseri{##1}` is the right entry to check and I think it always get compared to the actual text inside the first pair of brackets, in this case \glsentryuseri{##1}. It would need to be expanded somehow. **Edit:** Created MWE (https://gist.github.com/tairun/5648781)


title: Get the "annote" field of a .bib file

text: I have BibTeX entries that look like this:               @inproceedings{Defraene2010,     annote = {This is a very nice paper.I will say more about it later},     author = {Defraene, Bruno and van Waterschoot, Toon and Ferreau, Hans Joachim and Diehl, Moritz and Moonen, Marc and Waterschoot, Toon Van},     booktitle = {Proceedings of the 18th European Signal Processing Conference (EUSIPCO ’10), Aalborg, Denmark, Aug. 2010},     keywords = {clipping},     title = {{Perception-based clipping of audio signals}},     volume = {006},     year = {2010}     }      How can I get the content of the "annote" field in my LaTeX document? I am looking for something like this in the LaTeX file:               \cite{Defraene2010}: \citexxx[annote]{Defraene2010}


title: TikZ: labeling a small arc

text: How can I automate labeling a small arc?               \documentclass[tikz, convert = false]{standalone}     \begin{document}     \begin{tikzpicture}       \draw (0, 0) arc[radius = .25cm, start angle = 0, end angle = 30];       \draw (-.01, .07) arc[radius =.25cm, start angle = 90, end angle = -90]       node[left] {a};     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/zYFDE.png) I had to play around with `(-.01, .07)` for the labeling arc. However, if the arc moves, the label isn't in the correct location. This example is rather simple but this has to do with changing hyperbola and/or rotating it. When this occurs, the vectors will change position and increase or decrease the angle between them. Unfortunately, the labeling arc will remain put. How can I have the arc adjust with the changing of the figure? * * * Just for reference, here is a picture of the actual figure: ![enter image description here](http://i.stack.imgur.com/s1MB5.png) If anything is changed, everything but the arc and alpha_2 will adjust automatically. I would like to have the arc and alpha_2 built into the adjustments. Again for reference, here is the main figure code:               \documentclass[convert = false]{standalone}          \usepackage[utf8]{inputenc}                \renewcommand{\rmdefault}{ppl}                                                      \linespread{1.05}                               \usepackage[scaled]{helvet}                                                          \usepackage{courier}                                                                 \usepackage{eulervm}                             \normalfont     \usepackage[T1]{fontenc}     \usepackage{textcomp}          \usepackage[usenames, dvipsnames]{xcolor}     \usepackage{tikz}     \usepackage{fp}          \usetikzlibrary{arrows}     \usetikzlibrary{calc}     \usetikzlibrary{decorations.markings}     \usetikzlibrary{backgrounds}     \usetikzlibrary{intersections}     \usetikzlibrary{fixedpointarithmetic}          \begin{document}     \begin{tikzpicture}[       every label/.append style = {font = \tiny},       line join = round, line cap = round, >=triangle 45       ]       \def\angle{50}       \def\peri{.5}       \def\planet{.4}       \def\a{1.25}            \pgfmathsetmacro{\b}{\a / tan(\angle)}            \coordinate (O) at (0, 0);            \draw[-latex] (O) -- (3.5, 0) node[below left, font = \tiny] {\(\mathbf{V}\)};       \draw[-latex] (3.5, 0) -- +(1, 0) node[right, font = \tiny]       {\(\hat{\mathbf{u}}_V\)};       \draw[-latex] (0, 3.5) -- +(0, 1) node[above, font = \tiny]       {\(\hat{\mathbf{u}}_S\)};       \draw[thick, gray, name path global = soi] (O) circle[radius = 3.5cm];            \begin{scope}[rotate = {110}, shift = {(0, {-\a - \peri})},         decoration = {markings,           mark = at position 0.20 with {\arrow{latex}},           mark = at position 0.80 with {\arrow{latex}}         }]         \draw[red, postaction = decorate, name path global = hyper]         plot[domain = -2.95:2.95, samples = 100]         ({\x}, {\a * sqrt(1 + (\x / \b)^2)});         \draw[dashed] plot[domain = 0:3, samples = 100] ({\x}, {\a / \b * \x})         coordinate (P1);              \path plot[domain = 0:-3, samples = 100] ({\x}, {-\a / \b * \x})         coordinate (P2);              \draw[dashed] plot[domain = -3:0, samples = 100] ({\x}, {-\a / \b * \x})         coordinate (I);         \draw plot[domain = 0:.5, samples = 100] ({\x}, {-\a / \b * \x})         coordinate (P3);         \draw[dashed] (O) -- (I);              \shadedraw[gray, inner color = blue!40!green,         outer color = black!50!blue!50] (O) circle[radius = \planet];              \draw[fixed point arithmetic] let           \p0 = (I),           \p1 = (O),           \p2 = (P1),           \n1 = {atan2(\x1 - \x0, \y1 - \y0)},           \n2 = {atan2(\x2 - \x0, \y2 - \y0)},           \n3 = {.75cm},           \n4 = {(\n1 + \n2) / 2}         in (I) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         node[fill = white, inner sep = 0, font = \tiny] at (\n4:\n3) {\(\beta\)};              \draw[fixed point arithmetic] let           \p0 = (I),           \p1 = (O),           \p2 = (P2),           \n1 = {atan2(\x1 - \x0, \y1 - \y0)},           \n2 = {atan2(\x2 - \x0, \y2 - \y0)},           \n3 = {.75cm},           \n4 = {(\n1 + \n2) / 2}         in (I) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         node[fill = white, inner sep = 0, font = \tiny] at (\n4:\n3) {\(\beta\)};              \draw[fixed point arithmetic] let           \p0 = (I),           \p1 = (P1),           \p2 = (P3),           \n1 = {atan2(\x1 - \x0, \y1 - \y0)},           \n2 = {atan2(\x2 - \x0, \y2 - \y0)},           \n3 = {.75cm},           \n4 = {(\n1 + \n2) / 2}         in (I) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]         node[fill = white, inner sep = 0, font = \tiny] at (\n4:\n3) {\(\delta\)};       \end{scope}            \node[name intersections = {of = soi and hyper}] (P4) at       ($(intersection-2)$) {};            \draw[-latex] (P4.center) -- +(1.5, 0) node[font = \tiny, below left]       {\(\mathbf{V}\)} coordinate (P5);       \draw (P5) -- +(.5, 0) coordinate (P6);            \path[name path global = circ] (P4.center) circle[radius = 1bp];       \path[name intersections = {of = circ and hyper}] (P4.center) --       ($(intersection-2)!.75cm!(intersection-1)$) coordinate (P7);            \draw[-latex] (P5) -- +($(P7) - (P4)$) node[font = \tiny, right]       {\(\mathbf{v}_{\infty_1}\)} coordinate (P8);       \draw[-latex] (P4.center) -- (P8) node[font = \tiny, fill = white,       inner sep = 0, pos = .65] {\(\mathbf{V}_1^{(v)}\)};            \node[name intersections = {of = soi and hyper}] (P9) at ($(intersection-1)$)       {};            \draw[-latex] (P9.center) -- +(1.5, 0) node[font = \tiny, below left]       {\(\mathbf{V}\)} coordinate (P10);       \draw (P10) -- +(.65, 0) coordinate (P11);            \path[name path global = circ2] (P9.center) circle[radius = 1bp];       \path[name intersections = {of = circ2 and hyper}] (P9.center) --       ($(intersection-2)!.75cm!(intersection-1)$) coordinate (P12);            \draw[-latex] (P10) -- +($(P12) - (P9)$) node[font = \tiny, right]       {\(\mathbf{v}_{\infty_2}\)} coordinate (P13);       \draw[-latex] (P9.center) -- (P13) node[font = \tiny, fill = white,       inner sep = 0, pos = .5, above = .1cm] {\(\mathbf{V}_2^{(v)}\)};            \draw[fixed point arithmetic] let         \p0 = (P4.center),         \p1 = (P5),         \p2 = (P8),         \n1 = {atan2(\x1 - \x0, \y1 - \y0)},         \n2 = {atan2(\x2 - \x0, \y2 - \y0)},         \n3 = {.5cm},         \n4 = {(\n1 + \n2) / 2}       in (P4.center) +(\n1:\n3) arc[radius = \n3, start angle = \n1,       end angle = \n2] node[fill = white, inner sep = 0, font = \tiny] at       ([shift = (P4.center)] \n4:.75cm) {\(\alpha_1\)};            \draw[fixed point arithmetic] let         \p0 = (P5),         \p1 = (P6),         \p2 = (P8),         \n1 = {atan2(\x1 - \x0, \y1 - \y0)},         \n2 = {atan2(\x2 - \x0, \y2 - \y0)},         \n3 = {.45cm},         \n4 = {(\n1 + \n2) / 2}       in (P5) +(\n1:\n3) arc[radius = \n3, start angle = \n1,       end angle = \n2] node[fill = white, inner sep = 0, font = \tiny] at       ([shift = (P5)] \n4:.63cm) {\(\phi_1\)};            \draw[fixed point arithmetic] let         \p0 = (P9.center),         \p1 = (P10),         \p2 = (P13),         \n1 = {atan2(\x1 - \x0, \y1 - \y0)},         \n2 = {atan2(\x2 - \x0, \y2 - \y0)},         \n3 = {.5cm},         \n4 = {(\n1 + \n2) / 2}       in (P9.center) +(\n1:\n3) arc[radius = \n3, start angle = \n1,       end angle = \n2];            \draw[fixed point arithmetic] let         \p0 = (P10),         \p1 = (P11),         \p2 = (P13),         \n1 = {atan2(\x1 - \x0, \y1 - \y0)},         \n2 = {atan2(\x2 - \x0, \y2 - \y0)},         \n3 = {.65cm},         \n4 = {(\n1 + \n2) / 2}       in (P10) +(\n1:\n3) arc[radius = \n3, start angle = \n1,       end angle = \n2] node[fill = white, inner sep = 0, font = \tiny] at       ([shift = (P10)] \n4:\n3) {\(\phi_2\)};            \begin{scope}[on background layer]         \draw[dashed] (O) -- +($(O) - 0.65*(I)$) coordinate (P14);       \end{scope}            \draw[latex-] (P14) -- +($(P4) - (P7)$) node[font = \tiny, right]       {\(\mathbf{v}_{\infty_1}\)} coordinate (P15);       \draw[-latex] (P15) -- +($(P12) - (P9)$) node[font = \tiny, below]       {\(\mathbf{v}_{\infty_2}\)} coordinate (P16);       \draw[-latex] (P14) -- (P16) node[font = \tiny, pos = .5, above]       {\(\Delta\mathbf{V}^{(v)}\)};            \draw let         \p0 = (P15),         \p1 = (P14),         \p2 = (P16),         \n1 = {atan2(\x1 - \x0, \y1 - \y0)},         \n2 = {atan2(\x2 - \x0, \y2 - \y0)},         \n3 = {.25cm},         \n4 = {(\n1 + \n2) / 2}       in (P15) +(\n1:\n3) arc[radius = \n3, start angle = \n1,       end angle = \n2] node[inner sep = 0, font = \tiny, inner sep = 0,       fill = white] at ([shift = (P15)] \n4:\n3) {\(\delta\)};            \draw (-2.32, 2.15) arc[radius = .25cm, start angle = 90, end angle = -90]       node[left, font = \tiny] {\(\alpha_2\)};     \end{tikzpicture}     \end{document}


title: I want to draw a table like this, but my code does not work

text: ![enter image description here](http://i.stack.imgur.com/Oee6K.jpg) Here is my code.               \documentclass[12pt,a4paper,twoside]{memoir}     \pagestyle{empty}% for cropping     \usepackage{colortbl,multirow,hhline}     \usepackage[raggedrightboxes]{ragged2e}     \definecolor{c1}{rgb}{0.30980, 0.50588, 0.73725}     \definecolor{c2}{rgb}{0.82353, 0.87843, 0.92941}     \begin{document}          \begin{table}[H]   % added on 12172013 for caption and label     \centering     \caption{Table}     \label{tb32b}     \arrayrulecolor{white}     \begin{tabular}{|p{4.5em}|p{10.8cm}|p{3em}|}     \rowcolor{c1}     \textcolor{white}{Measure}              & \textcolor{white}{Description}                                              &   \textcolor{white}{NO.}  \\     \hline           \rowcolor{c2}     \multirow{2}{*}{Orientation-based}    &   The first orientation-based measure is the number of empty bins in the t.  &   $N_i$ is the number of detected      \\     \cline{2-2}     & The second one is defined as the variance in  the orientations of points. & $N_i$ \\     \cline{2-2}               \end{tabular}     \end{table}     \end{document}


title: Reference table value in text

text: I want to be able to reference a table value in my text (this is because I often update my tables, and then list the specific values in the text). Here is an example table I would use:               % Example Table     \documentclass{minimal}     \begin{filecontents*}{scientists.csv}     name,surname,age     Albert,Einstein,133     Marie,Curie,145     Thomas,Edison,165     \end{filecontents*}          % Read in Table                 \documentclass{article}     \usepackage{pgfplotstable}     \begin{document}     \pgfplotstabletypeset[         col sep=comma,         string type,         columns/name/.style={column name=Name, column type={|l}},         columns/surname/.style={column name=Surname, column type={|l}},         columns/age/.style={column name=Age, column type={|c|}},         every head row/.style={before row=\hline,after row=\hline},         every last row/.style={after row=\hline},         ]{scientists.csv}     \end{document}      I may want to be able to reference a given scientists age in the text by a reference of his/her name (ie,:)               Albert Einstein is \ref{albert} years old.        Ideally, this would still be using pgfplotstable because it is how I currently read in many tables. Thanks,


title: 3D plots with pgfplots

text: I am trying to plot 3D plots with `pgfplots`. I have started with an example from documentation:               \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{tikz}     \usepackage{pgfplots}     % \usepackage{3dplot}     \begin{document}     %     \begin{figure}[!h]     \begin{tikzpicture}     \begin{axis}     % this yields a 3x4 matrix:     \addplot3+[mesh] coordinates {     (0,0,0) (1,0,0) (2,0,0) (3,0,0)     (0,1,0) (1,1,0.6) (2,1,0.7) (3,1,0.5)     (0,2,0) (1,2,0.7) (2,2,0.8) (3,2,0.5)};     \end{axis}     \end{tikzpicture}     \end{figure}     %     \end{document}      When I look into the file .log I can read: > ! Package pgfkeys Error: I do not know the key '/tikz/mesh' and I am going > to ignore it. Perhaps you misspelled it. I have re-installed pgfplots package and the result is the same.


title: Conditional Bibliography in LyX Subdocument

text: I am using LyX to manage a multi-part document (my thesis) and I would like to be able to produce stand alone sub-documents (e.g. a chapter) that include a bibliography, but only when the sub-document is produced on its own. When I produce the full master document, the only bibliography should be at the end. How can I make the bibliography in a LyX subdocument only show up when the document is used by itself (and not when it is included in the master document)?


title: How to plot intervals and points in the real line?

text: I need to plot a series of sets of intervals (and points) in the real line. Intervals can be closed, left/right-open or open. (Open/closed ends are marked with empty/filled circles) and isolated points are just dots. Groups of intervals may have a common style and a common legend. Below you can see a mock up. ![enter image description here](http://i.stack.imgur.com/AmMrs.png) I can get the basics with the following code               \documentclass{article}     \usepackage{tikz}     \usepackage{pgfplots}          \begin{document}     \begin{tikzpicture}     \begin{axis}[title = {Number line}, axis y line=none, y=0.5cm/3, restrict y to domain=0:20, axis lines=left]     \addplot+[only marks] coordinates  {( 3.14, 0 )( 10, 0 )};      \addplot+[only marks] coordinates  {( 20, 0 ) ( 21, 0 )};      \end{axis}     \end{tikzpicture}     \end{document}      but it is difficult to go further, because I couldn't find a way to change the style of the point (e.g. from filled to empty circles) within a `coordinates` and/or break a single coordinate set to plot two disjoint intervals and points with the same style (like the blue set in the picture). And alternative that I found is to use `tikz` `draw`s inside the `axis` environment               \draw[green, -|] (axis cs:5,0)--(axis cs:6,0); % something like "(-]" or "*-o" (if they worked) may be better      but the points are ignored to set the axis boundaries (which I need to be automatic). Also I need to use pgfplots to keep consistency with other (normal) plots (in terms of the style of the point and lines and the axis).


title: LyX fancy header \thispagestyle{fancy}

text: I am using LyX and would like (all) my document pages to have a fancy header style that I defined. However, including               \thispagestyle{fancy}      or               \AtBeginDocument{\thispagestyle{fancy}}      doesn't work! The only way I got it to work is using the ERT command               \thispagestyle{fancy}      at the beginning of the document. Does anyone know how to get over it without using an ERT?


title: Table header appears twice at top of page

text: The following minimal code demonstrates my problem. (For me) the header appears twice on the table which is placed at the top of page #2. Any help would be appreciated.               \documentclass{article}          \usepackage{needspace}     \usepackage{longtable}          \begin{document}          ABC     \vspace{510pt} % Simulate a full first page.     \needspace{2\baselineskip} % Keep table from starting too soon.     \begin{longtable}{ l|l|l }     % The header will appear twice at the top of the table.     \hline \textbf{HD1} & \textbf{HD2} & \textbf{HD3} \endhead \hline     C1 & C2 & C3 \\ \hline     C1 & C2 & C3 \\ \hline     C1 & C2 & C3 \\ \hline     \end{longtable}          \end{document}


title: Line wrapping mathmode in ACM article-proc style

text: I am using the ACM document class acm_proc_article-sp. It is a two column page style. I keep running into a badbox where I have some line of text, and then a short equation in mathmode. For example,               ... such that $\exists x.p(x)$.      Leads to $\exists x.p(x)$ being outside of the margin (leaking into the middle of the page). One solution, is to rewrite the sentence using either fewer or more words to force it to fit, or to force a wrap. However this is not ideal because if you decide to change something earlier in the document, you can end up back in the situation, again having to mangle the sentence length.


title: Advanced math icon help in TeXlipse

text: As a regular user of Eclipse, I finally decided to give TeXlipse a shot. But I cant seem to find keyboard shortcuts or any sort of graphical menu or a popup such as content assist for advanced math symbols. For example, the "underbrace" symbol in this statement               $\underbrace{e^{i\pi}+1=0}_\text{i found it!}$      doesn't seem to figure anywhere in TeXlipse but it doesn't generate an error either if I use it. Among other useful short cuts, non-existent in TeXlipse, that I regularly use is "\\" for a newline in TexStudio (a fork of TexMaker). Has anybody missed similar features in TeXlipse ?


title: How to disable spell checking or equivalent features in TeXmaker/TeXstudio?

text: The spell checker is really good when I type English words. However I am a Chinese user and it always annoys me when I type `Chinese` words since they are treated as misspelled. So how can I disable spell checking in TeXmaker/TeXstudio or something equivalent to that?


title: How to represent cross and tick in itemize bullets?

text: I have a an `itemize` environment in LaTeX. How can I represent a **tick** and a **cross** symbol instead of a dot?


title: Why did they put PDF titling in the hyperref package?

text: The ability to title/attach an author to a published PDF file is in `\hypersetup` which is part of package `hyperref`. But it seems rather unintuitive to me that the `pdftitle`, `pdfauthor`, `pdfsubject` items are part of the `hyperref` package. Why is that? A reason I can think of that they might have done this is because search engines will crawl through that data?


title: Fancyheader and Appendix

text: I am having some trouble combining fancyhdr with my Appendix. There's two problems. The first is that the header doesn't show the correct information on the page just before the Appendix (the last page of the main text). It should look something like this: ![correct header](http://i42.photobucket.com/albums/e301/Timsey92/Header1.png) But what I get is: ![bad header](http://i42.photobucket.com/albums/e301/Timsey92/Header2.png) The second is that the header in the Appendix shows: ![appendix header](http://i42.photobucket.com/albums/e301/Timsey92/Header3.png) And I would like 'Chapter' to be 'Appendix'. I've tried the suggestions here, but those don't seem to work. The relevant code:               \documentclass[11pt]{report}          \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm]{geometry}          \usepackage{parskip}     \setlength\parindent{0pt}     \setlength{\headheight}{15pt}          \usepackage{fancyhdr}     \pagestyle{fancy}     \fancyhead{}     \fancyhead[L]{Entanglement Entropy}     \fancyhead[C]{Chapter \thechapter}     \fancyhead[R]{Section \thesection}          \renewcommand{\headrulewidth}{0.4pt}          \begin{document}          \chapter{title}     \input{chapters/chapter05}          \appendix     \chapter{another title}     \input{chapters/appendix}          \printbibliography          \end{document}


title: Tabular: messed up margins

text: ![enter image description here](http://i.stack.imgur.com/oMFqD.png) Why isn't the table adjusting the text to make line breaks when necessary? Can I make them manually? What could be done to fix these margins? Edit: MWE below:               \documentclass[a4paper,12pt,spanish]{article}     \usepackage{multirow}     \usepackage[utf8]{inputenc}     \usepackage{geometry}     \usepackage[spanish]{babel}     \usepackage{graphicx}     \begin{document}     \begin{center}     \begin{tabular}{|r|ccccc|}     \hline        & Descripción & Narración & Diálogo & Exposición & Argumentación \\     \hline       Técnico-científico &  &  &  & Habitual & \\       Jurídico-administrativo &  &  &  &  & \\       Humanístico &  &  &  & Estudio & Ensayo\\       Periodístico &  &  &  & Noticia & Art. opinión\\       Literario & Descripción & Novela & Teatro & \multicolumn{2}{c|}{Lengua literaria}\\     \hline     \end{tabular}     \end{center}     \end{document}      Edit 2: Problem remains when changing `tabular` with `tabu`. Aditionally, it gives me a non fatal error when compilling: `Overfull \hbox (57.79063 too wide) (page 2), lines 112-123.` Since this table appears in the page 2 and the code lines match too, it probably wants to tell me something, but I don't know what it means.


title: How do I get rid of "Key http://link is undefined" warnings?

text: When using the `hyperref` package, I keep getting this warning that says something like:               Key ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf is undefined      whenever I include an http link. For example:               \documentclass{article}          \usepackage[colorlinks=true]{hyperref}          \begin{document}          Here is a link to \href{ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf}{The Short     Math Guide}          \end{document}      I'm using pdflatex.exe to generate the output, and v6.82h of hyperref.sty.


title: BibLaTeX: Wrong indentation when changing font size?

text: BibLaTeX seems to calculate wrong indentation when I change the fontsize. The lines following the first one are a little to the left than the first line (see the red line). ![Picture that shows the problem](http://i.stack.imgur.com/5tDqT.png) MWE:               \documentclass[titlepage,listof=totoc,final]{scrbook}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[style=alphabetic,backend=biber,maxnames=4,minnames=3,maxbibnames=99,block=space,abbreviate=true,firstinits=true]{biblatex}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}     @online{GLS:datasheet,         title = "GLS Datasheet",         organization = "Optoelectronics Research Centre",         howpublished = "Website",         date = "2004-09",         urldate = "2013-07-01",         url = "http://www.southampton.XXXX",         address = "Southampton, United Kingdom"     }     @article{Labadie:First_fringes,         author = {Labadie, L. and Mart\'{\i}n, G. and Anheier, N. C. and Arezki, B. and Qiao, H. A. and Bernacki, B. and Kern, P.},         title = {First fringes with an integrated-optics beam combiner at 10},         DOI= "10.1051/0004-6361/201116727",         journal = {A\&A},         year = 2011,         volume = 531,         pages = "A48"     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \KOMAoptions{fontsize=12pt}     \nocite{*}     \printbibliography          \end{document}      **What can be done to avoid this?** P.S.: Some texts in my theses have to be 10pt, and others (like the bibliography) 12pt. Sadly, this is given to me, and I can't do anything about it.


title: Blank Page and "Missing \begin{document}" error in simple document

text: Im new with LaTeX, I have MikTek and TeXnic Center. The first time I tried to write a document I noticed I couldn't cancel terms in mathematical equations, so iI download the `cancel` package and installed it by hand. Now the new package is working (or at least that is what I think), but for example the following simple document generates a `Missing \begin{document}` error and a first blank page:               \documentclass{article}          \usepackage[spanish,activeacute]{babel}     \usepackage{amsmath}     \usepackage{cancel}          \title{...}     \author{...}          \begin{document}          \maketitle          \begin{equation}     \cancel{a}     \end{equation}          \end{document}      I cant copy all the build output from the TexnicCenter output window, but here you can see some part of it ![](http://imgur.com/TklbDy0.jpg) Why is this?


title: Weird error in file converted from docx to txt by LibreOffice

text: > **Possible Duplicate:**   >  LaTeX baffled by BOM---Unicode's byte order mark. I have a large text file in `.docx` format, and I used LibreOffice to convert it to plain text so I could nicely format it with LaTeX. I've fixed as many of the problems as I could find (unescaped %s, etc), but there's one persistent bug in the document that still remains. When I run LaTeX, I get as an error:               ! LaTeX Error: Missing \begin{document}.     ...     l.1           ��%\documentclass{article}      My preamble consists of               \documentclass{article}     \begin{document}      so I'm definitely not just missing a `\begin{document}`. I suspect the `��%` means that LibreOffice put a few unicode characters at the beginning of the file (I don't know what the � is, it just shows up as a question mark on my computer), and that this is causing LaTeX to fail somehow. **If these characters are the problem, how do I remove them?** **If these characters aren't the problem, what else could it be?**