title: Why doesn't yshift seem to work in tikzcd?

text: In the tikz-cd documentation, the following code snipped is given:               \begin{tikzcd}     A \arrow[yshift=0.7ex]{r} \arrow[yshift=-0.7ex]{r}     & B \arrow[xshift=0.7ex]{d} \arrow[xshift=-0.7ex]{d} \\     & C     \end{tikzcd}      and the following is shown as example output: ![enter image description here](http://i.stack.imgur.com/teNFW.jpg) However, when I copy and paste this code into my document and attempt to run it, the result looks like this instead: ![enter image description here](http://i.stack.imgur.com/kMXoc.jpg) What's going on here?


title: Chemmacros Experimental Environment Superscript

text: I am using the `chemmacros` package to typeset the experimental data of my research report. However, the options provided as settings for the output don't fit my needs. I would like to have atom numbers of the nuclei as superscripts instead of using a dash or a subscript. However, in the documentation a could only find the options side and sub. Is there a way of setting a superscript position? Currently I am using the following settings:               \documentclass[a4paper,10pt,bibliography=totoc,listof=totoc]{scrreprt}     \usepackage{chemmacros}     \usepackage{siunitx}     \chemsetup[nmr]{delta=(ppm),pos-number=side,use-equal,format = \bfseries,list=true}            \sisetup{separate-uncertainty,per-mode=symbol,detect-all,range-phrase=--}          \begin{document}     \begin{experimental}          \NMR(600)[CDCl3] \val{2.01} (s, \#{24}, \pos{5}), \val{2.31} (s, \#{12},\pos{6})\\     \data{IR} ...          \end{experimental}     \end{document}      Any help or suggestions are greatly appreciated. P.S. Is there a reason why the `nmr` option group is setting up the whole look of the experimental section? I was looking through the documentation for a more general option, but then found that this would do it.


title: Drawing a semicircle in 3D with pgfplots

text: I'm trying to make a plot of a torus with a semicircle drawn on its surface. The following MWE               \documentclass{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \begin{document}     \begin{tikzpicture}         \begin{axis}[hide axis,             axis equal,             view={-37.5}{30}]                 \addplot3[surf,                 shader=interp,                 samples=20,                 domain=0:2*pi,y domain=-pi:pi,                 z buffer=sort]                 ({(1+0.25*cos(deg(x)))*cos(deg(y))},                   {(1+0.25*cos(deg(x)))*sin(deg(y))},                   {0.25*sin(deg(x))});                      \addplot3[color=black,                 samples=20,                 domain=0:pi,                 line width=2.0pt]                 ({cos(deg(x))},                   {sin(deg(x))},                   {0.25});         \end{axis}     \end{tikzpicture}     \end{document}      generates ![torus](http://i.stack.imgur.com/ckEcx.jpg) which shows the problem: the semicircle gets closed. I'm not particularly well-versed in `pgfplots` (most of the above is stuff I picked up from examples and plots generated with the Matlab script `matlab2tikz`). Is there an easy way to get the unclosed semicircle I'm after? * * * Just did a quick test: the following code               \documentclass{standalone}     \usepackage{pgfplots}     \pgfplotsset{compat=newest}     \begin{document}     \begin{tikzpicture}         \begin{axis}[hide axis,             axis equal]                 \addplot[color=black,                 samples=20,                 domain=0:pi,                 line width=2.0pt]                 ({cos(deg(x))},                   {sin(deg(x))});         \end{axis}     \end{tikzpicture}     \end{document}      shows that this problem doesn't occur in a 2D plot: ![semicircle2D](http://i.stack.imgur.com/t1NkT.jpg)


title: Puzzled as to "centering" of KOMA-script captions

text: Section 3.20 of the KOMA-script documentation ("scrguien.pdf", pp. 120-1) prescribes the syntax `\setcapwidth[justification]{width}` for the formatting of a caption. `[c]` is the option for centering. Trying to produce the same output I get from the use of the `caption` package with options for justification and width, I'm surprised to see that the justification is quite different: KOMA-script produces a hanging caption that is justified, rather than centered in the strict sense. My question: is there a way to produce the same output as in the `caption` example: centered and not hanging? Examples follow, with an absurdly long caption to highlight the difference: ## caption               \documentclass[12pt]{book}          \usepackage{graphicx}     \usepackage{lipsum}     \usepackage[justification=centering,width=.8\textwidth]{caption}          \begin{document}          \begin{figure}[htbp]       \begin{center}        \includegraphics{imageTest.png}        \caption{\protect\lipsum[1]}       \end{center}     \end{figure}          \end{document}      Output: ![enter image description here](http://i.stack.imgur.com/5eV1k.png) * * * ## KOMA-script               \documentclass[12pt]{scrbook}          \usepackage{graphicx}     \usepackage{lipsum}          \KOMAoption{captions}{belowfigure}     \setcapwidth[c]{.8\textwidth}          \begin{document}          \begin{figure}[htbp]       \begin{center}        \includegraphics{"imageTest.png"}        \caption[short caption]{\lipsum[1]}       \end{center}     \end{figure}          \end{document}      Output: ![enter image description here](http://i.stack.imgur.com/BXcGi.png)


title: Why does lim_{n\to\infty} work in my LaTeX document?

text: `lim_` is not a command in LaTeX because all commands begin with a back slash. However, why does `lim_{n\to\infty}` work in math mode? What is `lim_` if it is not a command?


title: Linebreaks in KOMA-script captions

text: Using the `captions` package, linebreaks can be incorporated into figure- captions easily:               \documentclass[12pt]{book}          \usepackage{graphicx}     \usepackage{caption}          \begin{document}     \begin{figure}[htbp]       \begin{center}        \includegraphics{sampleImage.png}        \caption{First line of caption\\second line of caption\\third line of caption\\fourth line of caption}       \end{center}     \end{figure}          \end{document}      producing ![enter image description here](http://i.stack.imgur.com/VSYWu.png), with the line-breaks correctly observed. Attempting something comparable with KOMA-script:               \documentclass[12pt]{scrbook}          \usepackage{graphicx}     \KOMAoption{captions}{belowfigure}          \begin{document}          \begin{figure}[htbp]       \begin{center}        \includegraphics{"sampleImage.png"}        \caption{First line of caption\\second line of caption\\third line of caption\\fourth line of caption}       \end{center}     \end{figure}          \end{document}      generates an error: `Argument of \@caption has an extra }.` Is there another way to get line-breaks in a figure caption using KOMA-script?


title: Forcing paracol to look like a tabular

text: Consider the following `tabularx` construction: ![enter image description here](http://i.stack.imgur.com/uoEGp.png)               \documentclass{article}     \usepackage[margin=1in]{geometry}     \usepackage[table]{xcolor}     \usepackage{lipsum,tabularx}          \begin{document}          \noindent     \begin{tabularx}{\textwidth}{|p{.4\linewidth}|X|}       \hline       \cellcolor{black!10}1 \lipsum*[1] & 2 \lipsum*[2] \\       \hline       \cellcolor{black!10}3 \lipsum*[2] & 4 \lipsum*[1] \\       \hline     \end{tabularx}          \end{document}      All rules are included and one column is coloured. I'm interested in replicating the behaviour but using `paracol`. Here's a minimal example highlighting my shortcomings: ![enter image description here](http://i.stack.imgur.com/XRLdH.png)               \documentclass{article}     \usepackage[margin=1in]{geometry}     \usepackage[table]{xcolor}     \usepackage{lipsum,paracol}          \setlength{\columnseprule}{.4pt}     \begin{document}          \raggedright          \columnratio{0.4}     \backgroundcolor{c[0]}{black!10}     \begin{paracol}{2}       1 \lipsum[1]       \switchcolumn       2 \lipsum[2]       \switchcolumn*       3 \lipsum[2]       \switchcolumn       4 \lipsum[1]       \switchcolumn*       5 \lipsum[1]       \switchcolumn       6 \lipsum[2]       \switchcolumn*       7 \lipsum[2]       \switchcolumn       8 \lipsum[1]     \end{paracol}          \end{document}      In particular, the following still needs work:   1. Horizontal rules at top/bottom and inbetween _chunks_ ;   2. Vertical rules on the outside;   3. Equal separation between columns and vertical rules, similar to `\tabcolsep` (coloured separation in the coloured column, and not in the uncoloured one); Is it possible to make the output of `paracol` match that of a `tabular`? Motivation: A `tabular`-like structure that can break across the page boundary mid-row. I've tried using `cals` which seem to handle breaking at the page boundary, but the interface does not work as well for me.


title: Produce a hyperlinked DOI?

text: Friends, I'm trying to write a command that prints appropriately hyperlinked DOIs for a bibliography system. Here was my first attempt               \newcommand{\formatdoi}[1]{\href{http://dx.doi.org/#1}{#1}}      This works very well for most DOIs. However, some DOIs have pesky non-LaTeX- friendly characters in them like `_`. It turns out that if you butcher the DOI by transforming the `_` to a `\_`, then everything works! (Even the LINK in the `\href` is correct.) I'm not happy with this solution, because it means that we have to include butchered DOIs in our BibTeX database, which could confuse other users. I would like a solution that permits me to use legitimate DOIs as input. Well, I just learned about the `\detokenize` command. With this, I can update the command above to               \newcommand{\formatdoi}[1]{\href{http://dx.doi.org/\detokenize{#1}}{#1}}      which works very well for the hyperlink part; however, underscores naturally confuse typesetting of the second argument. Is there a simple solution? I had thought to use the verbatim environment here, but it does not seem to be robust enough to be used in a function this way. Any help much appreciated. A few more constraints:   * I would like to minimize the number (and complexity) of included packages since this all takes place inside a style file for a journal.   * It would be good enough for a small piece of code that transformed every `_` to a `\_`; is such a thing easy to come by? All the best, Alex


title: selecting specific items - onlyitems with macros

text: I'm interested in trying to use the onlyitems code posted here with some way to exclude text inside the items. The reason I would like to do this is that I am typesetting course notes and would like to be able to generate answers to selected exercises for students. I've read a couple of other posts about this - see these two about the answers and exercises packages (here and here) that were not helpful to me. The above code seems best, but I can't quite do exactly what I want with it. I need to keep the item (exercise) numbers the same. I have tried two solutions that don't work.   1. I have two environments, statement and answer, which I would like to be able to switch between depending on the version I want to generate. I suspect that the use of `\newcommand` in the onlyitems code mentioned above precludes the use of `\excludecomment` inside the items. The code works for me without the use of `\excludecomment` but does not work with it, so I would appreciate any suggestions.   2. I have also tried creating a `\newif` that could be turned on and off (see second code sample). This also does not work. The following part of the preamble is from the onlyitems code above:               `% from http://tex.stackexchange.com/questions/4502/onlyitems-how-to-select-specific-items-from-an-item-list     % A huge list of pgfkeys to be set up.     \pgfkeys{     /onlyitems/.is family, /onlyitems,     % Utility keys     utility/store tag/.store in = \itemOptions,     utility/store bool/.store in = \itemIf,     utility/process true/.style = {process/#1 = \iftrue},     utility/process false/.style = {process/#1 = \iffalse},%\fi     utility/set store bool/.style 2 args = {#1/.style = {utility/store bool = #2}},     utility/set select style/.style 2 args = {utility/set store bool = {select/#1}{#2}},     utility/verdict/.style = {},     utility/add to reset/.style = {     reset/.prefix style = {select/#1/.style = {select/.unknown}}     },     utility/current key/.estore in = \itemKey,     % Nothing in the process family is ever set, so any selection option is set to store a  boolean     process/.unknown/.style = {     utility/current key = \pgfkeyscurrentname,     select/\itemKey/.style = {     utility/set store bool = {utility/verdict}{#1}     },     utility/add to reset/.expand once = \itemKey     },     % For clearing the list of selected items (to support nested {itemize})     reset/.style = {},     reset/reset/.style = {reset/.style = {reset/reset, default}},     reset/reset,     % Here are the options you can actually pass.  These go to the {itemize}...     include/.style = {utility/process true/.list  = {#1}},     exclude/.style = {utility/process false/.list = {#1}},     all/.style  = {utility/set select style = {.unknown}{\iftrue}},     none/.style = {utility/set select style = {.unknown}{\iffalse}},%\fi     default/.style = {all},     % ...and these to the \item's     tag/.style = {utility/store tag = {[#1]}},     id/.style = {select/#1},     }     % Like tikzset, it sets a default key path     \newcommand\onlyitemsset[1]{\pgfkeys{/onlyitems, #1}}          \let\itemLaTeX=\item     % Have to use a \newcount because (ugh) the LaTeX \setcounter is a global assignment     \newcount\itemsSoFar     \renewcommand\item[1][]{%     % The \egroup closes off any \vbox'es from the previously ignored \item.     % The conditional \bgroup cancels it out when there aren't any.     \itemIf\bgroup\fi\egroup     \let\itemIf=\iffalse%\fi     \advance\itemsSoFar by 1 %     \onlyitemsset{utility/store tag = {}, utility/verdict/.style = {},    select/\the\itemsSoFar, #1, utility/verdict}%     \itemIf     \def\next{\expandafter\itemLaTeX\itemOptions}%     \else     % The vbox is set and then discarded, effectively ignoring an entire \item.     % This inner \itemLaTeX is necessary to avoid a glitch when we ignore the first \item of an itemize that itself contains a nested \itemize.  Don't ask, I don't know.     \def\next{\setbox0=\vbox\bgroup\itemLaTeX}%     \fi     \next     }          % \let\itemizeLaTeX=\itemize     % \let\enditemizeLaTeX=\enditemize     % \renewcommand\itemize[1][]{%     %  \let\itemIf=\iftrue     %  \itemsSoFar = 0 %     %  % We have to reset here so that the selections from an outer itemize don't conflict with an inner one.     %  \onlyitemsset{reset, #1}%     %  \itemizeLaTeX     % }     % \renewcommand\enditemize{%     %  % This closes off the last \vbox     %  \itemIf\bgroup\fi\egroup\enditemizeLaTeX     % }          \newcommand\onlyitems[2][]{%     \let\itemIf=\iftrue     \itemsSoFar = 0 %     % We have to reset here so that the selections from an outer itemize don't conflict with an inner one.     \onlyitemsset{reset, #1}%     #2%     % This closes off the last \vbox     \itemIf\bgroup\fi\egroup     }      Here is what I am trying to do (requires above in preamble):               % Here is my part of the preamble     \newenvironment{answer}{}{}     \newenvironment{statement}{}{}          \usepackage{comment}     %\excludecomment{answer}     \excludecomment{statement}               \begin{document}          \newcommand{\studentanswers}{     \item[id=noanswer]     \begin{statement}     Determine whether...     \end{statement}     \begin{answer}     No     \end{answer}          \item     \begin{statement}     The rectangle...     \end{statement}     \begin{answer}     7     \end{answer}          \item     \begin{statement}     Decide...     \end{statement}     \begin{answer}     Yes     \end{answer}     }          \begin{answer}     \begin{enumerate}\onlyitems[exclude={noanswer}]     \studentanswers     \end{enumerate}     \end{answer}          \end{document}      Here is the code for my second proposed solution. The earlier parts of the preamble are required, with the addition of:               \usepackage{ifthen}     \newif\ifshowanswer     \showanswertrue     %\showanswerfalse          \newcommand{\showanswer}[1]{\ifshowanswer #1}          \newif\ifshowstatement     %\showstatementtrue     \showstatementfalse          \newcommand{\showstatement}[1]{\ifshowstatement #1 \fi}               \begin{document}          \newcommand{\studentanswers}{     \item[id=noanswer]     \showstatement{Determine whether...}     \showanswer{No}          \item     \showstatement{The rectangle...}     \showanswer{7}          \item     \showstatement{Decide...}     \showanswer{Yes}     }          \begin{enumerate}\onlyitems[exclude={noanswer}]     \studentanswers     \end{enumerate}          \end{document}


title: Want to change the CV format in 1 page with two column and also want to balance the horizontal lines in CV?

text: ![enter image description here](http://i.stack.imgur.com/bmQy7.jpg)               \documentclass[a4paper]{article}     \usepackage{tabularx}     %\usepackage{doublespace}     %\setstretch{1.2}     \usepackage{ae}     \usepackage[T1]{fontenc}     \usepackage{CV}          \usepackage[colorlinks]{hyperref}     \hypersetup{linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=blue}          \setlength{\textwidth}{5in}     \setlength{\textheight}{660pt}          \setlength{\oddsidemargin}{42pt}     \setlength{\topmargin}{-20pt}          \newcommand{\ingreen}[1]{{\color{blue}#1}}               \begin{document}     \twocolumn     \pagestyle{empty}     \begin{center}     %\huge{\textsc{Curriculum Vitae}}     %\vspace{0.5\baselineskip}          \huge{\textsc{Name}}     \end{center}     \vspace{0.25\baselineskip}                    \section{Contact Information}     \begin{flushleft}          Email: \ingreen{abc@gmail.com} \\     Skype: abcd\\     Mobile: +12-34-56789012\\     Phone: +12-34-567890     \end{flushleft}          \section{Objective}     \begin{flushleft}     To become a good researcher in my field.     \end{flushleft}          \section{Education}          \begin{CV}     \item[\ingreen{August 2011--August 2013}]      \item[Master]     \item[University Name]     \item[City, Country]     \item[Area]     \section{Research Work}     \begin{flushleft}      \end{flushleft}          \section{Technical Expertise}     \noindent     \begin{itemize}     \item  MATLAB, Mathematica, C/C++, \LaTeX, \LaTeX Draw, Mayura Draw, MS Office     \end{itemize}     \section{Area of Interest}     \noindent     \begin{itemize}     \item Computational Fluid Dynamics     \item Mathematical Modeling and Simulation     \item Differential Equations     \end{itemize}     \section{Hobbies $\&$ Sports}     \noindent     \begin{itemize}     \item Studying Books, Cricket, Watching Sports Channels     \item Music, Movies, Photography     \end{itemize}          \section{References}     \noindent          \end{document}


title: How to change the appeareance of bibliography item labels in amsrefs?

text: Assume that I'd like to set the item labels in the "references" list in amsrefs in, say, boldface (or in lining numbers - I have oldstyle numbers set throughout the document). I can do it in citations in the text (obtained through `\cite`) by means of redefining `\citeform`; but how to do it for the references list?


title: Advantages and disadvantages of fully expandable macros

text: As I currently understand them, fully-expandable macros are analogous to pure/effect-free functions in functional programming. Correspondingly, things that are not expandable, such as `\def`, are effectful computations -- they can't be "evaluated" inside an `\edef`, for example. Effect-free functions are generally beneficial (think immutable objects in OOP), and I would expect this to carry over to fully-expandable TeX macros. However, writing fully-expandable macros seems to be tricky in many cases (see, for example, Tricks to make macros expandable). Moreover, the documentation of the `xparse` package seems to suggest that fully-expandable macros are usually _not_ desirable: > There are very rare occasion when it may be useful to create functions using > a fully-expandable argument grabber. [...] This facility should only be used > when absolutely necessary; if you do not understand when this might be, do > not use these functions! So, when should I use fully-expandable macros? What are the advantages and disadvantages of fully-expandable macros?


title: How to set a small linespace even with a very big letter in the text

text: I use a font (Aquiline), that has only a few characters, most notably the letter "A", which are quite huge in height. I use LuaLaTex with the fontspec package. So if I use this font and a capital A is in the line, the linespace is quite big compared to lines without that letter. It would be much nicer, if the linespace of the whole text would be the same. Preferrable even, if the line space would be like it is wihtout the presence of tha A and if this letter appears, it is no problem, if it intersects with the previous line. But I have no Idea, how to achieve this.


title: How do I complete placeholders is TeXstudio using keyboard

text: I know how to jump between placeholders in TeXstudio, but not how to exit them. In Eclipse and other editors with similar functionality, I press enter and then the placeholder disappears and the cursor is (usually) placed after the inserted text. It TexStudio when I press enter, the placeholders disappears but it also treats the enter as a character input, inserting a new line and overwriting any selected text. This is pretty useless, especially when filling out text between brackets where you as good as never want a newline. How can I exit/finalize/complete placeholders in a template, without inserting extra text/newlines. Thank you. **EDIT** I am using both mac and windows on and off, so please share hotkeys for as many platforms you know :)


title: Compilation problem with Xelatex

text: Last week-end, the compilation `biber` \+ `xelatex` worked very well. But today I have moved my files in another place of my computer, and I can't compile any of my texts any more. Whenever I try, the citations remain `undefined` I think the problem comes from my `.bib` file (because I haven't modified the former documents which used to work fine), but I can't find what it is. I use this configuration :               \documentclass[12pt,a4paper]{report}     \usepackage{fontspec}     \usepackage{xunicode}     \usepackage{polyglossia}     \usepackage[maxlevel=3]{csquotes}     \usepackage{graphicx}     \usepackage[style=authoryear, language=english]{biblatex}     \setmainfont[Ligatures=TeX]{FreeSerif}     \setmainlanguage{english}     \addbibresource{mabiblio.bib}      I and get this result :               LaTeX Warning: Citation 'Dgscgc2013' on page 10 undefined on input line 125.      or this :               LaTeX Warning: Empty bibliography on input line 137.      and finally this :                Latex failed to resolve 40 citation(s)     Latexmk: Errors, so I did not complete making targets     Collected error summary (may duplicate other messages):       pdflatex: Command for 'pdflatex' gave return code 512     Latexmk: Use the -f option to force complete processing,      unless error was exceeding maximum runs of latex/pdflatex.


title: lualatex: smallcaps and microtype don't work together

text: Compiling the following MWE with lualatex doesn't produce small caps. There are no font warnings.               \documentclass{article}          \usepackage{fontspec}     \newfontfeature{Microtype}{protrusion=default, expansion=default}     \defaultfontfeatures{Microtype}     \setmainfont{Linux Libertine O}          \begin{document}          \textsc{foo} {\scshape bar}          \end{document}      Doing one of the following fixes this:   * Don't add `Microtype` to `fontfeatures`   * compile with `xelatex` The system is a frozen TL 2011 on Archlinux.


title: Align missing data in siunitx S column type

text: How can I align missing data inside a S column type like in the below image? ![enter image description here](http://i.stack.imgur.com/lK2rp.png) If I just add `{\textemdash}`, the dash is not centered, example:               \documentclass{article}     \usepackage{siunitx}          \begin{document}     \begin{table}      \begin{tabular}{lS}      Case & {Variable} \\      First & {\textemdash} \\     Second & 15 \\      \end{tabular}     \end{table}     \end{document}      ![enter image description here](http://i.stack.imgur.com/7oNAV.png)


title: How to draw a boolean circuit diagram in circuitikz?

text: How would I draw this image: ![enter image description here](http://i.stack.imgur.com/MAGSt.png) using `circuitikz`? What I have so far is               \begin{circuitikz} \draw     (0,2) node[and port] (myand) {}     (2,1) node[or port] (myor) {}     (myand.in 1) node[anchor=east] {A}     (myand.in 2) node[anchor=east] {B}     (myand.out) -| (myor.in 1)     ;\end{circuitikz}      However I'm having trouble attaching the C while maintaining the alignment of A, B, and C.


title: 'Not element of' in Latin Modern

text: In the following example, the ∉ symbol does not look good.               \documentclass{article}     \usepackage{unicode-math}     \setmainfont{Latin Modern Roman}     \setmathfont{Latin Modern Math}     \begin{document}     This does not show: $\notin$ \\     This does not look good: $\not\in$     \end{document}      ![MWE output](http://i.stack.imgur.com/K9KgQ.png) `\not\in` works when not loading `unicode-math`, but `unicode-math` somehow prevents it from working (?). The Unicode character `0x2209` does not seem to be included in the Latin Modern Math font. I know that I can load the Unicode character from another font, but I just want the output to look like `\not\in` in Computer Modern. edit: To clarify, I just want the output to look like `\not\in` without using `unicode-math`. I want to use `unicode-math` for reasons not visible in this example.


title: Structure column in Aquamacs

text: I am exploring Aquamacs for Latex, and I wonder if there's an option to show a column next to the buffer with listed the structure/tree of the document (chapters, sections, paragraphs, etc.) similar to what appears in Texmaker.


title: TikZ animated Equation in Beamer

text: I'm trying to reproduce the example on creating a Presentation with LaTeX Beamer – Equations and tikz and the given code throws the following error > Package pgfkeys Error: I do not know the key '/tikz/na'. The LaTex code is               \documentclass[compress]{beamer}     \usetheme{Warsaw}     \usepackage{amsmath}     \usepackage{amssymb}     \usepackage{tikz}     \usetikzlibrary{arrows,shapes}          \tikzstyle{every picture}+=[remember picture]          \begin{document}          \begin{frame}     \frametitle{Test}               \begin{itemize}     \item Overall mean \tikz[na] \node[coordinate] (s1) {};     \end{itemize}          \tikzstyle{na} = [baseline=-.5ex]          \begin{equation}     y_{ijk} = \tikz[baseline]{ \node[fill=blue!20,anchor=base,rounded corners=2pt]       (d1) {$\mu$}; }     + \tikz[baseline]{ \node[fill=red!20,anchor=base,rounded corners=2pt]       (d2) {$r_{i}$}; }     + \tikz[baseline]{ \node[fill=green!20,anchor=base,rounded corners=2pt]       (d3) {$c_{j}$}; }     + \tikz[baseline]{ \node[fill=yellow!20,anchor=base,rounded corners=2pt]       (d4) {$t_{k}$}; }     + \epsilon_{ijk}     \end{equation}          \begin{itemize}     \item Effect of row $i$ \tikz[na] \node[coordinate] (s2) {};     \item Effect of column $j$ \tikz[na] \node[coordinate] (s3) {};     \item Effect of treatment $k$ \tikz[na] \node[coordinate] (s4) {};     \end{itemize}          \begin{tikzpicture}[overlay]     \path[->] (s1) edge [bend left] (d1);     \path[->] (s2) edge [bend right] (d2);     \path[->] (s3) edge [out=0, in=-90] (d3);     \path[->] (s4) edge [out=0, in=-90] (d4);     \end{tikzpicture}          \end{frame}          \end{document}      Also my equation is not animated. Any help to fix this error will be highly appreciated. Thanks


title: parcolumn nofirstindent not working well?

text: The following code leaves some extra space in front of the start of each box... `nofirstindent` should, I imagine, set it to 0 but it is not:               \documentclass{article}     \usepackage{tikz}     \usepackage{parcolumns}     \scrollmode          \begin{document}     \newcommand{\drawrect}[1]{\begin{tikzpicture} \draw (-1.5,-1.5) rectangle (1.5,1.5); \node at (0,0) {#1}; \end{tikzpicture}}          \begin{parcolumns}[nofirstindent,rulebetween,distance=0pt]{3}     \colchunk{     \drawrect{1}\\     \drawrect{2}\\     \drawrect{3}\\     }     \colchunk{     \drawrect{4}\\     \drawrect{5}\\     \drawrect{6}\\     }     \colchunk{     \drawrect{7}\\     \drawrect{8}\\     \drawrect{9}\\     }     \colplacechunks     \end{parcolumns}               \end{document}      It would also be nice if `parcolumns` would center itself between the margins.


title: \pageheight just inside layout package?

text: I've got a comprehension question: are the commands `\pageheight` and `\pagewidth` only available if the layout package is loaded? Are there any more simple ways to alter page height and width? I find it a bit hard to figure out, if it is just my error, or if something doesn't work, and I spend a lot of time figuring out: 'is this not so well explained or am I just too… whatever?'.


title: How to spread a table between two columns

text: I read these posts:   1. multi-page two column table in a single column document   2. Dealing with very long table - split into columns? But still can not resolve my problem. Could you please help me to spread a table between two columns in a two column page, as such: ![enter image description here](http://i.stack.imgur.com/Aubpe.png) Thank you.


title: How do you display table headers that are wider than the rest of the column?

text: I have a table with lots of columns, which only contain a short values, but have long headings. I think this table would fit width-wise on a single (landscape) page, if I could get the headings sit on alternating rows, with the ends overlapping. How can I achieve this? (I've tried writing two header rows, with half the column names in one row and half in another, using `\multicolumn`, but I can't get them to then align neatly with the columns.)               \documentclass[]{article}     \usepackage{booktabs}          \begin{document}          \begin{tabular}{ccc}     \toprule     Lengthy words which & make my  columns too wide like & antidisestablishmentarianism\\     \midrule     1 & 0 & 0\\     3 & 7 & 5\\     \bottomrule     \end{tabular}          \end{document}      Or, alternatively, is Big table with rotated column labels using booktabs the preferred layout for tables with long headings? I am reluctant to use it, because there are enough rows that the headers will need to be repeated on multiple pages already; making them taller will exacerbate this problem.


title: problem with putting everything on the same line

text: \documentclass[a4paper]{article}               \usepackage{amsmath}     \usepackage{graphicx}          \begin{document}     "Hello World! I know all about \[ \int_1^7 \frac{dx}{x}\] and \[e^{\pi i}\].          \end{document}      i dont know how to make everything to same line


title: How to redefine the second line indent for the author-citation references?

text: I am using elsarticle-harv.bst for author-citation references. However, the indent value for second line is a bit small, see e.g.: ![enter image description here](http://i.stack.imgur.com/ckqyl.png)               \documentclass[12 pt,a4paper,twoside] {article}     \usepackage{natbib}        \usepackage[UKenglish]{babel}     \usepackage[lining]{libertine}     \usepackage[ T1 ]{fontenc}     \begin{document}     \cite{Tsuji:2008} bla bla ... \\     Bla bla ... \citep[see e.g][]{Shirgaonkar:2009} .          \bibliographystyle{elsarticle-harv}     \bibliography{reffile}      \end{document}      Reference file `reffile.bib`e.g:               @ARTICLE{Tsuji:2008,       author  = {Tsuji, T. and Yabumoto, K. and Tanaka, T.},       title   = {Spontaneous structures in three-dimensional bubbling gas-fluidized bed by paralled {DEM-CFD} coupling simulation},       journal = {  Powder Technology },       year    = { 2008  },       volume  = { 184  },       pages   = {  132-140 },       number  = { }       }          @ARTICLE{Shirgaonkar:2009,       author  = {Shirgaonkar, A. A. and Maclver, M. A. and Patankar, N. A.},       title   = {A new mathematical formulation and fast algorithm for fully resovled simulation of self-propulsion},       journal = {Journal of Computional Physics},       year    = { 2009  },       volume  = { 228  },       pages   = {  2366-2390 },       number  = { }       }      So how to increase the indent?


title: Different chapter headings for odd and even pages

text: Is there a way to have different chapter headings for odd and even starting chapters using `fncychap` with `scrbook` class? I'm using a personal style (a mix of Sonny and Bjornstrup) that has a large chapter number on the right that is not clearly visible when chapter starts on even pages. Edit: This is style definition in `fncychap.sty`               %%%%%%PERSONAL DEF          \DeclareOption{Personal}{%       \ChNameVar{\Large\sf}       \ChNumVar{ \fontsize{76}{80}\usefont{OT1}{pzc}{m} {n}\selectfont\color{darkgray}}}       \ChTitleVar{\Large\sf\em\color{Sepia}}       \ChRuleWidth{0.5pt}       \ChNameUpperCase       \renewcommand{\DOCH}{%        \vskip -100\p@%         \raggedleft          \Huge\CNoV\thechapter          }       \renewcommand{\DOTI}[1]{%         \CTV\raggedleft\mghrulefill{\RW}\par\nobreak         \vskip 5\p@         \CTV\FmTi{#1}\par\nobreak         \mghrulefill{\RW}\par\nobreak         \vskip 20\p@}       \renewcommand{\DOTIS}[1]{%         \CTV\raggedleft\mghrulefill{\RW}\par\nobreak         \vskip 5\p@         \CTV\FmTi{#1}\par\nobreak         \mghrulefill{\RW}\par\nobreak         \vskip 5\p@}      And this is a pic of the output (sorry for low quality, only way to post it from netbook)![Output](http://i.stack.imgur.com/7Odj0.jpg) This chapter starts on odd page. I'm searching for a way to move the large chapter number on left when chapter starts on even page.


title: TikZ rectangle single rounded corner

text: How to round just one (or two, or three) corners of a TikZ rectangle? I can only get none or all rounded!               \documentclass[tikz]{standalone}     \begin{document}     \begin{tikzpicture}     \node [fill=red, rounded corners] {Round north east corner};     \end{tikzpicture}     \end{document}


title: Rounded corner box with shading

text: I wish to draw a rounded corner box (top-left side as a square, top-right side with 6pt radius curve and the bottom of two sides also with radius curve), in addition to that there should be shading, how can I get such a style? Is there any package available for this task?


title: TikZ rectangular node with different rounded corners

text: This is my minimal example:               \documentclass{article}      \usepackage{tikz}      \begin{document}         \begin{tikzpicture}                \node[rounded corners=3pt, draw, fill=red!20]{Hallo!};        \end{tikzpicture}     \end{document}      I'd like to define different values for rounded corners (i.e. 5pt for north- west and north-east and 2pt for south-east and south-west).


I am using `xelatex.exe` and need to iterate through the list of fonts installed on my Windows 7 machine. The following code is not complete because I have no idea what is the name that contains the list.               \documentclass{article}     \usepackage[active,tightpage]{preview}     \setlength\PreviewBorder{1pt}     %\PreviewEnvironment{}          \usepackage{etoolbox}          \def\myInstalledFonts{}     \begingroup     \renewcommand\<what should I put here>[<what should I put here>]{%       \listgadd{\myInstalledFonts}{#2}%       }     \input{<what should I put here>.def}     \endgroup          \usepackage{fontspec}          \def\do#1{%         \setmainfont{#1}             \begin{preview}         I can find a tool to convert PDF to EPS         in my neither bathroom nor kitchen.\par             \end{preview}     }%          \begin{document}          \dolistloop{\myInstalledFonts}          \end{document}      How to iterate through the list of installed fonts?


title: How to draw Closed curver with TiKZ?

text: I want to draw the following diagram. ![enter image description here](http://i.stack.imgur.com/90eDQ.jpg) I have tried with the following Latex command:               \documentclass[12pt,twoside,a4paper]{book}     \usepackage{graphicx,wrapfig,tikz}      \begin{document}           \begin{tikzpicture}      \draw (0,4) ellipse ( 2cm and .6cm);            \draw (2,4) -- (2,0);      \draw[fill] (0,0) circle (1pt);      \end{tikzpicture}      \end{document}      How can I draw this diagram using tikzpicture?


title: enumitem: How to change label on enumerate* when inline option is enabled?

text: I'm using an inline enumerate list in my document, and I want to make that label slightly different (prepend with a `(`) compared to the normal `enumerate` environment. However, since `enumerate*` share settings with the `enumerate` environment, how do I go about changing the label for the `enumerate*` environment?


title: How to place abstract text in front of abstract key?

text: I want to place my abstract text behind the abstract-key(which is used in all article), and left-aligned rather than centered on the page. How do I do this in LaTeX? I want the following format:               Abstract: some text is here.      The default abstract format (which I want to change it) is:                                          Abstract          Some text is here


title: Insert footer on chapter page but NOT header

text: this may or may not seem to be a weird thing to want, but I would like to have a customized header on all my pages, except the first one of each chapter, ToC, ..... Furthermore, I would like to have a footer in form of a simple line above the page number on each and every page, even on the first page of a chapter, ToC, ... Well, me being new to LaTeX, I was thinking it could work if I insert the \fancypagestyle{plain} command after the header, so it might not apply for the header but for the footer. Well, that did not work. Does anyone know how to do that? Is it even possible? Thank you so much for any advice in advance!               \documentclass[10pt,a4paper, twoside]{report}     \usepackage[latin1]{inputenc}     \usepackage{fancyhdr}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}     \pagestyle{fancy}          \begin{document}     \lhead[Contents]{\includegraphics[height=22pt]{Figures/WHM.eps}}     \rhead[{\includegraphics[height=22pt]{Figures/WHM.eps}}]{Contents}     \fancypagestyle{plain}{     \renewcommand{\footrulewidth}{0.4pt}}     \tableofcontents     \end{document}


title: Copying a TeXLive installation

text: What would be the easiest way to copy a TeXLive installation from one computer to another? I'm going to set up a new laptop to be a replacement for this machine, and I'd prefer not to have to download the full set of packages for TL2011, mainly because waiting for the download is so time-consuming; I've already done it once. **EDIT:** I'm using Arch Linux and installing TeXLive using tl-install / tlmgr rather than Arch's packages. **EDIT II:** Would it be advisable to make a backup of an existing install on the source machine, use install-tl to install a minimal version on the target machine, copy the backup(s) to the target machine, and then restore those backups using tlmgr?


title: How to share packages

text: I have locally created a document and used some packages for that. Is it possible to share this environment with my colleagues, without having them to install miktex and the packages? Solved: I used the portable version of miktex (http://miktex.org/portable) and put it to a shared networkfolder. After installing all required packages, all of my team mates are able to compile the document without problems.


title: insdljs + xetex - newlines ignored, corrupting JavaScript

text: I'm trying to create some dynamic forms in my PDF file with JavaScript. I am using xelatex to compile it. Something in the way the `insdljs` package is inserting the JavaScript is making it not work. Here is a sample file:               \documentclass{article}     \usepackage[dvipdfm]{eforms}          \begin{insDLJS}{hello}{Hello, World}     var done=0;          function hello()      {         if (!done) {             // check if we are done             done=1;             app.alert("Hello, World!");         }     }          \end{insDLJS}          \OpenAction{/S /JavaScript /JS (hello();)}     \begin{document}     Hello,world!     \end{document}      If you **remove** the useless comment and compile with xelatex, then open the compiled PDF in Acrobat Reader, you get a “Hello, World!” alert. But with the comment you get no alert. Looking at the actual JavaScript (you need Acrobat Pro to do this, I think) that gets inserted into the PDF, I see that all the newlines are removed. It becomes               var done=0;function hello(){if (!done) {// check if we are done done=1;app.alert("Hello, World!");}}      In JavaScript, the double slash `//` indicates that the rest of the line is a comment. When all the newlines are stripped, half of the code is ignored! Acrobat's JavaScript console gives error messages consistent with this (it doesn't find the `}` ending the `hello()` function block). So here are my workarounds:   1. Use no comments. Bad Idea.   2. Use only inline comments `/* ... */` OK, not great.   3. Coerce newlines to appear. After all, aside from comments, there are probably good reasons to have newlines. Any ideas on implementing #3? The eforms manual says you can insert newlines with `\n`, but this seems to not be happening. If I do that I get instead               var done=0;function hello(){if (!done) {// check if we are done \ndone=1;app.alert("Hello, World!");}}      (the `\n` just went straight into the document level JavaScript).


title: How can i use special glyphs in large font sizes, with fontspec?

text: now i have some trouble with font size declaration, using XeTeX's fontspec package. I read the fontspec manual. There is no explicit section about font size, but i see that the author of the manual using \fontsize{48}{48} command to declare the font size. It works for me also, e.g.:               \fontsize{60}{66}     \fontspec{Garamond Premier Pro}     Some text with font size 60 pt.\\      Or if Garamond is default, i can use:               \fontsize{60}{66}\selectfont     Some text with font size 60 pt.\\      That's fine, but if i want to use some special glyphs, for example fleurons in large font sizes, som ugly boxes appears in the pdf instead the character:               \fontsize{60}{66}\selectfont     Some text, and a fleuron: \symbol{\string"E1C0} or simply: \char"E1C0\\      I experimented, that the limit is between 14 and 15 pt: with 14 pt size, the fleuron appears, with 15 pt size and over, the box. What is the reason of this behaviour, and how can i scale these special glyphs larger than 14 pt?


title: making a big summation sign

text: how can I make a big summation sign ?               \begin{align}     \cos x = \sum\limits_{n=0}^{\infty} \frac{(ix)^2n}{(2n)!}     \end{align}      this is the code which I'm using for summation


title: BibTeX (TeX Live 2013) doesn't escape & in url

text: BibTeX (TeX Live 2013 on ubuntu) doesn't escape the `&` specifically in **urls**. The `%` escapes but not `&`. For example I have the following reference:               @article{benson1975,         title = {The Interorganizational Network as a Political Economy},         volume = {20},         issn = {00018392},         url = {http://www.jstor.org/discover/10.2307/2391696?uid=3737664&uid=2134&uid=2129&uid=2&uid=70&uid=4&sid=21102581457607},         doi = {10.2307/2391696},         number = {2},         urldate = {2013-08-25},         journal = {Administrative Science Quarterly},         author = {Benson, J. Kenneth},         month = jun,         year = {1975},         pages = {229}     }      and when I cite it the `bbl` files keeps the `&` intact like this:               \htmladdnormallink{$<$http:\-/\-/www\-.jstor\-.org\-/discover\-/10\-.2307\-/2391696?uid=3737664&uid=2134&uid=2129&uid=2&uid=70&uid=4&sid=21102581457607$>$}{http://www.jstor.org/discover/10.2307/2391696?uid=3737664&uid=2134&uid=2129&uid=2&uid=70&uid=4&sid=21102581457607}.}      When I manual replace the `&` inside the `\htmladdnormallink` with `\&` LaTeX compiles perfectly so I'm sure that is there is a way to escape the & it would work like a charm. Note that escaping the & on BibTeX (`\&`) doesn't work (works outside of urls, but not in urls). The `bbl` result is {`\textbackslash`} `&` instead of `\&`:               \htmladdnormallink{$<$http:\-/\-/www\-.jstor\-.org\-/discover\-/10\-.2307\-/2391696?uid=3737664{\textbackslash}&uid=2134{\textbackslash}&uid=2129{\textbackslash}&uid=2{\textbackslash}&uid=70{\textbackslash}&uid=4{\textbackslash}&sid=21102581457607$>$}{http://www.jstor.org/discover/10.2307/2391696?uid=3737664\&uid=2134\&uid=2129\&uid=2\&uid=70\&uid=4\&sid=21102581457607}.}      If it makes a difference, I'm using:               \documentclass[         article,         11pt,         oneside,         a4paper,         english,         brazil         ]{abntex2}          \usepackage{cmap}     \usepackage{lmodern}     \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage{indentfirst}     \usepackage{nomencl}     \usepackage{color}     \usepackage{graphicx}          \usepackage[brazilian,hyperpageref]{backref}     \usepackage[alf]{abntex2cite}          \hypersetup{         pdftitle={\@title},          pdfauthor={\@author},         pdfcreator={\@author},         colorlinks=true,         linkcolor=blue,         citecolor=blue,         filecolor=magenta,         urlcolor=blue,         bookmarksdepth=4     }


title: How to increase between hspace

text: How would I increase the vertical space between the first two projects and the second? Here is a MWE:               \documentclass[12pt,letterpaper,sans]{moderncv}           % moderncv themes     \moderncvstyle{banking}                             % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'     \moderncvcolor{red}                               % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'          \usepackage[scale=0.85]{geometry}     %\setlength{\hintscolumnwidth}{3cm}                % if you want to change the width of the column with the dates     %\setlength{\makecvtitlenamewidth}{10cm}           % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...     \usepackage{multicol}          % personal data     \name{My}{Name}     \title{Designer/Developer}     \address{123 Main Street}{Anytown, USA 20192}     \phone[mobile]{(555) 555-5555}                     \email{dasasd@gmail.com}                                 \homepage{www.asdasd.com}                             \social[linkedin]{asdasdasd}                                         \social[github]{asdasdasd}                                                                                \begin{document}     \makecvtitle     \vspace*{-13mm}     %\setlength{\hintscolumnwidth}{0.15\textwidth}     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \section{Selected Projects}          \hspace*{\fill}     \begin{minipage}{\maincolumnwidth}      \begin{multicols}{2}        \textbf{\href{http://google.com/}{Google}}        \begin{itemize}          \item Googley Google        \end{itemize}        \columnbreak        \textbf{\href{https://asdasdds.com}{asdasdasdasdasd}}        \begin{itemize}             \item asdasdads        \end{itemize}      \end{multicols}     \end{minipage}          \hspace*{\fill}     \begin{minipage}{\maincolumnwidth}      \begin{multicols}{2}        \textbf{\href{http://adsasd.com}{asdasdasd}}        \begin{itemize}          \item asdasdasd        \end{itemize}        \columnbreak        \textbf{\href{https://asdasdd.com}{asdasdasdasd}}        \begin{itemize}          \item adsasdasdasd        \end{itemize}      \end{multicols}     \end{minipage}          \end{document}      ![Here is what the spacing is now](http://i.stack.imgur.com/wVpvM.png)


title: trivlist list environment \item command

text: My document class uses `paralist` and redefines `\begin{enumerate}[(a)][abc]` etc... environments to issue `\label` for each `\item`, given a second option (e.g., `\abc{a}`) that becomes a 1-parameter macro issuing `\ref`. For this both `\@item` and `\pl@item` are " _overloaded_ ". However, there is a problem with, e.g., `ntheorem` environment nested inside `enumerate`:               \begin{enumerate}[(a)][abc] % \ref{...} is the body of "\gdef\abc" in refined       \item one         \begin{theorem}[second]           ... and so it follows.          \end{theorem}     \end{enumerate}          As in the point \abc*{1} above... % starred wraps around parentheses      I found `ntheorem` (and many other environments) use `trivlist` for style; so the example above is troublesome because there is an extra `\item` issued, without `\@listdepth` increased. I have actually to switch between `\let\@item\old@item` and `\let@item\new@item` accordingly with my redefined `\begin|\end{enumerate}`, because from "`new`" I also generate `\label` commands, for each `\item` issued.               \let\old@item\@item     \gdef\@item[#1]{\old@item[#1] ...}     \let\new@item\@item     \let\old@pl@item\pl@item     \def\pl@item[#1]{\old@pl@item[#1] ...}     \let\new@pl@item\pl@item      But the `\trivlist` from `ntheorem` gives "multiple defined labels" because of the " _spurious_ " `\item` coming with `\trivlist`. Next try was to redefine `\@trivlist` (also `\endtrivlist`),               \def\@trivlist{\if@newlist ... \fi}      where the dots in `\@trivlist` keep track of whether               \def\endtrivlist{\if@newlist ... \fi}      the dots in `\endtrivlist` should restore either the `old` or the `new` `\@item` and `\pl@item` (re)definitions. There is, though, never the case that `\@newlist` conditional is true, and `\trivlist` is heavily used everywhere: thus, I fail to discern the case of list environmens (that enumerate are too), from... `\everypar`? Initially, my intent was to intercept `\@thm` and `\@endtheorem`, but I tried widening the possibilities of environments nested in redefined `\begin{enumerate}`, and this is how I ran over `\trivlist`. The problem is that `\@trivlist` occurs many times **not paired** by `\endtrivlist`, which makes my task impossible (since I employ a push/pop technique). And trying using `\if@newlist`, supposedly suggesting that a list (always paired) is involved, the code is skipped, the flag is `false`. That not enough, `\@trivlist` also tests the flag `\if@inlabel`, having something to do with just _after_ `\item`, while I must take care of `old/new` trick _before_ `\item`. Appreciate any help, Thank s.


title: Undefined control sequence error for \pgfkeys when using pgfmath package

text: Why does this MWE result in an error?               \documentclass{article}     \usepackage{pgfmath}     \pagestyle{empty}     \begin{document}          \pgfmathparse{atan2(5,2)}     \pgfmathresult          \end{document}      From what I've read in the documentation, I've loaded all the appropriate packages. In particular, on page 525, the manual says that if I don't want the full package of `pgf` then I can just load `pgfmath`.


title: Tweaking behaviour of tikz trees for Feynman diagrams

text: I am working with tikz to draw Feynman diagrams, and I have a few questions about tweaking the behavior of the following code.               \documentclass[a4paper,12pt]{article}     \usepackage{tikz}     \usetikzlibrary{calc,matrix,arrows,decorations.pathmorphing,decorations.markings,trees}     \begin{document}          \tikzset{              photon/.style={decorate, decoration={snake}, draw=red},                  particle/.style={draw=blue,solid, postaction={decorate},              decoration={markings,mark=at position .5 with {\arrow[draw=blue]{>}}}},              antiparticle/.style={draw=blue,solid, postaction={decorate},                  decoration={markings,mark=at position .5 with {\arrow[draw=blue]{<}}}},              wboson/.style={draw=black,dashed}          }          \begin{tikzpicture}[              thick,              % Set the overall layout of the tree              level/.style={level distance=2.0cm},              level 2/.style={sibling distance=3.5cm},          ]          \coordinate              child[grow=left]{                  edge from parent [wboson]                  child {                      edge from parent [particle]                      node [above] {$d^r_L$}                  }                  child {                      edge from parent [antiparticle]                      node [below] {$u^r_L$}                  }                  node [above=3pt] {$W^+$}               }              % I have to insert a dummy child to get the tree to grow              % correctly to the right.              child[grow=right, level distance=0pt] {                  child { }                  child {                      edge from parent [particle]                      node [above] {$\nu_L$}                  }              }              child[grow=left, level distance=0pt]{                  child {                      edge from parent [particle]                      node [above] {$\overline{e^-_L}$}                  }                  child { }              };          \end{tikzpicture}     \end{document}      1) How can I remove the black solid lines from the picture so that only the dashed line and four blue lines remain? 2) How can I tweak the angle between the blue lines, so that the two right- most blue lines describe an acute angle, without increasing the level/sibling distances at all? Thanks for your time


title: two variables foreach loop problem

text: I want to draw a pulse train on which I write some information like the corresponding angle, etc... But I think I've got a problem with the two variables foreach loop because I can't even compile since I added this line               \addplot[dirac] coordinates {(\temps,0.75)};      The entire code is :               \documentclass[tikz]{standalone}          \usepackage[T1]{fontenc}     \usepackage[utf8]{inputenc}     \usepackage[french]{babel}     \usepackage{pgfplots}          \pgfplotsset{       dirac/.style={         mark=triangle*, mark options={scale=2}, ycomb, scatter, blue,         visualization depends on={y/abs(y)-1 \as \sign},         scatter/@pre marker code/.code={\scope[rotate=90*\sign,yshift=-2pt]}       }     }          \begin{document}       \begin{tikzpicture}       \tikzset{         every pin/.style={fill=yellow!50!white,rectangle,rounded                corners=3pt,font=\scriptsize},         small dot/.style={fill=black,circle,scale=0.2}     }          \begin{axis}[axis lines=middle,x=1,xmin=-25,xmax=375,y=100,ymin=0,ymax=1,       title={Train d'impulsions à 40MHz},ylabel={Tx},xlabel={Temps/ns},       every axis y label/.style={at={(ticklabel cs:1)},anchor=near ticklabel},       every axis x label/.style={at={(ticklabel cs:1)},anchor=near ticklabel},       ytickmin=2, xtickmax=350, axis y line=left       ]            \foreach \temps/\angle in {0/-21, 25/-18, 50/-15, 75/-12}{          \edef\temp{\noexpand          \addplot[dirac] coordinates {(\temps,0.75)};          \node[small dot,pin={$\angle\degres$}]  at (25+\temps,70) {};}          \temp       }              \end{axis}       \end{tikzpicture}     \end{document}      Thanks in advance for helping me. For my defense, I am a beginner in Tikz-PGF


title: luacode and ExplSyntaxOn/Off

text: I'm trying to build some sort of an interface to a lua matrix module. I've navigated a few issues and arrived at something that I felt like I could probably modify to work. Anticipating the need for expl3 functions as some point I wrapped the macro in `\ExplSyntaxOn` and `\ExplSyntaxOff` expecting a total catcode disaster. Rather I got an error relating to 'global' and 'nil value'. I am very much fumbling my way through this so, I don't have the tools to understand why what I did was bad. In the code below, the wrapper function spits out a matrix, however, when uncommenting an `\ExplSyntaxOn/Off` pair the error mentioned above occurs. If needed, the `matrix.lua` file can be found here: https://raw.github.com/davidm/lua-matrix/master/lua/matrix.lua               \documentclass{article}     \usepackage{xparse}     \usepackage{luacode}     \usepackage{fontspec}          %\ExplSyntaxOn     \directlua{dofile("matrix.lua")}     %\ExplSyntaxOn     \NewDocumentCommand{\matrixop}{}     {         \luaexec{             local matrix = require 'matrix'             m1 = matrix{{8,4,1},{6,8,3}}             m2 = matrix{{-8,1,3},{5,2,1}}             m3 = matrix.add(m1,m2)             a=matrix.latex(m3,c)             tex.print(a)         }     }     %\ExplSyntaxOff     \begin{document}          \matrixop{}          \end{document}


title: loading mps to pdf converter latex

text: \documentclass[a4paper,11pt,english,openright]{book}          \usepackage[ansinew]{inputenc}          \usepackage[english]{babel}     \usepackage{babel}     \usepackage[T1]{fontenc}     \usepackage[centertags]{amsmath}     \usepackage{amsfonts}     \usepackage{color}     \usepackage{amsthm}     \usepackage{mathtools}     \usepackage{newlfont}     \usepackage{graphicx}     \usepackage{layaureo}     \usepackage{amssymb}     \usepackage{amsmath}     \usepackage{url}     \usepackage{bbm}     \usepackage{mathrsfs}     \usepackage{eucal}     \usepackage{latexsym}     \usepackage{geometry}     \usepackage{fancyhdr}     \usepackage{dsfont}     %\usepackage{biblatex}     \usepackage[babel]{csquotes}          \pagestyle{fancy}          \addtolength{\headheight}{15pt}     \renewcommand{\chaptermark}[1]{\markboth {#1}{}}     \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}     \fancyhf{}     \fancyhead[RO,L]{\thepage}     \fancyhead[R]{\leftmark}     %\fancyhead[LO]{\rightmark}     %\renewcommand{\headrulewidth}{0.5pt}     %\renewcommand{\footrulewidth}{0pt}     %\addtolenght{\headheight}{0.5pt}     \fancypagestyle{plain}          \linespread{1.1}               \DeclarePairedDelimiter{\abs}{\lvert}{\rvert}     \DeclarePairedDelimiter{\norma}{\lVert}{\rVert}          \newcommand{\numberset}{\mathbb}     \newcommand{\N}{\numberset{N}}     \newcommand{\R}{\numberset{R}}     \newcommand{\D}{\numberset{D}}          %\theoremstyle{definition}     %\newtheorem{definizione}{Definizione}     \theoremstyle{remark}     \newtheorem{remark}{Osservazione}     \theoremstyle{plain}     \newtheorem{thm}{Teorema}[section]     \newtheorem{cor}[thm]{Corollario}     \newtheorem{lem}[thm]{Lemma}     \newtheorem{prop}[thm]{Proposizione}     \theoremstyle{definition}     \newtheorem{defn}{Definizione}[chapter]          \newenvironment{sistema}%     {\left\lbrace\begin{array}{@{}l@{}}}%     {\end{array}\right.}     %\newtheorem{teorema}{Teorema}     %\newtheorem{propos}{Proposizione}     %\newtheorem{lemma}{Lemma}     %\newtheorem{cor}{Corollario}     \newtheorem{esempio}{Esempio}                    \usepackage{subfigure}          \title{Introduction to Markov Reneval}     \author{Davide Cherubini}          \begin{document}     \maketitle     \chapter{Introduction to Markov Reneval}     \section{Homogeneous Convolution}          We consider two continous random variables F and G where $F,G\in\mathbb{R}$ with density function f and g  respectively.          Convolution is a mathematical operation between f and g, producing a third function  that is typically viewed as a modified version of one of the original functions and it is defined as the integral of the product of the two functions after one is reversed and shifted.               Then,     \[f\bullet g(t)     \]          is a homogeneous convolution with the following properties:      where is the error???


title: Help me to align homework points A, B and C in LaTex

text: I have this kind of homeworks here and I want to get things aligned nicely like `"1.2.6 EX. ... a) ... b) .."`, "` -- how? I don't like that LaTex inserts immediately the point 8 and points 8.1/8.2 etc. ![enter image description here](http://i.stack.imgur.com/BtQWx.png) ![enter image description here](http://i.stack.imgur.com/Nd1Bk.png) **Minimal working example**               \documentclass{article}     \usepackage[english]{babel}     \usepackage{graphicx}     \usepackage{float}          \begin{document}     \tableofcontents     \newpage          \section{Exercise 1.1.1}      \section{Exercise 1.3.4}     \subsection{a) The equation for the affine variety}     \end{document}


title: Is there a shortcut in LyX to exit ERT mode?

text: I know that C-l ENTERS ERT mode, but my question is- Is there a shortcut in LyX to EXIT ERT mode ?


title: Setting position of figure, captions using sidecap

text: I have a poster with 2 `sidecap`ed graphics: one in the lower-left corner (LLC) and another in the lower-right (LRC). Problems include   * both have their captions on the left. I'd prefer the LLC graphic to have its caption on the right, for symmetry.   * how to force both to the bottom of the layout? I know how to do that with package=figure, but not package=sidecap. details: I have a git repo for my first poster (and first LaTeX project) from which I generated the PDF linked above: `git clone git@bitbucket.org:tlroche/cmas-2012-poster.git`. It's pretty simple/crude and has a number of defects, about which I'd appreciate advice for improvement. One area of interest is the graphics in the LLC and LRC of the current layout (Figures 1 and 4). I'm using package `sidecap` to put their captions to the side of (rather than above or below) the figure. I'd like to know how to do the following with `sidecap`, or alternate package that provides the desired functionality:   1. how to set caption position _per figure_ (not per document)? For symmetry I'd like to have the LLC graphic to have its caption on the right, and the LRC graphic to have its caption on the left.   2. how to force those figures to the bottom of the layout? I believe I can do that with `\begin{figure}[b]` but that won't provide side captions, and I don't know how to force to bottom with `sidecap`.


title: \DeclareNameAlias{sortname}{last-first} does not sort the name of editor

text: Why doesn't the command `\DeclareNameAlias{sortname}{last-first}` order the name of editors to last name-first name? Look at the following MWE.               \documentclass[10pt]{article}          \usepackage[style=authoryear,backend=biber]{biblatex}     \DeclareNameAlias{sortname}{last-first}          \usepackage{filecontents}     \begin{filecontents}{\jobname.bib}     @book{cicero,       hyphenation = {german},       author = {Cicero, Marcus Tullius},       editor = {Blank-Sangmeister, Ursula},       translator = {Blank-Sangmeister, Ursula},       afterword = {Thraede, Klaus},       indextitle = {De natura deorum},       title = {De natura deorum. {\"U}ber das Wesen der G{\"o}tter},       shorttitle = {De natura deorum},       language = {langlatin and langgerman},       publisher = {Reclam},       location = {Stuttgart},       date = {1995},       annotation = {A bilingual edition of Cicero's \emph{De natura deorum}, with         a German translation. Note the format of the \texttt{language} field in         the database file, the concatenation of the \texttt{editor} and         \texttt{translator} fields, and the \texttt{afterword} field}     }          @book{aristotle:anima,       keywords = {primary},       hyphenation = {british},       author = {Aristotle},       editor = {Hicks, Robert Drew},       title = {De Anima},       publisher = cup,       location = {Cambridge},       date = {1907},       annotation = {A \texttt{book} entry with an \texttt{author} and an         \texttt{editor}}     }     \end{filecontents}          \addbibresource{\jobname.bib}          \begin{document}          \nocite{*}          \printbibliography          \end{document}      Is there another command that I can use for this?


title: Duplication of citation labels in amsrefs with shortalphabetic option

text: I'm having a problem with the citation labels automatically produced by `amsrefs` package when used with `shortalphabetic` option. Suppose that I have two authors with the same last name initial, say `Aaa` and `Abc`:               \documentclass{article}     \usepackage[shortalphabetic]{amsrefs}     \begin{document}     \begin{biblist}     \bib{a}{article}{     author={Aaa}     }     \bib{b}{article}{     author={Abc}     }     \end{biblist}     \end{document}      This correctly produces labels `[A1]` and `[A2]`. However, a problem occurs when author `Aaa` has another article with coauthor `Bbb`:               \documentclass{article}     \usepackage[shortalphabetic]{amsrefs}     \begin{document}     \begin{biblist}     \bib{a}{article}{     author={Aaa}     }     \bib{c}{article}{     author={Aaa},     author={Bbb}     }     \bib{b}{article}{     author={Abc}     }     \end{biblist}     \end{document}      The labels produced are `[A]`, `[AB]`, `[A]`. This seems like a bug. Am I doing something wrong? If it is a bug, is there a way to manually specify the citation label? (The amsrefs package I'm using was packaged on 2010-08-30 according to MiKTeX package manager, is there a newer version?)


title: Horizontal line of custom length like an —

text: Is there a way to get a custom-length horizontal line that appears like a "longer em-dash", if you will?


title: Changing computer modern font size?

text: Can you change the size of computer modern? In a beamer presentation? And, in the article class, why can't it never go over 12pt?


title: fbox in tabular throws missing endgroup

text: I have to draw a border around my tables, so I'm using `\fbox{}` (is there a better way?). It works when using a `threeparttable` but with the normal `tabular` latex throws an error stating               Missing \endgroup inserted      I have closed the curly brackets. What am I missing? I've found the post booktabs and tiny horizontal space where it seems to work. See the code below:               \begin{table}[h]     \fbox{     \centering\caption{\textbf{blabla 1}}     \begin{tabular*}{0.9\columnwidth}{@{\extracolsep{\fill}}lc}     \toprule      \textbf{SF-36 Parameter} & \textbf{Mittelwert (SD)}\tabularnewline     \midrule     \midrule      Körperliche Funktionsfähigkeit & 56,5 (33,6)\tabularnewline     \midrule      Psychisches Wohlbefinden & 70,7 (17,8)\tabularnewline     \bottomrule     \end{tabular*}     }     \end{table}


title: KOMA-Script scrreprt: How to add Appendix for each Part section

text: **EDIT (SOLVED)** The below answer by LaRiFaRi successfully allowed me to introduce appendicies where desired, however they have a serious issue with the minitoc. After the first appendix the next chapter loses its minitoc. This does not happen if the appendix is included as `\appendix` however this does cause every successive chapter to be an appendix (unless there is a known way to stop this command?). Please could you help fix the interaction between the two? The updated MWE from the original one is included at the bottom of this post. **Original post** I have subdivided my thesis into several parts since they are based on different methods employed. To make things more readable and light I want to move certain common information within each part to an appendix. How can I insert appendices that show up just at the end of the part section rather than at the end of the entire document? I know I could add a chapter rather than an appendix for this, however an appendix makes much more sense. Please find my MWE below with my customised chapter heading style with a TOC, Part and Chapter.               \documentclass[     bibliography=totoc,     headings=big,     captions=tableheading,     chapterprefix=true% like in standard class "report"     ]{scrreprt}     \usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}     \usepackage{xcolor}     \usepackage{graphicx}     \usepackage{minitoc}     \usepackage{setspace}     \usepackage{lmodern}          \setcounter{secnumdepth}{3} % number subsubsections     \setcounter{tocdepth}{3} % list subsubsections          \begin{document}     \dominitoc     \tableofcontents          \addtokomafont{chapterprefix}{\raggedleft}     \addtokomafont{chapter}{\fontsize{30}{38}\selectfont}     \addtokomafont{section}{\huge}     \addtokomafont{subsection}{\Large}     \addtokomafont{subsubsection}{\large}          \renewcommand*{\chapterformat}{%     \mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%     \scalebox{4}{\color{gray}\thechapter}\enskip}}          \setcounter{chapter}{6}\setcounter{page}{199}     \newpage\setcounter{page}{212}          \part{Introduction}          \chapter{Conclusions}     \dictum[Sun Tzu]{If you know the enemy and you know yourself %\\     you need not fear the results of a hundred battles.}          \minitoc                    \section{Summary of Achievements}     Text goes here          \subsection{Papers Submitted}     Text          \subsubsection{I want to go into the TOC}     Testing stuff out          \bibliographystyle{plain}     \bibliography{bibliography}          \end{document}       **UPDATED MWE**               \documentclass[     bibliography=totoc,     headings=big,     captions=tableheading,     chapterprefix=true% like in standard class "report"     ]{scrreprt}     \usepackage[left=2cm,right=2cm,top=2.5cm,bottom=3cm]{geometry}     \usepackage{xcolor}     \usepackage{graphicx}     \usepackage{minitoc}     \usepackage{setspace}     \usepackage{lmodern}     \usepackage[toc]{appendix}          \setcounter{secnumdepth}{3} % number subsubsections     \setcounter{tocdepth}{3} % list subsubsections          \begin{document}     \dominitoc     \tableofcontents          \addtokomafont{chapterprefix}{\raggedleft}     \addtokomafont{chapter}{\fontsize{30}{38}\selectfont}     \addtokomafont{section}{\huge}     \addtokomafont{subsection}{\Large}     \addtokomafont{subsubsection}{\large}          \renewcommand*{\chapterformat}{%     \mbox{\scalebox{1.5}{\chapappifchapterprefix{\nobreakspace}}%     \scalebox{4}{\color{gray}\thechapter}\enskip}}          \setcounter{chapter}{6}\setcounter{page}{199}     \newpage\setcounter{page}{212}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \part{Introduction}          %%%%%%%%%%%%%%%%%%%%     \chapter{Conclusions}     \dictum[Sun Tzu]{If you know the enemy and you know yourself %\\     you need not fear the results of a hundred battles.}          \minitoc          \section{Summary of Achievements}     Text goes here          \subsection{Papers Submitted}     Text          \subsubsection{I want to go into the TOC}     Testing stuff out               %%%%% APPENDIX     \begin{appendices}          \chapter{Some Appendix}     The contents...     \end{appendices}               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     \part{Introduction}          %%%%%%%%%%%%%%%%%%%%     \chapter{The No MiniTOC Chapter}     \dictum[Sun Tzu]{If you know the enemy and you know yourself %\\     you need not fear the results of a hundred battles.}          \minitoc          \section{Unfortunate Problems}     This chapter does not have a minitoc for some reason          \subsection{Still no minitoc}     Text          \subsubsection{I want to go into the TOC}     Testing stuff out          %%%%%%%%%%%%%%%%%%%%     \chapter{Conclusions}     \dictum[Sun Tzu]{If you know the enemy and you know yourself %\\     you need not fear the results of a hundred battles.}          \minitoc          \section{Summary of Achievements}     Text goes here          \subsection{Papers Submitted}     Text                    \bibliographystyle{plain}     \bibliography{bibliography}          \end{document}


title: Undefined control sequence error in \cite when compiling

text: This is the start of the .tex file :               \documentclass{llncs}       \newcommand{\modelName}{ABC}  %This is the name of the model       \title{XYZ}       \begin{document}          \section{Introduction}            Believable non-playable characters are critical to creating an immersive character-rich game world whether it is for entertainment or training \cite{reilly1996believable}.          \bibliographystyle{splncs}     \bibliography{aiide2014mx}      I am getting the following error with the above line. If anyone has any idea about this it would be really helpful! I do have the entry for the citation in the bib file. So I am not sure why I am getting this error.               ! Undefined control sequence.     \b@reilly1996believable ->\citeauthoryear     {Reilly}{1996}     l.90 ...nt or training \cite{reilly1996believable}     . Emotionally plausible ch...     The control sequence at the end of the top line     of your error message was never \def'ed. If you have     misspelled it (e.g., `\hobx'), type `I' and the correct     spelling (e.g., `I\hbox'). Otherwise just continue,     and I'll forget about whatever was undefined.      The .bib file is:               @techreport{reilly1996believable,     Author = {Reilly, W Scott},     Date-Added = {2014-05-13 05:53:57 +0000},     Date-Modified = {2014-05-13 05:53:57 +0000},     Institution = {Defense Technical Information Center (DTIC) Document},     Title = {{Believable Social and Emotional Agents.}},     Year = {1996}}


title: Second optional input to \chapter to rename bookmark

text: I would like to include a second optional argument in `\chapter`'s definition to be able to give the bookmark a name different from the one displayed on the toc. The reason for this is that on the toc sub- and superscripts can be typeset, whereas this is not possible in the bookmarks. This is my work-around               \documentclass{report}     \usepackage{hyperref,bookmark}     \usepackage{ifthen,twoopt}          \def\whyIsThisNeeded{       \let\origchap\chapter       \let\origsec\section            \renewcommandtwoopt\chapter[3][toc][bm]{         \hypersetup{bookmarksdepth=-2}         \ifthenelse{\equal{##1}{toc}}{\def\ontoc{##3}}{\def\ontoc{##1}}         \ifthenelse{\equal{##2}{bm}}{\def\inbm{##3}}{\def\inbm{##2}}              \origchap[\ontoc]{##3}         \phantomsection\pdfbookmark[0]{\inbm}{\inbm}         \hypersetup{bookmarksdepth=2}         }       \renewcommandtwoopt\section[3][toc][bm]{         \hypersetup{bookmarksdepth=-2}         \ifthenelse{\equal{##1}{toc}}{\def\ontoc{##3}}{\def\ontoc{##1}}         \ifthenelse{\equal{##2}{bm}}{\def\inbm{##3}}{\def\inbm{##2}}              \origsec[\ontoc]{##3}         \phantomsection\pdfbookmark[1]{\inbm}{\inbm}         \hypersetup{bookmarksdepth=2}         }     }          \begin{document}     \tableofcontents     \whyIsThisNeeded     \chapter[1st chapter on toc][chapter 1]{first chapter in document}     \section[section on toc][section bookmark]{section in doc}     \chapter[2nd chapter on toc][chapter 2]{second chapter in document}     \end{document}      and it does exactly what I want, however   1. Why is `\whyIsThisNeeded` needed?   2. How can I query the previous 'bookmarksdepth' and reset it afterwards?   3. Do I really need to redefine all `\chapter\section\sub...` commands individually?   4. How can I define the command in the form of `\chapter[toc-name]{doc-name}[bm-name]`?


title: pgflayer: background and foreground and tikz: pattern for water

text: I am attempting to draw a barrel floating in water. I am trying to use `pgfonlayer` so that when the water line intersects the barrel, the line will be removed. Also, I looked through small section in the manual on patterns, but I couldn't find a suitable pattern for water. Here is the image I am trying to re-create: ![enter image description here](http://i.stack.imgur.com/q8o3h.jpg) Here is the code I have and the image:               \documentclass[tikz]{standalone}     \usetikzlibrary{patterns}          \pgfdeclarelayer{background}     \pgfdeclarelayer{foreground}     \pgfsetlayers{background,foreground}          \begin{document}     \begin{tikzpicture}       \begin{pgfonlayer}{foreground}         % draw a barrel         \draw (0, 0) ellipse[x radius = 1.5cm, y radius = 0.5cm]         coordinate (B) at (-1.5cm, 0) coordinate (A) at (1.5cm, 0);         \draw[dashed] (-1.5cm, -1cm) arc[x radius = 1.5cm, y radius = 0.5cm,         start angle = 180, end angle = 360];         \draw[dashed] (-1.5cm, -1.1cm) arc[x radius = 1.5cm, y radius = 0.5cm,         start angle = 180, end angle = 360];         \draw[dashed] (-1.5cm, -2cm) arc[x radius = 1.5cm, y radius = 0.5cm,         start angle = 180, end angle = 360];         \draw[dashed] (-1.5cm, -2.1cm) arc[x radius = 1.5cm, y radius = 0.5cm,         start angle = 180, end angle = 360];         \draw (-1.5cm, -3cm) coordinate (C) arc[x radius = 1.5cm, y radius = 0.5cm,         start angle = 180, end angle = 360] coordinate (D);         \draw (A) -- (D);         \draw (B) -- (C);              % draw the direction of the W = mg         \fill[black] (0, -1.85cm) coordinate (W) circle[radius = 0.025cm];         \draw[-stealth] (W) -- ++(0, -0.35cm) node[right, font = \scriptsize] {$mg$};              % draw the barrel dimensions         \begin{scope}[>=stealth]           \draw[|<->|] (-1.5cm, 1cm) -- ++(3cm, 0) node[pos = 0.5,           fill = white, font = \scriptsize, inner sep = 0.05cm] {$d$};           \draw[|<->|] (-2cm, 0cm) -- ++(0, -3.5cm) node[pos = 0.5,           fill = white, font = \scriptsize, inner sep = 0.05cm] {$\ell$};         \end{scope}       \end{pgfonlayer}            % draw the water       \begin{pgfonlayer}{background}         \draw (-2.5cm, -1.5cm) -- ++(7cm, 0);       \end{pgfonlayer}     \end{tikzpicture}     \end{document}      ![enter image description here](http://i.stack.imgur.com/O2YRS.png)


title: LuaLaTeX: mkluatexfontdb does not include Type-1-fonts ( = *.pfb-files)

text: I'm running texlive 2011 on a Linux machine. Years ago I bought some Type 1 fonts, namely Rotis. They have been installed properly and Libre Office e.g. can print them. But running `mkluatexfontdb -v > fontlog` logs no Rotis, under whatever name. No `*.pfb` file neither. So how do I use those Type 1 fonts under LuaLaTeX? I checked the `fontspec`-manual, but no hint.


title: How to specify a direct color in a tikz picture

text: I want to model gradients in TikZ for a paper covering color gradients. These are rather special, so a cannot rely on a TikZ shade alone. Thus, I want to model the gradient using consecutive TikZ shaded rectangles, like this:               \documentclass{article}     \usepackage{graphicx}     \usepackage{xcolor}     \usepackage{tikz}     \begin{document}     \begin{figure}[!h]     \begin{tikzpicture}\shade[left color=red,right color=gray]       (1.211,0.000) rectangle (0.211,1.000);     \end{tikzpicture}     \end{figure}     \end{document}      However, instead of red and blue I need an RGB color triplet as common in HTML. As per `xcolor` manual 2.3.3, I figured               \shade[left color=rgb,300:red,51;green,41;blue,5,right color=rgb,300:red,50;green,38;blue,0]      might do the job, but I get `! Package xcolor Error: Undefined color `rgb'.` It is feasibe but really awkward to pregenerate all the colors I need. Is it possible to use `xcolor` direct colors in a TikZ shade? all the examples I came across either use definecolor (even for HTML colors) or named colors. Any pointers are appreciated.


title: Fix sized centered multirow and multicolumn tables

text: I'm using TeXLive 2011, and one of my friends has a problem with creating tables, which use fix sized centered `\multirow` and `\multicolumn` cells. This is his thesis, so there is a lot of ignorable code in the following minimal working example, but I'm not sure.               \documentclass[11pt,titlepage,oneside,fleqn]{report}     \usepackage[a4paper,right=1.0in,left=1.0in]{geometry}     \usepackage[utf8]{inputenc}     \usepackage[magyar]{babel}     \usepackage{ifthen}     \usepackage{graphicx}     \usepackage{fancyhdr}     \usepackage{amssymb}     \usepackage{indentfirst}     \usepackage{setspace}     \usepackage{changepage}     \usepackage{textcomp}     \usepackage[version=3]{mhchem}     \usepackage{tipa}     \usepackage{array}     \usepackage{tikz}     \usetikzlibrary{decorations.pathmorphing}     \usepackage{chemfig}     \usepackage{longtable}     \usepackage{xtab}     \usepackage{subfig}     \usepackage{multirow}     \usepackage{fmtcount}     \interfootnotelinepenalty=10000     \linespread{1.3}     \setcounter{secnumdepth}{4}     \setcounter{tocdepth}{4}          \hyphenation{ImageJ}          \frenchspacing     \sloppy          \newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}     \def\makebraces[#1,#2]#3#4#5{%     \edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%     \edef\delimvshift{\the\dimexpr(#1-#2)/2}%     \chemmove{%     \node[at=(#4),yshift=(\delimvshift)]     {$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim     width0pt\right.$};%     \node[at=(#5),yshift=(\delimvshift)]     {$\left.\vrule height\delimhalfdim depth\delimhalfdim     width0pt\right\delimright_{\rlap{$\scriptstyle#3$}}$};}}          \newcommand{\superscript}[1]{\ensuremath{^{\textrm{#1}}}}     \newcommand{\subscript}[1]{\ensuremath{_{\textrm{#1}}}}          \begin{document}          \makeatletter     \renewcommand{\@makechapterhead}[1]{%     \vspace*{50 pt}%     {\setlength{\parindent}{0pt} \raggedright \normalfont     \bfseries\Huge\thechapter.\ #1     \par\nobreak\vspace{40 pt}}}     \makeatother          \begin{table}[h]     \hspace{-1,25cm}     \begin{tabular}{>{\centering\arraybackslash}m{2cm} >{\centering\arraybackslash}m{3cm} >{\centering\arraybackslash}m{2cm} >{\centering\arraybackslash}m{4cm} >{\centering\arraybackslash}m{4cm}}     \hline     \noalign{\smallskip}     \multirow{3}{*}{A brmfe juiodondf} & \multicolumn{2}{c}{Az előkezelt otijgfni} & \multirow{3}{*}{A oighderinir, iufbdgkfddf and zxdbviid7ud uibuofvdt water dfubu} & \multirow{3}{*}{Absorbance 550~nm (liquid shit)}\\\noalign{\smallskip}     \cline{2-3} \noalign{\smallskip}     & what & whatever &  &\\\noalign{\smallskip}     \cline{2-3} \noalign{\smallskip}     & \multicolumn{2}{c}{something}\\     \noalign{\smallskip}     \hline     \noalign{\smallskip}     x & 0,71g & 0,0360g & 15ml & 0,4\\\noalign{\smallskip}     y & 0,11g & 0,0146g & 15ml & 0,26\\\noalign{\smallskip}     z & 0,47g & 0,0527g & 16ml & 0,5\\\noalign{\smallskip}     \multicolumn{4}{l}{again some} & 0,537\\\noalign{\smallskip}     \multicolumn{4}{l}{bullshit} & 0,456\\     \noalign{\smallskip}     \hline     \end{tabular}     \caption{Beautiful table}     \end{table}          \end{document}      ![enter image description here](http://i.stack.imgur.com/AQcHT.png)


title: Customized Table of Contents APA style

text: I am trying to produce the Table of Contents same as shown in Picture separately. Is there any template for this? I just have "Table of Contents" but no document attached with it.![enter image description here](http://i.stack.imgur.com/EVdpm.jpg) My problems for this Stack exchange template are:   1. Instead of "Contents" on the top I want "TABLE OF CONTENTS"   2. I do not want "Acknowledgement" and "List of Table" listed as section but want as shown in picture attached.   3. I want to manually control the page listing as in my code you can see all of page numbers are 2 but I want them as attached in picture. minimal example:               \documentclass{article}     \setcounter{secnumdepth}{5}     \setcounter{tocdepth}{5}     \usepackage{titlesec}          \titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection.}{1em}{}     \titleformat{\subsubsection}{\normalfont\normalsize\bfseries}{\thesubsubsection)}{1em}{}     \titleformat{\paragraph}[runin]{\normalfont\normalsize\bfseries}{\theparagraph)}{1em}{}     \titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries}{\thesubparagraph)}{1em}{}          \usepackage{tocloft}          \setlength{\cftsecnumwidth}{1em}     \setlength{\cftsubsecnumwidth}{2em}     \setlength{\cftsubsubsecnumwidth}{2.5em}     \setlength{\cftparanumwidth}{3.8em}     \setlength{\cftsubparanumwidth}{3.8em}          \setlength{\cftsecindent}{0em}     \setlength{\cftsubsecindent}{1.8em}     \setlength{\cftsubsubsecindent}{4.1em}     \setlength{\cftparaindent}{5.9em}     \setlength{\cftsubparaindent}{7.7em}          \begin{document}          \tableofcontents          \section{ACKNOWLEDGMENTS}     \section{LIST OF TABLES}     \section{Introduction}     \subsection{Background}     \subsection{Evolution of Missing Data Estimation Method}     \subsection{Missing Data Mechanism}     \subsubsection{Missing Completely at Random}     \subsubsection{Missing at Random}     \subsubsection{Missing not at Random}          \end{document}


title: Why \hyperlink{\rightmark}{} does not work in fancyhead (and inside some other macros)?

text: \fancyhead[LO,RE]{\hyperlink{\rightmark}{\bfseries\rightmark}}      (`\leftmark` is all the same) cause error:               TeX capacity exceeded, sorry [input stack size...      Why? (here, `\rightmark` has double function: the name and text argument of hyperlink (actually it is the full name of a section (e.g. 1.2 mysection) by which a hypertarget was created before inside `\section{...}` macro.) Here is a siple working code. My idea is to have chapter and section names automatically hyperlinked in header. This code works but if you uncomment `\usepackage[]{babel}` it produces the problematic error. * * *               \documentclass[pdftex,a4paper,12pt,oneside]{book}%          %\usepackage[magyar,english]{babel}     \usepackage{fancyhdr}     \usepackage{xifthen}     \usepackage{xstring}     \usepackage{hyperref}     \hypersetup{colorlinks,                       linktoc=all,                     hypertexnames=false,                     unicode=true,                     bookmarksnumbered=false,                 pdfmenubar=true,                   pdftoolbar=true}          %------- Chapter link ------------     \newcommand{\chapterlink}[1]{\addtocounter{chapter}{1}\hypertarget{\thechapter\ #1}{}\addtocounter{chapter}{-1}}     \newcommand{\Chapter}[2][]{\chapterlink{#2}\ifthenelse{\equal{#1}{}}{\chapter{#2}}{\chapter{#1}{#2}}}          %------- Section link ------------     \newcommand{\sectionlink}[1]{\addtocounter{section}{1}\hypertarget{\thesection\ #1}{}\addtocounter{section}{-1}}     \newcommand{\Section}[2][]{\sectionlink{#2}\ifthenelse{\equal{#1}{}}{\section{#2}}{\section{#1}{#2}}}                      \newcommand{\mainheader}                 {                     \pagestyle{fancy}                     \fancyhf{}                      \renewcommand{\chaptermark}[1]{\markboth{\thechapter\ ##1}{}}                     \renewcommand{\sectionmark}[1]{\markright{\thesection\ ##1}}                           \fancyhead[LO,RE]{\hyperlink{\leftmark}{\bfseries\StrBehind{\leftmark}{\ }}\ :\ \hyperlink{\rightmark}{\bfseries\StrBehind{\rightmark}{\ }}}                            \fancyhead[LE,RO]{\bfseries\thepage}                     \renewcommand{\headrulewidth}{0.5pt}                     \renewcommand{\footrulewidth}{0pt}                     \addtolength{\headheight}{2.5pt}                      \fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}                  }          %-----------------------------------          \begin{document}          \mainheader          \Chapter{Chapter one}          chapter text chapter text chapter text chapter text chapter text chapter text           \newpage          \Section{Section one}          section text section text section text section text section text section text           \newpage          section text section text section text section text section text section text           \end{document}      * * * Investigating the meaning of the macro `\rightmark` I have found the follwing: `macro:->\expandafter \@rightmark \firstmark \@empty \@empty` So I had a look into `\firstmark` without `\usepackage[magyar]{babel}`: `{1:Chapter-One}{3:Section-One}` %1 and 3 are my private counter values to be unique id-s in hyperlink, text is chapter name and section name with `\usepackage[magyar]{babel}`: `{\protect \foreignlanguage {magyar}{\protect \bbl@restore@actives 1:Chapter-One}}{\protect \foreignlanguage {magyar}{\protect \bbl@restore@actives 3:Section-One}}` Surely not fully expandable :) But this investigation gives me the clue to solve my problem. \meaning\firstmark can be parsed and split into substrings to get that part of the text that I wanted to use to be \hyperlink name and text. (If anybody like to see the whole MWE I readyly show it.)


title: Emacs23 and pdflatex

text: I use emacs23 in my laptop (Ubuntu). I would like to obtain a PDF file with pdflatex. But I don't know how to do. I am a beginner in using emacs23.


title: Adding a photo on top corner of a two column CV template

text: How can I add a photo on the top right/left corners to this CV Template ? http://www.latextemplates.com/template/two-column-one-page-cv I tried to use variants of the following code to insert the photo on right top corner after moving the name to the left side:               \begin{figure}[t]     \begin{flushright}     \includegraphics[width=4cm,height=5cm]{photo.jpg}     \end{flushright}     \end{figure}      I have two problems: 1- The photo is always at the center 2- The rest of the template (in a minipage environment) moves to a new page


title: Force equation number to be right aligned

text: I'm trying to typeset some basic equations with proper numbering. I simply want a single equation to have a right aligned number in the two column environment that I'm using. I tried three approaches, but none was satisfactory. I tried the regular `equation` environment, which produced a number on the next line; the `\mbox` approach which put the number directly next to the equation (could modify with some `\;` padding); and the `align` environment which produced no number. Specifically, I have the following               \documentclass[10pt,twocolumn]{article}     \usepackage{amsmath}          \begin{document}     \begin{equation} \label{NPV}          \textit{NPV}_{System} = P_d+&P_{a}Y\left(\frac{1}{1+r},N\right)+C_cf_{OM}Y\left(\frac{1+i}{1+r},L\right)          \end{equation}          \begin{equation} \label{NPV}          \mbox{\textit{NPV}_{System} = P_d+&P_{a}Y\left(\frac{1}{1+r},N\right)+C_cf_{OM}Y\left(\frac{1+i}{1+r},L\right)}          \end{equation}          \begin{align} \label{NPV}          \mbox{\textit{NPV}_{System} = P_d+&P_{a}Y\left(\frac{1}{1+r},N\right)+C_cf_{OM}Y\left(\frac{1+i}{1+r},L\right)}          \end{align}          \end{document}      A few questions.   1. How does LaTeX determine the spacing and when to break the line (first example)?    2. Is there a way to use `\mbox` to right align and not just "keep together".    3. Why does `\align` not produce an equation number in this instance? Some background: I'm using TeXnicCenter with LuaLaTeX though I get similar results using XeLaTeX.


title: Automatic numbering of nested environments / items

text: I would like to have an environment, let's call it `nested`, which produces output like               Case 1: top level item 1     Case 2: top level item 2     Case 2.1: nested item 1     Case 2.2: nested item 2     Case 2.2.1: even nestier item 1     Case 2.3: just nested again     Case 3: and toplevel to top it off      from code that _either_ looks like nested `enumerate`'s, i.e.               \begin{nested}     \item top level item 1     \item top level item 2           \begin{nested}           \item nested item 1           \item nested item 2                 \begin{nested}                 \item even nestier item 1                 \end{nested}           \item just nested again           \end{nested}     \item and toplevel to top it off     \end{nested}      or from code that looks, well, like nested environments:               \begin{nested} top level item 1 \end{nested}     \begin{nested} top level item 2          \begin{nested} nested item 1 \end{nested}         \begin{nested} nested item 2                  \begin{nested} even nestier item 1 \end{nested}         \end{nested}         \begin{nested} just nested again \end{nested}     \end{nested}     \begin{nested} and toplevel to top it off \end{nested}      In fact, I don't much care how the code has to look at all, as long as the numbering on the cases is done automatically. I tried to implement both of the above, however, and I could not figure it out at all. Is there a way to achieve this?


title: Centering table column titles above comma-aligned numbers

text: I am trying to make the following table look nice. With that I want the title to be centered horizontally, and the numbers to be alligned at comma. Here is how it looks now: ![Table](http://i.stack.imgur.com/vj8n5.png) And my code.               \documentclass[11pt,a4paper]{article}       % Alternativet er å bruke {report}, men vi holder oss helst til {article} i labrapportene.     \usepackage{booktabs}       \usepackage[norsk]{babel}     \usepackage{color}     \usepackage{graphicx}      \usepackage{siunitx}          \sisetup{     table-number-alignment = right,     }          \begin{document}          \begin{table}[h!tb]         \centering             \caption{beregnede og målte verdier av magnetfeltet $B$ på aksen til en kort spole s,f.a. avstanden $x$ fra spolens midtplan.}             \vspace{0.5cm}                      % Litt ekstra plass for å få det til å se penere ut.             \label{Tabell2}\resizebox{15cm}{!}{             \begin{tabular}{@{}*{10}{r@{}}}                  \toprule                        % Horisontal linje.     &     \multicolumn{1}{p{1cm}}{\centering {\color{white}|}\vspace*{-0.3cm} \newline \hspace*{0.1cm} $x$     \newline ($m$) }                   &         \multicolumn{1}{p{2cm}}{\centering $a=2R$ \newline \hspace*{0.05cm} Beregnet   \newline \hspace*{0.3cm}  $B_1$       \newline (gauss)}  &        \multicolumn{1}{p{2cm}}{\centering $a= R$ \newline \hspace*{0.15cm} Beregnet   \newline \hspace*{0.25cm} $B_1$       \newline (gauss)}  &     \multicolumn{1}{p{2cm}}{\centering $a=R/2$\newline \hspace*{0.15cm} Beregnet   \newline \hspace*{0.25cm} $B_1$       \newline (gauss)}  &         \multicolumn{1}{p{2cm}}{\centering $a=2R$ \newline \hspace*{0.05cm} Målt       \newline \hspace*{0.1cm}  $B_2$       \newline (gauss)}  &     \multicolumn{1}{p{2cm}}{\centering $a=2R$ \newline \hspace*{0.05cm} Differanse \newline \hspace*{0.1cm}  $B_2 - B_1$ \newline (\%}      &     \multicolumn{1}{p{2cm}}{\centering $a= R$ \newline \hspace*{0.05cm} Målt \newline\hspace*{0.1cm}  $B_2$ \newline (prosent)}             &     \multicolumn{1}{p{2cm}}{\centering $a= R$ \newline \hspace*{0.05cm} Differanse \newline\hspace*{0.1cm}  $B_2 - B_1$ \newline (\%)}      &      \multicolumn{1}{p{2cm}}{\centering $a=R/2$\newline \hspace*{0.05cm} Målt \newline\hspace*{0.1cm}  $B_2$ \newline (prosent)}             &     \multicolumn{1}{p{2cm}}{\centering $a=R/2$\newline \hspace*{0.05cm} Differanse \newline\hspace*{0.1cm}  $B_2 - B_1$ \newline (\%)}       \\                   \midrule                                               -0,18   &  5,265    &  3,365    &  2,981    &  5,31     &  0,864    &  3,34     & -0,743    &  3,01     &  0,959 \\     -0,16   &  7,725    &  4,667    &  4,057    &  7,77     &  0,584    &  4,60     & -1,439    &  4,08     &  0,559 \\     -0,14   & 11,595    &  6,666    &  5,675    & 11,61     &  0,131    &  6,58     & -1,293    &  5,68     &  0,084 \\     -0,12   & 17,398    &  9,797    &  8,175    & 17,48     &  0,470    &  9,62     & -1,811    &  8,17     & -0,061 \\     -0,10   & 24,796    & 14,694    & 12,114    & 24,71     & -0,345    & 14,35     & -2,338    & 12,04     & -0,607 \\     -0,08   & 30,955    & 21,937    & 18,306    & 30,82     & -0,436    & 21,46     & -2,175    & 18,10     & -1,125 \\     -0,06   & 31,701    & 30,981    & 27,529    & 31,61     & -0,288    & 30,59     & -1,262    & 27,27     & -0,940 \\     -0,04   & 27,387    & 38,714    & 39,223    & 27,42     &  0,121    & 38,68     & -0,088    & 38,99     & -0,595 \\     -0,02   & 22,688    & 41,914    & 49,688    & 22,67     & -0,080    & 42,49     &  1,375    & 49,85     &  0,326 \\      0,00   & 20,852    & 42,202    & 53,852    & 20,74     & -0,538    & 43,00     &  1,892    & 54,31     &  0,850 \\      0,02   & 22,688    & 41,914    & 49,688    & 22,49     & -0,873    & 42,46     &  1,303    & 50,04     &  0,708 \\      0,04   & 27,387    & 38,714    & 39,223    & 27,00     & -1,412    & 39,01     &  0,764    & 39,36     &  0,349 \\      0,06   & 31,701    & 30,981    & 27,529    & 31,42     & -0,887    & 31,16     &  0,578    & 27,63     &  0,368 \\      0,08   & 30,955    & 21,937    & 18,306    & 31,00     &  0,145    & 22,06     &  0,560    & 18,41     &  0,568 \\      0,10   & 24,796    & 14,694    & 12,114    & 25,13     &  1,348    & 14,88     &  1,269    & 12,15     &  0,301 \\      0,12   & 17,398    &  9,797    &  8,175    & 17,83     &  2,482    &  9,89     &  0,945    &  8,26     &  1,040 \\      0,14   & 11,595    &  6,666    &  5,675    & 11,91     &  2,718    &  6,77     &  1,558    &  5,74     &  1,141 \\      0,16   &  7,725    &  4,667    &  4,057    &  8,00     &  3,561    &  4,74     &  1,561    &  4,13     &  1,792 \\      0,18   &  5,265    &  3,365    &  2,981    &  5,39     &  2,384    &  3,45     &  2,526    &  3,04     &  1,965 \\                 \bottomrule             \end{tabular}}     \end{table}          \end{document      Yeah, it is not a pretty sight. I think I have tried every single mean I have to make it look good. Like using the `siunitx` package and so on. So yeah, any help in making this table look good is greatly appreciated. My main problem and question is how to make the title be centered above the numbers, and having the numbers align at comma / alligned to the right


title: Removing TeX fonts from being system-wide

text: After reading XeTeX can't find font I executed               sudo cp $(kpsewhich --var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf     sudo fc-cache -fsv      I am now trying out MathJax and I find that I need to remove the TeX fonts that were made system-wide so that I can test meaningfully. Is there any way to reverse the above process using the CLI? FYI, I am on a Ubuntu 11.10 64-bit system running TeX Live 2011.