title: Injecting text contained in file into custom environment

text: how can I inject text contained in a file `input.tex` into a custom environment. Something like :               \documentclass{report}     \usepackage{listings}          \lstdefinelanguage{text}{}     \lstnewenvironment{my}{\lstset{language=text}}{}          \begin{document}     \begin{my}     \input{input.tex}     \end{my}     \end{document}      * * * Response to Gonzalo Medina : Hi, if I use `\lstinputlisting[language=text]{file.tex}` then the comments (appearing after `\\\`) are not properly highlighted as comments :               \documentclass{report}     \usepackage{listings,xcolor}          \lstdefinelanguage{text}{     commentstyle=\color{green},     basicstyle=\footnotesize\ttfamily,     showstringspaces=false,     showspaces=false,     }          {\catcode`\^^M=12      \def\marshal{\lstnewenvironment{my}{     \lstset{language=text,comment=[s]{\\\\}{^^M}}     }{}}\expandafter}\marshal          \begin{document}          The following works as expected (comments showing in green):           \begin{my}     Not comment     \\Commment     Not comment     \end{my}          The following does not work as expected (comments not green):          \lstinputlisting[language=text]{input.text}          \end{document}      where `input.text` contains the following code :               Not comment     \\Commment     Not comment      * * * @egreg From regular expression in listings the following code works fine :               \documentclass{report}     \usepackage{listings,xcolor}     \lstdefinelanguage{text}{}          {\catcode`\^^M=12 \def\marshal{\lstnewenvironment{mylang}{\lstset{language=text,comment=[s]{^^MXYZ}{^^M^^M},commentstyle=\color{green},basicstyle=\footnotesize\ttfamily,showstringspaces=false,showspaces=false,}}{}}\expandafter}\marshal          \begin{document}     \begin{mylang}     Only a test, this is not a comment     XYZ this should colored as a comment     and this line too          this is not a command, because only lines starting with XYZ     are comments          This is not a comment, too     \end{mylang}     \end{document}      Now what I want to do is to have :               Only a test, this is not a comment     XYZ this should colored as a comment     and this line too          this is not a command, because only lines starting with XYZ     are comments          This is not a comment, too      Contained in a file, then to load this file into the main tex file and then get the same colouring which I get when the text is contained in the tex file as above. Thanks


title: Multiple questions regarding formatting tables

text: **Question 1** A while ago, I used some code from here, which fitted my requirements perfectly. However, I'd like a different table, and playing around with the code (I'm quite new to Latex) has not yielded any encouraging results. Basically I'd like a table like the one below (produced in Excel because I can't produce it in Latex at the moment): ![enter image description here](http://i.stack.imgur.com/juOkD.png) Currently I am getting the following - note the numbers in notes are from an old table ![enter image description here](http://i.stack.imgur.com/DojLR.png) My MWE (don't worry about alignment when it appears in the article class - I'm using a customised template which already has all the margins etc set out). I'd also like the Notes column to have a slightly greater width than the other columns because I will be putting more text in there. Also you might notice the (See Appendix ??) - that is my second question.               \documentclass{article}     \usepackage{booktabs}     \usepackage{array}     \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}     \renewcommand\arraystretch{1.2}     \usepackage{threeparttable}     \begin{document}     \begin{table}[H]     \centering     \renewcommand\arraystretch{1.2}     \begin{threeparttable}     \caption{Description of Independent Variables}     \begin{tabular}{@{}p{0.20\textwidth}*{4}{L{\dimexpr0.20\textwidth-2\tabcolsep\relax}}@{}}     \toprule     & {\bfseries Independent Variable} & {\bfseries Code} & {\bfseries Units} &    \bfseries{Notes} \\     \midrule     First-year GPA & FYGPA & Continuous & Overall first-year Grade Point Average & 5 -- 6  \\     Adjusted Matric GPA & AMGPA & Continuous & The average includes the top four subjects,  excluding Mathematics, Additional Mathematics, Mathematics Paper 3 and English (First or Second Language. See Appendix~\ref{chapter:AppendixB}). & 11 -- 14 \\     \bottomrule     \end{tabular}     \end{threeparttable}     \end{table}     \end{document}      **Question 2** I have a 'chapter' which is actually an Appendix. I've labelled the Appendix in the following way:               \chapter{Appendix B}     \label{AppendixB}     \lhead{Appendix B \emph{Adjusted Matric GPA }}      Now when I wanted to cross-reference this Appendix in my text, I get a ??. My cross-reference is the following:               See Appendix~\ref{chapter:AppendixB})      Why is Latex not picking up the label? **Question 3** My table is going to extend over one page once I put all my variables in. I see the longtable package is recommended for this job. However, simply replacing the \begin{table}...\end{table} with \begin{longtable}...\end{longtable} in my MWE is bringing up a whole host of additional errors (for example, it doesn't like the \centering command and says \caption -> \noalign). What should I be aware of when using the longtable package over the table package?


title: How would I cite a dataset from BibDesk on Beamer presentation?

text: I manage my bibliography using _BibDesk_ on _Mac OS X_. I have a presentation using _Beamer_ on which I would like to include some bibliographies. I am using _TeXShop_ to do that. What I know is that I have to put the `.bib` near my `.tex` file to compile, and use `\cite{}` to cite articles. Here is what I have done so far, I created a frame called _Bibliographie_. I cited an article _Gordillo:2013aa_. And I mentionned the path to my centralized `.bib`.               \begin{frame}     \frametitle{Bibliographie}          sds \cite{Gordillo:2013aa}          \bibliographystyle{plain}     \bibliography{/Users/Alji/Google Drive/Recherche/Papers/LibraryBibDesk.bib}          \end{frame}      ----> It does not work under TexShop, I get this : ![enter image description here](http://i.stack.imgur.com/HX8z7.png) I am looking for a general explanation that help me understand the way things work. I found it here How do I use my .bib file with TexShop but I am still having problems ... Thank you in advance


title: How to create a hyperlinked author-year citation?

text: I am using the biblatex package, and I'd like to reproduce an effect similar to the one required in this question. biblatex's standard \citeauthor{bibid} command puts in the authors name, but without a hyper link, or the year in which the article was written. I tried looking through the documentation for biblatex, but couldn't find a high level command at the level of autocite that would simply reproduce what I am looking for. What are my options?


title: How can I use a conditional expression as key-value arguments?

text: I want to reduce the number of used keystrokes in my code. More precisely, I want to simplify               \ifodd\numexpr\ix+\iy\relax\psset{fillstyle=vlines,hatchsep=.5pt,hatchcolor=lightgray}\else\psset{fillstyle=solid}\fi     \psframe[origin={\ix,\iy}](-1,-1)      to               \psframe[origin={\ix,\iy},\ifodd\numexpr\ix+\iy\relax fillstyle=vlines,hatchsep=.5pt,hatchcolor=lightgray\else fillstyle=solid\fi](-1,-1)      Unfortunately, the latter does not compile with some errors that you can see by yourself. Here is the complete code for both the former (that is the code to be simplified) and latter cases (that is the simplified code but failed). ## Unsimplified               \documentclass[pstricks,border=24pt]{standalone}     \usepackage{multido}     \begin{document}     \begin{pspicture}[dimen=m](8,8)         \multido{\ix=1+1}{8}         {             \uput[d](!\ix\space .5 sub 0){$\char\numexpr\ix+96\relax\mathstrut$}             \uput[l](!0 \ix\space .5 sub){$\ix\mathstrut$}             \multido{\iy=1+1}{8}             {                        \ifodd\numexpr\ix+\iy\relax\psset{fillstyle=vlines,hatchsep=.5pt,hatchcolor=lightgray}\else\psset{fillstyle=solid}\fi                 \psframe[origin={\ix,\iy}](-1,-1)                 \rput(!\ix\space .5 sub \iy\space .5 sub){$(\ix,\iy)$}             }         }     \end{pspicture}     \end{document}      ## Failed to be simplified               \documentclass[pstricks,border=24pt]{standalone}     \usepackage{multido}     \begin{document}     \begin{pspicture}[dimen=m](8,8)         \multido{\ix=1+1}{8}         {             \uput[d](!\ix\space .5 sub 0){$\char\numexpr\ix+96\relax\mathstrut$}             \uput[l](!0 \ix\space .5 sub){$\ix\mathstrut$}             \multido{\iy=1+1}{8}             {                            \psframe[origin={\ix,\iy},\ifodd\numexpr\ix+\iy\relax fillstyle=vlines,hatchsep=.5pt,hatchcolor=lightgray\else fillstyle=solid\fi](-1,-1)                 \rput(!\ix\space .5 sub \iy\space .5 sub){$(\ix,\iy)$}             }         }     \end{pspicture}     \end{document}      How to solve this issue?


title: Problem with titleformat: Don't want Chapter Style to be Applicable on Table of Contents & Bibliography

text: Please consider the following code:               \documentclass[11pt,twoside,openany]{book}          \usepackage[svgnames,x11names]{xcolor}     \usepackage{wallpaper}     \usepackage{changepage}     \usepackage[explicit]{titlesec}     \usepackage{tikz}     \usetikzlibrary{shapes,positioning}     \usepackage{lipsum}     \usepackage{geometry}     \geometry{        paperwidth=216mm, paperheight=303mm,        left=23mm,  %% or inner=23mm        right=18mm, %% or outer=18mm        top=23mm, bottom=23mm,        headheight=\baselineskip,        headsep=7mm,        footskip=7mm     }               %% Command to hold chapter illustration image     \newcommand\chapterillustration{}          %% Define how the chapter title is printed     \titleformat{\chapter}{}{}{0pt}{     %% Background image at top of page     \ThisULCornerWallPaper{1}{\chapterillustration}     %% Draw a semi-transparent rectangle across the top     \tikz[overlay,remember picture]       \fill[LightSalmon1,opacity=.7]       (current page.north west) rectangle        ([yshift=-3cm] current page.north east);       %% Check if on an odd or even page       \checkoddpage\strictpagecheck       %% On odd pages, "logo" image at lower right       %% corner; Chapter number printed near spine       %% edge (near the left); chapter title printed       %% near outer edge (near the right).       \ifoddpage{         \ThisLRCornerWallPaper{.35}{fern_mo_01}         \begin{tikzpicture}[overlay,remember picture]         \node[anchor=south west,           xshift=20mm,yshift=-30mm,           font=\sffamily\bfseries\huge]            at (current page.north west)            {\chaptername\ \thechapter};         \node[fill=Sienna!80!black,text=white,           font=\Huge\bfseries,            inner ysep=12pt, inner xsep=20pt,           rounded rectangle,anchor=east,            xshift=-20mm,yshift=-30mm]            at (current page.north east) {#1};         \end{tikzpicture}       }       %% On even pages, "logo" image at lower left       %% corner; Chapter number printed near outer       %% edge (near the right); chapter title printed       %% near spine edge (near the left).       \else {         \ThisLLCornerWallPaper{.35}{fern_mo_01}         \begin{tikzpicture}[overlay,remember picture]         \node[anchor=south east,           xshift=-20mm,yshift=-30mm,           font=\sffamily\bfseries\huge]            at (current page.north east)           {\chaptername\ \thechapter};         \node[fill=Sienna!80!black,text=white,           font=\Huge\bfseries,           inner sep=12pt, inner xsep=20pt,           rounded rectangle,anchor=west,           xshift=20mm,yshift=-30mm]            at ( current page.north west) {#1};         \end{tikzpicture}       }       \fi     }     \titlespacing*{\chapter}{0pt}{0pt}{135mm}               \begin{document}     \tableofcontents          \renewcommand\chapterillustration{six-computers-chips-circuits}     \newpage     \chapter{Hello World!}               \renewcommand\chapterillustration{cherry-tomatos}     \newpage     \chapter{Whassup, Doc?}          \end{document}      Problem: The Fancy Settings which I applied to "Chapters" comes over to Everything in the Document. => Table of Contents & Bibliography(not included in the sample code above) are now displayed as 'Chapters'. Also, I have to disable:               %\listoffigures     %\listoftables      as enabling these sections leads to compilation error (when the Chapter Settings applies to them). Please help me find some way to avoid this problem.


title: Table of contents in Beamer

text: I have seen a nice looking table of contents in a Beamer presentation. There were some formulas, pictures, graphs situated across the frame in a shadow background. Any idea how to do this?![enter image description here](http://i.stack.imgur.com/RlqT1.png)


title: Hevea Error at Non Ascii characters

text: I tried "Hevea" to convert Xelatex file to html, it worked great with table conversion etc. However my document has lot of characters like (स्वाध्यायनिरताम्) and I am getting this error.               bash-3.2# hevea Bala.tex     ./Bala.tex:39: Error while reading LaTeX:         Non-ascii '?' in input, consider using package inputenc     Adios      I tried with `\usepackage{inputenc}` but that did not help. Any suggestions would be greatly appreciated.


title: Beamer, Beamerposter and the TUGraz theme: compilation issue

text: When trying to compile using the Beamer class and the TUGraz theme I get the following error message: `LaTeX Error: There's no line here to end`. This is in Windows Vista (no goood, I know) with MikTeX 2.9. When I compile the same with MikTeX 2.9 in Windows XP I have no problem. Why? PS: I'm using the Beamerposter package. Here is a MWE:               \documentclass{beamer}     \usetheme{TUGraz}           \usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}          \title{\Huge Some Title\vspace{3mm}}     \author[]{Homer Simpson}          \begin{document}       \begin{frame}         \begin{block}{Introducction}           \begin{itemize}              \item This is an item.           \end{itemize}         \end{block}       \end{frame}     \end{document}      When I comment the line `\usetheme{TUGraz}` I have no compilation error. The TUGraz Beamer-poster theme can be downloaded from here ----------------------- EDIT ---------------------------------- And if I try to compile the following code I get `Error: Undefined control sequence`, referencing the line `\end{frame}`.               \documentclass[final,hyperref={pdfpagelabels=false}]{beamer}          %%%% Inclusion de fichiers "standalone" %%%%     \usepackage{standalone}          \mode<presentation> {         \usetheme{TUGraz}         }          %%%% Langue française %%%%     \usepackage[english,frenchb]{babel}     \usepackage[latin1]{inputenc}          %%%% Maths and symbols %%%%     \usepackage{amsmath,amsthm, amssymb, latexsym}          %%%% Policies matématiques %%%     \usefonttheme[onlymath]{serif}     \boldmath          %%% Package Beamerposter %%%%     \usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}               %%%% Institution %%%%     \institute[ECS-Lab]      {       ECS-Lab - ENSEA         \vspace {3mm}     }          %%%% Titre, auteurs, mails et site web %%%%     \title{\Huge Modes Glissants appliqués au Convertisseur Multicellulaire\vspace{3mm}}     \author[Amet, Ghanes \& Barbot]{Leonardo Amet, Malek Ghanes  et Jean-Pierre Barbot}     \mail{\{leonardo.amet,ghanes,barbot\}@ensea.fr}     \webpage{http://www-ecs.ensea.fr/}          \begin{document}     \begin{frame}     \centering     \begin{block}{Introduction}     \begin{minipage}{0.5\paperwidth}     Les \emph{\textbf{Convertisseurs Multicellulaires}} sont des structures de type \emph{multiniveaux} conçues dans le but de \emph{réduire les tensions sur les interrupteurs de puissance}.     \vspace{5mm}          \begin{minipage}[t]{0.29\paperwidth}     \textbf{Avantages:}     \begin{itemize}     \item réduction de $dV/dt$     \item réduction du contenu harmonique     \item modularité     \item réconfiguration possible (marche dégradée)     \item fréquence aparente de sortie supérieure à la fréquence de commutation     \end{itemize}     \end{minipage}\hspace{2cm}     \begin{minipage}[t]{0.19\paperwidth}     \textbf{Inconvénients:}     \begin{itemize}     \item nombre de composants élevé     \item composants flottants     \item \textbf{\textit{commande de tensions internes}}     \end{itemize}     \end{minipage}     \end{minipage}     \qquad     \begin{minipage}[c]{0.39\paperwidth}     \centering     \textbf{\textit{\large Convertisseur Multicellulaire à 3 cellules}} \vspace{0.6cm}     \hspace{-4cm}     % \scalebox{3.3}{     % \scalefont{0.35}     % \input{schema_multicell}}     \end{minipage}          \centering     \textbf{Pour égaler les tensions supportées par les cellules il faut charger chaque condensateur à une tension spécifique donnée par:     $\displaystyle {V_{C_k} = k\frac{E}{n}}$}     \end{block}          \begin{minipage}{0.479\paperwidth}     \begin{block}{Commande des Tensions Internes}      \textbf{\color{tugblue} MLI en boucle ouverte:}           \quad Equilibre naturel des tensions, mais lent et oscilatoire.\vspace{1.1cm}           \textbf{\color{tugblue} MLI en boucle fermée:}            \quad Equilibrage plus performant, mais pas suffisament rapide ni robust.\vspace{1.1cm}          \textbf{\color{tugblue} Modes Glissants:}           \centering      \quad \textbf{rapide et robust.}\vspace{1.1cm}      \end{block}      \end{minipage}      \quad     \begin{minipage}{0.479\paperwidth}     \begin{block}{Modèle instantané}     Cas d'un Convertisseur Multicellulaire à trois cellules:\vspace{5mm}     \begin{equation*}     \left\{         \begin{array}{cl}         \displaystyle   \dot{v}_{_{C_1}}    &= \displaystyle \frac{u_2(t) - u_1(t)}{C_1} \, i_s(t)\\         \displaystyle   \dot{v}_{_{C_2}}    &= \displaystyle \frac{u_3(t) - u_2(t)}{C_2} \, i_s(t)\\              \displaystyle v_s(t) &= \displaystyle \sum_{k=1}^3 [v_{_{C_k}}(t) - v_{_{C_{k-1}}}(t)]u_k(t)         \end{array}     \right.     \label{eq_mod_inst}     \end{equation*}     \end{block}     \end{minipage}          \begin{block}{Synthèse de la Commande par Modes Glissants}     \vspace{5cm}     \end{block}          \end{frame}     \end{document}      The beginning and the end of the log file are:                   This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded           format=pdflatex 2011.6.19)  25 SEP 2011 21:12     entering extended mode         .         .         .         Overfull \hbox (50.59032pt too wide) detected at line 38         [][][] [][][][][][][][][] [][][][][][][][][] [][][][][][][][][] [][][][][][][][         ][] [][][][][][][]           []              ! Undefined control sequence.         \beamer@frameslide ...duration=}\thispdfpagelabel                                                            {\insertframenumber } \xde...         l.117 \end{frame}              ?


title: XeLaTeX preventing beamer from using different backgrounds

text: I'm having an odd problem---it seems like `XeLaTeX` isn't working so well with `beamer`. I'm using MacTex 2011 and have updated to the latest packages using the TexLive utility. The problem is that compiling with XeLaTeX prevents me from using the `\setbeamertemplate` command more than once. As an example, I would like to have two slides with different backgrounds, say one with a blue gradient and the next with a red gradient. See the following sample code:               \documentclass[12 pt]{beamer}          \begin{document}               \setbeamertemplate{background canvas}[vertical shading][bottom=blue!30, top=white]          \begin{frame}[t]\frametitle{This should have a blue gradient}         Since this is the first instance of \texttt{setbeamertemplate}, it works properly.     \end{frame}            \setbeamertemplate{background canvas}[vertical shading][bottom=red!30, top=white]          \begin{frame}[t]\frametitle{This should have a red gradient}         However, if \texttt{XeLaTeX} is run, this will still show as blue.     \end{frame}          \end{document}      If I compile with PdfLaTeX, then this works as hoped. However, if I compile with XeLaTeX, then BOTH slides have blue gradient backgrounds. The second `\setbeamertemplate{background canvas}` call is ignored. Does anyone have any suggestions for this or an explanation for what's happening?


title: How to control the multirow table to fit in one column?

text: I have a multirow used in twocolumn format. The issue is that when I used some circled characters, the column of the table widened to invade the next column. How can I control the multirow table to fit in one column? ![enter image description here](http://i.stack.imgur.com/6q53J.png)               \documentclass[twocolumn]{article}     \usepackage{multirow}     \usepackage{tikz}          \newcommand*\circled[1]{\tikz[baseline=(char.base)]{                 \node[shape=circle,draw,inner sep=1pt] (char) {#1};}}     \newcommand{\round}[1]{%       \tikz[baseline=(char.base)]\node[anchor=south west, draw,rectangle, rounded corners, inner sep=1pt, minimum size=5mm,         text height=2mm](char){\ensuremath{#1}} ;}          \begin{document}     \centering{     \begin{tabular}{|c|c|c|c|}     \hline     \multicolumn{2}{|c|}{Team sheet} & Node 3 & Node 7 \\     \hline     \multirow{3}{*}{Time 1}       & Nodes & 12\circled{3}45678 & 123456\circled{7}8\\      & In &  \circled{2}\circled{4}\circled{6} & \circled{6}\circled{8} \\      & Out & \circled{3} & \circled{7} \\      \hline     \multirow{3}{*}{Time 2}       & Nodes & 1\circled{2}\circled{3}\circled{4}5\circled{6}78 & 12345\circled{6}\circled{7}\circled{8}\\      & In &  \round{1,2,3}\round{3,4,5}\round{3,6,7}& \round{3,6,7}\\      & Out & \round{2,3,4,6} & \round{6,7,8} \\      \hline     \multirow{3}{*}{Time 3}       & Nodes & \circled{1}\circled{2}\circled{3}\circled{4}\circled{5}\circled{6}\circled {7}8 & 12345\circled{6}\circled{7}\circled{8}\\      & In &  \round{2,3,4,5,6}\round{2,3,4,6}& \round{3,6,7}\\      & Out & \round{1,2,3,4,5,6} & \round{6,7,8} \\      \hline     \end{tabular}     }     \newpage     TeX encountered an unknown command name. You probably misspelled the     name. If this message occurs when a LaTeX command is being processed,     the command is probably in the wrong place---for example, the error     can be produced by an \item command that's not inside a list-making     environment. The error can also be caused by a missing \documentclass     command.     \end{document}


title: Supress initials of authors in biblatex-apa intext

text: I am referring to exactly the same issue as RSoul in his post a while ago: Apacite: suppress initials intext? However, I am looking for a solution with the biblatex-apa using biber- backend. It would be great if you could help me with this one! Just for your convenience, I am citing RSoul with his question as in his post: > I am writing a doctoral thesis and I am using APAcite to set the references > in APA (American Psychological Association) format. Mostly this has worked > perfectly fine, but I would like to suppress the author initials from the > compiled version (in-text, not in the end references section). This happens > because there are multiple authors with the same name e.g., > > Smith and Jones (1992) or Wells and Smith (1901) are typeset in-text as: > > I. Smith and Jones (1992) or Wells and D. Smith (1901). Although it may be > correct to have the initial in-text in APA format, in reality I am using BPS > (British Psychological Society) format, which uses an adapted APA format > (and you guessed it, they don't like the initial in text). Thus in-text > should look like the first example above (without initial) but looks like > the second (with). > > To clarify: Any ideas on how to suppress the initial in-text in apacite? Thanks a lot for your help!


title: Using several math fonts with unicode-math

text: I'd like to typeset a document that uses two different math fonts with `unicode-math`. In the documentation I can't find anything about switching the font mid-document. Just writing               \setmathfont{xits-math.otf} $a$     \setmathfont{lmmath-regular.otf} $a$      does work, but I'm wondering whether this is the correct way to do it when switching between fonts several times in a document.


title: itemize indentation

text: I think you guys know the answer, I tried a lot (`descripition`, `enumerate`) but it all didn't work, so heres my problem: The text after the long items has the correct indentation on the first two lines, but the last, the 3rd. row, has a wrong indentation, so it is far to left, and this looks stupid, here is my code:               \documentclass{book}     \begin{document}     \begin{itemize}     \item short item          \item short item          \item short          \item long item the problem here is, this has the wrong indentation          \item long item, also here, the same        \end{itemize}     \end{document}


title: Why does my PDF render differently in Windows and Linux?

text: I'm not trying anything fancy just a plain vanilla               \title{Practical Node.js  }      However, in Linux the results look great (Document Viewer 3.2.1) ![](http://i.stack.imgur.com/bgTKn.png) In windows it looks absolutely terrible (Adobe Reader 9) ![](http://i.stack.imgur.com/vr5zy.png) Edit: I'm rendering PDFs online using http://www.scribtex.com Edit2: Looks like it may be a problem with my reader on windows. Taking a different PDF compare ![Linux, smooth rendering](http://i.stack.imgur.com/KQCav.png) to ![Windows, blurry font](http://i.stack.imgur.com/78yM2.png) These are the fonts embedded in the document: ![screenshot of the fonts used in the document](http://i.stack.imgur.com/SHPRb.png)


title: Is it possible to italicize journal names and book titles through the .bst file?

text: I am working on an article for a Springer journal, and the specifications for manuscripts clearly ask to italicize all journal names and book titles. Doing it manually feels stupid, so I wonder if there's a way to make the BibTeX style do the trick for me. I am currently using `spbasic.bst` (natbib compatible stuff), and I have no experience in the obscure `.bst` language. Any hints?


title: Which publishers use TeX and friends for a significant proportion of their published books?

text: Which publishers use TeX and derivatives (LaTeX, ConTeXt, and friends) for a significant proportion of their published _books_? Note that I am not asking about journals. I'll leave the interpretation of "significant proportion" open. "Most books within a few subfields" counts; but if it's only "most math, physics, and computer science books" (which will be true in a lot of cases), please indicate so in your answer, as this will help us see which publishers try to use systems from the TeX family _even in fields where (La)TeX doesn't dominate_. **Note: All publishers regardless of size or fame are welcome in answers.** If we need to regroup the answers into categories (such as "university presses", "large international corporation$", "publishers focusing on locale X or language Y"), we can still do that later.


title: It is possible to lock up pdf?

text: I'm searching if it is possible to set permissions in LaTeX code to prevent copy/print/make changes of pdf? And if it is possible to encrypt pdf in LaTeX code?


title: Best solution to present school computing algorithm

text: I need to typeset some computing class algorithms like:               Repeat      Accept Roll_Number     If (the Roll Number has already been added to the absent list) then       Prompt”You have already added the roll number to the absent list”     Else              Continue with the adding process     End if              Connect to the Student’s table of Malpi’s database     Search for the match of Roll_Number     If (the match is found) Then              Display Student’s firstname,middlename,lastname,guardianname,contactnumber     Else              Don’t Display Anything     End If     Until (all the absent students have been added to the absent list)     Open the absent file where the records are to be added     Repeat              If (the student has already been added to the file for that day) Then                       Prompt” The student has already been added to the file”              Else                       Continue              End if     Until (All the Roll_Number in the list have been checked)     Get the record number of the last record in the absent file     Open the absent file where the records are to be added     Repeat             Add 1 to the record number             Save the student’s absent details to the file     Until (the records of all the students are saved in the absent file)      What is the best way to represent this in XeTeX ? I tried using \verbatim package but it seems to break margins ? Is there any good to present this ?


title: Glossaries and mylatexformat incompatible?

text: I'm trying to speed up my big preamble with many packages by using mylatexformat. And I have lots of errors, the majority of which comes from the glossaries package. My MWE:               \documentclass[11pt,onecolumn,twoside,draft,titlepage,fleqn,a4paper,openright]{book}      \usepackage{titlesec}     \usepackage{longtable}     \usepackage{makeidx}     \usepackage[nonumberlist, acronym, toc, section, shortcuts, nopostdot, nogroupskip]{glossaries}     \renewcommand*{\arraystretch}{1.3}  % sets the line indent in glossaries     \setlength{\glsdescwidth}{12.5cm}        \setlength\LTleft{0pt}     \endofdump          \newglossary[slg]{symbols}{syi}{syg}{Nomenclature}     \newglossary[ilg]{indices}{iyi}{iyg}{List of indices}     \makeglossaries          \newacronym{ECD}{ECD}{equivalent circuit diagram}     \newacronym{RES}{RES}{renewable energy source}     \newglossaryentry{Rx1}     {       name={\ensuremath{R_{x1}}},       description={Equivalent series resistance},       sort=Rx1, type=symbols     }     \newglossaryentry{ref}     {       name={*},       description={Indicates reference value},       sort=ref, type=indices     }          \begin{document}     \glsaddall                                     \printglossary[type=\acronymtype, style=long, title=List of Abbreviations and Acronyms]     \printglossary[type=symbols, style=long, title=Nomenclature]     \printglossary[type=indices, style=long, title=List of indices]          \section*{Sample}     \begin{longtable}{ll}     Some & Text     \end{longtable}     \gls{ref}, \gls{ECD}, \gls{Rx1}     \end{document}      The \endofdump command prohibits the "normal" use of Latex, so it should be commented out for normal runs. But it is needed for mylatexformat that should be started from terminal (opened in the same folder as the *.tex file). I've typed the command presented in the makeformat manual in the terminal:               etex -initialize -save-size=20000 -stack-size=20000 -jobname="mlt" "&pdflatex" mylatexformat.ltx """mlt.tex"""      where mlt.tex is the name of the *.tex file and also the name of the supposed *.fmt file (-jobname="mlt"). I've got the *.fmt file mlt.fmt, but as I tried to include it (by %&mlt in the very first line of mlt.tex), I've got no result (and so many errors). I also tried a sample example without glossaries (i.e. many other packages were included, but not this one), and it was successful.


title: How to embed LaTeX symbols in excel sheets

text: I would like to embed LaTeX symbols into Excel worksheets. This basically means each cell entry needs to display equations for example. I know there is a indirect but inconvenient solution of using excel2latex to transform excel tables into LaTeX. But this beats the advantage of having the symbols in the excel sheet, and sorting and manipulating the symbol with other numbers, names and other attributes. Are there any simple workarounds available? I have also looked at IguanaTex but this is only a Powerpoint addin. There are a group of free LaTeX tools available for Microsoft office but there is no indication on whether they support Excel. Maybe I am wrong here, but needs clarification.


title: vertical bar for absolute value and conditional expectation

text: Now I use "mid" for all vertical bars, but I wonder what's the proper ways. The first scenario is vertical bar for absolute value. Now I just right `$x\leq \mid x \mid$`. but is this correct? The second scenario is in conditional expectation. Now I write `E[x \mid y]`, but sometimes if the "x" part is complex, it might be quite "tall", I wonder if there's a way to have a "automatically adjusted" vertical bar. Is there?


title: Authoring RPG books in LaTeX: what packages to use?

text: I am intending on authoring a role playing game (RPG) and was wondering which LaTeX packages I should use. I have most of the useful PDF packages installed: `bookmarks`, `graphicx`, etc.. Pen and paper role playing games have a wide range for formatting mostly adding tables, graphics (images, maps, etc...), and text. The latter can be in-character fiction, generic descriptions, and game rules. Some have layouts that are genra specific (for example, science fiction will have a printed circuit board border between two columns). A good example of layout would be Eclipse Phase which you can get here -- creative commons. The main book layout seems to do most of what I need it to. However, I have seen the `memoir` class that seems to more more suitable but I have had no experience in using it. Does anyone? For indexes, I use the `makeidx` package, is there anything better? Any other suggestions of packages that would be helpful for authoring RPGs? Nothing is wrong with what I am currently using, I am just looking for people who have done the same kind of things for something "better" than the default.


title: How does TeX's mechanism for sorting out quotation marks work?

text: When I enter ```hello''` in TeX, it very nicely reformats it to some nicer version of `"hello"`. The mechanism for this seems to be buried deep down in the depths of TeX (and I can't find it in my usual resource: TeXbyTopic). It _seems_ like a font thing because if I do `\ttfamily` (in LaTeX) to get a monospaced font then this automatic replacement is turned off. I'd really like to turn it back on again, so that with `\ttfamily` I still get `"hello"`. Defining `'` and ``` as active characters seems a little dangerous for this task (though I'm happy to be proven wrong).


title: How to display a code using lstinputlisting that isn't separated with figures?

text: This is the code I used:               \lstinputlisting[language=Python,breaklines=true]{seminar_ED.py}      It works fine with displaying the code over multiple pages when I don't add other figures in the text. But when I do, this code is broken into multiple pieces and separated with those figures. My question is, is there a way to display the code entirely without being separated with figures ? This is how I enter the code for displaying figures:               \begin{figure}[ht,SSDD3]     \makebox[\textwidth][c]{\includegraphics[width=1.17\textwidth]{SSDD3}}%     \label{fig:SSDD3}     \end{figure}      How can I arrange my figures to display before the code, one after another, and then the code to follow the figures in its fullness ? The problem is that the figures are big in size so only one can appear on each page. Optimally, I would like to have top part of a page filled with one figure, and the lower part just blank, without being filled with the Python code.


title: \citep gives me only the first author author

text: If I use `\citep{}` I get > (Hugh et al., 2009) . However, I need > (Hugh Glaser, Afraz Jafri, and Ian Millard, 2009)                 \begin{document}       \usepackage{bibentry}            \end{document}      I do not know how to execute the bibentry package.


title: callout with multiple pointers, how to design it

text: I know, that this question was asked more than year ago (see here), but given answer is limited to callouts without border line. Is there a way to improve there given answer with callout shape with uniform fill and line border? Something like call outs as we can see in comics ... If it possible to design a new kind of callout, for example with following features:               shape: <rectangle multipointer callout> or <ellipse multipointer callout>     number of pointers: <number>     pointer one: <absolute coordinate> or <relative coordinate>     pointer two: <absolute coordinate> or <relative coordinate>     pointer origin offset: <x-offset,y-offset>  % not necessary       I think it would be very useful not just for mee. One of examples of my use of multipointer callouts:               \documentclass[12pt,tikz,border=3mm]{standalone}         \usetikzlibrary{arrows.meta,calc,chains,positioning,shadows,shapes.callouts}     %---------------------------------------------------------------%         \begin{document}     %%%% SA-multipointer-callout     \begin{tikzpicture}[         node distance=5mm and 44mm,         start chain = going right,                C/.style = {callout absolute pointer={#1},                            rectangle callout,                            callout pointer width=1.8 mm, callout pointer shorten=-1mm,                            rounded corners, draw, fill=yellow!30,                            semitransparent, text opacity=1,                            font=\footnotesize, text=teal!40!black, align=center},                L/.style = {line width=1mm, gray,                            arrows={-Stealth[inset=0pt,length=0pt 2,angle'=90]},                            text=black},         N/.style 2 args = {name=n#1,                            text width=#2,                            draw, fill=white, minimum height=9mm, align=center, on chain, drop shadow}                         ]\sffamily     \node[N={1}{21mm}]                  {oddajnik};     \node[name=n2,circle,inner sep=2pt,           fill=white,draw,on chain]     {$+$};     \node[N={3}{21mm}]                  {sprejemnik};     \draw[L]    (n1) edge node[above,pin=above left:signal]    {$y(t)$}                           node[below,black,pin=below left:sporo\v{c}ilo] {$y[n]$}    (n2)                 (n2) edge node[above] {$r(t)=y(t)+ n(t)$}                           node[below] {$r[n]=y[n]+ z[n]$}                 (n3);     \draw[->]   ($(n2.north)+(0,1.1)$)                 node[right,align=left,black] {motnje:  $n(t)$ ali $z[n]$}  -- (n2);     \node[C={([xshift=-7mm] n2.west)},below = of n2]               {komunikacijski\\ kanal};     \node[C={([xshift=+7mm] n2.east)},below = of n2]               {komunikacijski\\ kanal};     \end{tikzpicture}         \end{document}      So far I stacks callouts each on other, but result is quit ugly: ![enter image description here](http://i.stack.imgur.com/aId1q.jpg)


title: usage of \lipsum[] leads to fake examples

text: This is more a comment than a question. I've tried several hours to wrap text around a picture using the `wrapfig` package. Among others, I have relied on Adjusting left/right margins of a wrapfig and Too much space around wrap figure as that is exactly what I am looking for. I could not get it working for one reason - I was using `\blindtext[]` instead of `\lipsum[]`. Interestingly, those examples not running with `lipsum` do not work with "real" input, neither. Have a look at my example:                   \documentclass[10pt,a5paper]{article}         \usepackage[demo]{graphicx}         \usepackage{wrapfig}         \setlength{\parindent}{0pt}              \usepackage{lipsum}         \usepackage{blindtext}         \begin{document}         %########################## works with both lipsum and blindtext AND real text.         \lipsum[1]         %\blindtext[1]         \begin{wrapfigure}[9]{r}{0.5\textwidth}             \centering                 \vspace{-12pt}             \includegraphics[width=0.5\textwidth]{cow.jpg}         \end{wrapfigure}         %\lipsum[1]         \blindtext[1]         %########################## works only on lipsum         \newpage         \lipsum[1]         %\blindtext[1]         \begingroup             \setlength{\columnsep}{8pt}%                 \setlength{\intextsep}{0pt}%             \begin{wrapfigure}[9]{r}{0.5\textwidth}                 \centering         %       \vspace{-12pt}                 \includegraphics[width=0.5\textwidth]{cow.jpg}         %       \includegraphics[width=\linewidth]{cow.jpg}         %       \vspace{+12pt}             \end{wrapfigure}         %\lipsum[1]         \blindtext[1]         \endgroup         \end{document}


title: Append the contents of an environment to a hook using \gappto

text: I have a global hook (=macro) that should be appended to whenever an environment is executed. (Here, defined by the `\bhook`-`\ehook` pair.) However, I was unable to derive a working solution.               \documentclass{article}     \pagestyle{empty}          \usepackage{etoolbox}          \newcommand\myhook{}     \gappto{\myhook}{hooked!}          % How to define these macros?     \newcommand\bhook{\gappto{\myhook}\bgroup}     \newcommand\ehook{\egroup}          % Usage, result should be equivalent to     % \gappto{\myhook}{hook this!}     \bhook{hook this!}\ehook          \begin{document}       \myhook     \end{document}      Compilation of this code results in an error, as does replacing `\bgroup`/`\egroup` with `\begingroup`/`\endgroup` or               {\if0=`}\fi      and               \if0=`{\fi}      Is there a way to replace an environment with a command? No, the `\NewEnviron` from the environ package doesn't work here either. (At least for my special case -- I want to allow pretty much everything inside this environment.) Is this a deficiency in `\gappto`, or why do the "usual tricks" not work? Would this be easier to achieve using `\def` and friends? **EDIT** : To further complicate matters, the `\bhook` and `\ehook` commands are to be embedded in a custom environment:               \NewDocumentEnvironment{testhook}{}{\bhook}{\ehook}


title: OpenType fonts for Metapost Labels

text: Is it possible to use OpenType fonts in MetaPost labels? I use MiKTeX 2.9. I hoped something like `mpost --tex=dvilualatex <myfile>.mp` might work, but no luck. Suggestions? I tried this, but I get an empty box where my label should be, even if I use the default fonts.               \startMPdefinitions     \stopMPdefinitions               \starttext     \startMPpage     beginfig(1);       draw(0, 0)--(200,200);       dotlabel.bot("ABCDEFG", (100,100));     endfig;     \stopMPpage          \stoptext


title: LaTeX Package to generate QR codes?

text: I would like to be able to generate QR barcodes in my LaTeX documents, and I'm having a hard time finding a solution. The use would be a command such as               \qr[1in]{Your text to be QR encoded here}      The optional argument would be the width of the square. I'd be using this to put a barcode on each page of an exam for my students, so that the assignments could be scanned and sorted electronically once they hand them in. Anyone know of such a package? I don't mind using an external script (e.g., python) to generate a graphic that I could include.


title: Custom sibling angle for child nodes

text: As I explored the TikZ manual and available examples; the position of child nodes are defined within the parent node. This means that all child nodes spread on the same radius from the parent with constant angle intervals. How to define the `level dsiatance` and `sibling angle` individually for each child node?               \node[ball color=red,circle] (parent) at (5,5) {Parent}         [level distance=4cm,sibling angle=30,clockwise from=0]         child {node[rectangle,fill=red,color=white]         {e.g. 2cm from parent at angle 0}}         child {node[rectangle,fill=red,color=white]         {e.g. 5cm from parent at angle 20}}         child {node[rectangle,fill=red,color=white]         {e.g. 3cm from parent at angle 60}};      Instead of constant distance from parent and equal angle between child nodes defined in               [level distance=4cm,sibling angle=30,clockwise from=0]      How to define a custom (independent) value for each child?


title: How to substitute one glyph sequence for another with OTF feature files in LuaTeX?

text: I am trying to do some sequence-for-sequence glyph replacement. As far as I can tell from the Adobe spec, the LHS and RHS of a "sub … by …" rule cannot both contain multiple glyphs; and in any case, luatex 0.70.2-2012091206 (from TeXLive 2012) segfaults if I try. Hence, I tried the following:               languagesystem DFLT dflt;     languagesystem latn dflt;          lookup A_TO_O {         sub a by o;     } A_TO_O;          lookup U_TO_O {         sub u by o;     } U_TO_O;          feature test {         sub [t]' e by s;         sub [a]' lookup A_TO_O [u]' lookup U_TO_O;     } test;      along with the following LaTeX input:               \documentclass{scrbook}     \usepackage{fontspec}     \setmainfont[FeatureFile=test.fea,RawFeature=+test;]{Times New Roman}     \begin{document}     A test and baud boud bastard.     \end{document}      I'm trying here to replace "te" with "se" in the first rule, and "au" with "oo" in the second. This does not work; in fact, it doesn't do anything (the first rule doesn't fire). This seems to mean that LuaTeX didn't like it (it does the same thing if I introduce a definite syntax error), but I can't find any error messages. If I comment out the second rule, the first one fires, and I get "sest" instead of "test" in the output.


title: wrapping a rotated table

text: I have a rather wide table that doesn't fit to page width, so I rotated it. The fit is nice, but my idea was to have text wrapped around this rotated table. So far I found two choices that are mutually exclusive. If I use `wraptable`,               \begin{wraptable}{l}{0.3\textwidth}     \begin{sideways}     ...     \end{sideways}     \end{wraptable}      I get a nice flipped and wrapped table, but the caption doesn't follow and it looks weird, having a `0.3\textwidth` caption above a slim table. If I use `sidewaystable`               \begin{sidewaystable}     \begin{tabular}...     ...     \end{tabular}     \end{sidewaystable}      the table and caption looks OK, but it's placed on a new page and I can't figure out how to align it to one of the margins and have text wrapped around it. Question: How to rotate table, caption, push the table to one of the margins and have text wrapped around the sides of the table?


title: Adjust the length of an arrow to that of another arrow in tikz

text: I have created a commutative diagram using tikz, and I feel like I'm nearly there. Here is what I did so far:               \documentclass{standalone}     \usepackage{tikz}     \usepackage{amsmath,amsfonts}     \usetikzlibrary{matrix,arrows}     \begin{document}          \begin{tikzpicture}     \matrix (m) [matrix of math nodes, row sep=1.5em, column sep=2.5em, text height=1.5ex, text depth=0.25ex]       { \mathbb{C}[x_1,...,x_s]/J(f) & \mathbb{C}[x_1,...,x_s]/J(g)\\         \mathbb{C}[x]/\langle J(f),x_{s+1},...,x_n\rangle & \mathbb{C}[x]/\langle J(g),x_{s+1},...,x_n\rangle\\ };       \path[->]         (m-1-1) edge node[above] {$\sim$} (m-1-2)         (m-2-1) edge[dashed] node[above] {$\sim$} (m-2-2);       \draw[transparent]         (m-1-1) edge node[rotate=270,opacity=1] {$\cong$} (m-2-1)         (m-1-2) edge node[rotate=270,opacity=1] {$\cong$} (m-2-2);     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/DQQ0a.png) So far I like it, but is there a way to adjust the length of the arrows (1,1) -> (1,2) and (2,1) -> (2,2)? Ideally, they should both be of the same length, namely that of the lower arrow.


title: Extra page at beginning of appendix containing big figures

text: I have an appendix that contains two full-page figures. The first page of the appendix is always blank except for the title -- I suspect this is a common problem with appendices of full page figures. I narrowed the problem down to a MWE that, as it turns out can be reproduced without appendices at all. Here it is:               \documentclass{article}     \usepackage[top=1in, bottom=1in, left=0.5in, right=0.5in]{geometry}     \usepackage[demo]{graphicx}          \begin{document}          \section{Big Figure}     \begin{figure}[h]         \caption{Big Figure}         \includegraphics[height=0.76\vsize, width=0.4\hsize]{foo.png}     \end{figure}          \end{document}      which yields ![enter image description here](http://i.stack.imgur.com/Gf8V0m.png) Clearly there is enough room to fit this on a single page. Changing to `height=0.75` yields ![enter image description here](http://i.stack.imgur.com/YHtIjm.png) Note the excessive white space below the figure. What is going on here? Why can't this figure be bigger without creating a second page?


title: Handle class options in the order they're given

text: How can I pass options of my package in a specific order to another loaded package?               \ProvidesPackage{L10n}     \DeclareOption{english}{\PassOptionsToPackage{\CurrentOption}{babel}}     \DeclareOption{ngerman}{\PassOptionsToPackage{\CurrentOption}{babel}}     \DeclareOption{others}{% other options are also declared}     \DeclareOption*{\OptionNotUsed}     \ProcessOptions     \usepackage{babel}      Above declaration results in babel being loaded with `english,ngerman` always regardless whether I load `L10n` with               \usepackage[english,ngerman]{L10n}      or               \usepackage[ngerman,english]{L10n}      How can I manage to have the options `ngerman` and `english` in order for babel when loading my package?


title: Successively reveal tree bottom up

text: I am trying build a tree bottom up in a beamer document, i.e. to draw it on screen starting from the most deeply embedded leaves. I've found a lot of Q&As and discussions on how to have trees unfold from the root, on this page and elsewhere, but what I'm trying to do is the reverse, and as far as I can tell many of the methods proposed don't work in this scenario - e.g., I can't seem to suppress a parent node while displaying the children in a standard `tikz`-tree. Ideally, the method would use the size of the complete tree to compute positions all along so that the image doesn't wobble from slide to slide. I'm using `qtree` because it's what I grew up with, but I am very much open to solutions using other packages with different syntax. What I've come up with are the following:   1. Drawing the entire tree (in `qtree` or otherwise), and only revealing the nodes and leaves closer to the root later. Downside: The unlabeled skeleton of the tree remains visible throughout.   2. Copy-pasting different size chunks of the tree, and using overprint to display them on successive slides of the same frame. Downside: The size of the largest, complete tree is inaccessible when the smaller subtrees are drawn, so need an extra step of pushing the smaller trees to the right and bottom to get them anywhere near on top of each other (my snapshot below isn't actually quite there). So what I am looking for is either a variant of (1) that makes the higher edges invisible alongside with the suppressed nodes, or a variant of (2) that automatically extracts the dimensions of the largest tree and uses them as input for the absolute positions of the smaller ones, whichever works. Here's some working code for both approaches:               \documentclass[presentation]{beamer}     \usepackage{qtree, tikz}     \usepackage[english]{babel}     \begin{document}          \begin{frame}{\texttt{qtree}}     \Tree     [.\visible<6>{root}         \visible<6>{\alert<6>{leaf 1}}         [.\visible<5->{level1node}              \visible<5->{\alert<5>{leaf 2}}             [.\visible<4->{level2node}                 \visible<4->{\alert<4>{leaf 3}}                 [.\visible<3->{level3node}                     \visible<3->{\alert<3>{leaf 4}}                     [.\visible<2->{level4node}                         \visible<2->{\alert<2>{leaf 5}}                         [.{level5node}                             \alert<1>{leaf 6}                             {leaf 7}                          ]                      ]                  ]              ]          ]      ]     \end{frame}          \begin{frame}{overprint version}          This is my tree:     \vskip0pt plus 1filll     \begin{flushright}          \begin{overprint}     \onslide<6>     \Tree     [.{root}       {\alert<6>{leaf 1}}       [.{level1node}          {\alert<5>{leaf 2}}         [.{level2node}             {\alert<4>{leaf 3}}             [.{level3node}                 {\alert<3>{leaf 4}}                 [.{level4node}                     {\alert<2>{leaf 5}}                     [.{level5node}                         \alert<1>{leaf 6}                         {leaf 7}                      ]                  ]              ]          ]        ]      ]          \onslide<5>     \Tree       [.{level1node}          {\alert<5>{leaf 2}}         [.{level2node}             {\alert<4>{leaf 3}}             [.{level3node}                 {\alert<3>{leaf 4}}                 [.{level4node}                     {\alert<2>{leaf 5}}                     [.{level5node}                         \alert<1>{leaf 6}                         {leaf 7}                      ]                  ]              ]          ]        ]           \onslide<4>     \Tree         [.{level2node}             {\alert<4>{leaf 3}}             [.{level3node}                 {\alert<3>{leaf 4}}                 [.{level4node}                     {\alert<2>{leaf 5}}                     [.{level5node}                         \alert<1>{leaf 6}                         {leaf 7}                      ]                  ]              ]          ]           \onslide<3>     \Tree             [.{level3node}                 {\alert<3>{leaf 4}}                 [.{level4node}                     {\alert<2>{leaf 5}}                     [.{level5node}                         \alert<1>{leaf 6}                         {leaf 7}                      ]                  ]              ]           \onslide<2>     \Tree                 [.{level4node}                     {\alert<2>{leaf 5}}                     [.{level5node}                         \alert<1>{leaf 6}                         {leaf 7}                      ]                  ]           \onslide<1>     \Tree                     [.{level5node}                         \alert<1>{leaf 6}                         {leaf 7}                      ]           \end{overprint}     \end{flushright}          \end{frame}     \end{document}      # Edit: On the basis of Lay's answer, I managed to create the following branching tikz tree which comes close, but I'm still not quite happy: the edge that connects the currently displayed subtree to the rest of the tree is shown too early - I get a funny tail towards the rest of the tree that doesn't yet exist. If I adapt the position of the `tikzstyle`-change, the edges are drawn too late:               \begin{frame}     \begin{tikzpicture}     \tikzstyle{lvl0}=[transparent]     \tikzstyle{lvl1}=[transparent]     \tikzstyle{lvl2}=[transparent]     \tikzstyle{lvl3}=[transparent]     \tikzstyle{lvl4}=[transparent]     \tikzstyle{lvl5}=[opaque]     \only<2->{\tikzstyle{lvl4}=[opaque]}     \only<3->{\tikzstyle{lvl3}=[opaque]}     \only<4->{\tikzstyle{lvl2}=[opaque]}     \only<5->{\tikzstyle{lvl1}=[opaque]}     \only<6->{\tikzstyle{lvl0}=[opaque]}     \node [lvl0] {root}     child [lvl0] { node {leaf 1} }     child [lvl1] { node {lvl1}      child { node [lvl1] {leaf 2} }      child [lvl2]{ node {lvl2}       child { node [lvl2] {leaf 3} }       child [lvl3] { node {lvl3}         child { node [lvl3] {leaf 4} }         child { [lvl4] node {lvl4}           child { node [lvl4] {leaf 5} }           child { [lvl5] node {lvl5}             child { node [lvl5] {leaf 6} }             child { node [lvl5] {leaf 7} }             }           }         }       }     };     \end{tikzpicture}     \end{frame}


title: Depending on the edition, but in the same language, I want different kind of quotes

text: When I write ```something''`, I want the output to be one of the following inside the whole document, just changing one setup in the preambul:   * "something"   * « something »   * “something” One solution is to use `«` `»` everywhere in normal text, and use _sed_ to output the different editions. But I wonder if there is a _LyX_ or _LaTeX_ smart solution. I have had a look at the package _csquotes_ , but I don't figure out if I can do it with it or not.


title: Is it possible to alt+space instead of ~ to produce a non-breaking space in LaTeX on osx?

text: I learnt recently that `alt+space` produces a non-breakable space on macs, and I would like to be able to use it with LaTeX, if possible. Here is the error I get so far: > Package inputenc Error: Unicode char \u8: not set up for use with LaTeX. Here is my code:               \documentclass{article}     \usepackage[utf8]{inputenc}     \begin{document}     En Français, on met une espace devant :% the non-breakable space is before the ":"     les deux points.     \end{document}


title: Indent/leftmargin of itemize environment without using enumitem

text: I would like to have a smaller left margin or indent for the `itemize` environment. Currently, I tried so far `\leftmargin` and `\itemindent` but I did not affect the following lines of an entry. Does anyone know how to setup the `itemize` environment correctly without using `enumitem`?


What is the command that I can used to remove unnecessary space between text and figure on same page? Below command doesn't do anything               \newcommand{\squeezeup}{\vspace{-2.5mm}}


title: Adding arrows connecting foreign keys in relations using latex

text: How can I create arrows connecting the foreign keys to the corresponding primary key in LaTeX? The end result I'm trying to achieve is this: ![](http://i.stack.imgur.com/p6isJ.pngp6isJ.png) What is the best way to do this in LaTeX (I'm still new to the subject. Is there some practical way, or is it better to create this in another program and import it as image (or PDF?)


title: Different font sizes for different rows

text: I want to put different sizes of fonts (smaller) into different rows of my LaTeX table. I found that it is possible to have different font sizes for different columns of this post. Is there any simple way to put different fonts to LaTeX table rows ?


title: Strangely abbreviated Russian BibTeX entry name

text: I have following BibTeX entry:               @MISC{KaraMurzaBatchikovGlazyev2002,     author       = {Кара-Мурза, Сергей Георгиевич and Батчиков, С. А. and Глазьев, Сергей Юрьевич},      title        = {Белая книга. Экономические реформы в России 1991-2001},      year         = {2002},      url          = {http://bit.ly/1lpALQZ}     }      Here's the transliterated version:               @MISC{KaraMurzaBatchikovGlazyev2002,     author       = {Kara-Murza, Sergey Georgievich and Batchikov, S. A. and Glazyev, Sergey Yurevich},      title        = {Belaya kniga. Ekonomicheskie reformy v Rossii 1991-2001},      year         = {2002},      url          = {http://bit.ly/1lpALQZ}     }      I expected the abbreviated name of that entry to be something like `Кара-Мурза et al. (2002)` (`Kara-Murza et al. (2002)`), but it is rendered as `[Кара- Мурза et al.(2002)Кара-Мурза, Батчиков, and Глазьев]` (`Kara-Murza et al. (2002)Kara-Murza, Batchikov, Glazyev`). ![Bibliography](http://i.stack.imgur.com/PuIja.png) How should I change the BibTeX and/or the LaTeX file in order for the abbreviated version to appear as either   1. `Кара-Мурза et al. (2002)` or   2. `Кара-Мурза, Батчиков, and Глазьев (2002)` ? Here's the start of the document:               \documentclass[a5paper,pagesize,10pt,bibtotoc,pointlessnumbers,normalheadings,DIV=9,twoside=false]{scrbook}          \usepackage[a5paper]{geometry}          \usepackage{cmap}     \usepackage[T1,T2A]{fontenc}     \usepackage[russian]{babel}          \usepackage{pdfpages}          \usepackage[utf8]{inputenc}          \linespread{1.05}           \usepackage{graphicx}          \usepackage[toc,page]{appendix}          \usepackage{tabularx}          \usepackage{csquotes}          \newcommand{\q}[1]{>>\textit{#1}<<}          \title{...}     \author{Дмитрий Писаренко}      \date{\today}                \renewcommand{\appendixtocname}{Приложения}     \renewcommand{\appendixpagename}{Приложения}          \begin{document}          \includepdf[pages={1}]{cover/2014_01_11_sviz_cover.pdf}          \input{titlepage}               \tableofcontents          \input{_text}          \bibliographystyle{plainnat}     \bibliography{references}               \end{document}


title: Use \addbibresource via a script

text: Is there some way to use `\addbibresource` with biblatex to fetch a remote bibliography (in my case from CiteULike), but piping it through a script first? The output from CiteULike isn't perfect for what I need, so at the moment I use a bash script to grab it, pipe it through sed to strip out junk and correct a few things, and then standard BibTeX to assemble the bibliography for me. A minimum working example doesn't seem to make sense in this case, so I'll pin my script instead.               #!/bin/bash          curl "http://www.citeulike.org/bibtex/user/MarkEveritt/tag/nv_notes" | sed \     -e 's/pages = {\(.*\)-.*--.*-.*},/pages = {\1},/' \     -e 's/pages = {\(.*\)+},/pages = {\1},/' \     -e 's/comment =/note =/' \     -e 's/\\\$/$/g' \     -e 's/\(^.*title.*\)\\_/\1_/' \     -e '/^[ ]*abstract.*/d' \     -e '/^[ ]*citeulike-.*/d' \     -e '/^[ ]*priority.*/d' \     -e '/^[ ]*posted-at.*/d' \     -e '/^[ ]*keywords.*/d' \     > bibliography.bib


title: Displaying pinyin over Chinese characters, without impacting word spacing

text: I want to display pinyin (romanized form) over Chinese characters. However, the two methods I know (using `stackrel` or `tabular` both change the spacing between characters. This demonstrates the problem:               \documentclass[a5paper]{article}     \usepackage{ctexcap}     \usepackage{stackrel}     \setCJKmainfont{Adobe Heiti Std}     \newcommand{\mymacroone}[1]{$\stackrel{a}{\textrm{#1}}$}     \newcommand{\mymacrotwo}[1]{\begin{tabular}{l}a\\#1\end{tabular}}     \begin{document}         \Huge \noindent 床前明月光，疑是地上霜。举头望明月，低头思故乡。 \\         \mymacroone{床}\mymacroone{前}\mymacroone{明}\mymacroone{月}\mymacroone{光}，\mymacroone{疑}\mymacroone{是}\mymacroone{地}\mymacroone{上}\mymacroone{霜}。\mymacroone{举}\mymacroone{头}\mymacroone{望}\mymacroone{明}\mymacroone{月}，\mymacroone{低}\mymacroone{头}\mymacroone{思}\mymacroone{故}\mymacroone{乡}。 \\         \mymacrotwo{床}\mymacrotwo{前}\mymacrotwo{明}\mymacrotwo{月}\mymacrotwo{光}，\mymacrotwo{疑}\mymacrotwo{是}\mymacrotwo{地}\mymacrotwo{上}\mymacrotwo{霜}。\mymacrotwo{举}\mymacrotwo{头}\mymacrotwo{望}\mymacrotwo{明}\mymacrotwo{月}，\mymacrotwo{低}\mymacrotwo{头}\mymacrotwo{思}\mymacrotwo{故}\mymacrotwo{乡}。 \\     \end{document}      Each of the three lines should be displaying the same.   * With `stackrel`, the words are spaced too closely together. This problem is not created by `stackrel`. It is from having math mode with `textrm{}` inside.   * With `tabular`, the words are spaced too far apart, they do not properly break at the end of the line, and it has a strange vertical and horizontal alignment problems. Using `stackrel` would be ideal. How can I place pinyin above Chinese characters without changing the spacing between the characters (at least in situations where the pinyin is shorter than the characters)?


title: How to insert three Chinese characters?

text: I am a rank novice in TeX. I read an earlier TeX question about how to display Chinese characters but it seemed to be in context of an article entirely in Chinese. My document is an English article in TeX, and I only want to insert three Chinese characters. Can someone tell me how to format it?


title: Detect misplaced label in figure

text: I realized that I sometimes write :               \begin{figure}        ...        \label{fig:foo}        \caption{Bla}     \end{figure}      instead of:               \begin{figure}        ...        \caption{Bla}        \label{fig:foo}     \end{figure}      Which results in wrong reference numbers. Is there an easy way to catch all these errors?


title: Put (ed) at the end every time (verbose-trad) and first inits problem

text: I'm using `biblatex` with `verbose-trad2` option and I'm trying to change the way names are printed. I want to have (dir.) (= (ed)) at the end of editor's name (for proceedings or collection). It works except when you cite another time the reference. I get > A. Delapierre et F. Grivois, Ceci est... op. cit. but I would like to have > A. Delapierre et F. Grivois (dir.), Ceci est... op. cit. like the first time it appears... Besides, I'm not sure of my tricks to put first inits...               %%%%%%%%%%% latex code %%%%%%%%%%%%%%%          \documentclass[twoside,12pt,a4paper]{book}     \usepackage[latin1]{inputenc}     \usepackage[T1]{fontenc}     \usepackage{lmodern}     \usepackage{tikz}     \usepackage{fix-cm}     \usepackage[frenchb]{babel}     \usepackage[babel]{csquotes}     \usepackage{hyperref}     \usepackage{filecontents}     \hypersetup{colorlinks=true, citecolor=black, filecolor=black, linkcolor=black, urlcolor=black, bookmarks=true}               \usepackage[style=verbose-trad2, hyperref,backend=biber,     language=french, maxnames=10 %%%% nom max after and al.     ]{biblatex}          \FrenchFootnotes          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% BIBLATEX reparametrage     %%%%% first inits then name     %%%%%%%%%%%%%     \DeclareNameFormat{labelname}{%       \ifcase\value{uniquename}%           {\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}         \or           \ifuseprefix             {\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}             {\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%       \or         \usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%       \fi       \usebibmacro{name:andothers}}          %%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%% in the bibliography Name, First Name  and Name, First Name...     \DeclareNameAlias{last-first/first-last}{last-first}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%%%%%%%%%%% modified to put (dir.) at the end, see also byeditor+others %%%%%%%%%%%%     \renewbibmacro*{editor+others}{%       \ifboolexpr{         test \ifuseeditor         and         not test {\ifnameundef{editor}}       }         {\printnames{editor}%          \setunit{\addspace}%                        \usebibmacro{editor+othersstrg}             \clearname{editor}}         {}}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%%%%% put (dir.) at the end (byeditor)      %     \renewbibmacro*{byeditor+others}{%       \ifnameundef{editor}         {}         {%%%\usebibmacro{byeditor+othersstrg}       %%%% suppress          \setunit{\addcomma\addspace}%          \printnames[byeditor]{editor}%          \setunit{\addspace}%         % \addspace                                  %%%% suppress     %     \usebibmacro{byeditor+othersstrg}          %%%%           \usebibmacro{editor+othersstrg}             %%%%           \clearname{editor}%            %%%%%%%%%           \newunit     }%       \usebibmacro{byeditorx}%       \usebibmacro{bytranslator+others}}          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \DefineBibliographyStrings{french}{     opcit = \iffieldequalstr{entrytype}{inproceedings}{art\adddotspace cit\adddot}{             \iffieldequalstr{entrytype}{article}{art\adddotspace cit\adddot}{\emph{op\adddotspace cit}\adddot}},  %%%%%%%%%%%% french subtilities     idem = {\emph{idem}},     ibidem = {\emph{ibid\adddot}},     editor = {\mkbibparens{dir.}},          %%%%%%%%%%%% (dir.) instead of ed. by default     editors = {\mkbibparens{dir.}},         %%%%%%%%%%%% (dir.) instead of eds. by default     }%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%          %%%%%%%%%%%%%%%% new in     \newbibmacro*{in:}{%       \printtext{%         \bibstring{in}\nopunct\addspace}}   %%%%%%%%%%%%%% we suppress :      %%%%%%%%%%%%%%%%% comma between reference     \renewcommand*{\newunitpunct}{\addcomma\addspace} %      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%               \begin{filecontents}{\jobname.bib}          @PROCEEDINGS{delap,       editor = {Delapierre, André and Grivois, François},       title = {Ceci est une aventure},       shorttitle = {Ceci est...},       publisher = {Bordas, Paris},       year = {2011}     }          @BOOK{desmont,       author = {Desmont, Laurence},       title = {Chansons contemporaines},       shorttitle = {Chansons...},       publisher = {Belin},       year = {2000}     }     \end{filecontents}          \addbibresource{\jobname.bib}               \begin{document}          \section*{Test}          \cite{delap}          \cite{desmont}          \cite{delap}          \nocite{*}     \printbibliography               \end{document}


title: Different line numbers for two procedures in similar algorithm

text: I have following algorithm with two different procedures (i.e., phases) and want to give separate line numbers to both of them. Can any body help me out please? Thanks...               \documentclass[10pt,a4paper]{IEEEtran}     \usepackage{algorithmic}     \usepackage{algorithm}     \begin{document}          \begin{algorithm}     \caption{Boundaries calculation and rank computation}     \label{abc}     \begin{algorithmic}[1]          \STATE Phase 1: Compute boundaries     \STATE computer abc     \STATE calculate bcd          \STATE Phase 2: rank computation     \STATE compute wxy     \STATE calculate xyz          \end{algorithmic}     \end{algorithm}     \end{document}


title: Texstudio Environment frontmatter undefined

text: I am using TEXstudio. I am getting the following error Environment frontmatter undefined. \begin{frontmatter}


title: How do I remove the chapter number from my Index 'chapter' in the ToC?

text: A professional indexer has done an index for my book. I have created a new index chapter, pasted and formatted the index into it's own chapter. When I compile the book the ToC includes the Index with a chapter number e.g. > 10 Last Chapter.....400   >  Bibliography.........410   >  11 Index...............415 I want it to look like this: > 10 Last Chapter.....400   >  Bibliography..........410   >  Index....................415 That is with no chapter number. Here is my MWE with some packages that my be pertinent:               \documentclass[paper=6.125in:9.25in,pagesize=pdftex,10pt]{scrbook}     \areaset[0.375in]{4.5in}{8in}     \KOMAoptions{numbers=noendperiod} % get rid of last dot in eg Figure 3.1.      \usepackage{natbib} % style bibliograprhy (citations)     \usepackage{tocloft}     \setlength{\cftsecnumwidth}{2.5em} % this adds a gap in 13.10 and 13.11     \begin{document}     \frontmatter     \mainmatter     \tableofcontents     \include{somechapter}     \bibliographystyle{ieeetr}     \raggedright     \clearpage     \addcontentsline{toc}{chapter}{Bibliography}     \bibliography{somebibdeskfile}     \include{index}      \end{document}


title: mdframed and ntheorem counters

text: In the code below, counters defined by `mdframed` seem to not be accessible to `ntheorem` environments which is problematic but `ntheorem` counters can be read by `mdframed`. I could not find a work around and it looks like this limitation is not referenced anywhere.               \documentclass[fleqn,11pt]{book}     \usepackage{amsmath}     \usepackage[amsmath]{ntheorem}     \usepackage[ntheorem,framemethod=TikZ]{mdframed}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %\newmdtheoremenv{theorem}{Theorem}    % uncomment this line     \newtheorem{theorem}{Theorem}[chapter] % comment this line     \newtheorem{definition}[theorem]{Definition}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \begin{document}     text text text text text text text text text text text text       \begin{definition}[Definition]     text text text text text text text text text text text text       \end{definition}     text text text text text text text text text text text text       \begin{theorem}[Theorem]     text text text text text text text text text text text text       \end{theorem}     text text text text text text text text text text text text       \end{document}


title: Aligning linear systems of equations

text: > **Possible Duplicate:**   >  Best way to create an system of equations enviroment? What do I need to do to get my systems of linear equations to align at each of the addition/subtraction/equals signs without manually adding silly things like \phantom{2} in front of variables with coefficient 1? Here's a general example where the + signs in the last equation are not vertically aligned with the + signs in the first two equations (not to mention the fiddling I did to get the vertical dots to be in a reasonable place):               \begin{align*}        a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n & = b_1 \\        a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n & = b_2 \\        \hspace{1in}\vdots \hspace{.8in} \\        a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n & = b_m \\     \end{align*}      A more specific example:               \begin{align*}     x_1 + x_2 + 2x_3 &= 8 \\     -x_1 -2 x_2 + 3x_3 &= 1 \\     3x_1 -7 x_2 + 4x_3 &= 10 \\     \end{align*}      Should I just give up on align and use array?


title: TortoiseHg with word diffs and LaTeX

text: I am having a hard time figuring out how to configure TortoiseHg to do colored word diffs for my TeX and LaTeX documents. I found the following two threads   * How to use Mercurial for version control of text documents?   * Good strategy for line breaks with paragraphs of LaTeX source but they don't go in detail how to to set this up on TortoiseHg. I was wondering if anybody in the TeX/LaTeX community has figured this out already?


title: blank lines in user-defined lists in htlatex

text: Consider the following latex code:               \documentclass{article}     \begin{document}     \begin{list}{*}{}     \item one     \item two     \end{list}     \end{document}      It should produce:   * one   * two But the htlatex output has blank lines before "one" and before "two". Any ideas about how to fix this? Also, consider the following code:               \documentclass{article}     \usepackage{tex4ht}     \begin{document}     \begin{list}{*}{}     \item one     \item two     \end{list}     \end{document}      pdflatex outputs blank lines before "one" and "two" plus "xx" before everything.


title: Algorithm : Command \end{list} invalid in math mode

text: I just started with Latex and I struggle a little bit with algorithm. Here is the algorithm, I try to show. But on the line of the first ENDFOR, I have this error Latex Error: `Command \end{list} invalid in math mode` I don't seewhat's wrong with this. Thank you for your help.               \begin{algorithm}     \caption{Algorithme de Dijkstra}     \begin{algorithmic}[1]     \REQUIRE Un graphe $G$     \REQUIRE Un noeud source $s$     \ENSURE Les plus court chemins de s vers tout les autres noeuds de G $A$     \FORALL{$v \in V[G]$}         \STATE $d[v] \leftarrow +\infty$          \STATE $previous[v] \leftarrow undefined     \ENDFOR     \STATE $d[s] \leftarrow 0     \STATE $S \leftarrow empty set     \STATE $Q \leftarrow $V[G]     \Loop Q is not an empty set          \STATE $u \leftarrow  Extract_Min(Q)         \STATE $S \leftarrow  S union $u         \ForAll{edge (u,v) outgoing from u}           \IF{d[u] + w(u,v) < d[v]}             \STATE d[v] \leftarrow d[u] + w(u,v)             \STATE previous[v] := u          \ENDIF         \EndFor     \EndLoop     \end{algorithmic}     \end{algorithm}


title: ConTeXt xtables never \def'ed

text: I am new of ConTeXt. I want to use xtables but I get an error: \startxtable was never \def'ed. Am I forgetting some very basic thing?               \starttext     \startxtable[width=4cm]       \startxrow          \startxcell one \stopxcell          \startxcell two \stopxcell        \stopxrow        \startxrow           \startxcell alpha \stopxcell           \startxcell beta  \stopxcell         \stopxrow     \stopxtable     \stoptext


title: tikz edges too long, how to control the distance of nodes

text: I have in a beamer class document the following graph:                 \begin{center}            \begin{tikzpicture} [auto]         \tikzstyle{every node}=[font=\small]         \tikzset{           inst/.style={draw=black, rectangle},           ref/.style={draw=black, circle}         }         \node[inst]                       (constant1) {ConstantNode};         \node[right = of constant1]         (dummy1) {};         \node[inst, right = of dummy1]       (constant2) {ConstantNode};              \node[ref, below = of constant1]    (v1) {$v_1$};         \node[below = of dummy1]            (dummy2) {};         \node[ref, below = of constant2]    (v2) {$v_2$};              \node[inst, below = of dummy2]       (phi) {$v_3 = \phi(v_1, v_2)$};         \node[ref, below = of phi]          (v3) {$v_3$};             \node[inst, below = of v3]          (invoke) {MethodCallNode: $v_5$ = java/lang/String.substring(I), $v_3$, $v_4$};         \node[ref, below = of invoke] (v5) {$v_5$};             \node[inst, below = of v5] (return) {ReturnNode $v_3$};                   \draw[->] (constant1) to (v1);         \draw[->] (constant2) to (v2);         \draw[->] (v1) to (phi);         \draw[->] (v2) to (phi);             \draw[->] (phi) to (v3);             \draw[->] (v3) to (invoke);             \draw[->] (invoke) to (v5);             \draw[->] (v5) to (return);                \end{tikzpicture}       \end{center}      but the edges are too long, so the graph does not fit to the page. How can I make them shorter?


title: emacs whizzytex latex options, minted, -shell-escape

text: I want to use whizzytex with emacs because of its superior speed compared to other wysiwyg options available. The only thing preventing me from doing so is that my latex documents use the minted package for source code highlighting. Minted requires latex to be run with the -shell-escape flag and I do not see how to instruct whizzytex to run latex with this flag. For example, using               %; whizzy -latex "latex -shell-escape"      does not seem to work. How can I make whizzytex work with the minted module?


title: Equation Alignment With Steps

text: I'm trying to show all of the steps for solving a linear equation like this:               \begin{aligned}     -4(6x - 5) & = 188 \\     (-4*6x)+(-4*-5) &  \\     -24x + 20 & = 188 \\     -20 & = -20 \\     -24x & = 168 \\     /-24 & = /-24 \\     x & = -7     \end{aligned}      This renders as I would expect it to, but if I remove the = sign from the -20 step (and /-24), the -20 no longer aligns correctly on the right side. Is there any way to have it still align without putting the equals sign in there? Thanks!


title: How to write a pretty \not \varepsilon

text: How can I write a pretty `\not\varepsilon`? I want something like `\notin`, since I use `\varepsilon` as a relation symbol like `\in`.


title: Unable to Change References Section Title in moderncv

text: I'm attempting to write a CV using the moderncv document class with the following preamble:               \documentclass[10pt,letter]{moderncv}          % CV Theme Settings          \moderncvtheme[black]{classic}          % Font and Typography Settings          \usepackage[english]{babel}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[babel=true]{microtype}          ....      For my publications, I have the following code:               \nocite{*}     \bibliographystyle{plainyr}     \bibliography{publications}      When I typeset my CV using the `pdflatex` and `bibtex` dance, my publications show up under the head References. Does anyone know how to change the section heading to Publications? I tried placing a section manually as follows:               \section{\textbf{Publications}}     \nocite{*}     \bibliographystyle{plainyr}     \bibliography{publications}      but this only places an empty Publications section and then a section titled References. Thank you kindly in advance.


title: Background color for existing floats (e.g. w/o defining a new environment)?

text: I'm trying to make all my figures (including caption) backgrounded with a decent color. I already found these questions with some nice answers:   * _How to set a background color of figure environment?_   * _Rounded corner colored box around figure_   * _Background color boxes around complete figure in LaTeX_ But all these answers have in common that they define some new environments or commands that need to be put inside the figures or replace the figures completly. **Is there a way to put a background color behind _existing_ floats without having to change the content of these existing floats?**


title: Pros and cons: pdflatex+gs vs gs+pdflatex

text: I need to be producing two versions of documents I deal with: colour and grayscale. Of course the real issue are images. I'm not the author of the documents nor the images, I'm only the typesetter.   * So far I use the following quite complicated procedure that can be called **gs+pdflatex** :     1. Convert all images to PDF (`epstopdf`, `convert`).     2. Put them in sub directory `figures/`.     3. Using `gs` (GhostScript) convert _the images_ to grayscale to directory `figuresbw/`.     4. By different `\graphicspath{}` control which ones will be used.   * However, there is the other option that can be called **pdflatex+gs** :     1. Don't care at all about image types, pathes etc.     2. Run `pdflatex` to get the colour version.     3. Using `gs` (GhostScript) convert _the document_ to grayscale. Obviously the second option is easier to perform, but I have a bad feeling that there must be some drawbacks. So the question: What are the drawbacks of using one option or the other? * * * My `gs` command:               nice gs \       -sOutputFile=$outfile.pdf \       -sDEVICE=pdfwrite \       -sColorConversionStrategy=Gray \       -dProcessColorModel=/DeviceGray \       -dAutoRotatePages=/None \       -dCompatibilityLevel=1.4 \       $infile.pdf < /dev/null;


title: How to break text in subsection heading in Beamer using Copenhagen theme?

text: \documentclass[hyperref={pdfpagelabels=false}]{beamer}      \usetheme{Copenhagen}      \begin{document}      \title[Title]{}      \author[Author]{}      \institute[Test]{}      \date{\today}      \subject{Informatics}      { \begin{frame}      \titlepage      \end{frame} }      \section{Introduction}      \subsection{Test subsection with a really long title and some additional words for the example}      \begin{frame}      \frametitle{Table}      Test Section      \end{frame}      \end{document}


title: How can I change the indent of the row numbers in my tabular environment?

text: I'm using tabular to align numbers, answer choices basically. Each row is numbered (A), (B), etc. Is there any way to decrease the space between the row label and the first column?               \newcounter{ans}     \renewcommand\theans{\Alph{ans}}     \newcommand\anslabel{(\theans)}          \setcounter{ans}{0}     \begin{tabular}{@{}>{\stepcounter{ans}(\theans)}lrr@{.}l}     &$-2$ \\     &$-1$ \\     &$0.8$ \\     &$1$ \\     &$2.3$ \\     \end{tabular}


title: PgfPlots column name with multiple words

text: I have a simple data file consisting of two columns (x and y coordinates). I would like the first row of the file to be the names for the columns. I would like the user to have the option to specify the column names however he/she sees fit, including multiple words for one column. An example:               Number of points    Values     10    100     20    400     30    1200     40    2345     etc...      I can get this to work (as expected) when using single words for column names but as soon as I introduce multiple words I can not get latex to compile. I've tried the following in my latex:               \addplot table [only marks, x={Number of Points}, y={Time}] {...}     \addplot table [only marks, x=${Number of Points}$, y=${Time}$] {...}     \addplot table [only marks, x="Number of Points", y=Time] {...}      I've tried other variations as well and no luck. I keep getting the error: "Sorry, could not retrieve 'Number of Points' from table..." Any thoughts would be GREATLY appreciated.


title: How to get the sum of all sections and subsections in beamer

text: I want to determine how many pages I need for my toc which will be displayed in two coloumns with 10 (sub)sections each page. So if I had 8 sections and 20 subsections the code should return 28. _Edit:_ If someone knows a solution with only one run it's highly appreciated.


title: Align columns of text

text: So basically what I am trying to achieve is something like the following...               Mobile      :  +12 111 111 111      Email     :  something@something.com     Phone       :  +12 111 111          Website   :  http://www.something.com     Nationality :  Somenationality      Birthdate :  xx/xx/xxxx      keeping the blocks of text together for every line. I don't really know how to tackle that problem. The trick is to keep the `:` together in a row, keep the same spacing between Mobile Information and the Email title for example and keep that space for the three lines. What would be the right solution to get this nicely together... so far I solved it like this but it doesn't really work that great                 \begin{center}         {\LARGE \textbf{My Name}}\\         \textnormal{xx, rue du XX \ \ X-XXXX XXXXXX} \\[3mm]         \par\noindent\parbox{1.3cm}{Mobile}\parbox{0.2cm}{:} \parbox{3.5cm}{+122 111 111 111} \hspace{0.01cm} \parbox{1.3cm}{Email}   \parbox{0.2cm}{:} \parbox{3.5cm}{something@something.com}\\         \par\noindent\parbox{1.3cm}{Phone} \parbox{0.2cm}{:} \parbox{3.5cm}{+122 111 111}     \hspace{0.01cm} \parbox{1.3cm}{Website} \parbox{0.2cm}{:} \parbox{3.5cm}{http://www.something.com}\\         \par\noindent\parbox{1.3cm}{Nat.}  \parbox{0.2cm}{:} \parbox{3.5cm}{Somenationality}    \hspace{0.01cm} \parbox{1.3cm}{Birthdate}\parbox{0.2cm}{:} \parbox{3.5cm}{xx.xx.xxxx}\\       \end{center}


title: Wide figures to spill out into the outer, not inner, margin in double-sided documents

text: I'm writing a text where I have some figures that need to be wider than the text width, and I want then to spill out into the outer (in my text, rather wide) margin. I have tried a solution which I found in a previous question here, but I can't make it work. I copied the code in Place figures side by side, spill into outer margin and modified it to:               \usepackage{ifoddpage}          \begin{figure}       \checkoddpage       \edef\side{\ifoddpage l\else r\fi}%       \makebox[\textwidth][\side]{\includegraphics[width=1.4\textwidth]{wide_image}}          \caption{xxx}       \label{fig:1}     \end{figure}      This makes figures behave the correct way on odd pages (they are left-aligned with text), but not on even pages (where they are still left-aligned with the text, making them spill into the inner margin instead)? I'm using the "report" class.


title: texcl and range prefixes in listings with shorter comments

text: I'm trying to use the line range markers from the `listings` package to include sections of code. I'd previously been using actual line numbers, but based on the answer to this question, I've been able to gradually transition to using markers. It seems that if multiple line comment sequences have been defined (e.g., with `comment=[l]{;},morecomment=[l]{;;}`) as is sometimes necessary (see this answer), and the `texcl` option is used, then line range prefixes that are comments must include the longest such comment form. For instance, the following MWE defines `;` and `;;` as introducing comments, and uses the `texcl` option, but does not compile.               \documentclass{article}     \usepackage{listings}          \begin{document}          \lstset{%       texcl=true,%       comment=[l]{;},%       morecomment=[l]{;;},%       rangeprefix=;MARK\ ,%       includerangemarker=false,%     }          \begin{lstlisting}[linerange=lineTwo-lineFour]     lineOnee     ;MARK lineTwo     lineThree     ;MARK lineFour     lineFive     ;MARK lineSix     lineSeven     \end{lstlisting}          \begin{lstlisting}[linerange=5-7]     lineOne     ;MARK lineTwo     lineThree     ;MARK lineFour     lineFive     ;MARK lineSix     lineSeven     \end{lstlisting}          \end{document}      The error is ERROR: Undefined control sequence.               --- TeX said ---     \lst@next ->\lst@c;1 M          l.26 ;M            ARK lineFour     --- HELP ---     TeX encountered an unknown command name. You probably misspelled the     name. If this message occurs when a LaTeX command is being processed,     the command is probably in the wrong place---for example, the error     can be produced by an \item command that's not inside a list-making     environment. The error can also be caused by a missing \documentclass     command.      Commenting out the `texcl=true` option will make this example compile, but I need the `texcl` option. Alternatively, changing the rangeprefix to `;;MARK\` (and updating the listed code appropriately) also works, and is the workaround I'm using. I am fine with this workaround, but I'm wondering whether there is a way to use `texcl`, `;` and `;;` as comments, and have a range prefix begin with a single `;`.


title: make enumerated button in TikZ

text: Is it possible to make an enumerated button, similar to the ones shown in the figure below? I will be using them as pictures in an external document (not TeX). ![enter image description here](http://i.stack.imgur.com/S4XlJ.jpg)


title: Biblatex: Can We Delete `\autocite` From Biblatex?

text: Why do we have two different commands for citing? One when citing exactly one source (`\autocite`) and another one that is conceived to be used when citing more than one source (`\autocites`)? If you always use `\autocites` you dont have to make any changes regarding the command when you reduce or extend the references, because it seems to work with any number of references (including exactly one). If you use `\autocite` you have to make adjustments as soon as you change the number of sources. It seems as if `\autocite` could be eliminated because it is included in the `\autocites` command (or it could be redefined in a way that it works like the `\autocites`). (The same holds true for `\cite` etc.)               \documentclass{article}          \usepackage[ngerman]{babel} %dt. Silbentrennung     \usepackage[applemac]{inputenc}           \usepackage[]{biblatex}     \usepackage[babel,german=guillemets]{csquotes}          \usepackage{filecontents}          \begin{filecontents}{\jobname.bib}          @inbook{hC77a,     author = {Herbert~H. Clark},     title = {Inferences in Comprehension},     pages = {243-263},     booktitle = {Basic processes in Reading},     booksubtitle = {Perception and Comprehension},     editor = {David LaBerge and S.~Jay Samuels},     year = {1977},     location = {Erlbaum},     }                  @book{jS09,        author = {John~I. Saeed},        title = {Semantics},        subtitle = {},        year = {2009},        publisher = {Wiley-Blackwell},        location = {Malden, Mass. [u.a.]},        }          \end{filecontents}          \addbibresource{\jobname.bib}               \begin{document}          Using autocites \autocites[152-169]{jS09} % this does work          Using autocites \autocites[152-169]{jS09}[252]{hC77a} % this does work          Using autocite \autocite[152-169]{jS09}          Using autocite \autocite[152-169]{jS09}[252]{hC77a} % this doesnt work          \end{document}      So: Is there any hidden difference?


title: Comparing reference numbers

text: I'm using the `refcount` package to get the reference number associated with a label. I'd like to determine whether two references lay "next" to each other or not, that is: I'd like an _expandable_ command of the form:               \comparerefs{refOne}{refTwo}      that would yield `0` if `refOne` is equal to `refTwo`, `1` if `refOne` is _immediately before_ `refTwo`, `2` if `refOne` is _immediately after_ `refTwo`, and `3` in any other case. Merely calling `\getrefnumber` (from the `refcount` package), saving the result into a counter and adding/subtracting 1 doesn't work for two resons:   1. If `refOne` refers to a section (and we're using the `book` class), `\getrefnumber` return `1.1` and setting the counter breaks.   2. Even if one were to get the section number only, one has to be careful because section 1 of chapter 1 is _not_ immediately before section 2 of chapter 2. This should obviously work with "deeper" references (ie. references to sub- subsections and the like). To clarify: assume `refOne` is of the form `a.b.c` and `refTwo` of the form `d.e.f`, then `\comparerefs{refOne}{refTwo}` should return `0` if `a` = `d`, `b` = `e`, and `c` = `f`; `\comparerefs{refOne}{refTwo}` should return `1` if `a` = `d`, `b` = `e`, and `c` = `f - 1`; `\comparerefs{refOne}{refTwo}` should return `2` if `a` = `d`, `b` = `e`, and `c` = `f + 1`; and `\comparerefs{refOne}{refTwo}` should return `3` if `a` != `d`, or `b` != `e`, or `c` != `f - 1`, `f`, `f + 1` or if `refOne` and `refTwo` are of different lengths. Ideas?


title: How to renewcommand the word-size in section titles?

text: I type `\section{\Large Section title}` to make the section title larger than what it originally appears. Please could you tell me how to achieve this effect by redefining the command `\section` uniformly, so that to larger the word-size in the section titles?


title: longtable within table environment?

text: I have several tabulars and a threeparttable that are all included within a table environment (`\begin{table}` precedes them), so they all have common numbering and appear in the tables section at the end of the document. However, now I have a `longtable` (within a `threeparttablex` environment) and whenever I include within `\begin{table}`, it no longer spans multiple pages. If I take the `\begin{table}` and `\end{table}` out, it spans multiple pages again but appears in the body of the document and will be referred to as `Table 1` if I reference it. Does anybody know a way to work around this? Code is below:               \begin{table}     \begin{ThreePartTable}     \begin{TableNotes}     \item \textit{Notes:} Param. = parameter, cond. = condition, DC = DeCarlo    (2007), DLK = Dennis, Lee, \& Kinnell (2008), KD = Kinnell \& Dennis (2012), ODK = Osth, Dennis, \& Kinnell (in press), OD = Osth \& Dennis (2013), 1x = once presented, 4x = four times presented.     \end{TableNotes}          \begin{center}     \begin{longtable}{l l l l}          %headers     \hline     Param. & Number & Cond. & Datasets \\ \hline \endfirsthead          \multicolumn{4}{l}{\tablename \thetable{} - continued from previous page}    \\ \hline     Param. & Number & Cond. & Datasets \\ \hline \endhead     & & & \textit{Continued on next page}\endfoot     \insertTableNotes     \endlastfoot          %contents of table     \multirow{8}{1.35cm}{$r_{item}$} & 1 & Words (1 sec.) & DC\\                                  & 2 & Words (3 sec.) & DLK\\                                  & 3 & Fractals 1x & KD Ex 2; ODK Ex 1\\                                  & 4 & Fractals 4x & ODK Ex 1 (Mixed list   cond.)\\                                  & 5 & Faces 1x & KD Ex 3; ODK Ex 2\\                                  & 6 & Faces 4x & ODK Ex 2 (Mixed list cond.)\\                                  & 7 & Scenes 1x & KD Exp 4; ODK Ex 3\\                                  & 8 & Scenes 4x & ODK Ex 3 (Mixed list cond.)\\     \multirow{2}{1.35cm}{$r_{assoc}$} & 1 & Pairs 1x & KD Ex 1; OD\\                                   & 2 & Pairs 4x & OD (Mixed list cond.)\\     \multirow{2}{1.35cm}{$\mu_{ss}$} & 1 & Short delays (3.5 min) & ODK Ex 1, 2, 3; OD\\                                  & 2 & Long delays (8 min) & DLK; KD Ex 1, 2, 3, 4\\     $\sigma_{tt}^2$ & 1 & All & All datasets\\     $\sigma_{ss}^2$ & 2 & All & All datasets\\     \multirow{4}{1.35cm}{$\sigma_{ti}^2$} & 1 & Words & DLK; DC; KD Ex 1; OD \\                                       & 2 & Fractals & KD Ex 2; ODK Ex 1 \\                                       & 3 & Faces & KD Ex 3; ODK Ex 2 \\                                       & 4 & Scenes & KD Ex 4; ODK Ex 3 \\     \multirow{2}{1.35cm}{$\sigma_{su}^2$} & 1 & LF words & DLK; DC \\                                      & 2 &  HF words & DLK; DC \\     \multirow{4}{1.35cm}{$\beta_{item}$} & 1 & Words & DLK, DC \\                                      & 2 & Fractals & KD Ex 2; ODK Ex 1\\                                      & 3 & Faces & KD Ex 3; ODK Ex 2\\                                      & 4 & Scenes & KD Ex 4; ODK Ex 3\\     $\beta_{assoc}$ & 1 & Pairs & KD Ex 1, OD\\     \multirow{6}{1.5cm}{$\Phi$} & 1-5 & Confidence & DC\\                             & 6 & & DLK\\                             & 7 & Fractals & KD Ex 2, ODK Ex 1\\                             & 8 & Faces & KD Ex 3, ODK Ex 2\\                             & 9 & Scenes & KD Ex 4, ODK Ex 3\\                             & 10 & Pairs & KD Ex 1, OD\\          \end{longtable}     \end{center}     \end{ThreePartTable}     \end{table}


title: Write to /dev/null?

text: I'm working on package that (among other things) writes an external file during compilation. I'd like to provide an option to the package to _not_ write the external file. I know I can set up a boolean and test for it everywhere in the package the writes take place. But it would be nice to just set the `openout` command at the beginning to write to `/dev/null` or its equivalent. Is that possible? I need to keep this package supported on Windows, Mac, and Unix.


title: tcolorbox: vertical spacing in a tcolorbox

text: How can I obtain the same vertical spacing above and below the line of text in a `tcolorbox`?               \documentclass{article}     \usepackage[most]{tcolorbox}     \newtcolorbox{questions}{       colframe = red     }     \begin{document}     \begin{questions}       \centering       What is the spatial period?     \end{questions}     \end{document}      ![enter image description here](http://i.stack.imgur.com/MhIZM.png) From the image, we can see that the spacing below the sentence is more than above the spacing. I tried using `\vfill` but nothing changed. Also, as an additional question, can I stop indentations after a `tcolorbox` when a new sentence is started?