title: Tufte-book under XeTeX

text: I am trying to use tufte-book with either XəLaΤεχ or LuaΤεχ. Both give me a ‘Missing \begin{document}’ error, which is obviously not the real cause as it is indeed there. The whole skeleton I am trying to process:               \documentclass {tufte-book}     \usepackage {color, microtype, polyglossia, epigraph, fontspec, graphicx, listings, ucs}     \usepackage [colorlinks = true, urlcolor = blue, linkcolor = cyan, frenchlinks = true, pdfborder = {0 0 0}] {hyperref}     \usepackage [acronym, xindy] {glossaries}     \defaultfontfeatures {Contextuals = {Inner, LineFinal, Swash, WordInitial, WordFinal}, Ligatures=Rare, Numbers=Lowercase}          \setmainfont {Junicode}     \setmainlanguage {portuges}     \setotherlanguage [variant = british] {english}     \setotherlanguage [spelling = old] {german}     \setotherlanguage [variant = ancient] {greek}     \setotherlanguage [numerals = hebrew, calendar = hebrew] {hebrew}     \setotherlanguages {french, italian, latin, russian, spanish}          \makeglossaries          \begin {document}     \title {O que é fé salvadora?}     \author {\textenglish {Gordon Haddon \textsc {Clark}}}     \publishers {Monergismo}          \maketitle     \tableofcontents          \frontmatter     \part {Fé \& fé salvadora}     \chapter {Prefácio}     A motivação para este estudo sobre a natureza da fé é a edificação de cristãos:           \mainmatter     \chapter {Introdução}     O ladrão na cruz disse          \marginpar {Mesmo sabendo tão pouco}     Dificilmente ele sabia muito sobre Jesus.                    \part {O Logos joanino}               \backmatter     \bibliography{fé}{}     \bibliographystyle{plain}          \printglossaries     \end {document}      The error log:               ~/Documents/fé $ xelatex fé.xelatex     This is XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/Debian)      restricted \write18 enabled.     entering extended mode     (./fé.xelatex     LaTeX2e <2011/06/27>     Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, fa     rsi, arabic, pinyin, bulgarian, ukrainian, russian, usenglishmax, ukenglish, fr     ench, basque, ngerman, german, swissgerman, ngerman-x-2012-05-30, german-x-2012     -05-30, monogreek, greek, ibycus, ancientgreek, italian, latin, portuguese, gal     ician, catalan, spanish, swedish, thai, loaded.     (/usr/share/texlive/texmf-dist/tex/latex/tufte-latex/tufte-book.cls     Document Class: tufte-book 2009/12/11 v3.5.0 Tufte-book class     (/usr/share/texlive/texmf-dist/tex/latex/tufte-latex/tufte-common.def     (/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty     (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex     (/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))     (/usr/share/texlive/texmf-dist/tex/latex/xifthen/xifthen.sty     (/usr/share/texlive/texmf-dist/tex/latex/etex-pkg/etex.sty)     (/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty)     (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)     (/usr/share/texlive/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty))     (/usr/share/texlive/texmf-dist/tex/latex/base/book.cls     Document Class: book 2007/10/19 v1.4h Standard LaTeX document class     (/usr/share/texlive/texmf-dist/tex/latex/base/bk10.clo))     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)     (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)     (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titlesec.sty)     (/usr/share/texlive/texmf-dist/tex/latex/titlesec/titletoc.sty)     (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty)     (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def)     (/usr/share/texlive/texmf-dist/tex/xelatex/xetexconfig/hyperref.cfg)     (/usr/share/texlive/texmf-dist/tex/latex/hyperref/puenc.def)     (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty))          Package hyperref Message: Driver: hxetex.          (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hxetex.def     (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/stringenc.sty)     (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))          Package hyperref Warning: Option `pagecolor' is not available anymore.          (/usr/share/texlive/texmf-dist/tex/latex/ms/ragged2e.sty     (/usr/share/texlive/texmf-dist/tex/latex/ms/everysel.sty))     (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty)     (/usr/share/texlive/texmf-dist/tex/latex/changepage/changepage.sty)     (/usr/share/texlive/texmf-dist/tex/latex/paralist/paralist.sty)     (/usr/share/texlive/texmf-dist/tex/latex/textcase/textcase.sty)     (/usr/share/texlive/texmf-dist/tex/latex/soul/soul.sty)     (/usr/share/texlive/texmf-dist/tex/latex/setspace/setspace.sty)     (/usr/share/texlive/texmf-dist/tex/latex/natbib/natbib.sty)     (/usr/share/texlive/texmf-dist/tex/latex/natbib/bibentry.sty)     No file fé.bbl.     (/usr/share/texlive/texmf-dist/tex/latex/sauerj/optparams.sty)     (/usr/share/texlive/texmf-dist/tex/latex/placeins/placeins.sty)     (/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)     (/usr/share/texmf/tex/latex/xcolor/xcolor.sty     (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/color.cfg)     (/usr/share/texlive/texmf-dist/tex/xelatex/xetex-def/xetex.def)     (/usr/share/texlive/texmf-dist/tex/latex/graphics/dvipsnam.def)     (/usr/share/texmf/tex/latex/xcolor/svgnam.def))     (/usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty)))     (/usr/share/texlive/texmf-dist/tex/latex/microtype/microtype.sty          Package microtype Warning: You don't seem to be using pdftex.     (microtype)                `microtype' only works with pdftex.     (microtype)                Try running `pdflatex' instead of `xelatex'.          ) (/usr/share/texlive/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty     (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)     (/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty)     (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3names.sty     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3bootstrap.sty))     (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty     (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)     (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg))     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3basics.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3expan.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3tl.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3seq.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3int.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3quark.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3prg.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3clist.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3token.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3prop.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3msg.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3file.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3skip.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3keys.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3fp.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3box.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3coffins.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3color.sty)     (/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3luatex.sty))     (/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)     (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-patches.sty     (/usr/share/texlive/texmf-dist/tex/latex/base/fixltx2e.sty)     *************************************************     * LaTeX warning: "xparse/redefine-command"     *      * Redefining document command \oldstylenums with arg. spec. 'm' on line 107.     *************************************************     ) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty     (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty     (/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1enc.def)     (/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmr.fd))     (/usr/share/texlive/texmf-dist/tex/xelatex/xunicode/xunicode.sty     (/usr/share/texmf/tex/latex/tipa/t3enc.def     (/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmss.fd))     (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty))     (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg))))     (/usr/share/texlive/texmf-dist/tex/latex/epigraph/epigraph.sty)     (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty     (/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty)     (/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg))     (/usr/share/texlive/texmf-dist/tex/latex/ucs/ucs.sty     (/usr/share/texlive/texmf-dist/tex/latex/ucs/data/uni-global.def))          ! LaTeX Error: Missing \begin{document}.          See the LaTeX manual or LaTeX Companion for explanation.     Type  H <return>  for immediate help.      ...                                                        l.4 \usepackage                     [acronym, xindy] {glossaries}     ?       Is this even possible?


title: Accessing the current overlay number in beamer

text: For some `beamer` related code in one of my packages I need to access the current overlay number. I mean the internal number used for things like `\only<1>{..}`.               \only<1>{ Some internal number must be one in here }     \only<2>{ But 2 in here }     \only<1-5>{\includegraphics[page=(current overlay number)]{...}}      I checked the `beamer` manual and could find any information about this. I checked the source code and found some related macros/counters but they didn't held always the correct values. `\beamerpauses` seems not the correct one either. Does anyone now the "offical" counter/macro for this number?


title: Workaround for TexShop and multibib

text: It looks there is a problem with TexShop and `multibib` package. `multibib` package expects that you do `bibtex xxx` where `xxx` is your own `newcites`. However, when using TexShop it looks like it only does it for the main document. Therefore, the only way I have to make it work is to do it from command line (notice the `bibtex xxx`):                pdflatex main      bibtex main      bibtex xxx      pdflatex main      pdflatex main      Do you know a workaround I can do so that I can latex without problem in any IDE? Thanks!


title: Footnotes: Is it possible to combine "para" and "standard" style with one counter?

text: I know the para option of the `footmisc` package. I also know how to define seperate kinds of footnotes with `manyfoot` and that this package has the para option as well. I am looking for a way to combine standard and para footnotes within the same counter in order to swith between them. Why? There is a scientific essay with some long footnotes and a lot of simple page-numbers or "ibd."s. That is why I am imagining something like: > (1) long footnote long footnotelong footnotelong footnotelong footnotelong > footnotelong footnotelong footnotelong footnotelong footnotelong > footnotelong footnotelong footnote (Kruger 2011, 65). > > (2) Ibd. (3) Ibd. (4) Ibd. > > (5) next long footnotenext long footnotenext long footnotenext long > footnotenext long footnotenext long footnotenext long footnotenext long > footnotenext long footnote. PS: No, right at this moment it is no option to place the ibd.s in brackets in the main text.


title: How to manage comments in lecture notes?

text: In the university I'm currently attending a lecture where no lecture notes exist.   I want to tex what the professor has written on the blackboard. I'm gonna include comments (things that my professor said, but didn't write down) that I've written down.   For me it's necessary to distinguish between what the professor wrote down and what I added. I was thinking about something like this:               Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos e          \begin{mycomment}     X is important, because of Y. Catchwords: A, B, C     \end{mycomment}          accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eir      The words wrapped inside the `mycomment` tag should be rendered as normal text, but with a different style, color (grey forinstance) whatever. (I know there are packages for changing the color, like xcolor). It should be possible to 'toggle' these comments off. I'd like to give the *.tex files to a friend who should decide for himself whether the pdf output should contain my comments or not.   The desired solution would be change a line like               \newcommand{\PrintMyComments}{1}      to               \newcommand{\PrintMyComments}{0}      How can I do this in tex?


title: The siunitx package messes with manually input thousand-separators

text: Recently I found the very useful `siunitx` package, and immediately looked to use it for some tables. Unfortunately, I already have all my numbers typeset with `,` thousand separator and `.` decimal separator. If I try something like:                \documentclass{standalone}      \usepackage[group-separator={,}]{siunitx}      \begin{document}      \begin{tabular}{S[table-format=6.2]}      300,000.12\\      \end{tabular}      \end{document}      I get errors like:               Duplicate decimal marker '.' in input.      If I replace `300,000.12` with `300,000` it considers it as the `300.000` (i.e., `300`). This seems strange to me as the package interprets `300000` as `300,000` but it interprets `300,000` as `300.000`. I've scanned through the detailed `siunitx` documentation, but could not find any flags for picking up input separators. Anyone know how `siunitx` can be parameterised to treat raw input numbers like 300,000.12 gracefully? (I would rather not remove all commas from all input numbers.)


title: Table Spanning the Textwidth

text: I am trying to create a very simple, one row table that spans the linewidth. When I use the following command: `\begin{tabular*}{\linewidth}{l@{\extracolsep{\fill}}r}   Entry 1 & Entry 2   \end{tabular*}` the first entry is slightly indented and the second entry entends past the linewidth. How do I make it so that the first entry is aligned with the left margin and the second entry is aligned with the right margin?


title: How to use Line in Matrix

text: > **Possible Duplicate:**   >  \bordermatrix with brackets [ ] instead of parentheses ( ) I need to write a complicated matrix, that has a structure as in the attached picture ![image](http://i.stack.imgur.com/RZzJ1.png)


title: How to add a line break

text: Sometimes I need an empty line like this ![enter image description here](http://i.stack.imgur.com/DhaLf.png) If I write               $\Rightarrow \mathcal{I}_1 = \{\{A\}, \{B\}, \{C\}, \{E\}\}$     \\     Generierung der häufigen $2$-Itemsets:      I'll get an error "There's no line here to end". So, I've made               $\Rightarrow \mathcal{I}_1 = \{\{A\}, \{B\}, \{C\}, \{E\}\}$     $ $\\     Generierung der häufigen $2$-Itemsets:      This works, but I want to use a nicer solution... How can I fix this?? Thank you for your help!


title: Hyperlinked sectionnames in fancyheader

text: I am trying to create a header that consist of chaptername and sectionname (chaptername:sectionname) both of them a hyperlink to chapter and section respectively. I am using Hungarian language so there are many accented word, and - as I gathered - `hyperref` do not support accented links and after all, section names can be the same in different chapters so I need to get some unique names. So I generate a unique ASCII section name (see `\Section`) and in `\sectionmark` I concatenated it with the name of the section and in `\fancyhead` I try to separate them again and using them in a `\hyperlink` command, but so far I failed. Here is the brief (not working) code example:               \documentclass[pdftex,a4paper,12pt,oneside]{book}%          \usepackage[latin2]{inputenc}     \usepackage[T1]{fontenc}     \usepackage[magyar]{babel}     \usepackage{fancyhdr}     \usepackage{xstring}     \usepackage{hyperref}     \usepackage{bookmark}          \hypersetup{colorlinks,                               linkcolor=blue!80,filecolor=Orange,urlcolor=red!60,citecolor=magenta,                   linktoc=all,                 hypertexnames=false,                 unicode=true,                 bookmarksnumbered=false,             pdfmenubar=true,%               pdftoolbar=true              }          \newcommand{\chapterlinkname}{}     \newcommand{\setchapterlinkname}[1]{\renewcommand{\chapterlinkname}{#1}}     \newcommand{\chapterlink}[1]{\setchapterlinkname{lnk:chap#1}\hypertarget{\chapterlinkname}{}}     \newcommand{\Chapter}[2]{\newpage\chapterlink{#2} \chapter{#1}}          \newcommand{\sectionlinkname}{}     \newcommand{\setsectionlinkname}[1]{\renewcommand{\sectionlinkname}{#1}}     \newcommand{\sectionlink}[1]{\setsectionlinkname{\chapterlinkname:sec#1}\hypertarget{\sectionlinkname}{}}     \newcommand{\Section}[2]{\sectionlink{#2}\section{#1}}          \newcommand{\seclink}{}     \newcommand{\secname}{}     \newcommand{\mystrsplit}[4]{       \renewcommand{#3}{\StrBefore{#1}{#2}}       \renewcommand{#4}{\StrBehind{#1}{#2}}     }            %------------------          \begin{document}          \pagestyle{fancy}     \fancyhf{}      \renewcommand{\chaptermark}[1]{\markboth{##1}{}}     \renewcommand{\sectionmark}[1]{\markright{\sectionlinkname,##1}}           \fancyhead[LO,RE]{\mystrsplit{\rightmark}{,}{\seclink}{\secname} \hyperlink{\chapterlinkname}{\bfseries\leftmark} : \hyperlink{\seclink}{\bfseries\secname}}            \fancyhead[LE,RO]{\bfseries\thepage}     \renewcommand{\headrulewidth}{0.5pt}     \renewcommand{\footrulewidth}{0pt}     \addtolength{\headheight}{2.5pt}      \fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}           \Chapter{Állóképek}{Allokepek}          \Section{Tükörkép}{Tukorkep}          \newpage          \Section{Sírkőgyártó}{Sirkogyarto}          \end{document}      I am using MiKTeX 2.9 with TeXnicCenter.


title: Footnotes layout in multicols environment

text: I am using the package `multicol` to typeset a one-column (spanning the entire text width) heading and a two-column main text block. In order to do so, I begin the multicols environment along with the start of the text block. The one-column heading spans a small fraction of the text height in the front page and I need to set a footnote there, before starting the two-column environment. I'd like to have that footnote typeset under the first column in the two-column running text. How could I possibly do this? Moreover, I'd like to have the footnotes typeset in a single column under one of the text columns -- I don't even mind having them as two-column footnotes, but what I do not want is a footnotes layout spanning the entire text width. I have tried with the command `\twocolumnfootnotes` from the class `memoir`, with the packages `ledmac`, `dblfnote`, and even with `ftnright` (the latter complains about its being used in a single-column document, due to that one- column heading). None has proved useful in this setting. As a less than MWE, just to convey a more concrete depiction of my scenario, let us consider:               \documentclass{memoir}          \usepackage{multicol}          \begin{document}          A single-column heading\footnote{Here I have my footnote.}          \begin{multicols}{2}     Here I am in the two-column environment, and I want my footnotes being set in accordance with the document's ``columnwidth''.\footnote{A footnote in the two-column environment.}     \end{multicols}           \end{document}


title: Display the bullet of \item

text: In the following code, at the place of `*step 2*`, I would like to display exactly ![enter image description here](http://i.stack.imgur.com/rudjI.png). Does anyone know how to do it?               \begin{block}{title}     \begin{enumerate}       \item ... %Step 1       \item ... %Step 2       \item ... Go back to *Step 2*     \end{enumerate}     \end{block}


title: Dashes and hyphens in Hebrew

text: I'm trying to use hyphens in a Hebrew document, but they do not appear in the resulting file. I've created this example to test the error. It seems only the unicode en-dash letter renders correctly when the Hebrew language is selected. Do you know why does this happens?               \documentclass{article}     \usepackage[utf8x]{inputenc}     \usepackage[hebrew,english]{babel}          \begin{document}     Hyphen-Minus: Hello-World!          En dash: Hello–World!          Tex en dash: Hello--World!          Tex em dash: Hello---World!          \selectlanguage{hebrew}     \L{Maqaf } שלום־עולם!          \L{En dash } שלום–עולם!          \L{Hyphen-Minus } שלום-עולם!          \L{Tex en dash } שלום--עולם!          \L{Tex em dash } שלום---עולם!          \end{document}      ![The compiled example](http://i.stack.imgur.com/t7UcH.png)


title: Tikz automaton placed too far to the right

text: So I'm having a bit of trouble drawing an automaton that I've created. I've been looking around for a while to no real avail, so I decided to just ask the question myself: when I make an automaton (I'll post mine), the entire diagram is too far to the right. Given the default spacing that I had was 3.5cm, the diagram is perfectly visible throughout, nothing is cut off, but when I wish to space the nodes out a little more, say, to 5.5cm, then half of my automaton falls off the right side of the screen (ie it appears to never get drawn). I've tried altering to starting position of the first node, under the assumption that "every other node is just constructed around the first one", but that didn't work. I tried using `at (x, y)`, I've tried using `\centering`, I've tried loads of things (half of which came from this very site), but sadly, I cannot figure it out. Here is the code:               \documentclass[a4paper,10pt]{article}          %as of the 20th f August, 2013, all of the self-loops     %for all of the nodes are incomplete (ie if any     %nodes have self loops, the labels are not quite finished)                    \usepackage{pgf}     \usepackage{tikz}     \usetikzlibrary{arrows,automata, positioning}     \usepackage[latin1]{inputenc}     \begin{document}     \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=5.5cm,                     semithick]         \tikzstyle{every state}=[fill=red,draw=none,text=white]          \node[initial,state] (1)                    {$s_1$};     \node[state]         (2) [below of=1]       {$s_2$};     \node[state]         (3) [above left of=1]  {$s_3$};     \node[state]         (4) [above right of=1] {$s_4$};     \node[state]         (5) [below left of=3]  {$s_5$};     \node[state]         (6) [below right of=4] {$s_6$};     \node[state]         (7) [below of=2]       {$s_7$};     \node[state]         (8) [below of=5]       {$s_8$};     \node[state]         (9) [below of=6]       {$s_9$};          \path      (1) edge [bend left]    node [sloped, below, pos=.3] {PG$\_$ON} (2)         edge [bend left]    node [sloped, above] {CSP}  (3)         edge [bend right]   node [sloped, above] [swap, pos = .2] {CPSU}    (4)         edge [loop above, looseness=30] node {PSUFull}  (1)          (2) edge [bend left]    node [sloped, above] {CSP}  (5)         edge [bend right]   node [sloped, above] {CPSU} (6)         edge    node [swap, pos=.4, sloped, above] {PSUFull}    (7)         edge [bend left]    node [sloped, below, pos=.7] {PG$\_$OFF} (1)         edge [loop above]   node {lowSP} (2)          (3) edge [bend left]    node [sloped, below] {lowSP} (1)         edge [bend right]   node [left, sloped, above] {PG$\_$ON} (5)         edge [loop above]   node {CSP} (3)          (4) edge [bend right]   node [sloped, above] {PG$\_$ON} (6)         edge [bend right]   node [sloped, below] {PSU$\neg$Thresh} (1)         edge [loop above]   node {CPSU} (4)          (5) edge [bend left]    node [sloped, below] {lowSP} (2)         edge    node [sloped, above] {PSUFull} (8)         edge [bend right]   node [above, sloped] {PG$\_$OFF} (3)         edge [loop left, looseness=20]  node {CSP} (5)          (6) edge [bend right]   node [sloped, below]  {PSU$\neg$Thresh} (2)         edge    node [swap, sloped, above] {PSUFull} (9)         edge [bend right]   node [sloped, below] {PG$\_$OFF} (4)         edge [loop right, looseness=20]     node {CPSU} (6)          (7) edge [bend right]   node [sloped, below]  {CSP} (8)         edge [bend right]   node [swap, sloped, above] {CPSU} (9)         edge [bend right]   node [sloped, below] {PG$\_$OFF} (1)         edge [loop below]   node {lowSP} (7)          (8) edge [bend right]   node [sloped, swap] {lowSP} (7)         edge [bend left = 80]   node [pos=.2, sloped, below] {PG$\_$OFF} (3)         edge [loop left]    node {CSP} (8)          (9) edge [bend right]   node [sloped, below] {PSU$\neg$Thresh} (7)         edge [bend right=80]    node [swap, pos=.2] {PG$\_$OFF} (4)         edge [loop right]   node {CPSU} (9);               \end{tikzpicture}     \end{document}      And the image: ![My failure of an automata](http://i.imgur.com/TuAWtF7.png) I'm really sorry if this isn't formatted properly or if this question has been asked before/is really foolish. I'm just stuck =/. Any help is appreciated!


title: Labeled Number Line

text: I am transferring a professor's .doc files to LaTeX so that we can do more sophisticated formatting and I ran across a problem. I would like to recreate this number line in LaTeX. ![number line](http://i.imgur.com/kuTRC.jpg) Help with which package to use and which commands to study would be a great help.


title: Splitting circular nodes in tikz

text: I'm trying to reproduce the attached figure using the tikz package, but am having a hard time splitting the node with the {X,x} in it. Any suggestions? ![Taken from Richardson & Robins 2013](http://i.stack.imgur.com/VMRUb.png) Here's what I've come up with so far, but it's not good enough. The {X,x} node needs to be rotated and split, exactly as in the figure (colors not important):               \begin{tikzpicture}       \node [circle split,              draw,         line width = .05cm,              minimum width=1cm,              append after command={%               let \p1=($(\tikzlastnode.east)-(\tikzlastnode.west)$) in                     node[draw,                        shape=semicircle,                        rotate=180,                        anchor=south,                        double,                        minimum width=\x1] at (\tikzlastnode.center)     {}}]       {$X$         \nodepart{lower}         $x$       };     \node [ellipse,draw,line width=.05cm] at (3.75,0) {$Y(x)$};     \node [circle,draw,line width=.05cm] at (1.5,3) {$L$};     \node [circle,draw,line width=.05cm] at (4,4.5) {$H$};     \draw[->, line width=.125cm] (1.1,0) -- (2.5,0);     \draw[->, line width=.125cm] (0.9,3) to [out=180,in=90]  (-.5,1);     \draw[->, line width=.125cm] (1.8,2.6) -- (3,.75);     \draw[->, line width=.125cm] (3.45,4.2) -- (2.1,3.25);     \draw[->, line width=.125cm] (4,3.9) -- (4,.85);     %\draw[help lines] (0,0) grid (8,6) ;     \end{tikzpicture}


title: Helix type cumulative distribution in Tikz

text: I wrote the following codes. I am trying to obtain helix (as in DNA) type of structure on which everything - intersection points etc - can be seen explicitly. Whatever I do I am getting really ugly shapes. I have played angles, curvatures etc. Any help would be great! Some codes are not active, my apologies for that.               \documentclass{article}     \usepackage{tikz,subfigure}     \usetikzlibrary{intersections,calc}          \newdimen\XCoord     \newdimen\YCoord          \newcommand*{\ExtractCoordinate}[1]{\path (#1); \pgfgetlastxy{\XCoord} {\YCoord};} %          \newcommand*{\LabelCurrentCoordinate}[2]{\fill[#1] ($(\XCoord, \YCoord)$) circle (2pt) node [right] {#2}} %          \begin{figure}     \centering     \begin{tikzpicture}[ultra thick, scale=1]     \draw (0,0) -- +(10,0) node[pos=0,left]{\tt\color{black}1};          \draw (0,-10)-- +(10,0) node[pos=0,left]{\tt\color{black}0};          \draw [red,line width=2pt, name path= curve 1] (0,-10) -- (1,-10) to [out=0,in=180] (3,-8) to[out=0,in=270] (5,-6) to[out=90,in=180] (7,-4) to [out=0,in=180] (9,-2) to [out=0,in=180] (9.8,0) to (10,0);                \draw [blue, line width=2pt, name path= curve 2] (0,-10) -- (0.2,-10) to [out=0,in=270] (4,-8) to[out=-270, in=180] (6,-6) to [out=0,in=160](8,-2) to[out=-20,in=270] (9.8,0) -- (10,0);           \fill[name intersections={of=curve 1 and curve 2,total=\t}]      \foreach \s in {2,...,\t}{(intersection-\s) circle (3pt)     node[above left] {$E$\s}};          \end{tikzpicture}     \end{figure}     \end{document}


title: Strategies to visualize multiple two-dimensional regressions?

text: Hopefully I can describe my question more clear here in the content than in the title. It might be more about visualization strategy than specific pgfplots techniques. The problem is about regressions of two-dimensional input, but please let me start with one-dimensional input. Say in my experiment I vary the input x, and observe the output y. I repeat the experiments three times. The plot shows the results (code are listed at end): ![multiple regressions of 1-dimensional input](http://i.stack.imgur.com/ewpJM.png) Now assume my experiment have two inputs x and y, and an output z. For the observations from one experiment, it can be plotted like this: ![regression of 2-dimensional input](http://i.stack.imgur.com/FgkDx.png) However, for repeated experiments (say 4-5 times), the 3-D plot containing all these results is rather confusing. The mean and deviation plot looks better but certainly lost information. Here is an example when the experiments are repeated twice (two set of observations), the plots will be: ![multiple regressions of 2-dimensional input](http://i.stack.imgur.com/LIwrC.png) Is there any strategy that can visualize this case (multiple x-y-z) better? "Better" maybe in the sense that each individual experiment is presented clearly, and also multiple experiments are presented together for easy comparison. Just for reference, these are the pgfplots code generating the plots. Muliple x-y-z plot:               \begin{tikzpicture}[scale=0.8]     \begin{axis}       [scale only axis, width=0.35\textwidth,       xlabel=x, ylabel=y, zlabel=z, title=Two dimensional input,]       \addplot3[surf,mesh/rows=5] coordinates {          (0,0,0) (1,0,0) (2,0,0) (3,0,0)          (0,1,0.1) (1,1,0.3) (2,1,0.3) (3,1,0.4)          (0,2,0.15) (1,2,0.5) (2,2,0.5) (3,2,0.5)          (0,3,0.65) (1,3,0.60) (2,3,0.65) (3,3,0.45)          (0,4,0.8) (1,4,0.75) (2,4,0.85) (3,4,0.65)        };       \addplot3[surf,mesh/rows=5] coordinates {          (0,0,0.1) (1,0,0.1) (2,0,0) (3,0,0)          (0,1,0.3) (1,1,0.2) (2,1,0.2) (3,1,0.4)          (0,2,0.15) (1,2,0.6) (2,2,0.5) (3,2,0.5)          (0,3,0.55) (1,3,0.7) (2,3,0.65) (3,3,0.45)          (0,4,0.6) (1,4,0.85) (2,4,0.65) (3,4,0.35)        };      \end{axis}      \end{tikzpicture}     \begin{tikzpicture}[scale=0.8]     \begin{axis}[scale only axis, width=0.3\textwidth,       xlabel=x, ylabel=y, zlabel=z, title=Mean and Deviation,]       \addplot3[surf,mesh/rows=5,         error bars/z dir=both, error bars/z fixed=0.1,] coordinates {          (0,0,0.05) (1,0,0.05) (2,0,0) (3,0,0)          (0,1,0.2) (1,1,0.25) (2,1,0.25) (3,1,0.4)          (0,2,0.15) (1,2,0.55) (2,2,0.5) (3,2,0.5)          (0,3,0.65) (1,3,0.65) (2,3,0.65) (3,3,0.45)          (0,4,0.7) (1,4,0.80) (2,4,0.75) (3,4,0.5)        };      \end{axis}      \end{tikzpicture}      Single x-y-z plot:               \begin{tikzpicture}[scale=0.8]     \begin{axis}       [scale only axis, width=0.35\textwidth,       xlabel=x, ylabel=y, zlabel=z, title=Two dimensional input,]       \addplot3[surf,mesh/rows=5] coordinates {          (0,0,0) (1,0,0) (2,0,0) (3,0,0)          (0,1,0.1) (1,1,0.3) (2,1,0.3) (3,1,0.4)          (0,2,0.15) (1,2,0.5) (2,2,0.5) (3,2,0.5)          (0,3,0.65) (1,3,0.60) (2,3,0.65) (3,3,0.45)          (0,4,0.8) (1,4,0.75) (2,4,0.85) (3,4,0.65)        };      \end{axis}      \end{tikzpicture}     \hfill     \begin{tikzpicture}[scale=0.8]     \begin{axis}[view={0}{90}, scale only axis, width=0.3\textwidth,       xlabel=x, ylabel=y, zlabel=z, title=Top view of two dimensional input, ]       \addplot3[surf,mesh/rows=5] coordinates {          (0,0,0) (1,0,0) (2,0,0) (3,0,0)          (0,1,0.1) (1,1,0.3) (2,1,0.3) (3,1,0.4)          (0,2,0.15) (1,2,0.5) (2,2,0.5) (3,2,0.5)          (0,3,0.65) (1,3,0.60) (2,3,0.65) (3,3,0.45)          (0,4,0.8) (1,4,0.75) (2,4,0.85) (3,4,0.65)        };      \end{axis}      \end{tikzpicture}      Multiple x-y plot:               \begin{tikzpicture}     \begin{axis}       [scale only axis, width=0.3\textwidth,       xlabel=x, ylabel=y, title=One dimensional input]       \addplot coordinates{(0, 0.6) (0.1, 0.25) (0.2, 0.1) (0.3, 0.06) (0.4, 0.02) (0.5, 0.01)};       \addplot coordinates{(0, 0.7) (0.1, 0.1) (0.2, 0.125) (0.3, 0.08) (0.4, 0.016) (0.5, 0.02)};       \addplot coordinates{(0, 0.5) (0.1, 0.15) (0.2, 0.15) (0.3, 0.10) (0.4, 0.012) (0.5, 0.03)};       \legend{exp1, exp2, exp3}     \end{axis}     \end{tikzpicture}     \hfill     \begin{tikzpicture}     \begin{axis}       [scale only axis, width=0.3\textwidth,       xlabel=x, ylabel=y, title=Mean and Deviation]       \addplot[ error bars/.cd, y dir=both, y explicit, ]         coordinates{(0, 0.6)  +- (0, 0.1)                          (0.1, 0.1)  +- (0, 0.1)                         (0.2, 0.125) +- (0, 0.025)                         (0.3, 0.08) +- (0, 0.08)                          (0.4, 0.016) +- (0, 0.04)                       (0.5, 0.02) +- (0, 0.02)};     \end{axis}     \end{tikzpicture}      However,


title: A Weird Pagination Problem with memoir, amsref

text: I have a weird problem to describe. Please consider the following code:               \documentclass[a4paper,twoside,oldfontcommands,12pt]{memoir}     % \documentclass[a4paper,twoside,oldfontcommands,12pt]{memoir}     %%% A Hack to use amsrefs     \let\bibsection\relax          %%% INCLUDE THE PACKAGES     \usepackage[utf8x]{inputenc}     \usepackage[compact]{titlesec}     \usepackage{a4wide}     \usepackage{graphicx}     \usepackage{amssymb,amsmath,amsthm,amsfonts,amscd,amsrefs}     \usepackage{lipsum}     \usepackage{xcolor}     \usepackage{calc,graphicx,soul}     \usepackage{enumitem}      \usepackage[bookmarks=true]{hyperref}     \usepackage{bookmark}          \definecolor{nicered}{rgb}{.0588,.0941,.333}     \setsecheadstyle{\color{nicered}\Large\bfseries\sffamily\raggedright}     \setsubsecheadstyle{\large\bfseries\sffamily\raggedright}     \setsubsubsecheadstyle{\normalsize\bfseries\sffamily\raggedright}          %%%FORMATING FOR CHAPTER     \makeatletter     \newlength\dlf@normtxtw     \setlength\dlf@normtxtw{\textwidth}     \def\myhelvetfont{\def\sfdefault{mdput}}     \newsavebox{\feline@chapter}     \newcommand\feline@chapter@marker[1][4cm]{%     \sbox\feline@chapter{%     \resizebox{!}{#1}{\fboxsep=1pt%     \colorbox{nicered}{\color{white}\bfseries\sffamily\thechapter}%     }}%     \rotatebox{90}{%     \resizebox{%     \heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%     {!}{\scshape\so\@chapapp}}\quad%     \raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%     }     \newcommand\feline@chm[1][4cm]{%     \sbox\feline@chapter{\feline@chapter@marker[#1]}%     \makebox[0pt][l]{% aka \rlap     \makebox[1cm][r]{\usebox\feline@chapter}%     }}     \makechapterstyle{daleif1}{     \renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}     \renewcommand\chaptitlefont{\normalfont\huge\bfseries\scshape\color{nicered}}     \renewcommand\chapternamenum{}     \renewcommand\printchaptername{}     \renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}     \renewcommand\afterchapternum{\par\vskip\midchapskip}     \renewcommand\printchaptertitle[1]{\chaptitlefont\raggedleft ##1\par}     }     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \makeatother     \chapterstyle{daleif1}     %===================================================     \setcounter{secnumdepth}{5}     \captionnamefont{\small\sffamily\bfseries}     \captiontitlefont{\small\sffamily}          \makepagestyle{myruled}     \makeheadrule {myruled}{\textwidth}{2pt}     \makefootrule {myruled}{\textwidth}{2pt}{\footruleskip}     \makeevenhead {myruled}{}{\small\sffamily\leftmark}{}     \makeoddhead {myruled}{}{\small\sffamily\rightmark}{}     \makeevenfoot {myruled}{\small\thepage}{}{}     \makeoddfoot {myruled}{}{}{\small\thepage}     \makeatletter % because of \@chapapp     \makepsmarks{myruled}{       \nouppercaseheads\createmark{chapter}{both}{shownumber}{       \@chapapp\ }{.\ }       \createmark{section}{right}{shownumber}{}{. \ }       \createmark{subsection}{right}{shownumber}{}{. \ }       \createmark{subsubsection}{right}{shownumber}{}{. \ }       \createplainmark {toc}{both} {\contentsname}       \createplainmark {lof}{both} {\listfigurename}       \createplainmark {lot}{both} {\listtablename}       \createplainmark {bib}{both} {\bibname}       \createplainmark {index}{both} {\indexname}       \createplainmark {glossary}{both} {\glossaryname}     }     \makeatother     \setsecnumdepth{subsubsection}          \linespread{1.5}     \renewcommand{\arraystretch}{1.0}          %==================================================================================================================          \newcommand{\mar}[1]{\marginpar{\small \it #1}}     \marginparwidth 1 in          \newcounter{cnt1}     \newcounter{cnt2}     \newcommand{\blr}{\begin{list}{$($\roman{cnt1}$)$}      {\usecounter{cnt1} \setlength{\topsep}{0pt}      \setlength{\itemsep}{0pt}}}     \newcommand{\bla}{\begin{list}{$(\alph{cnt2})$}      {\usecounter{cnt2} \setlength{\topsep}{0pt}      \setlength{\itemsep}{0pt}}}     \newcommand{\el}{\end{list}}               \renewcommand{\biblistfont}{%       \normalfont       \normalsize     }          \begin{document}     \pagenumbering{gobble}     \include{cover(mem)}     \cleardoublepage     \include{title(mem)}     \cleardoublepage     \include{dedication(mem)}     \cleardoublepage     % \include{acknowledgement}     % \cleardoublepage     \setcounter{tocdepth}{2}     \tableofcontents     \cleardoublepage     \pagenumbering{arabic}     \pagestyle{myruled}     \chapter{Introduction}     \lipsum[1-11]     % \createmark{chapter}{both}{nonumber}{}{}     % \pagenumbering{gobble}      \chapter*[Bibliography]{}     \begin{bibdiv}     % \pdfbookmark{\bibname}{Bibliography}{}     % \pagenumbering{arabic}     % \setcounter{page}{93}     \begin{biblist}     \bib{Darwin}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin1}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin2}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin3}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin4}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin5}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin6}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin7}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin8}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin9}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin10}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin11}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin12}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin13}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin14}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }      \bib{Darwin15}{article}{            author={Darwin, Charles.},               title={Elephants, A New Perspective},             date={1972},             ISSN={1234},          journal={Nature},           volume={90},            pages={90\ndash 128},      }          \end{biblist}     \end{bibdiv}     \end{document}      I realise that this is perhaps not the right way to do it. The problem is (1) In the code, there is a new chapter (`\chapter*`) which clears a double page. (2) Suppose on the contrary, if I get rid of that, I get into trouble in the header and footer. And, the bookmark for Bibliography is not being created. I solved the problem by using `[openany]` option and using `\cleartorecto` as the need may be at the end of chapters (and this solution is manual and does not work if the last non-empty page before Bibliography is an even-numbered page); see the commented out bits of code. I'd be glad if someone can point me to the right way of doing it.


title: Change the bullet of each \item

text: Sorry, may be the title is not clear. In fact, I need to make a list of advantages and disadvantages and I want to note the advantages as + and disadvantages as -. How can I change the full circle of item to + or - sign?                \documentclass[compress,red]{beamer}      \usepackage{etex}      \mode<presentation>      \usetheme{Warsaw}        \usepackage[applemac]{inputenc}%les accents pour mac        \usepackage{subfigure}       \usepackage{amsmath}       \usepackage{epsfig}           \usepackage{graphicx}        \usepackage[all,knot]{xy}         \xyoption{arc}        \usepackage{setspace}          \begin{document}           \section{section1 }          \frame[shrink]{\frametitle{Titre de la fenetre}          \begin{itemize}                   \item point1             \item point2            \item point3             \item point4             \item point5            \end{itemize}                  }


title: TikZ: Can a \foreach command run inside decoration = {markings,?

text: Can I use `\foreach` inside of `decoration = {markings, ...`?               \documentclass[convert = false, tikz]{standalone}     \usetikzlibrary{decorations.markings}     \usetikzlibrary{arrows}          \begin{document}     \begin{tikzpicture}       \begin{scope}[decoration = {markings,           \foreach \loc in {.1, .2, ..., 1}{             mark = at position \loc with {\arrow{latex}},           }         }]         \draw[postaction = decorate] (0, 0) -- (2,3);       \end{scope}     \end{tikzpicture}     \end{document}      This code freezes on compilation.


title: Uninstalling STIX Fonts

text: I recently installed the `texlive-full` package, and want to uninstall the STIX fonts because they are interfering with my MathJax rendering. What is the terminal command to uninstall them? (I'm using Linux Mint 15, and pulled TL from the Ubuntu/Mint package repositories.) I'm asking because I don't want to mess up any dependencies, and am trying to uninstall them as cleanly as possible.


title: Multiple Texmaker windows?

text: In OS-X, is there a way to open multiple windows of TeXmaker, each for viewing and editing different (or same) files?


title: Beamer error, does not produce any output

text: \documentclass{beamer}     \usetheme{Darmstadt}     \usefonttheme[onlylarge]{structurebold}     \setbeamerfont*{frametitle}{size=\normalsize,series=\bfseries}     \setbeamertemplate{navigation symbols}{}     \usepackage[english]{babel}     %\usepackage[latin1]{inputenc}     \usepackage{times}     \usepackage[T1]{fontenc}     \usepackage{subfig}     \usepackage{amssymb,amsmath,graphicx,charter,latexsym}     \usepackage{enumerate}     \usepackage{comment}     \usepackage{verbatim}     \usepackage{bbm}     % Setup TikZ          \usepackage{tikz}     \usetikzlibrary{arrows}     \tikzstyle{block}=[draw opacity=0.7,line width=1.4cm]               % Author, Title, etc.          \title[xx]      {%       Max Weight Scheduling: Unscaled Queue Dynamics in Heavy Traffic.%     }          \author[x,y]     {       x \and       y     }                    %\date[WABI 2006]                         % The main document          \begin{document}          \begin{frame}       \titlepage     \end{frame}          \begin{frame}{Outline}       \tableofcontents     \end{frame}               \section{Timely Throughput Model}          \subsection{The Model}     \begin{frame}[t]{Guarantee per packet Hard Deadline Constraints}       \begin{block}         \begin{itemize}         \item Clients generate packets with fixed period $\tau$.  .         \item Deadline = Period.         \item Packets expire and are dropped if not delivered by the deadline.         \item Hence delay of successfully delivered packet is at most $\tau$.         \item Delivery ratio of packets that meet deadline for client $n$ should be at least $q_{n}$, i.e.      $$\liminf\limits_{T\to\infty} \frac{1}{T}\sum\limits_{t=1}^{T}\mathbbm{1}\{\mbox{client $i$'s packet is delivered in frame $t$}\}\geq q_{i}.$$        \end{itemize}       \end{block}     \end{frame}          \begin{frame}[t]{A Minimum Delivery-Ratio Required.}       \begin{block}         \begin{itemize}         \item Delivery ratio of packets that meet deadline for client $n$ should be at least $q_{n}$, i.e.      $$\liminf\limits_{T\to\infty} \frac{1}{T}\sum\limits_{t=1}^{T}\mathbbm{1}\{\mbox{client $i$'s packet is delivered in frame $t$}\}\geq q_{i}.$$        \end{itemize}       \end{block}     \end{frame}          \end{document}


title: How to project a function over a 3D plane

text: When I looked up the method to express two variable functions as a sequence of intersecting horizontal planes, I thought to use `PGFplots` to construct a simple set of "slices" of a generic function (represented as a blue line). Here is my MWE as the first plot (the first slice) is complied without errors:               \documentclass[a4paper]{article}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     %     \begin{document}     %     Initial \TeX{}t     \begin{figure}[h]     \begin{centering}     \begin{tikzpicture}     \tikzset{%      small dot/.style={fill=cyan,circle,scale=0.25}%     }     \begin{axis}[%      grid=major,      colormap/cool,      zlabel=$z$,      zmin=-5,      ztick={-5,-2.5,0,2.5,5},      ytick={-5,-2.5,0,2.5,5},      zmax=5,      xmin=-5,      xmax=5,      xlabel=$x$,      ylabel=$y$%     ]     \addplot3 [surf] {0};     \addplot3 [color=blue] coordinates {(0,-5,0) (0,5,0)};     \addplot3 [color=blue] coordinates {(-5,0,0) (5,0,0)};     \node[small dot,pin=-60:{$z_1$}] at (axis cs:2.5,-5,0) {};     %     \end{axis}     \end{tikzpicture}     \par     \end{centering}     \caption{Funzione definita $f_{1}(x,y)$ o $z_{1}$}     \end{figure}     \par     Ending \TeX{}t     %     \end{document}      And the output is evidently correct: > ![enter image description here](http://i.stack.imgur.com/mBJDQ.png) Now comes the major problem: I'd like to put ad _additional layer_ with the specific function _projected onto the new plane_ , but I have no idea on how to do this properly; as it can be seen the function on the MWE isn't really a function but some sort of "cheat". The problem will be solved if a macro will be able to plot some function (i.e. `sin(x)`) onto a plane into the third dimension.   As I can see, this question is very similar to Tim N's Question (for comparison). If the adding of a new layer will be too tricky, I'll accept the answer regarding the projection because it's the most important one, as the adding of more layers is easily solvable by re-correcting the position of the plots in my document.


title: unknown problem in siunitx

text: I'm trying to use the inch mark (the double prime) in a piece of text; in the past I've gotten away with               4 $''$ \times 6 $''$      but for some reason that doesn't work when that line is an item in an itemized list. I'm now experimenting with the siunitx package, but now there's a new problem. This MOLMWE (More or Less Minimal Working Example)               \documentclass{article}     \usepackage{siunitx}     \usepackage[LY1]{fontenc}     \usepackage{fontspec}     \usepackage{xltxtra}          \setromanfont[Numbers=OldStyle]{Linux Libertine O}          \sisetup{detect-all = true}     \DeclareSIUnit[number-unit-product = {}]{\inchQ}{\prime\prime}          \begin{document}          \begin{itemize}          \item \SI{4 \times 6}{\inchQ} index cards          \end{itemize}          \end{document}      produces an incorrect result; I'd attach an image, but I don't have sufficient reputation for that privilege. What's the problem, if you can spot it from just the code, and how do I fix it? P.S. As for the MOLMWE: I included possibly extraneous material because I wasn't sure whether it was relevant and decided to play it safe.


title: Align and underbrace

text: I got the following LaTeX-code (only an example):               \begin{align}     A=&0\\     0=& x y z re+ e\\     0\underbrace{=}_{\text{with bla bla bla bla}& u+z-24y     \end{align}      Now, I want that one equal signs is exactly the others, but the one where the underbrace is included is always shifted to the right. Edit:               \documentclass[11pt,a4paper]{article}     \usepackage[utf8]{inputenc}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}     \begin{document}     \begin{align}     a+b=&0\\     0=&z+u+i+v\\     0\underbrace{=}_{\text{inserting bla bla bla}}&43+2     \end{align}     \end{document}


title: How to reformat in-line citations when \nameyeardelim is undefined?

text: As per the second part of this question, I want to remove the comma from the end of the authors in my in-line citations, e.g., `Doe et al., 2013` -> `Doe et al. 2013`. The solution is to redefine `\nameyeardelim`:               \renewcommand*{\nameyeardelim}{\addspace}      However, this causes               ! LaTeX Error: \nameyeardelim undefined.      I'm using `natbib` with the default options. How can I overcome this error to remove the comma between the last author and year in my in-line citations?


title: Expandable, very specific keyval processing

text: I am having a hard time trying to come up with an fully expandable keyval parsing macro which deals only with specific keys/values. I wouldn't even attempt this in full generality, that's way beyond me. Here is as far as I've got:               \documentclass{article}     \usepackage{etoolbox}     \usepackage{ifthen}     \begin{document}          \makeatletter     \def\foo@bar{value}          \def\thing@i#1{%       \thing@ii#1&}          \def\thing@ii#1=#2&{%       \ifthenelse{\equal{#1}{form}}         {#2}         {}}          \catcode`\==11     \csuse{foo@\thing@i{form=original}}          \end{document}      Aside from the problem of having to catcode "=" (and then somehow having to catcode it back again later when "=" doesn't mean "=" any more), This doesn't work due to some expansion issue with the `\ifthen` it seems. I am a bit numb looking at this now, I've tried using `\ifx` etc. but no luck. There seems to be no way to get fully expandable keyval processing and so I'm reduced to doing something which hard-codes the possible keys etc. I have to have this because I will have macros with keyval args which need fully expanding to construct csnames.


title: JavaScript/HTML/SVG rendered inside a TeX PDF document, impossible?

text: I have a pretty general question. I have a report that is automatically created from HTML and Javascript and is output as a PDF. I'm using JavaScript because it's the best and easiest way I've found to generate the graphs I want. So I render all the graphs in HTML documents and then use a tool called `wkhtmltopdf` to render the a PDF out of all the pages. Now the problem is that the type produced by that tool absolutely _sucks_. What I want to do is render the JavaScript graphs, which renders as a `<svg ..></svg>` tag, inside a PDF document that has it's layout and text produced by some variation of TeX. Is this at all possible by any means?


title: Acrotex and Eqexam

text: I am a MacTeX 2013 user and I have installed acrotex first and then eqexam by following the directions outlined by Alan Munn found at this link: Eforms on Mac OS X I proceeded to test the installation by attempting to compile fortextbook.ltx found in the doc folder in the eqexam zip folder. I then changed line 3 to \def\mydriver{pdftex}; I commented out lines 6, 23, and line 19 (because I don’t have the lucida fonts) but I uncomment lines 4, 5, and 7,9-12, and I receive a bunch of errors for example: LaTeX Error: Command \eqemargin already defined. .. l.251 \newlength{\eqemargin} LaTeX Error: Command \prbPrtsep already defined. I have even tried compiling a smaller file such as the one found at this link: clickable problem book but I get similar error. Can someone please advise what I can do to make sure my installation correct or tell how to fix the files I am trying to compile so that they compile error free? I am not concerned with the missing psgraphs errors but only the errors that involve acrotex and eqexam.


title: Is it possible to pagebreak aligned equations?

text: The report I'm writting features a lot of long, multiple lines equations. To reduce visual polution I've been using an `aligned` environment nested inside `equation`. This way (unlike just using an `align` environment) I get only a single label for all the lines. The problem is that so many long equations often need to be broken into two pages, otherwise I get lots of blank vertical space in the document. However the `aligned` environment does not allow the `\displaybreak` command. **Is there an alternative way to achieve a pagebreak inside an aligned equation?** _Here's a sample ofthe equations I'm using_               \begin{equation}         \begin{aligned}         ...\\         ...\\  %I need to pagebreak here         ...\\     \end{aligned}\end{equation}


title: How to improve placement in a series of TiKZ nodes

text: I am a beginner in LaTeX, and TikZ trying to make an industrial document, with a series of keying patterns. I have managed to produce in the attached MWE what is needed, put I have to adjust manually the position of every half circle into the corresponding hexagon. I wonder if there would be a more sensible way to do this... (ie aligning the center of the half circle with the center of the hexagon). As I have many other configurations to show, where each half circle is to be placed at different angles, I have tried to use a \foreach loop, but could not find a way that would work....I would appreciate any help to improve the code.               \documentclass{standalone}      \usepackage[usenames,dvipsnames]{xcolor}     \usepackage{tikz} % Enabling watermarks and special graphics     \usetikzlibrary{positioning,chains, matrix,shapes,decorations,backgrounds,}     \begin{document}     \begin{tikzpicture}[every node/.style={on grid, regular polygon, regular polygon sides=6,  minimum width=10mm, minimum height=10 mm, draw, very thick, node distance=15mm, anchor= west},]     \begin{scope}     \node[draw= white, rectangle, text width=18em,  ] (0) {\textbf{Coding pattern for plug}};     \node[right of=0, xshift= 4 em,   label=above:1 ] (1) {};      \node [right of=0,  xshift= 4 em,   circle, draw, minimum size=7.8mm] {};     \node [right of=0, xshift= 4 em, yshift =1ex, semicircle, fill= black,  minimum size=3.8mm,] {};     \node[right of=1, label=above:2] (2) {};      \node [right of=1,  circle, draw, minimum size=7.8mm] {};     \node [right of=1,  semicircle, fill= black, xshift= 0.9ex, yshift= 0.5ex,  minimum size=3.8mm, rotate=-60] {};     \node [right of=1,  circle, draw, minimum size=7.8mm] {};     \node[right of=2, label=above:3] (3) {};     \node [right of=2,  circle, draw, minimum size=7.8mm] {};     \node [right of=2,  semicircle, fill= black, xshift= 0.7ex, yshift =-0.4ex,  minimum size=3.8mm, rotate=-120] {};     \end{scope}      \begin{scope}[yshift=2cm]     \node[draw= white, rectangle,text width=18em ] (0) {\textbf{Coding pattern for receptacle}};     \node[right of=0, xshift= 4 em,   label=above:4 ] (4) {};      \node [right of=0, xshift= 4 em,  yshift=-1ex, semicircle, fill= black,  minimum size=3.8mm, rotate=180] {};     \node [right of=0, xshift= 4 em,  circle, draw, minimum size=7.8mm] {};     \node[right of=4, label=above:3] (3) {};      \node [right of=4,  semicircle, fill= black,xshift=-1ex, yshift= -0.5ex, minimum size=3.8mm, rotate=120] {};     \node [right of=4,  circle, draw, minimum size=7.8mm] {};     \node[right of=3, label=above:2] (2) {};     \node [right of=3,  semicircle, fill= black, xshift=-0.7 ex, yshift=0.4ex,minimum size=3.8mm, rotate=60] {};     \node [right of=3,  circle, draw, minimum size=7.8mm] {};     \end{scope}     \end{tikzpicture}           \end{document}


title: A PostScript error when plotting an implicit function

text: This question was inspired by my answer for another question. I want to provide another solution with implicit function plot. Unfortunately the following code produces PostScript errors `/undefinedresult in --exp--`. How to fix it?               \documentclass[pstricks,border=12pt]{standalone}     \usepackage{pst-func}     \begin{document}     \begin{pspicture}(-2,-2)(2,2)       \psplotImp[linecolor=red,stepFactor=0.2,algebraic](-2,-2)(2,2){x^(2/3)+y^(2/3)-2^(2/3)}     \end{pspicture}     \end{document}


title: How to have both symbolic footnote (counters reset per page) and numeric footnote (numbering never resets) threads on top of each other?

text: I would like two footnote threads:   * one that uses traditional American footnote symbols (such as *†‡§¶‖) and whose counter is reset every page   * one that uses continuous (Arabic numeral) numbering throughout the entire document. I also like my footnote markers to be set into the margin, with a small separating space. Let's start with a minimal example:               \documentclass{memoir}          \footmarkstyle{\textsuperscript{#1\ }} % to have an additional space after footnote marks (not easily possible with the footmisc package)     \setlength{\footmarkwidth}{-1sp} \setlength{\footmarksep}{0em} % same effect as \usepackage[flushmargin]{footmisc}     \counterwithout{footnote}{chapter} % continuous numbering of footnotes across chapters          \begin{document}          \chapter{Introduction}     This is dummy text.\footnote{This numeric footnote should be prefixed by the counter 1, as it currently is.}          \chapter{Document body}     This is dummy text.\footnote{This numeric footnote should be prefixed by the counter 2, as it currently is.}     This is dummy text.\footnote{I want this footnote to be introduced by the symbol \(^{*}\) and be placed above the previous footnote, even though it comes later in the text.}          \end{document}      Basically, the last footnote should be symbolic and should appear above the numerical ones; in general a stack of symbolic ones should appear above a stack of numeric ones on any given page, _without_ additional vertical separation. (Bonus if there is an easy way for me to specify the symbol sequence.) _There isa related question, but this one is different in coverage and trickier._


title: \newcommand that restricts the value of an argument

text: When defining a macro, is it possible to restrict the value of an argument, so that if the thing followed it is a number, then it takes it as an argument, but if it is not, then it is just empty. To be concrete, I defined               \newcommand{\R}[1]{\ensuremath{\mathbb{R}^{#1}}}      for a real vector space, so the `\R2` and `\R3` give the 2-dim and 3-dim real spaces respectively. But what do I do if I want to input `\R` only?


title: inserting tikzstyle objects into sty files

text: I am trying to put a tikz object (pie chart) into the sty file so it will update its shape as the presentation proceeds (instead of `\insertframenumber/\inserttotalframenumber`). the code for the pie chart object is:                         \tikzstyle{pie chart}=[           chart,           slice/.style={line cap=round, line join=round, very thick,draw=white},           pie title/.style={font={\bf}},           slice type/.style 2 args={               ##1/.style={fill=##2},               values of ##1/.style={}           }           ]           \pgfdeclarelayer{background}           \pgfdeclarelayer{foreground}           \pgfsetlayers{background,main,foreground}           \newcommand{\pie}[3][]{           \begin{scope}[#1]           \pgfmathsetmacro{\curA}{90}           \pgfmathsetmacro{\r}{1}           \def\c{(0,0)}           \node[pie title] at (90:1.3) {#2};           \foreach \v/\s in{#3}{               \pgfmathsetmacro{\deltaA}{\v/100*360}               \pgfmathsetmacro{\nextA}{\curA + \deltaA}               \pgfmathsetmacro{\midA}{(\curA+\nextA)/2}                    \path[slice,\s] \c                   -- +(\curA:\r)                   arc (\curA:\nextA:\r)                   -- cycle;               \pgfmathsetmacro{\d}{max((\deltaA * -(.4/50) + 1) , .5)}                    %\begin{pgfonlayer}{foreground}               %\path \c -- node[pos=\d,pie values,values of \s]{$\v\%$} +(\midA:\r);               %\end{pgfonlayer}                    \global\let\curA\nextA           }           \end{scope}      and in the footer i want to have the shape itself                 \newcommand{\Ffootline}{       \insertsection        \hfill     \textit{Center Text}       \hfill       \begin{tikzpicture}       [       pie chart,       slice type={inlined}{lightgray},       slice type={noninlined}{darkgray},       pie values/.style={font={\tiny}},       scale=.5       ]       \pie{}{(\insertframenumber/\inserttotalframenumber)/inlined,(1-(\insertframenumber/\inserttotalframenumber))/noninlined}       \end{tikzpicture}      The error that i am getting now when running a simple tex (at the line after the sty is called) file is: > File ended while scanning use of \@xargdef} **here is the tex file (which works) that I am trying to turn into part of a *.sty file (example file):**               \documentclass{beamer}     \usepackage{graphicx}     \usepackage{graphics}     \usepackage{hyperref}     \usepackage{tikz,pgfplots, pgfplotstable}     \usepackage[english]{babel}     \usepgfplotslibrary{ternary, units}               \newenvironment{wideitemize}{\itemize\addtolength{\itemsep}{10pt}}{\enditemize}          \mode<presentation>         {         \usetheme{moo}         \setbeamercovered{transparent = 28}         }          \title{tikz in beamer}     \subtitle{test file}     \author{Yonicd}\institute{HUJI}          \begin{document}               \tikzstyle{chart}=[     legend label/.style={font={\scriptsize},anchor=west,align=left},     legend box/.style={rectangle, draw, minimum size=5pt},     axis/.style={black,semithick,->},     axis label/.style={anchor=east,font={\tiny}},     ]     \tikzstyle{pie chart}=[     chart,     slice/.style={line cap=round, line join=round, very thick,draw=white},     pie title/.style={font={\bf}},     slice type/.style 2 args={         ##1/.style={fill=##2},         values of ##1/.style={}     }     ]     \pgfdeclarelayer{background}     \pgfdeclarelayer{foreground}     \pgfsetlayers{background,main,foreground}     \newcommand{\pie}[3][]{     \begin{scope}[#1]     \pgfmathsetmacro{\curA}{90}     \pgfmathsetmacro{\r}{1}     \def\c{(0,0)}     \node[pie title] at (90:1.3) {#2};     \foreach \v/\s in{#3}{         \pgfmathsetmacro{\deltaA}{\v/100*360}         \pgfmathsetmacro{\nextA}{\curA + \deltaA}         \pgfmathsetmacro{\midA}{(\curA+\nextA)/2}              \path[slice,\s] \c             -- +(\curA:\r)             arc (\curA:\nextA:\r)             -- cycle;         \pgfmathsetmacro{\d}{max((\deltaA * -(.4/50) + 1) , .5)}         \global\let\curA\nextA     }     \end{scope}     }          \begin{frame}[plain]         \titlepage     \end{frame}               \AtBeginSection[]     {        \begin{frame}            \frametitle{Outline}            \tableofcontents[currentsection]        \end{frame}     }          \section{New Section}          \begin{frame}         \frametitle{Testing}     \begin{figure}     \begin{tikzpicture}     [     pie chart,     slice type={inlined}{lightgray},     slice type={noninlined}{darkgray},     pie values/.style={font={\tiny}},     scale=.5     ]     \pie{}{90/inlined,10/noninlined}     \end{tikzpicture}     \end{figure}     \end{frame}          \end{document}


title: Problem with \doublerulesepcolor in colortbl

text: I would like a table where the background of the first line is gray and the background of the rest of the table is white. The problem is that the table has a double column line. I have tried `\doublerulesepcolor` but it allows me to put color between the two column lines for ALL the table and not for just the first line.               \documentclass{report}     \usepackage{colortbl}     \begin{document}          \begin{verbatim}     \definecolor{Lightgray}{gray}{.80}     \doublerulesepcolor{Lightgray}      \begin{tabular}[t]{|c|c||c|}\hline      \rowcolor[gray]{.8} CityFrom & CityTo & Count\\\hline      \doublerulesepcolor{white}      a & c & 2\\      a & e & 1\\\hline     \end{tabular}     \end{verbatim}          \begin{center}     \definecolor{Lightgray}{gray}{.80}     \doublerulesepcolor{Lightgray}      \begin{tabular}[t]{|c|c||c|}\hline      \rowcolor[gray]{.8} CityFrom & CityTo & Count\\\hline      \doublerulesepcolor{white}      a & c & 2\\      a & e & 1\\\hline      \end{tabular}     \end{center}          While trying to solve the problem I realized that \verb+\arrayrulecolor+ can be changed at each line     but this not the case with \verb+\doublerulesepcolor+          \begin{verbatim}     \definecolor{Lightgray}{gray}{.80}     \setlength\arrayrulewidth{2pt}     \doublerulesepcolor{Lightgray}      \begin{tabular}[t]{|c|c||c|}\hline      \rowcolor[gray]{.8} CityFrom & CityTo & Count\\\hline      \arrayrulecolor{red}\doublerulesepcolor{red}      a & c & 2\\      \arrayrulecolor{blue}\doublerulesepcolor{blue}       a & e & 1\\\hline      \end{tabular}     \end{verbatim}          \begin{center}     \definecolor{Lightgray}{gray}{.80}     \setlength\arrayrulewidth{2pt}     \doublerulesepcolor{Lightgray}      \begin{tabular}[t]{|c|c||c|}\hline      \rowcolor[gray]{.8} CityFrom & CityTo & Count\\\hline      \arrayrulecolor{red}\doublerulesepcolor{red}      a & c & 2\\      \arrayrulecolor{blue}\doublerulesepcolor{blue}       a & e & 1\\\hline      \end{tabular}     \end{center}          What is needed is that \verb+\doublerulesepcolor+ has a ``local" behavior as \verb+\arrayrulecolor+.          Any hint how to obtain this ?          Regards          Esteban          \end{document}


title: `hhline` adding a strange vertical line distortion

text: I am using horizontal and vertical lines in a `longtable` environment to create a kind of tree-like internal structure. Since I need to color some cells with the `colortbl` package, I can't use `\cline`, so I've tried to use the `hhline` package instead. This mostly works; however, there is a strange distortion in some of the vertical lines: ![problem](http://i.stack.imgur.com/ViSlY.png) I do not fully understand what is going on here - where is this distorted pixel (?) coming from, and how do I put it back into its place? (Also, if there is a more elegant way to draw a tree-table like this, I would be happy to learn about it…)               \documentclass{article}     \usepackage{array}     \usepackage{longtable}     \usepackage{hhline}          \newcommand{\mc}[2]{\multicolumn{#1}{|l}{#2}}          \begin{document}       \begin{longtable}{|lllll|}         \hline         \mc{3}{one}                                & foo & bar \\                     & \mc{2}{two}                  & foo & bar \\                      & \mc{1}{}     & \mc{1}{three} & foo & bar \\                      & \mc{1}{}     & \mc{1}{four}  & foo & bar \\          \hhline{|~|~---}                         & \mc{1}{}     &               &     &     \\                     & \mc{2}{five}                 & foo & bar \\                      & \mc{1}{}     & \mc{1}{six}   & foo & bar \\                      & \mc{1}{}     & \mc{1}{seven} & foo & bar \\          \hhline{|~|~---}                         & \mc{1}{}     &               &     &     \\         \hhline{|~----}                         &              &               &     &     \\         \hline       \end{longtable}     \end{document}


title: Possible to call "command codes" from LaTeX?

text: I'm reading through tex.web:               @ Next are the ordinary run-of-the-mill command codes.  Codes that are     |min_internal| or more represent internal quantities that might be     expanded by `\.{\\the}'.          @d char_num=16 {character specified numerically ( \.{\\char} )}     ...      ... and I would actually like to call this one:               @d remove_item=25 {nullify last item ( \.{\\unpenalty},       \.{\\unkern}, \.{\\unskip} )}      Is it possible to somehow call these "ordinary" "command codes" from LaTeX - and how might they be "expanded by \the"? * * * Edit: to clarify: above I see a "command" called `remove_item` which has some sort of a code of `25`. Is it possible to call this command from LaTeX - maybe through `\catcode25` (which doesn't work) or something similar (I'm speculating here: say, something like `\cmd:remove_item`)? I don't understand the source code of Tex - but the way I read the above, there is an internal command `remove_item` in TeX, which apparently calls `\unpenalty \unkern \unskip`. I was hoping there is a way to call this `remove_item` from Latex...


title: new command with cases / conditionals / 'if... then's

text: Suppose I want to define a command, say, `\tree` with, say, two arguments. I would like `\tree` to do different things depending on what my first argument is. For example, if `#1` = a, then return `$\sqrt{#2}$` if `#1` = b, then return "Hi" Is it possible to realise the above pseudocode? If so, how can I?


title: Dashed axis lines

text: How can make the axis lines that go from the origin to each of the coordinates dashed? For instance I want the axis line that goes from (0,0,0) to (0,0,1) to be dashed.               \documentclass[tikz]{standalone}          \usepackage{pgfplots}     \pgfplotsset{compat=newest}          \begin{document}     \begin{tikzpicture}[scale=1]       \begin{axis}[view={40}{20}, ticks = none, axis on top, axis lines=center, y         dir=reverse, ymin=0, ymax=2, xmin=0, xmax=2, zmin=0, zmax=2,         xlabel=$p_{1}$, ylabel=$p_{2}$, zlabel=$p_{3}$, every axis y label/.append         style={at=(ticklabel* cs:0)}]            \addplot3[thick,mark=*] coordinates {(1,0,0) (0,1,0) (0,0,1)} --cycle;       \node [above right] at (axis cs:1,0,0) {$(1,0,0)$};       \node [above left] at (axis cs:0,1,0) {$(0,1,0)$};       \node [above right] at (axis cs:0,0,1) {$(0,0,1)$};       \end{axis}     \end{tikzpicture}     \end{document}


title: Multiple output pdfs with limited info in one

text: I am making my resume using and for xelatex. Certain versions of my resume have my name and address, they others, those which are public do not. Is there an easy way to hide this information on the public versions. As of now I just run               xelatex file.tex      I really don't want to have to go in and edit the file every time. any ideas?


title: vertical spacing for itemize environment with powerdot

text: I'm trying to increase the vertical spacing in an `itemize` environment with the `powerdot` class. According to the `powerdot` documentation this is achieved by changing some parameters values in the `\pdsetup{}` command, I have tried but my code does not change anything:               \documentclass[         size=12pt,         paper=screen,         mode=present,         display=slidesnotes,         nohandoutpagebreaks,         pauseslide,         fleqn         ]{powerdot}          \begin{document}          \pdsetup{         itemize={labelsep=10cm,leftmargin=*,itemsep=10cm,topsep=10cm,parsep=10cm}     }          \begin{slide}{title of the slide}       \begin{itemize}     \item  Hello           \item Hello     \end{itemize}     \end{slide}           \end{document}


title: How do I hang another, right-aligned line in a cases environment?

text: I've seen these questions, but in my case the equation content is too long to add the text description at the end and it overflows into the margin.               \[     d_i(g_n,\ldots,g_0) =     \begin{cases}      (d_0g_ng_{n-1},g_{n-2},\ldots,g_0),& \text{if $i=0$;}\\      (d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), &\text{if  $i=1,\ldots,n-1$;}\\      (d_ng_n,\ldots,d_1g_1),& \text{if $i=0$}      \end{cases}\\     \]      What I'd like is something similar to would be produced by replacing the one overly long line by the two lines                (d_ig_n,\ldots,d_1g_{n-i+1},d_0g_{n-i}g_{n-i-1},g_{n-i-2},\ldots,g_0), &\\      & \hspace{-10.5ex}\text{if  $i=1,\ldots,n-1$;}\\      ...but this is clearly not the way to do it. I'd also prefer not to break the long equation itself onto two lines, only put the text on the next line. Is there some nice way that will end up with the result that the semicolons are aligned automatically without tweaking the horizontal spacing?


title: How to specify a fill color in RGB format in a node in tikzpicture?

text: I am just trying to get a rounded corner box with some text in it. The text color will be white and the box will be filled with a particular color. The preamble includes:               \usepackage{tikz}     \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%     decorations.pathreplacing,decorations.pathmorphing,shapes,%     matrix,shapes.symbols,plotmarks,decorations.markings,shadows}      The code I have used is:               \begin{tikzpicture}     \node[drop shadow,fill=black,draw,rounded corners]     {\textcolor{white}{TEST}};     \end{tikzpicture}      How can I specify an arbitrary color (RGB values in a range of 0-255) in the fill option? Also, am I using too advanced a tool (tikz) to do something simple (draw a rounded corner rectangle filled with a color and text of some other color)?


title: How to "get" the size of the section header

text: I've got to format some text in the style of the section header. So what I would like to do is sort of "get" the parameters that define the section header (i.e. size, formatting, fontstyle) and apply that to the text. However, I'm too much of a newbie in tex and googling didn't really help me out. I'd rally appreciate hints :-)


title: Custom Command cannot use equation mode?

text: I have defined a new command below, but when ever I pass an equation into, it will not work.               \newcommand{\defn}[1]{     {\textbf{Definition}}\\       \parbox{5.2in}{\begin{flushright} \fbox{#1}\end{flushright} } }      This is what it allows me to do:               \defn{If $f$ is integrable over the interval $[a,b]$, we define $\int_{b}^{a} f(x)\ dx$ }      However, this is what I want to do:               \defn{If $f$ is integrable over the interval $[a,b]$, we define      $$\int_{b}^{a} f(x)\ dx$$ }      Or alternatively,                \defn{If $f$ is integrable over the interval $[a,b]$, we define        \begin{equation*}         \int_{b}^{a} f(x)\ dx       \end{equation}}      I would greatly appreciate any help. Thank you.


title: Page Numbering and Header Problem, with Margin and Multicols

text: **1)** The chapter page with margin, page numbering is not in the center. My code is,               \documentclass[a4paper,12pt]{book}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{lmodern}     \usepackage{multicol}     \usepackage{lipsum}     \usepackage{ifthen}     \usepackage{fancyhdr}          \usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=2.5cm,      marginparwidth=6cm,marginparsep=1cm,outer=8cm]{geometry}          \usepackage{showframe}          \begin{document}     \chapter{Chapter Name}     \section{Section Name}     \end{document}      ![enter image description here](http://i.stack.imgur.com/P3ZAF.png) Page numbering is what do I need to do to be in centre? **2)** Odd and even pages header is writing short. As follows, Odd page is, ![enter image description here](http://i.stack.imgur.com/lXpY8.png) Even Page is, ![enter image description here](http://i.stack.imgur.com/F6IEG.png) But I would like this, odd and even pages header is writing long (included marginparwidth). As follow, Odd page is, ![enter image description here](http://i.stack.imgur.com/2NN3E.png) Even page is, ![enter image description here](http://i.stack.imgur.com/iwxSP.png) **3)**               \newgeometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=2.5cm}     \setlength{\columnsep}{1cm}     \section{Multicols Page}     \begin{multicols}{2}     \lipsum[1-8]     \end{multicols}      This code is displaying in the new page. I don't want to this. I want immediately resume here with margin page. So, top of the page with MARGIN, bottom of the page MULTıCOLS. ![enter image description here](http://i.stack.imgur.com/VluSa.png) How solutions should be?


title: Compile error with MWE using pgfkeys, beamer, xparse and \includegraphics

text: First, please apologize the vague title, but I do not understand the problem enough to give a more exact title. The following MWE does not compile with a `missing \endcsname inserted` error around `\linewidth` with `pdflatex` and `lualatex`.               \documentclass{beamer}     % \documentclass{article}          \usepackage{pgfkeys}     \usepackage{xparse}     \usepackage{graphicx}          \pgfkeys{         /tikzscale/.is family, /tikzscale,         width/.code = {\the#1},     }          \RenewDocumentCommand{\includegraphics}{O{}}{%     % \renewcommand{\includegraphics}[1][]{%             \pgfkeys{/tikzscale, #1}%     }          \begin{document}         \includegraphics[width=\linewidth]         text     \end{document}      If either of both commented lines is uncommented (while commenting the line above), the file compiles, i.e. the combination of `pgfkeys`, `beamer`, `xparse` and `\includegraphics` seems to trigger the error. Putting `\AtBeginDocument` around the redefinition of `\includegraphics` does also solve the problem. Why doesn't this combination work? What is the difference between `\RenewDocumentCommand` and `\renewcommand` in this context?


title: Usage of minted inside newenvironment in minted 2.0a³

text: As a followup question to Lstinline macro inside another environment, I kind of want to do the same thing for `minted` as well, but I'm held back by the following: I used the code from Using minted to define a new environment but that doesn't seem to work so well for the latest version of `minted` (version 2.0 alpha 3). `\mintinline` works nicely in the latest version. Preferrably I wouldn't want to choose between the two. Any known workaround to this?               \documentclass[10pt]{article}     \makeatletter     \IfFileExists{minted.sty}{%     \usepackage{minted}     \usemintedstyle{euryris}     \usepackage{lineno}     \def\gobble##1{}     \renewcommand\DeleteFile[1]{}     \newenvironment{MyEnvironment}{% works fine in v1.7 ?       \VerbatimEnvironment       \minted@resetoptions       \setkeys{minted@opt}{}       \begin{center}         \begin{minipage}{\linewidth}               \begin{VerbatimOut}{\jobname.pyg}}     {%           \end{VerbatimOut}           \minted@pygmentize{python}           \DeleteFile{\jobname.pyg}         \end{minipage}         \end{center}}     }{}     \makeatother     \begin{document}          \section{Environment}     Have some python code:     \begin{MyEnvironment}     print(x**2)     \end{MyEnvironment}     ...as the pleasure is all mine.          \section{Inline code}     Some serious inline code right here:~\mintinline{python}{print(x**2)}. Some seriously ugly \jobname.pyg to the right % works fine in v2.0 ?     \end{document}      I'm also looking to embed `\mintinline` inside another macro. Not sure if the same recipe as `lstinline` applies?


title: Over citation in Springer template with pdflatex

text: I'm writing a paper for a Springer journal. So I downloaded the LaTeX template. http://www.springer.com/cda/content/document/cda_downloaddocument/LaTeX.zip The problem is that multiple citations (e.g. `\cite{A,B,C}`) protrude into the right margin, i.e., no line break is added automatically.               In previous work [A, 2011, B, 2010, C, 2009]     , suggests      But I want to write it like this.               In previous work [A, 2011, B, 2010,     C, 2009], suggests      I use `spbasic` and `apalike`, but the problem is not fixed.               \bibliographystyle{spbasic}     \bibliographystyle{apalike}      Is there any good bibliography style for writing a Springer journal paper? Or how can I solve this problem?


title: Current Arrows in Circuitikz

text: I would like to label a current arrow in circuitikz with the label:               i=$i(x+\Delta x,t)$       but it does not appear correctly. My code is:               \documentclass[]{article}     \usepackage{mathtools}     \usepackage{graphicx}     \usepackage{amsmath}     \usepackage{array}     \usepackage{bm}     \usepackage{circuitikz}     \usepackage{tikz}     \usepackage{siunitx}     \usepackage[hypcap]{caption}     \begin{document}          \begin{center}\begin{circuitikz} \draw     (0,0) to[short,i=$i(x+\Delta x,t)$] (4,0)     ; \end{circuitikz} \end{center}          \end{document}      What happens is this: ![](http://i.stack.imgur.com/0BpM2.png) Is it possible to label it like this? I ideally want an arrow which I can label, and I thought this would be the easiest way to do so. Anything like this ![](http://i.stack.imgur.com/OGEOj.png) would be fine. I've tried another suggestion of doing `\draw[-latex] (2.5,0.5) -- (1.5,0.5);` to get this but it does not work for me. Thanks


title: How to repeat text

text: I get interesting errors with the following macro. Mostly it works, but I get extra spaces after `\noindent` (but not after `\newline`). I tried using `\loop` or `\whiledo` (from `ifthen`) but get stack overflows. The really strange stuff occurs when I try to repeat `&` symbols (the log shows everything working until TeX throws in an extra `\fi`).               \documentclass{article}          \tracingmacros=1     \newcounter{tempcount}          \newcommand{\append}[3]{ % #1 = start of text, #2 = text to repeat, #3 = number of repetitions     \ifnum #3>0%     \setcounter{tempcount}{#3}%     \addtocounter{tempcount}{-1}%     \append{#1#2}{#2}{\arabic{tempcount}}     \else #1 \fi}          \begin{document}          \noindent\append{c}{c}{0}          \noindent\append{c}{c}{1}          \noindent\append{c}{c}{2}          \noindent\append{c}{c}{3}          \noindent\begin{tabular}{\append{c}{c}{2}}     1&2&3\\     \append{start}{&test}{1}\\     \append{start}{&test}{2}     \end{tabular}          \end{document}      I should mention that I've played with `\noexpand` to no avail. ![enter image description here](http://i.stack.imgur.com/b6SKn.png)


title: How to avoid a spurious space when combining frame, centering and another environment?

text: I want to create a special environment in `beamer`, which combines several environments, one of which is `center`. However, when using my newly created environment, I get an additional space in comparison to using the commands manually. Here is a minimal example:               \documentclass[20pt]{beamer}          \newenvironment{myenv}     {\begin{frame}[fragile,environment=myenv]\begin{center}\begin{tabular}{c}}     {\end{tabular}\end{center}\end{frame}}          \begin{document}          \begin{myenv}%     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%     \end{myenv}          \begin{frame}\begin{center}\begin{tabular}{c}%     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx%     \end{tabular}\end{center}\end{frame}          \end{document}      In the second frame, the text is centred as intended; in the first frame it is shifted to the left as if it contained an additional space at the end. The same happens with some environments other than `tabular` but not if I do not nest another environment inside `center`. Using `\ignorespacesafterend` does not help.


title: Missing chapter name when using fancyhdr

text: I want to get the following header: Left page: `\thepage\hfill\chaptername{}\thechapter` Right page: `\chaptername\hfill\thepage` So I write:               \documentclass{book}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{Arial}     \setsansfont{Arial}     \setromanfont{Arial}     \setmonofont{DejaVu Sans Mono}          \usepackage{fancyhdr}          \fancyhf{}     \fancyhead[LO]{\thechapter}     \fancyhead[RE]{\chaptername}     \fancyhead[LE,RO]{\thepage}     \pagestyle{fancy}          \begin{document}          \chapter{foo}          Foo!          \chapter{bar}          Bar!          \chapter{baz}          Baz!          \end{document}      but it doesn't print chapter name in header. What do I do wrong? **Edit** : Current best bet:               \documentclass{book}          \usepackage{fontspec} % enagles loading of OpenType fonts     \usepackage{polyglossia} % support for languages          % fonts:     \defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text} % without this XeLaTeX won't turn "--" into dashes     \setmainfont{Arial}     \setsansfont{Arial}     \setromanfont{Arial}     \setmonofont{DejaVu Sans Mono}          \usepackage{fancyhdr}          \renewcommand{\rightmark}[1]{\markboth{#1}{}}     \renewcommand{\leftmark}[1]{\chaptername{}\thechapter}     \fancyhf{}     \fancyhead[LO]{\leftmark}     \fancyhead[RE]{\rightmark}     \fancyhead[LE,RO]{\thepage}     \pagestyle{fancy}          \begin{document}          \chapter{foo}          Foo!          \chapter{bar}          Bar!          \chapter{baz}          Baz!          \end{document}


title: Subscripts in partial derivatives

text: I would like to print the partial derivative operator `$\frac{\partial}{\partial k_x}$`, but the spacing and the length of the bar bug me a little. I would really like the fraction to be typeset as `$\frac{\partial}{\partial k}$` (which has a shorter bar and the upper `$\partial$` further to the left), with the subscript `${}_x$` added afterwards. I'm definitely sure this is possible. What would be the quickest, cleanest way?


title: Styling definitions

text: In the current paper I am writing I make an extensive use of definitions, therefore I've added the `amsthm` package to my document and I've defined a new command:               \newtheorem{definition}{Definition}      so that I can call it in my document in the following way:               \begin{definition}     ...     \end{definition}      Everything works ok, but I would like to change the appearance of these definitions, giving them a cleaner look. By default, this is how the definitions look like: ![enter image description here](http://i.stack.imgur.com/uJpMz.png) This is what I would like to have:   1. Make the text normal and not italicized, so that `\emph{}` commands can look the way they are supposed to   2. After **Definition 10** I would like to have the name of the defined notion, so for example: **Definition 10 - Algebra**   3. I would like to break the line after the end of the definition heading, so that the actual definition begins on the following line   4. Finally, it would be nice to have a way to separate the definition title from the definition itself, for example with a line above and below the definition title (something like a box) Are all of these things possible?


title: Venn diagrams for fuzzy logic

text: I've seen a lot of code samples for producing Venn diagrams. I'm looking for a way to draw similar but different diagrams related to fuzzy logic (see the second row in the screenshot below). How could I produce those? ![enter image description here](http://i.stack.imgur.com/84bw5.png)


title: 'Undefined control sequence \setkomavar'

text: I ran into the error:               'Undefined control sequence     l.12 \setkomavar{subject}{Regarding: Code 123.456}'      My document preamble looks like this:               \documentclass{letter}     \usepackage{hyperref}     \usepackage[english]{babel}          \signature{M.Y. Name}     \address{Street \\ Place \\ ZIP-code}               \begin{document}               \begin{letter}{Recipient \\ I know where your bed sleeps \\ I know where your house lives}               \setkomavar{subject}{Regarding: Code 123.456}               \opening{Dear Sir, Madam}               \end{letter}               \end{document}      What went wrong?


title: What is the BibTeX category of a monograph that appeared in a series?

text: I would like to cite the following book (the author refers to the work as book several times), which appeared in a series: http://link.springer.com/book/10.1007%2F978-1-4419-1740-9 On the very first page of the PDF document I read "[...] the series: _Interdisciplinary Applied Mathematics_ " and then "The series will consist of monographs and high-level texts from researchers [...]". The PDF file has 492 pages. I would like to refer to the entire book. If I put it into the `INCOLLECTION` category I get: `Warning--empty pages in Seydel10` If I put it into the `BOOK` category I get `Warning--can't use both author and editor fields in Seydel10` The BibTeX entry is:               @BOOK{Seydel10,       AUTHOR = {R{\"u}diger Seydel},       EDITOR = {S.S. Antman and L. Sirovich and J.E. Marsden},       TITLE = {{Practical Bifurcation and Stability Analysis}},       SERIES = {{Interdisciplinary Applied Mathematics}},       VOLUME = {5},       YEAR = {2010},       PUBLISHER = {{Dordrecht, The Netherlands: Springer}}     }      **How do I refer to this book properly?** * * * Edit: OK, apparently the `.bst` file is also important, I did not know that, sorry. `\bibliographystyle{elsarticle-harv}` and is downloadable from here. * * * I got two excellent answers, they both answer my concerns. I decided to accept Bernard's answer because he "only" has 9.3k reputation points and Mico already has 74k at the time of writing.


title: Add header text to bibliography

text: I want to add an extra paragraph into my bibliography section, under the title, before the first references. ![enter image description here](http://i.stack.imgur.com/WwRIo.png) Is this even remotely possible, or do I need to look for another way around? I'm using the acmsmall.cls layout - my bibliography is currently built like this:               \begin{thebibliography}{}          %%%I want to add a statement here!          \bibitem{G}     Carretero, J., Isaila, F., Kermarrec, A. M., Taïani, F., \& Tirado, J. M.      (2012, June).      Geology: Modular georecommendation in gossip-based social networks.      In Distributed Computing Systems (ICDCS), 2012 IEEE 32nd International Conference on (pp. 637-646).      IEEE.               \end{thebibliography}


title: Header and footer alignment

text: After typesetting, the page numbers in my document fluctuates from right aligned to centre aligned. How can I ensure a specific and consistent page number alignment?               \documentclass[a4paper,12pt, oneside, final]{book}     \usepackage[UKenglish]{babel}% http://ctan.org/pkg/babel     \usepackage[UKenglish]{isodate}% http://ctan.org/pkg/isodate     %Original date format: \today \par     \cleanlookdateon% Remove ordinal day reference     %Modified date format: \today     %\usepackage[utf8]{inputenc}     \usepackage{microtype}     %\usepackage{graphicx}     \usepackage{picinpar,graphicx}     \usepackage{titlesec}     %\usepackage{secdot}     \usepackage{blindtext}     \usepackage{titlesec}     %\titlelabel{\thetitle.\quad}     \usepackage{floatflt}     \usepackage[inner=2.5cm, outer=2.5cm, top=2.5cm, bottom=2.5cm, bindingoffset=1cm]{geometry}     %\usepackage[english]{babel}     \usepackage[translate=babel]{glossaries}     \usepackage{tabularx}     \usepackage{tabulary}     \usepackage{fancyhdr}     \usepackage{fncychap}     \usepackage{paralist}     %\ChTitleUpperCase     \ChNameUpperCase     \ChNameVar{\centering\Huge\rm\bfseries}     \ChNumVar{\Huge}     \ChTitleVar{\centering\Huge\rm\bfseries}     \renewcommand{\cfttabfont}{Table }     \renewcommand{\cftfigfont}{Figure }     %usepackage{tocloft}     %\centering\Huge\rm\bfseries     %\usepackage{xcolor}     %\usepackage{color}\     %\usepackage{appendix}     %\autoref{app:...}     %\addtocontents{toc}{\cftpagenumberson{chapter}}     %\addtocontents{toc}{\cftpagenumberson}     %See MikTeX and Advanced LaTeX.pdf     %microtype is used for justification of paragraphs     %\usepackage{parskip}     %\usepackage[doublespacing]{setspace}     \setcounter{tocdepth}{5}     %\usepackage{parskip}     \usepackage[doublespacing]{setspace}     \usepackage{hyperref}     \usepackage{glossaries}     \usepackage{tocloft}     \renewcommand\cftchapaftersnum{.}% adds dot after chapter title in ToC     \renewcommand\cftchapdotsep{\cftdotsep}% adds leader dots from chapter titles to page numbers     \usepackage{etoolbox}     \makeatletter     % scale dots     \newcommand\mydot[1]{\scalebox{#1}{.}}     \patchcmd{\@dottedtocline}       {\hbox{.}}       {\hbox{\mydot{2}}}       {}       {}     % change separation between dots     \renewcommand\@dotsep{10} %default: 4.5     \makeatother     \fancyhf{}     \fancyhead[LE]{\leftmark}     \fancyhead[RO]{\nouppercase{\rightmark}}     \fancyfoot[LE,RO]{\thepage}     \pagestyle{fancy}     \newcommand{\HRule}{\rule{\linewidth}{0.2mm}}     %\usepackage{tocloft}     %\setlength\cftparskip{-2pt}     %\setlength\cftbeforesecskip{1pt}     %\setlength\cftaftertoctitleskip{1pt}     \usepackage[titles]{tocloft}     \setlength{\cftbeforechapskip}{.1ex}     \setlength{\cftbeforesecskip}{-.5ex}     \usepackage{lipsum} % placeholder text     \usepackage[font=small,format=plain,labelfont=bf,up,textfont=pl,up]{caption}


title: Automatic non-breaking spaces in proper name initials

text: I need to use non-breaking spaces in proper name initials, e.g.               J.~W.~Bush      Any way to make LaTeX replace regular spaces with non-breaking ones for such cases? Or would I better preprocess my tex files with some regexp/script?


title: How to change author alignment in Beamer?

text: It appears that different classes set up author layouts using tables. I would like to render one of these outputs: Equivalent to `\begin{tabular}{rl}`:                 Joe Schmoe My Boss         Jane Doe His Boss      or, equivalent to `\raggedleft`:                 Joe Schmoe My Boss        Jane Doe His Boss      from something resembling this M(N)WE:               \documentclass{beamer}          \author{%     Joe Schmoe, My Boss%     \and     Jane Doe, His Boss%     }          \begin{document}     \maketitle     \end{document}      I don't mind using `\institute` or something equivalent for job title, and I can even drop the job title to see a simple solution. In some other document classes there is a nice solution involving `\preauthor`, which I could modify in my style file. Unfortunately, I get an unknown command error in Beamer 3 on `\preauthor` with that code. Are there equivalent constructs in Beamer? There is also another approach that uses a tabular environment but that also fails in Beamer. Ideally, I would like to change `\defbeamertemplate*{title page}{default theme}{...` in my beamer style file, so that I could still use `\author{}` with all its trimmings in the main file, but since I do not use authors anywhere else on the slide, a solution using some kind of box in the main source would work as well.