title: Declaring layers causes tikzpicture to disappear

text: I'm using a picture environment to `\put` some tikzpictures at places within the page from within `\setkomavar{firsthead}`. When I declare some pgf layers like so:               \pgfdeclarelayer{background}     \pgfdeclarelayer{foreground}     \pgfsetlayers{background, main, foreground}      the pictures disappear. The reason for the layers is to create a fancy table environment to display some data. When I remove the layers, the pictures reappear. Does anyone know anything obvious to make the tikzpictures reappear? If not I'll make a minimal working example to explain what I mean. I've tried to do `\begin{pgfonlayer}{main}...\end{pgfonlayer}` but that doesn't change anything. Edit: minimal working example               \documentclass{scrlttr2}     \usepackage{booktabs}     \usepackage{graphicx}     \usepackage{tikz}     \usepackage{tabularx}     \usepackage{color}          \usetikzlibrary{calc, fit, shadows, arrows, positioning}     % if these lines are commented out, the box draws.     \pgfdeclarelayer{background}     \pgfdeclarelayer{foreground}     \pgfsetlayers{background, main, foreground}     % end comment out these lines          \newsavebox{\monotablecontent}     \newenvironment{monotable}[1]{%       \begin{lrbox}{\monotablecontent}%       \begin{tabular}{#1}}%       %       {%       \end{tabular}       \end{lrbox}       \begin{tikzpicture}         \node [inner xsep=0pt] (tbl){\usebox{\monotablecontent}};         % table         \draw[rounded corners=1pt,top color=gray!1,bottom color=gray!30,draw=black]         (tbl.north east) rectangle (tbl.south west);         % top line         \draw[rounded corners=1pt,top color=gray!10!black,bottom color=gray!50!black,draw=black]         ($(tbl.north west)$) rectangle ($(tbl.north east)-(0, 1.5\baselineskip)$);         % bottom rule         \draw[rounded corners=0.25pt,fill=gray,draw=black]         (tbl.south west) rectangle ($(tbl.south east)+(0, 0.05)$);       \end{tikzpicture}     }          \definecolor{myblue}{rgb}{0, 0.58, 0.85}          \newcommand*\invhead[1]{\sffamily{\color{myblue}\footnotesize{\textbf{#1}}}}     \newcommand*\head[1]{\tiny \invhead{#1}}          % set details     \setkomavar{fromname}{ACME Widgets}     \setkomavar{fromaddress}{1 Infinite Loop\\Sometown, 90210\\Uganda}     \setkomavar{fromphone}{+61 9876 5432}     \setkomavar{fromemail}{accounts@acme.com}     \setkomavar{fromfax}{+61 9876 5431}     \setkomavar{fromurl}{http://acme.com/}     \setkomavar{signature}{ACME Widgets}     \setkomavar{fromlogo}{}     \setkomavar{invoice}[Invoice number]{1234 567}     \setkomavar{date}{}     \setkomavar{customer}[Account number]{123456}          % set up a style for our boxes that we will eventually draw.     \tikzstyle{shadedbox} = [       draw=black,       shade,       top color=white,       bottom color=bottom,       drop shadow={         top color=black,         bottom color=black,         shadow xshift=2pt,         shadow yshift=-2pt,       },       thin,       rectangle,       inner sep=2pt,       inner ysep=2pt,       outer ysep=1ex,     ]          \newcommand*\monobox[2]{%       \begin{tikzpicture}         \definecolor{top}{RGB}{250,250,250}         \definecolor{bottom}{RGB}{235,235,235}         \begin{pfgonlayer}{main}         \node [shadedbox, minimum width=0.18\textwidth, text width=0.18\textwidth, align=right] (box) {           \begin{tabular}{r}             \invhead{\scriptsize #1}\\             \footnotesize{#2}\\           \end{tabular}         };         \end{pgfonlayer}       \end{tikzpicture}     }          % set the logo, draw some boxes...     \setkomavar{firsthead}{       \usekomavar{fromlogo}\\       \begin{picture}(0,0)         \put(0,0){           \parbox[t]{\textwidth}{             \vspace{\useplength{toaddrvpos}}             \vspace{3\baselineskip}             \hspace{-2pt}             \monobox{Last Bill}{\$29.95}           }         }       \end{picture}     }          \begin{document}          \begin{letter}[backaddress=false]{%         Mr Joe Customer\\%         17 Unicorn Avenue\\         Narwhtropilis\\%         Uganda\\%     }          \setkomavar{subject}{Invoice}     \opening{Dear Joe Customer,}     Here is your invoice.     \closing{Regards}     \end{letter}     \end{document}      The errors I seem to get are:               ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! A <box> was supposed to be here.     <to be read again>                         =     l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerboxsaved@ foreground      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ main      l.114 \opening{Dear Joe Customer,}          ?      ! Missing number, treated as zero.     <to be read again>                         \pgf@layerbox@ foreground      l.114 \opening{Dear Joe Customer,}          ?      Foot of first page     Address (addressee)     Location field: empty     Reference line(s): with fields but without date     Title: no     Subject: before opening     [1] (./test.aux)                )     Output written on test.pdf (1 page).


title: How do I get \pgfmathparse to create value rounded to one decimal place?

text: I'm trying to place a grid over an image to help me place other object where I want on the image. But, I'm having difficulty getting `tikz` to show coordinates as I wish. Here's my MWE:               \documentclass{article}     \usepackage[margin=1in]{geometry}     \usepackage{tikz}     \usepackage{graphicx}          \begin{document}          \noindent      \begin{tikzpicture}       \node[anchor=south west,inner sep=0pt] (image) at (0,0) {\includegraphics[width=4.5in]{example-image-a}};       \begin{scope}[x={(image.center |- {(0,0)})},y={(image.center -| {(0,0)})}]           \draw[help lines,xstep=0.1,ystep=0.1,yellow!20] (0,0) grid (2,2);           \pgfkeys{/pgf/number format/precision=1}           \foreach \x in {0,1,...,20}              {                \pgfmathparse{\x/10};               \edef\mylabel{\pgfmathresult}               \node [anchor=north] at (\x/10,0) {\rotatebox{-90}{\mylabel}};              }       \end{scope}       \draw[line width=4pt,red] (image.south west) rectangle (image.north east);     \end{tikzpicture}          \end{document}      ![enter image description here](http://i.stack.imgur.com/7udwb.png) What I would like is to have the x-values of `0.0, 0.1, 0.2, 0.3,...` along the bottom border of the image. I have tried the following too:               \documentclass{article}     \usepackage[margin=1in]{geometry}     \usepackage{tikz}     \usepackage{graphicx}          \begin{document}          \noindent      \begin{tikzpicture}       \node[anchor=south west,inner sep=0pt] (image) at (0,0) {\includegraphics[width=4.5in]{example-image-a}};       \begin{scope}[x={(image.center |- {(0,0)})},y={(image.center -| {(0,0)})}]           \draw[help lines,xstep=0.1,ystep=0.1,yellow!20] (0,0) grid (2,2);           \pgfkeys{/pgf/number format/precision=1}           \foreach \x in {0,0.1,...,2}              {                \node [anchor=north] at (\x,0) {\rotatebox{-90}{\x}};              }       \end{scope}       \draw[line width=4pt,red] (image.south west) rectangle (image.north east);     \end{tikzpicture}          \end{document}      which results in ![enter image description here](http://i.stack.imgur.com/Wk6UB.png) This time the x-values are not only off but also they're not counting through and showing `2.0`. Additionally I've tried               \node [anchor=north] at (\x,0) {\rotatebox{-90}{\pgfmathprintnumberto[precision=1]{\x}{\myresult}\myresult}};       If I could round to a certain decimal place or truncate in either scenario, I'd be happy. `precision` isn't doing what I expected though. Any suggestions?


title: Problem with landscape table layout following a normal table in a document

text: I have landscape tables which span multiple pages and are laid out as three part tables with a notes section at the bottom. The landscape tables in the document are fine at the beginning of the document. But in the landscape tables which come in the text following a normal table, the notes section is narrower (matching the width of the notes section for the preceding non- landscape table. Here is a working example:               \listfiles     \documentclass[12pt,a4paper,bibtotoc,liststotocnumbered,pointlessnumbers]{scrreprt}                       %---------------------------------------%     %       Layout          %     %---------------------------------------%     \usepackage[parfill]{parskip}           %use line breaks instead of     \usepackage[left=3.75cm, right=3.75cm, bottom=3.5cm]{geometry}          \usepackage{pdflscape}          %landscape single pages          %Sets up landscape pages for each landscape page.     \usepackage{pdfpages}           % http://ctan.org/pkg/pdfpages           \usepackage[absolute]{textpos}     \usepackage{fancyhdr}          \fancypagestyle{lscape}{%      \fancyhf{} % clear all header and footer fields      \fancyfoot[LE]{%     \begin{textblock}{20}(1,5){\rotatebox{90}{\leftmark}}\end{textblock}}     \fancyfoot[LO] {%     \begin{textblock}{1}(14,7.5){\rotatebox{90}{\thepage}}\end{textblock}}     \renewcommand{\headrulewidth}{0pt}      \renewcommand{\footrulewidth}{0pt}}          %---------------------------------------%     %   Tables & Figures        %     %---------------------------------------%     \usepackage{booktabs}     \usepackage{multirow}               % Allows rows in tables to be combined.     \usepackage{threeparttable}         % Allows for three part tables with a specified notes section.     \usepackage{threeparttablex}            % Lets threeparttable work with longtable     \usepackage{longtable}              % Allows tables to break across pages     \newcommand{\head}[1]{\textsf{\textbf{#1}}}          \usepackage{array}     \usepackage{ragged2e}     \newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}     \newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}     \newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}          \usepackage{floatrow}     \floatsetup[table]{capposition = top, font = sf}    %Sets table to sans serif font and puts caption on top     \floatsetup[figure]{capposition = top, font = sf}   %Sets table to sans serif font and puts caption on top          \usepackage{caption}     \captionsetup{font={sf,large},justification=justified, singlelinecheck=false}     \setkomafont{caption}{\sffamily}     \setkomafont{captionlabel}{\upshape\bfseries\sffamily}          \renewcommand{\topfraction}{0.9}% max fraction of floats at top     \renewcommand{\textfraction}{0.07}     \renewcommand{\bottomfraction}{0.9}% max fraction of floats at bottom          %Set table for to be smaller     \usepackage{etoolbox}     \AtBeginEnvironment{tabular}{\small}     \AtBeginEnvironment{longtable}{\small}          % Package for including code in the document     \usepackage{listings}                    \usepackage[english]{babel}     \usepackage{blindtext}\def\mytitle{Energy security under climate policies}     \def\myauthor{Jessica Jewell}     \begin{document}          \blindtext          \newgeometry{hmargin=3.5cm,vmargin=3.5cm}     \thispagestyle{lscape}     \pagestyle{lscape}          \begin{landscape}          \begin{ThreePartTable}     \begin{longtable}{C{4.4cm}C{1.2cm}C{1.4cm}C{1.7cm}C{3.6cm}P{8.0cm}}     \caption{\large{Previous studies}} \label{table1} \\               \toprule     \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\     \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &\head{\centering{XXX}} \\      \midrule      \endfirsthead           \toprule      \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\      \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} & \head{\centering{XXX}} \\      \midrule      \endhead           \multicolumn{6}{r}{{\emph{continues on next page}}} \\      \endfoot           \bottomrule      \endlastfoot            XXX & 2010 & XXXXl && This is an example of a working table \\       XXX & 2010 & XXXXl && This is an example of a working table \\       XXX & 2010 & XXXXl && This is an example of a working table \\       XXX & 2010 & XXXXl && This is an example of a working table \\       XXX & 2010 & XXXXl && This is an example of a working table \\       XXX & 2010 & XXXXl && This is an example of a working table \\       XXX & 2010 & XXXXl && This is an example of a working table \\            \end{longtable}       \begin{tablenotes}       \item Notes: These are some long notes to show that on the first table the text runs all the way across the bottom of the page. See? Isn't it lovely how it just lays down at the bottom of the page.            \end{tablenotes}       \end{ThreePartTable}       \end{landscape}       \restoregeometry       \pagestyle{plain}                 \blindtext                 \begin{table*}        \begin{threeparttable}      \caption{GDP and emissions of major economies} \label{meconomies}      \begin{tabular}{lcccccc}      \toprule      && \multicolumn{2}{c}{\head{XXXXXXX}} && \multicolumn{2}{c}{\head{XXXXXXXX}} \\      && XX & XX && XX & XX \\      \midrule      \head{XXXXX} && XX & XX && XX) & XX \\      \head{XXXXX} && XX & XX && XX) & XX \\      \head{XXXXX} && XX & XX && XX) & XX \\      \bottomrule      \end{tabular}      \begin{tablenotes}      \item Notes: This is meaningless not explaining the meaningless table.      \end{tablenotes}      \end{threeparttable}          \end{table*}                     \newgeometry{hmargin=3.5cm,vmargin=3.5cm}      \thispagestyle{lscape}      \pagestyle{lscape}           \begin{landscape}           \begin{ThreePartTable}      \begin{longtable}{C{4.4cm}C{1.2cm}C{1.4cm}C{1.7cm}C{3.6cm}P{8.0cm}}      \caption{\large{Previous studies}} \label{table2} \\                \toprule      \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\      \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &\head{\centering{XXX}} \\      \midrule      \endfirsthead           \toprule      \ & & \multicolumn{3}{l}{\hspace{1.0cm}\head{Energy security focus}} & \\      \head{XXX} & \head{XXX} & \head{XXX} & \head{XXX} & \head{\centering{XXXX}} &   \head{\centering{XXX}} \\      \midrule      \endhead           \multicolumn{6}{r}{{\emph{continues on next page}}} \\      \endfoot           \bottomrule      \endlastfoot           XXX & 2010 & XXXXl && This is an example of a working table \\      XXX & 2010 & XXXXl && This is an example of a working table \\      XXX & 2010 & XXXXl && This is an example of a working table \\      XXX & 2010 & XXXXl && This is an example of a working table \\      XXX & 2010 & XXXXl && This is an example of a working table \\      XXX & 2010 & XXXXl && This is an example of a working table \\      XXX & 2010 & XXXXl && This is an example of a working table \\      XXX & 2010 & XXXXl && This is an example of a working table \\           \end{longtable}      \begin{tablenotes}      \item Notes: These are some long notes. See how the margin of these notes is wrong? They match the text width of the preceding threeparttable.           \end{tablenotes}      \end{ThreePartTable}      \end{landscape}      \restoregeometry      \pagestyle{plain}          \blindtext          \end{document}


title: How to get, both fork down and right in a TikZ tree or diagram

text: I need your help with a diagram, where I want to place both fork down and right to organize my concept map.   If someone have a better solution, please give me some advice.   Here´s the code:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{trees}          \begin{document}     \begin{center}     \begin{tikzpicture}[     edge from parent fork down,     edge from parent/.style={black,thick,draw},     every node/.style={rectangle,draw,rounded corners},     every child node/.style={anchor=north},     par node/.style={         text width=#1,         align=left,     },     par node/.default=40mm,     parent anchor=south,     growth parent anchor=south,     ]          \node[par node] (p) at (0,0) {         \begin{center}\textbf{TITLE}\\\end{center}         Long text long text long text long text long text long text     }[sibling distance=50mm]     child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}         [sibling distance=27mm]         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}     }     child {node [par node] {\textbf{Title}\\ Long text long text long text long text long text long text}[sibling distance=27mm]         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}}         }     child {node [par node]{\textbf{Title}\\ Long text long text long text long text long text long text}         [sibling distance=27mm]         child {node[par node]{\textbf{Title}\\ Long text long text long text long text long text long text}         }     };     \end{tikzpicture}     \end{center}     \end{document}      I want something like this: ![image](http://i.stack.imgur.com/WUoa5.png)


title: europecv photo position

text: Hi guys I found on the web a beautiful template to write my CV in Latex using `europecv` package. Unfortunately my personal photo using the string               \ecvpicture[width=12cm]{myphoto}      seems to appear in the center of the document while I need to put it on top right as reported for example here: http://www.tixus.de/blog/archives/2010/12/entry_1235.html Can anyone help me please? Best regards


title: How to change the shaded color of the \rule{...}{...} command?

text: To change the shaded color of the `\rule{...}{...}` command, one solution is               \textcolor{blue}{\rule{2cm}{2cm}}      but I want to know how can I directly change the color of this command globally?


title: passing random variable to fp function

text: I am trying to create a command that will display a "+" sign for positive numbers and no sign for numbers within the esami package. I believe that the issue is the format of the random variable that I am trying to pass into the \rtink function. The function works if I use an integer, but I have been unable to figure out how to pass the variable through. Any help would be greatly appreciated. Here is the problem that has been designed in the eachtest.tex file:               \newproblem{prob12     \FPsetpar{a}{1}{9}[-1,1]     \FPsetpar{b}{1}{9}[-1,1]          \newcommand{\rtink}[1]{%     \FPifneg #1 \par $$ \else $+$ \fi     }          \item  If      \begin{equation*}  \a (x \rtink{\a} \b)=\a x+m \end{equation*} what is the value of $m$?          \vspace{10 mm}       \begin{answers}{2}\bChoices         \Ans1 \FPsv{\a*\b} \eAns         \Ans0 \FPsv{-\a*\b} \eAns   \eFreeze         \Ans0 \FPsv{\a} \eAns  \eFreeze         \Ans0 \FPsv{\b} \eAns         \eChoices\end{answers}     }      Here is the master_new.tex file that is pulling from the eachtest.tex file:               \documentclass[a4paper,UKenglish]{article}     \usepackage[shufflerandom,xyz,twocolumns,solutions]{esami}     \usepackage{lmodern,textcomp}     \usepackage[utf8]{inputenc}     \usepackage[T1]{fontenc}          % +=============================+     % |         DEFINITIONS         |     % +=============================+          \def\examname{The name of the exam}     \def\numcompiti{1}%%% The number of the versions     \date{2013/3/22}%%% THE DATE IN THE FORMAT YYYY/MM/DD     \def\Data{\longdate}%%% or \shortdate: the date in the heading          \begin{document}     \testversioni     \pagestyle{esame}     \whiledo{\thevers<\numcompiti}{\stepvers          % +=============================+     % |       THE SEED              |     % +=============================+          \FPeval\seme{round((\thenomefile+(3*\thevers)):0)}          \randomi=\seme     \permuta          \section*{Mathematics Achievement}     \begin{test}     \begin{questions}     \esercizi{eachtest}     \end{questions}     \end{test}          \closevers     }     \end{document}


title: shrink top and bottom margin of elsarticle template

text: I am using the latex template `elsarticle` from Elsevier, but I find that the top and bottom margin of this tempalte is too large, I would like to shrink the top and bottom margin. How can I do this? PS: the `geometry` package does not work here. The following is a smallest working set.                   %% Use the option review to obtain double line spacing     %% \documentclass[preprint,review,12pt]{elsarticle}          %% Use the options 1p,twocolumn; 3p; 3p,twocolumn; 5p; or 5p,twocolumn     %% for a journal layout:      \documentclass[final,1p,times]{elsarticle}     %% \documentclass[final,1p,times,twocolumn]{elsarticle}     %% \documentclass[final,3p,times]{elsarticle}     %% \documentclass[final,3p,times,twocolumn]{elsarticle}     %% \documentclass[final,5p,times]{elsarticle}     %% \documentclass[final,5p,times,twocolumn]{elsarticle}               \journal{}          \begin{document}          \begin{frontmatter}          \title{aaaaaaaaa}          %% use optional labels to link authors explicitly to addresses:     %% \author[label1,label2]{<author name>}     %% \address[label1]{<address>}     %% \address[label2]{<address>}          \author{     abc     }          \address{}          \begin{abstract}          A deal still has not been struck to avert tax hikes and budget      cuts after Friday's meeting between the president and congressional leaders.          WASHINGTON — U.S. Senate leaders are working to craft legislation      by Sunday to avert the year-end "fiscal cliff" of tax hikes and      spending cuts, but many details needed to be worked out after      a crucial meeting with President Barack Obama on Friday.          President Obama spoke about the meeting at a press conference late afternoon.          The president said he had a “constructive meeting today” and      he's still "modestly optimistic" that an agreement can be reached.      But if an agreement isn't struck by the Dec. 31 deadline,      then he will seek an up-or-down vote on a basic package that      would include preserve tax cuts for middle-class Americans,      while extending unemployment benefits for the long-term jobless      and working toward a foundation for a broader deal.          President Obama says the fact that elected leadership can't make      deadlines is mind-boggling to the average American. “We're now at the last minute”, he said.          Video: Without tax deal, vote on my plan, said Pres. Obama          The president will discuss the last-minute negotiations on      NBC's "Meet the Press" on Sunday, the network said in a statement.                    \end{abstract}          \begin{keyword}     %% keywords here, in the form: keyword \sep keyword          %% MSC codes here, in the form: \MSC code \sep code     %% or \MSC[2008] code \sep code (2000 is the default)                    \end{keyword}           \end{frontmatter}                    \bibliographystyle{elsarticle-num}     \bibliography{}                    \end{document}


title: Simple way to multiply two values

text: I have a macro to define the scale of my figures:               \newcommand{\myscale}{0.35}      Now I have a figure that needs to be scaled twice as big, so I tried to use something like this:               \begin{figure}[hbt]       \includegraphics[scale=2\myscale]{my-image}       \caption{My Caption}       \label{fig:my-label}     \end{figure}      This results a very big image, as `2\scale` expands to `20.35`... I tried/found:   * Using `scale=2*\myscale`, but still get errors   * Some more things using `calc`, again did not work   * `\real{}`, but it does not seem to work also   * intcalc, but this only seems to work for integers, which is not always the case for `\myscale`.   * pgf package, but it seems a complex for a simple multiplication   * fp package works, but still somewhat complex The easiest way (that works for me), is this fp-based implementation:               \begin{figure}[hbt]       \FPeval\calculatedScale{2*\myscale}       \includegraphics[scale=\calculatedScale]{my-image}       \caption{My Caption}       \label{fig:my-label}     \end{figure}      Am I missing something? Is there a more simple/elegant solution? Preferably directly usable with the `\includegraphics` command without creating the additional `\calculatedScale`.


title: How to make a figure span on two columns in a scientific paper?

text: If I just try to set the figure's size to `0.9\textwidth` my figure will just end up on the right column, sized to be two-columns wide. Has anyone done this before?


title: Displaying a wide figure in a two-column document

text: > **Possible Duplicate:**   >  How to make a figure span on two columns in a scientific paper? It's my first time working with a two-column document (declared as an argument to `\documentclass`) and I need to put in a very wide figure. The thing is, LaTeX puts it bounded by a column so it either (1) gets truncated, bleeding off the border or [right column] or (2) displays with an awkward text/line wrapping. Is there any way for me to get it to display the way `\maketitle` does, that is, at the top of the page (ideally) but at least spanning both columns and no awkward line wrapping? BTW, I use the following code to display my figure:               \begin{figure}         \centering         \includegraphics[width=6in]{tictac.png}         \caption{\textsf{The structure of our tic-tac-toe implementation.}}         \label{fig:ds}     \end{figure}


title: How to put an image accross double column?

text: > **Possible Duplicate:**   >  How to make a figure span on two columns in a scientific paper? Below is a page using IEEE trans, how to put the image (see Figure 1) accross two columns? ![enter image description here](http://i.stack.imgur.com/ti2mm.png)


title: Dealing with columns while placing a figure at the top of next page

text: I am using `ACM template` and having problem while placing the figure at the top of next page. I read threads here, but still instead of placing the figure at the top of whole page it only places it at the top of next column. > I am using following commands: Place a figure at the top of the next page I want it to be like this: ![enter image description here](http://i.stack.imgur.com/F0EH4.png) * * * But it happens to be like this: ![enter image description here](http://i.stack.imgur.com/QmQib.png)


\documentclass[preview,border=12pt]{standalone}     \usepackage{pst-plot}     \psset{polarplot}     \def\RPN#1{2 #1 10 div exp}     \def\Infix#1{2^(#1/10)}          \begin{document}     \begin{pspicture}[showgrid=true](-3,-3)(3,3)         \psplot{2 Pi mul neg RadtoDeg}{2 Pi mul RadtoDeg}{\RPN{x DegtoRad}}         \qdisk(!\RPN{Pi 3 mul 2 div} Pi 3 mul 2 div RadtoDeg PtoC){3pt}     \end{pspicture}\qquad     \begin{pspicture}[showgrid=true](-3,-3)(10,3)         \psplot[algebraic]{2 Pi mul neg}{2 Pi mul}{\Infix{x}}         %\qdisk(<your expression using \Infix goes here>){3pt}      \end{pspicture}     \end{document}      How to draw a point if the angle value and radial function are both given in algebraic (infix) form? Notes: Both angle and radius must accommodate infix expression such as `3*Pi/2` for the angle and `2^(3*Pi/2/10)` for the radius.


title: Aligning two captions in tables

text: I would like to have two captions for some tables and figures, where the first caption describes the general content and the second caption provides some additional information. The idea is to have the second caption left-aligned with the caption text of the first caption rather than with the caption label, that is, left-aligned with the description of the contents of the table (figure) rather than with the word Table (Figure). I thought the option [format=hang,indention=0cm] from the caption package would achieve that but the second caption appears centered. I would have thought that the second caption would be treated as a second paragraph in the caption but clearly I'm wrong (see Table 1). I found a similar query in this site (see here), hence I modified a bit the code in the suggested answer. For short captions it works well (see Table 2), but for long captions, the second caption is not aligned with the first (see Table 3). I realise that my code probably is far from efficient and hence it is introducing some bugs, so any help will be greatly appreciated. ![enter image description here](http://i.stack.imgur.com/BixQA.png)               \documentclass{article}     \usepackage[format=hang,indention=0cm]{caption}          % some auxiliary lengths for aligning the captions     \newlength\mylena     \newlength\mylenb     \newlength\mylenc          % new command: \MyCaption{First numbered caption}{Second unnumbered caption}     \newcommand\MyCaption[2]{%         \captionsetup{belowskip=-\baselineskip}         \settowidth\mylena{\tablename~\thetable:~ #1}         \settowidth\mylenb{\small{#2}}         \settowidth\mylenc{\tablename~\thetable:~}         \caption{#1}         \caption*{\hspace*{\dimexpr%             \mylenb - \mylena + \mylenc + \mylenc \relax}              \small{#2}}         \setlength\belowcaptionskip{\baselineskip}     }          \begin{document}          \begin{table}[ht]         \caption[LoT entry]{The first caption               (The second caption)}          \centerline{             \begin{tabular}{lrr}             \hline              & C1  & C2 \\             \hline             R1 & & \\             R2 & & \\             \hline             \end{tabular}             }     \end{table}          \begin{table}[ht]         \MyCaption{The first caption}{(The second caption)}          \centerline{             \begin{tabular}{lrr}             \hline              & C1  & C2 \\             \hline             R1 & & \\             R2 & & \\             \hline             \end{tabular}             }     \end{table}          \begin{table}[ht]         \MyCaption{A long first caption A long first caption A long first caption A long first caption A long first caption }{(A long second caption A long second caption A long second caption A long second caption A long second caption )}          \centerline{             \begin{tabular}{lrr}             \hline              & C1  & C2 \\             \hline             R1 & & \\             R2 & & \\             \hline             \end{tabular}             }     \end{table}          \end{document}


title: How to use a macro inside tick definition in pgfplots

text: Consider the following code:               \documentclass[border=2pt]{standalone}          \usepackage{pgfplots}          \newcommand\myxtick[1]{\foreach \x in {2,3,4}{\x,}#1}     \newcommand\otherxtick{2,3,4,5}          \begin{document}       \begin{tikzpicture}         \begin{axis}[             %xtick={\myxtick[5]},             xtick={\otherxtick},             xmax=10,xmin=0,ymax=10,domain=0:10]         \addplot {x};         \end{axis}     \end{tikzpicture}     \end{document}      If I specify the `xtick` with `\otherxtick` the code works but if I use `\myxtick[5]` it gives me errors and it does not compile. I tried also with `xtick./expanded={\myxtick[5]}`, `xtick./expand once={\myxtick[5]}` and `xtick./expand twice={\myxtick[5]}` but with the same result. I took a look also at these question but with no result:   * pgfplots: using macro for tick label   * Use macro to draw inside pgfplot/axis I ask this question because the notation `{1,2,...,20}` for the definition of ticks can not always be used. Consider for example a `dateplot` in which you want ticks every 3 years from 1900 to 1960. If I write `{1900-01-01,1903-01-01,...,1960-01-01}` it does not works and write all 21 ticks is very boring...


title: Problem with algorithm in pgfmath

text: I coded an algorithm from R with `pgfmath`:               \documentclass{article}     \usepackage{tikz}     \usetikzlibrary{fpu}     \makeatletter     \pgfmathdeclarefunction{qnorm}{4}{%       \begingroup         \pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}         % #1 = p         % #2 = sigma         % #3 = mu         % #4 = lower_tail (0 = true, 1 = false) % I'm not sure why it does this         \pgfmathparse{#2 < 0 ? 1 : 0}       % if(sigma  < 0)    ML_ERR_return_NAN;         \edef\sigma@negative{\pgfmathresult}    %         %         \pgfmathparse{#2 == 0 ? 1 : 0}      % if(sigma == 0)    return mu;         \edef\sigma@zerocheck{\pgfmathresult}   %         %         \pgfmathparse{#4? exp(#1) : 1-exp(#1)}  % #define R_DT_qIv(p) lower_tail ? exp(p) : - expm1(p);         \edef\p@under{\pgfmathresult}       % p_ = R_DT_qIv(p);         %         \pgfmathparse{\p@under - .5}        % q = p_ - 0.5;         \edef\q{\pgfmathresult}         %          %         \pgfmathparse{#4? -(1-exp(#1)) : exp(#1) }% #define R_DT_CIv(p) lower_tail ? -expm1(p) : exp(p);         \edef\@tmp{\pgfmathresult}          % r = R_DT_CIv(p);         %         \pgfmathparse{abs(\q) <= .425 ? 1 : 0}  % if (fabs(q) <= .425) /* 0.075 <= p <= 0.925 */         \edef\q@interval{\pgfmathresult}        %          %         \pgfmathparse{             \q@interval ?               % if (fabs(q) <= .425)                     .180625 - \q * \q       % r = .180625 - q * q;                     :                     ( \q > 0 ?              % if (q > 0)                         sqrt(-ln(\@tmp))    % r = R_DT_CIv(p) & r = sqrt(-log(r))                     :           % else                     sqrt(-ln(\p@under)) % r = p_; & r = sqrt(-log(r))                 )             }         \edef\r{\pgfmathresult}        %          \pgfmathparse{\r <= 5 ? \r - 1.6 : \r - 5}  % if (r <= 5.) (r += -1.6) else (r += -5)         \edef\@@tmp{\pgfmathresult}         \pgfmathparse{\@@tmp}           % add to r         \edef\r{\pgfmathresult}         \pgfmathparse{\q@interval ?          (#1 * (((((((\r * 2509.0809287301226727 +       % q is in the interval                            33430.575583588128105) * \r + 67265.770927008700853) * \r +                          45921.953931549871457) * \r + 13731.693765509461125) * \r +                        1971.5909503065514427) * \r + 133.14166789178437745) * \r +                      3.387132872796366608)                 / (((((((\r * 5226.495278852854561 +                          28729.085735721942674) * \r + 39307.89580009271061) * \r +                        21213.794301586595867) * \r + 5394.1960214247511077) * \r +                      687.1870074920579083) * \r + 42.313330701600911252) * \r + 1))                                         : ( \q > 0 ?        % q is positive but not within the interval                                             ((((((((\r * 7.7454501427834140764e-4 +                             .0227238449892691845833) * \r + .24178072517745061177) *                          \r + 1.27045825245236838258) * \r +                         3.64784832476320460504) * \r + 5.7694972214606914055) *                       \r + 4.6303378461565452959) * \r +                      1.42343711074968357734)                     / (((((((\r *                              1.05075007164441684324e-9 + 5.475938084995344946e-4) *                             \r + .0151986665636164571966) * \r +                            .14810397642748007459) * \r + .68976733498510000455) *                          \r + 1.6763848301838038494) * \r +                         2.05319162663775882187) * \r + 1))                                             :           % q is not within the interval, nor is it positive                                             ((((((((\r * 2.01033439929228813265e-7 +                            2.71155556874348757815e-5) * \r +                           .0012426609473880784386) * \r + .026532189526576123093) *                         \r + .29656057182850489123) * \r +                        1.7848265399172913358) * \r + 5.4637849111641143699) *                      \r + 6.6579046435011037772)                     / (((((((\r *                              2.04426310338993978564e-15 + 1.4215117583164458887e-7)*                             \r + 1.8463183175100546818e-5) * \r +                            7.868691311456132591e-4) * \r + .0148753612908506148525)                          * \r + .13692988092273580531) * \r +                         .59983220655588793769) * \r + 1.))                         )                      }         \edef\val{\pgfmathresult}         \pgfmathparse{\val}         \edef\@@@tmp{\pgfmathresult}         \pgfmathparse{(\sigma@negative ? sqrt(-1) : % if(sigma  < 0)    ML_ERR_return_NAN;              (\sigma@zerocheck ? #3 :           % if(sigma == 0)    return mu;                 ( !(\q > 0) ?                   % if(q < 0.0)                      #3+#2*-\@@@tmp :        % val = -val                     #3+#2*\@@@tmp           % return mu + sigma * val                 )             )             }         \pgfmath@smuggleone\pgfmathresult       \endgroup     }     \makeatother          \begin{document}     \pgfmathparse{qnorm(.05,2,2,1)}\pgfmathresult   % setting the first argument to .7 yields nan - I can't figure out why     \end{document}      Source 1: https://github.com/wch/r-source/blob/trunk/src/nmath/qnorm.c#L101 Source 2: https://github.com/wch/r-source/blob/843b6d3eb5c53ef585d3b0fe1bcb905e5c684de8/src/nmath/dpq.h Small values for the first argument (quantile `p`) approximate the `R` output nicely. But when I set this to .7, it returns value `nan`. I can't figure out why. The 70% quantile can be calculated as normally in `R`, but this expression tells me this value doesn't exist. Can anyone spot my mistake ? I've sat on this for days. `:-(` **EDIT** I forgot to mention that I exluded the option to use `log(p)` values, so some expressions, notably `R_DT_qIv(p)` and `R_DT_CIv(p)` are simplified.


When I try to compile a latex file, I get the following error:               LaTeX Error: Environment table undefined.      I think the line that is causing the problem is: `\begin{table}` Does anybody know how I can fix this?


title: Wrong numeration in LyX Subsubsection

text: I'm typing my lecture notes in one big `.lyx` file, and I use numeration to keep stuff organised in the TOC:   * Numbered Sections for Lectures\Recitations\Tutorials   * Numbered Subsections for Lecture\Recitation\Tutorial parts (e.g. For search algorithms, to distinguish between BFS and DFS)   * Numbered Subsubsections for Lemmas, Theorems, Examples and the etc. Since I wasn't doing that from the beginning, I've just finished converting what I've already typed, and all the numbers are correct. But, when I begin typing a new Section, when I don't have a Subsection in it, the numeration continues from the last Subsubsection instead of starting over. In other words, this is what happens: End of Lecture 2: > 3.3.5 Conclusion Begining of Lecture 3: > 4 Lecture number 03 - 07.11.2011 > > 4.0.6 Lemma: Screenshot: ![screenshot illustrating the problem](http://i.stack.imgur.com/2riym.png) How can it be solved, to output: > 4.0.1 Lemma: without adding Subsection between the Section and the Subsubsection? I've tried to do that, and it results: > 4 Lecture number 03 - 07.11.2011 > > 4.1 Dummytext > > 4.1.1 Lemma: But it don't need the Subsection there...


title: Adding general introduction to table of contents as chapter causes a problem

text: I'm trying to add a general introduction to my report. Well I added it to the table of contents and without number. Using this code :               \addcontentsline{toc}{chapter}{\protect\numberline{}Introduction générale}     \chapter*{Introduction générale}     \label{sec:IntroductionGénérale}      But the problem is : I already added a mini table of contents in the begining of chapters. So when I add the asterisk ,to hide the header the mini Table of contents desapears. And when I delete it , I get a header in the general introduction. This is the code I'm using :                   \documentclass[12pt,french]{report}     \usepackage[T1]{fontenc}     \usepackage{times}     \usepackage[utf8]{inputenc}     \usepackage[a4paper]{geometry}     \usepackage{minitoc}     \geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=3cm,rmargin=3cm}     \setcounter{secnumdepth}{3}     \setcounter{tocdepth}{3}     \setlength{\parskip}{\smallskipamount}     \setlength{\parindent}{0pt}     \usepackage{float}     \usepackage{graphicx}     \usepackage{setspace}     \usepackage{nomencl}     \usepackage{enumitem}%pou les puces     % the following is useful when we have the old nomencl.sty package     \providecommand{\printnomenclature}{\printglossary}     \providecommand{\makenomenclature}{\makeglossary}     \makenomenclature     \onehalfspacing          \makeatletter     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.     %/usepackage{t1enc}% un second package     \usepackage[francais]{babel}     % un troisième package     \usepackage{layout}     \usepackage[Lenny]{fncychap}     \usepackage{fancyhdr}     \usepackage[section]{placeins}     \usepackage{lettrine}           \floatstyle{boxed}     \title{Rapport de Projet De Fin D'Études}     \author{Amina GHABRI}     \usepackage{palatino}%police     \renewcommand{\baselinestretch}{1.5}          \AtBeginDocument{       \def\labelitemi{\normalfont\bfseries{--}}     }                    \usepackage{babel}               \addto\extrasfrench{%        \providecommand{\og}{\leavevmode\flqq~}%        \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%     }          \pagestyle{fancy}     \fancyhf{}     \fancyhead[LE,RO]{\leftmark}     \fancyhead[RE,LO]{\ }     \fancyfoot[CE,CO]{\thepage}     \fancyfoot[RE,LO]{\ }          \renewcommand{\headrulewidth}{1pt}     \renewcommand{\footrulewidth}{1pt}                         %\usepackage{babel}          \addto\extrasfrench{%        \providecommand{\og}{\leavevmode\flqq~}%        \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%     }                         \makeatother          %\usepackage{babel}     \makeatletter     \addto\extrasfrench{%        \providecommand{\og}{\leavevmode\flqq~}%        \providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}%     }     \rmfamily     \makeatother          \makeatletter     \renewcommand\paragraph{%        \@startsection{paragraph}{4}{0mm}%           {-\baselineskip}%           {.5\baselineskip}%           {\normalfont\normalsize\bfseries}}     \makeatother          \makeatletter     \renewcommand\subparagraph{%        \@startsection{subparagraph}{4}{0mm}%           {-\baselineskip}%           {.5\baselineskip}%           {\normalfont\normalsize\bfseries}}     \makeatother          \begin{document}     \maketitle      \dominitoc\tableofcontents{}\listoffigures          \listoftables               \addcontentsline{toc}{chapter}{\protect\numberline{}Introduction générale}     \chapter{Introduction générale}     \label{sec:IntroductionGénérale}                         Conçu originellement comme un système d’exploitation réservé pour les terminaux mobiles (Smartphones, Tablettes etc.), Android a bouleversé plusieurs domaines d’utilisation comme les téléviseurs, les autoradios et même les voitures. Il a changé automatiquement le fonctionnement  des entreprises et leurs environnements professionnels.                                             \chapter{Présenation du projet}     \label{sec:PrésenationDuProjet}                                        \minitoc \newpage          \addcontentsline{toc}{section}{\protect\numberline{}Introduction}% Add title to ToC     \section*{Introduction}     \label{sec:Introduction}          \lettrine[lines=2,loversize=0.08]{L}{}e succès retentissant des Smartphones sous Android a entrainé l'émergence quotidienne de nouvelles applications et services qui reposent sur la technologie Wi-Fi.     La première partie du chapitre est consacrée à la présentation du projet et à la spécification des besoins.       And this the result with * : ![enter image description here](http://i.stack.imgur.com/AtCMk.png) And this without * : the mini toc desapears : ![enter image description here](http://i.stack.imgur.com/6pyIK.png)


title: How to use an environment whose name comes from a reference?

text: Suppose somewhere in my long Ph.D. thesis I use a theorem-like environment (maybe it's a theorem, maybe it's a lemma, etc.), and label it. At another place I want to have an environment which is the same as that earlier one (not with the same number though). I can get the environment's name with `cleveref`'s `\namecref` - but I can't just use it:               \documentclass{article}     \usepackage{ntheorem}     \usepackage{cleveref}     \newtheorem{theorem}{Theorem}     \begin{document}     \begin{theorem}     \label{myfirst}     This is the first theorem.     \end{theorem}     \begin{\namecref{myfirst}}     This is another environment of the same kind as \ref{myfirst}!.     \end{\namecref{myfirst}}     \end{document}      trying to `\def` or `\edef` something to the `\namecref` doesn't work either. What can I do? Of course, the environment cannot be known on the first run, so I would obviously need a macro which would expand to some 'dummy environment' on the first run and the real environment on the second (`\namecref` should give **??** on the first run which is not useful.) _Note:_ This questions is a lead-up to the question Need a 'thin', flexible, theorem restatement environment.


title: What's the advantage of using csquotes over using an editor's auto-replacement for "?

text: Many editors (TeXnicCenter, Texmaker, TeXworks, ...) offer auto-replacement of `"` by the desired form of quotation marks, be it ```` and `''` for English, `"`` and `"'` for German, or whatnot. Usually, I know right from the start which quotation marks I want to use throughout a document, and I hardly ever nest quotations. Seeing that `csquotes` has at least one disadvantage (see Csquotes and microtype.) that is more likely to occur than nested quotes, I wonder: What advantages would I get from using the `csquotes` package over these "manual" quotes? Obviously, I could set up auto-replacement of `"` through `\csquotes{ _cursor here_ }`, which would result in similar typing activity.


title: MinionPro: spacing between f followed by quotes

text: Is it just me, or is the spacing between the letter 'f' and the following quotation marks incredibly tight in `MinionPro`? I am already using the `loosequotes` option, but as far as I can tell, that only increases the distance of the quotes from the text inside them. # Problem: ![Problem](http://i.stack.imgur.com/Q26Tv.png) Look at the difference in spacing between Minion Pro, Computer Modern and Palatino, and also look at how much better the spacing looks between the letter 'e' and quotation marks. The spacing looks way too tight for my taste. Assuming that I am not absolutely insane and that other people notice the issue as well, is there an easy way to fix this? * * * I also have sample text for all letters of the (English) alphabet followed by quotation marks, but I think the letter 'f' looks the worst. ![Alphabet output](http://i.stack.imgur.com/LxqYK.png) # MWE:               \documentclass{article}     \usepackage[loosequotes]{MinionPro}          \renewcommand{\ttdefault}{cmr} % Computer Modern | #yolo     \renewcommand{\sfdefault}{ppl} % Palatino        | #yolo          \usepackage{parskip}          \newcommand*{\sometextsingle}{Issue of `Minion Pro' font}     \newcommand*{\sometextdouble}{Issue of ``Minion Pro'' font}          \begin{document}     \begin{tabular}{lll}     Minion Pro               & \sometextsingle          & \sometextdouble\\     \texttt{Computer Modern} & \texttt{\sometextsingle} & \texttt{\sometextdouble}\\     \textsf{Palatino}        & \textsf{\sometextsingle} & \textsf{\sometextdouble}     \end{tabular}          \renewcommand*{\sometextsingle}{Issue of the `Minion Pro' font}     \renewcommand*{\sometextdouble}{Issue of the ``Minion Pro'' font}     \begin{tabular}{lll}     Minion Pro               & \sometextsingle          & \sometextdouble\\     \texttt{Computer Modern} & \texttt{\sometextsingle} & \texttt{\sometextdouble}\\     \textsf{Palatino}        & \textsf{\sometextsingle} & \textsf{\sometextdouble}\\     \end{tabular}          \vspace{0.5cm}          \begin{tabular}{ll}     a `Minion Pro' & A `Minion Pro'\\     b `Minion Pro' & B `Minion Pro'\\     c `Minion Pro' & C `Minion Pro'\\     d `Minion Pro' & D `Minion Pro'\\     e `Minion Pro' & E `Minion Pro'\\     f `Minion Pro' & F `Minion Pro'\\     g `Minion Pro' & G `Minion Pro'\\     h `Minion Pro' & H `Minion Pro'\\     i `Minion Pro' & I `Minion Pro'\\     j `Minion Pro' & J `Minion Pro'\\     k `Minion Pro' & K `Minion Pro'\\     l `Minion Pro' & L `Minion Pro'\\     m `Minion Pro' & M `Minion Pro'\\     n `Minion Pro' & N `Minion Pro'\\     o `Minion Pro' & O `Minion Pro'\\     p `Minion Pro' & P `Minion Pro'\\     q `Minion Pro' & Q `Minion Pro'\\     r `Minion Pro' & R `Minion Pro'\\     s `Minion Pro' & S `Minion Pro'\\     t `Minion Pro' & T `Minion Pro'\\     u `Minion Pro' & U `Minion Pro'\\     v `Minion Pro' & V `Minion Pro'\\     w `Minion Pro' & W `Minion Pro'\\     x `Minion Pro' & X `Minion Pro'\\     y `Minion Pro' & Y `Minion Pro'\\     z `Minion Pro' & Z `Minion Pro'\\     \end{tabular}          \end{document}


title: Change headings to another language when using elsarticle

text: After downloading the article template of Elsevier (elsarticle) and using it, I discovered that babel is not working.               \documentclass[preprint,a4paper,12pt]{elsarticle}         \usepackage[dutch]{babel}         \usepackage[utf8]{inputenc}         \journal{test}         \begin{document}         \begin{frontmatter}         \title{ Complicated }              \begin{abstract}         \end{abstract}         \begin{keyword}         \end{keyword}              \end{frontmatter}                   \end{document}      Q: is there a quick way to change the words “keyword”, “abstract” and “preprint submitted to” in to another language(e.g.,dutch/french)?


title: Using TeX to split words into syllables

text: I know literally nothing about TeX, but when trying to figure out how to split english words into syllables I saw that the TeX typesetting system has a syllable breaking algorithm. Is there a simple way that I could use this to break a bunch of words into syllables, or would it require a sizable ascent up the TeX learning curve?


title: How to just show a part of lines inside a tabular

text: I am drawing a matrix as follows:               \[\begin{tabular}{l|lllll|ll}         & 0 & i & j & k & $\ldots$ & x & y \\ \hline       0 & 0 & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$\\       i & $\ldots$ & 0 & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$\\       j & $\ldots$ & $\ldots$ & 0 & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$\\       k & $\ldots$ & $\ldots$ & $\ldots$ & 0 & $\ldots$ & $\ldots$ & $\ldots$ \\        $\vdots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$\\ \hline       x & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & 0 &$\ldots$\\       y & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & $\ldots$ & 0       \end{tabular}\]      And it gives: ![enter image description here](http://i.stack.imgur.com/QEsuk.png) The contents are fine, one problem is that I just want to keep a part of the horizontal and vertical lines which across inside the matrix. So I would like the lines to look like this image: ![enter image description here](http://i.stack.imgur.com/JMjJG.png) Does anyone know what to do to achieve this?


title: siunitx: Error while including value

text: A value is saved in a file (`value.txt`, let's say). The command               \SI{\input{value.txt}}{\someunit}      gives the error:               Argument of \input has an extra }      How can I read numbers from an external file and use them with `\SI`?


title: Angular frequency in siunitx

text: When using `siunitx`, is there an intuitive way to type angular frequencies with the prefix `2\pi \times`? The provided example               \documentclass{article}     \usepackage{siunitx}     \begin{document}     \SI{2\pi x 100}{\mega\hertz}     \end{document}      yields ![enter image description here](http://i.stack.imgur.com/jf8eE.png) So is there a neat way to supress the first unit?


title: How to increase the accuracy of \psTangentLine?

text: I want to draw the tangent line as well as the normal line for an arbitrary curve as follows.               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pstricks-add}          \begin{document}     \begin{pspicture}[showgrid](6,3)         \pscurve[curvature=1 1 1](0,0)(1,2)(2,1)(4,2)(6,1)         \psTangentLine[Tnormal,linecolor=blue](2,1)(4,2)(6,1){3}{0.25}         \psTangentLine[linecolor=red](2,1)(4,2)(6,1){3}{1}         \pscircle*[linecolor=green](OCurve){3pt}     \end{pspicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/hVQjH.png) Unfortunately, the point through which the above lines pass is not on the curve. What is wrong? And how to solve it?


title: Allow frame breaks in multicolumn environment

text: I want beamer to automatically split my text over multiple frames (as many as is required) while retaining the format of the specified number of multicolumns (in this case 3). I do not want to have to specify the column width that is why i have used "multicols." I found the question entitled Allow theorem split in many frames in beamer but this question is unique to the multicol environment.               \documentclass[gray]{beamer}     \usetheme{default}     \begin{document}     \begin{frame}[allowframebreaks]{Example Frame}     \begin{multicols}{3} \small\raggedright     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.     \end{multicols}     \end{frame}     \end{document}


title: Defining synonyms for indexing

text: Is it possible to set things up so that indexing synonyms does not generate multiple entries? For example, if the text includes `\index{cur}`, `\index{hound}`, and `\index{mutt}`, can these be coalesced under the entry “dog”? (Assume these keys are being automatically-generated; otherwise I’d just type `\index{dog}` every time.) Background: LaTeX3/expl3 offers the possibility of defining certain variants of functions together. In terms of the (experimental) class `l3doc`, an example might look like this:               % \begin{macro}[pTF]{\bool_if:N}     %   Blah blah blah.     %    \begin{macrocode}     \prg_new_conditional:Npnn \bool_if:N #1 { p , T , F , TF }       { … }     %    \end{macrocode}     % \end{macro}      In the documented code listings, this displays both `\bool_if:N(TF)` and `\bool_if_p:N` in the margins; in the generated code, this defines the four functions `\bool_if_p:N`, `\bool_if:NT`, `\bool_if:NF`, and `\bool_if:NTF`. [Note: The notation `\bool_if:N(TF)` is the closest I can come on this site to showing the actual notation; but it’s close enough for this discussion.] The trouble is that the automatic indexing of csnames from `doc.sty` indexes this line as an instance of the non-existent function `\bool_if:N`! [Note: `l3doc` adjusts catcodes so the colon & underscore are properly recognized.] So…. Is there a way to tell the index-generation that the function variants are synonyms? _I.e._ , can the various places within the code where the variants are used be coalesced under one index entry? (The entry would probably look something like `\bool_if:N(TF), \bool_if_p:N`.) Alternate option: Is it possible to set things up so the single key `\bool_if:N` is recognized not as itself but as an instance of the four variants that actually exist?


title: Overlaying parts of Beamer table with a "see-thru" (i.e., opaque) textbox

text: This seems like it should be simple! After creating a very complex table using `multirow` and many other table related `beamer` packages that I have just learned about, I now want to highlight parts of it during my talk with successful overlays (controlled by `\pause` or somesuch). I had envisioned doing three textblock calls such as:               \begin{textblock}{14.5}(0.75,3)        \textblockcolor{yellow}        \vspace{.5cm}        \center        Above the Saddle**        \vspace{.5cm}     \end{textblock}      Where each one has a different x-y location, a different colored background, different words. My problem is that I want the `textblockcolor` to be opaque or translucent so that the text below it (i.e., the table text) is visable. I have tried the "`transparent`" package - with much failure, I have tried many other false leads (so many that I have forgotten them all). I have studied the documentation for `textpos` (thinking that maybe I could do what I wanted with its `overlay` setting), any ideas? Naturally I don't want the text to be translucent, opaque, or transparent. It seems like I would want to use "opacity" but searching on that thread doesn't lead me where I want to do -- of course, it would be nice if I could vary the color of text in each `textblock` but I can live with black. Thanks for any help and thoughts.


title: Is there a latex template that makes a page look like a math notepad?

text: is there a class or template to make a LaTeX page look like a math-ruled notebook/pad page? Thanks.


title: Prevent latex from putting big figure alone on the page

text: I have a figure which occupies around 75% of the page and Latex keeps putting this figure alone on a page (in the middle of the page). What I want is to have some of the lines of the following paragraph right after the figure, even if there is space for only 4 or 5 lines. I tried with `\nopagebreak` and `minipage`, but nothing seems to work. Thanks! EDIT: I fixed it by setting the [ht] parameters for the figure.


title: Table and graph do not align

text: The table and graph are not vertically aligned and I don't know how to fix it. Any suggestions?               \begin{tabular}{|c|c|} \hline         $x$     &   $y$ \\ \hline          $-2$    &   $-5$    \\ \hline         $-1$    &   $-3$    \\ \hline         $0$ &   $-1$    \\ \hline         $1$ &   $1$ \\ \hline         $2$ &   $3$ \\ \hline         $3$ &   $5$ \\ \hline     \end{tabular}      \hspace{5cm}     \begin{tikzpicture}[scale=.3]         \begin{scope}             \clip (-10,-20) rectangle (10,0);             \draw[step=2cm,gray,very thin]                 (-12,-22) grid (10,0);         \end{scope}          \draw [<->] (-11,-10) -- (11,-10);         \draw [<->](0,-21) -- (0,1);         \clip (-10,-20) rectangle (10,0);     \end{tikzpicture}


title: Emacs and latex math delimiters

text: The `forward-sexp` command in EMACS can be used to find the `$` that closes an inline equation: if the point is before the `$` that opens the equation, then `forward-sexp` moves the point after the closing `$`. This does the correct thing with nested equations: e.g., if the point is before `$a + \text{b $c$}$`, then `forward-sexp` moves the point past the entire equation. Is there a way to find the `\\)` or `\\]` that closes a `\\(` and `\\[` with auctex, perhaps with `texmathp` or `font-latex-match-math-env`? This seems to be a bit tricky in EMACS as there is no way to store multi-char delimiters in a syntax table.


title: Setting catcodes in a group

text: Can someone explain to my why `\foo` and `\bar` are not the same (in the `\ifx` sense) in this example:               \documentclass{article}     \begingroup       \catcode`|=3\relax       \gdef\abc{|}     \endgroup     \makeatletter     \newcommand\foobar{       \begingroup         \catcode`|=3\relax         \def\abc{|}         \@foobar     }     \newcommand\@foobar[1]{       \xdef\foo{#1}       \endgroup     }     \edef\bar{\abc}     \foobar{\abc}          \begin{document}     foo means ``\meaning\foo'' and bar means ``\meaning\bar'', but the ``meanings'' are     \ifx\foo\bar       same     \else       different     \fi     \end{document}      I included the `\@foobar` because I read somewhere that the `catcode` had to be changed before reading the macro parameter (I don't think it applies here, but I have no idea what I am doing). The global definition of `\abc` (the one defined with `\gdef`) is | with catcode 3. I would like the local definition of `\abc` (the one defined with `\def`) to also be | with catcode 3. In my example the local `\abc` is | with catcode 12. Ultimately I would like to have `\foobar{\abc}` expand to | with catcode 3 without having `\abc` defined golbally.


title: eplain access to \li number

text: What is the best way to get the "marker" for the current item in a list in the eplain format?               \numberedlist       \li Here's an item       \li And this is another and it's marker is: \marker     \endnumberedlist      I've tried using "\marker" but from what I can tell, by the time that is expanded, the item number has already been incremented. I tried reading the eplain.tex source but I'm not proficient enough to understand it.


title: How to create integer labels on TikZ grid when we don't know the grid size at compile time?

text: I want to put integer labels on the grid. The grid size depends on the image loaded. The real scenario is to vectorize a JPG image but I need a grid label for navigation as follows ![enter image description here](http://i.stack.imgur.com/KNCQM.png)               \documentclass{article}     \usepackage{tikz}     \usepackage{graphicx}               \newsavebox\TempBox     \savebox\TempBox{\includegraphics{batman.jpg}}          \begin{document}     \begin{tikzpicture}          \node[inner sep=0] at (0,0) {\usebox\TempBox};         \draw[white](-0.5\wd\TempBox,-0.5\ht\TempBox) grid (0.5\wd\TempBox,0.5\ht\TempBox);              % I want to put integer labels for navigation purpose. The following code cannot be compiled!         %\foreach \x in {-0.5\wd\TempBox,1,...,0.5\wd\TempBox} { \node [anchor=north] at (\x,0) {\x}; }         %\foreach \y in {-0.5\ht\TempBox,1,...,0.5\ht\TempBox} { \node [anchor=east] at (0,\y) {\y}; }              \draw[line width=2pt,blue] (0,0) ellipse (6.3 and 3.4);         \draw[line width=2pt,blue] (0,0) ellipse (6.9 and 4.0);     \end{tikzpicture}     \end{document}      The following figure is the original image to complete the MWE. ![enter image description here](http://i.stack.imgur.com/J709k.jpg) How to create integer labels on TikZ grid? I might need something like `floor` or `ceiling` functions here.


title: Indexing some notions twice?

text: I'm making an Index of defined notions for my thesis (it's partly algebraic so there are dozens of notions defined through the whole text) and I think on how to index notions like _trace of a Mobius transformation_ or _side of a fundamental domain_. The nature says that the main part is the noun so it should be               fundamental domain        Ford        pre-Ford     Mobius transformation        rational        real     side        of fundamental domain     trace        of Mobius transformation     vertex        of fundamental domain      But then it could be indexed the other way as well, because both _Mobius transformation_ and _fundamental domain_ are in Index anyways.               fundamental domain        Ford        pre-Ford        side of        vertex of     Mobius transformation        rational        real        trace of      **My question is whether it is _confusing_ to merge both variants and make such terms indexed twice.**               fundamental domain        Ford        pre-Ford        side of        vertex of     Mobius transformation        rational        real        trace of     side        of fundamental domain     trace        of Mobius transformation     vertex        of fundamental domain


title: Use natbib with alpha style

text: Is it possible to use `natbib` together with the `alpha` style? It doesn't seem to be supported directly in the `natbib` package. What I mean is that there is no specific `alpha`-like `natbib` style, and if I use `alpha` directly I lose the possibility of citing author names and such with `\citet`... Does anybody know of an `alpha` style that would work with `natbib`?


title: Repeat and enumerate a part of document

text: I have 4 sets/groups of exam questions. I want to enumerate them from 1 to a number of persons. Because a number of students exceed 4 I must repeat the sets. If I had 40 students therefore I would write (where i is a number of repetitions)               for (i in 1 to 10)      {     Print(Group(4*i -3)))     Print(Group(4*i -2 ))     Print(Group(4*i -1))     Print(Group(4*i))     }      How to do this in LaTeX? In the last resort I could repeat (CTRL-C, CTRL-V) code below 10 times changing consecutive numbers. I would also appreciate if you figure out how to get the same visual effect on each page i.e. items in the first page are spaced out what I don’t want to.               \documentclass[a4paper,11pt]{article}     \usepackage[cm]{fullpage}     \usepackage [utf8]{inputenc}     \usepackage{lscape}     \usepackage{multicol}     \pagestyle{empty}               \begin{document}               \begin{landscape}     \begin{multicols}{2}[\columnsep 1.5cm]               \begin{center}     \textsc{Group $4i-3$}     \end{center}          \begin{enumerate}      \item Task  A     \item Task  B     \item Task  C     \item Task D     \end{enumerate}         \columnbreak          \begin{center}     \textsc{Group $4i-2$}     \end{center}          \begin{enumerate}      \item Task  E     \item Task  F     \item Task  G     \item Task H     \end{enumerate}     \pagebreak          \begin{center}     \textsc{Group $4i-1$}     \end{center}          \begin{enumerate}      \item Task  I     \item Task  J     \item Task  K     \item Task L     \end{enumerate}               \begin{center}     \textsc{Group $4*i$}     \end{center}          \begin{enumerate}      \item Task  M     \item Task  N     \item Task  O     \item Task P     \end{enumerate}               \end{multicols}     \end{landscape}          \end{document}


title: How do you make the underscore active in environments but preserve its orignal use in math mode?

text: I'm experimenting with creating a formatting shorthand package. I want to use the underscore to delimit an underlined text span, like so               some text _underlined text_ more text      Simply making the underscore active defining a macro               \catcode`_=\active%     \def_#1_{\underline{1}}%      is not viable since this obviously collides with the use of the underscore in math mode. Is it possible to have both work? If so, how?


title: biber-\printbibliography problem

text: Here is my MWE (file 'MWE-reference.tex')               \documentclass{article}     \usepackage[backend=biber]{biblatex}     \addbibresource{mybib.bib}     \DeclareSourcemap{       \maps[datatype=bibtex]{         \map{           \step[fieldsource=author,                 match={MacLane, S.},                 final]           \step[fieldset=keywords, fieldvalue=MacLane]         }       }     }     \begin{document}     Test\cite{mac};     Test\cite{notmac}     \begin{refsection}     \nocite{*}     \printbibliography[keyword=MacLane,title=none]     \end{refsection}     \printbibliography[notkeyword=MacLane,title=none]     \end{document}      The file mybib.bib is               @book{mac,       title = {Homology},       publisher = {Springer},       year = {1975},       author = {MacLane, S.},       volume = {114},       series = {Classics in Mathematics}     }     @book{notmac,       title = {Homology},       publisher = {Springer},       year = {1975},       author = {none},       volume = {114},       series = {Classics in Mathematics}     }      After running               Xelatex MWE-reference     biber MWE-reference     Xelatex MWE-reference     Xelatex MWE-reference      I get this > Test[mac]; Test[notmac]. and no Bibliography. What's wrong? Others: > Xelatex version 3.1415926-2.5-0.9999.3 (MiKTeX 2.9) > > Biber version **1.9** > > biblatex version **2.9** **Update** : The Biber log says > [0] Config.pm:320> INFO - This is Biber 1.9 > > [1] Config.pm:323> INFO - Logfile is 'MWE-reference.blg' > > [56] biber-MSWIN:274> INFO - === %a %b %e, %Y, %H:%M:%S > > [57] Biber.pm:333> INFO - Reading 'MWE-reference.bcf' > > [175] Biber.pm:635> INFO - Found 2 citekeys in bib section 0 > > [176] Biber.pm:632> INFO - Using all citekeys in bib section 1 > > [176] Biber.pm:635> INFO - Found 0 citekeys in bib section 0 > > [228] Biber.pm:3051> INFO - Processing section 0 > > [277] Biber.pm:3189> INFO - Looking for bibtex format file 'mybib.bib' for > section 0 **Update:** I found that after running biber, I get an empty .bbl file. I think this is the point, but as you can see in the above biber log, there are no warning or errors. What's wrong?


title: How to centre an equation

text: When I build and view my equation it is always aligned right               \begin{equation}      $$\textit{N}(\textit{t}) = $\frac{P_o}{\lambda+\rho\varepsilon/\Lambda}$[1-e$^{-t(\lambda+\rho\varepsilon/\Lambda}$)]$$      \end{equation}      but if I build and view using align*               \begin{equation}     \begin{align*}      $$\textit{N}(\textit{t}) = $\frac{P_o}{\lambda+\rho\varepsilon/\Lambda}$[1-e$^{-t(\lambda+\rho\varepsilon/\Lambda}$)]$$     \end{align*}      \end{equation}      the equation is centre aligned, but the format changes and the numerator no longer sits above the denominator and moves to the left. Any ideas what is going wrong?


title: Keep TikZ arrows on foreground with animategraphics

text: I am using beamer and I'd like to put an arrow with TikZ on a movie created with \animategraphics. No problem when I am using only one frame, for example:               \begin{frame}      \frametitle{\centerline{Title}}        \begin{tikzpicture}         \node[inner sep=0pt] (salimg) at (0,0) {\includegraphics[trim = 15mm 10mm 10mm 10mm,clip,width=\textwidth]{FirstImage.png} };                                   \node[inner sep=2pt,fill=magenta] (sectcall) at (6,-3) {\tiny Hi!};         \draw[<-,thick] ([xshift=-2cm,yshift=1.5cm]salimg.south east) -- (sectcall.west);        \end{tikzpicture}     \end{frame}      But when I insert the animation, part of the arrow is not visible because it goes underneath the frames               \begin{frame}      \frametitle{\centerline{Title}}        \begin{tikzpicture}                 \node[inner sep=0pt] (salimg) at (0,0) {\animategraphics[autoplay,loop,trim = 15mm 10mm 10mm 10mm,clip,width=\textwidth]{6}{Image0}{001}{010} }                                   \node[inner sep=2pt,fill=magenta] (sectcall) at (6,-3) {\tiny Hi!};         \draw[<-,thick] ([xshift=-2cm,yshift=1.5cm]salimg.south east) -- (sectcall.west);        \end{tikzpicture}     \end{frame}      I tried with declaring pgf layers but nothing will do. Any idea or advice? Thanks in advance!


title: Renewenvironement error

text: I'm using the epigraphs package, but try to redefine the epigraphs environment (to later on add something to it, e.g. a page break before). So I thought I do it like this:               \let\internepigraphs\epigraphs     \renewenvironment{epigraphs}{\begin{internepigraphs}}{\end{internepigraphs}}      But I get a few errors:               l.4 \end{epigraphs}     LaTeX Error: \begin{minipage} on input line 1 ended by \end{epigraphs}.          l.4 \end{epigraphs}                        Missing } inserted.      The code runs without the definition of renewenvironment, but otherwise not. Am I doing something wrong here?


title: Is it possible to cut a tikzpicture in half if the picture is too long and display it on two pages?

text: I'm using tikz (tikzpicture to be precise) to make some "drawings" (trees). The problem is that my "drawing" is too long to fit on one single page (it's too long). I was wondering what was the best way to display it on two (or more) pages :   * crop the picture and display it twice, first half on one page and second on second   * use some option that would allow to display the image on the first page and continue on the second page if the picture is too long... (but how?)   * ? Thanks,


title: Biblatex/biber keep cycling and not settle when using custom sort

text: I'm trying to do a custom sort: citation order -> year/month -> author -> title I think I got it in the style in the code below. However, when I run it: pdflatex -> biber -> pdflatex -> pdflatex. The numbers keep changing. First I got the compressed behavior in the citation, nicely [1]-[5], but the bibliography numbers are not in order. So, if I run pdflatex again, and now the bibliography is sorted, but the citation appears unsorted. ![unsorted-bib](http://i.stack.imgur.com/nG6Wz.png) ![unsorted- cite](http://i.stack.imgur.com/5vqfg.png) What am I doing wrong? Is there an option that I should turn on? or my sort has some problem?               \documentclass{article}          \usepackage{filecontents}     \begin{filecontents}{ref2.bib}     @INPROCEEDINGS{C2009,       author = {C H.},       title = {M},       booktitle = {C},       year = {2009},       month = oct     }     @INPROCEEDINGS{J2010,       author = {J O.},       title = {L},       booktitle = {P},       year = {2010}     }     @ARTICLE{T2010,       author = {X B.},       title = {E},       year = {2010},       month = jun,       journal = {I}     }     @ARTICLE{Z2010,       author = {B},       title = {L},       year = {2010},       volume = {19},       month = feb,       journal = {I}     }     @ARTICLE{Z2007,       author = {B},       title = {H},       year = {2007},       month = jan,       journal = {I}     }          \end{filecontents}          \usepackage[backend=biber,style=ieee,bibencoding=utf8,defernumbers=true]{biblatex}          % sort in citation order and then by year/month, and author and title     \DeclareSortingScheme{cymat}{       \sort{\citeorder}       \sort{           \field{sortyear}           \field{year}           \literal{0}         }         \sort{           \field[padside=left,padwidth=2,padchar=0]{month}           \literal{0}         }         \sort[direction=descending]{           \field[padside=left,padwidth=2,padchar=0]{day}           \literal{99}         }       \sort{           \name{sortname}           \name{author}           \name{editor}           \name{translator}           \field{sorttitle}           \field{title}       }     }              \bibliography{ref2}          \pagestyle{empty}          \begin{document}     \cite{J2010, Z2010, Z2007, C2009, T2010}     \printbibliography[sorting=cymat]          \end{document}


title: How to plot dense functions smoothly and correctly

text: I tried to plot a function like this ![enter image description here](http://i.stack.imgur.com/zr7qf.jpg) f(x)= (sin(x)^2)*(cos((x/2)^2)) on a tiny bandwidth around 180 degrees on various tools like PyXPlot, Asymptote and GNUPlot, I'm not expert in any of these but all tools give me almost the same result, the result is inaccurate as at `x=180`, `y=0.I` tried to plot with more samples but with no success.


title: Is it possible to use an \hdashrule inside a \ctable as a \midrule?

text: I would like to know if there is a way to use an `\hdashrule` or `\hdashline` inside a `\ctable`as a `\midrule`? If possible, it will obey to the same _rules_ as the `\midrule` command, like adjusting automatically to the **table width** and conserving the **vertical spacing** between the rows. I tried the following table :               \documentclass[11pt]{book}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[francais]{babel}     \usepackage{multicol,bm}     \usepackage{array, booktabs}     \usepackage{ctable, dashrule}     \usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}          \begin{document}     \ctable[caption= {Paramètres},             label  = {tab:paramètres},             ]             {m{6.cm} m{3.5cm} l }             {\tnote[$\ast$]{Dans le repère du solide.} \tnote[$\ast \ast$]{Autour de l'axe de rotation.}}{             \toprule                 &   \textbf{Premier Solide} &   \textbf{Deuxième Solide}\\             \midrule             \textbf{Masse (kg)} &   4,4839  &   3,8177\\             \multicolumn{3}{c}{\hdashrule{8cm}{1pt}{1pt 5pt}} \\             \textbf{Centre de masse\tmark[$\ast$] ($\bm{x}\,;\, \bm{y}$) (m)}   &   (0 ; 0,1940)    & (0 ; 0,1613)\\             \multicolumn{3}{c}{\hdashrule{8cm}{1pt}{1pt 5pt}} \\             \textbf{Moment d'inertie\tmark[$\ast \ast$] (kg$\cdot$m\textsuperscript 2)}&    0,0913  &   0,0615\\             \bottomrule}          \end{document}      Unfortunately, these dashed lines don't adjust automatically to the table width, and even worse, they do not conserve the vertical spacing between rows! Is there a way to make this simple and automatic? Note : I also tried replacing               \multicolumn{3}{c}{\hdashrule{8cm}{1pt}{1pt 5pt}}      by               \hdashline[1pt/3pt]      `\hdashline` has the advantage to automatically adjust to the table width, but it doesn't conserve the `booktabs` vertical spacing laws. Also, one can't control the size of the dashed line using this command.


title: Drawing specific curves/planes

text: I want to submit a paper and the only thing that's left to do is to add some graphics. My deadline is on Wednesday/Thursday. What I want to do is some basic curve/plane drawings. Here is an image: ![enter image description here](http://i.stack.imgur.com/N03bQ.jpg) I checked out the post about the big software list for drawings http://math.stackexchange.com/questions/1985/software-for-drawing-geometry- diagrams and I tried out TikZ but I don't really know in which direction I should go or which packages I should choose... Would another software be more helpful for my needs or can you recommend some easy to handle packages for TikZ?


title: Legend position & bad x ticks scale

text: I'm currently experimenting tikz-pgf, but facing some strong behaviour.   1. How is it possible to have only 1 legend for a groupplot?   2. Why is the scale 10^(-3) appearing below the first plot? Here is the MWE :               \documentclass{article}     \usepackage{tikz,pgfplots}     \usepgfplotslibrary{groupplots}          \begin{document}     \begin{tikzpicture}     \begin{groupplot}[group style={             group name=my plots,             group size=1 by 2,             xlabels at=edge bottom,             xticklabels at=edge bottom,             vertical sep=0pt         },enlarge x limits=false,height=3cm, width=.8\textwidth,grid=major,scaled x ticks=base 10:3,legend cell align=left,legend pos=outer north east]       \nextgroupplot       \addplot[domain=0:0.05,samples=200] {1.2*sin(2*pi*50*\x r)};       \addplot[red,domain=0:0.05,samples=200] {0.8*sin(2*pi*50*(\x r-0.25))};       \legend{U [V],I [A]};       \nextgroupplot[xlabel={t [s]}]       \addplot[green,domain=0:0.05,samples=200] {0.8*1.2*sin(2*pi*50*\x r)*sin(2*pi*50*(\x r-0.25))};       \legend{S [VA]};     \end{groupplot}     \end{tikzpicture}     \end{document}      Here is an illustration of the output : ![illustration](http://i.stack.imgur.com/R7dui.png)


title: multiple (concurrent) TeXLive installations on Windows XP and with WinEdt

text: I have been a long user of TeXLive (TL) for many years on my Windows XP machine. I currently have TeXLive 2008 installed and I would like to install the new TL2010. I have heard of the possibility to have multiple TL installations on the same machine. I have three questions:   1. Does anyone has experience with having multiple TL versions on a Windows machine? I don't see that my "environment variables" depend on TL files.    2. Are there any additional thing that I should know about these multiple (or concurrent?) installations? I understand that I have to use different folder names for the different TL versions.   3. I know that I have to indicate WinEdt which TL version to use. Anything else I should know here? P.S: I would like to keep my old TL2008 as it has always worked very fine for me and in case I don't like TL2010 for some reason, I always have the TL2008 as reserve. Thanks a lot...


title: Plotting functions with parameters from an external file using gnuplot/pgfplots/pgfplotstable

text: If I have a table, how can I get the table values and use them as parameters for plotting in pgfplots in gnuplot? In particular, how can multiple curves be plotted with the same functional form from multiple rows?


title: How can I link together outline-mode with RefTeX-TOC?

text: The question title says it, pretty much. How can I link together RefTeX's TOC functionality with `outline-mode` such that I can fold sections/subsections/etc.?


title: Horizontal spaces to the left and right of theorems

text: How do I get horizontal spaces to the left and right of theorems? My initial idea was to do the following bad idea:               \documentclass{article}     \usepackage{lipsum}% http://ctan.org/pkg/lipsum     \usepackage{amsthm}% http://ctan.org/pkg/amsthm          \newtheoremstyle{newplain}  % name of the style to be used       {}                        % measure of space to leave above the theorem       {}                        % measure of space to leave below the theorem       {\addtolength{\leftskip}{2em}\addtolength{\rightskip}{2em}% this is probably bad!!!        \itshape}                % commands on body of the theorem       {}                        % measure of space to indent (empty = no indent, \parindent = para indent)       {\bfseries}               % name of head font       {.}                       % punctuation between head and body       {5pt plus 1pt minus 1pt}  % space after theorem head       {}                        % Manually specify head          \theoremstyle{newplain}     \newtheorem{theorem}{Theorem}[section]     \newtheorem{lemma}{Lemma}[section]          \begin{document}          \lipsum[1]          \begin{lemma}     The Lemma says     \begin{equation}     y=mx+c.     \end{equation}     \end{lemma}          \lipsum[2]          \begin{theorem}[Wigner-Eckart theorem]     The Matrix elements of a tensor operator can be rewritten as     \begin{equation}     y=(\partial_x y)x+c.     \end{equation}     This equation does not does not have the correct formatting that was defined above.     \end{theorem}          \lipsum[3]          \end{document}


title: knitr problem after update to R 3.0.0

text: I just updated R to 3.0.0. I couldn't compile PDF from my .Rnw file, which I could do with R 2.15. Here is the error I got:               ! Undefined control sequence.     l.192 \SweaveOpts                      {concordance=TRUE}     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      It seems related to Sweave. But I was using knitr to weave .Rnw file. Could some one help me fix the problem?


title: TikZ: different x, y scales but so that shapes maintain their aspects

text: I have some old pstricks code which I'm re-doing with TikZ. In my current picture, the x and y scales are different:               \begin{tikzpicture}[xscale=1.8,yscale=4]      However, this has the problem that circles are drawn as ellipses, being stretched more in the y direction. I've also tried               \begin{tikzpicture}[x=1.8cm,y=4cm]      but this has the same effect of stretching circles into ellipses. So is there any way of scaling coordinates only in TikZ, which doesn't affect the object shapes?


title: Beamerpauses counter reset between environments inside an overlay?

text: I was reading the answer to this question Mixing overprint with blocks of enumerations [I recopy the code so you dont' have to follow the link]               \documentclass{beamer}     \usetheme{Warsaw}          \begin{document}          \begin{frame}{Test}       \begin{center}       text before       \pause       \begin{overlayarea}{\textwidth}{3.3cm}         \only<2-3>{%             \begin{block}{Some title here}             \begin{enumerate}[<+->]             \item One             \item Two             \end{enumerate}             \end{block}}         \only<4-7>{%         \begin{block}{Some title here}             \begin{enumerate}[<+(2)->]             \item CHicken             \item Duck             \item Rooster             \end{enumerate}             \end{block}}       \end{overlayarea}       text after       \end{center}     \end{frame}          \end{document}      and I noticed the use of a number between parentheses in the default incremented overlay specification in the second `enumerate` environment. (see the presence of `[<+(2)->]`) Only then will the items of the second numbered list in the `overlayarea` environment be uncovered incrementally. Why is that needed ? It seems to imply that `beamerpauses` is reset between the `enumerate` environments ? Or is it reset between the `only` commands in the `overlay` environment? Isnt that a nasty behaviour? Because it is as if you are supposed to keep track yourself of beamerpauses. The usefulness of `[<+->]` is lost then, isn't it ?